]> git.sur5r.net Git - u-boot/blobdiff - board/logicpd/omap3som/omap3logic.c
arm: am57xx: Set serial# variable
[u-boot] / board / logicpd / omap3som / omap3logic.c
index 668f68476e681a7373cba5338b129a9fe517ad69..b2fcc28f8b4bf77d2d78cd6ab0d0c970bcc0ade4 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/mach-types.h>
 #include <linux/mtd/nand.h>
 #include <asm/omap_musb.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/musb.h>
@@ -47,9 +47,10 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 
 static const struct ns16550_platdata omap3logic_serial = {
-       OMAP34XX_UART1,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART1,
+       .reg_shift = 2,
+       .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",
                },
        },
 };
@@ -144,20 +148,8 @@ static struct musb_hdrc_platform_data musb_plat = {
  */
 int misc_init_r(void)
 {
-       t2_t *t2_base = (t2_t *)T2_BASE;
-       u32 pbias_lite;
-       /* set up dual-voltage GPIOs to 1.8V */
-       pbias_lite = readl(&t2_base->pbias_lite);
-       pbias_lite &= ~PBIASLITEVMODE1;
-       pbias_lite |= PBIASLITEPWRDNZ1;
-       writel(pbias_lite, &t2_base->pbias_lite);
-       if (get_cpu_family() == CPU_OMAP36XX)
-               writel(readl(CONTROL_WKUP_CTRL) | GPIO_IO_PWRDNZ,
-                               CONTROL_WKUP_CTRL);
        twl4030_power_init();
-
        omap_die_id_display();
-       putc('\n');
 
 #ifdef CONFIG_USB_MUSB_OMAP2PLUS
        musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE);
@@ -177,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.
@@ -219,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