¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
[RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization 5
Add conditional compilation for the usb5744_i2c_init() function based on the CONFIG_DM_I2C configuration, to avoid compilation failure. CC net/net-common.o AR net/built-in.o LDS u-boot.lds LD u-boot aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init': /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write' aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write' Segmentation fault (core dumped) make: *** [Makefile:1824: u-boot] Error 139 make: *** Deleting file 'u-boot' Signed-off-by: Anand Moon <linux.amoon@...> --- common/usb_onboard_hub.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 1242513c631..92e3f3a92c9 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -30,6 +30,7 @@ struct onboard_hub_data { int (*init)(struct udevice *dev); }; +#if CONFIG_IS_ENABLED(DM_I2C) static int usb5744_i2c_init(struct udevice *dev) { /* @@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev) return 0; } +#endif int usb_onboard_hub_reset(struct udevice *dev) { @@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = { }; static const struct onboard_hub_data usb5744_data = { +#if CONFIG_IS_ENABLED(DM_I2C) .init = usb5744_i2c_init, +#endif .power_on_delay_us = 1000, .reset_us = 5, }; -- 2.49.0
Started by Anand Moon @ · Most recent @
Odroid n2+ usb broken on reboot 9
Hi, +CC [email protected] +CC linux-amlogic@... I think it's a very long term issue, USB lacks a proper reset at probe on warm reset, does USB still work from U-Boot after the reboot ? I'm pretty sure there's driver callbacks we should implement to do the same here, I need to check.
Started by Neil Armstrong @ · Most recent @
[RFC v1 2/7] configs: odorid-c2: Enable Onboard HUB driver 3
Enable the onboard USB HUB driver to power the USB_HUB_GL852G-OHG on the Odroid C2. Signed-off-by: Anand Moon <linux.amoon@...> --- configs/odroid-c2_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index bcaab46f8bc..f8a66a923c9 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -59,6 +59,7 @@ CONFIG_SYSINFO_SMBIOS=y CONFIG_USB=y CONFIG_USB_DWC2=y CONFIG_USB_KEYBOARD=y +CONFIG_USB_ONBOARD_HUB=y CONFIG_VIDEO=y # CONFIG_VIDEO_BPP8 is not set # CONFIG_VIDEO_BPP16 is not set -- 2.49.0
Started by Anand Moon @ · Most recent @
[RFC v1 3/7] usb: onboard-hub: Add support for Genesys GL853G 2
Enable support for the Genesys GL853G USB2.0 and USB3.1 Hub on the Odroid N2 and N2-plus. The GL853G driver activates the hub reset signal, which toggles the GPIO. Signed-off-by: Anand Moon <linux.amoon@...> --- => dm tree simple_bus 11 [ + ] dwc3-meson-g12a | `-- usb@ffe09000 usb_gadget 0 [ ] dwc2-udc-otg | |-- usb@ff400000 usb 0 [ + ] xhci-dwc3 | `-- usb@ff500000 usb_hub 0 [ + ] usb_hub | `-- usb_hub usb_hub 1 [ + ] usb_hub | |-- usb_hub usb_mass_s 0 [ + ] usb_mass_storage | | `-- usb_mass_storage blk 2 [ + ] usb_storage_blk | | |-- usb_mass_storage.lun0 partition 0 [ + ] blk_partition | | | `-- usb_mass_storage.lun0:1 bootdev 3 [ ] usb_bootdev | | `-- usb_mass_storage.lun0.bootdev usb_hub 2 [ + ] usb_hub | `-- usb_hub clk 2 [ + ] fixed_clock |-- xtal-clk --- common/usb_onboard_hub.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 39bbc1aefa2..3914e2f773d 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -231,6 +231,10 @@ static const struct onboard_hub_data genesys_gl852g_data = { .reset_us = 50, }; +static const struct onboard_hub_data genesys_gl853g_data = { + .reset_us = 50, +}; + static const struct udevice_id usb_onboard_hub_ids[] = { /* Use generic usbVID,PID dt-bindings (usb-device.yaml) */ { .compatible = "usb424,2514", /* USB2514B USB 2.0 */ @@ -244,6 +248,9 @@ static const struct udevice_id usb_onboard_hub_ids[] = { }, { .compatible = "usb5e3,610", /* GL852G USB 2.0 */ .data = (ulong)&genesys_gl852g_data, + }, { + .compatible = "usb5e3,620", /* GL852G USB 3.1 */ + .data = (ulong)&genesys_gl853g_data, } }; -- 2.49.0
Started by Anand Moon @ · Most recent @
[RFC v1 5/7] usb: onboard-hub: Add support for VL817 USB hub 2
Enable support for the Via labs VL817 USB2.0 and USB3.1 Hub on the Odroid C4. The Via labs VL817 USB driver activates the hub reset signal, which toggles the GPIO. Signed-off-by: Anand Moon <linux.amoon@...> --- => dm tree simple_bus 11 [ + ] dwc3-meson-g12a | `-- usb@ffe09000 usb_gadget 0 [ ] dwc2-udc-otg | |-- usb@ff400000 usb 0 [ + ] xhci-dwc3 | `-- usb@ff500000 usb_hub 0 [ + ] usb_hub | `-- usb_hub usb_hub 1 [ + ] usb_hub | |-- usb_hub usb_mass_s 0 [ + ] usb_mass_storage | | `-- usb_mass_storage blk 2 [ + ] usb_storage_blk | | |-- usb_mass_storage.lun0 partition 0 [ + ] blk_partition | | | |-- usb_mass_storage.lun0:1 partition 1 [ + ] blk_partition | | | |-- usb_mass_storage.lun0:2 partition 2 [ + ] blk_partition | | | |-- usb_mass_storage.lun0:3 partition 3 [ + ] blk_partition | | | `-- usb_mass_storage.lun0:4 bootdev 3 [ ] usb_bootdev | | `-- usb_mass_storage.lun0.bootdev usb_hub 2 [ + ] usb_hub | `-- usb_hub --- common/usb_onboard_hub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 3914e2f773d..1242513c631 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -235,6 +235,10 @@ static const struct onboard_hub_data genesys_gl853g_data = { .reset_us = 50, }; +static const struct onboard_hub_data vialab_vl817_data = { + .reset_us = 10, +}; + static const struct udevice_id usb_onboard_hub_ids[] = { /* Use generic usbVID,PID dt-bindings (usb-device.yaml) */ { .compatible = "usb424,2514", /* USB2514B USB 2.0 */ @@ -251,6 +255,12 @@ static const struct udevice_id usb_onboard_hub_ids[] = { }, { .compatible = "usb5e3,620", /* GL852G USB 3.1 */ .data = (ulong)&genesys_gl853g_data, + }, { + .compatible = "usb2109,817", /* Via labs VL817 2.0 */ + .data = (ulong)&vialab_vl817_data, + }, { + .compatible = "usb2109,2817", /* Via labs VL817 3.1 */ + .data = (ulong)&vialab_vl817_data, } }; -- 2.49.0
Started by Anand Moon @ · Most recent @
[RFC v1 6/7] configs: odorid-c4: Enable Oboard HUB driver 2
Enable the onboard USB HUB driver to power the Via labs VL817 USB 3.1 hub on the Odroid C4. Signed-off-by: Anand Moon <linux.amoon@...> --- configs/odroid-c4_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/odroid-c4_defconfig b/configs/odroid-c4_defconfig index cc3d7fc7484..3c5e53828a1 100644 --- a/configs/odroid-c4_defconfig +++ b/configs/odroid-c4_defconfig @@ -64,6 +64,7 @@ CONFIG_USB_DWC3=y # CONFIG_USB_DWC3_GADGET is not set CONFIG_USB_DWC3_MESON_G12A=y CONFIG_USB_KEYBOARD=y +CONFIG_USB_ONBOARD_HUB=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e CONFIG_USB_GADGET_PRODUCT_NUM=0xfada -- 2.49.0
Started by Anand Moon @ · Most recent @
[RFC v1 4/7] configs: odorid-n2: Enable Oboard HUB driver 2
Enable the onboard USB HUB driver to power the USB_HUB_GL853G-OHG on the Odroid N2 and Odroid N2-pluss. Signed-off-by: Anand Moon <linux.amoon@...> --- configs/odroid-n2_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/odroid-n2_defconfig b/configs/odroid-n2_defconfig index a8cbaee3c96..1bf687c1e6d 100644 --- a/configs/odroid-n2_defconfig +++ b/configs/odroid-n2_defconfig @@ -64,6 +64,7 @@ CONFIG_USB_DWC3=y # CONFIG_USB_DWC3_GADGET is not set CONFIG_USB_DWC3_MESON_G12A=y CONFIG_USB_KEYBOARD=y +CONFIG_USB_ONBOARD_HUB=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e CONFIG_USB_GADGET_PRODUCT_NUM=0xfada -- 2.49.0
Started by Anand Moon @ · Most recent @
[RFC v1 1/7] usb: onboard-hub: Add support for Genesys GL852G hub 2
Add support for the Genesys GL852G USB2.0 Hub on Odroid C1+ and Odroid C2. The GL852G driver trigger hub reset signal which toggles the gpio. Signed-off-by: Anand Moon <linux.amoon@...> --- Still some issue with USB hub on Odroid C2 => dm tree vidconsole 0 [ + ] vidconsole0 | | `-- vpu@... display 0 [ ] meson_dw_hdmi | |-- hdmi-tx@c883a000 phy 0 [ + ] meson_gxbb_usb2_phy | |-- phy@c0000020 usb 0 [ + ] dwc2_usb | `-- usb@c9100000 usb_hub 0 [ + ] usb_hub | `-- usb_hub usb_hub 1 [ + ] usb_hub | `-- usb_hub regulator 0 [ + ] regulator_fixed |-- regulator-usb-pwrs --- common/usb_onboard_hub.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 7fe62b043e6..39bbc1aefa2 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -227,6 +227,10 @@ static const struct onboard_hub_data usb5744_data = { .reset_us = 5, }; +static const struct onboard_hub_data genesys_gl852g_data = { + .reset_us = 50, +}; + static const struct udevice_id usb_onboard_hub_ids[] = { /* Use generic usbVID,PID dt-bindings (usb-device.yaml) */ { .compatible = "usb424,2514", /* USB2514B USB 2.0 */ @@ -237,6 +241,9 @@ static const struct udevice_id usb_onboard_hub_ids[] = { }, { .compatible = "usb424,5744", /* USB5744 USB 3.0 */ .data = (ulong)&usb5744_data, + }, { + .compatible = "usb5e3,610", /* GL852G USB 2.0 */ + .data = (ulong)&genesys_gl852g_data, } }; -- 2.49.0
Started by Anand Moon @ · Most recent @
[RFC v1 0/7] common: usb_onboard_hub: Add support for Odroid onboard USB hub reset
Odroid C1+/C2/C4/N2/N2-plus devices have an onboard USB hub controlled by a reset GPIO pin. Adds changes to the onboard USB hub driver to perform a proper reset of the USB hub. Added conditional compilation for I2C initialization based on CONFIG_DM_I2C for failed to compile. Thanks -Anand Anand Moon (7): usb: onboard-hub: Add support for Genesys GL852G hub configs: odorid-c2: Enable Onboard HUB driver usb: onboard-hub: Add support for Genesys GL853G configs: odorid-n2: Enable Oboard HUB driver usb: onboard-hub: Add support for VL817 USB hub configs: odorid-c4: Enable Oboard HUB driver usb: onboard-hub: Add conditional compilation for I2C initialization common/usb_onboard_hub.c | 28 ++++++++++++++++++++++++++++ configs/odroid-c2_defconfig | 1 + configs/odroid-c4_defconfig | 1 + configs/odroid-n2_defconfig | 1 + 4 files changed, 31 insertions(+) base-commit: 48db49b0977cc1c9c9abf82c0fb704238fcef4fd -- 2.49.0
Started by Anand Moon @
[PATCH v2 12/22] amlogic: Include env.h to permit reading the environment 2
This file reads from the environment but does not include the correct header. Update it. Signed-off-by: Simon Glass <sjg@...> --- (no changes since v1) board/amlogic/jethub-j100/jethub-j100.c | 1 + 1 file changed, 1 insertion(+) diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c index b770a1f8c53..9e87fb9f9d7 100644 --- a/board/amlogic/jethub-j100/jethub-j100.c +++ b/board/amlogic/jethub-j100/jethub-j100.c @@ -5,6 +5,7 @@ */ #include <dm.h> +#include <env.h> #include <init.h> #include <net.h> #include <asm/io.h> -- 2.43.0
Started by Simon Glass @ · Most recent @
[PATCH] net: mdio: mux-meson-gxl: set reversed bit when using internal phy
This bit is necessary to receive packets from the internal PHY. Without this bit set, no activity occurs on the interface. Normally u-boot sets this bit, but if u-boot is compiled without net support, the interface will be up but without any activity. The vendor SDK sets this bit along with the PHY_ID bits. Ported from the Linux change at [1] from Da Xu merged in commit [2]. [1] https://lore.kernel.org/all/20250425192009.1439508-1-da@.../ [2] b23285e93bef ("net: mdio: mux-meson-gxl: set reversed bit when using internal phy") Suggested-by: Da Xue <da@...> Signed-off-by: Neil Armstrong <neil.armstrong@...> --- drivers/net/mdio_mux_meson_gxl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mdio_mux_meson_gxl.c b/drivers/net/mdio_mux_meson_gxl.c index 8ef3ae598b77fabf7b992900141d309708428b13..31898ed437e4857dd7027d311ab496be3e448d16 100644 --- a/drivers/net/mdio_mux_meson_gxl.c +++ b/drivers/net/mdio_mux_meson_gxl.c @@ -19,6 +19,7 @@ #define REG2_LEDACT GENMASK(23, 22) #define REG2_LEDLINK GENMASK(25, 24) #define REG2_DIV4SEL BIT(27) +#define REG2_REVERSED BIT(28) #define REG2_ADCBYPASS BIT(30) #define REG2_CLKINSEL BIT(31) #define ETH_REG3 0x4 @@ -66,7 +67,7 @@ static int meson_gxl_enable_internal_mdio(struct mdio_mux_meson_gxl_priv *priv) * The only constraint is that it must match the one in * drivers/net/phy/meson-gxl.c to properly match the PHY. */ - writel(FIELD_PREP(REG2_PHYID, EPHY_GXL_ID), + writel(REG2_REVERSED | FIELD_PREP(REG2_PHYID, EPHY_GXL_ID), priv->regs + ETH_REG2); /* Enable the internal phy */ --- base-commit: 98a898e58499c78245e4fe36ee404b1b1208e32b change-id: 20250502-u-boot-topic-mdio-mux-gxl-bit28-a6d03bf8e383 Best regards, -- Neil Armstrong <neil.armstrong@...>
Started by Neil Armstrong @
[PATCH v2 00/22] Deal with exfat versus byteorder
Since exfat has its own byteorder functions we need to be careful about including the normal U-Boot byteorder headers in code included by exfat. One chain for include/linux/byteorder/little_endian.h is like this: In file included from arch/sandbox/include/asm/byteorder.h:19, from arch/sandbox/include/asm/byteorder.h:19, from include/compiler.h:132, from include/env.h:12, from include/command.h:13, from include/net-common.h:7, from include/net.h:6, from include/efi.h:23, from include/blk.h:12, from include/part.h:9, from include/fs_internal.h:11, from fs/exfat/io.c:52: This series tidies things up so that efi.h can include net.h as required. Changes in v2: - Add patches for other files exposed by this change Simon Glass (22): net: Use a forward declaration for cmd_tbl in net-common.h congatec: Include env.h to permit reading the environment dhelectronics: Include env.h to permit reading the environment imx8ulp_evk: Include env.h to permit reading the environment venice: Include env.h to permit reading the environment phytec: Include env.h to permit reading the environment ronetix: Include env.h to permit reading the environment toradex: Include env.h to permit reading the environment advantech: Include env.h in imx8qm_dmsse20_a1 tegra: Include env.h to permit reading the environment synology: Include env.h to permit reading the environment amlogic: Include env.h to permit reading the environment freescale: Include env.h to permit reading the environment google: Include env.h to permit reading the environment liebherr: Include env.h to permit reading the environment technexion: Include env.h to permit reading the environment elf: Only use network environment-variables if net enabled net: Include byteorder in net6.h net: Include string.h in net-legacy.h net: Include env.h in pcap.c net: dc2114x: Include env.h to permit reading the environment net: Move env_get_ip() out of the header file arch/arm/mach-tegra/dt-setup.c | 1 + board/Synology/ds414/ds414.c | 1 + .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c | 1 + board/amlogic/jethub-j100/jethub-j100.c | 1 + board/congatec/cgtqmx8/cgtqmx8.c | 3 +- board/dhelectronics/common/dh_common.c | 1 + board/freescale/imx8ulp_evk/imx8ulp_evk.c | 1 + board/freescale/mx7dsabresd/mx7dsabresd.c | 1 + board/gateworks/venice/venice.c | 1 + board/google/chameleonv3/board.c | 2 + board/liebherr/xea/xea.c | 1 + .../common/phytec_som_detection_blocks.c | 1 + board/ronetix/imx8mq-cm/imx8mq_cm.c | 1 + board/technexion/pico-imx7d/pico-imx7d.c | 1 + board/toradex/colibri_imx7/colibri_imx7.c | 1 + board/toradex/verdin-imx8mm/verdin-imx8mm.c | 2 +- cmd/elf.c | 41 ++++++++++--------- drivers/net/dc2114x.c | 1 + include/net-common.h | 9 ++-- include/net-legacy.h | 1 + include/net6.h | 1 + net/net-common.c | 6 +++ net/pcap.c | 1 + 23 files changed, 53 insertions(+), 27 deletions(-) -- 2.43.0 base-commit: b5d6220dd2f4612912989f3c2b5a710f2248cb36 branch: fix-net2
Started by Simon Glass @
[PATCH 2/2] ARM: mach-meson: use livetree by default
Finally enable OF_LIVE by default on the Amlogic support, this add some cost to build the live tree, but makes DT parsing from driver much faster. Signed-off-by: Neil Armstrong <neil.armstrong@...> --- arch/arm/mach-meson/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig index 7570f48e25fe477ce4dfb1eb608ed07b3a83d27f..10cef2ad6623180e2ff1ed2802543f3ba0714bd3 100644 --- a/arch/arm/mach-meson/Kconfig +++ b/arch/arm/mach-meson/Kconfig @@ -12,6 +12,7 @@ config MESON64_COMMON select MMC_PWRSEQ select BOARD_LATE_INIT select MESON_SM + imply OF_LIVE imply CMD_DM config MESON_GX -- 2.34.1
Started by Neil Armstrong @
[PATCH 1/2] pinctrl: meson: convert to livetree
From: Beniamino Galvani <b.galvani@...> Update the Meson pinctrl/gpio driver to support a live device tree. Signed-off-by: Beniamino Galvani <b.galvani@...> Link: https://lore.kernel.org/r/20170709223006.3998-5-b.galvani@... Signed-off-by: Neil Armstrong <neil.armstrong@...> --- drivers/pinctrl/meson/pinctrl-meson.c | 73 +++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index babf1bccc9697596522dc93d8906ff0454cfebf5..21409063ee89cd2f8aa3d511f3fed6b64f800e51 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -10,6 +10,8 @@ #include <dm/device-internal.h> #include <dm/device_compat.h> #include <dm/lists.h> +#include <dm/of_addr.h> +#include <linux/ioport.h> #include <dm/pinctrl.h> #include <fdt_support.h> #include <linux/bitops.h> @@ -319,88 +321,91 @@ int meson_gpio_probe(struct udevice *dev) return 0; } -static fdt_addr_t parse_address(int offset, const char *name, int na, int ns) +static phys_addr_t parse_address(struct udevice *dev, ofnode node, + const char *name) { - int index, len = 0; - const fdt32_t *reg; + struct resource r; + fdt_size_t sz; + int na, ns, index; - index = fdt_stringlist_search(gd->fdt_blob, offset, "reg-names", name); + index = ofnode_stringlist_search(node, "reg-names", name); if (index < 0) return FDT_ADDR_T_NONE; - reg = fdt_getprop(gd->fdt_blob, offset, "reg", &len); - if (!reg || (len <= (index * sizeof(fdt32_t) * (na + ns)))) + if (of_live_active()) { + if (of_address_to_resource(ofnode_to_np(node), index, &r)) + return FDT_ADDR_T_NONE; + else + return r.start; + } + + na = dev_read_addr_cells(dev->parent); + if (na < 1) { + debug("bad #address-cells\n"); return FDT_ADDR_T_NONE; + } - reg += index * (na + ns); + ns = dev_read_size_cells(dev->parent); + if (ns < 1) { + debug("bad #size-cells\n"); + return FDT_ADDR_T_NONE; + } - return fdt_translate_address((void *)gd->fdt_blob, offset, reg); + return fdtdec_get_addr_size_fixed(gd->fdt_blob, ofnode_to_offset(node), + "reg", index, na, ns, &sz, true); } int meson_pinctrl_probe(struct udevice *dev) { struct meson_pinctrl *priv = dev_get_priv(dev); + ofnode node, gpio = ofnode_null(); struct uclass_driver *drv; struct udevice *gpio_dev; - fdt_addr_t addr; - int node, gpio = -1, len; - int na, ns; + phys_addr_t addr; char *name; + int len; - /* FIXME: Should use livetree */ - na = fdt_address_cells(gd->fdt_blob, dev_of_offset(dev->parent)); - if (na < 1) { - debug("bad #address-cells\n"); - return -EINVAL; - } - - ns = fdt_size_cells(gd->fdt_blob, dev_of_offset(dev->parent)); - if (ns < 1) { - debug("bad #size-cells\n"); - return -EINVAL; - } - - fdt_for_each_subnode(node, gd->fdt_blob, dev_of_offset(dev)) { - if (fdt_getprop(gd->fdt_blob, node, "gpio-controller", &len)) { + dev_for_each_subnode(node, dev) { + if (ofnode_read_prop(node, "gpio-controller", &len)) { gpio = node; break; } } - if (!gpio) { + if (!ofnode_valid(gpio)) { debug("gpio node not found\n"); return -EINVAL; } - addr = parse_address(gpio, "mux", na, ns); + addr = parse_address(dev, gpio, "mux"); if (addr == FDT_ADDR_T_NONE) { debug("mux address not found\n"); return -EINVAL; } priv->reg_mux = (void __iomem *)addr; - addr = parse_address(gpio, "gpio", na, ns); + addr = parse_address(dev, gpio, "gpio"); if (addr == FDT_ADDR_T_NONE) { debug("gpio address not found\n"); return -EINVAL; } priv->reg_gpio = (void __iomem *)addr; - addr = parse_address(gpio, "pull", na, ns); + addr = parse_address(dev, gpio, "pull"); /* Use gpio region if pull one is not present */ if (addr == FDT_ADDR_T_NONE) priv->reg_pull = priv->reg_gpio; else priv->reg_pull = (void __iomem *)addr; - addr = parse_address(gpio, "pull-enable", na, ns); + addr = parse_address(dev, gpio, "pull-enable"); /* Use pull region if pull-enable one is not present */ if (addr == FDT_ADDR_T_NONE) priv->reg_pullen = priv->reg_pull; else priv->reg_pullen = (void __iomem *)addr; - addr = parse_address(gpio, "ds", na, ns); + addr = parse_address(dev, gpio, "ds"
Started by Neil Armstrong @
[PATCH 0/2] ARM: meson: finally switch to livetree
Never late than never, finally try to land Beniamino's "pinctrl: meson: convert to livetree" from 2017 to finally be a modern platform with OF_LIVE ! Signed-off-by: Neil Armstrong <neil.armstrong@...> --- Beniamino Galvani (1): pinctrl: meson: convert to livetree Neil Armstrong (1): ARM: mach-meson: use livetree by default arch/arm/mach-meson/Kconfig | 1 + drivers/pinctrl/meson/pinctrl-meson.c | 73 +++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 34 deletions(-) --- base-commit: f892a7f397a66d8d09f418d1e0e06dfb48bac27d change-id: 20250411-u-boot-meson-livetree-8fd1b0a18066 Best regards, -- Neil Armstrong <neil.armstrong@...>
Started by Neil Armstrong @
[PATCH 2/3] designware: Use the remove() method with related drivers 5
Hi Jonas, That's interesting. I wrote that code about 9 years ago so perhaps can be forgiven for forgetting. Very few drivers set the DM_FLAG_ACTIVE_DMA flag, certainly not the designware ones. So how would they be removed? Hmm yes I saw that but then apparently forgot to include it. I can perhaps redo this patch to add the DMA flag. Yes, I wasn't sure which way to go on that. I'll remove them. Regards, Simon
Started by Simon Glass @ · Most recent @
[PATCH v2 2/4] net: designware: Mark drivers as having active DMA
Network devices which use this driver have DMA running while receiving packages. Add the required flag to driver model so that they will be removed before starting the OS. Signed-off-by: Simon Glass <sjg@...> --- Changes in v2: - Add a new patch to mark drivers as having active DMA drivers/net/designware.c | 2 +- drivers/net/dwmac_meson8b.c | 2 +- drivers/net/dwmac_s700.c | 2 +- drivers/net/dwmac_socfpga.c | 2 +- drivers/net/gmac_rockchip.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 5385849ea6b..9b2b0a5d602 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -885,7 +885,7 @@ U_BOOT_DRIVER(eth_designware) = { .ops = &designware_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct dw_eth_pdata), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_ACTIVE_DMA, }; static struct pci_device_id supported[] = { diff --git a/drivers/net/dwmac_meson8b.c b/drivers/net/dwmac_meson8b.c index bf94e50842d..95a99a98e99 100644 --- a/drivers/net/dwmac_meson8b.c +++ b/drivers/net/dwmac_meson8b.c @@ -162,5 +162,5 @@ U_BOOT_DRIVER(dwmac_meson8b) = { .ops = &designware_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct dwmac_meson8b_plat), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_ACTIVE_DMA, }; diff --git a/drivers/net/dwmac_s700.c b/drivers/net/dwmac_s700.c index e78193f3376..21df8e3ce81 100644 --- a/drivers/net/dwmac_s700.c +++ b/drivers/net/dwmac_s700.c @@ -64,5 +64,5 @@ U_BOOT_DRIVER(dwmac_s700) = { .ops = &designware_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct eth_pdata), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_ACTIVE_DMA, }; diff --git a/drivers/net/dwmac_socfpga.c b/drivers/net/dwmac_socfpga.c index dda33f90d65..9f262aaee60 100644 --- a/drivers/net/dwmac_socfpga.c +++ b/drivers/net/dwmac_socfpga.c @@ -145,5 +145,5 @@ U_BOOT_DRIVER(dwmac_socfpga) = { .ops = &designware_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct dwmac_socfpga_plat), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_ACTIVE_DMA, }; diff --git a/drivers/net/gmac_rockchip.c b/drivers/net/gmac_rockchip.c index 5c542d62bd8..52be3a5687f 100644 --- a/drivers/net/gmac_rockchip.c +++ b/drivers/net/gmac_rockchip.c @@ -760,5 +760,5 @@ U_BOOT_DRIVER(eth_gmac_rockchip) = { .ops = &gmac_rockchip_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct gmac_rockchip_plat), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_ACTIVE_DMA, }; -- 2.43.0
Started by Simon Glass @
[GIT PULL] Please pull u-boot-amlogic-20250404 into master 2
Hi Tom, Here's a last minute fix for the libre-computer boards fixing the capsule update feature. Thanks, Neil The following changes since commit 82b69fc4224432d5aefa7ca750d950374cbc7fb2: Merge tag 'efi-2025-04-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi (2025-04-03 07:31:28 -0600) are available in the Git repository at: https://source.denx.de/u-boot/custodians/u-boot-amlogic.git tags/u-boot-amlogic-20250404 for you to fetch changes up to c5fd2c7ac7fa4835339ea09ead2884794314c9d8: board: libre-computer: check interface before comparing it in set_dfu_alt_info() (2025-04-04 10:37:40 +0200) ---------------------------------------------------------------- - check interface before comparing it in set_dfu_alt_info() to avoid hard crash on capsule update ---------------------------------------------------------------- Neil Armstrong (1): board: libre-computer: check interface before comparing it in set_dfu_alt_info() board/libre-computer/aml-a311d-cc/aml-a311d-cc.c | 2 +- board/libre-computer/aml-s805x-ac/aml-s805x-ac.c | 2 +- board/libre-computer/aml-s905d3-cc/aml-s905d3-cc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Started by Neil Armstrong @ · Most recent @
[PATCH v2 1/4] designware: Use the remove() method with related drivers
Several drivers make use of the designware Ethernet driver but do not implement the remove() method. Add this to keep things tidy. Note that the Ethernet uclass calls each driver's stop() method on removal, so there is no need to do that here. Signed-off-by: Simon Glass <sjg@...> Reported-by: Christian Kohlsch¨¹tter <christian@...> --- Changes in v2: - Use the designware_eth_remove() method directly - Add gmac_rockchip too - Reword the commit message to mention the uclass' actions drivers/net/designware.c | 2 +- drivers/net/designware.h | 12 ++++++++++++ drivers/net/dwmac_meson8b.c | 1 + drivers/net/dwmac_s700.c | 1 + drivers/net/dwmac_socfpga.c | 1 + drivers/net/gmac_rockchip.c | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 07b0f49ef58..5385849ea6b 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -805,7 +805,7 @@ clk_err: return err; } -static int designware_eth_remove(struct udevice *dev) +int designware_eth_remove(struct udevice *dev) { struct dw_eth_dev *priv = dev_get_priv(dev); diff --git a/drivers/net/designware.h b/drivers/net/designware.h index e47101ccaf6..8c9d0190e03 100644 --- a/drivers/net/designware.h +++ b/drivers/net/designware.h @@ -247,6 +247,18 @@ struct dw_eth_dev { int designware_eth_of_to_plat(struct udevice *dev); int designware_eth_probe(struct udevice *dev); + +/** + * designware_eth_remove() - Remove the device + * + * Disables DMA and marks the device as remove. This must be called before + * booting an OS, to ensure that DMA is inactive. + * + * @dev: Device to remove + * Return 0 if OK, -ve on error + */ +int designware_eth_remove(struct udevice *dev); + extern const struct eth_ops designware_eth_ops; struct dw_eth_pdata { diff --git a/drivers/net/dwmac_meson8b.c b/drivers/net/dwmac_meson8b.c index fde4aabbace..bf94e50842d 100644 --- a/drivers/net/dwmac_meson8b.c +++ b/drivers/net/dwmac_meson8b.c @@ -158,6 +158,7 @@ U_BOOT_DRIVER(dwmac_meson8b) = { .of_match = dwmac_meson8b_ids, .of_to_plat = dwmac_meson8b_of_to_plat, .probe = dwmac_meson8b_probe, + .remove = designware_eth_remove, .ops = &designware_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct dwmac_meson8b_plat), diff --git a/drivers/net/dwmac_s700.c b/drivers/net/dwmac_s700.c index 969d247b4f3..e78193f3376 100644 --- a/drivers/net/dwmac_s700.c +++ b/drivers/net/dwmac_s700.c @@ -60,6 +60,7 @@ U_BOOT_DRIVER(dwmac_s700) = { .of_match = dwmac_s700_ids, .of_to_plat = dwmac_s700_of_to_plat, .probe = dwmac_s700_probe, + .remove = designware_eth_remove, .ops = &designware_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct eth_pdata), diff --git a/drivers/net/dwmac_socfpga.c b/drivers/net/dwmac_socfpga.c index a9e2d8c0972..dda33f90d65 100644 --- a/drivers/net/dwmac_socfpga.c +++ b/drivers/net/dwmac_socfpga.c @@ -141,6 +141,7 @@ U_BOOT_DRIVER(dwmac_socfpga) = { .of_match = dwmac_socfpga_ids, .of_to_plat = dwmac_socfpga_of_to_plat, .probe = dwmac_socfpga_probe, + .remove = designware_eth_remove, .ops = &designware_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct dwmac_socfpga_plat), diff --git a/drivers/net/gmac_rockchip.c b/drivers/net/gmac_rockchip.c index 8cfeeffe95b..5c542d62bd8 100644 --- a/drivers/net/gmac_rockchip.c +++ b/drivers/net/gmac_rockchip.c @@ -756,6 +756,7 @@ U_BOOT_DRIVER(eth_gmac_rockchip) = { .of_match = rockchip_gmac_ids, .of_to_plat = gmac_rockchip_of_to_plat, .probe = gmac_rockchip_probe, + .remove = designware_eth_remove, .ops = &gmac_rockchip_eth_ops, .priv_auto = sizeof(struct dw_eth_dev), .plat_auto = sizeof(struct gmac_rockchip_plat), -- 2.43.0
Started by Simon Glass @
[PATCH v2 0/4] dm: net: Assorted patches related to networking and DMA
This series collects together a few patches related to U-Boot leaving DMA running when booting. Changes in v2: - Use the designware_eth_remove() method directly - Add gmac_rockchip too - Reword the commit message to mention the uclass' actions - Add a new patch to mark drivers as having active DMA Simon Glass (4): designware: Use the remove() method with related drivers net: designware: Mark drivers as having active DMA efi_loader: Move device-removal later in exit-boot-services dm: core: Rename dm_remove_devices_active() arch/arm/lib/bootm.c | 4 ++-- arch/riscv/lib/bootm.c | 2 +- arch/x86/lib/bootm.c | 2 +- drivers/core/root.c | 2 +- drivers/net/designware.c | 4 ++-- drivers/net/designware.h | 12 ++++++++++++ drivers/net/dwmac_meson8b.c | 3 ++- drivers/net/dwmac_s700.c | 3 ++- drivers/net/dwmac_socfpga.c | 3 ++- drivers/net/gmac_rockchip.c | 3 ++- include/dm/root.h | 6 +++--- lib/efi_loader/efi_boottime.c | 21 +++++++++++++-------- test/dm/core.c | 2 +- 13 files changed, 44 insertions(+), 23 deletions(-) -- 2.43.0 base-commit: d47b5693e21f78d8cd8caa8fcd9e64fd6ae85759 branch: eth2
Started by Simon Glass @
Current Image
Image Name
Sat 8:39am