* [PATCH] Add new ARM entry point for barebox
@ 2013-01-27 10:46 Sascha Hauer
2013-01-27 10:46 ` [PATCH 01/34] ARM: Add new " Sascha Hauer
` (33 more replies)
0 siblings, 34 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Memory is a precious resource. This series makes the memory layout
available to the early entry point for ARM barebox.
With this the boards no longer call board_init_lowlevel_return(void)
but instead barebox_arm_entry(u32 membase, u32 memsize, u32 boarddata).
This has the advantage that we can use this memory for example to allocate
the first level page table very early, which is also done in this series.
The MMU is now enabled during the decompression code and not disabled
afterwards until the regular MMU code picks up the already enabled MMU.
This is done to speed up starting.
Also the stack and the malloc base/size can now determined automatically.
Later, should we introduce relocatable binaries the memory information
will also be helpful.
This series is tested quite thoroughly on i.MX, Atmel, PXA and Omap boards.
Anyway, further testing would be appreciated.
Sascha
The following changes since commit cd1c289b2a4949e8acb235d4847419bde784a9d6:
Merge branch 'for-next/misc' into next (2013-01-25 19:51:11 +0100)
are available in the git repository at:
git://git.pengutronix.de/git/barebox.git pu/arm-entry
for you to fetch changes up to 0555221e00b6819d0a50bf7e8b77e4002513d802:
ARM pbl: inline decompress function (2013-01-27 01:40:52 +0100)
----------------------------------------------------------------
Sascha Hauer (34):
ARM: Add new entry point for barebox
ARM: add __noreturn to board_init_lowlevel_return
ARM i.MX: Use SRAM stack in lowlevel code
ARM i.MX: Add i.MX specific entry point for barebox
ARM i.MX: prepare external nand boot for SoC specific entry
ARM i.MX boards: switch to barebox_arm_entry
ARM MXS boards: switch to barebox_arm_entry
ARM OMAP boards: switch to barebox_arm_entry
ARM Samsung boards: switch to barebox_arm_entry
ARM PXA boards: switch to barebox_arm_entry
ARM ep93xx boards: switch to barebox_arm_entry
ARM tegra boards: switch to barebox_arm_entry
ARM nomadik boards: switch to barebox_arm_entry
ARM versatile boards: switch to barebox_arm_entry
ARM netx boards: switch to barebox_arm_entry
ARM clep7212: switch to barebox_arm_entry
ARM raspberrypi: switch to barebox_arm_entry
ARM AT91 mmccpu: Fix non existing define
ARM AT91: switch to barebox_arm_entry part1
ARM AT91: switch at91rm9200 board to barebox_arm_entry
ARM AT91: switch remaining boards to barebox_arm_entry
ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT
ARM start-pbl: make board_init_lowlevel_return static
ARM start-pbl: call uncompressed binary with arguments
ARM start: pickup parameters from pbl
ARM: Setup stack at end of SDRAM
ARM pbl: Use dynamic parameters for early malloc space
ARM mmu: pickup already enabled mmu
ARM: Factor out early mmu code
ARM: Enable mmu early
ARM: Automatically determine malloc size
generic memory layout: fix deps for [MALLOC|STACK]_BASE
ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT
ARM pbl: inline decompress function
arch/arm/Kconfig | 1 -
arch/arm/boards/a9m2410/lowlevel_init.S | 9 +-
arch/arm/boards/a9m2440/lowlevel_init.S | 9 +-
arch/arm/boards/archosg9/Makefile | 4 +-
arch/arm/boards/archosg9/lowlevel.c | 3 +-
arch/arm/boards/at91rm9200ek/Makefile | 2 +
arch/arm/boards/at91rm9200ek/lowlevel.c | 14 ++
arch/arm/boards/at91sam9263ek/Makefile | 4 +-
arch/arm/boards/at91sam9m10g45ek/Makefile | 2 +
arch/arm/boards/at91sam9m10g45ek/lowlevel.c | 11 ++
arch/arm/boards/at91sam9m10ihd/Makefile | 2 +
arch/arm/boards/at91sam9m10ihd/lowlevel.c | 11 ++
arch/arm/boards/at91sam9n12ek/Makefile | 2 +
arch/arm/boards/at91sam9n12ek/lowlevel.c | 11 ++
arch/arm/boards/at91sam9x5ek/Makefile | 2 +
arch/arm/boards/at91sam9x5ek/lowlevel.c | 11 ++
arch/arm/boards/beagle/Makefile | 2 +
arch/arm/boards/beagle/lowlevel.c | 14 ++
arch/arm/boards/beaglebone/Makefile | 2 +
arch/arm/boards/beaglebone/lowlevel.c | 11 ++
arch/arm/boards/ccxmx51/Makefile | 2 +
arch/arm/boards/ccxmx51/lowlevel.c | 9 ++
arch/arm/boards/chumby_falconwing/Makefile | 2 +
arch/arm/boards/chumby_falconwing/lowlevel.c | 11 ++
arch/arm/boards/clep7212/lowlevel.c | 3 +-
arch/arm/boards/crystalfontz-cfa10036/Makefile | 2 +
arch/arm/boards/crystalfontz-cfa10036/lowlevel.c | 11 ++
arch/arm/boards/edb93xx/sdram_cfg.c | 4 +
arch/arm/boards/efika-mx-smartbook/Makefile | 2 +
arch/arm/boards/efika-mx-smartbook/lowlevel.c | 9 ++
arch/arm/boards/eukrea_cpuimx25/lowlevel.c | 6 +-
arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S | 7 +-
arch/arm/boards/eukrea_cpuimx35/lowlevel.c | 8 +-
arch/arm/boards/eukrea_cpuimx51/Makefile | 2 +
arch/arm/boards/eukrea_cpuimx51/lowlevel.c | 9 ++
arch/arm/boards/freescale-mx23-evk/Makefile | 2 +
arch/arm/boards/freescale-mx23-evk/lowlevel.c | 11 ++
.../boards/freescale-mx25-3-stack/lowlevel_init.S | 7 +-
arch/arm/boards/freescale-mx28-evk/Makefile | 2 +
arch/arm/boards/freescale-mx28-evk/lowlevel.c | 11 ++
arch/arm/boards/freescale-mx35-3-stack/3stack.c | 1 +
.../boards/freescale-mx35-3-stack/lowlevel_init.S | 7 +-
arch/arm/boards/freescale-mx51-pdk/Makefile | 2 +
arch/arm/boards/freescale-mx51-pdk/lowlevel.c | 9 ++
arch/arm/boards/freescale-mx53-loco/Makefile | 2 +
arch/arm/boards/freescale-mx53-loco/lowlevel.c | 9 ++
arch/arm/boards/freescale-mx53-smd/Makefile | 2 +
arch/arm/boards/freescale-mx53-smd/lowlevel.c | 9 ++
arch/arm/boards/freescale-mx6-arm2/Makefile | 2 +
arch/arm/boards/freescale-mx6-arm2/lowlevel.c | 10 ++
arch/arm/boards/freescale-mx6-sabrelite/Makefile | 2 +
arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c | 10 ++
.../boards/friendlyarm-mini2440/lowlevel_init.S | 9 +-
arch/arm/boards/friendlyarm-mini6410/Makefile | 2 +
arch/arm/boards/friendlyarm-mini6410/lowlevel.c | 11 ++
arch/arm/boards/friendlyarm-tiny210/lowlevel.c | 4 +-
arch/arm/boards/friendlyarm-tiny6410/Makefile | 3 +-
arch/arm/boards/friendlyarm-tiny6410/lowlevel.c | 11 ++
arch/arm/boards/guf-cupid/lowlevel.c | 8 +-
arch/arm/boards/guf-neso/lowlevel.c | 8 +-
arch/arm/boards/guf-vincell/lowlevel.c | 5 +-
arch/arm/boards/imx21ads/imx21ads.c | 3 +-
arch/arm/boards/imx21ads/lowlevel_init.S | 11 +-
arch/arm/boards/imx233-olinuxino/Makefile | 2 +
arch/arm/boards/imx233-olinuxino/lowlevel.c | 11 ++
arch/arm/boards/imx27ads/lowlevel_init.S | 4 +-
arch/arm/boards/karo-tx25/lowlevel.c | 10 +-
arch/arm/boards/karo-tx28/Makefile | 2 +
arch/arm/boards/karo-tx28/lowlevel.c | 11 ++
arch/arm/boards/karo-tx51/Makefile | 2 +
arch/arm/boards/karo-tx51/lowlevel.c | 9 ++
arch/arm/boards/karo-tx53/lowlevel.c | 6 +-
arch/arm/boards/mioa701/Makefile | 2 +
arch/arm/boards/mioa701/lowlevel.c | 10 ++
arch/arm/boards/mmccpu/Makefile | 4 +-
arch/arm/boards/mmccpu/lowlevel_init.c | 2 +-
arch/arm/boards/netx/platform.S | 7 +-
arch/arm/boards/nhk8815/Makefile | 2 +
arch/arm/boards/nhk8815/lowlevel.c | 10 ++
arch/arm/boards/omap343xdsp/Makefile | 2 +
arch/arm/boards/omap343xdsp/lowlevel.c | 14 ++
arch/arm/boards/omap3evm/Makefile | 2 +
arch/arm/boards/omap3evm/lowlevel.c | 10 ++
arch/arm/boards/panda/lowlevel.c | 7 +-
arch/arm/boards/pcm027/lowlevel_init.S | 7 +-
arch/arm/boards/pcm037/lowlevel.c | 6 +-
arch/arm/boards/pcm038/lowlevel.c | 8 +-
arch/arm/boards/pcm043/lowlevel.c | 8 +-
arch/arm/boards/pcm049/lowlevel.c | 7 +-
arch/arm/boards/pcm051/Makefile | 2 +
arch/arm/boards/pcm051/lowlevel.c | 11 ++
arch/arm/boards/phycard-a-l1/Makefile | 2 +
arch/arm/boards/phycard-a-l1/lowlevel.c | 11 ++
arch/arm/boards/phycard-a-xl2/lowlevel.c | 7 +-
arch/arm/boards/phycard-i.MX27/lowlevel_init.S | 4 +-
arch/arm/boards/pm9261/Makefile | 4 +-
arch/arm/boards/pm9263/Makefile | 4 +-
arch/arm/boards/pm9g45/Makefile | 2 +
arch/arm/boards/pm9g45/lowlevel.c | 11 ++
arch/arm/boards/raspberry-pi/Makefile | 2 +
arch/arm/boards/raspberry-pi/lowlevel.c | 11 ++
arch/arm/boards/scb9328/lowlevel_init.S | 4 +-
arch/arm/boards/tny-a926x/Makefile | 4 +-
arch/arm/boards/toshiba-ac100/Makefile | 2 +
arch/arm/boards/toshiba-ac100/lowlevel.c | 10 ++
arch/arm/boards/tqma53/Makefile | 2 +
arch/arm/boards/tqma53/lowlevel.c | 9 ++
arch/arm/boards/usb-a926x/Makefile | 4 +-
arch/arm/boards/versatile/Makefile | 3 +-
arch/arm/boards/versatile/lowlevel.c | 10 ++
arch/arm/configs/archosg9_defconfig | 1 -
arch/arm/configs/phycard_a_l1_defconfig | 2 -
arch/arm/cpu/Makefile | 4 +-
arch/arm/cpu/cpu.c | 12 ++
arch/arm/cpu/mmu-early.c | 53 ++++++
arch/arm/cpu/mmu-early.h | 6 +
arch/arm/cpu/mmu.c | 9 +-
arch/arm/cpu/start-pbl.c | 170 +++++++-------------
arch/arm/cpu/start.c | 111 ++++++++++---
arch/arm/include/asm/barebox-arm.h | 6 +-
arch/arm/lib/Makefile | 1 -
arch/arm/lib/arm.c | 14 --
arch/arm/mach-at91/Kconfig | 15 +-
arch/arm/mach-at91/Makefile | 10 +-
arch/arm/mach-at91/at91rm9200_lowlevel_init.c | 5 +-
arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 11 +-
arch/arm/mach-at91/include/mach/board.h | 3 +
arch/arm/mach-clps711x/Kconfig | 2 -
arch/arm/mach-ep93xx/Kconfig | 8 -
arch/arm/mach-ep93xx/Makefile | 4 +-
arch/arm/mach-ep93xx/lowlevel_init.S | 11 +-
arch/arm/mach-imx/Kconfig | 17 --
arch/arm/mach-imx/Makefile | 5 +-
arch/arm/mach-imx/esdctl.c | 136 +++++++++++++---
arch/arm/mach-imx/external-nand-boot.c | 74 ++++++---
arch/arm/mach-imx/include/mach/esdctl.h | 11 ++
arch/arm/mach-imx/include/mach/imx-nand.h | 1 -
arch/arm/mach-imx/include/mach/imx21-regs.h | 1 +
arch/arm/mach-imx/include/mach/imx25-regs.h | 3 +
arch/arm/mach-imx/include/mach/imx27-regs.h | 1 +
arch/arm/mach-imx/include/mach/imx31-regs.h | 3 +
arch/arm/mach-netx/Kconfig | 1 -
arch/arm/mach-omap/Kconfig | 5 -
arch/arm/mach-omap/arch-omap.dox | 1 -
arch/arm/mach-omap/include/mach/omap3-silicon.h | 1 +
arch/arm/mach-omap/omap3_core.S | 11 +-
arch/arm/mach-pxa/Kconfig | 1 -
arch/arm/mach-samsung/Kconfig | 6 -
arch/arm/pbl/zbarebox.lds.S | 8 +-
common/Kconfig | 21 ++-
common/meminfo.c | 5 -
include/asm-generic/memory_layout.h | 6 +-
152 files changed, 1060 insertions(+), 387 deletions(-)
create mode 100644 arch/arm/boards/at91rm9200ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9m10g45ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9m10ihd/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9n12ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9x5ek/lowlevel.c
create mode 100644 arch/arm/boards/beagle/lowlevel.c
create mode 100644 arch/arm/boards/beaglebone/lowlevel.c
create mode 100644 arch/arm/boards/ccxmx51/lowlevel.c
create mode 100644 arch/arm/boards/chumby_falconwing/lowlevel.c
create mode 100644 arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
create mode 100644 arch/arm/boards/efika-mx-smartbook/lowlevel.c
create mode 100644 arch/arm/boards/eukrea_cpuimx51/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx23-evk/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx28-evk/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx51-pdk/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx53-loco/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx53-smd/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx6-arm2/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
create mode 100644 arch/arm/boards/friendlyarm-mini6410/lowlevel.c
create mode 100644 arch/arm/boards/friendlyarm-tiny6410/lowlevel.c
create mode 100644 arch/arm/boards/imx233-olinuxino/lowlevel.c
create mode 100644 arch/arm/boards/karo-tx28/lowlevel.c
create mode 100644 arch/arm/boards/karo-tx51/lowlevel.c
create mode 100644 arch/arm/boards/mioa701/lowlevel.c
create mode 100644 arch/arm/boards/nhk8815/lowlevel.c
create mode 100644 arch/arm/boards/omap343xdsp/lowlevel.c
create mode 100644 arch/arm/boards/omap3evm/lowlevel.c
create mode 100644 arch/arm/boards/pcm051/lowlevel.c
create mode 100644 arch/arm/boards/phycard-a-l1/lowlevel.c
create mode 100644 arch/arm/boards/pm9g45/lowlevel.c
create mode 100644 arch/arm/boards/raspberry-pi/lowlevel.c
create mode 100644 arch/arm/boards/toshiba-ac100/lowlevel.c
create mode 100644 arch/arm/boards/tqma53/lowlevel.c
create mode 100644 arch/arm/boards/versatile/lowlevel.c
create mode 100644 arch/arm/cpu/mmu-early.c
create mode 100644 arch/arm/cpu/mmu-early.h
delete mode 100644 arch/arm/lib/arm.c
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 01/34] ARM: Add new entry point for barebox
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 02/34] ARM: add __noreturn to board_init_lowlevel_return Sascha Hauer
` (32 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Memory is a precious resource, so it makes sense to make it available as
early as possible. By definition the lowlevel init code already knows where
to find memory because it's the lowlevel init code which sets up the memory.
Until all boards are converted this new entry is just a fallback to the old
entry point.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 13 +++++++++++++
arch/arm/cpu/start.c | 13 +++++++++++++
arch/arm/include/asm/barebox-arm.h | 1 +
3 files changed, 27 insertions(+)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index c5f9705..0778fb5 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -200,3 +200,16 @@ void __naked board_init_lowlevel_return(void)
barebox_uncompress((void *)pg_start, pg_len);
}
+
+/*
+ * Main ARM entry point in the compressed image. Call this with the memory
+ * region you can spare for barebox. This doesn't necessarily have to be the
+ * full SDRAM. The currently running binary can be inside or outside of this
+ * region. TEXT_BASE can be inside or outside of this region. boarddata will
+ * be preserved and can be accessed later with barebox_arm_boarddata().
+ */
+void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
+{
+ board_init_lowlevel_return();
+}
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 793445a..0b7eee8 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -63,3 +63,16 @@ void __naked board_init_lowlevel_return(void)
start_barebox();
}
+
+/*
+ * Main ARM entry point in the uncompressed image. Call this with the memory
+ * region you can spare for barebox. This doesn't necessarily have to be the
+ * full SDRAM. The currently running binary can be inside or outside of this
+ * region. TEXT_BASE can be inside or outside of this region. boarddata will
+ * be preserved and can be accessed later with barebox_arm_boarddata().
+ */
+void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
+{
+ board_init_lowlevel_return();
+}
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 993130d..4ccf938 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -39,5 +39,6 @@ void board_init_lowlevel_return(void);
uint32_t get_runtime_offset(void);
void setup_c(void);
+void __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize, uint32_t boarddata);
#endif /* _BAREBOX_ARM_H_ */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 02/34] ARM: add __noreturn to board_init_lowlevel_return
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
2013-01-27 10:46 ` [PATCH 01/34] ARM: Add new " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 03/34] ARM i.MX: Use SRAM stack in lowlevel code Sascha Hauer
` (31 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 6 +++---
arch/arm/cpu/start.c | 2 +-
arch/arm/include/asm/barebox-arm.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 0778fb5..4a83181 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -132,9 +132,9 @@ static void noinline errorfn(char *error)
while (1);
}
-static void barebox_uncompress(void *compressed_start, unsigned int len)
+static void __noreturn barebox_uncompress(void *compressed_start, unsigned int len)
{
- void (*barebox)(void);
+ void __noreturn (*barebox)(void);
/*
* remap_cached currently does not work rendering the feature
* of enabling the MMU in the PBL useless. disable for now.
@@ -172,7 +172,7 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
* Board code can jump here by either returning from board_init_lowlevel
* or by calling this function directly.
*/
-void __naked board_init_lowlevel_return(void)
+void __naked __noreturn board_init_lowlevel_return(void)
{
uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 0b7eee8..f212b61 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -55,7 +55,7 @@ void __naked __bare_init reset(void)
* Board code can jump here by either returning from board_init_lowlevel
* or by calling this function directly.
*/
-void __naked board_init_lowlevel_return(void)
+void __naked __noreturn board_init_lowlevel_return(void)
{
arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 4ccf938..0574f34 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -35,7 +35,7 @@ int dram_init (void);
extern char __exceptions_start[], __exceptions_stop[];
void board_init_lowlevel(void);
-void board_init_lowlevel_return(void);
+void __noreturn board_init_lowlevel_return(void);
uint32_t get_runtime_offset(void);
void setup_c(void);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 03/34] ARM i.MX: Use SRAM stack in lowlevel code
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
2013-01-27 10:46 ` [PATCH 01/34] ARM: Add new " Sascha Hauer
2013-01-27 10:46 ` [PATCH 02/34] ARM: add __noreturn to board_init_lowlevel_return Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 04/34] ARM i.MX: Add i.MX specific entry point for barebox Sascha Hauer
` (30 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Several i.MX boards setup a temporary stack in their lowlevel code.
Instead of using STACK_BASE use a stack in internal SRAM to get rid
of the STACK_BASE compile time dependency.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S | 3 ++-
arch/arm/boards/eukrea_cpuimx35/lowlevel.c | 2 +-
arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S | 3 ++-
arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S | 3 ++-
arch/arm/boards/guf-cupid/lowlevel.c | 2 +-
arch/arm/boards/guf-neso/lowlevel.c | 2 +-
arch/arm/boards/imx21ads/lowlevel_init.S | 3 ++-
arch/arm/boards/karo-tx25/lowlevel.c | 3 ++-
arch/arm/boards/pcm037/lowlevel.c | 2 +-
arch/arm/boards/pcm038/lowlevel.c | 2 +-
arch/arm/boards/pcm043/lowlevel.c | 2 +-
arch/arm/mach-imx/include/mach/imx21-regs.h | 1 +
arch/arm/mach-imx/include/mach/imx25-regs.h | 3 +++
arch/arm/mach-imx/include/mach/imx27-regs.h | 1 +
arch/arm/mach-imx/include/mach/imx31-regs.h | 3 +++
15 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
index 4e69aac..287b513 100644
--- a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
+++ b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
@@ -124,7 +124,8 @@ reset:
sdram_init
#ifdef CONFIG_NAND_IMX_BOOT
- ldr sp, =STACK_BASE + STACK_SIZE - 12 /* Setup a temporary stack in SDRAM */
+ /* Setup a temporary stack in SDRAM */
+ ldr sp, =MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 4;
b imx27_barebox_boot_nand_external
#endif /* CONFIG_NAND_IMX_BOOT */
diff --git a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
index 8f4615a..c43f7fe 100644
--- a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
@@ -138,7 +138,7 @@ void __bare_init __naked reset(void)
writel(r, MX35_CCM_BASE_ADDR + MX35_CCM_PDR4);
/* setup a stack to be able to call imx35_barebox_boot_nand_external() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx35_barebox_boot_nand_external();
#else
diff --git a/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S b/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S
index 595c485..2e49e6e 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S
+++ b/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S
@@ -98,7 +98,8 @@ reset:
str r3, [r0, #0x30]
#ifdef CONFIG_NAND_IMX_BOOT
- ldr sp, =STACK_BASE + STACK_SIZE - 12 /* Setup a temporary stack in SDRAM */
+ /* Setup a temporary stack in SRAM */
+ ldr sp, =MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 4
b imx25_barebox_boot_nand_external
#endif /* CONFIG_NAND_IMX_BOOT */
diff --git a/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S b/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S
index 5461b61..c63c953 100644
--- a/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S
+++ b/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S
@@ -155,7 +155,8 @@ reset:
str r3, [r0, #0x30]
#ifdef CONFIG_NAND_IMX_BOOT
- ldr sp, =STACK_BASE + STACK_SIZE - 12 /* Setup a temporary stack in SDRAM */
+ /* Setup a temporary stack in internal SRAM */
+ ldr sp, =MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 4
b imx35_barebox_boot_nand_external
#endif /* CONFIG_NAND_IMX_BOOT */
diff --git a/arch/arm/boards/guf-cupid/lowlevel.c b/arch/arm/boards/guf-cupid/lowlevel.c
index f2994eb..c141b54 100644
--- a/arch/arm/boards/guf-cupid/lowlevel.c
+++ b/arch/arm/boards/guf-cupid/lowlevel.c
@@ -314,7 +314,7 @@ void __bare_init __naked reset(void)
writel(r0, MX35_CCM_BASE_ADDR + MX35_CCM_PDR4);
/* setup a stack to be able to call imx35_barebox_boot_nand_external() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx35_barebox_boot_nand_external();
#else
diff --git a/arch/arm/boards/guf-neso/lowlevel.c b/arch/arm/boards/guf-neso/lowlevel.c
index 7a366d9..ca44607 100644
--- a/arch/arm/boards/guf-neso/lowlevel.c
+++ b/arch/arm/boards/guf-neso/lowlevel.c
@@ -88,7 +88,7 @@ void __bare_init __naked reset(void)
#ifdef CONFIG_NAND_IMX_BOOT
/* setup a stack to be able to call imx27_barebox_boot_nand_external() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
imx27_barebox_boot_nand_external();
#else
diff --git a/arch/arm/boards/imx21ads/lowlevel_init.S b/arch/arm/boards/imx21ads/lowlevel_init.S
index f06c964..5be4995 100644
--- a/arch/arm/boards/imx21ads/lowlevel_init.S
+++ b/arch/arm/boards/imx21ads/lowlevel_init.S
@@ -118,7 +118,8 @@ reset:
str r1, [r0]
#ifdef CONFIG_NAND_IMX_BOOT
- ldr sp, =STACK_BASE + STACK_SIZE - 12 /* Setup a temporary stack in SDRAM */
+ /* Setup a temporary stack in SRAM */
+ ldr sp, =MX21_IRAM_BASE_ADDR + MX21_IRAM_SIZE - 4
b imx21_barebox_boot_nand_external
#endif /* CONFIG_NAND_IMX_BOOT */
diff --git a/arch/arm/boards/karo-tx25/lowlevel.c b/arch/arm/boards/karo-tx25/lowlevel.c
index b1afe18..9e96e39 100644
--- a/arch/arm/boards/karo-tx25/lowlevel.c
+++ b/arch/arm/boards/karo-tx25/lowlevel.c
@@ -21,6 +21,7 @@
#include <mach/imx25-regs.h>
#include <mach/esdctl.h>
#include <io.h>
+#include <sizes.h>
#include <mach/imx-nand.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
@@ -134,7 +135,7 @@ void __bare_init __naked reset(void)
#ifdef CONFIG_NAND_IMX_BOOT
/* setup a stack to be able to call imx25_barebox_boot_nand_external() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 8);
imx25_barebox_boot_nand_external();
#else
diff --git a/arch/arm/boards/pcm037/lowlevel.c b/arch/arm/boards/pcm037/lowlevel.c
index da01732..b531615 100644
--- a/arch/arm/boards/pcm037/lowlevel.c
+++ b/arch/arm/boards/pcm037/lowlevel.c
@@ -127,7 +127,7 @@ void __bare_init __naked reset(void)
#ifdef CONFIG_NAND_IMX_BOOT
/* setup a stack to be able to call imx31_barebox_boot_nand_external() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX31_IRAM_BASE_ADDR + MX31_IRAM_SIZE - 12);
imx31_barebox_boot_nand_external();
#else
diff --git a/arch/arm/boards/pcm038/lowlevel.c b/arch/arm/boards/pcm038/lowlevel.c
index 4515107..aecdbf3 100644
--- a/arch/arm/boards/pcm038/lowlevel.c
+++ b/arch/arm/boards/pcm038/lowlevel.c
@@ -95,7 +95,7 @@ void __bare_init __naked reset(void)
#ifdef CONFIG_NAND_IMX_BOOT
/* setup a stack to be able to call mx27_barebox_boot_nand_external() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
imx27_barebox_boot_nand_external();
#else
diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c
index 639064f..a9832e2 100644
--- a/arch/arm/boards/pcm043/lowlevel.c
+++ b/arch/arm/boards/pcm043/lowlevel.c
@@ -190,7 +190,7 @@ void __bare_init __naked reset(void)
writel(r, MX35_CCM_BASE_ADDR + MX35_CCM_PDR4);
/* setup a stack to be able to call imx35_barebox_boot_nand_external() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx35_barebox_boot_nand_external();
#else
diff --git a/arch/arm/mach-imx/include/mach/imx21-regs.h b/arch/arm/mach-imx/include/mach/imx21-regs.h
index 87bd99c..1fa463a 100644
--- a/arch/arm/mach-imx/include/mach/imx21-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx21-regs.h
@@ -70,6 +70,7 @@
#define MX21_NFC_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x3000)
#define MX21_IRAM_BASE_ADDR 0xffffe800 /* internal ram */
+#define MX21_IRAM_SIZE 0x00001800
/* AIPI (base MX21_AIPI_BASE_ADDR) */
#define MX21_AIPI1_PSR0 0x00
diff --git a/arch/arm/mach-imx/include/mach/imx25-regs.h b/arch/arm/mach-imx/include/mach/imx25-regs.h
index b8ae45a..9ab0fb3 100644
--- a/arch/arm/mach-imx/include/mach/imx25-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx25-regs.h
@@ -76,6 +76,9 @@
#define MX25_USB_HS_BASE_ADDR (MX25_USB_BASE_ADDR + 0x0400)
#define MX25_CSI_BASE_ADDR 0x53ff8000
+#define MX25_IRAM_BASE_ADDR 0x78000000 /* internal ram */
+#define MX25_IRAM_SIZE SZ_128K
+
/*
* Clock Controller Module (CCM)
*/
diff --git a/arch/arm/mach-imx/include/mach/imx27-regs.h b/arch/arm/mach-imx/include/mach/imx27-regs.h
index 44bc1d3..c45befb 100644
--- a/arch/arm/mach-imx/include/mach/imx27-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx27-regs.h
@@ -100,6 +100,7 @@
/* IRAM */
#define MX27_IRAM_BASE_ADDR 0xffff4c00 /* internal ram */
+#define MX27_IRAM_SIZE 0x0000b400
/* PCMCIA (base: MX27_PCMCIA_CTL_BASE_ADDR) */
#define MX27_PCMCIA_PIPR 0x00
diff --git a/arch/arm/mach-imx/include/mach/imx31-regs.h b/arch/arm/mach-imx/include/mach/imx31-regs.h
index f641fe6..be3e4c1 100644
--- a/arch/arm/mach-imx/include/mach/imx31-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx31-regs.h
@@ -21,6 +21,9 @@
#include <sizes.h>
+#define MX31_IRAM_BASE_ADDR 0x1fffc000
+#define MX31_IRAM_SIZE 0x00004000
+
#define MX31_AIPS1_BASE_ADDR 0x43f00000
#define MX31_AIPS1_SIZE SZ_1M
#define MX31_MAX_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x04000)
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 04/34] ARM i.MX: Add i.MX specific entry point for barebox
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (2 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 03/34] ARM i.MX: Use SRAM stack in lowlevel code Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 05/34] ARM i.MX: prepare external nand boot for SoC specific entry Sascha Hauer
` (29 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Additionally to the generic entry point the i.MX specific ones
calculate the SDRAM size automatically so the boards do not have
to care.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 12 +++
arch/arm/cpu/start.c | 12 +++
arch/arm/mach-imx/esdctl.c | 136 ++++++++++++++++++++++++++-----
arch/arm/mach-imx/include/mach/esdctl.h | 11 +++
4 files changed, 150 insertions(+), 21 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 4a83181..8a4232d 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -207,6 +207,18 @@ void __naked __noreturn board_init_lowlevel_return(void)
* full SDRAM. The currently running binary can be inside or outside of this
* region. TEXT_BASE can be inside or outside of this region. boarddata will
* be preserved and can be accessed later with barebox_arm_boarddata().
+ *
+ * -> membase + memsize
+ * ARM_RESERVE_MEM_SIZE - reserved for board usage. Will not be touched
+ * by barebox
+ * STACK_SIZE - stack
+ * 16KiB, aligned to 16KiB - First level page table if early MMU support
+ * is enabled
+ * 128KiB - early memory space
+ * -> maximum end of barebox binary
+ *
+ * Usually a TEXT_BASE of 1MiB below your lowest possible end of memory should
+ * be fine.
*/
void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index f212b61..df22cde 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -70,6 +70,18 @@ void __naked __noreturn board_init_lowlevel_return(void)
* full SDRAM. The currently running binary can be inside or outside of this
* region. TEXT_BASE can be inside or outside of this region. boarddata will
* be preserved and can be accessed later with barebox_arm_boarddata().
+ *
+ * -> membase + memsize
+ * ARM_RESERVE_MEM_SIZE - reserved for board usage. Will not be touched
+ * by barebox
+ * STACK_SIZE - stack
+ * 16KiB, aligned to 16KiB - First level page table if early MMU support
+ * is enabled
+ * 128KiB - early memory space
+ * -> maximum end of barebox binary
+ *
+ * Usually a TEXT_BASE of 1MiB below your lowest possible end of memory should
+ * be fine.
*/
void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index dd70e6d..7224699 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -127,32 +127,18 @@ static inline unsigned long imx_v4_sdram_size(void __iomem *esdctlbase, int cs)
return 0;
if (cs == 1 && !(ctlval & ESDCTL_V4_ESDCTLx_SDE1))
return 0;
-
/* one 2GiB cs, memory is returned for cs0 only */
if (cs == 1 && (esdmisc & ESDCTL_V4_ESDMISC_ONE_CS))
- return 9;
-
+ return 0;
rows = ((ctlval >> 24) & 0x7) + 11;
- switch ((ctlval >> 20) & 0x7) {
- case 0:
- cols = 9;
- break;
- case 1:
- cols = 10;
- break;
- case 2:
- cols = 11;
- break;
- case 3:
+
+ cols = (ctlval >> 20) & 0x7;
+ if (cols == 3)
cols = 8;
- break;
- case 4:
+ else if (cols == 4)
cols = 12;
- break;
- default:
- cols = 0;
- break;
- }
+ else
+ cols += 9;
if (ctlval & ESDCTL_V4_ESDCTLx_DSIZ_32B)
width = 4;
@@ -353,3 +339,111 @@ static int imx_esdctl_init(void)
}
mem_initcall(imx_esdctl_init);
+
+/*
+ * The i.MX SoCs usually have two SDRAM chipselects. The following
+ * SoC specific functions return:
+ *
+ * - cs0 disabled, cs1 disabled: 0
+ * - cs0 enabled, cs1 disabled: SDRAM size for cs0
+ * - cs0 disabled, c1 enabled: 0 (currently assumed that no hardware does this)
+ * - cs0 enabled, cs1 enabled: The largest continuous region, that is, cs0 + cs1
+ * if cs0 is taking the whole address space.
+ */
+void __naked __noreturn imx1_barebox_entry(uint32_t boarddata)
+{
+ unsigned long base;
+ unsigned long size;
+
+ base = 0x08000000;
+
+ size = imx_v1_sdram_size((void *)MX1_SDRAMC_BASE_ADDR, 0);
+ if (size == SZ_64M)
+ size += imx_v1_sdram_size((void *)MX1_SDRAMC_BASE_ADDR, 1);
+
+ barebox_arm_entry(base, size, boarddata);
+}
+
+void __naked __noreturn imx25_barebox_entry(uint32_t boarddata)
+{
+ unsigned long base;
+ unsigned long size;
+
+ base = MX25_CSD0_BASE_ADDR;
+
+ size = imx_v2_sdram_size((void *)MX25_ESDCTL_BASE_ADDR, 0);
+ if (size == SZ_256M)
+ size += imx_v2_sdram_size((void *)MX25_ESDCTL_BASE_ADDR, 1);
+
+ barebox_arm_entry(base, size, boarddata);
+}
+
+void __naked __noreturn imx27_barebox_entry(uint32_t boarddata)
+{
+ unsigned long base;
+ unsigned long size;
+
+ base = MX27_CSD0_BASE_ADDR;
+
+ size = imx_v2_sdram_size((void *)MX27_ESDCTL_BASE_ADDR, 0);
+ if (size == SZ_256M)
+ size += imx_v2_sdram_size((void *)MX27_ESDCTL_BASE_ADDR, 1);
+
+ barebox_arm_entry(base, size, boarddata);
+}
+
+void __naked __noreturn imx31_barebox_entry(uint32_t boarddata)
+{
+ unsigned long base;
+ unsigned long size;
+
+ base = MX31_CSD0_BASE_ADDR;
+
+ size = imx_v2_sdram_size((void *)MX31_ESDCTL_BASE_ADDR, 0);
+ if (size == SZ_256M)
+ size += imx_v2_sdram_size((void *)MX31_ESDCTL_BASE_ADDR, 1);
+
+ barebox_arm_entry(base, size, boarddata);
+}
+
+void __naked __noreturn imx35_barebox_entry(uint32_t boarddata)
+{
+ unsigned long base;
+ unsigned long size;
+
+ base = MX35_CSD0_BASE_ADDR;
+
+ size = imx_v2_sdram_size((void *)MX35_ESDCTL_BASE_ADDR, 0);
+ if (size == SZ_256M)
+ size += imx_v2_sdram_size((void *)MX35_ESDCTL_BASE_ADDR, 1);
+
+ barebox_arm_entry(base, size, boarddata);
+}
+
+void __naked __noreturn imx51_barebox_entry(uint32_t boarddata)
+{
+ unsigned long base;
+ unsigned long size;
+
+ base = MX51_CSD0_BASE_ADDR;
+
+ size = imx_v3_sdram_size((void *)MX51_ESDCTL_BASE_ADDR, 0);
+ if (size == SZ_256M)
+ size += imx_v3_sdram_size((void *)MX51_ESDCTL_BASE_ADDR, 1);
+
+ barebox_arm_entry(base, size, boarddata);
+}
+
+void __naked __noreturn imx53_barebox_entry(uint32_t boarddata)
+{
+ unsigned long base;
+ unsigned long size;
+
+ base = MX53_CSD0_BASE_ADDR;
+
+ size = imx_v4_sdram_size((void *)MX53_ESDCTL_BASE_ADDR, 0);
+ if (size == SZ_1G)
+ size += imx_v4_sdram_size((void *)MX53_ESDCTL_BASE_ADDR, 1);
+
+ barebox_arm_entry(base, size, boarddata);
+}
diff --git a/arch/arm/mach-imx/include/mach/esdctl.h b/arch/arm/mach-imx/include/mach/esdctl.h
index 1a265c8..26436d9 100644
--- a/arch/arm/mach-imx/include/mach/esdctl.h
+++ b/arch/arm/mach-imx/include/mach/esdctl.h
@@ -127,4 +127,15 @@
//#define ESDCFGx_tRC_14 0x0000000e // 15 seems to not exist
#define ESDCFGx_tRC_16 0x0000000f
+#ifndef __ASSEMBLY__
+void __naked __noreturn imx1_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx25_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx27_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx31_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx35_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx51_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx53_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx6_barebox_entry(uint32_t boarddata);
+#endif
+
#endif /* __MACH_ESDCTL_V2_H */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 05/34] ARM i.MX: prepare external nand boot for SoC specific entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (3 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 04/34] ARM i.MX: Add i.MX specific entry point for barebox Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 06/34] ARM i.MX boards: switch to barebox_arm_entry Sascha Hauer
` (28 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
i.MX will get SoC specific entry points for barebox. To find the
correct one we have to call these from the SoC specific
imx*_barebox_boot_nand_external functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/external-nand-boot.c | 73 +++++++++++++++++++++--------
arch/arm/mach-imx/include/mach/imx-nand.h | 1 -
2 files changed, 53 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index 39ffb94..c97fec9 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -259,14 +259,19 @@ void __bare_init imx_nand_load_image(void *dest, int size)
}
/*
- * We are now running at the address we are linked at. Now load the image from
- * NAND to SDRAM and continue booting.
+ * This function assumes the currently running binary has been
+ * copied from its current position to an offset. It returns
+ * to the calling function - offset.
+ * NOTE: The calling function may not return itself since it still
+ * works on the old content of the lr register. Only call this
+ * from a __noreturn function.
*/
-static void __bare_init __naked insdram(void)
+static __bare_init __naked void jump_sdram(unsigned long offset)
{
- imx_nand_load_image((void *)_text, barebox_image_size);
-
- board_init_lowlevel_return();
+ __asm__ __volatile__ (
+ "sub lr, lr, %0;"
+ "mov pc, lr;" : : "r"(offset)
+ );
}
/*
@@ -274,7 +279,7 @@ static void __bare_init __naked insdram(void)
* running inside the NFC address space. If not, barebox is started from the
* currently running address without loading anything from NAND.
*/
-void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_base)
+void __bare_init imx_barebox_boot_nand_external(unsigned long nfc_base)
{
u32 r;
u32 *src, *trg;
@@ -283,7 +288,7 @@ void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_bas
/* skip NAND boot if not running from NFC space */
r = get_pc();
if (r < nfc_base || r > nfc_base + 0x800)
- board_init_lowlevel_return();
+ return;
src = (unsigned int *)nfc_base;
trg = (unsigned int *)_text;
@@ -291,13 +296,6 @@ void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_bas
/* Move ourselves out of NFC SRAM */
for (i = 0; i < 0x800 / sizeof(int); i++)
*trg++ = *src++;
-
- /* Jump to SDRAM */
- r = (unsigned int)&insdram;
- __asm__ __volatile__("mov pc, %0" : : "r"(r));
-
- /* not reached */
- while (1);
}
/*
@@ -306,30 +304,65 @@ void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_bas
* NAND. In this case the booting is continued without loading an image from
* NAND. This function needs a stack to be set up.
*/
+#ifdef CONFIG_ARCH_IMX21
void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
{
- imx_barebox_boot_nand_external(MX21_NFC_BASE_ADDR);
+ unsigned long nfc_base = MX21_NFC_BASE_ADDR;
+
+ imx_barebox_boot_nand_external(nfc_base);
+ jump_sdram(nfc_base - (unsigned long)_text);
+ imx_nand_load_image((void *)_text, barebox_image_size);
+ board_init_lowlevel_return();
}
+#endif
+#ifdef CONFIG_ARCH_IMX25
void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
{
- imx_barebox_boot_nand_external(MX25_NFC_BASE_ADDR);
+ unsigned long nfc_base = MX25_NFC_BASE_ADDR;
+
+ imx_barebox_boot_nand_external(nfc_base);
+ jump_sdram(nfc_base - (unsigned long)_text);
+ imx_nand_load_image((void *)_text, barebox_image_size);
+ board_init_lowlevel_return();
}
+#endif
+#ifdef CONFIG_ARCH_IMX27
void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
{
- imx_barebox_boot_nand_external(MX27_NFC_BASE_ADDR);
+ unsigned long nfc_base = MX27_NFC_BASE_ADDR;
+
+ imx_barebox_boot_nand_external(nfc_base);
+ jump_sdram(nfc_base - (unsigned long)_text);
+ imx_nand_load_image((void *)_text, barebox_image_size);
+ board_init_lowlevel_return();
}
+#endif
+#ifdef CONFIG_ARCH_IMX31
void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
{
- imx_barebox_boot_nand_external(MX31_NFC_BASE_ADDR);
+ unsigned long nfc_base = MX31_NFC_BASE_ADDR;
+
+ imx_barebox_boot_nand_external(nfc_base);
+ jump_sdram(nfc_base - (unsigned long)_text);
+ imx_nand_load_image((void *)_text, barebox_image_size);
+ board_init_lowlevel_return();
}
+#endif
+#ifdef CONFIG_ARCH_IMX35
void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
{
- imx_barebox_boot_nand_external(MX35_NFC_BASE_ADDR);
+ unsigned long nfc_base = MX35_NFC_BASE_ADDR;
+
+ imx_barebox_boot_nand_external(nfc_base);
+ jump_sdram(nfc_base - (unsigned long)_text);
+ imx_nand_load_image((void *)_text, barebox_image_size);
+ board_init_lowlevel_return();
}
+#endif
#define CONFIG_NAND_IMX_BOOT_DEBUG
#ifdef CONFIG_NAND_IMX_BOOT_DEBUG
diff --git a/arch/arm/mach-imx/include/mach/imx-nand.h b/arch/arm/mach-imx/include/mach/imx-nand.h
index a1f209e..8352d79 100644
--- a/arch/arm/mach-imx/include/mach/imx-nand.h
+++ b/arch/arm/mach-imx/include/mach/imx-nand.h
@@ -3,7 +3,6 @@
#include <linux/mtd/mtd.h>
-void imx_nand_load_image(void *dest, int size);
void imx21_barebox_boot_nand_external(void);
void imx25_barebox_boot_nand_external(void);
void imx27_barebox_boot_nand_external(void);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 06/34] ARM i.MX boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (4 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 05/34] ARM i.MX: prepare external nand boot for SoC specific entry Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 07/34] ARM MXS " Sascha Hauer
` (27 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Most i.MX boards can use the imx*_barebox_entry functions. The remaining
(i.MX21, i.MX6) use hardcoded base addresses.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/ccxmx51/Makefile | 2 ++
arch/arm/boards/ccxmx51/lowlevel.c | 9 +++++++++
arch/arm/boards/efika-mx-smartbook/Makefile | 2 ++
arch/arm/boards/efika-mx-smartbook/lowlevel.c | 9 +++++++++
arch/arm/boards/eukrea_cpuimx25/lowlevel.c | 6 +++---
arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S | 4 ++--
arch/arm/boards/eukrea_cpuimx35/lowlevel.c | 6 +++---
arch/arm/boards/eukrea_cpuimx51/Makefile | 2 ++
arch/arm/boards/eukrea_cpuimx51/lowlevel.c | 9 +++++++++
.../arm/boards/freescale-mx25-3-stack/lowlevel_init.S | 4 ++--
arch/arm/boards/freescale-mx35-3-stack/3stack.c | 1 +
.../arm/boards/freescale-mx35-3-stack/lowlevel_init.S | 4 ++--
arch/arm/boards/freescale-mx51-pdk/Makefile | 2 ++
arch/arm/boards/freescale-mx51-pdk/lowlevel.c | 9 +++++++++
arch/arm/boards/freescale-mx53-loco/Makefile | 2 ++
arch/arm/boards/freescale-mx53-loco/lowlevel.c | 9 +++++++++
arch/arm/boards/freescale-mx53-smd/Makefile | 2 ++
arch/arm/boards/freescale-mx53-smd/lowlevel.c | 9 +++++++++
arch/arm/boards/freescale-mx6-arm2/Makefile | 2 ++
arch/arm/boards/freescale-mx6-arm2/lowlevel.c | 10 ++++++++++
arch/arm/boards/freescale-mx6-sabrelite/Makefile | 2 ++
arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c | 10 ++++++++++
arch/arm/boards/guf-cupid/lowlevel.c | 6 +++---
arch/arm/boards/guf-neso/lowlevel.c | 6 +++---
arch/arm/boards/guf-vincell/lowlevel.c | 5 +++--
arch/arm/boards/imx21ads/imx21ads.c | 3 ++-
arch/arm/boards/imx21ads/lowlevel_init.S | 8 ++++++--
arch/arm/boards/imx27ads/lowlevel_init.S | 4 ++--
arch/arm/boards/karo-tx25/lowlevel.c | 7 ++++---
arch/arm/boards/karo-tx51/Makefile | 2 ++
arch/arm/boards/karo-tx51/lowlevel.c | 9 +++++++++
arch/arm/boards/karo-tx53/lowlevel.c | 6 ++----
arch/arm/boards/pcm037/lowlevel.c | 4 ++--
arch/arm/boards/pcm038/lowlevel.c | 6 ++++--
arch/arm/boards/pcm043/lowlevel.c | 6 +++---
arch/arm/boards/phycard-i.MX27/lowlevel_init.S | 4 ++--
arch/arm/boards/scb9328/lowlevel_init.S | 4 ++--
arch/arm/boards/tqma53/Makefile | 2 ++
arch/arm/boards/tqma53/lowlevel.c | 9 +++++++++
arch/arm/mach-imx/Kconfig | 17 -----------------
arch/arm/mach-imx/Makefile | 5 ++++-
arch/arm/mach-imx/external-nand-boot.c | 11 ++++++-----
43 files changed, 175 insertions(+), 66 deletions(-)
create mode 100644 arch/arm/boards/ccxmx51/lowlevel.c
create mode 100644 arch/arm/boards/efika-mx-smartbook/lowlevel.c
create mode 100644 arch/arm/boards/eukrea_cpuimx51/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx51-pdk/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx53-loco/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx53-smd/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx6-arm2/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
create mode 100644 arch/arm/boards/karo-tx51/lowlevel.c
create mode 100644 arch/arm/boards/tqma53/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6f7a71f..cac3360 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -58,6 +58,8 @@ config ARCH_IMX
select CLKDEV_LOOKUP
select WATCHDOG_IMX_RESET_SOURCE
select HAS_DEBUG_LL
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_MXS
bool "Freescale i.MX23/28 (mxs) based"
diff --git a/arch/arm/boards/ccxmx51/Makefile b/arch/arm/boards/ccxmx51/Makefile
index f9eb2db..d392533 100644
--- a/arch/arm/boards/ccxmx51/Makefile
+++ b/arch/arm/boards/ccxmx51/Makefile
@@ -1,3 +1,5 @@
obj-y += flash_header.o ccxmx51.o
pbl-y += flash_header.o
obj-$(CONFIG_MACH_CCMX51_BASEBOARD) += ccxmx51js.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/ccxmx51/lowlevel.c b/arch/arm/boards/ccxmx51/lowlevel.c
new file mode 100644
index 0000000..282024e
--- /dev/null
+++ b/arch/arm/boards/ccxmx51/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx51_barebox_entry(0);
+}
diff --git a/arch/arm/boards/efika-mx-smartbook/Makefile b/arch/arm/boards/efika-mx-smartbook/Makefile
index d08bb68..6ca1c06 100644
--- a/arch/arm/boards/efika-mx-smartbook/Makefile
+++ b/arch/arm/boards/efika-mx-smartbook/Makefile
@@ -1,3 +1,5 @@
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
obj-y += board.o
obj-y += flash_header.o
pbl-y += flash_header.o
diff --git a/arch/arm/boards/efika-mx-smartbook/lowlevel.c b/arch/arm/boards/efika-mx-smartbook/lowlevel.c
new file mode 100644
index 0000000..282024e
--- /dev/null
+++ b/arch/arm/boards/efika-mx-smartbook/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx51_barebox_entry(0);
+}
diff --git a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
index 3c1b50c..6afdd17 100644
--- a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
@@ -107,7 +107,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0x80000000 && r < 0x90000000)
- board_init_lowlevel_return();
+ goto out;
/* Init Mobile DDR */
writel(0x0000000E, MX25_ESDCTL_BASE_ADDR + IMX_ESDMISC);
@@ -132,7 +132,7 @@ void __bare_init __naked reset(void)
arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
imx25_barebox_boot_nand_external();
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx25_barebox_entry(0);
}
diff --git a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
index 287b513..c37d271 100644
--- a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
+++ b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
@@ -119,7 +119,7 @@ reset:
cmp pc, #0xc0000000
bhi 1f
- b board_init_lowlevel_return
+ b imx27_barebox_entry
1:
sdram_init
@@ -131,4 +131,4 @@ reset:
#endif /* CONFIG_NAND_IMX_BOOT */
ret:
- b board_init_lowlevel_return
+ b imx27_barebox_entry
diff --git a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
index c43f7fe..0533c1d 100644
--- a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
@@ -110,7 +110,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0x80000000 && r < 0x90000000)
- board_init_lowlevel_return();
+ goto out;
/* Init Mobile DDR */
writel(0x0000000E, MX35_ESDCTL_BASE_ADDR + IMX_ESDMISC);
@@ -141,7 +141,7 @@ void __bare_init __naked reset(void)
arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx35_barebox_boot_nand_external();
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx35_barebox_entry(0);
}
diff --git a/arch/arm/boards/eukrea_cpuimx51/Makefile b/arch/arm/boards/eukrea_cpuimx51/Makefile
index ce81ffa..1a23797 100644
--- a/arch/arm/boards/eukrea_cpuimx51/Makefile
+++ b/arch/arm/boards/eukrea_cpuimx51/Makefile
@@ -1,3 +1,5 @@
obj-y += eukrea_cpuimx51.o
obj-y += flash_header.o
pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/eukrea_cpuimx51/lowlevel.c b/arch/arm/boards/eukrea_cpuimx51/lowlevel.c
new file mode 100644
index 0000000..282024e
--- /dev/null
+++ b/arch/arm/boards/eukrea_cpuimx51/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx51_barebox_entry(0);
+}
diff --git a/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S b/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S
index 2e49e6e..a55508e 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S
+++ b/arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S
@@ -77,7 +77,7 @@ reset:
cmp pc, #0x90000000
bhi 1f
- b board_init_lowlevel_return
+ b imx25_barebox_entry
1:
ldr r0, ESDCTL_BASE_W
@@ -105,7 +105,7 @@ reset:
#endif /* CONFIG_NAND_IMX_BOOT */
ret:
- b board_init_lowlevel_return
+ b imx25_barebox_entry
/*
* r0: control base, r1: ram bank base
diff --git a/arch/arm/boards/freescale-mx35-3-stack/3stack.c b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
index 02844c5..e1cb73c 100644
--- a/arch/arm/boards/freescale-mx35-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
@@ -30,6 +30,7 @@
#include <init.h>
#include <nand.h>
#include <net.h>
+#include <sizes.h>
#include <partition.h>
#include <asm/armlinux.h>
diff --git a/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S b/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S
index c63c953..7b0a32b 100644
--- a/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S
+++ b/arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S
@@ -126,7 +126,7 @@ reset:
cmp pc, #CSD1_BASE_ADDR
bhi 1f
- b board_init_lowlevel_return
+ b imx35_barebox_entry
1:
ldr r0, =ESDCTL_BASE_ADDR
@@ -161,7 +161,7 @@ reset:
b imx35_barebox_boot_nand_external
#endif /* CONFIG_NAND_IMX_BOOT */
- b board_init_lowlevel_return
+ b imx35_barebox_entry
/*
* r0: ESDCTL control base, r1: sdram slot base
diff --git a/arch/arm/boards/freescale-mx51-pdk/Makefile b/arch/arm/boards/freescale-mx51-pdk/Makefile
index d08bb68..2f45976 100644
--- a/arch/arm/boards/freescale-mx51-pdk/Makefile
+++ b/arch/arm/boards/freescale-mx51-pdk/Makefile
@@ -1,3 +1,5 @@
obj-y += board.o
obj-y += flash_header.o
pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/freescale-mx51-pdk/lowlevel.c b/arch/arm/boards/freescale-mx51-pdk/lowlevel.c
new file mode 100644
index 0000000..282024e
--- /dev/null
+++ b/arch/arm/boards/freescale-mx51-pdk/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx51_barebox_entry(0);
+}
diff --git a/arch/arm/boards/freescale-mx53-loco/Makefile b/arch/arm/boards/freescale-mx53-loco/Makefile
index d08bb68..2f45976 100644
--- a/arch/arm/boards/freescale-mx53-loco/Makefile
+++ b/arch/arm/boards/freescale-mx53-loco/Makefile
@@ -1,3 +1,5 @@
obj-y += board.o
obj-y += flash_header.o
pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/freescale-mx53-loco/lowlevel.c b/arch/arm/boards/freescale-mx53-loco/lowlevel.c
new file mode 100644
index 0000000..c6f79ca
--- /dev/null
+++ b/arch/arm/boards/freescale-mx53-loco/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx53_barebox_entry(0);
+}
diff --git a/arch/arm/boards/freescale-mx53-smd/Makefile b/arch/arm/boards/freescale-mx53-smd/Makefile
index d08bb68..2f45976 100644
--- a/arch/arm/boards/freescale-mx53-smd/Makefile
+++ b/arch/arm/boards/freescale-mx53-smd/Makefile
@@ -1,3 +1,5 @@
obj-y += board.o
obj-y += flash_header.o
pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/freescale-mx53-smd/lowlevel.c b/arch/arm/boards/freescale-mx53-smd/lowlevel.c
new file mode 100644
index 0000000..c6f79ca
--- /dev/null
+++ b/arch/arm/boards/freescale-mx53-smd/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx53_barebox_entry(0);
+}
diff --git a/arch/arm/boards/freescale-mx6-arm2/Makefile b/arch/arm/boards/freescale-mx6-arm2/Makefile
index 11199d2..21fb7d9 100644
--- a/arch/arm/boards/freescale-mx6-arm2/Makefile
+++ b/arch/arm/boards/freescale-mx6-arm2/Makefile
@@ -1,2 +1,4 @@
obj-y += board.o flash_header.o
pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/freescale-mx6-arm2/lowlevel.c b/arch/arm/boards/freescale-mx6-arm2/lowlevel.c
new file mode 100644
index 0000000..810b890
--- /dev/null
+++ b/arch/arm/boards/freescale-mx6-arm2/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(0x10000000, SZ_2G, 0);
+}
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/Makefile b/arch/arm/boards/freescale-mx6-sabrelite/Makefile
index 11199d2..21fb7d9 100644
--- a/arch/arm/boards/freescale-mx6-sabrelite/Makefile
+++ b/arch/arm/boards/freescale-mx6-sabrelite/Makefile
@@ -1,2 +1,4 @@
obj-y += board.o flash_header.o
pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c b/arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
new file mode 100644
index 0000000..8f995ee
--- /dev/null
+++ b/arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(0x10000000, SZ_1G, 0);
+}
diff --git a/arch/arm/boards/guf-cupid/lowlevel.c b/arch/arm/boards/guf-cupid/lowlevel.c
index c141b54..9620abd 100644
--- a/arch/arm/boards/guf-cupid/lowlevel.c
+++ b/arch/arm/boards/guf-cupid/lowlevel.c
@@ -234,7 +234,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r0 = get_pc();
if (r0 > 0x80000000 && r0 < 0x90000000)
- board_init_lowlevel_return();
+ goto out;
/* Configure drive strength */
@@ -317,7 +317,7 @@ void __bare_init __naked reset(void)
arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx35_barebox_boot_nand_external();
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx35_barebox_entry(0);
}
diff --git a/arch/arm/boards/guf-neso/lowlevel.c b/arch/arm/boards/guf-neso/lowlevel.c
index ca44607..ebb8d56 100644
--- a/arch/arm/boards/guf-neso/lowlevel.c
+++ b/arch/arm/boards/guf-neso/lowlevel.c
@@ -48,7 +48,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0xa0000000 && r < 0xb0000000)
- board_init_lowlevel_return();
+ goto out;
/*
* DDR on CSD0
@@ -91,7 +91,7 @@ void __bare_init __naked reset(void)
arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
imx27_barebox_boot_nand_external();
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx27_barebox_entry(0);
}
diff --git a/arch/arm/boards/guf-vincell/lowlevel.c b/arch/arm/boards/guf-vincell/lowlevel.c
index 8003c67..1243b9a 100644
--- a/arch/arm/boards/guf-vincell/lowlevel.c
+++ b/arch/arm/boards/guf-vincell/lowlevel.c
@@ -5,6 +5,7 @@
#include <mach/imx5.h>
#include <mach/iomux-v3.h>
#include <mach/esdctl-v4.h>
+#include <mach/esdctl.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <io.h>
@@ -131,7 +132,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0x70000000 && r < 0xf0000000)
- board_init_lowlevel_return();
+ imx51_barebox_entry(0);
/* Setup a preliminary stack */
r = 0xf8000000 + 0x60000 - 16;
@@ -145,5 +146,5 @@ void __bare_init __naked reset(void)
imx_esdctlv4_init();
- board_init_lowlevel_return();
+ imx51_barebox_entry(0);
}
diff --git a/arch/arm/boards/imx21ads/imx21ads.c b/arch/arm/boards/imx21ads/imx21ads.c
index 3d07633..6087ad4 100644
--- a/arch/arm/boards/imx21ads/imx21ads.c
+++ b/arch/arm/boards/imx21ads/imx21ads.c
@@ -30,6 +30,7 @@
#include <mach/weim.h>
#include <partition.h>
#include <fs.h>
+#include <sizes.h>
#include <fcntl.h>
#include <generated/mach-types.h>
#include <mach/imx-nand.h>
@@ -107,7 +108,7 @@ core_initcall(imx21ads_timing_init);
static int mx21ads_mem_init(void)
{
- arm_add_mem_device("ram0", 0xc0000000, 64 * 1024 * 1024);
+ arm_add_mem_device("ram0", 0xc0000000, SZ_64M);
return 0;
}
diff --git a/arch/arm/boards/imx21ads/lowlevel_init.S b/arch/arm/boards/imx21ads/lowlevel_init.S
index 5be4995..5c6d3f7 100644
--- a/arch/arm/boards/imx21ads/lowlevel_init.S
+++ b/arch/arm/boards/imx21ads/lowlevel_init.S
@@ -14,6 +14,7 @@
*/
#include <config.h>
+#include <sizes.h>
#include <asm-generic/memory_layout.h>
#include <mach/imx21-regs.h>
#include <asm/barebox-arm-head.h>
@@ -75,7 +76,7 @@ reset:
cmp pc, #0xc8000000
bhi 1f
- b board_init_lowlevel_return
+ b ret
1:
/* Precharge */
@@ -125,7 +126,10 @@ reset:
#endif /* CONFIG_NAND_IMX_BOOT */
ret:
- b board_init_lowlevel_return
+ mov r0, #0xc0000000
+ mov r1, #SZ_64M
+ mov r2, #0
+ b barebox_arm_entry
/*
* spin for a while. we need to wait at least 200 usecs.
diff --git a/arch/arm/boards/imx27ads/lowlevel_init.S b/arch/arm/boards/imx27ads/lowlevel_init.S
index 2dc34b5..8939f6a 100644
--- a/arch/arm/boards/imx27ads/lowlevel_init.S
+++ b/arch/arm/boards/imx27ads/lowlevel_init.S
@@ -167,9 +167,9 @@ reset:
cmp pc, #0xc0000000
bhi 1f
- b board_init_lowlevel_return
+ b imx27_barebox_entry
1:
sdram_init_sha
- b board_init_lowlevel_return
+ b imx27_barebox_entry
diff --git a/arch/arm/boards/karo-tx25/lowlevel.c b/arch/arm/boards/karo-tx25/lowlevel.c
index 9e96e39..45fa17f 100644
--- a/arch/arm/boards/karo-tx25/lowlevel.c
+++ b/arch/arm/boards/karo-tx25/lowlevel.c
@@ -23,6 +23,7 @@
#include <io.h>
#include <sizes.h>
#include <mach/imx-nand.h>
+#include <mach/esdctl.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <asm/system.h>
@@ -115,7 +116,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0x80000000 && r < 0xa0000000)
- board_init_lowlevel_return();
+ goto out;
/* set to 3.3v SDRAM */
writel(0x800, MX25_IOMUXC_BASE_ADDR + 0x454);
@@ -138,7 +139,7 @@ void __bare_init __naked reset(void)
arm_setup_stack(MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 8);
imx25_barebox_boot_nand_external();
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx25_barebox_entry(0);
}
diff --git a/arch/arm/boards/karo-tx51/Makefile b/arch/arm/boards/karo-tx51/Makefile
index 6f51586..00f2b05 100644
--- a/arch/arm/boards/karo-tx51/Makefile
+++ b/arch/arm/boards/karo-tx51/Makefile
@@ -1,3 +1,5 @@
obj-y += tx51.o
obj-$(CONFIG_ARCH_IMX_INTERNAL_BOOT) += flash_header.o
pbl-$(CONFIG_ARCH_IMX_INTERNAL_BOOT) += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/karo-tx51/lowlevel.c b/arch/arm/boards/karo-tx51/lowlevel.c
new file mode 100644
index 0000000..282024e
--- /dev/null
+++ b/arch/arm/boards/karo-tx51/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx51_barebox_entry(0);
+}
diff --git a/arch/arm/boards/karo-tx53/lowlevel.c b/arch/arm/boards/karo-tx53/lowlevel.c
index 0ca164b..fe9dac1 100644
--- a/arch/arm/boards/karo-tx53/lowlevel.c
+++ b/arch/arm/boards/karo-tx53/lowlevel.c
@@ -2,8 +2,7 @@
#include <asm/barebox-arm-head.h>
#include <asm/barebox-arm.h>
#include <mach/imx5.h>
-
-#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
+#include <mach/esdctl.h>
void __naked reset(void)
{
@@ -17,6 +16,5 @@ void __naked reset(void)
if (IS_ENABLED(CONFIG_TX53_REV_XX30))
imx53_init_lowlevel(800);
- board_init_lowlevel_return();
+ imx53_barebox_entry(0);
}
-#endif
diff --git a/arch/arm/boards/pcm037/lowlevel.c b/arch/arm/boards/pcm037/lowlevel.c
index b531615..176c968 100644
--- a/arch/arm/boards/pcm037/lowlevel.c
+++ b/arch/arm/boards/pcm037/lowlevel.c
@@ -84,7 +84,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0x80000000 && r < 0xa0000000)
- board_init_lowlevel_return();
+ imx31_barebox_entry(0);
#if defined CONFIG_PCM037_SDRAM_BANK0_128MB
#define ROWS0 ESDCTL0_ROW13
@@ -131,6 +131,6 @@ void __bare_init __naked reset(void)
imx31_barebox_boot_nand_external();
#else
- board_init_lowlevel_return();
+ imx31_barebox_entry(0);
#endif
}
diff --git a/arch/arm/boards/pcm038/lowlevel.c b/arch/arm/boards/pcm038/lowlevel.c
index aecdbf3..c00b3b4 100644
--- a/arch/arm/boards/pcm038/lowlevel.c
+++ b/arch/arm/boards/pcm038/lowlevel.c
@@ -49,7 +49,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0xa0000000 && r < 0xb0000000)
- board_init_lowlevel_return();
+ goto out;
/* re-program the PLL prior(!) starting the SDRAM controller */
writel(MPCTL0_VAL, MX27_CCM_BASE_ADDR + MX27_MPCTL0);
@@ -99,6 +99,8 @@ void __bare_init __naked reset(void)
imx27_barebox_boot_nand_external();
#else
- board_init_lowlevel_return();
+ imx27_barebox_entry(0);
#endif
+out:
+ imx27_barebox_entry(0);
}
diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c
index a9832e2..d19d5b5 100644
--- a/arch/arm/boards/pcm043/lowlevel.c
+++ b/arch/arm/boards/pcm043/lowlevel.c
@@ -117,7 +117,7 @@ void __bare_init __naked reset(void)
/* Skip SDRAM initialization if we run from RAM */
r = get_pc();
if (r > 0x80000000 && r < 0x90000000)
- board_init_lowlevel_return();
+ goto out;
/* Set DDR Type to SDRAM, drive strength workaround *
* 0x00000000 MDDR *
@@ -193,7 +193,7 @@ void __bare_init __naked reset(void)
arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx35_barebox_boot_nand_external();
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx35_barebox_entry(0);
}
diff --git a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
index cb5d83d..d81066e 100644
--- a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
+++ b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
@@ -82,7 +82,7 @@ reset:
cmp pc, #0xc0000000
bhi 1f
- b board_init_lowlevel_return
+ b imx27_barebox_entry
1:
/* 399 MHz */
@@ -115,5 +115,5 @@ reset:
#endif /* CONFIG_NAND_IMX_BOOT */
ret:
- b board_init_lowlevel_return
+ b imx27_barebox_entry
diff --git a/arch/arm/boards/scb9328/lowlevel_init.S b/arch/arm/boards/scb9328/lowlevel_init.S
index cefac84..f8197bd 100644
--- a/arch/arm/boards/scb9328/lowlevel_init.S
+++ b/arch/arm/boards/scb9328/lowlevel_init.S
@@ -151,7 +151,7 @@ reset:
cmp pc, #0x09000000
bhi 1f
- b board_init_lowlevel_return
+ b imx1_barebox_entry
1:
@@ -181,4 +181,4 @@ reset:
/* Set to Normal Mode CAS 2 */
writel(0x810a8200, MX1_SDRAMC_BASE_ADDR + MX1_SDCTL0)
- b board_init_lowlevel_return
+ b imx1_barebox_entry
diff --git a/arch/arm/boards/tqma53/Makefile b/arch/arm/boards/tqma53/Makefile
index d08bb68..2f45976 100644
--- a/arch/arm/boards/tqma53/Makefile
+++ b/arch/arm/boards/tqma53/Makefile
@@ -1,3 +1,5 @@
obj-y += board.o
obj-y += flash_header.o
pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/tqma53/lowlevel.c b/arch/arm/boards/tqma53/lowlevel.c
new file mode 100644
index 0000000..c6f79ca
--- /dev/null
+++ b/arch/arm/boards/tqma53/lowlevel.c
@@ -0,0 +1,9 @@
+#include <common.h>
+#include <mach/esdctl.h>
+#include <asm/barebox-arm-head.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ imx53_barebox_entry(0);
+}
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 3cb35a0..4115d35 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -206,7 +206,6 @@ choice
config MACH_SCB9328
bool "Synertronixx scb9328"
select HAS_DM9000
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Synertronixx scb9328 board
@@ -223,7 +222,6 @@ choice
config MACH_IMX21ADS
bool "Freescale i.MX21ADS"
- select MACH_HAS_LOWLEVEL_INIT
select HAS_CS8900
help
Say Y here if you are using the Freescale i.MX21ads board equipped
@@ -242,14 +240,12 @@ choice
config MACH_EUKREA_CPUIMX25
bool "Eukrea CPUIMX25"
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Eukrea Electromatique's CPUIMX25
equipped with a Freescale i.MX25 Processor
config MACH_FREESCALE_MX25_3STACK
bool "Freescale MX25 3stack"
- select MACH_HAS_LOWLEVEL_INIT
select I2C
select I2C_MC34704
help
@@ -258,7 +254,6 @@ config MACH_FREESCALE_MX25_3STACK
config MACH_TX25
bool "Ka-Ro TX25"
- select MACH_HAS_LOWLEVEL_INIT
select HAVE_DEFAULT_ENVIRONMENT_NEW
help
Say Y here if you are using the Ka-Ro tx25 board
@@ -276,28 +271,24 @@ choice
config MACH_EUKREA_CPUIMX27
bool "EUKREA CPUIMX27"
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using Eukrea's CPUIMX27 equipped
with a Freescale i.MX27 Processor
config MACH_IMX27ADS
bool "Freescale i.MX27ADS"
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Freescale i.MX27ads board equipped
with a Freescale i.MX27 Processor
config MACH_PCA100
bool "phyCard-i.MX27"
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using Phytec's phyCard-i.MX27 (pca100) equipped
with a Freescale i.MX27 Processor
config MACH_PCM038
bool "phyCORE-i.MX27"
- select MACH_HAS_LOWLEVEL_INIT
select SPI
select DRIVER_SPI_IMX
select MFD_MC13XXX
@@ -316,7 +307,6 @@ config MACH_PCM970_BASEBOARD
config MACH_NESO
bool "Garz+Fricke Neso"
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Garz+Fricke Neso board equipped
with a Freescale i.MX27 Processor
@@ -334,7 +324,6 @@ choice
config MACH_PCM037
bool "phyCORE-i.MX31"
- select MACH_HAS_LOWLEVEL_INIT
select USB_ULPI if USB
select HAVE_DEFAULT_ENVIRONMENT_NEW
select ARCH_HAS_L2X0
@@ -355,7 +344,6 @@ choice
config MACH_EUKREA_CPUIMX35
bool "EUKREA CPUIMX35"
- select MACH_HAS_LOWLEVEL_INIT
select ARCH_HAS_L2X0
help
Say Y here if you are using Eukrea's CPUIMX35 equipped
@@ -363,7 +351,6 @@ config MACH_EUKREA_CPUIMX35
config MACH_FREESCALE_MX35_3STACK
bool "Freescale MX35 3stack"
- select MACH_HAS_LOWLEVEL_INIT
select I2C
select I2C_IMX
select MFD_MC13XXX
@@ -374,7 +361,6 @@ config MACH_FREESCALE_MX35_3STACK
config MACH_PCM043
bool "phyCORE-i.MX35"
- select MACH_HAS_LOWLEVEL_INIT
select ARCH_HAS_L2X0
help
Say Y here if you are using Phytec's phyCORE-i.MX35 (pcm043) equipped
@@ -382,7 +368,6 @@ config MACH_PCM043
config MACH_GUF_CUPID
bool "Garz+Fricke Cupid"
- select MACH_HAS_LOWLEVEL_INIT
select ARCH_HAS_L2X0
help
Say Y here if you are using the Garz+Fricke Neso board equipped
@@ -469,13 +454,11 @@ config MACH_TQMA53_1GB_RAM
config MACH_TX53
bool "Ka-Ro TX53"
select HAVE_DEFAULT_ENVIRONMENT_NEW
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Ka-Ro tx53 board
config MACH_GUF_VINCELL
select HAVE_DEFAULT_ENVIRONMENT_NEW
- select MACH_HAS_LOWLEVEL_INIT
bool "Garz-Fricke Vincell"
endchoice
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 104ab21..1c28035 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -11,8 +11,11 @@ pbl-$(CONFIG_ARCH_IMX53) += imx53.o imx5.o esdctl-v4.o
obj-$(CONFIG_ARCH_IMX6) += imx6.o iomux-v3.o usb-imx6.o clk-imx6.o
obj-$(CONFIG_IMX_IIM) += iim.o
obj-$(CONFIG_NAND_IMX) += nand.o
-obj-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
+ifdef CONFIG_PBL_IMAGE
pbl-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
+else
+obj-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
+endif
obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-pfd.o
obj-y += devices.o imx.o esdctl.o
obj-y += boot.o
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index c97fec9..2c353d7 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -18,6 +18,7 @@
#include <asm/sections.h>
#include <asm/barebox-arm.h>
#include <mach/imx-nand.h>
+#include <mach/esdctl.h>
#include <mach/generic.h>
#include <mach/imx21-regs.h>
#include <mach/imx25-regs.h>
@@ -312,7 +313,7 @@ void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
imx_barebox_boot_nand_external(nfc_base);
jump_sdram(nfc_base - (unsigned long)_text);
imx_nand_load_image((void *)_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx21_barebox_entry(0);
}
#endif
@@ -324,7 +325,7 @@ void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
imx_barebox_boot_nand_external(nfc_base);
jump_sdram(nfc_base - (unsigned long)_text);
imx_nand_load_image((void *)_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx25_barebox_entry(0);
}
#endif
@@ -336,7 +337,7 @@ void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
imx_barebox_boot_nand_external(nfc_base);
jump_sdram(nfc_base - (unsigned long)_text);
imx_nand_load_image((void *)_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx27_barebox_entry(0);
}
#endif
@@ -348,7 +349,7 @@ void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
imx_barebox_boot_nand_external(nfc_base);
jump_sdram(nfc_base - (unsigned long)_text);
imx_nand_load_image((void *)_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx31_barebox_entry(0);
}
#endif
@@ -360,7 +361,7 @@ void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
imx_barebox_boot_nand_external(nfc_base);
jump_sdram(nfc_base - (unsigned long)_text);
imx_nand_load_image((void *)_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx35_barebox_entry(0);
}
#endif
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 07/34] ARM MXS boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (5 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 06/34] ARM i.MX boards: switch to barebox_arm_entry Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 08/34] ARM OMAP " Sascha Hauer
` (26 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
All boards use hardcoded SDRAM addresses, copied from the board init file.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/chumby_falconwing/Makefile | 2 ++
arch/arm/boards/chumby_falconwing/lowlevel.c | 11 +++++++++++
arch/arm/boards/crystalfontz-cfa10036/Makefile | 2 ++
arch/arm/boards/crystalfontz-cfa10036/lowlevel.c | 11 +++++++++++
arch/arm/boards/freescale-mx23-evk/Makefile | 2 ++
arch/arm/boards/freescale-mx23-evk/lowlevel.c | 11 +++++++++++
arch/arm/boards/freescale-mx28-evk/Makefile | 2 ++
arch/arm/boards/freescale-mx28-evk/lowlevel.c | 11 +++++++++++
arch/arm/boards/imx233-olinuxino/Makefile | 2 ++
arch/arm/boards/imx233-olinuxino/lowlevel.c | 11 +++++++++++
arch/arm/boards/karo-tx28/Makefile | 2 ++
arch/arm/boards/karo-tx28/lowlevel.c | 11 +++++++++++
13 files changed, 80 insertions(+)
create mode 100644 arch/arm/boards/chumby_falconwing/lowlevel.c
create mode 100644 arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx23-evk/lowlevel.c
create mode 100644 arch/arm/boards/freescale-mx28-evk/lowlevel.c
create mode 100644 arch/arm/boards/imx233-olinuxino/lowlevel.c
create mode 100644 arch/arm/boards/karo-tx28/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index cac3360..627c1b5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -64,6 +64,8 @@ config ARCH_IMX
config ARCH_MXS
bool "Freescale i.MX23/28 (mxs) based"
select GENERIC_GPIO
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_NETX
bool "Hilscher NetX based"
diff --git a/arch/arm/boards/chumby_falconwing/Makefile b/arch/arm/boards/chumby_falconwing/Makefile
index 0bc79d9..360b55c 100644
--- a/arch/arm/boards/chumby_falconwing/Makefile
+++ b/arch/arm/boards/chumby_falconwing/Makefile
@@ -1 +1,3 @@
obj-y = falconwing.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/chumby_falconwing/lowlevel.c b/arch/arm/boards/chumby_falconwing/lowlevel.c
new file mode 100644
index 0000000..df28ad4
--- /dev/null
+++ b/arch/arm/boards/chumby_falconwing/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx23-regs.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(IMX_MEMORY_BASE, SZ_64M, 0);
+}
diff --git a/arch/arm/boards/crystalfontz-cfa10036/Makefile b/arch/arm/boards/crystalfontz-cfa10036/Makefile
index 7e8d5e2..0b701ed 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/Makefile
+++ b/arch/arm/boards/crystalfontz-cfa10036/Makefile
@@ -1 +1,3 @@
obj-y += cfa10036.o hwdetect.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/crystalfontz-cfa10036/lowlevel.c b/arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
new file mode 100644
index 0000000..467194f
--- /dev/null
+++ b/arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx28-regs.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(IMX_MEMORY_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/freescale-mx23-evk/Makefile b/arch/arm/boards/freescale-mx23-evk/Makefile
index cffb561..9386603 100644
--- a/arch/arm/boards/freescale-mx23-evk/Makefile
+++ b/arch/arm/boards/freescale-mx23-evk/Makefile
@@ -1,2 +1,4 @@
#
obj-y := mx23-evk.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/freescale-mx23-evk/lowlevel.c b/arch/arm/boards/freescale-mx23-evk/lowlevel.c
new file mode 100644
index 0000000..0c7e665
--- /dev/null
+++ b/arch/arm/boards/freescale-mx23-evk/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx23-regs.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(IMX_MEMORY_BASE, SZ_32M, 0);
+}
diff --git a/arch/arm/boards/freescale-mx28-evk/Makefile b/arch/arm/boards/freescale-mx28-evk/Makefile
index 3e1f53b..2039610 100644
--- a/arch/arm/boards/freescale-mx28-evk/Makefile
+++ b/arch/arm/boards/freescale-mx28-evk/Makefile
@@ -1 +1,3 @@
obj-y += mx28-evk.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/freescale-mx28-evk/lowlevel.c b/arch/arm/boards/freescale-mx28-evk/lowlevel.c
new file mode 100644
index 0000000..467194f
--- /dev/null
+++ b/arch/arm/boards/freescale-mx28-evk/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx28-regs.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(IMX_MEMORY_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/imx233-olinuxino/Makefile b/arch/arm/boards/imx233-olinuxino/Makefile
index 6d71450..b8d9223 100644
--- a/arch/arm/boards/imx233-olinuxino/Makefile
+++ b/arch/arm/boards/imx233-olinuxino/Makefile
@@ -1 +1,3 @@
obj-y = imx23-olinuxino.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/imx233-olinuxino/lowlevel.c b/arch/arm/boards/imx233-olinuxino/lowlevel.c
new file mode 100644
index 0000000..df28ad4
--- /dev/null
+++ b/arch/arm/boards/imx233-olinuxino/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx23-regs.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(IMX_MEMORY_BASE, SZ_64M, 0);
+}
diff --git a/arch/arm/boards/karo-tx28/Makefile b/arch/arm/boards/karo-tx28/Makefile
index d80ba17..c90bf36 100644
--- a/arch/arm/boards/karo-tx28/Makefile
+++ b/arch/arm/boards/karo-tx28/Makefile
@@ -1,2 +1,4 @@
obj-y += tx28.o
obj-$(CONFIG_MACH_TX28STK5) += tx28-stk5.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/karo-tx28/lowlevel.c b/arch/arm/boards/karo-tx28/lowlevel.c
new file mode 100644
index 0000000..467194f
--- /dev/null
+++ b/arch/arm/boards/karo-tx28/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx28-regs.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(IMX_MEMORY_BASE, SZ_128M, 0);
+}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 08/34] ARM OMAP boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (6 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 07/34] ARM MXS " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 09/34] ARM Samsung " Sascha Hauer
` (25 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
All boards use hardcoded SDRAM addresses, copied from the board init file.
OMAP3 boards are a bit special, they had a SoC specific reset() function. This
is renamed to omap3_invalidate_dcache() and called from the board lowlevel init
code now.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/archosg9/Makefile | 4 ++--
arch/arm/boards/archosg9/lowlevel.c | 3 ++-
arch/arm/boards/beagle/Makefile | 2 ++
arch/arm/boards/beagle/lowlevel.c | 14 ++++++++++++++
arch/arm/boards/beaglebone/Makefile | 2 ++
arch/arm/boards/beaglebone/lowlevel.c | 11 +++++++++++
arch/arm/boards/omap343xdsp/Makefile | 2 ++
arch/arm/boards/omap343xdsp/lowlevel.c | 14 ++++++++++++++
arch/arm/boards/omap3evm/Makefile | 2 ++
arch/arm/boards/omap3evm/lowlevel.c | 10 ++++++++++
arch/arm/boards/panda/lowlevel.c | 7 ++++---
arch/arm/boards/pcm049/lowlevel.c | 7 ++++---
arch/arm/boards/pcm051/Makefile | 2 ++
arch/arm/boards/pcm051/lowlevel.c | 11 +++++++++++
arch/arm/boards/phycard-a-l1/Makefile | 2 ++
arch/arm/boards/phycard-a-l1/lowlevel.c | 11 +++++++++++
arch/arm/boards/phycard-a-xl2/lowlevel.c | 7 ++++---
arch/arm/mach-omap/Kconfig | 5 -----
arch/arm/mach-omap/include/mach/omap3-silicon.h | 1 +
arch/arm/mach-omap/omap3_core.S | 11 ++++-------
21 files changed, 106 insertions(+), 24 deletions(-)
create mode 100644 arch/arm/boards/beagle/lowlevel.c
create mode 100644 arch/arm/boards/beaglebone/lowlevel.c
create mode 100644 arch/arm/boards/omap343xdsp/lowlevel.c
create mode 100644 arch/arm/boards/omap3evm/lowlevel.c
create mode 100644 arch/arm/boards/pcm051/lowlevel.c
create mode 100644 arch/arm/boards/phycard-a-l1/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 627c1b5..96ee516 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -82,6 +82,8 @@ config ARCH_OMAP
bool "TI OMAP"
select HAS_DEBUG_LL
select GPIOLIB
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_PXA
bool "Intel/Marvell PXA based"
diff --git a/arch/arm/boards/archosg9/Makefile b/arch/arm/boards/archosg9/Makefile
index 450c03f..4cc5a2e 100644
--- a/arch/arm/boards/archosg9/Makefile
+++ b/arch/arm/boards/archosg9/Makefile
@@ -1,4 +1,4 @@
obj-y += board.o
obj-$(CONFIG_ARM_BOARD_APPEND_ATAG) += archos_features.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel.o mux.o
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel.o mux.o
+obj-y += lowlevel.o mux.o
+pbl-y += lowlevel.o mux.o
diff --git a/arch/arm/boards/archosg9/lowlevel.c b/arch/arm/boards/archosg9/lowlevel.c
index aea6342..26808f6 100644
--- a/arch/arm/boards/archosg9/lowlevel.c
+++ b/arch/arm/boards/archosg9/lowlevel.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <io.h>
#include <init.h>
+#include <sizes.h>
#include <mach/omap4-mux.h>
#include <mach/omap4-silicon.h>
#include <mach/omap4-clock.h>
@@ -63,7 +64,7 @@ static noinline void archosg9_init_lowlevel(void)
omap4_ddr_init(&ddr_regs_400_mhz_2cs, &core);
- board_init_lowlevel_return();
+ barebox_arm_entry(0x80000000, SZ_1G, 0);
}
void __naked __bare_init reset(void)
diff --git a/arch/arm/boards/beagle/Makefile b/arch/arm/boards/beagle/Makefile
index dcfc293..88c223a 100644
--- a/arch/arm/boards/beagle/Makefile
+++ b/arch/arm/boards/beagle/Makefile
@@ -1 +1,3 @@
obj-y += board.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/beagle/lowlevel.c b/arch/arm/boards/beagle/lowlevel.c
new file mode 100644
index 0000000..50a6680
--- /dev/null
+++ b/arch/arm/boards/beagle/lowlevel.c
@@ -0,0 +1,14 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/omap3-silicon.h>
+
+void __naked reset(void)
+{
+ omap3_invalidate_dcache();
+
+ common_reset();
+
+ barebox_arm_entry(0x80000000, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/beaglebone/Makefile b/arch/arm/boards/beaglebone/Makefile
index dcfc293..8a571d9 100644
--- a/arch/arm/boards/beaglebone/Makefile
+++ b/arch/arm/boards/beaglebone/Makefile
@@ -1 +1,3 @@
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
obj-y += board.o
diff --git a/arch/arm/boards/beaglebone/lowlevel.c b/arch/arm/boards/beaglebone/lowlevel.c
new file mode 100644
index 0000000..5c55d4e
--- /dev/null
+++ b/arch/arm/boards/beaglebone/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+
+ barebox_arm_entry(0x80000000, SZ_256M, 0);
+}
diff --git a/arch/arm/boards/omap343xdsp/Makefile b/arch/arm/boards/omap343xdsp/Makefile
index dcfc293..88c223a 100644
--- a/arch/arm/boards/omap343xdsp/Makefile
+++ b/arch/arm/boards/omap343xdsp/Makefile
@@ -1 +1,3 @@
obj-y += board.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/omap343xdsp/lowlevel.c b/arch/arm/boards/omap343xdsp/lowlevel.c
new file mode 100644
index 0000000..50a6680
--- /dev/null
+++ b/arch/arm/boards/omap343xdsp/lowlevel.c
@@ -0,0 +1,14 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/omap3-silicon.h>
+
+void __naked reset(void)
+{
+ omap3_invalidate_dcache();
+
+ common_reset();
+
+ barebox_arm_entry(0x80000000, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/omap3evm/Makefile b/arch/arm/boards/omap3evm/Makefile
index dcfc293..88c223a 100644
--- a/arch/arm/boards/omap3evm/Makefile
+++ b/arch/arm/boards/omap3evm/Makefile
@@ -1 +1,3 @@
obj-y += board.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/omap3evm/lowlevel.c b/arch/arm/boards/omap3evm/lowlevel.c
new file mode 100644
index 0000000..ede3829
--- /dev/null
+++ b/arch/arm/boards/omap3evm/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(0x80000000, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/panda/lowlevel.c b/arch/arm/boards/panda/lowlevel.c
index 36e2bc5..df0f9c1 100644
--- a/arch/arm/boards/panda/lowlevel.c
+++ b/arch/arm/boards/panda/lowlevel.c
@@ -18,6 +18,7 @@
*/
#include <common.h>
#include <io.h>
+#include <sizes.h>
#include <mach/omap4-mux.h>
#include <mach/omap4-silicon.h>
#include <mach/omap4-clock.h>
@@ -70,8 +71,6 @@ static void noinline panda_init_lowlevel(void)
/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
omap4_scale_vcores(TPS62361_VSEL0_GPIO);
-
- board_init_lowlevel_return();
}
void reset(void)
@@ -79,9 +78,11 @@ void reset(void)
common_reset();
if (get_pc() > 0x80000000)
- board_init_lowlevel_return();
+ goto out;
arm_setup_stack(0x4030d000);
panda_init_lowlevel();
+out:
+ barebox_arm_entry(0x80000000, SZ_1G, 0);
}
diff --git a/arch/arm/boards/pcm049/lowlevel.c b/arch/arm/boards/pcm049/lowlevel.c
index b64244c..8ecf81a 100644
--- a/arch/arm/boards/pcm049/lowlevel.c
+++ b/arch/arm/boards/pcm049/lowlevel.c
@@ -18,6 +18,7 @@
*/
#include <common.h>
#include <io.h>
+#include <sizes.h>
#include <mach/omap4-mux.h>
#include <mach/omap4-silicon.h>
#include <mach/omap4-clock.h>
@@ -80,8 +81,6 @@ static void noinline pcm049_init_lowlevel(void)
sr32(0x4A30a31C, 16, 4, 0x0); /* set divisor to 1 */
sr32(0x4A30a110, 0, 1, 0x1); /* set the clock source to active */
sr32(0x4A30a110, 2, 2, 0x3); /* enable clocks */
-
- board_init_lowlevel_return();
}
void reset(void)
@@ -89,9 +88,11 @@ void reset(void)
common_reset();
if (get_pc() > 0x80000000)
- board_init_lowlevel_return();
+ goto out;
arm_setup_stack(0x4030d000);
pcm049_init_lowlevel();
+out:
+ barebox_arm_entry(0x80000000, SZ_512M, 0);
}
diff --git a/arch/arm/boards/pcm051/Makefile b/arch/arm/boards/pcm051/Makefile
index dcfc293..8a571d9 100644
--- a/arch/arm/boards/pcm051/Makefile
+++ b/arch/arm/boards/pcm051/Makefile
@@ -1 +1,3 @@
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
obj-y += board.o
diff --git a/arch/arm/boards/pcm051/lowlevel.c b/arch/arm/boards/pcm051/lowlevel.c
new file mode 100644
index 0000000..683fdce
--- /dev/null
+++ b/arch/arm/boards/pcm051/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+
+ barebox_arm_entry(0x80000000, SZ_512M, 0);
+}
diff --git a/arch/arm/boards/phycard-a-l1/Makefile b/arch/arm/boards/phycard-a-l1/Makefile
index 7041e11..5565c3d 100644
--- a/arch/arm/boards/phycard-a-l1/Makefile
+++ b/arch/arm/boards/phycard-a-l1/Makefile
@@ -15,3 +15,5 @@
#
obj-y += pca-a-l1.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/phycard-a-l1/lowlevel.c b/arch/arm/boards/phycard-a-l1/lowlevel.c
new file mode 100644
index 0000000..5c55d4e
--- /dev/null
+++ b/arch/arm/boards/phycard-a-l1/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+
+ barebox_arm_entry(0x80000000, SZ_256M, 0);
+}
diff --git a/arch/arm/boards/phycard-a-xl2/lowlevel.c b/arch/arm/boards/phycard-a-xl2/lowlevel.c
index 5d8693a..f8f4db5 100644
--- a/arch/arm/boards/phycard-a-xl2/lowlevel.c
+++ b/arch/arm/boards/phycard-a-xl2/lowlevel.c
@@ -18,6 +18,7 @@
*/
#include <common.h>
#include <io.h>
+#include <sizes.h>
#include <mach/omap4-mux.h>
#include <mach/omap4-silicon.h>
#include <mach/omap4-clock.h>
@@ -80,8 +81,6 @@ static noinline void pcaaxl2_init_lowlevel(void)
sr32(0x4A30a31C, 16, 4, 0x0); /* set divisor to 1 */
sr32(0x4A30a110, 0, 1, 0x1); /* set the clock source to active */
sr32(0x4A30a110, 2, 2, 0x3); /* enable clocks */
-
- board_init_lowlevel_return();
}
void reset(void)
@@ -89,9 +88,11 @@ void reset(void)
common_reset();
if (get_pc() > 0x80000000)
- board_init_lowlevel_return();
+ goto out;
arm_setup_stack(0x4030d000);
pcaaxl2_init_lowlevel();
+out:
+ barebox_arm_entry(0x80000000, SZ_512M, 0);
}
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index f659184..a87fc4b 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -29,7 +29,6 @@ config ARCH_OMAP3
bool "OMAP3"
select CPU_V7
select GENERIC_GPIO
- select MACH_HAS_LOWLEVEL_INIT
select OMAP_CLOCK_SOURCE_S32K
help
Say Y here if you are using Texas Instrument's OMAP343x based platform
@@ -148,7 +147,6 @@ config MACH_OMAP3EVM
config MACH_PANDA
bool "Texas Instrument's Panda Board"
- select MACH_HAS_LOWLEVEL_INIT
select HAVE_DEFAULT_ENVIRONMENT_NEW
depends on ARCH_OMAP4
help
@@ -156,7 +154,6 @@ config MACH_PANDA
config MACH_ARCHOSG9
bool "Archos G9 tablets"
- select MACH_HAS_LOWLEVEL_INIT
depends on ARCH_OMAP4
help
Say Y here if you are using OMAP4-based Archos G9 tablet
@@ -164,7 +161,6 @@ config MACH_ARCHOSG9
config MACH_PCM049
bool "Phytec phyCORE pcm049"
depends on ARCH_OMAP4
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using Phytecs phyCORE pcm049 board
based on OMAP4
@@ -177,7 +173,6 @@ config MACH_PCAAL1
config MACH_PCAAXL2
bool "Phytec phyCARD XL2"
- select MACH_HAS_LOWLEVEL_INIT
depends on ARCH_OMAP4
help
Say Y here if you are using a phyCARD-A-XL1 PCA-A-XL1
diff --git a/arch/arm/mach-omap/include/mach/omap3-silicon.h b/arch/arm/mach-omap/include/mach/omap3-silicon.h
index 282b587..43b2953 100644
--- a/arch/arm/mach-omap/include/mach/omap3-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap3-silicon.h
@@ -133,6 +133,7 @@
/* If Architecture specific init functions are present */
#ifndef __ASSEMBLY__
void omap3_core_init(void);
+void omap3_invalidate_dcache(void);
#endif /* __ASSEMBLY__ */
#endif /* __ASM_ARCH_OMAP3_H */
diff --git a/arch/arm/mach-omap/omap3_core.S b/arch/arm/mach-omap/omap3_core.S
index bc32f55..a47e248 100644
--- a/arch/arm/mach-omap/omap3_core.S
+++ b/arch/arm/mach-omap/omap3_core.S
@@ -33,9 +33,8 @@
#include <mach/clocks.h>
#include <asm/barebox-arm-head.h>
-#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
-.section .text.__reset
-ENTRY(reset)
+.section .text.__omap3_invalidate_dcache
+ENTRY(omap3_invalidate_dcache)
/* Invalidate all Dcaches */
#ifndef CONFIG_CPU_V7_DCACHE_SKIP
/* If Arch specific ROM code SMI handling does not exist */
@@ -83,8 +82,6 @@ finished_inval:
mcr p15, 2, r10, c0, c0, 0 /* select current cache level in cssr */
isb
#endif /* CONFIG_CPU_V7_DCACHE_SKIP */
- common_reset r0
/* back to arch calling code */
- b board_init_lowlevel_return
-ENDPROC(reset)
-#endif
+ bx lr
+ENDPROC(omap3_invalidate_dcache)
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 09/34] ARM Samsung boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (7 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 08/34] ARM OMAP " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 10/34] ARM PXA " Sascha Hauer
` (24 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
All Samsung boards automatically detect their SDRAM size. The size detection
code can't be called safely from lowlevel C code, so instead the minimum SDRAM
size is guessed from the defconfig files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 6 ++++++
arch/arm/boards/a9m2410/lowlevel_init.S | 9 +++++++--
arch/arm/boards/a9m2440/lowlevel_init.S | 9 +++++++--
arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S | 9 +++++++--
arch/arm/boards/friendlyarm-mini6410/Makefile | 2 ++
arch/arm/boards/friendlyarm-mini6410/lowlevel.c | 11 +++++++++++
arch/arm/boards/friendlyarm-tiny210/lowlevel.c | 4 +++-
arch/arm/boards/friendlyarm-tiny6410/Makefile | 3 ++-
arch/arm/boards/friendlyarm-tiny6410/lowlevel.c | 11 +++++++++++
arch/arm/mach-samsung/Kconfig | 6 ------
10 files changed, 56 insertions(+), 14 deletions(-)
create mode 100644 arch/arm/boards/friendlyarm-mini6410/lowlevel.c
create mode 100644 arch/arm/boards/friendlyarm-tiny6410/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 96ee516..1e509a4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -94,18 +94,24 @@ config ARCH_S3C24xx
select ARCH_SAMSUNG
select CPU_ARM920T
select GENERIC_GPIO
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_S5PCxx
bool "Samsung S5PC110, S5PV210"
select ARCH_SAMSUNG
select CPU_V7
select GENERIC_GPIO
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_S3C64xx
bool "Samsung S3C64xx"
select ARCH_SAMSUNG
select CPU_V6
select GENERIC_GPIO
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_VERSATILE
bool "ARM Versatile boards (ARM926EJ-S)"
diff --git a/arch/arm/boards/a9m2410/lowlevel_init.S b/arch/arm/boards/a9m2410/lowlevel_init.S
index 502ecdd..178e73a 100644
--- a/arch/arm/boards/a9m2410/lowlevel_init.S
+++ b/arch/arm/boards/a9m2410/lowlevel_init.S
@@ -3,6 +3,7 @@
*/
#include <config.h>
+#include <sizes.h>
#include <mach/s3c-iomap.h>
#include <asm/barebox-arm-head.h>
@@ -21,7 +22,7 @@ reset:
cmp pc, #S3C_SDRAM_END
bhs 1f
- b board_init_lowlevel_return
+ b out
/* we are running from NOR or NAND/SRAM memory. Do further initialisation */
1:
@@ -33,4 +34,8 @@ reset:
/* up to here we are running from the internal SRAM area */
bl s3c24x0_nand_boot
#endif
- b board_init_lowlevel_return
+out:
+ mov r0, #S3C_SDRAM_BASE
+ mov r1, #SZ_32M
+ mov r2, #0
+ b barebox_arm_entry
diff --git a/arch/arm/boards/a9m2440/lowlevel_init.S b/arch/arm/boards/a9m2440/lowlevel_init.S
index 8f6cfcb..bd51717 100644
--- a/arch/arm/boards/a9m2440/lowlevel_init.S
+++ b/arch/arm/boards/a9m2440/lowlevel_init.S
@@ -3,6 +3,7 @@
*/
#include <config.h>
+#include <sizes.h>
#include <mach/s3c-iomap.h>
#include <mach/s3c24xx-gpio.h>
#include <asm/barebox-arm-head.h>
@@ -225,7 +226,7 @@ reset:
cmp pc, #S3C_SDRAM_END
bhs 1f
- b board_init_lowlevel_return
+ b out
/* we are running from NOR or NAND/SRAM memory. Do further initialisation */
1:
@@ -237,4 +238,8 @@ reset:
/* up to here we are running from the internal SRAM area */
bl s3c24x0_nand_boot
#endif
- b board_init_lowlevel_return
+out:
+ mov r0, #S3C_SDRAM_BASE
+ mov r1, #SZ_32M
+ mov r2, #0
+ b barebox_arm_entry
diff --git a/arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S b/arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S
index 5c06b1c..a6e06ed 100644
--- a/arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S
+++ b/arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S
@@ -3,6 +3,7 @@
*/
#include <config.h>
+#include <sizes.h>
#include <mach/s3c-iomap.h>
#include <asm/barebox-arm-head.h>
@@ -22,7 +23,7 @@ reset:
cmp pc, #S3C_SDRAM_END
bhs 1f
- b board_init_lowlevel_return
+ b out
/* we are running from NOR or NAND/SRAM memory. Do further initialisation */
1:
@@ -34,4 +35,8 @@ reset:
/* up to here we are running from the internal SRAM area */
bl s3c24x0_nand_boot
#endif
- b board_init_lowlevel_return
+out:
+ mov r0, #S3C_SDRAM_BASE
+ mov r1, #SZ_32M
+ mov r2, #0
+ b barebox_arm_entry
diff --git a/arch/arm/boards/friendlyarm-mini6410/Makefile b/arch/arm/boards/friendlyarm-mini6410/Makefile
index cd7a427..d5fa853 100644
--- a/arch/arm/boards/friendlyarm-mini6410/Makefile
+++ b/arch/arm/boards/friendlyarm-mini6410/Makefile
@@ -1 +1,3 @@
obj-y += mini6410.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/friendlyarm-mini6410/lowlevel.c b/arch/arm/boards/friendlyarm-mini6410/lowlevel.c
new file mode 100644
index 0000000..61ed757
--- /dev/null
+++ b/arch/arm/boards/friendlyarm-mini6410/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/s3c-iomap.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(S3C_SDRAM_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
index 695f97d..5d9582e 100644
--- a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
+++ b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <init.h>
#include <io.h>
+#include <sizes.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <asm/sections.h>
@@ -61,7 +62,8 @@ void __bare_init reset(void)
#endif
if (get_pc() < 0xD0000000) /* Are we running from iRAM? */
- board_init_lowlevel_return(); /* No, we don't. */
+ /* No, we don't. */
+ barebox_arm_entry(S3C_SDRAM_BASE, SZ_64M, 0);
s5p_init_dram_bank_ddr2(S5P_DMC0_BASE, 0x20E00323, 0, 0);
diff --git a/arch/arm/boards/friendlyarm-tiny6410/Makefile b/arch/arm/boards/friendlyarm-tiny6410/Makefile
index b3ab12e..eb0e0ed 100644
--- a/arch/arm/boards/friendlyarm-tiny6410/Makefile
+++ b/arch/arm/boards/friendlyarm-tiny6410/Makefile
@@ -1,3 +1,4 @@
obj-y += tiny6410.o
-
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
obj-$(CONFIG_MACH_TINY6410_FA) += development-board.o
diff --git a/arch/arm/boards/friendlyarm-tiny6410/lowlevel.c b/arch/arm/boards/friendlyarm-tiny6410/lowlevel.c
new file mode 100644
index 0000000..61ed757
--- /dev/null
+++ b/arch/arm/boards/friendlyarm-tiny6410/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/s3c-iomap.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(S3C_SDRAM_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/mach-samsung/Kconfig b/arch/arm/mach-samsung/Kconfig
index 80575cb..a4dc301 100644
--- a/arch/arm/mach-samsung/Kconfig
+++ b/arch/arm/mach-samsung/Kconfig
@@ -40,7 +40,6 @@ choice
config MACH_A9M2410
bool "Digi A9M2410"
select CPU_S3C2410
- select MACH_HAS_LOWLEVEL_INIT
select S3C_PLL_INIT
select S3C_SDRAM_INIT
help
@@ -50,7 +49,6 @@ config MACH_A9M2410
config MACH_A9M2440
bool "Digi A9M2440"
select CPU_S3C2440
- select MACH_HAS_LOWLEVEL_INIT
select S3C_PLL_INIT
help
Say Y here if you are using Digi's Connect Core 9M equipped
@@ -59,8 +57,6 @@ config MACH_A9M2440
config MACH_MINI2440
bool "Mini 2440"
select CPU_S3C2440
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
select S3C_PLL_INIT
select S3C_SDRAM_INIT
select HAS_DM9000
@@ -138,8 +134,6 @@ choice
config MACH_TINY210
bool "Tiny 210"
select CPU_S5PV210
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
select S3C_SDRAM_INIT
endchoice
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 10/34] ARM PXA boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (8 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 09/34] ARM Samsung " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 11/34] ARM ep93xx " Sascha Hauer
` (23 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
All boards use hardcoded base addresses.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/mioa701/Makefile | 2 ++
arch/arm/boards/mioa701/lowlevel.c | 10 ++++++++++
arch/arm/boards/pcm027/lowlevel_init.S | 7 +++++--
4 files changed, 19 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boards/mioa701/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1e509a4..dd8f01e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -88,6 +88,8 @@ config ARCH_OMAP
config ARCH_PXA
bool "Intel/Marvell PXA based"
select GENERIC_GPIO
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_S3C24xx
bool "Samsung S3C2410, S3C2440"
diff --git a/arch/arm/boards/mioa701/Makefile b/arch/arm/boards/mioa701/Makefile
index dcfc293..88c223a 100644
--- a/arch/arm/boards/mioa701/Makefile
+++ b/arch/arm/boards/mioa701/Makefile
@@ -1 +1,3 @@
obj-y += board.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/mioa701/lowlevel.c b/arch/arm/boards/mioa701/lowlevel.c
new file mode 100644
index 0000000..6d48c97
--- /dev/null
+++ b/arch/arm/boards/mioa701/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(0xa0000000, SZ_64M, 0);
+}
diff --git a/arch/arm/boards/pcm027/lowlevel_init.S b/arch/arm/boards/pcm027/lowlevel_init.S
index cf5fcd9..b90682c 100644
--- a/arch/arm/boards/pcm027/lowlevel_init.S
+++ b/arch/arm/boards/pcm027/lowlevel_init.S
@@ -24,6 +24,7 @@
*/
#include <config.h>
+#include <sizes.h>
#include <mach/pxa-regs.h>
#include <mach/regs-ost.h>
#include <mach/regs-intc.h>
@@ -452,5 +453,7 @@ initclks:
/* -------------------------------------------------------------------- */
endlowlevel_init:
- b board_init_lowlevel_return
-
+ mov r0, #0xa0000000
+ mov r1, #SZ_64M
+ mov r2, #0
+ b barebox_arm_entry
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 11/34] ARM ep93xx boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (9 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 10/34] ARM PXA " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 12/34] ARM tegra " Sascha Hauer
` (22 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
This architecture is a bit strange. It has up to four SDRAM banks, but
all have a quite limited size. The SDRAM size for the different boards
currently is unknown as it's configurable with Kconfig. We use a SDRAM
size based on the value of the only board we have in the defconfigs:
edb9301. This likely breaks other ep93xx boards.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/edb93xx/sdram_cfg.c | 4 ++++
arch/arm/mach-ep93xx/Kconfig | 8 --------
arch/arm/mach-ep93xx/Makefile | 4 ++--
arch/arm/mach-ep93xx/lowlevel_init.S | 11 ++++++++++-
5 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dd8f01e..7b0e59a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -49,6 +49,8 @@ config ARCH_EP93XX
bool "Cirrus Logic EP93xx"
select CPU_ARM920T
select GENERIC_GPIO
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_IMX
bool "Freescale iMX-based"
diff --git a/arch/arm/boards/edb93xx/sdram_cfg.c b/arch/arm/boards/edb93xx/sdram_cfg.c
index 9442129..5c2a537 100644
--- a/arch/arm/boards/edb93xx/sdram_cfg.c
+++ b/arch/arm/boards/edb93xx/sdram_cfg.c
@@ -36,6 +36,10 @@ static void program_mode_registers(void);
void sdram_cfg(void)
{
struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE;
+ unsigned long pc = get_pc();
+
+ if (pc < CONFIG_EP93XX_SDRAM_BANK3_BASE + CONFIG_EP93XX_SDRAM_BANK3_SIZE)
+ return;
writel(SDRAM_DEVCFG_VAL, &sdram->SDRAM_DEVCFG_REG);
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index ed6e986..90859d5 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -38,7 +38,6 @@ choice
config MACH_EDB9301
bool "Cirrus Logic EDB9301"
select EP93XX_SDCE3_SYNC_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9301 Evaluation board
@@ -103,14 +102,12 @@ choice
config MACH_EDB9302
bool "Cirrus Logic EDB9302"
select EP93XX_SDCE3_SYNC_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9302 Evaluation board
config MACH_EDB9302A
bool "Cirrus Logic EDB9302A"
select EP93XX_SDCE0_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9302A Evaluation board
@@ -222,14 +219,12 @@ choice
config MACH_EDB9307
bool "Cirrus Logic EDB9307"
select EP93XX_SDCE3_SYNC_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9307 Evaluation board
config MACH_EDB9307A
bool "Cirrus Logic EDB9307A"
select EP93XX_SDCE0_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9307A Evaluation board
@@ -309,7 +304,6 @@ choice
config MACH_EDB9312
bool "Cirrus Logic EDB9312"
select EP93XX_SDCE3_SYNC_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9312 Evaluation board
@@ -358,14 +352,12 @@ choice
config MACH_EDB9315
bool "Cirrus Logic EDB9315"
select EP93XX_SDCE3_SYNC_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9315 Evaluation board
config MACH_EDB9315A
bool "Cirrus Logic EDB9315A"
select EP93XX_SDCE0_PHYS_OFFSET
- select MACH_HAS_LOWLEVEL_INIT
help
Say y here if you are using Cirrus Logic's EDB9315A Evaluation board
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index 5615394..0ff0b66 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -1,4 +1,4 @@
obj-y += clocksource.o gpio.o led.o header.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o led.o
+obj-y += lowlevel_init.o
+pbl-y += lowlevel_init.o led.o
diff --git a/arch/arm/mach-ep93xx/lowlevel_init.S b/arch/arm/mach-ep93xx/lowlevel_init.S
index 6de53dd..154d38d 100644
--- a/arch/arm/mach-ep93xx/lowlevel_init.S
+++ b/arch/arm/mach-ep93xx/lowlevel_init.S
@@ -20,6 +20,7 @@
*
*/
+#include <sizes.h>
#include <mach/ep93xx-regs.h>
#include <asm/barebox-arm-head.h>
@@ -52,4 +53,12 @@ reset:
orr r0, r0, #0xc0000000
mcr p15, 0, r0, c1, c0, 0
- b board_init_lowlevel_return
+ /*
+ * FIXME: This is suitable for the edb9301, the
+ * only ep93xx board we have in our defconfigs.
+ * Other boards need different values here.
+ */
+ mov r0, #0x05000000
+ mov r1, #SZ_8M
+ mov r2, #0
+ b barebox_arm_entry
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 12/34] ARM tegra boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (10 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 11/34] ARM ep93xx " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 13/34] ARM nomadik " Sascha Hauer
` (21 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Only one board, Toshiba AC100. This uses hardcoded SDRAM values.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/toshiba-ac100/Makefile | 2 ++
arch/arm/boards/toshiba-ac100/lowlevel.c | 10 ++++++++++
3 files changed, 14 insertions(+)
create mode 100644 arch/arm/boards/toshiba-ac100/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7b0e59a..5f5b965 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -126,6 +126,8 @@ config ARCH_TEGRA
bool "Nvidia Tegra-based boards"
select CPU_ARM926T
select HAS_DEBUG_LL
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
endchoice
diff --git a/arch/arm/boards/toshiba-ac100/Makefile b/arch/arm/boards/toshiba-ac100/Makefile
index 9e14763..5b74351 100644
--- a/arch/arm/boards/toshiba-ac100/Makefile
+++ b/arch/arm/boards/toshiba-ac100/Makefile
@@ -1,2 +1,4 @@
obj-y += board.o
obj-$(CONFIG_DRIVER_SERIAL_NS16550) += serial.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/toshiba-ac100/lowlevel.c b/arch/arm/boards/toshiba-ac100/lowlevel.c
new file mode 100644
index 0000000..68706a5
--- /dev/null
+++ b/arch/arm/boards/toshiba-ac100/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(0x0, SZ_512M, 0);
+}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 13/34] ARM nomadik boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (11 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 12/34] ARM tegra " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 14/34] ARM versatile " Sascha Hauer
` (20 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Only one board, the nhk8815. This uses hardcoded SDRAM values.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/nhk8815/Makefile | 2 ++
arch/arm/boards/nhk8815/lowlevel.c | 10 ++++++++++
3 files changed, 14 insertions(+)
create mode 100644 arch/arm/boards/nhk8815/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5f5b965..dcd48a9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -77,6 +77,8 @@ config ARCH_NOMADIK
bool "STMicroelectronics Nomadik"
select CPU_ARM926T
select CLOCKSOURCE_NOMADIK
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
help
Support for the Nomadik platform by ST-Ericsson
diff --git a/arch/arm/boards/nhk8815/Makefile b/arch/arm/boards/nhk8815/Makefile
index 2b9dba4..dbb2a71 100644
--- a/arch/arm/boards/nhk8815/Makefile
+++ b/arch/arm/boards/nhk8815/Makefile
@@ -1 +1,3 @@
obj-y += setup.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/nhk8815/lowlevel.c b/arch/arm/boards/nhk8815/lowlevel.c
new file mode 100644
index 0000000..3956347
--- /dev/null
+++ b/arch/arm/boards/nhk8815/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(0x0, SZ_64M, 0);
+}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 14/34] ARM versatile boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (12 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 13/34] ARM nomadik " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 15/34] ARM netx " Sascha Hauer
` (19 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Only one board, the qemu based Versatile/PB. Uses hardcoded SDRAM settings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/versatile/Makefile | 3 ++-
arch/arm/boards/versatile/lowlevel.c | 10 ++++++++++
3 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boards/versatile/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dcd48a9..79f797e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -123,6 +123,8 @@ config ARCH_VERSATILE
bool "ARM Versatile boards (ARM926EJ-S)"
select CPU_ARM926T
select GPIOLIB
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_TEGRA
bool "Nvidia Tegra-based boards"
diff --git a/arch/arm/boards/versatile/Makefile b/arch/arm/boards/versatile/Makefile
index a17aed3..9dc6869 100644
--- a/arch/arm/boards/versatile/Makefile
+++ b/arch/arm/boards/versatile/Makefile
@@ -1,2 +1,3 @@
-
obj-$(CONFIG_MACH_VERSATILEPB) += versatilepb.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/versatile/lowlevel.c b/arch/arm/boards/versatile/lowlevel.c
new file mode 100644
index 0000000..3956347
--- /dev/null
+++ b/arch/arm/boards/versatile/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(0x0, SZ_64M, 0);
+}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 15/34] ARM netx boards: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (13 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 14/34] ARM versatile " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 16/34] ARM clep7212: " Sascha Hauer
` (18 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Only one board supported, the nxdb500. Uses hardcoded SDRAM settings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/netx/platform.S | 7 +++++--
arch/arm/mach-netx/Kconfig | 1 -
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 79f797e..3197f8b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -72,6 +72,8 @@ config ARCH_MXS
config ARCH_NETX
bool "Hilscher NetX based"
select CPU_ARM926T
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_NOMADIK
bool "STMicroelectronics Nomadik"
diff --git a/arch/arm/boards/netx/platform.S b/arch/arm/boards/netx/platform.S
index 0438921..95ac13b 100644
--- a/arch/arm/boards/netx/platform.S
+++ b/arch/arm/boards/netx/platform.S
@@ -16,10 +16,13 @@
* GNU General Public License for more details.
*
*/
-
+#include <sizes.h>
#include <asm/barebox-arm-head.h>
.globl reset
reset:
common_reset r0
- b board_init_lowlevel_return
+ mov r0, #0x80000000
+ mov r1, #SZ_64M
+ mov r2, #0
+ b barebox_arm_entry
diff --git a/arch/arm/mach-netx/Kconfig b/arch/arm/mach-netx/Kconfig
index b767e54..8d8f49b 100644
--- a/arch/arm/mach-netx/Kconfig
+++ b/arch/arm/mach-netx/Kconfig
@@ -45,7 +45,6 @@ choice
config MACH_NXDB500
bool "Hilscher Netx nxdb500"
select HAS_NETX_ETHER
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Hilscher Netx nxdb500 board
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 16/34] ARM clep7212: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (14 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 15/34] ARM netx " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 16:32 ` Alexander Shiyan
2013-01-27 10:46 ` [PATCH 17/34] ARM raspberrypi: " Sascha Hauer
` (17 subsequent siblings)
33 siblings, 1 reply; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/clep7212/lowlevel.c | 3 ++-
arch/arm/mach-clps711x/Kconfig | 2 --
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3197f8b..6ed9bf0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -44,6 +44,8 @@ config ARCH_CLPS711X
bool "Cirrus Logic EP711x/EP721x/EP731x"
select CLKDEV_LOOKUP
select CPU_32v4T
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_EP93XX
bool "Cirrus Logic EP93xx"
diff --git a/arch/arm/boards/clep7212/lowlevel.c b/arch/arm/boards/clep7212/lowlevel.c
index 9b7e241..7465a42 100644
--- a/arch/arm/boards/clep7212/lowlevel.c
+++ b/arch/arm/boards/clep7212/lowlevel.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <init.h>
+#include <sizes.h>
#include <asm/io.h>
#include <asm/barebox-arm.h>
@@ -52,5 +53,5 @@ void __naked __bare_init reset(void)
writel(SDCONF_CASLAT_3 | SDCONF_SIZE_256 | SDCONF_WIDTH_16 |
SDCONF_CLKCTL | SDCONF_ACTIVE, SDCONF);
- board_init_lowlevel_return();
+ barebox_arm_entry(SDRAM0_BASE, SZ_32M, 0);
}
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index 469ca72..f0adeda 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -5,8 +5,6 @@ choice
config MACH_CLEP7212
bool "Cirrus Logic CLEP7212"
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
help
Boards based on the Cirrus Logic 7212/7312 CPU.
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 17/34] ARM raspberrypi: switch to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (15 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 16/34] ARM clep7212: " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 18/34] ARM AT91 mmccpu: Fix non existing define Sascha Hauer
` (16 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/raspberry-pi/Makefile | 2 ++
arch/arm/boards/raspberry-pi/lowlevel.c | 11 +++++++++++
3 files changed, 15 insertions(+)
create mode 100644 arch/arm/boards/raspberry-pi/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6ed9bf0..c7daebe 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -39,6 +39,8 @@ config ARCH_BCM2835
select COMMON_CLK
select CLOCKSOURCE_BCM2835
select ARM_AMBA
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_CLPS711X
bool "Cirrus Logic EP711x/EP721x/EP731x"
diff --git a/arch/arm/boards/raspberry-pi/Makefile b/arch/arm/boards/raspberry-pi/Makefile
index 6ce5ede..825b30b 100644
--- a/arch/arm/boards/raspberry-pi/Makefile
+++ b/arch/arm/boards/raspberry-pi/Makefile
@@ -1 +1,3 @@
obj-$(CONFIG_MACH_RPI) += rpi.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/raspberry-pi/lowlevel.c b/arch/arm/boards/raspberry-pi/lowlevel.c
new file mode 100644
index 0000000..7a09eed
--- /dev/null
+++ b/arch/arm/boards/raspberry-pi/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/platform.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(BCM2835_SDRAM_BASE, SZ_128M, 0);
+}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 18/34] ARM AT91 mmccpu: Fix non existing define
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (16 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 17/34] ARM raspberrypi: " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 19/34] ARM AT91: switch to barebox_arm_entry part1 Sascha Hauer
` (15 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/mmccpu/lowlevel_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boards/mmccpu/lowlevel_init.c b/arch/arm/boards/mmccpu/lowlevel_init.c
index 68c609f..c193eae 100644
--- a/arch/arm/boards/mmccpu/lowlevel_init.c
+++ b/arch/arm/boards/mmccpu/lowlevel_init.c
@@ -83,7 +83,7 @@ void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_c
#endif
cfg->pmc_mor =
- AT91_PMC_MSCEN |
+ AT91_PMC_MOSCEN |
(255 << 8); /* Main Oscillator Start-up Time */
cfg->pmc_pllar =
AT91_PMC_PLLA_WR_ERRATA | /* Bit 29 must be 1 when prog */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 19/34] ARM AT91: switch to barebox_arm_entry part1
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (17 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 18/34] ARM AT91 mmccpu: Fix non existing define Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:51 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 10:46 ` [PATCH 20/34] ARM AT91: switch at91rm9200 board to barebox_arm_entry Sascha Hauer
` (14 subsequent siblings)
33 siblings, 1 reply; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
This switches the at91sam926x, 9g10 and 9g20 over to barebox_arm_entry.
For these SoCs we currently support reading back the memory size from
the SDRAM controller, so all of these can have a common reset() function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/at91sam9263ek/Makefile | 4 ++--
arch/arm/boards/mmccpu/Makefile | 4 ++--
arch/arm/boards/pm9261/Makefile | 4 ++--
arch/arm/boards/pm9263/Makefile | 4 ++--
arch/arm/boards/tny-a926x/Makefile | 4 ++--
arch/arm/boards/usb-a926x/Makefile | 4 ++--
arch/arm/mach-at91/Kconfig | 19 ++++++++++++++-----
arch/arm/mach-at91/Makefile | 10 +++++++---
arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 11 ++++++++++-
9 files changed, 43 insertions(+), 21 deletions(-)
diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
index b6460c3..1702783 100644
--- a/arch/arm/boards/at91sam9263ek/Makefile
+++ b/arch/arm/boards/at91sam9263ek/Makefile
@@ -1,5 +1,5 @@
obj-y += init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
diff --git a/arch/arm/boards/mmccpu/Makefile b/arch/arm/boards/mmccpu/Makefile
index b6460c3..1702783 100644
--- a/arch/arm/boards/mmccpu/Makefile
+++ b/arch/arm/boards/mmccpu/Makefile
@@ -1,5 +1,5 @@
obj-y += init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
index b6460c3..1702783 100644
--- a/arch/arm/boards/pm9261/Makefile
+++ b/arch/arm/boards/pm9261/Makefile
@@ -1,5 +1,5 @@
obj-y += init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
diff --git a/arch/arm/boards/pm9263/Makefile b/arch/arm/boards/pm9263/Makefile
index b6460c3..1702783 100644
--- a/arch/arm/boards/pm9263/Makefile
+++ b/arch/arm/boards/pm9263/Makefile
@@ -1,5 +1,5 @@
obj-y += init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
diff --git a/arch/arm/boards/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
index 36ea09f..caa7163 100644
--- a/arch/arm/boards/tny-a926x/Makefile
+++ b/arch/arm/boards/tny-a926x/Makefile
@@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
lowlevel_init-$(CONFIG_MACH_TNY_A9263) = tny_a9263_lowlevel_init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile
index e314dd5..88f163f 100644
--- a/arch/arm/boards/usb-a926x/Makefile
+++ b/arch/arm/boards/usb-a926x/Makefile
@@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
lowlevel_init-$(CONFIG_MACH_USB_A9263) = usb_a9263_lowlevel_init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 9d4359e..4f30650 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -6,6 +6,9 @@ config HAVE_AT91_DBGU0
config HAVE_AT91_DBGU1
bool
+config HAVE_AT91_LOWLEVEL_INIT
+ bool
+
config AT91SAM9_SMC
bool
@@ -77,6 +80,8 @@ config SOC_AT91SAM9260
select HAVE_AT91_DBGU0
select HAS_MACB
select AT91SAM9_RESET
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
help
Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
or AT91SAM9G20 SoC.
@@ -86,6 +91,8 @@ config SOC_AT91SAM9261
select SOC_AT91SAM9
select HAVE_AT91_DBGU0
select AT91SAM9_RESET
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
help
Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
@@ -95,6 +102,8 @@ config SOC_AT91SAM9263
select HAVE_AT91_DBGU1
select HAS_MACB
select AT91SAM9_RESET
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config SOC_AT91SAM9G45
bool
@@ -263,7 +272,7 @@ config MACH_AT91SAM9261EK
config MACH_PM9261
bool "Ronetix PM9261"
select HAS_DM9000
- select MACH_HAS_LOWLEVEL_INIT
+ select HAVE_AT91_LOWLEVEL_INIT
help
Say y here if you are using the Ronetix PM9261 Board
@@ -338,7 +347,7 @@ choice
config MACH_AT91SAM9263EK
bool "Atmel AT91SAM9263-EK"
- select MACH_HAS_LOWLEVEL_INIT
+ select HAVE_AT91_LOWLEVEL_INIT
select HAVE_NAND_ATMEL_BUSWIDTH_16
help
Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
@@ -350,7 +359,7 @@ config MACH_MMCCPU
config MACH_PM9263
bool "Ronetix PM9263"
- select MACH_HAS_LOWLEVEL_INIT
+ select HAVE_AT91_LOWLEVEL_INIT
help
Say y here if you are using the Ronetix PM9263 Board
@@ -364,7 +373,7 @@ config MACH_TNY_A9263
config MACH_USB_A9263
bool "CALAO USB-A9263"
- select MACH_HAS_LOWLEVEL_INIT
+ select HAVE_AT91_LOWLEVEL_INIT
help
Select this if you are using a Calao Systems USB-A9263.
<http://www.calao-systems.com>
@@ -508,7 +517,7 @@ endif
config AT91_BOOTSTRAP
bool "at91 bootstrap"
- depends on MACH_HAS_LOWLEVEL_INIT
+ depends on HAVE_AT91_LOWLEVEL_INIT
select BOOTSTRAP
endif
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 634b160..b94424e 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -2,11 +2,15 @@ obj-y += setup.o clock.o gpio.o
obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
-lowlevel_init-y = at91sam926x_lowlevel_init.o
+lowlevel_init-$(CONFIG_ARCH_AT91SAM9260) = at91sam926x_lowlevel_init.o
+lowlevel_init-$(CONFIG_ARCH_AT91SAM9261) = at91sam926x_lowlevel_init.o
+lowlevel_init-$(CONFIG_ARCH_AT91SAM9263) = at91sam926x_lowlevel_init.o
+lowlevel_init-$(CONFIG_ARCH_AT91SAM9G10) = at91sam926x_lowlevel_init.o
+lowlevel_init-$(CONFIG_ARCH_AT91SAM9G20) = at91sam926x_lowlevel_init.o
lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+obj-y += $(lowlevel_init-y)
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+pbl-y += $(lowlevel_init-y)
obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
diff --git a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
index 14afbc9..31e9f54 100644
--- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
@@ -46,6 +46,7 @@ static int inline running_in_sram(void)
return addr == 0;
}
+#ifdef CONFIG_HAVE_AT91_LOWLEVEL_INIT
void __bare_init at91sam926x_lowlevel_init(void)
{
u32 r;
@@ -191,8 +192,14 @@ void __bare_init at91sam926x_lowlevel_init(void)
at91_pmc_write(AT91_PMC_PCER, 0xffffffff);
end:
- board_init_lowlevel_return();
+ barebox_arm_entry(AT91_SDRAM_BASE, at91_get_sdram_size(), 0);
}
+#else
+static inline void at91sam926x_lowlevel_init(void)
+{
+}
+#endif
+
void __naked __bare_init reset(void)
{
@@ -207,4 +214,6 @@ void __naked __bare_init reset(void)
#endif
at91sam926x_lowlevel_init();
+
+ barebox_arm_entry(AT91_SDRAM_BASE, at91_get_sdram_size(), 0);
}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 20/34] ARM AT91: switch at91rm9200 board to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (18 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 19/34] ARM AT91: switch to barebox_arm_entry part1 Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 21/34] ARM AT91: switch remaining boards " Sascha Hauer
` (13 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/at91rm9200ek/Makefile | 2 ++
arch/arm/boards/at91rm9200ek/lowlevel.c | 14 ++++++++++++++
arch/arm/mach-at91/Kconfig | 1 +
arch/arm/mach-at91/at91rm9200_lowlevel_init.c | 5 +++--
arch/arm/mach-at91/include/mach/board.h | 3 +++
5 files changed, 23 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boards/at91rm9200ek/lowlevel.c
diff --git a/arch/arm/boards/at91rm9200ek/Makefile b/arch/arm/boards/at91rm9200ek/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/at91rm9200ek/Makefile
+++ b/arch/arm/boards/at91rm9200ek/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
new file mode 100644
index 0000000..a6c8f13
--- /dev/null
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -0,0 +1,14 @@
+#include <common.h>
+#include <init.h>
+#include <sizes.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/hardware.h>
+#include <mach/board.h>
+
+void __naked __bare_init reset(void)
+{
+ common_reset();
+
+ at91rm9200_entry(SZ_64M, 0);
+}
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 4f30650..ec9e88b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -73,6 +73,7 @@ config SOC_AT91RM9200
select HAVE_AT91_DBGU0
select HAS_AT91_ETHER
select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config SOC_AT91SAM9260
bool
diff --git a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
index 4add3d9..c4b6155 100644
--- a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
@@ -23,7 +23,8 @@ void static inline access_sdram(void)
writel(0x00000000, AT91_SDRAM_BASE);
}
-void __naked __bare_init reset(void)
+void __naked __bare_init at91rm9200_entry(unsigned long sdram_size,
+ unsigned long board_data)
{
u32 r;
int i;
@@ -129,5 +130,5 @@ void __naked __bare_init reset(void)
set_cr(r);
end:
- board_init_lowlevel_return();
+ barebox_arm_entry(AT91_SDRAM_BASE, sdram_size, board_data);
}
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index b0afcf9..eefe389 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -163,4 +163,7 @@ struct at91_spi_platform_data {
};
void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata);
+
+void at91rm9200_entry(unsigned long sdram_size, unsigned long board_data);
+
#endif
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 21/34] ARM AT91: switch remaining boards to barebox_arm_entry
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (19 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 20/34] ARM AT91: switch at91rm9200 board to barebox_arm_entry Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 16:24 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 10:46 ` [PATCH 22/34] ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT Sascha Hauer
` (12 subsequent siblings)
33 siblings, 1 reply; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
For At91 boards which do not have a SDRAM size detection function
we create a lowlevel reset function which calls barebox_arm_entry
manually with the known memory size.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/at91sam9m10g45ek/Makefile | 2 ++
arch/arm/boards/at91sam9m10g45ek/lowlevel.c | 11 +++++++++++
arch/arm/boards/at91sam9m10ihd/Makefile | 2 ++
arch/arm/boards/at91sam9m10ihd/lowlevel.c | 11 +++++++++++
arch/arm/boards/at91sam9n12ek/Makefile | 2 ++
arch/arm/boards/at91sam9n12ek/lowlevel.c | 11 +++++++++++
arch/arm/boards/at91sam9x5ek/Makefile | 2 ++
arch/arm/boards/at91sam9x5ek/lowlevel.c | 11 +++++++++++
arch/arm/boards/pm9g45/Makefile | 2 ++
arch/arm/boards/pm9g45/lowlevel.c | 11 +++++++++++
arch/arm/mach-at91/Kconfig | 8 --------
12 files changed, 67 insertions(+), 8 deletions(-)
create mode 100644 arch/arm/boards/at91sam9m10g45ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9m10ihd/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9n12ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9x5ek/lowlevel.c
create mode 100644 arch/arm/boards/pm9g45/lowlevel.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c7daebe..0d5e004 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -30,6 +30,8 @@ config ARCH_AT91
select CLKDEV_LOOKUP
select HAS_DEBUG_LL
select HAVE_MACH_ARM_HEAD
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_BCM2835
bool "Broadcom BCM2835 boards"
diff --git a/arch/arm/boards/at91sam9m10g45ek/Makefile b/arch/arm/boards/at91sam9m10g45ek/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/at91sam9m10g45ek/Makefile
+++ b/arch/arm/boards/at91sam9m10g45ek/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
new file mode 100644
index 0000000..65259bb
--- /dev/null
+++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/at91sam9m10ihd/Makefile b/arch/arm/boards/at91sam9m10ihd/Makefile
index f2acf20..4ec0b36 100644
--- a/arch/arm/boards/at91sam9m10ihd/Makefile
+++ b/arch/arm/boards/at91sam9m10ihd/Makefile
@@ -1,2 +1,4 @@
obj-y += init.o
obj-y += hw_version.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
new file mode 100644
index 0000000..65259bb
--- /dev/null
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/at91sam9n12ek/Makefile b/arch/arm/boards/at91sam9n12ek/Makefile
index eb072c0..6c1a61f 100644
--- a/arch/arm/boards/at91sam9n12ek/Makefile
+++ b/arch/arm/boards/at91sam9n12ek/Makefile
@@ -1 +1,3 @@
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
obj-y += init.o
diff --git a/arch/arm/boards/at91sam9n12ek/lowlevel.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
new file mode 100644
index 0000000..65259bb
--- /dev/null
+++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/at91sam9x5ek/Makefile b/arch/arm/boards/at91sam9x5ek/Makefile
index f2acf20..4ec0b36 100644
--- a/arch/arm/boards/at91sam9x5ek/Makefile
+++ b/arch/arm/boards/at91sam9x5ek/Makefile
@@ -1,2 +1,4 @@
obj-y += init.o
obj-y += hw_version.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/at91sam9x5ek/lowlevel.c b/arch/arm/boards/at91sam9x5ek/lowlevel.c
new file mode 100644
index 0000000..65259bb
--- /dev/null
+++ b/arch/arm/boards/at91sam9x5ek/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/pm9g45/Makefile b/arch/arm/boards/pm9g45/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/pm9g45/Makefile
+++ b/arch/arm/boards/pm9g45/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
new file mode 100644
index 0000000..65259bb
--- /dev/null
+++ b/arch/arm/boards/pm9g45/lowlevel.c
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
+}
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index ec9e88b..13f4f21 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -72,8 +72,6 @@ config SOC_AT91RM9200
select CPU_ARM920T
select HAVE_AT91_DBGU0
select HAS_AT91_ETHER
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config SOC_AT91SAM9260
bool
@@ -81,8 +79,6 @@ config SOC_AT91SAM9260
select HAVE_AT91_DBGU0
select HAS_MACB
select AT91SAM9_RESET
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
help
Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
or AT91SAM9G20 SoC.
@@ -92,8 +88,6 @@ config SOC_AT91SAM9261
select SOC_AT91SAM9
select HAVE_AT91_DBGU0
select AT91SAM9_RESET
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
help
Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
@@ -103,8 +97,6 @@ config SOC_AT91SAM9263
select HAVE_AT91_DBGU1
select HAS_MACB
select AT91SAM9_RESET
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config SOC_AT91SAM9G45
bool
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 22/34] ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (20 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 21/34] ARM AT91: switch remaining boards " Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 23/34] ARM start-pbl: make board_init_lowlevel_return static Sascha Hauer
` (11 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 30 ------------------------------
arch/arm/configs/archosg9_defconfig | 1 -
arch/arm/configs/phycard_a_l1_defconfig | 2 --
arch/arm/cpu/start-pbl.c | 12 ------------
arch/arm/cpu/start.c | 12 ------------
arch/arm/mach-at91/Kconfig | 1 -
arch/arm/mach-omap/arch-omap.dox | 1 -
arch/arm/mach-pxa/Kconfig | 1 -
common/Kconfig | 12 ------------
9 files changed, 72 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0d5e004..6f7a71f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -30,8 +30,6 @@ config ARCH_AT91
select CLKDEV_LOOKUP
select HAS_DEBUG_LL
select HAVE_MACH_ARM_HEAD
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_BCM2835
bool "Broadcom BCM2835 boards"
@@ -41,22 +39,16 @@ config ARCH_BCM2835
select COMMON_CLK
select CLOCKSOURCE_BCM2835
select ARM_AMBA
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_CLPS711X
bool "Cirrus Logic EP711x/EP721x/EP731x"
select CLKDEV_LOOKUP
select CPU_32v4T
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_EP93XX
bool "Cirrus Logic EP93xx"
select CPU_ARM920T
select GENERIC_GPIO
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_IMX
bool "Freescale iMX-based"
@@ -66,27 +58,19 @@ config ARCH_IMX
select CLKDEV_LOOKUP
select WATCHDOG_IMX_RESET_SOURCE
select HAS_DEBUG_LL
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_MXS
bool "Freescale i.MX23/28 (mxs) based"
select GENERIC_GPIO
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_NETX
bool "Hilscher NetX based"
select CPU_ARM926T
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_NOMADIK
bool "STMicroelectronics Nomadik"
select CPU_ARM926T
select CLOCKSOURCE_NOMADIK
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
help
Support for the Nomadik platform by ST-Ericsson
@@ -94,52 +78,38 @@ config ARCH_OMAP
bool "TI OMAP"
select HAS_DEBUG_LL
select GPIOLIB
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_PXA
bool "Intel/Marvell PXA based"
select GENERIC_GPIO
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_S3C24xx
bool "Samsung S3C2410, S3C2440"
select ARCH_SAMSUNG
select CPU_ARM920T
select GENERIC_GPIO
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_S5PCxx
bool "Samsung S5PC110, S5PV210"
select ARCH_SAMSUNG
select CPU_V7
select GENERIC_GPIO
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_S3C64xx
bool "Samsung S3C64xx"
select ARCH_SAMSUNG
select CPU_V6
select GENERIC_GPIO
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_VERSATILE
bool "ARM Versatile boards (ARM926EJ-S)"
select CPU_ARM926T
select GPIOLIB
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_TEGRA
bool "Nvidia Tegra-based boards"
select CPU_ARM926T
select HAS_DEBUG_LL
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
endchoice
diff --git a/arch/arm/configs/archosg9_defconfig b/arch/arm/configs/archosg9_defconfig
index 1f3d105..9a051da 100644
--- a/arch/arm/configs/archosg9_defconfig
+++ b/arch/arm/configs/archosg9_defconfig
@@ -2,7 +2,6 @@ CONFIG_MACH_ARCHOSG9=y
CONFIG_ARCH_OMAP=y
CONFIG_ARCH_OMAP4=y
CONFIG_AEABI=y
-# CONFIG_MACH_DO_LOWLEVEL_INIT is not set
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_ARM_UNWIND=y
# CONFIG_MMU is not set
diff --git a/arch/arm/configs/phycard_a_l1_defconfig b/arch/arm/configs/phycard_a_l1_defconfig
index 5170722..d90a333 100644
--- a/arch/arm/configs/phycard_a_l1_defconfig
+++ b/arch/arm/configs/phycard_a_l1_defconfig
@@ -36,8 +36,6 @@ CONFIG_STACK_SIZE=0x8000
CONFIG_MALLOC_SIZE=0x1000000
CONFIG_EXPERIMENTAL=y
CONFIG_MALLOC_DLMALLOC=y
-CONFIG_MACH_HAS_LOWLEVEL_INIT=y
-CONFIG_MACH_DO_LOWLEVEL_INIT=y
CONFIG_ARCH_HAS_LOWLEVEL_INIT=y
CONFIG_PROMPT="phyCARD-A-L1 >"
CONFIG_BAUDRATE=115200
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 8a4232d..d80ff9d 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -44,18 +44,6 @@ void __naked __section(.text_head_entry) pbl_start(void)
barebox_arm_head();
}
-/*
- * The actual reset vector. This code is position independent and usually
- * does not run at the address it's linked at.
- */
-#ifndef CONFIG_MACH_DO_LOWLEVEL_INIT
-void __naked __bare_init reset(void)
-{
- common_reset();
- board_init_lowlevel_return();
-}
-#endif
-
extern void *input_data;
extern void *input_data_end;
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index df22cde..b59c489 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -40,18 +40,6 @@ void __naked __section(.text_entry) start(void)
}
/*
- * The actual reset vector. This code is position independent and usually
- * does not run at the address it's linked at.
- */
-#ifndef CONFIG_MACH_DO_LOWLEVEL_INIT
-void __naked __bare_init reset(void)
-{
- common_reset();
- board_init_lowlevel_return();
-}
-#endif
-
-/*
* Board code can jump here by either returning from board_init_lowlevel
* or by calling this function directly.
*/
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 13f4f21..14fe287 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -134,7 +134,6 @@ choice
config ARCH_AT91RM9200
bool "AT91RM9200"
- select MACH_DO_LOWLEVEL_INIT
select SOC_AT91RM9200
config ARCH_AT91SAM9260
diff --git a/arch/arm/mach-omap/arch-omap.dox b/arch/arm/mach-omap/arch-omap.dox
index 6b6b3a8..8c2b47d 100644
--- a/arch/arm/mach-omap/arch-omap.dox
+++ b/arch/arm/mach-omap/arch-omap.dox
@@ -70,7 +70,6 @@ The responsibility of arch_init_lowlevel and related calls is to setup OMAP. No
Once this is past, the code returns back to arm common code (cpu/start-arm.S). Here Instruction and Data caches are disabled. The execution proceeds to normal board initialization.
@section board_boot The board boot path
-If the proper CONFIG_MACH_DO_LOWLEVEL_INIT flag is setup, board_init_lowlevel is called. This again would call a common file arch/arm/boards/omap/platform.S which setups a temporary SRAM stack and bumps the control to board_init.
Every Board in OMAP platform can potentially define a board_init and enable defconfig in arch/arm/configs directory. The responsibility here is to setup OMAP for board configurations - this includes SDRAM configuration and pin muxing configuration.
Once this is complete, @a barebox boot process proceeds by calling init functions and finally entering shell prompt
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 6808d2f..2bc040c 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -42,7 +42,6 @@ config MACH_MIOA701
config MACH_PCM027
bool "Phytec phyCORE-PXA270"
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using a Phytec phyCORE PXA270
board
diff --git a/common/Kconfig b/common/Kconfig
index eccae4c..532755b 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -284,18 +284,6 @@ config RELOCATABLE
allowing it to relocate to the end of the available RAM. This
way you have the whole memory in a single piece.
-config MACH_HAS_LOWLEVEL_INIT
- bool
-
-config MACH_DO_LOWLEVEL_INIT
- bool "run machine low-level init"
- depends on MACH_HAS_LOWLEVEL_INIT
- default y
- help
- This entry enables SDRAM and other board low level initialization
- on many platforms. Disabling this option allows configurations to use
- barebox as a second stage boot loader.
-
config PROMPT
string
prompt "barebox command prompt"
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 23/34] ARM start-pbl: make board_init_lowlevel_return static
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (21 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 22/34] ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 24/34] ARM start-pbl: call uncompressed binary with arguments Sascha Hauer
` (10 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index d80ff9d..71732d6 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -156,18 +156,12 @@ static void __noreturn barebox_uncompress(void *compressed_start, unsigned int l
barebox();
}
-/*
- * Board code can jump here by either returning from board_init_lowlevel
- * or by calling this function directly.
- */
-void __naked __noreturn board_init_lowlevel_return(void)
+static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
+ uint32_t memsize, uint32_t boarddata)
{
uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
- /* Setup the stack */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
-
/* Get offset between linked address and runtime address */
offset = get_runtime_offset();
@@ -211,5 +205,7 @@ void __naked __noreturn board_init_lowlevel_return(void)
void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
- board_init_lowlevel_return();
+ arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+
+ __barebox_arm_entry(membase, memsize, boarddata);
}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 24/34] ARM start-pbl: call uncompressed binary with arguments
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (22 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 23/34] ARM start-pbl: make board_init_lowlevel_return static Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 25/34] ARM start: pickup parameters from pbl Sascha Hauer
` (9 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 71732d6..4fa1f32 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -120,9 +120,8 @@ static void noinline errorfn(char *error)
while (1);
}
-static void __noreturn barebox_uncompress(void *compressed_start, unsigned int len)
+static void barebox_uncompress(void *compressed_start, unsigned int len)
{
- void __noreturn (*barebox)(void);
/*
* remap_cached currently does not work rendering the feature
* of enabling the MMU in the PBL useless. disable for now.
@@ -138,11 +137,6 @@ static void __noreturn barebox_uncompress(void *compressed_start, unsigned int l
if (use_mmu)
mmu_enable((unsigned long)compressed_start, len);
- if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
- barebox = (void *)(TEXT_BASE + 1);
- else
- barebox = (void *)TEXT_BASE;
-
decompress((void *)compressed_start,
len,
NULL, NULL,
@@ -152,8 +146,6 @@ static void __noreturn barebox_uncompress(void *compressed_start, unsigned int l
mmu_disable();
flush_icache();
-
- barebox();
}
static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
@@ -161,6 +153,7 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
{
uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
+ void __noreturn (*barebox)(uint32_t, uint32_t, uint32_t);
/* Get offset between linked address and runtime address */
offset = get_runtime_offset();
@@ -181,6 +174,13 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
setup_c();
barebox_uncompress((void *)pg_start, pg_len);
+
+ if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
+ barebox = (void *)(TEXT_BASE + 1);
+ else
+ barebox = (void *)TEXT_BASE;
+
+ barebox(membase, memsize, boarddata);
}
/*
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 25/34] ARM start: pickup parameters from pbl
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (23 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 24/34] ARM start-pbl: call uncompressed binary with arguments Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 26/34] ARM: Setup stack at end of SDRAM Sascha Hauer
` (8 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start.c | 44 +++++++++++++++++++-----------------
arch/arm/include/asm/barebox-arm.h | 1 -
2 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index b59c489..64de5da 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -26,32 +26,21 @@
#include <asm/cache.h>
#include <memory.h>
-/*
- * First function in the uncompressed image. We get here from
- * the pbl.
- */
-void __naked __section(.text_entry) start(void)
+static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
{
-#ifdef CONFIG_PBL_IMAGE
- board_init_lowlevel_return();
-#else
- barebox_arm_head();
-#endif
-}
-
-/*
- * Board code can jump here by either returning from board_init_lowlevel
- * or by calling this function directly.
- */
-void __naked __noreturn board_init_lowlevel_return(void)
-{
- arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
-
setup_c();
start_barebox();
}
+#ifndef CONFIG_PBL_IMAGE
+
+void __naked __section(.text_entry) start(void)
+{
+ barebox_arm_head();
+}
+
/*
* Main ARM entry point in the uncompressed image. Call this with the memory
* region you can spare for barebox. This doesn't necessarily have to be the
@@ -74,5 +63,18 @@ void __naked __noreturn board_init_lowlevel_return(void)
void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
- board_init_lowlevel_return();
+ arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+
+ __start(membase, memsize, boarddata);
}
+#else
+/*
+ * First function in the uncompressed image. We get here from
+ * the pbl. The stack already has been set up by the pbl.
+ */
+void __naked __section(.text_entry) start(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
+{
+ __start(membase, memsize, boarddata);
+}
+#endif
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 0574f34..42b7a3f 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -35,7 +35,6 @@ int dram_init (void);
extern char __exceptions_start[], __exceptions_stop[];
void board_init_lowlevel(void);
-void __noreturn board_init_lowlevel_return(void);
uint32_t get_runtime_offset(void);
void setup_c(void);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 26/34] ARM: Setup stack at end of SDRAM
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (24 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 25/34] ARM start: pickup parameters from pbl Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 27/34] ARM pbl: Use dynamic parameters for early malloc space Sascha Hauer
` (7 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/cpu.c | 12 ++++++++++++
arch/arm/cpu/start-pbl.c | 2 +-
arch/arm/cpu/start.c | 9 ++++++++-
arch/arm/include/asm/barebox-arm.h | 4 ++++
common/meminfo.c | 5 -----
5 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/arch/arm/cpu/cpu.c b/arch/arm/cpu/cpu.c
index 2ca871f..7761f5c 100644
--- a/arch/arm/cpu/cpu.c
+++ b/arch/arm/cpu/cpu.c
@@ -28,6 +28,7 @@
#include <asm/mmu.h>
#include <asm/system.h>
#include <asm/memory.h>
+#include <asm-generic/memory_layout.h>
#include <asm/system_info.h>
#include <asm/cputype.h>
#include <asm/cache.h>
@@ -91,6 +92,17 @@ void arch_shutdown(void)
__asm__ __volatile__("msr cpsr, %0" : : "r"(r));
}
+extern unsigned long arm_stack_top;
+
+static int arm_request_stack(void)
+{
+ if (!request_sdram_region("stack", arm_stack_top - STACK_SIZE, STACK_SIZE))
+ pr_err("Error: Cannot request SDRAM region for stack\n");
+
+ return 0;
+}
+coredevice_initcall(arm_request_stack);
+
#ifdef CONFIG_THUMB2_BAREBOX
static void thumb2_execute(void *func, int argc, char *argv[])
{
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 4fa1f32..1900daa 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -205,7 +205,7 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
- arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+ arm_setup_stack(membase + memsize - ARM_RESERVE_MEM_SIZE - 16);
__barebox_arm_entry(membase, memsize, boarddata);
}
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 64de5da..530fb09 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -26,11 +26,18 @@
#include <asm/cache.h>
#include <memory.h>
+unsigned long arm_stack_top;
+
static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
+ unsigned long endmem = membase + memsize;
+
setup_c();
+ arm_stack_top = endmem;
+ endmem -= STACK_SIZE; /* Stack */
+
start_barebox();
}
@@ -63,7 +70,7 @@ void __naked __section(.text_entry) start(void)
void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
- arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+ arm_setup_stack(membase + memsize - ARM_RESERVE_MEM_SIZE - 16);
__start(membase, memsize, boarddata);
}
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 42b7a3f..988e6e8 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -25,6 +25,8 @@
#ifndef _BAREBOX_ARM_H_
#define _BAREBOX_ARM_H_
+#include <sizes.h>
+
/* cpu/.../cpu.c */
int cleanup_before_linux(void);
@@ -40,4 +42,6 @@ uint32_t get_runtime_offset(void);
void setup_c(void);
void __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize, uint32_t boarddata);
+#define ARM_RESERVE_MEM_SIZE SZ_128K
+
#endif /* _BAREBOX_ARM_H_ */
diff --git a/common/meminfo.c b/common/meminfo.c
index a09b2d2..5e3ff71 100644
--- a/common/meminfo.c
+++ b/common/meminfo.c
@@ -14,11 +14,6 @@ static int display_meminfo(void)
debug("bss segment: 0x%p -> 0x%p\n", __bss_start, __bss_stop - 1);
printf("malloc space: 0x%08lx -> 0x%08lx (size %s)\n",
mstart, mend, size_human_readable(msize));
-#ifdef CONFIG_ARM
- printf("stack space: 0x%08x -> 0x%08x (size %s)\n",
- STACK_BASE, STACK_BASE + STACK_SIZE - 1,
- size_human_readable(STACK_SIZE));
-#endif
return 0;
}
late_initcall(display_meminfo);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 27/34] ARM pbl: Use dynamic parameters for early malloc space
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (25 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 26/34] ARM: Setup stack at end of SDRAM Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 28/34] ARM mmu: pickup already enabled mmu Sascha Hauer
` (6 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 12 ++++++++----
arch/arm/cpu/start.c | 1 +
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 1900daa..6610be6 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -128,10 +128,6 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
*/
int use_mmu = 0;
- /* set 128 KiB at the end of the MALLOC_BASE for early malloc */
- free_mem_ptr = MALLOC_BASE + MALLOC_SIZE - SZ_128K;
- free_mem_end_ptr = free_mem_ptr + SZ_128K;
-
ttb = (void *)((free_mem_ptr - 0x4000) & ~0x3fff);
if (use_mmu)
@@ -154,6 +150,10 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
void __noreturn (*barebox)(uint32_t, uint32_t, uint32_t);
+ uint32_t endmem = membase + memsize;
+
+ endmem -= ARM_RESERVE_MEM_SIZE;
+ endmem -= STACK_SIZE; /* stack */
/* Get offset between linked address and runtime address */
offset = get_runtime_offset();
@@ -173,6 +173,10 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
setup_c();
+ endmem -= SZ_128K; /* early malloc */
+ free_mem_ptr = endmem;
+ free_mem_end_ptr = free_mem_ptr + SZ_128K;
+
barebox_uncompress((void *)pg_start, pg_len);
if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 530fb09..b77b070 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -35,6 +35,7 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
setup_c();
+ endmem -= ARM_RESERVE_MEM_SIZE;
arm_stack_top = endmem;
endmem -= STACK_SIZE; /* Stack */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 28/34] ARM mmu: pickup already enabled mmu
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (26 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 27/34] ARM pbl: Use dynamic parameters for early malloc space Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 29/34] ARM: Factor out early mmu code Sascha Hauer
` (5 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/mmu.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 7b5f4ee..2f058e1 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -255,7 +255,14 @@ static int mmu_init(void)
pte_flags_uncached = PTE_FLAGS_UNCACHED_V4;
}
- ttb = memalign(0x10000, 0x4000);
+ if (get_cr() & CR_M) {
+ asm volatile ("mrc p15,0,%0,c2,c0,0" : "=r"(ttb));
+
+ if (!request_sdram_region("ttb", (unsigned long)ttb, SZ_16K))
+ pr_err("Error: Can't request SDRAM region for ttb\n");
+ } else {
+ ttb = memalign(0x10000, 0x4000);
+ }
debug("ttb: 0x%p\n", ttb);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 29/34] ARM: Factor out early mmu code
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (27 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 28/34] ARM mmu: pickup already enabled mmu Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 14:54 ` Alexander Aring
2013-01-27 10:46 ` [PATCH 30/34] ARM: Enable mmu early Sascha Hauer
` (4 subsequent siblings)
33 siblings, 1 reply; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
Move early mmu code to a separate file so that it can be
used from the pbl and the regular image. Disabling the mmu
can be dropped since the regular mmu code is now able to
pickup an enabled mmu.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/Makefile | 4 +--
arch/arm/cpu/mmu-early.c | 53 ++++++++++++++++++++++++++++++++++
arch/arm/cpu/mmu-early.h | 6 ++++
arch/arm/cpu/start-pbl.c | 72 ----------------------------------------------
4 files changed, 61 insertions(+), 74 deletions(-)
create mode 100644 arch/arm/cpu/mmu-early.c
create mode 100644 arch/arm/cpu/mmu-early.h
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
index 4b0259c..44410ee 100644
--- a/arch/arm/cpu/Makefile
+++ b/arch/arm/cpu/Makefile
@@ -8,8 +8,8 @@ obj-y += start.o setupc.o
#
obj-$(CONFIG_CMD_ARM_CPUINFO) += cpuinfo.o
obj-$(CONFIG_CMD_ARM_MMUINFO) += mmuinfo.o
-obj-$(CONFIG_MMU) += mmu.o cache.o
-pbl-$(CONFIG_MMU) += cache.o
+obj-$(CONFIG_MMU) += mmu.o cache.o mmu-early.o
+pbl-$(CONFIG_MMU) += cache.o mmu-early.o
obj-$(CONFIG_CPU_32v4T) += cache-armv4.o
pbl-$(CONFIG_CPU_32v4T) += cache-armv4.o
obj-$(CONFIG_CPU_32v5) += cache-armv5.o
diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c
new file mode 100644
index 0000000..b8b30df
--- /dev/null
+++ b/arch/arm/cpu/mmu-early.c
@@ -0,0 +1,53 @@
+#include <common.h>
+#include <asm/mmu.h>
+#include <errno.h>
+#include <sizes.h>
+#include <asm/memory.h>
+#include <asm/system.h>
+#include <asm/cache.h>
+
+#include "mmu.h"
+
+static uint32_t *ttb;
+
+static void create_sections(unsigned long addr, int size_m, unsigned int flags)
+{
+ int i;
+
+ addr >>= 20;
+
+ for (i = size_m; i > 0; i--, addr++)
+ ttb[addr] = (addr << 20) | flags;
+}
+
+static void map_cachable(unsigned long start, unsigned long size)
+{
+ start &= ~(SZ_1M - 1);
+ size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1);
+
+ create_sections(start, size >> 20, PMD_SECT_AP_WRITE |
+ PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB);
+}
+
+void mmu_early_enable(uint32_t membase, uint32_t memsize, uint32_t _ttb)
+{
+ int i;
+
+ ttb = (uint32_t *)_ttb;
+
+ arm_set_cache_functions();
+
+ /* Set the ttb register */
+ asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb) /*:*/);
+
+ /* Set the Domain Access Control Register */
+ i = 0x3;
+ asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
+
+ create_sections(0, 4096, PMD_SECT_AP_WRITE |
+ PMD_SECT_AP_READ | PMD_TYPE_SECT);
+
+ map_cachable(membase, memsize);
+
+ __mmu_cache_on();
+}
diff --git a/arch/arm/cpu/mmu-early.h b/arch/arm/cpu/mmu-early.h
new file mode 100644
index 0000000..af21f52
--- /dev/null
+++ b/arch/arm/cpu/mmu-early.h
@@ -0,0 +1,6 @@
+#ifndef __ARM_CPU_MMU_EARLY_H
+#define __ARM_CPU_MMU_EARLY_H
+
+void mmu_early_enable(uint32_t membase, uint32_t memsize, uint32_t ttb);
+
+#endif /* __ARM_CPU_MMU_EARLY_H */
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 6610be6..96a9dcf 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -57,64 +57,6 @@ extern void *input_data_end;
#include "../../../lib/decompress_inflate.c"
#endif
-static unsigned long *ttb;
-
-static void create_sections(unsigned long addr, int size_m, unsigned int flags)
-{
- int i;
-
- addr >>= 20;
-
- for (i = size_m; i > 0; i--, addr++)
- ttb[addr] = (addr << 20) | flags;
-}
-
-static void map_cachable(unsigned long start, unsigned long size)
-{
- start &= ~(SZ_1M - 1);
- size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1);
-
- create_sections(start, size >> 20, PMD_SECT_AP_WRITE |
- PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB);
-}
-
-static void mmu_enable(unsigned long compressed_start, unsigned int len)
-{
- int i;
-
- /* Set the ttb register */
- asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb) /*:*/);
-
- /* Set the Domain Access Control Register */
- i = 0x3;
- asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
-
- create_sections(0, 4096, PMD_SECT_AP_WRITE |
- PMD_SECT_AP_READ | PMD_TYPE_SECT);
- /*
- * Setup all regions we need cacheable, namely:
- * - the stack
- * - the decompressor code
- * - the compressed image
- * - the uncompressed image
- * - the early malloc space
- */
- map_cachable(STACK_BASE, STACK_SIZE);
- map_cachable((unsigned long)&_text,
- (unsigned long)&_end - (unsigned long)&_text);
- map_cachable((unsigned long)compressed_start, len);
- map_cachable(TEXT_BASE, len * 4);
- map_cachable(free_mem_ptr, free_mem_end_ptr - free_mem_ptr);
-
- __mmu_cache_on();
-}
-
-static void mmu_disable(void)
-{
- __mmu_cache_flush();
- __mmu_cache_off();
-}
-
static void noinline errorfn(char *error)
{
while (1);
@@ -122,25 +64,11 @@ static void noinline errorfn(char *error)
static void barebox_uncompress(void *compressed_start, unsigned int len)
{
- /*
- * remap_cached currently does not work rendering the feature
- * of enabling the MMU in the PBL useless. disable for now.
- */
- int use_mmu = 0;
-
- ttb = (void *)((free_mem_ptr - 0x4000) & ~0x3fff);
-
- if (use_mmu)
- mmu_enable((unsigned long)compressed_start, len);
-
decompress((void *)compressed_start,
len,
NULL, NULL,
(void *)TEXT_BASE, NULL, errorfn);
- if (use_mmu)
- mmu_disable();
-
flush_icache();
}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 30/34] ARM: Enable mmu early
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (28 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 29/34] ARM: Factor out early mmu code Sascha Hauer
@ 2013-01-27 10:46 ` Sascha Hauer
2013-01-27 10:47 ` [PATCH 31/34] ARM: Automatically determine malloc size Sascha Hauer
` (3 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:46 UTC (permalink / raw)
To: barebox
This optionally enabled the MMU in the PBL or during early startup for
the non PBL case. The regular MMU init code will pickup the already enabled
MMU later. This might complicate debugging early code, so this has been
made optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 8 +++++++-
arch/arm/cpu/start.c | 12 ++++++++++++
common/Kconfig | 9 +++++++++
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 96a9dcf..b93f5a3 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -31,7 +31,7 @@
#include <asm/pgtable.h>
#include <asm/cache.h>
-#include "mmu.h"
+#include "mmu-early.h"
unsigned long free_mem_ptr;
unsigned long free_mem_end_ptr;
@@ -101,6 +101,12 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
setup_c();
+ if (IS_ENABLED(CONFIG_MMU_EARLY)) {
+ endmem &= ~0x3fff;
+ endmem -= SZ_16K; /* ttb */
+ mmu_early_enable(membase, memsize, endmem);
+ }
+
endmem -= SZ_128K; /* early malloc */
free_mem_ptr = endmem;
free_mem_end_ptr = free_mem_ptr + SZ_128K;
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index b77b070..b25592c 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -19,6 +19,7 @@
#include <common.h>
#include <init.h>
+#include <sizes.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <asm-generic/memory_layout.h>
@@ -26,6 +27,8 @@
#include <asm/cache.h>
#include <memory.h>
+#include "mmu-early.h"
+
unsigned long arm_stack_top;
static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
@@ -39,6 +42,15 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
arm_stack_top = endmem;
endmem -= STACK_SIZE; /* Stack */
+ if (IS_ENABLED(CONFIG_MMU_EARLY)) {
+
+ endmem &= ~0x3fff;
+ endmem -= SZ_16K; /* ttb */
+
+ if (!IS_ENABLED(CONFIG_PBL_IMAGE))
+ mmu_early_enable(membase, memsize, endmem);
+ }
+
start_barebox();
}
diff --git a/common/Kconfig b/common/Kconfig
index 532755b..22155b3 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -154,6 +154,15 @@ config MMU
to enable the data cache which depends on the MMU. See Documentation/mmu.txt
for further information.
+config MMU_EARLY
+ bool "Enable MMU early"
+ depends on ARM
+ depends on MMU
+ default y
+ help
+ This enables the MMU during early startup. This speeds up things during startup
+ of barebox, but may lead to harder to debug code. If unsure say yes here.
+
config HAVE_CONFIGURABLE_TEXT_BASE
bool
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 31/34] ARM: Automatically determine malloc size
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (29 preceding siblings ...)
2013-01-27 10:46 ` [PATCH 30/34] ARM: Enable mmu early Sascha Hauer
@ 2013-01-27 10:47 ` Sascha Hauer
2013-01-27 10:47 ` [PATCH 32/34] generic memory layout: fix deps for [MALLOC|STACK]_BASE Sascha Hauer
` (2 subsequent siblings)
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:47 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start.c | 28 ++++++++++++++++++++++++++++
arch/arm/lib/Makefile | 1 -
arch/arm/lib/arm.c | 14 --------------
3 files changed, 28 insertions(+), 15 deletions(-)
delete mode 100644 arch/arm/lib/arm.c
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index b25592c..19e332d 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -35,6 +35,7 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
unsigned long endmem = membase + memsize;
+ unsigned long malloc_start, malloc_end;
setup_c();
@@ -51,6 +52,33 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
mmu_early_enable(membase, memsize, endmem);
}
+ if ((unsigned long)_text > membase + memsize ||
+ (unsigned long)_text < membase)
+ /*
+ * barebox is either outside SDRAM or in another
+ * memory bank, so we can use the whole bank for
+ * malloc.
+ */
+ malloc_end = endmem;
+ else
+ malloc_end = (unsigned long)_text;
+
+ /*
+ * Maximum malloc space is the Kconfig value if given
+ * or 64MB.
+ */
+ if (MALLOC_SIZE > 0) {
+ malloc_start = malloc_end - MALLOC_SIZE;
+ if (malloc_start < membase)
+ malloc_start = membase;
+ } else {
+ malloc_start = malloc_end - (malloc_end - membase) / 2;
+ if (malloc_end - malloc_start > SZ_64M)
+ malloc_start = malloc_end - SZ_64M;
+ }
+
+ mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
+
start_barebox();
}
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 2e624cd..3ea695c 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -4,7 +4,6 @@ obj-$(CONFIG_CMD_BOOTZ) += bootz.o
obj-$(CONFIG_CMD_BOOTU) += bootu.o
obj-y += div0.o
obj-y += findbit.o
-obj-y += arm.o
obj-y += io.o
obj-y += io-readsb.o
obj-y += io-readsw-armv4.o
diff --git a/arch/arm/lib/arm.c b/arch/arm/lib/arm.c
deleted file mode 100644
index 80b62e9..0000000
--- a/arch/arm/lib/arm.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <common.h>
-#include <init.h>
-#include <memory.h>
-#include <asm/barebox-arm.h>
-#include <asm-generic/memory_layout.h>
-
-static int arm_mem_malloc_init(void)
-{
- mem_malloc_init((void *)MALLOC_BASE,
- (void *)(MALLOC_BASE + MALLOC_SIZE - 1));
- return 0;
-}
-
-core_initcall(arm_mem_malloc_init);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 32/34] generic memory layout: fix deps for [MALLOC|STACK]_BASE
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (30 preceding siblings ...)
2013-01-27 10:47 ` [PATCH 31/34] ARM: Automatically determine malloc size Sascha Hauer
@ 2013-01-27 10:47 ` Sascha Hauer
2013-01-27 10:47 ` [PATCH 33/34] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT Sascha Hauer
2013-01-27 10:47 ` [PATCH 34/34] ARM pbl: inline decompress function Sascha Hauer
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:47 UTC (permalink / raw)
To: barebox
Defining STACK_BASE and MALLOC_BASE only makes sense when
either CONFIG_MEMORY_LAYOUT_DEFAULT or CONFIG_MEMORY_LAYOUT_FIXED
is set, so use separate #ifdefs instead ot #if/#else
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
include/asm-generic/memory_layout.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/asm-generic/memory_layout.h b/include/asm-generic/memory_layout.h
index eb1607f..45e0ed8 100644
--- a/include/asm-generic/memory_layout.h
+++ b/include/asm-generic/memory_layout.h
@@ -2,15 +2,13 @@
#define __ASM_GENERIC_MEMORY_LAYOUT_H
#ifdef CONFIG_MEMORY_LAYOUT_DEFAULT
-
#define MALLOC_BASE (TEXT_BASE - CONFIG_MALLOC_SIZE)
#define STACK_BASE (TEXT_BASE - CONFIG_MALLOC_SIZE - CONFIG_STACK_SIZE)
+#endif
-#else
-
+#ifdef CONFIG_MEMORY_LAYOUT_FIXED
#define STACK_BASE CONFIG_STACK_BASE
#define MALLOC_BASE CONFIG_MALLOC_BASE
-
#endif
#define HEAD_TEXT_BASE MALLOC_BASE
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 33/34] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (31 preceding siblings ...)
2013-01-27 10:47 ` [PATCH 32/34] generic memory layout: fix deps for [MALLOC|STACK]_BASE Sascha Hauer
@ 2013-01-27 10:47 ` Sascha Hauer
2013-01-27 10:47 ` [PATCH 34/34] ARM pbl: inline decompress function Sascha Hauer
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:47 UTC (permalink / raw)
To: barebox
HAVE_CONFIGURABLE_MEMORY_LAYOUT was first meant as a feature, now it's a
feature to remove it. barebox on ARM now completely uses the memory passed
in from the lowlevel code and configures the malloc area and stack space
during runtime making it obsolete to hardcode these values.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 1 -
arch/arm/pbl/zbarebox.lds.S | 8 ++++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6f7a71f..28332ec 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2,7 +2,6 @@ config ARM
bool
select HAS_KALLSYMS
select HAS_MODULES
- select HAVE_CONFIGURABLE_MEMORY_LAYOUT
select HAVE_CONFIGURABLE_TEXT_BASE
select HAVE_PBL_IMAGE
select HAVE_IMAGE_COMPRESSION
diff --git a/arch/arm/pbl/zbarebox.lds.S b/arch/arm/pbl/zbarebox.lds.S
index 37af4e9..564b3c6 100644
--- a/arch/arm/pbl/zbarebox.lds.S
+++ b/arch/arm/pbl/zbarebox.lds.S
@@ -20,7 +20,7 @@
* MA 02111-1307 USA
*
*/
-
+#include <sizes.h>
#include <asm-generic/barebox.lds.h>
#include <asm-generic/memory_layout.h>
@@ -29,7 +29,7 @@ OUTPUT_ARCH(arm)
ENTRY(pbl_start)
SECTIONS
{
- . = HEAD_TEXT_BASE;
+ . = TEXT_BASE - SZ_2M;
PRE_IMAGE
@@ -71,6 +71,6 @@ SECTIONS
}
__piggydata_end = .;
- _barebox_image_size = __piggydata_end - HEAD_TEXT_BASE;
- _barebox_pbl_size = __bss_start - HEAD_TEXT_BASE;
+ _barebox_image_size = __piggydata_end - (TEXT_BASE - SZ_2M);
+ _barebox_pbl_size = __bss_start - (TEXT_BASE - SZ_2M);
}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 34/34] ARM pbl: inline decompress function
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
` (32 preceding siblings ...)
2013-01-27 10:47 ` [PATCH 33/34] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT Sascha Hauer
@ 2013-01-27 10:47 ` Sascha Hauer
33 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 10:47 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index b93f5a3..c192d59 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -62,16 +62,6 @@ static void noinline errorfn(char *error)
while (1);
}
-static void barebox_uncompress(void *compressed_start, unsigned int len)
-{
- decompress((void *)compressed_start,
- len,
- NULL, NULL,
- (void *)TEXT_BASE, NULL, errorfn);
-
- flush_icache();
-}
-
static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
uint32_t memsize, uint32_t boarddata)
{
@@ -111,7 +101,10 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
free_mem_ptr = endmem;
free_mem_end_ptr = free_mem_ptr + SZ_128K;
- barebox_uncompress((void *)pg_start, pg_len);
+ decompress((void *)pg_start, pg_len, NULL, NULL,
+ (void *)TEXT_BASE, NULL, errorfn);
+
+ flush_icache();
if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
barebox = (void *)(TEXT_BASE + 1);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 19/34] ARM AT91: switch to barebox_arm_entry part1
2013-01-27 10:46 ` [PATCH 19/34] ARM AT91: switch to barebox_arm_entry part1 Sascha Hauer
@ 2013-01-27 10:51 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:09 ` Sascha Hauer
0 siblings, 1 reply; 43+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 10:51 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 11:46 Sun 27 Jan , Sascha Hauer wrote:
> This switches the at91sam926x, 9g10 and 9g20 over to barebox_arm_entry.
> For these SoCs we currently support reading back the memory size from
> the SDRAM controller, so all of these can have a common reset() function.
can we wait after the cleanup on lowlevel
as I'm cleaning the AT91_BASE_SYS
patch send with 9261ek boostrao support
can you rebase over
at91sam9260/9g20/9261/9g10/9263: split soc lowlevel_init from generic
Best Regards,
J.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/boards/at91sam9263ek/Makefile | 4 ++--
> arch/arm/boards/mmccpu/Makefile | 4 ++--
> arch/arm/boards/pm9261/Makefile | 4 ++--
> arch/arm/boards/pm9263/Makefile | 4 ++--
> arch/arm/boards/tny-a926x/Makefile | 4 ++--
> arch/arm/boards/usb-a926x/Makefile | 4 ++--
> arch/arm/mach-at91/Kconfig | 19 ++++++++++++++-----
> arch/arm/mach-at91/Makefile | 10 +++++++---
> arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 11 ++++++++++-
> 9 files changed, 43 insertions(+), 21 deletions(-)
>
> diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
> index b6460c3..1702783 100644
> --- a/arch/arm/boards/at91sam9263ek/Makefile
> +++ b/arch/arm/boards/at91sam9263ek/Makefile
> @@ -1,5 +1,5 @@
> obj-y += init.o
>
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
>
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> diff --git a/arch/arm/boards/mmccpu/Makefile b/arch/arm/boards/mmccpu/Makefile
> index b6460c3..1702783 100644
> --- a/arch/arm/boards/mmccpu/Makefile
> +++ b/arch/arm/boards/mmccpu/Makefile
> @@ -1,5 +1,5 @@
> obj-y += init.o
>
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
>
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
> index b6460c3..1702783 100644
> --- a/arch/arm/boards/pm9261/Makefile
> +++ b/arch/arm/boards/pm9261/Makefile
> @@ -1,5 +1,5 @@
> obj-y += init.o
>
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
>
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> diff --git a/arch/arm/boards/pm9263/Makefile b/arch/arm/boards/pm9263/Makefile
> index b6460c3..1702783 100644
> --- a/arch/arm/boards/pm9263/Makefile
> +++ b/arch/arm/boards/pm9263/Makefile
> @@ -1,5 +1,5 @@
> obj-y += init.o
>
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
>
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> diff --git a/arch/arm/boards/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
> index 36ea09f..caa7163 100644
> --- a/arch/arm/boards/tny-a926x/Makefile
> +++ b/arch/arm/boards/tny-a926x/Makefile
> @@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
>
> lowlevel_init-$(CONFIG_MACH_TNY_A9263) = tny_a9263_lowlevel_init.o
>
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
>
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
> diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile
> index e314dd5..88f163f 100644
> --- a/arch/arm/boards/usb-a926x/Makefile
> +++ b/arch/arm/boards/usb-a926x/Makefile
> @@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
>
> lowlevel_init-$(CONFIG_MACH_USB_A9263) = usb_a9263_lowlevel_init.o
>
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
>
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index 9d4359e..4f30650 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -6,6 +6,9 @@ config HAVE_AT91_DBGU0
> config HAVE_AT91_DBGU1
> bool
>
> +config HAVE_AT91_LOWLEVEL_INIT
> + bool
> +
> config AT91SAM9_SMC
> bool
>
> @@ -77,6 +80,8 @@ config SOC_AT91SAM9260
> select HAVE_AT91_DBGU0
> select HAS_MACB
> select AT91SAM9_RESET
> + select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
> help
> Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
> or AT91SAM9G20 SoC.
> @@ -86,6 +91,8 @@ config SOC_AT91SAM9261
> select SOC_AT91SAM9
> select HAVE_AT91_DBGU0
> select AT91SAM9_RESET
> + select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
> help
> Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
>
> @@ -95,6 +102,8 @@ config SOC_AT91SAM9263
> select HAVE_AT91_DBGU1
> select HAS_MACB
> select AT91SAM9_RESET
> + select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
>
> config SOC_AT91SAM9G45
> bool
> @@ -263,7 +272,7 @@ config MACH_AT91SAM9261EK
> config MACH_PM9261
> bool "Ronetix PM9261"
> select HAS_DM9000
> - select MACH_HAS_LOWLEVEL_INIT
> + select HAVE_AT91_LOWLEVEL_INIT
> help
> Say y here if you are using the Ronetix PM9261 Board
>
> @@ -338,7 +347,7 @@ choice
>
> config MACH_AT91SAM9263EK
> bool "Atmel AT91SAM9263-EK"
> - select MACH_HAS_LOWLEVEL_INIT
> + select HAVE_AT91_LOWLEVEL_INIT
> select HAVE_NAND_ATMEL_BUSWIDTH_16
> help
> Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
> @@ -350,7 +359,7 @@ config MACH_MMCCPU
>
> config MACH_PM9263
> bool "Ronetix PM9263"
> - select MACH_HAS_LOWLEVEL_INIT
> + select HAVE_AT91_LOWLEVEL_INIT
> help
> Say y here if you are using the Ronetix PM9263 Board
>
> @@ -364,7 +373,7 @@ config MACH_TNY_A9263
>
> config MACH_USB_A9263
> bool "CALAO USB-A9263"
> - select MACH_HAS_LOWLEVEL_INIT
> + select HAVE_AT91_LOWLEVEL_INIT
> help
> Select this if you are using a Calao Systems USB-A9263.
> <http://www.calao-systems.com>
> @@ -508,7 +517,7 @@ endif
>
> config AT91_BOOTSTRAP
> bool "at91 bootstrap"
> - depends on MACH_HAS_LOWLEVEL_INIT
> + depends on HAVE_AT91_LOWLEVEL_INIT
> select BOOTSTRAP
>
> endif
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index 634b160..b94424e 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -2,11 +2,15 @@ obj-y += setup.o clock.o gpio.o
> obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
>
> obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
> -lowlevel_init-y = at91sam926x_lowlevel_init.o
> +lowlevel_init-$(CONFIG_ARCH_AT91SAM9260) = at91sam926x_lowlevel_init.o
> +lowlevel_init-$(CONFIG_ARCH_AT91SAM9261) = at91sam926x_lowlevel_init.o
> +lowlevel_init-$(CONFIG_ARCH_AT91SAM9263) = at91sam926x_lowlevel_init.o
> +lowlevel_init-$(CONFIG_ARCH_AT91SAM9G10) = at91sam926x_lowlevel_init.o
> +lowlevel_init-$(CONFIG_ARCH_AT91SAM9G20) = at91sam926x_lowlevel_init.o
> lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> +obj-y += $(lowlevel_init-y)
>
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> +pbl-y += $(lowlevel_init-y)
>
> obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
> obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
> diff --git a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> index 14afbc9..31e9f54 100644
> --- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> +++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> @@ -46,6 +46,7 @@ static int inline running_in_sram(void)
> return addr == 0;
> }
>
> +#ifdef CONFIG_HAVE_AT91_LOWLEVEL_INIT
> void __bare_init at91sam926x_lowlevel_init(void)
> {
> u32 r;
> @@ -191,8 +192,14 @@ void __bare_init at91sam926x_lowlevel_init(void)
> at91_pmc_write(AT91_PMC_PCER, 0xffffffff);
>
> end:
> - board_init_lowlevel_return();
> + barebox_arm_entry(AT91_SDRAM_BASE, at91_get_sdram_size(), 0);
> }
> +#else
> +static inline void at91sam926x_lowlevel_init(void)
> +{
> +}
> +#endif
> +
>
> void __naked __bare_init reset(void)
> {
> @@ -207,4 +214,6 @@ void __naked __bare_init reset(void)
> #endif
>
> at91sam926x_lowlevel_init();
> +
> + barebox_arm_entry(AT91_SDRAM_BASE, at91_get_sdram_size(), 0);
> }
> --
> 1.7.10.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 19/34] ARM AT91: switch to barebox_arm_entry part1
2013-01-27 10:51 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:09 ` Sascha Hauer
0 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-27 11:09 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Sun, Jan 27, 2013 at 11:51:35AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:46 Sun 27 Jan , Sascha Hauer wrote:
> > This switches the at91sam926x, 9g10 and 9g20 over to barebox_arm_entry.
> > For these SoCs we currently support reading back the memory size from
> > the SDRAM controller, so all of these can have a common reset() function.
>
> can we wait after the cleanup on lowlevel
>
> as I'm cleaning the AT91_BASE_SYS
>
> patch send with 9261ek boostrao support
>
> can you rebase over
>
> at91sam9260/9g20/9261/9g10/9263: split soc lowlevel_init from generic
Since this is based on -next I will have to rebase it anyway. I will
rebase this after the next merge flood on whatever is there.
Sascha
>
> Best Regards,
> J.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > arch/arm/boards/at91sam9263ek/Makefile | 4 ++--
> > arch/arm/boards/mmccpu/Makefile | 4 ++--
> > arch/arm/boards/pm9261/Makefile | 4 ++--
> > arch/arm/boards/pm9263/Makefile | 4 ++--
> > arch/arm/boards/tny-a926x/Makefile | 4 ++--
> > arch/arm/boards/usb-a926x/Makefile | 4 ++--
> > arch/arm/mach-at91/Kconfig | 19 ++++++++++++++-----
> > arch/arm/mach-at91/Makefile | 10 +++++++---
> > arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 11 ++++++++++-
> > 9 files changed, 43 insertions(+), 21 deletions(-)
> >
> > diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
> > index b6460c3..1702783 100644
> > --- a/arch/arm/boards/at91sam9263ek/Makefile
> > +++ b/arch/arm/boards/at91sam9263ek/Makefile
> > @@ -1,5 +1,5 @@
> > obj-y += init.o
> >
> > -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> >
> > -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> > diff --git a/arch/arm/boards/mmccpu/Makefile b/arch/arm/boards/mmccpu/Makefile
> > index b6460c3..1702783 100644
> > --- a/arch/arm/boards/mmccpu/Makefile
> > +++ b/arch/arm/boards/mmccpu/Makefile
> > @@ -1,5 +1,5 @@
> > obj-y += init.o
> >
> > -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> >
> > -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> > diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
> > index b6460c3..1702783 100644
> > --- a/arch/arm/boards/pm9261/Makefile
> > +++ b/arch/arm/boards/pm9261/Makefile
> > @@ -1,5 +1,5 @@
> > obj-y += init.o
> >
> > -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> >
> > -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> > diff --git a/arch/arm/boards/pm9263/Makefile b/arch/arm/boards/pm9263/Makefile
> > index b6460c3..1702783 100644
> > --- a/arch/arm/boards/pm9263/Makefile
> > +++ b/arch/arm/boards/pm9263/Makefile
> > @@ -1,5 +1,5 @@
> > obj-y += init.o
> >
> > -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> >
> > -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
> > +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
> > diff --git a/arch/arm/boards/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
> > index 36ea09f..caa7163 100644
> > --- a/arch/arm/boards/tny-a926x/Makefile
> > +++ b/arch/arm/boards/tny-a926x/Makefile
> > @@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
> >
> > lowlevel_init-$(CONFIG_MACH_TNY_A9263) = tny_a9263_lowlevel_init.o
> >
> > -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
> >
> > -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile
> > index e314dd5..88f163f 100644
> > --- a/arch/arm/boards/usb-a926x/Makefile
> > +++ b/arch/arm/boards/usb-a926x/Makefile
> > @@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
> >
> > lowlevel_init-$(CONFIG_MACH_USB_A9263) = usb_a9263_lowlevel_init.o
> >
> > -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > +obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
> >
> > -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > +pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> > index 9d4359e..4f30650 100644
> > --- a/arch/arm/mach-at91/Kconfig
> > +++ b/arch/arm/mach-at91/Kconfig
> > @@ -6,6 +6,9 @@ config HAVE_AT91_DBGU0
> > config HAVE_AT91_DBGU1
> > bool
> >
> > +config HAVE_AT91_LOWLEVEL_INIT
> > + bool
> > +
> > config AT91SAM9_SMC
> > bool
> >
> > @@ -77,6 +80,8 @@ config SOC_AT91SAM9260
> > select HAVE_AT91_DBGU0
> > select HAS_MACB
> > select AT91SAM9_RESET
> > + select MACH_HAS_LOWLEVEL_INIT
> > + select MACH_DO_LOWLEVEL_INIT
> > help
> > Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
> > or AT91SAM9G20 SoC.
> > @@ -86,6 +91,8 @@ config SOC_AT91SAM9261
> > select SOC_AT91SAM9
> > select HAVE_AT91_DBGU0
> > select AT91SAM9_RESET
> > + select MACH_HAS_LOWLEVEL_INIT
> > + select MACH_DO_LOWLEVEL_INIT
> > help
> > Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
> >
> > @@ -95,6 +102,8 @@ config SOC_AT91SAM9263
> > select HAVE_AT91_DBGU1
> > select HAS_MACB
> > select AT91SAM9_RESET
> > + select MACH_HAS_LOWLEVEL_INIT
> > + select MACH_DO_LOWLEVEL_INIT
> >
> > config SOC_AT91SAM9G45
> > bool
> > @@ -263,7 +272,7 @@ config MACH_AT91SAM9261EK
> > config MACH_PM9261
> > bool "Ronetix PM9261"
> > select HAS_DM9000
> > - select MACH_HAS_LOWLEVEL_INIT
> > + select HAVE_AT91_LOWLEVEL_INIT
> > help
> > Say y here if you are using the Ronetix PM9261 Board
> >
> > @@ -338,7 +347,7 @@ choice
> >
> > config MACH_AT91SAM9263EK
> > bool "Atmel AT91SAM9263-EK"
> > - select MACH_HAS_LOWLEVEL_INIT
> > + select HAVE_AT91_LOWLEVEL_INIT
> > select HAVE_NAND_ATMEL_BUSWIDTH_16
> > help
> > Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
> > @@ -350,7 +359,7 @@ config MACH_MMCCPU
> >
> > config MACH_PM9263
> > bool "Ronetix PM9263"
> > - select MACH_HAS_LOWLEVEL_INIT
> > + select HAVE_AT91_LOWLEVEL_INIT
> > help
> > Say y here if you are using the Ronetix PM9263 Board
> >
> > @@ -364,7 +373,7 @@ config MACH_TNY_A9263
> >
> > config MACH_USB_A9263
> > bool "CALAO USB-A9263"
> > - select MACH_HAS_LOWLEVEL_INIT
> > + select HAVE_AT91_LOWLEVEL_INIT
> > help
> > Select this if you are using a Calao Systems USB-A9263.
> > <http://www.calao-systems.com>
> > @@ -508,7 +517,7 @@ endif
> >
> > config AT91_BOOTSTRAP
> > bool "at91 bootstrap"
> > - depends on MACH_HAS_LOWLEVEL_INIT
> > + depends on HAVE_AT91_LOWLEVEL_INIT
> > select BOOTSTRAP
> >
> > endif
> > diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> > index 634b160..b94424e 100644
> > --- a/arch/arm/mach-at91/Makefile
> > +++ b/arch/arm/mach-at91/Makefile
> > @@ -2,11 +2,15 @@ obj-y += setup.o clock.o gpio.o
> > obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
> >
> > obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
> > -lowlevel_init-y = at91sam926x_lowlevel_init.o
> > +lowlevel_init-$(CONFIG_ARCH_AT91SAM9260) = at91sam926x_lowlevel_init.o
> > +lowlevel_init-$(CONFIG_ARCH_AT91SAM9261) = at91sam926x_lowlevel_init.o
> > +lowlevel_init-$(CONFIG_ARCH_AT91SAM9263) = at91sam926x_lowlevel_init.o
> > +lowlevel_init-$(CONFIG_ARCH_AT91SAM9G10) = at91sam926x_lowlevel_init.o
> > +lowlevel_init-$(CONFIG_ARCH_AT91SAM9G20) = at91sam926x_lowlevel_init.o
> > lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
> > -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > +obj-y += $(lowlevel_init-y)
> >
> > -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> > +pbl-y += $(lowlevel_init-y)
> >
> > obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
> > obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
> > diff --git a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> > index 14afbc9..31e9f54 100644
> > --- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> > +++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> > @@ -46,6 +46,7 @@ static int inline running_in_sram(void)
> > return addr == 0;
> > }
> >
> > +#ifdef CONFIG_HAVE_AT91_LOWLEVEL_INIT
> > void __bare_init at91sam926x_lowlevel_init(void)
> > {
> > u32 r;
> > @@ -191,8 +192,14 @@ void __bare_init at91sam926x_lowlevel_init(void)
> > at91_pmc_write(AT91_PMC_PCER, 0xffffffff);
> >
> > end:
> > - board_init_lowlevel_return();
> > + barebox_arm_entry(AT91_SDRAM_BASE, at91_get_sdram_size(), 0);
> > }
> > +#else
> > +static inline void at91sam926x_lowlevel_init(void)
> > +{
> > +}
> > +#endif
> > +
> >
> > void __naked __bare_init reset(void)
> > {
> > @@ -207,4 +214,6 @@ void __naked __bare_init reset(void)
> > #endif
> >
> > at91sam926x_lowlevel_init();
> > +
> > + barebox_arm_entry(AT91_SDRAM_BASE, at91_get_sdram_size(), 0);
> > }
> > --
> > 1.7.10.4
> >
> >
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 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] 43+ messages in thread
* Re: [PATCH 29/34] ARM: Factor out early mmu code
2013-01-27 10:46 ` [PATCH 29/34] ARM: Factor out early mmu code Sascha Hauer
@ 2013-01-27 14:54 ` Alexander Aring
2013-01-28 7:35 ` Sascha Hauer
0 siblings, 1 reply; 43+ messages in thread
From: Alexander Aring @ 2013-01-27 14:54 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Hi,
On Sun, Jan 27, 2013 at 11:46:58AM +0100, Sascha Hauer wrote:
> Move early mmu code to a separate file so that it can be
> used from the pbl and the regular image. Disabling the mmu
> can be dropped since the regular mmu code is now able to
> pickup an enabled mmu.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/cpu/Makefile | 4 +--
> arch/arm/cpu/mmu-early.c | 53 ++++++++++++++++++++++++++++++++++
> arch/arm/cpu/mmu-early.h | 6 ++++
> arch/arm/cpu/start-pbl.c | 72 ----------------------------------------------
> 4 files changed, 61 insertions(+), 74 deletions(-)
> create mode 100644 arch/arm/cpu/mmu-early.c
> create mode 100644 arch/arm/cpu/mmu-early.h
>
> diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
> index 4b0259c..44410ee 100644
> --- a/arch/arm/cpu/Makefile
> +++ b/arch/arm/cpu/Makefile
> @@ -8,8 +8,8 @@ obj-y += start.o setupc.o
> #
> obj-$(CONFIG_CMD_ARM_CPUINFO) += cpuinfo.o
> obj-$(CONFIG_CMD_ARM_MMUINFO) += mmuinfo.o
> -obj-$(CONFIG_MMU) += mmu.o cache.o
> -pbl-$(CONFIG_MMU) += cache.o
> +obj-$(CONFIG_MMU) += mmu.o cache.o mmu-early.o
> +pbl-$(CONFIG_MMU) += cache.o mmu-early.o
> obj-$(CONFIG_CPU_32v4T) += cache-armv4.o
> pbl-$(CONFIG_CPU_32v4T) += cache-armv4.o
> obj-$(CONFIG_CPU_32v5) += cache-armv5.o
> diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c
> new file mode 100644
> index 0000000..b8b30df
> --- /dev/null
> +++ b/arch/arm/cpu/mmu-early.c
> @@ -0,0 +1,53 @@
> +#include <common.h>
> +#include <asm/mmu.h>
> +#include <errno.h>
> +#include <sizes.h>
> +#include <asm/memory.h>
> +#include <asm/system.h>
> +#include <asm/cache.h>
> +
> +#include "mmu.h"
> +
> +static uint32_t *ttb;
> +
> +static void create_sections(unsigned long addr, int size_m, unsigned int flags)
> +{
> + int i;
> +
> + addr >>= 20;
> +
> + for (i = size_m; i > 0; i--, addr++)
> + ttb[addr] = (addr << 20) | flags;
> +}
> +
> +static void map_cachable(unsigned long start, unsigned long size)
> +{
> + start &= ~(SZ_1M - 1);
> + size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1);
Maybe we can use ALIGN macro from common.h here?
Only a small change, but it's easier to understand code.
I can send a patch for this, if you like that idea.
Similar we can create a macro ALIGN_DOWN for start.
Regards
Alex
> +
> + create_sections(start, size >> 20, PMD_SECT_AP_WRITE |
> + PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB);
> +}
> +
> +void mmu_early_enable(uint32_t membase, uint32_t memsize, uint32_t _ttb)
> +{
> + int i;
> +
> + ttb = (uint32_t *)_ttb;
> +
> + arm_set_cache_functions();
> +
> + /* Set the ttb register */
> + asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb) /*:*/);
> +
> + /* Set the Domain Access Control Register */
> + i = 0x3;
> + asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
> +
> + create_sections(0, 4096, PMD_SECT_AP_WRITE |
> + PMD_SECT_AP_READ | PMD_TYPE_SECT);
> +
> + map_cachable(membase, memsize);
> +
> + __mmu_cache_on();
> +}
> diff --git a/arch/arm/cpu/mmu-early.h b/arch/arm/cpu/mmu-early.h
> new file mode 100644
> index 0000000..af21f52
> --- /dev/null
> +++ b/arch/arm/cpu/mmu-early.h
> @@ -0,0 +1,6 @@
> +#ifndef __ARM_CPU_MMU_EARLY_H
> +#define __ARM_CPU_MMU_EARLY_H
> +
> +void mmu_early_enable(uint32_t membase, uint32_t memsize, uint32_t ttb);
> +
> +#endif /* __ARM_CPU_MMU_EARLY_H */
> diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
> index 6610be6..96a9dcf 100644
> --- a/arch/arm/cpu/start-pbl.c
> +++ b/arch/arm/cpu/start-pbl.c
> @@ -57,64 +57,6 @@ extern void *input_data_end;
> #include "../../../lib/decompress_inflate.c"
> #endif
>
> -static unsigned long *ttb;
> -
> -static void create_sections(unsigned long addr, int size_m, unsigned int flags)
> -{
> - int i;
> -
> - addr >>= 20;
> -
> - for (i = size_m; i > 0; i--, addr++)
> - ttb[addr] = (addr << 20) | flags;
> -}
> -
> -static void map_cachable(unsigned long start, unsigned long size)
> -{
> - start &= ~(SZ_1M - 1);
> - size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1);
> -
> - create_sections(start, size >> 20, PMD_SECT_AP_WRITE |
> - PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB);
> -}
> -
> -static void mmu_enable(unsigned long compressed_start, unsigned int len)
> -{
> - int i;
> -
> - /* Set the ttb register */
> - asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb) /*:*/);
> -
> - /* Set the Domain Access Control Register */
> - i = 0x3;
> - asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
> -
> - create_sections(0, 4096, PMD_SECT_AP_WRITE |
> - PMD_SECT_AP_READ | PMD_TYPE_SECT);
> - /*
> - * Setup all regions we need cacheable, namely:
> - * - the stack
> - * - the decompressor code
> - * - the compressed image
> - * - the uncompressed image
> - * - the early malloc space
> - */
> - map_cachable(STACK_BASE, STACK_SIZE);
> - map_cachable((unsigned long)&_text,
> - (unsigned long)&_end - (unsigned long)&_text);
> - map_cachable((unsigned long)compressed_start, len);
> - map_cachable(TEXT_BASE, len * 4);
> - map_cachable(free_mem_ptr, free_mem_end_ptr - free_mem_ptr);
> -
> - __mmu_cache_on();
> -}
> -
> -static void mmu_disable(void)
> -{
> - __mmu_cache_flush();
> - __mmu_cache_off();
> -}
> -
> static void noinline errorfn(char *error)
> {
> while (1);
> @@ -122,25 +64,11 @@ static void noinline errorfn(char *error)
>
> static void barebox_uncompress(void *compressed_start, unsigned int len)
> {
> - /*
> - * remap_cached currently does not work rendering the feature
> - * of enabling the MMU in the PBL useless. disable for now.
> - */
> - int use_mmu = 0;
> -
> - ttb = (void *)((free_mem_ptr - 0x4000) & ~0x3fff);
> -
> - if (use_mmu)
> - mmu_enable((unsigned long)compressed_start, len);
> -
> decompress((void *)compressed_start,
> len,
> NULL, NULL,
> (void *)TEXT_BASE, NULL, errorfn);
>
> - if (use_mmu)
> - mmu_disable();
> -
> flush_icache();
> }
>
> --
> 1.7.10.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 21/34] ARM AT91: switch remaining boards to barebox_arm_entry
2013-01-27 10:46 ` [PATCH 21/34] ARM AT91: switch remaining boards " Sascha Hauer
@ 2013-01-27 16:24 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 43+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 16:24 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 11:46 Sun 27 Jan , Sascha Hauer wrote:
> For At91 boards which do not have a SDRAM size detection function
> we create a lowlevel reset function which calls barebox_arm_entry
> manually with the known memory size.
I'll send a patch serie to add it
Best Regards,
J.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/Kconfig | 2 ++
> arch/arm/boards/at91sam9m10g45ek/Makefile | 2 ++
> arch/arm/boards/at91sam9m10g45ek/lowlevel.c | 11 +++++++++++
> arch/arm/boards/at91sam9m10ihd/Makefile | 2 ++
> arch/arm/boards/at91sam9m10ihd/lowlevel.c | 11 +++++++++++
> arch/arm/boards/at91sam9n12ek/Makefile | 2 ++
> arch/arm/boards/at91sam9n12ek/lowlevel.c | 11 +++++++++++
> arch/arm/boards/at91sam9x5ek/Makefile | 2 ++
> arch/arm/boards/at91sam9x5ek/lowlevel.c | 11 +++++++++++
> arch/arm/boards/pm9g45/Makefile | 2 ++
> arch/arm/boards/pm9g45/lowlevel.c | 11 +++++++++++
> arch/arm/mach-at91/Kconfig | 8 --------
> 12 files changed, 67 insertions(+), 8 deletions(-)
> create mode 100644 arch/arm/boards/at91sam9m10g45ek/lowlevel.c
> create mode 100644 arch/arm/boards/at91sam9m10ihd/lowlevel.c
> create mode 100644 arch/arm/boards/at91sam9n12ek/lowlevel.c
> create mode 100644 arch/arm/boards/at91sam9x5ek/lowlevel.c
> create mode 100644 arch/arm/boards/pm9g45/lowlevel.c
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index c7daebe..0d5e004 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -30,6 +30,8 @@ config ARCH_AT91
> select CLKDEV_LOOKUP
> select HAS_DEBUG_LL
> select HAVE_MACH_ARM_HEAD
> + select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
>
> config ARCH_BCM2835
> bool "Broadcom BCM2835 boards"
> diff --git a/arch/arm/boards/at91sam9m10g45ek/Makefile b/arch/arm/boards/at91sam9m10g45ek/Makefile
> index eb072c0..47ab803 100644
> --- a/arch/arm/boards/at91sam9m10g45ek/Makefile
> +++ b/arch/arm/boards/at91sam9m10g45ek/Makefile
> @@ -1 +1,3 @@
> obj-y += init.o
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> diff --git a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
> new file mode 100644
> index 0000000..65259bb
> --- /dev/null
> +++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
> @@ -0,0 +1,11 @@
> +#include <common.h>
> +#include <sizes.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/hardware.h>
> +
> +void __naked reset(void)
> +{
> + common_reset();
> + barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
> +}
> diff --git a/arch/arm/boards/at91sam9m10ihd/Makefile b/arch/arm/boards/at91sam9m10ihd/Makefile
> index f2acf20..4ec0b36 100644
> --- a/arch/arm/boards/at91sam9m10ihd/Makefile
> +++ b/arch/arm/boards/at91sam9m10ihd/Makefile
> @@ -1,2 +1,4 @@
> obj-y += init.o
> obj-y += hw_version.o
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> diff --git a/arch/arm/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
> new file mode 100644
> index 0000000..65259bb
> --- /dev/null
> +++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
> @@ -0,0 +1,11 @@
> +#include <common.h>
> +#include <sizes.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/hardware.h>
> +
> +void __naked reset(void)
> +{
> + common_reset();
> + barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
> +}
> diff --git a/arch/arm/boards/at91sam9n12ek/Makefile b/arch/arm/boards/at91sam9n12ek/Makefile
> index eb072c0..6c1a61f 100644
> --- a/arch/arm/boards/at91sam9n12ek/Makefile
> +++ b/arch/arm/boards/at91sam9n12ek/Makefile
> @@ -1 +1,3 @@
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> obj-y += init.o
> diff --git a/arch/arm/boards/at91sam9n12ek/lowlevel.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
> new file mode 100644
> index 0000000..65259bb
> --- /dev/null
> +++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
> @@ -0,0 +1,11 @@
> +#include <common.h>
> +#include <sizes.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/hardware.h>
> +
> +void __naked reset(void)
> +{
> + common_reset();
> + barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
> +}
> diff --git a/arch/arm/boards/at91sam9x5ek/Makefile b/arch/arm/boards/at91sam9x5ek/Makefile
> index f2acf20..4ec0b36 100644
> --- a/arch/arm/boards/at91sam9x5ek/Makefile
> +++ b/arch/arm/boards/at91sam9x5ek/Makefile
> @@ -1,2 +1,4 @@
> obj-y += init.o
> obj-y += hw_version.o
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> diff --git a/arch/arm/boards/at91sam9x5ek/lowlevel.c b/arch/arm/boards/at91sam9x5ek/lowlevel.c
> new file mode 100644
> index 0000000..65259bb
> --- /dev/null
> +++ b/arch/arm/boards/at91sam9x5ek/lowlevel.c
> @@ -0,0 +1,11 @@
> +#include <common.h>
> +#include <sizes.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/hardware.h>
> +
> +void __naked reset(void)
> +{
> + common_reset();
> + barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
> +}
> diff --git a/arch/arm/boards/pm9g45/Makefile b/arch/arm/boards/pm9g45/Makefile
> index eb072c0..47ab803 100644
> --- a/arch/arm/boards/pm9g45/Makefile
> +++ b/arch/arm/boards/pm9g45/Makefile
> @@ -1 +1,3 @@
> obj-y += init.o
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
> new file mode 100644
> index 0000000..65259bb
> --- /dev/null
> +++ b/arch/arm/boards/pm9g45/lowlevel.c
> @@ -0,0 +1,11 @@
> +#include <common.h>
> +#include <sizes.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/hardware.h>
> +
> +void __naked reset(void)
> +{
> + common_reset();
> + barebox_arm_entry(AT91_SDRAM_BASE, SZ_128M, 0);
> +}
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index ec9e88b..13f4f21 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -72,8 +72,6 @@ config SOC_AT91RM9200
> select CPU_ARM920T
> select HAVE_AT91_DBGU0
> select HAS_AT91_ETHER
> - select MACH_HAS_LOWLEVEL_INIT
> - select MACH_DO_LOWLEVEL_INIT
>
> config SOC_AT91SAM9260
> bool
> @@ -81,8 +79,6 @@ config SOC_AT91SAM9260
> select HAVE_AT91_DBGU0
> select HAS_MACB
> select AT91SAM9_RESET
> - select MACH_HAS_LOWLEVEL_INIT
> - select MACH_DO_LOWLEVEL_INIT
> help
> Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
> or AT91SAM9G20 SoC.
> @@ -92,8 +88,6 @@ config SOC_AT91SAM9261
> select SOC_AT91SAM9
> select HAVE_AT91_DBGU0
> select AT91SAM9_RESET
> - select MACH_HAS_LOWLEVEL_INIT
> - select MACH_DO_LOWLEVEL_INIT
> help
> Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
>
> @@ -103,8 +97,6 @@ config SOC_AT91SAM9263
> select HAVE_AT91_DBGU1
> select HAS_MACB
> select AT91SAM9_RESET
> - select MACH_HAS_LOWLEVEL_INIT
> - select MACH_DO_LOWLEVEL_INIT
>
> config SOC_AT91SAM9G45
> bool
> --
> 1.7.10.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 16/34] ARM clep7212: switch to barebox_arm_entry
2013-01-27 10:46 ` [PATCH 16/34] ARM clep7212: " Sascha Hauer
@ 2013-01-27 16:32 ` Alexander Shiyan
2013-01-28 7:41 ` Sascha Hauer
0 siblings, 1 reply; 43+ messages in thread
From: Alexander Shiyan @ 2013-01-27 16:32 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/Kconfig | 2 ++
> arch/arm/boards/clep7212/lowlevel.c | 3 ++-
> arch/arm/mach-clps711x/Kconfig | 2 --
> 3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 3197f8b..6ed9bf0 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -44,6 +44,8 @@ config ARCH_CLPS711X
> bool "Cirrus Logic EP711x/EP721x/EP731x"
> select CLKDEV_LOOKUP
> select CPU_32v4T
> + select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
>
> config ARCH_EP93XX
> bool "Cirrus Logic EP93xx"
> diff --git a/arch/arm/boards/clep7212/lowlevel.c b/arch/arm/boards/clep7212/lowlevel.c
> index 9b7e241..7465a42 100644
> --- a/arch/arm/boards/clep7212/lowlevel.c
> +++ b/arch/arm/boards/clep7212/lowlevel.c
> @@ -9,6 +9,7 @@
>
> #include <common.h>
> #include <init.h>
> +#include <sizes.h>
>
> #include <asm/io.h>
> #include <asm/barebox-arm.h>
> @@ -52,5 +53,5 @@ void __naked __bare_init reset(void)
> writel(SDCONF_CASLAT_3 | SDCONF_SIZE_256 | SDCONF_WIDTH_16 |
> SDCONF_CLKCTL | SDCONF_ACTIVE, SDCONF);
>
> - board_init_lowlevel_return();
> + barebox_arm_entry(SDRAM0_BASE, SZ_32M, 0);
...
Since this code placed in pbl, can we define a minimal size at this point?
Some targets may have a little than 32M.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 29/34] ARM: Factor out early mmu code
2013-01-27 14:54 ` Alexander Aring
@ 2013-01-28 7:35 ` Sascha Hauer
0 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-28 7:35 UTC (permalink / raw)
To: Alexander Aring; +Cc: barebox
On Sun, Jan 27, 2013 at 03:54:35PM +0100, Alexander Aring wrote:
> > +static void create_sections(unsigned long addr, int size_m, unsigned int flags)
> > +{
> > + int i;
> > +
> > + addr >>= 20;
> > +
> > + for (i = size_m; i > 0; i--, addr++)
> > + ttb[addr] = (addr << 20) | flags;
> > +}
> > +
> > +static void map_cachable(unsigned long start, unsigned long size)
> > +{
> > + start &= ~(SZ_1M - 1);
> > + size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1);
> Maybe we can use ALIGN macro from common.h here?
> Only a small change, but it's easier to understand code.
> I can send a patch for this, if you like that idea.
>
> Similar we can create a macro ALIGN_DOWN for start.
Good idea. I'll integrate this when redoing this series.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 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] 43+ messages in thread
* Re: [PATCH 16/34] ARM clep7212: switch to barebox_arm_entry
2013-01-27 16:32 ` Alexander Shiyan
@ 2013-01-28 7:41 ` Sascha Hauer
0 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-01-28 7:41 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: barebox
On Sun, Jan 27, 2013 at 08:32:15PM +0400, Alexander Shiyan wrote:
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > arch/arm/Kconfig | 2 ++
> > arch/arm/boards/clep7212/lowlevel.c | 3 ++-
> > arch/arm/mach-clps711x/Kconfig | 2 --
> > 3 files changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 3197f8b..6ed9bf0 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -44,6 +44,8 @@ config ARCH_CLPS711X
> > bool "Cirrus Logic EP711x/EP721x/EP731x"
> > select CLKDEV_LOOKUP
> > select CPU_32v4T
> > + select MACH_HAS_LOWLEVEL_INIT
> > + select MACH_DO_LOWLEVEL_INIT
> >
> > config ARCH_EP93XX
> > bool "Cirrus Logic EP93xx"
> > diff --git a/arch/arm/boards/clep7212/lowlevel.c b/arch/arm/boards/clep7212/lowlevel.c
> > index 9b7e241..7465a42 100644
> > --- a/arch/arm/boards/clep7212/lowlevel.c
> > +++ b/arch/arm/boards/clep7212/lowlevel.c
> > @@ -9,6 +9,7 @@
> >
> > #include <common.h>
> > #include <init.h>
> > +#include <sizes.h>
> >
> > #include <asm/io.h>
> > #include <asm/barebox-arm.h>
> > @@ -52,5 +53,5 @@ void __naked __bare_init reset(void)
> > writel(SDCONF_CASLAT_3 | SDCONF_SIZE_256 | SDCONF_WIDTH_16 |
> > SDCONF_CLKCTL | SDCONF_ACTIVE, SDCONF);
> >
> > - board_init_lowlevel_return();
> > + barebox_arm_entry(SDRAM0_BASE, SZ_32M, 0);
> ...
> Since this code placed in pbl, can we define a minimal size at this point?
> Some targets may have a little than 32M.
I'm not sure what you mean. First of all this only ends up in the pbl
when it's enabled. For the clep7212 it's not enabled, so this code will
go into the regular binary.
You can call barebox_arm_entry with any sdram size you like. Ideally
this would be the sdram size you actually have, but if you support a
board with less memory you can pass the minimum amount of memory.
I don't know if this already answers your question; could you elaborate
more if not?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 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] 43+ messages in thread
* [PATCH 15/34] ARM netx boards: switch to barebox_arm_entry
2013-02-01 7:59 [PATCH v2] Add new ARM entry point for barebox Sascha Hauer
@ 2013-02-01 7:59 ` Sascha Hauer
0 siblings, 0 replies; 43+ messages in thread
From: Sascha Hauer @ 2013-02-01 7:59 UTC (permalink / raw)
To: barebox
Only one board supported, the nxdb500. Uses hardcoded SDRAM settings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 2 ++
arch/arm/boards/netx/platform.S | 7 +++++--
arch/arm/mach-netx/Kconfig | 1 -
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 79f797e..3197f8b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -72,6 +72,8 @@ config ARCH_MXS
config ARCH_NETX
bool "Hilscher NetX based"
select CPU_ARM926T
+ select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
config ARCH_NOMADIK
bool "STMicroelectronics Nomadik"
diff --git a/arch/arm/boards/netx/platform.S b/arch/arm/boards/netx/platform.S
index 0438921..95ac13b 100644
--- a/arch/arm/boards/netx/platform.S
+++ b/arch/arm/boards/netx/platform.S
@@ -16,10 +16,13 @@
* GNU General Public License for more details.
*
*/
-
+#include <sizes.h>
#include <asm/barebox-arm-head.h>
.globl reset
reset:
common_reset r0
- b board_init_lowlevel_return
+ mov r0, #0x80000000
+ mov r1, #SZ_64M
+ mov r2, #0
+ b barebox_arm_entry
diff --git a/arch/arm/mach-netx/Kconfig b/arch/arm/mach-netx/Kconfig
index b767e54..8d8f49b 100644
--- a/arch/arm/mach-netx/Kconfig
+++ b/arch/arm/mach-netx/Kconfig
@@ -45,7 +45,6 @@ choice
config MACH_NXDB500
bool "Hilscher Netx nxdb500"
select HAS_NETX_ETHER
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Hilscher Netx nxdb500 board
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 43+ messages in thread
end of thread, other threads:[~2013-02-01 8:00 UTC | newest]
Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-27 10:46 [PATCH] Add new ARM entry point for barebox Sascha Hauer
2013-01-27 10:46 ` [PATCH 01/34] ARM: Add new " Sascha Hauer
2013-01-27 10:46 ` [PATCH 02/34] ARM: add __noreturn to board_init_lowlevel_return Sascha Hauer
2013-01-27 10:46 ` [PATCH 03/34] ARM i.MX: Use SRAM stack in lowlevel code Sascha Hauer
2013-01-27 10:46 ` [PATCH 04/34] ARM i.MX: Add i.MX specific entry point for barebox Sascha Hauer
2013-01-27 10:46 ` [PATCH 05/34] ARM i.MX: prepare external nand boot for SoC specific entry Sascha Hauer
2013-01-27 10:46 ` [PATCH 06/34] ARM i.MX boards: switch to barebox_arm_entry Sascha Hauer
2013-01-27 10:46 ` [PATCH 07/34] ARM MXS " Sascha Hauer
2013-01-27 10:46 ` [PATCH 08/34] ARM OMAP " Sascha Hauer
2013-01-27 10:46 ` [PATCH 09/34] ARM Samsung " Sascha Hauer
2013-01-27 10:46 ` [PATCH 10/34] ARM PXA " Sascha Hauer
2013-01-27 10:46 ` [PATCH 11/34] ARM ep93xx " Sascha Hauer
2013-01-27 10:46 ` [PATCH 12/34] ARM tegra " Sascha Hauer
2013-01-27 10:46 ` [PATCH 13/34] ARM nomadik " Sascha Hauer
2013-01-27 10:46 ` [PATCH 14/34] ARM versatile " Sascha Hauer
2013-01-27 10:46 ` [PATCH 15/34] ARM netx " Sascha Hauer
2013-01-27 10:46 ` [PATCH 16/34] ARM clep7212: " Sascha Hauer
2013-01-27 16:32 ` Alexander Shiyan
2013-01-28 7:41 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 17/34] ARM raspberrypi: " Sascha Hauer
2013-01-27 10:46 ` [PATCH 18/34] ARM AT91 mmccpu: Fix non existing define Sascha Hauer
2013-01-27 10:46 ` [PATCH 19/34] ARM AT91: switch to barebox_arm_entry part1 Sascha Hauer
2013-01-27 10:51 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:09 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 20/34] ARM AT91: switch at91rm9200 board to barebox_arm_entry Sascha Hauer
2013-01-27 10:46 ` [PATCH 21/34] ARM AT91: switch remaining boards " Sascha Hauer
2013-01-27 16:24 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 10:46 ` [PATCH 22/34] ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT Sascha Hauer
2013-01-27 10:46 ` [PATCH 23/34] ARM start-pbl: make board_init_lowlevel_return static Sascha Hauer
2013-01-27 10:46 ` [PATCH 24/34] ARM start-pbl: call uncompressed binary with arguments Sascha Hauer
2013-01-27 10:46 ` [PATCH 25/34] ARM start: pickup parameters from pbl Sascha Hauer
2013-01-27 10:46 ` [PATCH 26/34] ARM: Setup stack at end of SDRAM Sascha Hauer
2013-01-27 10:46 ` [PATCH 27/34] ARM pbl: Use dynamic parameters for early malloc space Sascha Hauer
2013-01-27 10:46 ` [PATCH 28/34] ARM mmu: pickup already enabled mmu Sascha Hauer
2013-01-27 10:46 ` [PATCH 29/34] ARM: Factor out early mmu code Sascha Hauer
2013-01-27 14:54 ` Alexander Aring
2013-01-28 7:35 ` Sascha Hauer
2013-01-27 10:46 ` [PATCH 30/34] ARM: Enable mmu early Sascha Hauer
2013-01-27 10:47 ` [PATCH 31/34] ARM: Automatically determine malloc size Sascha Hauer
2013-01-27 10:47 ` [PATCH 32/34] generic memory layout: fix deps for [MALLOC|STACK]_BASE Sascha Hauer
2013-01-27 10:47 ` [PATCH 33/34] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT Sascha Hauer
2013-01-27 10:47 ` [PATCH 34/34] ARM pbl: inline decompress function Sascha Hauer
2013-02-01 7:59 [PATCH v2] Add new ARM entry point for barebox Sascha Hauer
2013-02-01 7:59 ` [PATCH 15/34] ARM netx boards: switch to barebox_arm_entry Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox