summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-06-11 07:35:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-06-11 07:35:39 +0200
commitf8eaeee4571358afa5fb0d9e6374d095c7531c96 (patch)
tree40e37b7eb56c4f6f43273c07b58f310e68cfc2a6 /arch/mips
parent91649f1065d735bb4bcc6bb1a8067e670dcbbead (diff)
parent34d18aaa2a47522a8b607fb2e61c79f5b10ecb9a (diff)
downloadbarebox-f8eaeee4571358afa5fb0d9e6374d095c7531c96.tar.gz
barebox-f8eaeee4571358afa5fb0d9e6374d095c7531c96.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/io.h6
-rw-r--r--arch/mips/lib/reloc.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index c155199430..4df9853680 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -39,7 +39,11 @@ static inline unsigned long virt_to_phys(const void *address)
*/
static inline void *phys_to_virt(unsigned long address)
{
- return (void *)CKSEG0ADDR(address);
+ if (IS_ENABLED(CONFIG_MMU)) {
+ return (void *)CKSEG0ADDR(address);
+ }
+
+ return (void *)CKSEG1ADDR(address);
}
#define IO_SPACE_LIMIT 0
diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c
index 4b0e252352..b084a88be7 100644
--- a/arch/mips/lib/reloc.c
+++ b/arch/mips/lib/reloc.c
@@ -120,7 +120,11 @@ void relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
length = __bss_stop - __image_start;
relocaddr = ALIGN_DOWN(ram_size - length, SZ_64K);
- relocaddr = KSEG0ADDR(relocaddr);
+ if (IS_ENABLED(CONFIG_MMU)) {
+ relocaddr = KSEG0ADDR(relocaddr);
+ } else {
+ relocaddr = KSEG1ADDR(relocaddr);
+ }
new_stack = relocaddr - MALLOC_SIZE - 16;
/*