* [PATCH] ARM: Make memory known to lowlevel code
@ 2012-10-17 21:03 Sascha Hauer
2012-10-17 21:03 ` [PATCH 01/28] ARM: Make malloc available in all initcalls Sascha Hauer
` (27 more replies)
0 siblings, 28 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
Memory is a precious resource and should be known early. This series
adds a new entry point for ARM which is passed the SDRAM region used
for barebox. This allows us to setup the stack and malloc space
according to the RAM we have and get rid of the values from Kconfig.
Later with relocatable binary support it will allow us to find a
suitable base for barebox.
With the new entry point it is also possible for the lowlevel code
to pass a pointer on to barebox which can be retrieved later. This
way data from an earlier loader can be passed on.
It is not necessary to pass the whole SDRAM to the entry point (which
wouldn't be possible anyway when there are multiple memory banks).
It instead is enough to pass the memory barebox should use for itself.
i.MX gets functions to read back the SDRAM size from the controller.
Atmel and Samsung also have such a function, but these are not used
by every board, I didn't change that. Other boards have different
possible SDRAM sizes, I passed the minimum amount to the barebox
entry.
Sascha
----------------------------------------------------------------
Sascha Hauer (28):
ARM: Make malloc available in all initcalls
ARM at91sam926x: provide reset function for boards with lowlevel init
ARM at91rm9200: provide reset function for boards with lowlevel init
ARM: Add new entry point for barebox
ARM i.MX Add functions to get sdram base and size
ARM i.MX boards: switch to barebox_arm_entry
ARM AT91 boards: switch to barebox_arm_entry
ARM i.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: remove now unused *_LOWLEVEL_INIT Kconfig options
ARM start: remove unused board_init_lowlevel* functions
ARM pbl: setup stack at end of SDRAM
ARM pbl: Call uncompressed binary with arguments
ARM pbl: make MMU functional again
ARM start: pick up memory/boarddata arguments from pbl
ARM start: Add barebox_arm_boarddata function
ARM: Determine base and size of malloc space from SDRAM
ARM pbl: always copy piggydata
ARM i.MX: Use SRAM stack in lowlevel code
generic memory layout: fix deps for [MALLOC|STACK]_BASE
ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT
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 | 4 +-
arch/arm/boards/at91rm9200ek/Makefile | 2 +
arch/arm/boards/at91rm9200ek/lowlevel.c | 14 +
arch/arm/boards/at91sam9260ek/Makefile | 2 +
arch/arm/boards/at91sam9260ek/lowlevel.c | 12 +
arch/arm/boards/at91sam9261ek/Makefile | 2 +
arch/arm/boards/at91sam9261ek/lowlevel.c | 12 +
arch/arm/boards/at91sam9263ek/Makefile | 2 +
arch/arm/boards/at91sam9263ek/lowlevel.c | 15 ++
arch/arm/boards/at91sam9m10g45ek/Makefile | 2 +
arch/arm/boards/at91sam9m10g45ek/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/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/crystalfontz-cfa10036/Makefile | 2 +
arch/arm/boards/crystalfontz-cfa10036/lowlevel.c | 11 +
arch/arm/boards/dss11/Makefile | 2 +
arch/arm/boards/dss11/lowlevel.c | 12 +
arch/arm/boards/eukrea_cpuimx25/lowlevel.c | 12 +-
arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c | 2 +-
arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S | 7 +-
arch/arm/boards/eukrea_cpuimx35/lowlevel.c | 13 +-
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 +
arch/arm/boards/freescale-mx25-3-stack/3stack.c | 2 +-
.../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 | 7 +-
.../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 | 13 +-
arch/arm/boards/guf-neso/lowlevel.c | 13 +-
arch/arm/boards/imx21ads/imx21ads.c | 5 +-
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 | 12 +-
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 | 3 +-
arch/arm/boards/mioa701/Makefile | 2 +
arch/arm/boards/mioa701/lowlevel.c | 10 +
arch/arm/boards/mmccpu/Makefile | 2 +
arch/arm/boards/mmccpu/lowlevel.c | 12 +
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_init.S | 4 +-
arch/arm/boards/pcm037/pcm037.c | 2 +-
arch/arm/boards/pcm038/lowlevel.c | 12 +-
arch/arm/boards/pcm043/lowlevel.c | 13 +-
arch/arm/boards/pcm049/lowlevel.c | 7 +-
arch/arm/boards/phycard-a-l1/Makefile | 2 +
arch/arm/boards/phycard-a-xl2/lowlevel.c | 7 +-
arch/arm/boards/phycard-i.MX27/lowlevel_init.S | 5 +-
arch/arm/boards/pm9261/Makefile | 2 +
arch/arm/boards/pm9261/lowlevel.c | 14 +
arch/arm/boards/pm9263/Makefile | 2 +
arch/arm/boards/pm9263/lowlevel.c | 14 +
arch/arm/boards/pm9g45/Makefile | 2 +
arch/arm/boards/pm9g45/lowlevel.c | 11 +
arch/arm/boards/qil-a9260/Makefile | 2 +
arch/arm/boards/qil-a9260/lowlevel.c | 12 +
arch/arm/boards/scb9328/lowlevel_init.S | 4 +-
arch/arm/boards/tny-a926x/Makefile | 2 +
arch/arm/boards/tny-a926x/lowlevel.c | 12 +
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 | 2 +
arch/arm/boards/usb-a926x/lowlevel.c | 12 +
arch/arm/boards/versatile/Makefile | 3 +-
arch/arm/boards/versatile/lowlevel.c | 10 +
arch/arm/cpu/cpu.c | 9 +
arch/arm/cpu/start-pbl.c | 105 +++-----
arch/arm/cpu/start.c | 110 ++++++--
arch/arm/include/asm/barebox-arm.h | 5 +-
arch/arm/lib/Makefile | 1 -
arch/arm/lib/arm.c | 14 -
arch/arm/mach-at91/Kconfig | 16 +-
arch/arm/mach-at91/Makefile | 9 +-
arch/arm/mach-at91/at91rm9200_lowlevel_init.c | 11 +-
arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 11 +-
arch/arm/mach-at91/include/mach/board.h | 4 +
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 | 16 --
arch/arm/mach-imx/Makefile | 3 +-
arch/arm/mach-imx/esdctl.c | 273 ++++++++++++++++++++
arch/arm/mach-imx/imx1.c | 2 +
arch/arm/mach-imx/include/mach/esdctl.h | 13 +
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-netx/Kconfig | 1 -
arch/arm/mach-omap/Kconfig | 5 -
arch/arm/mach-omap/include/mach/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 | 20 +-
common/Kconfig | 12 -
common/meminfo.c | 5 -
include/asm-generic/memory_layout.h | 6 +-
142 files changed, 1126 insertions(+), 308 deletions(-)
create mode 100644 arch/arm/boards/at91rm9200ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9260ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9261ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9263ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9m10g45ek/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/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/dss11/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/mmccpu/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/pm9261/lowlevel.c
create mode 100644 arch/arm/boards/pm9263/lowlevel.c
create mode 100644 arch/arm/boards/pm9g45/lowlevel.c
create mode 100644 arch/arm/boards/qil-a9260/lowlevel.c
create mode 100644 arch/arm/boards/tny-a926x/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/usb-a926x/lowlevel.c
create mode 100644 arch/arm/boards/versatile/lowlevel.c
delete mode 100644 arch/arm/lib/arm.c
create mode 100644 arch/arm/mach-imx/esdctl.c
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 01/28] ARM: Make malloc available in all initcalls
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 02/28] ARM at91sam926x: provide reset function for boards with lowlevel init Sascha Hauer
` (26 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
This moves mem_malloc_init from an initcall to board_init_lowlevel_return.
This has the advantage that malloc is now available for all initcalls (though
only on ARM currently).
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start.c | 3 +++
arch/arm/lib/Makefile | 1 -
arch/arm/lib/arm.c | 14 --------------
3 files changed, 3 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 793445a..d47a9e9 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -61,5 +61,8 @@ void __naked board_init_lowlevel_return(void)
setup_c();
+ mem_malloc_init((void *)MALLOC_BASE,
+ (void *)(MALLOC_BASE + MALLOC_SIZE - 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] 40+ messages in thread
* [PATCH 02/28] ARM at91sam926x: provide reset function for boards with lowlevel init
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
2012-10-17 21:03 ` [PATCH 01/28] ARM: Make malloc available in all initcalls Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-18 7:26 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 21:03 ` [PATCH 03/28] ARM at91rm9200: " Sascha Hauer
` (25 subsequent siblings)
27 siblings, 1 reply; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
Some Atmel boards use a reset() function provided by the architecture.
Add a reset function for the board instead and call the architecture
specific init function from there. While at it, test if we are running
from SDRAM and skip the init function in this case. This makes the configs
safe for both first and second stage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/at91sam9263ek/Makefile | 2 ++
arch/arm/boards/at91sam9263ek/lowlevel.c | 15 +++++++++++++++
arch/arm/boards/pm9261/Makefile | 2 ++
arch/arm/boards/pm9261/lowlevel.c | 14 ++++++++++++++
arch/arm/boards/pm9263/Makefile | 2 ++
arch/arm/boards/pm9263/lowlevel.c | 14 ++++++++++++++
arch/arm/mach-at91/Kconfig | 11 +++++++++++
arch/arm/mach-at91/Makefile | 4 +++-
arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 9 +++++++--
arch/arm/mach-at91/include/mach/board.h | 3 +++
10 files changed, 73 insertions(+), 3 deletions(-)
create mode 100644 arch/arm/boards/at91sam9263ek/lowlevel.c
create mode 100644 arch/arm/boards/pm9261/lowlevel.c
create mode 100644 arch/arm/boards/pm9263/lowlevel.c
diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/at91sam9263ek/Makefile
+++ b/arch/arm/boards/at91sam9263ek/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/at91sam9263ek/lowlevel.c b/arch/arm/boards/at91sam9263ek/lowlevel.c
new file mode 100644
index 0000000..6050bcd
--- /dev/null
+++ b/arch/arm/boards/at91sam9263ek/lowlevel.c
@@ -0,0 +1,15 @@
+#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>
+#include <mach/at91sam9_sdramc.h>
+
+void __naked __bare_init reset(void)
+{
+ common_reset();
+
+ at91sam926x_entry(AT91_SDRAM_BASE, at91_get_sdram_size());
+}
diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/pm9261/Makefile
+++ b/arch/arm/boards/pm9261/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/pm9261/lowlevel.c b/arch/arm/boards/pm9261/lowlevel.c
new file mode 100644
index 0000000..b8a8728
--- /dev/null
+++ b/arch/arm/boards/pm9261/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();
+
+ at91sam926x_entry(AT91_SDRAM_BASE, SZ_64M);
+}
diff --git a/arch/arm/boards/pm9263/Makefile b/arch/arm/boards/pm9263/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/pm9263/Makefile
+++ b/arch/arm/boards/pm9263/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/pm9263/lowlevel.c b/arch/arm/boards/pm9263/lowlevel.c
new file mode 100644
index 0000000..b8a8728
--- /dev/null
+++ b/arch/arm/boards/pm9263/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();
+
+ at91sam926x_entry(AT91_SDRAM_BASE, SZ_64M);
+}
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 30225fa..f962084 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -107,6 +107,9 @@ config SUPPORT_CALAO_DAB_MMX
config SUPPORT_CALAO_MOB_TNY_MD2
bool
+config HAVE_AT91SAM926X_LOWLEVEL_INIT
+ bool
+
# ----------------------------------------------------------
if ARCH_AT91RM9200
@@ -116,6 +119,7 @@ choice
prompt "AT91RM9200 Board Type"
config MACH_AT91RM9200EK
+ select HAVE_AT91RM9200_LOWLEVEL_INIT
bool "Atmel AT91RM9200-EK Evaluation Kit"
help
Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
@@ -180,8 +184,10 @@ config MACH_AT91SAM9261EK
config MACH_PM9261
bool "Ronetix PM9261"
+ select HAVE_AT91SAM926X_LOWLEVEL_INIT
select HAS_DM9000
select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
help
Say y here if you are using the Ronetix PM9261 Board
@@ -258,18 +264,23 @@ choice
config MACH_AT91SAM9263EK
bool "Atmel AT91SAM9263-EK"
select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
select HAVE_NAND_ATMEL_BUSWIDTH_16
+ select HAVE_AT91SAM926X_LOWLEVEL_INIT
help
Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
config MACH_MMCCPU
bool "Bucyrus MMC-CPU"
+ select HAVE_AT91SAM926X_LOWLEVEL_INIT
help
Say y here if you are using the Bucyrus MMC-CPU
config MACH_PM9263
bool "Ronetix PM9263"
select MACH_HAS_LOWLEVEL_INIT
+ select MACH_DO_LOWLEVEL_INIT
+ select HAVE_AT91SAM926X_LOWLEVEL_INIT
help
Say y here if you are using the Ronetix PM9263 Board
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 3ade725..f9cb4f1 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -1,11 +1,13 @@
obj-y += clock.o gpio.o
-lowlevel_init-y = at91sam926x_lowlevel_init.o
lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+obj-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
+
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 0ee0345..a399854 100644
--- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
@@ -34,12 +34,17 @@ static void inline pmc_check_mckrdy(void)
} while (!(r & AT91_PMC_MCKRDY));
}
-void __naked __bare_init reset(void)
+void __naked __bare_init at91sam926x_entry(unsigned long sdram_base,
+ unsigned long sdram_size)
{
+ uint32_t pc;
u32 r;
int i;
- common_reset();
+ pc = get_pc();
+
+ if (pc < AT91_SDRAM_BASE || pc > AT91_SDRAM_BASE + 0x10000000)
+ goto end;
at91_sys_write(AT91_WDT_MR, CONFIG_SYS_WDTC_WDMR_VAL);
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 670c73d..eb71ed5 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -154,4 +154,7 @@ struct at91_spi_platform_data {
};
void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata);
+
+void at91sam926x_entry(unsigned long sdram_base, unsigned long sdram_size);
+
#endif
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 03/28] ARM at91rm9200: provide reset function for boards with lowlevel init
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
2012-10-17 21:03 ` [PATCH 01/28] ARM: Make malloc available in all initcalls Sascha Hauer
2012-10-17 21:03 ` [PATCH 02/28] ARM at91sam926x: provide reset function for boards with lowlevel init Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-18 7:27 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 21:03 ` [PATCH 04/28] ARM: Add new entry point for barebox Sascha Hauer
` (24 subsequent siblings)
27 siblings, 1 reply; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
Some Atmel boards use a reset() function provided by the architecture.
Add a reset function for the board instead and call the architecture
specific init function from there. While at it, test if we are running
from SDRAM and skip the init function in this case. This makes the configs
safe for both first and second stage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/at91rm9200ek/Makefile | 2 ++
arch/arm/mach-at91/Kconfig | 3 +++
arch/arm/mach-at91/Makefile | 7 ++-----
arch/arm/mach-at91/at91rm9200_lowlevel_init.c | 9 ++++++---
arch/arm/mach-at91/include/mach/board.h | 1 +
5 files changed, 14 insertions(+), 8 deletions(-)
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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index f962084..8ec033b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -110,6 +110,9 @@ config SUPPORT_CALAO_MOB_TNY_MD2
config HAVE_AT91SAM926X_LOWLEVEL_INIT
bool
+config HAVE_AT91RM9200_LOWLEVEL_INIT
+ bool
+
# ----------------------------------------------------------
if ARCH_AT91RM9200
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index f9cb4f1..5ce433c 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -1,10 +1,7 @@
obj-y += clock.o gpio.o
-lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
-
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
-
+obj-$(CONFIG_HAVE_AT91RM9200_LOWLEVEL_INIT) += at91rm9200_lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91RM9200_LOWLEVEL_INIT) += at91rm9200_lowlevel_init.o
obj-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
pbl-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
diff --git a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
index 3ce3e67..a0a0d5e 100644
--- a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
@@ -21,12 +21,15 @@ 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_base,
+ unsigned long sdram_size)
{
- u32 r;
+ u32 r, pc;
int i;
- common_reset();
+ pc = get_pc();
+ if (pc < AT91_SDRAM_BASE || pc > AT91_SDRAM_BASE + 0x10000000)
+ goto end;
/*
* PMC Check if the PLL is already initialized
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index eb71ed5..fc8947d 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -156,5 +156,6 @@ struct at91_spi_platform_data {
void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata);
void at91sam926x_entry(unsigned long sdram_base, unsigned long sdram_size);
+void at91rm9200_entry(unsigned long sdram_base, unsigned long sdram_size);
#endif
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 04/28] ARM: Add new entry point for barebox
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (2 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 03/28] ARM at91rm9200: " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 05/28] ARM i.MX Add functions to get sdram base and size Sascha Hauer
` (23 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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 609aedb..30877b4 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 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 d47a9e9..79cb437 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -66,3 +66,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 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..3eb28c0 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 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] 40+ messages in thread
* [PATCH 05/28] ARM i.MX Add functions to get sdram base and size
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (3 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 04/28] ARM: Add new entry point for barebox Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 06/28] ARM i.MX boards: switch to barebox_arm_entry Sascha Hauer
` (22 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
The code initializing the SDRAM controller is not at the same
place where SDRAM is registered with barebox. To reduce the
risk of registering wrong SDRAM sizes add functions to read
back the sizes from the SDRAM controller.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/Makefile | 3 +-
arch/arm/mach-imx/esdctl.c | 273 +++++++++++++++++++++++++++++++
arch/arm/mach-imx/imx1.c | 2 +
arch/arm/mach-imx/include/mach/esdctl.h | 13 ++
4 files changed, 290 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/mach-imx/esdctl.c
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 259733e..6bc2b79 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_NAND_IMX) += nand.o
obj-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
pbl-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-pfd.o
-obj-y += devices.o imx.o
+obj-y += devices.o imx.o esdctl.o
obj-y += boot.o
obj-$(CONFIG_BAREBOX_UPDATE) += imx-bbu-internal.o
+pbl-y += esdctl.o
diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
new file mode 100644
index 0000000..1e1ede1
--- /dev/null
+++ b/arch/arm/mach-imx/esdctl.c
@@ -0,0 +1,273 @@
+/*
+ * esdctl.c - i.MX sdram controller functions
+ *
+ * Copyright (c) 2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+ *
+ * based on Linux devicetree support
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#include <common.h>
+#include <io.h>
+#include <sizes.h>
+#include <asm/barebox-arm.h>
+#include <mach/esdctl.h>
+#include <mach/imx1-regs.h>
+#include <mach/imx21-regs.h>
+#include <mach/imx25-regs.h>
+#include <mach/imx27-regs.h>
+#include <mach/imx31-regs.h>
+#include <mach/imx35-regs.h>
+#include <mach/imx51-regs.h>
+#include <mach/imx53-regs.h>
+
+static inline unsigned long imx_v1_sdram_size(void __iomem *esdctlbase, int num)
+{
+ void __iomem *esdctl = esdctlbase + (num ? 4 : 0);
+ u32 ctlval = readl(esdctl);
+ unsigned long size;
+ int rows, cols, width = 2, banks = 4;
+
+ if (!(ctlval & ESDCTL0_SDE))
+ /* SDRAM controller disabled, so no RAM here */
+ return 0;
+
+ rows = ((ctlval >> 24) & 0x3) + 11;
+ cols = ((ctlval >> 20) & 0x3) + 8;
+
+ if (ctlval & (1 << 17))
+ width = 4;
+
+ size = (1 << cols) * (1 << rows) * banks * width;
+
+ if (size > SZ_64M)
+ size = SZ_64M;
+
+ return size;
+}
+
+static inline unsigned long imx_v2_sdram_size(void __iomem *esdctlbase, int num)
+{
+ void __iomem *esdctl = esdctlbase + (num ? IMX_ESDCTL1 : IMX_ESDCTL0);
+ u32 ctlval = readl(esdctl);
+ unsigned long size;
+ int rows, cols, width = 2, banks = 4;
+
+ if (!(ctlval & ESDCTL0_SDE))
+ /* SDRAM controller disabled, so no RAM here */
+ return 0;
+
+ rows = ((ctlval >> 24) & 0x7) + 11;
+ cols = ((ctlval >> 20) & 0x3) + 8;
+
+ if ((ctlval & ESDCTL0_DSIZ_MASK) == ESDCTL0_DSIZ_31_0)
+ width = 4;
+
+ size = (1 << cols) * (1 << rows) * banks * width;
+
+ if (size > SZ_256M)
+ size = SZ_256M;
+
+ return size;
+}
+
+static inline unsigned long imx_v3_sdram_size(void __iomem *esdctlbase, int num)
+{
+ unsigned long size;
+
+ size = imx_v2_sdram_size(esdctlbase, num);
+
+ if (readl(esdctlbase + IMX_ESDMISC) & (1 << 6))
+ size *= 2;
+
+ if (size > SZ_256M)
+ size = SZ_256M;
+
+ return size;
+}
+
+#define IMX_ESDCTL_V4_ESDCTL 0x0
+#define ESDCTL_V4_ESDCTL_DSIZ (1 << 16)
+
+#define IMX_ESDCTL_V4_ESDMISC 0x18
+#define ESDCTL_V4_ESDMISC_DDR_4_BANK (1 << 5)
+#define ESDCTL_V4_ESDMISC_ONECS (1 << 20)
+
+#define ESDCTL_V4_ESDCTL_SDE_0 1 /* FIXME */
+#define ESDCTL_V4_ESDMISC_BI 1 /* FIXME */
+
+static inline unsigned long imx_v4_sdram_size(void __iomem *esdctlbase)
+{
+ u32 ctlval = readl(esdctlbase + IMX_ESDCTL_V4_ESDCTL);
+ u32 esdmisc = readl(esdctlbase + IMX_ESDCTL_V4_ESDMISC);
+ unsigned long size;
+ int rows, cols, width = 2, banks = 8;
+
+ if (!(ctlval & ESDCTL_V4_ESDCTL_SDE_0))
+ 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 = 8;
+ break;
+ case 4:
+ cols = 12;
+ break;
+ default:
+ cols = 0;
+ break;
+ }
+
+ if (ctlval & ESDCTL_V4_ESDCTL_DSIZ)
+ width = 4;
+
+ if (esdmisc & ESDCTL_V4_ESDMISC_DDR_4_BANK)
+ banks = 4;
+
+ size = (1 << cols) * (1 << rows) * banks * width;
+
+ /* second cs not enabled, return size */
+ if (!(ctlval & ESDCTL_V4_ESDCTL_SDE_0))
+ return size;
+
+ /* one 2GiB cs, return size */
+ if (esdmisc & ESDCTL_V4_ESDMISC_ONECS)
+ return size;
+
+ /* interleaved, double size */
+ if (esdmisc & ESDCTL_V4_ESDMISC_BI)
+ return size * 2;
+
+ /* two areas with hole, return first area size */
+ if (size < SZ_1G)
+ return size;
+
+ /* both cs, 2 * 1GiB */
+ return size * 2;
+}
+
+/*
+ * 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 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 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 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 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 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 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 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);
+
+ barebox_arm_entry(base, size, boarddata);
+}
diff --git a/arch/arm/mach-imx/imx1.c b/arch/arm/mach-imx/imx1.c
index 18901ea..59cff28 100644
--- a/arch/arm/mach-imx/imx1.c
+++ b/arch/arm/mach-imx/imx1.c
@@ -49,6 +49,8 @@ void imx1_setup_eimcs(size_t cs, unsigned upper, unsigned lower)
writel(lower, MX1_EIM_BASE_ADDR + 4 + cs * 8);
}
+#include <mach/esdctl.h>
+
static int imx1_init(void)
{
imx_iomuxv1_init((void *)MX1_GPIO1_BASE_ADDR);
diff --git a/arch/arm/mach-imx/include/mach/esdctl.h b/arch/arm/mach-imx/include/mach/esdctl.h
index 8124c87..c31831b 100644
--- a/arch/arm/mach-imx/include/mach/esdctl.h
+++ b/arch/arm/mach-imx/include/mach/esdctl.h
@@ -26,6 +26,7 @@
#define ESDCTL0_DSIZ_31_16 (0 << 16)
#define ESDCTL0_DSIZ_15_0 (1 << 16)
#define ESDCTL0_DSIZ_31_0 (2 << 16)
+#define ESDCTL0_DSIZ_MASK (3 << 16)
#define ESDCTL0_REF1 (1 << 13)
#define ESDCTL0_REF2 (2 << 13)
#define ESDCTL0_REF4 (3 << 13)
@@ -124,3 +125,15 @@
//#define ESDCFGx_tRC_14 0x0000000e // 15 seems to not exist
#define ESDCFGx_tRC_16 0x0000000f
+#ifndef __ASSEMBLY__
+
+void __naked imx1_barebox_entry(uint32_t boarddata);
+void __naked imx21_barebox_entry(uint32_t boarddata);
+void __naked imx25_barebox_entry(uint32_t boarddata);
+void __naked imx27_barebox_entry(uint32_t boarddata);
+void __naked imx31_barebox_entry(uint32_t boarddata);
+void __naked imx35_barebox_entry(uint32_t boarddata);
+void __naked imx51_barebox_entry(uint32_t boarddata);
+void __naked imx53_barebox_entry(uint32_t boarddata);
+
+#endif
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 06/28] ARM i.MX boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (4 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 05/28] ARM i.MX Add functions to get sdram base and size Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:12 ` Alexander Shiyan
2012-10-17 21:03 ` [PATCH 07/28] ARM AT91 " Sascha Hauer
` (21 subsequent siblings)
27 siblings, 1 reply; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/boards/ccxmx51/Makefile | 2 ++
arch/arm/boards/ccxmx51/lowlevel.c | 9 +++++++++
arch/arm/boards/eukrea_cpuimx25/lowlevel.c | 10 +++++-----
arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c | 2 +-
arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S | 4 ++--
arch/arm/boards/eukrea_cpuimx35/lowlevel.c | 11 +++++------
arch/arm/boards/eukrea_cpuimx51/Makefile | 2 ++
arch/arm/boards/eukrea_cpuimx51/lowlevel.c | 9 +++++++++
arch/arm/boards/freescale-mx25-3-stack/3stack.c | 2 +-
arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S | 4 ++--
arch/arm/boards/freescale-mx35-3-stack/3stack.c | 7 ++++---
arch/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 | 11 +++++------
arch/arm/boards/guf-neso/lowlevel.c | 11 +++++------
arch/arm/boards/imx21ads/imx21ads.c | 5 +++--
arch/arm/boards/imx21ads/lowlevel_init.S | 8 ++++++--
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-tx51/Makefile | 2 ++
arch/arm/boards/karo-tx51/lowlevel.c | 9 +++++++++
arch/arm/boards/karo-tx53/lowlevel.c | 3 ++-
arch/arm/boards/pcm037/lowlevel_init.S | 4 ++--
arch/arm/boards/pcm037/pcm037.c | 2 +-
arch/arm/boards/pcm038/lowlevel.c | 10 +++++-----
arch/arm/boards/pcm043/lowlevel.c | 11 +++++------
arch/arm/boards/phycard-i.MX27/lowlevel_init.S | 5 ++---
arch/arm/boards/scb9328/lowlevel_init.S | 4 ++--
arch/arm/boards/tqma53/Makefile | 2 ++
arch/arm/boards/tqma53/lowlevel.c | 9 +++++++++
40 files changed, 170 insertions(+), 65 deletions(-)
create mode 100644 arch/arm/boards/ccxmx51/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/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/eukrea_cpuimx25/lowlevel.c b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
index 36ce98b..d08e494 100644
--- a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
@@ -40,7 +40,7 @@ static void __bare_init __naked insdram(void)
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx25_barebox_entry(0);
}
#endif
@@ -125,7 +125,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);
@@ -149,7 +149,7 @@ void __bare_init __naked reset(void)
/* skip NAND boot if not running from NFC space */
r = get_pc();
if (r < MX25_NFC_BASE_ADDR || r > MX25_NFC_BASE_ADDR + 0x800)
- board_init_lowlevel_return();
+ goto out;
src = (unsigned int *)MX25_NFC_BASE_ADDR;
trg = (unsigned int *)_text;
@@ -161,7 +161,7 @@ void __bare_init __naked reset(void)
/* Jump to SDRAM */
r = (unsigned int)&insdram;
__asm__ __volatile__("mov pc, %0" : : "r"(r));
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx25_barebox_entry(0);
}
diff --git a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
index c89ce8a..d85acb9 100644
--- a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
+++ b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
@@ -267,7 +267,7 @@ late_initcall(eukrea_cpuimx27_late_init);
void __bare_init nand_boot(void)
{
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx27_barebox_entry();
}
#endif
diff --git a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
index 4ee6efb..08659e0 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
@@ -151,4 +151,4 @@ copy_loop:
#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 0523335..f95459a 100644
--- a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
@@ -51,7 +51,7 @@ static void __bare_init __naked insdram(void)
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx35_barebox_entry(0);
}
#endif
@@ -134,7 +134,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);
@@ -158,7 +158,7 @@ void __bare_init __naked reset(void)
/* skip NAND boot if not running from NFC space */
r = get_pc();
if (r < MX35_NFC_BASE_ADDR || r > MX35_NFC_BASE_ADDR + 0x800)
- board_init_lowlevel_return();
+ goto out;
src = (unsigned int *)MX35_NFC_BASE_ADDR;
trg = (unsigned int *)_text;
@@ -170,8 +170,7 @@ void __bare_init __naked reset(void)
/* Jump to SDRAM */
r = (unsigned int)&insdram;
__asm__ __volatile__("mov pc, %0" : : "r"(r));
-#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/3stack.c b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
index 5ce2f8e..05b4924 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
@@ -292,7 +292,7 @@ console_initcall(imx25_console_init);
void __bare_init nand_boot(void)
{
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx25_barebox_entry();
}
#endif
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 fb98099..425cf99 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
@@ -125,7 +125,7 @@ copy_loop:
#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 7da031a..e508612 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>
@@ -130,8 +131,8 @@ static void set_board_rev(int rev)
static int f3s_mem_init(void)
{
- arm_add_mem_device("ram0", MX35_CSD0_BASE_ADDR, 128 * 1024 * 1024);
- arm_add_mem_device("ram1", MX35_CSD1_BASE_ADDR, 128 * 1024 * 1024);
+ arm_add_mem_device("ram0", MX35_CSD0_BASE_ADDR, SZ_128M);
+ arm_add_mem_device("ram1", MX35_CSD1_BASE_ADDR, SZ_128M);
return 0;
}
@@ -445,6 +446,6 @@ void __bare_init nand_boot(void)
* fuses or external pull ups. But not the blocksize...
*/
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx35_barebox_entry(MX35_CSD0_BASE_ADDR, SZ_128M);
}
#endif
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 dada5f3..f36a44a 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
@@ -181,7 +181,7 @@ copy_loop:
ret:
#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 f2e44af..e8ac9a3 100644
--- a/arch/arm/boards/guf-cupid/lowlevel.c
+++ b/arch/arm/boards/guf-cupid/lowlevel.c
@@ -58,7 +58,7 @@ static void __bare_init __naked insdram(void)
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx35_barebox_entry();
}
#endif
@@ -257,7 +257,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 */
@@ -333,7 +333,7 @@ void __bare_init __naked reset(void)
/* skip NAND boot if not running from NFC space */
r0 = get_pc();
if (r0 < MX35_NFC_BASE_ADDR || r0 > MX35_NFC_BASE_ADDR + 0x800)
- board_init_lowlevel_return();
+ goto out;
src = (unsigned int *)MX35_NFC_BASE_ADDR;
trg = (unsigned int *)_text;
@@ -345,8 +345,7 @@ void __bare_init __naked reset(void)
/* Jump to SDRAM */
r0 = (unsigned int)&insdram;
__asm__ __volatile__("mov pc, %0" : : "r"(r0));
-#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 ad414d9..55f0475 100644
--- a/arch/arm/boards/guf-neso/lowlevel.c
+++ b/arch/arm/boards/guf-neso/lowlevel.c
@@ -38,7 +38,7 @@ static void __bare_init __naked insdram(void)
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx27_barebox_entry(0);
}
#endif
@@ -63,7 +63,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
@@ -105,7 +105,7 @@ void __bare_init __naked reset(void)
/* skip NAND boot if not running from NFC space */
r = get_pc();
if (r < MX27_NFC_BASE_ADDR || r > MX27_NFC_BASE_ADDR + 0x800)
- board_init_lowlevel_return();
+ goto out;
src = (unsigned int *)MX27_NFC_BASE_ADDR;
trg = (unsigned int *)_text;
@@ -117,8 +117,7 @@ void __bare_init __naked reset(void)
/* Jump to SDRAM */
r = (unsigned int)&insdram;
__asm__ __volatile__("mov pc, %0" : : "r"(r));
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx27_barebox_entry(0);
}
-
diff --git a/arch/arm/boards/imx21ads/imx21ads.c b/arch/arm/boards/imx21ads/imx21ads.c
index ca566c8..9ca5d14 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;
}
@@ -194,7 +195,7 @@ console_initcall(mx21ads_console_init);
void __bare_init nand_boot(void)
{
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ barebox_arm_entry(0xc0000000, SZ_64M, 0);
}
#endif
diff --git a/arch/arm/boards/imx21ads/lowlevel_init.S b/arch/arm/boards/imx21ads/lowlevel_init.S
index e52cac1..a46dafe 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 */
@@ -145,7 +146,10 @@ copy_loop:
#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 9c5cc5c..9223a82 100644
--- a/arch/arm/boards/karo-tx25/lowlevel.c
+++ b/arch/arm/boards/karo-tx25/lowlevel.c
@@ -38,7 +38,7 @@ static void __bare_init __naked insdram(void)
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx25_barebox_entry(0);
}
#endif
@@ -131,7 +131,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 to 3.3v SDRAM */
writel(0x800, MX25_IOMUXC_BASE_ADDR + 0x454);
@@ -153,7 +153,7 @@ void __bare_init __naked reset(void)
/* skip NAND boot if not running from NFC space */
r = get_pc();
if (r < MX25_NFC_BASE_ADDR || r > MX25_NFC_BASE_ADDR + 0x800)
- board_init_lowlevel_return();
+ goto out;
src = (unsigned int *)MX25_NFC_BASE_ADDR;
trg = (unsigned int *)_text;
@@ -165,7 +165,7 @@ void __bare_init __naked reset(void)
/* Jump to SDRAM */
r = (unsigned int)&insdram;
__asm__ __volatile__("mov pc, %0" : : "r"(r));
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx25_barebox_entry(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-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 6b7314c..fe9dac1 100644
--- a/arch/arm/boards/karo-tx53/lowlevel.c
+++ b/arch/arm/boards/karo-tx53/lowlevel.c
@@ -2,6 +2,7 @@
#include <asm/barebox-arm-head.h>
#include <asm/barebox-arm.h>
#include <mach/imx5.h>
+#include <mach/esdctl.h>
void __naked reset(void)
{
@@ -15,5 +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);
}
diff --git a/arch/arm/boards/pcm037/lowlevel_init.S b/arch/arm/boards/pcm037/lowlevel_init.S
index f9ecce1..6912bc1 100644
--- a/arch/arm/boards/pcm037/lowlevel_init.S
+++ b/arch/arm/boards/pcm037/lowlevel_init.S
@@ -95,7 +95,7 @@ clear_iomux:
cmp pc, #0x90000000
bhs 1f
- b board_init_lowlevel_return
+ b imx31_barebox_entry
1:
#if defined CONFIG_PCM037_SDRAM_BANK0_128MB
@@ -164,5 +164,5 @@ copy_loop:
ret:
#endif /* CONFIG_NAND_IMX_BOOT */
- b board_init_lowlevel_return
+ b imx31_barebox_entry
diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index ff4089a..3b7afa8 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -238,6 +238,6 @@ console_initcall(imx31_console_init);
void __bare_init nand_boot(void)
{
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx31_barebox_entry();
}
#endif
diff --git a/arch/arm/boards/pcm038/lowlevel.c b/arch/arm/boards/pcm038/lowlevel.c
index 2f93c31..b2a47ac 100644
--- a/arch/arm/boards/pcm038/lowlevel.c
+++ b/arch/arm/boards/pcm038/lowlevel.c
@@ -39,7 +39,7 @@ static void __bare_init __naked insdram(void)
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx27_barebox_entry(0);
}
#endif
@@ -63,7 +63,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);
@@ -111,7 +111,7 @@ void __bare_init __naked reset(void)
/* skip NAND boot if not running from NFC space */
r = get_pc();
if (r < MX27_NFC_BASE_ADDR || r > MX27_NFC_BASE_ADDR + 0x800)
- board_init_lowlevel_return();
+ goto out;
src = (unsigned int *)MX27_NFC_BASE_ADDR;
trg = (unsigned int *)_text;
@@ -123,8 +123,8 @@ void __bare_init __naked reset(void)
/* Jump to SDRAM */
r = (unsigned int)&insdram;
__asm__ __volatile__("mov pc, %0" : : "r"(r));
-#else
- board_init_lowlevel_return();
#endif
+out:
+ imx27_barebox_entry(0);
}
diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c
index 06f05ab..a99fe74 100644
--- a/arch/arm/boards/pcm043/lowlevel.c
+++ b/arch/arm/boards/pcm043/lowlevel.c
@@ -56,7 +56,7 @@ static void __bare_init __naked insdram(void)
imx_nand_load_image(_text, barebox_image_size);
- board_init_lowlevel_return();
+ imx35_barebox_entry(0);
}
#endif
@@ -140,7 +140,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 *
@@ -209,7 +209,7 @@ void __bare_init __naked reset(void)
/* skip NAND boot if not running from NFC space */
r = get_pc();
if (r < MX35_NFC_BASE_ADDR || r > MX35_NFC_BASE_ADDR + 0x800)
- board_init_lowlevel_return();
+ goto out;
src = (unsigned int *)MX35_NFC_BASE_ADDR;
trg = (unsigned int *)_text;
@@ -221,8 +221,7 @@ void __bare_init __naked reset(void)
/* Jump to SDRAM */
r = (unsigned int)&insdram;
__asm__ __volatile__("mov pc, %0" : : "r"(r));
-#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 8f0000f..95bc024 100644
--- a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
+++ b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S
@@ -81,7 +81,7 @@ reset:
cmp pc, #0xc0000000
bhi 1f
- b board_init_lowlevel_return
+ b imx27_barebox_entry
1:
/* 399 MHz */
@@ -133,10 +133,9 @@ copy_loop:
ldr r0,=_text
ldr r1,=_barebox_image_size
bl imx_nand_load_image
- b board_init_lowlevel_return
#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);
+}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 07/28] ARM AT91 boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (5 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 06/28] ARM i.MX boards: switch to barebox_arm_entry Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 08/28] ARM i.MXs " Sascha Hauer
` (20 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
Most boards use hardcoded addresses, some automatically determine the
SDRAM size using at91_get_sdram_size(),
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/at91rm9200ek/lowlevel.c | 14 ++++++++++++++
arch/arm/boards/at91sam9260ek/Makefile | 2 ++
arch/arm/boards/at91sam9260ek/lowlevel.c | 12 ++++++++++++
arch/arm/boards/at91sam9261ek/Makefile | 2 ++
arch/arm/boards/at91sam9261ek/lowlevel.c | 12 ++++++++++++
arch/arm/boards/at91sam9m10g45ek/Makefile | 2 ++
arch/arm/boards/at91sam9m10g45ek/lowlevel.c | 11 +++++++++++
arch/arm/boards/at91sam9x5ek/Makefile | 2 ++
arch/arm/boards/at91sam9x5ek/lowlevel.c | 11 +++++++++++
arch/arm/boards/dss11/Makefile | 2 ++
arch/arm/boards/dss11/lowlevel.c | 12 ++++++++++++
arch/arm/boards/mmccpu/Makefile | 2 ++
arch/arm/boards/mmccpu/lowlevel.c | 12 ++++++++++++
arch/arm/boards/pm9g45/Makefile | 2 ++
arch/arm/boards/pm9g45/lowlevel.c | 11 +++++++++++
arch/arm/boards/qil-a9260/Makefile | 2 ++
arch/arm/boards/qil-a9260/lowlevel.c | 12 ++++++++++++
arch/arm/boards/tny-a926x/Makefile | 2 ++
arch/arm/boards/tny-a926x/lowlevel.c | 12 ++++++++++++
arch/arm/boards/usb-a926x/Makefile | 2 ++
arch/arm/boards/usb-a926x/lowlevel.c | 12 ++++++++++++
arch/arm/mach-at91/at91rm9200_lowlevel_init.c | 2 +-
arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 2 +-
23 files changed, 153 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boards/at91rm9200ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9260ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9261ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9m10g45ek/lowlevel.c
create mode 100644 arch/arm/boards/at91sam9x5ek/lowlevel.c
create mode 100644 arch/arm/boards/dss11/lowlevel.c
create mode 100644 arch/arm/boards/mmccpu/lowlevel.c
create mode 100644 arch/arm/boards/pm9g45/lowlevel.c
create mode 100644 arch/arm/boards/qil-a9260/lowlevel.c
create mode 100644 arch/arm/boards/tny-a926x/lowlevel.c
create mode 100644 arch/arm/boards/usb-a926x/lowlevel.c
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
new file mode 100644
index 0000000..5240596
--- /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(AT91_SDRAM_BASE, SZ_64M);
+}
diff --git a/arch/arm/boards/at91sam9260ek/Makefile b/arch/arm/boards/at91sam9260ek/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/at91sam9260ek/Makefile
+++ b/arch/arm/boards/at91sam9260ek/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/at91sam9260ek/lowlevel.c b/arch/arm/boards/at91sam9260ek/lowlevel.c
new file mode 100644
index 0000000..82520c3
--- /dev/null
+++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
@@ -0,0 +1,12 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+#include <mach/at91sam9_sdramc.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
+}
diff --git a/arch/arm/boards/at91sam9261ek/Makefile b/arch/arm/boards/at91sam9261ek/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/at91sam9261ek/Makefile
+++ b/arch/arm/boards/at91sam9261ek/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/at91sam9261ek/lowlevel.c b/arch/arm/boards/at91sam9261ek/lowlevel.c
new file mode 100644
index 0000000..82520c3
--- /dev/null
+++ b/arch/arm/boards/at91sam9261ek/lowlevel.c
@@ -0,0 +1,12 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+#include <mach/at91sam9_sdramc.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
+}
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..83da64d
--- /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_CHIPSELECT_1, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/at91sam9x5ek/Makefile b/arch/arm/boards/at91sam9x5ek/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/at91sam9x5ek/Makefile
+++ b/arch/arm/boards/at91sam9x5ek/Makefile
@@ -1 +1,3 @@
obj-y += init.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..83da64d
--- /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_CHIPSELECT_1, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/dss11/Makefile b/arch/arm/boards/dss11/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/dss11/Makefile
+++ b/arch/arm/boards/dss11/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/dss11/lowlevel.c b/arch/arm/boards/dss11/lowlevel.c
new file mode 100644
index 0000000..82520c3
--- /dev/null
+++ b/arch/arm/boards/dss11/lowlevel.c
@@ -0,0 +1,12 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+#include <mach/at91sam9_sdramc.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
+}
diff --git a/arch/arm/boards/mmccpu/Makefile b/arch/arm/boards/mmccpu/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/mmccpu/Makefile
+++ b/arch/arm/boards/mmccpu/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/mmccpu/lowlevel.c b/arch/arm/boards/mmccpu/lowlevel.c
new file mode 100644
index 0000000..9f6290c
--- /dev/null
+++ b/arch/arm/boards/mmccpu/lowlevel.c
@@ -0,0 +1,12 @@
+#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_CHIPSELECT_1, 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..83da64d
--- /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_CHIPSELECT_1, SZ_128M, 0);
+}
diff --git a/arch/arm/boards/qil-a9260/Makefile b/arch/arm/boards/qil-a9260/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/qil-a9260/Makefile
+++ b/arch/arm/boards/qil-a9260/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/qil-a9260/lowlevel.c b/arch/arm/boards/qil-a9260/lowlevel.c
new file mode 100644
index 0000000..82520c3
--- /dev/null
+++ b/arch/arm/boards/qil-a9260/lowlevel.c
@@ -0,0 +1,12 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+#include <mach/at91sam9_sdramc.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
+}
diff --git a/arch/arm/boards/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/tny-a926x/Makefile
+++ b/arch/arm/boards/tny-a926x/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/tny-a926x/lowlevel.c b/arch/arm/boards/tny-a926x/lowlevel.c
new file mode 100644
index 0000000..82520c3
--- /dev/null
+++ b/arch/arm/boards/tny-a926x/lowlevel.c
@@ -0,0 +1,12 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+#include <mach/at91sam9_sdramc.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
+}
diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile
index eb072c0..47ab803 100644
--- a/arch/arm/boards/usb-a926x/Makefile
+++ b/arch/arm/boards/usb-a926x/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
diff --git a/arch/arm/boards/usb-a926x/lowlevel.c b/arch/arm/boards/usb-a926x/lowlevel.c
new file mode 100644
index 0000000..82520c3
--- /dev/null
+++ b/arch/arm/boards/usb-a926x/lowlevel.c
@@ -0,0 +1,12 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+#include <mach/at91sam9_sdramc.h>
+
+void __naked reset(void)
+{
+ common_reset();
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
+}
diff --git a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
index a0a0d5e..897d266 100644
--- a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
@@ -130,5 +130,5 @@ void __naked __bare_init at91rm9200_entry(unsigned long sdram_base,
set_cr(r);
end:
- board_init_lowlevel_return();
+ barebox_arm_entry(sdram_base, sdram_size, 0);
}
diff --git a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
index a399854..b8463aa 100644
--- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
@@ -175,5 +175,5 @@ void __naked __bare_init at91sam926x_entry(unsigned long sdram_base,
#endif
end:
- board_init_lowlevel_return();
+ barebox_arm_entry(sdram_base, 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] 40+ messages in thread
* [PATCH 08/28] ARM i.MXs boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (6 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 07/28] ARM AT91 " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 09/28] ARM OMAP " Sascha Hauer
` (19 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/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/lowlevel.c | 11 +++++++++++
11 files changed, 76 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/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 75f0020..ec3f601 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/Makefile
+++ b/arch/arm/boards/crystalfontz-cfa10036/Makefile
@@ -1 +1,3 @@
obj-y += cfa10036.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/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] 40+ messages in thread
* [PATCH 09/28] ARM OMAP boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (7 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 08/28] ARM i.MXs " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 10/28] ARM Samsung " Sascha Hauer
` (18 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/boards/archosg9/Makefile | 4 ++--
arch/arm/boards/archosg9/lowlevel.c | 4 +++-
arch/arm/boards/beagle/Makefile | 2 ++
arch/arm/boards/beagle/lowlevel.c | 14 ++++++++++++++
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/phycard-a-l1/Makefile | 2 ++
arch/arm/boards/phycard-a-xl2/lowlevel.c | 7 ++++---
arch/arm/mach-omap/include/mach/silicon.h | 1 +
arch/arm/mach-omap/omap3_core.S | 11 ++++-------
14 files changed, 68 insertions(+), 19 deletions(-)
create mode 100644 arch/arm/boards/beagle/lowlevel.c
create mode 100644 arch/arm/boards/omap343xdsp/lowlevel.c
create mode 100644 arch/arm/boards/omap3evm/lowlevel.c
diff --git a/arch/arm/boards/archosg9/Makefile b/arch/arm/boards/archosg9/Makefile
index 256eaf6..53b9d5b 100644
--- a/arch/arm/boards/archosg9/Makefile
+++ b/arch/arm/boards/archosg9/Makefile
@@ -1,3 +1,3 @@
obj-y += board.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 fa5be1d..c9053bf 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,8 @@ static noinline void archosg9_init_lowlevel(void)
/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
omap4_scale_vcores(TPS62361_VSEL0_GPIO);
- 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..134839e
--- /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/silicon.h>
+
+void __naked reset(void)
+{
+ omap3_invalidate_dcache();
+
+ common_reset();
+
+ barebox_arm_entry(0x80000000, SZ_128M, 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..134839e
--- /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/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/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-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/include/mach/silicon.h b/arch/arm/mach-omap/include/mach/silicon.h
index 5ee1931..1dc4a15 100644
--- a/arch/arm/mach-omap/include/mach/silicon.h
+++ b/arch/arm/mach-omap/include/mach/silicon.h
@@ -28,6 +28,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_OMAP_SILICON_H */
diff --git a/arch/arm/mach-omap/omap3_core.S b/arch/arm/mach-omap/omap3_core.S
index df7c5b4..bbb9461 100644
--- a/arch/arm/mach-omap/omap3_core.S
+++ b/arch/arm/mach-omap/omap3_core.S
@@ -38,10 +38,8 @@
#include <mach/clocks.h>
#include <asm/barebox-arm-head.h>
-#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
-ENTRY(reset)
+ENTRY(omap3_invalidate_dcache)
/* Invalidate all Dcaches */
-#ifndef CONFIG_CPU_V7_DCACHE_SKIP
/* If Arch specific ROM code SMI handling does not exist */
mrc p15, 1, r0, c0, c0, 1 /* read clidr */
ands r3, r0, #0x7000000 /* extract loc from clidr */
@@ -86,8 +84,7 @@ finished_inval:
mov r10, #0 /* swith back to cache level 0 */
mcr p15, 2, r10, c0, c0, 0 /* select current cache level in cssr */
isb
-#endif /* CONFIG_CPU_V7_DCACHE_SKIP */
+
/* 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] 40+ messages in thread
* [PATCH 10/28] ARM Samsung boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (8 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 09/28] ARM OMAP " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 11/28] ARM PXA " Sascha Hauer
` (17 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/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 +++++++++++
8 files changed, 50 insertions(+), 8 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/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);
+}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 11/28] ARM PXA boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (9 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 10/28] ARM Samsung " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 12/28] ARM ep93xx " Sascha Hauer
` (16 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
All boards use hardcoded base addresses.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/mioa701/Makefile | 2 ++
arch/arm/boards/mioa701/lowlevel.c | 10 ++++++++++
arch/arm/boards/pcm027/lowlevel_init.S | 7 +++++--
3 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boards/mioa701/lowlevel.c
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] 40+ messages in thread
* [PATCH 12/28] ARM ep93xx boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (10 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 11/28] ARM PXA " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 13/28] ARM tegra " Sascha Hauer
` (15 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/mach-ep93xx/Makefile | 4 ++--
arch/arm/mach-ep93xx/lowlevel_init.S | 11 ++++++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
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] 40+ messages in thread
* [PATCH 13/28] ARM tegra boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (11 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 12/28] ARM ep93xx " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 14/28] ARM nomadik " Sascha Hauer
` (14 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/boards/toshiba-ac100/Makefile | 2 ++
arch/arm/boards/toshiba-ac100/lowlevel.c | 10 ++++++++++
2 files changed, 12 insertions(+)
create mode 100644 arch/arm/boards/toshiba-ac100/lowlevel.c
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] 40+ messages in thread
* [PATCH 14/28] ARM nomadik boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (12 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 13/28] ARM tegra " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 15/28] ARM versatile " Sascha Hauer
` (13 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/boards/nhk8815/Makefile | 2 ++
arch/arm/boards/nhk8815/lowlevel.c | 10 ++++++++++
2 files changed, 12 insertions(+)
create mode 100644 arch/arm/boards/nhk8815/lowlevel.c
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] 40+ messages in thread
* [PATCH 15/28] ARM versatile boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (13 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 14/28] ARM nomadik " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 16/28] ARM netx " Sascha Hauer
` (12 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/boards/versatile/Makefile | 3 ++-
arch/arm/boards/versatile/lowlevel.c | 10 ++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boards/versatile/lowlevel.c
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] 40+ messages in thread
* [PATCH 16/28] ARM netx boards: switch to barebox_arm_entry
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (14 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 15/28] ARM versatile " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 17/28] ARM: remove now unused *_LOWLEVEL_INIT Kconfig options Sascha Hauer
` (11 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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/boards/netx/platform.S | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
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
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 17/28] ARM: remove now unused *_LOWLEVEL_INIT Kconfig options
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (15 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 16/28] ARM netx " Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 18/28] ARM start: remove unused board_init_lowlevel* functions Sascha Hauer
` (10 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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 | 12 ------------
arch/arm/mach-at91/Kconfig | 8 --------
arch/arm/mach-ep93xx/Kconfig | 8 --------
arch/arm/mach-imx/Kconfig | 16 ----------------
arch/arm/mach-netx/Kconfig | 1 -
arch/arm/mach-omap/Kconfig | 5 -----
arch/arm/mach-pxa/Kconfig | 1 -
arch/arm/mach-samsung/Kconfig | 6 ------
common/Kconfig | 12 ------------
10 files changed, 81 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 30877b4..8b4f691 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 79cb437..c21a8d7 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 8ec033b..a4a0ebf 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -45,8 +45,6 @@ config ARCH_AT91RM9200
bool "AT91RM9200"
select CPU_ARM920T
select HAS_AT91_ETHER
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
config ARCH_AT91SAM9260
bool "AT91SAM9260"
@@ -189,8 +187,6 @@ config MACH_PM9261
bool "Ronetix PM9261"
select HAVE_AT91SAM926X_LOWLEVEL_INIT
select HAS_DM9000
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
help
Say y here if you are using the Ronetix PM9261 Board
@@ -266,8 +262,6 @@ choice
config MACH_AT91SAM9263EK
bool "Atmel AT91SAM9263-EK"
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
select HAVE_NAND_ATMEL_BUSWIDTH_16
select HAVE_AT91SAM926X_LOWLEVEL_INIT
help
@@ -281,8 +275,6 @@ config MACH_MMCCPU
config MACH_PM9263
bool "Ronetix PM9263"
- select MACH_HAS_LOWLEVEL_INIT
- select MACH_DO_LOWLEVEL_INIT
select HAVE_AT91SAM926X_LOWLEVEL_INIT
help
Say y here if you are using the Ronetix PM9263 Board
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-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index cca8394..447e8b9 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -203,7 +203,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
@@ -221,7 +220,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
@@ -241,14 +239,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
@@ -257,7 +253,6 @@ config MACH_FREESCALE_MX25_3STACK
config MACH_TX25
bool "Ka-Ro TX25"
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Ka-Ro tx25 board
@@ -275,28 +270,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
@@ -315,7 +306,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 ARCH_HAS_L2X0
help
@@ -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
@@ -464,7 +449,6 @@ 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
diff --git a/arch/arm/mach-netx/Kconfig b/arch/arm/mach-netx/Kconfig
index 8e83417..ea92afb 100644
--- a/arch/arm/mach-netx/Kconfig
+++ b/arch/arm/mach-netx/Kconfig
@@ -47,7 +47,6 @@ config MACH_NXDB500
bool "Hilscher Netx nxdb500"
select HAS_NETX_ETHER
select HAS_CFI
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using the Hilscher Netx nxdb500 board
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index da39530..d79e33f 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
@@ -127,7 +126,6 @@ config MACH_OMAP3EVM
config MACH_PANDA
bool "Texas Instrument's Panda Board"
select HAVE_NOSHELL
- select MACH_HAS_LOWLEVEL_INIT
depends on ARCH_OMAP4
help
Say Y here if you are using OMAP4 Panda board
@@ -135,7 +133,6 @@ config MACH_PANDA
config MACH_ARCHOSG9
bool "Archos G9 tablets"
select HAVE_NOSHELL
- select MACH_HAS_LOWLEVEL_INIT
depends on ARCH_OMAP4
help
Say Y here if you are using OMAP4-based Archos G9 tablet
@@ -144,7 +141,6 @@ config MACH_PCM049
bool "Phytec phyCORE pcm049"
select HAVE_NOSHELL
depends on ARCH_OMAP4
- select MACH_HAS_LOWLEVEL_INIT
help
Say Y here if you are using Phytecs phyCORE pcm049 board
based on OMAP4
@@ -159,7 +155,6 @@ config MACH_PCAAL1
config MACH_PCAAXL2
bool "Phytec phyCARD XL2"
select HAVE_NOSHELL
- 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-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 029fd8b..61f323b 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -43,7 +43,6 @@ config MACH_MIOA701
config MACH_PCM027
bool "Phytec phyCORE-PXA270"
select HAS_CFI
- select MACH_HAS_LOWLEVEL_INIT
select HAVE_MMU
help
Say Y here if you are using a Phytec phyCORE PXA270
diff --git a/arch/arm/mach-samsung/Kconfig b/arch/arm/mach-samsung/Kconfig
index 7312f5e..b3796cd 100644
--- a/arch/arm/mach-samsung/Kconfig
+++ b/arch/arm/mach-samsung/Kconfig
@@ -41,7 +41,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
@@ -51,7 +50,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
@@ -60,8 +58,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
@@ -141,8 +137,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
diff --git a/common/Kconfig b/common/Kconfig
index d60db80..1eb1e45 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -287,18 +287,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] 40+ messages in thread
* [PATCH 18/28] ARM start: remove unused board_init_lowlevel* functions
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (16 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 17/28] ARM: remove now unused *_LOWLEVEL_INIT Kconfig options Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 19/28] ARM pbl: setup stack at end of SDRAM Sascha Hauer
` (9 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 9 +++------
arch/arm/cpu/start.c | 37 +++++++++++++++++-------------------
arch/arm/include/asm/barebox-arm.h | 2 --
3 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 8b4f691..a2cdbf2 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -156,11 +156,8 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
barebox();
}
-/*
- * 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)
+static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
{
uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
@@ -199,5 +196,5 @@ void __naked board_init_lowlevel_return(void)
void __naked barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
- board_init_lowlevel_return();
+ __barebox_arm_entry(membase, memsize, boarddata);
}
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index c21a8d7..c75728f 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -26,24 +26,8 @@
#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)
-{
-#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 board_init_lowlevel_return(void)
+static noinline __naked void __start(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
{
arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
@@ -63,7 +47,20 @@ void __naked board_init_lowlevel_return(void)
* be preserved and can be accessed later with barebox_arm_boarddata().
*/
void __naked barebox_arm_entry(uint32_t membase, uint32_t memsize,
- uint32_t boarddata)
+ uint32_t boarddata)
{
- board_init_lowlevel_return();
+ __start(membase, memsize, boarddata);
+}
+
+/*
+ * First function in the uncompressed image. We get here from
+ * the pbl.
+ */
+void __naked __section(.text_entry) start(void)
+{
+#ifdef CONFIG_PBL_IMAGE
+ __start(0, 0, 0);
+#else
+ barebox_arm_head();
+#endif
}
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 3eb28c0..ce1eb47 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -34,8 +34,6 @@ int dram_init (void);
extern char __exceptions_start[], __exceptions_stop[];
-void board_init_lowlevel(void);
-void 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] 40+ messages in thread
* [PATCH 19/28] ARM pbl: setup stack at end of SDRAM
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (17 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 18/28] ARM start: remove unused board_init_lowlevel* functions Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments Sascha Hauer
` (8 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
We now have memory information available in barebox_arm_entry,
use it to setup the stack at the end of SDRAM instead of hardcoded
config value.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index a2cdbf2..e612d51 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -162,9 +162,6 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
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();
@@ -196,5 +193,7 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
void __naked barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
+ arm_setup_stack(membase + memsize - 8);
+
__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] 40+ messages in thread
* [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (18 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 19/28] ARM pbl: setup stack at end of SDRAM Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-18 7:29 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 21:03 ` [PATCH 21/28] ARM pbl: make MMU functional again Sascha Hauer
` (7 subsequent siblings)
27 siblings, 1 reply; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
This puts the code from barebox_uncompress inline into
the caller. Also we now call the uncompressed binary
with the memory and boarddata arguments, so everything
is ready for the uncompressed image to pick up the
values.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 64 +++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 37 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index e612d51..751e4fa 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -120,47 +120,13 @@ void noinline errorfn(char *error)
while (1);
}
-static void barebox_uncompress(void *compressed_start, unsigned int len)
-{
- void (*barebox)(void);
- /*
- * remap_cached currently does not work rendering the feature
- * of enabling the MMU in the PBL useless. disable for now.
- */
- 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)
- 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,
- (void *)TEXT_BASE, NULL, errorfn);
-
- if (use_mmu)
- mmu_disable();
-
- flush_icache();
-
- barebox();
-}
-
static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
+ void (*barebox)(uint32_t, uint32_t, uint32_t);
uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
+ int use_mmu = 0;
/* Get offset between linked address and runtime address */
offset = get_runtime_offset();
@@ -180,7 +146,31 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
setup_c();
- barebox_uncompress((void *)pg_start, pg_len);
+ /* set 128 KiB at the end of the MALLOC_BASE for early malloc */
+ free_mem_ptr = membase + memsize - SZ_256K;
+ free_mem_end_ptr = free_mem_ptr + SZ_128K;
+
+ ttb = (void *)((free_mem_ptr - 0x4000) & ~0x3fff);
+
+ if (use_mmu)
+ mmu_enable(membase, memsize);
+
+ decompress((void *)pg_start,
+ pg_len,
+ NULL, NULL,
+ (void *)TEXT_BASE, NULL, errorfn);
+
+ if (use_mmu)
+ mmu_disable();
+
+ flush_icache();
+
+ 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] 40+ messages in thread
* [PATCH 21/28] ARM pbl: make MMU functional again
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (19 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 22/28] ARM start: pick up memory/boarddata arguments from pbl Sascha Hauer
` (6 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
We now have memory information available and thus can simply
map the available SDRAM space instead of selecting the regions
we need manually.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 751e4fa..98c1ae3 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -78,10 +78,12 @@ static void map_cachable(unsigned long start, unsigned long size)
PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB);
}
-static void mmu_enable(unsigned long compressed_start, unsigned int len)
+static void mmu_enable(unsigned long membase, unsigned long memsize)
{
int i;
+ arm_set_cache_functions();
+
/* Set the ttb register */
asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb) /*:*/);
@@ -91,20 +93,8 @@ static void mmu_enable(unsigned long compressed_start, unsigned int len)
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);
+
+ map_cachable(membase, memsize);
__mmu_cache_on();
}
@@ -126,7 +116,7 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
void (*barebox)(uint32_t, uint32_t, uint32_t);
uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
- int use_mmu = 0;
+ int use_mmu = IS_ENABLED(CONFIG_MMU);
/* Get offset between linked address and runtime address */
offset = get_runtime_offset();
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 22/28] ARM start: pick up memory/boarddata arguments from pbl
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (20 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 21/28] ARM pbl: make MMU functional again Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 23/28] ARM start: Add barebox_arm_boarddata function Sascha Hauer
` (5 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
Now that the pbl calls the uncompressed image with memory/boarddata
arguments we can pick these up and use them in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index c75728f..ee351bb 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -26,11 +26,9 @@
#include <asm/cache.h>
#include <memory.h>
-static noinline __naked void __start(uint32_t membase, uint32_t memsize,
+static noinline void __start(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
- arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
-
setup_c();
mem_malloc_init((void *)MALLOC_BASE,
@@ -39,6 +37,14 @@ static noinline __naked void __start(uint32_t membase, uint32_t memsize,
start_barebox();
}
+#ifndef CONFIG_PBL_IMAGE
+
+void __naked __section(.text_entry) start(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
+{
+ 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
@@ -49,18 +55,20 @@ static noinline __naked void __start(uint32_t membase, uint32_t memsize,
void __naked barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
+ arm_setup_stack(membase + memsize - 8);
+
__start(membase, memsize, boarddata);
}
+#else
+
/*
* First function in the uncompressed image. We get here from
- * the pbl.
+ * the pbl. The stack already has been set up by the pbl.
*/
-void __naked __section(.text_entry) start(void)
+void __naked __section(.text_entry) start(uint32_t membase, uint32_t memsize,
+ uint32_t boarddata)
{
-#ifdef CONFIG_PBL_IMAGE
- __start(0, 0, 0);
-#else
- barebox_arm_head();
-#endif
+ __start(membase, memsize, boarddata);
}
+#endif
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 23/28] ARM start: Add barebox_arm_boarddata function
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (21 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 22/28] ARM start: pick up memory/boarddata arguments from pbl Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 24/28] ARM: Determine base and size of malloc space from SDRAM Sascha Hauer
` (4 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
The board specific lowlevel init code may wish to pass data from
the lowlevel code to the running barebox. This allows to pass data
on and to pick it up later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start.c | 14 ++++++++++++++
arch/arm/include/asm/barebox-arm.h | 2 ++
2 files changed, 16 insertions(+)
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index ee351bb..901dc6d 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -26,6 +26,18 @@
#include <asm/cache.h>
#include <memory.h>
+static uint32_t __barebox_arm_boarddata;
+
+/*
+ * the board specific lowlevel init code can pass a pointer or
+ * data value to barebox_arm_entry() and pick it up later with
+ * this function.
+ */
+uint32_t barebox_arm_boarddata(void)
+{
+ return __barebox_arm_boarddata;
+}
+
static noinline void __start(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
@@ -34,6 +46,8 @@ static noinline void __start(uint32_t membase, uint32_t memsize,
mem_malloc_init((void *)MALLOC_BASE,
(void *)(MALLOC_BASE + MALLOC_SIZE - 1));
+ __barebox_arm_boarddata = boarddata;
+
start_barebox();
}
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index ce1eb47..e7355bb 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -39,4 +39,6 @@ uint32_t get_runtime_offset(void);
void setup_c(void);
void barebox_arm_entry(uint32_t membase, uint32_t memsize, uint32_t boarddata);
+uint32_t barebox_arm_boarddata(void);
+
#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] 40+ messages in thread
* [PATCH 24/28] ARM: Determine base and size of malloc space from SDRAM
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (22 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 23/28] ARM start: Add barebox_arm_boarddata function Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 25/28] ARM pbl: always copy piggydata Sascha Hauer
` (3 subsequent siblings)
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
Now that we know how where to find memory we no longer depend on hardcoded
values. If no malloc size has been specified in Kconfig set up the malloc
space based on the available SDRAM. We use the SDRAM base up to TEXT_BASE
for malloc and unused memory where we put the kernel later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start.c | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 901dc6d..163a636 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -25,6 +25,7 @@
#include <asm/sections.h>
#include <asm/cache.h>
#include <memory.h>
+#include <sizes.h>
static uint32_t __barebox_arm_boarddata;
@@ -41,10 +42,48 @@ uint32_t barebox_arm_boarddata(void)
static noinline void __start(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
+ unsigned long malloc_start, malloc_end;
+
setup_c();
- mem_malloc_init((void *)MALLOC_BASE,
- (void *)(MALLOC_BASE + MALLOC_SIZE - 1));
+ 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 = membase + memsize - 1;
+ else
+ malloc_end = (unsigned long)_text - 1;
+
+ if (MALLOC_SIZE > 0) {
+ /*
+ * malloc size has been configured in Kconfig. Use it, but
+ * check if it's outside the region we are provided.
+ */
+ malloc_start = malloc_end - MALLOC_SIZE + 1;
+ if (malloc_start < membase)
+ malloc_start = membase;
+ } else {
+ /*
+ * No memory size given in Kconfig, try to make the best out of the
+ * available space.
+ *
+ * We need space for malloc and space to put the kernel outside the
+ * malloc space later. Divide available memory into two parts.
+ */
+ malloc_start = (membase + malloc_end) / 2;
+
+ /*
+ * Limit space we do not use for malloc to 16MB
+ */
+ if (malloc_start - membase > SZ_16M)
+ malloc_start = membase + SZ_16M;
+ }
+
+ mem_malloc_init((void *)malloc_start,
+ (void *)malloc_end);
__barebox_arm_boarddata = boarddata;
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 25/28] ARM pbl: always copy piggydata
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (23 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 24/28] ARM: Determine base and size of malloc space from SDRAM Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-18 7:23 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 21:03 ` [PATCH 26/28] ARM i.MX: Use SRAM stack in lowlevel code Sascha Hauer
` (2 subsequent siblings)
27 siblings, 1 reply; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 UTC (permalink / raw)
To: barebox
For now this is meant to make the code simpler. Copying the binary
is not very expensive and later either the MMU can be enabled before
relocating the binary, or relocatable code makes copying unnecessary
anyway.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start-pbl.c | 20 +++-----------------
arch/arm/pbl/zbarebox.lds.S | 12 ++++++------
2 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 98c1ae3..0757e6c 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -114,26 +114,9 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
void (*barebox)(uint32_t, uint32_t, uint32_t);
- uint32_t offset;
uint32_t pg_start, pg_end, pg_len;
int use_mmu = IS_ENABLED(CONFIG_MMU);
- /* Get offset between linked address and runtime address */
- offset = get_runtime_offset();
-
- pg_start = (uint32_t)&input_data - offset;
- pg_end = (uint32_t)&input_data_end - offset;
- pg_len = pg_end - pg_start;
-
- if (offset && (IS_ENABLED(CONFIG_PBL_FORCE_PIGGYDATA_COPY) ||
- region_overlap(pg_start, pg_len, TEXT_BASE, pg_len * 4))) {
- /*
- * copy piggydata binary to its link address
- */
- memcpy(&input_data, (void *)pg_start, pg_len);
- pg_start = (uint32_t)&input_data;
- }
-
setup_c();
/* set 128 KiB at the end of the MALLOC_BASE for early malloc */
@@ -145,6 +128,9 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
if (use_mmu)
mmu_enable(membase, memsize);
+ pg_start = (uint32_t)&input_data;
+ pg_end = (uint32_t)&input_data_end;
+ pg_len = pg_end - pg_start;
decompress((void *)pg_start,
pg_len,
NULL, NULL,
diff --git a/arch/arm/pbl/zbarebox.lds.S b/arch/arm/pbl/zbarebox.lds.S
index 37af4e9..ff2d2ab 100644
--- a/arch/arm/pbl/zbarebox.lds.S
+++ b/arch/arm/pbl/zbarebox.lds.S
@@ -59,18 +59,18 @@ SECTIONS
.data : { *(.data*) }
. = ALIGN(4);
- __bss_start = .;
- .bss : { *(.bss*) }
- __bss_stop = .;
- _end = .;
-
- . = ALIGN(4);
__piggydata_start = .;
.piggydata : {
*(.piggydata)
}
__piggydata_end = .;
+ . = ALIGN(4);
+ __bss_start = .;
+ .bss : { *(.bss*) }
+ __bss_stop = .;
+ _end = .;
+
_barebox_image_size = __piggydata_end - HEAD_TEXT_BASE;
_barebox_pbl_size = __bss_start - HEAD_TEXT_BASE;
}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 26/28] ARM i.MX: Use SRAM stack in lowlevel code
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (24 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 25/28] ARM pbl: always copy piggydata Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 27/28] generic memory layout: fix deps for [MALLOC|STACK]_BASE Sascha Hauer
2012-10-17 21:03 ` [PATCH 28/28] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT Sascha Hauer
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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_cpuimx25/lowlevel.c | 2 +-
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 | 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 +
14 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
index d08e494..a2ecbbf 100644
--- a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c
@@ -36,7 +36,7 @@ static void __bare_init __naked insdram(void)
uint32_t r;
/* setup a stack to be able to call imx_nand_load_image() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 8);
imx_nand_load_image(_text, barebox_image_size);
diff --git a/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S b/arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S
index 08659e0..0b39562 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;
ldr r0, =MX27_NFC_BASE_ADDR /* start of NFC SRAM */
ldr r2, =MX27_NFC_BASE_ADDR + 0x1000 /* end of NFC SRAM */
diff --git a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
index f95459a..5d56f9d 100644
--- a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
+++ b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c
@@ -47,7 +47,7 @@ static void __bare_init __naked insdram(void)
writel(r, MX35_CCM_BASE_ADDR + MX35_CCM_PDR4);
/* setup a stack to be able to call imx_nand_load_image() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx_nand_load_image(_text, barebox_image_size);
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 425cf99..3a307fd 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
ldr r0, =MX25_NFC_BASE_ADDR /* start of NFC SRAM */
ldr r2, =MX25_NFC_BASE_ADDR + 0x1000 /* end of NFC SRAM */
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 f36a44a..f69951c 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
ldr r0, =MX35_NFC_BASE_ADDR /* start of NFC SRAM */
ldr r2, =MX35_NFC_BASE_ADDR + 0x800 /* end of NFC SRAM */
diff --git a/arch/arm/boards/guf-cupid/lowlevel.c b/arch/arm/boards/guf-cupid/lowlevel.c
index e8ac9a3..d19fa3a 100644
--- a/arch/arm/boards/guf-cupid/lowlevel.c
+++ b/arch/arm/boards/guf-cupid/lowlevel.c
@@ -54,7 +54,7 @@ static void __bare_init __naked insdram(void)
writel(r, MX35_CCM_BASE_ADDR + CCM_PDR4);
/* setup a stack to be able to call imx_nand_load_image() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx_nand_load_image(_text, barebox_image_size);
diff --git a/arch/arm/boards/guf-neso/lowlevel.c b/arch/arm/boards/guf-neso/lowlevel.c
index 55f0475..3e0d55d 100644
--- a/arch/arm/boards/guf-neso/lowlevel.c
+++ b/arch/arm/boards/guf-neso/lowlevel.c
@@ -34,7 +34,7 @@
static void __bare_init __naked insdram(void)
{
/* setup a stack to be able to call imx_nand_load_image() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
imx_nand_load_image(_text, barebox_image_size);
diff --git a/arch/arm/boards/imx21ads/lowlevel_init.S b/arch/arm/boards/imx21ads/lowlevel_init.S
index a46dafe..e2b013e 100644
--- a/arch/arm/boards/imx21ads/lowlevel_init.S
+++ b/arch/arm/boards/imx21ads/lowlevel_init.S
@@ -119,7 +119,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
ldr r0, =MX21_NFC_BASE_ADDR /* start of NFC SRAM */
ldr r2, =MX21_NFC_BASE_ADDR + 0x800 /* end of NFC SRAM */
diff --git a/arch/arm/boards/karo-tx25/lowlevel.c b/arch/arm/boards/karo-tx25/lowlevel.c
index 9223a82..e012f82 100644
--- a/arch/arm/boards/karo-tx25/lowlevel.c
+++ b/arch/arm/boards/karo-tx25/lowlevel.c
@@ -34,7 +34,7 @@ static void __bare_init __naked insdram(void)
uint32_t r;
/* setup a stack to be able to call imx_nand_load_image() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 8);
imx_nand_load_image(_text, barebox_image_size);
diff --git a/arch/arm/boards/pcm038/lowlevel.c b/arch/arm/boards/pcm038/lowlevel.c
index b2a47ac..c5d2190 100644
--- a/arch/arm/boards/pcm038/lowlevel.c
+++ b/arch/arm/boards/pcm038/lowlevel.c
@@ -35,7 +35,7 @@
static void __bare_init __naked insdram(void)
{
/* setup a stack to be able to call imx_nand_load_image() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
imx_nand_load_image(_text, barebox_image_size);
diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c
index a99fe74..0ab6a5b 100644
--- a/arch/arm/boards/pcm043/lowlevel.c
+++ b/arch/arm/boards/pcm043/lowlevel.c
@@ -52,7 +52,7 @@ static void __bare_init __naked insdram(void)
writel(r, MX35_CCM_BASE_ADDR + CCM_PDR4);
/* setup a stack to be able to call imx_nand_load_image() */
- arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+ arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
imx_nand_load_image(_text, barebox_image_size);
diff --git a/arch/arm/mach-imx/include/mach/imx21-regs.h b/arch/arm/mach-imx/include/mach/imx21-regs.h
index 1c4b550..fbbb2eb 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 90b4614..e523563 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
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 27/28] generic memory layout: fix deps for [MALLOC|STACK]_BASE
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (25 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 26/28] ARM i.MX: Use SRAM stack in lowlevel code Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 28/28] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT Sascha Hauer
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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] 40+ messages in thread
* [PATCH 28/28] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
` (26 preceding siblings ...)
2012-10-17 21:03 ` [PATCH 27/28] generic memory layout: fix deps for [MALLOC|STACK]_BASE Sascha Hauer
@ 2012-10-17 21:03 ` Sascha Hauer
27 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-17 21:03 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. With the
removal of HAVE_CONFIGURABLE_MEMORY_LAYOUT barebox no longer requests the
SDRAM region for the stack automatically, so add code to request the region
manually.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/Kconfig | 1 -
arch/arm/cpu/cpu.c | 9 +++++++++
arch/arm/cpu/start.c | 4 ++++
arch/arm/pbl/zbarebox.lds.S | 8 ++++----
common/meminfo.c | 5 -----
5 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 69a6e57..6b36654 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/cpu/cpu.c b/arch/arm/cpu/cpu.c
index 2ca871f..0250b02 100644
--- a/arch/arm/cpu/cpu.c
+++ b/arch/arm/cpu/cpu.c
@@ -91,6 +91,15 @@ void arch_shutdown(void)
__asm__ __volatile__("msr cpsr, %0" : : "r"(r));
}
+extern unsigned long arm_stack_top;
+
+static int arm_request_stack(void)
+{
+ request_sdram_region("stack", arm_stack_top - 0x8000, 0x8000);
+ 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.c b/arch/arm/cpu/start.c
index 163a636..9247684 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -29,6 +29,8 @@
static uint32_t __barebox_arm_boarddata;
+unsigned long arm_stack_top;
+
/*
* the board specific lowlevel init code can pass a pointer or
* data value to barebox_arm_entry() and pick it up later with
@@ -85,6 +87,8 @@ static noinline void __start(uint32_t membase, uint32_t memsize,
mem_malloc_init((void *)malloc_start,
(void *)malloc_end);
+ arm_stack_top = membase + memsize;
+
__barebox_arm_boarddata = boarddata;
start_barebox();
diff --git a/arch/arm/pbl/zbarebox.lds.S b/arch/arm/pbl/zbarebox.lds.S
index ff2d2ab..582abc9 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
__bss_stop = .;
_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;
}
diff --git a/common/meminfo.c b/common/meminfo.c
index 06fce5a..b819d5a 100644
--- a/common/meminfo.c
+++ b/common/meminfo.c
@@ -13,11 +13,6 @@ static int display_meminfo(void)
debug("bss segment: 0x%p -> 0x%p\n", __bss_start, __bss_stop);
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,
- 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] 40+ messages in thread
* Re: [PATCH 06/28] ARM i.MX boards: switch to barebox_arm_entry
2012-10-17 21:03 ` [PATCH 06/28] ARM i.MX boards: switch to barebox_arm_entry Sascha Hauer
@ 2012-10-17 21:12 ` Alexander Shiyan
2012-11-01 19:21 ` Sascha Hauer
0 siblings, 1 reply; 40+ messages in thread
From: Alexander Shiyan @ 2012-10-17 21:12 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Wed, 17 Oct 2012 23:03:15 +0200 от Sascha Hauer <s.hauer@pengutronix.de>:
>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>
>
Sascha, stop. Too many patches while you need to prepare stable version for conference.
Really, stop and try to make one more stable version for your presentation.
;) Sorry, but I think about all :)
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 25/28] ARM pbl: always copy piggydata
2012-10-17 21:03 ` [PATCH 25/28] ARM pbl: always copy piggydata Sascha Hauer
@ 2012-10-18 7:23 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-19 15:34 ` Sascha Hauer
0 siblings, 1 reply; 40+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-18 7:23 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> For now this is meant to make the code simpler. Copying the binary
> is not very expensive and later either the MMU can be enabled before
> relocating the binary, or relocatable code makes copying unnecessary
> anyway.
no I add this for nand boot on at91 I does not have it I must not copy it
later code will
sorry I can not publish the code yet I need to finish other update first
Best Regards,
J.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/cpu/start-pbl.c | 20 +++-----------------
> arch/arm/pbl/zbarebox.lds.S | 12 ++++++------
> 2 files changed, 9 insertions(+), 23 deletions(-)
>
> diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
> index 98c1ae3..0757e6c 100644
> --- a/arch/arm/cpu/start-pbl.c
> +++ b/arch/arm/cpu/start-pbl.c
> @@ -114,26 +114,9 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
> uint32_t boarddata)
> {
> void (*barebox)(uint32_t, uint32_t, uint32_t);
> - uint32_t offset;
> uint32_t pg_start, pg_end, pg_len;
> int use_mmu = IS_ENABLED(CONFIG_MMU);
>
> - /* Get offset between linked address and runtime address */
> - offset = get_runtime_offset();
> -
> - pg_start = (uint32_t)&input_data - offset;
> - pg_end = (uint32_t)&input_data_end - offset;
> - pg_len = pg_end - pg_start;
> -
> - if (offset && (IS_ENABLED(CONFIG_PBL_FORCE_PIGGYDATA_COPY) ||
> - region_overlap(pg_start, pg_len, TEXT_BASE, pg_len * 4))) {
> - /*
> - * copy piggydata binary to its link address
> - */
> - memcpy(&input_data, (void *)pg_start, pg_len);
> - pg_start = (uint32_t)&input_data;
> - }
> -
> setup_c();
>
> /* set 128 KiB at the end of the MALLOC_BASE for early malloc */
> @@ -145,6 +128,9 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
> if (use_mmu)
> mmu_enable(membase, memsize);
>
> + pg_start = (uint32_t)&input_data;
> + pg_end = (uint32_t)&input_data_end;
> + pg_len = pg_end - pg_start;
> decompress((void *)pg_start,
> pg_len,
> NULL, NULL,
> diff --git a/arch/arm/pbl/zbarebox.lds.S b/arch/arm/pbl/zbarebox.lds.S
> index 37af4e9..ff2d2ab 100644
> --- a/arch/arm/pbl/zbarebox.lds.S
> +++ b/arch/arm/pbl/zbarebox.lds.S
> @@ -59,18 +59,18 @@ SECTIONS
> .data : { *(.data*) }
>
> . = ALIGN(4);
> - __bss_start = .;
> - .bss : { *(.bss*) }
> - __bss_stop = .;
> - _end = .;
> -
> - . = ALIGN(4);
> __piggydata_start = .;
> .piggydata : {
> *(.piggydata)
> }
> __piggydata_end = .;
>
> + . = ALIGN(4);
> + __bss_start = .;
> + .bss : { *(.bss*) }
> + __bss_stop = .;
> + _end = .;
> +
> _barebox_image_size = __piggydata_end - HEAD_TEXT_BASE;
> _barebox_pbl_size = __bss_start - HEAD_TEXT_BASE;
> }
> --
> 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] 40+ messages in thread
* Re: [PATCH 02/28] ARM at91sam926x: provide reset function for boards with lowlevel init
2012-10-17 21:03 ` [PATCH 02/28] ARM at91sam926x: provide reset function for boards with lowlevel init Sascha Hauer
@ 2012-10-18 7:26 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-19 15:30 ` Sascha Hauer
0 siblings, 1 reply; 40+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-18 7:26 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> Some Atmel boards use a reset() function provided by the architecture.
> Add a reset function for the board instead and call the architecture
> specific init function from there. While at it, test if we are running
> from SDRAM and skip the init function in this case. This makes the configs
> safe for both first and second stage.
no when using the lowlevel init ont at91 we are first stage so this can not
work at91_get_sdram_size can only known the ramsize after the lowlevle is done
Best Rebgards,
J.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/boards/at91sam9263ek/Makefile | 2 ++
> arch/arm/boards/at91sam9263ek/lowlevel.c | 15 +++++++++++++++
> arch/arm/boards/pm9261/Makefile | 2 ++
> arch/arm/boards/pm9261/lowlevel.c | 14 ++++++++++++++
> arch/arm/boards/pm9263/Makefile | 2 ++
> arch/arm/boards/pm9263/lowlevel.c | 14 ++++++++++++++
> arch/arm/mach-at91/Kconfig | 11 +++++++++++
> arch/arm/mach-at91/Makefile | 4 +++-
> arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 9 +++++++--
> arch/arm/mach-at91/include/mach/board.h | 3 +++
> 10 files changed, 73 insertions(+), 3 deletions(-)
> create mode 100644 arch/arm/boards/at91sam9263ek/lowlevel.c
> create mode 100644 arch/arm/boards/pm9261/lowlevel.c
> create mode 100644 arch/arm/boards/pm9263/lowlevel.c
>
> diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
> index eb072c0..47ab803 100644
> --- a/arch/arm/boards/at91sam9263ek/Makefile
> +++ b/arch/arm/boards/at91sam9263ek/Makefile
> @@ -1 +1,3 @@
> obj-y += init.o
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> diff --git a/arch/arm/boards/at91sam9263ek/lowlevel.c b/arch/arm/boards/at91sam9263ek/lowlevel.c
> new file mode 100644
> index 0000000..6050bcd
> --- /dev/null
> +++ b/arch/arm/boards/at91sam9263ek/lowlevel.c
> @@ -0,0 +1,15 @@
> +#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>
> +#include <mach/at91sam9_sdramc.h>
> +
> +void __naked __bare_init reset(void)
> +{
> + common_reset();
> +
> + at91sam926x_entry(AT91_SDRAM_BASE, at91_get_sdram_size());
> +}
> diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
> index eb072c0..47ab803 100644
> --- a/arch/arm/boards/pm9261/Makefile
> +++ b/arch/arm/boards/pm9261/Makefile
> @@ -1 +1,3 @@
> obj-y += init.o
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> diff --git a/arch/arm/boards/pm9261/lowlevel.c b/arch/arm/boards/pm9261/lowlevel.c
> new file mode 100644
> index 0000000..b8a8728
> --- /dev/null
> +++ b/arch/arm/boards/pm9261/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();
> +
> + at91sam926x_entry(AT91_SDRAM_BASE, SZ_64M);
> +}
> diff --git a/arch/arm/boards/pm9263/Makefile b/arch/arm/boards/pm9263/Makefile
> index eb072c0..47ab803 100644
> --- a/arch/arm/boards/pm9263/Makefile
> +++ b/arch/arm/boards/pm9263/Makefile
> @@ -1 +1,3 @@
> obj-y += init.o
> +obj-y += lowlevel.o
> +pbl-y += lowlevel.o
> diff --git a/arch/arm/boards/pm9263/lowlevel.c b/arch/arm/boards/pm9263/lowlevel.c
> new file mode 100644
> index 0000000..b8a8728
> --- /dev/null
> +++ b/arch/arm/boards/pm9263/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();
> +
> + at91sam926x_entry(AT91_SDRAM_BASE, SZ_64M);
> +}
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index 30225fa..f962084 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -107,6 +107,9 @@ config SUPPORT_CALAO_DAB_MMX
> config SUPPORT_CALAO_MOB_TNY_MD2
> bool
>
> +config HAVE_AT91SAM926X_LOWLEVEL_INIT
> + bool
> +
> # ----------------------------------------------------------
>
> if ARCH_AT91RM9200
> @@ -116,6 +119,7 @@ choice
> prompt "AT91RM9200 Board Type"
>
> config MACH_AT91RM9200EK
> + select HAVE_AT91RM9200_LOWLEVEL_INIT
> bool "Atmel AT91RM9200-EK Evaluation Kit"
> help
> Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
> @@ -180,8 +184,10 @@ config MACH_AT91SAM9261EK
>
> config MACH_PM9261
> bool "Ronetix PM9261"
> + select HAVE_AT91SAM926X_LOWLEVEL_INIT
> select HAS_DM9000
> select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
> help
> Say y here if you are using the Ronetix PM9261 Board
>
> @@ -258,18 +264,23 @@ choice
> config MACH_AT91SAM9263EK
> bool "Atmel AT91SAM9263-EK"
> select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
> select HAVE_NAND_ATMEL_BUSWIDTH_16
> + select HAVE_AT91SAM926X_LOWLEVEL_INIT
> help
> Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
>
> config MACH_MMCCPU
> bool "Bucyrus MMC-CPU"
> + select HAVE_AT91SAM926X_LOWLEVEL_INIT
> help
> Say y here if you are using the Bucyrus MMC-CPU
>
> config MACH_PM9263
> bool "Ronetix PM9263"
> select MACH_HAS_LOWLEVEL_INIT
> + select MACH_DO_LOWLEVEL_INIT
> + select HAVE_AT91SAM926X_LOWLEVEL_INIT
> help
> Say y here if you are using the Ronetix PM9263 Board
>
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index 3ade725..f9cb4f1 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -1,11 +1,13 @@
> obj-y += clock.o gpio.o
>
> -lowlevel_init-y = at91sam926x_lowlevel_init.o
> lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
> obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
>
> pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
>
> +obj-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
> +pbl-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
> +
> 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 0ee0345..a399854 100644
> --- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> +++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
> @@ -34,12 +34,17 @@ static void inline pmc_check_mckrdy(void)
> } while (!(r & AT91_PMC_MCKRDY));
> }
>
> -void __naked __bare_init reset(void)
> +void __naked __bare_init at91sam926x_entry(unsigned long sdram_base,
> + unsigned long sdram_size)
> {
> + uint32_t pc;
> u32 r;
> int i;
>
> - common_reset();
> + pc = get_pc();
> +
> + if (pc < AT91_SDRAM_BASE || pc > AT91_SDRAM_BASE + 0x10000000)
> + goto end;
>
> at91_sys_write(AT91_WDT_MR, CONFIG_SYS_WDTC_WDMR_VAL);
>
> diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
> index 670c73d..eb71ed5 100644
> --- a/arch/arm/mach-at91/include/mach/board.h
> +++ b/arch/arm/mach-at91/include/mach/board.h
> @@ -154,4 +154,7 @@ struct at91_spi_platform_data {
> };
>
> void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata);
> +
> +void at91sam926x_entry(unsigned long sdram_base, unsigned long sdram_size);
> +
> #endif
> --
> 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] 40+ messages in thread
* Re: [PATCH 03/28] ARM at91rm9200: provide reset function for boards with lowlevel init
2012-10-17 21:03 ` [PATCH 03/28] ARM at91rm9200: " Sascha Hauer
@ 2012-10-18 7:27 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 40+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-18 7:27 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> Some Atmel boards use a reset() function provided by the architecture.
> Add a reset function for the board instead and call the architecture
> specific init function from there. While at it, test if we are running
> from SDRAM and skip the init function in this case. This makes the configs
> safe for both first and second stage.
same as sam9
Best Regards,
J.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/boards/at91rm9200ek/Makefile | 2 ++
> arch/arm/mach-at91/Kconfig | 3 +++
> arch/arm/mach-at91/Makefile | 7 ++-----
> arch/arm/mach-at91/at91rm9200_lowlevel_init.c | 9 ++++++---
> arch/arm/mach-at91/include/mach/board.h | 1 +
> 5 files changed, 14 insertions(+), 8 deletions(-)
>
> 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index f962084..8ec033b 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -110,6 +110,9 @@ config SUPPORT_CALAO_MOB_TNY_MD2
> config HAVE_AT91SAM926X_LOWLEVEL_INIT
> bool
>
> +config HAVE_AT91RM9200_LOWLEVEL_INIT
> + bool
> +
> # ----------------------------------------------------------
>
> if ARCH_AT91RM9200
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index f9cb4f1..5ce433c 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -1,10 +1,7 @@
> obj-y += clock.o gpio.o
>
> -lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
> -obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> -
> -pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
> -
> +obj-$(CONFIG_HAVE_AT91RM9200_LOWLEVEL_INIT) += at91rm9200_lowlevel_init.o
> +pbl-$(CONFIG_HAVE_AT91RM9200_LOWLEVEL_INIT) += at91rm9200_lowlevel_init.o
> obj-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
> pbl-$(CONFIG_HAVE_AT91SAM926X_LOWLEVEL_INIT) += at91sam926x_lowlevel_init.o
>
> diff --git a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
> index 3ce3e67..a0a0d5e 100644
> --- a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
> +++ b/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
> @@ -21,12 +21,15 @@ 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_base,
> + unsigned long sdram_size)
> {
> - u32 r;
> + u32 r, pc;
> int i;
>
> - common_reset();
> + pc = get_pc();
> + if (pc < AT91_SDRAM_BASE || pc > AT91_SDRAM_BASE + 0x10000000)
> + goto end;
>
> /*
> * PMC Check if the PLL is already initialized
> diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
> index eb71ed5..fc8947d 100644
> --- a/arch/arm/mach-at91/include/mach/board.h
> +++ b/arch/arm/mach-at91/include/mach/board.h
> @@ -156,5 +156,6 @@ struct at91_spi_platform_data {
> void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata);
>
> void at91sam926x_entry(unsigned long sdram_base, unsigned long sdram_size);
> +void at91rm9200_entry(unsigned long sdram_base, unsigned long sdram_size);
>
> #endif
> --
> 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] 40+ messages in thread
* Re: [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments
2012-10-17 21:03 ` [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments Sascha Hauer
@ 2012-10-18 7:29 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-19 15:32 ` Sascha Hauer
0 siblings, 1 reply; 40+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-18 7:29 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> This puts the code from barebox_uncompress inline into
> the caller. Also we now call the uncompressed binary
> with the memory and boarddata arguments, so everything
> is ready for the uncompressed image to pick up the
> values.
can we use atags / dt and machine_id
it more flexible and allow us to be called as a kernel
Best Regards,
J.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/cpu/start-pbl.c | 64 +++++++++++++++++++---------------------------
> 1 file changed, 27 insertions(+), 37 deletions(-)
>
> diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
> index e612d51..751e4fa 100644
> --- a/arch/arm/cpu/start-pbl.c
> +++ b/arch/arm/cpu/start-pbl.c
> @@ -120,47 +120,13 @@ void noinline errorfn(char *error)
> while (1);
> }
>
> -static void barebox_uncompress(void *compressed_start, unsigned int len)
> -{
> - void (*barebox)(void);
> - /*
> - * remap_cached currently does not work rendering the feature
> - * of enabling the MMU in the PBL useless. disable for now.
> - */
> - 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)
> - 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,
> - (void *)TEXT_BASE, NULL, errorfn);
> -
> - if (use_mmu)
> - mmu_disable();
> -
> - flush_icache();
> -
> - barebox();
> -}
> -
> static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
> uint32_t boarddata)
> {
> + void (*barebox)(uint32_t, uint32_t, uint32_t);
> uint32_t offset;
> uint32_t pg_start, pg_end, pg_len;
> + int use_mmu = 0;
>
> /* Get offset between linked address and runtime address */
> offset = get_runtime_offset();
> @@ -180,7 +146,31 @@ static noinline void __barebox_arm_entry(uint32_t membase, uint32_t memsize,
>
> setup_c();
>
> - barebox_uncompress((void *)pg_start, pg_len);
> + /* set 128 KiB at the end of the MALLOC_BASE for early malloc */
> + free_mem_ptr = membase + memsize - SZ_256K;
> + free_mem_end_ptr = free_mem_ptr + SZ_128K;
> +
> + ttb = (void *)((free_mem_ptr - 0x4000) & ~0x3fff);
> +
> + if (use_mmu)
> + mmu_enable(membase, memsize);
> +
> + decompress((void *)pg_start,
> + pg_len,
> + NULL, NULL,
> + (void *)TEXT_BASE, NULL, errorfn);
> +
> + if (use_mmu)
> + mmu_disable();
> +
> + flush_icache();
> +
> + 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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 02/28] ARM at91sam926x: provide reset function for boards with lowlevel init
2012-10-18 7:26 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-19 15:30 ` Sascha Hauer
0 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-19 15:30 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Thu, Oct 18, 2012 at 09:26:56AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> > Some Atmel boards use a reset() function provided by the architecture.
> > Add a reset function for the board instead and call the architecture
> > specific init function from there. While at it, test if we are running
> > from SDRAM and skip the init function in this case. This makes the configs
> > safe for both first and second stage.
>
> no when using the lowlevel init ont at91 we are first stage so this can not
> work at91_get_sdram_size can only known the ramsize after the lowlevle is done
You are right, something is wrong here.
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] 40+ messages in thread
* Re: [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments
2012-10-18 7:29 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-19 15:32 ` Sascha Hauer
2012-10-19 16:15 ` Sascha Hauer
0 siblings, 1 reply; 40+ messages in thread
From: Sascha Hauer @ 2012-10-19 15:32 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Thu, Oct 18, 2012 at 09:29:59AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> > This puts the code from barebox_uncompress inline into
> > the caller. Also we now call the uncompressed binary
> > with the memory and boarddata arguments, so everything
> > is ready for the uncompressed image to pick up the
> > values.
> can we use atags / dt and machine_id
Of course that's the goal to be able to call barebox like the kernel,
but this is not an interface to the outside world, it's purely barebox
internal. That's what the third argument is for, to pass data from the
entry on to barebox.
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] 40+ messages in thread
* Re: [PATCH 25/28] ARM pbl: always copy piggydata
2012-10-18 7:23 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-19 15:34 ` Sascha Hauer
2012-10-19 17:27 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 40+ messages in thread
From: Sascha Hauer @ 2012-10-19 15:34 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Thu, Oct 18, 2012 at 09:23:31AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> > For now this is meant to make the code simpler. Copying the binary
> > is not very expensive and later either the MMU can be enabled before
> > relocating the binary, or relocatable code makes copying unnecessary
> > anyway.
>
> no I add this for nand boot on at91 I does not have it I must not copy it
> later code will
I don't know what you are doing, but hooking up into that place is not a
good idea.
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] 40+ messages in thread
* Re: [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments
2012-10-19 15:32 ` Sascha Hauer
@ 2012-10-19 16:15 ` Sascha Hauer
0 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-10-19 16:15 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Fri, Oct 19, 2012 at 05:32:41PM +0200, Sascha Hauer wrote:
> On Thu, Oct 18, 2012 at 09:29:59AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> > > This puts the code from barebox_uncompress inline into
> > > the caller. Also we now call the uncompressed binary
> > > with the memory and boarddata arguments, so everything
> > > is ready for the uncompressed image to pick up the
> > > values.
> > can we use atags / dt and machine_id
>
> Of course that's the goal to be able to call barebox like the kernel,
> but this is not an interface to the outside world, it's purely barebox
> internal. That's what the third argument is for, to pass data from the
> entry on to barebox.
Checkout the following branch. This is what I'm working on. build the
imxdt_defconfig. It builds a barebox which runs on all i.MX as a second
stage dt probed barebox. It's work in progress, so I guarantee for
nothing. The imxdt is basically a normal board support. We now have the
entry to barebox under board control, so this can be used to pick up the
oftree, look for memory nodes and pass the memory on to barebox. The
third argument is used to keep a pointer to the devicetree which is then
later used from the board to probe.
As the name suggests, this is currently i.MX specific, but it doesn't
have to be.
BTW for those who want to test this branch, barebox needs some nodes
currently not in all mainline dts files (ccm and gpt, linux,stdout-path
property in chosen node). Let me know when you are interested, I have
some example files.
git://git.pengutronix.de/git/barebox.git work/imxdt
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] 40+ messages in thread
* Re: [PATCH 25/28] ARM pbl: always copy piggydata
2012-10-19 15:34 ` Sascha Hauer
@ 2012-10-19 17:27 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 40+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-19 17:27 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 17:34 Fri 19 Oct , Sascha Hauer wrote:
> On Thu, Oct 18, 2012 at 09:23:31AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 23:03 Wed 17 Oct , Sascha Hauer wrote:
> > > For now this is meant to make the code simpler. Copying the binary
> > > is not very expensive and later either the MMU can be enabled before
> > > relocating the binary, or relocatable code makes copying unnecessary
> > > anyway.
> >
> > no I add this for nand boot on at91 I does not have it I must not copy it
> > later code will
>
> I don't know what you are doing, but hooking up into that place is not a
> good idea.
I load the data from lowlevel as the pbl is run from sram
Best Regards,
J.
>
> 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] 40+ messages in thread
* Re: [PATCH 06/28] ARM i.MX boards: switch to barebox_arm_entry
2012-10-17 21:12 ` Alexander Shiyan
@ 2012-11-01 19:21 ` Sascha Hauer
0 siblings, 0 replies; 40+ messages in thread
From: Sascha Hauer @ 2012-11-01 19:21 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: barebox
Hi Alexander,
On Thu, Oct 18, 2012 at 01:12:17AM +0400, Alexander Shiyan wrote:
> Wed, 17 Oct 2012 23:03:15 +0200 от Sascha Hauer <s.hauer@pengutronix.de>:
> >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>
> >
> Sascha, stop. Too many patches while you need to prepare stable version for conference.
> Really, stop and try to make one more stable version for your presentation.
> ;) Sorry, but I think about all :)
Although until now I haven't answered this mail I for sure have read it,
and yes, you are right. That's why I have concentrated on getting some
fixes out rather than adding more features. Thanks for pointing that out
;)
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] 40+ messages in thread
end of thread, other threads:[~2012-11-01 19:21 UTC | newest]
Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-17 21:03 [PATCH] ARM: Make memory known to lowlevel code Sascha Hauer
2012-10-17 21:03 ` [PATCH 01/28] ARM: Make malloc available in all initcalls Sascha Hauer
2012-10-17 21:03 ` [PATCH 02/28] ARM at91sam926x: provide reset function for boards with lowlevel init Sascha Hauer
2012-10-18 7:26 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-19 15:30 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 03/28] ARM at91rm9200: " Sascha Hauer
2012-10-18 7:27 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 21:03 ` [PATCH 04/28] ARM: Add new entry point for barebox Sascha Hauer
2012-10-17 21:03 ` [PATCH 05/28] ARM i.MX Add functions to get sdram base and size Sascha Hauer
2012-10-17 21:03 ` [PATCH 06/28] ARM i.MX boards: switch to barebox_arm_entry Sascha Hauer
2012-10-17 21:12 ` Alexander Shiyan
2012-11-01 19:21 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 07/28] ARM AT91 " Sascha Hauer
2012-10-17 21:03 ` [PATCH 08/28] ARM i.MXs " Sascha Hauer
2012-10-17 21:03 ` [PATCH 09/28] ARM OMAP " Sascha Hauer
2012-10-17 21:03 ` [PATCH 10/28] ARM Samsung " Sascha Hauer
2012-10-17 21:03 ` [PATCH 11/28] ARM PXA " Sascha Hauer
2012-10-17 21:03 ` [PATCH 12/28] ARM ep93xx " Sascha Hauer
2012-10-17 21:03 ` [PATCH 13/28] ARM tegra " Sascha Hauer
2012-10-17 21:03 ` [PATCH 14/28] ARM nomadik " Sascha Hauer
2012-10-17 21:03 ` [PATCH 15/28] ARM versatile " Sascha Hauer
2012-10-17 21:03 ` [PATCH 16/28] ARM netx " Sascha Hauer
2012-10-17 21:03 ` [PATCH 17/28] ARM: remove now unused *_LOWLEVEL_INIT Kconfig options Sascha Hauer
2012-10-17 21:03 ` [PATCH 18/28] ARM start: remove unused board_init_lowlevel* functions Sascha Hauer
2012-10-17 21:03 ` [PATCH 19/28] ARM pbl: setup stack at end of SDRAM Sascha Hauer
2012-10-17 21:03 ` [PATCH 20/28] ARM pbl: Call uncompressed binary with arguments Sascha Hauer
2012-10-18 7:29 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-19 15:32 ` Sascha Hauer
2012-10-19 16:15 ` Sascha Hauer
2012-10-17 21:03 ` [PATCH 21/28] ARM pbl: make MMU functional again Sascha Hauer
2012-10-17 21:03 ` [PATCH 22/28] ARM start: pick up memory/boarddata arguments from pbl Sascha Hauer
2012-10-17 21:03 ` [PATCH 23/28] ARM start: Add barebox_arm_boarddata function Sascha Hauer
2012-10-17 21:03 ` [PATCH 24/28] ARM: Determine base and size of malloc space from SDRAM Sascha Hauer
2012-10-17 21:03 ` [PATCH 25/28] ARM pbl: always copy piggydata Sascha Hauer
2012-10-18 7:23 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-19 15:34 ` Sascha Hauer
2012-10-19 17:27 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 21:03 ` [PATCH 26/28] ARM i.MX: Use SRAM stack in lowlevel code Sascha Hauer
2012-10-17 21:03 ` [PATCH 27/28] generic memory layout: fix deps for [MALLOC|STACK]_BASE Sascha Hauer
2012-10-17 21:03 ` [PATCH 28/28] ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox