[PATCH v2 1/1] kbuild: dtc: Allow adding device tree fragments via config

2021-09-22 Thread Trent Piepho
This introduces a config variable that allows adding additional fragments to the Barebox device tree(s). Example uses are adjusting the flash partition layout, adding barebox state variables, or adding an I2C device. These can be now be done with build configuration only, without needing to patch

Re: [PATCH 3/5] Documentation: boards: at91: remove done TODOs

2021-09-22 Thread Sam Ravnborg
Hi Ahmad, On Wed, Sep 22, 2021 at 08:49:59AM +0200, Ahmad Fatoum wrote: > All DT-enabled boards are now in the at91_multi_defconfig. > The SAMA5 ones also generate first stage bootloaders with the same > config. > > Cc: Sam Ravnborg > Signed-off-by: Ahmad Fatoum Nice to see the continued progr

Re: [PATCH] ARM: at91: sama5d27_som1_ek: populate MAC address from EEPROM

2021-09-22 Thread Ahmad Fatoum
Hello Sascha, On 22.06.21 10:08, Ahmad Fatoum wrote: > With the latest NVMEM enhancements merged, barebox networking core now > always consults NVMEM cells referenced in the network controller > device tree node before it falls back to randomizing a new address. > > The SAM5D27-SOM1 has a 256 byt

Re: [PATCH 2/2] pinctrl: bcm2835: Add support for bcm2711

2021-09-22 Thread Ahmad Fatoum
On 17.09.21 11:41, Uwe Kleine-König wrote: > From: Ahmad Fatoum > > bcm2711-rpi-4-b.dts lists 58 gpio names and the linux driver also uses > 58 GPIOs for bcm2711. Signed-off-by: Ahmad Fatoum > Signed-off-by: Uwe Kleine-König > --- > drivers/pinctrl/pinctrl-bcm2835.c | 22

Re: [PATCH 1/2] pinctrl: bcm2835: Probe driver earlier

2021-09-22 Thread Ahmad Fatoum
On 17.09.21 11:41, Uwe Kleine-König wrote: > From: Ahmad Fatoum > > coredevice is too late for the console driver and all other pinctrl drivers > are using "core", too. Signed-off-by: Ahmad Fatoum > > Signed-off-by: Uwe Kleine-König > --- > drivers/pinctrl/pinctrl-bcm2835.c | 2 +- > 1 file

Re: [PATCH 2/2] pinctrl: bcm2835: Add support for bcm2711

2021-09-22 Thread Roland Hieber
On Fri, Sep 17, 2021 at 11:41:52AM +0200, Uwe Kleine-König wrote: > From: Ahmad Fatoum > > bcm2711-rpi-4-b.dts lists 58 gpio names and the linux driver also uses > 58 GPIOs for bcm2711. > > Signed-off-by: Uwe Kleine-König Ahmad's S-o-b is missing on both. - Roland > --- > drivers/pinctrl/p

[PATCH v2] Documentation: reboot-mode: add note about /env/bmode

2021-09-22 Thread Ahmad Fatoum
This directory is an optional part of the defaultenv-2 and is documented there. There should be a sentence about it in the reboot-mode docs as well, because users can add it to their environments as well to avoid doing if-else chains in the init scripts. Signed-off-by: Ahmad Fatoum --- v1 -> v2:

[PATCH master] power: reset: nvmem-reboot-mode: disable device tree fixup

2021-09-22 Thread Ahmad Fatoum
Fixing up the nvmem reboot device tree node is problematic, because it contains a phandle to another node. Take the easy way out for now and expect user to provide matching reboot-mode nodes in both kernel and barebox device tree manually. Signed-off-by: Ahmad Fatoum --- drivers/power/reset/nvme

[PATCH] Documentation: reboot-mode: add note about /env/bmode

2021-09-22 Thread Ahmad Fatoum
This directly is optional part of the defaultenv-2 and is documented there. There should be a sentence about it in the reboot-mode docs as well. Signed-off-by: Ahmad Fatoum --- Documentation/user/defaultenv-2.rst | 2 +- Documentation/user/reboot-mode.rst | 4 +++- 2 files changed, 4 insertions

Re: [PATCH] kbuild: dtc: Allow adding device tree fragments via config

2021-09-22 Thread Ahmad Fatoum
Hi, On 20.09.21 22:43, Trent Piepho wrote: > On Mon, Sep 20, 2021 at 2:02 AM Ahmad Fatoum wrote: >> > Preprocessing the dts file gains another layer, where a generated dts > source consisting of an include directive for the original dts source is > followed by more includes for each f

Re: at91 sama5d3 "regressions"

2021-09-22 Thread Peter Rosin
Hi, On 2021-09-22 09:06, Ahmad Fatoum wrote: > On 19.09.21 08:32, Peter Rosin wrote: >> However, the above also means that the quotes around the >> "regressions" word in the subject can be removed. The problems >> are squarely in the upstream code base, and I do need fixes >> for region overlap, e

[PATCH master 2/2] common: menutree: prevent read of uninitialized memory in error path

2021-09-22 Thread Ahmad Fatoum
globfree() is a no-op if glob_t::gl_pathv is NULL. A failed glob may not always initialize this member however, leading to potential memory corruption. Fix this by initializing glob_t. Signed-off-by: Ahmad Fatoum --- common/menutree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH master 1/2] startup: don't read glob_t if glob("/env/init/*") fails

2021-09-22 Thread Ahmad Fatoum
globfree() is a no-op if glob_t::gl_pathv is NULL. A failed glob may not always initialize this member however, leading to potential memory corruption. Fix this by only freeing the glob_t if glob() had succeeded. Signed-off-by: Ahmad Fatoum --- common/startup.c | 4 ++-- 1 file changed, 2 inser

Re: at91 sama5d3 "regressions"

2021-09-22 Thread Ahmad Fatoum
Hi, On 19.09.21 08:32, Peter Rosin wrote: > On 2021-09-18 01:57, Peter Rosin wrote: >> On 2021-09-18 00:37, Peter Rosin wrote: >>> Hi! >>> >>> I have old boards that I'm trying to get up to current >>> revisions of various pieces of software, and I'm running >>> into a couple of problems with bare

[PATCH 0/5] ARM: at91: sama5d3_xplained: migrate to DT

2021-09-22 Thread Ahmad Fatoum
We have one other DT-enabled SAMA5D3 board already: microchip-ksz8477-evb, which is basically a sama5d3 xplained in different form factor and with a switch. Mimic what we do there to get rid of the sama5d3 board code. Tested booting first/second stage on SD and second stage after at91bootstrap on

[PATCH master 1/5] fs: fat: pbl: support >32M alignment for first partition

2021-09-22 Thread Ahmad Fatoum
The LBA of the first absolute sector in a partition is a 32-bit field at offset 0x8 of a partition entry. The first such partition entry is at offset 446 of the MBR. The DOS partition parser adheres to this scheme, but the FAT code contains a very basic partition parser as well that kicks in when

[PATCH master 2/5] ARM: at91: at91sam9263ek: add device tree check for board code

2021-09-22 Thread Ahmad Fatoum
Most board code is guarded by a compatible check, but not add_smc_devices(). Remedy this. Signed-off-by: Ahmad Fatoum --- arch/arm/boards/at91sam9263ek/of_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boards/at91sam9263ek/of_init.c b/arch/arm/boards/at91sam9263ek/of_ini

[PATCH 5/5] ARM: AT91: migrate sama5d3-xplained to DT

2021-09-22 Thread Ahmad Fatoum
We have one other DT-enabled SAMA5D3 board already: microchip-ksz8477-evb, which is basically a sama5d3 xplained in different form factor and with a switch. Mimic what we do there to get rid of the sama5d3 board code. Unlike the microchip-ksz9477-evb, the barebox support for this board includes NA

[PATCH 3/5] Documentation: boards: at91: remove done TODOs

2021-09-22 Thread Ahmad Fatoum
All DT-enabled boards are now in the at91_multi_defconfig. The SAMA5 ones also generate first stage bootloaders with the same config. Cc: Sam Ravnborg Signed-off-by: Ahmad Fatoum --- Documentation/boards/at91.rst | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a

[PATCH 4/5] ARM: at91: sam9_smc: register driver earlier

2021-09-22 Thread Ahmad Fatoum
The driver probe only depends on the device's resources, so there is no need to delay registration to coredevice_platform_driver. The way the AT91 code is structured is that: - board code adds SMC device (not probed from DT, so no deep probe) - SMC driver probe runs and stores regions - boar