Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Minkyu Kang | b1b2468 | 2011-01-24 15:22:23 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2010 Samsung Electronics. |
| 4 | * Minkyu Kang <mk7.kang@samsung.com> |
Minkyu Kang | b1b2468 | 2011-01-24 15:22:23 +0900 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Simon Glass | 1d91ba7 | 2019-11-14 12:57:37 -0700 | [diff] [blame] | 8 | #include <cpu_func.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 9 | #include <asm/cache.h> |
Minkyu Kang | b1b2468 | 2011-01-24 15:22:23 +0900 | [diff] [blame] | 10 | #include <asm/io.h> |
Rajeshwari Shinde | 10cb7fa | 2012-11-29 20:29:35 +0000 | [diff] [blame] | 11 | #include <asm/system.h> |
Sam Protsenko | eb16431 | 2023-10-20 16:46:31 -0500 | [diff] [blame] | 12 | #include <asm/arch/cpu.h> |
Rajeshwari Shinde | 10cb7fa | 2012-11-29 20:29:35 +0000 | [diff] [blame] | 13 | |
Thomas Abraham | f1855fc | 2016-11-16 18:49:16 +0530 | [diff] [blame] | 14 | #ifdef CONFIG_TARGET_ESPRESSO7420 |
| 15 | /* |
| 16 | * Exynos7420 uses CPU0 of Cluster-1 as boot CPU. Due to this, branch_if_master |
| 17 | * fails to identify as the boot CPU as the master CPU. As temporary workaround, |
| 18 | * setup the slave CPU boot address as "_main". |
| 19 | */ |
| 20 | extern void _main(void); |
| 21 | void *secondary_boot_addr = (void *)_main; |
| 22 | #endif /* CONFIG_TARGET_ESPRESSO7420 */ |
| 23 | |
Sam Protsenko | 07707fa | 2023-10-30 11:55:02 -0500 | [diff] [blame] | 24 | #if !CONFIG_IS_ENABLED(SYSRESET) |
Harald Seiler | 6f14d5f | 2020-12-15 16:47:52 +0100 | [diff] [blame] | 25 | void reset_cpu(void) |
Minkyu Kang | b1b2468 | 2011-01-24 15:22:23 +0900 | [diff] [blame] | 26 | { |
Lokesh Vutla | 81b1a67 | 2018-04-26 18:21:26 +0530 | [diff] [blame] | 27 | #ifdef CONFIG_CPU_V7A |
Minkyu Kang | b1b2468 | 2011-01-24 15:22:23 +0900 | [diff] [blame] | 28 | writel(0x1, samsung_get_base_swreset()); |
Thomas Abraham | a99ad39 | 2016-04-23 22:18:12 +0530 | [diff] [blame] | 29 | #endif |
Minkyu Kang | b1b2468 | 2011-01-24 15:22:23 +0900 | [diff] [blame] | 30 | } |
Sam Protsenko | 07707fa | 2023-10-30 11:55:02 -0500 | [diff] [blame] | 31 | #endif |
Łukasz Majewski | e667e76 | 2012-08-07 03:24:03 +0000 | [diff] [blame] | 32 | |
Trevor Woerner | 43ec7e0 | 2019-05-03 09:41:00 -0400 | [diff] [blame] | 33 | #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) |
Łukasz Majewski | e667e76 | 2012-08-07 03:24:03 +0000 | [diff] [blame] | 34 | void enable_caches(void) |
| 35 | { |
| 36 | /* Enable D-cache. I-cache is already enabled in start.S */ |
| 37 | dcache_enable(); |
| 38 | } |
| 39 | #endif |