diff options
Diffstat (limited to 'board/gateworks')
-rw-r--r-- | board/gateworks/gw_ventana/gw_ventana.c | 50 | ||||
-rw-r--r-- | board/gateworks/venice/README | 2 | ||||
-rw-r--r-- | board/gateworks/venice/spl.c | 42 |
3 files changed, 44 insertions, 50 deletions
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index 0ecfd98c226..683def7e9f7 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -83,44 +83,30 @@ int board_phy_config(struct phy_device *phydev) break; } + /* Fixed PHY: for GW5904/GW5909 this is Marvell 88E6176 GbE Switch */ + if (phydev->phy_id == PHY_FIXED_ID && + (board_type == GW5904 || board_type == GW5909)) { + struct mii_dev *bus = miiphy_get_dev_by_name("mdio"); + + puts("MV88E61XX "); + /* GPIO[0] output CLK125 for RGMII_REFCLK */ + bus->write(bus, 0x1c, 0, 0x1a, (1 << 15) | (0x62 << 8) | 0xfe); + bus->write(bus, 0x1c, 0, 0x1a, (1 << 15) | (0x68 << 8) | 7); + + /* Port 0-3 LED configuration: Table 80/82 */ + /* LED configuration: 7:4-green (8=Activity) 3:0 amber (8=Link) */ + bus->write(bus, 0x10, 0, 0x16, 0x8088); + bus->write(bus, 0x11, 0, 0x16, 0x8088); + bus->write(bus, 0x12, 0, 0x16, 0x8088); + bus->write(bus, 0x13, 0, 0x16, 0x8088); + } + if (phydev->drv->config) phydev->drv->config(phydev); return 0; } -#ifdef CONFIG_MV88E61XX_SWITCH -int mv88e61xx_hw_reset(struct phy_device *phydev) -{ - struct mii_dev *bus = phydev->bus; - - /* GPIO[0] output, CLK125 */ - debug("enabling RGMII_REFCLK\n"); - bus->write(bus, 0x1c /*MV_GLOBAL2*/, 0, - 0x1a /*MV_SCRATCH_MISC*/, - (1 << 15) | (0x62 /*MV_GPIO_DIR*/ << 8) | 0xfe); - bus->write(bus, 0x1c /*MV_GLOBAL2*/, 0, - 0x1a /*MV_SCRATCH_MISC*/, - (1 << 15) | (0x68 /*MV_GPIO01_CNTL*/ << 8) | 7); - - /* RGMII delay - Physical Control register bit[15:14] */ - debug("setting port%d RGMII rx/tx delay\n", CONFIG_MV88E61XX_CPU_PORT); - /* forced 1000mbps full-duplex link */ - bus->write(bus, 0x10 + CONFIG_MV88E61XX_CPU_PORT, 0, 1, 0xc0fe); - phydev->autoneg = AUTONEG_DISABLE; - phydev->speed = SPEED_1000; - phydev->duplex = DUPLEX_FULL; - - /* LED configuration: 7:4-green (8=Activity) 3:0 amber (8=Link) */ - bus->write(bus, 0x10, 0, 0x16, 0x8088); - bus->write(bus, 0x11, 0, 0x16, 0x8088); - bus->write(bus, 0x12, 0, 0x16, 0x8088); - bus->write(bus, 0x13, 0, 0x16, 0x8088); - - return 0; -} -#endif // CONFIG_MV88E61XX_SWITCH - #if defined(CONFIG_VIDEO_IPUV3) static void enable_hdmi(struct display_info_t const *dev) { diff --git a/board/gateworks/venice/README b/board/gateworks/venice/README index 9f3a250bb66..ea9b8348a7d 100644 --- a/board/gateworks/venice/README +++ b/board/gateworks/venice/README @@ -10,7 +10,7 @@ Quick Start Get and Build the ARM Trusted firmware ====================================== -$ git clone https://source.codeaurora.org/external/imx/imx-atf +$ git clone https://github.com/nxp-imx/imx-atf $ git checkout imx_5.4.47_2.2.0 $ make PLAT=imx8mm CROSS_COMPILE=aarch64-linux-gnu- bl31 $ cp build/imx8mm/release/bl31.bin . diff --git a/board/gateworks/venice/spl.c b/board/gateworks/venice/spl.c index e06de8bb54c..4eb7bdfcee6 100644 --- a/board/gateworks/venice/spl.c +++ b/board/gateworks/venice/spl.c @@ -16,10 +16,12 @@ #include <asm/arch/imx8mp_pins.h> #include <asm/arch/sys_proto.h> #include <asm/mach-imx/boot_mode.h> +#include <asm/mach-imx/mxc_i2c.h> #include <asm/arch/ddr.h> #include <asm-generic/gpio.h> #include <dm/uclass.h> #include <dm/device.h> +#include <dm/pinctrl.h> #include <linux/delay.h> #include <power/bd71837.h> #include <power/mp5416.h> @@ -165,9 +167,6 @@ static int power_init_board(void) /* Kernel uses OD/OD freq for SOC */ /* To avoid timing risk from SOC to ARM, increase VDD_ARM to OD voltage 0.95v */ dm_i2c_reg_write(dev, PCA9450_BUCK2OUT_DVS0, 0x1C); - - /* set WDOG_B_CFG to cold reset */ - dm_i2c_reg_write(dev, PCA9450_RESET_CTRL, 0xA1); } else if ((!strncmp(model, "GW7901", 6)) || @@ -218,8 +217,8 @@ static int power_init_board(void) void board_init_f(ulong dummy) { - struct udevice *dev; - int ret; + struct udevice *bus, *dev; + int i, ret; int dram_sz; arch_cpu_init(); @@ -250,19 +249,28 @@ void board_init_f(ulong dummy) * * On a board with a missing/depleted backup battery for GSC, the * board may be ready to probe the GSC before its firmware is - * running. We will wait here indefinately for the GSC EEPROM. + * running. Wait here for 50ms for the GSC firmware to let go of + * the SCL/SDA lines to avoid the i2c driver spamming + * 'Arbitration lost' I2C errors */ -#ifdef CONFIG_IMX8MN - /* - * IMX8MN boots quicker than IMX8MM and exposes issue - * where because GSC I2C state machine isn't running and its - * SCL/SDA are driven low the I2C driver spams 'Arbitration lost' - * I2C errors. - * - * TODO: Put a loop here that somehow waits for I2C CLK/DAT to be high - */ - mdelay(50); -#endif + if (!uclass_get_device_by_seq(UCLASS_I2C, 0, &bus)) { + if (!pinctrl_select_state(bus, "gpio")) { + struct mxc_i2c_bus *i2c_bus = dev_get_priv(bus); + struct gpio_desc *scl_gpio = &i2c_bus->scl_gpio; + struct gpio_desc *sda_gpio = &i2c_bus->sda_gpio; + + dm_gpio_set_dir_flags(scl_gpio, GPIOD_IS_IN); + dm_gpio_set_dir_flags(sda_gpio, GPIOD_IS_IN); + for (i = 0; i < 5; i++) { + if (dm_gpio_get_value(scl_gpio) && + dm_gpio_get_value(sda_gpio)) + break; + mdelay(10); + } + pinctrl_select_state(bus, "default"); + } + } + /* Wait indefiniately until the GSC probes */ while (1) { if (!uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(gsc), &dev)) break; |