summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/mmu.c2
-rw-r--r--arch/arm/cpu/start-pbl.c21
-rw-r--r--arch/arm/cpu/start-reset.c3
-rw-r--r--arch/arm/cpu/start.c17
4 files changed, 22 insertions, 21 deletions
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index dad8092e9f..e3ca722300 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -144,7 +144,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank)
if ((phys & (SZ_1M - 1)) || (bank->size & (SZ_1M - 1)))
return -EINVAL;
- ptes = memalign(PAGE_SIZE, num_ptes * sizeof(u32));
+ ptes = xmemalign(PAGE_SIZE, num_ptes * sizeof(u32));
debug("ptes: 0x%p ttb_start: 0x%08lx ttb_end: 0x%08lx\n",
ptes, ttb_start, ttb_end);
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 932a3da9e2..04b54304e1 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -36,6 +36,9 @@
unsigned long free_mem_ptr;
unsigned long free_mem_end_ptr;
+/*
+ * First instructions in the pbl image
+ */
void __naked __section(.text_head_entry) pbl_start(void)
{
barebox_arm_head();
@@ -116,7 +119,11 @@ static void mmu_disable(void)
static void barebox_uncompress(void *compressed_start, unsigned int len)
{
void (*barebox)(void);
- int use_mmu = IS_ENABLED(CONFIG_MMU);
+ /*
+ * remap_cached currently does not work rendering the feature
+ * of enabling the MMU in the PBL useless. disable for now.
+ */
+ int use_mmu = 0;
/* set 128 KiB at the end of the MALLOC_BASE for early malloc */
free_mem_ptr = MALLOC_BASE + MALLOC_SIZE - SZ_128K;
@@ -149,23 +156,17 @@ 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 __section(.text_ll_return) board_init_lowlevel_return(void)
+void __naked board_init_lowlevel_return(void)
{
- uint32_t r, addr, offset;
+ uint32_t r, offset;
uint32_t pg_start, pg_end, pg_len;
- /*
- * Get runtime address of this function. Do not
- * put any code above this.
- */
- __asm__ __volatile__("1: adr %0, 1b":"=r"(addr));
-
/* Setup the stack */
r = STACK_BASE + STACK_SIZE - 16;
__asm__ __volatile__("mov sp, %0" : : "r"(r));
/* Get offset between linked address and runtime address */
- offset = (uint32_t)__ll_return - addr;
+ offset = get_runtime_offset();
pg_start = (uint32_t)&input_data - offset;
pg_end = (uint32_t)&input_data_end - offset;
diff --git a/arch/arm/cpu/start-reset.c b/arch/arm/cpu/start-reset.c
index e0df676274..fcfdce6bff 100644
--- a/arch/arm/cpu/start-reset.c
+++ b/arch/arm/cpu/start-reset.c
@@ -29,6 +29,9 @@
/*
* The actual reset vector. This code is position independent and usually
* does not run at the address it's linked at.
+ *
+ * This is either executed in the pbl image (if enabled) or in the regular
+ * image.
*/
void __naked __bare_init reset(void)
{
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 07e7dfe822..1c6a7ddfcc 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -30,7 +30,7 @@
#ifdef CONFIG_PBL_IMAGE
/*
- * First function in the pbl image. We get here from
+ * First function in the uncompressed image. We get here from
* the pbl.
*/
void __naked __section(.text_entry) start(void)
@@ -47,6 +47,9 @@ void __naked __section(.text_entry) start(void)
}
#else
+/*
+ * First function in the image without pbl support
+ */
void __naked __section(.text_entry) start(void)
{
barebox_arm_head();
@@ -56,22 +59,16 @@ void __naked __section(.text_entry) start(void)
* Board code can jump here by either returning from board_init_lowlevel
* or by calling this function directly.
*/
-void __naked __section(.text_ll_return) board_init_lowlevel_return(void)
+void __naked board_init_lowlevel_return(void)
{
- uint32_t r, addr, offset;
-
- /*
- * Get runtime address of this function. Do not
- * put any code above this.
- */
- __asm__ __volatile__("1: adr %0, 1b":"=r"(addr));
+ uint32_t r, offset;
/* Setup the stack */
r = STACK_BASE + STACK_SIZE - 16;
__asm__ __volatile__("mov sp, %0" : : "r"(r));
/* Get offset between linked address and runtime address */
- offset = (uint32_t)__ll_return - addr;
+ offset = get_runtime_offset();
/* relocate to link address if necessary */
if (offset)