OFFLIST Re: [PATCH 0/5] ARM: at91: add first DT support for Calao usb/tny boards

2023-09-26 Thread Wolfram Sang
Hi!

> This is not yet a complete replacement:
> 
>   - We use the legacy NAND driver instead of the newly backported driver
> that Linux uses with the hardware, presumably without issues
> 
>   - OHCI hangs during probe, so it's disabled for now
> 
>   - A barebox with comparative functionality to the non-DT version
> exceeds the 256K partition size

Aber brauchst Du das Gerät dann nicht noch etwas für diese Sachen?

Grüße nach Paris,

   Wolfram



signature.asc
Description: PGP signature


[PATCH 2/5] ARM: at91: add SDRAMC driver for memory detection

2023-09-26 Thread Ahmad Fatoum
We already have support to read back memory size from the SDRAM
controller on older AT91 processor via the at91_get_sdram_size()
function, but that's mostly called from board code.

Add a proper driver that can probe the SDRAM device in the DT to
dynamically detect the memory without hardcoding.

Signed-off-by: Ahmad Fatoum 
---
 arch/arm/mach-at91/Kconfig  |  3 ++
 arch/arm/mach-at91/Makefile |  1 +
 arch/arm/mach-at91/sdramc.c | 47 +
 include/mach/at91/at91sam9_sdramc.h |  4 +++
 4 files changed, 55 insertions(+)
 create mode 100644 arch/arm/mach-at91/sdramc.c

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index d2499747252d..1197e06670c7 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -42,6 +42,9 @@ config HAVE_AT91_I2S_MUX_CLK
 config HAVE_AT91_SAM9X60_PLL
bool
 
+config HAVE_AT91_SDRAMC
+   bool
+
 config HAVE_AT91_DDRAMC
bool
 
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 301e0b761b26..777dc6d1aa3c 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_BOOTM) += bootm-barebox.o
 obj-y += at91sam9_reset.o
 obj-y += at91sam9g45_reset.o
 obj-pbl-$(CONFIG_HAVE_AT91_DDRAMC) += ddramc.o
+obj-pbl-$(CONFIG_HAVE_AT91_SDRAMC) += sdramc.o
 pbl-$(CONFIG_AT91_MCI_PBL) +=  xload-mmc.o
 pbl-$(CONFIG_AT91_MCI_PBL) +=  at91sam9_xload_mmc.o
 
diff --git a/arch/arm/mach-at91/sdramc.c b/arch/arm/mach-at91/sdramc.c
new file mode 100644
index ..655f24ecd9ad
--- /dev/null
+++ b/arch/arm/mach-at91/sdramc.c
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2020 Ahmad Fatoum 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+void __noreturn at91sam9260_barebox_entry(void *boarddata)
+{
+   barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ boarddata);
+}
+
+static int at91_sdramc_probe(struct device *dev)
+{
+   struct resource *iores;
+   void __iomem *base;
+
+   iores = dev_request_mem_resource(dev, 0);
+   if (IS_ERR(iores))
+   return PTR_ERR(iores);
+   base = IOMEM(iores->start);
+
+   return arm_add_mem_device("ram0", AT91_CHIPSELECT_1,
+ at91_get_sdram_size(base));
+}
+
+static struct of_device_id at91_sdramc_dt_ids[] = {
+   { .compatible = "atmel,at91sam9260-sdramc" },
+   { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, at91_sdramc_dt_ids);
+
+static struct driver at91_sdramc_driver = {
+   .name   = "at91sam9260-sdramc",
+   .probe  = at91_sdramc_probe,
+   .of_compatible = at91_sdramc_dt_ids,
+};
+mem_platform_driver(at91_sdramc_driver);
diff --git a/include/mach/at91/at91sam9_sdramc.h 
b/include/mach/at91/at91sam9_sdramc.h
index a4c88b24d4a0..2ba73cd2f2dc 100644
--- a/include/mach/at91/at91sam9_sdramc.h
+++ b/include/mach/at91/at91sam9_sdramc.h
@@ -13,6 +13,8 @@
 #ifndef AT91SAM9_SDRAMC_H
 #define AT91SAM9_SDRAMC_H
 
+#include 
+
 /* SDRAM Controller (SDRAMC) registers */
 #define AT91_SDRAMC_MR 0x00/* SDRAM Controller Mode Register */
 #defineAT91_SDRAMC_MODE(0xf << 0)  /* 
Command Mode */
@@ -268,5 +270,7 @@ static inline bool at91sam9263_is_low_power_sdram(int bank)
}
 }
 
+void __noreturn at91sam9260_barebox_entry(void *boarddata);
+
 #endif
 #endif
-- 
2.39.2




[PATCH 1/5] Revert "mtd: nand: drop DT support in legacy driver"

2023-09-26 Thread Ahmad Fatoum
DT support was removed with the rationale that all DT-enabled platforms
are supported by the new driver ported from Linux. The new driver
however refuses to work the AT91SAM9263. Until that's figured it,
restore DT support in the legacy driver.

This reverts commit 1fd8336bb0fe46856d2881121dd61bf560910448.

Signed-off-by: Ahmad Fatoum 
---
 drivers/mtd/nand/Kconfig|   8 ++-
 drivers/mtd/nand/atmel/legacy.c | 104 +++-
 2 files changed, 109 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 87926d88d2c6..19f4322f65a1 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -114,10 +114,14 @@ config NAND_ATMEL
depends on ARCH_AT91 || (OFDEVICE && COMPILE_TEST)
 
 config NAND_ATMEL_LEGACY
-   def_bool !AT91_MULTI_BOARDS
+   def_bool !AT91_MULTI_BOARDS || SOC_AT91SAM9
depends on NAND_ATMEL
help
- Select legacy non-device tree enabled driver.
+ Select legacy driver for non-DT-enabled platforms
+ and for the deprecated non-EBI binding.
+
+ The deprecated binding is currently the only one
+ support for AT91SAM9.
 
 config NAND_ATMEL_PMECC
bool
diff --git a/drivers/mtd/nand/atmel/legacy.c b/drivers/mtd/nand/atmel/legacy.c
index cf402549b857..cee9e49be021 100644
--- a/drivers/mtd/nand/atmel/legacy.c
+++ b/drivers/mtd/nand/atmel/legacy.c
@@ -23,6 +23,10 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -1105,6 +1109,92 @@ static void atmel_nand_hwctl(struct nand_chip 
*nand_chip, int mode)
 {
 }
 
+static int atmel_nand_of_init(struct atmel_nand_host *host, struct device_node 
*np)
+{
+   u32 val;
+   u32 offset[2];
+   int ecc_mode;
+   struct atmel_nand_data *board = host->board;
+   enum of_gpio_flags flags = 0;
+
+   if (!IS_ENABLED(CONFIG_OFDEVICE))
+   return -ENOSYS;
+
+   if (of_property_read_u32(np, "atmel,nand-addr-offset", ) == 0) {
+   if (val >= 32) {
+   dev_err(host->dev, "invalid addr-offset %u\n", val);
+   return -EINVAL;
+   }
+   board->ale = val;
+   }
+
+   if (of_property_read_u32(np, "atmel,nand-cmd-offset", ) == 0) {
+   if (val >= 32) {
+   dev_err(host->dev, "invalid cmd-offset %u\n", val);
+   return -EINVAL;
+   }
+   board->cle = val;
+   }
+
+   ecc_mode = of_get_nand_ecc_mode(np);
+
+   board->ecc_mode = ecc_mode < 0 ? NAND_ECC_SOFT : ecc_mode;
+
+   board->on_flash_bbt = of_get_nand_on_flash_bbt(np);
+
+   if (of_get_nand_bus_width(np) == 16)
+   board->bus_width_16 = 1;
+
+   board->rdy_pin = of_get_gpio_flags(np, 0, );
+   board->enable_pin = of_get_gpio(np, 1);
+   board->det_pin = of_get_gpio(np, 2);
+
+   board->has_pmecc = of_property_read_bool(np, "atmel,has-pmecc");
+
+   if (!(board->ecc_mode == NAND_ECC_HW) || !board->has_pmecc)
+   return 0;   /* Not using PMECC */
+
+   /* use PMECC, get correction capability, sector size and lookup
+   * table offset.
+   * If correction bits and sector size are not specified, then
+   *   find
+   * them from NAND ONFI parameters.
+   */
+   if (of_property_read_u32(np, "atmel,pmecc-cap", ) == 0) {
+   if ((val != 2) && (val != 4) && (val != 8) && (val != 12) && 
(val != 24)) {
+   dev_err(host->dev, "Unsupported PMECC correction 
capability: %d"
+   " should be 2, 4, 8, 12 or 24\n", val);
+   return -EINVAL;
+   }
+
+   board->pmecc_corr_cap = (u8)val;
+   }
+
+   if (of_property_read_u32(np, "atmel,pmecc-sector-size", ) == 0) {
+   if ((val != 512) && (val != 1024)) {
+   dev_err(host->dev, "Unsupported PMECC sector 
size: %d"
+   " should be 512 or 1024 bytes\n", val);
+   return -EINVAL;
+   }
+
+   board->pmecc_sector_size = (u16)val;
+   }
+
+   if (of_property_read_u32_array(np, "atmel,pmecc-lookup-table-offset", 
offset, 2) != 0) {
+   dev_err(host->dev, "Cannot get PMECC lookup table offset\n");
+   return -EINVAL;
+   }
+
+   if (!offset[0] && !offset[1]) {
+   dev_err(host->dev, "Invalid PMECC lookup table offset\n");
+   return -EINVAL;
+   }
+
+   board->pmecc_lookup_table_offset = (board->pmecc_sector_size == 512) ? 
offset[0] : offset[1];
+
+   return 0;
+}
+
 static int atmel_hw_nand_init_params(struct device *dev,
 struct atmel_nand_host *host)
 {
@@ -1191,7 +1281,13 @@ static int __init atmel_nand_probe(struct device *dev)
host->board = pdata;
   

[PATCH 3/5] ARM: at91: at91sam9_rst: add DT support for at91sam9260

2023-09-26 Thread Ahmad Fatoum
AT91SAM9260 needs a special reset sequence that we already implement
at91sam9_reset(). Make it easily available to DT-enabled boards by
adding it to the at91sam9_rst driver used for newer SoCs.

Signed-off-by: Ahmad Fatoum 
---
 arch/arm/mach-at91/at91sam9_rst.c | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9_rst.c 
b/arch/arm/mach-at91/at91sam9_rst.c
index db7411a053d6..d2c008e3439a 100644
--- a/arch/arm/mach-at91/at91sam9_rst.c
+++ b/arch/arm/mach-at91/at91sam9_rst.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 struct at91sam9x_rst {
@@ -56,6 +57,16 @@ static void __noreturn at91sam9x_restart_soc(struct 
restart_handler *rst)
hang();
 }
 
+void __noreturn at91sam9_reset(void __iomem *sdram, void __iomem *rstc_cr);
+
+static void __noreturn at91sam9260_restart_soc(struct restart_handler *rst)
+{
+   struct at91sam9x_rst *priv = container_of(rst, struct at91sam9x_rst, 
restart);
+
+   at91sam9_reset(IOMEM(AT91SAM9260_BASE_SDRAMC),
+  IOMEM(priv->base + AT91_RSTC_CR));
+}
+
 static int at91sam9x_rst_probe(struct device *dev)
 {
struct at91sam9x_rst *priv;
@@ -83,14 +94,15 @@ static int at91sam9x_rst_probe(struct device *dev)
at91sam9x_set_reset_reason(dev, priv->base);
 
priv->restart.name = "at91sam9x-rst";
-   priv->restart.restart = at91sam9x_restart_soc;
+   priv->restart.restart = device_get_match_data(dev);
 
return restart_handler_register(>restart);
 }
 
 static const __maybe_unused struct of_device_id at91sam9x_rst_dt_ids[] = {
-   { .compatible = "atmel,at91sam9g45-rstc", },
-   { .compatible = "atmel,sama5d3-rstc", },
+   { .compatible = "atmel,at91sam9260-rstc", at91sam9260_restart_soc },
+   { .compatible = "atmel,at91sam9g45-rstc", at91sam9x_restart_soc },
+   { .compatible = "atmel,sama5d3-rstc", at91sam9x_restart_soc },
{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, at91sam9x_rst_dt_ids);
-- 
2.39.2




[PATCH 5/5] ARM: at91: add first DT support for Calao usb/tny boards

2023-09-26 Thread Ahmad Fatoum
We have a lot of defconfigs for ARM9 AT91 boards, that we want to get
rid off after migrating the boards to at91_multi_defconfig.

Thanks to a temporarily donated Calao USB-A9G20 by Wolfram, we start by
switching the Calao boards to DT.

This is not yet a complete replacement:

  - We use the legacy NAND driver instead of the newly backported driver
that Linux uses with the hardware, presumably without issues

  - OHCI hangs during probe, so it's disabled for now

  - A barebox with comparative functionality to the non-DT version
exceeds the 256K partition size

These can be resolved separately though, so add here first DT support.

Signed-off-by: Ahmad Fatoum 
---
 arch/arm/boards/Makefile  |  1 +
 arch/arm/boards/calao/Makefile|  4 +++
 arch/arm/boards/calao/board.c | 13 
 arch/arm/boards/calao/lowlevel.c  | 30 +
 arch/arm/configs/at91_multi_defconfig |  4 +--
 arch/arm/dts/Makefile |  3 ++
 arch/arm/dts/at91sam9260.dtsi | 33 ++
 arch/arm/dts/at91sam9g20.dtsi |  2 ++
 arch/arm/dts/calao_nand.dtsi  | 48 +++
 arch/arm/dts/tny_a9260.dts|  4 +++
 arch/arm/dts/tny_a9g20.dts|  4 +++
 arch/arm/dts/usb_a9260.dts|  4 +++
 arch/arm/dts/usb_a9g20.dts|  4 +++
 arch/arm/mach-at91/Kconfig| 10 ++
 images/Makefile.at91  |  9 +
 include/mach/at91/at91sam9260.h   |  1 +
 include/mach/at91/at91sam9g45.h   |  1 +
 17 files changed, 173 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boards/calao/Makefile
 create mode 100644 arch/arm/boards/calao/board.c
 create mode 100644 arch/arm/boards/calao/lowlevel.c
 create mode 100644 arch/arm/dts/at91sam9260.dtsi
 create mode 100644 arch/arm/dts/at91sam9g20.dtsi
 create mode 100644 arch/arm/dts/calao_nand.dtsi
 create mode 100644 arch/arm/dts/tny_a9260.dts
 create mode 100644 arch/arm/dts/tny_a9g20.dts
 create mode 100644 arch/arm/dts/usb_a9260.dts
 create mode 100644 arch/arm/dts/usb_a9g20.dts

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index c285ed7aee2d..bdac1e69ee60 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_MACH_AT91SAM9N12EK)  += 
at91sam9n12ek/
 obj-$(CONFIG_MACH_AT91SAM9X5EK)+= at91sam9x5ek/
 obj-$(CONFIG_MACH_BEAGLE)  += beagle/
 obj-$(CONFIG_MACH_BEAGLEBONE)  += beaglebone/
+obj-$(CONFIG_MACH_CALAO)   += calao/
 obj-$(CONFIG_MACH_CANON_A1100) += canon-a1100/
 obj-$(CONFIG_MACH_CM_FX6)  += cm-fx6/
 obj-$(CONFIG_MACH_NITROGEN6)   += boundarydevices-nitrogen6/
diff --git a/arch/arm/boards/calao/Makefile b/arch/arm/boards/calao/Makefile
new file mode 100644
index ..da63d2625f7a
--- /dev/null
+++ b/arch/arm/boards/calao/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/calao/board.c b/arch/arm/boards/calao/board.c
new file mode 100644
index ..cc369c4cf1c1
--- /dev/null
+++ b/arch/arm/boards/calao/board.c
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include 
+#include 
+
+static const struct of_device_id calao_of_match[] = {
+   { .compatible = "calao,tny-a9260" },
+   { .compatible = "calao,tny-a9g20" },
+   { .compatible = "calao,usb-a9260" },
+   { .compatible = "calao,usb-a9g20" },
+   { /* sentinel */ },
+};
+BAREBOX_DEEP_PROBE_ENABLE(calao_of_match);
diff --git a/arch/arm/boards/calao/lowlevel.c b/arch/arm/boards/calao/lowlevel.c
new file mode 100644
index ..2a081a97a4e3
--- /dev/null
+++ b/arch/arm/boards/calao/lowlevel.c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void dbgu_init(void)
+{
+   /* pinmux/clocks/uart already configured by first stage */
+   putc_ll('>');
+}
+
+#define CALAO_ENTRY_2ND(entrypoint, dtbname) \
+AT91_ENTRY_FUNCTION(entrypoint, r0, r1, r2) { \
+   extern char __dtb_z_##dtbname##_start[]; \
+   arm_cpu_lowlevel_init(); \
+   arm_setup_stack(AT91SAM9260_SRAM_END); \
+   dbgu_init(); \
+   at91sam9260_barebox_entry(runtime_address(__dtb_z_##dtbname##_start)); \
+}
+
+CALAO_ENTRY_2ND(start_tny_a9260, tny_a9260);
+CALAO_ENTRY_2ND(start_tny_a9g20, tny_a9g20);
+CALAO_ENTRY_2ND(start_usb_a9260, usb_a9260);
+CALAO_ENTRY_2ND(start_usb_a9g20, usb_a9g20);
diff --git a/arch/arm/configs/at91_multi_defconfig 
b/arch/arm/configs/at91_multi_defconfig
index de47af3bd0a6..e24bb36c2890 100644
--- a/arch/arm/configs/at91_multi_defconfig
+++ b/arch/arm/configs/at91_multi_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARCH_AT91=y
 CONFIG_AT91_MULTI_BOARDS=y
+CONFIG_MACH_CALAO=y
 CONFIG_MACH_SKOV_ARM9CPU=y
 

[PATCH 4/5] ARM: at91: sam9260: don't build non-DT device support when unneeded

2023-09-26 Thread Ahmad Fatoum
The _device.c files create helper functions for creating devices for
legacy boards that do not support CONFIG_AT91_MULTI_BOARDS.

We are adding DT support for 9260, so guard the file behind a
!CONFIG_AT91_MULTI_BOARDS check.

Signed-off-by: Ahmad Fatoum 
---
 arch/arm/mach-at91/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 777dc6d1aa3c..c4532959556e 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -25,10 +25,10 @@ obj-$(CONFIG_HAVE_AT91SAM9_RST) += at91sam9_rst.o
 
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)   += at91rm9200.o at91rm9200_time.o 
at91rm9200_devices.o
-obj-$(CONFIG_SOC_AT91SAM9260) += at91sam9260.o at91sam9260_devices.o
 obj-$(CONFIG_SOC_AT91SAM9261) += at91sam9261.o at91sam9261_devices.o
 obj-$(CONFIG_SOC_AT91SAM9G10) += at91sam9261.o at91sam9261_devices.o
 ifeq ($(CONFIG_AT91_MULTI_BOARDS),)
+obj-$(CONFIG_SOC_AT91SAM9260) += at91sam9260.o at91sam9260_devices.o
 obj-$(CONFIG_SOC_AT91SAM9263) += at91sam9263.o at91sam9263_devices.o
 obj-$(CONFIG_SOC_SAMA5D3)  += sama5d3.o sama5d3_devices.o
 obj-$(CONFIG_SOC_SAMA5D4)  += sama5d4.o sama5d4_devices.o
-- 
2.39.2




[PATCH 0/5] ARM: at91: add first DT support for Calao usb/tny boards

2023-09-26 Thread Ahmad Fatoum
We have a lot of defconfigs for ARM9 AT91 boards, that we want to get
rid off after migrating the boards to at91_multi_defconfig.

Thanks to a temporarily donated Calao USB-A9G20 by Wolfram, we start by
switching the Calao boards to DT.

This is not yet a complete replacement:

  - We use the legacy NAND driver instead of the newly backported driver
that Linux uses with the hardware, presumably without issues

  - OHCI hangs during probe, so it's disabled for now

  - A barebox with comparative functionality to the non-DT version
exceeds the 256K partition size

These can be resolved separately though, so add here first DT support.

Ahmad Fatoum (5):
  Revert "mtd: nand: drop DT support in legacy driver"
  ARM: at91: add SDRAMC driver for memory detection
  ARM: at91: at91sam9_rst: add DT support for at91sam9260
  ARM: at91: sam9260: don't build non-DT device support when unneeded
  ARM: at91: add first DT support for Calao usb/tny boards

 arch/arm/boards/Makefile  |   1 +
 arch/arm/boards/calao/Makefile|   4 +
 arch/arm/boards/calao/board.c |  13 
 arch/arm/boards/calao/lowlevel.c  |  30 
 arch/arm/configs/at91_multi_defconfig |   4 +-
 arch/arm/dts/Makefile |   3 +
 arch/arm/dts/at91sam9260.dtsi |  33 
 arch/arm/dts/at91sam9g20.dtsi |   2 +
 arch/arm/dts/calao_nand.dtsi  |  48 
 arch/arm/dts/tny_a9260.dts|   4 +
 arch/arm/dts/tny_a9g20.dts|   4 +
 arch/arm/dts/usb_a9260.dts|   4 +
 arch/arm/dts/usb_a9g20.dts|   4 +
 arch/arm/mach-at91/Kconfig|  13 
 arch/arm/mach-at91/Makefile   |   3 +-
 arch/arm/mach-at91/at91sam9_rst.c |  18 -
 arch/arm/mach-at91/sdramc.c   |  47 
 drivers/mtd/nand/Kconfig  |   8 +-
 drivers/mtd/nand/atmel/legacy.c   | 104 +-
 images/Makefile.at91  |   9 +++
 include/mach/at91/at91sam9260.h   |   1 +
 include/mach/at91/at91sam9_sdramc.h   |   4 +
 include/mach/at91/at91sam9g45.h   |   1 +
 23 files changed, 353 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/boards/calao/Makefile
 create mode 100644 arch/arm/boards/calao/board.c
 create mode 100644 arch/arm/boards/calao/lowlevel.c
 create mode 100644 arch/arm/dts/at91sam9260.dtsi
 create mode 100644 arch/arm/dts/at91sam9g20.dtsi
 create mode 100644 arch/arm/dts/calao_nand.dtsi
 create mode 100644 arch/arm/dts/tny_a9260.dts
 create mode 100644 arch/arm/dts/tny_a9g20.dts
 create mode 100644 arch/arm/dts/usb_a9260.dts
 create mode 100644 arch/arm/dts/usb_a9g20.dts
 create mode 100644 arch/arm/mach-at91/sdramc.c

-- 
2.39.2




Re: [PATCH] ARM: i.MX8M: don't print TF-A version

2023-09-26 Thread Sascha Hauer
On Mon, Sep 11, 2023 at 12:12:19PM +0200, Ahmad Fatoum wrote:
> In usual configurations, TF-A already prints its version on startup, so
> printing it in barebox again is unnecessary and less informational than
> the TF-A print and complicates running barebox without TF-A.
> Thus just drop it.
> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  arch/arm/mach-imx/imx8m.c | 11 ---
>  1 file changed, 11 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
> index af44b089e08a..c7c799c64bc4 100644
> --- a/arch/arm/mach-imx/imx8m.c
> +++ b/arch/arm/mach-imx/imx8m.c
> @@ -56,7 +56,6 @@ u64 imx8m_uid(void)
>  static int imx8m_init(const char *cputypestr)
>  {
>   void __iomem *src = IOMEM(MX8M_SRC_BASE_ADDR);
> - struct arm_smccc_res res;
>  
>   genpd_activate();
>  
> @@ -66,16 +65,6 @@ static int imx8m_init(const char *cputypestr)
>   imx_set_reset_reason(src + IMX7_SRC_SRSR, imx7_reset_reasons);
>   pr_info("%s unique ID: %llx\n", cputypestr, imx8m_uid());
>  
> - if (IS_ENABLED(CONFIG_ARM_SMCCC) &&
> - IS_ENABLED(CONFIG_FIRMWARE_IMX8MQ_ATF)) {
> - arm_smccc_smc(IMX_SIP_BUILDINFO,
> -   IMX_SIP_BUILDINFO_GET_COMMITHASH,
> -   0, 0, 0, 0, 0, 0, );
> -
> - if (res.a0 > 0)
> - pr_info("i.MX ARM Trusted Firmware: %s\n", (char 
> *));
> - }
> -
>   if (IS_ENABLED(CONFIG_PBL_OPTEE) && tzc380_is_enabled() &&
>   !of_find_node_by_path_from(NULL, "/firmware/optee")) {
>   static struct of_optee_fixup_data optee_fixup_data = {
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |



Re: [PATCH] of: platform: don't fail of_find_device_by_node() if no driver bound

2023-09-26 Thread Sascha Hauer
On Thu, Sep 14, 2023 at 09:30:18AM +0200, Ahmad Fatoum wrote:
> of_find_device_by_node() may be called by a driver following
> of_platform_populate in order to bind the children to drivers.
> It's thus wrong to return NULL when a device has been found, but no
> driver was registered. That also aligns the function with the
> expectation resulting from its name: A device is found and devices may
> be bound or not.

I hesitated applying this one because I am not sure if some users expect
to have a driver bound when of_find_device_by_node() returns a valid
pointer.

I applied it now, let's see what happens.

Sascha

> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  drivers/of/platform.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index bd5f2ad82c6b..1f79a539f541 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -23,11 +23,9 @@
>  struct device *of_find_device_by_node(struct device_node *np)
>  {
>   struct device *dev;
> - int ret;
>  
> - ret = of_device_ensure_probed(np);
> - if (ret)
> - return NULL;
> + /* Not having a driver is not an error here */
> + (void)of_device_ensure_probed(np);
>  
>   if (deep_probe_is_supported())
>   return np->dev;
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |



Re: [PATCH v2 0/2] raspi: pass additional VC values via dtb

2023-09-26 Thread Sascha Hauer
Hi Denis,

On Mon, Sep 25, 2023 at 01:09:36PM +0200, Denis Osterland-Heim wrote:
> v2: fix whitespace error, add acked-by of Ahmad, fix line of 80 chars
> 
> Denis OSTERLAND-HEIM (2):
>   raspi: support to read vc values via dt-2nd boot
>   raspi: fixup additional vc created nodes
> 
>  arch/arm/boards/raspberry-pi/rpi-common.c | 69 ++-
> 
>  1 file changed, 49 insertions(+), 20 deletions(-)

The patches are still mangled. There are additional linebreaks, spaces
are replaced by UTF-8 character 0xc2a0 and tabs are replaced by multiple
0xc2a0. I fixed this up by hand this time, but please check your setup
for the next time. Are you using git send-email? If not, I'd recommend
doing so.

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |



Re: [PATCH v2 0/7] tlsf: use 8-byte alignment for normal malloc allocations

2023-09-26 Thread Sascha Hauer
On Mon, Sep 11, 2023 at 05:24:26PM +0200, Ahmad Fatoum wrote:
> TLSF currently uses only 4-byte alignment on 32-bit platforms, which isn't
> enough for ldrd/strd on ARMv7. This series reworks TLSF a bit, so we always
> have at least 8 byte alignment.  dlmalloc already has 8 byte alignment
> minimum, so nothing to do there.
> 
> This has the added benefit of giving TLSF the same alignment as KASAN,
> which can make debugging easier.
> 
> v1 didn't actually manage to boot on an i.MX6, which v2 fixes. This
> also boots normally on i.MX8M. I suggest this going into next after
> v2023.09.0.
> 
> v1 -> v2:
>   - drop switch of test_ffs_fls to bselftest. This function should just
> be replaced with barebox' own implementation in future
>   - keep block size a size_t and just ensure the block metadata is
> correctly aligned.

Applied, thanks

Sascha

> 
> Ahmad Fatoum (7):
>   tlsf: turn static const variables into compiletime constant
> expressions
>   tlsf: ensure malloc pool is aligned
>   tlsf: fix sizeof(size_t) == sizeof(void *) assumption
>   tlsf: give malloc 8-byte alignment on 32-bit as well
>   common: malloc: ensure alignment is always at least 8 byte
>   test: self: refactor to allow alignment check
>   test: self: malloc: fix memory leaks
> 
>  common/Kconfig |  5 +++
>  common/dlmalloc.c  |  3 ++
>  common/dummy_malloc.c  |  2 +-
>  common/tlsf.c  | 43 ++-
>  include/linux/bitops.h |  1 +
>  test/self/malloc.c | 96 ++
>  6 files changed, 102 insertions(+), 48 deletions(-)
> 
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |