samsung: e850-96: Enable USB host and Ethernet
cover samsung: e850-96: Enable USB host and Ethernet
The E850-96 board has a LAN9514 chip which acts as a USB hub and Ethernet controller. It's connected to the SoC via USB lines. In order to make this chip functional the USB controller in Exynos850 SoC has to be configured in the host role, and the corresponding power regulator has to be enabled as well.
This patch series enables USB host and network support on the E850-96 by making use of the LAN9514 chip. While at it, enable all power regulators (LDO) in the PMIC chip which can be useful in the bootloader and kernel, including the regulator used for LAN9514.
Sam Protsenko (10):
usb: host: dwc3-of-simple: Add exynos850 compatible
board: samsung: e850-96: Set ethaddr
board: samsung: e850-96: Add ACPM code
board: samsung: e850-96: Add PMIC code
board: samsung: e850-96: Configure PMIC regulators
board: samsung: e850-96: Extract device info from fw loading code
board: samsung: e850-96: Add bootdev var to choose boot device
configs: e850-96: Disable CONFIG_DEFAULT_FDT_FILE
configs: e850-96: Enable USB host support
configs: e850-96: Enable Ethernet
board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/acpm.c | 169 ++++++++++++++++++++++++++++++ board/samsung/e850-96/acpm.h | 27 +++++ board/samsung/e850-96/e850-96.c | 97 +++++++++++++++-- board/samsung/e850-96/e850-96.env | 2 +- board/samsung/e850-96/fw.c | 45 ++++---- board/samsung/e850-96/fw.h | 4 +- board/samsung/e850-96/pmic.c | 144 +++++++++++++++++++++++++ board/samsung/e850-96/pmic.h | 14 +++ configs/e850-96_defconfig | 10 +- drivers/usb/host/dwc3-of-simple.c | 1 + 11 files changed, 482 insertions(+), 33 deletions(-) create mode 100644 board/samsung/e850-96/acpm.c create mode 100644 board/samsung/e850-96/acpm.h create mode 100644 board/samsung/e850-96/pmic.c create mode 100644 board/samsung/e850-96/pmic.h
Signature · 1 line
2.39.5
PATCH 1/10 usb: host: dwc3-of-simple: Add exynos850 compatible
Enable support for Exynos850 SoC in DWC3 host glue layer driver.
--- drivers/usb/host/dwc3-of-simple.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/dwc3-of-simple.c +1 -0
@@ -91,6 +91,7 @@ static int dwc3_of_simple_remove(struct udevice *dev)static const struct udevice_id dwc3_of_simple_ids[] = { { .compatible ="amlogic,meson-gxl-dwc3" }, { .compatible ="rockchip,rk3399-dwc3" }, + { .compatible ="samsung,exynos850-dwusb3" }, { .compatible ="ti,dwc3" }, { } };
Signature · 1 line
2.39.5
Re: [PATCH 01/10] usb: host: dwc3-of-simple: Add exynos850 compatible
Quoted 3 lines · Sam Protsenko
Enable support for Exynos850 SoC in DWC3 host glue layer driver.
Signed-off-by Sam Protsenko <[email protected]>
Thanks
PATCH 2/10 board: samsung: e850-96: Set ethaddr
In reply to Sam ProtsenkoSet the environment variable for Ethernet MAC address (ethaddr). Use the SoC ID to make sure it's unique. It'll be formatted in a way that follows the consecutive style of the serial number ("serial#" variable), i.e.:
OTP_CHIPID0 = 0xf51c8113
OTP_CHIPID1 = 0x236
get_chip_id() = 0x236f51c8113
serial# = 00000236f51c8113
ethaddr = 02:36:f5:1c:81:13where corresponding bytes of the MAC address are:
mac_addr[0] = 0x02 // OTP_CHIPID1[15:8]
mac_addr[1] = 0x36 // OTP_CHIPID1[7:0]
mac_addr[2] = 0xf5 // OTP_CHIPID0[31:24]
mac_addr[3] = 0x1c // OTP_CHIPID0[23:16]
mac_addr[4] = 0x81 // OTP_CHIPID0[15:8]
mac_addr[5] = 0x13 // OTP_CHIPID0[7:0]because OTP_CHIPID1 has only 16 significant bits (with actual ID values), and all 32 bits of OTP_CHIPID0 are significant.
--- board/samsung/e850-96/e850-96.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
board/samsung/e850-96/e850-96.c +25 -0
@@ -8,6 +8,7 @@#include <env.h> #include <init.h> #include <mapmem.h> +#include <net.h> #include <asm/io.h> #include "fw.h"
@@ -92,11 +93,35 @@ static void setup_serial(void)env_set ("serial#" , serial_str); } +static void setup_ethaddr (void ) +{ +u64 serial_num; +u32 mac_hi, mac_lo; +u8 mac_addr[6 ]; + +if (env_get ("ethaddr" )) +return ; + + serial_num =get_chip_id (); + mac_lo = (u32 )serial_num;/* OTP_CHIPID0 */ + mac_hi = (u32)(serial_num >>32UL );/* OTP_CHIPID1 */ + mac_addr[0 ] = (mac_hi >>8 ) &0xff ; + mac_addr[1 ] = mac_hi &0xff ; + mac_addr[2 ] = (mac_lo >>24 ) &0xff ; + mac_addr[3 ] = (mac_lo >>16 ) &0xff ; + mac_addr[4 ] = (mac_lo >>8 ) &0xff ; + mac_addr[5 ] = mac_lo &0xff ; + mac_addr[0 ] &= ~0x1 ;/* make sure it's not a multicast address */ +if (is_valid_ethaddr (mac_addr)) +eth_env_set_enetaddr ("ethaddr" , mac_addr); +} +int board_late_init (void ) {int err;setup_serial (); +setup_ethaddr ();/* * Do this in board_late_init() to make sure MMC is not probed before
Signature · 1 line
2.39.5
PATCH 3/10 board: samsung: e850-96: Add ACPM code
In reply to Sam ProtsenkoAdd functions to access I3C bus via APM (Active Power Management) core by using ACPM IPC protocol. It will be further used for configuring PMIC chip voltage regulators.
--- board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/acpm.c | 169 +++++++++++++++++++++++++++++++++ board/samsung/e850-96/acpm.h | 27 ++++++ 3 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 board/samsung/e850-96/acpm.c create mode 100644 board/samsung/e850-96/acpm.h
board/samsung/e850-96/Makefile +1 -1
@@ -3,4 +3,4 @@ # Copyright (C) 2024, Linaro Limited # Sam Protsenko <[email protected]> -obj-y := e850-96.o fw.o +obj-y := e850-96.o fw.o acpm.o
board/samsung/e850-96/acpm.c new file +169 -0
169 lines not on this page · raw message
board/samsung/e850-96/acpm.h new file +27 -0
@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2025 Linaro Ltd. +* Sam Protsenko <[email protected]> +*/ + +#ifndef __E850_96_ACPM_H +#define __E850_96_ACPM_H + +#include <linux/types.h> + +/** +* struct acpm - Data for I3C communication over ACPM IPC protocol +* @mbox_base: Base address of APM mailbox block +* @sram_base: Base address of shared memory used for APM messages +* @ipc_ch: Mailbox channel number used for communication with I3C block (0-15) +*/ +struct acpm { +void __iomem *mbox_base; +void __iomem *sram_base; +u8 ipc_ch; +}; + +int acpm_i3c_read (struct acpm *acpm,u8 ch,u8 addr,u8 reg,u8 *val); +int acpm_i3c_write (struct acpm *acpm,u8 ch,u8 addr,u8 reg,u8 val); + +#endif /* __E850_96_ACPM_H */
Signature · 1 line
2.39.5
PATCH 4/10 board: samsung: e850-96: Add PMIC code
In reply to Sam ProtsenkoAdd functions for configuring voltage regulators on S2MPU12 PMIC chip for E850-96 board. The chip is accessed by commanding APM core (via ACPM IPC protocol) to perform corresponding transfers over I3C bus.
The most important regulator being set up is LDO24 used for LAN9514 chip power. As LAN9514 implements USB hub and Ethernet controller functionality, it's crucial to enable and configure LDO24 to be able to use it further. While at it, configure the rest of regulators that might be needed later, both in the bootloader and in kernel.
--- board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/pmic.c | 144 +++++++++++++++++++++++++++++++++ board/samsung/e850-96/pmic.h | 14 ++++ 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 board/samsung/e850-96/pmic.c create mode 100644 board/samsung/e850-96/pmic.h
board/samsung/e850-96/Makefile +1 -1
@@ -3,4 +3,4 @@ # Copyright (C) 2024, Linaro Limited # Sam Protsenko <[email protected]> -obj-y := e850-96.o fw.o acpm.o +obj-y := e850-96.o fw.o acpm.o pmic.o
board/samsung/e850-96/pmic.c new file +144 -0
144 lines not on this page · raw message
board/samsung/e850-96/pmic.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2025 Linaro Ltd. +* Sam Protsenko <[email protected]> +*/ + +#ifndef __E850_96_PMIC_H +#define __E850_96_PMIC_H + +#include "acpm.h" + +int pmic_init (struct acpm *acpm); + +#endif /* __E850_96_PMIC_H */
Signature · 1 line
2.39.5
PATCH 5/10 board: samsung: e850-96: Configure PMIC regulators
In reply to Sam ProtsenkoMake use of PMIC configuration routines and enable all LDOs that might be useful for bootloader and kernel. The most crucial regulator being enabled at the moment is LDO24 which provides power to LAN9514 chip. That makes Ethernet controller and USB hub functional.
--- board/samsung/e850-96/e850-96.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-)
board/samsung/e850-96/e850-96.c +28 -3
@@ -11,11 +11,18 @@#include <net.h> #include <asm/io.h> #include "fw.h" +#include "pmic.h" /* OTP Controller base address and register offsets */ -#define EXYNOS850_OTP_BASE 0x10000000 -#define OTP_CHIPID0 0x4 -#define OTP_CHIPID1 0x8 +#define EXYNOS850_OTP_BASE 0x10000000 +#define OTP_CHIPID0 0x4 +#define OTP_CHIPID1 0x8 + +/* ACPM and PMIC definitions */ +#define EXYNOS850_MBOX_APM2AP_BASE 0x11900000 +#define EXYNOS850_APM_SRAM_BASE 0x02039000/* in iRAM */ +#define EXYNOS850_APM_SHMEM_OFFSET 0x3200 +#define EXYNOS850_IPC_AP_I3C 10struct efi_fw_image fw_images[] = { {
@@ -56,6 +63,13 @@ struct efi_capsule_update_info update_info = { .images = fw_images, }; +static struct acpm acpm = { + .mbox_base = (void __iomem *)EXYNOS850_MBOX_APM2AP_BASE , + .sram_base = (void __iomem *)(EXYNOS850_APM_SRAM_BASE + +EXYNOS850_APM_SHMEM_OFFSET ), + .ipc_ch =EXYNOS850_IPC_AP_I3C , +}; +int dram_init (void ) {return fdtdec_setup_mem_size_base ();
@@ -133,3 +147,14 @@ int board_late_init(void)return 0 ; } + +int power_init_board (void ) +{ +int err; + + err =pmic_init (&acpm); +if (err) +printf ("ERROR: Failed to configure PMIC (%d)\n" , err); + +return 0 ; +}
Signature · 1 line
2.39.5
PATCH 6/10 board: samsung: e850-96: Extract device info from fw loading code
In reply to Sam ProtsenkoMake it possible to provide the information about storage device where LDFW firmware resides to the firmware loading routine. The firmware loader code shouldn't have that data hard-coded anyway, and it also allows for implementing more dynamic behavior later, like choosing the storage device containing LDFW via some environment variables.
No functional change.
--- board/samsung/e850-96/e850-96.c | 9 ++++++- board/samsung/e850-96/fw.c | 45 ++++++++++++++++++++------------- board/samsung/e850-96/fw.h | 4 ++- 3 files changed, 38 insertions(+), 20 deletions(-)
board/samsung/e850-96/e850-96.c +8 -1
@@ -24,6 +24,12 @@#define EXYNOS850_APM_SHMEM_OFFSET 0x3200#define EXYNOS850_IPC_AP_I3C 10 +/* LDFW firmware definitions */ +#define LDFW_NWD_ADDR 0x88000000 +#define EMMC_IFNAME "mmc" +#define EMMC_DEV_NUM 0 +#define EMMC_ESP_PART 1 +struct efi_fw_image fw_images[] = { { .image_type_id =E850_96_FWBL1_IMAGE_GUID ,
@@ -141,7 +147,8 @@ int board_late_init(void)* Do this in board_late_init() to make sure MMC is not probed before * efi_init_early(). */ - err =load_ldfw (); + err =load_ldfw (EMMC_IFNAME ,EMMC_DEV_NUM ,EMMC_ESP_PART , +LDFW_NWD_ADDR );if (err)printf ("ERROR: LDFW loading failed (%d)\n" , err);
board/samsung/e850-96/fw.c +27 -18
93 lines not on this page · raw message
board/samsung/e850-96/fw.h +3 -1
@@ -7,6 +7,8 @@#ifndef __E850_96_FW_H#define __E850_96_FW_H -int load_ldfw (void ); +#include <asm/types.h> + +int load_ldfw (const char *ifname,int dev,int part,phys_addr_t addr);#endif /* __E850_96_FW_H */
Signature · 1 line
2.39.5
PATCH 7/10 board: samsung: e850-96: Add bootdev var to choose boot device
In reply to Sam ProtsenkoProvide a way for the user to select which storage to load the LDFW firmware from, by setting the corresponding environment variables:
- bootdev: block device interface name
- bootdevnum: block device number
- bootdevpart: partition number
This might be useful when the OS is flashed and booted from a different storage device than eMMC (e.g. USB flash drive). In this case it should be sufficient to just set:
=> setenv bootdev usb
=> env save
assuming that the USB drive layout follows the same partitioning scheme as defined in $partitions.
--- board/samsung/e850-96/e850-96.c | 40 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-)
board/samsung/e850-96/e850-96.c +30 -10
@@ -9,6 +9,7 @@#include <init.h> #include <mapmem.h> #include <net.h> +#include <usb.h> #include <asm/io.h> #include "fw.h" #include "pmic.h"
@@ -136,21 +137,40 @@ static void setup_ethaddr(void)eth_env_set_enetaddr ("ethaddr" , mac_addr); } -int board_late_init (void ) +/* +* Call this in board_late_init() to avoid probing block devices before +* efi_init_early(). +*/ +void load_firmware (void ) { +const char *ifname; +ulong dev, part;int err; -setup_serial (); -setup_ethaddr (); - -/* -* Do this in board_late_init() to make sure MMC is not probed before -* efi_init_early(). -*/ - err =load_ldfw (EMMC_IFNAME ,EMMC_DEV_NUM ,EMMC_ESP_PART , -LDFW_NWD_ADDR ); + ifname =env_get ("bootdev" ); +if (!ifname) + ifname =EMMC_IFNAME ; + dev =env_get_ulong ("bootdevnum" ,10 ,EMMC_DEV_NUM ); + part =env_get_ulong ("bootdevpart" ,10 ,EMMC_ESP_PART ); + +if (!strcmp (ifname,"usb" )) { +printf ("Starting USB (bootdev=usb)...\n" ); + err =usb_init (); +if (err) +return ; + } + +printf ("Loading LDFW firmware (from %s %ld)...\n" , ifname, dev); + err =load_ldfw (ifname, dev, part,LDFW_NWD_ADDR );if (err)printf ("ERROR: LDFW loading failed (%d)\n" , err); +} + +int board_late_init (void ) +{ +setup_serial (); +setup_ethaddr (); +load_firmware ();return 0 ; }
Signature · 1 line
2.39.5
PATCH 8/10 configs: e850-96: Disable CONFIG_DEFAULT_FDT_FILE
In reply to Sam ProtsenkoLinux kernel should use some separate device tree obtained from another source anyway. For example the dtb file can be read from /boot directory in eMMC rootfs partition, either by GRUB or U-Boot. Using U-Boot's device tree blob to provide it to the kernel (when CONFIG_DEFAULT_FDT_FILE is set and nobody else overrides this choice) might lead to undesired effects when booting the OS. For example, if a user sets "dr_mode" property to "host" value in U-Boot's dts to enable USB host capabilities in U-Boot, it might confuse usb-conn-gpio driver in Linux kernel later like this:
platform connector: deferred probe pending: usb-conn-gpio:
failed to get role switch
Disable CONFIG_DEFAULT_FDT_FILE option to avoid any possible confusion.
--- board/samsung/e850-96/e850-96.env | 2 +- configs/e850-96_defconfig | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
board/samsung/e850-96/e850-96.env +1 -1
@@ -5,7 +5,7 @@ fdt_addr_r=0x8c000000 scriptaddr=0x8c100000 pxefile_addr_r=0x8c200000 ramdisk_addr_r=0x8c300000 -fdtfile=CONFIG_DEFAULT_FDT_FILE +fdtfile=exynos/exynos850-e850-96.dtb dfu_alt_info= rawemmc raw 0 0x747c000 mmcpart 1;
configs/e850-96_defconfig +0 -1
@@ -19,7 +19,6 @@ CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y CONFIG_BOOTSTD_FULL=y -CONFIG_DEFAULT_FDT_FILE="exynos850-e850-96.dtb" # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_BOARD_INIT is not set CONFIG_BOARD_LATE_INIT=y
Signature · 1 line
2.39.5
PATCH 9/10 configs: e850-96: Enable USB host support
In reply to Sam ProtsenkoExynos850 SoC has a dual-role USB controller which can be configured in USB host role. As it's the only one USB controller on the board, it's shared between "device" USB connector (micro-USB) and host USB connectors. The hardware automatically powers on the host related parts when the micro-USB cable (for device role) is being disconnected. Also, as U-Boot lacks dynamic USB role switching capability, the only way to switch the role at the moment is to modify "dr_mode" property in U-Boot's device tree file here:
dts/upstream/src/arm64/exynos/exynos850-e850-96.dts
This won't affect the dynamic role switching later in Linux kernel, as a separate (different) device tree blob is provided to the kernel.
Enable the USB host support and corresponding commands to make it functional in E850-96 board.
--- configs/e850-96_defconfig | 5 +++++ 1 file changed, 5 insertions(+)
configs/e850-96_defconfig +5 -0
@@ -29,6 +29,8 @@ CONFIG_CMD_CLK=y CONFIG_CMD_DFU=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_EFIDEBUG=y # CONFIG_CMD_DATE is not set CONFIG_CMD_RTC=y
@@ -63,6 +65,9 @@ CONFIG_SYSRESET=y CONFIG_SYSRESET_SYSCON=y CONFIG_USB=y CONFIG_DM_USB_GADGET=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y CONFIG_USB_GADGET=y
Signature · 1 line
2.39.5
PATCH 10/10 configs: e850-96: Enable Ethernet
In reply to Sam ProtsenkoLAN9514 is a chip on E850-96 board which acts as a USB host hub and Ethernet controller. It's controlled via USB lines when DWC3 is configured to be in USB host role (by setting the "dr_mode" property to "host" value in e850-96 dts file).
Enable network support and LAN9514 chip support. This makes Ethernet functional on E850-96 board.
--- configs/e850-96_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
configs/e850-96_defconfig +3 -1
@@ -42,7 +42,7 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_REDUNDANT=y CONFIG_ENV_RELOC_GD_ENV_ADDR=y CONFIG_ENV_MMC_EMMC_HW_PARTITION=2 -CONFIG_NO_NET=y +CONFIG_NET_LWIP=y CONFIG_CLK_EXYNOS850=y CONFIG_DFU_MMC=y CONFIG_USB_FUNCTION_FASTBOOT=y
@@ -70,6 +70,8 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_SMSC95XX=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="Samsung" CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
Signature · 1 line
2.39.5
Quoted 24 lines · Sam Protsenko
The E850-96 board has a LAN9514 chip which acts as a USB hub and Ethernet controller. It's connected to the SoC via USB lines. In order to make this chip functional the USB controller in Exynos850 SoC has to be configured in the host role, and the corresponding power regulator has to be enabled as well.
This patch series enables USB host and network support on the E850-96 by making use of the LAN9514 chip. While at it, enable all power regulators (LDO) in the PMIC chip which can be useful in the bootloader and kernel, including the regulator used for LAN9514.
Sam Protsenko (10):
usb: host: dwc3-of-simple: Add exynos850 compatible
board: samsung: e850-96: Set ethaddr
board: samsung: e850-96: Add ACPM code
board: samsung: e850-96: Add PMIC code
board: samsung: e850-96: Configure PMIC regulators
board: samsung: e850-96: Extract device info from fw loading code
board: samsung: e850-96: Add bootdev var to choose boot device
configs: e850-96: DisableCONFIG_DEFAULT_FDT_FILE
configs: e850-96: Enable USB host support
configs: e850-96: Enable Ethernet
Quoted 17 lines
board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/acpm.c | 169 ++++++++++++++++++++++++++++++ board/samsung/e850-96/acpm.h | 27 +++++ board/samsung/e850-96/e850-96.c | 97 +++++++++++++++-- board/samsung/e850-96/e850-96.env | 2 +- board/samsung/e850-96/fw.c | 45 ++++---- board/samsung/e850-96/fw.h | 4 +- board/samsung/e850-96/pmic.c | 144 +++++++++++++++++++++++++ board/samsung/e850-96/pmic.h | 14 +++ configs/e850-96_defconfig | 10 +- drivers/usb/host/dwc3-of-simple.c | 1 + 11 files changed, 482 insertions(+), 33 deletions(-) create mode 100644 board/samsung/e850-96/acpm.c create mode 100644 board/samsung/e850-96/acpm.h create mode 100644 board/samsung/e850-96/pmic.c create mode 100644 board/samsung/e850-96/pmic.h
Hi Minkyu,
If there are no objections, can you please apply this series?
Thanks!
Quoted 3 lines
--
2.39.5
Hi Sam
Quoted 24 lines · Sam Protsenko
The E850-96 board has a LAN9514 chip which acts as a USB hub and Ethernet controller. It's connected to the SoC via USB lines. In order to make this chip functional the USB controller in Exynos850 SoC has to be configured in the host role, and the corresponding power regulator has to be enabled as well.
This patch series enables USB host and network support on the E850-96 by making use of the LAN9514 chip. While at it, enable all power regulators (LDO) in the PMIC chip which can be useful in the bootloader and kernel, including the regulator used for LAN9514.
Sam Protsenko (10):
usb: host: dwc3-of-simple: Add exynos850 compatible
board: samsung: e850-96: Set ethaddr
board: samsung: e850-96: Add ACPM code
board: samsung: e850-96: Add PMIC code
board: samsung: e850-96: Configure PMIC regulators
board: samsung: e850-96: Extract device info from fw loading code
board: samsung: e850-96: Add bootdev var to choose boot device
configs: e850-96: DisableCONFIG_DEFAULT_FDT_FILE
configs: e850-96: Enable USB host support
configs: e850-96: Enable Ethernet
Quoted 17 lines
board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/acpm.c | 169 ++++++++++++++++++++++++++++++ board/samsung/e850-96/acpm.h | 27 +++++ board/samsung/e850-96/e850-96.c | 97 +++++++++++++++-- board/samsung/e850-96/e850-96.env | 2 +- board/samsung/e850-96/fw.c | 45 ++++---- board/samsung/e850-96/fw.h | 4 +- board/samsung/e850-96/pmic.c | 144 +++++++++++++++++++++++++ board/samsung/e850-96/pmic.h | 14 +++ configs/e850-96_defconfig | 10 +- drivers/usb/host/dwc3-of-simple.c | 1 + 11 files changed, 482 insertions(+), 33 deletions(-) create mode 100644 board/samsung/e850-96/acpm.c create mode 100644 board/samsung/e850-96/acpm.h create mode 100644 board/samsung/e850-96/pmic.c create mode 100644 board/samsung/e850-96/pmic.h
Can you move pmic to drivers/power/pmic/ ?
Thanks
-Anand
Quoted 3 lines · Anand Moon
Hi Sam
Hi Anand,
Quoted 42 lines · Sam Protsenko
Quoted 24 lines
The E850-96 board has a LAN9514 chip which acts as a USB hub and Ethernet controller. It's connected to the SoC via USB lines. In order to make this chip functional the USB controller in Exynos850 SoC has to be configured in the host role, and the corresponding power regulator has to be enabled as well.
This patch series enables USB host and network support on the E850-96 by making use of the LAN9514 chip. While at it, enable all power regulators (LDO) in the PMIC chip which can be useful in the bootloader and kernel, including the regulator used for LAN9514.
Sam Protsenko (10):
usb: host: dwc3-of-simple: Add exynos850 compatible
board: samsung: e850-96: Set ethaddr
board: samsung: e850-96: Add ACPM code
board: samsung: e850-96: Add PMIC code
board: samsung: e850-96: Configure PMIC regulators
board: samsung: e850-96: Extract device info from fw loading code
board: samsung: e850-96: Add bootdev var to choose boot device
configs: e850-96: DisableCONFIG_DEFAULT_FDT_FILE
configs: e850-96: Enable USB host support
configs: e850-96: Enable EthernetQuoted 17 lines
board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/acpm.c | 169 ++++++++++++++++++++++++++++++ board/samsung/e850-96/acpm.h | 27 +++++ board/samsung/e850-96/e850-96.c | 97 +++++++++++++++-- board/samsung/e850-96/e850-96.env | 2 +- board/samsung/e850-96/fw.c | 45 ++++---- board/samsung/e850-96/fw.h | 4 +- board/samsung/e850-96/pmic.c | 144 +++++++++++++++++++++++++ board/samsung/e850-96/pmic.h | 14 +++ configs/e850-96_defconfig | 10 +- drivers/usb/host/dwc3-of-simple.c | 1 + 11 files changed, 482 insertions(+), 33 deletions(-) create mode 100644 board/samsung/e850-96/acpm.c create mode 100644 board/samsung/e850-96/acpm.h create mode 100644 board/samsung/e850-96/pmic.c create mode 100644 board/samsung/e850-96/pmic.h
Quoted 2 lines
Can you move pmic to
drivers/power/pmic/?
Thank you for the review! This PMIC code is not really a driver, at least not yet. It's an ad-hoc solution, which is very specific to E850-96 board, and in its current form can't be used (even in theory) for different platforms. It also doesn't conform to U-Boot's Driver Model -- and I'd like to avoid reworking in such a way, please see the explanation below. At the moment it's very minimal and only needed to make Ethernet functional.
The plan for proper PMIC enablement is to do that first in Linux kernel, i.e.:
- implement S2MPU12 driver
- define ACPM bus in device tree
- define PMIC node in device tree and describe all needed LDO regulators
and then porting all that into U-Boot. But that effort might take quite a long time to implement, as I'm the only engineer working on the E850-96 enablement at the moment. So I really think it's better to keep the PMIC code as a part of the board code for now, hope you're ok with that?
Thanks!
Quoted 2 lines
Thanks
-Anand
Hi Sam,
Quoted 66 lines · Sam Protsenko
Quoted 3 lines · Anand Moon
Hi Sam
Hi Anand,
Quoted 42 lines · Sam Protsenko
Quoted 24 lines
The E850-96 board has a LAN9514 chip which acts as a USB hub and Ethernet controller. It's connected to the SoC via USB lines. In order to make this chip functional the USB controller in Exynos850 SoC has to be configured in the host role, and the corresponding power regulator has to be enabled as well.
This patch series enables USB host and network support on the E850-96 by making use of the LAN9514 chip. While at it, enable all power regulators (LDO) in the PMIC chip which can be useful in the bootloader and kernel, including the regulator used for LAN9514.
Sam Protsenko (10):
usb: host: dwc3-of-simple: Add exynos850 compatible
board: samsung: e850-96: Set ethaddr
board: samsung: e850-96: Add ACPM code
board: samsung: e850-96: Add PMIC code
board: samsung: e850-96: Configure PMIC regulators
board: samsung: e850-96: Extract device info from fw loading code
board: samsung: e850-96: Add bootdev var to choose boot device
configs: e850-96: DisableCONFIG_DEFAULT_FDT_FILE
configs: e850-96: Enable USB host support
configs: e850-96: Enable EthernetQuoted 17 lines
board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/acpm.c | 169 ++++++++++++++++++++++++++++++ board/samsung/e850-96/acpm.h | 27 +++++ board/samsung/e850-96/e850-96.c | 97 +++++++++++++++-- board/samsung/e850-96/e850-96.env | 2 +- board/samsung/e850-96/fw.c | 45 ++++---- board/samsung/e850-96/fw.h | 4 +- board/samsung/e850-96/pmic.c | 144 +++++++++++++++++++++++++ board/samsung/e850-96/pmic.h | 14 +++ configs/e850-96_defconfig | 10 +- drivers/usb/host/dwc3-of-simple.c | 1 + 11 files changed, 482 insertions(+), 33 deletions(-) create mode 100644 board/samsung/e850-96/acpm.c create mode 100644 board/samsung/e850-96/acpm.h create mode 100644 board/samsung/e850-96/pmic.c create mode 100644 board/samsung/e850-96/pmic.hQuoted 2 lines
Can you move pmic to
drivers/power/pmic/?Thank you for the review! This PMIC code is not really a driver, at least not yet. It's an ad-hoc solution, which is very specific to E850-96 board, and in its current form can't be used (even in theory) for different platforms. It also doesn't conform to U-Boot's Driver Model -- and I'd like to avoid reworking in such a way, please see the explanation below. At the moment it's very minimal and only needed to make Ethernet functional.
The plan for proper PMIC enablement is to do that first in Linux kernel, i.e.:
- implement S2MPU12 driver
- define ACPM bus in device tree
- define PMIC node in device tree and describe all needed LDO regulators
Quoted 6 lines
and then porting all that into U-Boot. But that effort might take quite a long time to implement, as I'm the only engineer working on the E850-96 enablement at the moment. So I really think it's better to keep the PMIC code as a part of the board code for now, hope you're ok with that?
Ok, Thanks for this input.
Thanks
-Anand
Hi
2025년 8월 30일 (토) 00:48, Anand Moon <[email protected]>님이 작성:
Quoted 81 lines
Hi Sam,
Quoted 2 lines · Sam Protsenko
On Sun, Aug 24, 2025 at 8:22 AM Anand Moon <[email protected]>
Quoted 7 lines · wrote:
Quoted 3 lines
Hi Sam
Hi Anand,
Quoted 1 line
On Thu, 7 Aug 2025 at 03:57, Sam Protsenko <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
The E850-96 board has a LAN9514 chip which acts as a USB hub and Ethernet controller. It's connected to the SoC via USB lines. In
order
Quoted 1 line
Quoted 1 line
Quoted 1 line
to make this chip functional the USB controller in Exynos850 SoC has
to
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
be configured in the host role, and the corresponding power regulator has to be enabled as well.
This patch series enables USB host and network support on the
E850-96 by
Quoted 1 line
Quoted 1 line
Quoted 1 line
making use of the LAN9514 chip. While at it, enable all power
regulators
Quoted 1 line
Quoted 1 line
Quoted 1 line
(LDO) in the PMIC chip which can be useful in the bootloader and
kernel,
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
including the regulator used for LAN9514.
Sam Protsenko (10):
usb: host: dwc3-of-simple: Add exynos850 compatible
board: samsung: e850-96: Set ethaddr
board: samsung: e850-96: Add ACPM code
board: samsung: e850-96: Add PMIC code
board: samsung: e850-96: Configure PMIC regulators
board: samsung: e850-96: Extract device info from fw loading code
board: samsung: e850-96: Add bootdev var to choose boot device
configs: e850-96: DisableCONFIG_DEFAULT_FDT_FILE
configs: e850-96: Enable USB host support
configs: e850-96: Enable EthernetQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
board/samsung/e850-96/Makefile | 2 +- board/samsung/e850-96/acpm.c | 169++++++++++++++++++++++++++++++
Quoted 26 lines
Quoted 15 lines
Quoted 6 lines
board/samsung/e850-96/acpm.h | 27 +++++ board/samsung/e850-96/e850-96.c | 97 +++++++++++++++-- board/samsung/e850-96/e850-96.env | 2 +- board/samsung/e850-96/fw.c | 45 ++++---- board/samsung/e850-96/fw.h | 4 +- board/samsung/e850-96/pmic.c | 144 +++++++++++++++++++++++++Quoted 9 lines
board/samsung/e850-96/pmic.h | 14 +++ configs/e850-96_defconfig | 10 +- drivers/usb/host/dwc3-of-simple.c | 1 + 11 files changed, 482 insertions(+), 33 deletions(-) create mode 100644 board/samsung/e850-96/acpm.c create mode 100644 board/samsung/e850-96/acpm.h create mode 100644 board/samsung/e850-96/pmic.c create mode 100644 board/samsung/e850-96/pmic.hQuoted 2 lines
Can you move pmic to
drivers/power/pmic/?Thank you for the review! This PMIC code is not really a driver, at least not yet. It's an ad-hoc solution, which is very specific to E850-96 board, and in its current form can't be used (even in theory) for different platforms. It also doesn't conform to U-Boot's Driver Model -- and I'd like to avoid reworking in such a way, please see the explanation below. At the moment it's very minimal and only needed to make Ethernet functional.
Quoted 1 line
The plan for proper PMIC enablement is to do that first in Linux kernel,
i.e.:
Quoted 3 lines
- implement S2MPU12 driver
- define ACPM bus in device tree
- define PMIC node in device tree and describe all needed LDOregulators
Quoted 1 line
Quoted 7 lines
Quoted 6 lines
and then porting all that into U-Boot. But that effort might take quite a long time to implement, as I'm the only engineer working on the E850-96 enablement at the moment. So I really think it's better to keep the PMIC code as a part of the board code for now, hope you're ok with that?
Ok, Thanks for this input.
applied to u-boot-samsung.
Thanks.
Minkyu Kang.
Quoted 4 lines
Thanks
-Anand