summaryrefslogtreecommitdiffstats
path: root/pm49fl00x.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2014-08-03 13:05:34 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-08-03 13:05:34 +0000
commitef3ac8ac17eac9d2041ea9c9e711a9b059412b59 (patch)
treee5fec0cda5a546133a7440f65da442329ec3db48 /pm49fl00x.c
parent2a41f0a2c0daeb0ee2a38a252ab96135d70a6b81 (diff)
downloadast2050-flashrom-ef3ac8ac17eac9d2041ea9c9e711a9b059412b59.zip
ast2050-flashrom-ef3ac8ac17eac9d2041ea9c9e711a9b059412b59.tar.gz
Refactor unlocking of many chips with locking at register space address +2
This includes PMC Pm49*, SST 49LF00*, ST M50* and Winbond W39* families. The erase and write test status bits of all affected chips have been reset. Corresponding to flashrom svn r1833. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'pm49fl00x.c')
-rw-r--r--pm49fl00x.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/pm49fl00x.c b/pm49fl00x.c
deleted file mode 100644
index fe28d2b..0000000
--- a/pm49fl00x.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the flashrom project.
- *
- * Copyright (C) 2004 Tyan Corporation
- * Copyright (C) 2007 Nikolay Petukhov <nikolay.petukhov@gmail.com>
- * Copyright (C) 2007 Reinder E.N. de Haan <lb_reha@mveas.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "flash.h"
-
-static void write_lockbits_49fl00x(const struct flashctx *flash,
- unsigned int size, unsigned char bits,
- unsigned int block_size)
-{
- unsigned int i, left = size;
- chipaddr bios = flash->virtual_registers;
-
- for (i = 0; left >= block_size; i++, left -= block_size) {
- /* pm49fl002 */
- if (block_size == 16384 && i % 2)
- continue;
-
- chip_writeb(flash, bits, bios + (i * block_size) + 2);
- }
-}
-
-int unlock_49fl00x(struct flashctx *flash)
-{
- write_lockbits_49fl00x(flash, flash->chip->total_size * 1024, 0,
- flash->chip->page_size);
- return 0;
-}
-
-int lock_49fl00x(struct flashctx *flash)
-{
- write_lockbits_49fl00x(flash, flash->chip->total_size * 1024, 1,
- flash->chip->page_size);
- return 0;
-}
OpenPOWER on IntegriCloud