VPD ECC support
Added methods/interfaces to create ECC and verify the data using ECC
Tested: tested some of the EEPROMS on Rainier simics
root@rainier:/tmp# ./ipz-read-vpd --file /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0050/8-00500/nvmem
PASSED
root@rainier:/tmp# ./ipz-read-vpd --file /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a400.i2c-bus/i2c-7/7-0050/7-00500/nvmem
PASSED
root@rainier:/tmp# ./ipz-read-vpd --file /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0051/8-00510/nvmem
PASSED
root@rainier:/tmp# ./ipz-read-vpd --file /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a400.i2c-bus/i2c-7/7-0051/7-00510/nvmem
PASSED
root@rainier:/tmp# ./ipz-read-vpd --file /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a080.i2c-bus/i2c-0/0-0051/0-00510/nvmem
PASSED
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
Change-Id: I863327f504c2dfa468d5ceadce10250292a968b7
diff --git a/vpdecc/vpdecc_support.h b/vpdecc/vpdecc_support.h
new file mode 100644
index 0000000..6f71c03
--- /dev/null
+++ b/vpdecc/vpdecc_support.h
@@ -0,0 +1,45 @@
+#include "vpdecc.h"
+
+/******************************************************************************/
+unsigned char seepromGetEcc(const unsigned char* data);
+
+/******************************************************************************/
+/* seepromScramble */
+/******************************************************************************/
+
+int seepromScramble(const int bitOffset, const unsigned char* cleanData,
+ size_t cleanSize, unsigned char* scrambledData,
+ size_t scrambledSize);
+
+/******************************************************************************/
+/******************************************************************************/
+int seepromUnscramble(const int bitOffset, const unsigned char* scrambledData,
+ size_t scrambledSize, unsigned char* cleanData,
+ size_t cleanSize);
+
+/******************************************************************************/
+/******************************************************************************/
+void seepromGenCsDecode(const unsigned char numBits,
+ const unsigned char syndrom,
+ const unsigned char* csdSyndroms,
+ unsigned char* vResult);
+
+/******************************************************************************/
+/* seepromGenerateCheckSyndromDecode */
+/******************************************************************************/
+void seepromGenerateCheckSyndromDecode(const unsigned char checkSyndrom,
+ unsigned char* csdData,
+ unsigned char* csdEcc);
+
+/******************************************************************************/
+/******************************************************************************/
+int seepromEccCheck(unsigned char* vData, unsigned char* vEcc,
+ size_t numOfDataBytes);
+
+/******************************************************************************/
+/******************************************************************************/
+/*int seepromCheckData(unsigned char* seepromData);*/
+
+/******************************************************************************/
+/******************************************************************************/
+/*int seepromCreateEcc(unsigned char* seepromData);*/