udoo_neo: Call gpio_request()
Subsystems (2)
PATCH 1/4 udoo_neo: Call gpio_request()
Calling gpio_request() prior to its usage is now mandatory.
This fixes the following GPIO errors:
gpio@20a8000: set_dir_flags: error: gpio GPIO4_16 not reserved gpio@20a8000: set_dir_flags: error: gpio GPIO4_13 not reserved gpio@20a8000: set_dir_flags: error: gpio GPIO4_0 not reserved gpio@20a8000: get_value: error: gpio GPIO4_13 not reserved gpio@20a8000: get_value: error: gpio GPIO4_0 not reserved gpio@20a0000: set_dir_flags: error: gpio GPIO2_1 not reserved gpio@20a0000: set_value: error: gpio GPIO2_1 not reserved
--- board/udoo/neo/neo.c | 4 ++++ 1 file changed, 4 insertions(+)
board/udoo/neo/neo.c +4 -0
@@ -249,6 +249,7 @@ static int setup_fec(void) ARRAY_SIZE(phy_control_pads));/* Reset PHY */ +gpio_request (IMX_GPIO_NR (2 ,1 ),"enet_rst" );gpio_direction_output (IMX_GPIO_NR (2 ,1 ) ,0 );udelay (10000 );gpio_set_value (IMX_GPIO_NR (2 ,1 ),1 );
@@ -280,6 +281,7 @@ int board_init(void) ARRAY_SIZE(peri_3v3_pads));/* Active high for ncp692 */ +gpio_request (IMX_GPIO_NR (4 ,16 ),"ncp692" );gpio_direction_output (IMX_GPIO_NR (4 ,16 ) ,1 );#ifdef CONFIG_SYS_I2C_MXC
@@ -296,6 +298,8 @@ static int get_board_value(void)imx_iomux_v3_setup_multiple_pads (board_recognition_pads,ARRAY_SIZE (board_recognition_pads)); +gpio_request (IMX_GPIO_NR (4 ,13 ),"r184" ); +gpio_request (IMX_GPIO_NR (4 ,0 ),"r185" );gpio_direction_input (IMX_GPIO_NR (4 ,13 ));gpio_direction_input (IMX_GPIO_NR (4 ,0 ));
Signature · 1 line
2.33.1
PATCH 2/4 udoo_neo: Fixes for booting from the mSD card
This fixes booting from the mSD card from both SPL and when using it for the OS booting. It also cleans up a few mmc booting bits that are no longer needed.
--- arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi | 7 ----- board/udoo/neo/neo.c | 40 ++++++++++++++++++++++++ configs/udoo_neo_defconfig | 1 + include/configs/udoo_neo.h | 4 +-- 4 files changed, 43 insertions(+), 9 deletions(-) delete mode 100644 arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi
arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi deleted +0 -7
@@ -1,7 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/ { - aliases { - mmc0 = &usdhc2; - }; -};
board/udoo/neo/neo.c +40 -0
@@ -19,6 +19,8 @@#include <asm/mach-imx/iomux-v3.h> #include <dm.h> #include <env.h> +#include <mmc.h> +#include <fsl_esdhc_imx.h> #include <asm/arch/crm_regs.h> #include <asm/io.h> #include <asm/mach-imx/mxc_i2c.h>
@@ -214,6 +216,19 @@ static iomux_v3_cfg_t const uart1_pads[] = { MX6_PAD_GPIO1_IO05__UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL), }; +static iomux_v3_cfg_t const usdhc2_pads[] = { +MX6_PAD_SD2_CLK__USDHC2_CLK |MUX_PAD_CTRL (USDHC_PAD_CTRL ), +MX6_PAD_SD2_CMD__USDHC2_CMD |MUX_PAD_CTRL (USDHC_PAD_CTRL ), +MX6_PAD_SD2_DATA0__USDHC2_DATA0 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), +MX6_PAD_SD2_DATA1__USDHC2_DATA1 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), +MX6_PAD_SD2_DATA2__USDHC2_DATA2 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), +MX6_PAD_SD2_DATA3__USDHC2_DATA3 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), +/* CD pin */ +MX6_PAD_SD1_DATA0__GPIO6_IO_2 |MUX_PAD_CTRL (NO_PAD_CTRL ), +/* Power */ +MX6_PAD_SD1_CMD__GPIO6_IO_1 |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; +static iomux_v3_cfg_t const phy_control_pads[] = {/* 25MHz Ethernet PHY Clock */ MX6_PAD_ENET2_RX_CLK__ENET2_REF_CLK_25M |
@@ -327,6 +342,31 @@ int board_early_init_f(void)return 0 ; } +static struct fsl_esdhc_cfg usdhc_cfg[1 ] = { + {USDHC2_BASE_ADDR }, +}; + +#define USDHC2_PWR_GPIO IMX_GPIO_NR(6, 1) +#define USDHC2_CD_GPIO IMX_GPIO_NR(6, 2) + +int board_mmc_getcd (struct mmc *mmc) +{ +return !gpio_get_value (USDHC2_CD_GPIO ); +} + +int board_mmc_init (struct bd_info *bis) +{ +SETUP_IOMUX_PADS (usdhc2_pads); + usdhc_cfg[0 ].sdhc_clk =mxc_get_clock (MXC_ESDHC2_CLK ); + usdhc_cfg[0 ].max_bus_width =4 ; +gpio_request (IMX_GPIO_NR (6 ,1 ),"usdhc2_pwr" ); +gpio_request (IMX_GPIO_NR (6 ,2 ),"usdhc2_cd" ); +gpio_direction_input (USDHC2_CD_GPIO ); +gpio_direction_output (USDHC2_PWR_GPIO ,1 ); + +return fsl_esdhc_initialize (bis, &usdhc_cfg[0 ]); +} +static char *board_string (void ) {switch (get_board_value ()) {
configs/udoo_neo_defconfig +1 -0
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SYS_MMC_ENV_DEV=1 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_BOUNCE_BUFFER=y CONFIG_SYS_I2C_LEGACY=y
include/configs/udoo_neo.h +2 -2
@@ -29,7 +29,7 @@"fdt_addr=0x83000000\0" \"fdt_addr_r=0x83000000\0" \"ip_dyn=yes\0" \ -"mmcdev=0\0" \ +"mmcdev=1\0" \"mmcrootfstype=ext4\0" \"findfdt=" \"if test $board_name = BASIC; then " \
@@ -49,7 +49,7 @@ BOOTENV#define BOOT_TARGET_DEVICES (func) \ - func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ func(DHCP, dhcp, na)#include <config_distro_bootcmd.h>
Signature · 1 line
2.33.1
Re: [PATCH 2/4] udoo_neo: Fixes for booting from the mSD card
Quoted 6 lines · Peter Robinson
This fixes booting from the mSD card from both SPL and when using it for the OS booting. It also cleans up a few mmc booting bits that are no longer needed.
Signed-off-by Peter Robinson <[email protected]>
Re: [PATCH 2/4] udoo_neo: Fixes for booting from the mSD card
In reply to Peter RobinsonQuoted 6 lines · Peter Robinson
This fixes booting from the mSD card from both SPL and when using it for the OS booting. It also cleans up a few mmc booting bits that are no longer needed.
Signed-off-by Peter Robinson <[email protected]>Reviewed-by Fabio Estevam <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH 3/4 udoo_neo: Fix ethernet
In reply to Peter RobinsonThe ethernet has a RMII not RGMII, also needs DM_MDIO and finally initialise it later in the process as it's not needed that early on and not everything is ready so it locks up the device.
--- board/udoo/neo/neo.c | 3 ++- configs/udoo_neo_defconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
board/udoo/neo/neo.c +2 -1
@@ -303,6 +303,8 @@ int board_init(void)setup_i2c (0 ,CONFIG_SYS_I2C_SPEED ,0x7f , &i2c_pad_info1);#endif +setup_fec (); +return 0 ; }
@@ -337,7 +339,6 @@ static int get_board_value(void)int board_early_init_f (void ) {setup_iomux_uart (); -setup_fec ();return 0 ; }
configs/udoo_neo_defconfig +1 -1
@@ -46,8 +46,8 @@ CONFIG_PHYLIB=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ8XXX=y CONFIG_DM_ETH=y +CONFIG_DM_MDIO=y CONFIG_FEC_MXC=y -CONFIG_RGMII=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y
Signature · 1 line
2.33.1
Re: [PATCH 3/4] udoo_neo: Fix ethernet
Quoted 6 lines · Peter Robinson
The ethernet has a RMII not RGMII, also needs
DM_MDIOand finally initialise it later in the process as it's not needed that early on and not everything is ready so it locks up the device.Signed-off-by Peter Robinson <[email protected]>
Re: [PATCH 3/4] udoo_neo: Fix ethernet
In reply to Peter RobinsonQuoted 6 lines · Peter Robinson
The ethernet has a RMII not RGMII, also needs
DM_MDIOand finally initialise it later in the process as it's not needed that early on and not everything is ready so it locks up the device.Signed-off-by Peter Robinson <[email protected]>Reviewed-by Fabio Estevam <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH 4/4 udoo_neo: Enable support for USB and storage
In reply to Peter RobinsonEnable support for USB and USB storage on the UDOO Neo.
--- configs/udoo_neo_defconfig | 7 +++++++ include/configs/udoo_neo.h | 1 + 2 files changed, 8 insertions(+)
configs/udoo_neo_defconfig +7 -0
@@ -27,6 +27,7 @@ CONFIG_SPL_FS_EXT4=y CONFIG_SPL_WATCHDOG=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y # CONFIG_CMD_PINMUX is not set # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_CACHE=y
@@ -53,5 +54,11 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y CONFIG_POWER_LEGACY=y CONFIG_POWER_I2C=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_ANATOP=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_STORAGE=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y
include/configs/udoo_neo.h +1 -0
@@ -50,6 +50,7 @@#define BOOT_TARGET_DEVICES (func) \ func(MMC, mmc, 1) \ + func(USB, usb, 0) \ func(DHCP, dhcp, na)#include <config_distro_bootcmd.h>
Signature · 1 line
2.33.1
Re: [PATCH 4/4] udoo_neo: Enable support for USB and storage
Quoted 4 lines · Peter Robinson
Enable support for USB and USB storage on the UDOO Neo.
Signed-off-by Peter Robinson <[email protected]>
Re: [PATCH 4/4] udoo_neo: Enable support for USB and storage
In reply to Peter RobinsonQuoted 4 lines · Peter Robinson
Enable support for USB and USB storage on the UDOO Neo.
Signed-off-by Peter Robinson <[email protected]>Reviewed-by Fabio Estevam <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
Quoted 12 lines · Peter Robinson
Calling
gpio_request()prior to its usage is now mandatory.This fixes the following GPIO errors:
gpio@20a8000:set_dir_flags: error: gpioGPIO4_16not reserved gpio@20a8000:set_dir_flags: error: gpioGPIO4_13not reserved gpio@20a8000:set_dir_flags: error: gpioGPIO4_0not reserved gpio@20a8000:get_value: error: gpioGPIO4_13not reserved gpio@20a8000:get_value: error: gpioGPIO4_0not reserved gpio@20a0000:set_dir_flags: error: gpioGPIO2_1not reserved gpio@20a0000:set_value: error: gpioGPIO2_1not reserved
Quoted 2 lines
Fixes 191840ae99 ("ARM: imx: udoo_neo: Enable OF_CONTROL and DM gpio/pin control")Signed-off-by Peter Robinson <[email protected]>
Quoted 11 lines · Peter Robinson
Calling
gpio_request()prior to its usage is now mandatory.This fixes the following GPIO errors:
gpio@20a8000:set_dir_flags: error: gpioGPIO4_16not reserved gpio@20a8000:set_dir_flags: error: gpioGPIO4_13not reserved gpio@20a8000:set_dir_flags: error: gpioGPIO4_0not reserved gpio@20a8000:get_value: error: gpioGPIO4_13not reserved gpio@20a8000:get_value: error: gpioGPIO4_0not reserved gpio@20a0000:set_dir_flags: error: gpioGPIO2_1not reserved gpio@20a0000:set_value: error: gpioGPIO2_1not reserved
Quoted 3 lines
Fixes 191840ae99 ("ARM: imx: udoo_neo: Enable OF_CONTROL and DM gpio/pin control")Signed-off-by Peter Robinson <[email protected]>Reviewed-by Fabio Estevam <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom