2012-10-25 16:41:39 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Pavel Machek <pavel@denx.de>
|
2015-06-05 13:24:52 +00:00
|
|
|
* Copyright (C) 2012-2015 Altera Corporation
|
2012-10-25 16:41:39 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MACH_CORE_H
|
|
|
|
#define __MACH_CORE_H
|
|
|
|
|
2013-04-11 15:55:24 +00:00
|
|
|
#define SOCFPGA_RSTMGR_CTRL 0x04
|
2014-10-14 19:33:38 +00:00
|
|
|
#define SOCFPGA_RSTMGR_MODMPURST 0x10
|
2013-04-11 15:55:24 +00:00
|
|
|
#define SOCFPGA_RSTMGR_MODPERRST 0x14
|
|
|
|
#define SOCFPGA_RSTMGR_BRGMODRST 0x1c
|
|
|
|
|
2015-07-20 16:23:13 +00:00
|
|
|
#define SOCFPGA_A10_RSTMGR_CTRL 0xC
|
2015-06-03 02:14:02 +00:00
|
|
|
#define SOCFPGA_A10_RSTMGR_MODMPURST 0x20
|
|
|
|
|
2013-04-11 15:55:24 +00:00
|
|
|
/* System Manager bits */
|
|
|
|
#define RSTMGR_CTRL_SWCOLDRSTREQ 0x1 /* Cold Reset */
|
|
|
|
#define RSTMGR_CTRL_SWWARMRSTREQ 0x2 /* Warm Reset */
|
|
|
|
|
2014-10-14 19:33:38 +00:00
|
|
|
#define RSTMGR_MPUMODRST_CPU1 0x2 /* CPU1 Reset */
|
|
|
|
|
2012-10-25 16:41:39 +00:00
|
|
|
extern void socfpga_init_clocks(void);
|
|
|
|
extern void socfpga_sysmgr_init(void);
|
2016-02-10 19:26:23 +00:00
|
|
|
void socfpga_init_l2_ecc(void);
|
2012-10-25 16:41:39 +00:00
|
|
|
|
2013-04-11 15:55:24 +00:00
|
|
|
extern void __iomem *sys_manager_base_addr;
|
|
|
|
extern void __iomem *rst_manager_base_addr;
|
2015-06-05 13:24:52 +00: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 15:55:24 +00:00
|
|
|
|
2012-10-25 16:41:39 +00: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 10:44:48 +00:00
|
|
|
extern unsigned long socfpga_cpu1start_addr;
|
2013-02-11 23:30:33 +00:00
|
|
|
|
2015-02-11 18:34:25 +00:00
|
|
|
#define SOCFPGA_SCU_VIRT_BASE 0xfee00000
|
2012-10-25 16:41:39 +00:00
|
|
|
|
|
|
|
#endif
|