summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/docg3.h
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2011-11-19 16:02:58 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 18:07:30 +0000
commit0f769d3f9e2ef3e88930ff190a20cfbfe6206d3a (patch)
tree7317d7e8beeae37c550a875835dcbf3dc1c7af32 /drivers/mtd/devices/docg3.h
parentc3de8a8a5a28603f8d318245992dbcda2e88a007 (diff)
downloadop-kernel-dev-0f769d3f9e2ef3e88930ff190a20cfbfe6206d3a.zip
op-kernel-dev-0f769d3f9e2ef3e88930ff190a20cfbfe6206d3a.tar.gz
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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mtd/devices/docg3.h b/drivers/mtd/devices/docg3.h
index 07182f9..a349915 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
OpenPOWER on IntegriCloud