blob: be18f181a7aac67de9c833bbc8b2e5a10985df5e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Minkyu Kangb1b24682011-01-24 15:22:23 +09002/*
3 * Copyright (c) 2010 Samsung Electronics.
4 * Minkyu Kang <mk7.kang@samsung.com>
Minkyu Kangb1b24682011-01-24 15:22:23 +09005 */
6
Simon Glass1d91ba72019-11-14 12:57:37 -07007#include <cpu_func.h>
Simon Glass274e0b02020-05-10 11:39:56 -06008#include <asm/cache.h>
Minkyu Kangb1b24682011-01-24 15:22:23 +09009#include <asm/io.h>
Rajeshwari Shinde10cb7fa2012-11-29 20:29:35 +000010#include <asm/system.h>
Sam Protsenkoeb164312023-10-20 16:46:31 -050011#include <asm/arch/cpu.h>
Rajeshwari Shinde10cb7fa2012-11-29 20:29:35 +000012
Thomas Abrahamf1855fc2016-11-16 18:49:16 +053013#ifdef CONFIG_TARGET_ESPRESSO7420
14/*
15 * Exynos7420 uses CPU0 of Cluster-1 as boot CPU. Due to this, branch_if_master
16 * fails to identify as the boot CPU as the master CPU. As temporary workaround,
17 * setup the slave CPU boot address as "_main".
18 */
19extern void _main(void);
20void *secondary_boot_addr = (void *)_main;
21#endif /* CONFIG_TARGET_ESPRESSO7420 */
22
Sam Protsenko07707fa2023-10-30 11:55:02 -050023#if !CONFIG_IS_ENABLED(SYSRESET)
Harald Seiler6f14d5f2020-12-15 16:47:52 +010024void reset_cpu(void)
Minkyu Kangb1b24682011-01-24 15:22:23 +090025{
Lokesh Vutla81b1a672018-04-26 18:21:26 +053026#ifdef CONFIG_CPU_V7A
Minkyu Kangb1b24682011-01-24 15:22:23 +090027 writel(0x1, samsung_get_base_swreset());
Thomas Abrahama99ad392016-04-23 22:18:12 +053028#endif
Minkyu Kangb1b24682011-01-24 15:22:23 +090029}
Sam Protsenko07707fa2023-10-30 11:55:02 -050030#endif
Łukasz Majewskie667e762012-08-07 03:24:03 +000031
Trevor Woerner43ec7e02019-05-03 09:41:00 -040032#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
Łukasz Majewskie667e762012-08-07 03:24:03 +000033void enable_caches(void)
34{
35 /* Enable D-cache. I-cache is already enabled in start.S */
36 dcache_enable();
37}
38#endif