Commit 0c331ebcc6843bb5e4e6727d1b4a13ef2284a5ab
Committed by
Tom Rini
1 parent
4ac32b9c4d
Exists in
v2017.01-smarct4x
and in
37 other branches
arm, am335x: siemens boards add FIT support
add FIT support and set "boardid" from factoryset records "DEV/id" and "COMP/ver". "boardid" is used for selecting which fit configuration gets booted on the board. Signed-off-by: Heiko Schocher <hs@denx.de>
Showing 8 changed files with 83 additions and 19 deletions Side-by-side Diff
board/siemens/common/board.c
... | ... | @@ -96,15 +96,6 @@ |
96 | 96 | return &dpll_ddr; |
97 | 97 | } |
98 | 98 | |
99 | -#ifdef CONFIG_BOARD_LATE_INIT | |
100 | -int board_late_init(void) | |
101 | -{ | |
102 | - omap_nand_switch_ecc(1, 8); | |
103 | - | |
104 | - return 0; | |
105 | -} | |
106 | -#endif | |
107 | - | |
108 | 99 | #ifndef CONFIG_SPL_BUILD |
109 | 100 | #if defined(BOARD_DFU_BUTTON_GPIO) |
110 | 101 | /* |
board/siemens/common/factoryset.c
... | ... | @@ -220,15 +220,6 @@ |
220 | 220 | printf("DFU USB: VID = 0x%4x, PID = 0x%4x\n", factory_dat.usb_vendor_id, |
221 | 221 | factory_dat.usb_product_id); |
222 | 222 | #endif |
223 | - if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV", | |
224 | - (uchar *)"id", buf, | |
225 | - MAX_STRING_LENGTH)) { | |
226 | - if (strncmp((const char *)buf, "PXM50", 5) == 0) | |
227 | - factory_dat.pxm50 = 1; | |
228 | - else | |
229 | - factory_dat.pxm50 = 0; | |
230 | - } | |
231 | - debug("PXM50: %d\n", factory_dat.pxm50); | |
232 | 223 | #if defined(CONFIG_VIDEO) |
233 | 224 | if (0 <= get_factory_record_val(cp, size, (uchar *)"DISP1", |
234 | 225 | (uchar *)"name", factory_dat.disp_name, |
... | ... | @@ -248,7 +239,14 @@ |
248 | 239 | NULL, 16); |
249 | 240 | debug("version number: %d\n", factory_dat.version); |
250 | 241 | } |
251 | - | |
242 | + /* Get ASN from factory set if available */ | |
243 | + if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV", | |
244 | + (uchar *)"id", factory_dat.asn, | |
245 | + MAX_STRING_LENGTH)) { | |
246 | + debug("factoryset asn: %s\n", factory_dat.asn); | |
247 | + } else { | |
248 | + factory_dat.asn[0] = 0; | |
249 | + } | |
252 | 250 | /* Get COMP/ver from factory set if available */ |
253 | 251 | if (0 <= get_factory_record_val(cp, size, (uchar *)"COMP", |
254 | 252 | (uchar *)"ver", |
board/siemens/common/factoryset.h
board/siemens/draco/board.c
... | ... | @@ -280,5 +280,14 @@ |
280 | 280 | #endif /* #if defined(CONFIG_DRIVER_TI_CPSW) */ |
281 | 281 | #endif /* #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) */ |
282 | 282 | |
283 | +#ifdef CONFIG_BOARD_LATE_INIT | |
284 | +int board_late_init(void) | |
285 | +{ | |
286 | + omap_nand_switch_ecc(1, 8); | |
287 | + | |
288 | + return 0; | |
289 | +} | |
290 | +#endif | |
291 | + | |
283 | 292 | #include "../common/board.c" |
board/siemens/pxm2/board.c
... | ... | @@ -428,5 +428,39 @@ |
428 | 428 | return 0; |
429 | 429 | } |
430 | 430 | #endif |
431 | + | |
432 | +#ifdef CONFIG_BOARD_LATE_INIT | |
433 | +int board_late_init(void) | |
434 | +{ | |
435 | + int ret; | |
436 | + | |
437 | + omap_nand_switch_ecc(1, 8); | |
438 | + | |
439 | +#ifdef CONFIG_FACTORYSET | |
440 | + if (factory_dat.asn[0] != 0) { | |
441 | + char tmp[2 * MAX_STRING_LENGTH + 2]; | |
442 | + | |
443 | + if (strncmp((const char *)factory_dat.asn, "PXM50", 5) == 0) | |
444 | + factory_dat.pxm50 = 1; | |
445 | + else | |
446 | + factory_dat.pxm50 = 0; | |
447 | + sprintf(tmp, "%s_%s", factory_dat.asn, | |
448 | + factory_dat.comp_version); | |
449 | + ret = setenv("boardid", tmp); | |
450 | + if (ret) | |
451 | + printf("error setting board id\n"); | |
452 | + } else { | |
453 | + factory_dat.pxm50 = 1; | |
454 | + ret = setenv("boardid", "PXM50_1.0"); | |
455 | + if (ret) | |
456 | + printf("error setting board id\n"); | |
457 | + } | |
458 | + debug("PXM50: %d\n", factory_dat.pxm50); | |
459 | +#endif | |
460 | + | |
461 | + return 0; | |
462 | +} | |
463 | +#endif | |
464 | + | |
431 | 465 | #include "../common/board.c" |
board/siemens/rut/board.c
... | ... | @@ -467,5 +467,28 @@ |
467 | 467 | return 0; |
468 | 468 | } |
469 | 469 | #endif /* ifdef CONFIG_VIDEO */ |
470 | + | |
471 | +#ifdef CONFIG_BOARD_LATE_INIT | |
472 | +int board_late_init(void) | |
473 | +{ | |
474 | + int ret; | |
475 | + char tmp[2 * MAX_STRING_LENGTH + 2]; | |
476 | + | |
477 | + omap_nand_switch_ecc(1, 8); | |
478 | + | |
479 | + if (factory_dat.asn[0] != 0) | |
480 | + sprintf(tmp, "%s_%s", factory_dat.asn, | |
481 | + factory_dat.comp_version); | |
482 | + else | |
483 | + sprintf(tmp, "QMX7.E38_4.0"); | |
484 | + | |
485 | + ret = setenv("boardid", tmp); | |
486 | + if (ret) | |
487 | + printf("error setting board id\n"); | |
488 | + | |
489 | + return 0; | |
490 | +} | |
491 | +#endif | |
492 | + | |
470 | 493 | #include "../common/board.c" |
include/configs/pxm2.h