]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx48/tx48.c
karo: tx48: only print message about cpu_clk, if it was actually changed
[karo-tx-uboot.git] / board / karo / tx48 / tx48.c
index e59aa162898bcc92d7d4283227cf211f4436f400..10b939095d350b63c1715946430fc8525f29f08c 100644 (file)
@@ -47,6 +47,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define TX48_LCD_RST_GPIO      AM33XX_GPIO_NR(1, 19)
 #define TX48_LCD_PWR_GPIO      AM33XX_GPIO_NR(1, 22)
 #define TX48_LCD_BACKLIGHT_GPIO        AM33XX_GPIO_NR(3, 14)
+#define TX48_MMC_CD_GPIO       AM33XX_GPIO_NR(3, 15)
 
 #define GMII_SEL               (CTRL_BASE + 0x650)
 
@@ -333,10 +334,13 @@ static const struct pin_mux stk5_pads[] = {
        { OFFSET(gpmc_a6), MODE(7) | PULLUDEN, },
        /* LCD Backlight (PWM) */
        { OFFSET(mcasp0_aclkx), MODE(7) | PULLUDEN, },
+       /* MMC CD */
+       { OFFSET(mcasp0_fsx), MODE(7) | PULLUDEN | PULLUP_EN, },
 };
 
 static const struct gpio stk5_gpios[] = {
-       { AM33XX_GPIO_NR(1, 26), GPIOF_OUTPUT_INIT_LOW, "HEARTBEAT LED", },
+       { TX48_LED_GPIO, GPIOF_OUTPUT_INIT_LOW, "HEARTBEAT LED", },
+       { TX48_MMC_CD_GPIO, GPIOF_INPUT, "MMC0 CD", },
 };
 
 static const struct pin_mux stk5_lcd_pads[] = {
@@ -865,11 +869,8 @@ int checkboard(void)
        prm_rstst = readl(PRM_RSTST);
        show_reset_cause(prm_rstst);
 
-#ifdef CONFIG_OF_LIBFDT
-       printf("Board: Ka-Ro TX48-7020 with FDT support\n");
-#else
        printf("Board: Ka-Ro TX48-7020\n");
-#endif
+
        timer_init();
        return 0;
 }
@@ -877,18 +878,31 @@ int checkboard(void)
 static void tx48_set_cpu_clock(void)
 {
        unsigned long cpu_clk = getenv_ulong("cpu_clk", 10, 0);
+       unsigned long act_cpu_clk;
 
-       if (had_ctrlc() || (prm_rstst & PRM_RSTST_WDT1_RST))
+       if (cpu_clk == 0 || cpu_clk == mpu_clk_rate() / 1000000)
                return;
 
-       if (cpu_clk == 0 || cpu_clk == mpu_clk_rate() / 1000000)
+       if (had_ctrlc() || (prm_rstst & PRM_RSTST_WDT1_RST)) {
+               if (prm_rstst & PRM_RSTST_WDT1_RST) {
+                       printf("Watchdog reset detected; skipping cpu clock change\n");
+               } else {
+                       printf("<CTRL-C> detected; skipping cpu clock change\n");
+               }
                return;
+       }
 
        mpu_pll_config_val(cpu_clk);
 
-       printf("CPU clock set to %lu.%03lu MHz\n",
-               mpu_clk_rate() / 1000000,
-               mpu_clk_rate() / 1000 % 1000);
+       act_cpu_clk = mpu_clk_rate();
+       if (cpu_clk * 1000000 != act_cpu_clk) {
+               printf("Failed to set CPU clock to %lu MHz; using %lu.%03lu MHz instead\n",
+                       cpu_clk, act_cpu_clk / 1000000,
+                       act_cpu_clk / 1000 % 1000);
+       } else {
+               printf("CPU clock set to %lu.%03lu MHz\n",
+                       act_cpu_clk / 1000000, act_cpu_clk / 1000 % 1000);
+       }
 }
 
 static void tx48_init_mac(void)
@@ -1015,6 +1029,13 @@ int board_eth_init(bd_t *bis)
 }
 #endif /* CONFIG_DRIVER_TI_CPSW */
 
+#if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD)
+int cpu_mmc_init(bd_t *bis)
+{
+       return omap_mmc_init(1, 0, 0, TX48_MMC_CD_GPIO, -1);
+}
+#endif
+
 void tx48_disable_watchdog(void)
 {
        struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
@@ -1079,13 +1100,18 @@ void ft_board_setup(void *blob, bd_t *bd)
        const char *baseboard = getenv("baseboard");
        int stk5_v5 = baseboard != NULL && (strcmp(baseboard, "stk5-v5") == 0);
        const char *video_mode = karo_get_vmode(getenv("video_mode"));
+       int ret;
+
+       ret = fdt_increase_size(blob, 4096);
+       if (ret)
+               printf("Failed to increase FDT size: %s\n", fdt_strerror(ret));
 
        fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
        fdt_fixup_ethernet(blob);
 
        karo_fdt_fixup_touchpanel(blob, tx48_touchpanels,
                                ARRAY_SIZE(tx48_touchpanels));
-       karo_fdt_fixup_usb_otg(blob, "usb0", "phys");
+       karo_fdt_fixup_usb_otg(blob, "usb0", "phys", "vcc-supply");
        karo_fdt_fixup_flexcan(blob, stk5_v5);
 
        karo_fdt_update_fb_mode(blob, video_mode);