diff options
30 files changed, 64 insertions, 105 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7b618d68817..77cb20090c4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -698,16 +698,17 @@ config ARCH_SOCFPGA select OF_CONTROL select SPL_OF_CONTROL select DM - select DM_SPI_FLASH - select DM_SPI select ENABLE_ARM_SOC_BOOT0_HOOK select ARCH_EARLY_INIT_R select ARCH_MISC_INIT - select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION select SYS_THUMB_BUILD imply CMD_MTDPARTS imply CRC32_VERIFY + imply DM_SPI + imply DM_SPI_FLASH imply FAT_WRITE + imply HW_WATCHDOG + imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" diff --git a/arch/arm/dts/socfpga_arria5_socdk.dts b/arch/arm/dts/socfpga_arria5_socdk.dts index 1e91a65af6b..4e4b619f4f9 100644 --- a/arch/arm/dts/socfpga_arria5_socdk.dts +++ b/arch/arm/dts/socfpga_arria5_socdk.dts @@ -88,7 +88,7 @@ u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; - compatible = "n25q00"; + compatible = "n25q00", "spi-flash"; reg = <0>; /* chip select */ spi-max-frequency = <50000000>; m25p,fast-read; diff --git a/arch/arm/dts/socfpga_cyclone5_is1.dts b/arch/arm/dts/socfpga_cyclone5_is1.dts index 2e2b71fefb6..ea323a16caa 100644 --- a/arch/arm/dts/socfpga_cyclone5_is1.dts +++ b/arch/arm/dts/socfpga_cyclone5_is1.dts @@ -87,7 +87,7 @@ u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; - compatible = "n25q00"; + compatible = "n25q00", "spi-flash"; reg = <0>; /* chip select */ spi-max-frequency = <100000000>; m25p,fast-read; diff --git a/arch/arm/dts/socfpga_cyclone5_socdk.dts b/arch/arm/dts/socfpga_cyclone5_socdk.dts index 95a8e653d7f..3af51134bbe 100644 --- a/arch/arm/dts/socfpga_cyclone5_socdk.dts +++ b/arch/arm/dts/socfpga_cyclone5_socdk.dts @@ -98,7 +98,7 @@ u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; - compatible = "n25q00"; + compatible = "n25q00", "spi-flash"; reg = <0>; /* chip select */ spi-max-frequency = <100000000>; m25p,fast-read; diff --git a/arch/arm/dts/socfpga_cyclone5_socrates.dts b/arch/arm/dts/socfpga_cyclone5_socrates.dts index e3ae8a82079..e612eeed4ff 100644 --- a/arch/arm/dts/socfpga_cyclone5_socrates.dts +++ b/arch/arm/dts/socfpga_cyclone5_socrates.dts @@ -68,7 +68,7 @@ flash0: n25q00@0 { #address-cells = <1>; #size-cells = <1>; - compatible = "n25q00"; + compatible = "n25q00", "spi-flash"; reg = <0>; /* chip select */ spi-max-frequency = <50000000>; m25p,fast-read; diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c b/board/compulab/cl-som-am57x/cl-som-am57x.c index 389eebb5891..d7dc8a42e4f 100644 --- a/board/compulab/cl-som-am57x/cl-som-am57x.c +++ b/board/compulab/cl-som-am57x/cl-som-am57x.c @@ -16,6 +16,7 @@ #include <asm/arch/sys_proto.h> #include "../common/common.h" #include "../common/eeprom.h" +#include <asm/omap_common.h> DECLARE_GLOBAL_DATA_PTR; @@ -64,3 +65,15 @@ u32 get_board_rev(void) { return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS); } + +int board_usb_init(int index, enum usb_init_type init) +{ + enable_usb_clocks(index); + return 0; +} + +int board_usb_cleanup(int index, enum usb_init_type init) +{ + disable_usb_clocks(index); + return 0; +} diff --git a/board/compulab/cm_t43/cm_t43.c b/board/compulab/cm_t43/cm_t43.c index 0d5da6f5e9d..bdbea4f5e55 100644 --- a/board/compulab/cm_t43/cm_t43.c +++ b/board/compulab/cm_t43/cm_t43.c @@ -14,6 +14,8 @@ #include <power/pmic.h> #include <power/tps65218.h> #include "board.h" +#include <usb.h> +#include <asm/omap_common.h> DECLARE_GLOBAL_DATA_PTR; @@ -50,6 +52,18 @@ int board_init(void) return 0; } +int board_usb_init(int index, enum usb_init_type init) +{ + enable_usb_clocks(index); + return 0; +} + +int board_usb_cleanup(int index, enum usb_init_type init) +{ + disable_usb_clocks(index); + return 0; +} + #ifdef CONFIG_DRIVER_TI_CPSW static void cpsw_control(int enabled) diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 16150ad30a2..715960a596e 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -687,7 +687,7 @@ int usb_gadget_handle_interrupts(int index) #endif /* CONFIG_USB_DWC3 */ #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP) -int omap_xhci_board_usb_init(int index, enum usb_init_type init) +int board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); #ifdef CONFIG_USB_DWC3 @@ -718,7 +718,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init) return 0; } -int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init) +int board_usb_cleanup(int index, enum usb_init_type init) { #ifdef CONFIG_USB_DWC3 switch (index) { diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 11287846e0d..c3f60f60c89 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -867,7 +867,7 @@ int usb_gadget_handle_interrupts(int index) #endif /* CONFIG_USB_DWC3 */ #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP) -int omap_xhci_board_usb_init(int index, enum usb_init_type init) +int board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); switch (index) { @@ -901,7 +901,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init) return 0; } -int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init) +int board_usb_cleanup(int index, enum usb_init_type init) { #ifdef CONFIG_USB_DWC3 switch (index) { diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 6ecf971a92b..519475e01f5 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -907,7 +907,7 @@ static struct ti_usb_phy_device usb_phy2_device = { .index = 1, }; -int omap_xhci_board_usb_init(int index, enum usb_init_type init) +int board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); switch (index) { @@ -944,7 +944,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init) return 0; } -int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init) +int board_usb_cleanup(int index, enum usb_init_type init) { switch (index) { case 0: diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index 540c016412b..0efe645044c 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -375,7 +375,7 @@ static void dwc_otg_core_init(struct dwc2_priv *priv) usbcfg &= ~DWC2_GUSBCFG_DDRSEL; #endif } else { /* UTMI+ interface */ -#if (CONFIG_DWC2_UTMI_PHY_WIDTH == 16) +#if (CONFIG_DWC2_UTMI_WIDTH == 16) usbcfg |= DWC2_GUSBCFG_PHYIF; #endif } diff --git a/drivers/usb/host/dwc2.h b/drivers/usb/host/dwc2.h index 4482dc621d6..574607a2acb 100644 --- a/drivers/usb/host/dwc2.h +++ b/drivers/usb/host/dwc2.h @@ -775,7 +775,9 @@ struct dwc2_core_regs { #define DWC2_PHY_TYPE_UTMI 1 #define DWC2_PHY_TYPE_ULPI 2 #define CONFIG_DWC2_PHY_TYPE DWC2_PHY_TYPE_UTMI /* PHY type */ +#ifndef CONFIG_DWC2_UTMI_WIDTH #define CONFIG_DWC2_UTMI_WIDTH 8 /* UTMI bus width (8/16) */ +#endif #undef CONFIG_DWC2_PHY_ULPI_DDR /* ULPI PHY uses DDR mode */ #define CONFIG_DWC2_PHY_ULPI_EXT_VBUS /* ULPI PHY controls VBUS */ diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c index d6c57448184..b814500bdbb 100644 --- a/drivers/usb/host/xhci-omap.c +++ b/drivers/usb/host/xhci-omap.c @@ -27,28 +27,6 @@ DECLARE_GLOBAL_DATA_PTR; static struct omap_xhci omap; -__weak int omap_xhci_board_usb_init(int index, enum usb_init_type init) -{ - enable_usb_clocks(index); - return 0; -} - -int board_usb_init(int index, enum usb_init_type init) -{ - return omap_xhci_board_usb_init(index, init); -} - -__weak int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init) -{ - disable_usb_clocks(index); - return 0; -} - -int board_usb_cleanup(int index, enum usb_init_type init) -{ - return omap_xhci_board_usb_cleanup(index, init); -} - static int omap_xhci_core_init(struct omap_xhci *omap) { int ret = 0; diff --git a/env/eeprom.c b/env/eeprom.c index 55d19d9d99c..63842d6ff3e 100644 --- a/env/eeprom.c +++ b/env/eeprom.c @@ -61,7 +61,10 @@ static int eeprom_bus_write(unsigned dev_addr, unsigned offset, return rcode; } -static int env_eeprom_get_char(int index) +/** Call this function from overridden env_get_char_spec() if you need + * this functionality. + */ +int env_eeprom_get_char(int index) { uchar c; unsigned int off = CONFIG_ENV_OFFSET; @@ -228,7 +231,6 @@ static int env_eeprom_save(void) U_BOOT_ENV_LOCATION(eeprom) = { .location = ENVL_EEPROM, ENV_NAME("EEPROM") - .get_char = env_eeprom_get_char, .load = env_eeprom_load, .save = env_save_ptr(env_eeprom_save), }; diff --git a/env/env.c b/env/env.c index 9a89832c1aa..3795dbc24e2 100644 --- a/env/env.c +++ b/env/env.c @@ -62,8 +62,6 @@ static enum env_location env_locations[] = { #endif }; -static enum env_location env_load_location = ENVL_UNKNOWN; - static bool env_has_inited(enum env_location location) { return gd->env_has_init & BIT(location); @@ -108,11 +106,11 @@ __weak enum env_location env_get_location(enum env_operation op, int prio) if (prio >= ARRAY_SIZE(env_locations)) return ENVL_UNKNOWN; - env_load_location = env_locations[prio]; - return env_load_location; + gd->env_load_location = env_locations[prio]; + return gd->env_load_location; case ENVOP_SAVE: - return env_load_location; + return gd->env_load_location; } return ENVL_UNKNOWN; @@ -149,32 +147,17 @@ static struct env_driver *env_driver_lookup(enum env_operation op, int prio) return drv; } -int env_get_char(int index) +__weak int env_get_char_spec(int index) { - struct env_driver *drv; - int prio; + return *(uchar *)(gd->env_addr + index); +} +int env_get_char(int index) +{ if (gd->env_valid == ENV_INVALID) return default_environment[index]; - - for (prio = 0; (drv = env_driver_lookup(ENVOP_GET_CHAR, prio)); prio++) { - int ret; - - if (!drv->get_char) - continue; - - if (!env_has_inited(drv->location)) - continue; - - ret = drv->get_char(index); - if (!ret) - return 0; - - debug("%s: Environment %s failed to load (err=%d)\n", __func__, - drv->name, ret); - } - - return -ENODEV; + else + return env_get_char_spec(index); } int env_load(void) diff --git a/env/nvram.c b/env/nvram.c index 6f76fe4b8d3..7cc62b631ec 100644 --- a/env/nvram.c +++ b/env/nvram.c @@ -41,7 +41,10 @@ env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; #endif #ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE -static int env_nvram_get_char(int index) +/** Call this function from overridden env_get_char_spec() if you need + * this functionality. + */ +int env_nvram_get_char(int index) { uchar c; @@ -113,9 +116,6 @@ static int env_nvram_init(void) U_BOOT_ENV_LOCATION(nvram) = { .location = ENVL_NVRAM, ENV_NAME("NVRAM") -#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE - .get_char = env_nvram_get_char, -#endif .load = env_nvram_load, .save = env_save_ptr(env_nvram_save), .init = env_nvram_init, diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 1de67e8e8f5..c16ad73864a 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -51,6 +51,7 @@ typedef struct global_data { unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Environment valid? enum env_valid */ unsigned long env_has_init; /* Bitmask of boolean of struct env_location offsets */ + int env_load_location; unsigned long ram_top; /* Top address of RAM used by U-Boot */ unsigned long relocaddr; /* Start address of U-Boot in RAM */ diff --git a/include/configs/socfpga_arria10_socdk.h b/include/configs/socfpga_arria10_socdk.h index 83718dd2c9c..82bb48b2777 100644 --- a/include/configs/socfpga_arria10_socdk.h +++ b/include/configs/socfpga_arria10_socdk.h @@ -9,8 +9,6 @@ #include <asm/arch/base_addr_a10.h> -#define CONFIG_HW_WATCHDOG - /* Booting Linux */ #define CONFIG_LOADADDR 0x01000000 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index 6b6d54b97b1..cd5aac65e92 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SoCDK */ diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 018a0c3bb48..9c5bd648e3d 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SoCDK */ diff --git a/include/configs/socfpga_de0_nano_soc.h b/include/configs/socfpga_de0_nano_soc.h index 275ed7ffebb..e5db00e3661 100644 --- a/include/configs/socfpga_de0_nano_soc.h +++ b/include/configs/socfpga_de0_nano_soc.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB */ diff --git a/include/configs/socfpga_de10_nano.h b/include/configs/socfpga_de10_nano.h index bb50fcf1ff0..656af1104dd 100644 --- a/include/configs/socfpga_de10_nano.h +++ b/include/configs/socfpga_de10_nano.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB */ diff --git a/include/configs/socfpga_de1_soc.h b/include/configs/socfpga_de1_soc.h index 05975c9bde4..f57b9504259 100644 --- a/include/configs/socfpga_de1_soc.h +++ b/include/configs/socfpga_de1_soc.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB */ diff --git a/include/configs/socfpga_is1.h b/include/configs/socfpga_is1.h index 883ffb76f3e..f2c3f405549 100644 --- a/include/configs/socfpga_is1.h +++ b/include/configs/socfpga_is1.h @@ -9,8 +9,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x10000000 diff --git a/include/configs/socfpga_mcvevk.h b/include/configs/socfpga_mcvevk.h index 404f064e948..f13463b8b06 100644 --- a/include/configs/socfpga_mcvevk.h +++ b/include/configs/socfpga_mcvevk.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on MCV */ diff --git a/include/configs/socfpga_sockit.h b/include/configs/socfpga_sockit.h index b4f31c42c50..0bbc7e01054 100644 --- a/include/configs/socfpga_sockit.h +++ b/include/configs/socfpga_sockit.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SoCDK */ diff --git a/include/configs/socfpga_socrates.h b/include/configs/socfpga_socrates.h index ebb9ac588d7..b66108d0ccd 100644 --- a/include/configs/socfpga_socrates.h +++ b/include/configs/socfpga_socrates.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SoCrates */ diff --git a/include/configs/socfpga_sr1500.h b/include/configs/socfpga_sr1500.h index 8c9069c923d..8879817b302 100644 --- a/include/configs/socfpga_sr1500.h +++ b/include/configs/socfpga_sr1500.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SR1500 */ diff --git a/include/configs/socfpga_vining_fpga.h b/include/configs/socfpga_vining_fpga.h index 0c76a775256..1197b40b58b 100644 --- a/include/configs/socfpga_vining_fpga.h +++ b/include/configs/socfpga_vining_fpga.h @@ -8,8 +8,6 @@ #include <asm/arch/base_addr_ac5.h> -#define CONFIG_HW_WATCHDOG - /* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on VINING_FPGA */ diff --git a/include/environment.h b/include/environment.h index 6044b9e1b46..7986a242778 100644 --- a/include/environment.h +++ b/include/environment.h @@ -188,6 +188,7 @@ enum env_valid { }; enum env_location { + ENVL_UNKNOWN, ENVL_EEPROM, ENVL_EXT4, ENVL_FAT, @@ -202,7 +203,6 @@ enum env_location { ENVL_NOWHERE, ENVL_COUNT, - ENVL_UNKNOWN, }; /* value for the various operations we want to perform on the env */ @@ -218,17 +218,6 @@ struct env_driver { enum env_location location; /** - * get_char() - Read a character from the environment - * - * This method is optional. If not provided, a default implementation - * will read from gd->env_addr. - * - * @index: Index of character to read (0=first) - * @return character read, or -ve on error - */ - int (*get_char)(int index); - - /** * load() - Load the environment from storage * * This method is optional. If not provided, no environment will be |