]> Git Repo - J-u-boot.git/blobdiff - board/compulab/cm_t35/cm_t35.c
common: Drop init.h from common header
[J-u-boot.git] / board / compulab / cm_t35 / cm_t35.c
index 3b963183bebad93ba0dec941091a753e33487d9c..b714712f2a54b09cab498086b26b082a88098fda 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2011 - 2013 CompuLab, Ltd. <www.compulab.co.il>
  *
@@ -8,22 +9,23 @@
  *     Manikandan Pillai <[email protected]>
  *     Richard Woodruff <[email protected]>
  *     Syed Mohammed Khasim <[email protected]>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <env.h>
+#include <init.h>
 #include <status_led.h>
 #include <netdev.h>
 #include <net.h>
 #include <i2c.h>
 #include <usb.h>
 #include <mmc.h>
+#include <splash.h>
 #include <twl4030.h>
 #include <linux/compiler.h>
 
 #include <asm/io.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/mmc_host_def.h>
@@ -59,11 +61,19 @@ void get_board_mem_timings(struct board_sdrc_timings *timings)
 }
 #endif
 
-#define CM_T35_SPLASH_NAND_OFFSET 0x100000
+struct splash_location splash_locations[] = {
+       {
+               .name = "nand",
+               .storage = SPLASH_STORAGE_NAND,
+               .flags = SPLASH_STORAGE_RAW,
+               .offset = 0x100000,
+       },
+};
 
 int splash_screen_prepare(void)
 {
-       return cl_splash_screen_prepare(CM_T35_SPLASH_NAND_OFFSET);
+       return splash_source_load(splash_locations,
+                                 ARRAY_SIZE(splash_locations));
 }
 
 /*
@@ -83,8 +93,8 @@ int board_init(void)
        /* boot param addr */
        gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
 
-#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
-       status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
+#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
+       status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
 #endif
 
        return 0;
@@ -96,13 +106,13 @@ int board_init(void)
  */
 u32 get_board_rev(void)
 {
-       return cl_eeprom_get_board_rev();
+       return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
 };
 
 int misc_init_r(void)
 {
        cl_print_pcb_info();
-       dieid_num_r();
+       omap_die_id_display();
 
        return 0;
 }
@@ -363,7 +373,7 @@ void set_muxconf_regs(void)
                cm_t3730_set_muxconf();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_MMC)
 #define SB_T35_WP_GPIO 59
 
 int board_mmc_getcd(struct mmc *mmc)
@@ -382,7 +392,14 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
-#ifdef CONFIG_SYS_I2C_OMAP34XX
+#if defined(CONFIG_MMC)
+void board_mmc_power_init(void)
+{
+       twl4030_power_mmc_init(0);
+}
+#endif
+
+#ifdef CONFIG_SYS_I2C_OMAP24XX
 /*
  * Routine: reset_net_chip
  * Description: reset the Ethernet controller via TPS65930 GPIO
@@ -418,24 +435,25 @@ static int handle_mac_address(void)
        unsigned char enetaddr[6];
        int rc;
 
-       rc = eth_getenv_enetaddr("ethaddr", enetaddr);
+       rc = eth_env_get_enetaddr("ethaddr", enetaddr);
        if (rc)
                return 0;
 
-       rc = cl_eeprom_read_mac_addr(enetaddr);
+       rc = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS);
        if (rc)
                return rc;
 
-       if (!is_valid_ether_addr(enetaddr))
+       if (!is_valid_ethaddr(enetaddr))
                return -1;
 
-       return eth_setenv_enetaddr("ethaddr", enetaddr);
+       return eth_env_set_enetaddr("ethaddr", enetaddr);
 }
 
 /*
  * Routine: board_eth_init
  * Description: initialize module and base-board Ethernet chips
  */
+#define SB_T35_SMC911X_BASE    (CONFIG_SMC911X_BASE + SZ_16M)
 int board_eth_init(bd_t *bis)
 {
        int rc = 0, rc1 = 0;
@@ -444,7 +462,7 @@ int board_eth_init(bd_t *bis)
        if (rc1)
                printf("No MAC address found! ");
 
-       rc1 = cl_omap3_smc911x_init(0, 5, CM_T3X_SMC911X_BASE,
+       rc1 = cl_omap3_smc911x_init(0, 5, CONFIG_SMC911X_BASE,
                                    cm_t3x_reset_net_chip, -EINVAL);
        if (rc1 > 0)
                rc++;
@@ -457,16 +475,6 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
-void __weak get_board_serial(struct tag_serialnr *serialnr)
-{
-       /*
-        * This corresponds to what happens when we can communicate with the
-        * eeprom but don't get a valid board serial value.
-        */
-       serialnr->low = 0;
-       serialnr->high = 0;
-};
-
 #ifdef CONFIG_USB_EHCI_OMAP
 struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
This page took 0.032541 seconds and 4 git commands to generate.