| 1 |
|
| 2 |
|
| 3 |
#include <types.h> |
| 4 |
|
| 5 |
#include <arch/cache.h> |
| 6 |
#include <bootblock_common.h> |
| 7 |
#include <symbols.h> |
| 8 |
|
| 9 |
#define SRAM_START ((uintptr_t)_sram / MiB) |
| 10 |
#define SRAM_END (DIV_ROUND_UP((uintptr_t)_esram, MiB)) |
| 11 |
|
| 12 |
#define DRAM_START ((uintptr_t)_dram / MiB) |
| 13 |
#define DRAM_SIZE (CONFIG_DRAM_SIZE_MB) |
| 14 |
|
| 15 |
void bootblock_soc_init(void) |
| 16 |
{ |
| 17 |
mmu_init(); |
| 18 |
|
| 19 |
|
| 20 |
mmu_config_range(0, 4096, DCACHE_OFF); |
| 21 |
|
| 22 |
mmu_config_range(SRAM_START, SRAM_END - SRAM_START, |
| 23 |
DCACHE_WRITEBACK); |
| 24 |
|
| 25 |
mmu_config_range(DRAM_START, DRAM_SIZE, DCACHE_WRITEBACK); |
| 26 |
|
| 27 |
dcache_mmu_enable(); |
| 28 |
} |