]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/ti/dra7xx/evm.c
env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()
[people/ms/u-boot.git] / board / ti / dra7xx / evm.c
index ae2d59da432ef26ff47a9948b31e93e898040181..93d3d0b54ebab0c9b6cd63fa1cf0674528f939d8 100644 (file)
@@ -438,14 +438,18 @@ struct vcores_data dra718_volts = {
         * and are powered by BUCK1 of LP873X PMIC
         */
        .eve.value[OPP_NOM]     = VDD_EVE_DRA7_NOM,
+       .eve.value[OPP_HIGH]    = VDD_EVE_DRA7_HIGH,
        .eve.efuse.reg[OPP_NOM] = STD_FUSE_OPP_VMIN_DSPEVE_NOM,
+       .eve.efuse.reg[OPP_HIGH] = STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
        .eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
        .eve.addr       = LP873X_REG_ADDR_BUCK1,
        .eve.pmic       = &lp8733,
        .eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
 
        .iva.value[OPP_NOM]     = VDD_IVA_DRA7_NOM,
+       .iva.value[OPP_HIGH]    = VDD_IVA_DRA7_HIGH,
        .iva.efuse.reg[OPP_NOM] = STD_FUSE_OPP_VMIN_IVA_NOM,
+       .iva.efuse.reg[OPP_HIGH] = STD_FUSE_OPP_VMIN_IVA_HIGH,
        .iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
        .iva.addr       = LP873X_REG_ADDR_BUCK1,
        .iva.pmic       = &lp8733,
@@ -456,27 +460,44 @@ int get_voltrail_opp(int rail_offset)
 {
        int opp;
 
-       /*
-        * DRA71x supports only OPP_NOM.
-        */
-       if (board_is_dra71x_evm())
-               return OPP_NOM;
-
        switch (rail_offset) {
        case VOLT_MPU:
                opp = DRA7_MPU_OPP;
+               /* DRA71x supports only OPP_NOM for MPU */
+               if (board_is_dra71x_evm())
+                       opp = OPP_NOM;
                break;
        case VOLT_CORE:
                opp = DRA7_CORE_OPP;
+               /* DRA71x supports only OPP_NOM for CORE */
+               if (board_is_dra71x_evm())
+                       opp = OPP_NOM;
                break;
        case VOLT_GPU:
                opp = DRA7_GPU_OPP;
+               /* DRA71x supports only OPP_NOM for GPU */
+               if (board_is_dra71x_evm())
+                       opp = OPP_NOM;
                break;
        case VOLT_EVE:
                opp = DRA7_DSPEVE_OPP;
+               /*
+                * DRA71x does not support OPP_OD for EVE.
+                * If OPP_OD is selected by menuconfig, fallback
+                * to OPP_NOM.
+                */
+               if (board_is_dra71x_evm() && opp == OPP_OD)
+                       opp = OPP_NOM;
                break;
        case VOLT_IVA:
                opp = DRA7_IVA_OPP;
+               /*
+                * DRA71x does not support OPP_OD for IVA.
+                * If OPP_OD is selected by menuconfig, fallback
+                * to OPP_NOM.
+                */
+               if (board_is_dra71x_evm() && opp == OPP_OD)
+                       opp = OPP_NOM;
                break;
        default:
                opp = OPP_NOM;
@@ -537,9 +558,10 @@ int board_late_init(void)
         * on HS devices.
         */
        if (get_device_type() == HS_DEVICE)
-               setenv("boot_fit", "1");
+               env_set("boot_fit", "1");
 
        omap_die_id_serial();
+       omap_set_fastboot_vars();
 #endif
        return 0;
 }
@@ -681,7 +703,7 @@ err:
 }
 #endif
 
-#if defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_MMC)
 int board_mmc_init(bd_t *bis)
 {
        omap_mmc_init(0, 0, 0, -1, -1);
@@ -729,7 +751,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
        .index = 1,
 };
 
-int board_usb_init(int index, enum usb_init_type init)
+int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
        enable_usb_clocks(index);
        switch (index) {
@@ -766,7 +788,7 @@ int board_usb_init(int index, enum usb_init_type init)
        return 0;
 }
 
-int board_usb_cleanup(int index, enum usb_init_type init)
+int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
 {
        switch (index) {
        case 0:
@@ -803,8 +825,8 @@ int spl_start_uboot(void)
 
 #ifdef CONFIG_SPL_ENV_SUPPORT
        env_init();
-       env_relocate_spec();
-       if (getenv_yesno("boot_os") != 1)
+       env_load();
+       if (env_get_yesno("boot_os") != 1)
                return 1;
 #endif
 
@@ -871,11 +893,11 @@ int board_eth_init(bd_t *bis)
        mac_addr[4] = (mac_lo & 0xFF00) >> 8;
        mac_addr[5] = mac_lo & 0xFF;
 
-       if (!getenv("ethaddr")) {
+       if (!env_get("ethaddr")) {
                printf("<ethaddr> not set. Validating first E-fuse MAC\n");
 
                if (is_valid_ethaddr(mac_addr))
-                       eth_setenv_enetaddr("ethaddr", mac_addr);
+                       eth_env_set_enetaddr("ethaddr", mac_addr);
        }
 
        mac_lo = readl((*ctrl)->control_core_mac_id_1_lo);
@@ -887,9 +909,9 @@ int board_eth_init(bd_t *bis)
        mac_addr[4] = (mac_lo & 0xFF00) >> 8;
        mac_addr[5] = mac_lo & 0xFF;
 
-       if (!getenv("eth1addr")) {
+       if (!env_get("eth1addr")) {
                if (is_valid_ethaddr(mac_addr))
-                       eth_setenv_enetaddr("eth1addr", mac_addr);
+                       eth_env_set_enetaddr("eth1addr", mac_addr);
        }
 
        ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33);