[PATCH v3 4/6] watchdog: Automatically register device with sysreset

2021-11-03 Thread Samuel Holland
Add an option to automatically register watchdog devices with the wdt_reboot driver for use with sysreset. This allows sysreset to be a drop-in replacement for platform-specific watchdog reset code, without needing any device tree changes. Signed-off-by: Samuel Holland --- Changes in v3

[PATCH v3 5/6] sunxi: Avoid duplicate reset_cpu with SYSRESET enabled

2021-11-03 Thread Samuel Holland
Schuchardt Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New patch arch/arm/mach-sunxi/board.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c index b4ba2a72c4..3ef179742c 100644 --- a/arch/arm/mach-sunxi

[PATCH v3 6/6] sunxi: Use sysreset framework for poweroff/reset

2021-11-03 Thread Samuel Holland
need to hardcode watchdog MMIO addresses, since the sysreset backends can be discovered using the device tree. Reviewed-by: Heinrich Schuchardt Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New patch arch/arm/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] net: phy: realtek: Set correct bit for 8211e delays

2021-11-04 Thread Samuel Holland
on. Fixes: cb1d40151489 ("net: phy: realtek: Add tx/rx delay config for 8211e") Reported-by: Tom Rini Signed-off-by: Samuel Holland --- drivers/net/phy/realtek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index 84

Re: [PATCH 3/4] gpio: sunxi: Implement .set_flags

2021-11-05 Thread Samuel Holland
On 11/5/21 9:43 AM, Heinrich Schuchardt wrote: > On 10/21/21 06:52, Samuel Holland wrote: >> This, along with gpio_flags_xlate(), allows the GPIO driver to handle >> pull-up/down flags provided by consumer drivers or in the device tree. >> >> Signed-off-by: Samuel Hol

Re: [RFC PATCH 04/13] sunxi: add memory addresses for R329 SoC

2021-11-05 Thread Samuel Holland
On 7/22/21 1:30 AM, Icenowy Zheng wrote: > Allwinner R329 SoC has a different memory map with previous post-H6 > SoCs. > > Add the memory map to a dedicated header file, fill everywhere that > uses a hardcoded MMIO address and specify the SPL/ATF load address. > > Signed-off-by: Icenowy Zheng >

Re: [RFC PATCH 05/13] sunxi: add support for R329 clocks

2021-11-05 Thread Samuel Holland
onfiguration registers are in PRCM memory zone, > not the ordinary CPUX CCU one. > > Add support for basical R329 clock initialization. > > Signed-off-by: Icenowy Zheng Reviewed-by: Samuel Holland One minor comment below. > --- > arch/arm/mach-sunxi/clock_sun50i_h6.c | 49

Re: [RFC PATCH 06/13] sunxi: add support for basical pinmux setup on R329

2021-11-05 Thread Samuel Holland
On 7/22/21 1:30 AM, Icenowy Zheng wrote: > Allwinner R329 SoC is the first known Allwinner SoC that has two > possible pinmux setups for MMC0 controller. > > Support configuration of both setups of MMC0 and UART0 at PB4/5. > > Signed-off-by: Icenowy Zheng > --- > arch/arm/include/asm/arch-sunxi

Re: [RFC PATCH 07/13] sunxi: add support for R329 DRAM controller

2021-11-05 Thread Samuel Holland
Add support for it. To prepare for further support of other SoCs, > routines with socid parameter are added, although not checked now. > > Signed-off-by: Icenowy Zheng I cannot really review the DRAM init part. But it works, so that's probably good enough. Tested-by: Samuel Holla

Re: [RFC PATCH 08/13] sunxi: add Kconfig option for R329

2021-11-05 Thread Samuel Holland
On 7/22/21 1:30 AM, Icenowy Zheng wrote: > As most code are ready for basic R329 support, let's add a Kconfig > option for it. > > Signed-off-by: Icenowy Zheng Reviewed-by: Samuel Holland with one minor comment below. > --- > arch/arm/mach-sunxi/Kconfig| 14 +++

Re: [RFC PATCH 10/13] clk: sunxi: add support for R329 in sunxi DM clock driver

2021-11-05 Thread Samuel Holland
On 7/22/21 1:30 AM, Icenowy Zheng wrote: > Currently only a subset of clocks/resets (similar to other SoCs) are > supported. > > Signed-off-by: Icenowy Zheng Reviewed-by: Samuel Holland > --- > drivers/clk/sunxi/Kconfig| 7 +++ > drivers/clk/sunxi/Makefile | 1 +

Re: [RFC PATCH 11/13] mmc: sunxi: add support for R329 MMC controller

2021-11-05 Thread Samuel Holland
are covered by CONFIG_SUN50I_GEN_H6. Reviewed-by: Samuel Holland > --- > drivers/mmc/sunxi_mmc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c > index 6b809c001f..59cc28794d 100644 > --- a/drivers/mmc/sunxi_mmc.c > +++ b/dri

Re: [RFC PATCH 12/13] sunxi: sync R329 DTs from internal WIP kernel tree

2021-11-05 Thread Samuel Holland
On 7/22/21 1:30 AM, Icenowy Zheng wrote: > Signed-off-by: Icenowy Zheng > --- > arch/arm/dts/Makefile | 2 + > arch/arm/dts/sun50i-r329-maix-iia-dock.dts | 36 > arch/arm/dts/sun50i-r329-maix-iia.dtsi | 45 + > arch/arm/dts/sun50i-r329.dtsi | 225

Re: [RFC PATCH 00/13] Add support for Allwinner R329

2021-11-05 Thread Samuel Holland
On 7/22/21 1:30 AM, Icenowy Zheng wrote: > This patchset adds Allwinner R329 support to U-Boot. > > First, some code refactors happen for SoCs w/o SCP/MMC2. > > Then the basical support for R329 come as several parts (memory map, > clocks, pinmux, DRAM, final Kconfig option). > > Then, as the RF

Re: [PATCH 1/5] sunxi: move non-essential code out of s_init()

2022-01-24 Thread Samuel Holland
s setup *again* > shortly afterwards, when running U-Boot proper. > > This makes gpio_init() to be called from the SPL only, so pull this code > into a CONFIG_SPL_BUILD protected part to avoid build warnings. > > Signed-off-by: Andre Przywara Reviewed-by

Re: [PATCH 2/5] sunxi: move Cortex SMPEN setting into start.S

2022-01-24 Thread Samuel Holland
On 1/24/22 7:15 PM, Andre Przywara wrote: > According to their TRMs, Cortex ARMv7 CPUs with SMP support require the > ACTLR.SMPEN bit to be set as early as possible, before any cache or TLB > maintenance operations are done. As we do those things still in start.S, > we need to move the SMPEN bit se

Re: [PATCH 3/5] sunxi: move early "SRAM setup" into separate file

2022-01-24 Thread Samuel Holland
On 1/24/22 7:15 PM, Andre Przywara wrote: > Currently we do some magic "SRAM setup" MMIO writes in s_init(), copied > from the original BSP U-Boot. The comment speaks of this being required > before DRAM access gets enabled, but there is no indication that this > would actually be required that ear

Re: [PATCH 4/5] armv8: remove no longer needed lowlevel_init.S

2022-01-24 Thread Samuel Holland
ser, we can now remove lowlevel_init from ARMv8 > altogether. Well, we are removing lowlevel_init.S anyway. There is still a weak definition of lowlevel_init in arch/arm/cpu/armv8/start.S, which we are now picking up. > Signed-off-by: Andre Przywara Reviewed-by: Samuel Holland > -

Re: [PATCH 5/5] sunxi-common.h: remove pointless #ifdefs

2022-01-24 Thread Samuel Holland
urpose > anymore: it's unconditionally defined for all sunxi boards, and protects > nothing applicable outside of sunxi code anymore. Just remove it. > > Signed-off-by: Andre Przywara Reviewed-by: Samuel Holland

Re: [PATCH 4/8] sunxi: board: Add PinePhone DT selection logic

2020-10-21 Thread Samuel Holland
On 10/21/20 1:56 PM, Jagan Teki wrote: > On Thu, Sep 3, 2020 at 10:37 AM Samuel Holland wrote: >> >> There are two different publicly-released revisions of the PinePhone >> hardware, versions 1.1 and 1.2; and they need different device trees. >> Since some GPIO pins wer

Re: [PATCH v4 5/9] sunxi: binman: Provide a default BL31 filename

2020-10-21 Thread Samuel Holland
On 10/21/20 1:49 PM, Jagan Teki wrote: > Hi Samuel, > > On Sun, Sep 13, 2020 at 3:05 AM Samuel Holland wrote: >> >> Prior to commit 7f7f8aca8257 ("sunxi: Convert 64-bit boards to use >> binman"), if the BL31 environment variable was not defined, the firmware

[PATCH v5 1/9] Makefile: Only define u-boot.itb rule when applicable

2020-10-21 Thread Samuel Holland
something that can be made. This will reduce confusion as platforms move away from CONFIG_USE_SPL_FIT_GENERATOR, as u-boot.itb was previously a valid goal for those platforms. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a

[PATCH v5 2/9] binman: Only write FDT once per node

2020-10-21 Thread Samuel Holland
imon Glass Signed-off-by: Samuel Holland --- tools/binman/etype/fit.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py index de4745c5521..8a24f12aa59 100644 --- a/tools/binman/etype/fit.py +++ b/tools/binman/etype/fit.py

[PATCH v5 3/9] sunxi: binman: Fix spacing between nodes

2020-10-21 Thread Samuel Holland
Nodes should have a blank line separating them from sibling nodes and properties. Add the necessary lines. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- arch/arm/dts/sunxi-u-boot.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch

[PATCH v5 7/9] sunxi: binman: Update FIT component descriptions

2020-10-21 Thread Samuel Holland
he boot process, where ATF runs before U-Boot, add the "os" properties and swap the firmware/loadable images in the FIT image. Since this description was copied as an example in commit 70248d6a2916 ("binman: Support generating FITs with multiple dtbs"), update those example

[PATCH v5 4/9] sunxi: binman: Provide a default BL31 filename

2020-10-21 Thread Samuel Holland
case no entry arg is provided, which will be the case if the environment variable is unset. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- arch/arm/dts/sunxi-u-boot.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dt

[PATCH v5 5/9] sunxi: binman: Use a macro for the BL31 load address

2020-10-21 Thread Samuel Holland
This consolidates the SoC-specific part at the top of the file to avoid cluttering it up with preprocessor conditions. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- arch/arm/dts/sunxi-u-boot.dtsi | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a

[PATCH v5 0/9] sunxi: binman fixes and SCP firmware support

2020-10-21 Thread Samuel Holland
in the series to emphasize that the binman fixes do not depend on it. - Rebase on top of u-boot/master. - Add a missing-msg for scp-sunxi. - Explain in documentation how to silence the binman messages. Changes v3->v4: - Added a test for the SCP firmware entry type. Samuel Holland (9): Ma

[PATCH v5 6/9] spl: fit: Minimally parse OS properties with FIT_IMAGE_TINY

2020-10-21 Thread Samuel Holland
-Boot/non-U-Boot loadables with CONFIG_SPL_FIT_IMAGE_TINY=y. This adds about 300 bytes, much less than the 7400 bytes added by CONFIG_SPL_FIT_IMAGE_TINY=n. Acked-by: Patrick Wildt Signed-off-by: Samuel Holland --- common/spl/Kconfig | 4 +--- common/spl/spl_fit.c | 17 - 2 fi

[PATCH v5 8/9] binman: Add support for SCP firmware

2020-10-21 Thread Samuel Holland
Add an entry type for a firmware blob for a System Control Processor, given by an entry arg. This firmware is a raw binary blob. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- Makefile | 1 + tools/binman/etype/scp.py | 19 +++ tools/binman

[PATCH v5 9/9] sunxi: binman: Add support for including SCP firmware

2020-10-21 Thread Samuel Holland
-off-by: Samuel Holland --- arch/arm/dts/sunxi-u-boot.dtsi | 17 +++- board/sunxi/README.sunxi64 | 47 +- tools/binman/missing-blob-help | 4 +++ 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts

[PATCH v2 3/8] sunxi: board: Simplify Pine A64 DT selection logic

2020-10-24 Thread Samuel Holland
otherwise the logic would trigger when "sun50i-a64-pine64-lts" was written to the SPL header. Acked-by: Maxime Ripard Reviewed-by: Andre Przywara Signed-off-by: Samuel Holland --- board/sunxi/board.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/b

[PATCH v2 1/8] sunxi: board: Use a more descriptive variable name

2020-10-24 Thread Samuel Holland
;. Acked-by: Maxime Ripard Reviewed-by: Andre Przywara Signed-off-by: Samuel Holland --- board/sunxi/board.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index a5cf0b65c7b..d7dfcc78eab 100644 --- a/board/sunxi/board

[PATCH v2 8/8] sunxi: a64: Add a defconfig for the PinePhone

2020-10-24 Thread Samuel Holland
at boot, one config/image can support both boards. Acked-by: Maxime Ripard Signed-off-by: Samuel Holland --- configs/pinephone_defconfig | 12 1 file changed, 12 insertions(+) create mode 100644 configs/pinephone_defconfig diff --git a/configs/pinephone_defconfig b/configs

[PATCH v2 0/8] PinePhone automatic device tree selection

2020-10-24 Thread Samuel Holland
: - Removed unnecessary "else"s in DT selection logic - Updated DT tag reference from v5.9-rc3 to v5.9 (no code change) - Regenerated defconfig with `make savedefconfig` - Added Acked-by and Reviewed-by tags Samuel Holland (8): sunxi: board: Use a more descriptive variable name sunxi:

[PATCH v2 5/8] sunxi: board: Save the chosen DT name in the SPL header

2020-10-24 Thread Samuel Holland
: Maxime Ripard Reviewed-by: Andre Przywara Signed-off-by: Samuel Holland --- board/sunxi/board.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index bff5135c1a1..9d0e29788b1 100644 --- a/board/sunxi

[PATCH v2 2/8] sunxi: board: Add a helper to get the SPL DT name

2020-10-24 Thread Samuel Holland
-off-by: Samuel Holland --- board/sunxi/board.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index d7dfcc78eab..a8a05ec59c8 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -319,6 +319,17

[PATCH v2 6/8] sunxi: board: Set fdtfile to match the DT chosen by SPL

2020-10-24 Thread Samuel Holland
the previous commit, always matches the DT used by U-Boot proper), Linux also sees the same board as U-Boot/SPL, even if the boot script later loads a DT from disk. Acked-by: Maxime Ripard Reviewed-by: Andre Przywara Signed-off-by: Samuel Holland --- board/sunxi/board.c | 11 +++ 1 file

[PATCH v2 4/8] sunxi: board: Add PinePhone DT selection logic

2020-10-24 Thread Samuel Holland
There are two different publicly-released revisions of the PinePhone hardware, versions 1.1 and 1.2; and they need different device trees. Since some GPIO pins were rerouted, we can use that to distinguish between them. Acked-by: Maxime Ripard Reviewed-by: Andre Przywara Signed-off-by: Samuel

[PATCH v2 7/8] sunxi: DT: A64: update device tree files

2020-10-24 Thread Samuel Holland
support. Acked-by: Maxime Ripard Signed-off-by: Samuel Holland --- arch/arm/dts/Makefile | 4 + arch/arm/dts/axp803.dtsi | 82 +-- arch/arm/dts/sun50i-a64-amarula-relic.dts | 109 +++- arch/arm/dts/sun50i-a64-bananapi-m64.dts | 118 ++-- arch

[PATCH] rockchip: mkimage: Remove host endianness dependency

2020-10-24 Thread Samuel Holland
. Signed-off-by: Samuel Holland --- tools/rkcommon.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tools/rkcommon.c b/tools/rkcommon.c index 61c392e27d5..d55cd2c2d5a 100644 --- a/tools/rkcommon.c +++ b/tools/rkcommon.c @@ -221,12 +221,13 @@ bool

[PATCH v3] sunxi: a64: Add a defconfig for the PinePhone

2020-11-02 Thread Samuel Holland
at boot, one config/image can support both boards. Acked-by: Maxime Ripard Signed-off-by: Samuel Holland --- Changes v2->v3: - All other patches merged - Added entry to MAINTAINERS Changes v1->v2: - Regenerated defconfig with `make savedefconfig` - Added Acked-by tag board

Re: Pull request: u-boot-sunxi/master

2020-11-16 Thread Samuel Holland
On 11/16/20 10:58 AM, Tom Rini wrote: > On Mon, Nov 16, 2020 at 04:51:32PM +, André Przywara wrote: >> On 16/11/2020 16:13, Tom Rini wrote: >>> On Mon, Nov 16, 2020 at 04:09:42PM +, André Przywara wrote: On 16/11/2020 15:50, Tom Rini wrote: Hi Tom, > On Mon, Nov 16,

Re: [PATCH v2 1/2] tools: mkimage: Add Allwinner eGON support

2020-11-16 Thread Samuel Holland
ng zero byte. */ > + ((char *)header->string_pool)[51] = 0; > + } else > + header->spl_signature[3] = SPL_ENV_HEADER_VERSION; > + > + /* Calculate the checksum. Yes, it's that simple. */ > + for (i = 0; i < sbuf->st_size / 4; i++) &g

Re: [PATCH 3/5] sunxi: move early "SRAM setup" into separate file

2022-01-27 Thread Samuel Holland
On 1/27/22 6:59 PM, Andre Przywara wrote: > On Mon, 24 Jan 2022 20:56:12 -0600 > Samuel Holland wrote: > > Hi Samuel, > >> On 1/24/22 7:15 PM, Andre Przywara wrote: >>> Currently we do some magic "SRAM setup" MMIO writes in s_init(), copied >>>

Re: [PATCH 09/11] sunxi: Add support for SUNIV architecture

2022-01-29 Thread Samuel Holland
On 1/29/22 5:51 AM, Andre Przywara wrote: > On Fri, 28 Jan 2022 22:21:28 -0500 > Jesse Taube wrote: >> On 1/26/22 09:38, Jesse Taube wrote: >>> On 1/26/22 09:13, Andre Przywara wrote: On Tue, 4 Jan 2022 19:35:06 -0500 Jesse Taube wrote: >u32 spl_boot_device(void) >

Re: [PATCH 1/3] sunxi: prcm: Add a few registers

2022-01-30 Thread Samuel Holland
On 1/30/22 8:27 AM, Jernej Skrabec wrote: > H6 and H616 SPL code has a few writes to unknown PRCM registers. Now > that we know what they are, let's replace magic offsets with proper > register names. > > Signed-off-by: Jernej Skrabec Reviewed-by: Samuel Holland

Re: [PATCH v2 2/5] sunxi: move Cortex SMPEN setting into start.S

2022-02-02 Thread Samuel Holland
On 1/31/22 7:41 PM, Andre Przywara wrote: > According to their TRMs, Cortex ARMv7 CPUs with SMP support require the > ACTLR.SMPEN bit to be set as early as possible, before any cache or TLB > maintenance operations are done. As we do those things still in start.S, > we need to move the SMPEN bit se

Re: [PATCH v2 5/5] sunxi-common.h: remove pointless #ifdefs

2022-02-02 Thread Samuel Holland
urpose > anymore: it's unconditionally defined for all sunxi boards, and protects > nothing applicable outside of sunxi code anymore. Just remove it. > > Reviewed-by: Samuel Holland > Reviewed-by: Simon Glass > Tested-by: Simon Glass > Signed-off-by: Andre Przywara Even

[PATCH] usb: xhci-dwc3: Fix usage of bulk PHY API

2020-05-30 Thread Samuel Holland
xes: 6dfb8a8052ee ("usb: dwc3: use the phy bulk API to get phys") Signed-off-by: Samuel Holland --- drivers/usb/host/xhci-dwc3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c index 563db1a426..9b22f271a7 100644

Re: [PATCH 05/11] power: pmic: Add a driver for X-Powers AXP PMICs

2021-09-02 Thread Samuel Holland
On 9/2/21 6:17 PM, Jaehoon Chung wrote: > On 8/22/21 8:05 AM, Samuel Holland wrote: >> These PMICs provide some combination of battery charger, fuel gauge, >> GPIOs, regulators, and VBUS routing. These functions are represented >> as child nodes in the device tree. Add the min

Re: [PATCH v2 1/2] board: sunxi: enable status LED early

2021-09-08 Thread Samuel Holland
feedback as soon as possible. > > In order achieve this goal, this patch initializes the status LED (if > configured) in the SPL. > > Signed-off-by: Arnaud Ferraris Reviewed-by: Samuel Holland

Re: [PATCH v2 2/2] pinephone_defconfig: add support for early-boot status LED

2021-09-08 Thread Samuel Holland
On 9/8/21 2:14 PM, Arnaud Ferraris wrote: > This commit enables the green status LED (PD18/GPIO 114) on boot in the > SPL, in order to provide visual feedback that the PinePhone is booting. > > Signed-off-by: Arnaud Ferraris > Reviewed-by: Andre Przywara Reviewed-by: Samuel Hol

Watchdog auto-start and TIMER_EARLY broken in RISC-V U-Boot

2021-09-11 Thread Samuel Holland
Hello, I am porting U-Boot to the Allwinner D1 SoC, and I ran into an issue where the board fails to boot if I enable watchdog auto-start. The call to get_timer() -> get_ticks() panics because no timer is available. And since panic_finish() calls udelay(), this causes infinite recursion of trying

Re: Watchdog auto-start and TIMER_EARLY broken in RISC-V U-Boot

2021-09-11 Thread Samuel Holland
On 9/11/21 1:31 PM, Sean Anderson wrote: > +CC Heinrich > > Did you ever try booting with WDT on k210? > > On 9/11/21 12:43 PM, Samuel Holland wrote: >> Hello, >> >> I am porting U-Boot to the Allwinner D1 SoC, and I ran into an issue >> where the board

[PATCH] clk: sunxi: Extend DM_RESET selection to SPL

2021-09-11 Thread Samuel Holland
The sunxi clock driver exposes a reset controller, so it selects the reset controller framework. Ensure that dependency is also satisfied when building the driver for the SPL. Signed-off-by: Samuel Holland --- drivers/clk/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH 0/3] sunxi: Cleanup to prepare for DM_GPIO/DM_PINCTRL

2021-09-11 Thread Samuel Holland
hes at this point). Samuel Holland (3): sunxi: Clean up inclusions of asm/arch/gpio.h sunxi: gpio: Remove name_to_gpio macro sunxi: gpio: Remove bank-specific size macros arch/arm/include/asm/arch-sunxi/gpio.h | 15 ++- arch/arm/mach-sunxi/board.c| 1 - arch/arm/m

[PATCH 1/3] sunxi: Clean up inclusions of asm/arch/gpio.h

2021-09-11 Thread Samuel Holland
t now, this header provides both sets of functions, because ARCH_SUNXI selects GPIO_EXTRA_HEADER. This will still be the right header to include once the DM_GPIO migration is complete and GPIO_EXTRA_HEADER is no longer needed. Signed-off-by: Samuel Holland --- arch/arm/mach-sunxi/board.c

[PATCH 2/3] sunxi: gpio: Remove name_to_gpio macro

2021-09-11 Thread Samuel Holland
remaining implementations of name_to_gpio. Signed-off-by: Samuel Holland --- arch/arm/include/asm/arch-sunxi/gpio.h | 1 - drivers/spi/spi-sunxi.c| 2 +- drivers/video/Kconfig | 10 +- drivers/video/hitachi_tx18d42vm_lcd.c | 6 +++--- drivers/video/sunxi

[PATCH 3/3] sunxi: gpio: Remove bank-specific size macros

2021-09-11 Thread Samuel Holland
Since the beginning, all banks have had space for 32 pins, even when not all pins were implemented. Let's use a single constant for the GPIO bank size here, like the GPIO driver is already doing. Signed-off-by: Samuel Holland --- arch/arm/include/asm/arch-sunxi/gpio.h

[PATCH 0/3] gpio: uclass enhancements for DM_GPIO drivers

2021-09-11 Thread Samuel Holland
d pin numbers. Samuel Holland (3): gpio: Verify validity of pin offsets when looking up names gpio: Verify validity of pin offsets from device trees gpio: Factor out DT flag translation drivers/gpio/gpio-uclass.c | 55 +++--- include/asm-generic/gpio.h

[PATCH 2/3] gpio: Verify validity of pin offsets from device trees

2021-09-11 Thread Samuel Holland
Translation of an OF GPIO specifier should fail if the pin offset is larger than the number of pins in the GPIO bank. Signed-off-by: Samuel Holland --- drivers/gpio/gpio-uclass.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c

[PATCH 1/3] gpio: Verify validity of pin offsets when looking up names

2021-09-11 Thread Samuel Holland
Translation of a pin name to a device+offset should fail if the offset is larger than the number of pins in the GPIO bank. Signed-off-by: Samuel Holland --- drivers/gpio/gpio-uclass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-uclass.c b/drivers

[PATCH 3/3] gpio: Factor out DT flag translation

2021-09-11 Thread Samuel Holland
The generic GPIO flags binding is shared across many drivers, some of which need their own xlate function. Factor out the flag translation code from gpio_xlate_offs_flags so it does not need to be duplicated. Signed-off-by: Samuel Holland --- drivers/gpio/gpio-uclass.c | 50

[PATCH 0/3] phy: sun4i-usb: Support VBUS detection via power supply

2021-09-12 Thread Samuel Holland
ldn't hurt anything either. Samuel Holland (3): phy: sun4i-usb: Remove a couple of debug messages phy: sun4i-usb: Refactor VBUS detection to match Linux phy: sun4i-usb: Support VBUS detection via power supply drivers/phy/allwinner/Kconfig | 1 + drivers/phy/allwinner/phy-s

[PATCH 1/3] phy: sun4i-usb: Remove a couple of debug messages

2021-09-12 Thread Samuel Holland
Both of these messages log the GPIO number of the ID detection GPIO, which is not terribly useful, especially in the VBUS detection function. Signed-off-by: Samuel Holland --- drivers/phy/allwinner/phy-sun4i-usb.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/phy/allwinner/phy

[PATCH 2/3] phy: sun4i-usb: Refactor VBUS detection to match Linux

2021-09-12 Thread Samuel Holland
the function a bit to remove the early return, and use the same "assume VBUS is present" final fallback. Signed-off-by: Samuel Holland --- drivers/phy/allwinner/phy-sun4i-usb.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/phy

[PATCH 3/3] phy: sun4i-usb: Support VBUS detection via power supply

2021-09-12 Thread Samuel Holland
is up to the PHY driver. Signed-off-by: Samuel Holland --- drivers/phy/allwinner/Kconfig | 1 + drivers/phy/allwinner/phy-sun4i-usb.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/phy/allwinner/Kconfig b/drivers/phy/allwinner/Kconfig index dba3bae61c4..aa9d0e7e6a5 1

[PATCH 1/2] clk: sunxi: Add support for I2C gates/resets

2021-09-12 Thread Samuel Holland
Currently, the I2C clocks are configured in the sunxi board code. Add the I2C clocks to the DM clock driver so they can be enabled from the DM I2C driver using the normal uclass methods. Signed-off-by: Samuel Holland --- drivers/clk/sunxi/clk_a10.c | 5 + drivers/clk/sunxi/clk_a10s.c

[PATCH 2/2] clk: sunxi: Add drivers for A31 and H6 PRCM CCUs

2021-09-12 Thread Samuel Holland
Add a driver so the clocks/resets for these peripherals (especially I2C, RSB, and UART) can be enabled using the normal uclass methods. Signed-off-by: Samuel Holland --- drivers/clk/sunxi/Kconfig | 14 drivers/clk/sunxi/Makefile| 2 ++ drivers/clk/sunxi/clk_a31_r.c | 59

[PATCH] i2c: mvtwsi: Add support for DM clocks and resets

2021-09-12 Thread Samuel Holland
The controller may need to have clocks/resets enabled for it to work. Add support for this. Since the clocks/resets are optional on some platforms (per the device tree binding), do not prevent probing the controller if they are missing. Signed-off-by: Samuel Holland --- drivers/i2c/mvtwsi.c

[PATCH 2/2] gpio: sunxi: Remove the sunxi_name_to_gpio_bank function

2021-09-12 Thread Samuel Holland
The only caller of this function was the MMC pinmux code, which used it to parse a string given from a Kconfig symbol. As the Kconfig symbol has been converted to a Boolean, this function is no longer needed. Signed-off-by: Samuel Holland --- arch/arm/include/asm/arch-sunxi/gpio.h | 1

[PATCH 1/2] sunxi: Simplify MMC pinmux selection

2021-09-12 Thread Samuel Holland
chosen by the preprocessor, instead of having the code parse a string at runtime (for a build-time option!). Not only does this reduce code size, but it also allows this Kconfig option to be used in a table-driven DM pinctrl driver. Signed-off-by: Samuel Holland --- arch/arm/include/asm/arch

[PATCH] serial: Add a debug console using the RISC-V SBI interface

2021-09-12 Thread Samuel Holland
The RISC-V SBI interface v0.1 provides a function for printing a character to the console. Even though SBI v0.1 functions are deprecated, the SBI console is quite useful for early debugging, because it works without any dcache, memory, or MMIO access in S mode. Signed-off-by: Samuel Holland

[PATCH] riscv: Fix setting no-map in reserved memory nodes

2021-09-12 Thread Samuel Holland
The no-map property is wrongly skipped if a no-map reserved memory node follows one without that property. Fix this by not remembering the absence of a no-map property across loop iterations. Fixes: d4ea649f179a ("riscv: Provide a mechanism to fix DT for reserved memory") Signed-off-

[PATCH] riscv: image: Use the first DRAM bank for bootm_low

2021-09-12 Thread Samuel Holland
CONFIG_SYS_SDRAM_BASE. Signed-off-by: Samuel Holland --- common/image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/image.c b/common/image.c index 59c52a1f9ad..1f06413bfa6 100644 --- a/common/image.c +++ b/common/image.c @@ -682,7 +682,7 @@ ulong env_get_bootm_low(void) #if

[PATCH] clk: sunxi: Move header out of arch directory

2021-09-12 Thread Samuel Holland
The CCU header is only used by the DM drivers, not any platform code. Its current location adds an artificial dependency on CONFIG_ARM and ARCH_SUNXI, which will be problematic when adding the CCU driver for a RISC-V sunxi platform. Signed-off-by: Samuel Holland --- This patch trivially

Re: [PATCH v6 3/4] sysreset: provide SBI based sysreset driver

2021-09-12 Thread Samuel Holland
On 9/12/21 2:11 PM, Heinrich Schuchardt wrote: > Provide sysreset driver using the SBI system reset extension. > > Signed-off-by: Heinrich Schuchardt > Reviewed-by: Sean Anderson > Reviewed-by: Bin Meng Tested-by: Samuel Holland on Allwinner D1.

Re: [PATCH 1/2] sunxi: Simplify MMC pinmux selection

2021-09-16 Thread Samuel Holland
On 9/16/21 5:42 AM, Andre Przywara wrote: > On 12/09/2021 16:28, Samuel Holland wrote: >> Only one board, Yones Toptech BD1078, actually uses a non-default MMC >> pinmux. All other uses of these symbols select the default value or an >> invalid value. To simplify things, r

Re: [PATCH 02/15] arm: sunxi: Remove most SoC-specific config header files

2022-03-10 Thread Samuel Holland
On 3/10/22 8:04 AM, Andre Przywara wrote: > On Thu, 10 Mar 2022 08:32:11 -0500 > Tom Rini wrote: > >> On Thu, Mar 10, 2022 at 10:58:50AM +, Andre Przywara wrote: >>> On Wed, 9 Mar 2022 20:43:51 -0500 >>> Tom Rini wrote: >>> >>> Hi Tom, >>> At this point, sunxi-common.h is used for a

[PATCH v2 00/23] sunxi: Add and use a pinctrl driver

2022-03-17 Thread Samuel Holland
This series resolves some longstanding TODOs by implementing a pinctrl driver for sunxi platforms and converting DM drivers to use it. Changes in v2: - Merge all SoC drivers into one file and one U_BOOT_DRIVER. - Add a consumer for the APB bus clock - Add support for the F1C100s SoC Samuel

[PATCH v2 02/23] sunxi: pinctrl: Implement pin muxing functions

2022-03-17 Thread Samuel Holland
plify MMC pinmux selection") Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/Kconfig | 1 + drivers/pinctrl/sunxi/pinctrl-sunxi.c | 227 ++ 2 files changed, 228 insertions(+) diff --git a/drivers/pinctrl/sunxi/Kconfig b/drive

[PATCH v2 03/23] sunxi: pinctrl: Implement get_pin_muxing function

2022-03-17 Thread Samuel Holland
The pinmux command uses this function to display pinmux status. Since the driver cannot map pin numbers to a list of supported functions, only functions which are common across all pins can be reported by name. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi

[PATCH v2 01/23] sunxi: pinctrl: Create the driver skeleton

2022-03-17 Thread Samuel Holland
bound by the pinctrl driver. This commit should cause no functional change. Signed-off-by: Samuel Holland --- Changes in v2: - Merge all SoC drivers into one file and one U_BOOT_DRIVER. - Add a consumer for the APB bus clock - Add support for the F1C100s SoC MAINTAINERS

[PATCH v2 04/23] sunxi: pinctrl: Implement pin configuration

2022-03-17 Thread Samuel Holland
The sunxi pinctrl hardware has bias and drive control. Add driver support for configuring those options. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/Kconfig | 1 + drivers/pinctrl/sunxi/pinctrl-sunxi.c | 53

[PATCH v2 06/23] sunxi: Skip non-DM UART pin setup when PINCTRL=y

2022-03-17 Thread Samuel Holland
When a pinctrl driver is available, it will take care of setting up these pins. However, for now this code is still needed in SPL. Reviewed-by: Simon Glass Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/mach-sunxi/board.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v2 05/23] pinctrl: sunxi: Add UART pinmuxes

2022-03-17 Thread Samuel Holland
This includes UART0 and R_UART (s_uart) on all supported platforms, plus the additional UART configurations from arch/arm/mach-sunxi/board.c. Pin lists and mux values were taken from the Linux drivers. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/pinctrl

[PATCH v2 08/23] net: sunxi_emac: Remove non-DM pin setup

2022-03-17 Thread Samuel Holland
This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/include/asm/arch-sunxi/gpio.h | 1 - drivers/net/sunxi_emac.c | 7 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm/include/asm

[PATCH v2 09/23] pinctrl: sunxi: Add sunxi GMAC pinmuxes

2022-03-17 Thread Samuel Holland
Pin lists and mux values were taken from the Linux drivers. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/pinctrl-sunxi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index

[PATCH v2 10/23] sunxi: Remove non-DM GMAC pin setup

2022-03-17 Thread Samuel Holland
This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/include/asm/arch-sunxi/gpio.h | 2 - board/sunxi/gmac.c | 55 -- 2 files changed, 57 deletions(-) diff --git a/arch/arm

[PATCH v2 07/23] pinctrl: sunxi: Add sun4i EMAC pinmuxes

2022-03-17 Thread Samuel Holland
Pin lists and mux values were taken from the Linux drivers. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/pinctrl-sunxi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index

[PATCH v2 11/23] pinctrl: sunxi: Add sun8i EMAC pinmuxes

2022-03-17 Thread Samuel Holland
Pin lists and mux values were taken from the Linux drivers. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/pinctrl-sunxi.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c

[PATCH v2 13/23] pinctrl: sunxi: Add I2C pinmuxes

2022-03-17 Thread Samuel Holland
Where multiple options were available, the one matching board.c and the device trees was chosen. Pin lists and mux values were taken from the Linux drivers. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/pinctrl-sunxi.c | 37 +++ 1 file

[PATCH v2 12/23] net: sun8i_emac: Remove non-DM pin setup

2022-03-17 Thread Samuel Holland
This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/net/sun8i_emac.c | 90 1 file changed, 90 deletions(-) diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index

[PATCH v2 14/23] sunxi: Remove options and setup code for I2C2-I2C4

2022-03-17 Thread Samuel Holland
These options are not currently enabled anywhere. Any new users should use DM clocks and pinctrl. Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/include/asm/arch-sunxi/gpio.h | 8 - arch/arm/include/asm/arch-sunxi/i2c.h | 11 +- arch/arm/mach-sunxi/Kconfig

[PATCH v2 15/23] sunxi: Remove non-DM I2C clock/pin setup from U-Boot

2022-03-17 Thread Samuel Holland
This is now handled automatically by the clock and pinctrl drivers. SPL still calls this function because it needes the non-DM code. Signed-off-by: Samuel Holland --- (no changes since v1) board/sunxi/board.c | 8 1 file changed, 8 deletions(-) diff --git a/board/sunxi/board.c b

[PATCH v2 16/23] i2c: sun6i_p2wi: Only do non-DM pin setup for non-DM I2C

2022-03-17 Thread Samuel Holland
When the DM_I2C driver is loaded, the pin setup is done automatically from the device tree by the pinctrl driver. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/i2c/sun6i_p2wi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/i2c

[PATCH v2 17/23] i2c: sun8i_rsb: Only do non-DM pin setup for non-DM I2C

2022-03-17 Thread Samuel Holland
-off-by: Samuel Holland --- (no changes since v1) drivers/i2c/sun8i_rsb.c | 46 + 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/drivers/i2c/sun8i_rsb.c b/drivers/i2c/sun8i_rsb.c index 716b245a00..0dea8f7a92 100644 --- a/drivers/i2c

[PATCH v2 18/23] pinctrl: sunxi: Add MMC pinmuxes

2022-03-17 Thread Samuel Holland
Pin lists and mux values were taken from the Linux drivers. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/pinctrl/sunxi/pinctrl-sunxi.c | 54 +++ 1 file changed, 54 insertions(+) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl

[PATCH v2 19/23] sunxi: Remove non-DM MMC pin setup

2022-03-17 Thread Samuel Holland
This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland --- (no changes since v1) board/sunxi/board.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 77ceefdb46..9a18399294 100644 --- a/board/sunxi

<    1   2   3   4   5   6   7   >