2012-10-26 00:41:39 +08:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Pavel Machek <pavel@denx.de>
|
|
|
|
* Copyright (C) 2012 Altera Corporation
|
|
|
|
*
|
|
|
|
* 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 23:55:24 +08:00
|
|
|
#define SOCFPGA_RSTMGR_CTRL 0x04
|
2014-10-15 03:33:38 +08:00
|
|
|
#define SOCFPGA_RSTMGR_MODMPURST 0x10
|
2013-04-11 23:55:24 +08:00
|
|
|
#define SOCFPGA_RSTMGR_MODPERRST 0x14
|
|
|
|
#define SOCFPGA_RSTMGR_BRGMODRST 0x1c
|
|
|
|
|
|
|
|
/* System Manager bits */
|
|
|
|
#define RSTMGR_CTRL_SWCOLDRSTREQ 0x1 /* Cold Reset */
|
|
|
|
#define RSTMGR_CTRL_SWWARMRSTREQ 0x2 /* Warm Reset */
|
|
|
|
|
2014-10-15 03:33:38 +08:00
|
|
|
#define RSTMGR_MPUMODRST_CPU1 0x2 /* CPU1 Reset */
|
|
|
|
|
2013-02-12 07:30:33 +08:00
|
|
|
extern void socfpga_secondary_startup(void);
|
2012-10-26 00:41:39 +08:00
|
|
|
extern void __iomem *socfpga_scu_base_addr;
|
|
|
|
|
|
|
|
extern void socfpga_init_clocks(void);
|
|
|
|
extern void socfpga_sysmgr_init(void);
|
|
|
|
|
2013-04-11 23:55:24 +08:00
|
|
|
extern void __iomem *sys_manager_base_addr;
|
|
|
|
extern void __iomem *rst_manager_base_addr;
|
|
|
|
|
2012-10-26 00:41:39 +08:00
|
|
|
extern struct smp_operations socfpga_smp_ops;
|
|
|
|
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 18:44:48 +08:00
|
|
|
extern unsigned long socfpga_cpu1start_addr;
|
2013-02-12 07:30:33 +08:00
|
|
|
|
2012-10-26 00:41:39 +08:00
|
|
|
#define SOCFPGA_SCU_VIRT_BASE 0xfffec000
|
|
|
|
|
|
|
|
#endif
|