developer | b73d795 | 2020-01-10 16:30:26 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2019 MediaTek Inc. |
| 4 | * Author: Sam Shih <sam.shih@mediatek.com> |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <fdtdec.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 9 | #include <init.h> |
developer | b73d795 | 2020-01-10 16:30:26 +0800 | [diff] [blame] | 10 | #include <asm/armv8/mmu.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 11 | #include <asm/cache.h> |
developer | b73d795 | 2020-01-10 16:30:26 +0800 | [diff] [blame] | 12 | |
| 13 | int print_cpuinfo(void) |
| 14 | { |
| 15 | printf("CPU: MediaTek MT7622\n"); |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | int dram_init(void) |
| 20 | { |
| 21 | int ret; |
| 22 | |
| 23 | ret = fdtdec_setup_memory_banksize(); |
| 24 | if (ret) |
| 25 | return ret; |
| 26 | return fdtdec_setup_mem_size_base(); |
| 27 | |
| 28 | } |
| 29 | |
Harald Seiler | 6f14d5f | 2020-12-15 16:47:52 +0100 | [diff] [blame^] | 30 | void reset_cpu(void) |
developer | b73d795 | 2020-01-10 16:30:26 +0800 | [diff] [blame] | 31 | { |
| 32 | psci_system_reset(); |
| 33 | } |
| 34 | |
| 35 | static struct mm_region mt7622_mem_map[] = { |
| 36 | { |
| 37 | /* DDR */ |
| 38 | .virt = 0x40000000UL, |
| 39 | .phys = 0x40000000UL, |
| 40 | .size = 0x40000000UL, |
| 41 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE, |
| 42 | }, { |
| 43 | .virt = 0x00000000UL, |
| 44 | .phys = 0x00000000UL, |
| 45 | .size = 0x40000000UL, |
| 46 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| 47 | PTE_BLOCK_NON_SHARE | |
| 48 | PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| 49 | }, { |
| 50 | 0, |
| 51 | } |
| 52 | }; |
| 53 | struct mm_region *mem_map = mt7622_mem_map; |