Aaron Durbin | bc3019c | 2014-07-15 10:53:29 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2014 Google 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. |
Aaron Durbin | bc3019c | 2014-07-15 10:53:29 -0500 | [diff] [blame] | 14 | */ |
| 15 | |
Aaron Durbin | bc3019c | 2014-07-15 10:53:29 -0500 | [diff] [blame] | 16 | #include <arch/stages.h> |
Julius Werner | 7dcf9d5 | 2015-10-16 13:10:02 -0700 | [diff] [blame] | 17 | #include <gic.h> |
Aaron Durbin | bc3019c | 2014-07-15 10:53:29 -0500 | [diff] [blame] | 18 | #include <soc/addressmap.h> |
Jimmy Zhang | aa228d0 | 2014-07-23 17:42:45 -0700 | [diff] [blame] | 19 | #include <soc/clock.h> |
Furquan Shaikh | fdb3a8d | 2015-10-15 15:50:30 -0700 | [diff] [blame] | 20 | #include <soc/mc.h> |
Julius Werner | 96195ee | 2014-10-20 13:25:21 -0700 | [diff] [blame] | 21 | #include <soc/mmu_operations.h> |
Aaron Durbin | bc3019c | 2014-07-15 10:53:29 -0500 | [diff] [blame] | 22 | |
Furquan Shaikh | fdb3a8d | 2015-10-15 15:50:30 -0700 | [diff] [blame] | 23 | static void lock_down_vpr(void) |
| 24 | { |
| 25 | struct tegra_mc_regs *regs = (void *)(uintptr_t)TEGRA_MC_BASE; |
| 26 | |
| 27 | write32(®s->video_protect_bom, 0); |
| 28 | write32(®s->video_protect_size_mb, 0); |
| 29 | write32(®s->video_protect_reg_ctrl, 1); |
| 30 | } |
| 31 | |
Julius Werner | 7dcf9d5 | 2015-10-16 13:10:02 -0700 | [diff] [blame] | 32 | /* Tegra-specific entry point, called from assembly in stage_entry.S */ |
| 33 | void ramstage_entry(void); |
| 34 | void ramstage_entry(void) |
Aaron Durbin | bc3019c | 2014-07-15 10:53:29 -0500 | [diff] [blame] | 35 | { |
Julius Werner | 7dcf9d5 | 2015-10-16 13:10:02 -0700 | [diff] [blame] | 36 | /* TODO: Is this still needed? */ |
| 37 | gic_init(); |
| 38 | |
| 39 | /* TODO: Move TrustZone setup to BL31? */ |
Aaron Durbin | 7ddb5f7 | 2014-07-21 14:24:42 -0500 | [diff] [blame] | 40 | trustzone_region_init(); |
Furquan Shaikh | da9b9f3 | 2014-07-17 11:42:35 -0700 | [diff] [blame] | 41 | |
| 42 | tegra132_mmu_init(); |
Jimmy Zhang | aa228d0 | 2014-07-23 17:42:45 -0700 | [diff] [blame] | 43 | |
| 44 | clock_cpu0_config(); |
Furquan Shaikh | fdb3a8d | 2015-10-15 15:50:30 -0700 | [diff] [blame] | 45 | |
| 46 | clock_init_arm_generic_timer(); |
| 47 | |
| 48 | /* Lock down VPR */ |
| 49 | lock_down_vpr(); |
Julius Werner | 7dcf9d5 | 2015-10-16 13:10:02 -0700 | [diff] [blame] | 50 | |
| 51 | /* Jump to boot state machine in common code. */ |
| 52 | main(); |
Aaron Durbin | bc3019c | 2014-07-15 10:53:29 -0500 | [diff] [blame] | 53 | } |