2019-05-27 13:55:05 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-10-25 23:41:39 +07:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Pavel Machek <pavel@denx.de>
|
2015-06-05 20:24:52 +07:00
|
|
|
* Copyright (C) 2012-2015 Altera Corporation
|
2012-10-25 23:41:39 +07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MACH_CORE_H
|
|
|
|
#define __MACH_CORE_H
|
|
|
|
|
2013-04-11 22:55:24 +07:00
|
|
|
#define SOCFPGA_RSTMGR_CTRL 0x04
|
2014-10-15 02:33:38 +07:00
|
|
|
#define SOCFPGA_RSTMGR_MODMPURST 0x10
|
2013-04-11 22:55:24 +07:00
|
|
|
#define SOCFPGA_RSTMGR_MODPERRST 0x14
|
|
|
|
#define SOCFPGA_RSTMGR_BRGMODRST 0x1c
|
|
|
|
|
2015-07-20 23:23:13 +07:00
|
|
|
#define SOCFPGA_A10_RSTMGR_CTRL 0xC
|
2015-06-03 09:14:02 +07:00
|
|
|
#define SOCFPGA_A10_RSTMGR_MODMPURST 0x20
|
|
|
|
|
2013-04-11 22:55:24 +07:00
|
|
|
/* System Manager bits */
|
|
|
|
#define RSTMGR_CTRL_SWCOLDRSTREQ 0x1 /* Cold Reset */
|
|
|
|
#define RSTMGR_CTRL_SWWARMRSTREQ 0x2 /* Warm Reset */
|
|
|
|
|
2014-10-15 02:33:38 +07:00
|
|
|
#define RSTMGR_MPUMODRST_CPU1 0x2 /* CPU1 Reset */
|
|
|
|
|
2016-02-11 02:26:23 +07:00
|
|
|
void socfpga_init_l2_ecc(void);
|
2016-02-11 02:26:24 +07:00
|
|
|
void socfpga_init_ocram_ecc(void);
|
2016-03-21 23:01:45 +07:00
|
|
|
void socfpga_init_arria10_l2_ecc(void);
|
2016-04-12 00:01:34 +07:00
|
|
|
void socfpga_init_arria10_ocram_ecc(void);
|
2012-10-25 23:41:39 +07:00
|
|
|
|
2013-04-11 22:55:24 +07:00
|
|
|
extern void __iomem *sys_manager_base_addr;
|
|
|
|
extern void __iomem *rst_manager_base_addr;
|
2015-06-05 20:24:52 +07:00
|
|
|
extern void __iomem *sdr_ctl_base_addr;
|
|
|
|
|
|
|
|
u32 socfpga_sdram_self_refresh(u32 sdr_base);
|
|
|
|
extern unsigned int socfpga_sdram_self_refresh_sz;
|
2013-04-11 22:55:24 +07:00
|
|
|
|
2012-10-25 23:41:39 +07:00
|
|
|
extern char secondary_trampoline, secondary_trampoline_end;
|
|
|
|
|
arm: socfpga: fix fetching cpu1start_addr for SMP
When CPU1 is brought out of reset, it's MMU is not turned on yet, so it will
only be able to use physical addresses. For systems with that have the
MMU page configured for 0xC0000000, 0x80000000, or 0x40000000
"BIC 0x40000000" will work just fine, as it was just converting the
virtual address of &cpu1start_addr into a physical address, ie. 0xC0000000
became 0x80000000. So for systems where the SDRAM controller was able to do a
wrap-around access, this was working fine, as it was just dropping the MSB,
but for systems where out of bounds memory access is not allowed, this would
not allow CPU1 to correctly fetch &cpu1start_addr.
This patch fixes the secondary_trampoline code to correctly fetch the
physical address of cpu1start_addr directly. The patch will subtract the
correct PAGE_OFFSET from &cpu1start_addr. And since on this platform, the
physical memory will always start at 0x0, subtracting PAGE_OFFSET from
&cpu1start_addr will allow CPU1 to correctly fetch the value of cpu1start_addr.
While at it, change the name of cpu1start_addr to socfpga_cpu1start_addr
to avoid any future naming collisions for multiplatform image.
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
v4: Updated commit log to correctly lay out the usage of PAGE_OFFSET and
add comments to the same effect.
v3: Used PAGE_OFFSET to get the physical address
v2: Correctly get the physical address instead of just a BIC hack.
2014-10-01 17:44:48 +07:00
|
|
|
extern unsigned long socfpga_cpu1start_addr;
|
2013-02-12 06:30:33 +07:00
|
|
|
|
2015-02-12 01:34:25 +07:00
|
|
|
#define SOCFPGA_SCU_VIRT_BASE 0xfee00000
|
2012-10-25 23:41:39 +07:00
|
|
|
|
|
|
|
#endif
|