summaryrefslogtreecommitdiff
path: root/board/isee/common/igep_test.h
diff options
context:
space:
mode:
Diffstat (limited to 'board/isee/common/igep_test.h')
-rw-r--r--board/isee/common/igep_test.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/board/isee/common/igep_test.h b/board/isee/common/igep_test.h
new file mode 100644
index 0000000..30aa0a2
--- /dev/null
+++ b/board/isee/common/igep_test.h
@@ -0,0 +1,58 @@
+/* Header file for Test Functions to help header code */
+
+#ifndef __TEST_HEADER__
+#define __TEST_HEADER__
+
+/* Magics that are involved */
+#define SPL_MAGIC_ID 0xdadd
+#define UB_MAGIC_ID 0xbebb
+#define SPL_MAGIC_ID_COUNTER 0xdadadada
+#define UB_MAGIC_ID_COUNTER 0xbebabeba
+#define SPL_START_TEST_OFF 0
+#define UB_START_TEST_OFF 58
+#define EEPROM_TEST_STRUCT_OFF 116
+#define EEPROM_ISEE_BOARD_STRUCT_OFF 121
+#define SPL_TEST_COUNTER_OFF 126
+#define UB_TEST_COUNTER_OFF 127
+#define KNOWN_CRC_CUSTOM_1MB 0x1997c7c7
+
+#define KNOWN_CRC_CUSTOM_1MB_1 0x79f08ba2
+#define KNOWN_CRC_CUSTOM_1MB_2 0x177dfc20
+#define KNOWN_CRC_CUSTOM_1MB_3 0xa5be2ae0
+#define KNOWN_CRC_CUSTOM_1MB_4 0xa8ced8e3
+
+
+/* CRC PATTERNS FOR RAM TEST */
+#define CRC_PATTERN1 0x0000AAAA
+#define CRC_PATTERN2 0x00005555
+#define CRC_PATTERN3 0x0000CCCC
+#define CRC_PATTERN4 0x33330000
+#define CRC_PATTERN5 0x99990000
+#define CRC_PATTERN6 0x66660000
+
+/* Structs that are involved */
+/* SPL / UBOOT RESULT TEST STRUCT */
+struct __attribute__((packed)) igep_bootloaders_test {
+ u16 magic_id; /* SPL or uboot magic id for result of test struct*/
+ u16 test; /* Results of test */
+ uint64_t cpuid; /* CPU ID */
+ u32 crc32; /* CRC32 of the entire struct */
+};
+
+/* SPL / UBOOT COUNTER TEST STRUCT */
+struct __attribute__((packed)) igep_bootloaders_counter {
+ u32 magic_id; /* SPL or uboot magic id for counter test struct */
+ uint64_t count; /* Counter */
+ u32 crc32; /* CRC32 of the entire struct */
+};
+
+/* Functions that are involved */
+int test_eeprom(void);
+int burn_test(char* t, uint64_t count, int offset);
+int burn_test_counter(char* t2, int offset);
+int test_counter_check(int offset);
+uint64_t test_counter_get(int offset);
+int save_test(uint16_t test, uint32_t id, uint64_t cpuid);
+uint16_t load_test(uint32_t id);
+int erase_eeprom_counter (uint32_t id, int offset);
+#endif