[PATCH 5/5] gpio: axp: Remove virtual VBUS enable GPIO

2023-10-31 Thread Samuel Holland
Now that this functionality is modeled using the device tree and regulator uclass, the named GPIO is not referenced anywhere. Remove it, along with the rest of the support for AXP virtual GPIOs. Signed-off-by: Samuel Holland --- drivers/gpio/axp_gpio.c | 75

[PATCH 4/5] sunxi: Remove obsolete USBx_VBUS_PIN Kconfig symbols

2023-10-31 Thread Samuel Holland
Now that the USB PHY driver uses the device tree to get VBUS supply regulators, these Kconfig symbols are unused. Remove them. Signed-off-by: Samuel Holland --- arch/arm/mach-sunxi/Kconfig | 29 configs/A10s-OLinuXino-M_defconfig | 1 - configs

[PATCH 3/5] phy: sun4i-usb: Control supplies via the regulator uclass

2023-10-31 Thread Samuel Holland
uino3-nano (PD2) - icnova-a20-swac_defconfig (PG10) / sun7i-a20-icnova-swac (PH6) Finally, this board has conflicting pins given for its USB2 VBUS: - Lamobo_R1_defconfig (PH3) / sun7i-a20-lamobo-r1 (PH12) Signed-off-by: Samuel Holland --- drivers/phy/allwinner/phy-sun4i-usb.c | 41 +

[PATCH 2/5] sunxi: Enable PMIC drivevbus regulator support for USB supplies

2023-10-31 Thread Samuel Holland
On many boards, the USB ports are powered by the PMIC's "drivevbus" regulator. In preparation for switching the USB PHY driver to use the regulator uclass instead of a virtual GPIO pin, ensure these boards have AXP PMIC regulator support enabled. Signed-off-by: Samuel Holland --- c

[PATCH 1/5] power: regulator: Add a driver for the AXP PMIC drivevbus

2023-10-31 Thread Samuel Holland
AXP PMICs have a pin which can either report the USB VBUS state, or driving a regulator that supplies USB VBUS. Add a regulator driver for controlling this pin. The selection between input and output is done via the x-powers,drive-vbus-en pin on the PMIC (parent) node. Signed-off-by: Samuel

[PATCH 0/5] sunxi: Control USB VBUS supplies via DT regulators

2023-10-31 Thread Samuel Holland
...@sholland.org/ Samuel Holland (5): power: regulator: Add a driver for the AXP PMIC drivevbus sunxi: Enable PMIC drivevbus regulator support for USB supplies phy: sun4i-usb: Control supplies via the regulator uclass sunxi: Remove obsolete USBx_VBUS_PIN Kconfig symbols gpio: axp: Remove

[PATCH] riscv: Weakly define invalidate_icache_range()

2023-10-30 Thread Samuel Holland
Some RISC-V CPUs, such as the T-HEAD XuanTie series, have a vendor-specific way to invalidate a portion of the instruction cache. Allow them to override invalidate_icache_range(). Signed-off-by: Samuel Holland --- arch/riscv/lib/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] riscv: Align the trap handler to 64 bytes

2023-10-30 Thread Samuel Holland
ha Signed-off-by: Samuel Holland --- arch/riscv/cpu/mtrap.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/cpu/mtrap.S b/arch/riscv/cpu/mtrap.S index 6eb3ed1d5a8..5cad7b41ff7 100644 --- a/arch/riscv/cpu/mtrap.S +++ b/arch/riscv/cpu/mtrap.S @@ -26,7 +26,7 @@

[PATCH] riscv: Sort target configs alphabetically

2023-10-30 Thread Samuel Holland
Clean things up for the next time somebody adds a target. Signed-off-by: Samuel Holland --- arch/riscv/Kconfig | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 8fc81fb284c..6d0d812ddb5 100644 --- a/arch/riscv

[PATCH] net: sun8i_emac: Drop DM_GPIO checks

2023-10-30 Thread Samuel Holland
DM_GPIO is always enable in U-Boot proper for ARCH_SUNXI, and this driver is never enabled in SPL, so the condition is always true. Signed-off-by: Samuel Holland --- drivers/net/sun8i_emac.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/net/sun8i_emac.c b/drivers/net

[PATCH 2/2] sunxi: mmc: Move header to the driver directory

2023-10-30 Thread Samuel Holland
changed. Signed-off-by: Samuel Holland --- arch/arm/include/asm/arch-sunxi/mmc.h | 139 +- drivers/mmc/sunxi_mmc.c | 4 + drivers/mmc/sunxi_mmc.h | 138 + 3 files changed, 146 insertions(+), 135 deletions(-) create

[PATCH 1/2] sunxi: mmc: Sort compatible strings numerically

2023-10-30 Thread Samuel Holland
commit 95168d77d391 ("sunxi: add Allwinner R528/T113 SoC support") added the new entry out of order. Signed-off-by: Samuel Holland --- drivers/mmc/sunxi_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c index 4

[PATCH v3 4/4] sunxi: Enable SPL FIT loading for 32-bit SoCs

2023-10-30 Thread Samuel Holland
Now that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default. SPL_FIT_IMAGE_TINY is required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere. Signed-off-by: Samuel Holland --- (no changes

[PATCH v3 3/4] sunxi: binman: Support FIT generation for 32-bit SoCs

2023-10-30 Thread Samuel Holland
on 32-bit SoCs. Instead, after loading the firmware, U-Boot proper is executed directly. Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Rely on binman min-size instead of using explicit offsets - Use Kconfig for firmware addresses instead of an #ifdef staircase arch

[PATCH v3 2/4] sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig

2023-10-30 Thread Samuel Holland
This is easier to read than the #ifdef staircase, provides better visibility into the memory map (alongside the other Kconfig definitions), and allows these addresses to be reused from code. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New

[PATCH v3 1/4] sunxi: spl: Disable padding from SPL_PAD_TO

2023-10-30 Thread Samuel Holland
do not want to unnecessarily pad SPL out to these giant sizes, we must set SPL_PAD_TO to zero. This causes no problems because binman already takes care of appending the SPL payload at the right offset. Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New patch for v2

[PATCH v3 0/4] sunxi: SPL FIT support for 32-bit sunxi SoCs

2023-10-30 Thread Samuel Holland
: - Disable padding from SPL_PAD_TO - Rely on binman min-size instead of using explicit offsets - Use Kconfig for firmware addresses instead of an #ifdef staircase Samuel Holland (4): sunxi: spl: Disable padding from SPL_PAD_TO sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig

[RESEND PATCH v3] serial: ns16550: Enable clocks during probe

2023-10-30 Thread Samuel Holland
If the UART bus or baud clock has a gate, it must be enabled before the UART can be used. Reviewed-by: Stefan Roese Signed-off-by: Samuel Holland --- Changes in v3: - Switch back to the original patch, now that the phycore-rk3288 build is fixed by enabling LTO. Changes in v2: - Only

[PATCH] pinctrl: sunxi: Avoid using .bss for SPL

2023-10-30 Thread Samuel Holland
sunxi platforms put .bss in DRAM, so .bss is not available in SPL before DRAM controller initialization. Therefore, this buffer must be placed in the .data section. Signed-off-by: Samuel Holland --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] clk: sunxi: Use the right symbol in the Makefile

2023-10-30 Thread Samuel Holland
CONFIG_ARCH_SUNXI will not be enabled for RISC-V SoCs using this driver. Use the symbol for the driver itself instead. Signed-off-by: Samuel Holland --- drivers/clk/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index

Re: [PATCH v2 16/22] sunxi: add R528/T113-s3/D1(s) DRAM initialisation code

2023-10-22 Thread Samuel Holland
Hi Andre, On 10/22/23 17:40, Andre Przywara wrote: > On Sat, 21 Oct 2023 22:52:06 -0500 > Samuel Holland wrote: >> On 9/28/23 16:54, Andre Przywara wrote: >>> The Allwinner R528/T113-s/D1/D1s SoCs all share the same die, so use the >>> same DRAM initialisation c

Re: [PATCH v2 16/22] sunxi: add R528/T113-s3/D1(s) DRAM initialisation code

2023-10-21 Thread Samuel Holland
clrsetbits_le32(0x3202004, 0xffc, 0x6f0); > + } > + /* store rank1 config in upper half of para1 */ > + offs += 16; > + mc_work_mode += 4; /* move to MC_WORK_MODE2 */ > + } > + } > + if (maxrank == 2) { > + config->dram_para2 &= 0xf0ff; > + /* note: rval is equal to para->dram_para1 here */ > + if ((rval & 0x) == (rval >> 16)) { > + debug("rank1 config same as rank0\n"); > + } else { > + config->dram_para2 |= BIT(8); > + debug("rank1 config different from rank0\n"); > + } > + } > + > + return 1; > +} > [...] > +static int sunxi_ram_probe(struct udevice *dev) > +{ > + struct sunxi_ram_priv *priv = dev_get_priv(dev); > + unsigned long dram_size; > + > + debug("%s: %s: probing\n", __func__, dev->name); > + > + dram_size = sunxi_dram_init(); > + if (!dram_size) { > + printf("DRAM init failed: %d\n", ret); There is no ret variable anymore, so this fails to compile. With this line and the variable size issue fixed, this driver works on my Nezha board, so with those fixes: Tested-by: Samuel Holland > + return -ENODEV; > + } > + > + priv->size = dram_size; > + > + return 0; > +}

Re: [PATCH v2 15/22] Kconfig: sunxi: prepare for using drivers/ram/sunxi

2023-10-21 Thread Samuel Holland
Hi Andre, On 9/28/23 16:54, Andre Przywara wrote: > At the moment all Allwinner DRAM initialisation routines are stored in > arch/arm/mach-sunxi, even though those "drivers" are just a giant > collection of writel's, without any architectural dependency. > > The R528/T113-s SoC (with ARM cores)

Re: [PATCH v2 10/22] sunxi: introduce NCAT2 generation model

2023-10-21 Thread Samuel Holland
default 0x2 if SUN50I_GEN_H6 || SUNXI_GEN_NCAT2 > default 0x0 > ---help--- > Older Allwinner SoCs have their mask boot ROM mapped just below 4GB, > @@ -189,6 +189,14 @@ config SUN50I_GEN_H6 > Select this for sunxi SoCs which have H6 like peripherals, clocks > and memory map. > > +config SUNXI_GEN_NCAT2 > + bool > + select MMC_SUNXI_HAS_NEW_MODE > + select SUPPORT_SPL > + ---help--- > + Select this for sunxi SoCs which have D1 like peripherals, clocks > + and memory map. This will eventually need to go in board/sunxi/Kconfig, so it can be selected by D1 (ARCH_SUNXI=n). For now: Tested-by: Samuel Holland

Re: [PATCH v2 01/22] sunxi: remove CONFIG_SATAPWR

2023-10-21 Thread Samuel Holland
On 10/21/23 18:27, Andre Przywara wrote: > On Thu, 19 Oct 2023 18:51:30 -0500 > Samuel Holland wrote: > > Hi Samuel, > > thanks for having a look! > >> On 9/28/23 16:54, Andre Przywara wrote: >>> The CONFIG_SATAPWR Kconfig symbol was used to point

Re: [PATCH v2 09/22] pinctrl: sunxi: add new D1 pinctrl support

2023-10-21 Thread Samuel Holland
ALTERNATIVE > config SUNXI_A64_TIMER_ERRATUM > bool > > +config SUNXI_NEW_PINCTRL Please put this in drivers/gpio/Kconfig so it can be selected on RISC-V (ARCH_SUNXI=n). With that: Tested-by: Samuel Holland Regards, Samuel > + bool > + ---help--- > + The Allwinner

Re: [PATCH v2 07/22] pinctrl: sunxi: remove GPIO_EXTRA_HEADER

2023-10-21 Thread Samuel Holland
eletions(-) > rename arch/arm/include/asm/arch-sunxi/gpio.h => include/sunxi_gpio.h (100%) Tested-by: Samuel Holland

Re: [PATCH v2 06/22] pinctrl: sunxi: remove struct sunxi_gpio

2023-10-21 Thread Samuel Holland
GPIO_CFG_REG_OFFSET 0x00 > #define GPIO_CFG_INDEX(pin) (((pin) & 0x1f) >> 3) > #define GPIO_CFG_OFFSET(pin) pin) & 0x1f) & 0x7) << 2) > > +#define GPIO_DAT_REG_OFFSET 0x10 > + > +#define GPIO_DRV_REG_OFFSET 0x14 > #define GPIO_DRV_IN

Re: [PATCH v2 05/22] pinctrl: sunxi: add GPIO in/out wrappers

2023-10-21 Thread Samuel Holland
> @@ -231,13 +232,8 @@ int sunxi_name_to_gpio(const char *name) > static int sunxi_gpio_get_value(struct udevice *dev, unsigned offset) > { > struct sunxi_gpio_plat *plat = dev_get_plat(dev); > - u32 num = GPIO_NUM(offset); > - unsigned dat; > -

Re: [PATCH v2 04/22] pinctrl: sunxi: move pinctrl code

2023-10-21 Thread Samuel Holland
| 1 - > arch/arm/mach-sunxi/pinmux.c | 78 --- > drivers/gpio/sunxi_gpio.c | 102 - > 4 files changed, 105 insertions(+), 96 deletions(-) > delete mode 100644 arch/arm/mach-sunxi/pinmux.c Many thanks! This works perfec

Re: [PATCH v2 03/22] sunxi: remove CONFIG_MACPWR

2023-10-20 Thread Samuel Holland
Hi Andre, On 9/28/23 16:54, Andre Przywara wrote: > The CONFIG_MACPWR Kconfig symbol is used to point to a GPIO that enables > the power for the Ethernet "MAC" (mostly PHY, really). > In the DT this is described with the phy-supply property in the MAC DT > node, pointing to a (GPIO controlled)

Re: [PATCH v2 11/22] pinctrl: sunxi: add Allwinner D1 pinctrl description

2023-10-20 Thread Samuel Holland
Hi Andre, On 9/28/23 16:54, Andre Przywara wrote: > Apart from using the new pinctrl MMIO register layout, the Allwinner D1 > and related SoCs still need to usual set of mux values hardcoded in > U-Boot's pinctrl driver. > Add the values we need so far to this list, so that DM based drivers >

Re: [PATCH v2 02/22] net: sunxi_emac: chase DT nodes to find PHY regulator

2023-10-19 Thread Samuel Holland
dev *priv = dev_get_priv(dev); > + struct ofnode_phandle_args args; > + ofnode mdio_node; > + int ret; > > pdata->iobase = dev_read_addr(dev); > > + /* The PHY regulator is in the MDIO node, not the EMAC or PHY node. */ > + ret = dev

Re: [PATCH v2 12/22] clk: sunxi: Add support for the D1 CCU

2023-10-19 Thread Samuel Holland
On 9/28/23 16:54, Andre Przywara wrote: > From: Samuel Holland > > Since the D1 CCU binding is defined, we can add support for its > gates/resets, following the pattern of the existing drivers. > > Signed-off-by: Samuel Holland > Reviewed-by: Andre Przywara > Acked-by:

Re: [PATCH v2 01/22] sunxi: remove CONFIG_SATAPWR

2023-10-19 Thread Samuel Holland
On 9/28/23 16:54, Andre Przywara wrote: > The CONFIG_SATAPWR Kconfig symbol was used to point to a GPIO that > enables the power for a SATA harddisk. > In the DT this is described with the target-supply property in the AHCI > DT node, pointing to a (GPIO controlled) regulator. Since we need SATA >

Re: [PATCH] riscv: andesv5: Prefer using the generic RISC-V timer driver in S-mode

2023-09-27 Thread Samuel Holland
_NDS > imply CPU > imply CPU_RISCV > imply RISCV_TIMER if (RISCV_SMODE || SPL_RISCV_SMODE) > + imply ANDES_PLMT_TIMER if RISCV_MMODE > + imply SPL_ANDES_PLMT_TIMER if SPL_RISCV_MMODE You don't need the "if RISCV_MMODE" condition since the imply statement will

Re: [PATCH 4/6] clk: Fix rate caching in clk_get_parent_rate()

2023-03-04 Thread Samuel Holland
On 2/20/23 10:11, Sean Anderson wrote: > On 2/20/23 00:59, Samuel Holland wrote: >> clk_get_rate() can return an error value. Recompute the rate if the >> cached value is an error value. >> >> Fixes: 4aa78300a025 ("dm: clk: Define clk_get_parent_rate() for c

Re: [PATCH 3/6] clk: Fix error handling in clk_get_parent()

2023-03-04 Thread Samuel Holland
On 2/20/23 04:39, Michal Suchánek wrote: > On Sun, Feb 19, 2023 at 11:59:36PM -0600, Samuel Holland wrote: >> Do not return both NULL and error pointers. The function is only >> documented as returning error pointers. >> >> Fixes: 8a1661f20e6c ("drivers: clk:

Re: [PATCH 1/6] clk: Handle error pointers in clk_valid()

2023-03-04 Thread Samuel Holland
On 2/20/23 13:42, Michal Suchánek wrote: > On Mon, Feb 20, 2023 at 10:57:17AM -0500, Sean Anderson wrote: >> >> On 2/20/23 05:46, Michal Suchánek wrote: >>> On Sun, Feb 19, 2023 at 11:59:34PM -0600, Samuel Holland wrote: >>>> Some clk uclass functions, such

[PATCH] fastboot: Only call the bootm command if it is enabled

2023-02-19 Thread Samuel Holland
This fixes an error with trying to link against do_bootm() when CONFIG_CMD_BOOTM is disabled. Signed-off-by: Samuel Holland --- drivers/fastboot/fb_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c index

[PATCH 3/3] remoteproc: Remove legacy probing method

2023-02-19 Thread Samuel Holland
This removes code that abused the device's platform data, interpreting the driver platform data as if it was the uclass platform data. Signed-off-by: Samuel Holland --- .../driver-model/remoteproc-framework.rst | 29 --- drivers/remoteproc/rproc-uclass.c | 18

[PATCH 2/3] remoteproc: Remove unused mem_type platform data

2023-02-19 Thread Samuel Holland
There is only one possible value for this field, it is unused except for debugging, and the devicetree property is not documented. Signed-off-by: Samuel Holland --- cmd/remoteproc.c | 12 +--- doc/develop/driver-model/remoteproc-framework.rst | 1

[PATCH 1/3] remoteproc: Move rproc_cfg_arr out of the uclass header

2023-02-19 Thread Samuel Holland
This array is private to the IPU driver, so it should be declared there. Signed-off-by: Samuel Holland --- drivers/remoteproc/ipu_rproc.c | 4 +++- include/remoteproc.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/ipu_rproc.c b/drivers

[PATCH 0/3] remoteproc: uclass cleanup

2023-02-19 Thread Samuel Holland
This series cleans up some misplaced and dead code that I ran in to while writing a new remoteproc driver for the Bouffalo Lab BL808. Samuel Holland (3): remoteproc: Move rproc_cfg_arr out of the uclass header remoteproc: Remove unused mem_type platform data remoteproc: Remove legacy

[PATCH] riscv: Support CONFIG_REMAKE_ELF

2023-02-19 Thread Samuel Holland
Add flags to tell objcopy what kind of ELF to create. Signed-off-by: Samuel Holland --- arch/riscv/config.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk index a8ed3faf28c..e5f4af22bcb 100644 --- a/arch/riscv/config.mk +++ b/arch/riscv

[PATCH 6/6] clk: Add a .get_parent operation

2023-02-19 Thread Samuel Holland
This allows clk_get_parent() to work with non-CCF clock drivers. Signed-off-by: Samuel Holland --- drivers/clk/clk-uclass.c | 18 -- include/clk-uclass.h | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk

[PATCH 5/6] clk: Remove an unneeded check from clk_get_parent_rate()

2023-02-19 Thread Samuel Holland
There is no need to check the parent clock's ops. The following call to clk_get_rate() does that already. Signed-off-by: Samuel Holland --- drivers/clk/clk-uclass.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 9d052e5a814

[PATCH 2/6] clk: Fix error handling in clk_get_rate()

2023-02-19 Thread Samuel Holland
log_ret() cannot work with unsigned values, and the assignment to 'ret' incorrectly truncates the rate from long to int. Fixes: 5c5992cb90cf ("clk: Add debugging for return values") Signed-off-by: Samuel Holland --- drivers/clk/clk-uclass.c | 7 +-- 1 file changed, 1 inser

[PATCH 4/6] clk: Fix rate caching in clk_get_parent_rate()

2023-02-19 Thread Samuel Holland
clk_get_rate() can return an error value. Recompute the rate if the cached value is an error value. Fixes: 4aa78300a025 ("dm: clk: Define clk_get_parent_rate() for clk operations") Signed-off-by: Samuel Holland --- drivers/clk/clk-uclass.c | 3 ++- 1 file changed, 2 insertions(+),

[PATCH 3/6] clk: Fix error handling in clk_get_parent()

2023-02-19 Thread Samuel Holland
Do not return both NULL and error pointers. The function is only documented as returning error pointers. Fixes: 8a1661f20e6c ("drivers: clk: Handle gracefully NULL pointers") Signed-off-by: Samuel Holland --- drivers/clk/clk-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH 0/6] clk: uclass fixes and improvements

2023-02-19 Thread Samuel Holland
it to implement PLL rate setting on sunxi. Samuel Holland (6): clk: Handle error pointers in clk_valid() clk: Fix error handling in clk_get_rate() clk: Fix error handling in clk_get_parent() clk: Fix rate caching in clk_get_parent_rate() clk: Remove an unneeded check from clk_get_parent_rate

[PATCH 1/6] clk: Handle error pointers in clk_valid()

2023-02-19 Thread Samuel Holland
Some clk uclass functions, such as devm_clk_get() and clk_get_parent(), return error pointers. clk_valid() should not consider these pointers to be valid. Fixes: 8a1661f20e6c ("drivers: clk: Handle gracefully NULL pointers") Signed-off-by: Samuel Holland --- include/clk.h | 2

Re: [RFC PATCH] doc: arch: Add document for RISC-V architecture

2023-02-12 Thread Samuel Holland
ent if there is anything I've missed that should > be mentioned in the document. Thanks. > --- > doc/arch/index.rst | 1 + > doc/arch/riscv.rst | 43 +++ > 2 files changed, 44 insertions(+) > create mode 100644 doc/arch/riscv.rst Reviewed-by: Samuel Holland

Re: [PATCH v3 68/76] usb: Drop unused fotg210 gadget

2023-02-10 Thread Samuel Holland
On 2/1/23 14:20, Simon Glass wrote: > This is not used and appears to be associated with the faraday board which > has been removed. Drop the driver and Kconfig options. > > Signed-off-by: Simon Glass > --- > > (no changes since v1) > > drivers/usb/gadget/Makefile | 3 +- >

Re: [PATCH v2 2/4] sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig

2023-01-23 Thread Samuel Holland
Hi Simon, On 1/23/23 12:42, Simon Glass wrote: > HI Samuel, > > On Sun, 22 Jan 2023 at 14:16, Samuel Holland wrote: >> >> This is easier to read than the #ifdef staircase, provides better >> visibility into the memory map (alongside the other Kconfig >> definit

[PATCH] ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator

2023-01-22 Thread Samuel Holland
t in Linux. Signed-off-by: Samuel Holland --- arch/arm/dts/sun6i-a31-mixtile-loftq.dts | 17 + 1 file changed, 17 insertions(+) diff --git a/arch/arm/dts/sun6i-a31-mixtile-loftq.dts b/arch/arm/dts/sun6i-a31-mixtile-loftq.dts index dde9bdf2f9..bd98fb3e6a 100644 --- a/arch/arm/dts

[PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO

2023-01-22 Thread Samuel Holland
Now that this functionality is modeled using the device tree and regulator uclass, the named GPIO is not referenced anywhere. Remove it. Signed-off-by: Samuel Holland --- arch/arm/include/asm/arch-sunxi/gpio.h | 1 - drivers/gpio/axp_gpio.c| 21 - drivers

[PATCH 2/3] sunxi: Switch to PMIC USB power supply VBUS detection

2023-01-22 Thread Samuel Holland
ys enabled: - Nintendo_NES_Classic_Edition_defconfig / sun8i-r16-nintendo-nes-classic The PHY driver already assumes VBUS is enabled when no detection method is available, so again this will not cause any problems. Signed-off-by: Samuel Holland --- configs/A33-OLinuXino_defconfig| 2 +- configs/Ainol_AW1

[PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply

2023-01-22 Thread Samuel Holland
This driver reports the presence/absence of voltage on the PMIC's USB VBUS pin. This information is used by the USB PHY driver. The corresponding Linux driver uses the power supply class, which does not exist in U-Boot. UCLASS_REGULATOR seems to be the closest match. Signed-off-by: Samuel Holland

[PATCH 0/3] power: Model X-Powers PMIC VBUS detection using the driver model

2023-01-22 Thread Samuel Holland
this regulator device when present[2]. The net result is removing some ugly hacks from a couple of GPIO drivers. [1]: https://lore.kernel.org/u-boot/20230121231307.42628-1-sam...@sholland.org/ [2]: commit 6fa41cdd19b9 ("phy: sun4i-usb: Support VBUS detection via power supply") Samuel

Re: [PATCH v2 3/4] sunxi: binman: Support FIT generation for 32-bit SoCs

2023-01-22 Thread Samuel Holland
On 1/22/23 17:37, Jesse Taube wrote: > > > On 1/22/23 16:15, Samuel Holland wrote: >> Some 32-bit SoCs can use SCP firmware to implement additional PSCI >> functionality, such as system suspend. In order to load this firmware >> from SPL, we need to generate and us

[PATCH v2 5/5] net: sun8i-emac: Remove the SoC variant ID

2023-01-22 Thread Samuel Holland
Now that all differences in functionality are covered by individual flags, remove the enumeration of SoC variants. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 drivers/net/sun8i_emac.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/net

[PATCH v2 4/5] net: sun8i-emac: Use common syscon setup for R40

2023-01-22 Thread Samuel Holland
beyond the simplification: - R40 boards now respect the RX delays from the devicetree - This resolves a warning on architectures where readl/writel expect the address to have a pointer type, not phys_addr_t. Signed-off-by: Samuel Holland --- Changes in v2: - Add a structure for driver data

[PATCH v2 3/5] net: sun8i-emac: Add a flag for the internal PHY switch

2023-01-22 Thread Samuel Holland
Describe this feature instead of using the SoC ID. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 drivers/net/sun8i_emac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index f232b8f087

[PATCH v2 2/5] net: sun8i-emac: Add a flag for RMII support

2023-01-22 Thread Samuel Holland
Describe this feature instead of using the SoC ID. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 drivers/net/sun8i_emac.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index

[PATCH v2 0/5] net: sun8i-emac: Allwinner D1 Support

2023-01-22 Thread Samuel Holland
: - Add a structure for driver data, and put the syscon offset there Samuel Holland (5): net: sun8i-emac: Add a structure for variant data net: sun8i-emac: Add a flag for RMII support net: sun8i-emac: Add a flag for the internal PHY switch net: sun8i-emac: Use common syscon setup for R40 net

[PATCH v2 1/5] net: sun8i-emac: Add a structure for variant data

2023-01-22 Thread Samuel Holland
Currently, EMAC variants are distinguished by their identity, but this gets unwieldy as more overlapping variants are added. Add a structure so we can describe the individual feature differences between the variants. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 drivers

[PATCH v2 6/6] mtd: nand: sunxi: Pass the device to the init function

2023-01-22 Thread Samuel Holland
This more closely matches the U-Boot driver to the Linux version. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/mtd/nand/raw/sunxi_nand.c | 39 --- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c

[PATCH v2 5/6] mtd: nand: sunxi: Convert to the driver model

2023-01-22 Thread Samuel Holland
y: Michael Trimarchi Signed-off-by: Samuel Holland --- (no changes since v1) board/sunxi/board.c | 5 +- drivers/mtd/nand/raw/sunxi_nand.c | 81 ++- 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/board/sunxi/board.c b/board/sunxi/boa

[PATCH v2 4/6] mtd: nand: sunxi: Convert from fdtdec to ofnode

2023-01-22 Thread Samuel Holland
-by: Samuel Holland --- (no changes since v1) drivers/mtd/nand/raw/sunxi_nand.c | 73 +++ include/fdtdec.h | 1 - lib/fdtdec.c | 1 - 3 files changed, 26 insertions(+), 49 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b

[PATCH v2 3/6] mtd: nand: sunxi: Remove an unnecessary check

2023-01-22 Thread Samuel Holland
Each chip is required to have a unique CS number ("reg" property) in the range 0-7, so there is no need to separately count the number of chips. Reviewed-by: Michael Trimarchi Signed-off-by: Samuel Holland --- (no changes since v1) drivers/mtd/nand/raw/sunxi_nand.c | 10

[PATCH v2 2/6] pinctrl: sunxi: Add NAND pinmuxes

2023-01-22 Thread Samuel Holland
NAND is always at function 2 on port C. Pin lists and mux values were taken from the Linux drivers. Reviewed-by: Andre Przywara Reviewed-by: Jagan Teki Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/pinctrl-sunxi.c | 13 + 1 file changed, 13

[PATCH v2 1/6] clk: sunxi: Add NAND clocks and resets

2023-01-22 Thread Samuel Holland
Signed-off-by: Samuel Holland --- Changes in v2: - Fix A80 bus clock/reset bit positions drivers/clk/sunxi/clk_a10.c | 2 ++ drivers/clk/sunxi/clk_a10s.c | 2 ++ drivers/clk/sunxi/clk_a23.c | 3 +++ drivers/clk/sunxi/clk_a31.c | 6 ++ drivers/clk/sunxi/clk_a64.c | 3 +++ drivers/clk/sun

[PATCH v2 0/6] mtd: nand: sunxi: Convert to devicetree and the driver model

2023-01-22 Thread Samuel Holland
bus clock/reset bit positions Samuel Holland (6): clk: sunxi: Add NAND clocks and resets pinctrl: sunxi: Add NAND pinmuxes mtd: nand: sunxi: Remove an unnecessary check mtd: nand: sunxi: Convert from fdtdec to ofnode mtd: nand: sunxi: Convert to the driver model mtd: nand: sunxi: Pass

[PATCH v2 4/4] sunxi: Enable SPL FIT loading for 32-bit SoCs

2023-01-22 Thread Samuel Holland
Now that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default. SPL_FIT_IMAGE_TINY is required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere. Signed-off-by: Samuel Holland --- Changes in v2

[PATCH v2 3/4] sunxi: binman: Support FIT generation for 32-bit SoCs

2023-01-22 Thread Samuel Holland
on 32-bit SoCs. Instead, after loading the firmware, U-Boot proper is executed directly. Signed-off-by: Samuel Holland --- Changes in v2: - Rely on binman min-size instead of using explicit offsets - Use Kconfig for firmware addresses instead of an #ifdef staircase arch/arm/dts/sunxi-u

[PATCH v2 2/4] sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig

2023-01-22 Thread Samuel Holland
This is easier to read than the #ifdef staircase, provides better visibility into the memory map (alongside the other Kconfig definitions), and allows these addresses to be reused from code. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2, split from the .dtsi changes

[PATCH v2 0/4] sunxi: SPL FIT support for 32-bit sunxi SoCs

2023-01-22 Thread Samuel Holland
. [1]: https://lore.kernel.org/u-boot/20230121232518.49723-1-sam...@sholland.org/ Changes in v2: - Disable padding from SPL_PAD_TO - Rely on binman min-size instead of using explicit offsets - Use Kconfig for firmware addresses instead of an #ifdef staircase Samuel Holland (4): sunxi: spl

[PATCH v2 1/4] sunxi: spl: Disable padding from SPL_PAD_TO

2023-01-22 Thread Samuel Holland
do not want to unnecessarily pad SPL out to these giant sizes, we must set SPL_PAD_TO to zero. This causes no problems because binman already takes care of appending the SPL payload at the right offset. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 common/spl/Kconfig | 3

[PATCH] Kconfig: Remove an impossible condition

2023-01-22 Thread Samuel Holland
ARCH_SUNXI selects BINMAN, so the condition "!BINMAN && ARCH_SUNXI" is impossible to satisfy. Signed-off-by: Samuel Holland --- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index a75cce7e28..f810646e8a 100644 --- a/Kco

[PATCH v2 2/3] power: regulator: Add a driver for AXP PMIC regulators

2023-01-21 Thread Samuel Holland
- LDOs shared with GPIO pins => not supported. Signed-off-by: Samuel Holland --- Changes in v2: - Dual-license the driver - Add a comment about the requirements for the voltage table - Fix AXP22x ALDO3 enable bit position drivers/power/regulator/Kconfig | 14 ++ drivers/power/

[PATCH v2 3/3] power: pmic: axp: Bind regulators from the DT

2023-01-21 Thread Samuel Holland
Now that a regulator driver exists for this PMIC, hook it up to the device tree "regulators" subnodes. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/power/pmic/axp.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/power/pmic/axp.c

[PATCH v3 2/2] serial: ns16550: Enable clocks during probe

2023-01-21 Thread Samuel Holland
If the UART bus or baud clock has a gate, it must be enabled before the UART can be used. Reviewed-by: Stefan Roese Signed-off-by: Samuel Holland --- Changes in v3: - Switch back to the original patch, now that the phycore-rk3288 build is fixed by enabling LTO in patch 1. Changes in v2

[PATCH v3 1/2] configs: phycore-rk3288: Enable CONFIG_LTO

2023-01-21 Thread Samuel Holland
From: Wadim Egorov The phycore-rk3288 SPL binary is reaching the limits of 32KB very often. Enable CONFIG_LTO to reduce the size of the SPL and make the board more future proof for changes increasing the SPL size. Signed-off-by: Wadim Egorov Signed-off-by: Samuel Holland --- Changes in v3

[PATCH v2 2/2] reset: Allow reset_get_by_name() with NULL name

2023-01-21 Thread Samuel Holland
This allows devm_reset_control_get(dev, NULL) to work and get the first reset control, which is common in code ported from Linux. Signed-off-by: Samuel Holland --- Changes in v2: - Move index error check inside if statement - Update function comment - Add unit test drivers/reset/reset

[PATCH v2 1/2] clk: Allow clk_get_by_name() with NULL name

2023-01-21 Thread Samuel Holland
This allows devm_clock_get(dev, NULL) to work and get the first clock, which is common in code ported from Linux. Signed-off-by: Samuel Holland --- Changes in v2: - Move index error check inside if statement - Update function comment - Add unit test drivers/clk/clk-uclass.c | 12

[PATCH] dm: core: Use full printf() format when possible

2023-01-21 Thread Samuel Holland
Use a more accurate check for determining if the full format string will be handled correctly, since SPL_USE_TINY_PRINTF can be disabled. Signed-off-by: Samuel Holland --- drivers/core/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/core/dump.c b/drivers/core

[PATCH 2/2] sunxi: binman: Fix U-Boot offset when SPL is not 32 KiB

2023-01-21 Thread Samuel Holland
, SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, and SYS_SPI_U_BOOT_OFFS) are guaranteed to be defined in all cases. Fixes: cfa3db602caf ("sunxi: Convert 64-bit boards to use binman") Signed-off-by: Samuel Holland --- arch/arm/dts/sunxi-u-boot.dtsi | 6 +- 1 file changed, 5 insertions(+),

[PATCH 1/2] binman: Add 'min-size' entry property

2023-01-21 Thread Samuel Holland
This property sets the minimum size of an entry, including padding but not alignment. It can be used to reserve space for growth of an entry, or to enforce a minimum offset for later entries in the section. Signed-off-by: Samuel Holland --- tools/binman/binman.rst | 8

[PATCH 0/2] sunxi: binman: Fix U-Boot offset when SPL is not 32 KiB

2023-01-21 Thread Samuel Holland
his response to my original series[1]. [0]: https://lore.kernel.org/u-boot/20211013023022.58829-1-sam...@sholland.org/ [1]: https://lore.kernel.org/u-boot/capnjgz1_ee7uodlt36ls5gqa12a2zswrqxwtem5g-opitjn...@mail.gmail.com/ Samuel Holland (2): binman: Add 'min-size' entry property sunxi: binman

[PATCH v2 0/3] power: X-Powers PMIC regulator support

2023-01-21 Thread Samuel Holland
a comment about the requirements for the voltage table - Fix AXP22x ALDO3 enable bit position Samuel Holland (3): power: pmic: axp: Provide a variant ID in the driver data power: regulator: Add a driver for AXP PMIC regulators power: pmic: axp: Bind regulators from the DT drivers/power/pmic

[PATCH v2 1/3] power: pmic: axp: Provide a variant ID in the driver data

2023-01-21 Thread Samuel Holland
Subordinate regulator drivers can use this enumerated ID instead of matching the compatible string again. Reviewed-by: Andre Przywara Signed-off-by: Samuel Holland --- (no changes since v1) drivers/power/pmic/axp.c | 18 +- include/axp_pmic.h | 12 2 files

Re: [PATCH v2] sunxi: eMMC: support TOC0 on boot partitions

2023-01-21 Thread Samuel Holland
> boot enabled, like the Remix Mini PC. > > Signed-off-by: Andre Przywara > --- > Changelog v2 .. v1: > - use struct members instead of indexing buffer array > > arch/arm/mach-sunxi/board.c | 11 +++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) Reviewed-by: Samuel Holland

Re: [PATCH] sunxi: eMMC: support TOC0 on boot partitions

2023-01-14 Thread Samuel Holland
Hi Andre, On 1/4/23 19:58, Andre Przywara wrote: > To determine whether we have been booted from an eMMC boot partition, we > replay some of the checks that the BROM must have done to successfully > load the SPL. This involves a checksum check, which currently relies on > the SPL being wrapped in

Re: [PATCH] sunxi: f1c100s: re-enable SYSRESET

2023-01-14 Thread Samuel Holland
onfig") > Signed-off-by: Andre Przywara > --- > Hi, > > this is not critical (so nothing for 2023.01), reset works either way. > But we should fix it anyway. > > Cheers, > Andre > > configs/licheepi_nano_defconfig | 1 - > 1 file changed, 1 deletion(-) Reviewed-by: Samuel Holland

Re: [PATCH] sunxi: f1c100s: Drop no-MMC hack

2023-01-14 Thread Samuel Holland
d that alias with a preprocessor macro. > > Now the F1C100s family has gained MMC nodes, so we don't need the > special treatment anymore. Just remove this guard. > > Signed-off-by: Andre Przywara > --- > arch/arm/dts/sunxi-u-boot.dtsi | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Samuel Holland

Re: [PATCH 5/8] sunxi: enable support for SPI NAND booting on SUNIV

2023-01-14 Thread Samuel Holland
is the same for SPI NOR and NAND. > > Signed-off-by: Icenowy Zheng > --- > arch/arm/mach-sunxi/board.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Reviewed-by: Samuel Holland > diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c > in

Re: [PATCH 4/8] sunxi: SPL SPI: add initial support for booting from SPI NAND

2023-01-14 Thread Samuel Holland
ooks fine to me. I verified that NOR booting still works when SPL_SPI_SUNXI_NAND is enabled, so: Tested-by: Samuel Holland # Orange Pi Zero Plus > Signed-off-by: Icenowy Zheng > --- > arch/arm/mach-sunxi/Kconfig | 16 +++ > arch/arm/mach-sunxi

Re: [PATCH 3/8] sunxi: SPL SPI: allow multiple boot attempt

2023-01-14 Thread Samuel Holland
o allow booting without valid magic number when > booting with SPI NOR. So the issue is that when CONFIG_SPL_RAW_IMAGE_SUPPORT=y, then spl_parse_image_header() will return 0 even when using the wrong NAND parameters? I don't see a better solution, so: Reviewed-by: Samuel Holland Tested-by: Samuel

Re: [PATCH 2/8] sunxi: SPL SPI: add support for read command with 2 byte address

2023-01-14 Thread Samuel Holland
real address. As the address is sent out > in bit endian, this makes it not compatible with usual 3 byte address. typo: big > Signed-off-by: Icenowy Zheng > --- > arch/arm/mach-sunxi/spl_spi_sunxi.c | 20 +--- > 1 file changed, 13 insertions(+), 7 deletions(-)

  1   2   3   4   5   6   7   >