mirror of
https://github.com/torvalds/linux.git
synced 2024-12-25 20:32:22 +00:00
0195c00244
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIVAwUAT3NKzROxKuMESys7AQKElw/+JyDxJSlj+g+nymkx8IVVuU8CsEwNLgRk 8KEnRfLhGtkXFLSJYWO6jzGo16F8Uqli1PdMFte/wagSv0285/HZaKlkkBVHdJ/m u40oSjgT013bBh6MQ0Oaf8pFezFUiQB5zPOA9QGaLVGDLXCmgqUgd7exaD5wRIwB ZmyItjZeAVnDfk1R+ZiNYytHAi8A5wSB+eFDCIQYgyulA1Igd1UnRtx+dRKbvc/m rWQ6KWbZHIdvP1ksd8wHHkrlUD2pEeJ8glJLsZUhMm/5oMf/8RmOCvmo8rvE/qwl eDQ1h4cGYlfjobxXZMHqAN9m7Jg2bI946HZjdb7/7oCeO6VW3FwPZ/Ic75p+wp45 HXJTItufERYk6QxShiOKvA+QexnYwY0IT5oRP4DrhdVB/X9cl2MoaZHC+RbYLQy+ /5VNZKi38iK4F9AbFamS7kd0i5QszA/ZzEzKZ6VMuOp3W/fagpn4ZJT1LIA3m4A9 Q0cj24mqeyCfjysu0TMbPtaN+Yjeu1o1OFRvM8XffbZsp5bNzuTDEvviJ2NXw4vK 4qUHulhYSEWcu9YgAZXvEWDEM78FXCkg2v/CrZXH5tyc95kUkMPcgG+QZBB5wElR FaOKpiC/BuNIGEf02IZQ4nfDxE90QwnDeoYeV+FvNj9UEOopJ5z5bMPoTHxm4cCD NypQthI85pc= =G9mT -----END PGP SIGNATURE----- Merge tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system Pull "Disintegrate and delete asm/system.h" from David Howells: "Here are a bunch of patches to disintegrate asm/system.h into a set of separate bits to relieve the problem of circular inclusion dependencies. I've built all the working defconfigs from all the arches that I can and made sure that they don't break. The reason for these patches is that I recently encountered a circular dependency problem that came about when I produced some patches to optimise get_order() by rewriting it to use ilog2(). This uses bitops - and on the SH arch asm/bitops.h drags in asm-generic/get_order.h by a circuituous route involving asm/system.h. The main difficulty seems to be asm/system.h. It holds a number of low level bits with no/few dependencies that are commonly used (eg. memory barriers) and a number of bits with more dependencies that aren't used in many places (eg. switch_to()). These patches break asm/system.h up into the following core pieces: (1) asm/barrier.h Move memory barriers here. This already done for MIPS and Alpha. (2) asm/switch_to.h Move switch_to() and related stuff here. (3) asm/exec.h Move arch_align_stack() here. Other process execution related bits could perhaps go here from asm/processor.h. (4) asm/cmpxchg.h Move xchg() and cmpxchg() here as they're full word atomic ops and frequently used by atomic_xchg() and atomic_cmpxchg(). (5) asm/bug.h Move die() and related bits. (6) asm/auxvec.h Move AT_VECTOR_SIZE_ARCH here. Other arch headers are created as needed on a per-arch basis." Fixed up some conflicts from other header file cleanups and moving code around that has happened in the meantime, so David's testing is somewhat weakened by that. We'll find out anything that got broken and fix it.. * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits) Delete all instances of asm/system.h Remove all #inclusions of asm/system.h Add #includes needed to permit the removal of asm/system.h Move all declarations of free_initmem() to linux/mm.h Disintegrate asm/system.h for OpenRISC Split arch_align_stack() out from asm-generic/system.h Split the switch_to() wrapper out of asm-generic/system.h Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h Create asm-generic/barrier.h Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h Disintegrate asm/system.h for Xtensa Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt] Disintegrate asm/system.h for Tile Disintegrate asm/system.h for Sparc Disintegrate asm/system.h for SH Disintegrate asm/system.h for Score Disintegrate asm/system.h for S390 Disintegrate asm/system.h for PowerPC Disintegrate asm/system.h for PA-RISC Disintegrate asm/system.h for MN10300 ...
226 lines
4.7 KiB
C
226 lines
4.7 KiB
C
/*
|
|
* linux/arch/arm/mach-rpc/riscpc.c
|
|
*
|
|
* Copyright (C) 1998-2001 Russell King
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* Architecture specific fixups.
|
|
*/
|
|
#include <linux/kernel.h>
|
|
#include <linux/tty.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/pm.h>
|
|
#include <linux/init.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/device.h>
|
|
#include <linux/serial_8250.h>
|
|
#include <linux/ata_platform.h>
|
|
#include <linux/io.h>
|
|
#include <linux/i2c.h>
|
|
|
|
#include <asm/elf.h>
|
|
#include <asm/mach-types.h>
|
|
#include <mach/hardware.h>
|
|
#include <asm/hardware/iomd.h>
|
|
#include <asm/page.h>
|
|
#include <asm/domain.h>
|
|
#include <asm/setup.h>
|
|
#include <asm/system_misc.h>
|
|
|
|
#include <asm/mach/map.h>
|
|
#include <asm/mach/arch.h>
|
|
#include <asm/mach/time.h>
|
|
|
|
extern void rpc_init_irq(void);
|
|
|
|
unsigned int vram_size;
|
|
unsigned int memc_ctrl_reg;
|
|
unsigned int number_mfm_drives;
|
|
|
|
static int __init parse_tag_acorn(const struct tag *tag)
|
|
{
|
|
memc_ctrl_reg = tag->u.acorn.memc_control_reg;
|
|
number_mfm_drives = tag->u.acorn.adfsdrives;
|
|
|
|
switch (tag->u.acorn.vram_pages) {
|
|
case 512:
|
|
vram_size += PAGE_SIZE * 256;
|
|
case 256:
|
|
vram_size += PAGE_SIZE * 256;
|
|
default:
|
|
break;
|
|
}
|
|
#if 0
|
|
if (vram_size) {
|
|
desc->video_start = 0x02000000;
|
|
desc->video_end = 0x02000000 + vram_size;
|
|
}
|
|
#endif
|
|
return 0;
|
|
}
|
|
|
|
__tagtable(ATAG_ACORN, parse_tag_acorn);
|
|
|
|
static struct map_desc rpc_io_desc[] __initdata = {
|
|
{ /* VRAM */
|
|
.virtual = SCREEN_BASE,
|
|
.pfn = __phys_to_pfn(SCREEN_START),
|
|
.length = 2*1048576,
|
|
.type = MT_DEVICE
|
|
}, { /* IO space */
|
|
.virtual = (u32)IO_BASE,
|
|
.pfn = __phys_to_pfn(IO_START),
|
|
.length = IO_SIZE ,
|
|
.type = MT_DEVICE
|
|
}, { /* EASI space */
|
|
.virtual = (unsigned long)EASI_BASE,
|
|
.pfn = __phys_to_pfn(EASI_START),
|
|
.length = EASI_SIZE,
|
|
.type = MT_DEVICE
|
|
}
|
|
};
|
|
|
|
static void __init rpc_map_io(void)
|
|
{
|
|
iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
|
|
|
|
/*
|
|
* Turn off floppy.
|
|
*/
|
|
writeb(0xc, PCIO_BASE + (0x3f2 << 2));
|
|
|
|
/*
|
|
* RiscPC can't handle half-word loads and stores
|
|
*/
|
|
elf_hwcap &= ~HWCAP_HALF;
|
|
}
|
|
|
|
static struct resource acornfb_resources[] = {
|
|
/* VIDC */
|
|
DEFINE_RES_MEM(0x03400000, 0x00200000),
|
|
DEFINE_RES_IRQ(IRQ_VSYNCPULSE),
|
|
};
|
|
|
|
static struct platform_device acornfb_device = {
|
|
.name = "acornfb",
|
|
.id = -1,
|
|
.dev = {
|
|
.coherent_dma_mask = 0xffffffff,
|
|
},
|
|
.num_resources = ARRAY_SIZE(acornfb_resources),
|
|
.resource = acornfb_resources,
|
|
};
|
|
|
|
static struct resource iomd_resources[] = {
|
|
DEFINE_RES_MEM(0x03200000, 0x10000),
|
|
};
|
|
|
|
static struct platform_device iomd_device = {
|
|
.name = "iomd",
|
|
.id = -1,
|
|
.num_resources = ARRAY_SIZE(iomd_resources),
|
|
.resource = iomd_resources,
|
|
};
|
|
|
|
static struct resource iomd_kart_resources[] = {
|
|
DEFINE_RES_IRQ(IRQ_KEYBOARDRX),
|
|
DEFINE_RES_IRQ(IRQ_KEYBOARDTX),
|
|
};
|
|
|
|
static struct platform_device kbd_device = {
|
|
.name = "kart",
|
|
.id = -1,
|
|
.dev = {
|
|
.parent = &iomd_device.dev,
|
|
},
|
|
.num_resources = ARRAY_SIZE(iomd_kart_resources),
|
|
.resource = iomd_kart_resources,
|
|
};
|
|
|
|
static struct plat_serial8250_port serial_platform_data[] = {
|
|
{
|
|
.mapbase = 0x03010fe0,
|
|
.irq = IRQ_SERIALPORT,
|
|
.uartclk = 1843200,
|
|
.regshift = 2,
|
|
.iotype = UPIO_MEM,
|
|
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
|
|
},
|
|
{ },
|
|
};
|
|
|
|
static struct platform_device serial_device = {
|
|
.name = "serial8250",
|
|
.id = PLAT8250_DEV_PLATFORM,
|
|
.dev = {
|
|
.platform_data = serial_platform_data,
|
|
},
|
|
};
|
|
|
|
static struct pata_platform_info pata_platform_data = {
|
|
.ioport_shift = 2,
|
|
};
|
|
|
|
static struct resource pata_resources[] = {
|
|
DEFINE_RES_MEM(0x030107c0, 0x20),
|
|
DEFINE_RES_MEM(0x03010fd8, 0x04),
|
|
DEFINE_RES_IRQ(IRQ_HARDDISK),
|
|
};
|
|
|
|
static struct platform_device pata_device = {
|
|
.name = "pata_platform",
|
|
.id = -1,
|
|
.num_resources = ARRAY_SIZE(pata_resources),
|
|
.resource = pata_resources,
|
|
.dev = {
|
|
.platform_data = &pata_platform_data,
|
|
.coherent_dma_mask = ~0, /* grumble */
|
|
},
|
|
};
|
|
|
|
static struct platform_device *devs[] __initdata = {
|
|
&iomd_device,
|
|
&kbd_device,
|
|
&serial_device,
|
|
&acornfb_device,
|
|
&pata_device,
|
|
};
|
|
|
|
static struct i2c_board_info i2c_rtc = {
|
|
I2C_BOARD_INFO("pcf8583", 0x50)
|
|
};
|
|
|
|
static int __init rpc_init(void)
|
|
{
|
|
i2c_register_board_info(0, &i2c_rtc, 1);
|
|
return platform_add_devices(devs, ARRAY_SIZE(devs));
|
|
}
|
|
|
|
arch_initcall(rpc_init);
|
|
|
|
static void rpc_restart(char mode, const char *cmd)
|
|
{
|
|
iomd_writeb(0, IOMD_ROMCR0);
|
|
|
|
/*
|
|
* Jump into the ROM
|
|
*/
|
|
soft_restart(0);
|
|
}
|
|
|
|
extern struct sys_timer ioc_timer;
|
|
|
|
MACHINE_START(RISCPC, "Acorn-RiscPC")
|
|
/* Maintainer: Russell King */
|
|
.atag_offset = 0x100,
|
|
.reserve_lp0 = 1,
|
|
.reserve_lp1 = 1,
|
|
.map_io = rpc_map_io,
|
|
.init_irq = rpc_init_irq,
|
|
.timer = &ioc_timer,
|
|
.restart = rpc_restart,
|
|
MACHINE_END
|