]> git.sur5r.net Git - u-boot/commitdiff
arm, am335x: siemens boards add FIT support
authorHeiko Schocher <hs@denx.de>
Tue, 18 Nov 2014 10:51:06 +0000 (11:51 +0100)
committerTom Rini <trini@ti.com>
Fri, 5 Dec 2014 02:28:32 +0000 (21:28 -0500)
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>
board/siemens/common/board.c
board/siemens/common/factoryset.c
board/siemens/common/factoryset.h
board/siemens/draco/board.c
board/siemens/pxm2/board.c
board/siemens/rut/board.c
include/configs/pxm2.h
include/configs/rut.h

index 2782bcc2a71febd7c4cc7e507b2d0645883a6dc0..cc0ac6b0bda3eff3f2ffd3b0b1c9cab6ae11b879 100644 (file)
@@ -96,15 +96,6 @@ const struct dpll_params *get_dpll_ddr_params(void)
        return &dpll_ddr;
 }
 
-#ifdef CONFIG_BOARD_LATE_INIT
-int board_late_init(void)
-{
-       omap_nand_switch_ecc(1, 8);
-
-       return 0;
-}
-#endif
-
 #ifndef CONFIG_SPL_BUILD
 #if defined(BOARD_DFU_BUTTON_GPIO)
 /*
index be0091d1334cd96db6cc161e29a4510fb5bf5555..7baac3dda6da55777e01b5413d593c11a7cc7628 100644 (file)
@@ -220,15 +220,6 @@ int factoryset_read_eeprom(int i2c_addr)
        printf("DFU USB: VID = 0x%4x, PID = 0x%4x\n", factory_dat.usb_vendor_id,
               factory_dat.usb_product_id);
 #endif
-       if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV",
-                                       (uchar *)"id", buf,
-                                       MAX_STRING_LENGTH)) {
-               if (strncmp((const char *)buf, "PXM50", 5) == 0)
-                       factory_dat.pxm50 = 1;
-               else
-                       factory_dat.pxm50 = 0;
-       }
-       debug("PXM50: %d\n", factory_dat.pxm50);
 #if defined(CONFIG_VIDEO)
        if (0 <= get_factory_record_val(cp, size, (uchar *)"DISP1",
                                        (uchar *)"name", factory_dat.disp_name,
@@ -248,7 +239,14 @@ int factoryset_read_eeprom(int i2c_addr)
                                                            NULL, 16);
                debug("version number: %d\n", factory_dat.version);
        }
-
+       /* Get ASN from factory set if available */
+       if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV",
+                                       (uchar *)"id", factory_dat.asn,
+                                       MAX_STRING_LENGTH)) {
+               debug("factoryset asn: %s\n", factory_dat.asn);
+       } else {
+               factory_dat.asn[0] = 0;
+       }
        /* Get COMP/ver from factory set if available */
        if (0 <= get_factory_record_val(cp, size, (uchar *)"COMP",
                                        (uchar *)"ver",
index 7667b96b532bf81adf9edba8999b38524801bf22..3f23d5ebf4126fd1eb1f711e45d473bac3d15e71 100644 (file)
@@ -20,6 +20,7 @@ struct factorysetcontainer {
 #endif
        unsigned char serial[MAX_STRING_LENGTH];
        int version;
+       uchar asn[MAX_STRING_LENGTH];
        uchar comp_version[MAX_STRING_LENGTH];
 };
 
index 9be2e344f8da37188cfcf12230016b0b91a3883e..ede73baf3e92f90d74fc9ff6f8050aad01e5c725 100644 (file)
@@ -280,4 +280,13 @@ U_BOOT_CMD(
 #endif /* #if defined(CONFIG_DRIVER_TI_CPSW) */
 #endif /* #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) */
 
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+       omap_nand_switch_ecc(1, 8);
+
+       return 0;
+}
+#endif
+
 #include "../common/board.c"
index 559af0e0e52f9c6bb3eb5be6fe29a139d9e3b2f6..264ba025b70987779a1ed8774fbe7b609f87d507 100644 (file)
@@ -428,4 +428,38 @@ static int board_video_init(void)
        return 0;
 }
 #endif
+
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+       int ret;
+
+       omap_nand_switch_ecc(1, 8);
+
+#ifdef CONFIG_FACTORYSET
+       if (factory_dat.asn[0] != 0) {
+               char tmp[2 * MAX_STRING_LENGTH + 2];
+
+               if (strncmp((const char *)factory_dat.asn, "PXM50", 5) == 0)
+                       factory_dat.pxm50 = 1;
+               else
+                       factory_dat.pxm50 = 0;
+               sprintf(tmp, "%s_%s", factory_dat.asn,
+                       factory_dat.comp_version);
+               ret = setenv("boardid", tmp);
+               if (ret)
+                       printf("error setting board id\n");
+       } else {
+               factory_dat.pxm50 = 1;
+               ret = setenv("boardid", "PXM50_1.0");
+               if (ret)
+                       printf("error setting board id\n");
+       }
+       debug("PXM50: %d\n", factory_dat.pxm50);
+#endif
+
+       return 0;
+}
+#endif
+
 #include "../common/board.c"
index 1752df2c4fba3f33a29f33b8b99c750754bdb686..fb840f7ed2263ad2f96107280d17d759b2aa107f 100644 (file)
@@ -467,4 +467,27 @@ static int board_video_init(void)
        return 0;
 }
 #endif /* ifdef CONFIG_VIDEO */
+
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+       int ret;
+       char tmp[2 * MAX_STRING_LENGTH + 2];
+
+       omap_nand_switch_ecc(1, 8);
+
+       if (factory_dat.asn[0] != 0)
+               sprintf(tmp, "%s_%s", factory_dat.asn,
+                       factory_dat.comp_version);
+       else
+               sprintf(tmp, "QMX7.E38_4.0");
+
+       ret = setenv("boardid", tmp);
+       if (ret)
+               printf("error setting board id\n");
+
+       return 0;
+}
+#endif
+
 #include "../common/board.c"
index d75d5629639e71756c263d813534f410081bdabf..946b2c85e9dd4d04e68051b6b34875cb06f1b398 100644 (file)
 #define CONFIG_SYS_CONSOLE_FG_COL      0x00
 #endif
 
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_FIT
+#endif
+
 #endif /* ! __CONFIG_PXM2_H */
index 6bddededaeb782954b1617155f310063bba56676..0067ea46e0ccbfe8a0a319fbd991b96833d5b587 100644 (file)
 #define CONFIG_SYS_CONSOLE_FG_COL      0x00
 #endif
 
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_FIT
+#endif
+
 #endif /* ! __CONFIG_RUT_H */