Re: [PATCH v2 11/13] ARM: boards: sunxi: Add initial support for the pinephone

2023-05-31 Thread Jules Maselbas
Hi Sascha, Thanks for your review On Tue, May 30, 2023 at 10:42:36AM +0200, Sascha Hauer wrote: > On Thu, May 25, 2023 at 01:43:26AM +0200, Jules Maselbas wrote: > > Signed-off-by: Jules Maselbas > > --- > > arch/arm/boards/Makefile| 1 + > >

Re: [PATCH 18/18] state: allow lookup of barebox state partition by Type GUID

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 22:01, Marco Felsch wrote: > Hi Ahmad, > > On 23-05-31, Ahmad Fatoum wrote: >> The backend device tree property so far always pointed at a partition. >> Let's allow pointing it at GPT storage devices directly and lookup >> the correct barebox state partition by the well-known type

Re: [PATCH 16/18] cdev: use cdev::dos_partition_type only if cdev_is_mbr_partitioned

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 20:54, Marco Felsch wrote: > On 23-05-31, Ahmad Fatoum wrote: >> dos_partition_type == 0 can mean that either a partition is not >> a MBR partition or that it indeed has a partition type of 0x00. >> >> In preparation for using that field in a union, explicitly check if we >> have a MBR

Re: [PATCH 15/18] state: factor device path lookup into helper function

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 19:54, Marco Felsch wrote: > Hi Ahmad, > > On 23-05-31, Ahmad Fatoum wrote: >> The #ifdef __BAREBOX__ is meant for easier synchronization with >> dt-utils. We'll keep that intact, but move it out of the function to not >> break reading flow. After sync, dt-utils would now need to

Re: [PATCH 12/18] common: partitions: record whether disk is GPT or MBR partitioned

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 19:33, Marco Felsch wrote: > On 23-05-31, Ahmad Fatoum wrote: >> Currently, the only way to differentiate between a GPT disk and a MBR >> one is to check whether the cdev's device has a guid (=> GPT) or a >> nt_signature (=> MBR) device parameter. We already have a flag parameter >>

Re: [PATCH 10/18] cdev: have devfs_add_partition return existing identical partition, not NULL

2023-05-31 Thread Ahmad Fatoum
Hello Marco, On 31.05.23 19:23, Marco Felsch wrote: > Hi Ahmad, > > On 23-05-31, Ahmad Fatoum wrote: >> Starting with commit 7f9f45b9bfef ("devfs: Do not create overlapping >> partitions"), any overlapping is disallowed. Overlapping can be useful >> though to bridge the gap between partition

Re: [PATCH 04/18] of: partition: support of_partition_ensure_probed on parent device

2023-05-31 Thread Ahmad Fatoum
Hello Marco, On 31.05.23 18:30, Marco Felsch wrote: > Hi Ahmad, > > On 23-05-31, Ahmad Fatoum wrote: >> barebox-state code uses of_partition_ensure_probed to resolve the >> backend property. We want to allow backend to point directly at a >> storage device instead of a partition. We can't

Re: [PATCH 18/18] state: allow lookup of barebox state partition by Type GUID

2023-05-31 Thread Marco Felsch
Hi Ahmad, On 23-05-31, Ahmad Fatoum wrote: > The backend device tree property so far always pointed at a partition. > Let's allow pointing it at GPT storage devices directly and lookup > the correct barebox state partition by the well-known type GUID: > > 4778ed65-bf42-45fa-9c5b-287a1dc4aab1

Re: [PATCH 16/18] cdev: use cdev::dos_partition_type only if cdev_is_mbr_partitioned

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > dos_partition_type == 0 can mean that either a partition is not > a MBR partition or that it indeed has a partition type of 0x00. > > In preparation for using that field in a union, explicitly check if we > have a MBR partition. > > Signed-off-by: Ahmad Fatoum

Re: [PATCH v2] Porting barebox to a new SoC

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 19:55, Ahmad Fatoum wrote: > Hi Lior, > > On 31.05.23 18:13, Lior Weintraub wrote: >> Hi Ahmad, >> >> Using end of SRAM as PBL stack is currently not working because we need >> 40bit address (0xC0_0020_). >> This needs a fix to ENTRY_FUNCTION_WITHSTACK macro. > > Ah, right. I

Re: [PATCH v2] Porting barebox to a new SoC

2023-05-31 Thread Ahmad Fatoum
Hi Lior, On 31.05.23 18:13, Lior Weintraub wrote: > Hi Ahmad, > > Using end of SRAM as PBL stack is currently not working because we need 40bit > address (0xC0_0020_). > This needs a fix to ENTRY_FUNCTION_WITHSTACK macro. Ah, right. I just sent an (untested) patch. Would be cool if you

Re: [PATCH 15/18] state: factor device path lookup into helper function

2023-05-31 Thread Marco Felsch
Hi Ahmad, On 23-05-31, Ahmad Fatoum wrote: > The #ifdef __BAREBOX__ is meant for easier synchronization with > dt-utils. We'll keep that intact, but move it out of the function to not > break reading flow. After sync, dt-utils would now need to implement > > of_cdev_find > cdev_to_devpath >

[PATCH RFT] ARM64: cpu: support 64-bit stack top in ENTRY_FUNCTION_WITHSTACK

2023-05-31 Thread Ahmad Fatoum
ENTRY_FUNCTION_WITHSTACK was written with the naive assumption that there will always be some memory in the first 32-bit of the address space to be used as early stack. There are SoCs out there though with sole on-chip SRAM > 4G. Accommodate this by accepting full 64-bit stack pointers in

Re: [PATCH 14/18] of: export new of_cdev_find helper

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > __of_find_path goes throught the hassle of determining the cdev, only to > discard it again and return either zero or an error code. > > Follow up commits will need to get the cdev corresponding to a path in > the DT. So let's make that easier by exporting a

Re: [PATCH 13/18] block: add cdev_is_block_(device,partition,disk) helpers

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > We look too much into struct cdev's guts. Let's add helpers to make > operating on block device cdevs more concise. > > Signed-off-by: Ahmad Fatoum Reviewed-by: Marco Felsch > --- > include/block.h | 15 +++ > 1 file changed, 15 insertions(+) >

Re: [PATCH 12/18] common: partitions: record whether disk is GPT or MBR partitioned

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > Currently, the only way to differentiate between a GPT disk and a MBR > one is to check whether the cdev's device has a guid (=> GPT) or a > nt_signature (=> MBR) device parameter. We already have a flag parameter > though, so let's record this info there for

Re: [PATCH 11/18] block: parse partition table on block device registration

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > Every instance where we register a block device, it's followed by an > attempt to parse the partition table, most often with a warning when > it fails. Thus let's move partition table parsing into > blockdevice_register. > > Signed-off-by: Ahmad Fatoum

Re: [PATCH 10/18] cdev: have devfs_add_partition return existing identical partition, not NULL

2023-05-31 Thread Marco Felsch
Hi Ahmad, On 23-05-31, Ahmad Fatoum wrote: > Starting with commit 7f9f45b9bfef ("devfs: Do not create overlapping > partitions"), any overlapping is disallowed. Overlapping can be useful > though to bridge the gap between partition described in DT and via > on-disk partition tables. Let's handle

Re: [PATCH 09/18] cdev: record whether partition is parsed from OF

2023-05-31 Thread Marco Felsch
Hi Ahmad, On 23-05-31, Ahmad Fatoum wrote: > Later code will make it possible to define a on-disk-described partition > in the DT as well. For this reason, we can't assumed > DEVFS_PARTITION_FROM_TABLE to mean !DT, so let's add a dedicated flag > for that. > > Signed-off-by: Ahmad Fatoum > ---

Re: [PATCH 08/18] cdev: use more descriptive struct cdev::diskuuid/partuuid

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > The UUID field has different meanings: > > For a master cdev: > > - GPT Header DiskGUID if GPT-formatted > - MBR Header NT Disk Signature if MBR-formatted > > For a partition cdev: > > - GPT UniquePartitionGUID > - MBR Header NT Disk Signature

Re: [PATCH 07/18] commands: stat: remove code duplication for type info

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > stat prints a line with partitioning/type info for cdevs, but not all > cdevs have these, so we want to skip printing when it's empty. > Instead of duplicating the check, just utilize printf returning the > number of characters written. > > Signed-off-by: Ahmad

Re: [PATCH 06/18] driver: add new cdev_is_partition helper

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > Partitions will have cdev->master != NULL, so often code will just do > if (cdev->master) to check if a cdev is a partition. This is suboptimal > as it may be misinterpreted by readers as meaning that the cdev is the > master device, while it's the other way

Re: [PATCH 05/18] of: of_path: always call of_partition_ensure_probed before resolving

2023-05-31 Thread Marco Felsch
Hi Ahmad, On 23-05-31, Ahmad Fatoum wrote: > of_find_path may be called on a partition, whose parent device is not > yet probed. state code solves that by calling of_partition_ensure_probed > before of_find_path_by_nde, but really we should be doing that for all nit: of_find_path_by_node >

Re: [PATCH 04/18] of: partition: support of_partition_ensure_probed on parent device

2023-05-31 Thread Marco Felsch
Hi Ahmad, On 23-05-31, Ahmad Fatoum wrote: > barebox-state code uses of_partition_ensure_probed to resolve the > backend property. We want to allow backend to point directly at a > storage device instead of a partition. We can't determine whether a DT > device is a storage device though before

RE: [PATCH v2] Porting barebox to a new SoC

2023-05-31 Thread Lior Weintraub
Hi Ahmad, Using end of SRAM as PBL stack is currently not working because we need 40bit address (0xC0_0020_). This needs a fix to ENTRY_FUNCTION_WITHSTACK macro. I tried just to change const u32 __stack_top = (stack_top); to const u64 __stack_top = (stack_top); but there were linking errors

Re: [PATCH 03/18] cdev: fix for_each_cdev macro

2023-05-31 Thread Marco Felsch
On 23-05-31, Ahmad Fatoum wrote: > The macro parameter 'c' was never used, instead hardcoding cdev. > It worked so far anyway, because all users of for_each_cdev used cdev > as the argument. Fix this. > > Signed-off-by: Ahmad Fatoum Reviewed-by: Marco Felsch > --- > include/driver.h | 2 +- >

[PATCH 04/18] of: partition: support of_partition_ensure_probed on parent device

2023-05-31 Thread Ahmad Fatoum
barebox-state code uses of_partition_ensure_probed to resolve the backend property. We want to allow backend to point directly at a storage device instead of a partition. We can't determine whether a DT device is a storage device though before it's probed, so let's have of_partition_ensure_probed

[PATCH 06/18] driver: add new cdev_is_partition helper

2023-05-31 Thread Ahmad Fatoum
Partitions will have cdev->master != NULL, so often code will just do if (cdev->master) to check if a cdev is a partition. This is suboptimal as it may be misinterpreted by readers as meaning that the cdev is the master device, while it's the other way round. Let's define cdev_is_partition

[PATCH 08/18] cdev: use more descriptive struct cdev::diskuuid/partuuid

2023-05-31 Thread Ahmad Fatoum
The UUID field has different meanings: For a master cdev: - GPT Header DiskGUID if GPT-formatted - MBR Header NT Disk Signature if MBR-formatted For a partition cdev: - GPT UniquePartitionGUID - MBR Header NT Disk Signature followed by "-${partititon_number}" Later code will add yet

[PATCH 10/18] cdev: have devfs_add_partition return existing identical partition, not NULL

2023-05-31 Thread Ahmad Fatoum
Starting with commit 7f9f45b9bfef ("devfs: Do not create overlapping partitions"), any overlapping is disallowed. Overlapping can be useful though to bridge the gap between partition described in DT and via on-disk partition tables. Let's handle the case of identical partitions specially and have

[PATCH 01/18] common: partitions: decouple from EFI GUID definition

2023-05-31 Thread Ahmad Fatoum
We have three UUID/GUID definitions in barebox: - efi_guid_t: for EFI GUIDs - uuid_t: for RFC 4122/DCE 1.1 (Variant 1) UUIDs - guid_t: Apparently UUIDs stored in little-endian In preparation for switching efi_guid_t to be a special case of guid_t like in Linux, let's replace non-EFI

[PATCH 18/18] state: allow lookup of barebox state partition by Type GUID

2023-05-31 Thread Ahmad Fatoum
The backend device tree property so far always pointed at a partition. Let's allow pointing it at GPT storage devices directly and lookup the correct barebox state partition by the well-known type GUID: 4778ed65-bf42-45fa-9c5b-287a1dc4aab1 Signed-off-by: Ahmad Fatoum --- common/state/state.c

[PATCH 02/18] efi: define efi_guid_t as 32-bit aligned guid_t

2023-05-31 Thread Ahmad Fatoum
Let's sync definition with Linux, so we are able to pass efi_guid_t types to function accepting guid_t. This has the added benefit of us starting to observe alignment, which may become relevant with barebox EFI on non-x86. Signed-off-by: Ahmad Fatoum --- include/efi.h | 19 +++

[PATCH 00/18] state: allow lookup of barebox state partition by Type GUID

2023-05-31 Thread Ahmad Fatoum
So far, we had basically three ways to reference barebox,state on block devices: - On platforms with device tree, we point at a fixed partition described in the DT - On platforms without device tree, we have a custom binding that does a global lookup by partuuid (or a more obscure

[PATCH 11/18] block: parse partition table on block device registration

2023-05-31 Thread Ahmad Fatoum
Every instance where we register a block device, it's followed by an attempt to parse the partition table, most often with a warning when it fails. Thus let's move partition table parsing into blockdevice_register. Signed-off-by: Ahmad Fatoum --- arch/sandbox/board/hostfile.c | 4

[PATCH 17/18] common: partitions: efi: record type UUID in cdev

2023-05-31 Thread Ahmad Fatoum
We already record DOS partition type in cdev, so let's do the same for GPT Type UUID. This will be used in a later commit to identify barebox-state partitions. Signed-off-by: Ahmad Fatoum --- common/partitions.c| 2 +- common/partitions/efi.c| 1 + common/partitions/parser.h | 5

[PATCH 05/18] of: of_path: always call of_partition_ensure_probed before resolving

2023-05-31 Thread Ahmad Fatoum
of_find_path may be called on a partition, whose parent device is not yet probed. state code solves that by calling of_partition_ensure_probed before of_find_path_by_nde, but really we should be doing that for all calls to of_find_path. Do so. Signed-off-by: Ahmad Fatoum ---

[PATCH 12/18] common: partitions: record whether disk is GPT or MBR partitioned

2023-05-31 Thread Ahmad Fatoum
Currently, the only way to differentiate between a GPT disk and a MBR one is to check whether the cdev's device has a guid (=> GPT) or a nt_signature (=> MBR) device parameter. We already have a flag parameter though, so let's record this info there for easy retrieval. We intentionally don't use

[PATCH 16/18] cdev: use cdev::dos_partition_type only if cdev_is_mbr_partitioned

2023-05-31 Thread Ahmad Fatoum
dos_partition_type == 0 can mean that either a partition is not a MBR partition or that it indeed has a partition type of 0x00. In preparation for using that field in a union, explicitly check if we have a MBR partition. Signed-off-by: Ahmad Fatoum --- common/blspec.c | 2 +- fs/fs.c |

[PATCH 14/18] of: export new of_cdev_find helper

2023-05-31 Thread Ahmad Fatoum
__of_find_path goes throught the hassle of determining the cdev, only to discard it again and return either zero or an error code. Follow up commits will need to get the cdev corresponding to a path in the DT. So let's make that easier by exporting a suitable helper function. Signed-off-by:

[PATCH 07/18] commands: stat: remove code duplication for type info

2023-05-31 Thread Ahmad Fatoum
stat prints a line with partitioning/type info for cdevs, but not all cdevs have these, so we want to skip printing when it's empty. Instead of duplicating the check, just utilize printf returning the number of characters written. Signed-off-by: Ahmad Fatoum --- fs/fs.c | 20

[PATCH 13/18] block: add cdev_is_block_(device,partition,disk) helpers

2023-05-31 Thread Ahmad Fatoum
We look too much into struct cdev's guts. Let's add helpers to make operating on block device cdevs more concise. Signed-off-by: Ahmad Fatoum --- include/block.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/block.h b/include/block.h index

[PATCH 03/18] cdev: fix for_each_cdev macro

2023-05-31 Thread Ahmad Fatoum
The macro parameter 'c' was never used, instead hardcoding cdev. It worked so far anyway, because all users of for_each_cdev used cdev as the argument. Fix this. Signed-off-by: Ahmad Fatoum --- include/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/driver.h

[PATCH 09/18] cdev: record whether partition is parsed from OF

2023-05-31 Thread Ahmad Fatoum
Later code will make it possible to define a on-disk-described partition in the DT as well. For this reason, we can't assumed DEVFS_PARTITION_FROM_TABLE to mean !DT, so let's add a dedicated flag for that. Signed-off-by: Ahmad Fatoum --- drivers/of/partition.c | 5 +++-- fs/fs.c

[PATCH 15/18] state: factor device path lookup into helper function

2023-05-31 Thread Ahmad Fatoum
The #ifdef __BAREBOX__ is meant for easier synchronization with dt-utils. We'll keep that intact, but move it out of the function to not break reading flow. After sync, dt-utils would now need to implement of_cdev_find cdev_to_devpath Signed-off-by: Ahmad Fatoum --- common/state/state.c |

[PATCH] net: phy: add driver for MotorComm PHY

2023-05-31 Thread yegorslists
From: Yegor Yefremov Signed-off-by: Yegor Yefremov --- drivers/net/phy/Kconfig | 5 ++ drivers/net/phy/Makefile| 1 + drivers/net/phy/motorcomm.c | 128 3 files changed, 134 insertions(+) create mode 100644 drivers/net/phy/motorcomm.c diff

[PATCH 2/2] commands: stat: add basic handling for cdev links

2023-05-31 Thread Ahmad Fatoum
cdev links are not symlinks and cdev_by_name will always resolve them. As the barebox stat command is a convenience for VFS developers, it's useful to have the command identify links, so let's teach it just that. There's no behavior difference between specifying -L and not. This should be rather

[PATCH 1/2] commands: stat: print symlink destination when called without -L

2023-05-31 Thread Ahmad Fatoum
This aligns behavior with usual implementations of stat. Signed-off-by: Ahmad Fatoum --- fs/fs.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/fs/fs.c b/fs/fs.c index 368458cc54f8..311571ba3088 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -130,8 +130,6 @@ void

Re: [PATCH] Revert "dma: use dma/cpu conversions correctly in dma_map/unmap_single"

2023-05-31 Thread Ahmad Fatoum
Hello Denis, On 31.05.23 15:02, Denis Orlov wrote: > Hi! > >> >> On 31.05.23 12:23, Sascha Hauer wrote: >>> This reverts commit d13d870986eeecc58d8652268557e4a159b9d4c4. >>> >>> While the patch itself is correct, it at least breaks USB on the >>> Raspberry Pi 3b. >>> >>> With this patch

Re: [PATCH] Revert "dma: use dma/cpu conversions correctly in dma_map/unmap_single"

2023-05-31 Thread Denis Orlov
Hi! > > On 31.05.23 12:23, Sascha Hauer wrote: > > This reverts commit d13d870986eeecc58d8652268557e4a159b9d4c4. > > > > While the patch itself is correct, it at least breaks USB on the > > Raspberry Pi 3b. > > > > With this patch dma_sync_single_for_device() is passed the DMA address. > > This

Re: [PATCH v2 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 14:38, Sascha Hauer wrote: > On Wed, May 31, 2023 at 01:58:33PM +0200, Ahmad Fatoum wrote: >>> From b6e5c92682467496bd9c57918996f1feffda2dd6 Mon Sep 17 00:00:00 2001 >>> From: Sascha Hauer >>> Date: Wed, 31 May 2023 11:58:51 +0200 >>> Subject: [PATCH] ARM: mmu_32: fix setting up zero

Re: [PATCH v2 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Sascha Hauer
On Wed, May 31, 2023 at 01:58:33PM +0200, Ahmad Fatoum wrote: > > From b6e5c92682467496bd9c57918996f1feffda2dd6 Mon Sep 17 00:00:00 2001 > > From: Sascha Hauer > > Date: Wed, 31 May 2023 11:58:51 +0200 > > Subject: [PATCH] ARM: mmu_32: fix setting up zero page when it is in SDRAM > > > > We used

Re: [PATCH v2 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Ahmad Fatoum
Hello Sascha, On 31.05.23 13:21, Sascha Hauer wrote: > On Wed, May 31, 2023 at 12:45:17PM +0200, Ahmad Fatoum wrote: >> On 31.05.23 12:35, Sascha Hauer wrote: >>> We used to skip setting the zero page to faulting when SDRAM starts >>> at 0x0. As bootm code now explicitly sets the zero page

Re: [PATCH v2 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Sascha Hauer
On Wed, May 31, 2023 at 12:45:17PM +0200, Ahmad Fatoum wrote: > On 31.05.23 12:35, Sascha Hauer wrote: > > We used to skip setting the zero page to faulting when SDRAM starts > > at 0x0. As bootm code now explicitly sets the zero page accessible > > before copying ATAGs there this should no longer

Re: [PATCH v2 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 12:35, Sascha Hauer wrote: > We used to skip setting the zero page to faulting when SDRAM starts > at 0x0. As bootm code now explicitly sets the zero page accessible > before copying ATAGs there this should no longer be necessary, so > unconditionally set the zero page to faulting

Re: [PATCH v2 1/2] ARM: set zero page accessible before copying ATAGs there

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 12:35, Sascha Hauer wrote: > We used skip setting up the zero page as faulting when the SDRAM > starts at 0x0. One reason for doing that was that ATAGs will be copied > there in that case. Call zero_page_access() if necessary to be able > to set the zero page to faulting during barebox

Re: [PATCH v2 1/2] scripts: omap3-usb-loader: fix heap overflow

2023-05-31 Thread Sascha Hauer
Gna, forget this. Wrong patches sent. Sascha On Wed, May 31, 2023 at 12:26:08PM +0200, Sascha Hauer wrote: > From: Ahmad Fatoum > > Newer GCC versions correctly warn that the buffer allocated by realloc > is too small. Correct the size. > > Signed-off-by: Ahmad Fatoum > Link:

[PATCH v2 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Sascha Hauer
We used to skip setting the zero page to faulting when SDRAM starts at 0x0. As bootm code now explicitly sets the zero page accessible before copying ATAGs there this should no longer be necessary, so unconditionally set the zero page to faulting during MMU startup. This also moves the zero page

[PATCH v2 1/2] ARM: set zero page accessible before copying ATAGs there

2023-05-31 Thread Sascha Hauer
We used skip setting up the zero page as faulting when the SDRAM starts at 0x0. One reason for doing that was that ATAGs will be copied there in that case. Call zero_page_access() if necessary to be able to set the zero page to faulting during barebox startup in the next step. Signed-off-by:

Re: [PATCH] Revert "dma: use dma/cpu conversions correctly in dma_map/unmap_single"

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 12:23, Sascha Hauer wrote: > This reverts commit d13d870986eeecc58d8652268557e4a159b9d4c4. > > While the patch itself is correct, it at least breaks USB on the > Raspberry Pi 3b. > > With this patch dma_sync_single_for_device() is passed the DMA address. > This is correct as even the

[PATCH v2 2/2] ARM: set zero page accessible before copying ATAGs there

2023-05-31 Thread Sascha Hauer
We used skip setting up the zero page as faulting when the SDRAM starts at 0x0. One reason for doing that was that ATAGs will be copied there in that case. Call zero_page_access() if necessary to be able to set the zero page to faulting during barebox startup in the next step. Signed-off-by:

[PATCH v2 1/2] scripts: omap3-usb-loader: fix heap overflow

2023-05-31 Thread Sascha Hauer
From: Ahmad Fatoum Newer GCC versions correctly warn that the buffer allocated by realloc is too small. Correct the size. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20230531062703.670521-3-ah...@a3f.at Signed-off-by: Sascha Hauer --- scripts/omap3-usb-loader.c | 2 +- 1 file

[PATCH] Revert "dma: use dma/cpu conversions correctly in dma_map/unmap_single"

2023-05-31 Thread Sascha Hauer
This reverts commit d13d870986eeecc58d8652268557e4a159b9d4c4. While the patch itself is correct, it at least breaks USB on the Raspberry Pi 3b. With this patch dma_sync_single_for_device() is passed the DMA address. This is correct as even the prototype suggests that it should get a dma_addr_t.

Re: [PATCH 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Ahmad Fatoum
Hello Sascha, On 31.05.23 12:01, Sascha Hauer wrote: > We used to skip setting the zero page to faulting when SDRAM starts > at 0x0. As bootm code now explicitly sets the zero page accessible > before copying ATAGs there this should no longer be necessary, so > unconditionally set the zero page

Re: [PATCH 1/2] ARM: set zero page accessible before copying ATAGs there

2023-05-31 Thread Ahmad Fatoum
On 31.05.23 12:01, Sascha Hauer wrote: > We used skip setting up the zero page as faulting when the SDRAM > starts at 0x0. One reason for doing that was that ATAGs will be copied > there in that case. Call zero_page_access() if necessary to be able > to set the zero page to faulting during barebox

[PATCH 2/2] ARM: mmu_32: fix setting up zero page when it is in SDRAM

2023-05-31 Thread Sascha Hauer
We used to skip setting the zero page to faulting when SDRAM starts at 0x0. As bootm code now explicitly sets the zero page accessible before copying ATAGs there this should no longer be necessary, so unconditionally set the zero page to faulting during MMU startup. This also moves the zero page

[PATCH 1/2] ARM: set zero page accessible before copying ATAGs there

2023-05-31 Thread Sascha Hauer
We used skip setting up the zero page as faulting when the SDRAM starts at 0x0. One reason for doing that was that ATAGs will be copied there in that case. Call zero_page_access() if necessary to be able to set the zero page to faulting during barebox startup in the next step. Signed-off-by:

Re: [PATCH v2] Porting barebox to a new SoC

2023-05-31 Thread Ahmad Fatoum
Hi Lior, On 31.05.23 10:05, Lior Weintraub wrote: > Hi Ahmad, > > Thanks again for your prompt reply and accurate tips! > Took the following changes: > 1. Increasing the DRAM size to 128MB (let barebox start from 0). > 2. Set PBL stack to offset 2MB from DRAM Just use end of SRAM, so you are

RE: [PATCH v2] Porting barebox to a new SoC

2023-05-31 Thread Lior Weintraub
Hi Ahmad, Thanks again for your prompt reply and accurate tips! Took the following changes: 1. Increasing the DRAM size to 128MB (let barebox start from 0). 2. Set PBL stack to offset 2MB from DRAM 3. Fix the device tree "memory" entry to have 128MB. 4. Load barebox-spider-mk1-evk.img to SRAM and

Re: [PATCH master 1/3] ARM: rockchip: pine64-quartz64: add sdram-init.bin to .gitignore

2023-05-31 Thread Sascha Hauer
On Wed, May 31, 2023 at 08:27:01AM +0200, Ahmad Fatoum wrote: > Other boards already have sdram-init.bin in their .gitignore, so have > quartz64 follow suit. > > Signed-off-by: Ahmad Fatoum > --- > arch/arm/boards/pine64-quartz64/.gitignore | 1 + > 1 file changed, 1 insertion(+) > create mode

Re: [PATCH 1/2] efi: payload: iomem: add commented out #define DEBUG 1

2023-05-31 Thread Sascha Hauer
On Wed, May 31, 2023 at 12:38:20AM +0900, Masahiro Yamada wrote: > On Tue, May 30, 2023 at 9:38 PM Sascha Hauer wrote: > > > > Picked some outdated address from Masahiro, so once again: > > > The macro name is misleading - perhaps, it should have > been named as __is_defined_as_1(). > > I do

[PATCH] regulator: core: add debug print for regulator_resolve_supply

2023-05-31 Thread Ahmad Fatoum
Starting with commit 324bd9bbe7e8 ("regulator: recursively enable/disable regulator dependency tree"), regulator operations may affect more than just the one regulator being enabled. Place a debug print, so it's easier to follow the dependency chain. Signed-off-by: Ahmad Fatoum ---

[PATCH 1/3] include: sync min/max definitions with Linux

2023-05-31 Thread Ahmad Fatoum
By syncing to Linux, min/max and friends now return constant expressions if possible, which makes them suitable for use as non-VLA array length. Signed-off-by: Ahmad Fatoum --- include/linux/const.h | 9 +++ include/linux/kernel.h | 123 +- include/linux/minmax.h

[PATCH 3/3] string: import strverscmp_improved from systemd

2023-05-31 Thread Ahmad Fatoum
The Boot Loader specification now references the UAPI group's version format specification[1] on how blspec entries should be sorted. In preparation of aligning barebox entry sorting with the specification, import systemd's strverscmp_improved as strverscmp and add some tests for it. The

[PATCH 2/3] include: minmax.h: implement compare3 helper

2023-05-31 Thread Ahmad Fatoum
Define the macro for use in comparison functions. The macro has the same semantics as systemd's CMP() macro with the difference that it returns constant expressions if possible. Signed-off-by: Ahmad Fatoum --- include/linux/minmax.h | 20 1 file changed, 20 insertions(+)

[PATCH 0/3] string: import strverscmp_improved from systemd

2023-05-31 Thread Ahmad Fatoum
The Boot Loader specification now references the UAPI group's version format specification[1] on how blspec entries should be sorted. In preparation of aligning barebox entry sorting with the specification, import systemd's strverscmp_improved as strverscmp and add some tests for it. The changes

[PATCH master 3/3] scripts: omap3-usb-loader: fix heap overflow

2023-05-31 Thread Ahmad Fatoum
Newer GCC versions correctly warn that the buffer allocated by realloc is too small. Correct the size. Signed-off-by: Ahmad Fatoum --- scripts/omap3-usb-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/omap3-usb-loader.c b/scripts/omap3-usb-loader.c index

[PATCH master 1/3] ARM: rockchip: pine64-quartz64: add sdram-init.bin to .gitignore

2023-05-31 Thread Ahmad Fatoum
Other boards already have sdram-init.bin in their .gitignore, so have quartz64 follow suit. Signed-off-by: Ahmad Fatoum --- arch/arm/boards/pine64-quartz64/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 arch/arm/boards/pine64-quartz64/.gitignore diff --git

[PATCH master 2/3] scripts: kwbimage: check return value of asprintf

2023-05-31 Thread Ahmad Fatoum
Some newer toolchains defines asprintf with a must_check attribute, leading to warnings when compiling kwbimage. Let's handle OOM gracefully to get rid of the warnings. Signed-off-by: Ahmad Fatoum --- scripts/kwbimage.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff

Re: [PATCH v2] Porting barebox to a new SoC

2023-05-31 Thread Ahmad Fatoum
Hi Lior, On 30.05.23 22:10, Lior Weintraub wrote: > Hello Ahmad, > > Thanks again for your kind support! > Your comments helped me progress and the current situation is as follows: > Our QEMU Spider machine is running a BL1.elf file using the following command: > QEMU_AUDIO_DRV=none