[PATCH] ata: ahci: use correct macro when calculating offsets in dma memory

2022-05-05 Thread Denis Orlov
The macro that indicates the size of a single element in the command list was incorrectly used instead of the macro that stands for the size of the whole list. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [RFC] ARM: OMAP: debug_ll: Add support for PBL console

2022-05-05 Thread Sascha Hauer
On Thu, May 05, 2022 at 12:42:54PM +0300, Alexander Shiyan wrote: > Signed-off-by: Alexander Shiyan > --- > arch/arm/boards/myirtech-x335x/lowlevel.c | 10 -- > arch/arm/mach-omap/include/mach/debug_ll.h | 20 ++-- > 2 files changed, 18 insertions(+), 12 deletions(-) >

[RFC] ARM: OMAP: debug_ll: Add support for PBL console

2022-05-05 Thread Alexander Shiyan
Signed-off-by: Alexander Shiyan --- arch/arm/boards/myirtech-x335x/lowlevel.c | 10 -- arch/arm/mach-omap/include/mach/debug_ll.h | 20 ++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/arch/arm/boards/myirtech-x335x/lowlevel.c

Re: [PATCH] ARM: OMAP: debug_ll: Use Kconfig UART base address

2022-05-05 Thread Alexander Shiyan
чт, 5 мая 2022 г. в 11:13, Sascha Hauer : > Hi Alexander, > On Thu, May 05, 2022 at 10:36:04AM +0300, Alexander Shiyan wrote: > > Signed-off-by: Alexander Shiyan > > --- > > arch/arm/boards/afi-gf/lowlevel.c| 2 +- > > arch/arm/boards/beagle/lowlevel.c| 2 +- > >

Re: Boot from SD if SD-Card is present - Beaglebone Black

2022-05-05 Thread Konstantin Kletschke
On Thu, May 05, 2022 at 10:25:07AM +0200, Sascha Hauer wrote: > Several partitioning tools set this automatically, but not all it seems. I got it. The partitions are created via sfdisk. No PARTUUID. If I change the disk identifier with fdisk afterwards, the partitions magically also get

Re: Boot from SD if SD-Card is present - Beaglebone Black

2022-05-05 Thread Konstantin Kletschke
On Thu, May 05, 2022 at 10:25:07AM +0200, Sascha Hauer wrote: > Is this a DOS partition table or GPT on this card? > I assume it's a DOS partition table in which case you should have a > variable mmc1.nt_signature. Set this to some arbitrary 32bit value. > Several partitioning tools set this

Re: Boot from SD if SD-Card is present - Beaglebone Black

2022-05-05 Thread Sascha Hauer
On Thu, May 05, 2022 at 09:24:48AM +0200, Konstantin Kletschke wrote: > Hey Sascha, > > On Thu, May 05, 2022 at 09:06:02AM +0200, Sascha Hauer wrote: > > > It's only "bootsource" and "bootsource_instance", without the global. > > prefix for historic reasons. > > Ah okay. Those varables are

Re: [PATCH] ARM: OMAP: debug_ll: Use Kconfig UART base address

2022-05-05 Thread Sascha Hauer
Hi Alexander, On Thu, May 05, 2022 at 10:36:04AM +0300, Alexander Shiyan wrote: > Signed-off-by: Alexander Shiyan > --- > arch/arm/boards/afi-gf/lowlevel.c| 2 +- > arch/arm/boards/beagle/lowlevel.c| 2 +- > arch/arm/boards/beaglebone/lowlevel.c| 2 +- >

Re: [PATCH] ARM: OMAP: debug_ll: Use Kconfig UART base address

2022-05-05 Thread Ahmad Fatoum
On 05.05.22 10:01, Alexander Shiyan wrote: > чт, 5 мая 2022 г. в 10:55, Lucas Stach : >> Am Donnerstag, dem 05.05.2022 um 10:36 +0300 schrieb Alexander Shiyan: >>> Signed-off-by: Alexander Shiyan >> Is this really a change in the right direction? The way it is currently >> done seems to mix well

[PATCH 11/15] ARM: rpi: add Raspberry Pi 4 support

2022-05-05 Thread Ahmad Fatoum
With basic driver support added in previous commits, add the boilerplate to have barebox-dt-2nd.img usable as bootloader for the Raspberry Pi 4 in 64-Bit mode. Tested peripherals: - SD-Card - pinctrl - clocksource - mini-UART Signed-off-by: Ahmad Fatoum ---

[PATCH 10/15] clocksource: bcm2835: bump below architeced timer for AArch64

2022-05-05 Thread Ahmad Fatoum
We use the ARM architected timer on other ARMv8 platforms as well, so let's do the same for the 64-bit Raspberry Pi configuration. Signed-off-by: Ahmad Fatoum --- drivers/clocksource/bcm2835.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/bcm2835.c

[PATCH 14/15] doc: bcm283x: add initial docs for Raspberry Pi 4 support

2022-05-05 Thread Ahmad Fatoum
Separate out the barebox-dt-2nd documentation. There's much duplication that way, but as we intend to remove the board-specific raspberry pi images, this is ok for now. Signed-off-by: Ahmad Fatoum --- Documentation/boards/bcm2835.rst | 61 +--- 1 file changed, 56

[PATCH 07/15] clk: rpi: add Raspberry Pi 4 support

2022-05-05 Thread Ahmad Fatoum
Our Raspberry Pi block driver is a hack, but it works well enough for older Rpis and just needs one more clock to support the SD-Card on the Raspberry Pi 4, so add that. In return, we remove bcm2835-cs, which we won't use on Raspberry Pi 4, because we'll leverage the ARM architected timer instead.

[PATCH 13/15] ARM: rpi: add heuristic for skipping detection of SDIO card

2022-05-05 Thread Ahmad Fatoum
mci0 is normally the WiFi while mci1 is the SD-Card on the Raspberry Pi 4. The proper way would be to use aliases, but as we accept device trees from outside, we can apply a simple heuristic to disfavor the SDIO controller: The SDIO controller tends to have a child node. If this is not the case,

[PATCH 06/15] ARM: rpi: rpi3: disallow MMU_EARLY && 64BIT

2022-05-05 Thread Ahmad Fatoum
Early MMU setup in 64-bit Raspberry Pi 3 barebox hangs, while normal setup concludes normally. Until this is figured out, disallow build of 64-Bit Raspberry Pi 3 support while CONFIG_MMU_EARLY=y. This issue doesn't affect the Raspberry Pi 4. Signed-off-by: Ahmad Fatoum ---

[PATCH 04/15] ARM: cpu: prevent recursive dependencies via CPU_SUPPORTS_64BIT_KERNEL

2022-05-05 Thread Ahmad Fatoum
For ARM, CONFIG_CPU_SUPPORTS_64BIT_KERNEL's only function, along with CONFIG_SYS_SUPPORTS_64BIT_KERNEL is to control visibility of the 64BIT symbol. It thus makes no sense to select it from CPU_V8 and it's actually detrimental, because subarches may want to select CPU_SUPPORTS_64BIT_KERNEL

[PATCH 08/15] mci: bcm2835: add bcm2711-emmc2 (Rpi4) support

2022-05-05 Thread Ahmad Fatoum
From: Uwe Kleine-König While older Raspberry Pis didn't mind the POWER_CONTROL register being 0x00, the BCM2711 on the Raspberry Pi 4 does mind, so initialize it for 3.3V like we do in many other SDHCI drivers. With the compatible added, this can access the SD-Card on the Raspberry Pi 4. Change

[PATCH 12/15] ARM: rpi: add debug_ll support for Raspberry Pi 4

2022-05-05 Thread Ahmad Fatoum
The mini uart (Pins 8/10) is the primary UART on the Raspberry Pi 4 and can be set up in firmware by specifying enable_uart=1 in the config.txt. Add a DEBUG_LL implementation to use this for early debugging. Signed-off-by: Ahmad Fatoum --- arch/arm/mach-bcm283x/include/mach/debug_ll.h | 21

[PATCH 01/15] PBL: fdt: fix /memory parsing when #address-cells != #size-cells

2022-05-05 Thread Ahmad Fatoum
Due to a typo, this code assumed so far ignored #size-cells and assumed it to be equal to #address-cells. This breaks using the barebox-dt-2nd.img with some 64-bit device trees like the Raspberry Pi's. Fixes: ffb0344b7410 ("ARM: Add generic device tree 2nd stage support") Signed-off-by: Ahmad

[PATCH 09/15] serial: ns16550: rpi: skip baudrate changes for bcm2711

2022-05-05 Thread Ahmad Fatoum
Current state of the driver leads to garbled output after divisor configuration, likely due to wrong clock rate. We so far blissfully ignored proper clock handling in barebox instead relying on firmware and fixed clocks. As the VideoCore firmware can already setup the mini-uart, we can continue

[PATCH 05/15] ARM: rpi: add Raspberry Pi 3 64-bit build support

2022-05-05 Thread Ahmad Fatoum
Have the subarch select the needed symbols to display a 32-bit/64-bit menu and hide the boards that aren't capable of 64-bit when CONFIG_64BIT=y. Building for 64-bit throws some warning about mismatched type sizes, so fix those as well. Signed-off-by: Ahmad Fatoum --- arch/arm/Kconfig

[PATCH 02/15] of: address: fix printing of OF node name in error message

2022-05-05 Thread Ahmad Fatoum
From: Uwe Kleine-König barebox has no %pOF. Open code this instance to yield a better error message. Signed-off-by: Uwe Kleine-König Signed-off-by: Ahmad Fatoum --- drivers/of/address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/address.c

[PATCH 03/15] serial: ns16550: rpi: remove ungating now done by proper clk driver

2022-05-05 Thread Ahmad Fatoum
We have bcm2835-aux-clk driver that will take care to ungate the clock, so we can remove this Raspberry Pi 3 specific detail from the driver. Tested on Raspberry Pi 3b. Signed-off-by: Ahmad Fatoum --- drivers/serial/serial_ns16550.c | 4 1 file changed, 4 deletions(-) diff --git

Re: [PATCH] ARM: OMAP: debug_ll: Use Kconfig UART base address

2022-05-05 Thread Alexander Shiyan
чт, 5 мая 2022 г. в 10:55, Lucas Stach : > Am Donnerstag, dem 05.05.2022 um 10:36 +0300 schrieb Alexander Shiyan: > > Signed-off-by: Alexander Shiyan > Is this really a change in the right direction? The way it is currently > done seems to mix well with overall multi-image theme of Barebox. By >

[PATCH 00/15] ARM: rpi: add basic Raspberry Pi 4 support

2022-05-05 Thread Ahmad Fatoum
Just basic support, so we get a shell on mini-uart and SD working. Needs more work for USB and Ethernet, but I'll leave that to others now that the initial hurdle is overcome. I tested this series on Raspberry Pi 3b (both 32-bit and newly added 64-bit support) and Raspberry Pi 4b (both

[PATCH 15/15] doc: bcm283x: reference newer firmware

2022-05-05 Thread Ahmad Fatoum
The old firmware can boot a Raspberry Pi 4 apparently, but it doesn't contain bcm2711 device trees, so it's probably not an actually supported configuration. Point at a newer firmware instead. Signed-off-by: Ahmad Fatoum --- Documentation/boards/bcm2835.rst | 6 +++--- 1 file changed, 3

Re: [PATCH] ARM: OMAP: debug_ll: Use Kconfig UART base address

2022-05-05 Thread Lucas Stach
Am Donnerstag, dem 05.05.2022 um 10:36 +0300 schrieb Alexander Shiyan: > Signed-off-by: Alexander Shiyan Is this really a change in the right direction? The way it is currently done seems to mix well with overall multi-image theme of Barebox. By using a Kconfig for that, the setting will most

Re: [PATCH] ARM: omap: Cleanup omap4_revision

2022-05-05 Thread Sascha Hauer
On Thu, May 05, 2022 at 09:52:06AM +0300, Alexander Shiyan wrote: > Clean up the omap4 revision function by removing exceeding break statements. > > Signed-off-by: Alexander Shiyan > --- > arch/arm/mach-omap/omap4_generic.c | 17 - > 1 file changed, 4 insertions(+), 13

Re: [PATCH 01/16] ata: ahci: use abstract read/write functions uniformly

2022-05-05 Thread Sascha Hauer
On Wed, May 04, 2022 at 12:25:38PM +0300, Denis Orlov wrote: > Currently those are used in some routines side by side with underlying > functions with no apparent reason for it. Make their usage uniform, this > cleans up code a bit and allows to remove unneeded variables. > > Signed-off-by: Denis

[PATCH] ARM: OMAP: debug_ll: Use Kconfig UART base address

2022-05-05 Thread Alexander Shiyan
Signed-off-by: Alexander Shiyan --- arch/arm/boards/afi-gf/lowlevel.c| 2 +- arch/arm/boards/beagle/lowlevel.c| 2 +- arch/arm/boards/beaglebone/lowlevel.c| 2 +- arch/arm/boards/myirtech-x335x/lowlevel.c| 2 +- arch/arm/boards/phytec-som-am335x/lowlevel.c

Re: Boot from SD if SD-Card is present - Beaglebone Black

2022-05-05 Thread Konstantin Kletschke
Hey Sascha, On Thu, May 05, 2022 at 09:06:02AM +0200, Sascha Hauer wrote: > It's only "bootsource" and "bootsource_instance", without the global. > prefix for historic reasons. Ah okay. Those varables are existing. If I boot from internal MMC bootsource is mmc and instance is 1. If I boot from

Re: [PATCH v6 0/5] add different OF board fixups

2022-05-05 Thread Sascha Hauer
On Tue, May 03, 2022 at 11:12:15AM +0200, Oleksij Rempel wrote: > changes v6: > - remove MACHINE_FIXUP Kconfig > - use barebox_get_serial_number instead of getenv > - use of_device_is_compatible() instead of of_machine_is_compatible() > and remove warning if compatible is already registered. >

Re: Boot from SD if SD-Card is present - Beaglebone Black

2022-05-05 Thread Sascha Hauer
Hey Konsti, On Tue, May 03, 2022 at 04:14:37PM +0200, Konstantin Kletschke wrote: > On Mon, May 02, 2022 at 08:35:55AM +0200, Ahmad Fatoum wrote: > > > There is, but I'd check first if it's possible to boot from eMMC only > > as a fallback if SD boot failed. On some bootroms, this is possible >

[PATCH] ARM: omap: Cleanup omap4_revision

2022-05-05 Thread Alexander Shiyan
Clean up the omap4 revision function by removing exceeding break statements. Signed-off-by: Alexander Shiyan --- arch/arm/mach-omap/omap4_generic.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-omap/omap4_generic.c