mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/9] ARM: misc cleanups
@ 2023-02-28 14:30 Sascha Hauer
  2023-02-28 14:30 ` [PATCH 1/9] ARM: mxs: remove unused mach/clock.h Sascha Hauer
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

I am working on making it possible to build support for multiple
arch/arm/mach-*/ into the same barebox. Here are some misc cleanups
I stumbled upon while preparing multi arch support.

Sascha Hauer (9):
  ARM: mxs: remove unused mach/clock.h
  ARM: imx: remove unused mach/clock.h
  ARM: rockchip: drop mach/timer.h
  ARM: i.MX: Move imxfb.h to include/platform_data/
  pinctrl: rockchip: Fix uninitialized var warning
  ARM: at91: remove unnecessary configs
  ARM: at91: Switch all boards to multiimage
  at91: consolidate usb-a963 128m images
  ARM: pxa: Move plat/ include files to mach/

 arch/arm/Kconfig                              |   1 +
 arch/arm/boards/animeo_ip/lowlevel.c          |   2 +-
 arch/arm/boards/at91rm9200ek/lowlevel.c       |   2 +-
 arch/arm/boards/at91sam9260ek/lowlevel.c      |  13 +-
 arch/arm/boards/at91sam9261ek/lowlevel_init.c |  11 +-
 arch/arm/boards/at91sam9m10g45ek/lowlevel.c   |   2 +-
 arch/arm/boards/at91sam9m10ihd/lowlevel.c     |   2 +-
 arch/arm/boards/at91sam9n12ek/lowlevel.c      |   2 +-
 .../arm/boards/chumby_falconwing/falconwing.c |   1 -
 .../boards/crystalfontz-cfa10036/cfa10036.c   |   1 -
 arch/arm/boards/dss11/lowlevel.c              |   2 +-
 arch/arm/boards/duckbill/board.c              |   1 -
 .../boards/eukrea_cpuimx25/eukrea_cpuimx25.c  |   2 +-
 .../boards/eukrea_cpuimx27/eukrea_cpuimx27.c  |   2 +-
 arch/arm/boards/freescale-mx21-ads/imx21ads.c |   2 +-
 arch/arm/boards/freescale-mx23-evk/mx23-evk.c |   1 -
 arch/arm/boards/guf-neso/board.c              |   2 +-
 arch/arm/boards/haba-knx/lowlevel.c           |   2 +-
 .../boards/imx233-olinuxino/imx23-olinuxino.c |   1 -
 arch/arm/boards/karo-tx28/tx28-stk5.c         |   1 -
 arch/arm/boards/phytec-phycard-imx27/pca100.c |   2 +-
 arch/arm/boards/phytec-phycore-imx27/pcm038.c |   2 +-
 arch/arm/boards/pm9261/lowlevel_init.c        |   2 +-
 arch/arm/boards/pm9263/lowlevel_init.c        |   2 +-
 arch/arm/boards/pm9g45/lowlevel.c             |   2 +-
 arch/arm/boards/qil-a926x/lowlevel.c          |  13 +-
 arch/arm/boards/telit-evk-pro3/lowlevel.c     |   2 +-
 .../arm/boards/tny-a926x/tny_a9260_lowlevel.c |  13 +-
 .../arm/boards/tny-a926x/tny_a9263_lowlevel.c |   2 +-
 .../arm/boards/usb-a926x/usb_a9260_lowlevel.c |  13 +-
 .../arm/boards/usb-a926x/usb_a9263_lowlevel.c |  21 +-
 arch/arm/configs/qil_a9260_128mib_defconfig   |  73 ---
 arch/arm/configs/qil_a9g20_128mib_defconfig   |  73 ---
 .../usb_a9263_128mib_bootstrap_defconfig      |  24 -
 arch/arm/configs/usb_a9263_128mib_defconfig   |  77 ---
 arch/arm/configs/usb_a9g20_128mib_defconfig   |  83 ----
 arch/arm/mach-at91/Kconfig                    |   7 -
 arch/arm/mach-imx/include/mach/clock.h        |   3 -
 arch/arm/mach-imx/include/mach/devices.h      |   2 +-
 arch/arm/mach-mxs/clocksource-imx23.c         |   1 -
 arch/arm/mach-mxs/clocksource-imx28.c         |   1 -
 arch/arm/mach-mxs/include/mach/clock.h        |   7 -
 arch/arm/mach-pxa/include/mach/gpio.h         |  38 +-
 arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h   |   2 +-
 arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h   |   2 +-
 arch/arm/mach-pxa/include/mach/mfp.h          | 460 ++++++++++++++++-
 arch/arm/mach-pxa/include/plat/gpio.h         |  42 --
 arch/arm/mach-pxa/include/plat/mfp.h          | 469 ------------------
 arch/arm/mach-pxa/mfp-pxa3xx.c                |   2 +-
 arch/arm/mach-rockchip/include/mach/timer.h   |  19 -
 drivers/clocksource/rk_timer.c                |  10 +-
 drivers/mci/mxs.c                             |   1 -
 drivers/pinctrl/pinctrl-rockchip.c            |   2 +-
 drivers/serial/serial_auart.c                 |   2 -
 drivers/serial/stm-serial.c                   |   1 -
 drivers/spi/mxs_spi.c                         |   1 -
 drivers/video/imx-ipu-fb.c                    |   2 +-
 drivers/video/imx.c                           |   2 +-
 images/Makefile.at91                          |  96 ++++
 .../mach => include/platform_data}/imxfb.h    |   0
 60 files changed, 695 insertions(+), 934 deletions(-)
 delete mode 100644 arch/arm/configs/qil_a9260_128mib_defconfig
 delete mode 100644 arch/arm/configs/qil_a9g20_128mib_defconfig
 delete mode 100644 arch/arm/configs/usb_a9263_128mib_bootstrap_defconfig
 delete mode 100644 arch/arm/configs/usb_a9263_128mib_defconfig
 delete mode 100644 arch/arm/configs/usb_a9g20_128mib_defconfig
 delete mode 100644 arch/arm/mach-imx/include/mach/clock.h
 delete mode 100644 arch/arm/mach-mxs/include/mach/clock.h
 delete mode 100644 arch/arm/mach-pxa/include/plat/gpio.h
 delete mode 100644 arch/arm/mach-pxa/include/plat/mfp.h
 delete mode 100644 arch/arm/mach-rockchip/include/mach/timer.h
 rename {arch/arm/mach-imx/include/mach => include/platform_data}/imxfb.h (100%)

-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/9] ARM: mxs: remove unused mach/clock.h
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 2/9] ARM: imx: " Sascha Hauer
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

mach/clock.h doesn't contain anything useful, remove it and
drop its inclusion from files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/chumby_falconwing/falconwing.c     | 1 -
 arch/arm/boards/crystalfontz-cfa10036/cfa10036.c   | 1 -
 arch/arm/boards/duckbill/board.c                   | 1 -
 arch/arm/boards/freescale-mx23-evk/mx23-evk.c      | 1 -
 arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c | 1 -
 arch/arm/boards/karo-tx28/tx28-stk5.c              | 1 -
 arch/arm/mach-mxs/clocksource-imx23.c              | 1 -
 arch/arm/mach-mxs/clocksource-imx28.c              | 1 -
 arch/arm/mach-mxs/include/mach/clock.h             | 7 -------
 drivers/mci/mxs.c                                  | 1 -
 drivers/serial/serial_auart.c                      | 2 --
 drivers/serial/stm-serial.c                        | 1 -
 drivers/spi/mxs_spi.c                              | 1 -
 13 files changed, 20 deletions(-)
 delete mode 100644 arch/arm/mach-mxs/include/mach/clock.h

diff --git a/arch/arm/boards/chumby_falconwing/falconwing.c b/arch/arm/boards/chumby_falconwing/falconwing.c
index 82b9415e80..44619d0c24 100644
--- a/arch/arm/boards/chumby_falconwing/falconwing.c
+++ b/arch/arm/boards/chumby_falconwing/falconwing.c
@@ -16,7 +16,6 @@
 #include <asm/mmu.h>
 #include <generated/mach-types.h>
 #include <mach/imx-regs.h>
-#include <mach/clock.h>
 #include <mach/mci.h>
 #include <mach/fb.h>
 #include <mach/usb.h>
diff --git a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
index 5a951d1abf..69ac71b0c3 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
+++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
@@ -19,7 +19,6 @@
 #include <i2c/i2c-gpio.h>
 #include <i2c/at24.h>
 
-#include <mach/clock.h>
 #include <mach/imx-regs.h>
 #include <mach/iomux.h>
 #include <mach/mci.h>
diff --git a/arch/arm/boards/duckbill/board.c b/arch/arm/boards/duckbill/board.c
index dd22c81566..56a4cc1853 100644
--- a/arch/arm/boards/duckbill/board.c
+++ b/arch/arm/boards/duckbill/board.c
@@ -11,7 +11,6 @@
 #include <io.h>
 #include <net.h>
 
-#include <mach/clock.h>
 #include <mach/imx-regs.h>
 #include <mach/iomux-imx28.h>
 #include <mach/iomux.h>
diff --git a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
index b12bb0dd79..b0aa9e1a33 100644
--- a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
+++ b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
@@ -12,7 +12,6 @@
 #include <generated/mach-types.h>
 #include <asm/barebox-arm.h>
 #include <mach/imx-regs.h>
-#include <mach/clock.h>
 #include <mach/mci.h>
 #include <usb/fsl_usb2.h>
 #include <mach/usb.h>
diff --git a/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
index 350576fa52..91151feba1 100644
--- a/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
+++ b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
@@ -22,7 +22,6 @@
 #include <mach/usb.h>
 #include <generated/mach-types.h>
 #include <mach/imx-regs.h>
-#include <mach/clock.h>
 #include <mach/mci.h>
 #include <mach/iomux.h>
 
diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c
index 56211d7a3a..c5e7b1451c 100644
--- a/arch/arm/boards/karo-tx28/tx28-stk5.c
+++ b/arch/arm/boards/karo-tx28/tx28-stk5.c
@@ -15,7 +15,6 @@
 #include <asm/barebox-arm.h>
 #include <linux/err.h>
 #include <mach/imx-regs.h>
-#include <mach/clock.h>
 #include <mach/mci.h>
 #include <mach/fb.h>
 #include <mach/ocotp.h>
diff --git a/arch/arm/mach-mxs/clocksource-imx23.c b/arch/arm/mach-mxs/clocksource-imx23.c
index ba5aad9f30..2973422229 100644
--- a/arch/arm/mach-mxs/clocksource-imx23.c
+++ b/arch/arm/mach-mxs/clocksource-imx23.c
@@ -6,7 +6,6 @@
 #include <clock.h>
 #include <notifier.h>
 #include <mach/imx23-regs.h>
-#include <mach/clock.h>
 #include <io.h>
 
 #define TIMROTCTRL 0x00
diff --git a/arch/arm/mach-mxs/clocksource-imx28.c b/arch/arm/mach-mxs/clocksource-imx28.c
index 65d8155ad2..6280cc64fb 100644
--- a/arch/arm/mach-mxs/clocksource-imx28.c
+++ b/arch/arm/mach-mxs/clocksource-imx28.c
@@ -6,7 +6,6 @@
 #include <clock.h>
 #include <notifier.h>
 #include <mach/imx28-regs.h>
-#include <mach/clock.h>
 #include <io.h>
 
 #define TIMROTCTRL 0x00
diff --git a/arch/arm/mach-mxs/include/mach/clock.h b/arch/arm/mach-mxs/include/mach/clock.h
deleted file mode 100644
index 2050b95913..0000000000
--- a/arch/arm/mach-mxs/include/mach/clock.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/* SPDX-FileCopyrightText: 2010 Juergen Beisert, Pengutronix */
-
-#ifndef __MACH_CLOCK_H
-# define __MACH_CLOCK_H
-
-#endif /* __MACH_CLOCK_H */
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
index 8e0753fe95..6a348e331e 100644
--- a/drivers/mci/mxs.c
+++ b/drivers/mci/mxs.c
@@ -28,7 +28,6 @@
 #include <linux/err.h>
 #include <asm/bitops.h>
 #include <mach/mci.h>
-#include <mach/clock.h>
 #include <mach/ssp.h>
 
 #define CLOCKRATE_MIN (1 * 1000 * 1000)
diff --git a/drivers/serial/serial_auart.c b/drivers/serial/serial_auart.c
index a0163bef6f..2ac7349c66 100644
--- a/drivers/serial/serial_auart.c
+++ b/drivers/serial/serial_auart.c
@@ -36,8 +36,6 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 
-#include <mach/clock.h>
-
 #define HW_UARTAPP_CTRL0		(0x00000000)
 
 #define HW_UARTAPP_CTRL2		(0x00000020)
diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c
index bddb422ac5..e7c04654d2 100644
--- a/drivers/serial/stm-serial.c
+++ b/drivers/serial/stm-serial.c
@@ -20,7 +20,6 @@
 #include <malloc.h>
 #include <linux/clk.h>
 #include <linux/err.h>
-#include <mach/clock.h>
 
 #define UARTDBGDR 0x00
 #define UARTDBGFR 0x18
diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index c44f551408..c435e4f22b 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -19,7 +19,6 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <mach/generic.h>
-#include <mach/clock.h>
 #include <mach/ssp.h>
 
 #define	MXS_SPI_MAX_TIMEOUT		(10 * MSECOND)
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/9] ARM: imx: remove unused mach/clock.h
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
  2023-02-28 14:30 ` [PATCH 1/9] ARM: mxs: remove unused mach/clock.h Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 3/9] ARM: rockchip: drop mach/timer.h Sascha Hauer
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

mach/clock.h is unused and doesn't contain anything useful. Remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/include/mach/clock.h | 3 ---
 1 file changed, 3 deletions(-)
 delete mode 100644 arch/arm/mach-imx/include/mach/clock.h

diff --git a/arch/arm/mach-imx/include/mach/clock.h b/arch/arm/mach-imx/include/mach/clock.h
deleted file mode 100644
index af1a6e439a..0000000000
--- a/arch/arm/mach-imx/include/mach/clock.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-/* nothing, but some drivers need this include */
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 3/9] ARM: rockchip: drop mach/timer.h
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
  2023-02-28 14:30 ` [PATCH 1/9] ARM: mxs: remove unused mach/clock.h Sascha Hauer
  2023-02-28 14:30 ` [PATCH 2/9] ARM: imx: " Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 4/9] ARM: i.MX: Move imxfb.h to include/platform_data/ Sascha Hauer
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

mach/timer.h only contains the declaration of struct rk_timer. Move
this into its only user and drop the file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-rockchip/include/mach/timer.h | 19 -------------------
 drivers/clocksource/rk_timer.c              | 10 +++++++++-
 2 files changed, 9 insertions(+), 20 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/include/mach/timer.h

diff --git a/arch/arm/mach-rockchip/include/mach/timer.h b/arch/arm/mach-rockchip/include/mach/timer.h
deleted file mode 100644
index e6ed0e4e3e..0000000000
--- a/arch/arm/mach-rockchip/include/mach/timer.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * (C) Copyright 2015 Rockchip Electronics Co., Ltd
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _ASM_ARCH_TIMER_H
-#define _ASM_ARCH_TIMER_H
-
-struct rk_timer {
-	unsigned int timer_load_count0;
-	unsigned int timer_load_count1;
-	unsigned int timer_curr_value0;
-	unsigned int timer_curr_value1;
-	unsigned int timer_ctrl_reg;
-	unsigned int timer_int_status;
-};
-
-#endif
diff --git a/drivers/clocksource/rk_timer.c b/drivers/clocksource/rk_timer.c
index 36aa6949e3..1d4b764561 100644
--- a/drivers/clocksource/rk_timer.c
+++ b/drivers/clocksource/rk_timer.c
@@ -10,12 +10,20 @@
 #include <clock.h>
 #include <init.h>
 #include <io.h>
-#include <mach/timer.h>
 #include <stdio.h>
 #include <mach/hardware.h>
 #include <mach/cru_rk3288.h>
 #include <common.h>
 
+struct rk_timer {
+	unsigned int timer_load_count0;
+	unsigned int timer_load_count1;
+	unsigned int timer_curr_value0;
+	unsigned int timer_curr_value1;
+	unsigned int timer_ctrl_reg;
+	unsigned int timer_int_status;
+};
+
 struct rk_timer *timer_ptr;
 
 static uint64_t rockchip_get_ticks(void)
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 4/9] ARM: i.MX: Move imxfb.h to include/platform_data/
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
                   ` (2 preceding siblings ...)
  2023-02-28 14:30 ` [PATCH 3/9] ARM: rockchip: drop mach/timer.h Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 5/9] pinctrl: rockchip: Fix uninitialized var warning Sascha Hauer
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

mach/imxfb.h only contains the platform_data for the framebuffer driver.
This is better suited in include/platform_data/, so move it there.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c               | 2 +-
 arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c               | 2 +-
 arch/arm/boards/freescale-mx21-ads/imx21ads.c                   | 2 +-
 arch/arm/boards/guf-neso/board.c                                | 2 +-
 arch/arm/boards/phytec-phycard-imx27/pca100.c                   | 2 +-
 arch/arm/boards/phytec-phycore-imx27/pcm038.c                   | 2 +-
 arch/arm/mach-imx/include/mach/devices.h                        | 2 +-
 drivers/video/imx-ipu-fb.c                                      | 2 +-
 drivers/video/imx.c                                             | 2 +-
 .../arm/mach-imx/include/mach => include/platform_data}/imxfb.h | 0
 10 files changed, 9 insertions(+), 9 deletions(-)
 rename {arch/arm/mach-imx/include/mach => include/platform_data}/imxfb.h (100%)

diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index ec0063ed9b..b24d85b8bc 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -18,7 +18,7 @@
 
 #include <generated/mach-types.h>
 #include <mach/imx-nand.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <mach/iim.h>
 #include <platform_data/eth-fec.h>
 #include <nand.h>
diff --git a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
index 19afadec4d..bb5ef52793 100644
--- a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
+++ b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
@@ -26,7 +26,7 @@
 #include <mach/imx-nand.h>
 #include <mach/imx-pll.h>
 #include <mach/weim.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <platform_data/serial-ns16550.h>
 #include <asm/mmu.h>
 #include <i2c/i2c.h>
diff --git a/arch/arm/boards/freescale-mx21-ads/imx21ads.c b/arch/arm/boards/freescale-mx21-ads/imx21ads.c
index beedacd7a7..0f596b21b9 100644
--- a/arch/arm/boards/freescale-mx21-ads/imx21ads.c
+++ b/arch/arm/boards/freescale-mx21-ads/imx21ads.c
@@ -23,7 +23,7 @@
 #include <fcntl.h>
 #include <generated/mach-types.h>
 #include <mach/imx-nand.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <mach/iomux-mx21.h>
 #include <mach/devices-imx21.h>
 
diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c
index 4662ab0ef8..4a98592107 100644
--- a/arch/arm/boards/guf-neso/board.c
+++ b/arch/arm/boards/guf-neso/board.c
@@ -26,7 +26,7 @@
 #include <mach/iomux-mx27.h>
 #include <mach/imx-nand.h>
 #include <mach/imx-pll.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <mach/devices-imx27.h>
 
 /* two pins are controlling the CS signals to the USB phys */
diff --git a/arch/arm/boards/phytec-phycard-imx27/pca100.c b/arch/arm/boards/phytec-phycard-imx27/pca100.c
index 4abac31a8a..fa285f3d16 100644
--- a/arch/arm/boards/phytec-phycard-imx27/pca100.c
+++ b/arch/arm/boards/phytec-phycard-imx27/pca100.c
@@ -18,7 +18,7 @@
 #include <io.h>
 #include <mach/imx-nand.h>
 #include <mach/imx-pll.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <asm/mmu.h>
 #include <usb/ulpi.h>
 #include <mach/bbu.h>
diff --git a/arch/arm/boards/phytec-phycore-imx27/pcm038.c b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
index 90ce579684..183b64094b 100644
--- a/arch/arm/boards/phytec-phycore-imx27/pcm038.c
+++ b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
@@ -14,7 +14,7 @@
 #include <mach/devices-imx27.h>
 #include <mach/imx-pll.h>
 #include <mach/imx27-regs.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <mach/iomux-mx27.h>
 #include <mfd/mc13xxx.h>
 #include <mach/bbu.h>
diff --git a/arch/arm/mach-imx/include/mach/devices.h b/arch/arm/mach-imx/include/mach/devices.h
index 3f785548ff..0e68125f26 100644
--- a/arch/arm/mach-imx/include/mach/devices.h
+++ b/arch/arm/mach-imx/include/mach/devices.h
@@ -5,7 +5,7 @@
 #include <i2c/i2c.h>
 #include <mach/spi.h>
 #include <mach/imx-nand.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <mach/imx-ipu-fb.h>
 #include <platform_data/mmc-esdhc-imx.h>
 #include <usb/chipidea-imx.h>
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index cca11dcd84..77c0ba2c9c 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -10,7 +10,7 @@
 #include <io.h>
 #include <mach/imx35-regs.h>
 #include <fb.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <malloc.h>
 #include <errno.h>
 #include <linux/math64.h>
diff --git a/drivers/video/imx.c b/drivers/video/imx.c
index 5bf5345619..cb1c11b4cb 100644
--- a/drivers/video/imx.c
+++ b/drivers/video/imx.c
@@ -14,7 +14,7 @@
 #include <common.h>
 #include <fb.h>
 #include <io.h>
-#include <mach/imxfb.h>
+#include <platform_data/imxfb.h>
 #include <driver.h>
 #include <malloc.h>
 #include <errno.h>
diff --git a/arch/arm/mach-imx/include/mach/imxfb.h b/include/platform_data/imxfb.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/imxfb.h
rename to include/platform_data/imxfb.h
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 5/9] pinctrl: rockchip: Fix uninitialized var warning
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
                   ` (3 preceding siblings ...)
  2023-02-28 14:30 ` [PATCH 4/9] ARM: i.MX: Move imxfb.h to include/platform_data/ Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 6/9] ARM: at91: remove unnecessary configs Sascha Hauer
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

'data' is not used uninitialized, but until the compiler understands
this just initialize it to NULL.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/pinctrl/pinctrl-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index ed53630fe0..df5f22a7c5 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -525,7 +525,7 @@ static bool rockchip_get_mux_route(struct rockchip_pin_bank *bank, int pin,
 {
 	struct rockchip_pinctrl *info = bank->drvdata;
 	struct rockchip_pin_ctrl *ctrl = info->ctrl;
-	struct rockchip_mux_route_data *data;
+	struct rockchip_mux_route_data *data = NULL;
 	int i;
 
 	for (i = 0; i < ctrl->niomux_routes; i++) {
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 6/9] ARM: at91: remove unnecessary configs
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
                   ` (4 preceding siblings ...)
  2023-02-28 14:30 ` [PATCH 5/9] pinctrl: rockchip: Fix uninitialized var warning Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 7/9] ARM: at91: Switch all boards to multiimage Sascha Hauer
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

We have some at91 defconfig files which differ from other files
only in the AT91_HAVE_SRAM_128M symbol. This symbol is not even
avaluated for several boards, so remove the unnecessary config
files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/configs/qil_a9260_128mib_defconfig | 73 ------------------
 arch/arm/configs/qil_a9g20_128mib_defconfig | 73 ------------------
 arch/arm/configs/usb_a9g20_128mib_defconfig | 83 ---------------------
 3 files changed, 229 deletions(-)
 delete mode 100644 arch/arm/configs/qil_a9260_128mib_defconfig
 delete mode 100644 arch/arm/configs/qil_a9g20_128mib_defconfig
 delete mode 100644 arch/arm/configs/usb_a9g20_128mib_defconfig

diff --git a/arch/arm/configs/qil_a9260_128mib_defconfig b/arch/arm/configs/qil_a9260_128mib_defconfig
deleted file mode 100644
index 3124a71ca9..0000000000
--- a/arch/arm/configs/qil_a9260_128mib_defconfig
+++ /dev/null
@@ -1,73 +0,0 @@
-CONFIG_ARCH_AT91SAM9260=y
-CONFIG_MACH_QIL_A9260=y
-CONFIG_AT91_HAVE_SRAM_128M=y
-CONFIG_CALAO_MB_QIL_A9260=y
-CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000
-CONFIG_AEABI=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_PBL_IMAGE=y
-CONFIG_MMU=y
-CONFIG_EXPERIMENTAL=y
-CONFIG_PROMPT="USB-9G20:"
-CONFIG_GLOB=y
-CONFIG_PROMPT_HUSH_PS2="y"
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_MENU=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_BOOTM_VERBOSE=y
-CONFIG_BOOTM_INITRD=y
-CONFIG_BOOTM_OFTREE=y
-CONFIG_BOOTM_OFTREE_UIMAGE=y
-CONFIG_CONSOLE_ACTIVATE_ALL=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-# CONFIG_CMD_ARM_CPUINFO is not set
-CONFIG_LONGHELP=y
-CONFIG_CMD_MEMINFO=y
-# CONFIG_CMD_BOOTU is not set
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_UIMAGE=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_MENU=y
-CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_LED_TRIGGER=y
-CONFIG_CMD_OFTREE=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_RESOLV=y
-CONFIG_DRIVER_NET_MACB=y
-# CONFIG_SPI is not set
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_NAND=y
-# CONFIG_NAND_ECC_HW is not set
-# CONFIG_NAND_ECC_HW_SYNDROME is not set
-# CONFIG_NAND_ECC_HW_NONE is not set
-CONFIG_NAND_ATMEL=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_DFU=y
-CONFIG_USB_GADGET_SERIAL=y
-CONFIG_MCI=y
-CONFIG_MCI_ATMEL=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_FS_TFTP=y
diff --git a/arch/arm/configs/qil_a9g20_128mib_defconfig b/arch/arm/configs/qil_a9g20_128mib_defconfig
deleted file mode 100644
index 0b2da05838..0000000000
--- a/arch/arm/configs/qil_a9g20_128mib_defconfig
+++ /dev/null
@@ -1,73 +0,0 @@
-CONFIG_ARCH_AT91SAM9G20=y
-CONFIG_MACH_QIL_A9G20=y
-CONFIG_AT91_HAVE_SRAM_128M=y
-CONFIG_CALAO_MB_QIL_A9260=y
-CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000
-CONFIG_AEABI=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_PBL_IMAGE=y
-CONFIG_MMU=y
-CONFIG_EXPERIMENTAL=y
-CONFIG_PROMPT="USB-9G20:"
-CONFIG_GLOB=y
-CONFIG_PROMPT_HUSH_PS2="y"
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_MENU=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_BOOTM_VERBOSE=y
-CONFIG_BOOTM_INITRD=y
-CONFIG_BOOTM_OFTREE=y
-CONFIG_BOOTM_OFTREE_UIMAGE=y
-CONFIG_CONSOLE_ACTIVATE_ALL=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-# CONFIG_CMD_ARM_CPUINFO is not set
-CONFIG_LONGHELP=y
-CONFIG_CMD_MEMINFO=y
-# CONFIG_CMD_BOOTU is not set
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_UIMAGE=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_MENU=y
-CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_LED_TRIGGER=y
-CONFIG_CMD_OFTREE=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_RESOLV=y
-CONFIG_DRIVER_NET_MACB=y
-# CONFIG_SPI is not set
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_NAND=y
-# CONFIG_NAND_ECC_HW is not set
-# CONFIG_NAND_ECC_HW_SYNDROME is not set
-# CONFIG_NAND_ECC_HW_NONE is not set
-CONFIG_NAND_ATMEL=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_DFU=y
-CONFIG_USB_GADGET_SERIAL=y
-CONFIG_MCI=y
-CONFIG_MCI_ATMEL=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_FS_TFTP=y
diff --git a/arch/arm/configs/usb_a9g20_128mib_defconfig b/arch/arm/configs/usb_a9g20_128mib_defconfig
deleted file mode 100644
index fce3a10061..0000000000
--- a/arch/arm/configs/usb_a9g20_128mib_defconfig
+++ /dev/null
@@ -1,83 +0,0 @@
-CONFIG_ARCH_AT91SAM9G20=y
-CONFIG_MACH_USB_A9G20=y
-CONFIG_AT91_HAVE_SRAM_128M=y
-CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000
-CONFIG_AEABI=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_PBL_IMAGE=y
-CONFIG_MMU=y
-CONFIG_EXPERIMENTAL=y
-CONFIG_MALLOC_TLSF=y
-CONFIG_PROMPT="USB-9G20:"
-CONFIG_GLOB=y
-CONFIG_PROMPT_HUSH_PS2="y"
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_MENU=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_BOOTM_VERBOSE=y
-CONFIG_BOOTM_INITRD=y
-CONFIG_BOOTM_OFTREE=y
-CONFIG_BOOTM_OFTREE_UIMAGE=y
-CONFIG_CONSOLE_ACTIVATE_ALL=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-# CONFIG_CMD_ARM_CPUINFO is not set
-CONFIG_LONGHELP=y
-CONFIG_CMD_MEMINFO=y
-# CONFIG_CMD_BOOTU is not set
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_UIMAGE=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_MD5SUM=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_LOGIN=y
-CONFIG_CMD_MENU=y
-CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_PASSWD=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_SPI=y
-CONFIG_CMD_LED_TRIGGER=y
-CONFIG_CMD_OFTREE=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_RESOLV=y
-CONFIG_DRIVER_NET_MACB=y
-CONFIG_DRIVER_SPI_ATMEL=y
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_NAND=y
-# CONFIG_NAND_ECC_HW is not set
-# CONFIG_NAND_ECC_HW_SYNDROME is not set
-# CONFIG_NAND_ECC_HW_NONE is not set
-CONFIG_NAND_ATMEL=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_DFU=y
-CONFIG_USB_GADGET_SERIAL=y
-CONFIG_MCI=y
-CONFIG_MCI_STARTUP=y
-CONFIG_MCI_SPI=y
-CONFIG_MMC_SPI_CRC_ON=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_FS_TFTP=y
-CONFIG_FS_FAT=y
-CONFIG_FS_FAT_WRITE=y
-CONFIG_FS_FAT_LFN=y
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 7/9] ARM: at91: Switch all boards to multiimage
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
                   ` (5 preceding siblings ...)
  2023-02-28 14:30 ` [PATCH 6/9] ARM: at91: remove unnecessary configs Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 8/9] at91: consolidate usb-a963 128m images Sascha Hauer
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

Most at91 boards are not safe for multiimage support. We can however
switch their compilation to the multiimage way which allows us to get
rid of some legacy cruft in the longer run.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/Kconfig                              |  1 +
 arch/arm/boards/animeo_ip/lowlevel.c          |  2 +-
 arch/arm/boards/at91rm9200ek/lowlevel.c       |  2 +-
 arch/arm/boards/at91sam9260ek/lowlevel.c      | 13 ++-
 arch/arm/boards/at91sam9261ek/lowlevel_init.c | 11 ++-
 arch/arm/boards/at91sam9m10g45ek/lowlevel.c   |  2 +-
 arch/arm/boards/at91sam9m10ihd/lowlevel.c     |  2 +-
 arch/arm/boards/at91sam9n12ek/lowlevel.c      |  2 +-
 arch/arm/boards/dss11/lowlevel.c              |  2 +-
 arch/arm/boards/haba-knx/lowlevel.c           |  2 +-
 arch/arm/boards/pm9261/lowlevel_init.c        |  2 +-
 arch/arm/boards/pm9263/lowlevel_init.c        |  2 +-
 arch/arm/boards/pm9g45/lowlevel.c             |  2 +-
 arch/arm/boards/qil-a926x/lowlevel.c          | 13 ++-
 arch/arm/boards/telit-evk-pro3/lowlevel.c     |  2 +-
 .../arm/boards/tny-a926x/tny_a9260_lowlevel.c | 13 ++-
 .../arm/boards/tny-a926x/tny_a9263_lowlevel.c |  2 +-
 .../arm/boards/usb-a926x/usb_a9260_lowlevel.c | 13 ++-
 .../arm/boards/usb-a926x/usb_a9263_lowlevel.c |  2 +-
 arch/arm/mach-at91/Kconfig                    |  1 -
 images/Makefile.at91                          | 92 +++++++++++++++++++
 21 files changed, 164 insertions(+), 19 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8183f6d546..3ac9bc4ad7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -42,6 +42,7 @@ config ARCH_AT91
 	bool "Atmel AT91"
 	select GPIOLIB
 	select CLKDEV_LOOKUP
+	select HAVE_PBL_MULTI_IMAGES
 	select HAS_DEBUG_LL
 	select HAVE_CLK
 	select COMMON_CLK_AT91 if COMMON_CLK_OF_PROVIDER
diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
index 7f52f824df..2d443f5384 100644
--- a/arch/arm/boards/animeo_ip/lowlevel.c
+++ b/arch/arm/boards/animeo_ip/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_animeo_ip, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
index b132ccc084..ba62f1116d 100644
--- a/arch/arm/boards/at91rm9200ek/lowlevel.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -21,7 +21,7 @@ void static inline access_sdram(void)
 	writel(0x00000000, AT91_CHIPSELECT_1);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91rm9200ek, r0, r1, r2)
 {
 	u32 r;
 	int i;
diff --git a/arch/arm/boards/at91sam9260ek/lowlevel.c b/arch/arm/boards/at91sam9260ek/lowlevel.c
index 7f52f824df..81fe70278b 100644
--- a/arch/arm/boards/at91sam9260ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
@@ -14,7 +14,18 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1,
+			  at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+			  NULL);
+}
+
+ENTRY_FUNCTION(start_at91sam9g20ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9261ek/lowlevel_init.c b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
index bb9b905c65..47a8f21db8 100644
--- a/arch/arm/boards/at91sam9261ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
@@ -117,7 +117,16 @@ static void __bare_init at91sam9261ek_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE);
+
+	at91sam9261ek_init();
+}
+
+ENTRY_FUNCTION(start_at91sam9g10ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
index 755e7ec029..94732df14f 100644
--- a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/hardware.h>
 #include <mach/at91_ddrsdrc.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91sam9m10g45ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
index 817c7548c9..1dd17ee263 100644
--- a/arch/arm/boards/at91sam9m10ihd/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9g45.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91sam9m10ihd, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9n12ek/lowlevel.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
index 4353555d0d..7366e74c3c 100644
--- a/arch/arm/boards/at91sam9n12ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
@@ -13,7 +13,7 @@
 #include <mach/at91_ddrsdrc.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91sam9n12ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/dss11/lowlevel.c b/arch/arm/boards/dss11/lowlevel.c
index 7f52f824df..86cc295e8b 100644
--- a/arch/arm/boards/dss11/lowlevel.c
+++ b/arch/arm/boards/dss11/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_dss11, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/haba-knx/lowlevel.c b/arch/arm/boards/haba-knx/lowlevel.c
index 7f52f824df..3f810a396d 100644
--- a/arch/arm/boards/haba-knx/lowlevel.c
+++ b/arch/arm/boards/haba-knx/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_haba_knx_lite, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9261/lowlevel_init.c b/arch/arm/boards/pm9261/lowlevel_init.c
index b18cd067b7..13a604ceb8 100644
--- a/arch/arm/boards/pm9261/lowlevel_init.c
+++ b/arch/arm/boards/pm9261/lowlevel_init.c
@@ -111,7 +111,7 @@ static void __bare_init pm9261_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_pm9261, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9263/lowlevel_init.c b/arch/arm/boards/pm9263/lowlevel_init.c
index 8f44adee99..9a690531e3 100644
--- a/arch/arm/boards/pm9263/lowlevel_init.c
+++ b/arch/arm/boards/pm9263/lowlevel_init.c
@@ -132,7 +132,7 @@ static void __bare_init pm9263_board_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_pm9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
index 5f66b28254..096bbc485a 100644
--- a/arch/arm/boards/pm9g45/lowlevel.c
+++ b/arch/arm/boards/pm9g45/lowlevel.c
@@ -14,7 +14,7 @@
 
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_pm9g45, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/qil-a926x/lowlevel.c b/arch/arm/boards/qil-a926x/lowlevel.c
index 7f52f824df..3a233fcf17 100644
--- a/arch/arm/boards/qil-a926x/lowlevel.c
+++ b/arch/arm/boards/qil-a926x/lowlevel.c
@@ -14,7 +14,18 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1,
+			  at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+			  NULL);
+}
+
+ENTRY_FUNCTION(start_qil_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/telit-evk-pro3/lowlevel.c b/arch/arm/boards/telit-evk-pro3/lowlevel.c
index 7f52f824df..3a613a65a8 100644
--- a/arch/arm/boards/telit-evk-pro3/lowlevel.c
+++ b/arch/arm/boards/telit-evk-pro3/lowlevel.c
@@ -14,7 +14,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_telit_evk_pro3, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
index 7f52f824df..e78e93528d 100644
--- a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
@@ -14,7 +14,18 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1,
+			  at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+			  NULL);
+}
+
+ENTRY_FUNCTION(start_tny_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
index 565ba438d2..b8b813ef12 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
@@ -118,7 +118,7 @@ static void __bare_init tny_a9263_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_tny_a9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
index 7f52f824df..7e3ee80ab7 100644
--- a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
@@ -14,7 +14,18 @@
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1,
+			  at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+			  NULL);
+}
+
+ENTRY_FUNCTION(start_usb_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
index 2ad88d7f22..e54c8442c4 100644
--- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
@@ -122,7 +122,7 @@ static void __bare_init usb_a9263_init(void)
 	                  NULL);
 }
 
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 22ed71350c..67d428e210 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -570,7 +570,6 @@ endif
 
 config AT91_MULTI_BOARDS
 	bool "Allow multiple boards to be selected"
-	select HAVE_PBL_MULTI_IMAGES
 	select ARM_USE_COMPRESSED_DTB
 
 if AT91_MULTI_BOARDS
diff --git a/images/Makefile.at91 b/images/Makefile.at91
index c6a6fb697b..bbb291bcbe 100644
--- a/images/Makefile.at91
+++ b/images/Makefile.at91
@@ -55,3 +55,95 @@ image-$(CONFIG_MACH_SKOV_ARM9CPU) += barebox-skov-arm9cpu.img
 pblb-$(CONFIG_MACH_SAMA5D4_WIFX) += start_sama5d4_wifx_l1
 FILE_barebox-wifx-l1.img = start_sama5d4_wifx_l1.pblb
 image-$(CONFIG_MACH_SAMA5D4_WIFX) += barebox-wifx-l1.img
+
+pblb-$(CONFIG_MACH_AT91SAM9261EK) += start_at91sam9261ek
+FILE_barebox-at91sam9261ek.img = start_at91sam9261ek.pblb
+image-$(CONFIG_MACH_AT91SAM9261EK) += barebox-at91sam9261ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9G10EK) += start_at91sam9g10ek
+FILE_barebox-at91sam9g10ek.img = start_at91sam9g10ek.pblb
+image-$(CONFIG_MACH_AT91SAM9G10EK) += barebox-at91sam9g10ek.img
+
+pblb-$(CONFIG_MACH_ANIMEO_IP) += start_animeo_ip
+FILE_barebox-animeo-ip.img = start_animeo_ip.pblb
+image-$(CONFIG_MACH_ANIMEO_IP) += barebox-animeo-ip.img
+
+pblb-$(CONFIG_MACH_AT91RM9200EK) += start_at91rm9200ek
+FILE_barebox-at91rm9200ek.img = start_at91rm9200ek.pblb
+image-$(CONFIG_MACH_AT91RM9200EK) += barebox-at91rm9200ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9260EK) += start_at91sam9260ek
+FILE_barebox-at91sam9260ek.img = start_at91sam9260ek.pblb
+image-$(CONFIG_MACH_AT91SAM9260EK) += barebox-at91sam9260ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9G20EK) += start_at91sam9g20ek
+FILE_barebox-at91sam9g20ek.img = start_at91sam9g20ek.pblb
+image-$(CONFIG_MACH_AT91SAM9G20EK) += barebox-at91sam9g20ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9M10G45EK) += start_at91sam9m10g45ek
+FILE_barebox-at91sam9m10g45ek.img = start_at91sam9m10g45ek.pblb
+image-$(CONFIG_MACH_AT91SAM9M10G45EK) += barebox-at91sam9m10g45ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9M10IHD) += start_at91sam9m10ihd
+FILE_barebox-at91sam9m10ihd.img = start_at91sam9m10ihd.pblb
+image-$(CONFIG_MACH_AT91SAM9M10IHD) += barebox-at91sam9m10ihd.img
+
+pblb-$(CONFIG_MACH_AT91SAM9N12EK) += start_at91sam9n12ek
+FILE_barebox-at91sam9n12ek.img = start_at91sam9n12ek.pblb
+image-$(CONFIG_MACH_AT91SAM9N12EK) += barebox-at91sam9n12ek.img
+
+pblb-$(CONFIG_MACH_DSS11) += start_dss11
+FILE_barebox-dss11.img = start_dss11.pblb
+image-$(CONFIG_MACH_DSS11) += barebox-dss11.img
+
+pblb-$(CONFIG_MACH_HABA_KNX_LITE) += start_haba_knx_lite
+FILE_barebox-haba-knx-lite.img = start_haba_knx_lite.pblb
+image-$(CONFIG_MACH_HABA_KNX_LITE) += barebox-haba-knx-lite.img
+
+pblb-$(CONFIG_MACH_PM9261) += start_pm9261
+FILE_barebox-pm9261.img = start_pm9261.pblb
+image-$(CONFIG_MACH_PM9261) += barebox-pm9261.img
+
+pblb-$(CONFIG_MACH_PM9263) += start_pm9263
+FILE_barebox-pm9263.img = start_pm9263.pblb
+image-$(CONFIG_MACH_PM9263) += barebox-pm9263.img
+
+pblb-$(CONFIG_MACH_PM9G45) += start_pm9g45
+FILE_barebox-pm9g45.img = start_pm9g45.pblb
+image-$(CONFIG_MACH_PM9G45) += barebox-pm9g45.img
+
+pblb-$(CONFIG_MACH_QIL_A9260) += start_qil_a926x
+FILE_barebox-qil-a926x.img = start_qil_a926x.pblb
+image-$(CONFIG_MACH_QIL_A9260) += barebox-qil-a926x.img
+
+pblb-$(CONFIG_MACH_QIL_A9G20) += start_qil_a9g20
+FILE_barebox-qil-a9g20.img = start_qil_a9g20.pblb
+image-$(CONFIG_MACH_QIL_A9G20) += barebox-qil-a9g20.img
+
+pblb-$(CONFIG_MACH_GE863) += start_telit_evk_pro3
+FILE_barebox-telit-evk-pro3.img = start_telit_evk_pro3.pblb
+image-$(CONFIG_MACH_GE863) += barebox-telit-evk-pro3.img
+
+pblb-$(CONFIG_MACH_TNY_A9260) += start_tny_a9260
+FILE_barebox-tny-a9260.img = start_tny_a9260.pblb
+image-$(CONFIG_MACH_TNY_A9260) += barebox-tny-a9260.img
+
+pblb-$(CONFIG_MACH_TNY_A9263) += start_tny_a9263
+FILE_barebox-tny-a9263.img = start_tny_a9263.pblb
+image-$(CONFIG_MACH_TNY_A9263) += barebox-tny-a9263.img
+
+pblb-$(CONFIG_MACH_TNY_A9G20) += start_tny_a9g20
+FILE_barebox-tny-a9g20.img = start_tny_a9g20.pblb
+image-$(CONFIG_MACH_TNY_A9G20) += barebox-tny-a9g20.img
+
+pblb-$(CONFIG_MACH_USB_A9260) += start_usb_a9260
+FILE_barebox-usb-a9260.img = start_usb_a9260.pblb
+image-$(CONFIG_MACH_USB_A9260) += barebox-usb-a9260.img
+
+pblb-$(CONFIG_MACH_USB_A9263) += start_usb_a9263
+FILE_barebox-usb-a9263.img = start_usb_a9263.pblb
+image-$(CONFIG_MACH_USB_A9263) += barebox-usb-a9263.img
+
+pblb-$(CONFIG_MACH_USB_A9G20) += start_usb_a9g20
+FILE_barebox-usb-a9g20.img = start_usb_a9g20.pblb
+image-$(CONFIG_MACH_USB_A9G20) += barebox-usb-a9g20.img
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 8/9] at91: consolidate usb-a963 128m images
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
                   ` (6 preceding siblings ...)
  2023-02-28 14:30 ` [PATCH 7/9] ARM: at91: Switch all boards to multiimage Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-02-28 14:30 ` [PATCH 9/9] ARM: pxa: Move plat/ include files to mach/ Sascha Hauer
  2023-02-28 17:37 ` [PATCH 0/9] ARM: misc cleanups Sam Ravnborg
  9 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

We have some at91 which differ from other configs only in the memory
size. Let's exploit the multiimage mechanism to build both memory
sizes from the same config using different images.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 .../arm/boards/usb-a926x/usb_a9263_lowlevel.c | 19 +++--
 .../usb_a9263_128mib_bootstrap_defconfig      | 24 ------
 arch/arm/configs/usb_a9263_128mib_defconfig   | 77 -------------------
 arch/arm/mach-at91/Kconfig                    |  6 --
 images/Makefile.at91                          |  4 +
 5 files changed, 18 insertions(+), 112 deletions(-)
 delete mode 100644 arch/arm/configs/usb_a9263_128mib_bootstrap_defconfig
 delete mode 100644 arch/arm/configs/usb_a9263_128mib_defconfig

diff --git a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
index e54c8442c4..0597321084 100644
--- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
@@ -20,7 +20,7 @@
 #endif
 #define MASTER_PLL_DIV		6
 
-static void __bare_init usb_a9263_board_config(struct at91sam926x_board_cfg *cfg)
+static void __bare_init usb_a9263_board_config(struct at91sam926x_board_cfg *cfg, bool has_mem_128m)
 {
 	/* Disable Watchdog */
 	cfg->wdt_mr =
@@ -88,7 +88,7 @@ static void __bare_init usb_a9263_board_config(struct at91sam926x_board_cfg *cfg
 		(5 << 24) |		/* Active to Precharge Delay */
 		(8 << 28);		/* Exit Self Refresh to Active Delay */
 
-	if (IS_ENABLED(CONFIG_AT91_HAVE_SRAM_128M))
+	if (has_mem_128m)
 		cfg->sdrc_cr |= AT91_SDRAMC_NC_10;
 	else
 		cfg->sdrc_cr |= AT91_SDRAMC_NC_9;
@@ -106,7 +106,7 @@ static void __bare_init usb_a9263_board_config(struct at91sam926x_board_cfg *cfg
 		AT91_RSTC_RSTTYP_WATCHDOG;
 }
 
-static void __bare_init usb_a9263_init(void)
+static void __bare_init usb_a9263_init(bool has_mem_128m)
 {
 	struct at91sam926x_board_cfg cfg;
 
@@ -115,7 +115,7 @@ static void __bare_init usb_a9263_init(void)
 	cfg.ebi_pio_is_peripha = true;
 	cfg.matrix_csa = IOMEM(AT91SAM9263_BASE_MATRIX + AT91SAM9263_MATRIX_EBI0CSA);
 
-	usb_a9263_board_config(&cfg);
+	usb_a9263_board_config(&cfg, has_mem_128m);
 	at91sam9263_board_init(&cfg);
 
 	barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
@@ -128,5 +128,14 @@ ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
 
 	arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE);
 
-	usb_a9263_init();
+	usb_a9263_init(false);
+}
+
+ENTRY_FUNCTION(start_usb_a9263_128m, r0, r1, r2)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE);
+
+	usb_a9263_init(true);
 }
diff --git a/arch/arm/configs/usb_a9263_128mib_bootstrap_defconfig b/arch/arm/configs/usb_a9263_128mib_bootstrap_defconfig
deleted file mode 100644
index 30794eeec4..0000000000
--- a/arch/arm/configs/usb_a9263_128mib_bootstrap_defconfig
+++ /dev/null
@@ -1,24 +0,0 @@
-CONFIG_ARCH_AT91SAM9263=y
-CONFIG_MACH_USB_A9263=y
-CONFIG_AT91_HAVE_SRAM_128M=y
-CONFIG_AT91_BOOTSTRAP=y
-CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x12000
-CONFIG_AEABI=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_ENVIRONMENT_VARIABLES=y
-CONFIG_PBL_IMAGE=y
-CONFIG_MMU=y
-CONFIG_MALLOC_DUMMY=y
-CONFIG_PROMPT="USB-9263:"
-CONFIG_SHELL_NONE=y
-# CONFIG_SPI is not set
-CONFIG_MTD=y
-# CONFIG_MTD_WRITE is not set
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_NAND=y
-# CONFIG_NAND_ECC_HW is not set
-# CONFIG_NAND_ECC_HW_SYNDROME is not set
-# CONFIG_NAND_ECC_HW_NONE is not set
-CONFIG_NAND_ATMEL=y
-# CONFIG_FS_RAMFS is not set
-CONFIG_BOOTSTRAP_DEVFS=y
diff --git a/arch/arm/configs/usb_a9263_128mib_defconfig b/arch/arm/configs/usb_a9263_128mib_defconfig
deleted file mode 100644
index 0795cacbb7..0000000000
--- a/arch/arm/configs/usb_a9263_128mib_defconfig
+++ /dev/null
@@ -1,77 +0,0 @@
-CONFIG_ARCH_AT91SAM9263=y
-CONFIG_MACH_USB_A9263=y
-CONFIG_AT91_HAVE_SRAM_128M=y
-CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000
-CONFIG_AEABI=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_PBL_IMAGE=y
-CONFIG_MMU=y
-CONFIG_EXPERIMENTAL=y
-CONFIG_MALLOC_TLSF=y
-CONFIG_PROMPT="USB-9263:"
-CONFIG_GLOB=y
-CONFIG_PROMPT_HUSH_PS2="y"
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_MENU=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_BOOTM_VERBOSE=y
-CONFIG_BOOTM_INITRD=y
-CONFIG_BOOTM_OFTREE=y
-CONFIG_BOOTM_OFTREE_UIMAGE=y
-CONFIG_CONSOLE_ACTIVATE_ALL=y
-CONFIG_PARTITION=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-# CONFIG_CMD_ARM_CPUINFO is not set
-CONFIG_LONGHELP=y
-CONFIG_CMD_MEMINFO=y
-# CONFIG_CMD_BOOTU is not set
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_UIMAGE=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_MD5SUM=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_LOGIN=y
-CONFIG_CMD_MENU=y
-CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_PASSWD=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_LED_TRIGGER=y
-CONFIG_CMD_OFTREE=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_RESOLV=y
-CONFIG_DRIVER_NET_MACB=y
-CONFIG_DRIVER_SPI_ATMEL=y
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_MTD_DATAFLASH=y
-CONFIG_NAND=y
-# CONFIG_NAND_ECC_HW is not set
-# CONFIG_NAND_ECC_HW_SYNDROME is not set
-# CONFIG_NAND_ECC_HW_NONE is not set
-CONFIG_NAND_ATMEL=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_DFU=y
-CONFIG_USB_GADGET_SERIAL=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_FS_TFTP=y
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 67d428e210..caf296dfcd 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -672,12 +672,6 @@ config AT91_HAVE_2MMC
 	  with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
 	  onwards.
 
-config AT91_HAVE_SRAM_128M
-	bool "Have 128 of ram"
-	depends on MACH_USB_A9G20 || MACH_USB_A9263 || MACH_QIL_A9260 || MACH_QIL_A9G20
-	help
-	  Select this if you board have 128 MiB of Ram (as USB_A9G20 C11)
-
 choice
 	prompt "LCD type"
 	depends on MACH_AT91SAM9M10G45EK
diff --git a/images/Makefile.at91 b/images/Makefile.at91
index bbb291bcbe..19a81e2e9a 100644
--- a/images/Makefile.at91
+++ b/images/Makefile.at91
@@ -144,6 +144,10 @@ pblb-$(CONFIG_MACH_USB_A9263) += start_usb_a9263
 FILE_barebox-usb-a9263.img = start_usb_a9263.pblb
 image-$(CONFIG_MACH_USB_A9263) += barebox-usb-a9263.img
 
+pblb-$(CONFIG_MACH_USB_A9263) += start_usb_a9263_128m
+FILE_barebox-usb-a9263-128m.img = start_usb_a9263_128m.pblb
+image-$(CONFIG_MACH_USB_A9263) += barebox-usb-a9263-128m.img
+
 pblb-$(CONFIG_MACH_USB_A9G20) += start_usb_a9g20
 FILE_barebox-usb-a9g20.img = start_usb_a9g20.pblb
 image-$(CONFIG_MACH_USB_A9G20) += barebox-usb-a9g20.img
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 9/9] ARM: pxa: Move plat/ include files to mach/
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
                   ` (7 preceding siblings ...)
  2023-02-28 14:30 ` [PATCH 8/9] at91: consolidate usb-a963 128m images Sascha Hauer
@ 2023-02-28 14:30 ` Sascha Hauer
  2023-03-01 17:42   ` Ahmad Fatoum
  2023-02-28 17:37 ` [PATCH 0/9] ARM: misc cleanups Sam Ravnborg
  9 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2023-02-28 14:30 UTC (permalink / raw)
  To: Barebox List

pxa has include files in include/plat/. Move the content over to
include/mach/ to be in line with other architectures.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-pxa/include/mach/gpio.h       |  38 +-
 arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h |   2 +-
 arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h |   2 +-
 arch/arm/mach-pxa/include/mach/mfp.h        | 460 ++++++++++++++++++-
 arch/arm/mach-pxa/include/plat/gpio.h       |  42 --
 arch/arm/mach-pxa/include/plat/mfp.h        | 469 --------------------
 arch/arm/mach-pxa/mfp-pxa3xx.c              |   2 +-
 7 files changed, 494 insertions(+), 521 deletions(-)
 delete mode 100644 arch/arm/mach-pxa/include/plat/gpio.h
 delete mode 100644 arch/arm/mach-pxa/include/plat/mfp.h

diff --git a/arch/arm/mach-pxa/include/mach/gpio.h b/arch/arm/mach-pxa/include/mach/gpio.h
index e6724e1caf..d8eac99fbc 100644
--- a/arch/arm/mach-pxa/include/mach/gpio.h
+++ b/arch/arm/mach-pxa/include/mach/gpio.h
@@ -128,5 +128,41 @@ static inline int __gpio_is_occupied(unsigned gpio)
 	} else
 		return GPDR(gpio) & GPIO_bit(gpio);
 }
-#include <plat/gpio.h>
+
+/*
+ * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with
+ * one set of registers. The register offsets are organized below:
+ *
+ *           GPLR    GPDR    GPSR    GPCR    GRER    GFER    GEDR
+ * BANK 0 - 0x0000  0x000C  0x0018  0x0024  0x0030  0x003C  0x0048
+ * BANK 1 - 0x0004  0x0010  0x001C  0x0028  0x0034  0x0040  0x004C
+ * BANK 2 - 0x0008  0x0014  0x0020  0x002C  0x0038  0x0044  0x0050
+ *
+ * BANK 3 - 0x0100  0x010C  0x0118  0x0124  0x0130  0x013C  0x0148
+ * BANK 4 - 0x0104  0x0110  0x011C  0x0128  0x0134  0x0140  0x014C
+ * BANK 5 - 0x0108  0x0114  0x0120  0x012C  0x0138  0x0144  0x0150
+ *
+ * NOTE:
+ *   BANK 3 is only available on PXA27x and later processors.
+ *   BANK 4 and 5 are only available on PXA935
+ */
+
+#define GPIO_BANK(n)    (GPIO_REGS_VIRT + BANK_OFF(n))
+
+#define GPLR_OFFSET     0x00
+#define GPDR_OFFSET     0x0C
+#define GPSR_OFFSET     0x18
+#define GPCR_OFFSET     0x24
+#define GRER_OFFSET     0x30
+#define GFER_OFFSET     0x3C
+#define GEDR_OFFSET     0x48
+
+/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
+ * Those cases currently cause holes in the GPIO number space, the
+ * actual number of the last GPIO is recorded by 'pxa_last_gpio'.
+ */
+extern int pxa_last_gpio;
+
+extern int pxa_init_gpio(int start, int end);
+
 #endif
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
index b01f6188d4..2713d4cc9f 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
@@ -3,7 +3,7 @@
 #ifndef __ASM_ARCH_MFP_PXA2XX_H
 #define __ASM_ARCH_MFP_PXA2XX_H
 
-#include <plat/mfp.h>
+#include <mach/mfp.h>
 
 /*
  * the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx:
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h
index 00eb724709..8e4af7cde8 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h
@@ -3,7 +3,7 @@
 #ifndef __ASM_ARCH_MFP_PXA3XX_H
 #define __ASM_ARCH_MFP_PXA3XX_H
 
-#include <plat/mfp.h>
+#include <mach/mfp.h>
 
 #define MFPR_BASE	(0x40e10000)
 
diff --git a/arch/arm/mach-pxa/include/mach/mfp.h b/arch/arm/mach-pxa/include/mach/mfp.h
index 271e249ae3..fd8c810552 100644
--- a/arch/arm/mach-pxa/include/mach/mfp.h
+++ b/arch/arm/mach-pxa/include/mach/mfp.h
@@ -1,7 +1,7 @@
 /*
- * arch/arm/mach-pxa/include/mach/mfp.h
+ * arch/arm/plat-pxa/include/plat/mfp.h
  *
- * Multi-Function Pin Definitions
+ *   Common Multi-Function Pin Definitions
  *
  * Copyright (C) 2007 Marvell International Ltd.
  *
@@ -13,9 +13,457 @@
  *  published by the Free Software Foundation.
  */
 
-#ifndef __ASM_ARCH_MFP_H
-#define __ASM_ARCH_MFP_H
+#ifndef __MACH_PXA_MFP_H
+#define __MACH_PXA_MFP_H
 
-#include <plat/mfp.h>
+#define mfp_to_gpio(m)	((m) % 256)
 
-#endif /* __ASM_ARCH_MFP_H */
+/* list of all the configurable MFP pins */
+enum {
+	MFP_PIN_INVALID = -1,
+
+	MFP_PIN_GPIO0 = 0,
+	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GPIO121,
+	MFP_PIN_GPIO122,
+	MFP_PIN_GPIO123,
+	MFP_PIN_GPIO124,
+	MFP_PIN_GPIO125,
+	MFP_PIN_GPIO126,
+	MFP_PIN_GPIO127,
+
+	MFP_PIN_GPIO128,
+	MFP_PIN_GPIO129,
+	MFP_PIN_GPIO130,
+	MFP_PIN_GPIO131,
+	MFP_PIN_GPIO132,
+	MFP_PIN_GPIO133,
+	MFP_PIN_GPIO134,
+	MFP_PIN_GPIO135,
+	MFP_PIN_GPIO136,
+	MFP_PIN_GPIO137,
+	MFP_PIN_GPIO138,
+	MFP_PIN_GPIO139,
+	MFP_PIN_GPIO140,
+	MFP_PIN_GPIO141,
+	MFP_PIN_GPIO142,
+	MFP_PIN_GPIO143,
+	MFP_PIN_GPIO144,
+	MFP_PIN_GPIO145,
+	MFP_PIN_GPIO146,
+	MFP_PIN_GPIO147,
+	MFP_PIN_GPIO148,
+	MFP_PIN_GPIO149,
+	MFP_PIN_GPIO150,
+	MFP_PIN_GPIO151,
+	MFP_PIN_GPIO152,
+	MFP_PIN_GPIO153,
+	MFP_PIN_GPIO154,
+	MFP_PIN_GPIO155,
+	MFP_PIN_GPIO156,
+	MFP_PIN_GPIO157,
+	MFP_PIN_GPIO158,
+	MFP_PIN_GPIO159,
+	MFP_PIN_GPIO160,
+	MFP_PIN_GPIO161,
+	MFP_PIN_GPIO162,
+	MFP_PIN_GPIO163,
+	MFP_PIN_GPIO164,
+	MFP_PIN_GPIO165,
+	MFP_PIN_GPIO166,
+	MFP_PIN_GPIO167,
+	MFP_PIN_GPIO168,
+	MFP_PIN_GPIO169,
+	MFP_PIN_GPIO170,
+	MFP_PIN_GPIO171,
+	MFP_PIN_GPIO172,
+	MFP_PIN_GPIO173,
+	MFP_PIN_GPIO174,
+	MFP_PIN_GPIO175,
+	MFP_PIN_GPIO176,
+	MFP_PIN_GPIO177,
+	MFP_PIN_GPIO178,
+	MFP_PIN_GPIO179,
+	MFP_PIN_GPIO180,
+	MFP_PIN_GP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 *
+ * bit  0.. 9 - MFP Pin Number (1024 Pins Maximum)
+ * bit 10..12 - Alternate Function Selection
+ * bit 13..15 - Drive Strength
+ * bit 16..18 - Low Power Mode State
+ * bit 19..20 - Low Power Mode Edge Detection
+ * bit 21..22 - Run Mode Pull State
+ *
+ * to facilitate the definition, the following macros are provided
+ *
+ * MFP_CFG_DEFAULT - default MFP configuration value, with
+ *		alternate function = 0,
+ *		drive strength = fast 3mA (MFP_DS03X)
+ *		low power mode = default
+ *		edge detection = none
+ *
+ * MFP_CFG	- default MFPR value with alternate function
+ * MFP_CFG_DRV	- default MFPR value with alternate function and
+ *		  pin drive strength
+ * MFP_CFG_LPM	- default MFPR value with alternate function and
+ *		  low power mode
+ * MFP_CFG_X	- default MFPR value with alternate function,
+ *		  pin drive strength and low power mode
+ */
+
+typedef unsigned long mfp_cfg_t;
+
+#define MFP_PIN(x)		((x) & 0x3ff)
+
+#define MFP_AF0			(0x0 << 10)
+#define MFP_AF1			(0x1 << 10)
+#define MFP_AF2			(0x2 << 10)
+#define MFP_AF3			(0x3 << 10)
+#define MFP_AF4			(0x4 << 10)
+#define MFP_AF5			(0x5 << 10)
+#define MFP_AF6			(0x6 << 10)
+#define MFP_AF7			(0x7 << 10)
+#define MFP_AF_MASK		(0x7 << 10)
+#define MFP_AF(x)		(((x) >> 10) & 0x7)
+
+#define MFP_DS01X		(0x0 << 13)
+#define MFP_DS02X		(0x1 << 13)
+#define MFP_DS03X		(0x2 << 13)
+#define MFP_DS04X		(0x3 << 13)
+#define MFP_DS06X		(0x4 << 13)
+#define MFP_DS08X		(0x5 << 13)
+#define MFP_DS10X		(0x6 << 13)
+#define MFP_DS13X		(0x7 << 13)
+#define MFP_DS_MASK		(0x7 << 13)
+#define MFP_DS(x)		(((x) >> 13) & 0x7)
+
+#define MFP_LPM_DEFAULT		(0x0 << 16)
+#define MFP_LPM_DRIVE_LOW	(0x1 << 16)
+#define MFP_LPM_DRIVE_HIGH	(0x2 << 16)
+#define MFP_LPM_PULL_LOW	(0x3 << 16)
+#define MFP_LPM_PULL_HIGH	(0x4 << 16)
+#define MFP_LPM_FLOAT		(0x5 << 16)
+#define MFP_LPM_INPUT		(0x6 << 16)
+#define MFP_LPM_STATE_MASK	(0x7 << 16)
+#define MFP_LPM_STATE(x)	(((x) >> 16) & 0x7)
+
+#define MFP_LPM_EDGE_NONE	(0x0 << 19)
+#define MFP_LPM_EDGE_RISE	(0x1 << 19)
+#define MFP_LPM_EDGE_FALL	(0x2 << 19)
+#define MFP_LPM_EDGE_BOTH	(0x3 << 19)
+#define MFP_LPM_EDGE_MASK	(0x3 << 19)
+#define MFP_LPM_EDGE(x)		(((x) >> 19) & 0x3)
+
+#define MFP_PULL_NONE		(0x0 << 21)
+#define MFP_PULL_LOW		(0x1 << 21)
+#define MFP_PULL_HIGH		(0x2 << 21)
+#define MFP_PULL_BOTH		(0x3 << 21)
+#define MFP_PULL_FLOAT		(0x4 << 21)
+#define MFP_PULL_MASK		(0x7 << 21)
+#define MFP_PULL(x)		(((x) >> 21) & 0x7)
+
+#define MFP_CFG_DEFAULT		(MFP_AF0 | MFP_DS03X | MFP_LPM_DEFAULT |\
+				 MFP_LPM_EDGE_NONE | MFP_PULL_NONE)
+
+#define MFP_CFG(pin, af)		\
+	((MFP_CFG_DEFAULT & ~MFP_AF_MASK) |\
+	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af))
+
+#define MFP_CFG_DRV(pin, af, drv)	\
+	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK)) |\
+	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv))
+
+#define MFP_CFG_LPM(pin, af, lpm)	\
+	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_LPM_STATE_MASK)) |\
+	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_LPM_##lpm))
+
+#define MFP_CFG_X(pin, af, drv, lpm)	\
+	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\
+	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm))
+
+#if defined(CONFIG_ARCH_PXA3XX)
+/*
+ * each MFP pin will have a MFPR register, since the offset of the
+ * register varies between processors, the processor specific code
+ * should initialize the pin offsets by mfp_init()
+ *
+ * mfp_init_base() - accepts a virtual base for all MFPR registers and
+ * initialize the MFP table to a default state
+ *
+ * mfp_init_addr() - accepts a table of "mfp_addr_map" structure, which
+ * represents a range of MFP pins from "start" to "end", with the offset
+ * begining at "offset", to define a single pin, let "end" = -1.
+ *
+ * use
+ *
+ * MFP_ADDR_X() to define a range of pins
+ * MFP_ADDR()   to define a single pin
+ * MFP_ADDR_END to signal the end of pin offset definitions
+ */
+struct mfp_addr_map {
+	unsigned int	start;
+	unsigned int	end;
+	unsigned long	offset;
+};
+
+#define MFP_ADDR_X(start, end, offset) \
+	{ MFP_PIN_##start, MFP_PIN_##end, offset }
+
+#define MFP_ADDR(pin, offset) \
+	{ MFP_PIN_##pin, -1, offset }
+
+#define MFP_ADDR_END	{ MFP_PIN_INVALID, 0 }
+
+void __init mfp_init_base(void __iomem *mfpr_base);
+void __init mfp_init_addr(struct mfp_addr_map *map);
+
+/*
+ * mfp_{read, write}()	- for direct read/write access to the MFPR register
+ * mfp_config()		- for configuring a group of MFPR registers
+ * mfp_config_lpm()	- configuring all low power MFPR registers for suspend
+ * mfp_config_run()	- configuring all run time  MFPR registers after resume
+ */
+unsigned long mfp_read(int mfp);
+void mfp_write(int mfp, unsigned long mfpr_val);
+void mfp_config(unsigned long *mfp_cfgs, int num);
+void mfp_config_run(void);
+void mfp_config_lpm(void);
+void mfp_init(void);
+#endif /* CONFIG_ARCH_PXA3XX */
+
+#endif /* __MACH_PXA_MFP_H */
diff --git a/arch/arm/mach-pxa/include/plat/gpio.h b/arch/arm/mach-pxa/include/plat/gpio.h
deleted file mode 100644
index 35f90715e0..0000000000
--- a/arch/arm/mach-pxa/include/plat/gpio.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __PLAT_GPIO_H
-#define __PLAT_GPIO_H
-
-#include <mach/gpio.h>
-
-/*
- * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with
- * one set of registers. The register offsets are organized below:
- *
- *           GPLR    GPDR    GPSR    GPCR    GRER    GFER    GEDR
- * BANK 0 - 0x0000  0x000C  0x0018  0x0024  0x0030  0x003C  0x0048
- * BANK 1 - 0x0004  0x0010  0x001C  0x0028  0x0034  0x0040  0x004C
- * BANK 2 - 0x0008  0x0014  0x0020  0x002C  0x0038  0x0044  0x0050
- *
- * BANK 3 - 0x0100  0x010C  0x0118  0x0124  0x0130  0x013C  0x0148
- * BANK 4 - 0x0104  0x0110  0x011C  0x0128  0x0134  0x0140  0x014C
- * BANK 5 - 0x0108  0x0114  0x0120  0x012C  0x0138  0x0144  0x0150
- *
- * NOTE:
- *   BANK 3 is only available on PXA27x and later processors.
- *   BANK 4 and 5 are only available on PXA935
- */
-
-#define GPIO_BANK(n)	(GPIO_REGS_VIRT + BANK_OFF(n))
-
-#define GPLR_OFFSET	0x00
-#define GPDR_OFFSET	0x0C
-#define GPSR_OFFSET	0x18
-#define GPCR_OFFSET	0x24
-#define GRER_OFFSET	0x30
-#define GFER_OFFSET	0x3C
-#define GEDR_OFFSET	0x48
-
-/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
- * Those cases currently cause holes in the GPIO number space, the
- * actual number of the last GPIO is recorded by 'pxa_last_gpio'.
- */
-extern int pxa_last_gpio;
-
-extern int pxa_init_gpio(int start, int end);
-
-#endif /* __PLAT_GPIO_H */
diff --git a/arch/arm/mach-pxa/include/plat/mfp.h b/arch/arm/mach-pxa/include/plat/mfp.h
deleted file mode 100644
index aedb956cd3..0000000000
--- a/arch/arm/mach-pxa/include/plat/mfp.h
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * arch/arm/plat-pxa/include/plat/mfp.h
- *
- *   Common Multi-Function Pin Definitions
- *
- * Copyright (C) 2007 Marvell International Ltd.
- *
- * 2007-8-21: eric miao <eric.miao@marvell.com>
- *            initial version
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#ifndef __ASM_PLAT_MFP_H
-#define __ASM_PLAT_MFP_H
-
-#define mfp_to_gpio(m)	((m) % 256)
-
-/* list of all the configurable MFP pins */
-enum {
-	MFP_PIN_INVALID = -1,
-
-	MFP_PIN_GPIO0 = 0,
-	MFP_PIN_GPIO1,
-	MFP_PIN_GPIO2,
-	MFP_PIN_GPIO3,
-	MFP_PIN_GPIO4,
-	MFP_PIN_GPIO5,
-	MFP_PIN_GPIO6,
-	MFP_PIN_GPIO7,
-	MFP_PIN_GPIO8,
-	MFP_PIN_GPIO9,
-	MFP_PIN_GPIO10,
-	MFP_PIN_GPIO11,
-	MFP_PIN_GPIO12,
-	MFP_PIN_GPIO13,
-	MFP_PIN_GPIO14,
-	MFP_PIN_GPIO15,
-	MFP_PIN_GPIO16,
-	MFP_PIN_GPIO17,
-	MFP_PIN_GPIO18,
-	MFP_PIN_GPIO19,
-	MFP_PIN_GPIO20,
-	MFP_PIN_GPIO21,
-	MFP_PIN_GPIO22,
-	MFP_PIN_GPIO23,
-	MFP_PIN_GPIO24,
-	MFP_PIN_GPIO25,
-	MFP_PIN_GPIO26,
-	MFP_PIN_GPIO27,
-	MFP_PIN_GPIO28,
-	MFP_PIN_GPIO29,
-	MFP_PIN_GPIO30,
-	MFP_PIN_GPIO31,
-	MFP_PIN_GPIO32,
-	MFP_PIN_GPIO33,
-	MFP_PIN_GPIO34,
-	MFP_PIN_GPIO35,
-	MFP_PIN_GPIO36,
-	MFP_PIN_GPIO37,
-	MFP_PIN_GPIO38,
-	MFP_PIN_GPIO39,
-	MFP_PIN_GPIO40,
-	MFP_PIN_GPIO41,
-	MFP_PIN_GPIO42,
-	MFP_PIN_GPIO43,
-	MFP_PIN_GPIO44,
-	MFP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_GPIO105,
-	MFP_PIN_GPIO106,
-	MFP_PIN_GPIO107,
-	MFP_PIN_GPIO108,
-	MFP_PIN_GPIO109,
-	MFP_PIN_GPIO110,
-	MFP_PIN_GPIO111,
-	MFP_PIN_GPIO112,
-	MFP_PIN_GPIO113,
-	MFP_PIN_GPIO114,
-	MFP_PIN_GPIO115,
-	MFP_PIN_GPIO116,
-	MFP_PIN_GPIO117,
-	MFP_PIN_GPIO118,
-	MFP_PIN_GPIO119,
-	MFP_PIN_GPIO120,
-	MFP_PIN_GPIO121,
-	MFP_PIN_GPIO122,
-	MFP_PIN_GPIO123,
-	MFP_PIN_GPIO124,
-	MFP_PIN_GPIO125,
-	MFP_PIN_GPIO126,
-	MFP_PIN_GPIO127,
-
-	MFP_PIN_GPIO128,
-	MFP_PIN_GPIO129,
-	MFP_PIN_GPIO130,
-	MFP_PIN_GPIO131,
-	MFP_PIN_GPIO132,
-	MFP_PIN_GPIO133,
-	MFP_PIN_GPIO134,
-	MFP_PIN_GPIO135,
-	MFP_PIN_GPIO136,
-	MFP_PIN_GPIO137,
-	MFP_PIN_GPIO138,
-	MFP_PIN_GPIO139,
-	MFP_PIN_GPIO140,
-	MFP_PIN_GPIO141,
-	MFP_PIN_GPIO142,
-	MFP_PIN_GPIO143,
-	MFP_PIN_GPIO144,
-	MFP_PIN_GPIO145,
-	MFP_PIN_GPIO146,
-	MFP_PIN_GPIO147,
-	MFP_PIN_GPIO148,
-	MFP_PIN_GPIO149,
-	MFP_PIN_GPIO150,
-	MFP_PIN_GPIO151,
-	MFP_PIN_GPIO152,
-	MFP_PIN_GPIO153,
-	MFP_PIN_GPIO154,
-	MFP_PIN_GPIO155,
-	MFP_PIN_GPIO156,
-	MFP_PIN_GPIO157,
-	MFP_PIN_GPIO158,
-	MFP_PIN_GPIO159,
-	MFP_PIN_GPIO160,
-	MFP_PIN_GPIO161,
-	MFP_PIN_GPIO162,
-	MFP_PIN_GPIO163,
-	MFP_PIN_GPIO164,
-	MFP_PIN_G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MC1_DAT0,
-	MFP_PIN_MMC1_CMD,
-	MFP_PIN_MMC1_CLK,
-	MFP_PIN_MMC1_CD,
-	MFP_PIN_MMC1_WP,
-
-	/* additional pins on PXA930 */
-	MFP_PIN_GSIM_UIO,
-	MFP_PIN_GSIM_UCLK,
-	MFP_PIN_GSIM_UDET,
-	MFP_PIN_GSIM_nURST,
-	MFP_PIN_PMIC_INT,
-	MFP_PIN_RDY,
-
-	MFP_PIN_MAX,
-};
-
-/*
- * a possible MFP configuration is represented by a 32-bit integer
- *
- * bit  0.. 9 - MFP Pin Number (1024 Pins Maximum)
- * bit 10..12 - Alternate Function Selection
- * bit 13..15 - Drive Strength
- * bit 16..18 - Low Power Mode State
- * bit 19..20 - Low Power Mode Edge Detection
- * bit 21..22 - Run Mode Pull State
- *
- * to facilitate the definition, the following macros are provided
- *
- * MFP_CFG_DEFAULT - default MFP configuration value, with
- *		alternate function = 0,
- *		drive strength = fast 3mA (MFP_DS03X)
- *		low power mode = default
- *		edge detection = none
- *
- * MFP_CFG	- default MFPR value with alternate function
- * MFP_CFG_DRV	- default MFPR value with alternate function and
- *		  pin drive strength
- * MFP_CFG_LPM	- default MFPR value with alternate function and
- *		  low power mode
- * MFP_CFG_X	- default MFPR value with alternate function,
- *		  pin drive strength and low power mode
- */
-
-typedef unsigned long mfp_cfg_t;
-
-#define MFP_PIN(x)		((x) & 0x3ff)
-
-#define MFP_AF0			(0x0 << 10)
-#define MFP_AF1			(0x1 << 10)
-#define MFP_AF2			(0x2 << 10)
-#define MFP_AF3			(0x3 << 10)
-#define MFP_AF4			(0x4 << 10)
-#define MFP_AF5			(0x5 << 10)
-#define MFP_AF6			(0x6 << 10)
-#define MFP_AF7			(0x7 << 10)
-#define MFP_AF_MASK		(0x7 << 10)
-#define MFP_AF(x)		(((x) >> 10) & 0x7)
-
-#define MFP_DS01X		(0x0 << 13)
-#define MFP_DS02X		(0x1 << 13)
-#define MFP_DS03X		(0x2 << 13)
-#define MFP_DS04X		(0x3 << 13)
-#define MFP_DS06X		(0x4 << 13)
-#define MFP_DS08X		(0x5 << 13)
-#define MFP_DS10X		(0x6 << 13)
-#define MFP_DS13X		(0x7 << 13)
-#define MFP_DS_MASK		(0x7 << 13)
-#define MFP_DS(x)		(((x) >> 13) & 0x7)
-
-#define MFP_LPM_DEFAULT		(0x0 << 16)
-#define MFP_LPM_DRIVE_LOW	(0x1 << 16)
-#define MFP_LPM_DRIVE_HIGH	(0x2 << 16)
-#define MFP_LPM_PULL_LOW	(0x3 << 16)
-#define MFP_LPM_PULL_HIGH	(0x4 << 16)
-#define MFP_LPM_FLOAT		(0x5 << 16)
-#define MFP_LPM_INPUT		(0x6 << 16)
-#define MFP_LPM_STATE_MASK	(0x7 << 16)
-#define MFP_LPM_STATE(x)	(((x) >> 16) & 0x7)
-
-#define MFP_LPM_EDGE_NONE	(0x0 << 19)
-#define MFP_LPM_EDGE_RISE	(0x1 << 19)
-#define MFP_LPM_EDGE_FALL	(0x2 << 19)
-#define MFP_LPM_EDGE_BOTH	(0x3 << 19)
-#define MFP_LPM_EDGE_MASK	(0x3 << 19)
-#define MFP_LPM_EDGE(x)		(((x) >> 19) & 0x3)
-
-#define MFP_PULL_NONE		(0x0 << 21)
-#define MFP_PULL_LOW		(0x1 << 21)
-#define MFP_PULL_HIGH		(0x2 << 21)
-#define MFP_PULL_BOTH		(0x3 << 21)
-#define MFP_PULL_FLOAT		(0x4 << 21)
-#define MFP_PULL_MASK		(0x7 << 21)
-#define MFP_PULL(x)		(((x) >> 21) & 0x7)
-
-#define MFP_CFG_DEFAULT		(MFP_AF0 | MFP_DS03X | MFP_LPM_DEFAULT |\
-				 MFP_LPM_EDGE_NONE | MFP_PULL_NONE)
-
-#define MFP_CFG(pin, af)		\
-	((MFP_CFG_DEFAULT & ~MFP_AF_MASK) |\
-	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af))
-
-#define MFP_CFG_DRV(pin, af, drv)	\
-	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK)) |\
-	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv))
-
-#define MFP_CFG_LPM(pin, af, lpm)	\
-	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_LPM_STATE_MASK)) |\
-	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_LPM_##lpm))
-
-#define MFP_CFG_X(pin, af, drv, lpm)	\
-	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\
-	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm))
-
-#if defined(CONFIG_ARCH_PXA3XX)
-/*
- * each MFP pin will have a MFPR register, since the offset of the
- * register varies between processors, the processor specific code
- * should initialize the pin offsets by mfp_init()
- *
- * mfp_init_base() - accepts a virtual base for all MFPR registers and
- * initialize the MFP table to a default state
- *
- * mfp_init_addr() - accepts a table of "mfp_addr_map" structure, which
- * represents a range of MFP pins from "start" to "end", with the offset
- * begining at "offset", to define a single pin, let "end" = -1.
- *
- * use
- *
- * MFP_ADDR_X() to define a range of pins
- * MFP_ADDR()   to define a single pin
- * MFP_ADDR_END to signal the end of pin offset definitions
- */
-struct mfp_addr_map {
-	unsigned int	start;
-	unsigned int	end;
-	unsigned long	offset;
-};
-
-#define MFP_ADDR_X(start, end, offset) \
-	{ MFP_PIN_##start, MFP_PIN_##end, offset }
-
-#define MFP_ADDR(pin, offset) \
-	{ MFP_PIN_##pin, -1, offset }
-
-#define MFP_ADDR_END	{ MFP_PIN_INVALID, 0 }
-
-void __init mfp_init_base(void __iomem *mfpr_base);
-void __init mfp_init_addr(struct mfp_addr_map *map);
-
-/*
- * mfp_{read, write}()	- for direct read/write access to the MFPR register
- * mfp_config()		- for configuring a group of MFPR registers
- * mfp_config_lpm()	- configuring all low power MFPR registers for suspend
- * mfp_config_run()	- configuring all run time  MFPR registers after resume
- */
-unsigned long mfp_read(int mfp);
-void mfp_write(int mfp, unsigned long mfpr_val);
-void mfp_config(unsigned long *mfp_cfgs, int num);
-void mfp_config_run(void);
-void mfp_config_lpm(void);
-void mfp_init(void);
-#endif /* CONFIG_ARCH_PXA3XX */
-
-#endif /* __ASM_PLAT_MFP_H */
diff --git a/arch/arm/mach-pxa/mfp-pxa3xx.c b/arch/arm/mach-pxa/mfp-pxa3xx.c
index df4922453d..af80ab24ad 100644
--- a/arch/arm/mach-pxa/mfp-pxa3xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa3xx.c
@@ -18,7 +18,7 @@
 #include <io.h>
 #include <mach/hardware.h>
 #include <mach/mfp-pxa3xx.h>
-#include <plat/mfp.h>
+#include <mach/mfp.h>
 
 #define MFPR_SIZE	(PAGE_SIZE)
 
-- 
2.30.2




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/9] ARM: misc cleanups
  2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
                   ` (8 preceding siblings ...)
  2023-02-28 14:30 ` [PATCH 9/9] ARM: pxa: Move plat/ include files to mach/ Sascha Hauer
@ 2023-02-28 17:37 ` Sam Ravnborg
  2023-03-01  7:53   ` Sascha Hauer
  9 siblings, 1 reply; 14+ messages in thread
From: Sam Ravnborg @ 2023-02-28 17:37 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hi Sascha,

On Tue, Feb 28, 2023 at 03:30:22PM +0100, Sascha Hauer wrote:
> I am working on making it possible to build support for multiple
> arch/arm/mach-*/ into the same barebox. Here are some misc cleanups
> I stumbled upon while preparing multi arch support.
> 
> Sascha Hauer (9):
>   ARM: mxs: remove unused mach/clock.h
>   ARM: imx: remove unused mach/clock.h
>   ARM: rockchip: drop mach/timer.h
>   ARM: i.MX: Move imxfb.h to include/platform_data/
>   pinctrl: rockchip: Fix uninitialized var warning
>   ARM: at91: remove unnecessary configs
>   ARM: at91: Switch all boards to multiimage
>   at91: consolidate usb-a963 128m images
>   ARM: pxa: Move plat/ include files to mach/

As much as I like the patches I think a more sane course of
action for these old at91 boards would be to drop most of them.
A simple algorithm would be:
  If not supported in the kernel, drop the board.
  
The boards that are not in the kernel have not seen any
activity in barebox for a long time, so it is not like
they look maintained.

That would allow us to get rid of some legacy stuff in
mach-at91 and maybe motivate someone like me to actually
work on the remaining boards as it then looks
doable to convert the remaining boards to DT.

	Sam



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/9] ARM: misc cleanups
  2023-02-28 17:37 ` [PATCH 0/9] ARM: misc cleanups Sam Ravnborg
@ 2023-03-01  7:53   ` Sascha Hauer
  2023-03-02 17:01     ` Sam Ravnborg
  0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2023-03-01  7:53 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Barebox List

On Tue, Feb 28, 2023 at 06:37:08PM +0100, Sam Ravnborg wrote:
> Hi Sascha,
> 
> On Tue, Feb 28, 2023 at 03:30:22PM +0100, Sascha Hauer wrote:
> > I am working on making it possible to build support for multiple
> > arch/arm/mach-*/ into the same barebox. Here are some misc cleanups
> > I stumbled upon while preparing multi arch support.
> > 
> > Sascha Hauer (9):
> >   ARM: mxs: remove unused mach/clock.h
> >   ARM: imx: remove unused mach/clock.h
> >   ARM: rockchip: drop mach/timer.h
> >   ARM: i.MX: Move imxfb.h to include/platform_data/
> >   pinctrl: rockchip: Fix uninitialized var warning
> >   ARM: at91: remove unnecessary configs
> >   ARM: at91: Switch all boards to multiimage
> >   at91: consolidate usb-a963 128m images
> >   ARM: pxa: Move plat/ include files to mach/
> 
> As much as I like the patches I think a more sane course of
> action for these old at91 boards would be to drop most of them.

Agreed, and you just motivated me to look into it.

> A simple algorithm would be:
>   If not supported in the kernel, drop the board.

That algorithm doesn't bring us very far. Here is a list of boards
supported in barebox, the 'x' add the beginning denotes that I
found a device tree for it in the kernel:

AT91RM9200
==========
x MACH_AT91RM9200EK	Atmel AT91RM9200-EK Evaluation Kit

AT91SAM9260
===========
x MACH_ANIMEO_IP	Somfy Animeo IP
x MACH_AT91SAM9260EK	Atmel AT91SAM9260-EK
x MACH_QIL_A9260	CALAO QIL-A9260 board
x MACH_TNY_A9260	CALAO TNY-A9260
x MACH_USB_A9260	CALAO USB-A9260
  MACH_GE863		Telit EVK-PRO3

AT91SAM9261
===========
x MACH_AT91SAM9261EK	Atmel AT91SAM9261-EK Evaluation Kit
  MACH_PM9261		Ronetix PM9261

AT91SAM9G10
===========
x MACH_AT91SAM9G10EK	Atmel AT91SAM9G10-EK Evaluation Kit

AT91SAM9G20
===========
x MACH_AT91SAM9G20EK	Atmel AT91SAM9G20-EK Evaluation Kit
x MACH_TNY_A9G20	CALAO TNY-A9G20
x MACH_USB_A9G20	CALAO USB-A9G20
  MACH_DSS11		aizo dSS11
  MACH_QIL_A9G20	CALAO QIL-A9G20 board
  MACH_HABA_KNX_LITE	CALAO HABA-KNX-LITE

AT91SAM9263
===========
  MACH_PM9263		Ronetix PM9263
x MACH_TNY_A9263	CALAO TNY-A9263
x MACH_USB_A9263	CALAO USB-A9263

AT91SAM9G45 or AT91SAM9M10
==========================
  MACH_AT91SAM9M10IHD	Atmel AT91SAM9M10IDH Tablet
x MACH_AT91SAM9M10G45EK	Atmel AT91SAM9M10G45-EK Evaluation Kit
x MACH_PM9G45		Ronetix PM9G45

AT91SAM9N12
===========
x MACH_AT91SAM9N12EK	Atmel AT91SAM9N12 Evaluation Kit

SAMA5D3
=======
x MACH_SAMA5D3XEK	Atmel SAMA5D3X Evaluation Kit

SAMA5D4
=======
x MACH_SAMA5D4EK	Atmel SAMA5D4 Evaluation Kit
x MACH_SAMA5D4_XPLAINED	Atmel SAMA5D4 XPLAINED ULTRA Evaluation Kit

It seems most boards are supported in the kernel as well.

>   
> The boards that are not in the kernel have not seen any
> activity in barebox for a long time, so it is not like
> they look maintained.

None of the boards has seen any activity except for those that are
already converted to multiboard.

Given that we could remove all board and SoC support that has
not yet been converted to multiboard support.

The question is: When you want to port over some more board/SoC code
to multiboard, does the existing code help you or would it be easier
to do a fresh start?

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-5555 |



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 9/9] ARM: pxa: Move plat/ include files to mach/
  2023-02-28 14:30 ` [PATCH 9/9] ARM: pxa: Move plat/ include files to mach/ Sascha Hauer
@ 2023-03-01 17:42   ` Ahmad Fatoum
  0 siblings, 0 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2023-03-01 17:42 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List

On 28.02.23 15:30, Sascha Hauer wrote:

> diff --git a/arch/arm/mach-pxa/include/mach/mfp.h b/arch/arm/mach-pxa/include/mach/mfp.h
> index 271e249ae3..fd8c810552 100644
> --- a/arch/arm/mach-pxa/include/mach/mfp.h
> +++ b/arch/arm/mach-pxa/include/mach/mfp.h
> @@ -1,7 +1,7 @@
>  /*
> - * arch/arm/mach-pxa/include/mach/mfp.h
> + * arch/arm/plat-pxa/include/plat/mfp.h

Not that it matters much, but could you revert
this line change?

-- 
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-5555 |




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/9] ARM: misc cleanups
  2023-03-01  7:53   ` Sascha Hauer
@ 2023-03-02 17:01     ` Sam Ravnborg
  0 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2023-03-02 17:01 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hi Sascha.

On Wed, Mar 01, 2023 at 08:53:24AM +0100, Sascha Hauer wrote:
> On Tue, Feb 28, 2023 at 06:37:08PM +0100, Sam Ravnborg wrote:
> > Hi Sascha,
> > 
> > On Tue, Feb 28, 2023 at 03:30:22PM +0100, Sascha Hauer wrote:
> > > I am working on making it possible to build support for multiple
> > > arch/arm/mach-*/ into the same barebox. Here are some misc cleanups
> > > I stumbled upon while preparing multi arch support.
> > > 
> > > Sascha Hauer (9):
> > >   ARM: mxs: remove unused mach/clock.h
> > >   ARM: imx: remove unused mach/clock.h
> > >   ARM: rockchip: drop mach/timer.h
> > >   ARM: i.MX: Move imxfb.h to include/platform_data/
> > >   pinctrl: rockchip: Fix uninitialized var warning
> > >   ARM: at91: remove unnecessary configs
> > >   ARM: at91: Switch all boards to multiimage
> > >   at91: consolidate usb-a963 128m images
> > >   ARM: pxa: Move plat/ include files to mach/
> > 
> > As much as I like the patches I think a more sane course of
> > action for these old at91 boards would be to drop most of them.
> 
> Agreed, and you just motivated me to look into it.
> 
> > A simple algorithm would be:
> >   If not supported in the kernel, drop the board.
> 
> That algorithm doesn't bring us very far. Here is a list of boards
> supported in barebox, the 'x' add the beginning denotes that I
> found a device tree for it in the kernel:
> 
> AT91RM9200
> ==========
> x MACH_AT91RM9200EK	Atmel AT91RM9200-EK Evaluation Kit
> 
> AT91SAM9260
> ===========
> x MACH_ANIMEO_IP	Somfy Animeo IP
> x MACH_AT91SAM9260EK	Atmel AT91SAM9260-EK
> x MACH_QIL_A9260	CALAO QIL-A9260 board
> x MACH_TNY_A9260	CALAO TNY-A9260
> x MACH_USB_A9260	CALAO USB-A9260
>   MACH_GE863		Telit EVK-PRO3
> 
> AT91SAM9261
> ===========
> x MACH_AT91SAM9261EK	Atmel AT91SAM9261-EK Evaluation Kit
>   MACH_PM9261		Ronetix PM9261
> 
> AT91SAM9G10
> ===========
> x MACH_AT91SAM9G10EK	Atmel AT91SAM9G10-EK Evaluation Kit
> 
> AT91SAM9G20
> ===========
> x MACH_AT91SAM9G20EK	Atmel AT91SAM9G20-EK Evaluation Kit
> x MACH_TNY_A9G20	CALAO TNY-A9G20
> x MACH_USB_A9G20	CALAO USB-A9G20
>   MACH_DSS11		aizo dSS11
>   MACH_QIL_A9G20	CALAO QIL-A9G20 board
>   MACH_HABA_KNX_LITE	CALAO HABA-KNX-LITE
> 
> AT91SAM9263
> ===========
>   MACH_PM9263		Ronetix PM9263
> x MACH_TNY_A9263	CALAO TNY-A9263
> x MACH_USB_A9263	CALAO USB-A9263
> 
> AT91SAM9G45 or AT91SAM9M10
> ==========================
>   MACH_AT91SAM9M10IHD	Atmel AT91SAM9M10IDH Tablet
> x MACH_AT91SAM9M10G45EK	Atmel AT91SAM9M10G45-EK Evaluation Kit
> x MACH_PM9G45		Ronetix PM9G45
> 
> AT91SAM9N12
> ===========
> x MACH_AT91SAM9N12EK	Atmel AT91SAM9N12 Evaluation Kit
> 
> SAMA5D3
> =======
> x MACH_SAMA5D3XEK	Atmel SAMA5D3X Evaluation Kit
> 
> SAMA5D4
> =======
> x MACH_SAMA5D4EK	Atmel SAMA5D4 Evaluation Kit
> x MACH_SAMA5D4_XPLAINED	Atmel SAMA5D4 XPLAINED ULTRA Evaluation Kit
> 
> It seems most boards are supported in the kernel as well.
Looking closer what I remembered was the removal of the legacy board
support - as the boards all became DT enabled.

> 
> >   
> > The boards that are not in the kernel have not seen any
> > activity in barebox for a long time, so it is not like
> > they look maintained.
> 
> None of the boards has seen any activity except for those that are
> already converted to multiboard.
> 
> Given that we could remove all board and SoC support that has
> not yet been converted to multiboard support.
> 
> The question is: When you want to port over some more board/SoC code
> to multiboard, does the existing code help you or would it be easier
> to do a fresh start?
If I for some reasons should look into adding DT support for a board, I
would have no trouble browsing some older barebox tree.
But I cannot see anyone would care about the older at91sam9* boards.
Keep the sama* boards but drop the at91sam* boards that are not
multi image enabled today.

If someone shows up and needs one of the at91sam* boards it should be
doable to add DT support as the infrastructure is in place.
But I cannot find the motivation to do so today, as I do not see any
potential users.

For the sama* boards Ahmed does a fantastic job migrating them one by
one so we should keep all of them. This is also a much newer SoC than
the at91sam* so there are products using this SoC where it can make
sense to do some new development.

Makes sense?

	Sam



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-03-02 17:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 14:30 [PATCH 0/9] ARM: misc cleanups Sascha Hauer
2023-02-28 14:30 ` [PATCH 1/9] ARM: mxs: remove unused mach/clock.h Sascha Hauer
2023-02-28 14:30 ` [PATCH 2/9] ARM: imx: " Sascha Hauer
2023-02-28 14:30 ` [PATCH 3/9] ARM: rockchip: drop mach/timer.h Sascha Hauer
2023-02-28 14:30 ` [PATCH 4/9] ARM: i.MX: Move imxfb.h to include/platform_data/ Sascha Hauer
2023-02-28 14:30 ` [PATCH 5/9] pinctrl: rockchip: Fix uninitialized var warning Sascha Hauer
2023-02-28 14:30 ` [PATCH 6/9] ARM: at91: remove unnecessary configs Sascha Hauer
2023-02-28 14:30 ` [PATCH 7/9] ARM: at91: Switch all boards to multiimage Sascha Hauer
2023-02-28 14:30 ` [PATCH 8/9] at91: consolidate usb-a963 128m images Sascha Hauer
2023-02-28 14:30 ` [PATCH 9/9] ARM: pxa: Move plat/ include files to mach/ Sascha Hauer
2023-03-01 17:42   ` Ahmad Fatoum
2023-02-28 17:37 ` [PATCH 0/9] ARM: misc cleanups Sam Ravnborg
2023-03-01  7:53   ` Sascha Hauer
2023-03-02 17:01     ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox