blob: 6a8a7d2c1655a923fd45d5101e491d7b8eedc269 [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.
Daisuke Nojiria6712f32015-01-23 10:06:19 -080014 */
15
Daisuke Nojirie5d59422015-02-17 13:43:35 -080016#include <arch/cache.h>
Daisuke Nojiria6712f32015-01-23 10:06:19 -080017#include <bootblock_common.h>
Daisuke Nojirie5d59422015-02-17 13:43:35 -080018#include <stddef.h>
19#include <symbols.h>
Corneliu Dobanbcdbdc62015-04-02 16:19:18 -070020#include <soc/hw_init.h>
Daisuke Nojiria6712f32015-01-23 10:06:19 -080021
22void bootblock_soc_init(void)
23{
24 /*
Daisuke Nojirie5d59422015-02-17 13:43:35 -080025 * not only for speed but for preventing the cpu from crashing.
26 * the cpu is not happy when cache is cleaned without mmu turned on.
Daisuke Nojiria6712f32015-01-23 10:06:19 -080027 */
Daisuke Nojirie5d59422015-02-17 13:43:35 -080028 mmu_init();
29 mmu_config_range(0, 4096, DCACHE_OFF);
30 mmu_config_range_kb((uintptr_t)_sram/KiB, _sram_size/KiB,
31 DCACHE_WRITETHROUGH);
32 dcache_mmu_enable();
Corneliu Dobanbcdbdc62015-04-02 16:19:18 -070033
34 hw_init();
Daisuke Nojiria6712f32015-01-23 10:06:19 -080035}