| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <device/mmio.h> |
| 4 | #include <bootblock_common.h> |
| 5 | #include <soc/grf.h> |
| 6 | #include <soc/mmu_operations.h> |
| 7 | #include <soc/clock.h> |
| 8 | |
| 9 | void bootblock_soc_init(void) |
| 10 | { |
| 11 | rkclk_init(); |
| 12 | |
| 13 | /* all ddr range non-secure */ |
| 14 | write32(&rk3399_pmusgrf->ddr_rgn_con[16], 0xff << 16 | 0); |
| 15 | |
| 16 | /* tzma_rosize = 0, all sram non-secure */ |
| 17 | write32(&rk3399_pmusgrf->soc_con4, 0x3ff << 16 | 0); |
| 18 | |
| 19 | /* emmc master secure */ |
| 20 | write32(&rk3399_pmusgrf->soc_con7, 1 << 23 | 1 << 24 | 0 << 8 | 0 << 7); |
| 21 | |
| 22 | /* glb_slv_secure_bypass */ |
| 23 | write32(&rk3399_pmusgrf->pmu_slv_con0, 1 << 16 | 1); |
| 24 | } |