diff options
author | Cástor Muñoz <cmvidal@gmail.com> | 2015-12-17 02:37:18 +0100 |
---|---|---|
committer | Cástor Muñoz <cmvidal@gmail.com> | 2015-12-17 10:52:49 +0100 |
commit | 00bda90a21d2c976cabd1926c96a81ad4a319b4e (patch) | |
tree | 1fb805f7100e17413eb4928eaa11b8c486615270 /firmware/target/arm/s5l8702/system-s5l8702.c | |
parent | 348bfc5c8f6633d40d3708e826aa7e9b0360729f (diff) |
iPod Classic: add non-cached memory region
Configures uncached memory region and adds some defines for misc HW,
for compability with the bootloader and other future use, current
functionality should not be affected.
Change-Id: I390e79bea1aef5b10dfbc72ad327d7fe438ec6f5
Diffstat (limited to 'firmware/target/arm/s5l8702/system-s5l8702.c')
-rw-r--r-- | firmware/target/arm/s5l8702/system-s5l8702.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/firmware/target/arm/s5l8702/system-s5l8702.c b/firmware/target/arm/s5l8702/system-s5l8702.c index 3e84e5cf54..6b20f44acb 100644 --- a/firmware/target/arm/s5l8702/system-s5l8702.c +++ b/firmware/target/arm/s5l8702/system-s5l8702.c @@ -168,7 +168,7 @@ void irq_handler(void) irqvector[current_irq](); VIC0ADDRESS = NULL; VIC1ADDRESS = NULL; - + asm volatile( "add sp, sp, #8 \n" /* Cleanup stack */ "ldmfd sp!, {r0-r7, ip, lr} \n" /* Restore context */ "subs pc, lr, #4 \n"); /* Return from IRQ */ @@ -258,3 +258,22 @@ void set_cpu_frequency(long frequency) cpu_frequency = frequency; } #endif + +static void set_page_tables(void) +{ + /* map RAM to itself and enable caching for it */ + map_section(0, 0, 0x380, CACHE_ALL); + + /* disable caching for I/O area */ + map_section(0x38000000, 0x38000000, 0x80, CACHE_NONE); + + /* map RAM uncached addresses */ + map_section(0, S5L8702_UNCACHED_ADDR(0x0), 0x380, CACHE_NONE); +} + +void memory_init(void) +{ + ttb_init(); + set_page_tables(); + enable_mmu(); +} |