[PATCH 4/5] ARM: rpi: add machine-id support

2023-02-06 Thread Daniel Brát
Pass board's serial number as hashable for machine-id generation and enable machine-id support for rpi platform by default. Signed-off-by: Daniel Brát --- arch/arm/boards/raspberry-pi/rpi-common.c | 4 arch/arm/configs/rpi_defconfig| 1 + arch/arm/configs/rpi_v8a_defconfig

[PATCH 2/5] ARM: rpi: add serial number readout

2023-02-06 Thread Daniel Brát
Remove querying for serial-number node from vc fdt, since it's not guaranteed to always be there (older firmwares dont provide it). Instead, retrieve board's serial number via the mbox api. Signed-off-by: Daniel Brát --- arch/arm/boards/raspberry-pi/lowlevel.h | 1 + arch/arm/boards

[PATCH 3/5] ARM: rpi: rework rpi board init code

2023-02-06 Thread Daniel Brát
the board init code from 'late_platform_driver' to 'coredevice_platform_driver' which in turn ment calling 'rpi_env_init' from separate late_initcall. Signed-off-by: Daniel Brát --- arch/arm/boards/raspberry-pi/rpi-common.c | 414 ++ arch/arm/dts/bcm2711-rpi-4.dts| 5

[PATCH 5/5] ARM: rpi: enable reset source detection in defconfig

2023-02-06 Thread Daniel Brát
Raspberry pi platform code added reset cause readout several patches back, so enable it in the rpi defconfigs. Signed-off-by: Daniel Brát --- arch/arm/configs/rpi_defconfig | 1 + arch/arm/configs/rpi_v8a_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs

[PATCH 1/5] ARM: rpi: rename function getting mac address

2023-02-06 Thread Daniel Brát
Rename 'rpi_set_usbethaddr' and 'rpi_get_usbethaddr' to more generic 'rpi_set_ethaddr' and 'rpi_get_ethaddr', since they can also be used to obtain factory assigned mac address on bcm2711 (rpi4), which uses bcmgenet nic instead of usb ethernet nic. Signed-off-by: Daniel Brát --- arch/arm/boards

[PATCH 0/5] rpi: platform code improvements

2023-02-06 Thread Daniel Brát
This series focuses mainly on init handling of rpi board variants. Init of ethernet, usb and leds for known variants is generalized and serial number and machin-id support is added. This series also allows bcmgenet ethernet driver to use the hw-assigned mac address on bcm2711 based boards. Daniel

[PATCH v2] image-fit: use real size of fit image

2022-07-29 Thread Daniel Brát
at the moment (so it has headroom for possible future image size changes). This modification uses the fdt header field 'totalsize' to read-in only what is needed. Signed-off-by: Daniel Brát --- v2: use fdt32_to_cpu to read the totalsize from header --- common/image-fit.c | 27 --- 1

[PATCH] i2c: bcm283x: fix ending of transfer in case of NACK

2022-07-20 Thread Daniel Brát
Fixes an issue where the driver in case of NACK error would not properly terminate the tranfer, resulting in BSC not sending the STOP condition until just before the next xfer. Signed-off-by: Daniel Brát --- drivers/i2c/busses/i2c-bcm283x.c | 23 +++ 1 file changed, 15

[PATCH] image-fit: use real size of fit image

2022-07-18 Thread Daniel Brát
at the moment (so it has headroom for possible future image size changes). This modification uses the fdt header field 'totalsize' to read-in only what is needed. Signed-off-by: Daniel Brát --- common/image-fit.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git

[PATCH] ARM: rpi: cleanup parsing of vc fdt

2022-06-21 Thread Daniel Brát
Refactoring and cleanup of vc fdt parsing based on advice from Ahmad Fatoum. Signed-off-by: Daniel Brát --- I originally wanted to send these as part of v5 of 'ARM: rpi: parse useful data from vc fdt' patch, but you were quicker with accepting the v4 :) Hope that's not a problem. arch/arm

[PATCH v4] ARM: rpi: parse useful data from vc fdt

2022-06-17 Thread Daniel Brát
in case of some errors, since the fdt from vc is now optional for barebox's basic function. Signed-off-by: Daniel Brát --- arch/arm/boards/raspberry-pi/rpi-common.c | 183 +- drivers/watchdog/bcm2835_wdt.c| 23 +-- include/soc/bcm283x/wdt.h | 40

Re: [PATCH 2/2] treewide: Simplify setenv() calls

2022-06-17 Thread Daniel Brát
Since this patch, I am getting a bunch of 'warning: format not a string literal and no format arguments [-Wformat-security]' warnings when compiling for aarch64 rpi. I am using 'aarch64-linux-gnu-gcc 7.5.0' on Ubuntu 18.04. Full compmpile log: https://pastebin.com/iCsBJbXU

[PATCH v2] i2c: add bcm283x i2c host controller support

2022-06-15 Thread Daniel Brát
Add a driver to support the i2c host controller (BSC) found in Broadcom's bcm283x family of SoCs (used by rpi boards). Signed-off-by: Daniel Brát --- arch/arm/configs/rpi_defconfig | 3 +- arch/arm/configs/rpi_v8a_defconfig | 3 +- drivers/i2c/busses/Kconfig | 4 + drivers/i2c

[PATCH v3] ARM: rpi: parse useful data from vc fdt

2022-06-15 Thread Daniel Brát
in case of some errors, since the fdt from vc is now optional for barebox's basic function. Signed-off-by: Daniel Brát --- arch/arm/boards/raspberry-pi/rpi-common.c | 167 -- drivers/watchdog/bcm2835_wdt.c| 23 +-- include/soc/bcm283x/wdt.h | 40

[PATCH v2] ARM: rpi: parse useful data from vc fdt

2022-06-13 Thread Daniel Brát
in case of some errors, since the fdt from vc is now optional for barebox's basic function. Signed-off-by: Daniel Brát --- arch/arm/boards/raspberry-pi/rpi-common.c | 200 +- drivers/watchdog/bcm2835_wdt.c| 23 +-- include/soc/bcm283x/wdt.h | 40

[PATCH] i2c: add bcm283x i2c host controller support

2022-06-11 Thread Daniel Brát
Add a driver to support the i2c host controller (BSC) found on bcm283x family os SoCs. Signed-off-by: Daniel Brát --- arch/arm/configs/rpi_v8a_defconfig | 3 +- drivers/i2c/busses/Kconfig | 4 + drivers/i2c/busses/Makefile| 1 + drivers/i2c/busses/i2c-bcm283x.c | 372

[PATCH] ARM: rpi: parse useful data from vc fdt

2022-06-11 Thread Daniel Brát
vc is now optional for barebox's basic function. Signed-off-by: Daniel Brát --- arch/arm/boards/raspberry-pi/rpi-common.c | 155 -- drivers/watchdog/bcm2835_wdt.c| 23 +--- drivers/watchdog/bcm2835_wdt.h| 40 ++ 3 files changed, 153 insertions

[PATCH] ARM: DTS: make rpi3/4 use pl011 uart as primary

2022-06-11 Thread Daniel Brát
' to the config, but since barebox has drivers for the pl011 full-fledged UART, lets just make barebox use it instead. Signed-off-by: Daniel Brát --- arch/arm/dts/bcm2711-rpi-4.dts | 8 +--- arch/arm/dts/bcm2837-rpi-3.dts | 2 ++ arch/arm/dts/rpi-use-pl011-uart.dtsi | 24

Re: [PATCH 1/2 v2] usb: dwc2: Make having a phy optional

2021-10-20 Thread Daniel Brát
Hi Jules, On Tue, 19 Oct 2021 18:16:54 +0200, Jules Maselbas wrote: > I am interested in getting this modification merged. Beside I don't > think the dwc2 driver modification is needed, as phy_optional_get is > intended to return NULL when no phy are available. For me it makes > sense that NULL

[PATCH] phy: core: Make 'phy_optional_get' return NULL when not implemented

2021-10-20 Thread Daniel Brát
its probe function despite being able to function without a phy just fine. Signed-off-by: Daniel Brát --- include/linux/phy/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 679ce6e42..321e546f9 100644 --- a/include

[PATCH v2] ARM: rpi_defconfig: Enable PHY core for dwc2 USB driver

2021-10-20 Thread Daniel Brát
Enable PHY core and USB NOP PHY driver in rpi_defconfig since the already enabled dwc2 usb driver uses it. Signed-off-by: Daniel Brát --- arch/arm/configs/rpi_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/rpi_defconfig b/arch/arm/configs/rpi_defconfig index

[PATCH 1/2 v2] usb: dwc2: Make having a phy optional

2021-09-08 Thread Daniel Brát
. The header stub of 'phy_optional_get' was changed to return NULL and the dwc2 driver was modified accordingly. Signed-off-by: Daniel Brát --- drivers/usb/dwc2/dwc2.c | 27 +++ include/linux/phy/phy.h | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git

[PATCH 2/2] ARM: rpi_defconfig: Enable PHY core for dwc2 usb driver

2021-09-08 Thread Daniel Brát
The Raspbery Pi device tree defines 'usb2_phy' optionally used by the dwc2 usb driver, so lets enable PHY core for it in the defconfig. Signed-off-by: Daniel Brát --- arch/arm/configs/rpi_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/rpi_defconfig b/arch/arm

[PATCH 1/2] usb: dwc2: Make having a phy optional

2021-09-08 Thread Daniel Brát
. Since the 'dwc2->phy' is optional, the driver was modified to reflect this. Tested working on Raspberry Pi 3B+. Signed-off-by: Daniel Brát --- drivers/usb/dwc2/dwc2.c | 38 ++ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/usb/dwc2/dwc2.

[PATCH 0/2] usb: dwc2: fix phy dependecy

2021-09-08 Thread Daniel Brát
I had problems getting USB working on my Raspberry Pi 3B+. I tracked the problem down to the dwc2 driver failing in its probe function due to CONFIG_GENERIC_PHY not enabled. I fixed the phy dependency in dwc2 and also enabled phy core in rpi_defconfig. Daniel Brát (2): usb: dwc2: Make having

[PATCH] video: Fix broken bcm2835 fb driver

2021-09-07 Thread Daniel Brát
on due to it being filled with garbage data. The offset by which to convert the address back can vary by device, so the value is read from devicetree 'dma-ranges' for somewhat portable operation. This fix was tested on Raspberry PI B+ and Raspberry PI 3B+. Signed-off-by: Daniel Brát --- drivers