Skip to contentSkip to conversation

Add new ARM entry point for barebox

PATCH New Jean-Christophe PLAGNIOL-VILLARD 1 participant 37 messages Feb 3, 2013

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Add new ARM entry point for barebox

Third version. I update at91 and test it on all at91 core

Best Regards,
J.

Second version. I updated the series to current -next. Besides, I dropped the board reserved memory chunk at the end of SDRAM as it does not work for configurations which run in tight SRAM. Boards are now required to reserve some memory themselves and skip this area from barebox_arm_entry should they need some space.

This version is compile tested only currently. My plan is to do some additional runtime tests on Monday when I'm back from the FOSDEM and apply it afterwards. So I won't apply any patches conflicting to this series before applying this one.

Sascha

The following changes since commit 531c3cd6adcea6b874772221f2f7787472550cee:

at91sam9_ddrsdr: fix register on mdr read and sdram detection for ddr size (2013-02-03 08:27:57 +0800)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git delivery/arm-entry

for you to fetch changes up to cd5f8e8aaf808ae19e7c1d2890f90f7de809a2c5:

ARM pbl: inline decompress function (2013-02-03 08:27:59 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (3):
ARM AT91: switch at91sam9g45 to barebox_arm_entry ARM AT91: switch at91sam9x5 to barebox_arm_entry ARM AT91: switch at91sam9n12 to barebox_arm_entry

Sascha Hauer (33):
ARM: Add new entry point for barebox
ARM: add __noreturn to board_init_lowlevel_return ARM i.MX: Use SRAM stack in lowlevel code
ARM i.MX: Add i.MX specific entry point for barebox ARM i.MX: prepare external nand boot for SoC specific entry ARM i.MX boards: switch to barebox_arm_entry
ARM MXS boards: switch to barebox_arm_entry
ARM OMAP boards: switch to barebox_arm_entry
ARM Samsung boards: switch to barebox_arm_entry ARM PXA boards: switch to barebox_arm_entry
ARM ep93xx boards: switch to barebox_arm_entry ARM tegra boards: switch to barebox_arm_entry
ARM nomadik boards: switch to barebox_arm_entry ARM versatile boards: switch to barebox_arm_entry ARM netx boards: switch to barebox_arm_entry
ARM clep7212: switch to barebox_arm_entry
ARM raspberrypi: switch to barebox_arm_entry
ARM AT91: switch at91sam9 to barebox_arm_entry part1 ARM AT91: switch at91rm9200 board to barebox_arm_entry ARM AT91: switch sama5d3 to barebox_arm_entry
ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT ARM start-pbl: make board_init_lowlevel_return static ARM start-pbl: call uncompressed binary with arguments ARM start: pickup parameters from pbl
ARM: Setup stack at end of SDRAM
ARM pbl: Use dynamic parameters for early malloc space ARM mmu: pickup already enabled mmu
ARM: Factor out early mmu code
ARM: Enable mmu early
ARM: Automatically determine malloc size
generic memory layout: fix deps for [MALLOC|STACK]_BASE
ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT
ARM pbl: inline decompress function

 arch/arm/Kconfig                                       |    1 -
 arch/arm/boards/a9m2410/lowlevel_init.S                |    9 +++++++--
 arch/arm/boards/a9m2440/lowlevel_init.S                |    9 +++++++--
 arch/arm/boards/archosg9/Makefile                      |    4 ++--
 arch/arm/boards/archosg9/lowlevel.c                    |    3 ++-
 arch/arm/boards/at91sam9261ek/Makefile                 |    4 ++--
 arch/arm/boards/at91sam9263ek/Makefile                 |    4 ++--
 arch/arm/boards/beagle/lowlevel.c                      |   16 ++++++++++++++--
 arch/arm/boards/beaglebone/Makefile                    |    2 ++
 arch/arm/boards/beaglebone/lowlevel.c                  |   12 +++++++++++-
 arch/arm/boards/ccxmx51/Makefile                       |    2 ++
 arch/arm/boards/ccxmx51/lowlevel.c                     |    9 +++++++++
 arch/arm/boards/chumby_falconwing/Makefile             |    2 ++
 arch/arm/boards/chumby_falconwing/lowlevel.c           |   11 +++++++++++
 arch/arm/boards/clep7212/lowlevel.c                    |    3 ++-
 arch/arm/boards/crystalfontz-cfa10036/Makefile         |    2 ++
 arch/arm/boards/crystalfontz-cfa10036/lowlevel.c       |   11 +++++++++++
 arch/arm/boards/edb93xx/sdram_cfg.c                    |    4 ++++
 arch/arm/boards/efika-mx-smartbook/Makefile            |    2 ++
 arch/arm/boards/efika-mx-smartbook/lowlevel.c          |    9 +++++++++
 arch/arm/boards/eukrea_cpuimx25/lowlevel.c             |    6 +++---
 arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S        |    7 ++++---
 arch/arm/boards/eukrea_cpuimx35/lowlevel.c             |    8 ++++----
 arch/arm/boards/eukrea_cpuimx51/Makefile               |    2 ++
 arch/arm/boards/eukrea_cpuimx51/lowlevel.c             |    9 +++++++++
 arch/arm/boards/freescale-mx23-evk/Makefile            |    2 ++
 arch/arm/boards/freescale-mx23-evk/lowlevel.c          |   11 +++++++++++
 arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S |    7 ++++---
 arch/arm/boards/freescale-mx28-evk/Makefile            |    2 ++
 arch/arm/boards/freescale-mx28-evk/lowlevel.c          |   11 +++++++++++
 arch/arm/boards/freescale-mx35-3-stack/3stack.c        |    1 +
 arch/arm/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 ++++++++++
 arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S   |    9 +++++++--
 arch/arm/boards/friendlyarm-mini6410/Makefile          |    2 ++
 arch/arm/boards/friendlyarm-mini6410/lowlevel.c        |   11 +++++++++++
 arch/arm/boards/friendlyarm-tiny210/lowlevel.c         |    4 +++-
 arch/arm/boards/friendlyarm-tiny6410/Makefile          |    3 ++-
 arch/arm/boards/friendlyarm-tiny6410/lowlevel.c        |   11 +++++++++++
 arch/arm/boards/guf-cupid/lowlevel.c                   |    8 ++++----
 arch/arm/boards/guf-neso/lowlevel.c                    |    8 ++++----
 arch/arm/boards/guf-vincell/lowlevel.c                 |    5 +++--
 arch/arm/boards/imx21ads/imx21ads.c                    |    3 ++-
 arch/arm/boards/imx21ads/lowlevel_init.S               |   11 ++++++++---
 arch/arm/boards/imx233-olinuxino/Makefile              |    2 ++
 arch/arm/boards/imx233-olinuxino/lowlevel.c            |   11 +++++++++++
 arch/arm/boards/imx27ads/lowlevel_init.S               |    4 ++--
 arch/arm/boards/karo-tx25/lowlevel.c                   |   10 ++++++----
 arch/arm/boards/karo-tx28/Makefile                     |    2 ++
 arch/arm/boards/karo-tx28/lowlevel.c                   |   11 +++++++++++
 arch/arm/boards/karo-tx51/Makefile                     |    2 ++
 arch/arm/boards/karo-tx51/lowlevel.c                   |    9 +++++++++
 arch/arm/boards/karo-tx53/lowlevel.c                   |    6 ++----
 arch/arm/boards/mioa701/Makefile                       |    2 ++
 arch/arm/boards/mioa701/lowlevel.c                     |   10 ++++++++++
 arch/arm/boards/mmccpu/Makefile                        |    4 ++--
 arch/arm/boards/netx/platform.S                        |    7 +++++--
 arch/arm/boards/nhk8815/Makefile                       |    2 ++
 arch/arm/boards/nhk8815/lowlevel.c                     |   10 ++++++++++
 arch/arm/boards/omap343xdsp/lowlevel.c                 |   15 +++++++++++++--
 arch/arm/boards/omap3evm/lowlevel.c                    |   13 +++++++++++--
 arch/arm/boards/panda/lowlevel.c                       |    7 ++++---
 arch/arm/boards/pcm027/lowlevel_init.S                 |    7 +++++--
 arch/arm/boards/pcm037/lowlevel.c                      |    6 +++---
 arch/arm/boards/pcm038/lowlevel.c                      |    8 +++++---
 arch/arm/boards/pcm043/lowlevel.c                      |    8 ++++----
 arch/arm/boards/pcm049/lowlevel.c                      |    7 ++++---
 arch/arm/boards/pcm051/Makefile                        |    2 ++
 arch/arm/boards/pcm051/lowlevel.c                      |   11 +++++++++++
 arch/arm/boards/phycard-a-l1/lowlevel.c                |   12 ++++++++++--
 arch/arm/boards/phycard-a-xl2/lowlevel.c               |    7 ++++---
 arch/arm/boards/phycard-i.MX27/lowlevel_init.S         |    4 ++--
 arch/arm/boards/pm9261/Makefile                        |    4 ++--
 arch/arm/boards/pm9263/Makefile                        |    4 ++--
 arch/arm/boards/raspberry-pi/Makefile                  |    2 ++
 arch/arm/boards/raspberry-pi/lowlevel.c                |   11 +++++++++++
 arch/arm/boards/scb9328/lowlevel_init.S                |    4 ++--
 arch/arm/boards/tny-a926x/Makefile                     |    4 ++--
 arch/arm/boards/toshiba-ac100/Makefile                 |    2 ++
 arch/arm/boards/toshiba-ac100/lowlevel.c               |   10 ++++++++++
 arch/arm/boards/tqma53/Makefile                        |    2 ++
 arch/arm/boards/tqma53/lowlevel.c                      |    9 +++++++++
 arch/arm/boards/usb-a926x/Makefile                     |    4 ++--
 arch/arm/boards/versatile/Makefile                     |    3 ++-
 arch/arm/boards/versatile/lowlevel.c                   |   10 ++++++++++
 arch/arm/configs/archosg9_defconfig                    |    1 -
 arch/arm/configs/phycard_a_l1_defconfig                |    2 --
 arch/arm/cpu/Makefile                                  |    4 ++--
 arch/arm/cpu/cpu.c                                     |   12 ++++++++++++
 arch/arm/cpu/mmu-early.c                               |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 arch/arm/cpu/mmu-early.h                               |    6 ++++++
 arch/arm/cpu/mmu.c                                     |    9 ++++++++-
 arch/arm/cpu/start-pbl.c                               |  163 +++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------
 arch/arm/cpu/start.c                                   |  107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------
 arch/arm/include/asm/barebox-arm.h                     |    4 +++-
 arch/arm/lib/Makefile                                  |    1 -
 arch/arm/lib/arm.c                                     |   14 --------------
 arch/arm/mach-at91/Kconfig                             |   19 +++++++++----------
 arch/arm/mach-at91/Makefile                            |   11 ++++++++---
 arch/arm/mach-at91/at91rm9200_lowlevel_init.c          |    2 +-
 arch/arm/mach-at91/at91sam9260_lowlevel_init.c         |    2 ++
 arch/arm/mach-at91/at91sam9261_lowlevel_init.c         |    2 ++
 arch/arm/mach-at91/at91sam9263_lowlevel_init.c         |    2 ++
 arch/arm/mach-at91/at91sam926x_lowlevel_init.c         |    7 ++-----
 arch/arm/mach-at91/at91sam9g45_lowlevel_init.c         |   26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/at91sam9n12_lowlevel_init.c         |   26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/at91sam9x5_lowlevel_init.c          |   26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/include/mach/at91_lowlevel_init.h   |    5 +++++
 arch/arm/mach-at91/sama5d3_lowlevel_init.c             |   25 +++++++++++++++++++++++++
 arch/arm/mach-clps711x/Kconfig                         |    2 --
 arch/arm/mach-ep93xx/Kconfig                           |    8 --------
 arch/arm/mach-ep93xx/Makefile                          |    4 ++--
 arch/arm/mach-ep93xx/lowlevel_init.S                   |   11 ++++++++++-
 arch/arm/mach-imx/Kconfig                              |   17 -----------------
 arch/arm/mach-imx/Makefile                             |    5 ++++-
 arch/arm/mach-imx/esdctl.c                             |  136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
 arch/arm/mach-imx/external-nand-boot.c                 |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
 arch/arm/mach-imx/include/mach/esdctl.h                |   11 +++++++++++
 arch/arm/mach-imx/include/mach/imx-nand.h              |    1 -
 arch/arm/mach-imx/include/mach/imx21-regs.h            |    1 +
 arch/arm/mach-imx/include/mach/imx25-regs.h            |    3 +++
 arch/arm/mach-imx/include/mach/imx27-regs.h            |    1 +
 arch/arm/mach-imx/include/mach/imx31-regs.h            |    3 +++
 arch/arm/mach-netx/Kconfig                             |    1 -
 arch/arm/mach-omap/Kconfig                             |    5 -----
 arch/arm/mach-omap/arch-omap.dox                       |    1 -
 arch/arm/mach-omap/include/mach/omap3-silicon.h        |    1 +
 arch/arm/mach-omap/omap3_core.S                        |   11 ++++-------
 arch/arm/mach-pxa/Kconfig                              |    1 -
 arch/arm/mach-samsung/Kconfig                          |    6 ------
 arch/arm/pbl/zbarebox.lds.S                            |    8 ++++----
 common/Kconfig                                         |   21 +++++++++------------
 common/meminfo.c                                       |    5 -----
 include/asm-generic/memory_layout.h                    |    6 ++----
 143 files changed, 1064 insertions(+), 400 deletions(-)
 create mode 100644 arch/arm/boards/ccxmx51/lowlevel.c
 create mode 100644 arch/arm/boards/chumby_falconwing/lowlevel.c
 create mode 100644 arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
 create mode 100644 arch/arm/boards/efika-mx-smartbook/lowlevel.c
 create mode 100644 arch/arm/boards/eukrea_cpuimx51/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx23-evk/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx28-evk/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx51-pdk/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx53-loco/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx53-smd/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx6-arm2/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
 create mode 100644 arch/arm/boards/friendlyarm-mini6410/lowlevel.c
 create mode 100644 arch/arm/boards/friendlyarm-tiny6410/lowlevel.c
 create mode 100644 arch/arm/boards/imx233-olinuxino/lowlevel.c
 create mode 100644 arch/arm/boards/karo-tx28/lowlevel.c
 create mode 100644 arch/arm/boards/karo-tx51/lowlevel.c
 create mode 100644 arch/arm/boards/mioa701/lowlevel.c
 create mode 100644 arch/arm/boards/nhk8815/lowlevel.c
 create mode 100644 arch/arm/boards/pcm051/lowlevel.c
 create mode 100644 arch/arm/boards/raspberry-pi/lowlevel.c
 create mode 100644 arch/arm/boards/toshiba-ac100/lowlevel.c
 create mode 100644 arch/arm/boards/tqma53/lowlevel.c
 create mode 100644 arch/arm/boards/versatile/lowlevel.c
 create mode 100644 arch/arm/cpu/mmu-early.c
 create mode 100644 arch/arm/cpu/mmu-early.h
 delete mode 100644 arch/arm/lib/arm.c
 create mode 100644 arch/arm/mach-at91/at91sam9g45_lowlevel_init.c
 create mode 100644 arch/arm/mach-at91/at91sam9n12_lowlevel_init.c
 create mode 100644 arch/arm/mach-at91/at91sam9x5_lowlevel_init.c
 create mode 100644 arch/arm/mach-at91/sama5d3_lowlevel_init.c

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH 1/36 ARM: Add new entry point for barebox

From: Sascha Hauer <[email protected]>

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.

---
 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(+)
arch/arm/cpu/start-pbl.c +13 -0
index f506792..f1ce2c5 100644
@@ -183,3 +183,16 @@ void __naked board_init_lowlevel_return(void)
 
 	barebox_uncompress((void *)pg_start, pg_len);
 }
+
+/*
+ * Main ARM entry point in the compressed image. Call this with the memory
+ * region you can spare for barebox. This doesn't necessarily have to be the
+ * full SDRAM. The currently running binary can be inside or outside of this
+ * region. TEXT_BASE can be inside or outside of this region. boarddata will
+ * be preserved and can be accessed later with barebox_arm_boarddata().
+ */
+void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
+		uint32_t boarddata)
+{
+	board_init_lowlevel_return();
+}
arch/arm/cpu/start.c +13 -0
index 793445a..0b7eee8 100644
@@ -63,3 +63,16 @@ void __naked board_init_lowlevel_return(void)
 
 	start_barebox();
 }
+
+/*
+ * Main ARM entry point in the uncompressed image. Call this with the memory
+ * region you can spare for barebox. This doesn't necessarily have to be the
+ * full SDRAM. The currently running binary can be inside or outside of this
+ * region. TEXT_BASE can be inside or outside of this region. boarddata will
+ * be preserved and can be accessed later with barebox_arm_boarddata().
+ */
+void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
+                uint32_t boarddata)
+{
+	board_init_lowlevel_return();
+}
arch/arm/include/asm/barebox-arm.h +1 -0
index 993130d..4ccf938 100644
@@ -39,5 +39,6 @@ void board_init_lowlevel_return(void);
 uint32_t get_runtime_offset(void);
 
 void setup_c(void);
+void __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize, uint32_t boarddata);
 
 #endif	/* _BAREBOX_ARM_H_ */
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/36 ARM: add __noreturn to board_init_lowlevel_return

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/start-pbl.c           |    6 +++---
 arch/arm/cpu/start.c               |    2 +-
 arch/arm/include/asm/barebox-arm.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/cpu/start-pbl.c +3 -3
index f1ce2c5..da62111 100644
@@ -118,9 +118,9 @@ static void mmu_disable(void)
 	__mmu_cache_off();
 }
 
-static void barebox_uncompress(void *compressed_start, unsigned int len)
+static void __noreturn barebox_uncompress(void *compressed_start, unsigned int len)
 {
-	void (*barebox)(void);
+	void __noreturn (*barebox)(void);
 	/*
 	 * remap_cached currently does not work rendering the feature
 	 * of enabling the MMU in the PBL useless. disable for now.
@@ -155,7 +155,7 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
  * Board code can jump here by either returning from board_init_lowlevel
  * or by calling this function directly.
  */
-void __naked board_init_lowlevel_return(void)
+void __naked __noreturn board_init_lowlevel_return(void)
 {
 	uint32_t offset;
 	uint32_t pg_start, pg_end, pg_len;
arch/arm/cpu/start.c +1 -1
index 0b7eee8..f212b61 100644
@@ -55,7 +55,7 @@ void __naked __bare_init reset(void)
  * Board code can jump here by either returning from board_init_lowlevel
  * or by calling this function directly.
  */
-void __naked board_init_lowlevel_return(void)
+void __naked __noreturn board_init_lowlevel_return(void)
 {
 	arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
 
arch/arm/include/asm/barebox-arm.h +1 -1
index 4ccf938..0574f34 100644
@@ -35,7 +35,7 @@ int	dram_init (void);
 extern char __exceptions_start[], __exceptions_stop[];
 
 void board_init_lowlevel(void);
-void board_init_lowlevel_return(void);
+void __noreturn board_init_lowlevel_return(void);
 uint32_t get_runtime_offset(void);
 
 void setup_c(void);
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/36 ARM i.MX: Use SRAM stack in lowlevel code

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

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.

---
 arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S        |    3 ++-
 arch/arm/boards/eukrea_cpuimx35/lowlevel.c             |    2 +-
 arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S |    3 ++-
 arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S |    3 ++-
 arch/arm/boards/guf-cupid/lowlevel.c                   |    2 +-
 arch/arm/boards/guf-neso/lowlevel.c                    |    2 +-
 arch/arm/boards/imx21ads/lowlevel_init.S               |    3 ++-
 arch/arm/boards/karo-tx25/lowlevel.c                   |    3 ++-
 arch/arm/boards/pcm037/lowlevel.c                      |    2 +-
 arch/arm/boards/pcm038/lowlevel.c                      |    2 +-
 arch/arm/boards/pcm043/lowlevel.c                      |    2 +-
 arch/arm/mach-imx/include/mach/imx21-regs.h            |    1 +
 arch/arm/mach-imx/include/mach/imx25-regs.h            |    3 +++
 arch/arm/mach-imx/include/mach/imx27-regs.h            |    1 +
 arch/arm/mach-imx/include/mach/imx31-regs.h            |    3 +++
 15 files changed, 24 insertions(+), 11 deletions(-)
arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S +2 -1
index 4e69aac..287b513 100644
@@ -124,7 +124,8 @@ reset:
 	sdram_init
 
 #ifdef CONFIG_NAND_IMX_BOOT
-	ldr	sp, =STACK_BASE + STACK_SIZE - 12	/* Setup a temporary stack in SDRAM */
+	/* Setup a temporary stack in SDRAM */
+	ldr	sp, =MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 4;
 
 	b	imx27_barebox_boot_nand_external
 #endif /* CONFIG_NAND_IMX_BOOT */
arch/arm/boards/eukrea_cpuimx35/lowlevel.c +1 -1
index 8f4615a..c43f7fe 100644
@@ -138,7 +138,7 @@ void __bare_init __naked reset(void)
 	writel(r, MX35_CCM_BASE_ADDR + MX35_CCM_PDR4);
 
 	/* setup a stack to be able to call imx35_barebox_boot_nand_external() */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+	arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
 
 	imx35_barebox_boot_nand_external();
 #else
arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S +2 -1
index 595c485..2e49e6e 100644
@@ -98,7 +98,8 @@ reset:
 	str r3, [r0, #0x30]
 
 #ifdef CONFIG_NAND_IMX_BOOT
-	ldr	sp, =STACK_BASE + STACK_SIZE - 12 /* Setup a temporary stack in SDRAM */
+	/* Setup a temporary stack in SRAM */
+	ldr	sp, =MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 4
 
 	b	imx25_barebox_boot_nand_external
 #endif /* CONFIG_NAND_IMX_BOOT */
arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S +2 -1
index 5461b61..c63c953 100644
@@ -155,7 +155,8 @@ reset:
 	str	r3, [r0, #0x30]
 
 #ifdef CONFIG_NAND_IMX_BOOT
-	ldr	sp, =STACK_BASE + STACK_SIZE - 12		/* Setup a temporary stack in SDRAM */
+	/* Setup a temporary stack in internal SRAM */
+	ldr	sp, =MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 4
 
 	b	imx35_barebox_boot_nand_external
 #endif /* CONFIG_NAND_IMX_BOOT */
arch/arm/boards/guf-cupid/lowlevel.c +1 -1
index f2994eb..c141b54 100644
@@ -314,7 +314,7 @@ void __bare_init __naked reset(void)
 	writel(r0, MX35_CCM_BASE_ADDR + MX35_CCM_PDR4);
 
 	/* setup a stack to be able to call imx35_barebox_boot_nand_external() */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+	arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
 
 	imx35_barebox_boot_nand_external();
 #else
arch/arm/boards/guf-neso/lowlevel.c +1 -1
index 7a366d9..ca44607 100644
@@ -88,7 +88,7 @@ void __bare_init __naked reset(void)
 
 #ifdef CONFIG_NAND_IMX_BOOT
 	/* setup a stack to be able to call imx27_barebox_boot_nand_external() */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+	arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
 
 	imx27_barebox_boot_nand_external();
 #else
arch/arm/boards/imx21ads/lowlevel_init.S +2 -1
index f06c964..5be4995 100644
@@ -118,7 +118,8 @@ reset:
 	str	r1, [r0]
 
 #ifdef CONFIG_NAND_IMX_BOOT
-	ldr	sp, =STACK_BASE + STACK_SIZE - 12	/* Setup a temporary stack in SDRAM */
+	/* Setup a temporary stack in SRAM */
+	ldr	sp, =MX21_IRAM_BASE_ADDR + MX21_IRAM_SIZE - 4
 
 	b	imx21_barebox_boot_nand_external
 #endif /* CONFIG_NAND_IMX_BOOT */
arch/arm/boards/karo-tx25/lowlevel.c +2 -1
index b1afe18..9e96e39 100644
@@ -21,6 +21,7 @@
 #include <mach/imx25-regs.h>
 #include <mach/esdctl.h>
 #include <io.h>
+#include <sizes.h>
 #include <mach/imx-nand.h>
 #include <asm/barebox-arm.h>
 #include <asm/barebox-arm-head.h>
@@ -134,7 +135,7 @@ void __bare_init __naked reset(void)
 
 #ifdef CONFIG_NAND_IMX_BOOT
 	/* setup a stack to be able to call imx25_barebox_boot_nand_external() */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+	arm_setup_stack(MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 8);
 
 	imx25_barebox_boot_nand_external();
 #else
arch/arm/boards/pcm037/lowlevel.c +1 -1
index da01732..b531615 100644
@@ -127,7 +127,7 @@ void __bare_init __naked reset(void)
 
 #ifdef CONFIG_NAND_IMX_BOOT
 	/* setup a stack to be able to call imx31_barebox_boot_nand_external() */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+	arm_setup_stack(MX31_IRAM_BASE_ADDR + MX31_IRAM_SIZE - 12);
 
 	imx31_barebox_boot_nand_external();
 #else
arch/arm/boards/pcm038/lowlevel.c +1 -1
index 4515107..aecdbf3 100644
@@ -95,7 +95,7 @@ void __bare_init __naked reset(void)
 
 #ifdef CONFIG_NAND_IMX_BOOT
 	/* setup a stack to be able to call mx27_barebox_boot_nand_external() */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+	arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
 
 	imx27_barebox_boot_nand_external();
 #else
arch/arm/boards/pcm043/lowlevel.c +1 -1
index 639064f..a9832e2 100644
@@ -190,7 +190,7 @@ void __bare_init __naked reset(void)
 	writel(r, MX35_CCM_BASE_ADDR + MX35_CCM_PDR4);
 
 	/* setup a stack to be able to call imx35_barebox_boot_nand_external() */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
+	arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
 
 	imx35_barebox_boot_nand_external();
 #else
arch/arm/mach-imx/include/mach/imx21-regs.h +1 -0
index 87bd99c..1fa463a 100644
@@ -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
arch/arm/mach-imx/include/mach/imx25-regs.h +3 -0
index b8ae45a..9ab0fb3 100644
@@ -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)
  */
arch/arm/mach-imx/include/mach/imx27-regs.h +1 -0
index 44bc1d3..c45befb 100644
@@ -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
arch/arm/mach-imx/include/mach/imx31-regs.h +3 -0
index f641fe6..be3e4c1 100644
@@ -21,6 +21,9 @@
 
 #include <sizes.h>
 
+#define MX31_IRAM_BASE_ADDR		0x1fffc000
+#define MX31_IRAM_SIZE			0x00004000
+
 #define MX31_AIPS1_BASE_ADDR		0x43f00000
 #define MX31_AIPS1_SIZE			SZ_1M
 #define MX31_MAX_BASE_ADDR			(MX31_AIPS1_BASE_ADDR + 0x04000)
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/36 ARM i.MX: Add i.MX specific entry point for barebox

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

Additionally to the generic entry point the i.MX specific ones calculate the SDRAM size automatically so the boards do not have to care.

---
 arch/arm/cpu/start-pbl.c                |   12 +++
 arch/arm/mach-imx/esdctl.c              |  136 ++++++++++++++++++++++++++-----
 arch/arm/mach-imx/include/mach/esdctl.h |   11 +++
 3 files changed, 138 insertions(+), 21 deletions(-)
arch/arm/cpu/start-pbl.c +12 -0
index da62111..11ab025 100644
@@ -190,6 +190,18 @@ void __naked __noreturn board_init_lowlevel_return(void)
  * full SDRAM. The currently running binary can be inside or outside of this
  * region. TEXT_BASE can be inside or outside of this region. boarddata will
  * be preserved and can be accessed later with barebox_arm_boarddata().
+ *
+ * -> membase + memsize
+ *   ARM_RESERVE_MEM_SIZE    - reserved for board usage. Will not be touched
+ *                             by barebox
+ *   STACK_SIZE              - stack
+ *   16KiB, aligned to 16KiB - First level page table if early MMU support
+ *                             is enabled
+ *   128KiB                  - early memory space
+ * -> maximum end of barebox binary
+ *
+ * Usually a TEXT_BASE of 1MiB below your lowest possible end of memory should
+ * be fine.
  */
 void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
 		uint32_t boarddata)
arch/arm/mach-imx/esdctl.c +115 -21

150 lines not on this page · raw message

arch/arm/mach-imx/include/mach/esdctl.h +11 -0
index 1a265c8..26436d9 100644
@@ -127,4 +127,15 @@
 //#define ESDCFGx_tRC_14		0x0000000e	// 15 seems to not exist
 #define ESDCFGx_tRC_16			0x0000000f
 
+#ifndef __ASSEMBLY__
+void __naked __noreturn imx1_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx25_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx27_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx31_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx35_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx51_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx53_barebox_entry(uint32_t boarddata);
+void __naked __noreturn imx6_barebox_entry(uint32_t boarddata);
+#endif
+
 #endif /* __MACH_ESDCTL_V2_H */
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 5/36 ARM i.MX: prepare external nand boot for SoC specific entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

i.MX will get SoC specific entry points for barebox. To find the correct one we have to call these from the SoC specific imx*_barebox_boot_nand_external functions.

---
 arch/arm/mach-imx/external-nand-boot.c    |   73 +++++++++++++++++++++--------
 arch/arm/mach-imx/include/mach/imx-nand.h |    1 -
 2 files changed, 53 insertions(+), 21 deletions(-)
arch/arm/mach-imx/external-nand-boot.c +53 -20
index 39ffb94..c97fec9 100644
@@ -259,14 +259,19 @@ void __bare_init imx_nand_load_image(void *dest, int size)
 }
 
 /*
- * We are now running at the address we are linked at. Now load the image from
- * NAND to SDRAM and continue booting.
+ * This function assumes the currently running binary has been
+ * copied from its current position to an offset. It returns
+ * to the calling function - offset.
+ * NOTE: The calling function may not return itself since it still
+ * works on the old content of the lr register. Only call this
+ * from a __noreturn function.
  */
-static void __bare_init __naked insdram(void)
+static __bare_init __naked void jump_sdram(unsigned long offset)
 {
-	imx_nand_load_image((void *)_text, barebox_image_size);
-
-	board_init_lowlevel_return();
+	__asm__ __volatile__ (
+			"sub lr, lr, %0;"
+			"mov pc, lr;" : : "r"(offset)
+			);
 }
 
 /*
@@ -274,7 +279,7 @@ static void __bare_init __naked insdram(void)
  * running inside the NFC address space. If not, barebox is started from the
  * currently running address without loading anything from NAND.
  */
-void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_base)
+void __bare_init imx_barebox_boot_nand_external(unsigned long nfc_base)
 {
 	u32 r;
 	u32 *src, *trg;
@@ -283,7 +288,7 @@ void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_bas
 	/* skip NAND boot if not running from NFC space */
 	r = get_pc();
 	if (r < nfc_base || r > nfc_base + 0x800)
-		board_init_lowlevel_return();
+		return;
 
 	src = (unsigned int *)nfc_base;
 	trg = (unsigned int *)_text;
@@ -291,13 +296,6 @@ void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_bas
 	/* Move ourselves out of NFC SRAM */
 	for (i = 0; i < 0x800 / sizeof(int); i++)
 		*trg++ = *src++;
-
-	/* Jump to SDRAM */
-	r = (unsigned int)&insdram;
-	__asm__ __volatile__("mov pc, %0" : : "r"(r));
-
-	/* not reached */
-	while (1);
 }
 
 /*
@@ -306,30 +304,65 @@ void __bare_init __noreturn imx_barebox_boot_nand_external(unsigned long nfc_bas
  * NAND. In this case the booting is continued without loading an image from
  * NAND. This function needs a stack to be set up.
  */
+#ifdef CONFIG_ARCH_IMX21
 void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
 {
-	imx_barebox_boot_nand_external(MX21_NFC_BASE_ADDR);
+	unsigned long nfc_base = MX21_NFC_BASE_ADDR;
+
+	imx_barebox_boot_nand_external(nfc_base);
+	jump_sdram(nfc_base - (unsigned long)_text);
+	imx_nand_load_image((void *)_text, barebox_image_size);
+	board_init_lowlevel_return();
 }
+#endif
 
+#ifdef CONFIG_ARCH_IMX25
 void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
 {
-	imx_barebox_boot_nand_external(MX25_NFC_BASE_ADDR);
+	unsigned long nfc_base = MX25_NFC_BASE_ADDR;
+
+	imx_barebox_boot_nand_external(nfc_base);
+	jump_sdram(nfc_base - (unsigned long)_text);
+	imx_nand_load_image((void *)_text, barebox_image_size);
+	board_init_lowlevel_return();
 }
+#endif
 
+#ifdef CONFIG_ARCH_IMX27
 void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
 {
-	imx_barebox_boot_nand_external(MX27_NFC_BASE_ADDR);
+	unsigned long nfc_base = MX27_NFC_BASE_ADDR;
+
+	imx_barebox_boot_nand_external(nfc_base);
+	jump_sdram(nfc_base - (unsigned long)_text);
+	imx_nand_load_image((void *)_text, barebox_image_size);
+	board_init_lowlevel_return();
 }
+#endif
 
+#ifdef CONFIG_ARCH_IMX31
 void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
 {
-	imx_barebox_boot_nand_external(MX31_NFC_BASE_ADDR);
+	unsigned long nfc_base = MX31_NFC_BASE_ADDR;
+
+	imx_barebox_boot_nand_external(nfc_base);
+	jump_sdram(nfc_base - (unsigned long)_text);
+	imx_nand_load_image((void *)_text, barebox_image_size);
+	board_init_lowlevel_return();
 }
+#endif
 
+#ifdef CONFIG_ARCH_IMX35
 void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
 {
-	imx_barebox_boot_nand_external(MX35_NFC_BASE_ADDR);
+	unsigned long nfc_base = MX35_NFC_BASE_ADDR;
+
+	imx_barebox_boot_nand_external(nfc_base);
+	jump_sdram(nfc_base - (unsigned long)_text);
+	imx_nand_load_image((void *)_text, barebox_image_size);
+	board_init_lowlevel_return();
 }
+#endif
 
 #define CONFIG_NAND_IMX_BOOT_DEBUG
 #ifdef CONFIG_NAND_IMX_BOOT_DEBUG
arch/arm/mach-imx/include/mach/imx-nand.h +0 -1
index a1f209e..8352d79 100644
@@ -3,7 +3,6 @@
 
 #include <linux/mtd/mtd.h>
 
-void imx_nand_load_image(void *dest, int size);
 void imx21_barebox_boot_nand_external(void);
 void imx25_barebox_boot_nand_external(void);
 void imx27_barebox_boot_nand_external(void);
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH 6/36 ARM i.MX boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

Most i.MX boards can use the imx*_barebox_entry functions. The remaining (i.MX21, i.MX6) use hardcoded base addresses.

---
 arch/arm/Kconfig                                      |    2 ++
 arch/arm/boards/ccxmx51/Makefile                      |    2 ++
 arch/arm/boards/ccxmx51/lowlevel.c                    |    9 +++++++++
 arch/arm/boards/efika-mx-smartbook/Makefile           |    2 ++
 arch/arm/boards/efika-mx-smartbook/lowlevel.c         |    9 +++++++++
 arch/arm/boards/eukrea_cpuimx25/lowlevel.c            |    6 +++---
 arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S       |    4 ++--
 arch/arm/boards/eukrea_cpuimx35/lowlevel.c            |    6 +++---
 arch/arm/boards/eukrea_cpuimx51/Makefile              |    2 ++
 arch/arm/boards/eukrea_cpuimx51/lowlevel.c            |    9 +++++++++
 .../arm/boards/freescale-mx25-3-stack/lowlevel_init.S |    4 ++--
 arch/arm/boards/freescale-mx35-3-stack/3stack.c       |    1 +
 .../arm/boards/freescale-mx35-3-stack/lowlevel_init.S |    4 ++--
 arch/arm/boards/freescale-mx51-pdk/Makefile           |    2 ++
 arch/arm/boards/freescale-mx51-pdk/lowlevel.c         |    9 +++++++++
 arch/arm/boards/freescale-mx53-loco/Makefile          |    2 ++
 arch/arm/boards/freescale-mx53-loco/lowlevel.c        |    9 +++++++++
 arch/arm/boards/freescale-mx53-smd/Makefile           |    2 ++
 arch/arm/boards/freescale-mx53-smd/lowlevel.c         |    9 +++++++++
 arch/arm/boards/freescale-mx6-arm2/Makefile           |    2 ++
 arch/arm/boards/freescale-mx6-arm2/lowlevel.c         |   10 ++++++++++
 arch/arm/boards/freescale-mx6-sabrelite/Makefile      |    2 ++
 arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c    |   10 ++++++++++
 arch/arm/boards/guf-cupid/lowlevel.c                  |    6 +++---
 arch/arm/boards/guf-neso/lowlevel.c                   |    6 +++---
 arch/arm/boards/guf-vincell/lowlevel.c                |    5 +++--
 arch/arm/boards/imx21ads/imx21ads.c                   |    3 ++-
 arch/arm/boards/imx21ads/lowlevel_init.S              |    8 ++++++--
 arch/arm/boards/imx27ads/lowlevel_init.S              |    4 ++--
 arch/arm/boards/karo-tx25/lowlevel.c                  |    7 ++++---
 arch/arm/boards/karo-tx51/Makefile                    |    2 ++
 arch/arm/boards/karo-tx51/lowlevel.c                  |    9 +++++++++
 arch/arm/boards/karo-tx53/lowlevel.c                  |    6 ++----
 arch/arm/boards/pcm037/lowlevel.c                     |    4 ++--
 arch/arm/boards/pcm038/lowlevel.c                     |    6 ++++--
 arch/arm/boards/pcm043/lowlevel.c                     |    6 +++---
 arch/arm/boards/phycard-i.MX27/lowlevel_init.S        |    4 ++--
 arch/arm/boards/scb9328/lowlevel_init.S               |    4 ++--
 arch/arm/boards/tqma53/Makefile                       |    2 ++
 arch/arm/boards/tqma53/lowlevel.c                     |    9 +++++++++
 arch/arm/mach-imx/Kconfig                             |   17 -----------------
 arch/arm/mach-imx/Makefile                            |    5 ++++-
 arch/arm/mach-imx/external-nand-boot.c                |   11 ++++++-----
 43 files changed, 175 insertions(+), 66 deletions(-)
 create mode 100644 arch/arm/boards/ccxmx51/lowlevel.c
 create mode 100644 arch/arm/boards/efika-mx-smartbook/lowlevel.c
 create mode 100644 arch/arm/boards/eukrea_cpuimx51/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx51-pdk/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx53-loco/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx53-smd/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx6-arm2/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
 create mode 100644 arch/arm/boards/karo-tx51/lowlevel.c
 create mode 100644 arch/arm/boards/tqma53/lowlevel.c
arch/arm/Kconfig +2 -0
index 6f7a71f..cac3360 100644
@@ -58,6 +58,8 @@ config ARCH_IMX
 	select CLKDEV_LOOKUP
 	select WATCHDOG_IMX_RESET_SOURCE
 	select HAS_DEBUG_LL
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_MXS
 	bool "Freescale i.MX23/28 (mxs) based"
arch/arm/boards/ccxmx51/Makefile +2 -0
index f9eb2db..d392533 100644
@@ -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
arch/arm/boards/ccxmx51/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..282024e
@@ -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);
+}
arch/arm/boards/efika-mx-smartbook/Makefile +2 -0
index d08bb68..6ca1c06 100644
@@ -1,3 +1,5 @@
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
 obj-y += board.o
 obj-y += flash_header.o
 pbl-y += flash_header.o
arch/arm/boards/efika-mx-smartbook/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..282024e
@@ -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);
+}
arch/arm/boards/eukrea_cpuimx25/lowlevel.c +3 -3
index 3c1b50c..6afdd17 100644
@@ -107,7 +107,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0x80000000 && r < 0x90000000)
-		board_init_lowlevel_return();
+		goto out;
 
 	/* Init Mobile DDR */
 	writel(0x0000000E, MX25_ESDCTL_BASE_ADDR + IMX_ESDMISC);
@@ -132,7 +132,7 @@ void __bare_init __naked reset(void)
 	arm_setup_stack(STACK_BASE + STACK_SIZE - 12);
 
 	imx25_barebox_boot_nand_external();
-#else
-	board_init_lowlevel_return();
 #endif
+out:
+	imx25_barebox_entry(0);
 }
arch/arm/boards/eukrea_cpuimx27/lowlevel_init.S +2 -2
index 287b513..c37d271 100644
@@ -119,7 +119,7 @@ reset:
 	cmp	pc, #0xc0000000
 	bhi	1f
 
-	b	board_init_lowlevel_return
+	b	imx27_barebox_entry
 1:
 	sdram_init
 
@@ -131,4 +131,4 @@ reset:
 #endif /* CONFIG_NAND_IMX_BOOT */
 
 ret:
-	b	board_init_lowlevel_return
+	b	imx27_barebox_entry
arch/arm/boards/eukrea_cpuimx35/lowlevel.c +3 -3
index c43f7fe..0533c1d 100644
@@ -110,7 +110,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0x80000000 && r < 0x90000000)
-		board_init_lowlevel_return();
+		goto out;
 
 	/* Init Mobile DDR */
 	writel(0x0000000E, MX35_ESDCTL_BASE_ADDR + IMX_ESDMISC);
@@ -141,7 +141,7 @@ void __bare_init __naked reset(void)
 	arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
 
 	imx35_barebox_boot_nand_external();
-#else
-	board_init_lowlevel_return();
 #endif
+out:
+	imx35_barebox_entry(0);
 }
arch/arm/boards/eukrea_cpuimx51/Makefile +2 -0
index ce81ffa..1a23797 100644
@@ -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
arch/arm/boards/eukrea_cpuimx51/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..282024e
@@ -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);
+}
arch/arm/boards/freescale-mx25-3-stack/lowlevel_init.S +2 -2
index 2e49e6e..a55508e 100644
@@ -77,7 +77,7 @@ reset:
 	cmp	pc, #0x90000000
 	bhi	1f
 
-	b	board_init_lowlevel_return
+	b	imx25_barebox_entry
 
 1:
 	ldr r0, ESDCTL_BASE_W
@@ -105,7 +105,7 @@ reset:
 #endif /* CONFIG_NAND_IMX_BOOT */
 
 ret:
-	b	board_init_lowlevel_return
+	b	imx25_barebox_entry
 
 /*
  * r0: control base, r1: ram bank base
arch/arm/boards/freescale-mx35-3-stack/3stack.c +1 -0
index 02844c5..e1cb73c 100644
@@ -30,6 +30,7 @@
 #include <init.h>
 #include <nand.h>
 #include <net.h>
+#include <sizes.h>
 #include <partition.h>
 
 #include <asm/armlinux.h>
arch/arm/boards/freescale-mx35-3-stack/lowlevel_init.S +2 -2
index c63c953..7b0a32b 100644
@@ -126,7 +126,7 @@ reset:
 	cmp	pc, #CSD1_BASE_ADDR
 	bhi	1f
 
-	b	board_init_lowlevel_return
+	b	imx35_barebox_entry
 
 1:
 	ldr	r0, =ESDCTL_BASE_ADDR
@@ -161,7 +161,7 @@ reset:
 	b	imx35_barebox_boot_nand_external
 #endif /* CONFIG_NAND_IMX_BOOT */
 
-	b	board_init_lowlevel_return
+	b	imx35_barebox_entry
 
 /*
  * r0: ESDCTL control base, r1: sdram slot base
arch/arm/boards/freescale-mx51-pdk/Makefile +2 -0
index d08bb68..2f45976 100644
@@ -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
arch/arm/boards/freescale-mx51-pdk/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..282024e
@@ -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);
+}
arch/arm/boards/freescale-mx53-loco/Makefile +2 -0
index d08bb68..2f45976 100644
@@ -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
arch/arm/boards/freescale-mx53-loco/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..c6f79ca
@@ -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);
+}
arch/arm/boards/freescale-mx53-smd/Makefile +2 -0
index d08bb68..2f45976 100644
@@ -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
arch/arm/boards/freescale-mx53-smd/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..c6f79ca
@@ -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);
+}
arch/arm/boards/freescale-mx6-arm2/Makefile +2 -0
index 11199d2..21fb7d9 100644
@@ -1,2 +1,4 @@
 obj-y += board.o flash_header.o
 pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/freescale-mx6-arm2/lowlevel.c new file +10 -0
new file mode 100644
index 0000000..810b890
@@ -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);
+}
arch/arm/boards/freescale-mx6-sabrelite/Makefile +2 -0
index 11199d2..21fb7d9 100644
@@ -1,2 +1,4 @@
 obj-y += board.o flash_header.o
 pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c new file +10 -0
new file mode 100644
index 0000000..8f995ee
@@ -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);
+}
arch/arm/boards/guf-cupid/lowlevel.c +3 -3
index c141b54..9620abd 100644
@@ -234,7 +234,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r0 = get_pc();
 	if (r0 > 0x80000000 && r0 < 0x90000000)
-		board_init_lowlevel_return();
+		goto out;
 
 	/* Configure drive strength */
 
@@ -317,7 +317,7 @@ void __bare_init __naked reset(void)
 	arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
 
 	imx35_barebox_boot_nand_external();
-#else
-	board_init_lowlevel_return();
 #endif
+out:
+	imx35_barebox_entry(0);
 }
arch/arm/boards/guf-neso/lowlevel.c +3 -3
index ca44607..ebb8d56 100644
@@ -48,7 +48,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0xa0000000 && r < 0xb0000000)
-		board_init_lowlevel_return();
+		goto out;
 
 	/*
 	 * DDR on CSD0
@@ -91,7 +91,7 @@ void __bare_init __naked reset(void)
 	arm_setup_stack(MX27_IRAM_BASE_ADDR + MX27_IRAM_SIZE - 8);
 
 	imx27_barebox_boot_nand_external();
-#else
-	board_init_lowlevel_return();
 #endif
+out:
+	imx27_barebox_entry(0);
 }
arch/arm/boards/guf-vincell/lowlevel.c +3 -2
index 8003c67..1243b9a 100644
@@ -5,6 +5,7 @@
 #include <mach/imx5.h>
 #include <mach/iomux-v3.h>
 #include <mach/esdctl-v4.h>
+#include <mach/esdctl.h>
 #include <asm/barebox-arm.h>
 #include <asm/barebox-arm-head.h>
 #include <io.h>
@@ -131,7 +132,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0x70000000 && r < 0xf0000000)
-		board_init_lowlevel_return();
+		imx51_barebox_entry(0);
 
 	/* Setup a preliminary stack */
 	r = 0xf8000000 + 0x60000 - 16;
@@ -145,5 +146,5 @@ void __bare_init __naked reset(void)
 
 	imx_esdctlv4_init();
 
-	board_init_lowlevel_return();
+	imx51_barebox_entry(0);
 }
arch/arm/boards/imx21ads/imx21ads.c +2 -1
index 3d07633..6087ad4 100644
@@ -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;
 }
arch/arm/boards/imx21ads/lowlevel_init.S +6 -2
index 5be4995..5c6d3f7 100644
@@ -14,6 +14,7 @@
  */
 
 #include <config.h>
+#include <sizes.h>
 #include <asm-generic/memory_layout.h>
 #include <mach/imx21-regs.h>
 #include <asm/barebox-arm-head.h>
@@ -75,7 +76,7 @@ reset:
 	cmp	pc, #0xc8000000
 	bhi	1f
 
-	b	board_init_lowlevel_return
+	b	ret
 1:
 
 	/* Precharge */
@@ -125,7 +126,10 @@ reset:
 #endif /* CONFIG_NAND_IMX_BOOT */
 
 ret:
-	b	board_init_lowlevel_return
+	mov	r0, #0xc0000000
+	mov	r1, #SZ_64M
+	mov	r2, #0
+	b	barebox_arm_entry
 
 /*
  *  spin for a while.  we need to wait at least 200 usecs.
arch/arm/boards/imx27ads/lowlevel_init.S +2 -2
index 2dc34b5..8939f6a 100644
@@ -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
 
arch/arm/boards/karo-tx25/lowlevel.c +4 -3
index 9e96e39..45fa17f 100644
@@ -23,6 +23,7 @@
 #include <io.h>
 #include <sizes.h>
 #include <mach/imx-nand.h>
+#include <mach/esdctl.h>
 #include <asm/barebox-arm.h>
 #include <asm/barebox-arm-head.h>
 #include <asm/system.h>
@@ -115,7 +116,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0x80000000 && r < 0xa0000000)
-		board_init_lowlevel_return();
+		goto out;
 
 	/* set to 3.3v SDRAM */
 	writel(0x800, MX25_IOMUXC_BASE_ADDR + 0x454);
@@ -138,7 +139,7 @@ void __bare_init __naked reset(void)
 	arm_setup_stack(MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE - 8);
 
 	imx25_barebox_boot_nand_external();
-#else
-	board_init_lowlevel_return();
 #endif
+out:
+	imx25_barebox_entry(0);
 }
arch/arm/boards/karo-tx51/Makefile +2 -0
index 6f51586..00f2b05 100644
@@ -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
arch/arm/boards/karo-tx51/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..282024e
@@ -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);
+}
arch/arm/boards/karo-tx53/lowlevel.c +2 -4
index 0ca164b..fe9dac1 100644
@@ -2,8 +2,7 @@
 #include <asm/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 #include <mach/imx5.h>
-
-#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
+#include <mach/esdctl.h>
 
 void __naked reset(void)
 {
@@ -17,6 +16,5 @@ void __naked reset(void)
 	if (IS_ENABLED(CONFIG_TX53_REV_XX30))
 		imx53_init_lowlevel(800);
 
-	board_init_lowlevel_return();
+	imx53_barebox_entry(0);
 }
-#endif
arch/arm/boards/pcm037/lowlevel.c +2 -2
index b531615..176c968 100644
@@ -84,7 +84,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0x80000000 && r < 0xa0000000)
-		board_init_lowlevel_return();
+		imx31_barebox_entry(0);
 
 #if defined CONFIG_PCM037_SDRAM_BANK0_128MB
 #define ROWS0	ESDCTL0_ROW13
@@ -131,6 +131,6 @@ void __bare_init __naked reset(void)
 
 	imx31_barebox_boot_nand_external();
 #else
-	board_init_lowlevel_return();
+	imx31_barebox_entry(0);
 #endif
 }
arch/arm/boards/pcm038/lowlevel.c +4 -2
index aecdbf3..c00b3b4 100644
@@ -49,7 +49,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0xa0000000 && r < 0xb0000000)
-		board_init_lowlevel_return();
+		goto out;
 
 	/* re-program the PLL prior(!) starting the SDRAM controller */
 	writel(MPCTL0_VAL, MX27_CCM_BASE_ADDR + MX27_MPCTL0);
@@ -99,6 +99,8 @@ void __bare_init __naked reset(void)
 
 	imx27_barebox_boot_nand_external();
 #else
-	board_init_lowlevel_return();
+	imx27_barebox_entry(0);
 #endif
+out:
+	imx27_barebox_entry(0);
 }
arch/arm/boards/pcm043/lowlevel.c +3 -3
index a9832e2..d19d5b5 100644
@@ -117,7 +117,7 @@ void __bare_init __naked reset(void)
 	/* Skip SDRAM initialization if we run from RAM */
 	r = get_pc();
 	if (r > 0x80000000 && r < 0x90000000)
-		board_init_lowlevel_return();
+		goto out;
 
 	/* Set DDR Type to SDRAM, drive strength workaround	*
 	 * 0x00000000	MDDR					*
@@ -193,7 +193,7 @@ void __bare_init __naked reset(void)
 	arm_setup_stack(MX35_IRAM_BASE_ADDR + MX35_IRAM_SIZE - 8);
 
 	imx35_barebox_boot_nand_external();
-#else
-	board_init_lowlevel_return();
 #endif
+out:
+	imx35_barebox_entry(0);
 }
arch/arm/boards/phycard-i.MX27/lowlevel_init.S +2 -2
index cb5d83d..d81066e 100644
@@ -82,7 +82,7 @@ reset:
 	cmp	pc, #0xc0000000
 	bhi	1f
 
-	b	board_init_lowlevel_return
+	b	imx27_barebox_entry
 
 1:
 	/* 399 MHz */
@@ -115,5 +115,5 @@ reset:
 #endif /* CONFIG_NAND_IMX_BOOT */
 
 ret:
-	b	board_init_lowlevel_return
+	b	imx27_barebox_entry
 
arch/arm/boards/scb9328/lowlevel_init.S +2 -2
index cefac84..f8197bd 100644
@@ -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
arch/arm/boards/tqma53/Makefile +2 -0
index d08bb68..2f45976 100644
@@ -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
arch/arm/boards/tqma53/lowlevel.c new file +9 -0
new file mode 100644
index 0000000..c6f79ca
@@ -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);
+}
arch/arm/mach-imx/Kconfig +0 -17
index 3cb35a0..4115d35 100644
@@ -206,7 +206,6 @@ choice
 config MACH_SCB9328
 	bool "Synertronixx scb9328"
 	select HAS_DM9000
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using the Synertronixx scb9328 board
 
@@ -223,7 +222,6 @@ choice
 
 config MACH_IMX21ADS
 	bool "Freescale i.MX21ADS"
-	select MACH_HAS_LOWLEVEL_INIT
 	select HAS_CS8900
 	help
 	  Say Y here if you are using the Freescale i.MX21ads board equipped
@@ -242,14 +240,12 @@ choice
 
 config MACH_EUKREA_CPUIMX25
 	bool "Eukrea CPUIMX25"
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using the Eukrea Electromatique's CPUIMX25
 	  equipped with a Freescale i.MX25 Processor
 
 config MACH_FREESCALE_MX25_3STACK
 	bool "Freescale MX25 3stack"
-	select MACH_HAS_LOWLEVEL_INIT
 	select I2C
 	select I2C_MC34704
 	help
@@ -258,7 +254,6 @@ config MACH_FREESCALE_MX25_3STACK
 
 config MACH_TX25
 	bool "Ka-Ro TX25"
-	select MACH_HAS_LOWLEVEL_INIT
 	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Say Y here if you are using the Ka-Ro tx25 board
@@ -276,28 +271,24 @@ choice
 
 config MACH_EUKREA_CPUIMX27
 	bool "EUKREA CPUIMX27"
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using Eukrea's CPUIMX27 equipped
 	  with a Freescale i.MX27 Processor
 
 config MACH_IMX27ADS
 	bool "Freescale i.MX27ADS"
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using the Freescale i.MX27ads board equipped
 	  with a Freescale i.MX27 Processor
 
 config MACH_PCA100
 	bool "phyCard-i.MX27"
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using Phytec's phyCard-i.MX27 (pca100) equipped
 	  with a Freescale i.MX27 Processor
 
 config MACH_PCM038
 	bool "phyCORE-i.MX27"
-	select MACH_HAS_LOWLEVEL_INIT
 	select SPI
 	select DRIVER_SPI_IMX
 	select MFD_MC13XXX
@@ -316,7 +307,6 @@ config MACH_PCM970_BASEBOARD
 
 config MACH_NESO
 	bool "Garz+Fricke Neso"
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using the Garz+Fricke Neso board equipped
 	  with a Freescale i.MX27 Processor
@@ -334,7 +324,6 @@ choice
 
 config MACH_PCM037
 	bool "phyCORE-i.MX31"
-	select MACH_HAS_LOWLEVEL_INIT
 	select USB_ULPI if USB
 	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select ARCH_HAS_L2X0
@@ -355,7 +344,6 @@ choice
 
 config MACH_EUKREA_CPUIMX35
 	bool "EUKREA CPUIMX35"
-	select MACH_HAS_LOWLEVEL_INIT
 	select ARCH_HAS_L2X0
 	help
 	  Say Y here if you are using Eukrea's CPUIMX35 equipped
@@ -363,7 +351,6 @@ config MACH_EUKREA_CPUIMX35
 
 config MACH_FREESCALE_MX35_3STACK
 	bool "Freescale MX35 3stack"
-	select MACH_HAS_LOWLEVEL_INIT
 	select I2C
 	select I2C_IMX
 	select MFD_MC13XXX
@@ -374,7 +361,6 @@ config MACH_FREESCALE_MX35_3STACK
 
 config MACH_PCM043
 	bool "phyCORE-i.MX35"
-	select MACH_HAS_LOWLEVEL_INIT
 	select ARCH_HAS_L2X0
 	help
 	  Say Y here if you are using Phytec's phyCORE-i.MX35 (pcm043) equipped
@@ -382,7 +368,6 @@ config MACH_PCM043
 
 config MACH_GUF_CUPID
 	bool "Garz+Fricke Cupid"
-	select MACH_HAS_LOWLEVEL_INIT
 	select ARCH_HAS_L2X0
 	help
 	  Say Y here if you are using the Garz+Fricke Neso board equipped
@@ -469,13 +454,11 @@ config MACH_TQMA53_1GB_RAM
 config MACH_TX53
 	bool "Ka-Ro TX53"
 	select HAVE_DEFAULT_ENVIRONMENT_NEW
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using the Ka-Ro tx53 board
 
 config MACH_GUF_VINCELL
 	select HAVE_DEFAULT_ENVIRONMENT_NEW
-	select MACH_HAS_LOWLEVEL_INIT
 	bool "Garz-Fricke Vincell"
 
 endchoice
arch/arm/mach-imx/Makefile +4 -1
index 104ab21..1c28035 100644
@@ -11,8 +11,11 @@ pbl-$(CONFIG_ARCH_IMX53) += imx53.o imx5.o esdctl-v4.o
 obj-$(CONFIG_ARCH_IMX6) += imx6.o iomux-v3.o usb-imx6.o clk-imx6.o
 obj-$(CONFIG_IMX_IIM)	+= iim.o
 obj-$(CONFIG_NAND_IMX) += nand.o
-obj-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
+ifdef CONFIG_PBL_IMAGE
 pbl-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
+else
+obj-$(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND) += external-nand-boot.o
+endif
 obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-pfd.o
 obj-y += devices.o imx.o esdctl.o
 obj-y += boot.o
arch/arm/mach-imx/external-nand-boot.c +6 -5
index c97fec9..2c353d7 100644
@@ -18,6 +18,7 @@
 #include <asm/sections.h>
 #include <asm/barebox-arm.h>
 #include <mach/imx-nand.h>
+#include <mach/esdctl.h>
 #include <mach/generic.h>
 #include <mach/imx21-regs.h>
 #include <mach/imx25-regs.h>
@@ -312,7 +313,7 @@ void __bare_init __noreturn imx21_barebox_boot_nand_external(void)
 	imx_barebox_boot_nand_external(nfc_base);
 	jump_sdram(nfc_base - (unsigned long)_text);
 	imx_nand_load_image((void *)_text, barebox_image_size);
-	board_init_lowlevel_return();
+	imx21_barebox_entry(0);
 }
 #endif
 
@@ -324,7 +325,7 @@ void __bare_init __noreturn imx25_barebox_boot_nand_external(void)
 	imx_barebox_boot_nand_external(nfc_base);
 	jump_sdram(nfc_base - (unsigned long)_text);
 	imx_nand_load_image((void *)_text, barebox_image_size);
-	board_init_lowlevel_return();
+	imx25_barebox_entry(0);
 }
 #endif
 
@@ -336,7 +337,7 @@ void __bare_init __noreturn imx27_barebox_boot_nand_external(void)
 	imx_barebox_boot_nand_external(nfc_base);
 	jump_sdram(nfc_base - (unsigned long)_text);
 	imx_nand_load_image((void *)_text, barebox_image_size);
-	board_init_lowlevel_return();
+	imx27_barebox_entry(0);
 }
 #endif
 
@@ -348,7 +349,7 @@ void __bare_init __noreturn imx31_barebox_boot_nand_external(void)
 	imx_barebox_boot_nand_external(nfc_base);
 	jump_sdram(nfc_base - (unsigned long)_text);
 	imx_nand_load_image((void *)_text, barebox_image_size);
-	board_init_lowlevel_return();
+	imx31_barebox_entry(0);
 }
 #endif
 
@@ -360,7 +361,7 @@ void __bare_init __noreturn imx35_barebox_boot_nand_external(void)
 	imx_barebox_boot_nand_external(nfc_base);
 	jump_sdram(nfc_base - (unsigned long)_text);
 	imx_nand_load_image((void *)_text, barebox_image_size);
-	board_init_lowlevel_return();
+	imx35_barebox_entry(0);
 }
 #endif
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH 7/36 ARM MXS boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

All boards use hardcoded SDRAM addresses, copied from the board init file.

---
 arch/arm/Kconfig                                 |    2 ++
 arch/arm/boards/chumby_falconwing/Makefile       |    2 ++
 arch/arm/boards/chumby_falconwing/lowlevel.c     |   11 +++++++++++
 arch/arm/boards/crystalfontz-cfa10036/Makefile   |    2 ++
 arch/arm/boards/crystalfontz-cfa10036/lowlevel.c |   11 +++++++++++
 arch/arm/boards/freescale-mx23-evk/Makefile      |    2 ++
 arch/arm/boards/freescale-mx23-evk/lowlevel.c    |   11 +++++++++++
 arch/arm/boards/freescale-mx28-evk/Makefile      |    2 ++
 arch/arm/boards/freescale-mx28-evk/lowlevel.c    |   11 +++++++++++
 arch/arm/boards/imx233-olinuxino/Makefile        |    2 ++
 arch/arm/boards/imx233-olinuxino/lowlevel.c      |   11 +++++++++++
 arch/arm/boards/karo-tx28/Makefile               |    2 ++
 arch/arm/boards/karo-tx28/lowlevel.c             |   11 +++++++++++
 13 files changed, 80 insertions(+)
 create mode 100644 arch/arm/boards/chumby_falconwing/lowlevel.c
 create mode 100644 arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx23-evk/lowlevel.c
 create mode 100644 arch/arm/boards/freescale-mx28-evk/lowlevel.c
 create mode 100644 arch/arm/boards/imx233-olinuxino/lowlevel.c
 create mode 100644 arch/arm/boards/karo-tx28/lowlevel.c
arch/arm/Kconfig +2 -0
index cac3360..627c1b5 100644
@@ -64,6 +64,8 @@ config ARCH_IMX
 config ARCH_MXS
 	bool "Freescale i.MX23/28 (mxs) based"
 	select GENERIC_GPIO
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_NETX
 	bool "Hilscher NetX based"
arch/arm/boards/chumby_falconwing/Makefile +2 -0
index 0bc79d9..360b55c 100644
@@ -1 +1,3 @@
 obj-y = falconwing.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/chumby_falconwing/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..df28ad4
@@ -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);
+}
arch/arm/boards/crystalfontz-cfa10036/Makefile +2 -0
index 7e8d5e2..0b701ed 100644
@@ -1 +1,3 @@
 obj-y += cfa10036.o hwdetect.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/crystalfontz-cfa10036/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..467194f
@@ -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);
+}
arch/arm/boards/freescale-mx23-evk/Makefile +2 -0
index cffb561..9386603 100644
@@ -1,2 +1,4 @@
 #
 obj-y := mx23-evk.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/freescale-mx23-evk/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..0c7e665
@@ -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);
+}
arch/arm/boards/freescale-mx28-evk/Makefile +2 -0
index 3e1f53b..2039610 100644
@@ -1 +1,3 @@
 obj-y += mx28-evk.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/freescale-mx28-evk/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..467194f
@@ -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);
+}
arch/arm/boards/imx233-olinuxino/Makefile +2 -0
index 6d71450..b8d9223 100644
@@ -1 +1,3 @@
 obj-y = imx23-olinuxino.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/imx233-olinuxino/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..df28ad4
@@ -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);
+}
arch/arm/boards/karo-tx28/Makefile +2 -0
index d80ba17..c90bf36 100644
@@ -1,2 +1,4 @@
 obj-y += tx28.o
 obj-$(CONFIG_MACH_TX28STK5) += tx28-stk5.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/karo-tx28/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..467194f
@@ -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);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 8/36 ARM OMAP boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

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.

---
 arch/arm/Kconfig                                |    2 ++
 arch/arm/boards/archosg9/Makefile               |    4 ++--
 arch/arm/boards/archosg9/lowlevel.c             |    3 ++-
 arch/arm/boards/beagle/lowlevel.c               |   16 ++++++++++++++--
 arch/arm/boards/beaglebone/Makefile             |    2 ++
 arch/arm/boards/beaglebone/lowlevel.c           |   12 +++++++++++-
 arch/arm/boards/omap343xdsp/lowlevel.c          |   15 +++++++++++++--
 arch/arm/boards/omap3evm/lowlevel.c             |   13 +++++++++++--
 arch/arm/boards/panda/lowlevel.c                |    7 ++++---
 arch/arm/boards/pcm049/lowlevel.c               |    7 ++++---
 arch/arm/boards/pcm051/Makefile                 |    2 ++
 arch/arm/boards/pcm051/lowlevel.c               |   11 +++++++++++
 arch/arm/boards/phycard-a-l1/lowlevel.c         |   12 ++++++++++--
 arch/arm/boards/phycard-a-xl2/lowlevel.c        |    7 ++++---
 arch/arm/mach-omap/Kconfig                      |    5 -----
 arch/arm/mach-omap/include/mach/omap3-silicon.h |    1 +
 arch/arm/mach-omap/omap3_core.S                 |   11 ++++-------
 17 files changed, 97 insertions(+), 33 deletions(-)
 create mode 100644 arch/arm/boards/pcm051/lowlevel.c
arch/arm/Kconfig +2 -0
index 627c1b5..96ee516 100644
@@ -82,6 +82,8 @@ config ARCH_OMAP
 	bool "TI OMAP"
 	select HAS_DEBUG_LL
 	select GPIOLIB
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_PXA
 	bool "Intel/Marvell PXA based"
arch/arm/boards/archosg9/Makefile +2 -2
index 450c03f..4cc5a2e 100644
@@ -1,4 +1,4 @@
 obj-y += board.o
 obj-$(CONFIG_ARM_BOARD_APPEND_ATAG) += archos_features.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel.o mux.o
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel.o mux.o
+obj-y += lowlevel.o mux.o
+pbl-y += lowlevel.o mux.o
arch/arm/boards/archosg9/lowlevel.c +2 -1
index aea6342..26808f6 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <io.h>
 #include <init.h>
+#include <sizes.h>
 #include <mach/omap4-mux.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-clock.h>
@@ -63,7 +64,7 @@ static noinline void archosg9_init_lowlevel(void)
 
 	omap4_ddr_init(&ddr_regs_400_mhz_2cs, &core);
 
-	board_init_lowlevel_return();
+	barebox_arm_entry(0x80000000, SZ_1G, 0);
 }
 
 void __naked __bare_init reset(void)
arch/arm/boards/beagle/lowlevel.c +14 -2
index 677f055..c0abbe8 100644
@@ -1,5 +1,7 @@
 #include <io.h>
-#include <init.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
 #include <mach/control.h>
 #include <mach/omap3-silicon.h>
 #include <mach/omap3-mux.h>
@@ -164,4 +166,14 @@ static int beagle_board_init(void)
 
 	return 0;
 }
-pure_initcall(beagle_board_init);
+
+void __naked reset(void)
+{
+	omap3_invalidate_dcache();
+
+	common_reset();
+
+	beagle_board_init();
+
+	barebox_arm_entry(0x80000000, SZ_128M, 0);
+}
arch/arm/boards/beaglebone/Makefile +2 -0
index 88c223a..3b7261c 100644
@@ -1,3 +1,5 @@
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
 obj-y += board.o
 obj-y += lowlevel.o
 pbl-y += lowlevel.o
arch/arm/boards/beaglebone/lowlevel.c +11 -1
index d446e8d..b565c74 100644
@@ -1,6 +1,8 @@
 #include <init.h>
 #include <sizes.h>
 #include <io.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
 #include <mach/am33xx-silicon.h>
 #include <mach/am33xx-clock.h>
 #include <mach/sdrc.h>
@@ -245,4 +247,12 @@ static int beaglebone_board_init(void)
 
 	return 0;
 }
-pure_initcall(beaglebone_board_init);
+
+void __naked reset(void)
+{
+	common_reset();
+
+	beaglebone_board_init();
+
+	barebox_arm_entry(0x80000000, SZ_256M, 0);
+}
arch/arm/boards/omap343xdsp/lowlevel.c +13 -2
index 0d2ccd4..403de91 100644
@@ -1,7 +1,8 @@
 #include <common.h>
 #include <io.h>
-#include <init.h>
 #include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
 #include <mach/omap3-mux.h>
 #include <mach/sdrc.h>
 #include <mach/control.h>
@@ -543,4 +544,14 @@ static int sdp343x_board_init(void)
 
 	return 0;
 }
-pure_initcall(sdp343x_board_init);
+
+void __naked reset(void)
+{
+	omap3_invalidate_dcache();
+
+	common_reset();
+
+	sdp343x_board_init();
+
+	barebox_arm_entry(0x80000000, SZ_128M, 0);
+}
arch/arm/boards/omap3evm/lowlevel.c +11 -2
index 9050c09..49ecb85 100644
@@ -1,7 +1,8 @@
-#include <common.h>
 #include <io.h>
 #include <init.h>
 #include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
 #include <mach/omap3-mux.h>
 #include <mach/sdrc.h>
 #include <mach/control.h>
@@ -157,4 +158,12 @@ static int omap3_evm_board_init(void)
 
 	return 0;
 }
-pure_initcall(omap3_evm_board_init);
+
+void __naked reset(void)
+{
+	common_reset();
+
+	omap3_evm_board_init();
+
+	barebox_arm_entry(0x80000000, SZ_128M, 0);
+}
arch/arm/boards/panda/lowlevel.c +4 -3
index 36e2bc5..df0f9c1 100644
@@ -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);
 }
arch/arm/boards/pcm049/lowlevel.c +4 -3
index b64244c..8ecf81a 100644
@@ -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);
 }
arch/arm/boards/pcm051/Makefile +2 -0
index dcfc293..8a571d9 100644
@@ -1 +1,3 @@
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
 obj-y += board.o
arch/arm/boards/pcm051/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..683fdce
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked reset(void)
+{
+	common_reset();
+
+	barebox_arm_entry(0x80000000, SZ_512M, 0);
+}
arch/arm/boards/phycard-a-l1/lowlevel.c +10 -2
index d82c43d..6043d8a 100644
@@ -1,7 +1,8 @@
-#include <common.h>
 #include <io.h>
 #include <init.h>
 #include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
 #include <mach/omap3-mux.h>
 #include <mach/sdrc.h>
 #include <mach/control.h>
@@ -247,5 +248,12 @@ static int pcaal1_board_init(void)
 
 	return 0;
 }
-pure_initcall(pcaal1_board_init);
 
+void __naked reset(void)
+{
+	common_reset();
+
+	pcaal1_board_init();
+
+	barebox_arm_entry(0x80000000, SZ_256M, 0);
+}
arch/arm/boards/phycard-a-xl2/lowlevel.c +4 -3
index 5d8693a..f8f4db5 100644
@@ -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);
 }
arch/arm/mach-omap/Kconfig +0 -5
index f659184..a87fc4b 100644
@@ -29,7 +29,6 @@ config ARCH_OMAP3
 	bool "OMAP3"
 	select CPU_V7
 	select GENERIC_GPIO
-	select MACH_HAS_LOWLEVEL_INIT
 	select OMAP_CLOCK_SOURCE_S32K
 	help
 	  Say Y here if you are using Texas Instrument's OMAP343x based platform
@@ -148,7 +147,6 @@ config MACH_OMAP3EVM
 
 config MACH_PANDA
 	bool "Texas Instrument's Panda Board"
-	select MACH_HAS_LOWLEVEL_INIT
 	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	depends on ARCH_OMAP4
 	help
@@ -156,7 +154,6 @@ config MACH_PANDA
 
 config MACH_ARCHOSG9
 	bool "Archos G9 tablets"
-	select MACH_HAS_LOWLEVEL_INIT
 	depends on ARCH_OMAP4
 	help
 	  Say Y here if you are using OMAP4-based Archos G9 tablet
@@ -164,7 +161,6 @@ config MACH_ARCHOSG9
 config MACH_PCM049
 	bool "Phytec phyCORE pcm049"
 	depends on ARCH_OMAP4
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using Phytecs phyCORE pcm049 board
 	  based on OMAP4
@@ -177,7 +173,6 @@ config MACH_PCAAL1
 
 config MACH_PCAAXL2
 	bool "Phytec phyCARD XL2"
-	select MACH_HAS_LOWLEVEL_INIT
 	depends on ARCH_OMAP4
 	help
 	  Say Y here if you are using a phyCARD-A-XL1 PCA-A-XL1
arch/arm/mach-omap/include/mach/omap3-silicon.h +1 -0
index 282b587..43b2953 100644
@@ -133,6 +133,7 @@
 /* If Architecture specific init functions are present */
 #ifndef __ASSEMBLY__
 void omap3_core_init(void);
+void omap3_invalidate_dcache(void);
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ASM_ARCH_OMAP3_H */
arch/arm/mach-omap/omap3_core.S +4 -7
index bc32f55..a47e248 100644
@@ -33,9 +33,8 @@
 #include <mach/clocks.h>
 #include <asm/barebox-arm-head.h>
 
-#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
-.section .text.__reset
-ENTRY(reset)
+.section .text.__omap3_invalidate_dcache
+ENTRY(omap3_invalidate_dcache)
 	/* Invalidate all Dcaches */
 #ifndef CONFIG_CPU_V7_DCACHE_SKIP
 	/* If Arch specific ROM code SMI handling does not exist */
@@ -83,8 +82,6 @@ finished_inval:
 	mcr	p15, 2, r10, c0, c0, 0	/* select current cache level in cssr */
 	isb
 #endif /* CONFIG_CPU_V7_DCACHE_SKIP */
-	common_reset r0
 	/* back to arch calling code */
-	b board_init_lowlevel_return
-ENDPROC(reset)
-#endif
+	bx lr
+ENDPROC(omap3_invalidate_dcache)
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

PATCH 9/36 ARM Samsung boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

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.

---
 arch/arm/Kconfig                                     |    6 ++++++
 arch/arm/boards/a9m2410/lowlevel_init.S              |    9 +++++++--
 arch/arm/boards/a9m2440/lowlevel_init.S              |    9 +++++++--
 arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S |    9 +++++++--
 arch/arm/boards/friendlyarm-mini6410/Makefile        |    2 ++
 arch/arm/boards/friendlyarm-mini6410/lowlevel.c      |   11 +++++++++++
 arch/arm/boards/friendlyarm-tiny210/lowlevel.c       |    4 +++-
 arch/arm/boards/friendlyarm-tiny6410/Makefile        |    3 ++-
 arch/arm/boards/friendlyarm-tiny6410/lowlevel.c      |   11 +++++++++++
 arch/arm/mach-samsung/Kconfig                        |    6 ------
 10 files changed, 56 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/boards/friendlyarm-mini6410/lowlevel.c
 create mode 100644 arch/arm/boards/friendlyarm-tiny6410/lowlevel.c
arch/arm/Kconfig +6 -0
index 96ee516..1e509a4 100644
@@ -94,18 +94,24 @@ config ARCH_S3C24xx
 	select ARCH_SAMSUNG
 	select CPU_ARM920T
 	select GENERIC_GPIO
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_S5PCxx
 	bool "Samsung S5PC110, S5PV210"
 	select ARCH_SAMSUNG
 	select CPU_V7
 	select GENERIC_GPIO
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_S3C64xx
 	bool "Samsung S3C64xx"
 	select ARCH_SAMSUNG
 	select CPU_V6
 	select GENERIC_GPIO
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_VERSATILE
 	bool "ARM Versatile boards (ARM926EJ-S)"
arch/arm/boards/a9m2410/lowlevel_init.S +7 -2
index 502ecdd..178e73a 100644
@@ -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
arch/arm/boards/a9m2440/lowlevel_init.S +7 -2
index 8f6cfcb..bd51717 100644
@@ -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
arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S +7 -2
index 5c06b1c..a6e06ed 100644
@@ -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
arch/arm/boards/friendlyarm-mini6410/Makefile +2 -0
index cd7a427..d5fa853 100644
@@ -1 +1,3 @@
 obj-y += mini6410.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/friendlyarm-mini6410/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..61ed757
@@ -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);
+}
arch/arm/boards/friendlyarm-tiny210/lowlevel.c +3 -1
index 695f97d..5d9582e 100644
@@ -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);
 
arch/arm/boards/friendlyarm-tiny6410/Makefile +2 -1
index b3ab12e..eb0e0ed 100644
@@ -1,3 +1,4 @@
 obj-y += tiny6410.o
-
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
 obj-$(CONFIG_MACH_TINY6410_FA) += development-board.o
arch/arm/boards/friendlyarm-tiny6410/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..61ed757
@@ -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);
+}
arch/arm/mach-samsung/Kconfig +0 -6
index 80575cb..a4dc301 100644
@@ -40,7 +40,6 @@ choice
 config MACH_A9M2410
 	bool "Digi A9M2410"
 	select CPU_S3C2410
-	select MACH_HAS_LOWLEVEL_INIT
 	select S3C_PLL_INIT
 	select S3C_SDRAM_INIT
 	help
@@ -50,7 +49,6 @@ config MACH_A9M2410
 config MACH_A9M2440
 	bool "Digi A9M2440"
 	select CPU_S3C2440
-	select MACH_HAS_LOWLEVEL_INIT
 	select S3C_PLL_INIT
 	help
 	  Say Y here if you are using Digi's Connect Core 9M equipped
@@ -59,8 +57,6 @@ config MACH_A9M2440
 config MACH_MINI2440
 	bool "Mini 2440"
 	select CPU_S3C2440
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 	select S3C_PLL_INIT
 	select S3C_SDRAM_INIT
 	select HAS_DM9000
@@ -138,8 +134,6 @@ choice
 config MACH_TINY210
 	bool "Tiny 210"
 	select CPU_S5PV210
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 	select S3C_SDRAM_INIT
 
 endchoice
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

PATCH 10/36 ARM PXA boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

All boards use hardcoded base addresses.

---
 arch/arm/Kconfig                       |    2 ++
 arch/arm/boards/mioa701/Makefile       |    2 ++
 arch/arm/boards/mioa701/lowlevel.c     |   10 ++++++++++
 arch/arm/boards/pcm027/lowlevel_init.S |    7 +++++--
 4 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boards/mioa701/lowlevel.c
arch/arm/Kconfig +2 -0
index 1e509a4..dd8f01e 100644
@@ -88,6 +88,8 @@ config ARCH_OMAP
 config ARCH_PXA
 	bool "Intel/Marvell PXA based"
 	select GENERIC_GPIO
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_S3C24xx
 	bool "Samsung S3C2410, S3C2440"
arch/arm/boards/mioa701/Makefile +2 -0
index dcfc293..88c223a 100644
@@ -1 +1,3 @@
 obj-y += board.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/mioa701/lowlevel.c new file +10 -0
new file mode 100644
index 0000000..6d48c97
@@ -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);
+}
arch/arm/boards/pcm027/lowlevel_init.S +5 -2
index cf5fcd9..b90682c 100644
@@ -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
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

PATCH 11/36 ARM ep93xx boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

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.

---
 arch/arm/Kconfig                     |    2 ++
 arch/arm/boards/edb93xx/sdram_cfg.c  |    4 ++++
 arch/arm/mach-ep93xx/Kconfig         |    8 --------
 arch/arm/mach-ep93xx/Makefile        |    4 ++--
 arch/arm/mach-ep93xx/lowlevel_init.S |   11 ++++++++++-
 5 files changed, 18 insertions(+), 11 deletions(-)
arch/arm/Kconfig +2 -0
index dd8f01e..7b0e59a 100644
@@ -49,6 +49,8 @@ config ARCH_EP93XX
 	bool "Cirrus Logic EP93xx"
 	select CPU_ARM920T
 	select GENERIC_GPIO
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_IMX
 	bool "Freescale iMX-based"
arch/arm/boards/edb93xx/sdram_cfg.c +4 -0
index 9442129..5c2a537 100644
@@ -36,6 +36,10 @@ static void program_mode_registers(void);
 void sdram_cfg(void)
 {
 	struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE;
+	unsigned long pc = get_pc();
+
+	if (pc < CONFIG_EP93XX_SDRAM_BANK3_BASE + CONFIG_EP93XX_SDRAM_BANK3_SIZE)
+		return;
 
 	writel(SDRAM_DEVCFG_VAL, &sdram->SDRAM_DEVCFG_REG);
 
arch/arm/mach-ep93xx/Kconfig +0 -8
index ed6e986..90859d5 100644
@@ -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
 
arch/arm/mach-ep93xx/Makefile +2 -2
index 5615394..0ff0b66 100644
@@ -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
arch/arm/mach-ep93xx/lowlevel_init.S +10 -1
index 6de53dd..154d38d 100644
@@ -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
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

PATCH 12/36 ARM tegra boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

Only one board, Toshiba AC100. This uses hardcoded SDRAM values.

---
 arch/arm/Kconfig                         |    2 ++
 arch/arm/boards/toshiba-ac100/Makefile   |    2 ++
 arch/arm/boards/toshiba-ac100/lowlevel.c |   10 ++++++++++
 3 files changed, 14 insertions(+)
 create mode 100644 arch/arm/boards/toshiba-ac100/lowlevel.c
arch/arm/Kconfig +2 -0
index 7b0e59a..5f5b965 100644
@@ -126,6 +126,8 @@ config ARCH_TEGRA
 	bool "Nvidia Tegra-based boards"
 	select CPU_ARM926T
 	select HAS_DEBUG_LL
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 endchoice
 
arch/arm/boards/toshiba-ac100/Makefile +2 -0
index 9e14763..5b74351 100644
@@ -1,2 +1,4 @@
 obj-y += board.o
 obj-$(CONFIG_DRIVER_SERIAL_NS16550) += serial.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/toshiba-ac100/lowlevel.c new file +10 -0
new file mode 100644
index 0000000..68706a5
@@ -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);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#13 lore raw

PATCH 13/36 ARM nomadik boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

Only one board, the nhk8815. This uses hardcoded SDRAM values.

---
 arch/arm/Kconfig                   |    2 ++
 arch/arm/boards/nhk8815/Makefile   |    2 ++
 arch/arm/boards/nhk8815/lowlevel.c |   10 ++++++++++
 3 files changed, 14 insertions(+)
 create mode 100644 arch/arm/boards/nhk8815/lowlevel.c
arch/arm/Kconfig +2 -0
index 5f5b965..dcd48a9 100644
@@ -77,6 +77,8 @@ config ARCH_NOMADIK
 	bool "STMicroelectronics Nomadik"
 	select CPU_ARM926T
 	select CLOCKSOURCE_NOMADIK
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Support for the Nomadik platform by ST-Ericsson
 
arch/arm/boards/nhk8815/Makefile +2 -0
index 2b9dba4..dbb2a71 100644
@@ -1 +1,3 @@
 obj-y += setup.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/nhk8815/lowlevel.c new file +10 -0
new file mode 100644
index 0000000..3956347
@@ -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);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#14 lore raw

PATCH 14/36 ARM versatile boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

Only one board, the qemu based Versatile/PB. Uses hardcoded SDRAM settings.

---
 arch/arm/Kconfig                     |    2 ++
 arch/arm/boards/versatile/Makefile   |    3 ++-
 arch/arm/boards/versatile/lowlevel.c |   10 ++++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/versatile/lowlevel.c
arch/arm/Kconfig +2 -0
index dcd48a9..79f797e 100644
@@ -123,6 +123,8 @@ config ARCH_VERSATILE
 	bool "ARM Versatile boards (ARM926EJ-S)"
 	select CPU_ARM926T
 	select GPIOLIB
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_TEGRA
 	bool "Nvidia Tegra-based boards"
arch/arm/boards/versatile/Makefile +2 -1
index a17aed3..9dc6869 100644
@@ -1,2 +1,3 @@
-
 obj-$(CONFIG_MACH_VERSATILEPB) += versatilepb.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/versatile/lowlevel.c new file +10 -0
new file mode 100644
index 0000000..3956347
@@ -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);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#15 lore raw

PATCH 15/36 ARM netx boards: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

Only one board supported, the nxdb500. Uses hardcoded SDRAM settings.

---
 arch/arm/Kconfig                |    2 ++
 arch/arm/boards/netx/platform.S |    7 +++++--
 arch/arm/mach-netx/Kconfig      |    1 -
 3 files changed, 7 insertions(+), 3 deletions(-)
arch/arm/Kconfig +2 -0
index 79f797e..3197f8b 100644
@@ -72,6 +72,8 @@ config ARCH_MXS
 config ARCH_NETX
 	bool "Hilscher NetX based"
 	select CPU_ARM926T
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_NOMADIK
 	bool "STMicroelectronics Nomadik"
arch/arm/boards/netx/platform.S +5 -2
index 0438921..95ac13b 100644
@@ -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
arch/arm/mach-netx/Kconfig +0 -1
index b767e54..8d8f49b 100644
@@ -45,7 +45,6 @@ choice
 config MACH_NXDB500
 	bool "Hilscher Netx nxdb500"
 	select HAS_NETX_ETHER
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using the Hilscher Netx nxdb500 board
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#16 lore raw

PATCH 16/36 ARM clep7212: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/Kconfig                    |    2 ++
 arch/arm/boards/clep7212/lowlevel.c |    3 ++-
 arch/arm/mach-clps711x/Kconfig      |    2 --
 3 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/Kconfig +2 -0
index 3197f8b..6ed9bf0 100644
@@ -44,6 +44,8 @@ config ARCH_CLPS711X
 	bool "Cirrus Logic EP711x/EP721x/EP731x"
 	select CLKDEV_LOOKUP
 	select CPU_32v4T
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_EP93XX
 	bool "Cirrus Logic EP93xx"
arch/arm/boards/clep7212/lowlevel.c +2 -1
index 9b7e241..7465a42 100644
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <init.h>
+#include <sizes.h>
 
 #include <asm/io.h>
 #include <asm/barebox-arm.h>
@@ -52,5 +53,5 @@ void __naked __bare_init reset(void)
 	writel(SDCONF_CASLAT_3 | SDCONF_SIZE_256 | SDCONF_WIDTH_16 |
 	       SDCONF_CLKCTL | SDCONF_ACTIVE, SDCONF);
 
-	board_init_lowlevel_return();
+	barebox_arm_entry(SDRAM0_BASE, SZ_32M, 0);
 }
arch/arm/mach-clps711x/Kconfig +0 -2
index 469ca72..f0adeda 100644
@@ -5,8 +5,6 @@ choice
 
 config MACH_CLEP7212
 	bool "Cirrus Logic CLEP7212"
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Boards based on the Cirrus Logic 7212/7312 CPU.
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#17 lore raw

PATCH 17/36 ARM raspberrypi: switch to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/Kconfig                        |    2 ++
 arch/arm/boards/raspberry-pi/Makefile   |    2 ++
 arch/arm/boards/raspberry-pi/lowlevel.c |   11 +++++++++++
 3 files changed, 15 insertions(+)
 create mode 100644 arch/arm/boards/raspberry-pi/lowlevel.c
arch/arm/Kconfig +2 -0
index 6ed9bf0..c7daebe 100644
@@ -39,6 +39,8 @@ config ARCH_BCM2835
 	select COMMON_CLK
 	select CLOCKSOURCE_BCM2835
 	select ARM_AMBA
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_CLPS711X
 	bool "Cirrus Logic EP711x/EP721x/EP731x"
arch/arm/boards/raspberry-pi/Makefile +2 -0
index 6ce5ede..825b30b 100644
@@ -1 +1,3 @@
 obj-$(CONFIG_MACH_RPI) += rpi.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/raspberry-pi/lowlevel.c new file +11 -0
new file mode 100644
index 0000000..7a09eed
@@ -0,0 +1,11 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/platform.h>
+
+void __naked reset(void)
+{
+        common_reset();
+        barebox_arm_entry(BCM2835_SDRAM_BASE, SZ_128M, 0);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#18 lore raw

PATCH 18/36 ARM AT91: switch at91sam9 to barebox_arm_entry part1

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

This switches the at91sam926x, 9g10 and 9g20 over to barebox_arm_entry. For these SoCs we currently support reading back the memory size from the SDRAM controller, so all of these can have a common reset() function.

---
 arch/arm/boards/at91sam9261ek/Makefile               |    4 ++--
 arch/arm/boards/at91sam9263ek/Makefile               |    4 ++--
 arch/arm/boards/mmccpu/Makefile                      |    4 ++--
 arch/arm/boards/pm9261/Makefile                      |    4 ++--
 arch/arm/boards/pm9263/Makefile                      |    4 ++--
 arch/arm/boards/tny-a926x/Makefile                   |    4 ++--
 arch/arm/boards/usb-a926x/Makefile                   |    4 ++--
 arch/arm/mach-at91/Kconfig                           |   16 +++++++++++-----
 arch/arm/mach-at91/Makefile                          |    7 ++++---
 arch/arm/mach-at91/at91sam9260_lowlevel_init.c       |    2 ++
 arch/arm/mach-at91/at91sam9261_lowlevel_init.c       |    2 ++
 arch/arm/mach-at91/at91sam9263_lowlevel_init.c       |    2 ++
 arch/arm/mach-at91/at91sam926x_lowlevel_init.c       |    7 ++-----
 arch/arm/mach-at91/include/mach/at91_lowlevel_init.h |    5 +++++
 14 files changed, 42 insertions(+), 27 deletions(-)
arch/arm/boards/at91sam9261ek/Makefile +2 -2
index b6460c3..1702783 100644
@@ -1,5 +1,5 @@
 obj-y += init.o
 
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
arch/arm/boards/at91sam9263ek/Makefile +2 -2
index b6460c3..1702783 100644
@@ -1,5 +1,5 @@
 obj-y += init.o
 
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
arch/arm/boards/mmccpu/Makefile +2 -2
index b6460c3..1702783 100644
@@ -1,5 +1,5 @@
 obj-y += init.o
 
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
arch/arm/boards/pm9261/Makefile +2 -2
index b6460c3..1702783 100644
@@ -1,5 +1,5 @@
 obj-y += init.o
 
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
arch/arm/boards/pm9263/Makefile +2 -2
index b6460c3..1702783 100644
@@ -1,5 +1,5 @@
 obj-y += init.o
 
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
arch/arm/boards/tny-a926x/Makefile +2 -2
index 36ea09f..caa7163 100644
@@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
 
 lowlevel_init-$(CONFIG_MACH_TNY_A9263) = tny_a9263_lowlevel_init.o
 
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
arch/arm/boards/usb-a926x/Makefile +2 -2
index e314dd5..88f163f 100644
@@ -5,6 +5,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
 
 lowlevel_init-$(CONFIG_MACH_USB_A9263) = usb_a9263_lowlevel_init.o
 
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+obj-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+pbl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
arch/arm/mach-at91/Kconfig +11 -5
index 14bab55..4e687c4 100644
@@ -6,6 +6,9 @@ config HAVE_AT91_DBGU0
 config HAVE_AT91_DBGU1
 	bool
 
+config HAVE_AT91_LOWLEVEL_INIT
+	bool
+
 config AT91SAM9_SMC
 	bool
 
@@ -76,6 +79,8 @@ config HAVE_AT91_LOAD_BAREBOX_SRAM
 
 config AT91SAM9_LOWLEVEL_INIT
 	bool
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 comment "Atmel AT91 System-on-Chip"
 
@@ -293,6 +298,7 @@ config MACH_AT91SAM9261EK
 	select HAVE_AT91_DATAFLASH_CARD
 	select MACH_HAS_LOWLEVEL_INIT
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
+	select HAVE_AT91_LOWLEVEL_INIT
 	help
 	  Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
 	  <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
@@ -300,7 +306,7 @@ config MACH_AT91SAM9261EK
 config MACH_PM9261
 	bool "Ronetix PM9261"
 	select HAS_DM9000
-	select MACH_HAS_LOWLEVEL_INIT
+	select HAVE_AT91_LOWLEVEL_INIT
 	help
 	  Say y here if you are using the Ronetix PM9261 Board
 
@@ -375,7 +381,7 @@ choice
 
 config MACH_AT91SAM9263EK
 	bool "Atmel AT91SAM9263-EK"
-	select MACH_HAS_LOWLEVEL_INIT
+	select HAVE_AT91_LOWLEVEL_INIT
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
 	help
 	  Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
@@ -387,7 +393,7 @@ config MACH_MMCCPU
 
 config MACH_PM9263
 	bool "Ronetix PM9263"
-	select MACH_HAS_LOWLEVEL_INIT
+	select HAVE_AT91_LOWLEVEL_INIT
 	help
 	  Say y here if you are using the Ronetix PM9263 Board
 
@@ -401,7 +407,7 @@ config MACH_TNY_A9263
 
 config MACH_USB_A9263
 	bool "CALAO USB-A9263"
-	select MACH_HAS_LOWLEVEL_INIT
+	select HAVE_AT91_LOWLEVEL_INIT
 	help
 	  Select this if you are using a Calao Systems USB-A9263.
 	  <http://www.calao-systems.com>
@@ -565,7 +571,7 @@ endif
 
 config AT91_BOOTSTRAP
 	bool "at91 bootstrap"
-	depends on MACH_HAS_LOWLEVEL_INIT
+	depends on HAVE_AT91_LOWLEVEL_INIT
 	select BOOTSTRAP
 
 config AT91_LOAD_BAREBOX_SRAM
arch/arm/mach-at91/Makefile +4 -3
index f6c8500..1f335f6 100644
@@ -2,14 +2,15 @@ obj-y += setup.o clock.o gpio.o
 obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
 
 obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
-lowlevel_init-$(CONFIG_AT91SAM9_LOWLEVEL_INIT) = at91sam926x_lowlevel_init.o
+sam926x_lowlevel_init-$(CONFIG_AT91SAM9_LOWLEVEL_INIT) = at91sam926x_lowlevel_init.o
+lowlevel_init-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) = $(sam926x_lowlevel_init-y)
 lowlevel_init-$(CONFIG_SOC_AT91SAM9260) += at91sam9260_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9261) += at91sam9261_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9263) += at91sam9263_lowlevel_init.o
 lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
-obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+obj-y += $(lowlevel_init-y)
 
-pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += $(lowlevel_init-y)
+pbl-y += $(lowlevel_init-y)
 
 obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
 obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
arch/arm/mach-at91/at91sam9260_lowlevel_init.c +2 -0
index c2cf8bf..875c767 100644
@@ -31,4 +31,6 @@ void __naked __bare_init reset(void)
 
 	at91sam926x_lowlevel_init(IOMEM(AT91SAM9260_BASE_PIOC), false,
 				  AT91_MATRIX_EBICSA);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
 }
arch/arm/mach-at91/at91sam9261_lowlevel_init.c +2 -0
index a2e065f..beaddc8 100644
@@ -31,4 +31,6 @@ void __naked __bare_init reset(void)
 
 	at91sam926x_lowlevel_init(IOMEM(AT91SAM9261_BASE_PIOC), false,
 				  AT91_MATRIX_EBICSA);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
 }
arch/arm/mach-at91/at91sam9263_lowlevel_init.c +2 -0
index 5260658..5102051 100644
@@ -31,4 +31,6 @@ void __naked __bare_init reset(void)
 
 	at91sam926x_lowlevel_init(IOMEM(AT91SAM9263_BASE_PIOD), true,
 				  AT91_MATRIX_EBI0CSA);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(), 0);
 }
arch/arm/mach-at91/at91sam926x_lowlevel_init.c +2 -5
index 8b9b33e..b62615e 100644
@@ -80,7 +80,7 @@ void __bare_init at91sam926x_lowlevel_init(void *pio, bool is_pio_asr,
 	 */
 	r = at91_pmc_read(AT91_PMC_MCKR);
 	if (r & AT91_PMC_CSS && !in_sram)
-		goto end;
+		return;
 
 	/*
 	 * Enable the Main Oscillator
@@ -123,7 +123,7 @@ void __bare_init at91sam926x_lowlevel_init(void *pio, bool is_pio_asr,
 	 */
 	r = at91_sys_read(AT91_SDRAMC_TR);
 	if (r && !in_sram)
-		goto end;
+		return;
 
 	/* SDRAMC_MR : Normal Mode */
 	at91_sys_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_NORMAL);
@@ -182,7 +182,4 @@ void __bare_init at91sam926x_lowlevel_init(void *pio, bool is_pio_asr,
 	 * We will shutdown what we don't need later
 	 */
 	at91_pmc_write(AT91_PMC_PCER, 0xffffffff);
-
-end:
-	board_init_lowlevel_return();
 }
arch/arm/mach-at91/include/mach/at91_lowlevel_init.h +5 -0
index 8c53ce7..f8c020b 100644
@@ -28,7 +28,12 @@ struct at91sam926x_lowlevel_cfg {
 	u32 rstc_rmr;
 };
 
+#ifdef CONFIG_HAVE_AT91_LOWLEVEL_INIT
 void at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg);
 void at91sam926x_lowlevel_init(void *pio, bool is_pio_asr, u32 matrix_csa);
+#else
+static inline void at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg) {}
+static inline void at91sam926x_lowlevel_init(void *pio, bool is_pio_asr, u32 matrix_csa) {}
+#endif
 
 #endif /* __AT91_LOWLEVEL_INIT_H__ */
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#19 lore raw

PATCH 19/36 ARM AT91: switch at91rm9200 board to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/mach-at91/Kconfig                    |    1 +
 arch/arm/mach-at91/at91rm9200_lowlevel_init.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-at91/Kconfig +1 -0
index 4e687c4..f54b6dc 100644
@@ -90,6 +90,7 @@ config SOC_AT91RM9200
 	select HAVE_AT91_DBGU0
 	select HAS_AT91_ETHER
 	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config SOC_AT91SAM9260
 	bool
arch/arm/mach-at91/at91rm9200_lowlevel_init.c +1 -1
index 4add3d9..221c05d 100644
@@ -129,5 +129,5 @@ void __naked __bare_init reset(void)
 	set_cr(r);
 
 end:
-	board_init_lowlevel_return();
+	barebox_arm_entry(AT91_CHIPSELECT_1, at91rm9200_get_sdram_size(), 0);
 }
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#20 lore raw

PATCH 20/36 ARM AT91: switch at91sam9g45 to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/mach-at91/Kconfig                     |    2 ++
 arch/arm/mach-at91/Makefile                    |    1 +
 arch/arm/mach-at91/at91sam9g45_lowlevel_init.c |   26 ++++++++++++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 arch/arm/mach-at91/at91sam9g45_lowlevel_init.c
arch/arm/mach-at91/Kconfig +2 -0
index f54b6dc..69426e4 100644
@@ -127,6 +127,8 @@ config SOC_AT91SAM9G45
 	select HAVE_AT91_DBGU1
 	select HAS_MACB
 	select AT91SAM9G45_RESET
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
 	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
arch/arm/mach-at91/Makefile +1 -0
index 1f335f6..0ead23c 100644
@@ -7,6 +7,7 @@ lowlevel_init-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) = $(sam926x_lowlevel_init-y)
 lowlevel_init-$(CONFIG_SOC_AT91SAM9260) += at91sam9260_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9261) += at91sam9261_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9263) += at91sam9263_lowlevel_init.o
+lowlevel_init-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45_lowlevel_init.o
 lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
 obj-y += $(lowlevel_init-y)
 
arch/arm/mach-at91/at91sam9g45_lowlevel_init.c new file +26 -0
new file mode 100644
index 0000000..689312f
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * Under GPLv2
+  */
+
+#define __LOWLEVEL_INIT__
+
+#include <common.h>
+#include <asm/system.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/hardware.h>
+#include <mach/io.h>
+#include <mach/at91sam9_ddrsdr.h>
+#include <init.h>
+#include <sizes.h>
+
+void __naked __bare_init reset(void)
+{
+	common_reset();
+
+	arm_setup_stack(AT91SAM9G45_SRAM_BASE + AT91SAM9G45_SRAM_SIZE - 16);
+
+	barebox_arm_entry(AT91_CHIPSELECT_6, at91sam9g45_get_ddram_size(1), 0);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#21 lore raw

PATCH 21/36 ARM AT91: switch at91sam9x5 to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/mach-at91/Kconfig                    |    2 ++
 arch/arm/mach-at91/Makefile                   |    1 +
 arch/arm/mach-at91/at91sam9x5_lowlevel_init.c |   26 +++++++++++++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 arch/arm/mach-at91/at91sam9x5_lowlevel_init.c
arch/arm/mach-at91/Kconfig +2 -0
index 69426e4..21949e7 100644
@@ -139,6 +139,8 @@ config SOC_AT91SAM9X5
 	select HAVE_AT91_DBGU0
 	select HAS_MACB
 	select AT91SAM9G45_RESET
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
 	  This means that your SAM9 name finishes with a '5' (except if it is
arch/arm/mach-at91/Makefile +1 -0
index 0ead23c..a03398e 100644
@@ -8,6 +8,7 @@ lowlevel_init-$(CONFIG_SOC_AT91SAM9260) += at91sam9260_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9261) += at91sam9261_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9263) += at91sam9263_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45_lowlevel_init.o
+lowlevel_init-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5_lowlevel_init.o
 lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
 obj-y += $(lowlevel_init-y)
 
arch/arm/mach-at91/at91sam9x5_lowlevel_init.c new file +26 -0
new file mode 100644
index 0000000..e1befcb
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * Under GPLv2
+  */
+
+#define __LOWLEVEL_INIT__
+
+#include <common.h>
+#include <asm/system.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/hardware.h>
+#include <mach/io.h>
+#include <mach/at91sam9_ddrsdr.h>
+#include <init.h>
+#include <sizes.h>
+
+void __naked __bare_init reset(void)
+{
+	common_reset();
+
+	arm_setup_stack(AT91SAM9X5_SRAM_BASE + AT91SAM9X5_SRAM_SIZE - 16);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1, at91sam9x5_get_ddram_size(), 0);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#22 lore raw

PATCH 22/36 ARM AT91: switch at91sam9n12 to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/mach-at91/Kconfig                     |    2 ++
 arch/arm/mach-at91/Makefile                    |    1 +
 arch/arm/mach-at91/at91sam9n12_lowlevel_init.c |   26 ++++++++++++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 arch/arm/mach-at91/at91sam9n12_lowlevel_init.c
arch/arm/mach-at91/Kconfig +2 -0
index 21949e7..f4b8f9f 100644
@@ -153,6 +153,8 @@ config SOC_AT91SAM9N12
 	select SOC_AT91SAM9
 	select HAVE_AT91_DBGU0
 	select AT91SAM9G45_RESET
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Select this if you are using Atmel's AT91SAM9N12 SoC.
 
arch/arm/mach-at91/Makefile +1 -0
index a03398e..c4cbe36 100644
@@ -9,6 +9,7 @@ lowlevel_init-$(CONFIG_SOC_AT91SAM9261) += at91sam9261_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9263) += at91sam9263_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5_lowlevel_init.o
+lowlevel_init-$(CONFIG_SOC_AT91SAM9N12) += at91sam9n12_lowlevel_init.o
 lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
 obj-y += $(lowlevel_init-y)
 
arch/arm/mach-at91/at91sam9n12_lowlevel_init.c new file +26 -0
new file mode 100644
index 0000000..6acbd06
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * Under GPLv2
+  */
+
+#define __LOWLEVEL_INIT__
+
+#include <common.h>
+#include <asm/system.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/hardware.h>
+#include <mach/io.h>
+#include <mach/at91sam9_ddrsdr.h>
+#include <init.h>
+#include <sizes.h>
+
+void __naked __bare_init reset(void)
+{
+	common_reset();
+
+	arm_setup_stack(AT91SAM9N12_SRAM_BASE + AT91SAM9N12_SRAM_SIZE - 16);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1, at91sam9n12_get_ddram_size(), 0);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#23 lore raw

PATCH 23/36 ARM AT91: switch sama5d3 to barebox_arm_entry

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/mach-at91/Kconfig                 |    2 ++
 arch/arm/mach-at91/Makefile                |    1 +
 arch/arm/mach-at91/sama5d3_lowlevel_init.c |   25 +++++++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 arch/arm/mach-at91/sama5d3_lowlevel_init.c
arch/arm/mach-at91/Kconfig +2 -0
index f4b8f9f..723d25e 100644
@@ -26,6 +26,8 @@ config SOC_SAMA5
 	select CPU_V7
 	select AT91SAM9_SMC
 	select AT91SAM9_TIMER
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_TEXT_BASE
 	hex
arch/arm/mach-at91/Makefile +1 -0
index c4cbe36..53ca570 100644
@@ -11,6 +11,7 @@ lowlevel_init-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5_lowlevel_init.o
 lowlevel_init-$(CONFIG_SOC_AT91SAM9N12) += at91sam9n12_lowlevel_init.o
 lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
+lowlevel_init-$(CONFIG_ARCH_SAMA5D3) += sama5d3_lowlevel_init.o
 obj-y += $(lowlevel_init-y)
 
 pbl-y += $(lowlevel_init-y)
arch/arm/mach-at91/sama5d3_lowlevel_init.c new file +25 -0
new file mode 100644
index 0000000..1d30da6
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * Under GPLv2
+  */
+
+#define __LOWLEVEL_INIT__
+
+#include <common.h>
+#include <sizes.h>
+#include <init.h>
+#include <asm/system.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/hardware.h>
+#include <mach/at91sam9_ddrsdr.h>
+
+void __naked __bare_init reset(void)
+{
+	common_reset();
+
+	arm_setup_stack(SAMA5D3_SRAM_BASE + SAMA5D3_SRAM_SIZE - 16);
+
+	barebox_arm_entry(SAMA5_DDRCS, at91sama5_get_ddram_size(), 0);
+}
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#24 lore raw

PATCH 24/36 ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/Kconfig                        |   28 ----------------------------
 arch/arm/configs/archosg9_defconfig     |    1 -
 arch/arm/configs/phycard_a_l1_defconfig |    2 --
 arch/arm/cpu/start-pbl.c                |   12 ------------
 arch/arm/cpu/start.c                    |   12 ------------
 arch/arm/mach-at91/Kconfig              |   16 ----------------
 arch/arm/mach-omap/arch-omap.dox        |    1 -
 arch/arm/mach-pxa/Kconfig               |    1 -
 common/Kconfig                          |   12 ------------
 9 files changed, 85 deletions(-)
arch/arm/Kconfig +0 -28
index c7daebe..6f7a71f 100644
@@ -39,22 +39,16 @@ config ARCH_BCM2835
 	select COMMON_CLK
 	select CLOCKSOURCE_BCM2835
 	select ARM_AMBA
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_CLPS711X
 	bool "Cirrus Logic EP711x/EP721x/EP731x"
 	select CLKDEV_LOOKUP
 	select CPU_32v4T
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_EP93XX
 	bool "Cirrus Logic EP93xx"
 	select CPU_ARM920T
 	select GENERIC_GPIO
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_IMX
 	bool "Freescale iMX-based"
@@ -64,27 +58,19 @@ config ARCH_IMX
 	select CLKDEV_LOOKUP
 	select WATCHDOG_IMX_RESET_SOURCE
 	select HAS_DEBUG_LL
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_MXS
 	bool "Freescale i.MX23/28 (mxs) based"
 	select GENERIC_GPIO
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_NETX
 	bool "Hilscher NetX based"
 	select CPU_ARM926T
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_NOMADIK
 	bool "STMicroelectronics Nomadik"
 	select CPU_ARM926T
 	select CLOCKSOURCE_NOMADIK
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Support for the Nomadik platform by ST-Ericsson
 
@@ -92,52 +78,38 @@ config ARCH_OMAP
 	bool "TI OMAP"
 	select HAS_DEBUG_LL
 	select GPIOLIB
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_PXA
 	bool "Intel/Marvell PXA based"
 	select GENERIC_GPIO
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_S3C24xx
 	bool "Samsung S3C2410, S3C2440"
 	select ARCH_SAMSUNG
 	select CPU_ARM920T
 	select GENERIC_GPIO
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_S5PCxx
 	bool "Samsung S5PC110, S5PV210"
 	select ARCH_SAMSUNG
 	select CPU_V7
 	select GENERIC_GPIO
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_S3C64xx
 	bool "Samsung S3C64xx"
 	select ARCH_SAMSUNG
 	select CPU_V6
 	select GENERIC_GPIO
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_VERSATILE
 	bool "ARM Versatile boards (ARM926EJ-S)"
 	select CPU_ARM926T
 	select GPIOLIB
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_TEGRA
 	bool "Nvidia Tegra-based boards"
 	select CPU_ARM926T
 	select HAS_DEBUG_LL
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 endchoice
 
arch/arm/configs/archosg9_defconfig +0 -1
index 1f3d105..9a051da 100644
@@ -2,7 +2,6 @@ CONFIG_MACH_ARCHOSG9=y
 CONFIG_ARCH_OMAP=y
 CONFIG_ARCH_OMAP4=y
 CONFIG_AEABI=y
-# CONFIG_MACH_DO_LOWLEVEL_INIT is not set
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
 CONFIG_ARM_UNWIND=y
 # CONFIG_MMU is not set
arch/arm/configs/phycard_a_l1_defconfig +0 -2
index 5170722..d90a333 100644
@@ -36,8 +36,6 @@ CONFIG_STACK_SIZE=0x8000
 CONFIG_MALLOC_SIZE=0x1000000
 CONFIG_EXPERIMENTAL=y
 CONFIG_MALLOC_DLMALLOC=y
-CONFIG_MACH_HAS_LOWLEVEL_INIT=y
-CONFIG_MACH_DO_LOWLEVEL_INIT=y
 CONFIG_ARCH_HAS_LOWLEVEL_INIT=y
 CONFIG_PROMPT="phyCARD-A-L1 >"
 CONFIG_BAUDRATE=115200
arch/arm/cpu/start-pbl.c +0 -12
index 11ab025..06c0a17 100644
@@ -45,18 +45,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;
 
arch/arm/cpu/start.c +0 -12
index f212b61..4966ab6 100644
@@ -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.
  */
arch/arm/mach-at91/Kconfig +0 -16
index 723d25e..b8528d0 100644
@@ -26,8 +26,6 @@ config SOC_SAMA5
 	select CPU_V7
 	select AT91SAM9_SMC
 	select AT91SAM9_TIMER
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config ARCH_TEXT_BASE
 	hex
@@ -81,8 +79,6 @@ config HAVE_AT91_LOAD_BAREBOX_SRAM
 
 config AT91SAM9_LOWLEVEL_INIT
 	bool
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 comment "Atmel AT91 System-on-Chip"
 
@@ -91,8 +87,6 @@ config SOC_AT91RM9200
 	select CPU_ARM920T
 	select HAVE_AT91_DBGU0
 	select HAS_AT91_ETHER
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 
 config SOC_AT91SAM9260
 	bool
@@ -129,8 +123,6 @@ config SOC_AT91SAM9G45
 	select HAVE_AT91_DBGU1
 	select HAS_MACB
 	select AT91SAM9G45_RESET
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
 	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
@@ -141,8 +133,6 @@ config SOC_AT91SAM9X5
 	select HAVE_AT91_DBGU0
 	select HAS_MACB
 	select AT91SAM9G45_RESET
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
 	  This means that your SAM9 name finishes with a '5' (except if it is
@@ -155,8 +145,6 @@ config SOC_AT91SAM9N12
 	select SOC_AT91SAM9
 	select HAVE_AT91_DBGU0
 	select AT91SAM9G45_RESET
-	select MACH_HAS_LOWLEVEL_INIT
-	select MACH_DO_LOWLEVEL_INIT
 	help
 	  Select this if you are using Atmel's AT91SAM9N12 SoC.
 
@@ -165,7 +153,6 @@ choice
 
 config ARCH_AT91RM9200
 	bool "AT91RM9200"
-	select MACH_DO_LOWLEVEL_INIT
 	select SOC_AT91RM9200
 
 config ARCH_AT91SAM9260
@@ -305,7 +292,6 @@ config MACH_AT91SAM9261EK
 	bool "Atmel AT91SAM9261-EK Evaluation Kit"
 	select HAS_DM9000
 	select HAVE_AT91_DATAFLASH_CARD
-	select MACH_HAS_LOWLEVEL_INIT
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
 	select HAVE_AT91_LOWLEVEL_INIT
 	help
@@ -409,7 +395,6 @@ config MACH_PM9263
 config MACH_TNY_A9263
 	bool "CALAO TNY-A9263"
 	select SUPPORT_CALAO_MOB_TNY_MD2
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Select this if you are using a Calao Systems TNY-A9263.
 	  <http://www.calao-systems.com>
@@ -585,7 +570,6 @@ config AT91_BOOTSTRAP
 
 config AT91_LOAD_BAREBOX_SRAM
 	bool "at91 laad barebox in sram"
-	depends on MACH_HAS_LOWLEVEL_INIT
 	depends on SHELL_NONE || HAVE_AT91_LOAD_BAREBOX_SRAM
 	default y if SHELL_NONE
 
arch/arm/mach-omap/arch-omap.dox +0 -1
index 6b6b3a8..8c2b47d 100644
@@ -70,7 +70,6 @@ The responsibility of arch_init_lowlevel and related calls is to setup OMAP. No
 Once this is past, the code returns back to arm common code (cpu/start-arm.S). Here Instruction and Data caches are disabled. The execution proceeds to normal board initialization.
 
 @section board_boot The board boot path
-If the proper CONFIG_MACH_DO_LOWLEVEL_INIT flag is setup, board_init_lowlevel is called. This again would call a common file arch/arm/boards/omap/platform.S which setups a temporary SRAM stack and bumps the control to board_init.
 Every Board in OMAP platform can potentially define a board_init and enable defconfig in arch/arm/configs directory. The responsibility here is to setup OMAP for board configurations - this includes SDRAM configuration and pin muxing configuration.
 
 Once this is complete, @a barebox boot process proceeds by calling init functions and finally entering shell prompt
arch/arm/mach-pxa/Kconfig +0 -1
index 6808d2f..2bc040c 100644
@@ -42,7 +42,6 @@ config MACH_MIOA701
 
 config MACH_PCM027
 	bool "Phytec phyCORE-PXA270"
-	select MACH_HAS_LOWLEVEL_INIT
 	help
 	  Say Y here if you are using a Phytec phyCORE PXA270
 	  board
common/Kconfig +0 -12
index 2e062ba..595e91f 100644
@@ -244,18 +244,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"
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#25 lore raw

PATCH 25/36 ARM start-pbl: make board_init_lowlevel_return static

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/start-pbl.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
arch/arm/cpu/start-pbl.c +5 -9
index 06c0a17..0da4fef 100644
@@ -139,18 +139,12 @@ static void __noreturn barebox_uncompress(void *compressed_start, unsigned int l
 	barebox();
 }
 
-/*
- * Board code can jump here by either returning from board_init_lowlevel
- * or by calling this function directly.
- */
-void __naked __noreturn board_init_lowlevel_return(void)
+static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
+		uint32_t memsize, uint32_t boarddata)
 {
 	uint32_t offset;
 	uint32_t pg_start, pg_end, pg_len;
 
-	/* Setup the stack */
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
-
 	/* Get offset between linked address and runtime address */
 	offset = get_runtime_offset();
 
@@ -194,5 +188,7 @@ void __naked __noreturn board_init_lowlevel_return(void)
 void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
 		uint32_t boarddata)
 {
-	board_init_lowlevel_return();
+	arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+
+	__barebox_arm_entry(membase, memsize, boarddata);
 }
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#26 lore raw

PATCH 26/36 ARM start-pbl: call uncompressed binary with arguments

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/start-pbl.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm/cpu/start-pbl.c +9 -9
index 0da4fef..64cd6ff 100644
@@ -106,9 +106,8 @@ static void mmu_disable(void)
 	__mmu_cache_off();
 }
 
-static void __noreturn barebox_uncompress(void *compressed_start, unsigned int len)
+static void barebox_uncompress(void *compressed_start, unsigned int len)
 {
-	void __noreturn (*barebox)(void);
 	/*
 	 * remap_cached currently does not work rendering the feature
 	 * of enabling the MMU in the PBL useless. disable for now.
@@ -124,19 +123,12 @@ static void __noreturn barebox_uncompress(void *compressed_start, unsigned int l
 	if (use_mmu)
 		mmu_enable((unsigned long)compressed_start, len);
 
-	if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
-		barebox = (void *)(TEXT_BASE + 1);
-	else
-		barebox = (void *)TEXT_BASE;
-
 	pbl_barebox_uncompress((void*)TEXT_BASE, compressed_start, len);
 
 	if (use_mmu)
 		mmu_disable();
 
 	flush_icache();
-
-	barebox();
 }
 
 static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
@@ -144,6 +136,7 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 {
 	uint32_t offset;
 	uint32_t pg_start, pg_end, pg_len;
+	void __noreturn (*barebox)(uint32_t, uint32_t, uint32_t);
 
 	/* Get offset between linked address and runtime address */
 	offset = get_runtime_offset();
@@ -164,6 +157,13 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 	setup_c();
 
 	barebox_uncompress((void *)pg_start, pg_len);
+
+	if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
+		barebox = (void *)(TEXT_BASE + 1);
+	else
+		barebox = (void *)TEXT_BASE;
+
+	barebox(membase, memsize, boarddata);
 }
 
 /*
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#27 lore raw

PATCH 27/36 ARM start: pickup parameters from pbl

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/start.c               |   44 +++++++++++++++++++-----------------
 arch/arm/include/asm/barebox-arm.h |    1 -
 2 files changed, 23 insertions(+), 22 deletions(-)
arch/arm/cpu/start.c +23 -21
index 4966ab6..9fd1e8d 100644
@@ -26,32 +26,21 @@
 #include <asm/cache.h>
 #include <memory.h>
 
-/*
- * First function in the uncompressed image. We get here from
- * the pbl.
- */
-void __naked __section(.text_entry) start(void)
+static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
+		uint32_t boarddata)
 {
-#ifdef CONFIG_PBL_IMAGE
-	board_init_lowlevel_return();
-#else
-	barebox_arm_head();
-#endif
-}
-
-/*
- * Board code can jump here by either returning from board_init_lowlevel
- * or by calling this function directly.
- */
-void __naked __noreturn board_init_lowlevel_return(void)
-{
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
-
 	setup_c();
 
 	start_barebox();
 }
 
+#ifndef CONFIG_PBL_IMAGE
+
+void __naked __section(.text_entry) start(void)
+{
+	barebox_arm_head();
+}
+
 /*
  * Main ARM entry point in the uncompressed image. Call this with the memory
  * region you can spare for barebox. This doesn't necessarily have to be the
@@ -62,5 +51,18 @@ void __naked __noreturn board_init_lowlevel_return(void)
 void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
                 uint32_t boarddata)
 {
-	board_init_lowlevel_return();
+	arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+
+	__start(membase, memsize, boarddata);
 }
+#else
+/*
+ * First function in the uncompressed image. We get here from
+ * the pbl. The stack already has been set up by the pbl.
+ */
+void __naked __section(.text_entry) start(uint32_t membase, uint32_t memsize,
+                uint32_t boarddata)
+{
+	__start(membase, memsize, boarddata);
+}
+#endif
arch/arm/include/asm/barebox-arm.h +0 -1
index 0574f34..42b7a3f 100644
@@ -35,7 +35,6 @@ int	dram_init (void);
 extern char __exceptions_start[], __exceptions_stop[];
 
 void board_init_lowlevel(void);
-void __noreturn board_init_lowlevel_return(void);
 uint32_t get_runtime_offset(void);
 
 void setup_c(void);
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#28 lore raw

PATCH 28/36 ARM: Setup stack at end of SDRAM

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/cpu.c                 |   12 ++++++++++++
 arch/arm/cpu/start-pbl.c           |    4 +---
 arch/arm/cpu/start.c               |   18 +++++++++++++++++-
 arch/arm/include/asm/barebox-arm.h |    2 ++
 common/meminfo.c                   |    5 -----
 5 files changed, 32 insertions(+), 9 deletions(-)
arch/arm/cpu/cpu.c +12 -0
index 2ca871f..7761f5c 100644
@@ -28,6 +28,7 @@
 #include <asm/mmu.h>
 #include <asm/system.h>
 #include <asm/memory.h>
+#include <asm-generic/memory_layout.h>
 #include <asm/system_info.h>
 #include <asm/cputype.h>
 #include <asm/cache.h>
@@ -91,6 +92,17 @@ void arch_shutdown(void)
 	__asm__ __volatile__("msr cpsr, %0" : : "r"(r));
 }
 
+extern unsigned long arm_stack_top;
+
+static int arm_request_stack(void)
+{
+	if (!request_sdram_region("stack", arm_stack_top - STACK_SIZE, STACK_SIZE))
+		pr_err("Error: Cannot request SDRAM region for stack\n");
+
+	return 0;
+}
+coredevice_initcall(arm_request_stack);
+
 #ifdef CONFIG_THUMB2_BAREBOX
 static void thumb2_execute(void *func, int argc, char *argv[])
 {
arch/arm/cpu/start-pbl.c +1 -3
index 64cd6ff..89839f0 100644
@@ -174,8 +174,6 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
  * be preserved and can be accessed later with barebox_arm_boarddata().
  *
  * -> membase + memsize
- *   ARM_RESERVE_MEM_SIZE    - reserved for board usage. Will not be touched
- *                             by barebox
  *   STACK_SIZE              - stack
  *   16KiB, aligned to 16KiB - First level page table if early MMU support
  *                             is enabled
@@ -188,7 +186,7 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
 		uint32_t boarddata)
 {
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+	arm_setup_stack(membase + memsize - 16);
 
 	__barebox_arm_entry(membase, memsize, boarddata);
 }
arch/arm/cpu/start.c +17 -1
index 9fd1e8d..a621161 100644
@@ -26,11 +26,18 @@
 #include <asm/cache.h>
 #include <memory.h>
 
+unsigned long arm_stack_top;
+
 static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
 		uint32_t boarddata)
 {
+	unsigned long endmem = membase + memsize;
+
 	setup_c();
 
+	arm_stack_top = endmem;
+	endmem -= STACK_SIZE; /* Stack */
+
 	start_barebox();
 }
 
@@ -47,11 +54,20 @@ void __naked __section(.text_entry) start(void)
  * full SDRAM. The currently running binary can be inside or outside of this
  * region. TEXT_BASE can be inside or outside of this region. boarddata will
  * be preserved and can be accessed later with barebox_arm_boarddata().
+ *
+ * -> membase + memsize
+ *   STACK_SIZE              - stack
+ *   16KiB, aligned to 16KiB - First level page table if early MMU support
+ *                             is enabled
+ * -> maximum end of barebox binary
+ *
+ * Usually a TEXT_BASE of 1MiB below your lowest possible end of memory should
+ * be fine.
  */
 void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
                 uint32_t boarddata)
 {
-	arm_setup_stack(STACK_BASE + STACK_SIZE - 16);
+	arm_setup_stack(membase + memsize - 16);
 
 	__start(membase, memsize, boarddata);
 }
arch/arm/include/asm/barebox-arm.h +2 -0
index 42b7a3f..9c10e36 100644
@@ -25,6 +25,8 @@
 #ifndef _BAREBOX_ARM_H_
 #define _BAREBOX_ARM_H_
 
+#include <sizes.h>
+
 /* cpu/.../cpu.c */
 int	cleanup_before_linux(void);
 
common/meminfo.c +0 -5
index a09b2d2..5e3ff71 100644
@@ -14,11 +14,6 @@ static int display_meminfo(void)
 	debug("bss segment:  0x%p -> 0x%p\n", __bss_start, __bss_stop - 1);
 	printf("malloc space: 0x%08lx -> 0x%08lx (size %s)\n",
 		mstart, mend, size_human_readable(msize));
-#ifdef CONFIG_ARM
-	printf("stack space:  0x%08x -> 0x%08x (size %s)\n",
-		STACK_BASE, STACK_BASE + STACK_SIZE - 1,
-		size_human_readable(STACK_SIZE));
-#endif
 	return 0;
 }
 late_initcall(display_meminfo);
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#29 lore raw

PATCH 29/36 ARM pbl: Use dynamic parameters for early malloc space

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/start-pbl.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
arch/arm/cpu/start-pbl.c +7 -4
index 89839f0..9c168b3 100644
@@ -114,10 +114,6 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
 	 */
 	int use_mmu = 0;
 
-	/* set 128 KiB at the end of the MALLOC_BASE for early malloc */
-	free_mem_ptr = MALLOC_BASE + MALLOC_SIZE - SZ_128K;
-	free_mem_end_ptr = free_mem_ptr + SZ_128K;
-
 	ttb = (void *)((free_mem_ptr - 0x4000) & ~0x3fff);
 
 	if (use_mmu)
@@ -137,6 +133,9 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 	uint32_t offset;
 	uint32_t pg_start, pg_end, pg_len;
 	void __noreturn (*barebox)(uint32_t, uint32_t, uint32_t);
+	uint32_t endmem = membase + memsize;
+
+	endmem -= STACK_SIZE; /* stack */
 
 	/* Get offset between linked address and runtime address */
 	offset = get_runtime_offset();
@@ -156,6 +155,10 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 
 	setup_c();
 
+	endmem -= SZ_128K; /* early malloc */
+	free_mem_ptr = endmem;
+	free_mem_end_ptr = free_mem_ptr + SZ_128K;
+
 	barebox_uncompress((void *)pg_start, pg_len);
 
 	if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#30 lore raw

PATCH 30/36 ARM mmu: pickup already enabled mmu

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/mmu.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/cpu/mmu.c +8 -1
index 8f9a43e..73dd0d3 100644
@@ -276,7 +276,14 @@ static int mmu_init(void)
 		pte_flags_uncached = PTE_FLAGS_UNCACHED_V4;
 	}
 
-	ttb = memalign(0x10000, 0x4000);
+	if (get_cr() & CR_M) {
+		asm volatile ("mrc  p15,0,%0,c2,c0,0" : "=r"(ttb));
+
+		if (!request_sdram_region("ttb", (unsigned long)ttb, SZ_16K))
+			pr_err("Error: Can't request SDRAM region for ttb\n");
+	} else {
+		ttb = memalign(0x10000, 0x4000);
+	}
 
 	pr_debug("ttb: 0x%p\n", ttb);
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#31 lore raw

PATCH 31/36 ARM: Factor out early mmu code

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

Move early mmu code to a separate file so that it can be used from the pbl and the regular image. Disabling the mmu can be dropped since the regular mmu code is now able to pickup an enabled mmu.

---
 arch/arm/cpu/Makefile    |    4 +--
 arch/arm/cpu/mmu-early.c |   53 ++++++++++++++++++++++++++++++++++
 arch/arm/cpu/mmu-early.h |    6 ++++
 arch/arm/cpu/start-pbl.c |   72 ----------------------------------------------
 4 files changed, 61 insertions(+), 74 deletions(-)
 create mode 100644 arch/arm/cpu/mmu-early.c
 create mode 100644 arch/arm/cpu/mmu-early.h
arch/arm/cpu/Makefile +2 -2
index 4b0259c..44410ee 100644
@@ -8,8 +8,8 @@ obj-y += start.o setupc.o
 #
 obj-$(CONFIG_CMD_ARM_CPUINFO) += cpuinfo.o
 obj-$(CONFIG_CMD_ARM_MMUINFO) += mmuinfo.o
-obj-$(CONFIG_MMU) += mmu.o cache.o
-pbl-$(CONFIG_MMU) += cache.o
+obj-$(CONFIG_MMU) += mmu.o cache.o mmu-early.o
+pbl-$(CONFIG_MMU) += cache.o mmu-early.o
 obj-$(CONFIG_CPU_32v4T) += cache-armv4.o
 pbl-$(CONFIG_CPU_32v4T) += cache-armv4.o
 obj-$(CONFIG_CPU_32v5) += cache-armv5.o
arch/arm/cpu/mmu-early.c new file +53 -0

53 lines not on this page · raw message

arch/arm/cpu/mmu-early.h new file +6 -0
new file mode 100644
index 0000000..af21f52
@@ -0,0 +1,6 @@
+#ifndef __ARM_CPU_MMU_EARLY_H
+#define __ARM_CPU_MMU_EARLY_H
+
+void mmu_early_enable(uint32_t membase, uint32_t memsize, uint32_t ttb);
+
+#endif /* __ARM_CPU_MMU_EARLY_H */
arch/arm/cpu/start-pbl.c +0 -72

82 lines not on this page · raw message

Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#32 lore raw

PATCH 32/36 ARM: Enable mmu early

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

This optionally enabled the MMU in the PBL or during early startup for the non PBL case. The regular MMU init code will pickup the already enabled MMU later. This might complicate debugging early code, so this has been made optional.

---
 arch/arm/cpu/start-pbl.c |    8 +++++++-
 arch/arm/cpu/start.c     |   12 ++++++++++++
 common/Kconfig           |    9 +++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)
arch/arm/cpu/start-pbl.c +7 -1
index 0599c57..a825e9f 100644
@@ -32,7 +32,7 @@
 #include <asm/pgtable.h>
 #include <asm/cache.h>
 
-#include "mmu.h"
+#include "mmu-early.h"
 
 unsigned long free_mem_ptr;
 unsigned long free_mem_end_ptr;
@@ -83,6 +83,12 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 
 	setup_c();
 
+	if (IS_ENABLED(CONFIG_MMU_EARLY)) {
+		endmem &= ~0x3fff;
+		endmem -= SZ_16K; /* ttb */
+		mmu_early_enable(membase, memsize, endmem);
+	}
+
 	endmem -= SZ_128K; /* early malloc */
 	free_mem_ptr = endmem;
 	free_mem_end_ptr = free_mem_ptr + SZ_128K;
arch/arm/cpu/start.c +12 -0
index a621161..d90b244 100644
@@ -19,6 +19,7 @@
 
 #include <common.h>
 #include <init.h>
+#include <sizes.h>
 #include <asm/barebox-arm.h>
 #include <asm/barebox-arm-head.h>
 #include <asm-generic/memory_layout.h>
@@ -26,6 +27,8 @@
 #include <asm/cache.h>
 #include <memory.h>
 
+#include "mmu-early.h"
+
 unsigned long arm_stack_top;
 
 static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
@@ -38,6 +41,15 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
 	arm_stack_top = endmem;
 	endmem -= STACK_SIZE; /* Stack */
 
+	if (IS_ENABLED(CONFIG_MMU_EARLY)) {
+
+		endmem &= ~0x3fff;
+		endmem -= SZ_16K; /* ttb */
+
+		if (!IS_ENABLED(CONFIG_PBL_IMAGE))
+			mmu_early_enable(membase, memsize, endmem);
+	}
+
 	start_barebox();
 }
 
common/Kconfig +9 -0
index 595e91f..3f6c11e 100644
@@ -114,6 +114,15 @@ config MMU
 	  to enable the data cache which depends on the MMU. See Documentation/mmu.txt
 	  for further information.
 
+config MMU_EARLY
+	bool "Enable MMU early"
+	depends on ARM
+	depends on MMU
+	default y
+	help
+	  This enables the MMU during early startup. This speeds up things during startup
+	  of barebox, but may lead to harder to debug code. If unsure say yes here.
+
 config HAVE_CONFIGURABLE_TEXT_BASE
 	bool
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#33 lore raw

PATCH 33/36 ARM: Automatically determine malloc size

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/start.c  |   28 ++++++++++++++++++++++++++++
 arch/arm/lib/Makefile |    1 -
 arch/arm/lib/arm.c    |   14 --------------
 3 files changed, 28 insertions(+), 15 deletions(-)
 delete mode 100644 arch/arm/lib/arm.c
arch/arm/cpu/start.c +28 -0
index d90b244..cd34d9c 100644
@@ -35,6 +35,7 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
 		uint32_t boarddata)
 {
 	unsigned long endmem = membase + memsize;
+	unsigned long malloc_start, malloc_end;
 
 	setup_c();
 
@@ -50,6 +51,33 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
 			mmu_early_enable(membase, memsize, endmem);
 	}
 
+	if ((unsigned long)_text > membase + memsize ||
+			(unsigned long)_text < membase)
+		/*
+		 * barebox is either outside SDRAM or in another
+		 * memory bank, so we can use the whole bank for
+		 * malloc.
+		 */
+		malloc_end = endmem;
+	else
+		malloc_end = (unsigned long)_text;
+
+	/*
+	 * Maximum malloc space is the Kconfig value if given
+	 * or 64MB.
+	 */
+	if (MALLOC_SIZE > 0) {
+		malloc_start = malloc_end - MALLOC_SIZE;
+		if (malloc_start < membase)
+			malloc_start = membase;
+	} else {
+		malloc_start = malloc_end - (malloc_end - membase) / 2;
+		if (malloc_end - malloc_start > SZ_64M)
+			malloc_start = malloc_end - SZ_64M;
+	}
+
+	mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
+
 	start_barebox();
 }
 
arch/arm/lib/Makefile +0 -1
index 2e624cd..3ea695c 100644
@@ -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
arch/arm/lib/arm.c deleted +0 -14
deleted file mode 100644
index 80b62e9..0000000
@@ -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);
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#34 lore raw

PATCH 34/36 generic memory layout: fix deps for [MALLOC|STACK]_BASE

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

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

---
 include/asm-generic/memory_layout.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/asm-generic/memory_layout.h +2 -4
index eb1607f..45e0ed8 100644
@@ -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
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#35 lore raw

PATCH 35/36 ARM: disable HAVE_CONFIGURABLE_MEMORY_LAYOUT

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

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.

---
 arch/arm/Kconfig            |    1 -
 arch/arm/pbl/zbarebox.lds.S |    8 ++++----
 2 files changed, 4 insertions(+), 5 deletions(-)
arch/arm/Kconfig +0 -1
index 6f7a71f..28332ec 100644
@@ -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
arch/arm/pbl/zbarebox.lds.S +4 -4
index 37af4e9..564b3c6 100644
@@ -20,7 +20,7 @@
  * MA 02111-1307 USA
  *
  */
-
+#include <sizes.h>
 #include <asm-generic/barebox.lds.h>
 #include <asm-generic/memory_layout.h>
 
@@ -29,7 +29,7 @@ OUTPUT_ARCH(arm)
 ENTRY(pbl_start)
 SECTIONS
 {
-	. = HEAD_TEXT_BASE;
+	. = TEXT_BASE - SZ_2M;
 
 	PRE_IMAGE
 
@@ -71,6 +71,6 @@ SECTIONS
 	}
 	__piggydata_end = .;
 
-	_barebox_image_size = __piggydata_end - HEAD_TEXT_BASE;
-	_barebox_pbl_size = __bss_start - HEAD_TEXT_BASE;
+	_barebox_image_size = __piggydata_end - (TEXT_BASE - SZ_2M);
+	_barebox_pbl_size = __bss_start - (TEXT_BASE - SZ_2M);
 }
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#36 lore raw

PATCH 36/36 ARM pbl: inline decompress function

In reply to Jean-Christophe PLAGNIOL-VILLARD

From: Sascha Hauer <[email protected]>

---
 arch/arm/cpu/start-pbl.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/arm/cpu/start-pbl.c +3 -8
index a825e9f..91bc8fe 100644
@@ -48,13 +48,6 @@ void __naked __section(.text_head_entry) pbl_start(void)
 extern void *input_data;
 extern void *input_data_end;
 
-static void barebox_uncompress(void *compressed_start, unsigned int len)
-{
-	pbl_barebox_uncompress((void*)TEXT_BASE, compressed_start, len);
-
-	flush_icache();
-}
-
 static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 		uint32_t memsize, uint32_t boarddata)
 {
@@ -93,7 +86,9 @@ static noinline __noreturn void __barebox_arm_entry(uint32_t membase,
 	free_mem_ptr = endmem;
 	free_mem_end_ptr = free_mem_ptr + SZ_128K;
 
-	barebox_uncompress((void *)pg_start, pg_len);
+	pbl_barebox_uncompress((void*)TEXT_BASE, (void *)pg_start, pg_len);
+
+	flush_icache();
 
 	if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
 		barebox = (void *)(TEXT_BASE + 1);
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox