summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-11-21 12:19:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-12-10 14:35:34 +0100
commit9080ddd214a786f9d2f184b94f15ba9ce4939895 (patch)
tree4d63abae4c94ba617236fc0156c0ef02994b7a4b /arch
parent038806d8e2e21d104987c18f3b25997fa5269b76 (diff)
downloadbarebox-9080ddd214a786f9d2f184b94f15ba9ce4939895.tar.gz
barebox-9080ddd214a786f9d2f184b94f15ba9ce4939895.tar.xz
ARM: am33xx Phytec phyCORE: Switch to multiimage support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/pcm051/lowlevel.c41
-rw-r--r--arch/arm/configs/pcm051_defconfig4
-rw-r--r--arch/arm/configs/pcm051_mlo_defconfig9
-rw-r--r--arch/arm/dts/Makefile1
-rw-r--r--arch/arm/mach-omap/Kconfig1
5 files changed, 39 insertions, 17 deletions
diff --git a/arch/arm/boards/pcm051/lowlevel.c b/arch/arm/boards/pcm051/lowlevel.c
index 08f36ecb18..d3cac6860b 100644
--- a/arch/arm/boards/pcm051/lowlevel.c
+++ b/arch/arm/boards/pcm051/lowlevel.c
@@ -46,6 +46,9 @@ static const struct am33xx_ddr_data MT41J256M8HX15E_2x256M8_data = {
.dll_lock_diff0 = 0x0,
};
+extern char __dtb_am335x_phytec_phycore_start[];
+extern char __dtb_am335x_phytec_phycore_end[];
+
/**
* @brief The basic entry point for board initialization.
*
@@ -55,8 +58,10 @@ static const struct am33xx_ddr_data MT41J256M8HX15E_2x256M8_data = {
*
* @return void
*/
-static int pcm051_board_init(void)
+static noinline void pcm051_board_init(void)
{
+ unsigned long sdram = 0x80000000, fdt;
+
/* WDT1 is already running when the bootloader gets control
* Disable it to avoid "random" resets
*/
@@ -66,9 +71,6 @@ static int pcm051_board_init(void)
writel(WDT_DISABLE_CODE2, AM33XX_WDT_REG(WSPR));
while (readl(AM33XX_WDT_REG(WWPS)) != 0x0);
- if (am33xx_running_in_sdram())
- return 0;
-
am33xx_pll_init(MPUPLL_M_600, 25, DDRPLL_M_303);
am335x_sdram_init(0x18B, &MT41J256M8HX15E_2x256M8_cmd,
@@ -80,16 +82,39 @@ static int pcm051_board_init(void)
omap_uart_lowlevel_init((void *)AM33XX_UART0_BASE);
putc_ll('>');
- return 0;
+ /*
+ * Copy the devicetree blob to sdram so that the barebox code finds it
+ * inside valid SDRAM instead of SRAM.
+ */
+ memcpy((void *)sdram, __dtb_am335x_phytec_phycore_start,
+ __dtb_am335x_phytec_phycore_end -
+ __dtb_am335x_phytec_phycore_start);
+ fdt = sdram;
+
+ barebox_arm_entry(sdram, SZ_512M, fdt);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t *data)
+ENTRY_FUNCTION(start_am33xx_phytec_phycore_sram, bootinfo, r1, r2)
{
- am33xx_save_bootinfo(data);
+ am33xx_save_bootinfo((void *)bootinfo);
arm_cpu_lowlevel_init();
+ /*
+ * Setup C environment, the board init code uses global variables.
+ * Stackpointer has already been initialized by the ROM code.
+ */
+ relocate_to_current_adr();
+ setup_c();
+
pcm051_board_init();
+}
+
+ENTRY_FUNCTION(start_am33xx_phytec_phycore_sdram, r0, r1, r2)
+{
+ uint32_t fdt;
+
+ fdt = (uint32_t)__dtb_am335x_phytec_phycore_start - get_runtime_offset();
- barebox_arm_entry(0x80000000, SZ_512M, 0);
+ barebox_arm_entry(0x80000000, SZ_512M, fdt);
}
diff --git a/arch/arm/configs/pcm051_defconfig b/arch/arm/configs/pcm051_defconfig
index e55ac47768..482329aa60 100644
--- a/arch/arm/configs/pcm051_defconfig
+++ b/arch/arm/configs/pcm051_defconfig
@@ -1,5 +1,3 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="am335x-phytec-phycore"
CONFIG_ARCH_OMAP=y
CONFIG_BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO=y
CONFIG_MACH_PCM051=y
@@ -8,8 +6,6 @@ CONFIG_ARM_BOARD_APPEND_ATAG=y
CONFIG_CMD_ARM_MMUINFO=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_ARM_UNWIND=y
-CONFIG_PBL_IMAGE=y
-CONFIG_PBL_RELOCATABLE=y
CONFIG_MMU=y
CONFIG_TEXT_BASE=0x0
CONFIG_MALLOC_SIZE=0x0
diff --git a/arch/arm/configs/pcm051_mlo_defconfig b/arch/arm/configs/pcm051_mlo_defconfig
index 4f6a7b1496..dc4165a8e1 100644
--- a/arch/arm/configs/pcm051_mlo_defconfig
+++ b/arch/arm/configs/pcm051_mlo_defconfig
@@ -1,5 +1,3 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="am335x-phytec-phycore"
CONFIG_ARCH_OMAP=y
CONFIG_OMAP_BUILD_IFT=y
CONFIG_MACH_PCM051=y
@@ -8,9 +6,10 @@ CONFIG_THUMB2_BAREBOX=y
# CONFIG_MEMINFO is not set
CONFIG_ENVIRONMENT_VARIABLES=y
CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x402F0400
-CONFIG_STACK_SIZE=0x1600
-CONFIG_MALLOC_SIZE=0x1000000
+CONFIG_TEXT_BASE=0x0
+CONFIG_MALLOC_SIZE=0x0
+CONFIG_MALLOC_TLSF=y
+CONFIG_RELOCATABLE=y
CONFIG_PROMPT="MLO>"
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index f801932165..5d413cd382 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -29,6 +29,7 @@ pbl-$(CONFIG_MACH_FREESCALE_MX51_PDK) += imx51-babbage.dtb.o
pbl-$(CONFIG_MACH_FREESCALE_MX53_LOCO) += imx53-qsb.dtb.o
pbl-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += imx53-voipac-bsb.dtb.o
pbl-$(CONFIG_MACH_DFI_FS700_M60) += imx6q-dfi-fs700-m60-6q.dtb.o imx6dl-dfi-fs700-m60-6s.dtb.o
+pbl-$(CONFIG_MACH_PCM051) += am335x-phytec-phycore.dtb.o
pbl-$(CONFIG_MACH_PHYTEC_PFLA02) += imx6q-phytec-pbab01.dtb.o
pbl-$(CONFIG_MACH_REALQ7) += imx6q-dmo-realq7.dtb.o
pbl-$(CONFIG_MACH_SOLIDRUN_CUBOX) += dove-cubox.dtb.o
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 7cd7f89f22..1cfc22f15f 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -178,6 +178,7 @@ config MACH_PCM051
bool "Phytec phyCORE pcm051"
select HAVE_DEFAULT_ENVIRONMENT_NEW
select ARCH_AM33XX
+ select HAVE_PBL_MULTI_IMAGES
help
Say Y here if you are using Phytecs phyCORE pcm051 board