summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Herzmann <thomas.herzmann@keymile.com>2011-05-12 19:59:22 +0000
committerWolfgang Denk <wd@denx.de>2011-05-18 23:02:55 +0200
commit92c91080e41b36146985fc6d5bf9d35bb162d034 (patch)
treeff8ce4222ede56c4dd8571af749f2ba7191acdc6 /include
parent96e0e7b36c5c335e7a551537f3a19dec0cd53356 (diff)
km/common: implement boardId HWkey checks as u-boot cmd
BoardId and HWKey are used to identify the HW class of a given board. The correct values are stored in the inventory eeprom. During creation time of a boot package the boardId and HWkey for the SW is stored in the default environment and burned into the flash. During boottime the values in the inventory and in the environment are compared to avoid starting of a SW which is not authorized for this board. Some bootpackages are allowed to run on a set of different boardId hwKey. In this case the environment variable boardIdListHex was added to the default environment. In this case the command iterates over the pair values and compares them with the values read from the inventory eeprom. The syntax of such a boardIdListHex value is e.g.: 158_1 159_1 159_2 Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com> Signed-off-by: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Acked-by: Heiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/configs/km/keymile-common.h30
1 files changed, 1 insertions, 29 deletions
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h
index e91f6c73d50..6a5ecc6d747 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -238,7 +238,6 @@
"release=" \
"setenv actual_bank ${initial_boot_bank} && " \
"setenv subbootcmds \"" \
- "checkboardidlist " \
"checkboardid " \
"ubiattach ubicopy " \
"cramfsloadfdt cramfsloadkernel " \
@@ -389,36 +388,9 @@
"default=" \
"setenv default 'run newenv; reset' && " \
"run release && saveenv; reset\0" \
- "checkboardidlist=" \
- "if test \"x${boardIdListHex}\" != \"x\"; then " \
- "IVMbidhwk=${IVM_BoardId}_${IVM_HWKey}; " \
- "found=0; " \
- "for bidhwk in \"${boardIdListHex}\"; do " \
- "echo trying $bidhwk ...; " \
- "if test \"x$bidhwk\" = \"x$IVMbidhwk\"; then " \
- "found=1; " \
- "echo match found for $bidhwk; " \
- "if test \"x$bidhwk\" != \"x${boardId}_${hwKey}\";then "\
- "setenv boardid ${IVM_BoardId}; " \
- "setenv boardId ${IVM_BoardId}; " \
- "setenv hwkey ${IVM_HWKey}; " \
- "setenv hwKey ${IVM_HWKey}; " \
- "echo \"boardId set to ${boardId}\"; " \
- "echo \"hwKey set to ${hwKey}\"; " \
- "saveenv; " \
- "fi; " \
- "fi; " \
- "done; " \
- "else " \
- "echo \"boardIdListHex not set, not checked\"; "\
- "found=1; " \
- "fi; " \
- "test \"$found\" = 1 \0" \
- "checkboardid=" \
- "test \"x${boardId}\" = \"x${IVM_BoardId}\" && " \
- "test \"x${hwKey}\" = \"x${IVM_HWKey}\"\0" \
"printbootargs=print bootargs\0" \
"rootfsfile="xstr(CONFIG_HOSTNAME) "/rootfsImage\0" \
+ "checkboardid=km_checkbidhwk\0" \
""
#ifndef CONFIG_KM_DEF_ENV