Daisuke Nojiri | a6712f3 | 2015-01-23 10:06:19 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2015 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. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #include <arch/cache.h> |
| 21 | #include <arch/exception.h> |
| 22 | #include <arch/stages.h> |
| 23 | #include <armv7.h> |
| 24 | #include <cbfs.h> |
| 25 | #include <cbmem.h> |
| 26 | #include <console/console.h> |
| 27 | #include <delay.h> |
| 28 | #include <program_loading.h> |
| 29 | #include <soc/sdram.h> |
| 30 | #include <stdlib.h> |
| 31 | #include <symbols.h> |
| 32 | #include <timestamp.h> |
| 33 | #include <types.h> |
| 34 | #include <vendorcode/google/chromeos/chromeos.h> |
| 35 | |
| 36 | void main(void) |
| 37 | { |
Daisuke Nojiri | 73dd7b6 | 2015-03-04 11:01:36 -0800 | [diff] [blame^] | 38 | timestamp_add_now(TS_START_ROMSTAGE); |
Daisuke Nojiri | a6712f3 | 2015-01-23 10:06:19 -0800 | [diff] [blame] | 39 | |
| 40 | console_init(); |
| 41 | |
Daisuke Nojiri | 73dd7b6 | 2015-03-04 11:01:36 -0800 | [diff] [blame^] | 42 | timestamp_add_now(TS_BEFORE_INITRAM); |
Daisuke Nojiri | a6712f3 | 2015-01-23 10:06:19 -0800 | [diff] [blame] | 43 | sdram_init(); |
Daisuke Nojiri | 73dd7b6 | 2015-03-04 11:01:36 -0800 | [diff] [blame^] | 44 | timestamp_add_now(TS_AFTER_INITRAM); |
Daisuke Nojiri | a6712f3 | 2015-01-23 10:06:19 -0800 | [diff] [blame] | 45 | |
Daisuke Nojiri | 99d3956 | 2015-03-02 14:38:37 -0800 | [diff] [blame] | 46 | /* Now that DRAM is up, add mappings for it and DMA coherency buffer. */ |
| 47 | mmu_config_range((uintptr_t)_dram/MiB, |
| 48 | sdram_size_mb(), DCACHE_WRITEBACK); |
| 49 | mmu_config_range((uintptr_t)_dma_coherent/MiB, |
| 50 | _dma_coherent_size/MiB, DCACHE_OFF); |
Daisuke Nojiri | a6712f3 | 2015-01-23 10:06:19 -0800 | [diff] [blame] | 51 | |
| 52 | cbmem_initialize_empty(); |
| 53 | |
Daisuke Nojiri | a6712f3 | 2015-01-23 10:06:19 -0800 | [diff] [blame] | 54 | run_ramstage(); |
| 55 | } |