diff options
author | Tom Rini <trini@konsulko.com> | 2017-12-29 09:27:04 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-12-29 09:27:04 -0500 |
commit | 3bb6dc04a9b78c3db7c130bea7e817d77add275e (patch) | |
tree | f8c48e1764ce3996e9569c93bd4463421a5ded53 /board | |
parent | 8e5f0497c8a8ab9bd7314737f2edb4711733b6fe (diff) | |
parent | d6abd1d53992cf863019aed1251924c45893a46b (diff) | |
download | u-boot-3bb6dc04a9b78c3db7c130bea7e817d77add275e.tar.gz |
Merge git://git.denx.de/u-boot-imx
Diffstat (limited to 'board')
-rw-r--r-- | board/compulab/cm_fx6/cm_fx6.c | 71 | ||||
-rw-r--r-- | board/dhelectronics/dh_imx6/dh_imx6_spl.c | 4 | ||||
-rw-r--r-- | board/freescale/mx6sabreauto/mx6sabreauto.c | 47 | ||||
-rw-r--r-- | board/freescale/mx6slevk/imximage.cfg | 9 | ||||
-rw-r--r-- | board/freescale/mx6sxsabresd/mx6sxsabresd.c | 16 | ||||
-rw-r--r-- | board/ge/common/Makefile | 2 | ||||
-rw-r--r-- | board/ge/common/ge_common.c | 55 | ||||
-rw-r--r-- | board/ge/common/ge_common.h | 7 | ||||
-rw-r--r-- | board/ge/mx53ppd/mx53ppd.c | 47 | ||||
-rw-r--r-- | board/warp/imximage.cfg | 9 |
10 files changed, 99 insertions, 168 deletions
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 638e9f393b..620c3f2d0d 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -210,48 +210,6 @@ static int cm_fx6_setup_issd(void) #define CM_FX6_SATA_INIT_RETRIES 10 -# if !CONFIG_IS_ENABLED(AHCI) -int sata_initialize(void) -{ - int err, i; - - /* Make sure this gpio has logical 0 value */ - gpio_direction_output(CM_FX6_SATA_PWLOSS_INT, 0); - udelay(100); - cm_fx6_sata_power(1); - - for (i = 0; i < CM_FX6_SATA_INIT_RETRIES; i++) { - err = setup_sata(); - if (err) { - printf("SATA setup failed: %d\n", err); - return err; - } - - udelay(100); - - err = __sata_initialize(); - if (!err) - break; - - /* There is no device on the SATA port */ - if (sata_port_status(0, 0) == 0) - break; - - /* There's a device, but link not established. Retry */ - } - - return err; -} - -int sata_stop(void) -{ - __sata_stop(); - cm_fx6_sata_power(0); - mdelay(250); - - return 0; -} -# endif #else static int cm_fx6_setup_issd(void) { return 0; } #endif @@ -548,35 +506,6 @@ static void cm_fx6_setup_gpmi_nand(void) static void cm_fx6_setup_gpmi_nand(void) {} #endif -#ifdef CONFIG_FSL_ESDHC -static struct fsl_esdhc_cfg usdhc_cfg[3] = { - {USDHC1_BASE_ADDR}, - {USDHC2_BASE_ADDR}, - {USDHC3_BASE_ADDR}, -}; - -static enum mxc_clock usdhc_clk[3] = { - MXC_ESDHC_CLK, - MXC_ESDHC2_CLK, - MXC_ESDHC3_CLK, -}; - -int board_mmc_init(bd_t *bis) -{ - int i; - - cm_fx6_set_usdhc_iomux(); - for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) { - usdhc_cfg[i].sdhc_clk = mxc_get_clock(usdhc_clk[i]); - usdhc_cfg[i].max_bus_width = 4; - fsl_esdhc_initialize(bis, &usdhc_cfg[i]); - enable_usdhc_clk(1, i); - } - - return 0; -} -#endif - #ifdef CONFIG_MXC_SPI int cm_fx6_setup_ecspi(void) { diff --git a/board/dhelectronics/dh_imx6/dh_imx6_spl.c b/board/dhelectronics/dh_imx6/dh_imx6_spl.c index bb98f39f02..57ae7f15ce 100644 --- a/board/dhelectronics/dh_imx6/dh_imx6_spl.c +++ b/board/dhelectronics/dh_imx6/dh_imx6_spl.c @@ -387,10 +387,6 @@ void board_init_f(ulong dummy) &dhcom6sdl_grp_ioregs); mx6_dram_cfg(&dhcom_ddr_info, &dhcom_mmdc_calib, &dhcom_mem_ddr); - /* Perform DDR DRAM calibration */ - udelay(100); - mmdc_do_dqs_calibration(&dhcom_ddr_info); - /* Clear the BSS. */ memset(__bss_start, 0, __bss_end - __bss_start); diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c b/board/freescale/mx6sabreauto/mx6sabreauto.c index bdeb5f7667..9c83e350d4 100644 --- a/board/freescale/mx6sabreauto/mx6sabreauto.c +++ b/board/freescale/mx6sabreauto/mx6sabreauto.c @@ -397,39 +397,9 @@ int board_eth_init(bd_t *bis) return cpu_eth_init(bis); } -#define BOARD_REV_B 0x200 -#define BOARD_REV_A 0x100 - -static int mx6sabre_rev(void) -{ - /* - * Get Board ID information from OCOTP_GP1[15:8] - * i.MX6Q ARD RevA: 0x01 - * i.MX6Q ARD RevB: 0x02 - */ - struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; - struct fuse_bank *bank = &ocotp->bank[4]; - struct fuse_bank4_regs *fuse = - (struct fuse_bank4_regs *)bank->fuse_regs; - int reg = readl(&fuse->gp1); - int ret; - - switch (reg >> 8 & 0x0F) { - case 0x02: - ret = BOARD_REV_B; - break; - case 0x01: - default: - ret = BOARD_REV_A; - break; - } - - return ret; -} - u32 get_board_rev(void) { - int rev = mx6sabre_rev(); + int rev = nxp_board_rev(); return (get_cpu_rev() & ~(0xF << 8)) | rev; } @@ -703,20 +673,7 @@ int board_late_init(void) int checkboard(void) { - int rev = mx6sabre_rev(); - char *revname; - - switch (rev) { - case BOARD_REV_B: - revname = "B"; - break; - case BOARD_REV_A: - default: - revname = "A"; - break; - } - - printf("Board: MX6Q-Sabreauto rev%s\n", revname); + printf("Board: MX6Q-Sabreauto rev%c\n", nxp_board_rev_string()); return 0; } diff --git a/board/freescale/mx6slevk/imximage.cfg b/board/freescale/mx6slevk/imximage.cfg index 024de9cdb4..9722eb5d7e 100644 --- a/board/freescale/mx6slevk/imximage.cfg +++ b/board/freescale/mx6slevk/imximage.cfg @@ -8,6 +8,8 @@ * * The syntax is taken as close as possible with the kwbimage */ +#define __ASSEMBLY__ +#include <config.h> /* image version */ @@ -21,6 +23,13 @@ IMAGE_VERSION 2 BOOT_FROM sd /* + * Secure boot support + */ +#ifdef CONFIG_SECURE_BOOT +CSF CONFIG_CSF_SIZE +#endif + +/* * Device Configuration Data (DCD) * * Each entry must have the format: diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 2aeef61ffd..3ad2140314 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -540,9 +540,23 @@ int board_init(void) return 0; } +static bool is_reva(void) +{ + return (nxp_board_rev() == 1); +} + +int board_late_init(void) +{ +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + if (is_reva()) + env_set("board_rev", "REVA"); +#endif + return 0; +} + int checkboard(void) { - puts("Board: MX6SX SABRE SDB\n"); + printf("Board: MX6SX SABRE SDB rev%c\n", nxp_board_rev_string()); return 0; } diff --git a/board/ge/common/Makefile b/board/ge/common/Makefile index 93e6c0182b..f5be11bcef 100644 --- a/board/ge/common/Makefile +++ b/board/ge/common/Makefile @@ -4,4 +4,4 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-y := vpd_reader.o +obj-y := vpd_reader.o ge_common.o diff --git a/board/ge/common/ge_common.c b/board/ge/common/ge_common.c new file mode 100644 index 0000000000..c8260960cf --- /dev/null +++ b/board/ge/common/ge_common.c @@ -0,0 +1,55 @@ +/* + * Copyright 2017 General Electric Company + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <i2c.h> +#include <rtc.h> + +void check_time(void) +{ + int ret, i; + struct rtc_time tm; + u8 retry = 3; + + unsigned int current_i2c_bus = i2c_get_bus_num(); + + ret = i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM); + if (ret < 0) + return; + + rtc_init(); + + for (i = 0; i < retry; i++) { + ret = rtc_get(&tm); + if (!ret || ret == -EINVAL) + break; + } + + if (ret < 0) + env_set("rtc_status", "RTC_ERROR"); + + if (tm.tm_year > 2037) { + tm.tm_sec = 0; + tm.tm_min = 0; + tm.tm_hour = 0; + tm.tm_mday = 1; + tm.tm_wday = 2; + tm.tm_mon = 1; + tm.tm_year = 2036; + + for (i = 0; i < retry; i++) { + ret = rtc_set(&tm); + if (!ret) + break; + } + + if (ret < 0) + env_set("rtc_status", "RTC_ERROR"); + } + + i2c_set_bus_num(current_i2c_bus); +} + diff --git a/board/ge/common/ge_common.h b/board/ge/common/ge_common.h new file mode 100644 index 0000000000..b28aada8dd --- /dev/null +++ b/board/ge/common/ge_common.h @@ -0,0 +1,7 @@ +/* + * Copyright 2017 General Electric Company + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +void check_time(void); diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c index 6a8a29d7d8..90dbccc5ed 100644 --- a/board/ge/mx53ppd/mx53ppd.c +++ b/board/ge/mx53ppd/mx53ppd.c @@ -33,8 +33,8 @@ #include <watchdog.h> #include "ppd_gpio.h" #include <stdlib.h> +#include "../../ge/common/ge_common.h" #include "../../ge/common/vpd_reader.h" -#include <rtc.h> #define MX53PPD_LCD_POWER IMX_GPIO_NR(3, 24) @@ -357,51 +357,6 @@ static int read_vpd(uint eeprom_bus) return res; } -static void check_time(void) -{ - int ret, i; - struct rtc_time tm; - u8 retry = 3; - - unsigned int current_i2c_bus = i2c_get_bus_num(); - - ret = i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM); - if (ret < 0) - return; - - rtc_init(); - - for (i = 0; i < retry; i++) { - ret = rtc_get(&tm); - if (!ret || ret == -EINVAL) - break; - } - - if (ret < 0) - env_set("rtc_status", "RTC_ERROR"); - - if (tm.tm_year > 2037) { - tm.tm_sec = 0; - tm.tm_min = 0; - tm.tm_hour = 0; - tm.tm_mday = 1; - tm.tm_wday = 2; - tm.tm_mon = 1; - tm.tm_year = 2036; - - for (i = 0; i < retry; i++) { - ret = rtc_set(&tm); - if (!ret) - break; - } - - if (ret < 0) - env_set("rtc_status", "RTC_ERROR"); - } - - i2c_set_bus_num(current_i2c_bus); -} - int board_init(void) { gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; diff --git a/board/warp/imximage.cfg b/board/warp/imximage.cfg index 771dbb3614..84209681d9 100644 --- a/board/warp/imximage.cfg +++ b/board/warp/imximage.cfg @@ -8,6 +8,8 @@ * * The syntax is taken as close as possible with the kwbimage */ +#define __ASSEMBLY__ +#include <config.h> /* image version */ @@ -21,6 +23,13 @@ IMAGE_VERSION 2 BOOT_FROM sd /* + * Secure boot support + */ +#ifdef CONFIG_SECURE_BOOT +CSF CONFIG_CSF_SIZE +#endif + +/* * Device Configuration Data (DCD) * * Each entry must have the format: |