Christian Marangi | c771b63 | 2025-03-14 19:59:21 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | #include <fdtdec.h> |
| 4 | #include <init.h> |
| 5 | #include <asm/armv8/mmu.h> |
| 6 | #include <asm/system.h> |
| 7 | |
| 8 | int print_cpuinfo(void) |
| 9 | { |
| 10 | printf("CPU: Airoha AN7581\n"); |
| 11 | return 0; |
| 12 | } |
| 13 | |
| 14 | int dram_init(void) |
| 15 | { |
| 16 | return fdtdec_setup_mem_size_base(); |
| 17 | } |
| 18 | |
| 19 | int dram_init_banksize(void) |
| 20 | { |
| 21 | return fdtdec_setup_memory_banksize(); |
| 22 | } |
| 23 | |
| 24 | void reset_cpu(ulong addr) |
| 25 | { |
| 26 | psci_system_reset(); |
| 27 | } |
| 28 | |
| 29 | static struct mm_region an7581_mem_map[] = { |
| 30 | { |
| 31 | /* DDR */ |
| 32 | .virt = 0x80000000UL, |
| 33 | .phys = 0x80000000UL, |
| 34 | .size = 0x80000000UL, |
| 35 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE, |
| 36 | }, { |
| 37 | .virt = 0x00000000UL, |
| 38 | .phys = 0x00000000UL, |
| 39 | .size = 0x20000000UL, |
| 40 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| 41 | PTE_BLOCK_NON_SHARE | |
| 42 | PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| 43 | }, { |
| 44 | 0, |
| 45 | } |
| 46 | }; |
| 47 | struct mm_region *mem_map = an7581_mem_map; |