2005-10-31 22:25:02 +08:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-realview/core.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 - 2003 ARM Limited
|
|
|
|
* Copyright (C) 2000 Deep Blue Solutions Ltd
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
2005-11-01 00:57:06 +08:00
|
|
|
#include <linux/platform_device.h>
|
2005-10-31 22:25:02 +08:00
|
|
|
#include <linux/dma-mapping.h>
|
2011-12-22 08:26:03 +08:00
|
|
|
#include <linux/device.h>
|
2005-10-31 22:25:02 +08:00
|
|
|
#include <linux/interrupt.h>
|
2006-01-07 21:52:45 +08:00
|
|
|
#include <linux/amba/bus.h>
|
|
|
|
#include <linux/amba/clcd.h>
|
2008-09-06 19:10:45 +08:00
|
|
|
#include <linux/io.h>
|
2009-01-20 21:23:30 +08:00
|
|
|
#include <linux/smsc911x.h>
|
2009-02-12 22:59:21 +08:00
|
|
|
#include <linux/ata_platform.h>
|
2009-09-22 21:29:36 +08:00
|
|
|
#include <linux/amba/mmci.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 16:04:11 +08:00
|
|
|
#include <linux/gfp.h>
|
2011-05-18 17:51:49 +08:00
|
|
|
#include <linux/mtd/physmap.h>
|
2005-10-31 22:25:02 +08:00
|
|
|
|
2008-08-05 23:14:15 +08:00
|
|
|
#include <mach/hardware.h>
|
2005-10-31 22:25:02 +08:00
|
|
|
#include <asm/irq.h>
|
2008-11-10 22:10:11 +08:00
|
|
|
#include <asm/mach-types.h>
|
2005-10-31 22:25:02 +08:00
|
|
|
#include <asm/hardware/arm_timer.h>
|
2010-01-17 04:16:10 +08:00
|
|
|
#include <asm/hardware/icst.h>
|
2005-10-31 22:25:02 +08:00
|
|
|
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/irq.h>
|
|
|
|
#include <asm/mach/map.h>
|
|
|
|
|
|
|
|
|
2009-05-30 21:00:17 +08:00
|
|
|
#include <mach/platform.h>
|
|
|
|
#include <mach/irqs.h>
|
2010-10-06 23:18:08 +08:00
|
|
|
#include <asm/hardware/timer-sp.h>
|
2009-05-30 21:00:17 +08:00
|
|
|
|
2011-01-19 04:13:20 +08:00
|
|
|
#include <plat/clcd.h>
|
2010-12-16 05:56:47 +08:00
|
|
|
#include <plat/sched_clock.h>
|
|
|
|
|
2005-10-31 22:25:02 +08:00
|
|
|
#include "core.h"
|
|
|
|
|
|
|
|
#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
|
|
|
|
|
2011-05-18 17:51:55 +08:00
|
|
|
static void realview_flash_set_vpp(struct platform_device *pdev, int on)
|
2005-10-31 22:25:02 +08:00
|
|
|
{
|
|
|
|
u32 val;
|
|
|
|
|
|
|
|
val = __raw_readl(REALVIEW_FLASHCTRL);
|
|
|
|
if (on)
|
|
|
|
val |= REALVIEW_FLASHPROG_FLVPPEN;
|
|
|
|
else
|
|
|
|
val &= ~REALVIEW_FLASHPROG_FLVPPEN;
|
|
|
|
__raw_writel(val, REALVIEW_FLASHCTRL);
|
|
|
|
}
|
|
|
|
|
2011-05-18 17:51:49 +08:00
|
|
|
static struct physmap_flash_data realview_flash_data = {
|
2005-10-31 22:25:02 +08:00
|
|
|
.width = 4,
|
|
|
|
.set_vpp = realview_flash_set_vpp,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct platform_device realview_flash_device = {
|
2011-05-18 17:51:49 +08:00
|
|
|
.name = "physmap-flash",
|
2005-10-31 22:25:02 +08:00
|
|
|
.id = 0,
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &realview_flash_data,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2008-04-19 05:43:10 +08:00
|
|
|
int realview_flash_register(struct resource *res, u32 num)
|
|
|
|
{
|
|
|
|
realview_flash_device.resource = res;
|
|
|
|
realview_flash_device.num_resources = num;
|
|
|
|
return platform_device_register(&realview_flash_device);
|
|
|
|
}
|
|
|
|
|
2009-01-20 21:23:30 +08:00
|
|
|
static struct smsc911x_platform_config smsc911x_config = {
|
|
|
|
.flags = SMSC911X_USE_32BIT,
|
|
|
|
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
|
|
|
|
.irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
|
|
|
|
.phy_interface = PHY_INTERFACE_MODE_MII,
|
2008-12-01 22:54:59 +08:00
|
|
|
};
|
|
|
|
|
2008-12-01 22:54:58 +08:00
|
|
|
static struct platform_device realview_eth_device = {
|
2009-01-20 21:23:30 +08:00
|
|
|
.name = "smsc911x",
|
2008-12-01 22:54:58 +08:00
|
|
|
.id = 0,
|
|
|
|
.num_resources = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
int realview_eth_register(const char *name, struct resource *res)
|
|
|
|
{
|
|
|
|
if (name)
|
|
|
|
realview_eth_device.name = name;
|
|
|
|
realview_eth_device.resource = res;
|
2009-01-20 21:23:30 +08:00
|
|
|
if (strcmp(realview_eth_device.name, "smsc911x") == 0)
|
|
|
|
realview_eth_device.dev.platform_data = &smsc911x_config;
|
2008-12-01 22:54:58 +08:00
|
|
|
|
|
|
|
return platform_device_register(&realview_eth_device);
|
2009-02-12 23:00:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
struct platform_device realview_usb_device = {
|
|
|
|
.name = "isp1760",
|
|
|
|
.num_resources = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
int realview_usb_register(struct resource *res)
|
|
|
|
{
|
|
|
|
realview_usb_device.resource = res;
|
|
|
|
return platform_device_register(&realview_usb_device);
|
2008-12-01 22:54:58 +08:00
|
|
|
}
|
|
|
|
|
2009-02-12 22:59:21 +08:00
|
|
|
static struct pata_platform_info pata_platform_data = {
|
|
|
|
.ioport_shift = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource pata_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = REALVIEW_CF_BASE,
|
|
|
|
.end = REALVIEW_CF_BASE + 0xff,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = REALVIEW_CF_BASE + 0x100,
|
|
|
|
.end = REALVIEW_CF_BASE + SZ_4K - 1,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
struct platform_device realview_cf_device = {
|
|
|
|
.name = "pata_platform",
|
|
|
|
.id = -1,
|
|
|
|
.num_resources = ARRAY_SIZE(pata_resources),
|
|
|
|
.resource = pata_resources,
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &pata_platform_data,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2006-12-11 04:21:32 +08:00
|
|
|
static struct resource realview_i2c_resource = {
|
|
|
|
.start = REALVIEW_I2C_BASE,
|
|
|
|
.end = REALVIEW_I2C_BASE + SZ_4K - 1,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct platform_device realview_i2c_device = {
|
|
|
|
.name = "versatile-i2c",
|
2009-02-12 22:58:20 +08:00
|
|
|
.id = 0,
|
2006-12-11 04:21:32 +08:00
|
|
|
.num_resources = 1,
|
|
|
|
.resource = &realview_i2c_resource,
|
|
|
|
};
|
|
|
|
|
2009-02-12 22:58:20 +08:00
|
|
|
static struct i2c_board_info realview_i2c_board_info[] = {
|
|
|
|
{
|
2009-07-18 22:51:55 +08:00
|
|
|
I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
|
2009-02-12 22:58:20 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init realview_i2c_init(void)
|
|
|
|
{
|
|
|
|
return i2c_register_board_info(0, realview_i2c_board_info,
|
|
|
|
ARRAY_SIZE(realview_i2c_board_info));
|
|
|
|
}
|
|
|
|
arch_initcall(realview_i2c_init);
|
|
|
|
|
2005-10-31 22:25:02 +08:00
|
|
|
#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)
|
|
|
|
|
2009-07-09 22:17:41 +08:00
|
|
|
/*
|
|
|
|
* This is only used if GPIOLIB support is disabled
|
|
|
|
*/
|
2005-10-31 22:25:02 +08:00
|
|
|
static unsigned int realview_mmc_status(struct device *dev)
|
|
|
|
{
|
|
|
|
struct amba_device *adev = container_of(dev, struct amba_device, dev);
|
|
|
|
u32 mask;
|
|
|
|
|
2010-07-02 17:24:03 +08:00
|
|
|
if (machine_is_realview_pb1176()) {
|
|
|
|
static bool inserted = false;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The PB1176 does not have the status register,
|
|
|
|
* assume it is inserted at startup, then invert
|
|
|
|
* for each call so card insertion/removal will
|
|
|
|
* be detected anyway. This will not be called if
|
|
|
|
* GPIO on PL061 is active, which is the proper
|
|
|
|
* way to do this on the PB1176.
|
|
|
|
*/
|
|
|
|
inserted = !inserted;
|
|
|
|
return inserted ? 0 : 1;
|
|
|
|
}
|
|
|
|
|
2005-10-31 22:25:02 +08:00
|
|
|
if (adev->res.start == REALVIEW_MMCI0_BASE)
|
|
|
|
mask = 1;
|
|
|
|
else
|
|
|
|
mask = 2;
|
|
|
|
|
2010-07-29 22:58:59 +08:00
|
|
|
return readl(REALVIEW_SYSMCI) & mask;
|
2005-10-31 22:25:02 +08:00
|
|
|
}
|
|
|
|
|
2009-09-22 21:29:36 +08:00
|
|
|
struct mmci_platform_data realview_mmc0_plat_data = {
|
2005-10-31 22:25:02 +08:00
|
|
|
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
|
|
|
.status = realview_mmc_status,
|
2009-07-09 22:17:41 +08:00
|
|
|
.gpio_wp = 17,
|
|
|
|
.gpio_cd = 16,
|
2010-08-09 19:54:43 +08:00
|
|
|
.cd_invert = true,
|
2005-10-31 22:25:02 +08:00
|
|
|
};
|
|
|
|
|
2009-09-22 21:29:36 +08:00
|
|
|
struct mmci_platform_data realview_mmc1_plat_data = {
|
2005-10-31 22:25:02 +08:00
|
|
|
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
|
|
|
.status = realview_mmc_status,
|
2009-07-09 22:17:41 +08:00
|
|
|
.gpio_wp = 19,
|
|
|
|
.gpio_cd = 18,
|
2010-08-09 19:54:43 +08:00
|
|
|
.cd_invert = true,
|
2005-10-31 22:25:02 +08:00
|
|
|
};
|
|
|
|
|
2011-01-11 21:05:01 +08:00
|
|
|
void __init realview_init_early(void)
|
2008-11-09 04:05:55 +08:00
|
|
|
{
|
2011-01-11 21:05:01 +08:00
|
|
|
void __iomem *sys = __io_address(REALVIEW_SYS_BASE);
|
|
|
|
|
|
|
|
versatile_sched_clock_init(sys + REALVIEW_SYS_24MHz_OFFSET, 24000000);
|
2008-11-09 04:05:55 +08:00
|
|
|
}
|
|
|
|
|
2005-10-31 22:25:02 +08:00
|
|
|
/*
|
|
|
|
* CLCD support.
|
|
|
|
*/
|
|
|
|
#define SYS_CLCD_NLCDIOON (1 << 2)
|
|
|
|
#define SYS_CLCD_VDDPOSSWITCH (1 << 3)
|
|
|
|
#define SYS_CLCD_PWR3V5SWITCH (1 << 4)
|
|
|
|
#define SYS_CLCD_ID_MASK (0x1f << 8)
|
|
|
|
#define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8)
|
|
|
|
#define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8)
|
|
|
|
#define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8)
|
|
|
|
#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
|
|
|
|
#define SYS_CLCD_ID_VGA (0x1f << 8)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Disable all display connectors on the interface module.
|
|
|
|
*/
|
|
|
|
static void realview_clcd_disable(struct clcd_fb *fb)
|
|
|
|
{
|
|
|
|
void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
|
|
|
|
u32 val;
|
|
|
|
|
|
|
|
val = readl(sys_clcd);
|
|
|
|
val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
|
|
|
|
writel(val, sys_clcd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable the relevant connector on the interface module.
|
|
|
|
*/
|
|
|
|
static void realview_clcd_enable(struct clcd_fb *fb)
|
|
|
|
{
|
|
|
|
void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
|
|
|
|
u32 val;
|
|
|
|
|
|
|
|
/*
|
2006-03-16 22:10:20 +08:00
|
|
|
* Enable the PSUs
|
2005-10-31 22:25:02 +08:00
|
|
|
*/
|
2006-03-16 22:10:20 +08:00
|
|
|
val = readl(sys_clcd);
|
2005-10-31 22:25:02 +08:00
|
|
|
val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
|
|
|
|
writel(val, sys_clcd);
|
|
|
|
}
|
|
|
|
|
2011-01-19 04:13:20 +08:00
|
|
|
/*
|
|
|
|
* Detect which LCD panel is connected, and return the appropriate
|
|
|
|
* clcd_panel structure. Note: we do not have any information on
|
|
|
|
* the required timings for the 8.4in panel, so we presently assume
|
|
|
|
* VGA timings.
|
|
|
|
*/
|
2005-10-31 22:25:02 +08:00
|
|
|
static int realview_clcd_setup(struct clcd_fb *fb)
|
|
|
|
{
|
2011-01-19 04:13:20 +08:00
|
|
|
void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
|
|
|
|
const char *panel_name, *vga_panel_name;
|
2008-11-10 22:10:12 +08:00
|
|
|
unsigned long framesize;
|
2011-01-19 04:13:20 +08:00
|
|
|
u32 val;
|
2005-10-31 22:25:02 +08:00
|
|
|
|
2011-01-19 04:13:20 +08:00
|
|
|
if (machine_is_realview_eb()) {
|
2008-11-10 22:10:12 +08:00
|
|
|
/* VGA, 16bpp */
|
|
|
|
framesize = 640 * 480 * 2;
|
2011-01-19 04:13:20 +08:00
|
|
|
vga_panel_name = "VGA";
|
|
|
|
} else {
|
2008-11-10 22:10:12 +08:00
|
|
|
/* XVGA, 16bpp */
|
|
|
|
framesize = 1024 * 768 * 2;
|
2011-01-19 04:13:20 +08:00
|
|
|
vga_panel_name = "XVGA";
|
2005-10-31 22:25:02 +08:00
|
|
|
}
|
|
|
|
|
2011-01-19 04:13:20 +08:00
|
|
|
val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
|
|
|
|
if (val == SYS_CLCD_ID_SANYO_3_8)
|
|
|
|
panel_name = "Sanyo TM38QV67A02A";
|
|
|
|
else if (val == SYS_CLCD_ID_SANYO_2_5)
|
|
|
|
panel_name = "Sanyo QVGA Portrait";
|
|
|
|
else if (val == SYS_CLCD_ID_EPSON_2_2)
|
|
|
|
panel_name = "Epson L2F50113T00";
|
|
|
|
else if (val == SYS_CLCD_ID_VGA)
|
|
|
|
panel_name = vga_panel_name;
|
|
|
|
else {
|
|
|
|
pr_err("CLCD: unknown LCD panel ID 0x%08x, using VGA\n", val);
|
|
|
|
panel_name = vga_panel_name;
|
|
|
|
}
|
2005-10-31 22:25:02 +08:00
|
|
|
|
2011-01-19 04:13:20 +08:00
|
|
|
fb->panel = versatile_clcd_get_panel(panel_name);
|
|
|
|
if (!fb->panel)
|
|
|
|
return -EINVAL;
|
2005-10-31 22:25:02 +08:00
|
|
|
|
2011-01-19 04:13:20 +08:00
|
|
|
return versatile_clcd_setup_dma(fb, framesize);
|
2005-10-31 22:25:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
struct clcd_board clcd_plat_data = {
|
|
|
|
.name = "RealView",
|
2011-01-19 04:13:20 +08:00
|
|
|
.caps = CLCD_CAP_ALL,
|
2005-10-31 22:25:02 +08:00
|
|
|
.check = clcdfb_check,
|
|
|
|
.decode = clcdfb_decode,
|
|
|
|
.disable = realview_clcd_disable,
|
|
|
|
.enable = realview_clcd_enable,
|
|
|
|
.setup = realview_clcd_setup,
|
2011-01-19 04:13:20 +08:00
|
|
|
.mmap = versatile_clcd_mmap_dma,
|
|
|
|
.remove = versatile_clcd_remove_dma,
|
2005-10-31 22:25:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Where is the timer (VA)?
|
|
|
|
*/
|
2008-04-19 05:43:11 +08:00
|
|
|
void __iomem *timer0_va_base;
|
|
|
|
void __iomem *timer1_va_base;
|
|
|
|
void __iomem *timer2_va_base;
|
|
|
|
void __iomem *timer3_va_base;
|
2005-10-31 22:25:02 +08:00
|
|
|
|
|
|
|
/*
|
2008-02-05 00:30:57 +08:00
|
|
|
* Set up the clock source and clock events devices
|
2005-10-31 22:25:02 +08:00
|
|
|
*/
|
2008-02-05 00:43:02 +08:00
|
|
|
void __init realview_timer_init(unsigned int timer_irq)
|
2005-10-31 22:25:02 +08:00
|
|
|
{
|
|
|
|
u32 val;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* set clock frequency:
|
|
|
|
* REALVIEW_REFCLK is 32KHz
|
|
|
|
* REALVIEW_TIMCLK is 1MHz
|
|
|
|
*/
|
|
|
|
val = readl(__io_address(REALVIEW_SCTL_BASE));
|
|
|
|
writel((REALVIEW_TIMCLK << REALVIEW_TIMER1_EnSel) |
|
|
|
|
(REALVIEW_TIMCLK << REALVIEW_TIMER2_EnSel) |
|
|
|
|
(REALVIEW_TIMCLK << REALVIEW_TIMER3_EnSel) |
|
|
|
|
(REALVIEW_TIMCLK << REALVIEW_TIMER4_EnSel) | val,
|
|
|
|
__io_address(REALVIEW_SCTL_BASE));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialise to a known state (all timers off)
|
|
|
|
*/
|
2008-04-19 05:43:11 +08:00
|
|
|
writel(0, timer0_va_base + TIMER_CTRL);
|
|
|
|
writel(0, timer1_va_base + TIMER_CTRL);
|
|
|
|
writel(0, timer2_va_base + TIMER_CTRL);
|
|
|
|
writel(0, timer3_va_base + TIMER_CTRL);
|
2005-10-31 22:25:02 +08:00
|
|
|
|
2011-05-12 19:08:23 +08:00
|
|
|
sp804_clocksource_init(timer3_va_base, "timer3");
|
2011-05-12 22:31:13 +08:00
|
|
|
sp804_clockevents_init(timer0_va_base, timer_irq, "timer0");
|
2005-10-31 22:25:02 +08:00
|
|
|
}
|
2009-11-04 20:19:04 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Setup the memory banks.
|
|
|
|
*/
|
ARM: platform fixups: remove mdesc argument to fixup function
Get rid of the mdesc pointer in the fixup function call. No one uses
the mdesc pointer, it shouldn't be modified anyway, and we can't wrap
it, so let's remove it.
Platform files found by:
$ regexp=$(git grep -h '\.fixup.*=' arch/arm |
sed 's!.*= *\([^,]*\),* *!\1!' | sort -u |
tr '\n' '|' | sed 's,|$,,;s,|,\\|,g')
$ git grep $regexp arch/arm
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-12-20 18:37:50 +08:00
|
|
|
void realview_fixup(struct tag *tags, char **from, struct meminfo *meminfo)
|
2009-11-04 20:19:04 +08:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Most RealView platforms have 512MB contiguous RAM at 0x70000000.
|
|
|
|
* Half of this is mirrored at 0.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
|
|
|
|
meminfo->bank[0].start = 0x70000000;
|
|
|
|
meminfo->bank[0].size = SZ_512M;
|
|
|
|
meminfo->nr_banks = 1;
|
|
|
|
#else
|
|
|
|
meminfo->bank[0].start = 0;
|
|
|
|
meminfo->bank[0].size = SZ_256M;
|
|
|
|
meminfo->nr_banks = 1;
|
|
|
|
#endif
|
|
|
|
}
|