Re: [PATCH v3 2/4] rockchip: rk-3399: rock-pi-4: dts: Add XTX SPI NOR 4MiB Flash chip in Rock Pi 4 boards from rev 1.4 on.

2022-08-26 Thread Kever Yang



On 2022/7/20 23:41, Xavier Drudis Ferran wrote:

Configure Rock Pi 4 to boot from SPI NOR Flash.

Based on flash chip, board documentation and tests, this is the
fastest I could use it.

This seems to be the minimum necessary configuration for Rock Pi 4 to
be able to boot from SPI NOR Flash.

With the next patch, it works to sf probe 1:0, sf read, sf erase, sf
write, sf read and then boot linux and flashrom can write to
it. Sometimes flashrom seems to fail to write when at U-Boot stage
there was no sf read or write, not sure why. Might work better after
a little while off power.

Note: It seems to work with or without CONFIG_SPL_SPI_FLASH_TINY If I
   disable it, and enable CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT I have
   to increase CONFIG_SPL_MAX_SIZE (I set it to 0x2e800) because
   the SPL grew over 1200 bytes bigger. It might work better, or
   just be chance, but it boots from SPI 0.3s slower. So I leave
   this out of this patch.

Changed since v2:

 - added CONFIG_SPL_DM_SEQ_ALIAS to keep spi1 numeration consistent
   between SPL and U-Boot

Changed since v1:

 - include CONFIG_SF_DEFAULT_BUS=1 now that numeration
   will be unified between U-Boot and SPL (at patch 5/5)
  
Cc: Simon Glass 

Cc: Philipp Tomsich 
Cc: Kever Yang 

Signed-off-by: Xavier Drudis Ferran 


Reviewed-by: Kever Yang 

Thanks,
- Kever

---
  arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi | 18 ++
  configs/rock-pi-4-rk3399_defconfig| 22 ++
  2 files changed, 40 insertions(+)

diff --git a/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi 
b/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi
index c17e769f64..4c2fe8f6bc 100644
--- a/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi
@@ -15,3 +15,21 @@
  _log {
regulator-init-microvolt = <95>;
  };
+
+ {
+   status = "okay";
+   spi-max-frequency = <4000>;
+   spi-activate-delay = <12000>; /* 12 ms */
+
+   norflash: flash@0 {
+   compatible = "rockchip,spidev", "jedec,spi-nor";
+   reg = <0>;
+
+   spi-max-frequency = <4000>;
+   spi-cpha;
+   spi-cpol;
+
+   status = "okay";
+   u-boot,dm-pre-reloc;
+   };
+};
diff --git a/configs/rock-pi-4-rk3399_defconfig 
b/configs/rock-pi-4-rk3399_defconfig
index cf2e9fbde3..d5fadcb64f 100644
--- a/configs/rock-pi-4-rk3399_defconfig
+++ b/configs/rock-pi-4-rk3399_defconfig
@@ -10,6 +10,8 @@ CONFIG_ROCKCHIP_RK3399=y
  CONFIG_TARGET_EVB_RK3399=y
  CONFIG_DEBUG_UART_BASE=0xFF1A
  CONFIG_DEBUG_UART_CLOCK=2400
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
  CONFIG_SYS_LOAD_ADDR=0x800800
  CONFIG_DEBUG_UART=y
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
@@ -28,6 +30,10 @@ CONFIG_SPL_BSS_MAX_SIZE=0x2000
  CONFIG_SPL_STACK=0x40
  CONFIG_SPL_STACK_R=y
  CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x1
+CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_SPI_FLASH_MTD=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0xb
  CONFIG_TPL=y
  CONFIG_CMD_BOOTZ=y
  CONFIG_CMD_GPT=y
@@ -40,6 +46,7 @@ CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent 
assigned-clocks assigned-clock-rates assigned-clock-parents"
  CONFIG_ENV_IS_IN_MMC=y
  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
  CONFIG_ROCKCHIP_GPIO=y
  CONFIG_SYS_I2C_ROCKCHIP=y
  CONFIG_MISC=y
@@ -48,21 +55,36 @@ CONFIG_MMC_DW=y
  CONFIG_MMC_DW_ROCKCHIP=y
  CONFIG_MMC_SDHCI=y
  CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_SF_DEFAULT_BUS=1
+CONFIG_SF_DEFAULT_MODE=0x3
+CONFIG_SF_DEFAULT_SPEED=4000
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_SOFT_RESET=y
+CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
+CONFIG_SPI_FLASH_XTX=y
+CONFIG_SPI_FLASH_MTD=y
  CONFIG_DM_ETH=y
  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
  CONFIG_NVME_PCI=y
  CONFIG_PCI=y
+CONFIG_SPL_PHY=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y
  CONFIG_PHY_ROCKCHIP_TYPEC=y
+CONFIG_DM_PMIC_FAN53555=y
  CONFIG_PMIC_RK8XX=y
  CONFIG_REGULATOR_PWM=y
+CONFIG_SPL_REGULATOR_PWM=y
+CONFIG_DM_REGULATOR_GPIO=y
  CONFIG_REGULATOR_RK8XX=y
  CONFIG_PWM_ROCKCHIP=y
  CONFIG_RAM_RK3399_LPDDR4=y
  CONFIG_DM_RESET=y
  CONFIG_BAUDRATE=150
  CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_ROCKCHIP_SPI=y
  CONFIG_SYSRESET=y
  CONFIG_USB=y
  CONFIG_USB_XHCI_HCD=y


Re: [PATCH 2/2] rockchip: rk3399: sync spl_boot_devices_tbl and boot_devices node paths

2022-08-26 Thread Kever Yang



On 2022/7/15 23:15, Quentin Schulz wrote:

From: Quentin Schulz 

While technically not a bug, let's have some consistency in paths
returned by u-boot,spl-boot-order look-up and the one saved in
u-boot,spl-boot-device by syncing spl_boot_devices_tbl and boot_devices
node paths.

Cc: Quentin Schulz 
Signed-off-by: Quentin Schulz 


Reviewed-by: Kever Yang 

Thanks,
- Kever

---
  arch/arm/mach-rockchip/rk3399/rk3399.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c 
b/arch/arm/mach-rockchip/rk3399/rk3399.c
index f280cb1dbf..7147dc09f5 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -182,7 +182,7 @@ const char *spl_decode_boot_device(u32 boot_device)
} spl_boot_devices_tbl[] = {
{ BOOT_DEVICE_MMC2, "/mmc@fe32" },
{ BOOT_DEVICE_MMC1, "/mmc@fe33" },
-   { BOOT_DEVICE_SPI, "/spi@ff1d" },
+   { BOOT_DEVICE_SPI, "/spi@ff1d/flash@0" },
};
  
  	for (i = 0; i < ARRAY_SIZE(spl_boot_devices_tbl); ++i)


Re: [PATCH 1/2] rockchip: rk3399: fix incorrect boot-device in u-boot,spl-boot-device

2022-08-26 Thread Kever Yang



On 2022/7/15 23:15, Quentin Schulz wrote:

From: Quentin Schulz 

On RK3399, mmc0 is eMMC and mmc1 is SD card, c.f. console:
MMC:   mmc@fe32: 1, mmc@fe33: 0

In arch/arm/mach-rockchip/spl-boot-order.c:board_boot_order, the
boot_device (BOOT_DEVICE_*) value is gotten from spl_node_to_boot_device
function. Said function returns BOOT_DEVICE_MMC1 for mmc0 (eMMC) and
BOOT_DEVICE_MMC2 for mmc1 (SD card).

Since the SD card controller is at mmc@fe32, it should be associated
with BOOT_DEVICE_MMC2 and not BOOT_DEVICE_MMC1. Same applies to eMMC.

Let's fix that by swapping the two BOOT_DEVICEs.

Cc: Quentin Schulz 
Signed-off-by: Quentin Schulz 


Reviewed-by: Kever Yang 

Thanks,
- Kever

---
  arch/arm/mach-rockchip/rk3399/rk3399.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c 
b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 691d69dc59..f280cb1dbf 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -180,8 +180,8 @@ const char *spl_decode_boot_device(u32 boot_device)
u32 boot_device;
const char *ofpath;
} spl_boot_devices_tbl[] = {
-   { BOOT_DEVICE_MMC1, "/mmc@fe32" },
-   { BOOT_DEVICE_MMC2, "/mmc@fe33" },
+   { BOOT_DEVICE_MMC2, "/mmc@fe32" },
+   { BOOT_DEVICE_MMC1, "/mmc@fe33" },
{ BOOT_DEVICE_SPI, "/spi@ff1d" },
};
  


Re: [PATCH v2 5/5] rockchip: rock-pi-4: dts: spi: Make the index of the spi flash the same in SPL and U-Boot proper

2022-08-26 Thread Kever Yang

Hi Michal, Quentin, Xavier,


On 2022/7/18 21:01, Quentin Schulz wrote:

Hi Michal,

On 7/18/22 13:00, Michal Suchánek wrote:

On Mon, Jul 18, 2022 at 11:09:56AM +0200, Xavier Drudis Ferran wrote:

El Mon, Jul 18, 2022 at 10:33:18AM +0200, Quentin Schulz deia:

Hi Xavier,

On 7/15/22 18:30, Xavier Drudis Ferran wrote:
Spi0 is not needed in SPL and SPL could be a little smaller 
without it,

but then the SF_DEFAULT_BOOT would have to be 0 to refer to spi1, and
that's confusing, because once U-Boot proper runs, it numbers the 
bus 1.


Add spi0 to the pre-reloc and spl trees so that the flash is always
connected to bus 1.



Mmmm... Could we instead make U-Boot use the bus number from the 
alias in
the aliases DT node? I think the mmc subsystem does this already 
and it
would mean we don't need to enable unnecessary devices. Also, 
relying on

boot order for the bus number is brittle in Linux, I don't know about
U-Boot, but if we can avoid this assumption, it'd be great :)

See: 
https://urldefense.proofpoint.com/v2/url?u=https-3A__source.denx.de_u-2Dboot_u-2Dboot_-2D_commit_2243d19e5618122d9d7aba23eb51f63f2719dba5=DwIBAg=_sEr5x9kUWhuk4_nFwjJtA=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t=G-LrZmlVXqwFFza02frCo5F8vUCol4vDYe6RpSOpezwdgWuNQZyIB2hF_SNO4Gz3=O9wEK10SUOQNv_9zcY0K2oSdD_soaQtgjga-pw9nAgY=

for how to do it today?



Maybe I should just drop this patch and try to define
CONFIG_SPL_DM_SEQ_ALIAS in configs/rock-pi-4-rk3399 instead ?
Let me test this a little...

I have CONFIG_DM_SEQ_ALIAS=y but   CONFIG_SPL_DM_SEQ_ALIAS unset.



Your patch series got sent with each commit in their individual thread


I know. Sorry for the lapsus. I did it right in v1, wrong in v2, and 
will do right in v3.


What is actually the correct naming here?

We have in arch/arm/mach-rockchip/rk3399/rk3399.c

const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
 [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe33",
 [BROM_BOOTSOURCE_SPINOR] = "/spi@ff1d/flash@0",
 [BROM_BOOTSOURCE_SD] = "/mmc@fe32",
};

 } spl_boot_devices_tbl[] = {
 { BOOT_DEVICE_MMC1, "/mmc@fe32" },
 { BOOT_DEVICE_MMC2, "/sdhci@fe33" },
 { BOOT_DEVICE_SPI, "/spi@ff1d" },
 };



This one was incorrect for boards not redefining the aliases nodes for 
mmc devices from rk3399-u-boot.dtsi and I've sent a patch for it:
https://lore.kernel.org/u-boot/20220715151552.953654-1-foss+ub...@0leil.net/ 




which then presumably gets converted in common/spl/spl_mmc.c

SPL_LOAD_IMAGE_METHOD("MMC1", 0, BOOT_DEVICE_MMC1, spl_mmc_load_image);
SPL_LOAD_IMAGE_METHOD("MMC2", 0, BOOT_DEVICE_MMC2, spl_mmc_load_image);
SPL_LOAD_IMAGE_METHOD("MMC2_2", 0, BOOT_DEVICE_MMC2_2, 
spl_mmc_load_image);




I actually think from spl_mmc_get_device_index()?


We then have this in rk3399.dtsi:

 sdio0: mmc@fe31 {
 compatible = "rockchip,rk3399-dw-mshc",

 sdmmc: mmc@fe32 {
 compatible = "rockchip,rk3399-dw-mshc",

 sdhci: mmc@fe33 {
 compatible = "rockchip,rk3399-sdhci-5.1", 
"arasan,sdhci-5.1";


and this in rk3399-u-boot.dtsi

 mmc0 = 
 mmc1 = 

and this in arch/arm/dts/rk3399-pinebook-pro.dts

 aliases {
 mmc0 = 
 mmc1 = 
 mmc2 = 
 };


mmc@fe31: 3
mmc@fe32: 1 (SD)
mmc@fe33: 0 (eMMC)

This is not consistent with any of the above.


For the boot sequence in SPL and U-Boot proper, two issue here:

1. mmc index

    There is no alias for mmc few years ago when we add alias for mmc 
in U-Boot, we would like to make the boot order like this:


SDMMC -> eMMC

  And SDIO is not in consideration because it's not storage in most 
case, we add alias for mmc so that we can use the boot script in 
include/configs/rockchip-common.h to get the Fixed boot order:


/* First try to boot from SD (index 1), then eMMC (index 0) */

    The SD card is removable and easy to replace, and not easy to break 
the board system, it's better to boot from SD card if there is available 
firmware inside.


    And after this rule in U-Boot works with boot script and mmc alias 
in -u-boot.dtsi, the kernel also add the alias without consideration for 
the boot order, then we can see the difference in u-boot dts now.



2. boot order in SPL and U-Boot proper

    For SPL, it's recommend to follow the BootRom boot device, because 
the loader until U-Boot usually in the same storage media;


    For U-Boot proper, it's per board different:

- for most SBC and product, it only support eMMC and SD, we would like 
to boot from SD card first so that we can upgrade the firmware to eMMC;


- for device with SPI, system will boot from SPI in loader stage, and 
boot from eMMC or NvMe in U-Boot proper for OS;



Hope the information is enough for you.


Thanks,
- Kever


Re: [PATCH] rockchip: rk3308: fix same-as-spl boot order

2022-08-26 Thread Kever Yang



On 2022/7/14 22:18, John Keeping wrote:

Rockchip SoCs need the boot_devices array defined in order to map the
bootloader's value to a U-Boot device.  Implement this for rk3308.

Signed-off-by: John Keeping 


Reviewed-by: Kever Yang 

Thanks,
- Kever

---
  arch/arm/mach-rockchip/rk3308/rk3308.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3308/rk3308.c 
b/arch/arm/mach-rockchip/rk3308/rk3308.c
index 70fe0d0ac3..dd9109b7c3 100644
--- a/arch/arm/mach-rockchip/rk3308/rk3308.c
+++ b/arch/arm/mach-rockchip/rk3308/rk3308.c
@@ -8,6 +8,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -142,6 +143,11 @@ enum {
  
  #define GPIO0_A4	4
  
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {

+   [BROM_BOOTSOURCE_EMMC] = "/mmc@ff49",
+   [BROM_BOOTSOURCE_SD] = "/mmc@ff48",
+};
+
  int rk_board_init(void)
  {
static struct rk3308_grf * const grf = (void *)GRF_BASE;


Re: [PATCH] rockchip: rk3308: fix rockchip_dnl_key_pressed() on roc-cc

2022-08-26 Thread Kever Yang



On 2022/7/14 22:09, John Keeping wrote:

Commit 6aa4fe3912 ("dm: core: Rename and fix uclass_get_by_name_len()")
changed uclass_get_device_by_name() to an exact match when previously it
behaved as a prefix match.

The roc-cc code relied on this prefix match by only specifying part of
the device name.  Fix this by using the full name including the address.

Signed-off-by: John Keeping 
---


Reviewed-by: Kever Yang 

Thanks,
- Kever

  board/firefly/firefly-rk3308/roc_cc_rk3308.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/firefly/firefly-rk3308/roc_cc_rk3308.c 
b/board/firefly/firefly-rk3308/roc_cc_rk3308.c
index 28dcc2a690..bdf3cc03dc 100644
--- a/board/firefly/firefly-rk3308/roc_cc_rk3308.c
+++ b/board/firefly/firefly-rk3308/roc_cc_rk3308.c
@@ -70,7 +70,7 @@ int rockchip_dnl_key_pressed(void)
  {
unsigned int val;
  
-	if (adc_channel_single_shot("saradc", 1, )) {

+   if (adc_channel_single_shot("saradc@ff1e", 1, )) {
printf("%s read adc key val failed\n", __func__);
return false;
}


Re: [PATCH] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2.

2022-08-26 Thread Kever Yang

Hi Xavier,

On 2022/7/2 02:59, Xavier Drudis Ferran wrote:

arch/arm/dts/rk3399.dtsi has a node

   usb_host0_ehci: usb@fe38 {
compatible = "generic-ehci";

with clocks:

clocks = < HCLK_HOST0>, < HCLK_HOST0_ARB>,
 <>;

The first 2 refer to nodes with class UCLASS_CLK, but 
has class UCLASS_PHY.

   u2phy0: usb2phy@e450 {
compatible = "rockchip,rk3399-usb2phy";

Since clk_get_bulk() only looks for devices with UCLASS_CLK,
it fails with -ENODEV and then ehci_usb_probe() aborts.

The consequence is peripherals connected to a USB 2 port (e.g. in a
Rock Pi 4 the white port, nearer the edge) not being detected.
They're detected if CONFIG_USB_OHCI_GENERIC is selected in Kconfig,
because ohci_usb_probe() does not abort when one clk_get_by_index()
fails, but then they work in USB 1 mode,.

rk3399.dtsi comes from linux and the  u2phy0 was added[1] to the clock
list in:

 commit b5d1c57299734f5b54035ef2e61706b83041f20c
 Author: William wu 
 Date:   Wed Dec 21 18:41:05 2016 +0800

 arm64: dts: rockchip: add u2phy clock for ehci and ohci of rk3399

 We found that the suspend process was blocked when it run into
 ehci/ohci module due to clk-480m of usb2-phy was disabled.
 [...]

Suspend concerns don't apply to U-Boot, and the problem with U-Boot
failing to probe EHCI doesn't apply to linux, because in linux
rockchip_usb2phy_clk480m_register makes u2phy0 a proper clock provider
when called by rockchip_usb2phy_probe().

So I can think of a few alternative solutions:

1- Change ehci_usb_probe() to make it more similar to
ohci_usb_probe(), and survive failure to get one clock. Looks a
little harder, and I don't know whether it could break something if
it ignored a clock that was important for something else than
suspend.

2- Change rk3399.dtsi effecttively reverting the linux commit
b5d1c57299734f5b54035ef2e61706b83041f20c. This dealigns the .dtsi
from linux and seems fragile at the next synchronisation.

3- Change the clock list in rk3399-u-boot.dtsi or somewhere else.
This survives .dts* sync but may survive "too much" and miss some
change from linux that we might want.

4- Enable CONFIG_USB_OHCI_GENERIC and use the ports in USB 1 mode.
This would need to be made for all boards using rk3399.  In a
simple test reading one file from USB storage it gave 769.5 KiB/s
instead of 20.5 MiB/s with solution 2.

5- Trying to replicate linux and have usb2phy somehow provide a clk,
or have a separate clock device for usb2phy in addition to the phy
device. I just can't seem to imagine how to achieve this with the
U-Boot driver model, maybe because of my limited familiarity with
it.

This patch is option 3. Looked like the simplest and most performant.
But it might not be what's wanted, so comments wellcome.
The idea for dtsi now is to sync the kernel and U-Boot dts, and Linux 
distribution will
use the dts from U-Boot. If we change the dts property in -u-boot.dts, 
it will also pass
to kernel, which make kernel function not available. So we would like to 
sync the driver

for kernel and u-boot to use the same dts nodes.

So we can try option 1, output warning instead of error return for clock 
get fail, since the clock

driver for kernel and u-boot are totally different.


Thanks,
- Kever


Link: [1] https://lkml.kernel.org/lkml/1731551.Q6cHK6n5ZM@phil/T/

Cc: Simon Glass 
Cc: Philipp Tomsich 
Cc: Kever Yang 
Cc: Lukasz Majewski 
Cc: Sean Anderson 
Cc: Marek Vasut 

Signed-off-by: Xavier Drudis Ferran 
---
  arch/arm/dts/rk3399-u-boot.dtsi | 8 
  1 file changed, 8 insertions(+)

diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 716b9a433a..63c7b10405 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -147,3 +147,11 @@
   {
u-boot,dm-pre-reloc;
  };
+
+_host0_ehci {
+   clocks = < HCLK_HOST0>, < HCLK_HOST0_ARB>;
+};
+
+_host1_ehci {
+   clocks = < HCLK_HOST1>, < HCLK_HOST1_ARB>;
+};


[PATCH v4 2/2] image-fit: don't set compression if it can't be read

2022-08-26 Thread Daniel Golle
fit_image_get_comp() should not set value -1 in case it can't read
the compression node. Instead, leave the value untouched in that case
as it can be absent and a default value previously defined by the
caller of fit_image_get_comp() should be used.

As a result the warning message
WARNING: 'compression' nodes for ramdisks are deprecated, please fix your .its 
file!
no longer shows if the compression node is actually absent.

Signed-off-by: Daniel Golle 
---
v2: fix typo 'imape_comp' vs. 'image_comp'
v3: rather fix the typo everywhere in an additional patch before
v4: rebase on updated patch fixing typo

boot/bootm.c | 6 ++
 boot/image-fit.c | 3 +--
 cmd/ximg.c   | 7 ++-
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 63c79a9cfc..29c067fae7 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1024,10 +1024,8 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
return -EINVAL;
}
 
-   if (fit_image_get_comp(fit, noffset, _comp)) {
-   puts("Can't get image compression!\n");
-   return -EINVAL;
-   }
+   if (fit_image_get_comp(fit, noffset, _comp))
+   image_comp = IH_COMP_NONE;
 
/* Allow the image to expand by a factor of 4, should be safe */
buf_size = (1 << 20) + len * 4;
diff --git a/boot/image-fit.c b/boot/image-fit.c
index df3e5df883..21dbd05118 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -477,7 +477,7 @@ void fit_print_contents(const void *fit)
 void fit_image_print(const void *fit, int image_noffset, const char *p)
 {
char *desc;
-   uint8_t type, arch, os, comp;
+   uint8_t type, arch, os, comp = IH_COMP_NONE;
size_t size;
ulong load, entry;
const void *data;
@@ -794,7 +794,6 @@ int fit_image_get_comp(const void *fit, int noffset, 
uint8_t *comp)
data = fdt_getprop(fit, noffset, FIT_COMP_PROP, );
if (data == NULL) {
fit_get_debug(fit, noffset, FIT_COMP_PROP, len);
-   *comp = -1;
return -1;
}
 
diff --git a/cmd/ximg.c b/cmd/ximg.c
index 65ba41320a..f84141ff45 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -171,11 +171,8 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, 
char *const argv[])
return 1;
}
 
-   if (fit_image_get_comp(fit_hdr, noffset, )) {
-   puts("Could not find script subimage "
-   "compression type\n");
-   return 1;
-   }
+   if (fit_image_get_comp(fit_hdr, noffset, ))
+   comp = IH_COMP_NONE;
 
data = (ulong)fit_data;
len = (ulong)fit_len;
-- 
2.37.2



[PATCH v4 1/2] bootm: fix typo imape_comp -> image_comp

2022-08-26 Thread Daniel Golle
Chage variable name 'imape_comp' to the supposedly intended name
'image_comp'.

Signed-off-by: Daniel Golle 
---
v4: add missing name replacement

boot/bootm.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 86dbfbcfed..63c79a9cfc 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1006,7 +1006,7 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
int noffset;
ulong load_end, buf_size;
uint8_t image_type;
-   uint8_t imape_comp;
+   uint8_t image_comp;
void *load_buf;
int ret;
 
@@ -1024,7 +1024,7 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
return -EINVAL;
}
 
-   if (fit_image_get_comp(fit, noffset, _comp)) {
+   if (fit_image_get_comp(fit, noffset, _comp)) {
puts("Can't get image compression!\n");
return -EINVAL;
}
@@ -1032,12 +1032,12 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
/* Allow the image to expand by a factor of 4, should be safe */
buf_size = (1 << 20) + len * 4;
load_buf = malloc(buf_size);
-   ret = image_decomp(imape_comp, 0, data, image_type, load_buf,
+   ret = image_decomp(image_comp, 0, data, image_type, load_buf,
   (void *)data, len, buf_size, _end);
free(load_buf);
 
if (ret) {
-   ret = handle_decomp_error(imape_comp, load_end - 0, buf_size, 
ret);
+   ret = handle_decomp_error(image_comp, load_end - 0, buf_size, 
ret);
if (ret != BOOTM_ERR_UNIMPLEMENTED)
return ret;
}
-- 
2.37.2



[PATCH v3 2/2] image-fit: don't set compression if it can't be read

2022-08-26 Thread Daniel Golle
fit_image_get_comp() should not set value -1 in case it can't read
the compression node. Instead, leave the value untouched in that case
as it can be absent and a default value previously defined by the
caller of fit_image_get_comp() should be used.

As a result the warning message
WARNING: 'compression' nodes for ramdisks are deprecated, please fix your .its 
file!
no longer shows if the compression node is actually absent.

Signed-off-by: Daniel Golle 
---
 boot/bootm.c | 6 ++
 boot/image-fit.c | 3 +--
 cmd/ximg.c   | 7 ++-
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 4de573e24e..29c067fae7 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1024,10 +1024,8 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
return -EINVAL;
}
 
-   if (fit_image_get_comp(fit, noffset, _comp)) {
-   puts("Can't get image compression!\n");
-   return -EINVAL;
-   }
+   if (fit_image_get_comp(fit, noffset, _comp))
+   image_comp = IH_COMP_NONE;
 
/* Allow the image to expand by a factor of 4, should be safe */
buf_size = (1 << 20) + len * 4;
diff --git a/boot/image-fit.c b/boot/image-fit.c
index df3e5df883..21dbd05118 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -477,7 +477,7 @@ void fit_print_contents(const void *fit)
 void fit_image_print(const void *fit, int image_noffset, const char *p)
 {
char *desc;
-   uint8_t type, arch, os, comp;
+   uint8_t type, arch, os, comp = IH_COMP_NONE;
size_t size;
ulong load, entry;
const void *data;
@@ -794,7 +794,6 @@ int fit_image_get_comp(const void *fit, int noffset, 
uint8_t *comp)
data = fdt_getprop(fit, noffset, FIT_COMP_PROP, );
if (data == NULL) {
fit_get_debug(fit, noffset, FIT_COMP_PROP, len);
-   *comp = -1;
return -1;
}
 
diff --git a/cmd/ximg.c b/cmd/ximg.c
index 65ba41320a..f84141ff45 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -171,11 +171,8 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, 
char *const argv[])
return 1;
}
 
-   if (fit_image_get_comp(fit_hdr, noffset, )) {
-   puts("Could not find script subimage "
-   "compression type\n");
-   return 1;
-   }
+   if (fit_image_get_comp(fit_hdr, noffset, ))
+   comp = IH_COMP_NONE;
 
data = (ulong)fit_data;
len = (ulong)fit_len;
-- 
2.37.2



[PATCH v3 1/2] bootm: fix typo imape_comp -> image_comp

2022-08-26 Thread Daniel Golle
Chage variable name 'imape_comp' to the supposedly intended name
'image_comp'.

Signed-off-by: Daniel Golle 
---
 boot/bootm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 86dbfbcfed..4de573e24e 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1006,7 +1006,7 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
int noffset;
ulong load_end, buf_size;
uint8_t image_type;
-   uint8_t imape_comp;
+   uint8_t image_comp;
void *load_buf;
int ret;
 
@@ -1032,12 +1032,12 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
/* Allow the image to expand by a factor of 4, should be safe */
buf_size = (1 << 20) + len * 4;
load_buf = malloc(buf_size);
-   ret = image_decomp(imape_comp, 0, data, image_type, load_buf,
+   ret = image_decomp(image_comp, 0, data, image_type, load_buf,
   (void *)data, len, buf_size, _end);
free(load_buf);
 
if (ret) {
-   ret = handle_decomp_error(imape_comp, load_end - 0, buf_size, 
ret);
+   ret = handle_decomp_error(image_comp, load_end - 0, buf_size, 
ret);
if (ret != BOOTM_ERR_UNIMPLEMENTED)
return ret;
}
-- 
2.37.2



Re: [PATCH] drivers: ram: rockchip: Fix dram channels calculation for rk3399

2022-08-26 Thread Kever Yang



On 2022/5/15 14:11, pengp...@foxmail.com wrote:

From: Han Pengfei 

Only add the dram channel when we finally setup it successfully at the
last step.

Signed-off-by: Han Pengfei 

Reviewed-by: Kever Yang 

Thanks,
- Kever

---
  drivers/ram/rockchip/sdram_rk3399.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ram/rockchip/sdram_rk3399.c 
b/drivers/ram/rockchip/sdram_rk3399.c
index c0a06dcaed..fd8ba45d68 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -2964,8 +2964,6 @@ static int sdram_init(struct dram_info *dram,
if (cap_info->rank == 0) {
clear_channel_params(params, 1);
continue;
-   } else {
-   params->base.num_channels++;
}
  
  		if (IS_ENABLED(CONFIG_RAM_ROCKCHIP_DEBUG)) {

@@ -2991,6 +2989,8 @@ static int sdram_init(struct dram_info *dram,
printf("no ddrconfig find, Cap not support!\n");
continue;
}
+
+   params->base.num_channels++;
set_ddrconfig(chan, params, channel, cap_info->ddrconfig);
set_cap_relate_config(chan, params, channel);
}


Re: [PATCH] rockchip: rk3399: boot_devices: fix eMMC node name

2022-08-26 Thread Kever Yang



On 2022/7/11 22:15, Quentin Schulz wrote:

From: Quentin Schulz 

When idbloader.img is flashed on the eMMC, the SPL still tries to load
from SPI-NOR first.

This is due to an incorrect look-up in the Device Tree. Since commit
822556a93459 ("arm: dts: sync the Rockhip 3399 SoCs from Linux"), the
node name (but not label) changed from sdhci@fe33 to mmc@fe33
meaning U-Boot SPL is not looking for the correct node name anymore and
fails to find the "same-as-spl" node when eMMC is the medium from which
the SPL booted.

Fixes: 822556a93459 ("arm: dts: sync the Rockhip 3399 SoCs from Linux")
Cc: Quentin Schulz 
Signed-off-by: Quentin Schulz 



Reviewed-by: Kever Yang 


Thanks,
- Kever

---

Sorry for resend, was not yet subscribed.

  arch/arm/mach-rockchip/rk3399/rk3399.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c 
b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 01a05599cd..de11a3fa30 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
  #define GRF_BASE  0xff77
  
  const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {

-   [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe33",
+   [BROM_BOOTSOURCE_EMMC] = "/mmc@fe33",
[BROM_BOOTSOURCE_SPINOR] = "/spi@ff1d/flash@0",
[BROM_BOOTSOURCE_SD] = "/mmc@fe32",
  };
@@ -181,7 +181,7 @@ const char *spl_decode_boot_device(u32 boot_device)
const char *ofpath;
} spl_boot_devices_tbl[] = {
{ BOOT_DEVICE_MMC1, "/mmc@fe32" },
-   { BOOT_DEVICE_MMC2, "/sdhci@fe33" },
+   { BOOT_DEVICE_MMC2, "/mmc@fe33" },
{ BOOT_DEVICE_SPI, "/spi@ff1d" },
};
  


Please pull u-boot-dm

2022-08-26 Thread Simon Glass
Hi Tom,

https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/13234


The following changes since commit aea087a665c447dfb89bf2113cad74ad53fa17a0:

  Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
(2022-08-23 15:44:54 -0400)

are available in the Git repository at:

  git://git.denx.de/u-boot-dm.git tags/dm-pull-26aug22

for you to fetch changes up to c2ee5ee7b3393770dbe809ca36814083feffaf83:

  Rename disto_[pxe_]getfile to distro_[pxe_]getfile (2022-08-26 16:33:48 -0600)


binman/patman documentation improvements
other minor fixes


Dario Binacchi (1):
  Rename disto_[pxe_]getfile to distro_[pxe_]getfile

Heinrich Schuchardt (2):
  boot: fix vbe_find_first_device()
  boot: simplify bootmeth_vbe_simple_ft_fixup()

Sergei Antonov (1):
  dm: core: fix a typo in help text

Simon Glass (6):
  doc: Build documentation in parallel
  patman: Fix version table
  patman: Tidy up unnecessary blank lines and numbers
  binman: Mention split-elf in the main docs
  binman: Document how to handle dependent images
  vbe: Enable command only with BOOTSTD_FULL

Stefan Herbrechtsmeier (1):
  binman: Sort tests and rework test-file numbers

 boot/bootmeth_distro.c  |   6 +-
 boot/bootmeth_pxe.c |   6 +-
 boot/vbe.c  |   2 +-
 boot/vbe_simple.c   |   7 +-
 cmd/Kconfig |   2 +-
 cmd/dm.c|   2 +-
 doc/Makefile|   1 +
 doc/develop/bootstd.rst |   2 +-
 tools/binman/binman.rst |  54 +
 tools/binman/ftest.py   | 113 +-
 tools/binman/test/{225_dev.key => 230_dev.key}  |   0
 .../test/{225_pre_load.dts => 230_pre_load.dts} |   2 +-
 ..._pre_load_pkcs.dts => 231_pre_load_pkcs.dts} |   2 +-
 ...27_pre_load_pss.dts => 232_pre_load_pss.dts} |   2 +-
 ...ing.dts => 233_pre_load_invalid_padding.dts} |   2 +-
 ...lid_sha.dts => 234_pre_load_invalid_sha.dts} |   2 +-
 ...d_algo.dts => 235_pre_load_invalid_algo.dts} |   2 +-
 ...lid_key.dts => 236_pre_load_invalid_key.dts} |   2 +-
 ...30_unique_names.dts => 237_unique_names.dts} |   0
 ...mes_multi.dts => 238_unique_names_multi.dts} |   0
 ...bintool.dts => 239_replace_with_bintool.dts} |   0
 ..._replace.dts => 240_fit_extract_replace.dts} |   0
 ...imple.dts => 241_replace_section_simple.dts} |   0
 ...35_mkimage_name.dts => 242_mkimage_name.dts} |   0
 ..._mkimage_image.dts => 243_mkimage_image.dts} |   0
 ...ent.dts => 244_mkimage_image_no_content.dts} |   0
 ..._image_bad.dts => 245_mkimage_image_bad.dts} |   0
 ...ction_other.dts => 246_collection_other.dts} |   0
 ...40_mkimage_coll.dts => 247_mkimage_coll.dts} |   0
 ...dts => 248_compress_dtb_prepend_invalid.dts} |   0
 dts => 249_compress_dtb_prepend_length.dts} |   0
 ...invalid.dts => 250_compress_dtb_invalid.dts} |   0
 ...s_dtb_zstd.dts => 251_compress_dtb_zstd.dts} |   0
 tools/patman/patman.rst |  47 +++-
 34 files changed, 148 insertions(+), 108 deletions(-)
 rename tools/binman/test/{225_dev.key => 230_dev.key} (100%)
 rename tools/binman/test/{225_pre_load.dts => 230_pre_load.dts} (86%)
 rename tools/binman/test/{226_pre_load_pkcs.dts => 231_pre_load_pkcs.dts} (87%)
 rename tools/binman/test/{227_pre_load_pss.dts => 232_pre_load_pss.dts} (87%)
 rename tools/binman/test/{228_pre_load_invalid_padding.dts =>
233_pre_load_invalid_padding.dts} (86%)
 rename tools/binman/test/{229_pre_load_invalid_sha.dts =>
234_pre_load_invalid_sha.dts} (86%)
 rename tools/binman/test/{230_pre_load_invalid_algo.dts =>
235_pre_load_invalid_algo.dts} (86%)
 rename tools/binman/test/{231_pre_load_invalid_key.dts =>
236_pre_load_invalid_key.dts} (86%)
 rename tools/binman/test/{230_unique_names.dts => 237_unique_names.dts} (100%)
 rename tools/binman/test/{231_unique_names_multi.dts =>
238_unique_names_multi.dts} (100%)
 rename tools/binman/test/{232_replace_with_bintool.dts =>
239_replace_with_bintool.dts} (100%)
 rename tools/binman/test/{233_fit_extract_replace.dts =>
240_fit_extract_replace.dts} (100%)
 rename tools/binman/test/{234_replace_section_simple.dts =>
241_replace_section_simple.dts} (100%)
 rename tools/binman/test/{235_mkimage_name.dts => 242_mkimage_name.dts} (100%)
 rename tools/binman/test/{236_mkimage_image.dts =>
243_mkimage_image.dts} (100%)
 rename tools/binman/test/{237_mkimage_image_no_content.dts =>
244_mkimage_image_no_content.dts} (100%)
 rename tools/binman/test/{238_mkimage_image_bad.dts =>
245_mkimage_image_bad.dts} (100%)
 rename tools/binman/test/{239_collection_other.dts =>
246_collection_other.dts} (100%)
 rename tools/binman/test/{240_mkimage_coll.dts => 

Re: [PATCH] binman: Sort tests and rework test-file numbers

2022-08-26 Thread Simon Glass
On Tue, 23 Aug 2022 at 04:46, Stefan Herbrechtsmeier
 wrote:
>
> From: Stefan Herbrechtsmeier 
>
> Tests should be in order of the test-file numbers. Sort the tests
> according to the test-file numbers and rework the test-file numbers to
> eliminate duplicate numbers.
>
> Signed-off-by: Stefan Herbrechtsmeier 
>
> ---
>
>  tools/binman/ftest.py | 113 +-
>  .../binman/test/{225_dev.key => 230_dev.key}  |   0
>  .../{225_pre_load.dts => 230_pre_load.dts}|   2 +-
>  ...re_load_pkcs.dts => 231_pre_load_pkcs.dts} |   2 +-
>  ..._pre_load_pss.dts => 232_pre_load_pss.dts} |   2 +-
>  ...g.dts => 233_pre_load_invalid_padding.dts} |   2 +-
>  ...d_sha.dts => 234_pre_load_invalid_sha.dts} |   2 +-
>  ...algo.dts => 235_pre_load_invalid_algo.dts} |   2 +-
>  ...d_key.dts => 236_pre_load_invalid_key.dts} |   2 +-
>  ..._unique_names.dts => 237_unique_names.dts} |   0
>  ...s_multi.dts => 238_unique_names_multi.dts} |   0
>  ...ntool.dts => 239_replace_with_bintool.dts} |   0
>  ...eplace.dts => 240_fit_extract_replace.dts} |   0
>  ...ple.dts => 241_replace_section_simple.dts} |   0
>  ..._mkimage_name.dts => 242_mkimage_name.dts} |   0
>  ...kimage_image.dts => 243_mkimage_image.dts} |   0
>  ...t.dts => 244_mkimage_image_no_content.dts} |   0
>  ...mage_bad.dts => 245_mkimage_image_bad.dts} |   0
>  ...ion_other.dts => 246_collection_other.dts} |   0
>  ..._mkimage_coll.dts => 247_mkimage_coll.dts} |   0
>  ...s => 248_compress_dtb_prepend_invalid.dts} |   0
>  ...ts => 249_compress_dtb_prepend_length.dts} |   0
>  ...valid.dts => 250_compress_dtb_invalid.dts} |   0
>  ...dtb_zstd.dts => 251_compress_dtb_zstd.dts} |   0
>  24 files changed, 64 insertions(+), 63 deletions(-)
>  rename tools/binman/test/{225_dev.key => 230_dev.key} (100%)
>  rename tools/binman/test/{225_pre_load.dts => 230_pre_load.dts} (86%)
>  rename tools/binman/test/{226_pre_load_pkcs.dts => 231_pre_load_pkcs.dts} 
> (87%)
>  rename tools/binman/test/{227_pre_load_pss.dts => 232_pre_load_pss.dts} (87%)
>  rename tools/binman/test/{228_pre_load_invalid_padding.dts => 
> 233_pre_load_invalid_padding.dts} (86%)
>  rename tools/binman/test/{229_pre_load_invalid_sha.dts => 
> 234_pre_load_invalid_sha.dts} (86%)
>  rename tools/binman/test/{230_pre_load_invalid_algo.dts => 
> 235_pre_load_invalid_algo.dts} (86%)
>  rename tools/binman/test/{231_pre_load_invalid_key.dts => 
> 236_pre_load_invalid_key.dts} (86%)
>  rename tools/binman/test/{230_unique_names.dts => 237_unique_names.dts} 
> (100%)
>  rename tools/binman/test/{231_unique_names_multi.dts => 
> 238_unique_names_multi.dts} (100%)
>  rename tools/binman/test/{232_replace_with_bintool.dts => 
> 239_replace_with_bintool.dts} (100%)
>  rename tools/binman/test/{233_fit_extract_replace.dts => 
> 240_fit_extract_replace.dts} (100%)
>  rename tools/binman/test/{234_replace_section_simple.dts => 
> 241_replace_section_simple.dts} (100%)
>  rename tools/binman/test/{235_mkimage_name.dts => 242_mkimage_name.dts} 
> (100%)
>  rename tools/binman/test/{236_mkimage_image.dts => 243_mkimage_image.dts} 
> (100%)
>  rename tools/binman/test/{237_mkimage_image_no_content.dts => 
> 244_mkimage_image_no_content.dts} (100%)
>  rename tools/binman/test/{238_mkimage_image_bad.dts => 
> 245_mkimage_image_bad.dts} (100%)
>  rename tools/binman/test/{239_collection_other.dts => 
> 246_collection_other.dts} (100%)
>  rename tools/binman/test/{240_mkimage_coll.dts => 247_mkimage_coll.dts} 
> (100%)
>  rename tools/binman/test/{235_compress_dtb_prepend_invalid.dts => 
> 248_compress_dtb_prepend_invalid.dts} (100%)
>  rename tools/binman/test/{236_compress_dtb_prepend_length.dts => 
> 249_compress_dtb_prepend_length.dts} (100%)
>  rename tools/binman/test/{237_compress_dtb_invalid.dts => 
> 250_compress_dtb_invalid.dts} (100%)
>  rename tools/binman/test/{238_compress_dtb_zstd.dts => 
> 251_compress_dtb_zstd.dts} (100%)
>

Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!


Re: [RFC PATCH] Rename disto_[pxe_]getfile to distro_[pxe_]getfile

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 18:21, Simon Glass  wrote:
>
> On Fri, 26 Aug 2022 at 07:15, Dario Binacchi
>  wrote:
> >
> > Replace 'disto' with 'distro' since they are all functions about distro
> > booting.
> >
> > Signed-off-by: Dario Binacchi 
> >
> > ---
> >
> >  boot/bootmeth_distro.c  | 6 +++---
> >  boot/bootmeth_pxe.c | 6 +++---
> >  doc/develop/bootstd.rst | 2 +-
> >  3 files changed, 7 insertions(+), 7 deletions(-)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!


Re: [PATCH 1/2] binman: Mention split-elf in the main docs

2022-08-26 Thread Simon Glass
Since we are talking about ATF, add mention of this new feature too.

Signed-off-by: Simon Glass 
---

 tools/binman/binman.rst | 4 
 1 file changed, 4 insertions(+)

Applied to u-boot-dm, thanks!


Re: [PATCH v2 01/11] doc: Build documentation in parallel

2022-08-26 Thread Simon Glass
+Heinrich Schuchardt

On Sat, 13 Aug 2022 at 11:41, Simon Glass  wrote:
>
> With the addition of the revision stats this now takes over a minute. Use
> a parallel build to reduce it a bit (24 seconds for me).
>
> Series-changes; 2
> - Use '-j auto' instead
>
> Signed-off-by: Simon Glass 
> ---
>
> (no changes since v1)
>
>  doc/Makefile | 1 +
>  1 file changed, 1 insertion(+)

Does this look OK to you?

>
Applied to u-boot-dm, thanks!


Re: [PATCH 1/2] patman: Fix version table

2022-08-26 Thread Simon Glass
One of the changes to the version table was made by mistake. Fix it.

Signed-off-by: Simon Glass 
---

 tools/patman/patman.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!


Re: [PATCH 2/2] patman: Tidy up unnecessary blank lines and numbers

2022-08-26 Thread Simon Glass
Quite a few blank lines are not needed here. Drop these and use the #
mechanism to number paragraphs.

Signed-off-by: Simon Glass 
---

 tools/patman/patman.rst | 45 ++---
 1 file changed, 15 insertions(+), 30 deletions(-)

Applied to u-boot-dm, thanks!


Re: [PATCH 2/2] binman: Document how to handle dependent images

2022-08-26 Thread Simon Glass
Binman does not support this properly at present. Add documentation about
it including a work-around.

Signed-off-by: Simon Glass 
---

 tools/binman/binman.rst | 50 +
 1 file changed, 50 insertions(+)

Applied to u-boot-dm, thanks!


Re: [PATCH] dm: core: fix a typo in help text

2022-08-26 Thread Simon Glass
On Sun, 21 Aug 2022 at 07:45, Sergei Antonov  wrote:
>
> Signed-off-by: Sergei Antonov 
> ---
>  cmd/dm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass 

(but please always add a commit message)


>
Applied to u-boot-dm, thanks!


Re: [PATCH 1/1] boot: simplify bootmeth_vbe_simple_ft_fixup()

2022-08-26 Thread Simon Glass
On Tue, 23 Aug 2022 at 02:32, Heinrich Schuchardt
 wrote:
>
> Don't assign a value to a variable if it is not used afterwards.
> Move variables to the code fragment where they are used.
>
> Addresses-Coverity: CID 356243 ("Code maintainability issues (UNUSED_VALUE)")
> Signed-off-by: Heinrich Schuchardt 
> ---
>  boot/vbe_simple.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!


Re: [PATCH 1/1] boot: fix vbe_find_first_device()

2022-08-26 Thread Simon Glass
On Tue, 23 Aug 2022 at 02:25, Heinrich Schuchardt
 wrote:
>
> uclass_find_first_device() may return NULL if no device for the uclass
> exists. Handle this case gracefully.
>
> Addresses-Coverity: CID 356244 ("Null pointer dereferences (FORWARD_NULL)")
> Signed-off-by: Heinrich Schuchardt 
> ---
>  boot/vbe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!


Re: [PATCH] vbe: Enable command only with BOOTSTD_FULL

2022-08-26 Thread Simon Glass
On Tue, 23 Aug 2022 at 20:14, Simon Glass  wrote:
>
> Avoid enabling this command by default. This saves about 1KB of code
> space.
>
> Signed-off-by: Simon Glass 
> ---
>
>  cmd/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied to u-boot-dm, thanks!


Re: Question about uboot initialisation

2022-08-26 Thread Simon Glass
Hi Aubin,

On Fri, 26 Aug 2022 at 06:41, momo aubin  wrote:
>
> Dear all,
>
>
> Is there any way that allows us to know that uboot has initialised all his
> peripherals before starting loading kernel ?
>
> The goal of this check is to reset the board in case of bad initialisation
> and choose a different uboot .
>
> Thanks for your answer in advance.
> Aubin

If there is a failure then it likely results in an error-return code
from board_init_f() or board_init_r(). These generally halt U-Boot /
cause a reboot. But this only covers the peripherals that U-Boot sets
up early, like serial, clocks, pinctrl, MMC, PCI, etc.

U-Boot typically does not init a peripheral unless it is needed for U-Boot.

While U-Boot is running (e.g. a script) it may start up other
peripherals (e.g. to read a kernel from USB) and in those cases errors
can be handled by the script.

You can use 'dm tree' to see what devices have been probed successfully.

Regards,
Simon


Re: [PATCH 4/4] arm: dts: chameleonv3: Add 270-2 variant

2022-08-26 Thread Simon Glass
Hi Paweł,

On Fri, 26 Aug 2022 at 01:54, Paweł Anikiel  wrote:
>
> Add devicetree for chameleonv3 with the 270-2I2-D11E variant of the
> Mercury+ AA1 module
>
> Signed-off-by: Paweł Anikiel 
> ---
>  arch/arm/dts/Makefile|  1 +
>  .../socfpga_arria10_chameleonv3_270_2-u-boot.dtsi| 12 
>  arch/arm/dts/socfpga_arria10_chameleonv3_270_2.dts   |  5 +
>  3 files changed, 18 insertions(+)
>  create mode 100644 arch/arm/dts/socfpga_arria10_chameleonv3_270_2-u-boot.dtsi
>  create mode 100644 arch/arm/dts/socfpga_arria10_chameleonv3_270_2.dts
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 7330121dba..36d5d65595 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -425,6 +425,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) += 
>   \
> socfpga_agilex_socdk.dtb\
> socfpga_arria5_secu1.dtb\
> socfpga_arria5_socdk.dtb\
> +   socfpga_arria10_chameleonv3_270_2.dtb   \
> socfpga_arria10_chameleonv3_270_3.dtb   \
> socfpga_arria10_chameleonv3_480_2.dtb   \
> socfpga_arria10_socdk_sdmmc.dtb \
> diff --git a/arch/arm/dts/socfpga_arria10_chameleonv3_270_2-u-boot.dtsi 
> b/arch/arm/dts/socfpga_arria10_chameleonv3_270_2-u-boot.dtsi
> new file mode 100644
> index 00..05b4485cf3
> --- /dev/null
> +++ b/arch/arm/dts/socfpga_arria10_chameleonv3_270_2-u-boot.dtsi
> @@ -0,0 +1,12 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2022 Google LLC
> + */
> +#include "socfpga_arria10_chameleonv3_480_2_handoff.h"
> +#include "socfpga_arria10-handoff.dtsi"
> +#include "socfpga_arria10_handoff_u-boot.dtsi"
> +#include "socfpga_arria10_mercury_aa1-u-boot.dtsi"
> +
> +_mgr {
> +   altr,bitstream = "fpga-270-2.itb";
> +};
> diff --git a/arch/arm/dts/socfpga_arria10_chameleonv3_270_2.dts 
> b/arch/arm/dts/socfpga_arria10_chameleonv3_270_2.dts
> new file mode 100644
> index 00..5f40af6eb9
> --- /dev/null
> +++ b/arch/arm/dts/socfpga_arria10_chameleonv3_270_2.dts
> @@ -0,0 +1,5 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2022 Google LLC
> + */
> +#include "socfpga_arria10_chameleonv3.dts"

Can you create a common .dtsi file instead? We should not be including
a .dts file into another file.

> --
> 2.37.2.672.g94769d06f0-goog
>

Regards,
Simon


Re: [PATCH] corenet_ds.h: Remove

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 08:53, Tom Rini  wrote:
>
> This was missed when removing the platform.
>
> Signed-off-by: Tom Rini 
> ---
>  include/configs/corenet_ds.h | 369 ---
>  1 file changed, 369 deletions(-)
>  delete mode 100644 include/configs/corenet_ds.h
>

Reviewed-by: Simon Glass 


Re: [PATCH v5 1/8] binman: add support for skipping file concatenation for mkimage

2022-08-26 Thread Simon Glass
Hi Quentin,

On Fri, 26 Aug 2022 at 09:37, Quentin Schulz  wrote:
>
> From: Quentin Schulz 
>
> Some image types handled by mkimage require the datafiles to be passed
> independently (-d data1:data2) for specific handling of each. A
> concatenation of datafiles prior to passing them to mkimage wouldn't
> work.
>
> That is the case for rkspi for example which requires page alignment
> and only writing 2KB every 4KB.
>
> This adds the ability to tell binman to pass the datafiles without
> prior concatenation to mkimage, by adding the multiple-data-files
> boolean property to the mkimage node.
>
> Cc: Quentin Schulz 
> Reviewed-by: Simon Glass 
> Signed-off-by: Quentin Schulz 
> ---
>
> v5:
>  - changed to use full path from input dir with tools.get_input_filename
>  to make it possible to run the unit tests,
>  - added unit test,
>
>
>  tools/binman/entries.rst  | 22 ++
>  tools/binman/etype/mkimage.py | 41 +--
>  tools/binman/ftest.py | 16 

Please put the new test at the end.

>  .../test/241_mkimage_multiple_data_files.dts  | 21 ++
>  4 files changed, 96 insertions(+), 4 deletions(-)
>  create mode 100644 tools/binman/test/241_mkimage_multiple_data_files.dts

This is pretty close but it still missing a line of test coverage.
Please try 'binman test -T' to see it. I'd also prefer a shorter
filename for the 241 file.

I've pushed a tree containing a suggested fix (updating this patch). I
can update it when applying if you like, otherwise please send a new
version.

Also note that the files have been renumbered, so the latest update is
at u-boot-dm/testing

Regards,
Simon


Re: [PATCH v2] image-fit: don't set compression if it can't be read

2022-08-26 Thread Simon Glass
Hi Daniel,

On Fri, 26 Aug 2022 at 15:28, Daniel Golle  wrote:
>
> fit_image_get_comp() should not set value -1 in case it can't read
> the compression node. Instead, leave the value untouched in that case
> as it can be absent and a default value previously defined by the
> caller of fit_image_get_comp() should be used.
>
> As a result the warning message
> WARNING: 'compression' nodes for ramdisks are deprecated, please fix your 
> .its file!
> no longer shows if the compression node is actually absent.
>
> Signed-off-by: Daniel Golle 
> ---
> v2: fix typo 'imape_comp' vs. 'image_comp'
>  boot/bootm.c | 6 ++
>  boot/image-fit.c | 3 +--
>  cmd/ximg.c   | 7 ++-
>  3 files changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/boot/bootm.c b/boot/bootm.c
> index 86dbfbcfed..fcdf23f19c 100644
> --- a/boot/bootm.c
> +++ b/boot/bootm.c
> @@ -1024,10 +1024,8 @@ static int bootm_host_load_image(const void *fit, int 
> req_image_type,
> return -EINVAL;
> }
>
> -   if (fit_image_get_comp(fit, noffset, _comp)) {
> -   puts("Can't get image compression!\n");
> -   return -EINVAL;
> -   }
> +   if (fit_image_get_comp(fit, noffset, _comp))
> +   imape_comp = IH_COMP_NONE;
>
> /* Allow the image to expand by a factor of 4, should be safe */
> buf_size = (1 << 20) + len * 4;
> diff --git a/boot/image-fit.c b/boot/image-fit.c
> index df3e5df883..21dbd05118 100644
> --- a/boot/image-fit.c
> +++ b/boot/image-fit.c
> @@ -477,7 +477,7 @@ void fit_print_contents(const void *fit)
>  void fit_image_print(const void *fit, int image_noffset, const char *p)
>  {
> char *desc;
> -   uint8_t type, arch, os, comp;
> +   uint8_t type, arch, os, comp = IH_COMP_NONE;
> size_t size;
> ulong load, entry;
> const void *data;
> @@ -794,7 +794,6 @@ int fit_image_get_comp(const void *fit, int noffset, 
> uint8_t *comp)
> data = fdt_getprop(fit, noffset, FIT_COMP_PROP, );
> if (data == NULL) {
> fit_get_debug(fit, noffset, FIT_COMP_PROP, len);
> -   *comp = -1;
> return -1;
> }
>
> diff --git a/cmd/ximg.c b/cmd/ximg.c
> index 65ba41320a..f84141ff45 100644
> --- a/cmd/ximg.c
> +++ b/cmd/ximg.c
> @@ -171,11 +171,8 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, 
> char *const argv[])
> return 1;
> }
>
> -   if (fit_image_get_comp(fit_hdr, noffset, )) {
> -   puts("Could not find script subimage "
> -   "compression type\n");
> -   return 1;
> -   }
> +   if (fit_image_get_comp(fit_hdr, noffset, ))
> +   comp = IH_COMP_NONE;
>
> data = (ulong)fit_data;
> len = (ulong)fit_len;
> --
> 2.37.2
>

Well it should be imape_comp, so could you fix that error first (in a
patch before this one)?

Regards,
SImon


Re: [PATCH v9 08/15] event: Add an event for main_loop

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 03:58, Sughosh Ganu  wrote:
>
> Add an event type EVT_MAIN_LOOP that can be used for registering
> events that need to be run after the platform has been initialised and
> before the main_loop function is called.
>
> Signed-off-by: Sughosh Ganu 
> ---
> Changes since V8: New patch
>
>  common/board_r.c | 3 +++
>  common/event.c   | 3 +++
>  include/event.h  | 3 +++
>  3 files changed, 9 insertions(+)

Reviewed-by: Simon Glass 

But please add more detail below.

>
> diff --git a/common/board_r.c b/common/board_r.c
> index 56eb60fa27..1db061e65c 100644
> --- a/common/board_r.c
> +++ b/common/board_r.c
> @@ -576,6 +576,9 @@ static int run_main_loop(void)
>  #ifdef CONFIG_SANDBOX
> sandbox_main_loop_init();
>  #endif
> +
> +   event_notify_null(EVT_MAIN_LOOP);
> +
> /* main_loop() can return to retry autoboot, if so just run it again 
> */
> for (;;)
> main_loop();
> diff --git a/common/event.c b/common/event.c
> index 3e34550978..231b9e6ffd 100644
> --- a/common/event.c
> +++ b/common/event.c
> @@ -38,6 +38,9 @@ const char *const type_name[] = {
>
> /* fdt hooks */
> "ft_fixup",
> +
> +   /* main loop events */
> +   "main_loop",
>  };
>
>  _Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size");
> diff --git a/include/event.h b/include/event.h
> index e8f2f55c63..0748d676df 100644
> --- a/include/event.h
> +++ b/include/event.h
> @@ -34,6 +34,9 @@ enum event_t {
> /* Device tree fixups before booting */
> EVT_FT_FIXUP,
>
> +   /* To be called from main_loop */

This is vague. Please indicate exactly when it is called, i.e. only
once, just before the main loop is run for the first time.

> +   EVT_MAIN_LOOP,
> +
> EVT_COUNT
>  };
>
> --
> 2.34.1
>

Regards,
SImon


Re: [PATCH v5 8/8] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 09:37, Quentin Schulz  wrote:
>
> From: Quentin Schulz 
>
> This new image is similar to u-boot-rockchip.bin except that it's
> destined to be flashed on SPI-NOR flashes.
>
> Cc: Quentin Schulz 
> Signed-off-by: Quentin Schulz 
> ---
>
> v3:
>  - added filename property so that idblaoder-spi.img binary is generated
>  by binman, as per community request,
>  - added new temporary files to the list of files to clean up on `make
>  clean`,
>
>  Makefile  |  3 ++-
>  arch/arm/dts/rockchip-u-boot.dtsi | 30 ++
>  2 files changed, 32 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass 


Re: [PATCH v5 2/8] binman: allow user-defined filenames for mkimage entry

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 09:37, Quentin Schulz  wrote:
>
> From: Quentin Schulz 
>
> mkimage entry currently creates a file whose name is derived from the
> section name containing said entry.
>
> Let's allow the user to define a filename for the mkimage-generated
> binary by using the 'filename' DT property.
>
> Cc: Quentin Schulz 
> Signed-off-by: Quentin Schulz 
> ---
>
> v5:
>  - updated unit test filename,
>  - removed _testing section in unit test,
>  - removed -n arg in unit test,
>  - removed size property in binman node,
>
> v4:
>  - added binman test,
>  - fixed >80 chars-long line,
>
> added in v3
>
>  tools/binman/etype/mkimage.py  | 11 ---
>  tools/binman/ftest.py  |  7 +++
>  tools/binman/test/242_mkimage_filename.dts | 18 ++
>  3 files changed, 33 insertions(+), 3 deletions(-)
>  create mode 100644 tools/binman/test/242_mkimage_filename.dts

Reviewed-by: Simon Glass 

nit below

>
> diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py
> index 5f4bc6fa3c..c2288c48ee 100644
> --- a/tools/binman/etype/mkimage.py
> +++ b/tools/binman/etype/mkimage.py
> @@ -21,11 +21,13 @@ class Entry_mkimage(Entry):
>  - multiple-data-files: boolean to tell binman to pass all files as
>datafiles to mkimage instead of creating a temporary file the 
> result
>of datafiles concatenation
> +- filename: filename of output binary generated by mkimage
>
>  The data passed to mkimage via the -d flag is collected from subnodes of 
> the
>  mkimage node, e.g.::
>
>  mkimage {
> +filename = "imximage.bin";
>  args = "-n test -T imximage";
>
>  u-boot-spl {
> @@ -38,8 +40,9 @@ class Entry_mkimage(Entry):
>  mkimage -d  -n test -T imximage 
>
>  The output from mkimage then becomes part of the image produced by
> -binman. If you need to put multiple things in the data file, you can use
> -a section, or just multiple subnodes like this::
> +binman but also is written into `imximage.bin` file. If you need to put
> +multiple things in the data file, you can use a section, or just multiple
> +subnodes like this::
>
>  mkimage {
>  args = "-n test -T imximage";
> @@ -121,6 +124,7 @@ class Entry_mkimage(Entry):
>  self._multiple_data_files = fdt_util.GetBool(self._node, 
> 'multiple-data-files')
>  self._mkimage_entries = OrderedDict()
>  self._imagename = None
> +self._filename = fdt_util.GetString(self._node, 'filename')
>  self.align_default = None
>
>  def ReadNode(self):
> @@ -164,7 +168,8 @@ class Entry_mkimage(Entry):
>  [self._imagename], 'mkimage-n', 1024)
>  if image_data is None:
>  return False
> -output_fname = tools.get_output_filename('mkimage-out.%s' % uniq)
> +outfile = self._filename if self._filename else 'mkimage-out.%s' % 
> uniq
> +output_fname = tools.get_output_filename(outfile)
>
>  args = ['-d', input_fname]
>  if self._data_to_imagename:
> diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
> index 091692ef93..da0c7299ac 100644
> --- a/tools/binman/ftest.py
> +++ b/tools/binman/ftest.py
> @@ -5834,6 +5834,13 @@ fdt fdtmapExtract the 
> devicetree blob from the fdtmap
>  expect += U_BOOT_SPL_DATA
>  self.assertEqual(expect, data[-len(expect):])
>
> +def testMkimageFilename(self):
> +"""Test using mkimage to build a binary with a filename"""
> +retcode = self._DoTestFile('242_mkimage_filename.dts')
> +self.assertEqual(0, retcode)
> +fname = tools.get_output_filename('mkimage-test.bin')
> +self.assertTrue(os.path.exists(fname))
> +

Please put the new test at the end.

>  def testCompressDtbPrependInvalid(self):
>  """Test that invalid header is detected"""
>  with self.assertRaises(ValueError) as e:
> diff --git a/tools/binman/test/242_mkimage_filename.dts 
> b/tools/binman/test/242_mkimage_filename.dts
> new file mode 100644
> index 00..4483790ae8
> --- /dev/null
> +++ b/tools/binman/test/242_mkimage_filename.dts
> @@ -0,0 +1,18 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +/dts-v1/;
> +
> +/ {
> +   #address-cells = <1>;
> +   #size-cells = <1>;
> +
> +   binman {
> +   mkimage {
> +   filename = "mkimage-test.bin";
> +   args = "-T script";
> +
> +   u-boot-spl {
> +   };
> +   };
> +   };
> +};
> --
> 2.37.2
>

Regards,
Simon


Re: [PATCH v5 6/8] rockchip: simplify binman image dependencies addition to INPUTS

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 09:37, Quentin Schulz  wrote:
>
> From: Quentin Schulz 
>
> By factoring SPL check in the first condition, this makes the checks a
> bit less convoluted and more readable.
>
> Cc: Quentin Schulz 
> Signed-off-by: Quentin Schulz 
> ---
>
> v4:
>  - fixed wrong place for endif for ARM32 boards,
>
>  Makefile | 9 ++---
>  1 file changed, 2 insertions(+), 7 deletions(-)

Reviewed-by: Simon Glass 


>
> diff --git a/Makefile b/Makefile
> index 1dee09eb36..736c4ad182 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1001,19 +1001,14 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
>  INPUTS-y += u-boot-with-dtb.bin
>  endif
>
> -ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
> -# On ARM64 this target is produced by binman so we don't need this dep
> +ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
> +# Binman image dependencies
>  ifeq ($(CONFIG_ARM64),y)
> -ifeq ($(CONFIG_SPL),y)
>  INPUTS-y += u-boot.itb
> -endif
>  else
> -ifeq ($(CONFIG_SPL),y)
> -# Generate these inputs for binman which will create the output files
>  INPUTS-y += u-boot.img
>  endif
>  endif
> -endif
>
>  INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \
> $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
> --
> 2.37.2
>


Re: [PATCH v5 7/8] rockchip: allow to build SPI images even without HAS_ROM option

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 09:37, Quentin Schulz  wrote:
>
> From: Quentin Schulz 
>
> This prepares for the creation of a u-boot-rockchip-spi.bin image
> similar to u-boot-rockchip.bin to the exception it's destined for
> SPI-NOR flashes instead of MMC storage medium.
>
> Cc: Quentin Schulz 
> Signed-off-by: Quentin Schulz 
> ---
>  arch/arm/dts/rk3288-u-boot.dtsi | 2 +-
>  arch/arm/dts/rk3399-u-boot.dtsi | 2 +-
>  arch/arm/mach-rockchip/Kconfig  | 6 ++
>  3 files changed, 4 insertions(+), 6 deletions(-)
>

Reviewed-by: Simon Glass 


Re: [PATCH 1/2] Revert "i2c: fix stack buffer overflow vulnerability in i2c md command"

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 15:16, Marek Vasut  wrote:
>
> This reverts commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409.
>
> The commit is largely wrong and breaks most of i2c command functionality.
> The problem described in the aforementioned commit commit message is valid,
> however the commit itself does many more changes unrelated to fixing that
> one problem it describes. Those extra changes, namely the handling of i2c
> device address length as unsigned instead of signed integer, breaks the
> expectation that address length may be negative value. The negative value
> is used by DM to indicate that address length of device does not change.
>
> The actual bug documented in commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409
> can be fixed by extra sanitization in separate patch.
>
> Signed-off-by: Marek Vasut 
> Cc: Heiko Schocher 
> Cc: Nicolas Iooss 
> Cc: Simon Glass 
> Cc: Tim Harvey 
> ---
>  cmd/i2c.c | 24 
>  1 file changed, 12 insertions(+), 12 deletions(-)

Reviewed-by: Simon Glass 


Re: [PATCH v5 3/8] rockchip: remove binman temporary files when cleaning

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 09:37, Quentin Schulz  wrote:
>
> From: Quentin Schulz 
>
> Binman mkimage entry generates temporary files so let's remove them
> when calling `make clean`.
>
> Fixes: 9b312e26fc77 ("rockchip: Enable building a SPI ROM image on jerry")
> Cc: Quentin Schulz 
> Reported-by: Johan Jonker 
> Signed-off-by: Quentin Schulz 
> ---
>
> added in v3
>
>  Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass 


>
> diff --git a/Makefile b/Makefile
> index 541e942ed5..5750a9e4b8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2225,7 +2225,8 @@ CLEAN_FILES += include/bmp_logo.h 
> include/bmp_logo_data.h \
>lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
>idbloader.img flash.bin flash.log defconfig keep-syms-lto.c \
>mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \
> -  itb.fit.fit itb.fit.itb itb.map spl.map
> +  itb.fit.fit itb.fit.itb itb.map spl.map 
> mkimage-out.rom.mkimage \
> +  mkimage.rom.mkimage rom.map simple-bin.map
>
>  # Directories & files removed with 'make mrproper'
>  MRPROPER_DIRS  += include/config include/generated spl tpl \
> --
> 2.37.2
>


Re: [RFC PATCH] Rename disto_[pxe_]getfile to distro_[pxe_]getfile

2022-08-26 Thread Simon Glass
On Fri, 26 Aug 2022 at 07:15, Dario Binacchi
 wrote:
>
> Replace 'disto' with 'distro' since they are all functions about distro
> booting.
>
> Signed-off-by: Dario Binacchi 
>
> ---
>
>  boot/bootmeth_distro.c  | 6 +++---
>  boot/bootmeth_pxe.c | 6 +++---
>  doc/develop/bootstd.rst | 2 +-
>  3 files changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Simon Glass 


Re: [PATCH] usb: Add delay for control messages to reach usb stick

2022-08-26 Thread Simon Glass
Hi,

On Fri, 26 Aug 2022 at 13:37, Janne Grunau  wrote:
>
> Hej,
>
> On 2022-08-25 23:35:33 -0600, Ashok Reddy Soma wrote:
> > We are seeing timing issues with transcend usb sticks. These devices
> > seems to require more time than regular devices for the control messages
> > to reach device. Add 1ms delay before sending control message to fix
> > trancend device detection issue.
>
> I suspect I see something similar with the DWC3 controller on Apple
> M1/M2 devices. It seems to be related to USB full speed devices with
> bMaxPacketSize0 of 8. Failing devices are so only keyboards since that
> is a device everyone will connect when using a Mac Mini as desktop.
> I can reproduce the issue with older Logitech Unifying Receiver wireless
> keyboard/mouse dongles (bcdDevice 12.03 or 12.10). I could also resolve
> the issue with random 'mdelay(1);'. I chased the cause of the issue down
> to the initial USB descriptor read to parse 'bMaxPacketSize0' in
> usb_setup_descriptor(). Please test if adding the delay after the
> get_descriptor_len() call in usb_setup_descriptor() is enough.
> On the Apple silicon devices reducing the read size from 64 byte to 8
> resolves the issue as well. Please try attached work-in-progress patch
> (comment and commit message are not finalized).
>
> HTH Janne
>
> > Signed-off-by: Ashok Reddy Soma 
> > ---
> >
> >  common/usb.c | 6 ++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/common/usb.c b/common/usb.c
> > index 6fcf1e8428..3fae32b048 100644
> > --- a/common/usb.c
> > +++ b/common/usb.c
> > @@ -241,6 +241,12 @@ int usb_control_msg(struct usb_device *dev, unsigned 
> > int pipe,
> > request, requesttype, value, index, size);
> >   dev->status = USB_ST_NOT_PROC; /*not yet processed */
> >
> > + /* Timing issues are observed with transcend usb sticks such as
> > +  * “Transcend Jetflash 350 USB2.0". Add 1ms delay for the usb
> > +  * device to get detected.
> > +  */
> > + mdelay(1);
>
> Please let's try to avoid this. I noticed a slowdown of USB probing with
> an hub with 4 devices connected. Since Apple silicon devices are desktop
> style machines I expect it's not uncommon to see systems with many USB
> devices.

Can we add a CONFIG for this, or put a setting in the device tree? Or
is there a way to detect the problem and retry?

>
> > +
> >   err = submit_control_msg(dev, pipe, data, size, setup_packet);
> >   if (err < 0)
> >   return err;
> > --
> > 2.17.1
> >

Regards,
Simon


Re: [RFC PATCH] clk: fix clk_get_rate() always return ulong

2022-08-26 Thread Simon Glass
Hi,

On Fri, 26 Aug 2022 at 08:00, Sean Anderson  wrote:
>
> On 8/26/22 6:31 AM, Julien Masson wrote:
> > According to clk_ops struct definition, the callback `get_rate()`
> > return current clock rate value as ulong.
> > `clk_get_rate()` should handle the clock rate returned as ulong also.
> >
> > Otherwise we may have invalid/truncated clock rate value returned by
> > `clk_get_rate()`.
> >
> > `log_ret` has also been removed since it use an `int` in the macro
> > definition.
> >
> > Signed-off-by: Julien Masson 
> > ---
> >   drivers/clk/clk-uclass.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
> > index b89c77bf79..446f7c49b8 100644
> > --- a/drivers/clk/clk-uclass.c
> > +++ b/drivers/clk/clk-uclass.c
> > @@ -469,7 +469,7 @@ void clk_free(struct clk *clk)
> >   ulong clk_get_rate(struct clk *clk)
> >   {
> >   const struct clk_ops *ops;
> > - int ret;
> > + ulong ret;
> >
> >   debug("%s(clk=%p)\n", __func__, clk);
> >   if (!clk_valid(clk))
> > @@ -481,7 +481,7 @@ ulong clk_get_rate(struct clk *clk)
> >
> >   ret = ops->get_rate(clk);
> >   if (ret)
> > - return log_ret(ret);

How about:

if (IS_ERR(ret))
   return log_ret(ret)

> > + return ret;
> >
> >   return 0;
>
> This can just be return ret no if required.

Yes, but it is nice to have the 'success' path clear and at the end.

>
> >   }
> >

Regards,
Simon


Re: [PATCH 2/2] i2c: fix stack buffer overflow vulnerability in i2c md command

2022-08-26 Thread Tim Harvey
On Fri, Aug 26, 2022 at 3:21 PM Tim Harvey  wrote:
>
> On Fri, Aug 26, 2022 at 2:16 PM Marek Vasut  wrote:
> >
> > This reinstates fix from commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409
> > without the changes unrelated to the actual fix. Avoid the underflow by
> > setting only nbytes and linebytes as unsigned integers.
> >
> > Signed-off-by: Marek Vasut 
> > Cc: Heiko Schocher 
> > Cc: Nicolas Iooss 
> > Cc: Simon Glass 
> > Cc: Tim Harvey 
> > ---
> >  cmd/i2c.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/cmd/i2c.c b/cmd/i2c.c
> > index 9050b2b8d27..e196a73efa6 100644
> > --- a/cmd/i2c.c
> > +++ b/cmd/i2c.c
> > @@ -470,7 +470,8 @@ static int do_i2c_md(struct cmd_tbl *cmdtp, int flag, 
> > int argc,
> > uintchip;
> > uintaddr, length;
> > int alen;
> > -   int j, nbytes, linebytes;
> > +   int j;
> > +   uint nbytes, linebytes;
> > int ret;
> >  #if CONFIG_IS_ENABLED(DM_I2C)
> > struct udevice *dev;
> > --
> > 2.35.1
> >
>
> Marek,
>
> Did 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 get reverted then?
>

Oh gosh... my bad for not seeing your first patch that reverts it!

Acked-by: Tim Harvey 

Best Regards,

Tim


Re: [PATCH 2/2] i2c: fix stack buffer overflow vulnerability in i2c md command

2022-08-26 Thread Tim Harvey
On Fri, Aug 26, 2022 at 2:16 PM Marek Vasut  wrote:
>
> This reinstates fix from commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409
> without the changes unrelated to the actual fix. Avoid the underflow by
> setting only nbytes and linebytes as unsigned integers.
>
> Signed-off-by: Marek Vasut 
> Cc: Heiko Schocher 
> Cc: Nicolas Iooss 
> Cc: Simon Glass 
> Cc: Tim Harvey 
> ---
>  cmd/i2c.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/cmd/i2c.c b/cmd/i2c.c
> index 9050b2b8d27..e196a73efa6 100644
> --- a/cmd/i2c.c
> +++ b/cmd/i2c.c
> @@ -470,7 +470,8 @@ static int do_i2c_md(struct cmd_tbl *cmdtp, int flag, int 
> argc,
> uintchip;
> uintaddr, length;
> int alen;
> -   int j, nbytes, linebytes;
> +   int j;
> +   uint nbytes, linebytes;
> int ret;
>  #if CONFIG_IS_ENABLED(DM_I2C)
> struct udevice *dev;
> --
> 2.35.1
>

Marek,

Did 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 get reverted then?

Best Regards,

Tim


[PATCH v2] image-fit: don't set compression if it can't be read

2022-08-26 Thread Daniel Golle
fit_image_get_comp() should not set value -1 in case it can't read
the compression node. Instead, leave the value untouched in that case
as it can be absent and a default value previously defined by the
caller of fit_image_get_comp() should be used.

As a result the warning message
WARNING: 'compression' nodes for ramdisks are deprecated, please fix your .its 
file!
no longer shows if the compression node is actually absent.

Signed-off-by: Daniel Golle 
---
v2: fix typo 'imape_comp' vs. 'image_comp'
 boot/bootm.c | 6 ++
 boot/image-fit.c | 3 +--
 cmd/ximg.c   | 7 ++-
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 86dbfbcfed..fcdf23f19c 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1024,10 +1024,8 @@ static int bootm_host_load_image(const void *fit, int 
req_image_type,
return -EINVAL;
}
 
-   if (fit_image_get_comp(fit, noffset, _comp)) {
-   puts("Can't get image compression!\n");
-   return -EINVAL;
-   }
+   if (fit_image_get_comp(fit, noffset, _comp))
+   imape_comp = IH_COMP_NONE;
 
/* Allow the image to expand by a factor of 4, should be safe */
buf_size = (1 << 20) + len * 4;
diff --git a/boot/image-fit.c b/boot/image-fit.c
index df3e5df883..21dbd05118 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -477,7 +477,7 @@ void fit_print_contents(const void *fit)
 void fit_image_print(const void *fit, int image_noffset, const char *p)
 {
char *desc;
-   uint8_t type, arch, os, comp;
+   uint8_t type, arch, os, comp = IH_COMP_NONE;
size_t size;
ulong load, entry;
const void *data;
@@ -794,7 +794,6 @@ int fit_image_get_comp(const void *fit, int noffset, 
uint8_t *comp)
data = fdt_getprop(fit, noffset, FIT_COMP_PROP, );
if (data == NULL) {
fit_get_debug(fit, noffset, FIT_COMP_PROP, len);
-   *comp = -1;
return -1;
}
 
diff --git a/cmd/ximg.c b/cmd/ximg.c
index 65ba41320a..f84141ff45 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -171,11 +171,8 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, 
char *const argv[])
return 1;
}
 
-   if (fit_image_get_comp(fit_hdr, noffset, )) {
-   puts("Could not find script subimage "
-   "compression type\n");
-   return 1;
-   }
+   if (fit_image_get_comp(fit_hdr, noffset, ))
+   comp = IH_COMP_NONE;
 
data = (ulong)fit_data;
len = (ulong)fit_len;
-- 
2.37.2



[PATCH] ARM: imx: Enable SPL GPIO hog on i.MX8M Plus DHCOM

2022-08-26 Thread Marek Vasut
Enable GPIO hog support in SPL to match the GPIO hog support in U-Boot proper.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Peng Fan 
Cc: Stefano Babic 
Cc: uboot-imx 
---
 configs/imx8mp_dhcom_pdk2_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/imx8mp_dhcom_pdk2_defconfig 
b/configs/imx8mp_dhcom_pdk2_defconfig
index 0315a4cfb21..e78b9a1569e 100644
--- a/configs/imx8mp_dhcom_pdk2_defconfig
+++ b/configs/imx8mp_dhcom_pdk2_defconfig
@@ -169,6 +169,7 @@ CONFIG_FASTBOOT_BUF_SIZE=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
+CONFIG_SPL_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 # CONFIG_INPUT is not set
-- 
2.35.1



[PATCH 2/2] i2c: fix stack buffer overflow vulnerability in i2c md command

2022-08-26 Thread Marek Vasut
This reinstates fix from commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409
without the changes unrelated to the actual fix. Avoid the underflow by
setting only nbytes and linebytes as unsigned integers.

Signed-off-by: Marek Vasut 
Cc: Heiko Schocher 
Cc: Nicolas Iooss 
Cc: Simon Glass 
Cc: Tim Harvey 
---
 cmd/i2c.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/i2c.c b/cmd/i2c.c
index 9050b2b8d27..e196a73efa6 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -470,7 +470,8 @@ static int do_i2c_md(struct cmd_tbl *cmdtp, int flag, int 
argc,
uintchip;
uintaddr, length;
int alen;
-   int j, nbytes, linebytes;
+   int j;
+   uint nbytes, linebytes;
int ret;
 #if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
-- 
2.35.1



[PATCH 1/2] Revert "i2c: fix stack buffer overflow vulnerability in i2c md command"

2022-08-26 Thread Marek Vasut
This reverts commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409.

The commit is largely wrong and breaks most of i2c command functionality.
The problem described in the aforementioned commit commit message is valid,
however the commit itself does many more changes unrelated to fixing that
one problem it describes. Those extra changes, namely the handling of i2c
device address length as unsigned instead of signed integer, breaks the
expectation that address length may be negative value. The negative value
is used by DM to indicate that address length of device does not change.

The actual bug documented in commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409
can be fixed by extra sanitization in separate patch.

Signed-off-by: Marek Vasut 
Cc: Heiko Schocher 
Cc: Nicolas Iooss 
Cc: Simon Glass 
Cc: Tim Harvey 
---
 cmd/i2c.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/cmd/i2c.c b/cmd/i2c.c
index bd04b14024b..9050b2b8d27 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -200,10 +200,10 @@ void i2c_init_board(void)
  *
  * Returns the address length.
  */
-static uint get_alen(char *arg, uint default_len)
+static uint get_alen(char *arg, int default_len)
 {
-   uintj;
-   uintalen;
+   int j;
+   int alen;
 
alen = default_len;
for (j = 0; j < 8; j++) {
@@ -247,7 +247,7 @@ static int do_i2c_read(struct cmd_tbl *cmdtp, int flag, int 
argc,
 {
uintchip;
uintdevaddr, length;
-   uintalen;
+   int alen;
u_char  *memaddr;
int ret;
 #if CONFIG_IS_ENABLED(DM_I2C)
@@ -301,7 +301,7 @@ static int do_i2c_write(struct cmd_tbl *cmdtp, int flag, 
int argc,
 {
uintchip;
uintdevaddr, length;
-   uintalen;
+   int alen;
u_char  *memaddr;
int ret;
 #if CONFIG_IS_ENABLED(DM_I2C)
@@ -469,8 +469,8 @@ static int do_i2c_md(struct cmd_tbl *cmdtp, int flag, int 
argc,
 {
uintchip;
uintaddr, length;
-   uintalen;
-   uintj, nbytes, linebytes;
+   int alen;
+   int j, nbytes, linebytes;
int ret;
 #if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
@@ -589,9 +589,9 @@ static int do_i2c_mw(struct cmd_tbl *cmdtp, int flag, int 
argc,
 {
uintchip;
ulong   addr;
-   uintalen;
+   int alen;
uchar   byte;
-   uintcount;
+   int count;
int ret;
 #if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
@@ -676,8 +676,8 @@ static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int 
argc,
 {
uintchip;
ulong   addr;
-   uintalen;
-   uintcount;
+   int alen;
+   int count;
uchar   byte;
ulong   crc;
ulong   err;
@@ -985,7 +985,7 @@ static int do_i2c_loop(struct cmd_tbl *cmdtp, int flag, int 
argc,
   char *const argv[])
 {
uintchip;
-   uintalen;
+   int alen;
uintaddr;
uintlength;
u_char  bytes[16];
-- 
2.35.1



Re: [PATCH] image-fit: don't set compression if it can't be read

2022-08-26 Thread Tom Rini
On Mon, Aug 15, 2022 at 12:38:27PM +0200, Daniel Golle wrote:

> fit_image_get_comp() should not set value -1 in case it can't read
> the compression node. Instead, leave the value untouched in that case
> as it can be absent and a default value previously defined by the
> caller of fit_image_get_comp() should be used.
> 
> As a result the warning message
> WARNING: 'compression' nodes for ramdisks are deprecated, please fix your 
> .its file!
> no longer shows if the compression node is actually absent.
> 
> Signed-off-by: Daniel Golle 
> Reviewed-by: Simon Glass 

This causes most platforms to fail to build with an error such as:
https://source.denx.de/u-boot/u-boot/-/jobs/486959#L140

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] Makefile: Use relative paths for debugging symbols.

2022-08-26 Thread Tom Rini
On Thu, Aug 18, 2022 at 10:31:34AM -0700, Vagrant Cascadian wrote:

> From: Vagrant Cascadian 
> 
> The KBUILD_CFLAGS and KBUILD_AFLAGS variables are adjusted to use
> -ffile-prefix-map and --debug-prefix-map, respectively, to use
> relative paths for occurrences of __FILE__ and debug paths.
> 
> This enables reproducible builds regardless of the absolute path to
> the build directory:
> 
>   https://reproducible-builds.org/docs/build-path/
> 
> Signed-off-by: Vagrant Cascadian 
> Acked-by: Rasmus Villemoes 

This needs some sort of clang check and then perhaps different flag
used? How does the linux kernel handle this? See:
https://source.denx.de/u-boot/u-boot/-/jobs/487013#L48

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] usb: Add delay for control messages to reach usb stick

2022-08-26 Thread Janne Grunau
Hej,

On 2022-08-25 23:35:33 -0600, Ashok Reddy Soma wrote:
> We are seeing timing issues with transcend usb sticks. These devices
> seems to require more time than regular devices for the control messages
> to reach device. Add 1ms delay before sending control message to fix
> trancend device detection issue.

I suspect I see something similar with the DWC3 controller on Apple 
M1/M2 devices. It seems to be related to USB full speed devices with 
bMaxPacketSize0 of 8. Failing devices are so only keyboards since that 
is a device everyone will connect when using a Mac Mini as desktop.
I can reproduce the issue with older Logitech Unifying Receiver wireless 
keyboard/mouse dongles (bcdDevice 12.03 or 12.10). I could also resolve 
the issue with random 'mdelay(1);'. I chased the cause of the issue down 
to the initial USB descriptor read to parse 'bMaxPacketSize0' in 
usb_setup_descriptor(). Please test if adding the delay after the 
get_descriptor_len() call in usb_setup_descriptor() is enough.
On the Apple silicon devices reducing the read size from 64 byte to 8 
resolves the issue as well. Please try attached work-in-progress patch 
(comment and commit message are not finalized).

HTH Janne
 
> Signed-off-by: Ashok Reddy Soma 
> ---
> 
>  common/usb.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/common/usb.c b/common/usb.c
> index 6fcf1e8428..3fae32b048 100644
> --- a/common/usb.c
> +++ b/common/usb.c
> @@ -241,6 +241,12 @@ int usb_control_msg(struct usb_device *dev, unsigned int 
> pipe,
> request, requesttype, value, index, size);
>   dev->status = USB_ST_NOT_PROC; /*not yet processed */
>  
> + /* Timing issues are observed with transcend usb sticks such as
> +  * “Transcend Jetflash 350 USB2.0". Add 1ms delay for the usb
> +  * device to get detected.
> +  */
> + mdelay(1);

Please let's try to avoid this. I noticed a slowdown of USB probing with 
an hub with 4 devices connected. Since Apple silicon devices are desktop 
style machines I expect it's not uncommon to see systems with many USB 
devices.

> +
>   err = submit_control_msg(dev, pipe, data, size, setup_packet);
>   if (err < 0)
>   return err;
> -- 
> 2.17.1
> 
>From df9e5b78687fc4eed4988f99d3f195cba8b227e1 Mon Sep 17 00:00:00 2001
From: Janne Grunau 
Date: Fri, 26 Aug 2022 00:01:15 +0200
Subject: [PATCH 1/1] usb: request on 8 bytes for USB_SPEED_FULL
 bMaxPacketSize0 probing

Fixes probing of Logitech Unifying receivers (bcdDevice 12.03 or 12.10)
with bMaxPacketSize0 == 8 on Apple silicon SoCs using DWC3 controllers.

Signed-off-by: Janne Grunau 
---
 common/usb.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/usb.c b/common/usb.c
index aad13fd9c557..2d6d782f9103 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -999,8 +999,17 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
 		 * the number of packets in addition to the number of bytes.
 		 * A request for 64 bytes of data with the maxpacket guessed
 		 * as 64 (above) yields a request for 1 packet.
+		 *
+		 * The DWC3 controller integrated into Apple silicon SoCs like
+		 * the M1 and M2 does not like to read 64 bytes for devices with
+		 * bMaxPacketSize0 == 8. request only 8 bytes which should also
+		 * result in a single packet.
+		 * Fixes probing errors with Logitech Unifying receivers with
+		 * bcdDevice 12.03 or 12.10.
+		 * A delay of 1 ms after this get_descriptor_len() call fixes
+		 * the issue as well.
 		 */
-		err = get_descriptor_len(dev, 64, 8);
+		err = get_descriptor_len(dev, 8, 8);
 		if (err)
 			return err;
 	}
-- 
2.35.1



Re: [PATCH 13/13] qcs404evb_defconfig: Enable USB configs

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:21PM +0530, Sumit Garg wrote:

> Enable USB config options along with its dependencies like PHY, RESET,
> PMIC GPIO etc. config options.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] arm: total_compute: enable psci

2022-08-26 Thread Tom Rini
On Tue, Aug 09, 2022 at 03:56:52PM +0530, Davidson K wrote:

> psci is used for system reset
> 
> Signed-off-by: Davidson K 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 12/13] board: qcs404-evb: Enable USB3 specific PMIC GPIO

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:20PM +0530, Sumit Garg wrote:

> For USB3 host controller to detect devices on the bus it is required to
> enable a PMIC GPIO: usb_vbus_boost_pin. So enable that during board
> specific initialization.
> 
> And since this PMIC GPIO parsing is quite u-boot specific, so add a
> DT override to qcs404-evb-uboot.dtsi to represent usb_vbus_boost_pin.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 11/13] dts: qcs404-evb: Add PMIC GPIO controller node

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:19PM +0530, Sumit Garg wrote:

> PMIC GPIOs are special GPIOs which are accessible through SPMI bus. So
> add corresponding DT nodes.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 10/13] gpio: qcom_pmic: Add support for GPIO LV/MV subtype

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:18PM +0530, Sumit Garg wrote:

> GPIO LV (low voltage)/MV (medium voltage) subtypes have different
> features and register mappings than 4CH/8CH subtypes. Add support
> for LV and MV subtypes.
> 
> With GPIO LV/MV subtype available, add "qcom,pms405-gpio" compatible
> which requires support for GPIO MV subtype.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 09/13] pmic: Convert pm8916 driver to a generic Qcom PMIC driver

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:17PM +0530, Sumit Garg wrote:

> Since both pm8916.c and pm8916_gpio.c are already supporting multiple
> Qcom SoCs, it makes sense to rename these drivers to pmic_qcom.c and
> qcom_pmic_gpio.c respectively. Also, these driver can be extended to
> support additional functionality if required for other Qcom SoCs.
> 
> Along with this import latest DT binding: qcom,spmi-pmic.txt from Linux
> kernel and thereby remove pm8916.txt.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 08/13] dts: qcs404-evb: Add USB controller and PHY nodes

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:16PM +0530, Sumit Garg wrote:

> QCS404 SoC provides support for two USB controllers: one USB3 and the
> other one being USB2. The USB3 controller supports further 2 PHY: one high
> speed PHY and the other super speed PHY. The USB2 controller supports a
> single high speed PHY. So add corresponding DT nodes.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 07/13] clocks: qcs404: Add support for USB clocks

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:15PM +0530, Sumit Garg wrote:

> Add support for USB controller and PHY clocks for QCS404 SoC.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 06/13] clocks: qcom: Add clock enable callback support

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:14PM +0530, Sumit Garg wrote:

> Drivers like USB, ethernet etc. uses ".enable" hook to enable clocks.
> So add corresponding support for Qcom clock drivers.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 05/13] dts: qcs404-evb: Add reset controller node

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:13PM +0530, Sumit Garg wrote:

> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 04/13] reset: qcom: Add support for QCS404 SoC reset table

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:12PM +0530, Sumit Garg wrote:

> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 03/13] reset: Convert ipq4019 driver to a generic Qcom driver

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:11PM +0530, Sumit Garg wrote:

> Since the base functionality remains the same for a reset driver on Qcom
> SoCs, so leverage that to convert ipq4019 specific reset driver to a
> generic Qcom reset driver. With that one just need to provide SoC specific
> reset table.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 02/13] phy: Add support for drivers to enable USB on QCS404 SoC

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:10PM +0530, Sumit Garg wrote:

> QCS404 SoC supports two types of PHY, one supports high speed mode or
> USB2 PHY and the other supports super speed mode or USB3 PHY. So add
> corresponding PHY drivers.
> 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 01/13] phy: Move qcom SoCs specific phy drivers to qcom folder

2022-08-26 Thread Tom Rini
On Thu, Aug 04, 2022 at 07:57:09PM +0530, Sumit Garg wrote:

> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] configs: j721s2_evm_a72_defconfig: fix the bootcmd

2022-08-26 Thread Tom Rini
On Tue, Aug 02, 2022 at 06:38:14PM +0530, Jayesh Choudhary wrote:

> Remove the main_cpsw0_qsgmii_phyinit variable from the boot
> command as there is no ethernet firmware in j721s2.
> 
> Fixes: 8886341aa670 ('configs: j721s2_evm_a72_defconfig: Add A72 specific 
> defconfig')
> Signed-off-by: Jayesh Choudhary 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 2/2] arm: dts: qcom: Sync pinctrl DT nodes with Linux bindings

2022-08-26 Thread Tom Rini
On Wed, Jul 27, 2022 at 01:52:04PM +0530, Sumit Garg wrote:

> Currently for all Qcom SoCs/boards there are separate compatibles for
> GPIO and pinctrl. But this is inconsistent with official (upstream) Linux
> bindings which requires only a single compatible "qcom,-pinctrl"
> and there is no such compatible property as "qcom,tlmm-".
> 
> So fix this inconsistency for Qcom SoCs in order to comply with upstream
> DT bindings. This is done via removing compatibles from "msm_gpio" driver
> and via binding to "msm_gpio" driver from pinctrl driver in case
> "gpio-controller" property is specified for pinctrl node.
> 
> Suggested-by: Stephan Gerhold 
> Signed-off-by: Sumit Garg 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 1/2] pinctrl: sdm845: Remove redundant CONFIG_SDM845 check

2022-08-26 Thread Tom Rini
On Wed, Jul 27, 2022 at 01:52:03PM +0530, Sumit Garg wrote:

> DT compatible is sufficient to make platform specific differentiation,
> so remove redundant CONFIG_SDM845 check.
> 
> Signed-off-by: Sumit Garg 
> Reviewed-by: Ramon Fried 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 4/4] firmware: ti_sci: Move ACK checking to ti_sci_do_xfer() function

2022-08-26 Thread Tom Rini
On Mon, Jul 25, 2022 at 08:25:06PM -0500, Andrew Davis wrote:

> We can check if the message was acknowledged in the common
> ti_sci_do_xfer() which lets us remove it from after each call to this
> function. This simplifies the code and reduces binary size.
> 
> Signed-off-by: Andrew Davis 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 3/4] firmware: ti_sci: Remove inline keyword from functions

2022-08-26 Thread Tom Rini
On Mon, Jul 25, 2022 at 08:25:05PM -0500, Andrew Davis wrote:

> The inline hint is not needed here, the compiler will do the right thing
> based on if we are compiling for speed or for code size. In this case the
> inline causes this function to be placed inside each callsite which is
> not the right thing to do for either speed nor size. There is no
> performance benefit to this due to the larger function size reducing
> cache locality, but there is a huge size penalty. Remove inline keyword.
> 
> Signed-off-by: Andrew Davis 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 2/4] firmware: ti_sci: Factor out message alloc failed message

2022-08-26 Thread Tom Rini
On Mon, Jul 25, 2022 at 08:25:04PM -0500, Andrew Davis wrote:

> We don't need to print the same message in every location, just
> print it in the function that fails and remove all the extra
> message printouts.
> 
> Signed-off-by: Andrew Davis 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/4] firmware: ti_sci: Reduce output on ti_sci_do_xfer error

2022-08-26 Thread Tom Rini
On Mon, Jul 25, 2022 at 08:25:03PM -0500, Andrew Davis wrote:

> This ti_sci_do_xfer() function already prints out the reason for the
> failure, and the caller of each of these functions should also notify
> the user of the failed task. Remove this extra level of error message.
> 
> Signed-off-by: Andrew Davis 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v2 6/8] imx8mp: synchronise device tree with linux

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Synchronise device tree with linux v6.0-rc1.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 arch/arm/dts/imx8mp-dhcom-pdk2.dts  |  27 +++--
 arch/arm/dts/imx8mp-dhcom-som.dtsi  |  20 +---
 arch/arm/dts/imx8mp-evk.dts | 126 +++-
 arch/arm/dts/imx8mp-phyboard-pollux-rdk.dts |  48 
 arch/arm/dts/imx8mp-u-boot.dtsi |   2 +-
 arch/arm/dts/imx8mp-venice-gw74xx.dts   | 116 +-
 arch/arm/dts/imx8mp-verdin.dtsi |  14 ++-
 arch/arm/dts/imx8mp.dtsi|  33 -
 include/dt-bindings/clock/imx8mp-clock.h|  13 +-
 include/dt-bindings/power/imx8mp-power.h|  15 ++-
 include/dt-bindings/reset/imx8mp-reset.h|  50 
 11 files changed, 284 insertions(+), 180 deletions(-)
 create mode 100644 include/dt-bindings/reset/imx8mp-reset.h

diff --git a/arch/arm/dts/imx8mp-dhcom-pdk2.dts 
b/arch/arm/dts/imx8mp-dhcom-pdk2.dts
index e95abfb3e89..2ca2ede2e94 100644
--- a/arch/arm/dts/imx8mp-dhcom-pdk2.dts
+++ b/arch/arm/dts/imx8mp-dhcom-pdk2.dts
@@ -19,7 +19,6 @@
};
 
gpio-keys {
-   #size-cells = <0>;
compatible = "gpio-keys";
 
button-0 {
@@ -62,7 +61,7 @@
led {
compatible = "gpio-leds";
 
-   led-5 {
+   led-0 {
color = ;
default-state = "off";
function = LED_FUNCTION_INDICATOR;
@@ -71,7 +70,7 @@
pinctrl-names = "default";
};
 
-   led-6 {
+   led-1 {
color = ;
default-state = "off";
function = LED_FUNCTION_INDICATOR;
@@ -80,7 +79,7 @@
pinctrl-names = "default";
};
 
-   led-7 {
+   led-2 {
color = ;
default-state = "off";
function = LED_FUNCTION_INDICATOR;
@@ -89,7 +88,7 @@
pinctrl-names = "default";
};
 
-   led-8 {
+   led-3 {
color = ;
default-state = "off";
function = LED_FUNCTION_INDICATOR;
@@ -118,10 +117,11 @@
mdio {
ethphypdk: ethernet-phy@7 { /* KSZ 9021 */
compatible = "ethernet-phy-ieee802.3-c22";
-   interrupt-parent = <>;
-   interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <_ethphy1>;
pinctrl-names = "default";
+   interrupt-parent = <>;
+   interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+   max-speed = <100>;
reg = <7>;
reset-assert-us = <1000>;
reset-deassert-us = <1000>;
@@ -138,7 +138,6 @@
txd2-skew-ps = <0>;
txd3-skew-ps = <0>;
txen-skew-ps = <0>;
-   max-speed = <100>;
};
};
 };
@@ -150,3 +149,15 @@
 _1 {
fsl,over-current-active-low;
 };
+
+ {
+   /*
+* GPIO_A,B,C,D are connected to buttons.
+* GPIO_E,F,H,I are connected to LEDs.
+* GPIO_M is connected to CLKOUT2.
+*/
+   pinctrl-0 = <_hog_base
+_dhcom_g _dhcom_j
+_dhcom_k _dhcom_l
+_dhcom_int>;
+};
diff --git a/arch/arm/dts/imx8mp-dhcom-som.dtsi 
b/arch/arm/dts/imx8mp-dhcom-som.dtsi
index 63cc6c92c41..a616eb37800 100644
--- a/arch/arm/dts/imx8mp-dhcom-som.dtsi
+++ b/arch/arm/dts/imx8mp-dhcom-som.dtsi
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2021-2022 Marek Vasut 
  */
@@ -224,10 +224,6 @@
 };
 
  {
-   /*
-* iMX8MP 1P33A Errata ERR007805
-* I2C is limited to 384 kHz due to SoC bug.
-*/
clock-frequency = <10>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <_i2c3>;
@@ -393,10 +389,6 @@
 };
 
  {
-   /*
-* iMX8MP 1P33A Errata ERR007805
-* I2C is limited to 384 kHz due to SoC bug.
-*/
clock-frequency = <10>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <_i2c4>;
@@ -407,10 +399,6 @@
 };
 
  {/* HDMI EDID bus */
-   /*
-* iMX8MP 1P33A Errata ERR007805
-* I2C is limited to 384 kHz due to SoC bug.
-*/
clock-frequency = <10>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <_i2c5>;
@@ -802,8 +790,8 @@
 
pinctrl_i2c5: dhcom-i2c5-grp {
fsl,pins = <
-   MX8MP_IOMUXC_HDMI_DDC_SCL__HDMIMIX_HDMI_SCL 
0x4084
-   

[PATCH v2 8/8] imx8mm: synchronise device tree with linux

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Synchronise device tree with linux v6.0-rc1.

Signed-off-by: Marcel Ziswiler 

---

(no changes since v1)

 arch/arm/dts/imx8mm-beacon-baseboard.dtsi |  4 +-
 arch/arm/dts/imx8mm-evk.dtsi  | 43 +++
 arch/arm/dts/imx8mm-icore-mx8mm.dtsi  | 12 +++---
 arch/arm/dts/imx8mm-mx8menlo.dts  |  4 +-
 arch/arm/dts/imx8mm-u-boot.dtsi   |  2 +-
 arch/arm/dts/imx8mm-venice-gw700x.dtsi| 24 +--
 arch/arm/dts/imx8mm-venice-gw7901.dts |  8 ++--
 arch/arm/dts/imx8mm-venice-gw7902.dts | 10 ++---
 arch/arm/dts/imx8mm-venice-gw7903.dts |  6 +--
 arch/arm/dts/imx8mm-verdin.dtsi   | 10 -
 include/dt-bindings/interconnect/imx8mm.h | 50 +++
 11 files changed, 137 insertions(+), 36 deletions(-)
 create mode 100644 include/dt-bindings/interconnect/imx8mm.h

diff --git a/arch/arm/dts/imx8mm-beacon-baseboard.dtsi 
b/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
index f338a886d81..03266bd90a0 100644
--- a/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
@@ -285,14 +285,14 @@
  {
vbus-supply = <_usbotg1>;
disable-over-current;
-   dr_mode="otg";
+   dr_mode = "otg";
status = "okay";
 };
 
  {
pinctrl-names = "default";
disable-over-current;
-   dr_mode="host";
+   dr_mode = "host";
status = "okay";
 };
 
diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
index c42b966f7a6..7d6317d95b1 100644
--- a/arch/arm/dts/imx8mm-evk.dtsi
+++ b/arch/arm/dts/imx8mm-evk.dtsi
@@ -75,6 +75,11 @@
linux,autosuspend-period = <125>;
};
 
+   audio_codec_bt_sco: audio-codec-bt-sco {
+   compatible = "linux,bt-sco";
+   #sound-dai-cells = <1>;
+   };
+
wm8524: audio-codec {
#sound-dai-cells = <0>;
compatible = "wlf,wm8524";
@@ -83,6 +88,25 @@
wlf,mute-gpios = < 21 GPIO_ACTIVE_LOW>;
};
 
+   sound-bt-sco {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "bt-sco-audio";
+   simple-audio-card,format = "dsp_a";
+   simple-audio-card,bitclock-inversion;
+   simple-audio-card,frame-master = <>;
+   simple-audio-card,bitclock-master = <>;
+
+   btcpu: simple-audio-card,cpu {
+   sound-dai = <>;
+   dai-tdm-slot-num = <2>;
+   dai-tdm-slot-width = <16>;
+   };
+
+   simple-audio-card,codec {
+   sound-dai = <_codec_bt_sco 1>;
+   };
+   };
+
sound-wm8524 {
compatible = "simple-audio-card";
simple-audio-card,name = "wm8524-audio";
@@ -346,6 +370,16 @@
status = "okay";
 };
 
+ {
+   #sound-dai-cells = <0>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_sai2>;
+   assigned-clocks = < IMX8MM_CLK_SAI2>;
+   assigned-clock-parents = < IMX8MM_AUDIO_PLL1_OUT>;
+   assigned-clock-rates = <24576000>;
+   status = "okay";
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_sai3>;
@@ -494,6 +528,15 @@
>;
};
 
+   pinctrl_sai2: sai2grp {
+   fsl,pins = <
+   MX8MM_IOMUXC_SAI2_TXC_SAI2_TX_BCLK  0xd6
+   MX8MM_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0xd6
+   MX8MM_IOMUXC_SAI2_TXD0_SAI2_TX_DATA00xd6
+   MX8MM_IOMUXC_SAI2_RXD0_SAI2_RX_DATA00xd6
+   >;
+   };
+
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
diff --git a/arch/arm/dts/imx8mm-icore-mx8mm.dtsi 
b/arch/arm/dts/imx8mm-icore-mx8mm.dtsi
index b40148d728e..9e6170d9394 100644
--- a/arch/arm/dts/imx8mm-icore-mx8mm.dtsi
+++ b/arch/arm/dts/imx8mm-icore-mx8mm.dtsi
@@ -84,42 +84,42 @@
};
 
reg_buck1: buck1 {
-   regulator-min-microvolt =  <40>;
+   regulator-min-microvolt = <40>;
regulator-max-microvolt = <180>;
regulator-always-on;
regulator-boot-on;
};
 
reg_buck2: buck2 {
-   regulator-min-microvolt =  <40>;
+   regulator-min-microvolt = <40>;
regulator-max-microvolt = <180>;
regulator-always-on;
regulator-boot-on;
};
 
reg_buck3: buck3 {
-   regulator-min-microvolt =  <40>;
+   regulator-min-microvolt = 

[PATCH v2 7/8] imx8mn: synchronise device tree with linux

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Synchronise device tree with linux v6.0-rc1.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 arch/arm/dts/imx8mn-beacon-baseboard.dtsi |  4 +-
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi|  2 +-
 .../dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi  |  2 +-
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi  |  2 +-
 arch/arm/dts/imx8mn-evk.dtsi  | 45 ++-
 .../dts/imx8mn-var-som-symphony-u-boot.dtsi   |  2 +-
 arch/arm/dts/imx8mn-var-som-symphony.dts  |  6 +--
 arch/arm/dts/imx8mn-venice-gw7902.dts |  8 ++--
 arch/arm/dts/imx8mn-venice-u-boot.dtsi|  2 +-
 arch/arm/dts/imx8mn.dtsi  | 13 +++---
 include/dt-bindings/interconnect/imx8mn.h | 41 +
 11 files changed, 106 insertions(+), 21 deletions(-)
 create mode 100644 include/dt-bindings/interconnect/imx8mn.h

diff --git a/arch/arm/dts/imx8mn-beacon-baseboard.dtsi 
b/arch/arm/dts/imx8mn-beacon-baseboard.dtsi
index 02f37dcda7e..9e82069c941 100644
--- a/arch/arm/dts/imx8mn-beacon-baseboard.dtsi
+++ b/arch/arm/dts/imx8mn-beacon-baseboard.dtsi
@@ -146,7 +146,7 @@
 };
 
  {
-   fsl,asrc-rate  = <48000>;
+   fsl,asrc-rate = <48000>;
status = "okay";
 };
 
@@ -182,7 +182,7 @@
  {
vbus-supply = <_usb_otg_vbus>;
disable-over-current;
-   dr_mode="otg";
+   dr_mode = "otg";
status = "okay";
 };
 
diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi 
b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
index 5f839524028..6d8ba4c39af 100644
--- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
@@ -15,7 +15,7 @@
};
 };
 
-&{/soc@0} {
+ {
u-boot,dm-pre-reloc;
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi 
b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
index c4ae7ca4f31..8312b64bcc0 100644
--- a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
+++ b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
@@ -16,7 +16,7 @@
};
 };
 
-&{/soc@0} {
+ {
u-boot,dm-pre-reloc;
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 78773c198e4..edd9b959d09 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -21,7 +21,7 @@
};
 };
 
-&{/soc@0} {
+ {
u-boot,dm-pre-reloc;
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8mn-evk.dtsi b/arch/arm/dts/imx8mn-evk.dtsi
index d1f6cccfa00..261c3654007 100644
--- a/arch/arm/dts/imx8mn-evk.dtsi
+++ b/arch/arm/dts/imx8mn-evk.dtsi
@@ -47,6 +47,11 @@
linux,autosuspend-period = <125>;
};
 
+   audio_codec_bt_sco: audio-codec-bt-sco {
+   compatible = "linux,bt-sco";
+   #sound-dai-cells = <1>;
+   };
+
wm8524: audio-codec {
#sound-dai-cells = <0>;
compatible = "wlf,wm8524";
@@ -57,6 +62,25 @@
clock-names = "mclk";
};
 
+   sound-bt-sco {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "bt-sco-audio";
+   simple-audio-card,format = "dsp_a";
+   simple-audio-card,bitclock-inversion;
+   simple-audio-card,frame-master = <>;
+   simple-audio-card,bitclock-master = <>;
+
+   btcpu: simple-audio-card,cpu {
+   sound-dai = <>;
+   dai-tdm-slot-num = <2>;
+   dai-tdm-slot-width = <16>;
+   };
+
+   simple-audio-card,codec {
+   sound-dai = <_codec_bt_sco 1>;
+   };
+   };
+
sound-wm8524 {
compatible = "fsl,imx-audio-wm8524";
model = "wm8524-audio";
@@ -78,7 +102,7 @@
 };
 
  {
-   fsl,asrc-rate  = <48000>;
+   fsl,asrc-rate = <48000>;
status = "okay";
 };
 
@@ -183,6 +207,16 @@
};
 };
 
+ {
+   #sound-dai-cells = <0>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_sai2>;
+   assigned-clocks = < IMX8MN_CLK_SAI2>;
+   assigned-clock-parents = < IMX8MN_AUDIO_PLL1_OUT>;
+   assigned-clock-rates = <24576000>;
+   status = "okay";
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_sai3>;
@@ -354,6 +388,15 @@
>;
};
 
+   pinctrl_sai2: sai2grp {
+   fsl,pins = <
+   MX8MN_IOMUXC_SAI2_TXC_SAI2_TX_BCLK  0xd6
+   MX8MN_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0xd6
+   MX8MN_IOMUXC_SAI2_TXD0_SAI2_TX_DATA00xd6
+   MX8MN_IOMUXC_SAI2_RXD0_SAI2_RX_DATA00xd6
+   >;
+   };
+
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MN_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
diff --git 

[PATCH v2 4/8] imx8ulp: synchronise device tree with linux

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Synchronise device tree with linux v6.0-rc1.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- imx8ulp: Re-added s400_mu device tree node.

 arch/arm/dts/imx8ulp-evk-u-boot.dtsi  |  15 +-
 arch/arm/dts/imx8ulp-evk.dts  | 191 +-
 arch/arm/dts/imx8ulp-pinfunc.h|   4 +-
 arch/arm/dts/imx8ulp.dtsi | 564 +-
 include/dt-bindings/clock/imx8ulp-clock.h |  49 +-
 include/dt-bindings/power/imx8ulp-power.h |  26 +
 include/dt-bindings/reset/imx8ulp-pcc-reset.h |  59 ++
 7 files changed, 278 insertions(+), 630 deletions(-)
 create mode 100644 include/dt-bindings/power/imx8ulp-power.h
 create mode 100644 include/dt-bindings/reset/imx8ulp-pcc-reset.h

diff --git a/arch/arm/dts/imx8ulp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8ulp-evk-u-boot.dtsi
index 7c1dab2acfc..ad264f271ec 100644
--- a/arch/arm/dts/imx8ulp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8ulp-evk-u-boot.dtsi
@@ -3,7 +3,16 @@
  * Copyright 2021 NXP
  */
 
-&{/soc@0} {
+/ {
+   mu@2702 {
+   compatible = "fsl,imx8ulp-mu";
+   reg = <0 0x2702 0 0x1>;
+   status = "okay";
+   u-boot,dm-spl;
+   };
+};
+
+ {
u-boot,dm-spl;
 };
 
@@ -23,10 +32,6 @@
u-boot,dm-spl;
 };
 
-_mu {
-   u-boot,dm-spl;
-};
-
  {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx8ulp-evk.dts b/arch/arm/dts/imx8ulp-evk.dts
index da09ff48ff8..33e84c4e9ed 100644
--- a/arch/arm/dts/imx8ulp-evk.dts
+++ b/arch/arm/dts/imx8ulp-evk.dts
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright 2021 NXP
  */
@@ -8,17 +8,16 @@
 #include "imx8ulp.dtsi"
 
 / {
-   model = "FSL i.MX8ULP EVK";
+   model = "NXP i.MX8ULP EVK";
compatible = "fsl,imx8ulp-evk", "fsl,imx8ulp";
 
chosen {
stdout-path = 
-   bootargs = "console=ttyLP1,115200 earlycon";
};
 
-   usdhc2_pwrseq: usdhc2_pwrseq {
-   compatible = "mmc-pwrseq-simple";
-   reset-gpios = < 2 GPIO_ACTIVE_LOW>;
+   memory@8000 {
+   device_type = "memory";
+   reg = <0x0 0x8000 0 0x8000>;
};
 };
 
@@ -30,24 +29,25 @@
status = "okay";
 };
 
+ {
+   pinctrl-names = "default", "sleep";
+   pinctrl-0 = <_usdhc0>;
+   pinctrl-1 = <_usdhc0>;
+   non-removable;
+   bus-width = <8>;
+   status = "okay";
+};
+
  {
pinctrl_lpuart5: lpuart5grp {
fsl,pins = <
-   MX8ULP_PAD_PTF14__LPUART5_TX0x03
-   MX8ULP_PAD_PTF15__LPUART5_RX0x03
-   >;
-   };
-
-   pinctrl_lpi2c7: lpi2c7grp {
-   fsl,pins = <
-   MX8ULP_PAD_PTE12__LPI2C7_SCL0x27
-   MX8ULP_PAD_PTE13__LPI2C7_SDA0x27
+   MX8ULP_PAD_PTF14__LPUART5_TX0x3
+   MX8ULP_PAD_PTF15__LPUART5_RX0x3
>;
};
 
pinctrl_usdhc0: usdhc0grp {
fsl,pins = <
-   MX8ULP_PAD_PTD0__SDHC0_RESET_B  0x43
MX8ULP_PAD_PTD1__SDHC0_CMD  0x43
MX8ULP_PAD_PTD2__SDHC0_CLK  0x10042
MX8ULP_PAD_PTD10__SDHC0_D0  0x43
@@ -61,163 +61,4 @@
MX8ULP_PAD_PTD11__SDHC0_DQS 0x10042
>;
};
-
-   pinctrl_usdhc2_pte: usdhc2ptegrp {
-   fsl,pins = <
-   MX8ULP_PAD_PTE1__SDHC2_D0   0x43
-   MX8ULP_PAD_PTE0__SDHC2_D1   0x43
-   MX8ULP_PAD_PTE5__SDHC2_D2   0x43
-   MX8ULP_PAD_PTE4__SDHC2_D3   0x43
-   MX8ULP_PAD_PTE2__SDHC2_CLK  0x10042
-   MX8ULP_PAD_PTE3__SDHC2_CMD  0x43
-   MX8ULP_PAD_PTE7__PTE7   0x10003
-   >;
-   };
-
-   pinctrl_fec: fecgrp {
-   fsl,pins = <
-   MX8ULP_PAD_PTE14__ENET0_MDIO0x43
-   MX8ULP_PAD_PTE15__ENET0_MDC 0x43
-   MX8ULP_PAD_PTE18__ENET0_CRS_DV  0x43
-   MX8ULP_PAD_PTE17__ENET0_RXER0x43
-   MX8ULP_PAD_PTF1__ENET0_RXD0 0x43
-   MX8ULP_PAD_PTE20__ENET0_RXD10x43
-   MX8ULP_PAD_PTE16__ENET0_TXEN0x43
-   MX8ULP_PAD_PTE23__ENET0_TXD00x43
-   MX8ULP_PAD_PTE22__ENET0_TXD10x43
-   MX8ULP_PAD_PTE19__ENET0_REFCLK  0x10043
-   MX8ULP_PAD_PTF10__ENET0_1588_CLKIN 0x10043
-   >;
-   };
-
-   pinctrl_usbotg0_id: otg0idgrp {
-   fsl,pins = <
-   MX8ULP_PAD_PTF2__USB0_ID0x10003
-   >;
-   

[PATCH v2 0/8] arm: dts: imx: sync device trees with upstream linux kernel part 1

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 


This series synchronises them imx device trees with the upstream Linux
kernel (v6.0-rc1). I split it into two parts. This is part 1.

It also fixes a few issues as discussed during/after the pre-mature
application of my first series [1].

I am not touching kontron-sl-mx6ul as Frieder already took care of those
[2].

Feedback welcome. Thanks!

[1] 
https://patchwork.ozlabs.org/project/uboot/cover/20220721132748.1052244-1-mar...@ziswiler.com/
[2] 
https://patchwork.ozlabs.org/project/uboot/cover/20220823142917.306176-1-frie...@fris.de/

Changes in v2:
- imxrt1050: Re-added DDR timings aka semc node as pointed out by Fabio. Thanks!
- imx8ulp: Re-added s400_mu device tree node.

Marcel Ziswiler (8):
  vf610: synchronise device tree with linux
  imxrt1020: fix lpuart issue in common u-boot device tree
  imxrt1050: synchronise device tree with linux
  imx8ulp: synchronise device tree with linux
  imx8mq: synchronise device tree with linux
  imx8mp: synchronise device tree with linux
  imx8mn: synchronise device tree with linux
  imx8mm: synchronise device tree with linux

 arch/arm/dts/imx8mm-beacon-baseboard.dtsi |   4 +-
 arch/arm/dts/imx8mm-evk.dtsi  |  43 ++
 arch/arm/dts/imx8mm-icore-mx8mm.dtsi  |  12 +-
 arch/arm/dts/imx8mm-mx8menlo.dts  |   4 +-
 arch/arm/dts/imx8mm-u-boot.dtsi   |   2 +-
 arch/arm/dts/imx8mm-venice-gw700x.dtsi|  24 +-
 arch/arm/dts/imx8mm-venice-gw7901.dts |   8 +-
 arch/arm/dts/imx8mm-venice-gw7902.dts |  10 +-
 arch/arm/dts/imx8mm-venice-gw7903.dts |   6 +-
 arch/arm/dts/imx8mm-verdin.dtsi   |  10 +-
 arch/arm/dts/imx8mn-beacon-baseboard.dtsi |   4 +-
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi|   2 +-
 .../dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi  |   2 +-
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi  |   2 +-
 arch/arm/dts/imx8mn-evk.dtsi  |  45 +-
 .../dts/imx8mn-var-som-symphony-u-boot.dtsi   |   2 +-
 arch/arm/dts/imx8mn-var-som-symphony.dts  |   6 +-
 arch/arm/dts/imx8mn-venice-gw7902.dts |   8 +-
 arch/arm/dts/imx8mn-venice-u-boot.dtsi|   2 +-
 arch/arm/dts/imx8mn.dtsi  |  13 +-
 arch/arm/dts/imx8mp-dhcom-pdk2.dts|  27 +-
 arch/arm/dts/imx8mp-dhcom-som.dtsi|  20 +-
 arch/arm/dts/imx8mp-evk.dts   | 126 ++--
 arch/arm/dts/imx8mp-phyboard-pollux-rdk.dts   |  48 +-
 arch/arm/dts/imx8mp-u-boot.dtsi   |   2 +-
 arch/arm/dts/imx8mp-venice-gw74xx.dts | 116 ++--
 arch/arm/dts/imx8mp-verdin.dtsi   |  14 +-
 arch/arm/dts/imx8mp.dtsi  |  33 +-
 arch/arm/dts/imx8mq-evk.dts   |  43 ++
 arch/arm/dts/imx8mq-u-boot.dtsi   |  10 +-
 arch/arm/dts/imx8mq.dtsi  |  15 +-
 arch/arm/dts/imx8ulp-evk-u-boot.dtsi  |  15 +-
 arch/arm/dts/imx8ulp-evk.dts  | 191 +-
 arch/arm/dts/imx8ulp-pinfunc.h|   4 +-
 arch/arm/dts/imx8ulp.dtsi | 564 +-
 arch/arm/dts/imxrt1020-evk-u-boot.dtsi|   7 +-
 arch/arm/dts/imxrt1020-evk.dts|   1 -
 arch/arm/dts/imxrt1050-evk-u-boot.dtsi| 155 -
 arch/arm/dts/imxrt1050-evk.dts| 257 +---
 arch/arm/dts/imxrt1050-pinfunc.h  |   2 +-
 arch/arm/dts/imxrt1050.dtsi   | 168 +++---
 arch/arm/dts/vf610-pinfunc.h  |   2 +-
 include/dt-bindings/clock/imx8mp-clock.h  |  13 +-
 include/dt-bindings/clock/imx8ulp-clock.h |  49 +-
 include/dt-bindings/clock/imxrt1050-clock.h   |   9 +-
 include/dt-bindings/interconnect/imx8mm.h |  50 ++
 include/dt-bindings/interconnect/imx8mn.h |  41 ++
 include/dt-bindings/power/imx8mp-power.h  |  15 +-
 include/dt-bindings/power/imx8ulp-power.h |  26 +
 include/dt-bindings/reset/imx8mp-reset.h  |  50 ++
 include/dt-bindings/reset/imx8mq-reset.h  |  61 +-
 include/dt-bindings/reset/imx8ulp-pcc-reset.h |  59 ++
 52 files changed, 1146 insertions(+), 1256 deletions(-)
 create mode 100644 include/dt-bindings/interconnect/imx8mm.h
 create mode 100644 include/dt-bindings/interconnect/imx8mn.h
 create mode 100644 include/dt-bindings/power/imx8ulp-power.h
 create mode 100644 include/dt-bindings/reset/imx8mp-reset.h
 create mode 100644 include/dt-bindings/reset/imx8ulp-pcc-reset.h

-- 
2.35.1



[PATCH v2 3/8] imxrt1050: synchronise device tree with linux

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Synchronise device tree with linux v6.0-rc1.

Signed-off-by: Marcel Ziswiler 

---

Changes in v2:
- imxrt1050: Re-added DDR timings aka semc node as pointed out by Fabio. Thanks!

 arch/arm/dts/imxrt1050-evk-u-boot.dtsi  | 155 ++--
 arch/arm/dts/imxrt1050-evk.dts  | 257 +++-
 arch/arm/dts/imxrt1050-pinfunc.h|   2 +-
 arch/arm/dts/imxrt1050.dtsi | 168 ++---
 include/dt-bindings/clock/imxrt1050-clock.h |   9 +-
 5 files changed, 248 insertions(+), 343 deletions(-)

diff --git a/arch/arm/dts/imxrt1050-evk-u-boot.dtsi 
b/arch/arm/dts/imxrt1050-evk-u-boot.dtsi
index 617cece448a..7db53b19c2f 100644
--- a/arch/arm/dts/imxrt1050-evk-u-boot.dtsi
+++ b/arch/arm/dts/imxrt1050-evk-u-boot.dtsi
@@ -4,6 +4,8 @@
  * Author(s): Giulio Benetti 
  */
 
+#include 
+
 / {
chosen {
u-boot,dm-spl;
@@ -15,6 +17,52 @@
 
soc {
u-boot,dm-spl;
+
+   semc@402f {
+   compatible = "fsl,imxrt-semc";
+   clocks = < IMXRT1050_CLK_SEMC>;
+   pinctrl-0 = <_semc>;
+   pinctrl-names = "default";
+   reg = <0x402f 0x4000>;
+   status = "okay";
+   u-boot,dm-spl;
+
+   /*
+* Memory configuration from sdram datasheet 
IS42S16160J-6BLI
+*/
+   fsl,sdram-mux = /bits/ 8 ;
+   fsl,sdram-control = /bits/ 8 ;
+   fsl,sdram-timing = /bits/ 8 <0x2
+0x2
+0x9
+0x1
+0x5
+0x6
+
+0x20
+0x09
+0x01
+0x00
+
+0x04
+0x0A
+0x21
+0x50>;
+
+   bank1: bank@0 {
+   fsl,base-address = <0x8000>;
+   fsl,memory-size = ;
+   u-boot,dm-spl;
+   };
+   };
};
 };
 
@@ -50,7 +98,7 @@
u-boot,dm-spl;
 };
 
- {
+ {
u-boot,dm-spl;
 };
 
@@ -58,33 +106,108 @@
u-boot,dm-spl;
 };
 
- {
-   u-boot,dm-spl;
-
-   bank1: bank@0 {
-   u-boot,dm-spl;
-   };
-};
-
  {
u-boot,dm-spl;
 
imxrt1050-evk {
u-boot,dm-spl;
-   pinctrl_lpuart1: lpuart1grp {
-   u-boot,dm-spl;
-   };
 
pinctrl_semc: semcgrp {
-   u-boot,dm-spl;
-   };
-
-   pinctrl_usdhc0: usdhc0grp {
+   fsl,pins = <
+   MXRT1050_IOMUXC_GPIO_EMC_00_SEMC_DA00
+   0xf1/* SEMC_D0 */
+   MXRT1050_IOMUXC_GPIO_EMC_01_SEMC_DA01
+   0xf1/* SEMC_D1 */
+   MXRT1050_IOMUXC_GPIO_EMC_02_SEMC_DA02
+   0xf1/* SEMC_D2 */
+   MXRT1050_IOMUXC_GPIO_EMC_03_SEMC_DA03
+   0xf1/* SEMC_D3 */
+   MXRT1050_IOMUXC_GPIO_EMC_04_SEMC_DA04
+   0xf1/* SEMC_D4 */
+   MXRT1050_IOMUXC_GPIO_EMC_05_SEMC_DA05
+   0xf1/* SEMC_D5 */
+   MXRT1050_IOMUXC_GPIO_EMC_06_SEMC_DA06
+   0xf1/* SEMC_D6 */
+   MXRT1050_IOMUXC_GPIO_EMC_07_SEMC_DA07
+   0xf1/* SEMC_D7 */
+   MXRT1050_IOMUXC_GPIO_EMC_08_SEMC_DM00
+   0xf1/* SEMC_DM0 */
+   MXRT1050_IOMUXC_GPIO_EMC_09_SEMC_ADDR00
+   0xf1/* SEMC_A0 */
+   MXRT1050_IOMUXC_GPIO_EMC_10_SEMC_ADDR01
+   0xf1/* SEMC_A1 */
+   MXRT1050_IOMUXC_GPIO_EMC_11_SEMC_ADDR02
+   0xf1/* SEMC_A2 */
+   MXRT1050_IOMUXC_GPIO_EMC_12_SEMC_ADDR03
+   0xf1

[PATCH v2 5/8] imx8mq: synchronise device tree with linux

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Synchronise device tree with linux v6.0-rc1.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 arch/arm/dts/imx8mq-evk.dts  | 43 +
 arch/arm/dts/imx8mq-u-boot.dtsi  | 10 ++--
 arch/arm/dts/imx8mq.dtsi | 15 +++---
 include/dt-bindings/reset/imx8mq-reset.h | 61 +---
 4 files changed, 88 insertions(+), 41 deletions(-)

diff --git a/arch/arm/dts/imx8mq-evk.dts b/arch/arm/dts/imx8mq-evk.dts
index 99fed35168e..82387b9cb80 100644
--- a/arch/arm/dts/imx8mq-evk.dts
+++ b/arch/arm/dts/imx8mq-evk.dts
@@ -71,12 +71,36 @@
linux,autosuspend-period = <125>;
};
 
+   audio_codec_bt_sco: audio-codec-bt-sco {
+   compatible = "linux,bt-sco";
+   #sound-dai-cells = <1>;
+   };
+
wm8524: audio-codec {
#sound-dai-cells = <0>;
compatible = "wlf,wm8524";
wlf,mute-gpios = < 8 GPIO_ACTIVE_LOW>;
};
 
+   sound-bt-sco {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "bt-sco-audio";
+   simple-audio-card,format = "dsp_a";
+   simple-audio-card,bitclock-inversion;
+   simple-audio-card,frame-master = <>;
+   simple-audio-card,bitclock-master = <>;
+
+   btcpu: simple-audio-card,cpu {
+   sound-dai = <>;
+   dai-tdm-slot-num = <2>;
+   dai-tdm-slot-width = <16>;
+   };
+
+   simple-audio-card,codec {
+   sound-dai = <_codec_bt_sco 1>;
+   };
+   };
+
sound-wm8524 {
compatible = "simple-audio-card";
simple-audio-card,name = "wm8524-audio";
@@ -386,6 +410,16 @@
status = "okay";
 };
 
+ {
+   #sound-dai-cells = <0>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_sai3>;
+   assigned-clocks = < IMX8MQ_CLK_SAI3>;
+   assigned-clock-parents = < IMX8MQ_AUDIO_PLL1_OUT>;
+   assigned-clock-rates = <24576000>;
+   status = "okay";
+};
+
 _pwrkey {
status = "okay";
 };
@@ -548,6 +582,15 @@
>;
};
 
+   pinctrl_sai3: sai3grp {
+   fsl,pins = <
+   MX8MQ_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
+   MX8MQ_IOMUXC_SAI3_TXC_SAI3_TX_BCLK  0xd6
+   MX8MQ_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6
+   MX8MQ_IOMUXC_SAI3_RXD_SAI3_RX_DATA0 0xd6
+   >;
+   };
+
pinctrl_spdif1: spdif1grp {
fsl,pins = <
MX8MQ_IOMUXC_SPDIF_TX_SPDIF1_OUT0xd6
diff --git a/arch/arm/dts/imx8mq-u-boot.dtsi b/arch/arm/dts/imx8mq-u-boot.dtsi
index e8b5f83706e..e6448ab8ad3 100644
--- a/arch/arm/dts/imx8mq-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-u-boot.dtsi
@@ -10,23 +10,23 @@
 
 };
 
-&{/soc@0} {
+ {
u-boot,dm-spl;
 };
 
-&{/soc@0/bus@3000} {
+ {
u-boot,dm-spl;
 };
 
-&{/soc@0/bus@3040} {
+ {
u-boot,dm-spl;
 };
 
-&{/soc@0/bus@3080} {
+ {
u-boot,dm-spl;
 };
 
-&{/soc@0/bus@32c0} {
+ {
u-boot,dm-spl;
 };
 
diff --git a/arch/arm/dts/imx8mq.dtsi b/arch/arm/dts/imx8mq.dtsi
index 49eadb081b1..e9f0cdd10ab 100644
--- a/arch/arm/dts/imx8mq.dtsi
+++ b/arch/arm/dts/imx8mq.dtsi
@@ -94,7 +94,7 @@
clk_ext4: clock-ext4 {
compatible = "fixed-clock";
#clock-cells = <0>;
-   clock-frequency= <13300>;
+   clock-frequency = <13300>;
clock-output-names = "clk_ext4";
};
 
@@ -320,7 +320,7 @@
arm,no-tick-in-suspend;
};
 
-   soc@0 {
+   soc: soc@0 {
compatible = "fsl,imx8mq-soc", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
@@ -329,7 +329,7 @@
nvmem-cells = <_uid>;
nvmem-cell-names = "soc_unique_id";
 
-   bus@3000 { /* AIPS1 */
+   aips1: bus@3000 { /* AIPS1 */
compatible = "fsl,aips-bus", "simple-bus";
reg = <0x3000 0x40>;
#address-cells = <1>;
@@ -507,7 +507,7 @@
  <0x00030005 0x0053>,
  <0x00030006 0x005f>,
  <0x00030007 0x0071>;
-   #thermal-sensor-cells =  <1>;
+   #thermal-sensor-cells = <1>;
};
 
wdog1: watchdog@3028 {
@@ -784,7 +784,7 @@
};
};
 
-   bus@3040 { /* AIPS2 */
+   aips2: bus@3040 { /* AIPS2 */
compatible = "fsl,aips-bus", 

[PATCH v2 2/8] imxrt1020: fix lpuart issue in common u-boot device tree

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix lpuart issue in common U-Boot device tree.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 arch/arm/dts/imxrt1020-evk-u-boot.dtsi | 7 ---
 arch/arm/dts/imxrt1020-evk.dts | 1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/dts/imxrt1020-evk-u-boot.dtsi 
b/arch/arm/dts/imxrt1020-evk-u-boot.dtsi
index 9e1b074d2e7..7cab486f5fa 100644
--- a/arch/arm/dts/imxrt1020-evk-u-boot.dtsi
+++ b/arch/arm/dts/imxrt1020-evk-u-boot.dtsi
@@ -67,9 +67,6 @@
 
imxrt1020-evk {
u-boot,dm-spl;
-   pinctrl_lpuart1: lpuart1grp {
-   u-boot,dm-spl;
-   };
 
pinctrl_semc: semcgrp {
u-boot,dm-spl;
@@ -81,6 +78,10 @@
};
 };
 
+_lpuart1 {
+   u-boot,dm-spl;
+};
+
  {
u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imxrt1020-evk.dts b/arch/arm/dts/imxrt1020-evk.dts
index 22ae5ed7359..d4d1de4ea84 100644
--- a/arch/arm/dts/imxrt1020-evk.dts
+++ b/arch/arm/dts/imxrt1020-evk.dts
@@ -6,7 +6,6 @@
 
 /dts-v1/;
 #include "imxrt1020.dtsi"
-#include "imxrt1020-evk-u-boot.dtsi"
 #include "imxrt1020-pinfunc.h"
 
 / {
-- 
2.35.1



[PATCH v2 1/8] vf610: synchronise device tree with linux

2022-08-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Synchronise device tree with linux v6.0-rc1 plus the recent DDR pinmux
addition still being in-flight.

Signed-off-by: Marcel Ziswiler 
---

(no changes since v1)

 arch/arm/dts/vf610-pinfunc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/vf610-pinfunc.h b/arch/arm/dts/vf610-pinfunc.h
index 740276431aa..b7b7322a2d1 100644
--- a/arch/arm/dts/vf610-pinfunc.h
+++ b/arch/arm/dts/vf610-pinfunc.h
@@ -802,7 +802,6 @@
 #define VF610_PAD_PTE28__EWM_OUT   0x214 0x000 ALT7 0x0
 #define VF610_PAD_PTA7__GPIO_134   0x218 0x000 ALT0 0x0
 #define VF610_PAD_PTA7__VIU_PIX_CLK0x218 0x3AC ALT1 0x1
-
 #define VF610_PAD_DDR_RESETB   0x21c 0x000 ALT0 0x0
 #define VF610_PAD_DDR_A15__DDR_A_150x220 0x000 ALT0 0x0
 #define VF610_PAD_DDR_A14__DDR_A_140x224 0x000 ALT0 0x0
@@ -853,4 +852,5 @@
 #define VF610_PAD_DDR_ODT0__DDR_ODT_1  0x2d8 0x000 ALT0 0x0
 #define VF610_PAD_DDR_DDRBYTE1__DDR_DDRBYTE1   0x2dc 0x000 ALT0 0x0
 #define VF610_PAD_DDR_DDRBYTE2__DDR_DDRBYTE2   0x2e0 0x000 ALT0 0x0
+
 #endif
-- 
2.35.1



Re: [RFC PATCH v1 3/9] clk: renesas: add R906G032 driver

2022-08-26 Thread Ralph Siemsen

On Tue, Aug 23, 2022 at 12:14:31AM -0400, Sean Anderson wrote:
Regarding the unused fields (scon, mirack, mistat): I am not really 
sure what their purpose is. Maybe there is some value in having them. 
I'll try to find out more information about them. If we do decide to 
drop them, I would like to keep it synchronised with the Linux driver.


OK, well if you don't use them then perhaps you can just leave them in
the macro but remove them from the struct. That way you can add support
for them later if you need to, but they don't take up space in the mean
time. A comment summarizing your explanation above would be helpful.


I did figure out (mostly) what they are for, so I can see some value in 
keeping at least some of them. But as you said, they are currently 
unused, so dropping them from the structure make sense.


I have prepared patches for this firstly on the kernel side, and then I 
will make the same change in this u-boot driver. Stay tuned :-)


I think it happened before I started working on RZ/N1, but there 
seemed to be quite a few iterations on how to represent the clock 
tree. At one point there were macros to assign/construct the bitfield 
values. And then a different way, and eventually the direct hex values 
you now see in the clock tables.


At the risk of re-opening old wounds (luckily not mine) I decided to 
just leave this part exactly as-is in the Linux driver.


Can you link to that discussion? The earliest discussion of that
series I could find was [1], and there's no mention of the encoding.
This encoding scheme seems to be used only for this SoC, and not for
any of the other renesas drivers. I suspect that this just wasn't
reviewed in detail the first time around...

[1] 
https://lore.kernel.org/all/1527154169-32380-6-git-send-email-michel.pol...@bp.renesas.com/


That link [1] is the current driver, which uses the packed encoding 
(with a register offset and bit number stored as a packed uint16_t).


This is based (loosely) on an earlier version of the driver, which you 
can find in the Schneider kernel repo [2] on the 4.19 and older branch.
This version stores clock information is in the device tree [3] and uses 
_BIT() macro in the clock tables [4]


[2] 
https://github.com/renesas-rz/rzn1_linux/tree/rzn1-stable-v4.19/drivers/clk/rzn1

[3] 
https://github.com/renesas-rz/rzn1_linux/blob/rzn1-stable-v4.19/arch/arm/boot/dts/rzn1-clocks.dtsi

[4] 
https://github.com/renesas-rz/rzn1_linux/blob/rzn1-stable-v4.19/drivers/clk/rzn1/rzn1-clkctrl-tables.h

Evidently this was not deemed suitable, and thus morphed into the 
version that did get merged [1]. At least that is my guess, I don't know 
for sure what transpired.


I have modified the clock table so that the register offset and bitnum 
are explicit values, rather than packed together. I will run this up the 
kernel side and see if they agree. Am still trying to test it though...



In fact quite a few of them are in the dt-bindings already, see 
include/dt-bindings/clock/r9a06g032-sysctrl.h


I'm not really sure why some of these are defined in the .C file while 
others are in the dt-bindings header. Like much of the other bits, 
this was something I just carried over as-is from the Linux driver.


I think these are "internal" clocks (that is, clocks which don't really
exist like intermediate dividers) whereas the others are public-facing
clocks. It's up to you, but maybe have a comment noting where the other
ids come from.


I guess that is plausible explanation.. I will add a comment...


+    else
+    parent->id = desc->source - 1;
+
+    parent->dev = clk->dev;


I think you need to clk_request here.


Normally clk_request is called by a driver wishing to use a particular 
clock. That is not the case here. This is in a helper function used to 
compute the current rate of a given clock. It only looks at the local 
table (struct r9a06g032_clkdsc).


You call clk_get_rate on it. Any time you "create" a new clock, you
must call clk_request.


So the situation here is similar to that on the mediatek patches from 
Weijie Gao [5], where you made a similar comment. These are not real 
clocks, they have no ops->request, and the only field used is clk->id.
This is done primarily to avoid a bunch of malloc of struct clk, 
particularly in the early u-boot (before relocation).
 
[5] https://lore.kernel.org/all/31b0e1313267c8d342e0e3d1c9f15eaa8e666114.ca...@mediatek.com/


It is for a different clock type. However I will see if I do something 
to avoid the duplication.


I mean in r9a06g032_clk_get_parent_rate. You can also just do

if (!parent_rate)
...


I've fixed this (and several similar instances elsewhere).


DIV_ROUND_CLOSEST?


I'm hesitant to change the logic on this, as it could subtly alter the values.


Well if you have 2MHz divided by 3, the resulting rate is closer to
67 kHz than 66 Hz.


While I can't argue with the math, the linux driver upon which this is 
based uses DIV_ROUND_UP everywhere. Maybe 

[PATCH v5 8/8] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

This new image is similar to u-boot-rockchip.bin except that it's
destined to be flashed on SPI-NOR flashes.

Cc: Quentin Schulz 
Signed-off-by: Quentin Schulz 
---

v3:
 - added filename property so that idblaoder-spi.img binary is generated
 by binman, as per community request,
 - added new temporary files to the list of files to clean up on `make
 clean`,

 Makefile  |  3 ++-
 arch/arm/dts/rockchip-u-boot.dtsi | 30 ++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 736c4ad182..e70e92c947 100644
--- a/Makefile
+++ b/Makefile
@@ -2197,7 +2197,8 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h 
\
   idbloader.img flash.bin flash.log defconfig keep-syms-lto.c \
   mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \
   itb.fit.fit itb.fit.itb itb.map spl.map mkimage-out.rom.mkimage \
-  mkimage.rom.mkimage rom.map simple-bin.map
+  mkimage.rom.mkimage rom.map simple-bin.map simple-bin-spi.map \
+  idbloader-spi.img
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi 
b/arch/arm/dts/rockchip-u-boot.dtsi
index f90a8bf085..584f21eb5b 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -39,5 +39,35 @@
offset = ;
};
};
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+   simple-bin-spi {
+   filename = "u-boot-rockchip-spi.bin";
+   pad-byte = <0xff>;
+
+   mkimage {
+   filename = "idbloader-spi.img";
+   args = "-n", CONFIG_SYS_SOC, "-T", "rkspi";
+#ifdef CONFIG_TPL
+   multiple-data-files;
+
+   u-boot-tpl {
+   };
+#endif
+   u-boot-spl {
+   };
+   };
+
+#ifdef CONFIG_ARM64
+   blob {
+   filename = "u-boot.itb";
+#else
+   u-boot-img {
+#endif
+   /* Sync with u-boot,spl-payload-offset if present */
+   offset = ;
+   };
+   };
+#endif
 };
 #endif
-- 
2.37.2



[PATCH v5 7/8] rockchip: allow to build SPI images even without HAS_ROM option

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

This prepares for the creation of a u-boot-rockchip-spi.bin image
similar to u-boot-rockchip.bin to the exception it's destined for
SPI-NOR flashes instead of MMC storage medium.

Cc: Quentin Schulz 
Signed-off-by: Quentin Schulz 
---
 arch/arm/dts/rk3288-u-boot.dtsi | 2 +-
 arch/arm/dts/rk3399-u-boot.dtsi | 2 +-
 arch/arm/mach-rockchip/Kconfig  | 6 ++
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
index 9eb696b141..e411445ed6 100644
--- a/arch/arm/dts/rk3288-u-boot.dtsi
+++ b/arch/arm/dts/rk3288-u-boot.dtsi
@@ -56,7 +56,7 @@
};
 };
 
-#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM)
  {
rom {
filename = "u-boot.rom";
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 716b9a433a..3c1a15fe51 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -60,7 +60,7 @@
 
 };
 
-#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM)
  {
rom {
filename = "u-boot.rom";
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index c561a77e6a..b46cea2f91 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -425,12 +425,10 @@ config SPL_MMC
 
 config ROCKCHIP_SPI_IMAGE
bool "Build a SPI image for rockchip"
-   depends on HAS_ROM
help
  Some Rockchip SoCs support booting from SPI flash. Enable this
- option to produce a 4MB SPI-flash image (called u-boot.rom)
- containing U-Boot. The image is built by binman. U-Boot sits near
- the start of the image.
+ option to produce a SPI-flash image containing U-Boot. The image
+ is built by binman. U-Boot sits near the start of the image.
 
 config LNX_KRNL_IMG_TEXT_OFFSET_BASE
default SYS_TEXT_BASE
-- 
2.37.2



[PATCH v5 6/8] rockchip: simplify binman image dependencies addition to INPUTS

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

By factoring SPL check in the first condition, this makes the checks a
bit less convoluted and more readable.

Cc: Quentin Schulz 
Signed-off-by: Quentin Schulz 
---

v4:
 - fixed wrong place for endif for ARM32 boards,

 Makefile | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 1dee09eb36..736c4ad182 100644
--- a/Makefile
+++ b/Makefile
@@ -1001,19 +1001,14 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 INPUTS-y += u-boot-with-dtb.bin
 endif
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-# On ARM64 this target is produced by binman so we don't need this dep
+ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
+# Binman image dependencies
 ifeq ($(CONFIG_ARM64),y)
-ifeq ($(CONFIG_SPL),y)
 INPUTS-y += u-boot.itb
-endif
 else
-ifeq ($(CONFIG_SPL),y)
-# Generate these inputs for binman which will create the output files
 INPUTS-y += u-boot.img
 endif
 endif
-endif
 
 INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \
$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
-- 
2.37.2



[PATCH v5 5/8] rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

This allows to build u-boot-rockchip.bin binary with binman for Rockchip
ARM64 boards instead of the legacy Makefile way.

Cc: Quentin Schulz 
Reviewed-by: Simon Glass 
Signed-off-by: Quentin Schulz 
---

v4:
 - added Reviewed-by,

 Makefile  | 26 +-
 arch/arm/Kconfig  |  2 +-
 arch/arm/dts/rockchip-u-boot.dtsi |  5 +
 3 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
index dbe1aa254a..1dee09eb36 100644
--- a/Makefile
+++ b/Makefile
@@ -1005,8 +1005,7 @@ ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
 # On ARM64 this target is produced by binman so we don't need this dep
 ifeq ($(CONFIG_ARM64),y)
 ifeq ($(CONFIG_SPL),y)
-# TODO: Get binman to generate this too
-INPUTS-y += u-boot-rockchip.bin
+INPUTS-y += u-boot.itb
 endif
 else
 ifeq ($(CONFIG_SPL),y)
@@ -1498,29 +1497,6 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
 u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
$(call if_changed,pad_cat)
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-
-# TPL + SPL
-ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
-MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T rksd
-tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
-   $(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
-   $(call if_changed,cat)
-else
-MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T rksd
-idbloader.img: spl/u-boot-spl.bin FORCE
-   $(call if_changed,mkimage)
-endif
-
-ifeq ($(CONFIG_ARM64),y)
-OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \
-   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
-u-boot-rockchip.bin: idbloader.img u-boot.itb FORCE
-   $(call if_changed,pad_cat)
-endif # CONFIG_ARM64
-
-endif # CONFIG_ARCH_ROCKCHIP
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
 MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0b72e4f650..82cd456f51 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1974,7 +1974,7 @@ config ARCH_STM32MP
 config ARCH_ROCKCHIP
bool "Support Rockchip SoCs"
select BLK
-   select BINMAN if SPL_OPTEE || (SPL && !ARM64)
+   select BINMAN if SPL_OPTEE || SPL
select DM
select DM_GPIO
select DM_I2C
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi 
b/arch/arm/dts/rockchip-u-boot.dtsi
index ad72ca9700..f90a8bf085 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -30,7 +30,12 @@
};
};
 
+#ifdef CONFIG_ARM64
+   blob {
+   filename = "u-boot.itb";
+#else
u-boot-img {
+#endif
offset = ;
};
};
-- 
2.37.2



[PATCH v5 4/8] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

idbloader.img content - currently created by way of Makefile - can be
created by binman directly.

So let's do that for Rockchip ARM platforms.

Cc: Quentin Schulz 
Reviewed-by: Simon Glass 
Signed-off-by: Quentin Schulz 
---
v4:
 - added Reviewed-by,

v3:
 - moved spl back into mkimage section,
 - added filename property so that the idbloader.img binary is still
 generated,
 Makefile  |  2 +-
 arch/arm/dts/rockchip-u-boot.dtsi | 11 ++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 5750a9e4b8..dbe1aa254a 100644
--- a/Makefile
+++ b/Makefile
@@ -1011,7 +1011,7 @@ endif
 else
 ifeq ($(CONFIG_SPL),y)
 # Generate these inputs for binman which will create the output files
-INPUTS-y += idbloader.img u-boot.img
+INPUTS-y += u-boot.img
 endif
 endif
 endif
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi 
b/arch/arm/dts/rockchip-u-boot.dtsi
index eae3ee715d..ad72ca9700 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -17,8 +17,17 @@
filename = "u-boot-rockchip.bin";
pad-byte = <0xff>;
 
-   blob {
+   mkimage {
filename = "idbloader.img";
+   args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+#ifdef CONFIG_TPL
+   multiple-data-files;
+
+   u-boot-tpl {
+   };
+#endif
+   u-boot-spl {
+   };
};
 
u-boot-img {
-- 
2.37.2



[PATCH v5 3/8] rockchip: remove binman temporary files when cleaning

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

Binman mkimage entry generates temporary files so let's remove them
when calling `make clean`.

Fixes: 9b312e26fc77 ("rockchip: Enable building a SPI ROM image on jerry")
Cc: Quentin Schulz 
Reported-by: Johan Jonker 
Signed-off-by: Quentin Schulz 
---

added in v3

 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 541e942ed5..5750a9e4b8 100644
--- a/Makefile
+++ b/Makefile
@@ -2225,7 +2225,8 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h 
\
   lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
   idbloader.img flash.bin flash.log defconfig keep-syms-lto.c \
   mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \
-  itb.fit.fit itb.fit.itb itb.map spl.map
+  itb.fit.fit itb.fit.itb itb.map spl.map mkimage-out.rom.mkimage \
+  mkimage.rom.mkimage rom.map simple-bin.map
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
-- 
2.37.2



[PATCH v5 2/8] binman: allow user-defined filenames for mkimage entry

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

mkimage entry currently creates a file whose name is derived from the
section name containing said entry.

Let's allow the user to define a filename for the mkimage-generated
binary by using the 'filename' DT property.

Cc: Quentin Schulz 
Signed-off-by: Quentin Schulz 
---

v5:
 - updated unit test filename,
 - removed _testing section in unit test,
 - removed -n arg in unit test,
 - removed size property in binman node,

v4:
 - added binman test,
 - fixed >80 chars-long line,

added in v3

 tools/binman/etype/mkimage.py  | 11 ---
 tools/binman/ftest.py  |  7 +++
 tools/binman/test/242_mkimage_filename.dts | 18 ++
 3 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 tools/binman/test/242_mkimage_filename.dts

diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py
index 5f4bc6fa3c..c2288c48ee 100644
--- a/tools/binman/etype/mkimage.py
+++ b/tools/binman/etype/mkimage.py
@@ -21,11 +21,13 @@ class Entry_mkimage(Entry):
 - multiple-data-files: boolean to tell binman to pass all files as
   datafiles to mkimage instead of creating a temporary file the result
   of datafiles concatenation
+- filename: filename of output binary generated by mkimage
 
 The data passed to mkimage via the -d flag is collected from subnodes of 
the
 mkimage node, e.g.::
 
 mkimage {
+filename = "imximage.bin";
 args = "-n test -T imximage";
 
 u-boot-spl {
@@ -38,8 +40,9 @@ class Entry_mkimage(Entry):
 mkimage -d  -n test -T imximage 
 
 The output from mkimage then becomes part of the image produced by
-binman. If you need to put multiple things in the data file, you can use
-a section, or just multiple subnodes like this::
+binman but also is written into `imximage.bin` file. If you need to put
+multiple things in the data file, you can use a section, or just multiple
+subnodes like this::
 
 mkimage {
 args = "-n test -T imximage";
@@ -121,6 +124,7 @@ class Entry_mkimage(Entry):
 self._multiple_data_files = fdt_util.GetBool(self._node, 
'multiple-data-files')
 self._mkimage_entries = OrderedDict()
 self._imagename = None
+self._filename = fdt_util.GetString(self._node, 'filename')
 self.align_default = None
 
 def ReadNode(self):
@@ -164,7 +168,8 @@ class Entry_mkimage(Entry):
 [self._imagename], 'mkimage-n', 1024)
 if image_data is None:
 return False
-output_fname = tools.get_output_filename('mkimage-out.%s' % uniq)
+outfile = self._filename if self._filename else 'mkimage-out.%s' % uniq
+output_fname = tools.get_output_filename(outfile)
 
 args = ['-d', input_fname]
 if self._data_to_imagename:
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 091692ef93..da0c7299ac 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -5834,6 +5834,13 @@ fdt fdtmapExtract the devicetree 
blob from the fdtmap
 expect += U_BOOT_SPL_DATA
 self.assertEqual(expect, data[-len(expect):])
 
+def testMkimageFilename(self):
+"""Test using mkimage to build a binary with a filename"""
+retcode = self._DoTestFile('242_mkimage_filename.dts')
+self.assertEqual(0, retcode)
+fname = tools.get_output_filename('mkimage-test.bin')
+self.assertTrue(os.path.exists(fname))
+
 def testCompressDtbPrependInvalid(self):
 """Test that invalid header is detected"""
 with self.assertRaises(ValueError) as e:
diff --git a/tools/binman/test/242_mkimage_filename.dts 
b/tools/binman/test/242_mkimage_filename.dts
new file mode 100644
index 00..4483790ae8
--- /dev/null
+++ b/tools/binman/test/242_mkimage_filename.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   binman {
+   mkimage {
+   filename = "mkimage-test.bin";
+   args = "-T script";
+
+   u-boot-spl {
+   };
+   };
+   };
+};
-- 
2.37.2



[PATCH v5 1/8] binman: add support for skipping file concatenation for mkimage

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

Some image types handled by mkimage require the datafiles to be passed
independently (-d data1:data2) for specific handling of each. A
concatenation of datafiles prior to passing them to mkimage wouldn't
work.

That is the case for rkspi for example which requires page alignment
and only writing 2KB every 4KB.

This adds the ability to tell binman to pass the datafiles without
prior concatenation to mkimage, by adding the multiple-data-files
boolean property to the mkimage node.

Cc: Quentin Schulz 
Reviewed-by: Simon Glass 
Signed-off-by: Quentin Schulz 
---

v5:
 - changed to use full path from input dir with tools.get_input_filename
 to make it possible to run the unit tests,
 - added unit test,


 tools/binman/entries.rst  | 22 ++
 tools/binman/etype/mkimage.py | 41 +--
 tools/binman/ftest.py | 16 
 .../test/241_mkimage_multiple_data_files.dts  | 21 ++
 4 files changed, 96 insertions(+), 4 deletions(-)
 create mode 100644 tools/binman/test/241_mkimage_multiple_data_files.dts

diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst
index b3613d7cbd..18bd328c5c 100644
--- a/tools/binman/entries.rst
+++ b/tools/binman/entries.rst
@@ -1175,6 +1175,9 @@ Properties / Entry arguments:
 - args: Arguments to pass
 - data-to-imagename: Indicates that the -d data should be passed in as
   the image name also (-n)
+- multiple-data-files: boolean to tell binman to pass all files as
+  datafiles to mkimage instead of creating a temporary file the result
+  of datafiles concatenation
 
 The data passed to mkimage via the -d flag is collected from subnodes of the
 mkimage node, e.g.::
@@ -1205,6 +1208,25 @@ a section, or just multiple subnodes like this::
 };
 };
 
+To pass all datafiles untouched to mkimage::
+
+mkimage {
+args = "-n rk3399 -T rkspi";
+multiple-data-files;
+
+u-boot-tpl {
+};
+
+u-boot-spl {
+};
+};
+
+This calls mkimage to create a Rockchip RK3399-specific first stage
+bootloader, made of TPL+SPL. Since this first stage bootloader requires to
+align the TPL and SPL but also some weird hacks that is handled by mkimage
+directly, binman is told to not perform the concatenation of datafiles prior
+to passing the data to mkimage.
+
 To use CONFIG options in the arguments, use a string list instead, as in
 this example which also produces four arguments::
 
diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py
index ddbd9cec65..5f4bc6fa3c 100644
--- a/tools/binman/etype/mkimage.py
+++ b/tools/binman/etype/mkimage.py
@@ -18,6 +18,9 @@ class Entry_mkimage(Entry):
 - args: Arguments to pass
 - data-to-imagename: Indicates that the -d data should be passed in as
   the image name also (-n)
+- multiple-data-files: boolean to tell binman to pass all files as
+  datafiles to mkimage instead of creating a temporary file the result
+  of datafiles concatenation
 
 The data passed to mkimage via the -d flag is collected from subnodes of 
the
 mkimage node, e.g.::
@@ -51,6 +54,25 @@ class Entry_mkimage(Entry):
 Note that binman places the contents (here SPL and TPL) into a single file
 and passes that to mkimage using the -d option.
 
+   To pass all datafiles untouched to mkimage::
+
+   mkimage {
+   args = "-n rk3399 -T rkspi";
+   multiple-data-files;
+
+   u-boot-tpl {
+   };
+
+   u-boot-spl {
+   };
+   };
+
+   This calls mkimage to create a Rockchip RK3399-specific first stage
+   bootloader, made of TPL+SPL. Since this first stage bootloader requires 
to
+   align the TPL and SPL but also some weird hacks that is handled by 
mkimage
+   directly, binman is told to not perform the concatenation of datafiles 
prior
+   to passing the data to mkimage.
+
 To use CONFIG options in the arguments, use a string list instead, as in
 this example which also produces four arguments::
 
@@ -96,6 +118,7 @@ class Entry_mkimage(Entry):
 """
 def __init__(self, section, etype, node):
 super().__init__(section, etype, node)
+self._multiple_data_files = fdt_util.GetBool(self._node, 
'multiple-data-files')
 self._mkimage_entries = OrderedDict()
 self._imagename = None
 self.align_default = None
@@ -122,10 +145,20 @@ class Entry_mkimage(Entry):
 def ObtainContents(self):
 # Use a non-zero size for any fake files to keep mkimage happy
 # Note that testMkimageImagename() relies on this 'mkimage' parameter
-data, input_fname, uniq = self.collect_contents_to_file(
-self._mkimage_entries.values(), 'mkimage', 1024)
-if data is None:
-return False
+ 

[PATCH v5 0/8] migrate u-boot-rockchip.bin to binman and generate an image for SPI

2022-08-26 Thread Quentin Schulz
From: Quentin Schulz 

This migrates the generation of u-boot-rockchip.bin from Makefile to binman
completely.

This also adds support for generating the same kind of image than
u-boot-rockchip.bin but for SPI flashes (specifically, a different image
type generated by mkimage is necessary, in addition to a different
offset in the storage medium).

This has been tested on Puma RK3399 with patch series from 
https://lore.kernel.org/u-boot/20220722160655.3904213-1-foss+ub...@0leil.net/#b 
(plus 
https://lore.kernel.org/u-boot/20220722113505.3875669-4-foss+ub...@0leil.net/).

Cheers,
Quentin

v5:
 - rebased on latest master,
 - added binman test for mkimage multiple data files,
 - fixed mkimage data files to pass full paths to input files to
 mkimage,

v4:
 - added binman test for mkimage filename,
 - fixed >80 chars line in patch 2/8 binman: allow user-defined filenames for
 mkimage entry,
 - fixed wrong location for endif in patch 6/8 simplify binman image
 dependencies addition to INPUTS,


v3:
 - removed
 https://lore.kernel.org/u-boot/20220722113505.3875669-4-foss+ub...@0leil.net/,
 it'll be added later on in a separate patch series,
 - added "binman: allow user-defined filenames for mkimage entry,"
 - kept idbloader.img binary creation even with binman as requested by
 community,
 - generate idbloader-spi.img binary with binman,
 - added "rockchip: remove binman temporary files when cleaning"

v2:
 - removed patch 4/8 rockchip: pad u-boot-rockchip.bin correctly because
 it would break partitions table,
 - rebased on top of master, changes to patch 3/7 rockchip: remove
 unneeded CONFIG_SPL_PAD_TO compared to the RFC 3/8 rockchip: remove
 unneeded CONFIG_SPL_PAD_TO,

Quentin Schulz (8):
  binman: add support for skipping file concatenation for mkimage
  binman: allow user-defined filenames for mkimage entry
  rockchip: remove binman temporary files when cleaning
  rockchip: generate idbloader.img content for u-boot-rockchip.bin with
binman for ARM
  rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards
  rockchip: simplify binman image dependencies addition to INPUTS
  rockchip: allow to build SPI images even without HAS_ROM option
  rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR
flash

 Makefile  | 41 +++
 arch/arm/Kconfig  |  2 +-
 arch/arm/dts/rk3288-u-boot.dtsi   |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi   |  2 +-
 arch/arm/dts/rockchip-u-boot.dtsi | 46 +++-
 arch/arm/mach-rockchip/Kconfig|  6 +--
 tools/binman/entries.rst  | 22 
 tools/binman/etype/mkimage.py | 52 ---
 tools/binman/ftest.py | 23 
 .../test/241_mkimage_multiple_data_files.dts  | 21 
 tools/binman/test/242_mkimage_filename.dts| 20 +++
 11 files changed, 188 insertions(+), 49 deletions(-)
 create mode 100644 tools/binman/test/241_mkimage_multiple_data_files.dts
 create mode 100644 tools/binman/test/242_mkimage_filename.dts

-- 
2.37.2



Re: [PATCH] distroboot: ubifs: Add support for specifying UBI header offset

2022-08-26 Thread Tom Rini
On Thu, Aug 25, 2022 at 03:52:20PM +0200, Pali Rohár wrote:
> On Monday 08 August 2022 12:10:27 Tom Rini wrote:
> > On Sun, Aug 07, 2022 at 09:04:22PM +0200, Pali Rohár wrote:
> > 
> > > Some UBI partitions may use non-standard UBI header offset. For attaching
> > > these UBI partitions it is required to pass second argument with offset to
> > > "ubi part" command.
> > > 
> > > Therefore extend distroboot to allow specifying additional optional 6th
> > > argument with UBI header offset. This offset is set in new distroboot
> > > variable ${bootubioff} which may be used by distroboot script to e.g.
> > > properly pass this value to linux kernel command line for proper mounting
> > > of rootfs by kernel. This variable is set to empty string (cleared) when
> > > UBI header offset is not specified into distroboot BOOT_TARGET_DEVICES
> > > macro.
> > > 
> > > Usage of helper macro BOOTENV_DEV_UBIFS_BOOTUBIOFF in this change is there
> > > as a type check. It ensures that in BOOT_TARGET_DEVICES macro was 
> > > specified
> > > UBIFS func with either 5 or 6 arguments. If not then cpp throws compile
> > > error.
> > > 
> > > Signed-off-by: Pali Rohár 
> > 
> > Reviewed-by: Tom Rini 
> > 
> > -- 
> > Tom
> 
> Tom, who can take this patch?

I'll take it, as part of putting together a number of small fixes for
this release.

-- 
Tom


signature.asc
Description: PGP signature


Re: [RFC PATCH v2 9/9] tools: spkgimage: add Renesas SPKG format

2022-08-26 Thread Ralph Siemsen

On Mon, Aug 22, 2022 at 11:42:54PM -0400, Sean Anderson wrote:

+static int spkgimage_check_image_types(uint8_t type)
+{
+ return type == IH_TYPE_RENESAS_SPKG ? 0 : 1;


This function is not necessary if you only support one type.


Without this function, mkimage kept telling me that my format
(spkgimage) was not supported, and none of my callbacks got invoked.
It only complained when trying to generate a header. When listing the
supported formats, spkgimage showed up correctly.

I'll take another look on Monday, maybe I missed something obvious.


I have re-checked this:
- without the function, mkimage complains that spkgimage is unknown
- with a function that unconditionally returns 0, it works fine

If it really is meant to work without the function, then a bug must
have crept in elsewhere...


Huh. I did a quick grep so maybe I missed something. IMO this *should*
work without a function, because we have tons of drivers which just
have an equality check. In any case, you can just do

return type == IH_TYPE_RENESAS_SPKG ? 0 : -EINVAL;


It works fine when I use the following for the function:

static int spkgimage_check_image_types(uint8_t type)
{
return 0;
}

However if no function is provided, i.e. U_BOOT_IMAGE_TYPE has
NULL for check_image_type field, then mkimage fails with the error:

tools/mkimage: unsupported type Renesas SPKG Image

Looking at this a bit more, it seems to be due to:

struct image_type_params *imagetool_get_type(int type)
{
...snip...

for (curr = start; curr != end; curr++) {
if ((*curr)->check_image_type) {
if (!(*curr)->check_image_type(type))
return *curr;
}
}
return NULL;
}

So the only way to get non-NULL from imagetool_get_type is for
there to be a callback function, and it must return zero. And
this in turn causes mkimage to bail out quite early in main():

/* set tparams as per input type_id */
tparams = imagetool_get_type(params.type);
if (tparams == NULL && !params.lflag) {
fprintf (stderr, "%s: unsupported type %s\n",
params.cmdname, genimg_get_type_name(params.type));
exit (EXIT_FAILURE);
}

Unless I am missing something, it seems I must provide a function.

-Ralph

PS I will post an updated series (v3) eventually. I'm working on making 
changes to the clock driver on the kernel side, to keep it in sync with 
the changes you requested in the u-boot side.


Re: [U-Boot] [PATCH 00/10] Add pruss and pru support for am33xx and am57xx

2022-08-26 Thread Tom Rini
On Wed, Jul 27, 2022 at 03:27:47PM -0400, Greg Leonberg wrote:

> This series adds support for the pruss/pru_rproc drivers on am33xx and
> am57xx SoCs.
> 
> All PRU interfaces pru0 and pru1 are supported on am33xx.
> All PRU interfaces pru0, pru1, pru2, and pru3 are supported on am57xx.
> 
> Testing is done via the "rproc" U-Boot command.
> 
> This patch series is based on ti-u-boot-2020.01 branch on ti-u-boot
> repository located at: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/
> and commit 2781231a33c3
> ("arm: mach-k3: j721e_init: probe clock node after sci node is probed")
> 
> From looking at the master branch of the main u-boot repository, there does
> not appear to be significant effort required to merge it into the master
> branch.

Please note that there is some effort required however, for upstream. If
you intend for this to be merged upstream, please rebase and resend,
thanks.

-- 
Tom


signature.asc
Description: PGP signature


Re: Broken commit de47ff536363289f92f85ed1e4901724d238432d

2022-08-26 Thread Tom Rini
On Wed, Aug 17, 2022 at 11:29:08AM +0200, Pali Rohár wrote:
> On Monday 08 August 2022 09:37:22 Tom Rini wrote:
> > On Mon, Aug 08, 2022 at 09:51:49AM +0200, Marek Behún wrote:
> > > On Fri, 5 Aug 2022 18:20:19 -0400
> > > Tom Rini  wrote:
> > > 
> > > > On Fri, Aug 05, 2022 at 10:17:01PM +0200, Pali Rohár wrote:
> > > > > On Friday 05 August 2022 11:54:53 Tom Rini wrote:  
> > > > > > On Fri, Aug 05, 2022 at 05:51:35PM +0200, Pali Rohár wrote:  
> > > > > > > On Friday 05 August 2022 11:44:00 Tom Rini wrote:  
> > > > > > > > On Fri, Aug 05, 2022 at 05:12:59PM +0200, Pali Rohár wrote:  
> > > > > > > > > On Friday 05 August 2022 11:03:40 Tom Rini wrote:  
> > > > > > > > > > On Fri, Aug 05, 2022 at 04:59:35PM +0200, Pali Rohár wrote: 
> > > > > > > > > >  
> > > > > > > > > > > On Friday 05 August 2022 10:47:31 Tom Rini wrote:  
> > > > > > > > > > > > On Fri, Aug 05, 2022 at 04:21:24PM +0200, Pali Rohár 
> > > > > > > > > > > > wrote:  
> > > > > > > > > > > > > On Wednesday 03 August 2022 12:13:18 Tom Rini wrote:  
> > > > > > > > > > > > > > On Wed, Aug 03, 2022 at 06:00:13PM +0200, Pali 
> > > > > > > > > > > > > > Rohár wrote:  
> > > > > > > > > > > > > > > On Tuesday 02 August 2022 06:58:26 Tom Rini 
> > > > > > > > > > > > > > > wrote:  
> > > > > > > > > > > > > > > > On Tue, Aug 02, 2022 at 11:13:38AM +0200, Pali 
> > > > > > > > > > > > > > > > Rohár wrote:
> > > > > > > > > > > > > > > >   
> > > > > > > > > > > > > > > > > Hello Tom!
> > > > > > > > > > > > > > > > > 
> > > > > > > > > > > > > > > > > Your commit 
> > > > > > > > > > > > > > > > > de47ff536363289f92f85ed1e4901724d238432d 
> > > > > > > > > > > > > > > > > ("Convert
> > > > > > > > > > > > > > > > > CONFIG_SYS_MPC85XX_NO_RESETVEC to Kconfig") 
> > > > > > > > > > > > > > > > > seems to be broken.  
> > > > > > > > > > > > > > > > 
> > > > > > > > > > > > > > > > I thought I had managed to mirror the 
> > > > > > > > > > > > > > > > TPL/SPL/full usage that was there
> > > > > > > > > > > > > > > > prior, but apparently some got missed.  
> > > > > > > > > > > > > > > 
> > > > > > > > > > > > > > > Yea, conversion to Kconfig seems that was 
> > > > > > > > > > > > > > > incorrect.  
> > > > > > > > > > > > > > 
> > > > > > > > > > > > > > As the config files were just unclear, but you seem 
> > > > > > > > > > > > > > to understand what
> > > > > > > > > > > > > > it's supposed to be, a patch to clean it up would 
> > > > > > > > > > > > > > be most appreciated,
> > > > > > > > > > > > > > thanks.
> > > > > > > > > > > > > > 
> > > > > > > > > > > > > > -- 
> > > > > > > > > > > > > > Tom  
> > > > > > > > > > > > > 
> > > > > > > > > > > > > Broken is also commit 
> > > > > > > > > > > > > d433c74eecdce1e4952ef4e8c712a9289c0dfcc2. Seems
> > > > > > > > > > > > > that all kconfig migration changes done after that 
> > > > > > > > > > > > > commit are broken.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > I really do not have energy to investigate what and 
> > > > > > > > > > > > > how was broken due
> > > > > > > > > > > > > to incorrect kconfig migration.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > 
> > > > > > > > > > > > > I did simple test. Applied following change:
> > > > > > > > > > > > > 
> > > > > > > > > > > > > diff --git a/include/configs/p1_p2_rdb_pc.h 
> > > > > > > > > > > > > b/include/configs/p1_p2_rdb_pc.h
> > > > > > > > > > > > > index a6523753d5ca..489f24df0ab1 100644
> > > > > > > > > > > > > --- a/include/configs/p1_p2_rdb_pc.h
> > > > > > > > > > > > > +++ b/include/configs/p1_p2_rdb_pc.h
> > > > > > > > > > > > > @@ -624,3 +624,7 @@ __stringify(__PCIE_RST_CMD)"\0"
> > > > > > > > > > > > >  "bootm $norbootaddr - $norfdtaddr"
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  #endif /* __CONFIG_H */
> > > > > > > > > > > > > +
> > > > > > > > > > > > > +#ifdef CONFIG_SDCARD
> > > > > > > > > > > > > +#error
> > > > > > > > > > > > > +#endif
> > > > > > > > > > > > > 
> > > > > > > > > > > > > And then called:
> > > > > > > > > > > > > 
> > > > > > > > > > > > > make CROSS_COMPILE=powerpc-linux-gnuspe- 
> > > > > > > > > > > > > P2020RDB-PC_defconfig u-boot.bin
> > > > > > > > > > > > > 
> > > > > > > > > > > > > And it failed, even when this defconfig file is not 
> > > > > > > > > > > > > SD card builds.  
> > > > > > > > > > > > 
> > > > > > > > > > > > Where is PBL in that case even then?  
> > > > > > > > > > > 
> > > > > > > > > > > P2020 (and older) are pre-PBL boards, they do not support 
> > > > > > > > > > > NXP PBL
> > > > > > > > > > > header.  
> > > > > > > > > > 
> > > > > > > > > > Ah, OK, then it should just be removing TARGET_P2020RDB 
> > > > > > > > > > from the choice
> > > > > > > > > > on "Freescale PBL load location".
> > > > > > > > > > 
> > > > > > > > > > -- 
> > > > > > > > > > Tom  
> > > > > > > > > 
> > > > > > > > > I just do not understand.
> > > > > > > > > 
> > > > > > > > > P10** and P20** do not support NXP PBL. They support only 
> > > > > > > > > 

[PATCH] corenet_ds.h: Remove

2022-08-26 Thread Tom Rini
This was missed when removing the platform.

Signed-off-by: Tom Rini 
---
 include/configs/corenet_ds.h | 369 ---
 1 file changed, 369 deletions(-)
 delete mode 100644 include/configs/corenet_ds.h

diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
deleted file mode 100644
index 7e65b2b6aa22..
--- a/include/configs/corenet_ds.h
+++ /dev/null
@@ -1,369 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright 2009-2012 Freescale Semiconductor, Inc.
- * Copyright 2020-2021 NXP
- */
-
-/*
- * Corenet DS style board configuration file
- */
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include 
-
-#include "../board/freescale/common/ics307_clk.h"
-
-#ifdef CONFIG_RAMBOOT_PBL
-#define CONFIG_RAMBOOT_TEXT_BASE   CONFIG_SYS_TEXT_BASE
-#define CONFIG_RESET_VECTOR_ADDRESS0xfffc
-#endif
-
-#ifdef CONFIG_SRIO_PCIE_BOOT_SLAVE
-/* Set 1M boot space */
-#define CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_SYS_TEXT_BASE & 
0xfff0)
-#define CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS \
-   (0x3ull | CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR)
-#define CONFIG_RESET_VECTOR_ADDRESS 0xfffc
-#endif
-
-/* High Level Configuration Options */
-
-#ifndef CONFIG_RESET_VECTOR_ADDRESS
-#define CONFIG_RESET_VECTOR_ADDRESS0xeffc
-#endif
-
-#define CONFIG_SYS_NUM_CPC CONFIG_SYS_NUM_DDR_CTLRS
-
-/*
- * These can be toggled for performance analysis, otherwise use default.
- */
-#define CONFIG_SYS_INIT_L2CSR0 L2CSR0_L2E
-#ifdef CONFIG_DDR_ECC
-#define CONFIG_MEM_INIT_VALUE  0xdeadbeef
-#endif
-
-#define CONFIG_POST CONFIG_SYS_POST_MEMORY /* test POST memory test */
-
-/*
- *  Config the L3 Cache as L3 SRAM
- */
-#define CONFIG_SYS_INIT_L3_ADDRCONFIG_RAMBOOT_TEXT_BASE
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_INIT_L3_ADDR_PHYS   (0xfull | 
CONFIG_RAMBOOT_TEXT_BASE)
-#else
-#define CONFIG_SYS_INIT_L3_ADDR_PHYS   CONFIG_SYS_INIT_L3_ADDR
-#endif
-#define CONFIG_SYS_L3_SIZE (1024 << 10)
-#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR + CONFIG_SYS_L3_SIZE)
-
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_DCSRBAR 0xf000
-#define CONFIG_SYS_DCSRBAR_PHYS0xfull
-#endif
-
-/* EEPROM */
-#define CONFIG_SYS_I2C_EEPROM_NXID
-#define CONFIG_SYS_EEPROM_BUS_NUM  0
-
-/*
- * DDR Setup
- */
-#define CONFIG_VERY_BIG_RAM
-#define CONFIG_SYS_DDR_SDRAM_BASE  0x
-#define CONFIG_SYS_SDRAM_BASE  CONFIG_SYS_DDR_SDRAM_BASE
-
-#define SPD_EEPROM_ADDRESS10x51
-#define SPD_EEPROM_ADDRESS20x52
-#define SPD_EEPROM_ADDRESS SPD_EEPROM_ADDRESS1 /* for p3041/p5010 */
-#define CONFIG_SYS_SDRAM_SIZE  4096/* for fixed parameter use */
-
-/*
- * Local Bus Definitions
- */
-
-/* Set the local bus clock 1/8 of platform clock */
-#define CONFIG_SYS_LBC_LCRRLCRR_CLKDIV_8
-
-#define CONFIG_SYS_FLASH_BASE  0xe000  /* Start of PromJet */
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_FLASH_BASE_PHYS 0xfe000ull
-#else
-#define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE
-#endif
-
-#define PIXIS_BASE 0xffdf  /* PIXIS registers */
-#ifdef CONFIG_PHYS_64BIT
-#define PIXIS_BASE_PHYS0xfffdfull
-#else
-#define PIXIS_BASE_PHYSPIXIS_BASE
-#endif
-
-#define PIXIS_LBMAP_SWITCH 7
-#define PIXIS_LBMAP_MASK   0xf0
-#define PIXIS_LBMAP_SHIFT  4
-#define PIXIS_LBMAP_ALTBANK0x40
-
-#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
-
-/* Nand Flash */
-#ifdef CONFIG_NAND_FSL_ELBC
-#define CONFIG_SYS_NAND_BASE   0xffa0
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_NAND_BASE_PHYS  0xfffa0ull
-#else
-#define CONFIG_SYS_NAND_BASE_PHYS  CONFIG_SYS_NAND_BASE
-#endif
-
-#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
-#define CONFIG_SYS_MAX_NAND_DEVICE 1
-
-/* NAND flash config */
-#define CONFIG_SYS_NAND_BR_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
-  | (2<> 1)
-#define CONFIG_SYS_BMAN_CINH_BASE   (CONFIG_SYS_BMAN_MEM_BASE + \
-   CONFIG_SYS_BMAN_CENA_SIZE)
-#define CONFIG_SYS_BMAN_CINH_SIZE   (CONFIG_SYS_BMAN_MEM_SIZE >> 1)
-#define CONFIG_SYS_BMAN_SWP_ISDR_REG   0xE08
-#define CONFIG_SYS_QMAN_NUM_PORTALS10
-#define CONFIG_SYS_QMAN_MEM_BASE   0xf420
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_QMAN_MEM_PHYS   0xff420ull
-#else
-#define CONFIG_SYS_QMAN_MEM_PHYS   CONFIG_SYS_QMAN_MEM_BASE
-#endif
-#define CONFIG_SYS_QMAN_MEM_SIZE   0x0020
-#define CONFIG_SYS_QMAN_SP_CENA_SIZE0x4000
-#define CONFIG_SYS_QMAN_SP_CINH_SIZE0x1000
-#define CONFIG_SYS_QMAN_CENA_BASE   CONFIG_SYS_QMAN_MEM_BASE
-#define CONFIG_SYS_QMAN_CENA_SIZE   (CONFIG_SYS_QMAN_MEM_SIZE >> 1)
-#define CONFIG_SYS_QMAN_CINH_BASE   (CONFIG_SYS_QMAN_MEM_BASE + \
-  

Re: [PATCH v3 0/8] U-boot: fs: add generic unaligned read offset handling

2022-08-26 Thread Tom Rini
On Mon, Aug 15, 2022 at 07:45:11PM +0800, Qu Wenruo wrote:

> [CHANGELOG]
> v3:
> - Fix an error that we always return 0 actread bytes for unsupported fses
>   For unsupported fses, we should also populate @total_read.
>   Or we will just read the data but still return 0 for actually bytes.
> 
>   Now it pass all test_fs* cases.

We're failing squashfs still, sorry:
https://source.denx.de/u-boot/u-boot/-/jobs/486819#L399

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] spl: introduce SPL_XIP to config

2022-08-26 Thread Sean Anderson

On 8/26/22 4:44 AM, Nikita Shubin wrote:

From: Nikita Shubin 

U-Boot and SPL don't necessary share the same location, so we might end
with U-Boot SPL in read-only memory (XIP) and U-Boot in read-write memory.

In case of non XIP boot mode, we rely on such variables as "hart_lottery"
and "available_harts_lock" which we use as atomics.

The problem is that CONFIG_XIP also propagate to main U-Boot, not only SPL,
so we need CONFIG_SPL_XIP to distinguish SPL XIP from other XIP modes.

This adds an option special for SPL to behave it in XIP manner and we don't
use hart_lottery and available_harts_lock, during start proccess.

Signed-off-by: Nikita Shubin 
---
rfc->v0:
Sean Anderson:
- replace defined with CONFIG_IS_ENABLED
- add proper description to KConfig
---
  arch/riscv/cpu/cpu.c | 2 +-
  arch/riscv/cpu/start.S   | 4 ++--
  arch/riscv/include/asm/global_data.h | 2 +-
  arch/riscv/lib/asm-offsets.c | 2 +-
  arch/riscv/lib/smp.c | 2 +-
  common/spl/Kconfig   | 7 +++
  6 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
index 9f5fa0bcb3..5d8163b19f 100644
--- a/arch/riscv/cpu/cpu.c
+++ b/arch/riscv/cpu/cpu.c
@@ -19,7 +19,7 @@
   * The variables here must be stored in the data section since they are used
   * before the bss section is available.
   */
-#ifndef CONFIG_XIP
+#if !CONFIG_IS_ENABLED(XIP)
  u32 hart_lottery __section(".data") = 0;
  
  /*

diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
index ac81783a90..c3c859e667 100644
--- a/arch/riscv/cpu/start.S
+++ b/arch/riscv/cpu/start.S
@@ -122,7 +122,7 @@ call_board_init_f_0:
  call_harts_early_init:
jal harts_early_init
  
-#ifndef CONFIG_XIP

+#if !CONFIG_IS_ENABLED(XIP)
/*
 * Pick hart to initialize global data and run U-Boot. The other harts
 * wait for initialization to complete.
@@ -150,7 +150,7 @@ call_harts_early_init:
/* save the boot hart id to global_data */
SREGtp, GD_BOOT_HART(gp)
  
-#ifndef CONFIG_XIP

+#if !CONFIG_IS_ENABLED(XIP)
la  t0, available_harts_lock
amoswap.w.rl zero, zero, 0(t0)
  
diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h

index 9a146d1d49..a4d3cf430b 100644
--- a/arch/riscv/include/asm/global_data.h
+++ b/arch/riscv/include/asm/global_data.h
@@ -30,7 +30,7 @@ int iccm[CONFIG_NR_CPUS];
  #if CONFIG_IS_ENABLED(SMP)
struct ipi_data ipi[CONFIG_NR_CPUS];
  #endif
-#ifndef CONFIG_XIP
+#if !CONFIG_IS_ENABLED(XIP)
ulong available_harts;
  #endif
  };
diff --git a/arch/riscv/lib/asm-offsets.c b/arch/riscv/lib/asm-offsets.c
index f1fe089b3d..c4f48c8373 100644
--- a/arch/riscv/lib/asm-offsets.c
+++ b/arch/riscv/lib/asm-offsets.c
@@ -16,7 +16,7 @@ int main(void)
  {
DEFINE(GD_BOOT_HART, offsetof(gd_t, arch.boot_hart));
DEFINE(GD_FIRMWARE_FDT_ADDR, offsetof(gd_t, arch.firmware_fdt_addr));
-#ifndef CONFIG_XIP
+#if !CONFIG_IS_ENABLED(XIP)
DEFINE(GD_AVAILABLE_HARTS, offsetof(gd_t, arch.available_harts));
  #endif
  
diff --git a/arch/riscv/lib/smp.c b/arch/riscv/lib/smp.c

index ba992100ad..f8b756291f 100644
--- a/arch/riscv/lib/smp.c
+++ b/arch/riscv/lib/smp.c
@@ -45,7 +45,7 @@ static int send_ipi_many(struct ipi_data *ipi, int wait)
continue;
}
  
-#ifndef CONFIG_XIP

+#if !CONFIG_IS_ENABLED(XIP)
/* skip if hart is not available */
if (!(gd->arch.available_harts & (1 << reg)))
continue;
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 07c03d611d..b3719f9626 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -27,6 +27,13 @@ config SPL_FRAMEWORK
  supports MMC, NAND and YMODEM and other methods loading of U-Boot
  and the Linux Kernel.  If unsure, say Y.
  
+config SPL_XIP

+   bool "Enable XIP mode for SPL"
+   help
+ If SPL starts in read-only memory (XIP for example) then we shouldn't
+ rely on lock variables (for example hart_lottery and 
available_harts_lock),
+ this affects only SPL, other stages should proceed as non-XIP.
+


Kconfig descriptions should tell you what should happen when you enable this 
config.
So the way you have worded this is strange; I would expect something more like

Support booting SPL from read-only memory (such as XIP). Don't rely on lock 
variables
(for example hart_lottery and available_harts_lock) since they cannot be 
modified.

The rest looks good.

--Sean


  config SPL_FRAMEWORK_BOARD_INIT_F
bool "Define a generic function board_init_f"
depends on SPL_FRAMEWORK





Re: [RFC PATCH] clk: fix clk_get_rate() always return ulong

2022-08-26 Thread Sean Anderson

On 8/26/22 6:31 AM, Julien Masson wrote:

According to clk_ops struct definition, the callback `get_rate()`
return current clock rate value as ulong.
`clk_get_rate()` should handle the clock rate returned as ulong also.

Otherwise we may have invalid/truncated clock rate value returned by
`clk_get_rate()`.

`log_ret` has also been removed since it use an `int` in the macro
definition.

Signed-off-by: Julien Masson 
---
  drivers/clk/clk-uclass.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index b89c77bf79..446f7c49b8 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -469,7 +469,7 @@ void clk_free(struct clk *clk)
  ulong clk_get_rate(struct clk *clk)
  {
const struct clk_ops *ops;
-   int ret;
+   ulong ret;
  
  	debug("%s(clk=%p)\n", __func__, clk);

if (!clk_valid(clk))
@@ -481,7 +481,7 @@ ulong clk_get_rate(struct clk *clk)
  
  	ret = ops->get_rate(clk);

if (ret)
-   return log_ret(ret);
+   return ret;
  
  	return 0;


This can just be return ret no if required.


  }



Re: [PATCH 3/3] exports: Fix export of SPI access functions

2022-08-26 Thread Wolfgang Denk
Dear Paul,

In message <20220505153242.1598807-4-paul.bar...@sancloud.com> you wrote:
> * With CONFIG_DM_SPI defined, spi_get_bus_and_cs needs to be used
> instead of spi_setup_slave to configure a SPI bus. As spi_setup_slave is
> already present in the export list it is reasonable to also export
> spi_get_bus_and_cs.
>
> * For the functions listed in the jump table to be callable they must
> also be defined in the "exports.h" header. Define the various exported
> SPI functions so that they can be used.
>
> Signed-off-by: Paul Barker 
> ---
>  include/_exports.h |  4 
>  include/exports.h  | 15 ++-
>  2 files changed, 18 insertions(+), 1 deletion(-)

Sorry, but I disagree here.  The SPI functions should have never
been part of the export interface.  As far as I can see now, they
have been added by commit bedd8403f7

export SPI functions to standalone apps

While we're here, fix the broken #ifdef handling in _exports.h.

Signed-off-by: Mike Frysinger 

in 2009. Actually I must even have seen them, as I complained about
incorrect comment style :-(

But no, SPI support should not be inclluded.  I2C was there because
it was needed for reading the environment from an EEPROM, but then
the interface was frozen ano no more new interfices / drivers should
be allowed.


Viele Grüße,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich,  Office: Kirchenstr. 5, 82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If you can't explain it to a six year old, you  don't  understand  it
yourself.   - Albert Einstein


Re: [PATCH 1/3] Licenses: Clarify exceptions for standalone apps

2022-08-26 Thread Wolfgang Denk
Dear Paul Barker,

In message <20220505153242.1598807-2-paul.bar...@sancloud.com> you wrote:
> On 2010-01-27, an email [1] was sent to the mailing list by Wolfgang
> Denk which clarified the intended licensing exceptions for standalone
> applications. As the "export.h" header and the "stubs.c" source files
> are required to implement a standalone application, the intention was
> that these files be covered by the licensing exception. This is made
> clear in the following quotes from that email:
>
>   "exports.h" should be added to the "allowed" file list; there should
>   be no need to include "common.h". Eventually this needs fixing.
>   Patches are welcome.
>
>   "examples/standalone/stubs.c" should be added to the "allowed" file
>   list (the ppc_*jmp.S files are LGPLed).
>
>   There should be no doubts - the intention is clear, the current state
>   may need improvement. Help (read: patches) welcome.
>
> [1]: https://lists.denx.de/pipermail/u-boot/2010-January/067174.html
>
> Signed-off-by: Paul Barker 
> Cc: Wolfgang Denk 

Acked-by: Wolfgang Denk 


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich,  Office: Kirchenstr. 5, 82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It usually takes more than three weeks to prepare  a  good  impromptu
speech.  - Mark Twain


[RFC PATCH] Rename disto_[pxe_]getfile to distro_[pxe_]getfile

2022-08-26 Thread Dario Binacchi
Replace 'disto' with 'distro' since they are all functions about distro
booting.

Signed-off-by: Dario Binacchi 

---

 boot/bootmeth_distro.c  | 6 +++---
 boot/bootmeth_pxe.c | 6 +++---
 doc/develop/bootstd.rst | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/boot/bootmeth_distro.c b/boot/bootmeth_distro.c
index fea09b2c2fbe..5c6c687f0a64 100644
--- a/boot/bootmeth_distro.c
+++ b/boot/bootmeth_distro.c
@@ -35,8 +35,8 @@ static int distro_get_state_desc(struct udevice *dev, char 
*buf, int maxsize)
return 0;
 }
 
-static int disto_getfile(struct pxe_context *ctx, const char *file_path,
-char *file_addr, ulong *sizep)
+static int distro_getfile(struct pxe_context *ctx, const char *file_path,
+ char *file_addr, ulong *sizep)
 {
struct distro_info *info = ctx->userdata;
ulong addr;
@@ -113,7 +113,7 @@ static int distro_boot(struct udevice *dev, struct bootflow 
*bflow)
addr = map_to_sysmem(bflow->buf);
info.dev = dev;
info.bflow = bflow;
-   ret = pxe_setup_ctx(, , disto_getfile, , true,
+   ret = pxe_setup_ctx(, , distro_getfile, , true,
bflow->subdir);
if (ret)
return log_msg_ret("ctx", -EINVAL);
diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c
index f1e2b4c77627..e6992168c067 100644
--- a/boot/bootmeth_pxe.c
+++ b/boot/bootmeth_pxe.c
@@ -23,8 +23,8 @@
 #include 
 #include 
 
-static int disto_pxe_getfile(struct pxe_context *ctx, const char *file_path,
-char *file_addr, ulong *sizep)
+static int distro_pxe_getfile(struct pxe_context *ctx, const char *file_path,
+ char *file_addr, ulong *sizep)
 {
struct distro_info *info = ctx->userdata;
ulong addr;
@@ -142,7 +142,7 @@ static int distro_pxe_boot(struct udevice *dev, struct 
bootflow *bflow)
info.dev = dev;
info.bflow = bflow;
info.cmdtp = 
-   ret = pxe_setup_ctx(ctx, , disto_pxe_getfile, , false,
+   ret = pxe_setup_ctx(ctx, , distro_pxe_getfile, , false,
bflow->subdir);
if (ret)
return log_msg_ret("ctx", -EINVAL);
diff --git a/doc/develop/bootstd.rst b/doc/develop/bootstd.rst
index f7fc72570766..1ccc49424ebd 100644
--- a/doc/develop/bootstd.rst
+++ b/doc/develop/bootstd.rst
@@ -322,7 +322,7 @@ look like this::
 
 The `sf-bootdev` driver can implement a way to read from the SPI flash, using
 the offset and size provided, and return that bootflow file back to the caller.
-When distro boot wants to read the kernel it calls disto_getfile() which must
+When distro boot wants to read the kernel it calls distro_getfile() which must
 provide a way to read from the SPI flash. See `distro_boot()` at distro_boot_
 for more details.
 
-- 
2.32.0



  1   2   >