diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2011-11-19 16:02:58 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 19:07:30 +0100 |
commit | 0f769d3f9e2ef3e88930ff190a20cfbfe6206d3a (patch) | |
tree | 7317d7e8beeae37c550a875835dcbf3dc1c7af32 /drivers/mtd/devices/docg3.h | |
parent | mtd: docg3: add fast mode (diff) | |
download | linux-0f769d3f9e2ef3e88930ff190a20cfbfe6206d3a.tar.xz linux-0f769d3f9e2ef3e88930ff190a20cfbfe6206d3a.zip |
mtd: docg3: add protection areas sysfs access
As each docg3 chip has 2 protection areas (DPS0 and DPS1),
and because theses areas can prevent user access to the chip
data, add for each floor the sysfs entries which insert the
protection key into the right DPS.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com>
Reviewed-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices/docg3.h')
-rw-r--r-- | drivers/mtd/devices/docg3.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mtd/devices/docg3.h b/drivers/mtd/devices/docg3.h index 07182f9d484d..a349915da77d 100644 --- a/drivers/mtd/devices/docg3.h +++ b/drivers/mtd/devices/docg3.h @@ -118,6 +118,8 @@ #define DOC_BCH_SYNDROM(idx) (0x1048 + (idx << 0)) #define DOC_PROTECTION 0x1056 +#define DOC_DPS0_KEY 0x105c +#define DOC_DPS1_KEY 0x105e #define DOC_DPS0_ADDRLOW 0x1060 #define DOC_DPS0_ADDRHIGH 0x1062 #define DOC_DPS1_ADDRLOW 0x1064 @@ -252,6 +254,17 @@ #define DOC_PLANES_STATUS_PLANE0_KO 0x02 #define DOC_PLANES_STATUS_PLANE1_KO 0x04 +/* + * DPS key management + * + * Each floor of docg3 has 2 protection areas: DPS0 and DPS1. These areas span + * across block boundaries, and define whether these blocks can be read or + * written. + * The definition is dynamically stored in page 0 of blocks (2,3) for DPS0, and + * page 0 of blocks (4,5) for DPS1. + */ +#define DOC_LAYOUT_DPS_KEY_LENGTH 8 + /** * struct docg3 - DiskOnChip driver private data * @dev: the device currently under control |