Commit 83928e17 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/rmk/linux-2.6-arm

Minor manual fixups for gfp_t clashes.
parents 9be16a03 50f4c001
...@@ -204,6 +204,7 @@ config ARCH_H720X ...@@ -204,6 +204,7 @@ config ARCH_H720X
config ARCH_AAEC2000 config ARCH_AAEC2000
bool "Agilent AAEC-2000 based" bool "Agilent AAEC-2000 based"
select ARM_AMBA
help help
This enables support for systems based on the Agilent AAEC-2000 This enables support for systems based on the Agilent AAEC-2000
...@@ -687,7 +688,8 @@ source "drivers/acorn/block/Kconfig" ...@@ -687,7 +688,8 @@ source "drivers/acorn/block/Kconfig"
if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \ if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \
|| ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \ || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \
|| ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE \
|| MACH_MP1000
source "drivers/ide/Kconfig" source "drivers/ide/Kconfig"
endif endif
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
defined(CONFIG_ARCH_IXP4XX) || \ defined(CONFIG_ARCH_IXP4XX) || \
defined(CONFIG_ARCH_IXP2000) || \ defined(CONFIG_ARCH_IXP2000) || \
defined(CONFIG_ARCH_LH7A40X) || \ defined(CONFIG_ARCH_LH7A40X) || \
defined(CONFIG_ARCH_OMAP) defined(CONFIG_ARCH_OMAP) || \
defined(CONFIG_MACH_MP1000)
.macro loadsp, rb .macro loadsp, rb
addruart \rb addruart \rb
.endm .endm
......
This diff is collapsed.
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleloader.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/elf.h> #include <linux/elf.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
......
...@@ -345,7 +345,9 @@ static int bad_syscall(int n, struct pt_regs *regs) ...@@ -345,7 +345,9 @@ static int bad_syscall(int n, struct pt_regs *regs)
struct thread_info *thread = current_thread_info(); struct thread_info *thread = current_thread_info();
siginfo_t info; siginfo_t info;
if (current->personality != PER_LINUX && thread->exec_domain->handler) { if (current->personality != PER_LINUX &&
current->personality != PER_LINUX_32BIT &&
thread->exec_domain->handler) {
thread->exec_domain->handler(n, regs); thread->exec_domain->handler(n, regs);
return regs->ARM_r0; return regs->ARM_r0;
} }
......
...@@ -11,7 +11,7 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ ...@@ -11,7 +11,7 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
strnlen_user.o strchr.o strrchr.o testchangebit.o \ strnlen_user.o strchr.o strrchr.o testchangebit.o \
testclearbit.o testsetbit.o uaccess.o getuser.o \ testclearbit.o testsetbit.o uaccess.o getuser.o \
putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
ucmpdi2.o lib1funcs.o div64.o \ ucmpdi2.o lib1funcs.o div64.o sha1.o \
io-readsb.o io-writesb.o io-readsl.o io-writesl.o io-readsb.o io-writesb.o io-readsl.o io-writesl.o
ifeq ($(CONFIG_CPU_32v3),y) ifeq ($(CONFIG_CPU_32v3),y)
......
/*
* linux/arch/arm/lib/sha1.S
*
* SHA transform optimized for ARM
*
* Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
* Created: September 17, 2005
*
* 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.
*
* The reference implementation for this code is linux/lib/sha1.c
*/
#include <linux/linkage.h>
.text
/*
* void sha_transform(__u32 *digest, const char *in, __u32 *W)
*
* Note: the "in" ptr may be unaligned.
*/
ENTRY(sha_transform)
stmfd sp!, {r4 - r8, lr}
@ for (i = 0; i < 16; i++)
@ W[i] = be32_to_cpu(in[i]); */
#ifdef __ARMEB__
mov r4, r0
mov r0, r2
mov r2, #64
bl memcpy
mov r2, r0
mov r0, r4
#else
mov r3, r2
mov lr, #16
1: ldrb r4, [r1], #1
ldrb r5, [r1], #1
ldrb r6, [r1], #1
ldrb r7, [r1], #1
subs lr, lr, #1
orr r5, r5, r4, lsl #8
orr r6, r6, r5, lsl #8
orr r7, r7, r6, lsl #8
str r7, [r3], #4
bne 1b
#endif
@ for (i = 0; i < 64; i++)
@ W[i+16] = ror(W[i+13] ^ W[i+8] ^ W[i+2] ^ W[i], 31);
sub r3, r2, #4
mov lr, #64
2: ldr r4, [r3, #4]!
subs lr, lr, #1
ldr r5, [r3, #8]
ldr r6, [r3, #32]
ldr r7, [r3, #52]
eor r4, r4, r5
eor r4, r4, r6
eor r4, r4, r7
mov r4, r4, ror #31
str r4, [r3, #64]
bne 2b
/*
* The SHA functions are:
*
* f1(B,C,D) = (D ^ (B & (C ^ D)))
* f2(B,C,D) = (B ^ C ^ D)
* f3(B,C,D) = ((B & C) | (D & (B | C)))
*
* Then the sub-blocks are processed as follows:
*
* A' = ror(A, 27) + f(B,C,D) + E + K + *W++
* B' = A
* C' = ror(B, 2)
* D' = C
* E' = D
*
* We therefore unroll each loop 5 times to avoid register shuffling.
* Also the ror for C (and also D and E which are successivelyderived
* from it) is applied in place to cut on an additional mov insn for
* each round.
*/
.macro sha_f1, A, B, C, D, E
ldr r3, [r2], #4
eor ip, \C, \D
add \E, r1, \E, ror #2
and ip, \B, ip, ror #2
add \E, \E, \A, ror #27
eor ip, ip, \D, ror #2
add \E, \E, r3
add \E, \E, ip
.endm
.macro sha_f2, A, B, C, D, E
ldr r3, [r2], #4
add \E, r1, \E, ror #2
eor ip, \B, \C, ror #2
add \E, \E, \A, ror #27
eor ip, ip, \D, ror #2
add \E, \E, r3
add \E, \E, ip
.endm
.macro sha_f3, A, B, C, D, E
ldr r3, [r2], #4
add \E, r1, \E, ror #2
orr ip, \B, \C, ror #2
add \E, \E, \A, ror #27
and ip, ip, \D, ror #2
add \E, \E, r3
and r3, \B, \C, ror #2
orr ip, ip, r3
add \E, \E, ip
.endm
ldmia r0, {r4 - r8}
mov lr, #4
ldr r1, .L_sha_K + 0
/* adjust initial values */
mov r6, r6, ror #30
mov r7, r7, ror #30
mov r8, r8, ror #30
3: subs lr, lr, #1
sha_f1 r4, r5, r6, r7, r8
sha_f1 r8, r4, r5, r6, r7
sha_f1 r7, r8, r4, r5, r6
sha_f1 r6, r7, r8, r4, r5
sha_f1 r5, r6, r7, r8, r4
bne 3b
ldr r1, .L_sha_K + 4
mov lr, #4
4: subs lr, lr, #1
sha_f2 r4, r5, r6, r7, r8
sha_f2 r8, r4, r5, r6, r7
sha_f2 r7, r8, r4, r5, r6
sha_f2 r6, r7, r8, r4, r5
sha_f2 r5, r6, r7, r8, r4
bne 4b
ldr r1, .L_sha_K + 8
mov lr, #4
5: subs lr, lr, #1
sha_f3 r4, r5, r6, r7, r8
sha_f3 r8, r4, r5, r6, r7
sha_f3 r7, r8, r4, r5, r6
sha_f3 r6, r7, r8, r4, r5
sha_f3 r5, r6, r7, r8, r4
bne 5b
ldr r1, .L_sha_K + 12
mov lr, #4
6: subs lr, lr, #1
sha_f2 r4, r5, r6, r7, r8
sha_f2 r8, r4, r5, r6, r7
sha_f2 r7, r8, r4, r5, r6
sha_f2 r6, r7, r8, r4, r5
sha_f2 r5, r6, r7, r8, r4
bne 6b
ldmia r0, {r1, r2, r3, ip, lr}
add r4, r1, r4
add r5, r2, r5
add r6, r3, r6, ror #2
add r7, ip, r7, ror #2
add r8, lr, r8, ror #2
stmia r0, {r4 - r8}
ldmfd sp!, {r4 - r8, pc}
.L_sha_K:
.word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
/*
* void sha_init(__u32 *buf)
*/
.L_sha_initial_digest:
.word 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0
ENTRY(sha_init)
str lr, [sp, #-4]!
adr r1, .L_sha_initial_digest
ldmia r1, {r1, r2, r3, ip, lr}
stmia r0, {r1, r2, r3, ip, lr}
ldr pc, [sp], #4
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
# Common support (must be linked before board specific support) # Common support (must be linked before board specific support)
obj-y += core.o obj-y += core.o clock.o
# Specific board support # Specific board support
obj-$(CONFIG_MACH_AAED2000) += aaed2000.o obj-$(CONFIG_MACH_AAED2000) += aaed2000.o
...@@ -27,16 +27,65 @@ ...@@ -27,16 +27,65 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/arch/aaed2000.h>
#include "core.h" #include "core.h"
static void aaed2000_clcd_disable(struct clcd_fb *fb)
{
AAED_EXT_GPIO &= ~AAED_EGPIO_LCD_PWR_EN;
}
static void aaed2000_clcd_enable(struct clcd_fb *fb)
{
AAED_EXT_GPIO |= AAED_EGPIO_LCD_PWR_EN;
}
struct aaec2000_clcd_info clcd_info = {
.enable = aaed2000_clcd_enable,
.disable = aaed2000_clcd_disable,
.panel = {
.mode = {
.name = "Sharp",
.refresh = 60,
.xres = 640,
.yres = 480,
.pixclock = 39721,
.left_margin = 20,
.right_margin = 44,
.upper_margin = 21,
.lower_margin = 34,
.hsync_len = 96,
.vsync_len = 2,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
},
.width = -1,
.height = -1,
.tim2 = TIM2_IVS | TIM2_IHS,
.cntl = CNTL_LCDTFT,
.bpp = 16,
},
};
static void __init aaed2000_init_irq(void) static void __init aaed2000_init_irq(void)
{ {
aaec2000_init_irq(); aaec2000_init_irq();
} }
static void __init aaed2000_init(void)
{
aaec2000_set_clcd_plat_data(&clcd_info);
}
static struct map_desc aaed2000_io_desc[] __initdata = {
{ EXT_GPIO_VBASE, EXT_GPIO_PBASE, EXT_GPIO_LENGTH, MT_DEVICE }, /* Ext GPIO */
};
static void __init aaed2000_map_io(void) static void __init aaed2000_map_io(void)
{ {
aaec2000_map_io(); aaec2000_map_io();
iotable_init(aaed2000_io_desc, ARRAY_SIZE(aaed2000_io_desc));
} }
MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform") MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
...@@ -47,4 +96,5 @@ MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform") ...@@ -47,4 +96,5 @@ MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
.map_io = aaed2000_map_io, .map_io = aaed2000_map_io,
.init_irq = aaed2000_init_irq, .init_irq = aaed2000_init_irq,
.timer = &aaec2000_timer, .timer = &aaec2000_timer,
.init_machine = aaed2000_init,
MACHINE_END MACHINE_END
/*
* linux/arch/arm/mach-aaec2000/clock.c
*
* Copyright (C) 2005 Nicolas Bellido Y Ortega
*
* Based on linux/arch/arm/mach-integrator/clock.c
*
* 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.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <asm/semaphore.h>
#include <asm/hardware/clock.h>
#include "clock.h"
static LIST_HEAD(clocks);
static DECLARE_MUTEX(clocks_sem);
struct clk *clk_get(struct device *dev, const char *id)
{
struct clk *p, *clk = ERR_PTR(-ENOENT);
down(&clocks_sem);
list_for_each_entry(p, &clocks, node) {
if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
clk = p;
break;
}
}
up(&clocks_sem);
return clk;
}
EXPORT_SYMBOL(clk_get);
void clk_put(struct clk *clk)
{
module_put(clk->owner);
}
EXPORT_SYMBOL(clk_put);
int clk_enable(struct clk *clk)
{
return 0;
}
EXPORT_SYMBOL(clk_enable);
void clk_disable(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_disable);
int clk_use(struct clk *clk)
{
return 0;
}
EXPORT_SYMBOL(clk_use);
void clk_unuse(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_unuse);
unsigned long clk_get_rate(struct clk *clk)
{
return clk->rate;
}
EXPORT_SYMBOL(clk_get_rate);
long clk_round_rate(struct clk *clk, unsigned long rate)
{
return rate;
}
EXPORT_SYMBOL(clk_round_rate);
int clk_set_rate(struct clk *clk, unsigned long rate)
{
return 0;
}
EXPORT_SYMBOL(clk_set_rate);
int clk_register(struct clk *clk)
{
down(&clocks_sem);
list_add(&clk->node, &clocks);
up(&clocks_sem);
return 0;
}
EXPORT_SYMBOL(clk_register);
void clk_unregister(struct clk *clk)
{
down(&clocks_sem);
list_del(&clk->node);
up(&clocks_sem);
}
EXPORT_SYMBOL(clk_unregister);
static int __init clk_init(void)
{
return 0;
}
arch_initcall(clk_init);
/*
* linux/arch/arm/mach-aaec2000/clock.h
*
* Copyright (C) 2005 Nicolas Bellido Y Ortega
*
* Based on linux/arch/arm/mach-integrator/clock.h
*
* 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.
*/
struct module;
struct clk {
struct list_head node;
unsigned long rate;
struct module *owner;
const char *name;
void *data;
};
int clk_register(struct clk *clk);
void clk_unregister(struct clk *clk);
...@@ -13,19 +13,27 @@ ...@@ -13,19 +13,27 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/device.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/sizes.h>
#include <asm/hardware/amba.h>
#include <asm/mach/flash.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include "core.h"
#include "clock.h"
/* /*
* Common I/O mapping: * Common I/O mapping:
* *
...@@ -40,9 +48,17 @@ ...@@ -40,9 +48,17 @@
* default mapping provided here. * default mapping provided here.
*/ */
static struct map_desc standard_io_desc[] __initdata = { static struct map_desc standard_io_desc[] __initdata = {
/* virtual physical length type */ {
{ VIO_APB_BASE, PIO_APB_BASE, IO_APB_LENGTH, MT_DEVICE }, .virtual = VIO_APB_BASE,
{ VIO_AHB_BASE, PIO_AHB_BASE, IO_AHB_LENGTH, MT_DEVICE } .physical = __phys_to_pfn(PIO_APB_BASE),
.length = IO_APB_LENGTH,
.type = MT_DEVICE
}, {
.virtual = VIO_AHB_BASE,
.physical = __phys_to_pfn(PIO_AHB_BASE),
.length = IO_AHB_LENGTH,
.type = MT_DEVICE
}
}; };
void __init aaec2000_map_io(void) void __init aaec2000_map_io(void)
...@@ -155,3 +171,116 @@ struct sys_timer aaec2000_timer = { ...@@ -155,3 +171,116 @@ struct sys_timer aaec2000_timer = {
.offset = aaec2000_gettimeoffset, .offset = aaec2000_gettimeoffset,
}; };
static struct clcd_panel mach_clcd_panel;
static int aaec2000_clcd_setup(struct clcd_fb *fb)
{
dma_addr_t dma;
fb->panel = &mach_clcd_panel;
fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, SZ_1M,
&dma, GFP_KERNEL);
if (!fb->fb.screen_base) {
printk(KERN_ERR "CLCD: unable to map framebuffer\n");
return -ENOMEM;
}
fb->fb.fix.smem_start = dma;
fb->fb.fix.smem_len = SZ_1M;
return 0;
}
static int aaec2000_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
{
return dma_mmap_writecombine(&fb->dev->dev, vma,
fb->fb.screen_base,
fb->fb.fix.smem_start,
fb->fb.fix.smem_len);
}
static void aaec2000_clcd_remove(struct clcd_fb *fb)
{
dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
fb->fb.screen_base, fb->fb.fix.smem_start);
}
static struct clcd_board clcd_plat_data = {
.name = "AAEC-2000",
.check = clcdfb_check,
.decode = clcdfb_decode,
.setup = aaec2000_clcd_setup,
.mmap = aaec2000_clcd_mmap,
.remove = aaec2000_clcd_remove,
};
static struct amba_device clcd_device = {
.dev = {
.bus_id = "mb:16",
.coherent_dma_mask = ~0,
.platform_data = &clcd_plat_data,
},
.res = {
.start = AAEC_CLCD_PHYS,
.end = AAEC_CLCD_PHYS + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
.irq = { INT_LCD, NO_IRQ },
.periphid = 0x41110,
};
static struct amba_device *amba_devs[] __initdata = {
&clcd_device,
};
static struct clk aaec2000_clcd_clk = {
.name = "CLCDCLK",
};
void __init aaec2000_set_clcd_plat_data(struct aaec2000_clcd_info *clcd)
{
clcd_plat_data.enable = clcd->enable;
clcd_plat_data.disable = clcd->disable;
memcpy(&mach_clcd_panel, &clcd->panel, sizeof(struct clcd_panel));
}
static struct flash_platform_data aaec2000_flash_data = {
.map_name = "cfi_probe",
.width = 4,
};
static struct resource aaec2000_flash_resource = {
.start = AAEC_FLASH_BASE,
.end = AAEC_FLASH_BASE + AAEC_FLASH_SIZE,
.flags = IORESOURCE_MEM,
};
static struct platform_device aaec2000_flash_device = {
.name = "armflash",
.id = 0,
.dev = {
.platform_data = &aaec2000_flash_data,
},
.num_resources = 1,
.resource = &aaec2000_flash_resource,
};
static int __init aaec2000_init(void)
{
int i;
clk_register(&aaec2000_clcd_clk);
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
amba_device_register(d, &iomem_resource);
}
platform_device_register(&aaec2000_flash_device);
return 0;
};
arch_initcall(aaec2000_init);
...@@ -9,8 +9,19 @@ ...@@ -9,8 +9,19 @@
* *
*/ */
#include <asm/hardware/amba_clcd.h>
struct sys_timer; struct sys_timer;
extern struct sys_timer aaec2000_timer; extern struct sys_timer aaec2000_timer;
extern void __init aaec2000_map_io(void); extern void __init aaec2000_map_io(void);
extern void __init aaec2000_init_irq(void); extern void __init aaec2000_init_irq(void);
struct aaec2000_clcd_info {
struct clcd_panel panel;
void (*disable)(struct clcd_fb *);
void (*enable)(struct clcd_fb *);
};
extern void __init aaec2000_set_clcd_plat_data(struct aaec2000_clcd_info *);
...@@ -69,6 +69,17 @@ config EP72XX_ROM_BOOT ...@@ -69,6 +69,17 @@ config EP72XX_ROM_BOOT
You almost surely want to say N here. You almost surely want to say N here.
config MACH_MP1000
bool "MACH_MP1000"
help
Say Y if you intend to run the kernel on the Comdial MP1000 platform.
config MP1000_90MHZ
bool "MP1000_90MHZ"
depends on MACH_MP1000
help
Say Y if you have the MP1000 configured to be set at 90MHZ rather than 74MHZ
endmenu endmenu
endif endif
...@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o ...@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o
obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o
obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o
obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o
obj-$(CONFIG_MACH_MP1000) += mp1000-mach.o mp1000-mm.o mp1000-seprom.o
obj-$(CONFIG_ARCH_P720T) += p720t.o obj-$(CONFIG_ARCH_P720T) += p720t.o
leds-$(CONFIG_ARCH_P720T) += p720t-leds.o leds-$(CONFIG_ARCH_P720T) += p720t-leds.o
obj-$(CONFIG_LEDS) += $(leds-y) obj-$(CONFIG_LEDS) += $(leds-y)
...@@ -46,10 +46,14 @@ ...@@ -46,10 +46,14 @@
*/ */
static struct map_desc autcpu12_io_desc[] __initdata = { static struct map_desc autcpu12_io_desc[] __initdata = {
/* virtual, physical, length, type */
/* memory-mapped extra io and CS8900A Ethernet chip */ /* memory-mapped extra io and CS8900A Ethernet chip */
/* ethernet chip */ /* ethernet chip */
{ AUTCPU12_VIRT_CS8900A, AUTCPU12_PHYS_CS8900A, SZ_1M, MT_DEVICE } {
.virtual = AUTCPU12_VIRT_CS8900A,
.pfn = __phys_to_pfn(AUTCPU12_PHYS_CS8900A),
.length = SZ_1M,
.type = MT_DEVICE
}
}; };
void __init autcpu12_map_io(void) void __init autcpu12_map_io(void)
......
...@@ -39,7 +39,12 @@ ...@@ -39,7 +39,12 @@
* ethernet driver, perhaps. * ethernet driver, perhaps.
*/ */
static struct map_desc cdb89712_io_desc[] __initdata = { static struct map_desc cdb89712_io_desc[] __initdata = {
{ ETHER_BASE, ETHER_START, ETHER_SIZE, MT_DEVICE } {
.virtual = ETHER_BASE,
.pfn =__phys_to_pfn(ETHER_START),
.length = ETHER_SIZE,
.type = MT_DEVICE
}
}; };
static void __init cdb89712_map_io(void) static void __init cdb89712_map_io(void)
......
...@@ -37,11 +37,13 @@ ...@@ -37,11 +37,13 @@
#include "common.h" #include "common.h"
static struct map_desc ceiva_io_desc[] __initdata = { static struct map_desc ceiva_io_desc[] __initdata = {
/* virtual, physical, length, type */
/* SED1355 controlled video RAM & registers */ /* SED1355 controlled video RAM & registers */
{ CEIVA_VIRT_SED1355, CEIVA_PHYS_SED1355, SZ_2M, MT_DEVICE } {
.virtual = CEIVA_VIRT_SED1355,
.pfn = __phys_to_pfn(CEIVA_PHYS_SED1355),
.length = SZ_2M,
.type = MT_DEVICE
}
}; };
......
...@@ -51,15 +51,27 @@ extern void clps711x_map_io(void); ...@@ -51,15 +51,27 @@ extern void clps711x_map_io(void);
* happens). * happens).
*/ */
static struct map_desc edb7211_io_desc[] __initdata = { static struct map_desc edb7211_io_desc[] __initdata = {
/* virtual, physical, length, type */ { /* memory-mapped extra keyboard row */
.virtual = EP7211_VIRT_EXTKBD,
/* memory-mapped extra keyboard row and CS8900A Ethernet chip */ .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD),
{ EP7211_VIRT_EXTKBD, EP7211_PHYS_EXTKBD, SZ_1M, MT_DEVICE }, .length = SZ_1M,
{ EP7211_VIRT_CS8900A, EP7211_PHYS_CS8900A, SZ_1M, MT_DEVICE }, .type - MT_DEVICE
}, { /* and CS8900A Ethernet chip */
/* flash banks */ .virtual = EP7211_VIRT_CS8900A,
{ EP7211_VIRT_FLASH1, EP7211_PHYS_FLASH1, SZ_8M, MT_DEVICE }, .pfn = __phys_to_pfn(EP7211_PHYS_CS8900A),
{ EP7211_VIRT_FLASH2, EP7211_PHYS_FLASH2, SZ_8M, MT_DEVICE } .length = SZ_1M,
.type = MT_DEVICE
}, { /* flash banks */
.virtual = EP7211_VIRT_FLASH1,
.pfn = __phys_to_pfn(EP7211_PHYS_FLASH1),
.length = SZ_8M,
.type = MT_DEVICE
}, {
.virtual = EP7211_VIRT_FLASH2,
.pfn = __phys_to_pfn(EP7211_PHYS_FLASH2),
.length = SZ_8M,
.type = MT_DEVICE
}
}; };
void __init edb7211_map_io(void) void __init edb7211_map_io(void)
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/sizes.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/page.h> #include <asm/page.h>
...@@ -34,7 +35,12 @@ ...@@ -34,7 +35,12 @@
* This maps the generic CLPS711x registers * This maps the generic CLPS711x registers
*/ */
static struct map_desc clps711x_io_desc[] __initdata = { static struct map_desc clps711x_io_desc[] __initdata = {
{ CLPS7111_VIRT_BASE, CLPS7111_PHYS_BASE, 1048576, MT_DEVICE } {
.virtual = CLPS7111_VIRT_BASE,
.pfn = __phys_to_pfn(CLPS7111_PHYS_BASE),
.length = SZ_1M,
.type = MT_DEVICE
}
}; };
void __init clps711x_map_io(void) void __init clps711x_map_io(void)
......
/*
* linux/arch/arm/mach-mp1000/mp1000.c
*
* Copyright (C) 2005 Comdial 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
*/
#include <linux/init.h>
#include <linux/types.h>
#include <linux/string.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/arch/mp1000-seprom.h>
#include "common.h"
extern void mp1000_map_io(void);
static void __init mp1000_init(void)
{
seprom_init();
}
MACHINE_START(MP1000, "Comdial MP1000")
/* Maintainer: Jon Ringle */
.phys_ram = 0xc0000000,
.phys_io = 0x80000000,
.io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
.boot_params = 0xc0015100,
.map_io = mp1000_map_io,
.init_irq = clps711x_init_irq,
.init_machine = mp1000_init,
.timer = &clps711x_timer,
MACHINE_END
/*
* linux/arch/arm/mach-mp1000/mm.c
*
* Extra MM routines for the MP1000
*
* Copyright (C) 2005 Comdial 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
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/sizes.h>
#include <asm/mach/map.h>
extern void clps711x_map_io(void);
static struct map_desc mp1000_io_desc[] __initdata = {
{ MP1000_EIO_BASE, MP1000_EIO_START, MP1000_EIO_SIZE, MT_DEVICE },
{ MP1000_FIO_BASE, MP1000_FIO_START, MP1000_FIO_SIZE, MT_DEVICE },
{ MP1000_LIO_BASE, MP1000_LIO_START, MP1000_LIO_SIZE, MT_DEVICE },
{ MP1000_NIO_BASE, MP1000_NIO_START, MP1000_NIO_SIZE, MT_DEVICE },
{ MP1000_IDE_BASE, MP1000_IDE_START, MP1000_IDE_SIZE, MT_DEVICE },
{ MP1000_DSP_BASE, MP1000_DSP_START, MP1000_DSP_SIZE, MT_DEVICE }
};
void __init mp1000_map_io(void)
{
clps711x_map_io();
iotable_init(mp1000_io_desc, ARRAY_SIZE(mp1000_io_desc));
}
/*`
* mp1000-seprom.c
*
* This file contains the Serial EEPROM code for the MP1000 board
*
* Copyright (C) 2005 Comdial 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
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/hardware/clps7111.h>
#include <asm/arch/mp1000-seprom.h>
/* If SepromInit() can initialize and checksum the seprom successfully, */
/* then it will point seprom_data_ptr at the shadow copy. */
static eeprom_struct seprom_data; /* shadow copy of seprom content */
eeprom_struct *seprom_data_ptr = 0; /* 0 => not initialized */
/*
* Port D Bit 5 is Chip Select for EEPROM
* Port E Bit 0 is Input, Data out from EEPROM
* Port E Bit 1 is Output, Data in to EEPROM
* Port E Bit 2 is Output, CLK to EEPROM
*/
static char *port_d_ptr = (char *)(CLPS7111_VIRT_BASE + PDDR);
static char *port_e_ptr = (char *)(CLPS7111_VIRT_BASE + PEDR);
#define NO_OF_SHORTS 64 // Device is 64 x 16 bits
#define ENABLE_RW 0
#define DISABLE_RW 1
static inline void toggle_seprom_clock(void)
{
*port_e_ptr |= HwPortESepromCLK;
*port_e_ptr &= ~(HwPortESepromCLK);
}
static inline void select_eeprom(void)
{
*port_d_ptr |= HwPortDEECS;
*port_e_ptr &= ~(HwPortESepromCLK);
}
static inline void deselect_eeprom(void)
{
*port_d_ptr &= ~(HwPortDEECS);
*port_e_ptr &= ~(HwPortESepromDIn);
}
/*
* GetSepromDataPtr - returns pointer to shadow (RAM) copy of seprom
* and returns 0 if seprom is not initialized or
* has a checksum error.
*/
eeprom_struct* get_seprom_ptr(void)
{
return seprom_data_ptr;
}
unsigned char* get_eeprom_mac_address(void)
{
return seprom_data_ptr->variant.eprom_struct.mac_Address;
}
/*
* ReadSProm, Physically reads data from the Serial PROM
*/
static void read_sprom(short address, int length, eeprom_struct *buffer)
{
short data = COMMAND_READ | (address & 0x3F);
short bit;
int i;
select_eeprom();
// Clock in 9 bits of the command
for (i = 0, bit = 0x100; i < 9; i++, bit >>= 1) {
if (data & bit)
*port_e_ptr |= HwPortESepromDIn;
else
*port_e_ptr &= ~(HwPortESepromDIn);
toggle_seprom_clock();
}
//
// Now read one or more shorts of data from the Seprom
//
while (length-- > 0) {
data = 0;
// Read 16 bits at a time
for (i = 0; i < 16; i++) {
data <<= 1;
toggle_seprom_clock();
data |= *port_e_ptr & HwPortESepromDOut;
}
buffer->variant.eprom_short_data[address++] = data;
}
deselect_eeprom();
return;
}
/*
* ReadSerialPROM
*
* Input: Pointer to array of 64 x 16 Bits
*
* Output: if no problem reading data is filled in
*/
static void read_serial_prom(eeprom_struct *data)
{
read_sprom(0, 64, data);
}
//
// Compute Serial EEPROM checksum
//
// Input: Pointer to struct with Eprom data
//
// Output: The computed Eprom checksum
//
static short compute_seprom_checksum(eeprom_struct *data)
{
short checksum = 0;
int i;
for (i = 0; i < 126; i++) {
checksum += (short)data->variant.eprom_byte_data[i];
}
return((short)(0x5555 - (checksum & 0xFFFF)));
}
//
// Make sure the data port bits for the SEPROM are correctly initialised
//
void __init seprom_init(void)
{
short checksum;
// Init Port D
*(char *)(CLPS7111_VIRT_BASE + PDDDR) = 0x0;
*(char *)(CLPS7111_VIRT_BASE + PDDR) = 0x15;
// Init Port E
*(int *)(CLPS7111_VIRT_BASE + PEDDR) = 0x06;
*(int *)(CLPS7111_VIRT_BASE + PEDR) = 0x04;
//
// Make sure that EEPROM struct size never exceeds 128 bytes
//
if (sizeof(eeprom_struct) > 128) {
panic("Serial PROM struct size > 128, aborting read\n");
}
read_serial_prom(&seprom_data);
checksum = compute_seprom_checksum(&seprom_data);
if (checksum != seprom_data.variant.eprom_short_data[63]) {
panic("Serial EEPROM checksum failed\n");
}
seprom_data_ptr = &seprom_data;
}
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/sizes.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -42,8 +43,17 @@ ...@@ -42,8 +43,17 @@
* We map both here. * We map both here.
*/ */
static struct map_desc p720t_io_desc[] __initdata = { static struct map_desc p720t_io_desc[] __initdata = {
{ SYSPLD_VIRT_BASE, SYSPLD_PHYS_BASE, 1048576, MT_DEVICE }, {
{ 0xfe400000, 0x10400000, 1048576, MT_DEVICE } .virtual = SYSPLD_VIRT_BASE,
.pfn = __phys_to_pfn(SYSPLD_PHYS_BASE),
.length = SZ_1M,
.type = MT_DEVICE
}, {
.virtual = 0xfe400000,
.pfn = __phys_to_pfn(0x10400000),
.length = SZ_1M,
.type = MT_DEVICE
}
}; };
static void __init static void __init
......
...@@ -259,10 +259,27 @@ static void __init clps7500_init_irq(void) ...@@ -259,10 +259,27 @@ static void __init clps7500_init_irq(void)
} }
static struct map_desc cl7500_io_desc[] __initdata = { static struct map_desc cl7500_io_desc[] __initdata = {
{ IO_BASE, IO_START, IO_SIZE, MT_DEVICE }, /* IO space */ { /* IO space */
{ ISA_BASE, ISA_START, ISA_SIZE, MT_DEVICE }, /* ISA space */ .virtual = IO_BASE,
{ FLASH_BASE, FLASH_START, FLASH_SIZE, MT_DEVICE }, /* Flash */ .pfn = __phys_to_pfn(IO_START),
{ LED_BASE, LED_START, LED_SIZE, MT_DEVICE } /* LED */ .length = IO_SIZE,
.type = MT_DEVICE
}, { /* ISA space */
.virtual = ISA_BASE,
.pfn = __phys_to_pfn(ISA_START),
.length = ISA_SIZE,
.type = MT_DEVICE
}, { /* Flash */
.virtual = FLASH_BASE,
.pfn = __phys_to_pfn(FLASH_START),
.length = FLASH_SIZE,
.type = MT_DEVICE
}, { /* LED */
.virtual = LED_BASE,
.pfn = __phys_to_pfn(LED_START),
.length = LED_SIZE,
.type = MT_DEVICE
}
}; };
static void __init clps7500_map_io(void) static void __init clps7500_map_io(void)
......
...@@ -76,16 +76,42 @@ static struct map_desc ebsa110_io_desc[] __initdata = { ...@@ -76,16 +76,42 @@ static struct map_desc ebsa110_io_desc[] __initdata = {
/* /*
* sparse external-decode ISAIO space * sparse external-decode ISAIO space
*/ */
{ IRQ_STAT, TRICK4_PHYS, PGDIR_SIZE, MT_DEVICE }, /* IRQ_STAT/IRQ_MCLR */ { /* IRQ_STAT/IRQ_MCLR */
{ IRQ_MASK, TRICK3_PHYS, PGDIR_SIZE, MT_DEVICE }, /* IRQ_MASK/IRQ_MSET */ .virtual = IRQ_STAT,
{ SOFT_BASE, TRICK1_PHYS, PGDIR_SIZE, MT_DEVICE }, /* SOFT_BASE */ .pfn = __phys_to_pfn(TRICK4_PHYS),
{ PIT_BASE, TRICK0_PHYS, PGDIR_SIZE, MT_DEVICE }, /* PIT_BASE */ .length = PGDIR_SIZE,
.type = MT_DEVICE
}, { /* IRQ_MASK/IRQ_MSET */
.virtual = IRQ_MASK,
.pfn = __phys_to_pfn(TRICK3_PHYS),
.length = PGDIR_SIZE,
.type = MT_DEVICE
}, { /* SOFT_BASE */
.virtual = SOFT_BASE,
.pfn = __phys_to_pfn(TRICK1_PHYS),
.length = PGDIR_SIZE,
.type = MT_DEVICE
}, { /* PIT_BASE */
.virtual = PIT_BASE,
.pfn = __phys_to_pfn(TRICK0_PHYS),
.length = PGDIR_SIZE,
.type = MT_DEVICE
},
/* /*
* self-decode ISAIO space * self-decode ISAIO space
*/ */
{ ISAIO_BASE, ISAIO_PHYS, ISAIO_SIZE, MT_DEVICE }, {
{ ISAMEM_BASE, ISAMEM_PHYS, ISAMEM_SIZE, MT_DEVICE } .virtual = ISAIO_BASE,
.pfn = __phys_to_pfn(ISAIO_PHYS),
.length = ISAIO_SIZE,
.type = MT_DEVICE
}, {
.virtual = ISAMEM_BASE,
.pfn = __phys_to_pfn(ISAMEM_PHYS),
.length = ISAMEM_SIZE,
.type = MT_DEVICE
}
}; };
static void __init ebsa110_map_io(void) static void __init ebsa110_map_io(void)
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/hardware.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/page.h> #include <asm/page.h>
......
...@@ -31,12 +31,37 @@ ...@@ -31,12 +31,37 @@
/* Page table mapping for I/O region */ /* Page table mapping for I/O region */
static struct map_desc epxa10db_io_desc[] __initdata = { static struct map_desc epxa10db_io_desc[] __initdata = {
{ IO_ADDRESS(EXC_REGISTERS_BASE), EXC_REGISTERS_BASE, SZ_16K, MT_DEVICE }, {
{ IO_ADDRESS(EXC_PLD_BLOCK0_BASE), EXC_PLD_BLOCK0_BASE, SZ_16K, MT_DEVICE }, .virtual = IO_ADDRESS(EXC_REGISTERS_BASE),
{ IO_ADDRESS(EXC_PLD_BLOCK1_BASE), EXC_PLD_BLOCK1_BASE, SZ_16K, MT_DEVICE }, .pfn = __phys_to_pfn(EXC_REGISTERS_BASE),
{ IO_ADDRESS(EXC_PLD_BLOCK2_BASE), EXC_PLD_BLOCK2_BASE, SZ_16K, MT_DEVICE }, .length = SZ_16K,
{ IO_ADDRESS(EXC_PLD_BLOCK3_BASE), EXC_PLD_BLOCK3_BASE, SZ_16K, MT_DEVICE }, .type = MT_DEVICE
{ FLASH_VADDR(EXC_EBI_BLOCK0_BASE), EXC_EBI_BLOCK0_BASE, SZ_16M, MT_DEVICE } }, {
.virtual = IO_ADDRESS(EXC_PLD_BLOCK0_BASE),
.pfn = __phys_to_pfn(EXC_PLD_BLOCK0_BASE),
.length = SZ_16K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(EXC_PLD_BLOCK1_BASE),
.pfn =__phys_to_pfn(EXC_PLD_BLOCK1_BASE),
.length = SZ_16K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(EXC_PLD_BLOCK2_BASE),
.physical = __phys_to_pfn(EXC_PLD_BLOCK2_BASE),
.length = SZ_16K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(EXC_PLD_BLOCK3_BASE),
.pfn = __phys_to_pfn(EXC_PLD_BLOCK3_BASE),
.length = SZ_16K,
.type = MT_DEVICE
}, {
.virtual = FLASH_VADDR(EXC_EBI_BLOCK0_BASE),
.pfn = __phys_to_pfn(EXC_EBI_BLOCK0_BASE),
.length = SZ_16M,
.type = MT_DEVICE
}
}; };
void __init epxa10db_map_io(void) void __init epxa10db_map_io(void)
......
...@@ -130,8 +130,17 @@ void __init footbridge_init_irq(void) ...@@ -130,8 +130,17 @@ void __init footbridge_init_irq(void)
* it means that we have extra bullet protection on our feet. * it means that we have extra bullet protection on our feet.
*/ */
static struct map_desc fb_common_io_desc[] __initdata = { static struct map_desc fb_common_io_desc[] __initdata = {
{ ARMCSR_BASE, DC21285_ARMCSR_BASE, ARMCSR_SIZE, MT_DEVICE }, {
{ XBUS_BASE, 0x40000000, XBUS_SIZE, MT_DEVICE } .virtual = ARMCSR_BASE,
.pfn = DC21285_ARMCSR_BASE,
.length = ARMCSR_SIZE,
.type = MT_DEVICE
}, {
.virtual = XBUS_BASE,
.pfn = __phys_to_pfn(0x40000000),
.length = XBUS_SIZE,
.type = MT_DEVICE
}
}; };
/* /*
...@@ -140,11 +149,32 @@ static struct map_desc fb_common_io_desc[] __initdata = { ...@@ -140,11 +149,32 @@ static struct map_desc fb_common_io_desc[] __initdata = {
*/ */
static struct map_desc ebsa285_host_io_desc[] __initdata = { static struct map_desc ebsa285_host_io_desc[] __initdata = {
#if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_FOOTBRIDGE_HOST) #if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_FOOTBRIDGE_HOST)
{ PCIMEM_BASE, DC21285_PCI_MEM, PCIMEM_SIZE, MT_DEVICE }, {
{ PCICFG0_BASE, DC21285_PCI_TYPE_0_CONFIG, PCICFG0_SIZE, MT_DEVICE }, .virtual = PCIMEM_BASE,
{ PCICFG1_BASE, DC21285_PCI_TYPE_1_CONFIG, PCICFG1_SIZE, MT_DEVICE }, .pfn = __phys_to_pfn(DC21285_PCI_MEM),
{ PCIIACK_BASE, DC21285_PCI_IACK, PCIIACK_SIZE, MT_DEVICE }, .length = PCIMEM_SIZE,
{ PCIO_BASE, DC21285_PCI_IO, PCIO_SIZE, MT_DEVICE } .type = MT_DEVICE
}, {
.virtual = PCICFG0_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_TYPE_0_CONFIG),
.length = PCICFG0_SIZE,
.type = MT_DEVICE
}, {
.virtual = PCICFG1_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_TYPE_1_CONFIG),
.length = PCICFG1_SIZE,
.type = MT_DEVICE
}, {
.virtual = PCIIACK_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_IACK),
.length = PCIIACK_SIZE,
.type = MT_DEVICE
}, {
.virtual = PCIO_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_IO),
.length = PCIO_SIZE,
.type = MT_DEVICE
}
#endif #endif
}; };
...@@ -153,8 +183,17 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = { ...@@ -153,8 +183,17 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = {
*/ */
static struct map_desc co285_io_desc[] __initdata = { static struct map_desc co285_io_desc[] __initdata = {
#ifdef CONFIG_ARCH_CO285 #ifdef CONFIG_ARCH_CO285
{ PCIO_BASE, DC21285_PCI_IO, PCIO_SIZE, MT_DEVICE }, {
{ PCIMEM_BASE, DC21285_PCI_MEM, PCIMEM_SIZE, MT_DEVICE } .virtual = PCIO_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_IO),
.length = PCIO_SIZE,
.type = MT_DEVICE
}, {
.virtual = PCIMEM_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_MEM),
.length = PCIMEM_SIZE,
.type = MT_DEVICE
}
#endif #endif
}; };
......
...@@ -237,7 +237,12 @@ void __init h720x_init_irq (void) ...@@ -237,7 +237,12 @@ void __init h720x_init_irq (void)
} }
static struct map_desc h720x_io_desc[] __initdata = { static struct map_desc h720x_io_desc[] __initdata = {
{ IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, {
.virtual = IO_VIRT,
.pfn = __phys_to_pfn(IO_PHYS),
.length = IO_SIZE,
.type = MT_DEVICE
},
}; };
/* Initialize io tables */ /* Initialize io tables */
......
...@@ -273,8 +273,12 @@ static struct platform_device *devices[] __initdata = { ...@@ -273,8 +273,12 @@ static struct platform_device *devices[] __initdata = {
}; };
static struct map_desc imx_io_desc[] __initdata = { static struct map_desc imx_io_desc[] __initdata = {
/* virtual physical length type */ {
{IMX_IO_BASE, IMX_IO_PHYS, IMX_IO_SIZE, MT_DEVICE}, .virtual = IMX_IO_BASE,
.pfn = __phys_to_pfn(IMX_IO_PHYS),
.length = IMX_IO_SIZE,
.type = MT_DEVICE
}
}; };
void __init void __init
......
...@@ -61,13 +61,37 @@ mx1ads_init(void) ...@@ -61,13 +61,37 @@ mx1ads_init(void)
} }
static struct map_desc mx1ads_io_desc[] __initdata = { static struct map_desc mx1ads_io_desc[] __initdata = {
/* virtual physical length type */ {
{IMX_CS0_VIRT, IMX_CS0_PHYS, IMX_CS0_SIZE, MT_DEVICE}, .virtual = IMX_CS0_VIRT,
{IMX_CS1_VIRT, IMX_CS1_PHYS, IMX_CS1_SIZE, MT_DEVICE}, .pfn = __phys_to_pfn(IMX_CS0_PHYS),
{IMX_CS2_VIRT, IMX_CS2_PHYS, IMX_CS2_SIZE, MT_DEVICE}, .length = IMX_CS0_SIZE,
{IMX_CS3_VIRT, IMX_CS3_PHYS, IMX_CS3_SIZE, MT_DEVICE}, .type = MT_DEVICE
{IMX_CS4_VIRT, IMX_CS4_PHYS, IMX_CS4_SIZE, MT_DEVICE}, }, {
{IMX_CS5_VIRT, IMX_CS5_PHYS, IMX_CS5_SIZE, MT_DEVICE}, .virtual = IMX_CS1_VIRT,
.pfn = __phys_to_pfn(IMX_CS1_PHYS),
.length = IMX_CS1_SIZE,
.type = MT_DEVICE
}, {
.virtual = IMX_CS2_VIRT,
.pfn = __phys_to_pfn(IMX_CS2_PHYS),
.length = IMX_CS2_SIZE,
.type = MT_DEVICE
}, {
.virtual = IMX_CS3_VIRT,
.pfn = __phys_to_pfn(IMX_CS3_PHYS),
.length = IMX_CS3_SIZE,
.type = MT_DEVICE
}, {
.virtual = IMX_CS4_VIRT,
.pfn = __phys_to_pfn(IMX_CS4_PHYS),
.length = IMX_CS4_SIZE,
.type = MT_DEVICE
}, {
.virtual = IMX_CS5_VIRT,
.pfn = __phys_to_pfn(IMX_CS5_PHYS),
.length = IMX_CS5_SIZE,
.type = MT_DEVICE
}
}; };
static void __init static void __init
......
...@@ -75,19 +75,72 @@ ...@@ -75,19 +75,72 @@
*/ */
static struct map_desc ap_io_desc[] __initdata = { static struct map_desc ap_io_desc[] __initdata = {
{ IO_ADDRESS(INTEGRATOR_HDR_BASE), INTEGRATOR_HDR_BASE, SZ_4K, MT_DEVICE }, {
{ IO_ADDRESS(INTEGRATOR_SC_BASE), INTEGRATOR_SC_BASE, SZ_4K, MT_DEVICE }, .virtual = IO_ADDRESS(INTEGRATOR_HDR_BASE),
{ IO_ADDRESS(INTEGRATOR_EBI_BASE), INTEGRATOR_EBI_BASE, SZ_4K, MT_DEVICE }, .pfn = __phys_to_pfn(INTEGRATOR_HDR_BASE),
{ IO_ADDRESS(INTEGRATOR_CT_BASE), INTEGRATOR_CT_BASE, SZ_4K, MT_DEVICE }, .length = SZ_4K,
{ IO_ADDRESS(INTEGRATOR_IC_BASE), INTEGRATOR_IC_BASE, SZ_4K, MT_DEVICE }, .type = MT_DEVICE
{ IO_ADDRESS(INTEGRATOR_UART0_BASE), INTEGRATOR_UART0_BASE, SZ_4K, MT_DEVICE }, }, {
{ IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE }, .virtual = IO_ADDRESS(INTEGRATOR_SC_BASE),
{ IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE }, .pfn = __phys_to_pfn(INTEGRATOR_SC_BASE),
{ IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE }, .length = SZ_4K,
{ PCI_MEMORY_VADDR, PHYS_PCI_MEM_BASE, SZ_16M, MT_DEVICE }, .type = MT_DEVICE
{ PCI_CONFIG_VADDR, PHYS_PCI_CONFIG_BASE, SZ_16M, MT_DEVICE }, }, {
{ PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_64K, MT_DEVICE }, .virtual = IO_ADDRESS(INTEGRATOR_EBI_BASE),
{ PCI_IO_VADDR, PHYS_PCI_IO_BASE, SZ_64K, MT_DEVICE } .pfn = __phys_to_pfn(INTEGRATOR_EBI_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_CT_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_CT_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_IC_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_IC_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_UART0_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_UART0_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_UART1_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_UART1_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_DBG_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_DBG_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = PCI_MEMORY_VADDR,
.pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE),
.length = SZ_16M,
.type = MT_DEVICE
}, {
.virtual = PCI_CONFIG_VADDR,
.pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE),
.length = SZ_16M,
.type = MT_DEVICE
}, {
.virtual = PCI_V3_VADDR,
.pfn = __phys_to_pfn(PHYS_PCI_V3_BASE),
.length = SZ_64K,
.type = MT_DEVICE
}, {
.virtual = PCI_IO_VADDR,
.pfn = __phys_to_pfn(PHYS_PCI_IO_BASE),
.length = SZ_64K,
.type = MT_DEVICE
}
}; };
static void __init ap_map_io(void) static void __init ap_map_io(void)
......
...@@ -74,17 +74,62 @@ ...@@ -74,17 +74,62 @@
*/ */
static struct map_desc intcp_io_desc[] __initdata = { static struct map_desc intcp_io_desc[] __initdata = {
{ IO_ADDRESS(INTEGRATOR_HDR_BASE), INTEGRATOR_HDR_BASE, SZ_4K, MT_DEVICE }, {
{ IO_ADDRESS(INTEGRATOR_SC_BASE), INTEGRATOR_SC_BASE, SZ_4K, MT_DEVICE }, .virtual = IO_ADDRESS(INTEGRATOR_HDR_BASE),
{ IO_ADDRESS(INTEGRATOR_EBI_BASE), INTEGRATOR_EBI_BASE, SZ_4K, MT_DEVICE }, .pfn = __phys_to_pfn(INTEGRATOR_HDR_BASE),
{ IO_ADDRESS(INTEGRATOR_CT_BASE), INTEGRATOR_CT_BASE, SZ_4K, MT_DEVICE }, .length = SZ_4K,
{ IO_ADDRESS(INTEGRATOR_IC_BASE), INTEGRATOR_IC_BASE, SZ_4K, MT_DEVICE }, .type = MT_DEVICE
{ IO_ADDRESS(INTEGRATOR_UART0_BASE), INTEGRATOR_UART0_BASE, SZ_4K, MT_DEVICE }, }, {
{ IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE }, .virtual = IO_ADDRESS(INTEGRATOR_SC_BASE),
{ IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE }, .pfn = __phys_to_pfn(INTEGRATOR_SC_BASE),
{ IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE }, .length = SZ_4K,
{ 0xfca00000, 0xca000000, SZ_4K, MT_DEVICE }, .type = MT_DEVICE
{ 0xfcb00000, 0xcb000000, SZ_4K, MT_DEVICE }, }, {
.virtual = IO_ADDRESS(INTEGRATOR_EBI_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_EBI_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_CT_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_CT_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_IC_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_IC_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_UART0_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_UART0_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_UART1_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_UART1_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_DBG_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_DBG_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE),
.pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = 0xfca00000,
.pfn = __phys_to_pfn(0xca000000),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = 0xfcb00000,
.pfn = __phys_to_pfn(0xcb000000),
.length = SZ_4K,
.type = MT_DEVICE
}
}; };
static void __init intcp_map_io(void) static void __init intcp_map_io(void)
......
...@@ -38,13 +38,17 @@ ...@@ -38,13 +38,17 @@
* Standard IO mapping for all IOP321 based systems * Standard IO mapping for all IOP321 based systems
*/ */
static struct map_desc iop321_std_desc[] __initdata = { static struct map_desc iop321_std_desc[] __initdata = {
/* virtual physical length type */ { /* mem mapped registers */
.virtual = IOP321_VIRT_MEM_BASE,
/* mem mapped registers */ .pfn = __phys_to_pfn(IOP321_PHYS_MEM_BASE),
{ IOP321_VIRT_MEM_BASE, IOP321_PHYS_MEM_BASE, 0x00002000, MT_DEVICE }, .length = 0x00002000,
.type = MT_DEVICE
/* PCI IO space */ }, { /* PCI IO space */
{ IOP321_PCI_LOWER_IO_VA, IOP321_PCI_LOWER_IO_PA, IOP321_PCI_IO_WINDOW_SIZE, MT_DEVICE } .virtual = IOP321_PCI_LOWER_IO_VA,
.pfn = __phys_to_pfn(IOP321_PCI_LOWER_IO_PA),
.length = IOP321_PCI_IO_WINDOW_SIZE,
.type = MT_DEVICE
}
}; };
#ifdef CONFIG_ARCH_IQ80321 #ifdef CONFIG_ARCH_IQ80321
......
...@@ -37,13 +37,17 @@ ...@@ -37,13 +37,17 @@
* Standard IO mapping for all IOP331 based systems * Standard IO mapping for all IOP331 based systems
*/ */
static struct map_desc iop331_std_desc[] __initdata = { static struct map_desc iop331_std_desc[] __initdata = {
/* virtual physical length type */ { /* mem mapped registers */
.virtual = IOP331_VIRT_MEM_BASE,
/* mem mapped registers */ .pfn = __phys_to_pfn(IOP331_PHYS_MEM_BASE),
{ IOP331_VIRT_MEM_BASE, IOP331_PHYS_MEM_BASE, 0x00002000, MT_DEVICE }, .length = 0x00002000,
.type = MT_DEVICE
/* PCI IO space */ }, { /* PCI IO space */
{ IOP331_PCI_LOWER_IO_VA, IOP331_PCI_LOWER_IO_PA, IOP331_PCI_IO_WINDOW_SIZE, MT_DEVICE } .virtual = IOP331_PCI_LOWER_IO_VA,
.pfn = __phys_to_pfn(IOP331_PCI_LOWER_IO_PA),
.length = IOP331_PCI_IO_WINDOW_SIZE,
.type = MT_DEVICE
}
}; };
static struct uart_port iop331_serial_ports[] = { static struct uart_port iop331_serial_ports[] = {
......
...@@ -29,10 +29,12 @@ ...@@ -29,10 +29,12 @@
* We use RedBoot's setup for the onboard devices. * We use RedBoot's setup for the onboard devices.
*/ */
static struct map_desc iq31244_io_desc[] __initdata = { static struct map_desc iq31244_io_desc[] __initdata = {
/* virtual physical length type */ { /* on-board devices */
.virtual = IQ31244_UART,
/* on-board devices */ .pfn = __phys_to_pfn(IQ31244_UART),
{ IQ31244_UART, IQ31244_UART, 0x00100000, MT_DEVICE } .length = 0x00100000,
.type = MT_DEVICE
}
}; };
void __init iq31244_map_io(void) void __init iq31244_map_io(void)
......
...@@ -29,10 +29,12 @@ ...@@ -29,10 +29,12 @@
* We use RedBoot's setup for the onboard devices. * We use RedBoot's setup for the onboard devices.
*/ */
static struct map_desc iq80321_io_desc[] __initdata = { static struct map_desc iq80321_io_desc[] __initdata = {
/* virtual physical length type */ { /* on-board devices */
.virtual = IQ80321_UART,
/* on-board devices */ .pfn = __phys_to_pfn(IQ80321_UART),
{ IQ80321_UART, IQ80321_UART, 0x00100000, MT_DEVICE } .length = 0x00100000,
.type = MT_DEVICE
}
}; };
void __init iq80321_map_io(void) void __init iq80321_map_io(void)
......
...@@ -83,42 +83,42 @@ void ixp2000_release_slowport(struct slowport_cfg *old_cfg) ...@@ -83,42 +83,42 @@ void ixp2000_release_slowport(struct slowport_cfg *old_cfg)
static struct map_desc ixp2000_io_desc[] __initdata = { static struct map_desc ixp2000_io_desc[] __initdata = {
{ {
.virtual = IXP2000_CAP_VIRT_BASE, .virtual = IXP2000_CAP_VIRT_BASE,
.physical = IXP2000_CAP_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_CAP_PHYS_BASE),
.length = IXP2000_CAP_SIZE, .length = IXP2000_CAP_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = IXP2000_INTCTL_VIRT_BASE, .virtual = IXP2000_INTCTL_VIRT_BASE,
.physical = IXP2000_INTCTL_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_INTCTL_PHYS_BASE),
.length = IXP2000_INTCTL_SIZE, .length = IXP2000_INTCTL_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = IXP2000_PCI_CREG_VIRT_BASE, .virtual = IXP2000_PCI_CREG_VIRT_BASE,
.physical = IXP2000_PCI_CREG_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_PCI_CREG_PHYS_BASE),
.length = IXP2000_PCI_CREG_SIZE, .length = IXP2000_PCI_CREG_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = IXP2000_PCI_CSR_VIRT_BASE, .virtual = IXP2000_PCI_CSR_VIRT_BASE,
.physical = IXP2000_PCI_CSR_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_PCI_CSR_PHYS_BASE),
.length = IXP2000_PCI_CSR_SIZE, .length = IXP2000_PCI_CSR_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = IXP2000_MSF_VIRT_BASE, .virtual = IXP2000_MSF_VIRT_BASE,
.physical = IXP2000_MSF_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_MSF_PHYS_BASE),
.length = IXP2000_MSF_SIZE, .length = IXP2000_MSF_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = IXP2000_PCI_IO_VIRT_BASE, .virtual = IXP2000_PCI_IO_VIRT_BASE,
.physical = IXP2000_PCI_IO_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE),
.length = IXP2000_PCI_IO_SIZE, .length = IXP2000_PCI_IO_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = IXP2000_PCI_CFG0_VIRT_BASE, .virtual = IXP2000_PCI_CFG0_VIRT_BASE,
.physical = IXP2000_PCI_CFG0_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_PCI_CFG0_PHYS_BASE),
.length = IXP2000_PCI_CFG0_SIZE, .length = IXP2000_PCI_CFG0_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = IXP2000_PCI_CFG1_VIRT_BASE, .virtual = IXP2000_PCI_CFG1_VIRT_BASE,
.physical = IXP2000_PCI_CFG1_PHYS_BASE, .pfn = __phys_to_pfn(IXP2000_PCI_CFG1_PHYS_BASE),
.length = IXP2000_PCI_CFG1_SIZE, .length = IXP2000_PCI_CFG1_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
} }
......
...@@ -176,7 +176,7 @@ void ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long ...@@ -176,7 +176,7 @@ void ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long
*************************************************************************/ *************************************************************************/
static struct map_desc ixdp2x00_io_desc __initdata = { static struct map_desc ixdp2x00_io_desc __initdata = {
.virtual = IXDP2X00_VIRT_CPLD_BASE, .virtual = IXDP2X00_VIRT_CPLD_BASE,
.physical = IXDP2X00_PHYS_CPLD_BASE, .pfn = __phys_to_pfn(IXDP2X00_PHYS_CPLD_BASE),
.length = IXDP2X00_CPLD_SIZE, .length = IXDP2X00_CPLD_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}; };
......
...@@ -136,7 +136,7 @@ void __init ixdp2x01_init_irq(void) ...@@ -136,7 +136,7 @@ void __init ixdp2x01_init_irq(void)
*************************************************************************/ *************************************************************************/
static struct map_desc ixdp2x01_io_desc __initdata = { static struct map_desc ixdp2x01_io_desc __initdata = {
.virtual = IXDP2X01_VIRT_CPLD_BASE, .virtual = IXDP2X01_VIRT_CPLD_BASE,
.physical = IXDP2X01_PHYS_CPLD_BASE, .pfn = __phys_to_pfn(IXDP2X01_PHYS_CPLD_BASE),
.length = IXDP2X01_CPLD_REGION_SIZE, .length = IXDP2X01_CPLD_REGION_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}; };
......
...@@ -44,24 +44,24 @@ ...@@ -44,24 +44,24 @@
static struct map_desc ixp4xx_io_desc[] __initdata = { static struct map_desc ixp4xx_io_desc[] __initdata = {
{ /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */ { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */
.virtual = IXP4XX_PERIPHERAL_BASE_VIRT, .virtual = IXP4XX_PERIPHERAL_BASE_VIRT,
.physical = IXP4XX_PERIPHERAL_BASE_PHYS, .pfn = __phys_to_pfn(IXP4XX_PERIPHERAL_BASE_PHYS),
.length = IXP4XX_PERIPHERAL_REGION_SIZE, .length = IXP4XX_PERIPHERAL_REGION_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { /* Expansion Bus Config Registers */ }, { /* Expansion Bus Config Registers */
.virtual = IXP4XX_EXP_CFG_BASE_VIRT, .virtual = IXP4XX_EXP_CFG_BASE_VIRT,
.physical = IXP4XX_EXP_CFG_BASE_PHYS, .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS),
.length = IXP4XX_EXP_CFG_REGION_SIZE, .length = IXP4XX_EXP_CFG_REGION_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { /* PCI Registers */ }, { /* PCI Registers */
.virtual = IXP4XX_PCI_CFG_BASE_VIRT, .virtual = IXP4XX_PCI_CFG_BASE_VIRT,
.physical = IXP4XX_PCI_CFG_BASE_PHYS, .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS),
.length = IXP4XX_PCI_CFG_REGION_SIZE, .length = IXP4XX_PCI_CFG_REGION_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, },
#ifdef CONFIG_DEBUG_LL #ifdef CONFIG_DEBUG_LL
{ /* Debug UART mapping */ { /* Debug UART mapping */
.virtual = IXP4XX_DEBUG_UART_BASE_VIRT, .virtual = IXP4XX_DEBUG_UART_BASE_VIRT,
.physical = IXP4XX_DEBUG_UART_BASE_PHYS, .pfn = __phys_to_pfn(IXP4XX_DEBUG_UART_BASE_PHYS),
.length = IXP4XX_DEBUG_UART_REGION_SIZE, .length = IXP4XX_DEBUG_UART_REGION_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
} }
......
...@@ -26,8 +26,17 @@ ...@@ -26,8 +26,17 @@
/* This function calls the board specific IRQ initialization function. */ /* This function calls the board specific IRQ initialization function. */
static struct map_desc kev7a400_io_desc[] __initdata = { static struct map_desc kev7a400_io_desc[] __initdata = {
{ IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, {
{ CPLD_VIRT, CPLD_PHYS, CPLD_SIZE, MT_DEVICE }, .virtual = IO_VIRT,
.pfn = __phys_to_pfn(IO_PHYS),
.length = IO_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD_VIRT,
.pfn = __phys_to_pfn(CPLD_PHYS),
.length = CPLD_SIZE,
.type = MT_DEVICE
}
}; };
void __init kev7a400_map_io(void) void __init kev7a400_map_io(void)
......
...@@ -227,23 +227,79 @@ void __init lh7a40x_init_board_irq (void) ...@@ -227,23 +227,79 @@ void __init lh7a40x_init_board_irq (void)
} }
static struct map_desc lpd7a400_io_desc[] __initdata = { static struct map_desc lpd7a400_io_desc[] __initdata = {
{ IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, {
/* Mapping added to work around chip select problems */ .virtual = IO_VIRT,
{ IOBARRIER_VIRT, IOBARRIER_PHYS, IOBARRIER_SIZE, MT_DEVICE }, .pfn = __phys_to_pfn(IO_PHYS),
{ CF_VIRT, CF_PHYS, CF_SIZE, MT_DEVICE }, .length = IO_SIZE,
.type = MT_DEVICE
}, { /* Mapping added to work around chip select problems */
.virtual = IOBARRIER_VIRT,
.pfn = __phys_to_pfn(IOBARRIER_PHYS),
.length = IOBARRIER_SIZE,
.type = MT_DEVICE
}, {
.virtual = CF_VIRT,
.pfn = __phys_to_pfn(CF_PHYS),
.length = CF_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD02_VIRT,
.pfn = __phys_to_pfn(CPLD02_PHYS),
.length = CPLD02_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD06_VIRT,
.pfn = __phys_to_pfn(CPLD06_PHYS),
.length = CPLD06_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD08_VIRT,
.pfn = __phys_to_pfn(CPLD08_PHYS),
.length = CPLD08_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD0C_VIRT,
.pfn = __phys_to_pfn(CPLD0C_PHYS),
.length = CPLD0C_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD0E_VIRT,
.pfn = __phys_to_pfn(CPLD0E_PHYS),
.length = CPLD0E_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD10_VIRT,
.pfn = __phys_to_pfn(CPLD10_PHYS),
.length = CPLD10_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD12_VIRT,
.pfn = __phys_to_pfn(CPLD12_PHYS),
.length = CPLD12_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD14_VIRT,
.pfn = __phys_to_pfn(CPLD14_PHYS),
.length = CPLD14_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD16_VIRT,
.pfn = __phys_to_pfn(CPLD16_PHYS),
.length = CPLD16_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD18_VIRT,
.pfn = __phys_to_pfn(CPLD18_PHYS),
.length = CPLD18_SIZE,
.type = MT_DEVICE
}, {
.virtual = CPLD1A_VIRT,
.pfn = __phys_to_pfn(CPLD1A_PHYS),
.length = CPLD1A_SIZE,
.type = MT_DEVICE
},
/* This mapping is redundant since the smc driver performs another. */ /* This mapping is redundant since the smc driver performs another. */
/* { CPLD00_VIRT, CPLD00_PHYS, CPLD00_SIZE, MT_DEVICE }, */ /* { CPLD00_VIRT, CPLD00_PHYS, CPLD00_SIZE, MT_DEVICE }, */
{ CPLD02_VIRT, CPLD02_PHYS, CPLD02_SIZE, MT_DEVICE },
{ CPLD06_VIRT, CPLD06_PHYS, CPLD06_SIZE, MT_DEVICE },
{ CPLD08_VIRT, CPLD08_PHYS, CPLD08_SIZE, MT_DEVICE },
{ CPLD0C_VIRT, CPLD0C_PHYS, CPLD0C_SIZE, MT_DEVICE },
{ CPLD0E_VIRT, CPLD0E_PHYS, CPLD0E_SIZE, MT_DEVICE },
{ CPLD10_VIRT, CPLD10_PHYS, CPLD10_SIZE, MT_DEVICE },
{ CPLD12_VIRT, CPLD12_PHYS, CPLD12_SIZE, MT_DEVICE },
{ CPLD14_VIRT, CPLD14_PHYS, CPLD14_SIZE, MT_DEVICE },
{ CPLD16_VIRT, CPLD16_PHYS, CPLD16_SIZE, MT_DEVICE },
{ CPLD18_VIRT, CPLD18_PHYS, CPLD18_SIZE, MT_DEVICE },
{ CPLD1A_VIRT, CPLD1A_PHYS, CPLD1A_SIZE, MT_DEVICE },
}; };
void __init void __init
......
...@@ -103,8 +103,12 @@ static struct platform_device innovator_flash_device = { ...@@ -103,8 +103,12 @@ static struct platform_device innovator_flash_device = {
/* Only FPGA needs to be mapped here. All others are done with ioremap */ /* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc innovator1510_io_desc[] __initdata = { static struct map_desc innovator1510_io_desc[] __initdata = {
{ OMAP1510_FPGA_BASE, OMAP1510_FPGA_START, OMAP1510_FPGA_SIZE, {
MT_DEVICE }, .virtual = OMAP1510_FPGA_BASE,
.pfn = __phys_to_pfn(OMAP1510_FPGA_START),
.length = OMAP1510_FPGA_SIZE,
.type = MT_DEVICE
}
}; };
static struct resource innovator1510_smc91x_resources[] = { static struct resource innovator1510_smc91x_resources[] = {
......
...@@ -134,8 +134,12 @@ void omap_perseus2_init_irq(void) ...@@ -134,8 +134,12 @@ void omap_perseus2_init_irq(void)
/* Only FPGA needs to be mapped here. All others are done with ioremap */ /* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc omap_perseus2_io_desc[] __initdata = { static struct map_desc omap_perseus2_io_desc[] __initdata = {
{H2P2_DBG_FPGA_BASE, H2P2_DBG_FPGA_START, H2P2_DBG_FPGA_SIZE, {
MT_DEVICE}, .virtual = H2P2_DBG_FPGA_BASE,
.pfn = __phys_to_pfn(H2P2_DBG_FPGA_START),
.length = H2P2_DBG_FPGA_SIZE,
.type = MT_DEVICE
}
}; };
static void __init omap_perseus2_map_io(void) static void __init omap_perseus2_map_io(void)
......
...@@ -26,27 +26,59 @@ extern void omap_sram_init(void); ...@@ -26,27 +26,59 @@ extern void omap_sram_init(void);
* default mapping provided here. * default mapping provided here.
*/ */
static struct map_desc omap_io_desc[] __initdata = { static struct map_desc omap_io_desc[] __initdata = {
{ IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, {
.virtual = IO_VIRT,
.pfn = __phys_to_pfn(IO_PHYS),
.length = IO_SIZE,
.type = MT_DEVICE
}
}; };
#ifdef CONFIG_ARCH_OMAP730 #ifdef CONFIG_ARCH_OMAP730
static struct map_desc omap730_io_desc[] __initdata = { static struct map_desc omap730_io_desc[] __initdata = {
{ OMAP730_DSP_BASE, OMAP730_DSP_START, OMAP730_DSP_SIZE, MT_DEVICE }, {
{ OMAP730_DSPREG_BASE, OMAP730_DSPREG_START, OMAP730_DSPREG_SIZE, MT_DEVICE }, .virtual = OMAP730_DSP_BASE,
.pfn = __phys_to_pfn(OMAP730_DSP_START),
.length = OMAP730_DSP_SIZE,
.type = MT_DEVICE
}, {
.virtual = OMAP730_DSPREG_BASE,
.pfn = __phys_to_pfn(OMAP730_DSPREG_START),
.length = OMAP730_DSPREG_SIZE,
.type = MT_DEVICE
}
}; };
#endif #endif
#ifdef CONFIG_ARCH_OMAP1510 #ifdef CONFIG_ARCH_OMAP1510
static struct map_desc omap1510_io_desc[] __initdata = { static struct map_desc omap1510_io_desc[] __initdata = {
{ OMAP1510_DSP_BASE, OMAP1510_DSP_START, OMAP1510_DSP_SIZE, MT_DEVICE }, {
{ OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_START, OMAP1510_DSPREG_SIZE, MT_DEVICE }, .virtual = OMAP1510_DSP_BASE,
.pfn = __phys_to_pfn(OMAP1510_DSP_START),
.length = OMAP1510_DSP_SIZE,
.type = MT_DEVICE
}, {
.virtual = OMAP1510_DSPREG_BASE,
.pfn = __phys_to_pfn(OMAP1510_DSPREG_START),
.length = OMAP1510_DSPREG_SIZE,
.type = MT_DEVICE
}
}; };
#endif #endif
#if defined(CONFIG_ARCH_OMAP16XX) #if defined(CONFIG_ARCH_OMAP16XX)
static struct map_desc omap16xx_io_desc[] __initdata = { static struct map_desc omap16xx_io_desc[] __initdata = {
{ OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE }, {
{ OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE }, .virtual = OMAP16XX_DSP_BASE,
.pfn = __phys_to_pfn(OMAP16XX_DSP_START),
.length = OMAP16XX_DSP_SIZE,
.type = MT_DEVICE
}, {
.virtual = OMAP16XX_DSPREG_BASE,
.pfn = __phys_to_pfn(OMAP16XX_DSPREG_START),
.length = OMAP16XX_DSPREG_SIZE,
.type = MT_DEVICE
}
}; };
#endif #endif
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <asm/arch/udc.h> #include <asm/arch/udc.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
#include <asm/arch/mmc.h> #include <asm/arch/mmc.h>
#include <asm/arch/irda.h>
#include <asm/arch/i2c.h> #include <asm/arch/i2c.h>
#include "generic.h" #include "generic.h"
...@@ -92,14 +93,42 @@ EXPORT_SYMBOL(pxa_set_cken); ...@@ -92,14 +93,42 @@ EXPORT_SYMBOL(pxa_set_cken);
* and cache flush area. * and cache flush area.
*/ */
static struct map_desc standard_io_desc[] __initdata = { static struct map_desc standard_io_desc[] __initdata = {
/* virtual physical length type */ { /* Devs */
{ 0xf2000000, 0x40000000, 0x02000000, MT_DEVICE }, /* Devs */ .virtual = 0xf2000000,
{ 0xf4000000, 0x44000000, 0x00100000, MT_DEVICE }, /* LCD */ .pfn = __phys_to_pfn(0x40000000),
{ 0xf6000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Mem Ctl */ .length = 0x02000000,
{ 0xf8000000, 0x4c000000, 0x00100000, MT_DEVICE }, /* USB host */ .type = MT_DEVICE
{ 0xfa000000, 0x50000000, 0x00100000, MT_DEVICE }, /* Camera */ }, { /* LCD */
{ 0xfe000000, 0x58000000, 0x00100000, MT_DEVICE }, /* IMem ctl */ .virtual = 0xf4000000,
{ 0xff000000, 0x00000000, 0x00100000, MT_DEVICE } /* UNCACHED_PHYS_0 */ .pfn = __phys_to_pfn(0x44000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* Mem Ctl */
.virtual = 0xf6000000,
.pfn = __phys_to_pfn(0x48000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* USB host */
.virtual = 0xf8000000,
.pfn = __phys_to_pfn(0x4c000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* Camera */
.virtual = 0xfa000000,
.pfn = __phys_to_pfn(0x50000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* IMem ctl */
.virtual = 0xfe000000,
.pfn = __phys_to_pfn(0x58000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* UNCACHED_PHYS_0 */
.virtual = 0xff000000,
.pfn = __phys_to_pfn(0x00000000),
.length = 0x00100000,
.type = MT_DEVICE
}
}; };
void __init pxa_map_io(void) void __init pxa_map_io(void)
...@@ -225,6 +254,10 @@ static struct platform_device stuart_device = { ...@@ -225,6 +254,10 @@ static struct platform_device stuart_device = {
.name = "pxa2xx-uart", .name = "pxa2xx-uart",
.id = 2, .id = 2,
}; };
static struct platform_device hwuart_device = {
.name = "pxa2xx-uart",
.id = 3,
};
static struct resource i2c_resources[] = { static struct resource i2c_resources[] = {
{ {
...@@ -265,10 +298,26 @@ static struct resource i2s_resources[] = { ...@@ -265,10 +298,26 @@ static struct resource i2s_resources[] = {
static struct platform_device i2s_device = { static struct platform_device i2s_device = {
.name = "pxa2xx-i2s", .name = "pxa2xx-i2s",
.id = -1, .id = -1,
.resource = i2c_resources, .resource = i2s_resources,
.num_resources = ARRAY_SIZE(i2s_resources), .num_resources = ARRAY_SIZE(i2s_resources),
}; };
static u64 pxaficp_dmamask = ~(u32)0;
static struct platform_device pxaficp_device = {
.name = "pxa2xx-ir",
.id = -1,
.dev = {
.dma_mask = &pxaficp_dmamask,
.coherent_dma_mask = 0xffffffff,
},
};
void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
{
pxaficp_device.dev.platform_data = info;
}
static struct platform_device *devices[] __initdata = { static struct platform_device *devices[] __initdata = {
&pxamci_device, &pxamci_device,
&udc_device, &udc_device,
...@@ -276,13 +325,26 @@ static struct platform_device *devices[] __initdata = { ...@@ -276,13 +325,26 @@ static struct platform_device *devices[] __initdata = {
&ffuart_device, &ffuart_device,
&btuart_device, &btuart_device,
&stuart_device, &stuart_device,
&pxaficp_device,
&i2c_device, &i2c_device,
&i2s_device, &i2s_device,
}; };
static int __init pxa_init(void) static int __init pxa_init(void)
{ {
return platform_add_devices(devices, ARRAY_SIZE(devices)); int cpuid, ret;
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret)
return ret;
/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
cpuid = read_cpuid(CPUID_ID);
if (((cpuid >> 4) & 0xfff) == 0x2d0 ||
((cpuid >> 4) & 0xfff) == 0x290)
ret = platform_device_register(&hwuart_device);
return ret;
} }
subsys_initcall(pxa_init); subsys_initcall(pxa_init);
...@@ -152,16 +152,17 @@ static void __init idp_init_irq(void) ...@@ -152,16 +152,17 @@ static void __init idp_init_irq(void)
} }
static struct map_desc idp_io_desc[] __initdata = { static struct map_desc idp_io_desc[] __initdata = {
/* virtual physical length type */ {
.virtual = IDP_COREVOLT_VIRT,
{ IDP_COREVOLT_VIRT, .pfn = __phys_to_pfn(IDP_COREVOLT_PHYS),
IDP_COREVOLT_PHYS, .length = IDP_COREVOLT_SIZE,
IDP_COREVOLT_SIZE, .type = MT_DEVICE
MT_DEVICE }, }, {
{ IDP_CPLD_VIRT, .virtual = IDP_CPLD_VIRT,
IDP_CPLD_PHYS, .pfn = __phys_to_pfn(IDP_CPLD_PHYS),
IDP_CPLD_SIZE, .length = IDP_CPLD_SIZE,
MT_DEVICE } .type = MT_DEVICE
}
}; };
static void __init idp_map_io(void) static void __init idp_map_io(void)
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <asm/arch/pxa-regs.h> #include <asm/arch/pxa-regs.h>
#include <asm/arch/lubbock.h> #include <asm/arch/lubbock.h>
#include <asm/arch/udc.h> #include <asm/arch/udc.h>
#include <asm/arch/irda.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
#include <asm/arch/mmc.h> #include <asm/arch/mmc.h>
...@@ -237,16 +238,40 @@ static struct pxamci_platform_data lubbock_mci_platform_data = { ...@@ -237,16 +238,40 @@ static struct pxamci_platform_data lubbock_mci_platform_data = {
.init = lubbock_mci_init, .init = lubbock_mci_init,
}; };
static void lubbock_irda_transceiver_mode(struct device *dev, int mode)
{
unsigned long flags;
local_irq_save(flags);
if (mode & IR_SIRMODE) {
LUB_MISC_WR &= ~(1 << 4);
} else if (mode & IR_FIRMODE) {
LUB_MISC_WR |= 1 << 4;
}
local_irq_restore(flags);
}
static struct pxaficp_platform_data lubbock_ficp_platform_data = {
.transceiver_cap = IR_SIRMODE | IR_FIRMODE,
.transceiver_mode = lubbock_irda_transceiver_mode,
};
static void __init lubbock_init(void) static void __init lubbock_init(void)
{ {
pxa_set_udc_info(&udc_info); pxa_set_udc_info(&udc_info);
set_pxa_fb_info(&sharp_lm8v31); set_pxa_fb_info(&sharp_lm8v31);
pxa_set_mci_info(&lubbock_mci_platform_data); pxa_set_mci_info(&lubbock_mci_platform_data);
pxa_set_ficp_info(&lubbock_ficp_platform_data);
(void) platform_add_devices(devices, ARRAY_SIZE(devices)); (void) platform_add_devices(devices, ARRAY_SIZE(devices));
} }
static struct map_desc lubbock_io_desc[] __initdata = { static struct map_desc lubbock_io_desc[] __initdata = {
{ LUBBOCK_FPGA_VIRT, LUBBOCK_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */ { /* CPLD */
.virtual = LUBBOCK_FPGA_VIRT,
.pfn = __phys_to_pfn(LUBBOCK_FPGA_PHYS),
.length = 0x00100000,
.type = MT_DEVICE
}
}; };
static void __init lubbock_map_io(void) static void __init lubbock_map_io(void)
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <asm/arch/audio.h> #include <asm/arch/audio.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
#include <asm/arch/mmc.h> #include <asm/arch/mmc.h>
#include <asm/arch/irda.h>
#include "generic.h" #include "generic.h"
...@@ -294,6 +295,29 @@ static struct pxamci_platform_data mainstone_mci_platform_data = { ...@@ -294,6 +295,29 @@ static struct pxamci_platform_data mainstone_mci_platform_data = {
.exit = mainstone_mci_exit, .exit = mainstone_mci_exit,
}; };
static void mainstone_irda_transceiver_mode(struct device *dev, int mode)
{
unsigned long flags;
local_irq_save(flags);
if (mode & IR_SIRMODE) {
MST_MSCWR1 &= ~MST_MSCWR1_IRDA_FIR;
} else if (mode & IR_FIRMODE) {
MST_MSCWR1 |= MST_MSCWR1_IRDA_FIR;
}
if (mode & IR_OFF) {
MST_MSCWR1 = (MST_MSCWR1 & ~MST_MSCWR1_IRDA_MASK) | MST_MSCWR1_IRDA_OFF;
} else {
MST_MSCWR1 = (MST_MSCWR1 & ~MST_MSCWR1_IRDA_MASK) | MST_MSCWR1_IRDA_FULL;
}
local_irq_restore(flags);
}
static struct pxaficp_platform_data mainstone_ficp_platform_data = {
.transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
.transceiver_mode = mainstone_irda_transceiver_mode,
};
static void __init mainstone_init(void) static void __init mainstone_init(void)
{ {
/* /*
...@@ -313,11 +337,17 @@ static void __init mainstone_init(void) ...@@ -313,11 +337,17 @@ static void __init mainstone_init(void)
set_pxa_fb_info(&toshiba_ltm035a776c); set_pxa_fb_info(&toshiba_ltm035a776c);
pxa_set_mci_info(&mainstone_mci_platform_data); pxa_set_mci_info(&mainstone_mci_platform_data);
pxa_set_ficp_info(&mainstone_ficp_platform_data);
} }
static struct map_desc mainstone_io_desc[] __initdata = { static struct map_desc mainstone_io_desc[] __initdata = {
{ MST_FPGA_VIRT, MST_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */ { /* CPLD */
.virtual = MST_FPGA_VIRT,
.pfn = __phys_to_pfn(MST_FPGA_PHYS),
.length = 0x00100000,
.type = MT_DEVICE
}
}; };
static void __init mainstone_map_io(void) static void __init mainstone_map_io(void)
......
...@@ -129,7 +129,7 @@ void pxa_cpu_pm_enter(suspend_state_t state) ...@@ -129,7 +129,7 @@ void pxa_cpu_pm_enter(suspend_state_t state)
case PM_SUSPEND_MEM: case PM_SUSPEND_MEM:
/* set resume return address */ /* set resume return address */
PSPR = virt_to_phys(pxa_cpu_resume); PSPR = virt_to_phys(pxa_cpu_resume);
pxa_cpu_suspend(3); pxa_cpu_suspend(PWRMODE_SLEEP);
break; break;
} }
} }
......
...@@ -157,7 +157,7 @@ void pxa_cpu_pm_enter(suspend_state_t state) ...@@ -157,7 +157,7 @@ void pxa_cpu_pm_enter(suspend_state_t state)
case PM_SUSPEND_MEM: case PM_SUSPEND_MEM:
/* set resume return address */ /* set resume return address */
PSPR = virt_to_phys(pxa_cpu_resume); PSPR = virt_to_phys(pxa_cpu_resume);
pxa_cpu_suspend(3); pxa_cpu_suspend(PWRMODE_SLEEP);
break; break;
} }
} }
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
/* /*
* pxa_cpu_suspend() * pxa_cpu_suspend()
* *
* Forces CPU into sleep state * Forces CPU into sleep state.
*
* r0 = value for PWRMODE M field for desired sleep state
*/ */
ENTRY(pxa_cpu_suspend) ENTRY(pxa_cpu_suspend)
...@@ -53,6 +55,7 @@ ENTRY(pxa_cpu_suspend) ...@@ -53,6 +55,7 @@ ENTRY(pxa_cpu_suspend)
mov r10, sp mov r10, sp
stmfd sp!, {r3 - r10} stmfd sp!, {r3 - r10}
mov r5, r0 @ save sleep mode
@ preserve phys address of stack @ preserve phys address of stack
mov r0, sp mov r0, sp
bl sleep_phys_sp bl sleep_phys_sp
...@@ -66,7 +69,7 @@ ENTRY(pxa_cpu_suspend) ...@@ -66,7 +69,7 @@ ENTRY(pxa_cpu_suspend)
@ (also workaround for sighting 28071) @ (also workaround for sighting 28071)
@ prepare value for sleep mode @ prepare value for sleep mode
mov r1, #3 @ sleep mode mov r1, r5 @ sleep mode
@ prepare pointer to physical address 0 (virtual mapping in generic.c) @ prepare pointer to physical address 0 (virtual mapping in generic.c)
mov r2, #UNCACHED_PHYS_0 mov r2, #UNCACHED_PHYS_0
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
ENTRY(pxa_cpu_standby) ENTRY(pxa_cpu_standby)
ldr r0, =PSSR ldr r0, =PSSR
mov r1, #(PSSR_PH | PSSR_STS) mov r1, #(PSSR_PH | PSSR_STS)
mov r2, #2 mov r2, #PWRMODE_STANDBY
mov r3, #UNCACHED_PHYS_0 @ Read mem context in. mov r3, #UNCACHED_PHYS_0 @ Read mem context in.
ldr ip, [r3] ldr ip, [r3]
b 1f b 1f
......
...@@ -61,9 +61,22 @@ static int __init parse_tag_acorn(const struct tag *tag) ...@@ -61,9 +61,22 @@ static int __init parse_tag_acorn(const struct tag *tag)
__tagtable(ATAG_ACORN, parse_tag_acorn); __tagtable(ATAG_ACORN, parse_tag_acorn);
static struct map_desc rpc_io_desc[] __initdata = { static struct map_desc rpc_io_desc[] __initdata = {
{ SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */ { /* VRAM */
{ (u32)IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */ .virtual = SCREEN_BASE,
{ EASI_BASE, EASI_START, EASI_SIZE, MT_DEVICE } /* EASI space */ .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 = EASI_BASE,
.pfn = __phys_to_pfn(EASI_START),
.length = EASI_SIZE,
.type = MT_DEVICE
}
}; };
static void __init rpc_map_io(void) static void __init rpc_map_io(void)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* todo - fix when rmk changes iodescs to use `void __iomem *` */ /* todo - fix when rmk changes iodescs to use `void __iomem *` */
#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, S3C2410_PA_##x, S3C24XX_SZ_##x, MT_DEVICE } #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C2410_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
#ifndef MHZ #ifndef MHZ
#define MHZ (1000*1000) #define MHZ (1000*1000)
......
...@@ -47,7 +47,7 @@ struct platform_device *s3c24xx_uart_devs[3]; ...@@ -47,7 +47,7 @@ struct platform_device *s3c24xx_uart_devs[3];
static struct resource s3c_usb_resource[] = { static struct resource s3c_usb_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_USBHOST, .start = S3C2410_PA_USBHOST,
.end = S3C2410_PA_USBHOST + S3C24XX_SZ_USBHOST, .end = S3C2410_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -77,7 +77,7 @@ EXPORT_SYMBOL(s3c_device_usb); ...@@ -77,7 +77,7 @@ EXPORT_SYMBOL(s3c_device_usb);
static struct resource s3c_lcd_resource[] = { static struct resource s3c_lcd_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_LCD, .start = S3C2410_PA_LCD,
.end = S3C2410_PA_LCD + S3C24XX_SZ_LCD, .end = S3C2410_PA_LCD + S3C24XX_SZ_LCD - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -103,21 +103,25 @@ struct platform_device s3c_device_lcd = { ...@@ -103,21 +103,25 @@ struct platform_device s3c_device_lcd = {
EXPORT_SYMBOL(s3c_device_lcd); EXPORT_SYMBOL(s3c_device_lcd);
static struct s3c2410fb_mach_info s3c2410fb_info; void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info)
{ {
memcpy(&s3c2410fb_info,hard_s3c2410fb_info,sizeof(struct s3c2410fb_mach_info)); struct s3c2410fb_mach_info *npd;
s3c_device_lcd.dev.platform_data = &s3c2410fb_info;
npd = kmalloc(sizeof(*npd), GFP_KERNEL);
if (npd) {
memcpy(npd, pd, sizeof(*npd));
s3c_device_lcd.dev.platform_data = npd;
} else {
printk(KERN_ERR "no memory for LCD platform data\n");
}
} }
EXPORT_SYMBOL(set_s3c2410fb_info);
/* NAND Controller */ /* NAND Controller */
static struct resource s3c_nand_resource[] = { static struct resource s3c_nand_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_NAND, .start = S3C2410_PA_NAND,
.end = S3C2410_PA_NAND + S3C24XX_SZ_NAND, .end = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
} }
}; };
...@@ -136,7 +140,7 @@ EXPORT_SYMBOL(s3c_device_nand); ...@@ -136,7 +140,7 @@ EXPORT_SYMBOL(s3c_device_nand);
static struct resource s3c_usbgadget_resource[] = { static struct resource s3c_usbgadget_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_USBDEV, .start = S3C2410_PA_USBDEV,
.end = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV, .end = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -161,7 +165,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget); ...@@ -161,7 +165,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget);
static struct resource s3c_wdt_resource[] = { static struct resource s3c_wdt_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_WATCHDOG, .start = S3C2410_PA_WATCHDOG,
.end = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG, .end = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -186,7 +190,7 @@ EXPORT_SYMBOL(s3c_device_wdt); ...@@ -186,7 +190,7 @@ EXPORT_SYMBOL(s3c_device_wdt);
static struct resource s3c_i2c_resource[] = { static struct resource s3c_i2c_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_IIC, .start = S3C2410_PA_IIC,
.end = S3C2410_PA_IIC + S3C24XX_SZ_IIC, .end = S3C2410_PA_IIC + S3C24XX_SZ_IIC - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -211,7 +215,7 @@ EXPORT_SYMBOL(s3c_device_i2c); ...@@ -211,7 +215,7 @@ EXPORT_SYMBOL(s3c_device_i2c);
static struct resource s3c_iis_resource[] = { static struct resource s3c_iis_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_IIS, .start = S3C2410_PA_IIS,
.end = S3C2410_PA_IIS + S3C24XX_SZ_IIS, .end = S3C2410_PA_IIS + S3C24XX_SZ_IIS -1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
} }
}; };
...@@ -265,7 +269,7 @@ EXPORT_SYMBOL(s3c_device_rtc); ...@@ -265,7 +269,7 @@ EXPORT_SYMBOL(s3c_device_rtc);
static struct resource s3c_adc_resource[] = { static struct resource s3c_adc_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_ADC, .start = S3C2410_PA_ADC,
.end = S3C2410_PA_ADC + S3C24XX_SZ_ADC, .end = S3C2410_PA_ADC + S3C24XX_SZ_ADC - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -288,7 +292,7 @@ struct platform_device s3c_device_adc = { ...@@ -288,7 +292,7 @@ struct platform_device s3c_device_adc = {
static struct resource s3c_sdi_resource[] = { static struct resource s3c_sdi_resource[] = {
[0] = { [0] = {
.start = S3C2410_PA_SDI, .start = S3C2410_PA_SDI,
.end = S3C2410_PA_SDI + S3C24XX_SZ_SDI, .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -465,7 +469,7 @@ EXPORT_SYMBOL(s3c_device_timer3); ...@@ -465,7 +469,7 @@ EXPORT_SYMBOL(s3c_device_timer3);
static struct resource s3c_camif_resource[] = { static struct resource s3c_camif_resource[] = {
[0] = { [0] = {
.start = S3C2440_PA_CAMIF, .start = S3C2440_PA_CAMIF,
.end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF, .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* 04-Oct-2004 BJD Added irq filter controls for GPIO * 04-Oct-2004 BJD Added irq filter controls for GPIO
* 05-Nov-2004 BJD EXPORT_SYMBOL() added for all code * 05-Nov-2004 BJD EXPORT_SYMBOL() added for all code
* 13-Mar-2005 BJD Updates for __iomem * 13-Mar-2005 BJD Updates for __iomem
* 26-Oct-2005 BJD Added generic configuration types
*/ */
...@@ -58,6 +59,27 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function) ...@@ -58,6 +59,27 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
mask = 3 << S3C2410_GPIO_OFFSET(pin)*2; mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
} }
switch (function) {
case S3C2410_GPIO_LEAVE:
mask = 0;
function = 0;
break;
case S3C2410_GPIO_INPUT:
case S3C2410_GPIO_OUTPUT:
case S3C2410_GPIO_SFN2:
case S3C2410_GPIO_SFN3:
if (pin < S3C2410_GPIO_BANKB) {
function &= 1;
function <<= S3C2410_GPIO_OFFSET(pin);
} else {
function &= 3;
function <<= S3C2410_GPIO_OFFSET(pin)*2;
}
}
/* modify the specified register wwith IRQs off */
local_irq_save(flags); local_irq_save(flags);
con = __raw_readl(base + 0x00); con = __raw_readl(base + 0x00);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
* 25-Jul-2005 BJD Removed ASIX static mappings * 25-Jul-2005 BJD Removed ASIX static mappings
* 27-Jul-2005 BJD Ensure maximum frequency of i2c bus * 27-Jul-2005 BJD Ensure maximum frequency of i2c bus
* 20-Sep-2005 BJD Added static to non-exported items * 20-Sep-2005 BJD Added static to non-exported items
* 26-Oct-2005 BJD Added FB platform data
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -61,8 +62,10 @@ ...@@ -61,8 +62,10 @@
#include <asm/arch/regs-gpio.h> #include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-mem.h> #include <asm/arch/regs-mem.h>
#include <asm/arch/regs-lcd.h> #include <asm/arch/regs-lcd.h>
#include <asm/arch/nand.h> #include <asm/arch/nand.h>
#include <asm/arch/iic.h> #include <asm/arch/iic.h>
#include <asm/arch/fb.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
...@@ -399,6 +402,38 @@ static struct s3c2410_platform_i2c bast_i2c_info = { ...@@ -399,6 +402,38 @@ static struct s3c2410_platform_i2c bast_i2c_info = {
.max_freq = 130*1000, .max_freq = 130*1000,
}; };
static struct s3c2410fb_mach_info __initdata bast_lcd_info = {
.width = 640,
.height = 480,
.xres = {
.min = 320,
.max = 1024,
.defval = 640,
},
.yres = {
.min = 240,
.max = 600,
.defval = 480,
},
.bpp = {
.min = 4,
.max = 16,
.defval = 8,
},
.regs = {
.lcdcon1 = 0x00000176,
.lcdcon2 = 0x1d77c7c2,
.lcdcon3 = 0x013a7f13,
.lcdcon4 = 0x00000057,
.lcdcon5 = 0x00014b02,
}
};
/* Standard BAST devices */ /* Standard BAST devices */
static struct platform_device *bast_devices[] __initdata = { static struct platform_device *bast_devices[] __initdata = {
...@@ -454,6 +489,10 @@ static void __init bast_map_io(void) ...@@ -454,6 +489,10 @@ static void __init bast_map_io(void)
usb_simtec_init(); usb_simtec_init();
} }
static void __init bast_init(void)
{
s3c24xx_fb_set_platdata(&bast_lcd_info);
}
MACHINE_START(BAST, "Simtec-BAST") MACHINE_START(BAST, "Simtec-BAST")
/* Maintainer: Ben Dooks <ben@simtec.co.uk> */ /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
...@@ -463,5 +502,6 @@ MACHINE_START(BAST, "Simtec-BAST") ...@@ -463,5 +502,6 @@ MACHINE_START(BAST, "Simtec-BAST")
.boot_params = S3C2410_SDRAM_PA + 0x100, .boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = bast_map_io, .map_io = bast_map_io,
.init_irq = s3c24xx_init_irq, .init_irq = s3c24xx_init_irq,
.init_machine = bast_init,
.timer = &s3c24xx_timer, .timer = &s3c24xx_timer,
MACHINE_END MACHINE_END
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
* 14-Jan-2005 BJD Added clock init * 14-Jan-2005 BJD Added clock init
* 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
* 20-Sep-2005 BJD Added static to non-exported items * 20-Sep-2005 BJD Added static to non-exported items
* 26-Oct-2005 BJD Changed name of fb init call
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -164,7 +165,7 @@ static void __init h1940_init_irq(void) ...@@ -164,7 +165,7 @@ static void __init h1940_init_irq(void)
static void __init h1940_init(void) static void __init h1940_init(void)
{ {
set_s3c2410fb_info(&h1940_lcdcfg); s3c24xx_fb_set_platdata(&h1940_lcdcfg);
} }
MACHINE_START(H1940, "IPAQ-H1940") MACHINE_START(H1940, "IPAQ-H1940")
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA * 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA
* 14-Mar-2005 BJD void __iomem fixes * 14-Mar-2005 BJD void __iomem fixes
* 20-Sep-2005 BJD Added static to non-exported items * 20-Sep-2005 BJD Added static to non-exported items
* 26-Oct-2005 BJD Added framebuffer data
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -41,7 +42,10 @@ ...@@ -41,7 +42,10 @@
//#include <asm/debug-ll.h> //#include <asm/debug-ll.h>
#include <asm/arch/regs-serial.h> #include <asm/arch/regs-serial.h>
#include <asm/arch/regs-gpio.h> #include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-lcd.h>
#include <asm/arch/idle.h> #include <asm/arch/idle.h>
#include <asm/arch/fb.h>
#include "s3c2410.h" #include "s3c2410.h"
#include "s3c2440.h" #include "s3c2440.h"
...@@ -86,6 +90,70 @@ static struct s3c2410_uartcfg smdk2440_uartcfgs[] = { ...@@ -86,6 +90,70 @@ static struct s3c2410_uartcfg smdk2440_uartcfgs[] = {
} }
}; };
/* LCD driver info */
static struct s3c2410fb_mach_info smdk2440_lcd_cfg __initdata = {
.regs = {
.lcdcon1 = S3C2410_LCDCON1_TFT16BPP |
S3C2410_LCDCON1_TFT |
S3C2410_LCDCON1_CLKVAL(0x04),
.lcdcon2 = S3C2410_LCDCON2_VBPD(7) |
S3C2410_LCDCON2_LINEVAL(319) |
S3C2410_LCDCON2_VFPD(6) |
S3C2410_LCDCON2_VSPW(3),
.lcdcon3 = S3C2410_LCDCON3_HBPD(19) |
S3C2410_LCDCON3_HOZVAL(239) |
S3C2410_LCDCON3_HFPD(7),
.lcdcon4 = S3C2410_LCDCON4_MVAL(0) |
S3C2410_LCDCON4_HSPW(3),
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
},
#if 0
/* currently setup by downloader */
.gpccon = 0xaa940659,
.gpccon_mask = 0xffffffff,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa84aaa0,
.gpdcon_mask = 0xffffffff,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
#endif
.lpcsel = ((0xCE6) & ~7) | 1<<4,
.width = 240,
.height = 320,
.xres = {
.min = 240,
.max = 240,
.defval = 240,
},
.yres = {
.min = 320,
.max = 320,
.defval = 320,
},
.bpp = {
.min = 16,
.max = 16,
.defval = 16,
},
};
static struct platform_device *smdk2440_devices[] __initdata = { static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_usb, &s3c_device_usb,
&s3c_device_lcd, &s3c_device_lcd,
...@@ -121,6 +189,8 @@ static void __init smdk2440_machine_init(void) ...@@ -121,6 +189,8 @@ static void __init smdk2440_machine_init(void)
s3c2410_gpio_setpin(S3C2410_GPF6, 0); s3c2410_gpio_setpin(S3C2410_GPF6, 0);
s3c2410_gpio_setpin(S3C2410_GPF7, 0); s3c2410_gpio_setpin(S3C2410_GPF7, 0);
s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg);
s3c2410_pm_init(); s3c2410_pm_init();
} }
......
...@@ -388,9 +388,17 @@ static struct sa1100_port_fns assabet_port_fns __initdata = { ...@@ -388,9 +388,17 @@ static struct sa1100_port_fns assabet_port_fns __initdata = {
}; };
static struct map_desc assabet_io_desc[] __initdata = { static struct map_desc assabet_io_desc[] __initdata = {
/* virtual physical length type */ { /* Board Control Register */
{ 0xf1000000, 0x12000000, 0x00100000, MT_DEVICE }, /* Board Control Register */ .virtual = 0xf1000000,
{ 0xf2800000, 0x4b800000, 0x00800000, MT_DEVICE } /* MQ200 */ .pfn = __phys_to_pfn(0x12000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* MQ200 */
.virtual = 0xf2800000,
.pfn = __phys_to_pfn(0x4b800000),
.length = 0x00800000,
.type = MT_DEVICE
}
}; };
static void __init assabet_map_io(void) static void __init assabet_map_io(void)
......
...@@ -254,10 +254,22 @@ EXPORT_SYMBOL(badge4_set_5V); ...@@ -254,10 +254,22 @@ EXPORT_SYMBOL(badge4_set_5V);
static struct map_desc badge4_io_desc[] __initdata = { static struct map_desc badge4_io_desc[] __initdata = {
/* virtual physical length type */ { /* SRAM bank 1 */
{0xf1000000, 0x08000000, 0x00100000, MT_DEVICE },/* SRAM bank 1 */ .virtual = 0xf1000000,
{0xf2000000, 0x10000000, 0x00100000, MT_DEVICE },/* SRAM bank 2 */ .pfn = __phys_to_pfn(0x08000000),
{0xf4000000, 0x48000000, 0x00100000, MT_DEVICE } /* SA-1111 */ .length = 0x00100000,
.type = MT_DEVICE
}, { /* SRAM bank 2 */
.virtual = 0xf2000000,
.pfn = __phys_to_pfn(0x10000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* SA-1111 */
.virtual = 0xf4000000,
.pfn = __phys_to_pfn(0x48000000),
.length = 0x00100000,
.type = MT_DEVICE
}
}; };
static void static void
......
...@@ -100,8 +100,12 @@ static void __init cerf_init_irq(void) ...@@ -100,8 +100,12 @@ static void __init cerf_init_irq(void)
} }
static struct map_desc cerf_io_desc[] __initdata = { static struct map_desc cerf_io_desc[] __initdata = {
/* virtual physical length type */ { /* Crystal Ethernet Chip */
{ 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE } /* Crystal Ethernet Chip */ .virtual = 0xf0000000,
.pfn = __phys_to_pfn(0x08000000),
.length = 0x00100000,
.type = MT_DEVICE
}
}; };
static void __init cerf_map_io(void) static void __init cerf_map_io(void)
......
...@@ -171,9 +171,17 @@ static void __init collie_init(void) ...@@ -171,9 +171,17 @@ static void __init collie_init(void)
} }
static struct map_desc collie_io_desc[] __initdata = { static struct map_desc collie_io_desc[] __initdata = {
/* virtual physical length type */ { /* 32M main flash (cs0) */
{0xe8000000, 0x00000000, 0x02000000, MT_DEVICE}, /* 32M main flash (cs0) */ .virtual = 0xe8000000,
{0xea000000, 0x08000000, 0x02000000, MT_DEVICE}, /* 32M boot flash (cs1) */ .pfn = __phys_to_pfn(0x00000000),
.length = 0x02000000,
.type = MT_DEVICE
}, { /* 32M boot flash (cs1) */
.virtual = 0xea000000,
.pfn = __phys_to_pfn(0x08000000),
.length = 0x02000000,
.type = MT_DEVICE
}
}; };
static void __init collie_map_io(void) static void __init collie_map_io(void)
......
...@@ -369,11 +369,27 @@ EXPORT_SYMBOL(sa1100fb_lcd_power); ...@@ -369,11 +369,27 @@ EXPORT_SYMBOL(sa1100fb_lcd_power);
*/ */
static struct map_desc standard_io_desc[] __initdata = { static struct map_desc standard_io_desc[] __initdata = {
/* virtual physical length type */ { /* PCM */
{ 0xf8000000, 0x80000000, 0x00100000, MT_DEVICE }, /* PCM */ .virtual = 0xf8000000,
{ 0xfa000000, 0x90000000, 0x00100000, MT_DEVICE }, /* SCM */ .pfn = __phys_to_pfn(0x80000000),
{ 0xfc000000, 0xa0000000, 0x00100000, MT_DEVICE }, /* MER */ .length = 0x00100000,
{ 0xfe000000, 0xb0000000, 0x00200000, MT_DEVICE } /* LCD + DMA */ .type = MT_DEVICE
}, { /* SCM */
.virtual = 0xfa000000,
.pfn = __phys_to_pfn(0x90000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* MER */
.virtual = 0xfc000000,
.pfn = __phys_to_pfn(0xa0000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* LCD + DMA */
.virtual = 0xfe000000,
.pfn = __phys_to_pfn(0xb0000000),
.length = 0x00200000,
.type = MT_DEVICE
},
}; };
void __init sa1100_map_io(void) void __init sa1100_map_io(void)
......
...@@ -223,10 +223,22 @@ static void h3xxx_lcd_power(int enable) ...@@ -223,10 +223,22 @@ static void h3xxx_lcd_power(int enable)
} }
static struct map_desc h3600_io_desc[] __initdata = { static struct map_desc h3600_io_desc[] __initdata = {
/* virtual physical length type */ { /* static memory bank 2 CS#2 */
{ H3600_BANK_2_VIRT, SA1100_CS2_PHYS, 0x02800000, MT_DEVICE }, /* static memory bank 2 CS#2 */ .virtual = H3600_BANK_2_VIRT,
{ H3600_BANK_4_VIRT, SA1100_CS4_PHYS, 0x00800000, MT_DEVICE }, /* static memory bank 4 CS#4 */ .pfn = __phys_to_pfn(SA1100_CS2_PHYS),
{ H3600_EGPIO_VIRT, H3600_EGPIO_PHYS, 0x01000000, MT_DEVICE }, /* EGPIO 0 CS#5 */ .length = 0x02800000,
.type = MT_DEVICE
}, { /* static memory bank 4 CS#4 */
.virtual = H3600_BANK_4_VIRT,
.pfn = __phys_to_pfn(SA1100_CS4_PHYS),
.length = 0x00800000,
.type = MT_DEVICE
}, { /* EGPIO 0 CS#5 */
.virtual = H3600_EGPIO_VIRT,
.pfn = __phys_to_pfn(H3600_EGPIO_PHYS),
.length = 0x01000000,
.type = MT_DEVICE
}
}; };
/* /*
......
...@@ -57,8 +57,12 @@ static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate) ...@@ -57,8 +57,12 @@ static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
*/ */
static struct map_desc hackkit_io_desc[] __initdata = { static struct map_desc hackkit_io_desc[] __initdata = {
/* virtual physical length type */ { /* Flash bank 0 */
{ 0xe8000000, 0x00000000, 0x01000000, MT_DEVICE } /* Flash bank 0 */ .virtual = 0xe8000000,
.pfn = __phys_to_pfn(0x00000000),
.length = 0x01000000,
.type = MT_DEVICE
},
}; };
static struct sa1100_port_fns hackkit_port_fns __initdata = { static struct sa1100_port_fns hackkit_port_fns __initdata = {
......
...@@ -81,10 +81,22 @@ static int __init jornada720_init(void) ...@@ -81,10 +81,22 @@ static int __init jornada720_init(void)
arch_initcall(jornada720_init); arch_initcall(jornada720_init);
static struct map_desc jornada720_io_desc[] __initdata = { static struct map_desc jornada720_io_desc[] __initdata = {
/* virtual physical length type */ { /* Epson registers */
{ 0xf0000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Epson registers */ .virtual = 0xf0000000,
{ 0xf1000000, 0x48200000, 0x00100000, MT_DEVICE }, /* Epson frame buffer */ .pfn = __phys_to_pfn(0x48000000),
{ 0xf4000000, 0x40000000, 0x00100000, MT_DEVICE } /* SA-1111 */ .length = 0x00100000,
.type = MT_DEVICE
}, { /* Epson frame buffer */
.virtual = 0xf1000000,
.pfn = __phys_to_pfn(0x48200000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* SA-1111 */
.virtual = 0xf4000000,
.pfn = __phys_to_pfn(0x40000000),
.length = 0x00100000,
.type = MT_DEVICE
}
}; };
static void __init jornada720_map_io(void) static void __init jornada720_map_io(void)
......
...@@ -31,9 +31,17 @@ static void __init lart_init(void) ...@@ -31,9 +31,17 @@ static void __init lart_init(void)
} }
static struct map_desc lart_io_desc[] __initdata = { static struct map_desc lart_io_desc[] __initdata = {
/* virtual physical length type */ { /* main flash memory */
{ 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */ .virtual = 0xe8000000,
{ 0xec000000, 0x08000000, 0x00400000, MT_DEVICE } /* main flash, alternative location */ .pfn = __phys_to_pfn(0x00000000),
.length = 0x00400000,
.type = MT_DEVICE
}, { /* main flash, alternative location */
.virtual = 0xec000000,
.pfn = __phys_to_pfn(0x08000000),
.length = 0x00400000,
.type = MT_DEVICE
}
}; };
static void __init lart_map_io(void) static void __init lart_map_io(void)
......
...@@ -331,9 +331,17 @@ static int __init neponset_init(void) ...@@ -331,9 +331,17 @@ static int __init neponset_init(void)
subsys_initcall(neponset_init); subsys_initcall(neponset_init);
static struct map_desc neponset_io_desc[] __initdata = { static struct map_desc neponset_io_desc[] __initdata = {
/* virtual physical length type */ { /* System Registers */
{ 0xf3000000, 0x10000000, SZ_1M, MT_DEVICE }, /* System Registers */ .virtual = 0xf3000000,
{ 0xf4000000, 0x40000000, SZ_1M, MT_DEVICE } /* SA-1111 */ .pfn = __phys_to_pfn(0x10000000),
.length = SZ_1M,
.type = MT_DEVICE
}, { /* SA-1111 */
.virtual = 0xf4000000,
.pfn = __phys_to_pfn(0x40000000),
.length = SZ_1M,
.type = MT_DEVICE
}
}; };
void __init neponset_map_io(void) void __init neponset_map_io(void)
......
...@@ -60,11 +60,17 @@ EXPORT_SYMBOL(set_cs3_bit); ...@@ -60,11 +60,17 @@ EXPORT_SYMBOL(set_cs3_bit);
EXPORT_SYMBOL(clear_cs3_bit); EXPORT_SYMBOL(clear_cs3_bit);
static struct map_desc simpad_io_desc[] __initdata = { static struct map_desc simpad_io_desc[] __initdata = {
/* virtual physical length type */ { /* MQ200 */
/* MQ200 */ .virtual = 0xf2800000,
{ 0xf2800000, 0x4b800000, 0x00800000, MT_DEVICE }, .pfn = __phys_to_pfn(0x4b800000),
/* Paules CS3, write only */ .length = 0x00800000,
{ 0xf1000000, 0x18000000, 0x00100000, MT_DEVICE }, .type = MT_DEVICE
}, { /* Paules CS3, write only */
.virtual = 0xf1000000,
.pfn = __phys_to_pfn(0x18000000),
.length = 0x00100000,
.type = MT_DEVICE
},
}; };
......
...@@ -62,7 +62,12 @@ arch_initcall(shark_init); ...@@ -62,7 +62,12 @@ arch_initcall(shark_init);
extern void shark_init_irq(void); extern void shark_init_irq(void);
static struct map_desc shark_io_desc[] __initdata = { static struct map_desc shark_io_desc[] __initdata = {
{ IO_BASE , IO_START , IO_SIZE , MT_DEVICE } {
.virtual = IO_BASE,
.pfn = __phys_to_pfn(IO_START),
.length = IO_SIZE,
.type = MT_DEVICE
}
}; };
static void __init shark_map_io(void) static void __init shark_map_io(void)
......
...@@ -186,25 +186,82 @@ void __init versatile_init_irq(void) ...@@ -186,25 +186,82 @@ void __init versatile_init_irq(void)
} }
static struct map_desc versatile_io_desc[] __initdata = { static struct map_desc versatile_io_desc[] __initdata = {
{ IO_ADDRESS(VERSATILE_SYS_BASE), VERSATILE_SYS_BASE, SZ_4K, MT_DEVICE }, {
{ IO_ADDRESS(VERSATILE_SIC_BASE), VERSATILE_SIC_BASE, SZ_4K, MT_DEVICE }, .virtual = IO_ADDRESS(VERSATILE_SYS_BASE),
{ IO_ADDRESS(VERSATILE_VIC_BASE), VERSATILE_VIC_BASE, SZ_4K, MT_DEVICE }, .pfn = __phys_to_pfn(VERSATILE_SYS_BASE),
{ IO_ADDRESS(VERSATILE_SCTL_BASE), VERSATILE_SCTL_BASE, SZ_4K * 9, MT_DEVICE }, .length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(VERSATILE_SIC_BASE),
.pfn = __phys_to_pfn(VERSATILE_SIC_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(VERSATILE_VIC_BASE),
.pfn = __phys_to_pfn(VERSATILE_VIC_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(VERSATILE_SCTL_BASE),
.pfn = __phys_to_pfn(VERSATILE_SCTL_BASE),
.length = SZ_4K * 9,
.type = MT_DEVICE
},
#ifdef CONFIG_MACH_VERSATILE_AB #ifdef CONFIG_MACH_VERSATILE_AB
{ IO_ADDRESS(VERSATILE_GPIO0_BASE), VERSATILE_GPIO0_BASE, SZ_4K, MT_DEVICE }, {
{ IO_ADDRESS(VERSATILE_IB2_BASE), VERSATILE_IB2_BASE, SZ_64M, MT_DEVICE }, .virtual = IO_ADDRESS(VERSATILE_GPIO0_BASE),
.pfn = __phys_to_pfn(VERSATILE_GPIO0_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = IO_ADDRESS(VERSATILE_IB2_BASE),
.pfn = __phys_to_pfn(VERSATILE_IB2_BASE),
.length = SZ_64M,
.type = MT_DEVICE
},
#endif #endif
#ifdef CONFIG_DEBUG_LL #ifdef CONFIG_DEBUG_LL
{ IO_ADDRESS(VERSATILE_UART0_BASE), VERSATILE_UART0_BASE, SZ_4K, MT_DEVICE }, {
.virtual = IO_ADDRESS(VERSATILE_UART0_BASE),
.pfn = __phys_to_pfn(VERSATILE_UART0_BASE),
.length = SZ_4K,
.type = MT_DEVICE
},
#endif #endif
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
{ IO_ADDRESS(VERSATILE_PCI_CORE_BASE), VERSATILE_PCI_CORE_BASE, SZ_4K, MT_DEVICE }, {
{ VERSATILE_PCI_VIRT_BASE, VERSATILE_PCI_BASE, VERSATILE_PCI_BASE_SIZE, MT_DEVICE }, .virtual = IO_ADDRESS(VERSATILE_PCI_CORE_BASE),
{ VERSATILE_PCI_CFG_VIRT_BASE, VERSATILE_PCI_CFG_BASE, VERSATILE_PCI_CFG_BASE_SIZE, MT_DEVICE }, .pfn = __phys_to_pfn(VERSATILE_PCI_CORE_BASE),
.length = SZ_4K,
.type = MT_DEVICE
}, {
.virtual = VERSATILE_PCI_VIRT_BASE,
.pfn = __phys_to_pfn(VERSATILE_PCI_BASE),
.length = VERSATILE_PCI_BASE_SIZE,
.type = MT_DEVICE
}, {
.virtual = VERSATILE_PCI_CFG_VIRT_BASE,
.pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE),
.length = VERSATILE_PCI_CFG_BASE_SIZE,
.type = MT_DEVICE
},
#if 0 #if 0
{ VERSATILE_PCI_VIRT_MEM_BASE0, VERSATILE_PCI_MEM_BASE0, SZ_16M, MT_DEVICE }, {
{ VERSATILE_PCI_VIRT_MEM_BASE1, VERSATILE_PCI_MEM_BASE1, SZ_16M, MT_DEVICE }, .virtual = VERSATILE_PCI_VIRT_MEM_BASE0,
{ VERSATILE_PCI_VIRT_MEM_BASE2, VERSATILE_PCI_MEM_BASE2, SZ_16M, MT_DEVICE }, .pfn = __phys_to_pfn(VERSATILE_PCI_MEM_BASE0),
.length = SZ_16M,
.type = MT_DEVICE
}, {
.virtual = VERSATILE_PCI_VIRT_MEM_BASE1,
.pfn = __phys_to_pfn(VERSATILE_PCI_MEM_BASE1),
.length = SZ_16M,
.type = MT_DEVICE
}, {
.virtual = VERSATILE_PCI_VIRT_MEM_BASE2,
.pfn = __phys_to_pfn(VERSATILE_PCI_MEM_BASE2),
.length = SZ_16M,
.type = MT_DEVICE
},
#endif #endif
#endif #endif
}; };
......
This diff is collapsed.
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/hardware.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
......
/* /*
* linux/arch/arm/mm/mm-armv.c * linux/arch/arm/mm/mm-armv.c
* *
* Copyright (C) 1998-2002 Russell King * Copyright (C) 1998-2005 Russell King
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -305,16 +305,6 @@ alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pg ...@@ -305,16 +305,6 @@ alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pg
set_pte(ptep, pfn_pte(phys >> PAGE_SHIFT, prot)); set_pte(ptep, pfn_pte(phys >> PAGE_SHIFT, prot));
} }
/*
* Clear any PGD mapping. On a two-level page table system,
* the clearance is done by the middle-level functions (pmd)
* rather than the top-level (pgd) functions.
*/
static inline void clear_mapping(unsigned long virt)
{
pmd_clear(pmd_off_k(virt));
}
struct mem_types { struct mem_types {
unsigned int prot_pte; unsigned int prot_pte;
unsigned int prot_l1; unsigned int prot_l1;
...@@ -373,7 +363,7 @@ static struct mem_types mem_types[] __initdata = { ...@@ -373,7 +363,7 @@ static struct mem_types mem_types[] __initdata = {
/* /*
* Adjust the PMD section entries according to the CPU in use. * Adjust the PMD section entries according to the CPU in use.
*/ */
static void __init build_mem_type_table(void) void __init build_mem_type_table(void)
{ {
struct cachepolicy *cp; struct cachepolicy *cp;
unsigned int cr = get_cr(); unsigned int cr = get_cr();
...@@ -483,25 +473,25 @@ static void __init build_mem_type_table(void) ...@@ -483,25 +473,25 @@ static void __init build_mem_type_table(void)
* offsets, and we take full advantage of sections and * offsets, and we take full advantage of sections and
* supersections. * supersections.
*/ */
static void __init create_mapping(struct map_desc *md) void __init create_mapping(struct map_desc *md)
{ {
unsigned long virt, length; unsigned long virt, length;
int prot_sect, prot_l1, domain; int prot_sect, prot_l1, domain;
pgprot_t prot_pte; pgprot_t prot_pte;
long off; unsigned long off = (u32)__pfn_to_phys(md->pfn);
if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) { if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
printk(KERN_WARNING "BUG: not creating mapping for " printk(KERN_WARNING "BUG: not creating mapping for "
"0x%08lx at 0x%08lx in user region\n", "0x%016llx at 0x%08lx in user region\n",
md->physical, md->virtual); __pfn_to_phys((u64)md->pfn), md->virtual);
return; return;
} }
if ((md->type == MT_DEVICE || md->type == MT_ROM) && if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) { md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {
printk(KERN_WARNING "BUG: mapping for 0x%08lx at 0x%08lx " printk(KERN_WARNING "BUG: mapping for 0x%016llx at 0x%08lx "
"overlaps vmalloc space\n", "overlaps vmalloc space\n",
md->physical, md->virtual); __pfn_to_phys((u64)md->pfn), md->virtual);
} }
domain = mem_types[md->type].domain; domain = mem_types[md->type].domain;
...@@ -509,15 +499,40 @@ static void __init create_mapping(struct map_desc *md) ...@@ -509,15 +499,40 @@ static void __init create_mapping(struct map_desc *md)
prot_l1 = mem_types[md->type].prot_l1 | PMD_DOMAIN(domain); prot_l1 = mem_types[md->type].prot_l1 | PMD_DOMAIN(domain);
prot_sect = mem_types[md->type].prot_sect | PMD_DOMAIN(domain); prot_sect = mem_types[md->type].prot_sect | PMD_DOMAIN(domain);
/*
* Catch 36-bit addresses
*/
if(md->pfn >= 0x100000) {
if(domain) {
printk(KERN_ERR "MM: invalid domain in supersection "
"mapping for 0x%016llx at 0x%08lx\n",
__pfn_to_phys((u64)md->pfn), md->virtual);
return;
}
if((md->virtual | md->length | __pfn_to_phys(md->pfn))
& ~SUPERSECTION_MASK) {
printk(KERN_ERR "MM: cannot create mapping for "
"0x%016llx at 0x%08lx invalid alignment\n",
__pfn_to_phys((u64)md->pfn), md->virtual);
return;
}
/*
* Shift bits [35:32] of address into bits [23:20] of PMD
* (See ARMv6 spec).
*/
off |= (((md->pfn >> (32 - PAGE_SHIFT)) & 0xF) << 20);
}
virt = md->virtual; virt = md->virtual;
off = md->physical - virt; off -= virt;
length = md->length; length = md->length;
if (mem_types[md->type].prot_l1 == 0 && if (mem_types[md->type].prot_l1 == 0 &&
(virt & 0xfffff || (virt + off) & 0xfffff || (virt + length) & 0xfffff)) { (virt & 0xfffff || (virt + off) & 0xfffff || (virt + length) & 0xfffff)) {
printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not " printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not "
"be mapped using pages, ignoring.\n", "be mapped using pages, ignoring.\n",
md->physical, md->virtual); __pfn_to_phys(md->pfn), md->virtual);
return; return;
} }
...@@ -535,14 +550,23 @@ static void __init create_mapping(struct map_desc *md) ...@@ -535,14 +550,23 @@ static void __init create_mapping(struct map_desc *md)
* of the actual domain assignments in use. * of the actual domain assignments in use.
*/ */
if (cpu_architecture() >= CPU_ARCH_ARMv6 && domain == 0) { if (cpu_architecture() >= CPU_ARCH_ARMv6 && domain == 0) {
/* Align to supersection boundary */ /*
while ((virt & ~SUPERSECTION_MASK || (virt + off) & * Align to supersection boundary if !high pages.
~SUPERSECTION_MASK) && length >= (PGDIR_SIZE / 2)) { * High pages have already been checked for proper
* alignment above and they will fail the SUPSERSECTION_MASK
* check because of the way the address is encoded into
* offset.
*/
if (md->pfn <= 0x100000) {
while ((virt & ~SUPERSECTION_MASK ||
(virt + off) & ~SUPERSECTION_MASK) &&
length >= (PGDIR_SIZE / 2)) {
alloc_init_section(virt, virt + off, prot_sect); alloc_init_section(virt, virt + off, prot_sect);
virt += (PGDIR_SIZE / 2); virt += (PGDIR_SIZE / 2);
length -= (PGDIR_SIZE / 2); length -= (PGDIR_SIZE / 2);
} }
}
while (length >= SUPERSECTION_SIZE) { while (length >= SUPERSECTION_SIZE) {
alloc_init_supersection(virt, virt + off, prot_sect); alloc_init_supersection(virt, virt + off, prot_sect);
...@@ -601,100 +625,6 @@ void setup_mm_for_reboot(char mode) ...@@ -601,100 +625,6 @@ void setup_mm_for_reboot(char mode)
} }
} }
extern void _stext, _etext;
/*
* Setup initial mappings. We use the page we allocated for zero page to hold
* the mappings, which will get overwritten by the vectors in traps_init().
* The mappings must be in virtual address order.
*/
void __init memtable_init(struct meminfo *mi)
{
struct map_desc *init_maps, *p, *q;
unsigned long address = 0;
int i;
build_mem_type_table();
init_maps = p = alloc_bootmem_low_pages(PAGE_SIZE);
#ifdef CONFIG_XIP_KERNEL
p->physical = CONFIG_XIP_PHYS_ADDR & PMD_MASK;
p->virtual = (unsigned long)&_stext & PMD_MASK;
p->length = ((unsigned long)&_etext - p->virtual + ~PMD_MASK) & PMD_MASK;
p->type = MT_ROM;
p ++;
#endif
for (i = 0; i < mi->nr_banks; i++) {
if (mi->bank[i].size == 0)
continue;
p->physical = mi->bank[i].start;
p->virtual = __phys_to_virt(p->physical);
p->length = mi->bank[i].size;
p->type = MT_MEMORY;
p ++;
}
#ifdef FLUSH_BASE
p->physical = FLUSH_BASE_PHYS;
p->virtual = FLUSH_BASE;
p->length = PGDIR_SIZE;
p->type = MT_CACHECLEAN;
p ++;
#endif
#ifdef FLUSH_BASE_MINICACHE
p->physical = FLUSH_BASE_PHYS + PGDIR_SIZE;
p->virtual = FLUSH_BASE_MINICACHE;
p->length = PGDIR_SIZE;
p->type = MT_MINICLEAN;
p ++;
#endif
/*
* Go through the initial mappings, but clear out any
* pgdir entries that are not in the description.
*/
q = init_maps;
do {
if (address < q->virtual || q == p) {
clear_mapping(address);
address += PGDIR_SIZE;
} else {
create_mapping(q);
address = q->virtual + q->length;
address = (address + PGDIR_SIZE - 1) & PGDIR_MASK;
q ++;
}
} while (address != 0);
/*
* Create a mapping for the machine vectors at the high-vectors
* location (0xffff0000). If we aren't using high-vectors, also
* create a mapping at the low-vectors virtual address.
*/
init_maps->physical = virt_to_phys(init_maps);
init_maps->virtual = 0xffff0000;
init_maps->length = PAGE_SIZE;
init_maps->type = MT_HIGH_VECTORS;
create_mapping(init_maps);
if (!vectors_high()) {
init_maps->virtual = 0;
init_maps->type = MT_LOW_VECTORS;
create_mapping(init_maps);
}
flush_cache_all();
local_flush_tlb_all();
top_pmd = pmd_off_k(0xffff0000);
}
/* /*
* Create the architecture specific mappings * Create the architecture specific mappings
*/ */
......
...@@ -6,6 +6,6 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ ...@@ -6,6 +6,6 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
oprofilefs.o oprofile_stats.o \ oprofilefs.o oprofile_stats.o \
timer_int.o ) timer_int.o )
oprofile-y := $(DRIVER_OBJS) init.o backtrace.o oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
oprofile-$(CONFIG_CPU_XSCALE) += common.o op_model_xscale.o oprofile-$(CONFIG_CPU_XSCALE) += op_model_xscale.o
...@@ -10,40 +10,94 @@ ...@@ -10,40 +10,94 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/oprofile.h> #include <linux/oprofile.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/semaphore.h>
#include <linux/sysdev.h> #include <linux/sysdev.h>
#include <asm/semaphore.h>
#include "op_counter.h" #include "op_counter.h"
#include "op_arm_model.h" #include "op_arm_model.h"
static struct op_arm_model_spec *pmu_model; static struct op_arm_model_spec *op_arm_model;
static int pmu_enabled; static int op_arm_enabled;
static struct semaphore pmu_sem; static struct semaphore op_arm_sem;
struct op_counter_config counter_config[OP_MAX_COUNTER];
static int op_arm_create_files(struct super_block *sb, struct dentry *root)
{
unsigned int i;
for (i = 0; i < op_arm_model->num_counters; i++) {
struct dentry *dir;
char buf[2];
snprintf(buf, sizeof buf, "%d", i);
dir = oprofilefs_mkdir(sb, root, buf);
oprofilefs_create_ulong(sb, dir, "enabled", &counter_config[i].enabled);
oprofilefs_create_ulong(sb, dir, "event", &counter_config[i].event);
oprofilefs_create_ulong(sb, dir, "count", &counter_config[i].count);
oprofilefs_create_ulong(sb, dir, "unit_mask", &counter_config[i].unit_mask);
oprofilefs_create_ulong(sb, dir, "kernel", &counter_config[i].kernel);
oprofilefs_create_ulong(sb, dir, "user", &counter_config[i].user);
}
return 0;
}
static int op_arm_setup(void)
{
int ret;
spin_lock(&oprofilefs_lock);
ret = op_arm_model->setup_ctrs();
spin_unlock(&oprofilefs_lock);
return ret;
}
static int op_arm_start(void)
{
int ret = -EBUSY;
down(&op_arm_sem);
if (!op_arm_enabled) {
ret = op_arm_model->start();
op_arm_enabled = !ret;
}
up(&op_arm_sem);
return ret;
}
static int pmu_start(void); static void op_arm_stop(void)
static int pmu_setup(void); {
static void pmu_stop(void); down(&op_arm_sem);
static int pmu_create_files(struct super_block *, struct dentry *); if (op_arm_enabled)
op_arm_model->stop();
op_arm_enabled = 0;
up(&op_arm_sem);
}
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int pmu_suspend(struct sys_device *dev, pm_message_t state) static int op_arm_suspend(struct sys_device *dev, pm_message_t state)
{ {
if (pmu_enabled) down(&op_arm_sem);
pmu_stop(); if (op_arm_enabled)
op_arm_model->stop();
up(&op_arm_sem);
return 0; return 0;
} }
static int pmu_resume(struct sys_device *dev) static int op_arm_resume(struct sys_device *dev)
{ {
if (pmu_enabled) down(&op_arm_sem);
pmu_start(); if (op_arm_enabled && op_arm_model->start())
op_arm_enabled = 0;
up(&op_arm_sem);
return 0; return 0;
} }
static struct sysdev_class oprofile_sysclass = { static struct sysdev_class oprofile_sysclass = {
set_kset_name("oprofile"), set_kset_name("oprofile"),
.resume = pmu_resume, .resume = op_arm_resume,
.suspend = pmu_suspend, .suspend = op_arm_suspend,
}; };
static struct sys_device device_oprofile = { static struct sys_device device_oprofile = {
...@@ -71,86 +125,41 @@ static void exit_driverfs(void) ...@@ -71,86 +125,41 @@ static void exit_driverfs(void)
#define exit_driverfs() do { } while (0) #define exit_driverfs() do { } while (0)
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
struct op_counter_config counter_config[OP_MAX_COUNTER]; int __init oprofile_arch_init(struct oprofile_operations *ops)
static int pmu_create_files(struct super_block *sb, struct dentry *root)
{
unsigned int i;
for (i = 0; i < pmu_model->num_counters; i++) {
struct dentry *dir;
char buf[2];
snprintf(buf, sizeof buf, "%d", i);
dir = oprofilefs_mkdir(sb, root, buf);
oprofilefs_create_ulong(sb, dir, "enabled", &counter_config[i].enabled);
oprofilefs_create_ulong(sb, dir, "event", &counter_config[i].event);
oprofilefs_create_ulong(sb, dir, "count", &counter_config[i].count);
oprofilefs_create_ulong(sb, dir, "unit_mask", &counter_config[i].unit_mask);
oprofilefs_create_ulong(sb, dir, "kernel", &counter_config[i].kernel);
oprofilefs_create_ulong(sb, dir, "user", &counter_config[i].user);
}
return 0;
}
static int pmu_setup(void)
{
int ret;
spin_lock(&oprofilefs_lock);
ret = pmu_model->setup_ctrs();
spin_unlock(&oprofilefs_lock);
return ret;
}
static int pmu_start(void)
{ {
int ret = -EBUSY; struct op_arm_model_spec *spec = NULL;
int ret = -ENODEV;
down(&pmu_sem); #ifdef CONFIG_CPU_XSCALE
if (!pmu_enabled) { spec = &op_xscale_spec;
ret = pmu_model->start(); #endif
pmu_enabled = !ret;
}
up(&pmu_sem);
return ret;
}
static void pmu_stop(void)
{
down(&pmu_sem);
if (pmu_enabled)
pmu_model->stop();
pmu_enabled = 0;
up(&pmu_sem);
}
int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec) if (spec) {
{ init_MUTEX(&op_arm_sem);
init_MUTEX(&pmu_sem);
if (spec->init() < 0) if (spec->init() < 0)
return -ENODEV; return -ENODEV;
pmu_model = spec; op_arm_model = spec;
init_driverfs(); init_driverfs();
ops->create_files = pmu_create_files; ops->create_files = op_arm_create_files;
ops->setup = pmu_setup; ops->setup = op_arm_setup;
ops->shutdown = pmu_stop; ops->shutdown = op_arm_stop;
ops->start = pmu_start; ops->start = op_arm_start;
ops->stop = pmu_stop; ops->stop = op_arm_stop;
ops->cpu_type = pmu_model->name; ops->cpu_type = op_arm_model->name;
printk(KERN_INFO "oprofile: using %s PMU\n", spec->name); ops->backtrace = arm_backtrace;
printk(KERN_INFO "oprofile: using %s\n", spec->name);
}
return 0; return ret;
} }
void pmu_exit(void) void oprofile_arch_exit(void)
{ {
if (pmu_model) { if (op_arm_model) {
exit_driverfs(); exit_driverfs();
pmu_model = NULL; op_arm_model = NULL;
} }
} }
/**
* @file init.c
*
* @remark Copyright 2004 Oprofile Authors
* @remark Read the file COPYING
*
* @author Zwane Mwaikambo
*/
#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/errno.h>
#include "op_arm_model.h"
int __init oprofile_arch_init(struct oprofile_operations *ops)
{
int ret = -ENODEV;
#ifdef CONFIG_CPU_XSCALE
ret = pmu_init(ops, &op_xscale_spec);
#endif
ops->backtrace = arm_backtrace;
return ret;
}
void oprofile_arch_exit(void)
{
#ifdef CONFIG_CPU_XSCALE
pmu_exit();
#endif
}
...@@ -26,6 +26,6 @@ extern struct op_arm_model_spec op_xscale_spec; ...@@ -26,6 +26,6 @@ extern struct op_arm_model_spec op_xscale_spec;
extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth); extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth);
extern int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec); extern int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec);
extern void pmu_exit(void); extern void op_arm_exit(void);
#endif /* OP_ARM_MODEL_H */ #endif /* OP_ARM_MODEL_H */
...@@ -59,7 +59,11 @@ void __init omap_detect_sram(void) ...@@ -59,7 +59,11 @@ void __init omap_detect_sram(void)
} }
static struct map_desc omap_sram_io_desc[] __initdata = { static struct map_desc omap_sram_io_desc[] __initdata = {
{ OMAP1_SRAM_BASE, OMAP1_SRAM_START, 0, MT_DEVICE } { /* .length gets filled in at runtime */
.virtual = OMAP1_SRAM_BASE,
.pfn = __phys_to_pfn(OMAP1_SRAM_START),
.type = MT_DEVICE
}
}; };
/* /*
......
This diff is collapsed.
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/scatterlist.h> #include <asm/scatterlist.h>
#include <asm/sizes.h>
#include <asm/hardware/amba.h> #include <asm/hardware/amba.h>
#include <asm/hardware/clock.h> #include <asm/hardware/clock.h>
#include <asm/mach/mmc.h> #include <asm/mach/mmc.h>
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/concat.h> #include <linux/mtd/concat.h>
#include <asm/hardware.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include <asm/mach/flash.h> #include <asm/mach/flash.h>
......
...@@ -1338,7 +1338,7 @@ config FORCEDETH ...@@ -1338,7 +1338,7 @@ config FORCEDETH
config CS89x0 config CS89x0
tristate "CS89x0 support" tristate "CS89x0 support"
depends on (NET_PCI && (ISA || ARCH_IXDP2X01)) || ARCH_PNX0105 depends on (NET_PCI && (ISA || ARCH_IXDP2X01)) || ARCH_PNX0105 || MACH_MP1000
---help--- ---help---
Support for CS89x0 chipset based Ethernet cards. If you have a Support for CS89x0 chipset based Ethernet cards. If you have a
network (Ethernet) card of this type, say Y and read the network (Ethernet) card of this type, say Y and read the
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/io.h> #include <asm/io.h>
#define TX_BUFFERS 15 #define TX_BUFFERS 15
......
...@@ -182,6 +182,10 @@ static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0}; ...@@ -182,6 +182,10 @@ static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0};
#define CIRRUS_DEFAULT_IRQ VH_INTC_INT_NUM_CASCADED_INTERRUPT_1 /* Event inputs bank 1 - ID 35/bit 3 */ #define CIRRUS_DEFAULT_IRQ VH_INTC_INT_NUM_CASCADED_INTERRUPT_1 /* Event inputs bank 1 - ID 35/bit 3 */
static unsigned int netcard_portlist[] __initdata = {CIRRUS_DEFAULT_BASE, 0}; static unsigned int netcard_portlist[] __initdata = {CIRRUS_DEFAULT_BASE, 0};
static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0}; static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
#elif defined(CONFIG_MACH_MP1000)
#include <asm/arch/mp1000-seprom.h>
static unsigned int netcard_portlist[] __initdata = {MP1000_EIO_BASE+0x300, 0};
static unsigned int cs8900_irq_map[] = {IRQ_EINT3,0,0,0};
#else #else
static unsigned int netcard_portlist[] __initdata = static unsigned int netcard_portlist[] __initdata =
{ 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
...@@ -590,6 +594,10 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) ...@@ -590,6 +594,10 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
cnt -= j; cnt -= j;
} }
} else } else
#elif defined(CONFIG_MACH_MP1000)
if (1) {
memcpy(dev->dev_addr, get_eeprom_mac_address(), ETH_ALEN);
} else
#endif #endif
if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) == if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) ==
...@@ -649,6 +657,10 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) ...@@ -649,6 +657,10 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
if (1) { if (1) {
printk(KERN_NOTICE "cs89x0: No EEPROM on HiCO.SH4\n"); printk(KERN_NOTICE "cs89x0: No EEPROM on HiCO.SH4\n");
} else } else
#elif defined(CONFIG_MACH_MP1000)
if (1) {
lp->force |= FORCE_RJ45;
} else
#endif #endif
if ((readreg(dev, PP_SelfST) & EEPROM_PRESENT) == 0) if ((readreg(dev, PP_SelfST) & EEPROM_PRESENT) == 0)
printk(KERN_WARNING "cs89x0: No EEPROM, relying on command line....\n"); printk(KERN_WARNING "cs89x0: No EEPROM, relying on command line....\n");
...@@ -1231,7 +1243,7 @@ net_open(struct net_device *dev) ...@@ -1231,7 +1243,7 @@ net_open(struct net_device *dev)
else else
#endif #endif
{ {
#if !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX0105) #if !defined(CONFIG_ARCH_IXDP2X01) && !defined(CONFIG_ARCH_PNX0105) && !defined(CONFIG_MACH_MP1000)
if (((1 << dev->irq) & lp->irq_map) == 0) { if (((1 << dev->irq) & lp->irq_map) == 0) {
printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
dev->name, dev->irq, lp->irq_map); dev->name, dev->irq, lp->irq_map);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/config.h> #include <linux/config.h>
#if defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX0105) #if defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX0105) || defined (CONFIG_MACH_MP1000)
/* IXDP2401/IXDP2801 uses dword-aligned register addressing */ /* IXDP2401/IXDP2801 uses dword-aligned register addressing */
#define CS89x0_PORT(reg) ((reg) * 2) #define CS89x0_PORT(reg) ((reg) * 2)
#else #else
......
...@@ -400,5 +400,15 @@ config VIA_FIR ...@@ -400,5 +400,15 @@ config VIA_FIR
To compile it as a module, choose M here: the module will be called To compile it as a module, choose M here: the module will be called
via-ircc. via-ircc.
config PXA_FICP
tristate "Intel PXA2xx Internal FICP"
depends on ARCH_PXA && IRDA
help
Say Y or M here if you want to build support for the PXA2xx
built-in IRDA interface which can support both SIR and FIR.
This driver relies on platform specific helper routines so
available capabilities may vary from one PXA2xx target to
another.
endmenu endmenu
...@@ -18,6 +18,7 @@ obj-$(CONFIG_SMC_IRCC_FIR) += smsc-ircc2.o ...@@ -18,6 +18,7 @@ obj-$(CONFIG_SMC_IRCC_FIR) += smsc-ircc2.o
obj-$(CONFIG_ALI_FIR) += ali-ircc.o obj-$(CONFIG_ALI_FIR) += ali-ircc.o
obj-$(CONFIG_VLSI_FIR) += vlsi_ir.o obj-$(CONFIG_VLSI_FIR) += vlsi_ir.o
obj-$(CONFIG_VIA_FIR) += via-ircc.o obj-$(CONFIG_VIA_FIR) += via-ircc.o
obj-$(CONFIG_PXA_FICP) += pxaficp_ir.o
# Old dongle drivers for old SIR drivers # Old dongle drivers for old SIR drivers
obj-$(CONFIG_ESI_DONGLE_OLD) += esi.o obj-$(CONFIG_ESI_DONGLE_OLD) += esi.o
obj-$(CONFIG_TEKRAM_DONGLE_OLD) += tekram.o obj-$(CONFIG_TEKRAM_DONGLE_OLD) += tekram.o
......
This diff is collapsed.
...@@ -122,7 +122,7 @@ void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) ...@@ -122,7 +122,7 @@ void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
static int pcmcia_probe(struct sa1111_dev *dev) static int pcmcia_probe(struct sa1111_dev *dev)
{ {
char *base; void __iomem *base;
if (!request_mem_region(dev->res.start, 512, if (!request_mem_region(dev->res.start, 512,
SA1111_DRIVER_NAME(dev))) SA1111_DRIVER_NAME(dev)))
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/hardware/amba.h> #include <asm/hardware/amba.h>
#include <asm/hardware/amba_serial.h> #include <asm/hardware/amba_serial.h>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment