diff options
author | Tom Rini <trini@konsulko.com> | 2021-04-09 07:41:32 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-04-09 07:41:32 -0400 |
commit | c3932e5eaf8d92e701c44b1a0a86488d14e5529b (patch) | |
tree | 514c5dcf9b86f77e9d5447b13ca65ca682eb554d /board/gateworks | |
parent | f6127db8cc8dec22cf9cd6d6363d812f659ce517 (diff) | |
parent | 2fc93e5bafdae7cf6373479e054e9f3943fde23c (diff) | |
download | u-boot-WIP/09Apr2021.zip u-boot-WIP/09Apr2021.tar.gz u-boot-WIP/09Apr2021.tar.bz2 |
Merge tag 'u-boot-imx-20210409' of https://gitlab.denx.de/u-boot/custodians/u-boot-imxWIP/09Apr2021
u-boot-imx-20210409
-------------------
- Secure Boot :
- HAB for MX8M / MX7ULP
- CAAM fixes
- Fixes for imxrt1020
- Fixes for USDHC driver
- Fixes for Toradex (Colibri / Apalis)
- Switch to DM for several boards
- mx23 olinuxo
- usbarmory
- marsboard / riotboard
- Gateworks GW Ventana
- NXP upstream patches (LPDDR / CAAM / HAB)
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/7089
Diffstat (limited to 'board/gateworks')
-rw-r--r-- | board/gateworks/gw_ventana/MAINTAINERS | 48 | ||||
-rw-r--r-- | board/gateworks/gw_ventana/common.c | 17 | ||||
-rw-r--r-- | board/gateworks/gw_ventana/common.h | 1 | ||||
-rw-r--r-- | board/gateworks/gw_ventana/gsc.c | 88 | ||||
-rw-r--r-- | board/gateworks/gw_ventana/gsc.h | 1 | ||||
-rw-r--r-- | board/gateworks/gw_ventana/gw_ventana.c | 138 | ||||
-rw-r--r-- | board/gateworks/gw_ventana/gw_ventana_spl.c | 10 | ||||
-rw-r--r-- | board/gateworks/venice/gsc.c | 23 |
8 files changed, 175 insertions, 151 deletions
diff --git a/board/gateworks/gw_ventana/MAINTAINERS b/board/gateworks/gw_ventana/MAINTAINERS index 265ddac..1619d23 100644 --- a/board/gateworks/gw_ventana/MAINTAINERS +++ b/board/gateworks/gw_ventana/MAINTAINERS @@ -6,3 +6,51 @@ F: include/configs/gw_ventana.h F: configs/gwventana_nand_defconfig F: configs/gwventana_emmc_defconfig F: configs/gwventana_gw5904_defconfig +F: arch/arm/dts/imx6dl-gw51xx.dts +F: arch/arm/dts/imx6dl-gw52xx.dts +F: arch/arm/dts/imx6dl-gw53xx.dts +F: arch/arm/dts/imx6dl-gw54xx.dts +F: arch/arm/dts/imx6dl-gw551x.dts +F: arch/arm/dts/imx6dl-gw552x.dts +F: arch/arm/dts/imx6dl-gw553x.dts +F: arch/arm/dts/imx6dl-gw560x.dts +F: arch/arm/dts/imx6dl-gw5903.dts +F: arch/arm/dts/imx6dl-gw5904.dts +F: arch/arm/dts/imx6dl-gw5905.dts +F: arch/arm/dts/imx6dl-gw5907.dts +F: arch/arm/dts/imx6dl-gw5910.dts +F: arch/arm/dts/imx6dl-gw5912.dts +F: arch/arm/dts/imx6dl-gw5913.dts +F: arch/arm/dts/imx6qdl-gw51xx.dtsi +F: arch/arm/dts/imx6qdl-gw52xx.dtsi +F: arch/arm/dts/imx6qdl-gw53xx.dtsi +F: arch/arm/dts/imx6qdl-gw54xx.dtsi +F: arch/arm/dts/imx6qdl-gw551x.dtsi +F: arch/arm/dts/imx6qdl-gw552x.dtsi +F: arch/arm/dts/imx6qdl-gw553x.dtsi +F: arch/arm/dts/imx6qdl-gw560x.dtsi +F: arch/arm/dts/imx6qdl-gw5903.dtsi +F: arch/arm/dts/imx6qdl-gw5904.dtsi +F: arch/arm/dts/imx6qdl-gw5905.dtsi +F: arch/arm/dts/imx6qdl-gw5907.dtsi +F: arch/arm/dts/imx6qdl-gw5910.dtsi +F: arch/arm/dts/imx6qdl-gw5912.dtsi +F: arch/arm/dts/imx6qdl-gw5913.dtsi +F: arch/arm/dts/imx6q-gw51xx.dts +F: arch/arm/dts/imx6q-gw52xx.dts +F: arch/arm/dts/imx6q-gw53xx.dts +F: arch/arm/dts/imx6q-gw5400-a.dts +F: arch/arm/dts/imx6q-gw54xx.dts +F: arch/arm/dts/imx6q-gw551x.dts +F: arch/arm/dts/imx6q-gw552x.dts +F: arch/arm/dts/imx6q-gw553x.dts +F: arch/arm/dts/imx6q-gw560x.dts +F: arch/arm/dts/imx6q-gw5901.dts +F: arch/arm/dts/imx6q-gw5902.dts +F: arch/arm/dts/imx6q-gw5903.dts +F: arch/arm/dts/imx6q-gw5904.dts +F: arch/arm/dts/imx6q-gw5905.dts +F: arch/arm/dts/imx6q-gw5907.dts +F: arch/arm/dts/imx6q-gw5910.dts +F: arch/arm/dts/imx6q-gw5912.dts +F: arch/arm/dts/imx6q-gw5913.dts diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c index 14f45bf..4627a15 100644 --- a/board/gateworks/gw_ventana/common.c +++ b/board/gateworks/gw_ventana/common.c @@ -970,7 +970,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .rs485en = IMX_GPIO_NR(3, 24), .dioi2c_en = IMX_GPIO_NR(4, 5), .pcie_sson = IMX_GPIO_NR(1, 20), - .otgpwr_en = IMX_GPIO_NR(3, 22), .mmc_cd = IMX_GPIO_NR(7, 0), }, @@ -990,7 +989,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .gps_shdn = IMX_GPIO_NR(1, 2), .vidin_en = IMX_GPIO_NR(5, 20), .wdis = IMX_GPIO_NR(7, 12), - .otgpwr_en = IMX_GPIO_NR(3, 22), .nand = true, }, @@ -1014,7 +1012,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .wdis = IMX_GPIO_NR(7, 12), .msata_en = GP_MSATA_SEL, .rs232_en = GP_RS232_EN, - .otgpwr_en = IMX_GPIO_NR(3, 22), .vsel_pin = IMX_GPIO_NR(6, 14), .mmc_cd = IMX_GPIO_NR(7, 0), .nand = true, @@ -1039,7 +1036,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .wdis = IMX_GPIO_NR(7, 12), .msata_en = GP_MSATA_SEL, .rs232_en = GP_RS232_EN, - .otgpwr_en = IMX_GPIO_NR(3, 22), .vsel_pin = IMX_GPIO_NR(6, 14), .mmc_cd = IMX_GPIO_NR(7, 0), .nand = true, @@ -1066,7 +1062,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .wdis = IMX_GPIO_NR(5, 17), .msata_en = GP_MSATA_SEL, .rs232_en = GP_RS232_EN, - .otgpwr_en = IMX_GPIO_NR(3, 22), .vsel_pin = IMX_GPIO_NR(6, 14), .mmc_cd = IMX_GPIO_NR(7, 0), .nand = true, @@ -1117,7 +1112,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .pcie_rst = IMX_GPIO_NR(1, 0), .vidin_en = IMX_GPIO_NR(5, 20), .wdis = IMX_GPIO_NR(7, 12), - .otgpwr_en = IMX_GPIO_NR(3, 22), .vsel_pin = IMX_GPIO_NR(6, 14), .mmc_cd = IMX_GPIO_NR(7, 0), .nand = true, @@ -1140,7 +1134,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .rs232_en = GP_RS232_EN, .vidin_en = IMX_GPIO_NR(3, 31), .wdis = IMX_GPIO_NR(7, 12), - .otgpwr_en = IMX_GPIO_NR(4, 15), .mmc_cd = IMX_GPIO_NR(7, 0), }, @@ -1166,7 +1159,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { }, .pcie_rst = IMX_GPIO_NR(1, 0), .rs232_en = GP_RS232_EN, - .otgpwr_en = IMX_GPIO_NR(3, 23), .nand = true, }, @@ -1179,7 +1171,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .leds = { IMX_GPIO_NR(6, 14), }, - .otgpwr_en = IMX_GPIO_NR(4, 15), .mmc_cd = IMX_GPIO_NR(6, 11), }, @@ -1197,7 +1188,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .pcie_rst = IMX_GPIO_NR(1, 0), .mezz_pwren = IMX_GPIO_NR(2, 19), .mezz_irq = IMX_GPIO_NR(2, 18), - .otgpwr_en = IMX_GPIO_NR(3, 22), }, /* GW5905 */ @@ -1279,7 +1269,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .pcie_rst = IMX_GPIO_NR(1, 0), .mezz_pwren = IMX_GPIO_NR(2, 19), .mezz_irq = IMX_GPIO_NR(2, 18), - .otgpwr_en = IMX_GPIO_NR(3, 22), }, }; @@ -1382,12 +1371,6 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info) gpio_direction_output(gpio_cfg[board].wdis, 1); } - /* OTG power off */ - if (gpio_cfg[board].otgpwr_en) { - gpio_request(gpio_cfg[board].otgpwr_en, "usbotg_pwr"); - gpio_direction_output(gpio_cfg[board].otgpwr_en, 0); - } - /* sense vselect pin to see if we support uhs-i */ if (gpio_cfg[board].vsel_pin) { gpio_request(gpio_cfg[board].vsel_pin, "sd3_vselect"); diff --git a/board/gateworks/gw_ventana/common.h b/board/gateworks/gw_ventana/common.h index 5cec01c..d73850c 100644 --- a/board/gateworks/gw_ventana/common.h +++ b/board/gateworks/gw_ventana/common.h @@ -75,7 +75,6 @@ struct ventana { int wdis; int msata_en; int rs232_en; - int otgpwr_en; int vsel_pin; int mmc_cd; /* various features */ diff --git a/board/gateworks/gw_ventana/gsc.c b/board/gateworks/gw_ventana/gsc.c index bcb6bca..ffed6b5 100644 --- a/board/gateworks/gw_ventana/gsc.c +++ b/board/gateworks/gw_ventana/gsc.c @@ -14,6 +14,8 @@ #include <i2c.h> #include <linux/ctype.h> +#include <asm/arch/sys_proto.h> + #include "ventana_eeprom.h" #include "gsc.h" @@ -179,6 +181,92 @@ int gsc_boot_wd_disable(void) return 1; } +/* determine BOM revision from model */ +int get_bom_rev(const char *str) +{ + int rev_bom = 0; + int i; + + for (i = strlen(str) - 1; i > 0; i--) { + if (str[i] == '-') + break; + if (str[i] >= '1' && str[i] <= '9') { + rev_bom = str[i] - '0'; + break; + } + } + return rev_bom; +} + +/* determine PCB revision from model */ +char get_pcb_rev(const char *str) +{ + char rev_pcb = 'A'; + int i; + + for (i = strlen(str) - 1; i > 0; i--) { + if (str[i] == '-') + break; + if (str[i] >= 'A') { + rev_pcb = str[i]; + break; + } + } + return rev_pcb; +} + +/* + * get dt name based on model and detail level: + */ +const char *gsc_get_dtb_name(int level, char *buf, int sz) +{ + const char *model = (const char *)ventana_info.model; + const char *pre = is_mx6dq() ? "imx6q-" : "imx6dl-"; + int modelno, rev_pcb, rev_bom; + + /* a few board models are dt equivalents to other models */ + if (strncasecmp(model, "gw5906", 6) == 0) + model = "gw552x-d"; + else if (strncasecmp(model, "gw5908", 6) == 0) + model = "gw53xx-f"; + else if (strncasecmp(model, "gw5905", 6) == 0) + model = "gw5904-a"; + + modelno = ((model[2] - '0') * 1000) + + ((model[3] - '0') * 100) + + ((model[4] - '0') * 10) + + (model[5] - '0'); + rev_pcb = tolower(get_pcb_rev(model)); + rev_bom = get_bom_rev(model); + + /* compare model/rev/bom in order of most specific to least */ + snprintf(buf, sz, "%s%04d", pre, modelno); + switch (level) { + case 0: /* full model first (ie gw5400-a1) */ + if (rev_bom) { + snprintf(buf, sz, "%sgw%04d-%c%d", pre, modelno, rev_pcb, rev_bom); + break; + } + fallthrough; + case 1: /* don't care about bom rev (ie gw5400-a) */ + snprintf(buf, sz, "%sgw%04d-%c", pre, modelno, rev_pcb); + break; + case 2: /* don't care about the pcb rev (ie gw5400) */ + snprintf(buf, sz, "%sgw%04d", pre, modelno); + break; + case 3: /* look for generic model (ie gw540x) */ + snprintf(buf, sz, "%sgw%03dx", pre, modelno / 10); + break; + case 4: /* look for more generic model (ie gw54xx) */ + snprintf(buf, sz, "%sgw%02dxx", pre, modelno / 100); + break; + default: /* give up */ + return NULL; + } + + return buf; +} + #if defined(CONFIG_CMD_GSC) && !defined(CONFIG_SPL_BUILD) static int do_gsc_sleep(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) diff --git a/board/gateworks/gw_ventana/gsc.h b/board/gateworks/gw_ventana/gsc.h index 6dcaafa..29d375b 100644 --- a/board/gateworks/gw_ventana/gsc.h +++ b/board/gateworks/gw_ventana/gsc.h @@ -67,5 +67,6 @@ int gsc_i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len); int gsc_i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len); int gsc_info(int verbose); int gsc_boot_wd_disable(void); +const char *gsc_get_dtb_name(int level, char *buf, int sz); #endif diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index 71de80c..5237f2d 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -19,17 +19,14 @@ #include <asm/gpio.h> #include <asm/mach-imx/boot_mode.h> #include <asm/mach-imx/sata.h> -#include <asm/mach-imx/spi.h> #include <asm/mach-imx/video.h> #include <asm/io.h> #include <asm/setup.h> #include <dm.h> -#include <dm/platform_data/serial_mxc.h> #include <env.h> #include <hwconfig.h> #include <i2c.h> #include <fdt_support.h> -#include <fsl_esdhc_imx.h> #include <jffs2/load_kernel.h> #include <linux/ctype.h> #include <miiphy.h> @@ -43,7 +40,6 @@ #include <power/pfuze100_pmic.h> #include <fdt_support.h> #include <jffs2/load_kernel.h> -#include <spi_flash.h> #include "gsc.h" #include "common.h" @@ -56,7 +52,6 @@ DECLARE_GLOBAL_DATA_PTR; * read it once. */ struct ventana_board_info ventana_info; - static int board_type; /* ENET */ @@ -83,54 +78,6 @@ static iomux_v3_cfg_t const enet_pads[] = { IOMUX_PADS(PAD_ENET_TXD0__GPIO1_IO30 | DIO_PAD_CFG), }; -#ifdef CONFIG_CMD_NAND -static iomux_v3_cfg_t const nfc_pads[] = { - IOMUX_PADS(PAD_NANDF_CLE__NAND_CLE | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_ALE__NAND_ALE | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_WP_B__NAND_WP_B | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_RB0__NAND_READY_B | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_CS0__NAND_CE0_B | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_SD4_CMD__NAND_RE_B | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_SD4_CLK__NAND_WE_B | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D0__NAND_DATA00 | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D1__NAND_DATA01 | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D2__NAND_DATA02 | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D3__NAND_DATA03 | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D4__NAND_DATA04 | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D5__NAND_DATA05 | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D6__NAND_DATA06 | MUX_PAD_CTRL(NO_PAD_CTRL)), - IOMUX_PADS(PAD_NANDF_D7__NAND_DATA07 | MUX_PAD_CTRL(NO_PAD_CTRL)), -}; - -static void setup_gpmi_nand(void) -{ - struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; - - /* config gpmi nand iomux */ - SETUP_IOMUX_PADS(nfc_pads); - - /* config gpmi and bch clock to 100 MHz */ - clrsetbits_le32(&mxc_ccm->cs2cdr, - MXC_CCM_CS2CDR_ENFC_CLK_PODF_MASK | - MXC_CCM_CS2CDR_ENFC_CLK_PRED_MASK | - MXC_CCM_CS2CDR_ENFC_CLK_SEL_MASK, - MXC_CCM_CS2CDR_ENFC_CLK_PODF(0) | - MXC_CCM_CS2CDR_ENFC_CLK_PRED(3) | - MXC_CCM_CS2CDR_ENFC_CLK_SEL(3)); - - /* enable gpmi and bch clock gating */ - setbits_le32(&mxc_ccm->CCGR4, - MXC_CCM_CCGR4_RAWNAND_U_BCH_INPUT_APB_MASK | - MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_BCH_MASK | - MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_GPMI_IO_MASK | - MXC_CCM_CCGR4_RAWNAND_U_GPMI_INPUT_APB_MASK | - MXC_CCM_CCGR4_PL301_MX6QPER1_BCH_OFFSET); - - /* enable apbh clock gating */ - setbits_le32(&mxc_ccm->CCGR0, MXC_CCM_CCGR0_APBHDMA_MASK); -} -#endif - static void setup_iomux_enet(int gpio) { SETUP_IOMUX_PADS(enet_pads); @@ -144,18 +91,14 @@ static void setup_iomux_enet(int gpio) } #ifdef CONFIG_USB_EHCI_MX6 -static iomux_v3_cfg_t const usb_pads[] = { - IOMUX_PADS(PAD_GPIO_1__USB_OTG_ID | DIO_PAD_CFG), - IOMUX_PADS(PAD_KEY_COL4__USB_OTG_OC | DIO_PAD_CFG), - /* OTG PWR */ - IOMUX_PADS(PAD_EIM_D22__GPIO3_IO22 | DIO_PAD_CFG), -}; - +/* toggle USB_HUB_RST# for boards that have it; it is not defined in dt */ int board_ehci_hcd_init(int port) { int gpio; - SETUP_IOMUX_PADS(usb_pads); + /* USB HUB is always on P1 */ + if (port == 0) + return 0; /* Reset USB HUB */ switch (board_type) { @@ -180,40 +123,8 @@ int board_ehci_hcd_init(int port) return 0; } - -int board_ehci_power(int port, int on) -{ - /* enable OTG VBUS */ - if (!port && board_type < GW_UNKNOWN) { - if (gpio_cfg[board_type].otgpwr_en) - gpio_set_value(gpio_cfg[board_type].otgpwr_en, on); - } - return 0; -} #endif /* CONFIG_USB_EHCI_MX6 */ -#ifdef CONFIG_MXC_SPI -iomux_v3_cfg_t const ecspi1_pads[] = { - /* SS1 */ - IOMUX_PADS(PAD_EIM_D19__GPIO3_IO19 | MUX_PAD_CTRL(SPI_PAD_CTRL)), - IOMUX_PADS(PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL)), - IOMUX_PADS(PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL)), - IOMUX_PADS(PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL)), -}; - -int board_spi_cs_gpio(unsigned bus, unsigned cs) -{ - return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(3, 19)) : -1; -} - -static void setup_spi(void) -{ - gpio_request(IMX_GPIO_NR(3, 19), "spi_cs"); - gpio_direction_output(IMX_GPIO_NR(3, 19), 1); - SETUP_IOMUX_PADS(ecspi1_pads); -} -#endif - /* configure eth0 PHY board-specific LED behavior */ int board_phy_config(struct phy_device *phydev) { @@ -629,8 +540,6 @@ void get_board_serial(struct tag_serialnr *serialnr) int board_early_init_f(void) { - setup_iomux_uart(); - #if defined(CONFIG_VIDEO_IPUV3) setup_display(); #endif @@ -658,25 +567,33 @@ int board_init(void) setup_ventana_i2c(0); board_type = read_eeprom(CONFIG_I2C_GSC, &ventana_info); -#ifdef CONFIG_CMD_NAND - if (gpio_cfg[board_type].nand) - setup_gpmi_nand(); -#endif -#ifdef CONFIG_MXC_SPI - setup_spi(); -#endif setup_ventana_i2c(1); setup_ventana_i2c(2); -#ifdef CONFIG_SATA - setup_sata(); -#endif - setup_iomux_gpio(board_type, &ventana_info); return 0; } +int board_fit_config_name_match(const char *name) +{ + static char init; + const char *dtb; + char buf[32]; + int i = 0; + + do { + dtb = gsc_get_dtb_name(i++, buf, sizeof(buf)); + if (dtb && !strcmp(dtb, name)) { + if (!init++) + printf("DTB: %s\n", name); + return 0; + } + } while (dtb); + + return -1; +} + #if defined(CONFIG_DISPLAY_BOARDINFO_LATE) /* * called during late init (after relocation and after board_init()) @@ -1371,12 +1288,3 @@ int ft_board_setup(void *blob, struct bd_info *bd) return 0; } #endif /* CONFIG_OF_BOARD_SETUP */ - -static struct mxc_serial_plat ventana_mxc_serial_plat = { - .reg = (struct mxc_uart *)UART2_BASE, -}; - -U_BOOT_DRVINFO(ventana_serial) = { - .name = "serial_mxc", - .plat = &ventana_mxc_serial_plat, -}; diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c index e0e4bac..a4f6439 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -731,8 +731,16 @@ void board_boot_order(u32 *spl_boot_list) /* its our chance to print info about boot device */ void spl_board_init(void) { + u32 boot_device; + int board_type; + /* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 */ - u32 boot_device = spl_boot_device(); + boot_device = spl_boot_device(); + + /* read eeprom again now that we have gd */ + board_type = read_eeprom(CONFIG_I2C_GSC, &ventana_info); + if (board_type == GW_UNKNOWN) + hang(); switch (boot_device) { case BOOT_DEVICE_MMC1: diff --git a/board/gateworks/venice/gsc.c b/board/gateworks/venice/gsc.c index ad3f8d9..d2490e6 100644 --- a/board/gateworks/venice/gsc.c +++ b/board/gateworks/venice/gsc.c @@ -125,29 +125,18 @@ enum { static struct udevice *gsc_get_dev(int busno, int slave) { - struct udevice *dev; + static const char * const i2c[] = { "i2c@30a20000", "i2c@30a30000" }; + struct udevice *dev, *bus; int ret; -#if (IS_ENABLED(CONFIG_SPL_BUILD)) - ret = i2c_get_chip_for_busnum(busno + 1, slave, 1, &dev); - if (ret) - return NULL; -#else - struct udevice *bus; - - busno--; - - ret = uclass_get_device_by_seq(UCLASS_I2C, busno, &bus); + ret = uclass_get_device_by_name(UCLASS_I2C, i2c[busno - 1], &bus); if (ret) { - printf("i2c%d: no bus %d\n", busno + 1, ret); + printf("GSC : failed I2C%d probe: %d\n", busno, ret); return NULL; } - ret = i2c_get_chip(bus, slave, 1, &dev); - if (ret) { - printf("i2c%d@0x%02x: no chip %d\n", busno + 1, slave, ret); + ret = dm_i2c_probe(bus, slave, 0, &dev); + if (ret) return NULL; - } -#endif return dev; } |