Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 Rockchip Electronics Co., Ltd |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <asm/armv8/mmu.h> |
Kever Yang | f3ea046 | 2016-10-07 15:56:16 +0800 | [diff] [blame] | 9 | #include <asm/io.h> |
| 10 | #include <asm/arch/hardware.h> |
| 11 | |
| 12 | #define GRF_EMMCCORE_CON11 0xff77f02c |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 13 | |
| 14 | static struct mm_region rk3399_mem_map[] = { |
| 15 | { |
| 16 | .virt = 0x0UL, |
| 17 | .phys = 0x0UL, |
Kever Yang | da77e49 | 2017-04-17 16:42:44 +0800 | [diff] [blame] | 18 | .size = 0xf8000000UL, |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 19 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | |
| 20 | PTE_BLOCK_INNER_SHARE |
| 21 | }, { |
Kever Yang | da77e49 | 2017-04-17 16:42:44 +0800 | [diff] [blame] | 22 | .virt = 0xf8000000UL, |
| 23 | .phys = 0xf8000000UL, |
| 24 | .size = 0x08000000UL, |
Kever Yang | 0d3d783 | 2016-07-19 21:16:59 +0800 | [diff] [blame] | 25 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| 26 | PTE_BLOCK_NON_SHARE | |
| 27 | PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| 28 | }, { |
| 29 | /* List terminator */ |
| 30 | 0, |
| 31 | } |
| 32 | }; |
| 33 | |
| 34 | struct mm_region *mem_map = rk3399_mem_map; |
Kever Yang | f3ea046 | 2016-10-07 15:56:16 +0800 | [diff] [blame] | 35 | |
| 36 | int arch_cpu_init(void) |
| 37 | { |
| 38 | /* We do some SoC one time setting here. */ |
| 39 | |
| 40 | /* Emmc clock generator: disable the clock multipilier */ |
| 41 | rk_clrreg(GRF_EMMCCORE_CON11, 0x0ff); |
| 42 | |
| 43 | return 0; |
| 44 | } |