X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Flogicpd%2Fomap3som%2Fomap3logic.c;h=b2fcc28f8b4bf77d2d78cd6ab0d0c970bcc0ade4;hb=7a2af751a005a08c21a697a7295dbe6f928fc980;hp=c2bb730e977693585a92a05f0f82dbf51ee37799;hpb=31c98cbb31dc8c7ccb0e9c07ff340c22f5e407ba;p=u-boot diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index c2bb730e97..b2fcc28f8b 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -49,7 +49,8 @@ DECLARE_GLOBAL_DATA_PTR; static const struct ns16550_platdata omap3logic_serial = { .base = OMAP34XX_UART1, .reg_shift = 2, - .clock = V_NS16550_CLK + .clock = V_NS16550_CLK, + .fcr = UART_FCR_DEFVAL, }; U_BOOT_DEVICE(omap3logic_uart) = { @@ -60,25 +61,28 @@ U_BOOT_DEVICE(omap3logic_uart) = { static struct board_id { char *name; int machine_id; + char *fdtfile; } boards[2][2] = { { { .name = "OMAP35xx SOM LV", .machine_id = MACH_TYPE_OMAP3530_LV_SOM, + .fdtfile = "logicpd-som-lv-35xx-devkit.dtb", }, { .name = "OMAP35xx Torpedo", .machine_id = MACH_TYPE_OMAP3_TORPEDO, + .fdtfile = "logicpd-torpedo-35xx-devkit.dtb", }, }, { { .name = "DM37xx SOM LV", - .machine_id = MACH_TYPE_DM3730_SOM_LV, + .fdtfile = "logicpd-som-lv-37xx-devkit.dtb", }, { .name = "DM37xx Torpedo", - .machine_id = MACH_TYPE_DM3730_TORPEDO, + .fdtfile = "logicpd-torpedo-37xx-devkit.dtb", }, }, }; @@ -165,14 +169,20 @@ int misc_init_r(void) */ int board_init(void) { - struct board_id *board; - unsigned int val; - gpmc_init(); /* in SRAM or SDRAM, finish GPMC */ /* boot param addr */ gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); + return 0; +} + +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init(void) +{ + struct board_id *board; + unsigned int val; + /* * To identify between a SOM LV and Torpedo module, * a pulldown resistor is on hsusb0_data5 for the SOM LV module. @@ -207,35 +217,16 @@ int board_init(void) printf("Board: %s\n", board->name); /* Set the machine_id passed to Linux */ - gd->bd->bi_arch_number = board->machine_id; + if (board->machine_id) + gd->bd->bi_arch_number = board->machine_id; + + /* If the user has not set fdtimage, set the default */ + if (!getenv("fdtimage")) + setenv("fdtimage", board->fdtfile); } /* restore hsusb0_data5 pin as hsusb0_data5 */ MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0)); - - return 0; -} - -#ifdef CONFIG_BOARD_LATE_INIT -int board_late_init(void) -{ - switch (gd->bd->bi_arch_number) { - case MACH_TYPE_DM3730_TORPEDO: - setenv("fdtimage", "logicpd-torpedo-37xx-devkit.dtb"); - break; - case MACH_TYPE_DM3730_SOM_LV: - setenv("fdtimage", "logicpd-som-lv-37xx-devkit.dtb"); - break; - case MACH_TYPE_OMAP3_TORPEDO: - setenv("fdtimage", "logicpd-torpedo-35xx-devkit.dtb"); - break; - case MACH_TYPE_OMAP3530_LV_SOM: - setenv("fdtimage", "logicpd-som-lv-35xx-devkit.dtb"); - break; - default: - /* unknown machine type */ - break; - } return 0; } #endif