Hi there,
I'm orpahning all the pending patches I've submitted to this project. If you
have them in your patch queue, please disregard them.
Full list:
- boot: Pass baud rate to stdout
https://lore.kernel.org/r/20240411-stdout-v1-1-66ebe5bb1...@jookia.org
- pwm: sunxi: Add support Allwinner D1
Hi,
On Fri, Jun 28, 2024 at 04:17:27PM +0100, Andre Przywara wrote:
> > I do not know if this patch is still a
> > necessity; though if John is nudging about it, it probably is.
>
> Yes apparently he needs it, though I am not entirely sure why.
> USB gadget has worked for ages in sunxi, without
This driver is mostly copied from the Linux kernel and includes
support for two physical panels that use this driver.
Signed-off-by: John Watts
---
This patch is a straightforward port of the kernel NV3052C SPI driver to
U-Boot, keeping full compatibility with mainline device tree bindings
Implement these by inverting the DE and PCLK polarities.
Signed-off-by: John Watts
---
arch/arm/include/asm/arch-sunxi/lcdc.h | 2 ++
drivers/video/sunxi/lcdc.c | 4
2 files changed, 6 insertions(+)
diff --git a/arch/arm/include/asm/arch-sunxi/lcdc.h
b/arch/arm/include/asm
The current code assumes hsync and vsync are active high by default, but
they are actually active low by default. This results in panels being
driven with the wrong sync polarities. Invert the check to fix it.
Signed-off-by: John Watts
---
drivers/video/sunxi/lcdc.c | 4 ++--
1 file changed, 2
The current LCD controller driver has incorrect polarity masks, so I've
provided a fix for that. While I was there I also added support for two
new display flags related to polarities.
Signed-off-by: John Watts
---
John Watts (2):
sunxi: video: Properly invert hsync and vsync polarity
Currently the LCD code only supports reading panel timings from the
device tree. Change that so it can use a real panel.
Signed-off-by: John Watts
---
I've been working on a panel driver port from Linux for the T113 and
found I need this code to have the panel boot correctly.
---
drivers/video
This interface supports sending MIPI commands over an SPI bus.
This driver only implements the Type C1 protocol for now.
Signed-off-by: John Watts
---
drivers/video/Kconfig| 6
drivers/video/Makefile | 1 +
drivers/video/mipi_dbi.c | 70
The bit-banging soft SPI driver supports any word length, so just
blindly return support for all of them.
Signed-off-by: John Watts
---
drivers/spi/soft_spi.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/soft_spi.c b/drivers/spi/soft_spi.c
index 0fa14339bd..4f2161f0bf
Implement spi_set_wordlen for driver model devices.
Not all drivers support this interface, so we will assume the default
wordlen is safe and allow setting that unconditionally.
Signed-off-by: John Watts
---
drivers/spi/spi-uclass.c | 29 +
1 file changed, 29
We have no way to tell if we can actually set the wordlen in non-DM
code, so limit it to the default wordlen already in use.
Signed-off-by: John Watts
---
drivers/spi/spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3649c9c25b
Return the current wordlen to the caller so they can restore it back
when done. This is required to avoid clobbering the bus state.
Signed-off-by: John Watts
---
drivers/spi/spi.c | 4 +++-
include/spi.h | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/spi
from the kernel.
Signed-off-by: John Watts
---
John Watts (5):
spi: Return old wordlen in spit_set_wordlen
spi: Limit spi_set_wordlen to SPI_DEFAULT_WORDLEN
spi: Implement spi_set_wordlen for driver model
spi: softspi: Support setting wordlen
video: add support
On Sat, May 18, 2024 at 01:54:45PM +1000, John Watts wrote:
> This driver documents and handles setting up PWM on the D1.
>
> Signed-off-by: John Watts
> ---
> drivers/pwm/Kconfig| 6 +
> drivers/pwm/Makefile | 1 +
> drivers/pwm
On Mon, May 20, 2024 at 03:58:12PM +0530, Sumit Garg wrote:
> This change shouldn't be needed for your testing purposes too. It only
> comes into picture once you enable OF_UPSTREAM. BTW, DT source files
> in dts/upstream are strictly following/syncing against Linux kernel DT
> sources. So all the
After a long time reading the datasheet I found out my approach was
actually wrong and led to an off by on error.
Signed-off-by: John Watts
---
drivers/pwm/sunxi_pwm_d1.c | 57 +-
1 file changed, 32 insertions(+), 25 deletions(-)
diff --git a/drivers/pwm
After a long time reading the datasheet I found out my approach was
actually wrong and led to an off by on error.
Signed-off-by: John Watts
---
drivers/pwm/sunxi_pwm_d1.c | 57 +-
1 file changed, 32 insertions(+), 25 deletions(-)
diff --git a/drivers/pwm
This is based on the binding from the as yet unmerged kernel series:
https://lore.kernel.org/linux-kernel/20240131125920.2879433-2-privates...@gmail.com/
Signed-off-by: John Watts
---
arch/riscv/dts/sunxi-d1s-t113.dtsi | 12
dts/upstream/src/riscv/allwinner/sunxi
This driver documents and handles setting up PWM on the D1.
Signed-off-by: John Watts
---
drivers/pwm/Kconfig| 6 +
drivers/pwm/Makefile | 1 +
drivers/pwm/sunxi_pwm_d1.c | 542 +
3 files changed, 549 insertions(+)
diff --git
This is currently only used for PD22 on the Mango Pi MQ-Dual.
Signed-off-by: John Watts
---
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 37ea93715d..b3f2568ffe
This is needed for the D1 PWM driver.
Signed-off-by: John Watts
---
drivers/clk/sunxi/clk_d1.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/clk/sunxi/clk_d1.c b/drivers/clk/sunxi/clk_d1.c
index 9dae761de8..6577d86e0b 100644
--- a/drivers/clk/sunxi/clk_d1.c
+++ b/drivers/clk
This patch series adds support for the Allwinner D1, T113 and R329 PWM.
This code isn't based on any kernel code but instead written from scratch with
the goal of handling the PWM pairs deterministically.
I've tested this on T113 hardware and it works very well.
Signed-off-by: John Watts
This is required for compiling.
Signed-off-by: John Watts
---
drivers/spi/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 025c81adc9..f1c6a838ae 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -417,6 +417,7 @@ config
This code uses dev_err which is defined in dm/device_compat.h
Signed-off-by: John Watts
---
drivers/spi/ca_sflash.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/ca_sflash.c b/drivers/spi/ca_sflash.c
index 38bddd3861..78e442cac9 100644
--- a/drivers/spi/ca_sflash.c
+++ b
This created a conflict when linking.
Signed-off-by: John Watts
---
drivers/spi/mtk_spim.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/spi/mtk_spim.c b/drivers/spi/mtk_spim.c
index 90f4c3cecb..2979487fff 100644
--- a/drivers/spi/mtk_spim.c
+++ b/drivers/spi/mtk_spim.c
@@ -18,7
These dependencies are required for building the drivers and create
compile errors if not enabled.
Signed-off-by: John Watts
---
drivers/spi/Kconfig | 16
1 file changed, 16 insertions(+)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 612434633b..025c81adc9
I'm doing some SPI work so I tried to compile all the drivers on my
sunxi board to try and avoid some regressions. This failed, so here are
some fixes for this.
Signed-off-by: John Watts
---
John Watts (4):
spi: Kconfig: Add some required arch depends for drivers
spi: mtk_spim
on the H616 and VIDEO0 elsewhere.
Signed-off-by: John Watts
---
arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h | 9 +++
arch/arm/mach-sunxi/clock_sun50i_h6.c | 10
drivers/video/sunxi/sunxi_dw_hdmi.c | 70 ---
3 files changed, 80 insertions(+), 9
Now that all the code is present and can compile, enable the DE2 so
people can use it.
Signed-off-by: John Watts
---
arch/arm/mach-sunxi/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index ddf9414b08..9d76e429ef 100644
or VIDEO1 to run the TCON and
HDMI encoder based on the chip.
Signed-off-by: John Watts
---
drivers/video/sunxi/sunxi_dw_hdmi.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c
b/drivers/video/sunxi/sunxi_dw_hdmi.c
index 0324a050d0..34a6b8bab7
This variable is only used sometimes, so gate it behind an #ifdef.
Signed-off-by: John Watts
---
drivers/video/sunxi/lcdc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/video/sunxi/lcdc.c b/drivers/video/sunxi/lcdc.c
index ea21d602be..1474f6cb2e 100644
--- a/drivers/video
This requires just a little change to clocking and reset logic.
Signed-off-by: John Watts
---
drivers/video/sunxi/sunxi_de2.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c
index e02d359cd2..9b6c41b212
The H6/D1/R528 don't require any big changes, just some small
tweaks to support new clock and reset logic.
Signed-off-by: John Watts
---
drivers/video/sunxi/lcdc.c | 20
drivers/video/sunxi/sunxi_lcd.c | 6 --
2 files changed, 24 insertions(+), 2 deletions
These are used for operating the LCD on the H6/H616.
Signed-off-by: John Watts
---
arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h
b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h
index
These are used for operating the LCD on the D1/T113.
Signed-off-by: John Watts
---
arch/arm/include/asm/arch-sunxi/cpu_sunxi_ncat2.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sunxi_ncat2.h
b/arch/arm/include/asm/arch-sunxi/cpu_sunxi_ncat2.h
This code adds support for clocking VIDEO0 and VIDEO1, as well as
registers used for the DE2.
This code deliberately uses a 12MHz step in clocking to align with
the DE2 code's expectation of double 6MHz steps.
Signed-off-by: John Watts
---
arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h | 56
to work on it. It compiles and looks like it should work,
but I haven't ungated/reset the slow HDMI clock, or HDMI sub.
Signed-off-by: John Watts
---
John Watts (9):
sunxi: clock: support H6/D1 video clocks
sunxi: ncat2: Specify DE2 and LCD0 base addresses
sunxi: sun50i-h6
in the probe func, per feedback from Marek.
> I received no other feedback against v1 of this patch.
Hi Sam,
I did some more testing and I believe my USB issues mentioned in the
other subthread are unrelated to this patch.
As such, here's my reviewed-by and tested-by. :)
John.
Reviewed-b
On Thu, Apr 11, 2024 at 05:27:08PM -0600, Sam Edwards wrote:
> Hi John,
>
> It doesn't look like I was sent the whole series (only 00 and 01), but
> I was able to find it on Patchwork and sift through it. A few general
> comments follow:
>
> The introduction of `SUNXI_BOOTED_FROM_SPINAND` is the
On Thu, Apr 11, 2024 at 03:53:51PM -0600, Sam Edwards wrote:
> Hi John,
Hi Sam,
> Ahh I see the problem. In U-Boot, `ubi` isn't actually a block device:
> it's implemented as a stub in the block layer, and the filesystem
> layer redirects `ubi` accesses to the currently-mounted ubifs instead.
>
On Thu, Apr 11, 2024 at 05:11:46PM +0200, Mark Kettenis wrote:
> You probably should fix this by making sure the device tree you're
> using has the appropriate stdout-path node. Because I think the
> functionality you're trying to use here is deprecated:
Hi Mark,
Interesting, I'll go with that
On Sun, Dec 31, 2023 at 03:38:37PM -0500, Aren Moynihan wrote:
> Add support for building the sunxi-musb driver with DM_USB_GADGET
> including adding a separate IRQ handling function and registering the
> driver with the musb system differently.
Hi there,
Were you aware of this similar patch?
Hi there,
I've tested this patch and it seems to support the gadget model, but I'm having
a lot of USB errors. What device did you test this on?
John.
On Thu, Jun 08, 2023 at 01:56:29PM -0600, Sam Edwards wrote:
> Happy Thursday, U-Boot list!
>
> Here is attempt 2 at making this USB controller
The T113 supports UART2 on PD1 and PD2. Add it as an option.
Signed-off-by: John Watts
---
arch/arm/mach-sunxi/board.c | 4
include/sunxi_gpio.h| 1 +
2 files changed, 5 insertions(+)
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index f5da50b43a
The T113 supports UART1 on pins PG6 and PG7, add support for it here.
Signed-off-by: John Watts
---
arch/arm/mach-sunxi/board.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index f4dbb2a740..f5da50b43a 100644
The T113 supports UART1 and UART2 on PG and PD pins respectively.
Add support for these in U-Boot so we can use them.
Note: I'm not entirely sure if the PD pins should be default, they
overlap with the LCD pins. I am however using this on a real board.
Signed-off-by: John Watts
---
John Watts
UBI required MTD to build correctly, add it as a Kconfig dependency.
Signed-off-by: John Watts
---
While working with UBI on my SPI NAND patch series I found it was
possible to enable it without enabling the MTD subsystem.
Add a Kconfig option to solve this.
---
drivers/mtd/ubi/Kconfig | 1 +
1
Linux might use the wrong baud rate such as 9600 by default, make sure
to specify it when passing the serial port over.
Signed-off-by: John Watts
---
On my board at least (a sunxi T113) the serial console will initialize
as 9600 baud instead of the set baud. Pass the baud with the serial
device
Hello,
I've used this code extensively, incorporated it in to an RFC branch of
mine during development and reviewed it in the process.
John.
Reviewed-by: John Watts
Tested-by: John Watts
On Fri, Oct 14, 2022 at 11:05:12AM +0800, Icenowy Zheng wrote:
> This patchset tries to extend SPI-ba
Hi there,
I've been using my own independent implementation of this patch but
today I gave this one a test in my tree and found out it works.
The code looks fine in comparison, so here's a Tested-by and a
Reviewed-by.
John.
Tested-by: John Watts
Reviewed-by: John Watts
On Sat, Nov 11, 2023
The FIT loader doesn't support access through UBI, so load the FIT
image ourself in to memory then boot it normally.
Signed-off-by: John Watts
---
common/spl/spl_ubi.c | 34 ++
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/common/spl/spl_ubi.c b
UBI supports traditional NAND and oneNAND devices already, so add
support for booting from SPI NAND devices.
Signed-off-by: John Watts
---
common/spl/spl_ubi.c | 15 ++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/common/spl/spl_ubi.c b/common/spl/spl_ubi.c
index
These are used by NAND-aware loaders such as UBI.
Signed-off-by: John Watts
---
arch/arm/mach-sunxi/spl_spi_sunxi.c | 21 +
1 file changed, 21 insertions(+)
diff --git a/arch/arm/mach-sunxi/spl_spi_sunxi.c
b/arch/arm/mach-sunxi/spl_spi_sunxi.c
index 602ebfe8c5..d6b03678d0
These are implemented by the board-specific SPL code for use with
NAND-aware loaders like UBI.
Signed-off-by: John Watts
---
include/nand.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/nand.h b/include/nand.h
index 220ffa202e..9fb8941dce 100644
--- a/include/nand.h
+++ b
Use the newly created SPL_SPINAND configuration options instead of
sunxi-only options.
No backwards compatibility is needed as the SPI NAND patches are not
mainline yet.
Signed-off-by: John Watts
---
arch/arm/mach-sunxi/Kconfig | 16
arch/arm/mach-sunxi/spl_spi_sunxi.c
Boards that support SPI NAND need to specify the page and eraseblock
size. Add those as Kconfig options.
Signed-off-by: John Watts
---
common/spl/Kconfig | 21 +
1 file changed, 21 insertions(+)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 6405374bcc
Currently there are two different boot device options: SPI and NAND.
One is intended for SPI NOR operation, the other is intended for dedicated
NAND operation.
Add a new option for SPI NAND operation.
Signed-off-by: John Watts
---
arch/arm/include/asm/spl.h | 1 +
arch/mips/include/asm
Instead of trying to boot from SPI NAND then SPI NOR in series, select
one based on the current boot device.
Signed-off-by: John Watts
---
arch/arm/include/asm/arch-sunxi/spl.h | 1 +
arch/arm/mach-sunxi/board.c | 5 -
arch/arm/mach-sunxi/spl_spi_sunxi.c | 28
work though.
Signed-off-by: John Watts
---
arch/arm/include/asm/arch-sunxi/spl.h | 2 --
arch/arm/mach-sunxi/board.c | 22 +-
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/arch/arm/include/asm/arch-sunxi/spl.h
b/arch/arm/include/asm/arch-sunxi
From: Icenowy Zheng
As we added support for SPI NAND to the existing SPL SPI codepath, route
the boot code to it when it detects the BROM loads SPL from SPI NAND, as
for SoCs with both SPI NAND and boot media indicator support, the boot
media indicator is the same for SPI NOR and NAND.
From: Icenowy Zheng
This commit adds support for booting from SPI NAND to SPL SPI code by
mimicing the behavior of boot ROM (use fixed page size and sequentially
try SPI NOR and NAND).
Signed-off-by: Icenowy Zheng
Tested-by: Samuel Holland # Orange Pi Zero Plus
---
From: Icenowy Zheng
As we're going to add support for SPI NAND to this code, add code that
allows multiple boot attempts with different load offsets and functions.
To keep compatibility with loading raw binary on SPI NOR, a bool
parameter is used to allow booting without valid magic number when
From: Icenowy Zheng
This kind of read command is utilized in SPI NANDs for reading data
inside a selected page, which is obviously smaller than how much 2
byte address can address. So 2 bytes are used for the address and one
dummy byte is needed after the real address. As the address is sent out
From: Icenowy Zheng
To support SPI NAND flashes, more commands than Read (03h) are needed.
Extract the code for doing SPI transfer from the reading code for code
reuse.
Signed-off-by: Icenowy Zheng
Reviewed-by: Samuel Holland
Tested-by: Samuel Holland # Orange Pi Zero Plus
---
From: Maksim Kiselev
R528/T113 SoCs uses the same SPI IP as the H6, also have the same clocks
and reset bits layout, but the CCU base is different. Another difference
is that the new SoCs do not have a clock divider inside. Instead of this
we should configure sample mode depending on input clock
://lore.kernel.org/all/2023133432.755363-2-biguncle...@gmail.com/
Hopefully this can get the ball rolling on how to properly implement
SPI NAND support in mainline U-Boot.
Signed-off-by: John Watts
---
Icenowy Zheng (5):
sunxi: SPL SPI: extract code for doing SPI transfer
sunxi: SPL SPI
Greetings sunxi and U-Boot friends!
Over the past five months I've managed to slog through getting a
complete SPI NAND U-Boot and Linux setup running on my Mango Pi MQ.
My tree is here, but I will be slowly trying to upstream my work over
the next few months:
67 matches
Mail list logo