[PATCH] ARM: imx: Switch Data Modul i.MX8M Mini eDM SBC to USB251x Hub driver
Stefan Herbrechtsmeier
stefan.herbrechtsmeier-oss at weidmueller.com
Tue Jun 14 11:05:21 CEST 2022
Am 14.06.2022 um 10:39 schrieb Marek Vasut:
> Replace the ad-hoc I2C register programming scripted in board
> environment with U-Boot DM driver.
>
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Fabio Estevam <festevam at gmail.com>
> Cc: Peng Fan <peng.fan at nxp.com>
> Cc: Stefano Babic <sbabic at denx.de>
> ---
> .../imx8mm_data_modul_edm_sbc.c | 10 ++++++++++
> configs/imx8mm_data_modul_edm_sbc_defconfig | 1 +
> include/configs/imx8mm_data_modul_edm_sbc.h | 20 -------------------
> 3 files changed, 11 insertions(+), 20 deletions(-)
>
> diff --git a/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c b/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c
> index 46cb6f77b59..56202ca2fc8 100644
> --- a/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c
> +++ b/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c
> @@ -9,6 +9,8 @@
> #include <asm/io.h>
> #include <asm/mach-imx/boot_mode.h>
> #include <dm.h>
> +#include <dm/device-internal.h>
> +#include <dm/uclass-internal.h>
> #include <i2c_eeprom.h>
> #include <malloc.h>
> #include <net.h>
> @@ -104,7 +106,15 @@ int board_init(void)
>
> int board_late_init(void)
> {
> + struct udevice *dev;
> + int ret;
> +
> setup_boot_device();
> setup_mac_address();
> +
> + ret = uclass_find_device_by_name(UCLASS_MISC, "usb-hub at 2c", &dev);
> + if (!ret)
> + device_probe(dev);
Maybe you should use uclass_get_device_by_name() from uclass.h.
> +
> return 0;
> }
"setenv autoload false && " \
More information about the U-Boot
mailing list