huang lin | c14b54d | 2016-03-02 18:38:40 +0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2016 Rockchip Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
huang lin | c14b54d | 2016-03-02 18:38:40 +0800 | [diff] [blame] | 14 | */ |
| 15 | |
Shunqian Zheng | 5dae930 | 2016-04-13 22:43:35 +0800 | [diff] [blame] | 16 | #include <arch/io.h> |
huang lin | c14b54d | 2016-03-02 18:38:40 +0800 | [diff] [blame] | 17 | #include <bootblock_common.h> |
Shunqian Zheng | 5dae930 | 2016-04-13 22:43:35 +0800 | [diff] [blame] | 18 | #include <soc/grf.h> |
Lin Huang | fe7aa20 | 2016-03-19 22:44:39 +0800 | [diff] [blame] | 19 | #include <soc/mmu_operations.h> |
Lin Huang | a1f82a3 | 2016-03-09 18:08:20 +0800 | [diff] [blame] | 20 | #include <soc/clock.h> |
huang lin | c14b54d | 2016-03-02 18:38:40 +0800 | [diff] [blame] | 21 | |
| 22 | void bootblock_soc_init(void) |
| 23 | { |
Lin Huang | a1f82a3 | 2016-03-09 18:08:20 +0800 | [diff] [blame] | 24 | rkclk_init(); |
Shunqian Zheng | 5dae930 | 2016-04-13 22:43:35 +0800 | [diff] [blame] | 25 | |
| 26 | /* all ddr range non-secure */ |
| 27 | write32(&rk3399_pmusgrf->ddr_rgn_con[16], 0xff << 16 | 0); |
| 28 | |
| 29 | /* tzma_rosize = 0, all sram non-secure */ |
| 30 | write32(&rk3399_pmusgrf->soc_con4, 0x3ff << 16 | 0); |
| 31 | |
| 32 | /* emmc master secure */ |
| 33 | write32(&rk3399_pmusgrf->soc_con7, 1 << 23 | 1 << 24 | 0 << 8 | 0 << 7); |
| 34 | |
| 35 | /* glb_slv_secure_bypass */ |
| 36 | write32(&rk3399_pmusgrf->pmu_slv_con0, 1 << 16 | 1); |
huang lin | c14b54d | 2016-03-02 18:38:40 +0800 | [diff] [blame] | 37 | } |