blob: 3c853923aaf548174fbe8055f9976b4a8c13d669 [file] [log] [blame]
Daisuke Nojiria6712f32015-01-23 10:06:19 -08001/*
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
Daisuke Nojirie5d59422015-02-17 13:43:35 -080020#include <arch/cache.h>
Daisuke Nojiria6712f32015-01-23 10:06:19 -080021#include <bootblock_common.h>
Daisuke Nojirie5d59422015-02-17 13:43:35 -080022#include <stddef.h>
23#include <symbols.h>
Corneliu Dobanbcdbdc62015-04-02 16:19:18 -070024#include <soc/hw_init.h>
Daisuke Nojiria6712f32015-01-23 10:06:19 -080025
26void bootblock_soc_init(void)
27{
28 /*
Daisuke Nojirie5d59422015-02-17 13:43:35 -080029 * not only for speed but for preventing the cpu from crashing.
30 * the cpu is not happy when cache is cleaned without mmu turned on.
Daisuke Nojiria6712f32015-01-23 10:06:19 -080031 */
Daisuke Nojirie5d59422015-02-17 13:43:35 -080032 mmu_init();
33 mmu_config_range(0, 4096, DCACHE_OFF);
34 mmu_config_range_kb((uintptr_t)_sram/KiB, _sram_size/KiB,
35 DCACHE_WRITETHROUGH);
36 dcache_mmu_enable();
Corneliu Dobanbcdbdc62015-04-02 16:19:18 -070037
38 hw_init();
Daisuke Nojiria6712f32015-01-23 10:06:19 -080039}