* [PATCH 1/3] ARM: CCMX51: Remove excess assignment
@ 2022-04-19 7:21 Alexander Shiyan
2022-04-19 7:21 ` [PATCH 2/3] ARM: CCMX51: Add support for low-level debug Alexander Shiyan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alexander Shiyan @ 2022-04-19 7:21 UTC (permalink / raw)
To: barebox; +Cc: Alexander Shiyan
Default assignment for board index is already done in array initialization.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
arch/arm/boards/ccxmx51/ccxmx51.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
index dfc26cd835..cbf06e6cd6 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51.c
@@ -245,8 +245,6 @@ static __init int ccxmx51_init(void)
hang();
}
- ccxmx_id = &ccxmx51_ids[hwid[0]];
-
switch (hwid[2] & 0xc0) {
case 0x00:
manloc = 'B';
--
2.32.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] ARM: CCMX51: Add support for low-level debug
2022-04-19 7:21 [PATCH 1/3] ARM: CCMX51: Remove excess assignment Alexander Shiyan
@ 2022-04-19 7:21 ` Alexander Shiyan
2022-04-19 7:21 ` [PATCH 3/3] ARM: CCMX51: Add support for 16-bit memory module variants Alexander Shiyan
2022-04-20 6:45 ` [PATCH 1/3] ARM: CCMX51: Remove excess assignment Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Shiyan @ 2022-04-19 7:21 UTC (permalink / raw)
To: barebox; +Cc: Alexander Shiyan
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
arch/arm/boards/ccxmx51/lowlevel.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/arch/arm/boards/ccxmx51/lowlevel.c b/arch/arm/boards/ccxmx51/lowlevel.c
index adcb30a7ff..367925e398 100644
--- a/arch/arm/boards/ccxmx51/lowlevel.c
+++ b/arch/arm/boards/ccxmx51/lowlevel.c
@@ -2,12 +2,37 @@
/* Author: Alexander Shiyan <shc_work@mail.ru> */
#include <common.h>
+#include <debug_ll.h>
+#include <mach/clock-imx51_53.h>
#include <mach/esdctl.h>
#include <mach/generic.h>
+#include <mach/iomux-mx51.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <mach/imx51-regs.h>
+static inline void setup_uart(void)
+{
+ void __iomem *iomuxbase = IOMEM(MX51_IOMUXC_BASE_ADDR);
+ void __iomem *ccmbase = IOMEM(MX51_CCM_BASE_ADDR);
+
+ /*
+ * Restore CCM values that might be changed by the Mask ROM
+ * code.
+ *
+ * Source: RealView debug scripts provided by Freescale
+ */
+ writel(MX5_CCM_CBCDR_RESET_VALUE, ccmbase + MX5_CCM_CBCDR);
+ writel(MX5_CCM_CSCMR1_RESET_VALUE, ccmbase + MX5_CCM_CSCMR1);
+ writel(MX5_CCM_CSCDR1_RESET_VALUE, ccmbase + MX5_CCM_CSCDR1);
+
+ imx_setup_pad(iomuxbase, MX51_PAD_UART1_TXD__UART1_TXD);
+
+ imx51_uart_setup_ll();
+
+ putc_ll('>');
+}
+
ENTRY_FUNCTION(start_ccxmx51, r0, r1, r2)
{
extern char __dtb_imx51_ccxmx51_start[];
@@ -15,6 +40,9 @@ ENTRY_FUNCTION(start_ccxmx51, r0, r1, r2)
imx5_cpu_lowlevel_init();
+ if (IS_ENABLED(CONFIG_DEBUG_LL))
+ setup_uart();
+
arm_setup_stack(0x20000000);
fdt = __dtb_imx51_ccxmx51_start + get_runtime_offset();
--
2.32.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/3] ARM: CCMX51: Add support for 16-bit memory module variants
2022-04-19 7:21 [PATCH 1/3] ARM: CCMX51: Remove excess assignment Alexander Shiyan
2022-04-19 7:21 ` [PATCH 2/3] ARM: CCMX51: Add support for low-level debug Alexander Shiyan
@ 2022-04-19 7:21 ` Alexander Shiyan
2022-04-20 6:45 ` [PATCH 1/3] ARM: CCMX51: Remove excess assignment Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Shiyan @ 2022-04-19 7:21 UTC (permalink / raw)
To: barebox; +Cc: Alexander Shiyan
Modules can have memory chips with a bus width of 16 bits.
Let's separate the binaries for initializing different types.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
.../boards/ccxmx51/flash-header-x16.imxcfg | 61 +++++++++++++++++++
...-header.imxcfg => flash-header-x32.imxcfg} | 1 -
arch/arm/boards/ccxmx51/lowlevel.c | 12 +++-
images/Makefile.imx | 10 +--
4 files changed, 78 insertions(+), 6 deletions(-)
create mode 100644 arch/arm/boards/ccxmx51/flash-header-x16.imxcfg
rename arch/arm/boards/ccxmx51/{flash-header.imxcfg => flash-header-x32.imxcfg} (99%)
diff --git a/arch/arm/boards/ccxmx51/flash-header-x16.imxcfg b/arch/arm/boards/ccxmx51/flash-header-x16.imxcfg
new file mode 100644
index 0000000000..6d77324fc8
--- /dev/null
+++ b/arch/arm/boards/ccxmx51/flash-header-x16.imxcfg
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+soc imx51
+loadaddr 0x90000000
+ivtofs 0x400
+wm 32 0x73fa88a0 0x00000200
+wm 32 0x73fa850c 0x000020c5
+wm 32 0x73fa8510 0x000020c5
+wm 32 0x73fa883c 0x00000002
+wm 32 0x73fa8848 0x00000002
+wm 32 0x73fa84b8 0x000000e7
+wm 32 0x73fa84bc 0x00000045
+wm 32 0x73fa84c0 0x00000045
+wm 32 0x73fa84c4 0x00000045
+wm 32 0x73fa84c8 0x00000045
+wm 32 0x73fa8820 0x00000000
+wm 32 0x73fa84a4 0x00000003
+wm 32 0x73fa84a8 0x00000003
+wm 32 0x73fa84ac 0x000000e3
+wm 32 0x73fa84b0 0x000000e3
+wm 32 0x73fa84b4 0x000000e3
+wm 32 0x73fa84cc 0x000000e3
+wm 32 0x73fa84d0 0x000000e2
+wm 32 0x73fa882c 0x00000004
+wm 32 0x73fa88a4 0x00000004
+wm 32 0x73fa88ac 0x00000004
+wm 32 0x73fa88b8 0x00000004
+wm 32 0x83fd9000 0x82a10000
+wm 32 0x83fd9008 0x82a10000
+wm 32 0x83fd9010 0x000ad0d0
+wm 32 0x83fd9004 0x3f3584ab
+wm 32 0x83fd900c 0x3f3584ab
+wm 32 0x83fd9014 0x04008008
+wm 32 0x83fd9014 0x0000801a
+wm 32 0x83fd9014 0x0000801b
+wm 32 0x83fd9014 0x00448019
+wm 32 0x83fd9014 0x07328018
+wm 32 0x83fd9014 0x04008008
+wm 32 0x83fd9014 0x00008010
+wm 32 0x83fd9014 0x00008010
+wm 32 0x83fd9014 0x06328018
+wm 32 0x83fd9014 0x03808019
+wm 32 0x83fd9014 0x00408019
+wm 32 0x83fd9014 0x00008000
+wm 32 0x83fd9014 0x0400800c
+wm 32 0x83fd9014 0x0000801e
+wm 32 0x83fd9014 0x0000801f
+wm 32 0x83fd9014 0x0000801d
+wm 32 0x83fd9014 0x0732801c
+wm 32 0x83fd9014 0x0400800c
+wm 32 0x83fd9014 0x00008014
+wm 32 0x83fd9014 0x00008014
+wm 32 0x83fd9014 0x0632801c
+wm 32 0x83fd9014 0x0380801d
+wm 32 0x83fd9014 0x0040801d
+wm 32 0x83fd9014 0x00008004
+wm 32 0x83fd9000 0xb2a10000
+wm 32 0x83fd9008 0xb2a10000
+wm 32 0x83fd9010 0x000ad6d0
+wm 32 0x83fd9034 0x90000000
+wm 32 0x83fd9014 0x00000000
diff --git a/arch/arm/boards/ccxmx51/flash-header.imxcfg b/arch/arm/boards/ccxmx51/flash-header-x32.imxcfg
similarity index 99%
rename from arch/arm/boards/ccxmx51/flash-header.imxcfg
rename to arch/arm/boards/ccxmx51/flash-header-x32.imxcfg
index 185a48fe18..6480aa590e 100644
--- a/arch/arm/boards/ccxmx51/flash-header.imxcfg
+++ b/arch/arm/boards/ccxmx51/flash-header-x32.imxcfg
@@ -59,4 +59,3 @@ wm 32 0x83fd9008 0xb2a20000
wm 32 0x83fd9010 0x000ad6d0
wm 32 0x83fd9034 0x90000000
wm 32 0x83fd9014 0x00000000
-
diff --git a/arch/arm/boards/ccxmx51/lowlevel.c b/arch/arm/boards/ccxmx51/lowlevel.c
index 367925e398..49bc7bfe32 100644
--- a/arch/arm/boards/ccxmx51/lowlevel.c
+++ b/arch/arm/boards/ccxmx51/lowlevel.c
@@ -33,7 +33,7 @@ static inline void setup_uart(void)
putc_ll('>');
}
-ENTRY_FUNCTION(start_ccxmx51, r0, r1, r2)
+static inline void start_ccxmx51(void)
{
extern char __dtb_imx51_ccxmx51_start[];
void *fdt;
@@ -49,3 +49,13 @@ ENTRY_FUNCTION(start_ccxmx51, r0, r1, r2)
barebox_arm_entry(MX51_CSD0_BASE_ADDR, SZ_128M, fdt);
}
+
+ENTRY_FUNCTION(start_ccxmx51_x16, r0, r1, r2)
+{
+ start_ccxmx51();
+}
+
+ENTRY_FUNCTION(start_ccxmx51_x32, r0, r1, r2)
+{
+ start_ccxmx51();
+}
diff --git a/images/Makefile.imx b/images/Makefile.imx
index 18cabbf041..8cc20b1137 100644
--- a/images/Makefile.imx
+++ b/images/Makefile.imx
@@ -88,10 +88,12 @@ FILE_barebox-kindle-ey21.img = start_imx50_kindle_ey21.pblb.imximg
image-$(CONFIG_MACH_KINDLE_MX50) += barebox-kindle-ey21.img
# ----------------------- i.MX51 based boards ---------------------------
-pblb-$(CONFIG_MACH_CCMX51) += start_ccxmx51
-CFG_start_ccxmx51.pblb.imximg = $(board)/ccxmx51/flash-header.imxcfg
-FILE_barebox-imx51-ccxmx51.img = start_ccxmx51.pblb.imximg
-image-$(CONFIG_MACH_CCMX51) += barebox-imx51-ccxmx51.img
+pblb-$(CONFIG_MACH_CCMX51) += start_ccxmx51_x16 start_ccxmx51_x32
+CFG_start_ccxmx51_x16.pblb.imximg = $(board)/ccxmx51/flash-header-x16.imxcfg
+CFG_start_ccxmx51_x32.pblb.imximg = $(board)/ccxmx51/flash-header-x32.imxcfg
+FILE_barebox-imx51-ccxmx51-x16.img = start_ccxmx51_x16.pblb.imximg
+FILE_barebox-imx51-ccxmx51-x32.img = start_ccxmx51_x32.pblb.imximg
+image-$(CONFIG_MACH_CCMX51) += barebox-imx51-ccxmx51-x16.img barebox-imx51-ccxmx51-x32.img
pblb-$(CONFIG_MACH_FREESCALE_MX51_PDK) += start_imx51_babbage
CFG_start_imx51_babbage.pblb.imximg = $(board)/freescale-mx51-babbage/flash-header-imx51-babbage.imxcfg
--
2.32.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] ARM: CCMX51: Remove excess assignment
2022-04-19 7:21 [PATCH 1/3] ARM: CCMX51: Remove excess assignment Alexander Shiyan
2022-04-19 7:21 ` [PATCH 2/3] ARM: CCMX51: Add support for low-level debug Alexander Shiyan
2022-04-19 7:21 ` [PATCH 3/3] ARM: CCMX51: Add support for 16-bit memory module variants Alexander Shiyan
@ 2022-04-20 6:45 ` Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2022-04-20 6:45 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: barebox
On Tue, Apr 19, 2022 at 10:21:21AM +0300, Alexander Shiyan wrote:
> Default assignment for board index is already done in array initialization.
>
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> ---
> arch/arm/boards/ccxmx51/ccxmx51.c | 2 --
> 1 file changed, 2 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
> index dfc26cd835..cbf06e6cd6 100644
> --- a/arch/arm/boards/ccxmx51/ccxmx51.c
> +++ b/arch/arm/boards/ccxmx51/ccxmx51.c
> @@ -245,8 +245,6 @@ static __init int ccxmx51_init(void)
> hang();
> }
>
> - ccxmx_id = &ccxmx51_ids[hwid[0]];
> -
> switch (hwid[2] & 0xc0) {
> case 0x00:
> manloc = 'B';
> --
> 2.32.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-20 6:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 7:21 [PATCH 1/3] ARM: CCMX51: Remove excess assignment Alexander Shiyan
2022-04-19 7:21 ` [PATCH 2/3] ARM: CCMX51: Add support for low-level debug Alexander Shiyan
2022-04-19 7:21 ` [PATCH 3/3] ARM: CCMX51: Add support for 16-bit memory module variants Alexander Shiyan
2022-04-20 6:45 ` [PATCH 1/3] ARM: CCMX51: Remove excess assignment Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox