aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2013-01-18 13:10:05 +0100
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-02-04 09:27:33 +0200
commit1648eaaa1575ea686acb82fb8cb3d8839764ef2c (patch)
tree7838db70e662d7c9db628ef4c6bafd3ad0d08d94 /drivers/mtd/maps
parent422f3890a68333cfd39f2133cf7255ed067e92e6 (diff)
downloadkernel_goldelico_gta04-1648eaaa1575ea686acb82fb8cb3d8839764ef2c.zip
kernel_goldelico_gta04-1648eaaa1575ea686acb82fb8cb3d8839764ef2c.tar.gz
kernel_goldelico_gta04-1648eaaa1575ea686acb82fb8cb3d8839764ef2c.tar.bz2
mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking
Currently cfi_cmdset_0002.c does not support PPB locking of sectors. This patch adds support for this locking/unlocking mechanism. It is needed on some platforms, since newer U-Boot versions do support this PPB locking and protect for example their environment sector(s) this way. This PPB locking/unlocking will be enabled for all devices supported by cfi_cmdset_0002 reporting 8 in the CFI word 0x49 (Sector Protect/Unprotect scheme). Please note that PPB locking does support sector-by-sector locking. But the whole chip can only be unlocked together. So unlocking one sector will automatically unlock all sectors of this device. Because of this chip limitation, the PPB unlocking function saves the current locking status of all sectors before unlocking the whole device. After unlocking the saved locking status is re-configured. This way only the addressed sectors will be unlocked. To selectively enable this advanced sector protection mechanism, the device-tree property "use-advanced-sector-protection" has been created. To enable support for this locking this property needs to be present in the flash DT node. E.g.: nor_flash@0,0 { compatible = "amd,s29gl256n", "cfi-flash"; bank-width = <2>; use-advanced-sector-protection; ... Tested with Spansion S29GL512S10THI and Micron JS28F512M29EWx flash devices. Signed-off-by: Stefan Roese <sr@denx.de> Tested-by: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/physmap_of.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 67cc73c..263d9e1 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -241,6 +241,7 @@ static int of_flash_probe(struct platform_device *dev)
info->list[i].map.phys = res.start;
info->list[i].map.size = res_size;
info->list[i].map.bankwidth = be32_to_cpup(width);
+ info->list[i].map.device_node = dp;
err = -ENOMEM;
info->list[i].map.virt = ioremap(info->list[i].map.phys,