[U-Boot] [PATCH v1 09/11] DM: display5: Convert display5 board to use DM/DTS

Peng Fan peng.fan at nxp.com
Mon Jun 10 01:45:53 UTC 2019


> Subject: [PATCH v1 09/11] DM: display5: Convert display5 board to use
> DM/DTS
> 
> This commit converts display5 board (also its 'factory' variant) to use DM/DTS.
> 
> The change has been made in a single patch to avoid problems with
> unbuildable commits (as DM conversion breaks some of them).
> 
> Notable changes (DM/DTS conversion):
> 
> - PINCTRL{_IMX6}
> - DM_I2C
> - enable 'regulator' and 'pmic' commands
> - DM_MMC and BLK (USDHC)
> - DM_ETH
> - DM_SPI and DM_SPI_FLASH (but no in SPL)
> - DM WDT (including SYSRESET)
> - Update display5_factory_defconfig after switch to DM/DTS and uuu utility
> 
> Note regarding 'display5_factory_defconfig'
> 
> The VID and PID for SPL running SDP gadget have been updated to allow
> seamless work with 'uuu' utility from NXP (the imx_usb doesn't work properly
> after embedding the u-boot proper into fitImage - problem with IVT
> embedding in FIT).
> 
> Example to use 'uuu' session:
> 
> cat << EOF > display5_recovery.lst
> uuu_version 1.2.135
> SDP: boot -f /srv/tftp/SPL
> SDPU: write -f /srv/tftp/u-boot-dtb.img -addr 0x10000000
> SDPU: jump -addr 0x10000000
> SDPU: done
> EOF
> 
> sudo ./uuu/uuu display5_recovery.lst
> 
> Signed-off-by: Lukasz Majewski <lukma at denx.de>
> ---
> 
>  arch/arm/dts/imx6q-display5-u-boot.dtsi |   5 +
>  arch/arm/mach-imx/mx6/Kconfig           |   5 +
>  board/liebherr/display5/common.c        |  24 ----
>  board/liebherr/display5/common.h        |   2 -
>  board/liebherr/display5/display5.c      | 225 ++++----------------------------
>  configs/display5_defconfig              |  29 ++++
>  configs/display5_factory_defconfig      |  43 +++++-
>  include/configs/display5.h              |  29 ++--
>  8 files changed, 115 insertions(+), 247 deletions(-)
> 
> diff --git a/arch/arm/dts/imx6q-display5-u-boot.dtsi
> b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> index b942218b7a..aa660b5aeb 100644
> --- a/arch/arm/dts/imx6q-display5-u-boot.dtsi
> +++ b/arch/arm/dts/imx6q-display5-u-boot.dtsi
> @@ -31,6 +31,11 @@
>  	chosen {
>  		stdout-path = &uart5;
>  	};
> +
> +	wdt-reboot {
> +		compatible = "wdt-reboot";
> +		wdt = <&wdog1>;
> +	};
>  };
> 
>  &i2c3 {
> diff --git a/arch/arm/mach-imx/mx6/Kconfig
> b/arch/arm/mach-imx/mx6/Kconfig index f513c4c06f..da00cf611e 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -187,6 +187,11 @@ config TARGET_DHCOMIMX6  config
> TARGET_DISPLAY5
>  	bool "LWN DISPLAY5 board"
>  	select DM
> +	select DM_ETH
> +	select DM_I2C
> +	select DM_MMC
> +	select DM_SPI
> +	select DM_GPIO
>  	select DM_SERIAL
>  	select SUPPORT_SPL
>  	imply CMD_DM
> diff --git a/board/liebherr/display5/common.c
> b/board/liebherr/display5/common.c
> index 48b5c1a6f5..2b3253d88d 100644
> --- a/board/liebherr/display5/common.c
> +++ b/board/liebherr/display5/common.c
> @@ -45,18 +45,6 @@ void displ5_set_iomux_misc_spl(void)  }
> 
>  #ifdef CONFIG_MXC_SPI
> -iomux_v3_cfg_t const ecspi_pads[] = {
> -	/* SPI3 */
> -	MX6_PAD_DISP0_DAT2__ECSPI3_MISO	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT1__ECSPI3_MOSI	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT0__ECSPI3_SCLK	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT3__ECSPI3_SS0	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT4__ECSPI3_SS1	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT5__ECSPI3_SS2	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT6__ECSPI3_SS3	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -	MX6_PAD_DISP0_DAT7__ECSPI3_RDY	|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -};
> -
>  iomux_v3_cfg_t const ecspi2_pads[] = {
>  	/* SPI2, NOR Flash nWP, CS0 */
>  	MX6_PAD_CSI0_DAT10__ECSPI2_MISO	|
> MUX_PAD_CTRL(SPI_PAD_CTRL),
> @@ -79,14 +67,8 @@ void displ5_set_iomux_ecspi_spl(void)
>  	SETUP_IOMUX_PADS(ecspi2_pads);
>  }
> 
> -void displ5_set_iomux_ecspi(void)
> -{
> -	SETUP_IOMUX_PADS(ecspi_pads);
> -}
> -
>  #else
>  void displ5_set_iomux_ecspi_spl(void) {} -void displ5_set_iomux_ecspi(void)
> {}  #endif
> 
>  #ifdef CONFIG_FSL_ESDHC
> @@ -109,12 +91,6 @@ void displ5_set_iomux_usdhc_spl(void)
>  	SETUP_IOMUX_PADS(usdhc4_pads);
>  }
> 
> -void displ5_set_iomux_usdhc(void)
> -{
> -	SETUP_IOMUX_PADS(usdhc4_pads);
> -}
> -
>  #else
>  void displ5_set_iomux_usdhc_spl(void) {} -void displ5_set_iomux_usdhc(void)
> {}  #endif diff --git a/board/liebherr/display5/common.h
> b/board/liebherr/display5/common.h
> index 78c64b02e2..2bbd934e7a 100644
> --- a/board/liebherr/display5/common.h
> +++ b/board/liebherr/display5/common.h
> @@ -34,9 +34,7 @@
>  void displ5_set_iomux_uart_spl(void);
>  void displ5_set_iomux_uart(void);
>  void displ5_set_iomux_ecspi_spl(void);
> -void displ5_set_iomux_ecspi(void);
>  void displ5_set_iomux_usdhc_spl(void);
> -void displ5_set_iomux_usdhc(void);
>  void displ5_set_iomux_misc_spl(void);
> 
>  #endif /* __DISPL5_COMMON_H_ */
> diff --git a/board/liebherr/display5/display5.c
> b/board/liebherr/display5/display5.c
> index 410d5bc782..6592f0c3ca 100644
> --- a/board/liebherr/display5/display5.c
> +++ b/board/liebherr/display5/display5.c
> @@ -17,25 +17,14 @@
>  #include <asm/gpio.h>
>  #include <malloc.h>
>  #include <asm/mach-imx/iomux-v3.h>
> -#include <asm/mach-imx/mxc_i2c.h>
>  #include <asm/mach-imx/boot_mode.h>
> -#include <asm/mach-imx/spi.h>
> -#include <mmc.h>
> -#include <fsl_esdhc.h>
>  #include <miiphy.h>
> -#include <netdev.h>
> -#include <i2c.h>
>  #include <environment.h>
> 
>  #include <dm.h>
>  #include <dm/platform_data/serial_mxc.h>  #include <dm/platdata.h>
> 
> -#ifndef CONFIG_MXC_SPI
> -#error "CONFIG_SPI must be set for this board"
> -#error "Please check your config file"
> -#endif
> -
>  #include "common.h"
> 
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -119,49 +108,6 @@ int dram_init(void)
>  	return 0;
>  }
> 
> -#define PC	MUX_PAD_CTRL(I2C_PAD_CTRL)
> -/* I2C1: TFA9879 */
> -struct i2c_pads_info i2c_pad_info0 = {
> -	.scl = {
> -		.i2c_mode = MX6_PAD_EIM_D21__I2C1_SCL | PC,
> -		.gpio_mode = MX6_PAD_EIM_D21__GPIO3_IO21 | PC,
> -		.gp = IMX_GPIO_NR(3, 21)
> -	},
> -	.sda = {
> -		.i2c_mode = MX6_PAD_EIM_D28__I2C1_SDA | PC,
> -		.gpio_mode = MX6_PAD_EIM_D28__GPIO3_IO28 | PC,
> -		.gp = IMX_GPIO_NR(3, 28)
> -	}
> -};
> -
> -/* I2C2: TIVO TM4C123 */
> -struct i2c_pads_info i2c_pad_info1 = {
> -	.scl = {
> -		.i2c_mode = MX6_PAD_EIM_EB2__I2C2_SCL | PC,
> -		.gpio_mode = MX6_PAD_EIM_EB2__GPIO2_IO30 | PC,
> -		.gp = IMX_GPIO_NR(2, 30)
> -	},
> -	.sda = {
> -		.i2c_mode = MX6_PAD_EIM_D16__I2C2_SDA | PC,
> -		.gpio_mode = MX6_PAD_EIM_D16__GPIO3_IO16 | PC,
> -		.gp = IMX_GPIO_NR(3, 16)
> -	}
> -};
> -
> -/* I2C3: PMIC PF0100, EEPROM AT24C256C */ -struct i2c_pads_info
> i2c_pad_info2 = {
> -	.scl = {
> -		.i2c_mode = MX6_PAD_EIM_D17__I2C3_SCL | PC,
> -		.gpio_mode = MX6_PAD_EIM_D17__GPIO3_IO17 | PC,
> -		.gp = IMX_GPIO_NR(3, 17)
> -	},
> -	.sda = {
> -		.i2c_mode = MX6_PAD_EIM_D18__I2C3_SDA | PC,
> -		.gpio_mode = MX6_PAD_EIM_D18__GPIO3_IO18 | PC,
> -		.gp = IMX_GPIO_NR(3, 18)
> -	}
> -};
> -
>  iomux_v3_cfg_t const misc_pads[] = {
>  	/* Prod ID GPIO pins */
>  	MX6_PAD_NANDF_D4__GPIO2_IO04    |
> MUX_PAD_CTRL(NO_PAD_CTRL),
> @@ -186,174 +132,48 @@ iomux_v3_cfg_t const misc_pads[] = {
>  	MX6_PAD_EIM_D29__GPIO3_IO29 |
> MUX_PAD_CTRL(NO_PAD_CTRL),  };
> 
> -#ifdef CONFIG_FSL_ESDHC
> -struct fsl_esdhc_cfg usdhc_cfg[1] = {
> -	{ USDHC4_BASE_ADDR, 0, 8, },
> -};
> -
> -int board_mmc_getcd(struct mmc *mmc)
> +/*
> + * Do not overwrite the console
> + * Always use serial for U-Boot console  */ int overwrite_console(void)
>  {
>  	return 1;
>  }
> 
> -int board_mmc_init(bd_t *bis)
> -{
> -	displ5_set_iomux_usdhc();
> -
> -	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
> -
> -	return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
> -}
> -#endif /* CONFIG_FSL_ESDHC */
> -
> -static void displ5_setup_ecspi(void)
> -{
> -	int ret;
> -
> -	displ5_set_iomux_ecspi();
> -
> -	ret = gpio_request(IMX_GPIO_NR(5, 29), "spi2_cs0");
> -	if (!ret)
> -		gpio_direction_output(IMX_GPIO_NR(5, 29), 1);
> -
> -	ret = gpio_request(IMX_GPIO_NR(7, 0), "spi2_#wp");
> -	if (!ret)
> -		gpio_direction_output(IMX_GPIO_NR(7, 0), 1);
> -}
> -
> -#ifdef CONFIG_FEC_MXC
> -iomux_v3_cfg_t const enet_pads[] = {
> -	MX6_PAD_ENET_TXD1__ENET_1588_EVENT0_IN	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT |
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_MDIO__ENET_MDIO		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_MDC__ENET_MDC		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_ENET_REF_CLK__ENET_TX_CLK	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -
> -	/* for old evalboard with R159 present and R160 not populated */
> -	MX6_PAD_GPIO_16__ENET_REF_CLK		|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -
> -	MX6_PAD_RGMII_TXC__RGMII_TXC		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD0__RGMII_TD0		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD1__RGMII_TD1		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD2__RGMII_TD2		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TD3__RGMII_TD3		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -
> -	MX6_PAD_RGMII_RXC__RGMII_RXC		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD0__RGMII_RD0		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD1__RGMII_RD1		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD2__RGMII_RD2		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RD3__RGMII_RD3		|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL	|
> MUX_PAD_CTRL(ENET_PAD_CTRL),
> -	/*INT#_GBE*/
> -	MX6_PAD_ENET_TX_EN__GPIO1_IO28		|
> MUX_PAD_CTRL(NO_PAD_CTRL),
> -};
> -
> -static void setup_iomux_enet(void)
> -{
> -	SETUP_IOMUX_PADS(enet_pads);
> -	gpio_direction_input(IMX_GPIO_NR(1, 28)); /*INT#_GBE*/
> -}
> -
> -static int setup_mac_from_fuse(void)
> +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
> int
> +ft_board_setup(void *blob, bd_t *bd)
>  {
> -	unsigned char enetaddr[6];
> -	int ret;
> -
> -	ret = eth_env_get_enetaddr("ethaddr", enetaddr);
> -	if (ret)	/* ethaddr is already set */
> -		return 0;
> -
> -	imx_get_mac_from_fuse(0, enetaddr);
> -
> -	if (is_valid_ethaddr(enetaddr)) {
> -		eth_env_set_enetaddr("ethaddr", enetaddr);
> -		return 0;
> -	}
> -
> +	fdt_fixup_ethernet(blob);
>  	return 0;
>  }
> +#endif
> 
> -int board_eth_init(bd_t *bd)
> +int board_phy_config(struct phy_device *phydev)
>  {
> -	struct phy_device *phydev;
> -	struct mii_dev *bus;
> -	int ret;
> -
> -	setup_iomux_enet();
> -
> -	iomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);
> -
> -	ret = enable_fec_anatop_clock(0, ENET_125MHZ);
> -	if (ret)
> -		return ret;
> -
> -	setup_mac_from_fuse();
> -
> -	bus = fec_get_miibus(IMX_FEC_BASE, -1);
> -	if (!bus)
> -		return -ENODEV;
> -
> -	/*
> -	 * We use here the "rgmii-id" mode of operation and allow M88E1512
> -	 * PHY to use its internally callibrated RX/TX delays
> -	 */
> -	phydev = phy_find_by_mask(bus, 0xffffffff /* (0xf << 4) */,
> -				  PHY_INTERFACE_MODE_RGMII_ID);
> -	if (!phydev) {
> -		ret = -ENODEV;
> -		goto err_phy;
> -	}
> -
>  	/* display5 due to PCB routing can only work with 100 Mbps */
>  	phydev->advertising &= ~(ADVERTISED_1000baseX_Half |
>  				 ADVERTISED_1000baseX_Full |
>  				 SUPPORTED_1000baseT_Half |
>  				 SUPPORTED_1000baseT_Full);
> 
> -	ret  = fec_probe(bd, -1, IMX_FEC_BASE, bus, phydev);
> -	if (ret)
> -		goto err_sw;
> +	if (phydev->drv->config)
> +		return phydev->drv->config(phydev);
> 
>  	return 0;
> -
> -err_sw:
> -	free(phydev);
> -err_phy:
> -	mdio_unregister(bus);
> -	free(bus);
> -	return ret;
>  }
> -#endif /* CONFIG_FEC_MXC */
> -
> -/*
> - * Do not overwrite the console
> - * Always use serial for U-Boot console
> - */
> -int overwrite_console(void)
> -{
> -	return 1;
> -}
> -
> -#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
> -int ft_board_setup(void *blob, bd_t *bd) -{
> -	fdt_fixup_ethernet(blob);
> -	return 0;
> -}
> -#endif
> 
>  int board_init(void)
>  {
> +	int ret;
> +
>  	debug("board init\n");
>  	/* address of boot parameters */
>  	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
> 
>  	/* Setup iomux for non console UARTS */
>  	displ5_set_iomux_uart();
> -
> -	displ5_setup_ecspi();
> -
> +	/* Setup misc (application specific) stuff */
>  	SETUP_IOMUX_PADS(misc_pads);
> 
>  	get_board_id(gpio_table_sw_ids, &gpio_table_sw_ids_names[0], @@
> -369,9 +189,18 @@ int board_init(void)
> 
>  	udelay(25);
> 
> -	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0);
> -	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
> -	setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
> +	/* Setup low level FEC (ETH) */
> +	ret = gpio_request(IMX_GPIO_NR(1, 28), "INT_GBE");
> +	if (!ret)
> +		gpio_direction_input(IMX_GPIO_NR(1, 28)); /*INT#_GBE*/
> +
> +	iomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);
> +	enable_fec_anatop_clock(0, ENET_125MHZ);
> +
> +	/* Setup #WP for SPI-NOR memory */
> +	ret = gpio_request(IMX_GPIO_NR(7, 0), "spi2_#wp");
> +	if (!ret)
> +		gpio_direction_output(IMX_GPIO_NR(7, 0), 1);
> 
>  	return 0;
>  }
> diff --git a/configs/display5_defconfig b/configs/display5_defconfig index
> 0ef56024e9..6fca4d059b 100644
> --- a/configs/display5_defconfig
> +++ b/configs/display5_defconfig
> @@ -46,13 +46,17 @@ CONFIG_CMD_GPT=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
>  CONFIG_CMD_PART=y
> +# CONFIG_CMD_PINMUX is not set
>  CONFIG_CMD_SF=y
>  CONFIG_CMD_SPI=y
> +CONFIG_CMD_WDT=y
>  CONFIG_CMD_DHCP=y
>  CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
>  CONFIG_CMD_CACHE=y
>  CONFIG_CMD_TIME=y
> +CONFIG_CMD_PMIC=y
> +CONFIG_CMD_REGULATOR=y
>  CONFIG_CMD_EXT2=y
>  CONFIG_CMD_EXT4=y
>  CONFIG_CMD_FAT=y
> @@ -66,20 +70,45 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5"
>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_BOOTLIMIT=3
> +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
> +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x2
> +CONFIG_SYS_I2C_MXC=y
> +CONFIG_SYS_I2C_MXC_I2C1=y
> +CONFIG_SYS_I2C_MXC_I2C2=y
> +CONFIG_SYS_I2C_MXC_I2C3=y
> +CONFIG_MISC=y
> +CONFIG_I2C_EEPROM=y
> +CONFIG_SYS_I2C_EEPROM_ADDR=0x50
> +CONFIG_SYS_I2C_EEPROM_BUS=2
> +CONFIG_SYS_EEPROM_SIZE=32768
> +CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
> +CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_FSL_ESDHC=y
>  CONFIG_MTD_DEVICE=y
> +CONFIG_DM_SPI_FLASH=y
>  CONFIG_SPI_FLASH=y
>  CONFIG_SF_DEFAULT_BUS=1
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=50000000
> +CONFIG_SPI_FLASH_SFDP_SUPPORT=y
>  CONFIG_SPI_FLASH_SPANSION=y
>  CONFIG_SPI_FLASH_STMICRO=y
> +CONFIG_SPI_FLASH_MTD=y
>  CONFIG_PHYLIB=y
>  CONFIG_PHY_MARVELL=y
>  CONFIG_FEC_MXC=y
>  CONFIG_MII=y
> +CONFIG_PINCTRL=y
> +CONFIG_PINCTRL_IMX6=y
> +CONFIG_DM_PMIC=y
> +CONFIG_DM_PMIC_PFUZE100=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_PFUZE100=y
>  CONFIG_MXC_UART=y
>  CONFIG_SPI=y
>  CONFIG_MXC_SPI=y
> +CONFIG_SYSRESET=y
> +CONFIG_SYSRESET_WATCHDOG=y
> +CONFIG_I2C_EDID=y
>  CONFIG_IMX_WATCHDOG=y
> diff --git a/configs/display5_factory_defconfig
> b/configs/display5_factory_defconfig
> index 0d9eed3a3e..aafeda437d 100644
> --- a/configs/display5_factory_defconfig
> +++ b/configs/display5_factory_defconfig
> @@ -4,13 +4,19 @@ CONFIG_SYS_TEXT_BASE=0x17800000
> CONFIG_SPL_GPIO_SUPPORT=y  CONFIG_SPL_LIBCOMMON_SUPPORT=y
> CONFIG_SPL_LIBGENERIC_SUPPORT=y
> +CONFIG_SYS_MALLOC_F_LEN=0x1000
> +CONFIG_MX6_DDRCAL=y
>  CONFIG_TARGET_DISPLAY5=y
> +CONFIG_SPL_MMC_SUPPORT=y
>  CONFIG_SPL_SERIAL_SUPPORT=y
> +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_SPL=y
>  CONFIG_SPL_SPI_FLASH_SUPPORT=y
>  CONFIG_SPL_SPI_SUPPORT=y
> +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_FIT=y
> +CONFIG_SPL_LOAD_FIT=y
>  CONFIG_OF_BOARD_SETUP=y
> 
> CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cf
> g,MX6Q"
>  CONFIG_BOOTDELAY=3
> @@ -20,7 +26,6 @@ CONFIG_SUPPORT_RAW_INITRD=y
> CONFIG_MISC_INIT_R=y  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_SPL_TEXT_BASE=0x00908000
> -# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set  #
> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
> CONFIG_SPL_DMA_SUPPORT=y  CONFIG_SPL_I2C_SUPPORT=y @@ -46,11
> +51,14 @@ CONFIG_CMD_PART=y  CONFIG_CMD_SF=y
> CONFIG_CMD_SPI=y  CONFIG_CMD_USB_SDP=y
> +CONFIG_CMD_WDT=y
>  CONFIG_CMD_DHCP=y
>  CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
>  CONFIG_CMD_CACHE=y
>  CONFIG_CMD_TIME=y
> +CONFIG_CMD_PMIC=y
> +CONFIG_CMD_REGULATOR=y
>  CONFIG_CMD_EXT2=y
>  CONFIG_CMD_EXT4=y
>  CONFIG_CMD_EXT4_WRITE=y
> @@ -61,30 +69,57 @@ CONFIG_MTDIDS_DEFAULT="nor0=02008000.spi.1"
> 
> CONFIG_MTDPARTS_DEFAULT="mtdparts=02008000.spi.1:128k(SPL),1m(u-bo
> ot),64k(env1),64k(env2),4m(swu-kernel),16m(swu-initramfs),1m(factory),-(res
> erved)"
>  # CONFIG_SPL_EFI_PARTITION is not set
>  CONFIG_PARTITION_TYPE_GUID=y
> +CONFIG_OF_CONTROL=y
> +CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5"
>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_SF=y
> +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
> +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x2
> +CONFIG_SYS_I2C_MXC=y
> +CONFIG_SYS_I2C_MXC_I2C1=y
> +CONFIG_SYS_I2C_MXC_I2C2=y
> +CONFIG_SYS_I2C_MXC_I2C3=y
> +CONFIG_MISC=y
> +CONFIG_I2C_EEPROM=y
> +CONFIG_SYS_I2C_EEPROM_ADDR=0x50
> +CONFIG_SYS_I2C_EEPROM_BUS=2
> +CONFIG_SYS_EEPROM_SIZE=32768
> +CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
> +CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_FSL_ESDHC=y
>  CONFIG_MTD_DEVICE=y
> +CONFIG_DM_SPI_FLASH=y
>  CONFIG_SPI_FLASH=y
>  CONFIG_SF_DEFAULT_BUS=1
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=50000000
> +CONFIG_SPI_FLASH_SFDP_SUPPORT=y
>  CONFIG_SPI_FLASH_SPANSION=y
>  CONFIG_SPI_FLASH_STMICRO=y
> +CONFIG_SPI_FLASH_MTD=y
>  CONFIG_PHYLIB=y
> +CONFIG_PHY_MARVELL=y
>  CONFIG_FEC_MXC=y
>  CONFIG_MII=y
> +CONFIG_DM_PMIC=y
> +CONFIG_DM_PMIC_PFUZE100=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_PFUZE100=y
>  CONFIG_MXC_UART=y
>  CONFIG_SPI=y
>  CONFIG_MXC_SPI=y
> +CONFIG_SYSRESET=y
> +CONFIG_SYSRESET_WATCHDOG=y
>  CONFIG_USB=y
> +CONFIG_DM_USB=y
>  CONFIG_USB_GADGET=y
>  CONFIG_USB_GADGET_MANUFACTURER="Liebherr"
> -CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
> -CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
> +CONFIG_USB_GADGET_VENDOR_NUM=0x0525
> +CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
>  CONFIG_CI_UDC=y
>  CONFIG_USB_GADGET_DOWNLOAD=y
> +CONFIG_I2C_EDID=y
>  CONFIG_IMX_WATCHDOG=y
> -CONFIG_OF_LIBFDT=y
> +CONFIG_PANIC_HANG=y
> diff --git a/include/configs/display5.h b/include/configs/display5.h index
> 5dbe5b8528..c8218effc3 100644
> --- a/include/configs/display5.h
> +++ b/include/configs/display5.h
> @@ -35,8 +35,11 @@
>   * 0x1540000 - 0x1640000 : SPI.factory  (1MiB)
>   */
> 
> -#ifndef CONFIG_SPL_BUILD
> -#define CONFIG_SPI_FLASH_MTD
> +/* SPI Flash Configs */
> +#if defined(CONFIG_SPL_BUILD)
> +#undef CONFIG_DM_SPI
> +#undef CONFIG_DM_SPI_FLASH
> +#undef CONFIG_SPI_FLASH_MTD
>  #endif
> 
>  /* Below values are "dummy" - only to avoid build break */ @@ -58,23
> +61,7 @@
>  #define CONFIG_MXC_UART_BASE		UART5_BASE
> 
>  /* I2C Configs */
> -#define CONFIG_SYS_I2C
> -#define CONFIG_SYS_I2C_MXC
> -#define CONFIG_SYS_I2C_MXC_I2C1
> -#define CONFIG_SYS_I2C_MXC_I2C2
> -#define CONFIG_SYS_I2C_MXC_I2C3
>  #define CONFIG_I2C_MULTI_BUS
> -#define CONFIG_SYS_I2C_SPEED		100000
> -#define CONFIG_I2C_EDID
> -#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
> -
> -/* Ethernet */
> -#ifdef CONFIG_FEC_MXC
> -#define IMX_FEC_BASE			ENET_BASE_ADDR
> -#define CONFIG_FEC_XCV_TYPE		RGMII
> -#define CONFIG_ETHPRIME			"FEC"
> -#define CONFIG_FEC_MXC_PHYADDR		0
> -#endif
> 
>  /* MMC Configs */
>  #define CONFIG_FSL_USDHC
> @@ -363,7 +350,11 @@
> 
>  /* Watchdog */
>  #define CONFIG_WATCHDOG_TIMEOUT_MSECS   15000
> -
> +#if defined(CONFIG_SPL_BUILD)
> +#undef CONFIG_WDT
> +#undef CONFIG_WATCHDOG
> +#define CONFIG_HW_WATCHDOG
> +#endif
>  /* ENV config */
>  #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
>  #define CONFIG_ENV_SIZE		(SZ_64K)

Reviewed-by: Peng Fan <peng.fan at nxp.com>

> --
> 2.11.0



More information about the U-Boot mailing list