Commit ddacbff2 authored by Russell King's avatar Russell King

Merge flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5

into flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5-rmk
parents f4e1c439 e78e17ad
This diff is collapsed.
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
SYSTEM =$(TOPDIR)/vmlinux SYSTEM =$(TOPDIR)/vmlinux
# Note: the following conditions must always be true:
# ZRELADDR == virt_to_phys(TEXTADDR)
# PARAMS_PHYS must be with 4MB of ZRELADDR
# INITRD_PHYS must be in RAM
ifeq ($(CONFIG_CPU_26),y) ifeq ($(CONFIG_CPU_26),y)
ZRELADDR = 0x02080000 ZRELADDR = 0x02080000
PARAMS_PHYS = 0x0207c000 PARAMS_PHYS = 0x0207c000
...@@ -129,14 +134,14 @@ zImage: compressed/vmlinux ...@@ -129,14 +134,14 @@ zImage: compressed/vmlinux
bootpImage: bootp/bootp bootpImage: bootp/bootp
$(OBJCOPY) $(OBJCOPYFLAGS) $< $@ $(OBJCOPY) $(OBJCOPYFLAGS) $< $@
compressed/vmlinux: $(TOPDIR)/vmlinux compressed/vmlinux: $(TOPDIR)/vmlinux FORCE
@$(MAKE) -C compressed vmlinux @$(MAKE) -C compressed vmlinux
bootp/bootp: zImage initrd bootp/bootp: zImage initrd FORCE
@$(MAKE) -C bootp bootp @$(MAKE) -C bootp bootp
initrd: initrd:
@test "$(INITRD_PHYS)" != "" || (echo This architecture does not support INITRD; exit -1) @test "$(INITRD_PHYS)" != "" || (echo This machine does not support INITRD; exit -1)
@test "$(INITRD)" != "" || (echo You must specify INITRD; exit -1) @test "$(INITRD)" != "" || (echo You must specify INITRD; exit -1)
install: Image install: Image
...@@ -149,3 +154,5 @@ clean: ...@@ -149,3 +154,5 @@ clean:
$(RM) Image zImage bootpImage $(RM) Image zImage bootpImage
@$(MAKE) -C compressed clean @$(MAKE) -C compressed clean
@$(MAKE) -C bootp clean @$(MAKE) -C bootp clean
FORCE:
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
ZSYSTEM =$(TOPDIR)/arch/arm/boot/zImage ZSYSTEM =$(TOPDIR)/arch/arm/boot/zImage
ZLDFLAGS =-p -X -T bootp.lds \ ZLDFLAGS =-p -X -T bootp.lds \
--defsym initrd_addr=$(INITRD_PHYS) \ --defsym initrd_addr=$(INITRD_PHYS) \
--defsym params=$(PARAMS_PHYS) \ --defsym params=$(PARAMS_PHYS)
--defsym kernel_addr=$(ZTEXTADDR)
all: bootp all: bootp
......
/* /*
* linux/arch/arm/boot/bootp/bootp.lds * linux/arch/arm/boot/bootp/bootp.lds
* *
* Copyright (C) 2000 Russell King * Copyright (C) 2000-2002 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
...@@ -15,13 +15,9 @@ SECTIONS ...@@ -15,13 +15,9 @@ SECTIONS
_text = .; _text = .;
.text : { .text : {
_stext = .; _stext = .;
_start = .; *(.start)
init.o(.start)
kernel_start = .;
kernel.o kernel.o
kernel_len = . - kernel_start;
. = ALIGN(32); . = ALIGN(32);
*(.text)
initrd_start = .; initrd_start = .;
initrd.o initrd.o
initrd_len = . - initrd_start; initrd_len = . - initrd_start;
......
/* /*
* linux/arch/arm/boot/bootp/init.S * linux/arch/arm/boot/bootp/init.S
* *
* Copyright (C) 2000 Russell King * Copyright (C) 2000-2002 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
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
* r0 through to r3 straight through. * r0 through to r3 straight through.
*/ */
.section .start,#alloc,#execinstr .section .start,#alloc,#execinstr
.type _entry, #function .type _start, #function
_entry: adr r10, initdata .globl _start
_start: adr r10, initdata
ldr r11, initdata ldr r11, initdata
sub r11, r10, r11 @ work out exec offset sub r11, r10, r11 @ work out exec offset
b splitify b splitify
...@@ -22,17 +23,11 @@ _entry: adr r10, initdata ...@@ -22,17 +23,11 @@ _entry: adr r10, initdata
initdata: .word initdata @ compiled address of this initdata: .word initdata @ compiled address of this
.size initdata,. - initdata .size initdata,. - initdata
.text
splitify: adr r13, data splitify: adr r13, data
ldmia r13!, {r4-r6} @ move the initrd ldmia r13!, {r4-r6} @ move the initrd
add r4, r4, r11 @ correction add r4, r4, r11 @ correction
bl move bl move
ldmia r13!, {r4-r6} @ then the kernel
mov r12, r5
add r4, r4, r11 @ correction
bl move
/* /*
* Setup the initrd parameters to pass to the kernel. This can either be * Setup the initrd parameters to pass to the kernel. This can either be
* passed in via a param_struct or a tag list. We spot the param_struct * passed in via a param_struct or a tag list. We spot the param_struct
...@@ -76,6 +71,7 @@ taglist: ldr r9, [r8, #0] @ tag length ...@@ -76,6 +71,7 @@ taglist: ldr r9, [r8, #0] @ tag length
mov r4, #16 @ length of initrd tag mov r4, #16 @ length of initrd tag
mov r9, #0 @ end of tag list terminator mov r9, #0 @ end of tag list terminator
stmia r8, {r4, r5, r6, r7, r9} stmia r8, {r4, r5, r6, r7, r9}
adr r12, kernel_start
mov pc, r12 @ call kernel mov pc, r12 @ call kernel
/* /*
...@@ -97,15 +93,12 @@ data: .word initrd_start ...@@ -97,15 +93,12 @@ data: .word initrd_start
.word initrd_addr .word initrd_addr
.word initrd_len .word initrd_len
.word kernel_start
.word kernel_addr
.word kernel_len
.word 0x54410001 @ r4 = ATAG_CORE .word 0x54410001 @ r4 = ATAG_CORE
.word 0x54420005 @ r5 = ATAG_INITRD .word 0x54420005 @ r5 = ATAG_INITRD
.word initrd_addr @ r6 .word initrd_addr @ r6
.word initrd_len @ r7 .word initrd_len @ r7
.word params @ r8 .word params @ r8
.type kernel_start,#object
.type initrd_start,#object .type initrd_start,#object
kernel_start:
...@@ -40,6 +40,14 @@ ...@@ -40,6 +40,14 @@
.macro writeb, rb .macro writeb, rb
strb \rb, [r3, #0] strb \rb, [r3, #0]
.endm .endm
#elif defined(CONFIG_ARCH_PXA) /* Xscale-type */
.macro loadsp, rb
mov \rb, #0x40000000
orr \rb, \rb, #0x00100000
.endm
.macro writeb, rb
strb \rb, [r3, #0]
.endm
#else #else
#error no serial architecture defined #error no serial architecture defined
#endif #endif
......
This diff is collapsed.
...@@ -73,6 +73,7 @@ extern void abort(void); ...@@ -73,6 +73,7 @@ extern void abort(void);
extern void ret_from_exception(void); extern void ret_from_exception(void);
extern void fpundefinstr(void); extern void fpundefinstr(void);
extern void fp_enter(void); extern void fp_enter(void);
extern void fp_init(union fp_state *);
/* /*
* This has a special calling convention; it doesn't * This has a special calling convention; it doesn't
...@@ -129,6 +130,7 @@ EXPORT_SYMBOL(disable_irq); ...@@ -129,6 +130,7 @@ EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(set_irq_type); EXPORT_SYMBOL(set_irq_type);
EXPORT_SYMBOL(pm_idle); EXPORT_SYMBOL(pm_idle);
EXPORT_SYMBOL(pm_power_off); EXPORT_SYMBOL(pm_power_off);
EXPORT_SYMBOL(fp_init);
/* processor dependencies */ /* processor dependencies */
EXPORT_SYMBOL(__machine_arch_type); EXPORT_SYMBOL(__machine_arch_type);
......
...@@ -117,8 +117,8 @@ __turn_mmu_on: ...@@ -117,8 +117,8 @@ __turn_mmu_on:
#ifdef CONFIG_ALIGNMENT_TRAP #ifdef CONFIG_ALIGNMENT_TRAP
orr r0, r0, #2 @ ...........A. orr r0, r0, #2 @ ...........A.
#endif #endif
mcr p15, 0, r0, c1, c0 mcr p15, 0, r0, c1, c0, 0 @ write control reg
mov r0, r0 mrc p15, 0, r0, c1, c0, 0 @ read it back.
mov r0, r0 mov r0, r0
mov r0, r0 mov r0, r0
mov pc, lr mov pc, lr
......
...@@ -217,14 +217,11 @@ do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -217,14 +217,11 @@ do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
desc->triggered = 1; desc->triggered = 1;
irq_enter();
kstat.irqs[cpu][irq]++; kstat.irqs[cpu][irq]++;
action = desc->action; action = desc->action;
if (action) if (action)
__do_irq(irq, desc->action, regs); __do_irq(irq, desc->action, regs);
irq_exit();
} }
/* /*
...@@ -256,7 +253,6 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -256,7 +253,6 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
*/ */
desc->running = 1; desc->running = 1;
irq_enter();
kstat.irqs[cpu][irq]++; kstat.irqs[cpu][irq]++;
do { do {
...@@ -274,8 +270,6 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -274,8 +270,6 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
__do_irq(irq, action, regs); __do_irq(irq, action, regs);
} while (desc->pending); } while (desc->pending);
irq_exit();
desc->running = 0; desc->running = 0;
/* /*
...@@ -311,7 +305,6 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -311,7 +305,6 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
desc->chip->ack(irq); desc->chip->ack(irq);
if (likely(desc->enabled)) { if (likely(desc->enabled)) {
irq_enter();
kstat.irqs[cpu][irq]++; kstat.irqs[cpu][irq]++;
/* /*
...@@ -325,7 +318,6 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -325,7 +318,6 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
!check_irq_lock(desc, irq, regs))) !check_irq_lock(desc, irq, regs)))
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
irq_exit();
} }
} }
...@@ -345,12 +337,11 @@ asmlinkage void asm_do_IRQ(int irq, struct pt_regs *regs) ...@@ -345,12 +337,11 @@ asmlinkage void asm_do_IRQ(int irq, struct pt_regs *regs)
if (irq >= NR_IRQS) if (irq >= NR_IRQS)
desc = &bad_irq_desc; desc = &bad_irq_desc;
irq_enter();
spin_lock(&irq_controller_lock); spin_lock(&irq_controller_lock);
desc->handle(irq, desc, regs); desc->handle(irq, desc, regs);
spin_unlock(&irq_controller_lock); spin_unlock(&irq_controller_lock);
irq_exit();
if (softirq_pending(smp_processor_id()))
do_softirq();
} }
void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained) void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained)
......
...@@ -177,9 +177,9 @@ void show_regs(struct pt_regs * regs) ...@@ -177,9 +177,9 @@ void show_regs(struct pt_regs * regs)
flags & PSR_Z_BIT ? 'Z' : 'z', flags & PSR_Z_BIT ? 'Z' : 'z',
flags & PSR_C_BIT ? 'C' : 'c', flags & PSR_C_BIT ? 'C' : 'c',
flags & PSR_V_BIT ? 'V' : 'v'); flags & PSR_V_BIT ? 'V' : 'v');
printk(" IRQs %s FIQs %s Mode %s%s Segment %s\n", printk(" IRQs o%s FIQs o%s Mode %s%s Segment %s\n",
interrupts_enabled(regs) ? "on" : "off", interrupts_enabled(regs) ? "n" : "ff",
fast_interrupts_enabled(regs) ? "on" : "off", fast_interrupts_enabled(regs) ? "n" : "ff",
processor_modes[processor_mode(regs)], processor_modes[processor_mode(regs)],
thumb_mode(regs) ? " (T)" : "", thumb_mode(regs) ? " (T)" : "",
get_fs() == get_ds() ? "kernel" : "user"); get_fs() == get_ds() ? "kernel" : "user");
...@@ -293,15 +293,22 @@ void exit_thread(void) ...@@ -293,15 +293,22 @@ void exit_thread(void)
{ {
} }
static void default_fp_init(union fp_state *fp)
{
memset(fp, 0, sizeof(union fp_state));
}
void (*fp_init)(union fp_state *) = default_fp_init;
void flush_thread(void) void flush_thread(void)
{ {
struct thread_info *thread = current_thread_info(); struct thread_info *thread = current_thread_info();
struct task_struct *tsk = current; struct task_struct *tsk = current;
memset(&tsk->thread.debug, 0, sizeof(struct debug_info)); tsk->used_math = 0;
memset(&thread->fpstate, 0, sizeof(union fp_state));
current->used_math = 0; memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
fp_init(&thread->fpstate);
} }
void release_thread(struct task_struct *dead_task) void release_thread(struct task_struct *dead_task)
......
CONFIG_ARCH_ARCA5K
This selects what ARM system you wish to build the kernel for. It
also selects to some extent the CPU type. If you are unsure what
to set this option to, please consult any information supplied with
your system.
CONFIG_ARCH_A5K
Say Y here to to support the Acorn A5000. Linux can support the
internal IDE disk and CD-ROM interface, serial and parallel port,
and the floppy drive. Note that on some A5000s the floppy is
plugged into the wrong socket on the motherboard.
CONFIG_ARCH_ARC
The Acorn Archimedes was an personal computer based on an 8K ARM2
processor, released in 1987. It supported 512K of RAM and 2 800K
floppy disks. Picture and more detailed specifications at
<http://www.computingmuseum.com/museum/archi.htm>.
CONFIG_PAGESIZE_16
Say Y here if your Archimedes or A5000 system has only 2MB of
memory, otherwise say N. The resulting kernel will not run on a
machine with 4MB of memory.
mainmenu_option next_comment
comment 'Archimedes/A5000 Implementations'
# These architectures will be combined. However, until this
# is complete... Note that the ARC will take precedence over
# A5K
comment 'Archimedes/A5000 Implementations (select only ONE)'
dep_bool ' Archimedes' CONFIG_ARCH_ARC $CONFIG_ARCH_ARCA5K
dep_bool ' A5000' CONFIG_ARCH_A5K $CONFIG_ARCH_ARCA5K
if [ "$CONFIG_ARCH_ARCA5K" = "y" ]; then
bool '2MB physical memory' CONFIG_PAGESIZE_16
fi
endmenu
CONFIG_ARCH_AUTCPU12
Say Y if you intend to run the kernel on the autronix autcpu12
board. This board is based on a Cirrus Logic CS89712.
CONFIG_ARCH_CDB89712
This is an evaluation board from Cirrus for the CS89712 processor.
The board includes 2 serial ports, Ethernet, IRDA, and expansion
headers. It comes with 16 MB SDRAM and 8 MB flash ROM.
CONFIG_ARCH_CEIVA
Say Y here if you intend to run this kernel on the Ceiva/Polaroid
PhotoMax Digital Picture Frame.
CONFIG_ARCH_EDB7211
Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
evaluation board.
CONFIG_ARCH_P720T
Say Y here if you intend to run this kernel on the ARM Prospector
720T.
CONFIG_EP72XX_ROM_BOOT
If you say Y here, your CLPS711x-based kernel will use the bootstrap
mode memory map instead of the normal memory map.
Processors derived from the Cirrus CLPS-711X core support two boot
modes. Normal mode boots from the external memory device at CS0.
Bootstrap mode rearranges parts of the memory map, placing an
internal 128 byte bootstrap ROM at CS0. This option performs the
address map changes required to support booting in this mode.
You almost surely want to say N here.
mainmenu_option next_comment
comment 'CLPS711X/EP721X Implementations'
dep_bool ' AUTCPU12' CONFIG_ARCH_AUTCPU12 $CONFIG_ARCH_CLPS711X
dep_bool ' CDB89712' CONFIG_ARCH_CDB89712 $CONFIG_ARCH_CLPS711X
dep_bool ' CEIVA' CONFIG_ARCH_CEIVA $CONFIG_ARCH_CLPS711X
dep_bool ' CLEP7312' CONFIG_ARCH_CLEP7312 $CONFIG_ARCH_CLPS711X
dep_bool ' EDB7211' CONFIG_ARCH_EDB7211 $CONFIG_ARCH_CLPS711X
dep_bool ' P720T' CONFIG_ARCH_P720T $CONFIG_ARCH_CLPS711X
dep_bool ' FORTUNET' CONFIG_ARCH_FORTUNET $CONFIG_ARCH_CLPS711X
# XXX Maybe these should indicate register compatibility
# instead of being mutually exclusive.
if [ "$CONFIG_ARCH_EDB7211" = "y" ]; then
define_bool CONFIG_ARCH_EP7211 y
else
define_bool CONFIG_ARCH_EP7211 n
fi
if [ "$CONFIG_ARCH_P720T" = "y" -o \
"$CONFIG_ARCH_CEIVA" = "y" ]; then
define_bool CONFIG_ARCH_EP7212 y
else
define_bool CONFIG_ARCH_EP7212 n
fi
if [ "$CONFIG_ARCH_EP7211" = "y" -o \
"$CONFIG_ARCH_EP7212" = "y" ]; then
bool ' EP72xx ROM boot' CONFIG_EP72XX_ROM_BOOT
fi
endmenu
CONFIG_PLD_HOTSWAP
This enables support for the dynamic loading and configuration of
compatible drivers when the contents of the PLD are changed. This
is still experimental and requires configuration tools which are
not yet generally available. Say N here. You must enable the kernel
module loader for this feature to work.
mainmenu_option next_comment
comment 'Epxa10db'
if [ "$CONFIG_ARCH_CAMELOT" = "y" ]; then
comment 'PLD hotswap support'
define_bool CONFIG_PLD y
dep_bool 'Support for PLD device hotplugging (experimental)' CONFIG_PLD_HOTSWAP $CONFIG_EXPERIMENTAL
fi
endmenu
CONFIG_ARCH_CATS
Say Y here if you intend to run this kernel on the CATS.
Saying N will reduce the size of the Footbridge kernel.
CONFIG_ARCH_EBSA285_ADDIN
Say Y here if you intend to run this kernel on the EBSA285 card
in addin mode.
Saying N will reduce the size of the Footbridge kernel.
CONFIG_ARCH_EBSA285_HOST
Say Y here if you intend to run this kernel on the EBSA285 card
in host ("central function") mode.
Saying N will reduce the size of the Footbridge kernel.
CONFIG_ARCH_NETWINDER
Say Y here if you intend to run this kernel on the Rebel.COM
NetWinder. Information about this machine can be found at:
<http://www.netwinder.org/>
Saying N will reduce the size of the Footbridge kernel.
CONFIG_ARCH_PERSONAL_SERVER
Say Y here if you intend to run this kernel on the Compaq
Personal Server.
Saying N will reduce the size of the Footbridge kernel.
The Compaq Personal Server is not available for purchase.
There are no product plans beyond the current research
prototypes at this time. Information is available at:
<http://crl.research.compaq.com/projects/personalserver/>
If you have any questions or comments about the Compaq Personal
Server, send e-mail to skiff@crl.dec.com.
mainmenu_option next_comment
comment 'Footbridge Implementations'
dep_bool ' CATS' CONFIG_ARCH_CATS $CONFIG_ARCH_FOOTBRIDGE
dep_bool ' Compaq Personal Server' CONFIG_ARCH_PERSONAL_SERVER $CONFIG_ARCH_FOOTBRIDGE
dep_bool ' EBSA285 (addin mode)' CONFIG_ARCH_EBSA285_ADDIN $CONFIG_ARCH_FOOTBRIDGE
dep_bool ' EBSA285 (host mode)' CONFIG_ARCH_EBSA285_HOST $CONFIG_ARCH_FOOTBRIDGE
dep_bool ' NetWinder' CONFIG_ARCH_NETWINDER $CONFIG_ARCH_FOOTBRIDGE
endmenu
...@@ -29,38 +29,10 @@ ...@@ -29,38 +29,10 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/amba_kmi.h>
extern void integrator_map_io(void); extern void integrator_map_io(void);
extern void integrator_init_irq(void); extern void integrator_init_irq(void);
#ifdef CONFIG_KMI_KEYB
static struct kmi_info integrator_keyboard __initdata = {
.base = IO_ADDRESS(KMI0_BASE),
.irq = IRQ_KMIINT0,
.divisor = 24 / 8 - 1,
.type = KMI_KEYBOARD,
};
static struct kmi_info integrator_mouse __initdata = {
.base = IO_ADDRESS(KMI1_BASE),
.irq = IRQ_KMIINT1,
.divisor = 24 / 8 - 1,
.type = KMI_MOUSE,
};
#endif
static int __init integrator_init(void)
{
#ifdef CONFIG_KMI_KEYB
register_kmi(&integrator_keyboard);
register_kmi(&integrator_mouse);
#endif
return 0;
}
__initcall(integrator_init);
MACHINE_START(INTEGRATOR, "ARM-Integrator") MACHINE_START(INTEGRATOR, "ARM-Integrator")
MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) BOOT_MEM(0x00000000, 0x16000000, 0xf1600000)
......
...@@ -181,4 +181,4 @@ static int __init integrator_cpu_init(void) ...@@ -181,4 +181,4 @@ static int __init integrator_cpu_init(void)
return 0; return 0;
} }
__initcall(integrator_cpu_init); core_initcall(integrator_cpu_init);
CONFIG_ARCH_IQ80310
Say Y here if you want to run your kernel on the Intel IQ80310
evaluation kit for the IOP310 chipset.
mainmenu_option next_comment
comment 'IOP310 Implementation Options'
dep_bool ' IQ80310' CONFIG_ARCH_IQ80310 $CONFIG_ARCH_IOP310
comment 'IOP310 Chipset Features'
dep_bool 'Support Intel 80312 Application Accelerator Unit (EXPERIMENTAL)' CONFIG_IOP310_AAU $CONFIG_ARCH_IOP310 $CONFIG_EXPERIMENTAL
dep_bool 'Support Intel 80312 DMA (EXPERIMENTAL)' CONFIG_IOP310_DMA $CONFIG_ARCH_IOP310 $CONFIG_EXPERIMENTAL
dep_bool 'Support Intel 80312 Messaging Unit (EXPERIMENTAL)' CONFIG_IOP310_MU $CONFIG_ARCH_IOP310 $CONFIG_EXPERIMENTAL
dep_bool 'Support Intel 80312 Performance Monitor (EXPERIMENTAL)' CONFIG_IOP310_PMON $CONFIG_ARCH_IOP310 $CONFIG_EXPERIMENTAL
endmenu
mainmenu_option next_comment
comment 'Intel PXA250/210 Implementations'
dep_bool ' Intel DBPXA250 Development Platform' CONFIG_ARCH_LUBBOCK $CONFIG_ARCH_PXA
dep_bool ' Accelent Xscale IDP' CONFIG_ARCH_PXA_IDP $CONFIG_ARCH_PXA
endmenu
...@@ -124,7 +124,7 @@ static int __init pxa_dma_init (void) ...@@ -124,7 +124,7 @@ static int __init pxa_dma_init (void)
return ret; return ret;
} }
__initcall(pxa_dma_init); arch_initcall(pxa_dma_init);
EXPORT_SYMBOL(pxa_request_dma); EXPORT_SYMBOL(pxa_request_dma);
EXPORT_SYMBOL(pxa_free_dma); EXPORT_SYMBOL(pxa_free_dma);
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* *
* 2001-09-13: Cliff Brake <cbrake@accelent.com> * 2001-09-13: Cliff Brake <cbrake@accelent.com>
* Initial code * Initial code
*
* Expected command line: mem=32M initrd=0xa1000000,4M root=/dev/ram ramdisk=8192
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -29,8 +31,6 @@ ...@@ -29,8 +31,6 @@
#include "generic.h" #include "generic.h"
#define PXA_IDP_REV02
#ifndef PXA_IDP_REV02 #ifndef PXA_IDP_REV02
/* shadow registers for write only registers */ /* shadow registers for write only registers */
unsigned int idp_cpld_led_control_shadow = 0x1; unsigned int idp_cpld_led_control_shadow = 0x1;
...@@ -103,9 +103,19 @@ static void __init idp_map_io(void) ...@@ -103,9 +103,19 @@ static void __init idp_map_io(void)
pxa_map_io(); pxa_map_io();
iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
set_GPIO_IRQ_edge(IRQ_TO_GPIO_2_80(TOUCH_PANEL_IRQ), TOUCH_PANEL_IRQ_EDGE); set_irq_type(IRQ_TO_GPIO_2_80(TOUCH_PANEL_IRQ), TOUCH_PANEL_IRQ_EDGE);
// serial ports 2 & 3
pxa_gpio_mode(GPIO42_BTRXD_MD);
pxa_gpio_mode(GPIO43_BTTXD_MD);
pxa_gpio_mode(GPIO44_BTCTS_MD);
pxa_gpio_mode(GPIO45_BTRTS_MD);
pxa_gpio_mode(GPIO46_STRXD_MD);
pxa_gpio_mode(GPIO47_STTXD_MD);
} }
MACHINE_START(PXA_IDP, "Accelent Xscale IDP") MACHINE_START(PXA_IDP, "Accelent Xscale IDP")
MAINTAINER("Accelent Systems Inc.") MAINTAINER("Accelent Systems Inc.")
BOOT_MEM(0xa0000000, 0x40000000, 0xfc000000) BOOT_MEM(0xa0000000, 0x40000000, 0xfc000000)
......
CONFIG_SA1100_ASSABET
Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
Microprocessor Development Board (also known as the Assabet).
CONFIG_ASSABET_NEPONSET
Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
Microprocessor Development Board (Assabet) with the SA-1111
Development Board (Nepon).
CONFIG_SA1100_ADSBITSY
Say Y here if you are using Applied Data Systems Intel(R)
StrongARM(R) 1110 based Bitsy, 3 x 5 inches in size, Compaq - IPAQ -
like platform. See
<http://www.applieddata.net/products_bitsySpec.asp> for more
information.
CONFIG_SA1100_BRUTUS
Say Y here if you are using the Intel(R) StrongARM(R) SA-1100
Microprocessor Development Board (also known as the Brutus).
CONFIG_SA1100_CERF
The Intrinsyc CerfBoard is based on the StrongARM 1110.
More information is available at:
<http://www.intrinsyc.com/products/referenceplatforms/cerfboard.html>.
Say Y if configuring for an Intrinsyc CerfBoard.
Say N otherwise.
CONFIG_SA1100_CERF_CPLD
Say Y here to support the Linux CerfPDA development kit from
Intrinsyc. This is a StrongARM-1110-based reference platform for
designing custom PDAs. Product info is at
<http://www.intrinsyc.com/products/referencedesigns/cerfpda.asp>.
CONFIG_SA1100_H3100
Say Y here if you intend to run this kernel on the Compaq iPAQ
H3100 handheld computer. Information about this machine and the
Linux port to this machine can be found at:
<http://www.handhelds.org/Compaq/index.html#iPAQ_H3100>
<http://www.compaq.com/products/handhelds/pocketpc/>
CONFIG_SA1100_H3600
Say Y here if you intend to run this kernel on the Compaq iPAQ
H3600 handheld computer. Information about this machine and the
Linux port to this machine can be found at:
<http://www.handhelds.org/Compaq/index.html#iPAQ_H3600>
<http://www.compaq.com/products/handhelds/pocketpc/>
CONFIG_SA1100_H3800
Say Y here if you intend to run this kernel on the Compaq iPAQ H3800
series handheld computer. Information about this machine and the
Linux port to this machine can be found at:
<http://www.handhelds.org/Compaq/index.html#iPAQ_H3800>
<http://www.compaq.com/products/handhelds/pocketpc/>
CONFIG_H3600_SLEEVE
Choose this option to enable support for extension packs (sleeves)
for the Compaq iPAQ H3XXX series of handheld computers. This option
is required for the CF, PCMCIA, Bluetooth and GSM/GPRS extension
packs.
CONFIG_SA1100_FLEXANET
Say Y here if you intend to run this kernel on the FlexaNet
handheld instruments. Information about this machine can be
found at: <http://www.flexanet.com/>.
CONFIG_SA1100_FREEBIRD
Support the FreeBird board used in Coventive embedded products. See
Documentation/arm/SA1100/Freebird for more.
CONFIG_SA1100_GRAPHICSCLIENT
Say Y here if you are using an Applied Data Systems Intel(R)
StrongARM(R) SA-1100 based Graphics Client SBC. See
<http://www.flatpanels.com/> for information on this system.
CONFIG_SA1100_GRAPHICSMASTER
Say Y here if you are using an Applied Data Systems Intel(R)
StrongARM(R) SA-1100 based Graphics Master SBC with SA-1111
StrongARM companion chip. See
<http://www.applieddata.net/products_masterSpec.asp> for information
on this system.
CONFIG_SA1100_BADGE4
Say Y here if you want to build a kernel for the HP Laboratories
BadgePAD 4.
CONFIG_SA1100_JORNADA720
Say Y here if you want to build a kernel for the HP Jornada 720
handheld computer. See <http://www.hp.com/jornada/products/720>
for details.
CONFIG_SA1100_HUW_WEBPANEL
Say Y here to support the HuW Webpanel produced by Hoeft & Wessel
AG. English-language website is at
<http://www.hoeft-wessel.de/en.htm>; credits and build instructions
at Documentation/arm/SA1100/HUW_WEBPANEL.
CONFIG_SA1100_ITSY
Say Y here if you are using the Compaq Itsy experimental pocket
computer. See <http://research.compaq.com/wrl/projects/itsy/> for
more information.
CONFIG_SA1100_LART
Say Y here if you are using the Linux Advanced Radio Terminal
(also known as the LART). See <http://www.lart.tudelft.nl/> for
information on the LART.
CONFIG_SA1100_NANOENGINE
The nanoEngine is a StrongARM 1110-based single board computer
from Bright Star Engineering. More information is available at:
<http://www.brightstareng.com/arm/nanoeng.htm>.
Say Y if configuring for a nanoEngine.
Say N otherwise.
CONFIG_SA1100_OMNIMETER
Say Y here if you are using the inhand electronics OmniMeter. See
<http://www.inhandelectronics.com/html/omni1.html> for details.
CONFIG_SA1100_PANGOLIN
Pangolin is a StrongARM 1110-based evaluation platform produced
by Dialogue Technology. It has EISA slots for ease of configuration
with SDRAM/Flash memory card, USB/Serial/Audio card, Compact Flash
card, and TFT-LCD card.
Say Y if configuring for a Pangolin.
Say N otherwise.
CONFIG_SA1100_PLEB
Say Y here if you are using a Portable Linux Embedded Board
(also known as PLEB). See <http://www.cse.unsw.edu.au/~pleb/>
for more information.
CONFIG_SA1100_PT_SYSTEM3
Say Y here if you intend to build a kernel suitable to run on
a Pruftechnik Digital Board. For more information see
<http://www.pruftechnik.com>
CONFIG_SA1100_SHANNON
The Shannon (also known as a Tuxscreen, and also as a IS2630) was a
limited edition webphone produced by Philips. The Shannon is a SA1100
platform with a 640x480 LCD, touchscreen, CIR keyboard, PCMCIA slots,
and a telco interface.
CONFIG_SA1100_SHERMAN
Say Y here to support the Blazie Engineering `Sherman' StrongARM
1110-based SBC, used primarily in assistance products for the
visually impaired. The company is now Freedom Scientific, with
a website at <http://www.freedomscientific.com/index.html>. The
Sherman product, however, appears to have been discontinued.
CONFIG_SA1100_SIMPAD
The SIEMENS webpad SIMpad is based on the StrongARM 1110. There
are two different versions CL4 and SL4. CL4 has 32MB RAM and 16MB
FLASH. The SL4 version got 64 MB RAM and 32 MB FLASH and a
PCMCIA-Slot. The version for the Germany Telecom (DTAG) is the same
like CL4 in additional it has a PCMCIA-Slot. For more information
visit <http://www.my-siemens.com or www.siemens.ch>.
CONFIG_SA1100_PFS168
The Radisys Corp. PFS-168 (aka Tulsa) is an Intel® StrongArm® SA-1110 based
computer which includes the SA-1111 Microprocessor Companion Chip and other
custom I/O designed to add connectivity and multimedia features for vending
and business machine applications. Say Y here if you require support for
this target.
CONFIG_SA1100_VICTOR
Say Y here if you are using a Visu Aide Intel(R) StrongARM(R)
SA-1100 based Victor Digital Talking Book Reader. See
<http://www.visuaide.com/pagevictor.en.html> for information on
this system.
CONFIG_SA1100_XP860
:: Config help missing ::
:: 06 August 2002 ::
CONFIG_SA1100_YOPY
Say Y here to support the Yopy PDA. Product information at
<http://www.yopy.com/>. See Documentation/arm/SA110/Yopy
for more.
CONFIG_SA1100_STORK
Say Y here if you intend to run this kernel on the Stork
handheld computer.
mainmenu_option next_comment
comment 'SA11x0 Implementations'
dep_bool ' Assabet' CONFIG_SA1100_ASSABET $CONFIG_ARCH_SA1100
dep_bool ' Include support for Neponset' CONFIG_ASSABET_NEPONSET $CONFIG_SA1100_ASSABET
dep_bool ' ADS Bitsy' CONFIG_SA1100_ADSBITSY $CONFIG_ARCH_SA1100
dep_bool ' Brutus' CONFIG_SA1100_BRUTUS $CONFIG_ARCH_SA1100
dep_bool ' CerfBoard' CONFIG_SA1100_CERF $CONFIG_ARCH_SA1100
if [ "$CONFIG_SA1100_CERF" = "y" ]; then
choice 'Cerf Flash available' \
"8MB CONFIG_SA1100_CERF_FLASH_8MB \
16MB CONFIG_SA1100_CERF_FLASH_16MB \
32MB CONFIG_SA1100_CERF_FLASH_32MB" 8MB
bool 'Cerf w/CPLD support (CerfPDA)' CONFIG_SA1100_CERF_CPLD
fi
dep_bool ' Compaq iPAQ H3100' CONFIG_SA1100_H3100 $CONFIG_ARCH_SA1100
dep_bool ' Compaq iPAQ H3600/H3700' CONFIG_SA1100_H3600 $CONFIG_ARCH_SA1100
dep_bool ' Compaq iPAQ H3800' CONFIG_SA1100_H3800 $CONFIG_ARCH_SA1100
if [ "$CONFIG_SA1100_H3100" = "y" -o "$CONFIG_SA1100_H3600" = "y" -o "$CONFIG_SA1100_H3800" = "y" ]; then
define_bool CONFIG_SA1100_H3XXX y
else
define_bool CONFIG_SA1100_H3XXX n
fi
#dep_bool ' Consus' CONFIG_SA1100_CONSUS $CONFIG_ARCH_SA1100
#dep_bool ' Empeg' CONFIG_SA1100_EMPEG $CONFIG_ARCH_SA1100
dep_bool ' Extenex HandHeld Theater (Squashtail)' CONFIG_SA1100_EXTENEX1 $CONFIG_ARCH_SA1100
if [ "$CONFIG_SA1100_EXTENEX1" = "y" ]; then
bool ' Support 16 MB of DRAM (not just 8)' CONFIG_SA1100_EXTENEX1_16MB
fi
dep_bool ' FlexaNet' CONFIG_SA1100_FLEXANET $CONFIG_ARCH_SA1100
dep_bool ' FreeBird-v1.1' CONFIG_SA1100_FREEBIRD $CONFIG_ARCH_SA1100
dep_bool ' GraphicsClient Plus' CONFIG_SA1100_GRAPHICSCLIENT $CONFIG_ARCH_SA1100
dep_bool ' GraphicsMaster' CONFIG_SA1100_GRAPHICSMASTER $CONFIG_ARCH_SA1100
dep_bool ' HP Labs BadgePAD 4' CONFIG_SA1100_BADGE4 $CONFIG_ARCH_SA1100
dep_bool ' HP Jornada 720' CONFIG_SA1100_JORNADA720 $CONFIG_ARCH_SA1100
dep_bool ' HuW WebPanel' CONFIG_SA1100_HUW_WEBPANEL $CONFIG_ARCH_SA1100
dep_bool ' Itsy' CONFIG_SA1100_ITSY $CONFIG_ARCH_SA1100
dep_bool ' LART' CONFIG_SA1100_LART $CONFIG_ARCH_SA1100
dep_bool ' nanoEngine' CONFIG_SA1100_NANOENGINE $CONFIG_ARCH_SA1100
dep_bool ' OmniMeter' CONFIG_SA1100_OMNIMETER $CONFIG_ARCH_SA1100
dep_bool ' Pangolin' CONFIG_SA1100_PANGOLIN $CONFIG_ARCH_SA1100
dep_bool ' PLEB' CONFIG_SA1100_PLEB $CONFIG_ARCH_SA1100
dep_bool ' PT System 3' CONFIG_SA1100_PT_SYSTEM3 $CONFIG_ARCH_SA1100
dep_bool ' Shannon' CONFIG_SA1100_SHANNON $CONFIG_ARCH_SA1100
dep_bool ' Sherman' CONFIG_SA1100_SHERMAN $CONFIG_ARCH_SA1100
dep_bool ' Simpad' CONFIG_SA1100_SIMPAD $CONFIG_ARCH_SA1100
dep_bool ' Tulsa' CONFIG_SA1100_PFS168 $CONFIG_ARCH_SA1100
dep_bool ' Victor' CONFIG_SA1100_VICTOR $CONFIG_ARCH_SA1100
dep_bool ' XP860' CONFIG_SA1100_XP860 $CONFIG_ARCH_SA1100
dep_bool ' Yopy' CONFIG_SA1100_YOPY $CONFIG_ARCH_SA1100
dep_bool ' Stork' CONFIG_SA1100_STORK $CONFIG_ARCH_SA1100
dep_tristate 'SA1100 USB function support' CONFIG_SA1100_USB $CONFIG_ARCH_SA1100
dep_tristate ' Support for SA11x0 USB network link function' CONFIG_SA1100_USB_NETLINK $CONFIG_SA1100_USB
dep_tristate ' Support for SA11x0 USB character device emulation' CONFIG_SA1100_USB_CHAR $CONFIG_SA1100_USB
dep_tristate 'Compaq iPAQ Handheld sleeve support' CONFIG_H3600_SLEEVE $CONFIG_SA1100_H3600
endmenu
...@@ -26,8 +26,8 @@ obj-$(CONFIG_SA1100_PT_SYSTEM3) += cpu-sa1110.o ...@@ -26,8 +26,8 @@ obj-$(CONFIG_SA1100_PT_SYSTEM3) += cpu-sa1110.o
endif endif
# Next, the SA1111 stuff. # Next, the SA1111 stuff.
obj-$(CONFIG_SA1111) += sa1111.o obj-$(CONFIG_SA1111) += sa1111.o
obj-$(CONFIG_USB_OHCI_SA1111) += sa1111-pcibuf.o pcipool.o obj-$(CONFIG_USB_OHCI_HCD) += sa1111-pcibuf.o pcipool.o
# Specific board support # Specific board support
obj-$(CONFIG_SA1100_ADSBITSY) += adsbitsy.o obj-$(CONFIG_SA1100_ADSBITSY) += adsbitsy.o
......
...@@ -69,7 +69,7 @@ static int __init adsbitsy_init(void) ...@@ -69,7 +69,7 @@ static int __init adsbitsy_init(void)
return 0; return 0;
} }
__initcall(adsbitsy_init); arch_initcall(adsbitsy_init);
static void __init adsbitsy_init_irq(void) static void __init adsbitsy_init_irq(void)
{ {
......
...@@ -126,7 +126,7 @@ static int __init assabet_init(void) ...@@ -126,7 +126,7 @@ static int __init assabet_init(void)
return 0; return 0;
} }
__initcall(assabet_init); arch_initcall(assabet_init);
/* /*
......
...@@ -109,7 +109,7 @@ static int __init badge4_init(void) ...@@ -109,7 +109,7 @@ static int __init badge4_init(void)
return 0; return 0;
} }
__initcall(badge4_init); arch_initcall(badge4_init);
static unsigned badge4_5V_bitmap = 0; static unsigned badge4_5V_bitmap = 0;
......
...@@ -254,4 +254,4 @@ static int __init sa1100_dram_init(void) ...@@ -254,4 +254,4 @@ static int __init sa1100_dram_init(void)
return ret; return ret;
} }
__initcall(sa1100_dram_init); core_initcall(sa1100_dram_init);
...@@ -327,4 +327,4 @@ static int __init sa1110_clk_init(void) ...@@ -327,4 +327,4 @@ static int __init sa1110_clk_init(void)
return 0; return 0;
} }
__initcall(sa1110_clk_init); core_initcall(sa1110_clk_init);
...@@ -143,14 +143,6 @@ static int flexanet_serial_init(void) ...@@ -143,14 +143,6 @@ static int flexanet_serial_init(void)
} }
static int __init flexanet_init(void)
{
return 0;
}
__initcall(flexanet_init);
static struct map_desc flexanet_io_desc[] __initdata = { static struct map_desc flexanet_io_desc[] __initdata = {
/* virtual physical length type */ /* virtual physical length type */
{ 0xf0000000, 0x10000000, 0x00001000, MT_DEVICE }, /* Board Control Register */ { 0xf0000000, 0x10000000, 0x00001000, MT_DEVICE }, /* Board Control Register */
......
...@@ -48,7 +48,7 @@ static int __init freebird_init(void) ...@@ -48,7 +48,7 @@ static int __init freebird_init(void)
return 0; return 0;
} }
__initcall(freebird_init); arch_initcall(freebird_init);
static struct map_desc freebird_io_desc[] __initdata = { static struct map_desc freebird_io_desc[] __initdata = {
/* virtual physical length type */ /* virtual physical length type */
......
...@@ -8,11 +8,6 @@ ...@@ -8,11 +8,6 @@
* 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
* published by the Free Software Foundation. * published by the Free Software Foundation.
*
* Since this file should be linked before any other machine specific file,
* the __initcall() here will be executed first. This serves as default
* initialization stuff for SA1100 machines which can be overriden later if
* need be.
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -117,7 +112,7 @@ static int __init sa1100_init(void) ...@@ -117,7 +112,7 @@ static int __init sa1100_init(void)
return 0; return 0;
} }
__initcall(sa1100_init); core_initcall(sa1100_init);
void (*sa1100fb_backlight_power)(int on); void (*sa1100fb_backlight_power)(int on);
void (*sa1100fb_lcd_power)(int on); void (*sa1100fb_lcd_power)(int on);
......
...@@ -59,7 +59,7 @@ static int __init graphicsmaster_init(void) ...@@ -59,7 +59,7 @@ static int __init graphicsmaster_init(void)
return 0; return 0;
} }
__initcall(graphicsmaster_init); arch_initcall(graphicsmaster_init);
/* /*
* Handlers for GraphicsMaster's external IRQ logic * Handlers for GraphicsMaster's external IRQ logic
......
...@@ -52,7 +52,7 @@ static int __init init_huw_cs3(void) ...@@ -52,7 +52,7 @@ static int __init init_huw_cs3(void)
return 0; return 0;
} }
__initcall(init_huw_cs3); arch_initcall(init_huw_cs3);
/** /**
......
...@@ -53,7 +53,7 @@ static int __init jornada720_init(void) ...@@ -53,7 +53,7 @@ static int __init jornada720_init(void)
return 0; return 0;
} }
__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 */ /* virtual physical length type */
......
...@@ -44,4 +44,4 @@ sa1100_leds_init(void) ...@@ -44,4 +44,4 @@ sa1100_leds_init(void)
return 0; return 0;
} }
__initcall(sa1100_leds_init); core_initcall(sa1100_leds_init);
...@@ -216,7 +216,7 @@ static int __init neponset_init(void) ...@@ -216,7 +216,7 @@ static int __init neponset_init(void)
return sa1111_init(&neponset_device, 0x40000000, IRQ_NEPONSET_SA1111); return sa1111_init(&neponset_device, 0x40000000, IRQ_NEPONSET_SA1111);
} }
__initcall(neponset_init); arch_initcall(neponset_init);
static struct map_desc neponset_io_desc[] __initdata = { static struct map_desc neponset_io_desc[] __initdata = {
/* virtual physical length type */ /* virtual physical length type */
......
...@@ -39,7 +39,7 @@ static int __init omnimeter_init(void) ...@@ -39,7 +39,7 @@ static int __init omnimeter_init(void)
return 0; return 0;
} }
__initcall(omnimeter_init); arch_initcall(omnimeter_init);
static struct map_desc omnimeter_io_desc[] __initdata = { static struct map_desc omnimeter_io_desc[] __initdata = {
/* virtual physical length type */ /* virtual physical length type */
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
#include <asm/page.h> #include <asm/page.h>
#include "pcipool.h"
/* /*
* Pool allocator ... wraps the pci_alloc_consistent page allocator, so * Pool allocator ... wraps the pci_alloc_consistent page allocator, so
* small blocks are easily used by drivers for bus mastering controllers. * small blocks are easily used by drivers for bus mastering controllers.
...@@ -33,7 +31,6 @@ struct pci_pool { /* the pool */ ...@@ -33,7 +31,6 @@ struct pci_pool { /* the pool */
spinlock_t lock; spinlock_t lock;
size_t blocks_per_page; size_t blocks_per_page;
size_t size; size_t size;
int flags;
struct pci_dev *dev; struct pci_dev *dev;
size_t allocation; size_t allocation;
char name [32]; char name [32];
...@@ -52,6 +49,19 @@ struct pci_page { /* cacheable header for 'allocation' bytes */ ...@@ -52,6 +49,19 @@ struct pci_page { /* cacheable header for 'allocation' bytes */
// #define CONFIG_PCIPOOL_DEBUG // #define CONFIG_PCIPOOL_DEBUG
static inline const char *slot_name(const struct pci_pool *pool)
{
const struct pci_dev *pdev = pool->dev;
if (pdev == 0)
return "[0]";
else if (dev_is_sa1111(pdev))
return "[SA-1111]";
else
return pdev->slot_name;
}
/** /**
* pci_pool_create - Creates a pool of pci consistent memory blocks, for dma. * pci_pool_create - Creates a pool of pci consistent memory blocks, for dma.
...@@ -60,7 +70,7 @@ struct pci_page { /* cacheable header for 'allocation' bytes */ ...@@ -60,7 +70,7 @@ struct pci_page { /* cacheable header for 'allocation' bytes */
* @size: size of the blocks in this pool. * @size: size of the blocks in this pool.
* @align: alignment requirement for blocks; must be a power of two * @align: alignment requirement for blocks; must be a power of two
* @allocation: returned blocks won't cross this boundary (or zero) * @allocation: returned blocks won't cross this boundary (or zero)
* @flags: SLAB_* flags (not all are supported). * @mem_flags: SLAB_* flags.
* *
* Returns a pci allocation pool with the requested characteristics, or * Returns a pci allocation pool with the requested characteristics, or
* null if one can't be created. Given one of these pools, pci_pool_alloc() * null if one can't be created. Given one of these pools, pci_pool_alloc()
...@@ -76,7 +86,7 @@ struct pci_page { /* cacheable header for 'allocation' bytes */ ...@@ -76,7 +86,7 @@ struct pci_page { /* cacheable header for 'allocation' bytes */
*/ */
struct pci_pool * struct pci_pool *
pci_pool_create (const char *name, struct pci_dev *pdev, pci_pool_create (const char *name, struct pci_dev *pdev,
size_t size, size_t align, size_t allocation, int flags) size_t size, size_t align, size_t allocation, int mem_flags)
{ {
struct pci_pool *retval; struct pci_pool *retval;
...@@ -100,13 +110,9 @@ pci_pool_create (const char *name, struct pci_dev *pdev, ...@@ -100,13 +110,9 @@ pci_pool_create (const char *name, struct pci_dev *pdev,
} else if (allocation < size) } else if (allocation < size)
return 0; return 0;
if (!(retval = kmalloc (sizeof *retval, flags))) if (!(retval = kmalloc (sizeof *retval, mem_flags)))
return retval; return retval;
#ifdef CONFIG_PCIPOOL_DEBUG
flags |= SLAB_POISON;
#endif
strncpy (retval->name, name, sizeof retval->name); strncpy (retval->name, name, sizeof retval->name);
retval->name [sizeof retval->name - 1] = 0; retval->name [sizeof retval->name - 1] = 0;
...@@ -114,14 +120,13 @@ pci_pool_create (const char *name, struct pci_dev *pdev, ...@@ -114,14 +120,13 @@ pci_pool_create (const char *name, struct pci_dev *pdev,
INIT_LIST_HEAD (&retval->page_list); INIT_LIST_HEAD (&retval->page_list);
spin_lock_init (&retval->lock); spin_lock_init (&retval->lock);
retval->size = size; retval->size = size;
retval->flags = flags;
retval->allocation = allocation; retval->allocation = allocation;
retval->blocks_per_page = allocation / size; retval->blocks_per_page = allocation / size;
init_waitqueue_head (&retval->waitq); init_waitqueue_head (&retval->waitq);
#ifdef CONFIG_PCIPOOL_DEBUG #ifdef CONFIG_PCIPOOL_DEBUG
printk (KERN_DEBUG "pcipool create %s/%s size %d, %d/page (%d alloc)\n", printk (KERN_DEBUG "pcipool create %s/%s size %d, %d/page (%d alloc)\n",
pdev ? pdev->slot_name : NULL, retval->name, size, slot_name(retval), retval->name, size,
retval->blocks_per_page, allocation); retval->blocks_per_page, allocation);
#endif #endif
...@@ -143,11 +148,13 @@ pool_alloc_page (struct pci_pool *pool, int mem_flags) ...@@ -143,11 +148,13 @@ pool_alloc_page (struct pci_pool *pool, int mem_flags)
if (!page) if (!page)
return 0; return 0;
page->vaddr = pci_alloc_consistent (pool->dev, page->vaddr = pci_alloc_consistent (pool->dev,
pool->allocation, &page->dma); pool->allocation,
&page->dma);
if (page->vaddr) { if (page->vaddr) {
memset (page->bitmap, 0xff, mapsize); // bit set == free memset (page->bitmap, 0xff, mapsize); // bit set == free
if (pool->flags & SLAB_POISON) #ifdef CONFIG_DEBUG_SLAB
memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); memset (page->vaddr, POOL_POISON_BYTE, pool->allocation);
#endif
list_add (&page->page_list, &pool->page_list); list_add (&page->page_list, &pool->page_list);
} else { } else {
kfree (page); kfree (page);
...@@ -173,8 +180,9 @@ pool_free_page (struct pci_pool *pool, struct pci_page *page) ...@@ -173,8 +180,9 @@ pool_free_page (struct pci_pool *pool, struct pci_page *page)
{ {
dma_addr_t dma = page->dma; dma_addr_t dma = page->dma;
if (pool->flags & SLAB_POISON) #ifdef CONFIG_DEBUG_SLAB
memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); memset (page->vaddr, POOL_POISON_BYTE, pool->allocation);
#endif
pci_free_consistent (pool->dev, pool->allocation, page->vaddr, dma); pci_free_consistent (pool->dev, pool->allocation, page->vaddr, dma);
list_del (&page->page_list); list_del (&page->page_list);
kfree (page); kfree (page);
...@@ -195,8 +203,7 @@ pci_pool_destroy (struct pci_pool *pool) ...@@ -195,8 +203,7 @@ pci_pool_destroy (struct pci_pool *pool)
#ifdef CONFIG_PCIPOOL_DEBUG #ifdef CONFIG_PCIPOOL_DEBUG
printk (KERN_DEBUG "pcipool destroy %s/%s\n", printk (KERN_DEBUG "pcipool destroy %s/%s\n",
pool->dev ? pool->dev->slot_name : NULL, slot_name(pool), pool->name);
pool->name);
#endif #endif
spin_lock_irqsave (&pool->lock, flags); spin_lock_irqsave (&pool->lock, flags);
...@@ -206,8 +213,7 @@ pci_pool_destroy (struct pci_pool *pool) ...@@ -206,8 +213,7 @@ pci_pool_destroy (struct pci_pool *pool)
struct pci_page, page_list); struct pci_page, page_list);
if (is_page_busy (pool->blocks_per_page, page->bitmap)) { if (is_page_busy (pool->blocks_per_page, page->bitmap)) {
printk (KERN_ERR "pci_pool_destroy %s/%s, %p busy\n", printk (KERN_ERR "pci_pool_destroy %s/%s, %p busy\n",
pool->dev ? pool->dev->slot_name : NULL, slot_name(pool), pool->name, page->vaddr);
pool->name, page->vaddr);
/* leak the still-in-use consistent memory */ /* leak the still-in-use consistent memory */
list_del (&page->page_list); list_del (&page->page_list);
kfree (page); kfree (page);
...@@ -327,35 +333,32 @@ pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma) ...@@ -327,35 +333,32 @@ pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma)
int map, block; int map, block;
if ((page = pool_find_page (pool, dma)) == 0) { if ((page = pool_find_page (pool, dma)) == 0) {
printk (KERN_ERR "pci_pool_free %s/%s, %p/%x (bad dma)\n", printk (KERN_ERR "pci_pool_free %s/%s, %p/%lx (bad dma)\n",
pool->dev ? pool->dev->slot_name : NULL,
pool->name, vaddr, dma);
return;
}
#ifdef CONFIG_PCIPOOL_DEBUG
if (((dma - page->dma) + (void *)page->vaddr) != vaddr) {
printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%x\n",
pool->dev ? pool->dev->slot_name : NULL, pool->dev ? pool->dev->slot_name : NULL,
pool->name, vaddr, dma); pool->name, vaddr, (unsigned long) dma);
return; return;
} }
#endif
block = dma - page->dma; block = dma - page->dma;
block /= pool->size; block /= pool->size;
map = block / BITS_PER_LONG; map = block / BITS_PER_LONG;
block %= BITS_PER_LONG; block %= BITS_PER_LONG;
#ifdef CONFIG_PCIPOOL_DEBUG #ifdef CONFIG_DEBUG_SLAB
if (((dma - page->dma) + (void *)page->vaddr) != vaddr) {
printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%lx\n",
pool->dev ? pool->dev->slot_name : NULL,
pool->name, vaddr, (unsigned long) dma);
return;
}
if (page->bitmap [map] & (1UL << block)) { if (page->bitmap [map] & (1UL << block)) {
printk (KERN_ERR "pci_pool_free %s/%s, dma %x already free\n", printk (KERN_ERR "pci_pool_free %s/%s, dma %x already free\n",
pool->dev ? pool->dev->slot_name : NULL, pool->dev ? pool->dev->slot_name : NULL,
pool->name, dma); pool->name, dma);
return; return;
} }
memset (vaddr, POOL_POISON_BYTE, pool->size);
#endif #endif
if (pool->flags & SLAB_POISON)
memset (vaddr, POOL_POISON_BYTE, pool->size);
spin_lock_irqsave (&pool->lock, flags); spin_lock_irqsave (&pool->lock, flags);
set_bit (block, &page->bitmap [map]); set_bit (block, &page->bitmap [map]);
...@@ -369,9 +372,19 @@ pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma) ...@@ -369,9 +372,19 @@ pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma)
spin_unlock_irqrestore (&pool->lock, flags); spin_unlock_irqrestore (&pool->lock, flags);
} }
EXPORT_SYMBOL (pci_pool_create); EXPORT_SYMBOL (pci_pool_create);
EXPORT_SYMBOL (pci_pool_destroy); EXPORT_SYMBOL (pci_pool_destroy);
EXPORT_SYMBOL (pci_pool_alloc); EXPORT_SYMBOL (pci_pool_alloc);
EXPORT_SYMBOL (pci_pool_free); EXPORT_SYMBOL (pci_pool_free);
/* **************************************** */
static int __init pcipool_init(void)
{
MOD_INC_USE_COUNT; /* never unload */
return 0;
}
module_init(pcipool_init);
MODULE_LICENSE("GPL");
struct pci_pool *pci_pool_create (const char *name, struct pci_dev *dev,
size_t size, size_t align, size_t allocation, int flags);
void pci_pool_destroy (struct pci_pool *pool);
void *pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle);
void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
...@@ -39,7 +39,7 @@ static int __init pfs168_init(void) ...@@ -39,7 +39,7 @@ static int __init pfs168_init(void)
return sa1111_init(NULL, 0x40000000, IRQ_GPIO25); return sa1111_init(NULL, 0x40000000, IRQ_GPIO25);
} }
__initcall(pfs168_init); arch_initcall(pfs168_init);
static void __init pfs168_init_irq(void) static void __init pfs168_init_irq(void)
......
...@@ -225,7 +225,7 @@ static int __init pm_init(void) ...@@ -225,7 +225,7 @@ static int __init pm_init(void)
return 0; return 0;
} }
__initcall(pm_init); fs_initcall(pm_init);
#endif #endif
......
This diff is collapsed.
...@@ -131,7 +131,7 @@ static int __init cs3_init(void) ...@@ -131,7 +131,7 @@ static int __init cs3_init(void)
return 0; return 0;
} }
__initcall(cs3_init); arch_initcall(cs3_init);
#endif // CONFIG_PROC_FS #endif // CONFIG_PROC_FS
......
...@@ -429,7 +429,7 @@ static int __init system3_init(void) ...@@ -429,7 +429,7 @@ static int __init system3_init(void)
/********************************************************************** /**********************************************************************
* kernel magic macros * kernel magic macros
*/ */
__initcall(system3_init); arch_initcall(system3_init);
MACHINE_START(PT_SYSTEM3, "PT System 3") MACHINE_START(PT_SYSTEM3, "PT System 3")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
......
...@@ -54,7 +54,7 @@ static int __init xp860_init(void) ...@@ -54,7 +54,7 @@ static int __init xp860_init(void)
return 0; return 0;
} }
__initcall(xp860_init); arch_initcall(xp860_init);
static struct map_desc xp860_io_desc[] __initdata = { static struct map_desc xp860_io_desc[] __initdata = {
/* virtual physical length type */ /* virtual physical length type */
......
...@@ -65,7 +65,7 @@ static int __init yopy_hw_init(void) ...@@ -65,7 +65,7 @@ static int __init yopy_hw_init(void)
return 0; return 0;
} }
__initcall(yopy_hw_init); arch_initcall(yopy_hw_init);
static struct map_desc yopy_io_desc[] __initdata = { static struct map_desc yopy_io_desc[] __initdata = {
......
...@@ -21,9 +21,9 @@ ENTRY(v4t_late_abort) ...@@ -21,9 +21,9 @@ ENTRY(v4t_late_abort)
tst r3, #PSR_T_BIT @ check for thumb mode tst r3, #PSR_T_BIT @ check for thumb mode
mrc p15, 0, r1, c5, c0, 0 @ get FSR mrc p15, 0, r1, c5, c0, 0 @ get FSR
mrc p15, 0, r0, c6, c0, 0 @ get FAR mrc p15, 0, r0, c6, c0, 0 @ get FAR
bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR
ldreq r8, [r2] @ read arm instruction
bne .data_thumb_abort bne .data_thumb_abort
ldr r8, [r2] @ read arm instruction
bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR
tst r8, #1 << 20 @ L = 1 -> write? tst r8, #1 << 20 @ L = 1 -> write?
orreq r1, r1, #1 << 11 @ yes. orreq r1, r1, #1 << 11 @ yes.
and r7, r8, #15 << 24 and r7, r8, #15 << 24
...@@ -203,7 +203,7 @@ ENTRY(v4t_late_abort) ...@@ -203,7 +203,7 @@ ENTRY(v4t_late_abort)
ldr r7, [sp, #13 << 2] ldr r7, [sp, #13 << 2]
tst r8, #1 << 11 tst r8, #1 << 11
addne r7, r7, r6, lsl #2 @ increment SP if PUSH addne r7, r7, r6, lsl #2 @ increment SP if PUSH
subeq r7, r7, r6, lsr #2 @ decrement SP if POP subeq r7, r7, r6, lsl #2 @ decrement SP if POP
str r7, [sp, #13 << 2] str r7, [sp, #13 << 2]
mov pc, lr mov pc, lr
......
...@@ -611,4 +611,4 @@ static int __init alignment_init(void) ...@@ -611,4 +611,4 @@ static int __init alignment_init(void)
return 0; return 0;
} }
__initcall(alignment_init); fs_initcall(alignment_init);
...@@ -98,7 +98,8 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *handl ...@@ -98,7 +98,8 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *handl
{ {
int gfp = GFP_KERNEL; int gfp = GFP_KERNEL;
if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) if (hwdev == NULL || dev_is_sa1111(hwdev) ||
hwdev->dma_mask != 0xffffffff)
gfp |= GFP_DMA; gfp |= GFP_DMA;
return consistent_alloc(gfp, size, handle); return consistent_alloc(gfp, size, handle);
......
...@@ -65,4 +65,4 @@ static int __init minicache_init(void) ...@@ -65,4 +65,4 @@ static int __init minicache_init(void)
return 0; return 0;
} }
__initcall(minicache_init); core_initcall(minicache_init);
...@@ -73,8 +73,6 @@ nwfpe_enter: ...@@ -73,8 +73,6 @@ nwfpe_enter:
mov r4, lr @ save the failure-return addresses mov r4, lr @ save the failure-return addresses
mov sl, sp mov sl, sp
bl FPA11_CheckInit @ check to see if we are initialised
ldr r5, [sp, #60] @ get contents of PC; ldr r5, [sp, #60] @ get contents of PC;
sub r8, r5, #4 sub r8, r5, #4
.Lx2: ldrt r0, [r8] @ get actual instruction into r0 .Lx2: ldrt r0, [r8] @ get actual instruction into r0
......
...@@ -66,7 +66,6 @@ several floating point instructions. */ ...@@ -66,7 +66,6 @@ several floating point instructions. */
.globl nwfpe_enter .globl nwfpe_enter
nwfpe_enter: nwfpe_enter:
mov sl, sp mov sl, sp
bl FPA11_CheckInit @ check to see if we are initialised
ldr r5, [sp, #60] @ get contents of PC ldr r5, [sp, #60] @ get contents of PC
bic r5, r5, #0xfc000003 bic r5, r5, #0xfc000003
......
...@@ -34,7 +34,7 @@ unsigned int EmulateCPDT(const unsigned int); ...@@ -34,7 +34,7 @@ unsigned int EmulateCPDT(const unsigned int);
unsigned int EmulateCPRT(const unsigned int); unsigned int EmulateCPRT(const unsigned int);
/* Reset the FPA11 chip. Called to initialize and reset the emulator. */ /* Reset the FPA11 chip. Called to initialize and reset the emulator. */
void resetFPA11(void) static void resetFPA11(void)
{ {
int i; int i;
FPA11 *fpa11 = GET_FPA11(); FPA11 *fpa11 = GET_FPA11();
...@@ -126,16 +126,14 @@ void SetRoundingPrecision(const unsigned int opcode) ...@@ -126,16 +126,14 @@ void SetRoundingPrecision(const unsigned int opcode)
} }
} }
void FPA11_CheckInit(void) void nwfpe_init(union fp_state *fp)
{ {
FPA11 *fpa11 = GET_FPA11(); FPA11 *fpa11 = (FPA11 *)fp;
if (unlikely(fpa11->initflag == 0)) memset(fpa11, 0, sizeof(FPA11));
{ resetFPA11();
resetFPA11(); SetRoundingMode(ROUND_TO_NEAREST);
SetRoundingMode(ROUND_TO_NEAREST); SetRoundingPrecision(ROUND_EXTENDED);
SetRoundingPrecision(ROUND_EXTENDED); fpa11->initflag = 1;
fpa11->initflag = 1;
}
} }
/* Emulate the instruction in the opcode. */ /* Emulate the instruction in the opcode. */
......
...@@ -80,8 +80,8 @@ typedef struct tagFPA11 { ...@@ -80,8 +80,8 @@ typedef struct tagFPA11 {
initialised. */ initialised. */
} FPA11; } FPA11;
extern void resetFPA11(void);
extern void SetRoundingMode(const unsigned int); extern void SetRoundingMode(const unsigned int);
extern void SetRoundingPrecision(const unsigned int); extern void SetRoundingPrecision(const unsigned int);
extern void nwfpe_init(union fp_state *fp);
#endif #endif
...@@ -42,10 +42,8 @@ ...@@ -42,10 +42,8 @@
#include "fpa11.inl" #include "fpa11.inl"
/* kernel symbols required for signal handling */ /* kernel symbols required for signal handling */
typedef struct task_struct* PTASK;
#ifdef MODULE #ifdef MODULE
void fp_send_sig(unsigned long sig, PTASK p, int priv); void fp_send_sig(unsigned long sig, struct task_struct *p, int priv);
#if LINUX_VERSION_CODE > 0x20115 #if LINUX_VERSION_CODE > 0x20115
MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>"); MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>");
MODULE_DESCRIPTION("NWFPE floating point emulator"); MODULE_DESCRIPTION("NWFPE floating point emulator");
...@@ -63,9 +61,11 @@ void fp_setup(void); ...@@ -63,9 +61,11 @@ void fp_setup(void);
/* external declarations for saved kernel symbols */ /* external declarations for saved kernel symbols */
extern void (*kern_fp_enter)(void); extern void (*kern_fp_enter)(void);
extern void (*fp_init)(union fp_state *);
/* Original value of fp_enter from kernel before patched by fpe_init. */ /* Original value of fp_enter from kernel before patched by fpe_init. */
static void (*orig_fp_enter)(void); static void (*orig_fp_enter)(void);
static void (*orig_fp_init)(union fp_state *);
/* forward declarations */ /* forward declarations */
extern void nwfpe_enter(void); extern void nwfpe_enter(void);
...@@ -108,7 +108,9 @@ static int __init fpe_init(void) ...@@ -108,7 +108,9 @@ static int __init fpe_init(void)
/* Save pointer to the old FP handler and then patch ourselves in */ /* Save pointer to the old FP handler and then patch ourselves in */
orig_fp_enter = kern_fp_enter; orig_fp_enter = kern_fp_enter;
orig_fp_init = fp_init;
kern_fp_enter = nwfpe_enter; kern_fp_enter = nwfpe_enter;
fp_init = nwfpe_init;
return 0; return 0;
} }
...@@ -117,6 +119,7 @@ static void __exit fpe_exit(void) ...@@ -117,6 +119,7 @@ static void __exit fpe_exit(void)
{ {
/* Restore the values we saved earlier. */ /* Restore the values we saved earlier. */
kern_fp_enter = orig_fp_enter; kern_fp_enter = orig_fp_enter;
fp_init = orig_fp_init;
} }
/* /*
......
...@@ -52,6 +52,4 @@ ...@@ -52,6 +52,4 @@
#define __virt_to_bus(x) __virt_to_phys(x) #define __virt_to_bus(x) __virt_to_phys(x)
#define __bus_to_virt(x) __phys_to_virt(x) #define __bus_to_virt(x) __phys_to_virt(x)
#define PHYS_TO_NID(x) 0
#endif #endif
...@@ -31,6 +31,4 @@ ...@@ -31,6 +31,4 @@
#define __virt_to_bus__is_a_macro #define __virt_to_bus__is_a_macro
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -50,6 +50,4 @@ ...@@ -50,6 +50,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) (x) #define __bus_to_virt(x) (x)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -46,6 +46,4 @@ ...@@ -46,6 +46,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) __phys_to_virt(x) #define __bus_to_virt(x) __phys_to_virt(x)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -90,8 +90,6 @@ ...@@ -90,8 +90,6 @@
* memory bank. For those systems, simply undefine CONFIG_DISCONTIGMEM. * memory bank. For those systems, simply undefine CONFIG_DISCONTIGMEM.
*/ */
#ifdef CONFIG_ARCH_EDB7211
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
/* /*
* Because of the wide memory address space between physical RAM banks on the * Because of the wide memory address space between physical RAM banks on the
...@@ -155,11 +153,5 @@ ...@@ -155,11 +153,5 @@
#endif /* CONFIG_DISCONTIGMEM */ #endif /* CONFIG_DISCONTIGMEM */
#endif /* CONFIG_ARCH_EDB7211 */
#ifndef PFN_TO_NID
#define PFN_TO_NID(pfn) (0)
#endif
#endif #endif
...@@ -48,6 +48,4 @@ ...@@ -48,6 +48,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) (x) #define __bus_to_virt(x) (x)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -80,6 +80,4 @@ extern unsigned long __bus_to_virt(unsigned long); ...@@ -80,6 +80,4 @@ extern unsigned long __bus_to_virt(unsigned long);
#define __phys_to_virt__is_a_macro #define __phys_to_virt__is_a_macro
#define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET) #define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#define PAGE_OFFSET (0xc0000000UL) #define PAGE_OFFSET (0xc0000000UL)
#define PHYS_OFFSET (0x00000000UL) #define PHYS_OFFSET (0x00000000UL)
#define PHYS_TO_NID(addr) (0)
/* /*
* On epxa10, the dram is contiguous * On epxa10, the dram is contiguous
*/ */
......
...@@ -58,6 +58,4 @@ ...@@ -58,6 +58,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) (x - INTEGRATOR_HDR0_SDRAM_BASE + PAGE_OFFSET) #define __bus_to_virt(x) (x - INTEGRATOR_HDR0_SDRAM_BASE + PAGE_OFFSET)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -49,8 +49,6 @@ ...@@ -49,8 +49,6 @@
#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP310_SIATVR)) | ((*IOP310_SIABAR) & 0xfffffff0)) #define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP310_SIATVR)) | ((*IOP310_SIABAR) & 0xfffffff0))
#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP310_SIALR)) | ( *IOP310_SIATVR))) #define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP310_SIALR)) | ( *IOP310_SIATVR)))
#define PHYS_TO_NID(x) 0
/* boot mem allocate global pointer for MU circular queues QBAR */ /* boot mem allocate global pointer for MU circular queues QBAR */
#ifdef CONFIG_IOP310_MU #ifdef CONFIG_IOP310_MU
extern void *mu_mem; extern void *mu_mem;
......
...@@ -47,6 +47,4 @@ ...@@ -47,6 +47,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) __phys_to_virt(x) #define __bus_to_virt(x) __phys_to_virt(x)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -43,6 +43,4 @@ ...@@ -43,6 +43,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) ((unsigned long)(x) + PAGE_OFFSET - BUS_OFFSET) #define __bus_to_virt(x) ((unsigned long)(x) + PAGE_OFFSET - BUS_OFFSET)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -19,9 +19,10 @@ ...@@ -19,9 +19,10 @@
/* comment out following if you have a rev01 board */ /* comment out following if you have a rev01 board */
#define PXA_IDP_REV02 1 #define PXA_IDP_REV02 1
//#undef PXA_IDP_REV02
#ifdef PXA_IDP_REV02 #ifdef PXA_IDP_REV02
//Use this as well for 0017-x004 and greater pcb's:
#define PXA_IDP_REV04 1
#define IDP_FLASH_PHYS (PXA_CS0_PHYS) #define IDP_FLASH_PHYS (PXA_CS0_PHYS)
#define IDP_ALT_FLASH_PHYS (PXA_CS1_PHYS) #define IDP_ALT_FLASH_PHYS (PXA_CS1_PHYS)
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
#define IDP_IDE_BASE (0xf0000000) #define IDP_IDE_BASE (0xf0000000)
#define IDP_IDE_SIZE (1*1024*1024) #define IDP_IDE_SIZE (1*1024*1024)
#define IDE_REG_STRIDE 4
#define IDP_ETH_BASE (IDP_IDE_BASE + IDP_IDE_SIZE) #define IDP_ETH_BASE (IDP_IDE_BASE + IDP_IDE_SIZE)
#define IDP_ETH_SIZE (1*1024*1024) #define IDP_ETH_SIZE (1*1024*1024)
...@@ -111,6 +113,33 @@ ...@@ -111,6 +113,33 @@
* Bit masks for various registers * Bit masks for various registers
*/ */
// IDP_CPLD_PCCARD_PWR
#define PCC0_PWR0 (1 << 0)
#define PCC0_PWR1 (1 << 1)
#define PCC0_PWR2 (1 << 2)
#define PCC0_PWR3 (1 << 3)
#define PCC1_PWR0 (1 << 4)
#define PCC1_PWR1 (1 << 5)
#define PCC1_PWR2 (1 << 6)
#define PCC1_PWR3 (1 << 7)
// IDP_CPLD_PCCARD_EN
#define PCC0_RESET (1 << 6)
#define PCC1_RESET (1 << 7)
#define PCC0_ENABLE (1 << 0)
#define PCC1_ENABLE (1 << 1)
// IDP_CPLD_PCCARDx_STATUS
#define _PCC_WRPROT (1 << 7) // 7-4 read as low true
#define _PCC_RESET (1 << 6)
#define _PCC_IRQ (1 << 5)
#define _PCC_INPACK (1 << 4)
#define PCC_BVD2 (1 << 3)
#define PCC_BVD1 (1 << 2)
#define PCC_VS2 (1 << 1)
#define PCC_VS1 (1 << 0)
#define PCC_DETECT(x) (GPLR(7 + (x)) & GPIO_bit(7 + (x)))
/* /*
* Macros for LCD Driver * Macros for LCD Driver
...@@ -129,6 +158,32 @@ ...@@ -129,6 +158,32 @@
#endif #endif
/* A listing of interrupts used by external hardware devices */
#ifdef PXA_IDP_REV04
#define TOUCH_PANEL_IRQ IRQ_GPIO(5)
#define IDE_IRQ IRQ_GPIO(21)
#else
#define TOUCH_PANEL_IRQ IRQ_GPIO(21)
#define IDE_IRQ IRQ_GPIO(5)
#endif
#define TOUCH_PANEL_IRQ_EDGE IRQT_FALLING
#define ETHERNET_IRQ IRQ_GPIO(4)
#define ETHERNET_IRQ_EDGE IRQT_RISING
#define IDE_IRQ_EDGE IRQT_RISING
#define PCMCIA_S0_CD_VALID IRQ_GPIO(7)
#define PCMCIA_S0_CD_VALID_EDGE IRQT_BOTHEDGE
#define PCMCIA_S1_CD_VALID IRQ_GPIO(8)
#define PCMCIA_S1_CD_VALID_EDGE IRQT_BOTHEDGE
#define PCMCIA_S0_RDYINT IRQ_GPIO(19)
#define PCMCIA_S1_RDYINT IRQ_GPIO(22)
/* /*
* Macros for LED Driver * Macros for LED Driver
...@@ -173,14 +228,6 @@ ...@@ -173,14 +228,6 @@
inputs = (IDP_CPLD_KB_ROW & 0x7f);\ inputs = (IDP_CPLD_KB_ROW & 0x7f);\
} }
/* A listing of interrupts used by external hardware devices */
#define TOUCH_PANEL_IRQ IRQ_GPIO(21)
#define TOUCH_PANEL_IRQ_EGDE GPIO_FALLING_EDGE
#define ETHERNET_IRQ IRQ_GPIO(4)
#define ETHERNET_IRQ_EDGE GPIO_RISING_EDGE
#else #else
/* /*
...@@ -286,7 +333,7 @@ extern unsigned int idp_control_port_shadow; ...@@ -286,7 +333,7 @@ extern unsigned int idp_control_port_shadow;
#define WRITE_IDP_CPLD_LED_CONTROL(value, mask) \ #define WRITE_IDP_CPLD_LED_CONTROL(value, mask) \
{\ {\
idp_cpld_led_control_shadow = ((value & mask) | (idp_cpld_led_control_shadow & ~mask));\ idp_cpld_led_control_shadow = (((value & mask) | (idp_cpld_led_control_shadow & ~mask)));\
IDP_CPLD_LED_CONTROL = idp_cpld_led_control_shadow;\ IDP_CPLD_LED_CONTROL = idp_cpld_led_control_shadow;\
} }
#define WRITE_IDP_CPLD_PERIPH_PWR(value, mask) \ #define WRITE_IDP_CPLD_PERIPH_PWR(value, mask) \
...@@ -346,10 +393,10 @@ extern unsigned int idp_control_port_shadow; ...@@ -346,10 +393,10 @@ extern unsigned int idp_control_port_shadow;
/* A listing of interrupts used by external hardware devices */ /* A listing of interrupts used by external hardware devices */
#define TOUCH_PANEL_IRQ IRQ_GPIO(21) #define TOUCH_PANEL_IRQ IRQ_GPIO(21)
#define TOUCH_PANEL_IRQ_EGDE GPIO_FALLING_EDGE #define TOUCH_PANEL_IRQ_EGDE IRQT_FALLING
#define ETHERNET_IRQ IRQ_GPIO(4) #define ETHERNET_IRQ IRQ_GPIO(4)
#define ETHERNET_IRQ_EDGE GPIO_RISING_EDGE #define ETHERNET_IRQ_EDGE IRQT_RISING
/* /*
* Bit masks for various registers * Bit masks for various registers
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
* Physical DRAM offset. * Physical DRAM offset.
*/ */
#define PHYS_OFFSET (0xa0000000UL) #define PHYS_OFFSET (0xa0000000UL)
#define PHYS_TO_NID(addr) (0)
/* /*
* physical vs virtual ram conversion * physical vs virtual ram conversion
......
...@@ -50,6 +50,4 @@ ...@@ -50,6 +50,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) __phys_to_virt(x) #define __bus_to_virt(x) __phys_to_virt(x)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -40,6 +40,4 @@ ...@@ -40,6 +40,4 @@
#define isa_virt_to_bus virt_to_bus #define isa_virt_to_bus virt_to_bus
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -41,6 +41,4 @@ ...@@ -41,6 +41,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) __phys_to_virt(x) #define __bus_to_virt(x) __phys_to_virt(x)
#define PHYS_TO_NID(addr) (0)
#endif #endif
...@@ -53,7 +53,6 @@ typedef struct { void *null; } elf_fpregset_t; ...@@ -53,7 +53,6 @@ typedef struct { void *null; } elf_fpregset_t;
/* This yields a mask that user programs can use to figure out what /* This yields a mask that user programs can use to figure out what
instruction set this cpu supports. */ instruction set this cpu supports. */
extern unsigned int elf_hwcap;
#define ELF_HWCAP (elf_hwcap) #define ELF_HWCAP (elf_hwcap)
/* This yields a string that ld.so will use to load implementation /* This yields a string that ld.so will use to load implementation
......
...@@ -611,10 +611,13 @@ struct sa1111_device { ...@@ -611,10 +611,13 @@ struct sa1111_device {
extern struct sa1111_device *sa1111; extern struct sa1111_device *sa1111;
int sa1111_check_dma_bug(dma_addr_t addr);
/* /*
* These frob the SKPCR register. * These frob the SKPCR register.
*/ */
void sa1111_enable_device(unsigned int mask); void sa1111_enable_device(unsigned int mask);
void sa1111_disable_device(unsigned int mask); void sa1111_disable_device(unsigned int mask);
#endif /* _ASM_ARCH_SA1111 */ #endif /* _ASM_ARCH_SA1111 */
/*
* linux/include/asm-arm/mach/amba_kmi.h
*
* Copyright (C) 2000 Deep Blue Solutions Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
struct kmi_info {
u_int base;
u_int irq;
u_char divisor;
u_char type;
u_char state;
u_char prev_rx;
u_char last_tx;
u_char resend_count;
u_short res;
u_char present;
wait_queue_head_t wait_q;
void (*rx)(struct kmi_info *, u_int val,
struct pt_regs *regs);
char name[8];
};
#define KMI_KEYBOARD 0
#define KMI_MOUSE 1
int register_kmi(struct kmi_info *kmi);
...@@ -74,6 +74,8 @@ static inline void *phys_to_virt(unsigned long x) ...@@ -74,6 +74,8 @@ static inline void *phys_to_virt(unsigned long x)
#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)) #define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
#define virt_addr_valid(kaddr) ((kaddr) >= PAGE_OFFSET && (kaddr) < (unsigned long)high_memory) #define virt_addr_valid(kaddr) ((kaddr) >= PAGE_OFFSET && (kaddr) < (unsigned long)high_memory)
#define PHYS_TO_NID(addr) (0)
#else #else
/* /*
* This is more complex. We have a set of mem_map arrays spread * This is more complex. We have a set of mem_map arrays spread
......
...@@ -34,13 +34,17 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) ...@@ -34,13 +34,17 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
/* /*
* This is the actual mm switch as far as the scheduler * This is the actual mm switch as far as the scheduler
* is concerned. No registers are touched. * is concerned. No registers are touched. We avoid
* calling the CPU specific function when the mm hasn't
* actually changed.
*/ */
static inline void static inline void
switch_mm(struct mm_struct *prev, struct mm_struct *next, switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk, unsigned int cpu) struct task_struct *tsk, unsigned int cpu)
{ {
cpu_switch_mm(next->pgd, next); if (prev != next) {
cpu_switch_mm(next->pgd, next);
}
} }
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
......
...@@ -12,6 +12,34 @@ ...@@ -12,6 +12,34 @@
struct pci_dev; struct pci_dev;
/*
* For SA-1111 these functions are "magic" and utilize bounce
* buffers as need to workaround SA-1111 DMA bugs. They are called in
* place of their pci_* counterparts when dev_is_sa1111() returns true.
*/
dma_addr_t sa1111_map_single(struct pci_dev *, void *, size_t, int);
void sa1111_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
int sa1111_map_sg(struct pci_dev *, struct scatterlist *, int, int);
void sa1111_unmap_sg(struct pci_dev *, struct scatterlist *, int, int);
void sa1111_dma_sync_single(struct pci_dev *, dma_addr_t, size_t, int);
void sa1111_dma_sync_sg(struct pci_dev *, struct scatterlist *, int, int);
#ifdef CONFIG_SA1111
#define SA1111_FAKE_PCIDEV ((struct pci_dev *) 1111)
static inline int dev_is_sa1111(const struct pci_dev *dev)
{
return (dev == SA1111_FAKE_PCIDEV);
}
#else
static inline int dev_is_sa1111(const struct pci_dev *dev) { return 0; }
#endif
static inline void pcibios_set_master(struct pci_dev *dev) static inline void pcibios_set_master(struct pci_dev *dev)
{ {
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
...@@ -61,17 +89,9 @@ pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, ...@@ -61,17 +89,9 @@ pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr,
static inline dma_addr_t static inline dma_addr_t
pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
{ {
#ifdef CONFIG_SA1111 if (dev_is_sa1111(hwdev))
extern dma_addr_t sa1111_map_single(struct pci_dev *, void *, size_t, int);
/*
* for SA1111 these functions are "magic" and relocate buffers. We
* only need to do these if hwdev is non-null; otherwise we expect
* the buffer to already be suitable for DMA.
*/
if (hwdev != NULL)
return sa1111_map_single(hwdev, ptr, size, direction); return sa1111_map_single(hwdev, ptr, size, direction);
#endif
consistent_sync(ptr, size, direction); consistent_sync(ptr, size, direction);
return virt_to_bus(ptr); return virt_to_bus(ptr);
} }
...@@ -86,12 +106,9 @@ pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) ...@@ -86,12 +106,9 @@ pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
static inline void static inline void
pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction)
{ {
#ifdef CONFIG_SA1111 if (dev_is_sa1111(hwdev))
extern void sa1111_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
if (hwdev != NULL)
sa1111_unmap_single(hwdev, dma_addr, size, direction); sa1111_unmap_single(hwdev, dma_addr, size, direction);
#endif
/* nothing to do */ /* nothing to do */
} }
...@@ -99,7 +116,7 @@ pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int di ...@@ -99,7 +116,7 @@ pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int di
* Whether pci_unmap_{single,page} is a nop depends upon the * Whether pci_unmap_{single,page} is a nop depends upon the
* configuration. * configuration.
*/ */
#ifdef CONFIG_PCI #if defined(CONFIG_PCI) || defined(CONFIG_SA1111)
#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME; #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME; #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME) #define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
...@@ -135,6 +152,9 @@ pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int directi ...@@ -135,6 +152,9 @@ pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int directi
{ {
int i; int i;
if (dev_is_sa1111(hwdev))
return sa1111_map_sg(hwdev, sg, nents, direction);
for (i = 0; i < nents; i++, sg++) { for (i = 0; i < nents; i++, sg++) {
char *virt; char *virt;
...@@ -153,6 +173,11 @@ pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int directi ...@@ -153,6 +173,11 @@ pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int directi
static inline void static inline void
pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
{ {
if (dev_is_sa1111(hwdev)) {
sa1111_unmap_sg(hwdev, sg, nents, direction);
return;
}
/* nothing to do */ /* nothing to do */
} }
...@@ -168,6 +193,11 @@ pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direc ...@@ -168,6 +193,11 @@ pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direc
static inline void static inline void
pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction)
{ {
if (dev_is_sa1111(hwdev)) {
sa1111_dma_sync_single(hwdev, dma_handle, size, direction);
return;
}
consistent_sync(bus_to_virt(dma_handle), size, direction); consistent_sync(bus_to_virt(dma_handle), size, direction);
} }
...@@ -182,6 +212,11 @@ pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int d ...@@ -182,6 +212,11 @@ pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int d
{ {
int i; int i;
if (dev_is_sa1111(hwdev)) {
sa1111_dma_sync_sg(hwdev, sg, nelems, direction);
return;
}
for (i = 0; i < nelems; i++, sg++) { for (i = 0; i < nelems; i++, sg++) {
char *virt = page_address(sg->page) + sg->offset; char *virt = page_address(sg->page) + sg->offset;
consistent_sync(virt, sg->length, direction); consistent_sync(virt, sg->length, direction);
...@@ -204,6 +239,19 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) ...@@ -204,6 +239,19 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
/* Return the index of the PCI controller for device PDEV. */ /* Return the index of the PCI controller for device PDEV. */
#define pci_controller_num(PDEV) (0) #define pci_controller_num(PDEV) (0)
#if defined(CONFIG_SA1111) && !defined(CONFIG_PCI)
/* SA-1111 needs these prototypes even when !defined(CONFIG_PCI) */
/* kmem_cache style wrapper around pci_alloc_consistent() */
struct pci_pool *pci_pool_create (const char *name, struct pci_dev *dev,
size_t size, size_t align, size_t allocation, int flags);
void pci_pool_destroy (struct pci_pool *pool);
void *pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle);
void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
#endif
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif #endif
...@@ -6,10 +6,14 @@ ...@@ -6,10 +6,14 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
/* 32-bit code is always OK. Some cpus can do 26-bit, some can't. */ /*
#define ELF_PROC_OK(x) \ * 32-bit code is always OK. Some cpus can do 26-bit, some can't.
((! ((x)->e_flags & EF_ARM_APCS26)) \ */
|| (elf_hwcap & HWCAP_26BIT)) #define ELF_PROC_OK(x) \
(( (elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 1) == 1) || \
(!(elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 3) == 0) || \
( (elf_hwcap & HWCAP_26BIT) && (x)->e_flags & EF_ARM_APCS26) || \
((x)->e_flags & EF_ARM_APCS26) == 0)
/* Old NetWinder binaries were compiled in such a way that the iBCS /* Old NetWinder binaries were compiled in such a way that the iBCS
heuristic always trips on them. Until these binaries become uncommon heuristic always trips on them. Until these binaries become uncommon
......
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
regs->ARM_cpsr = USR_MODE; \ regs->ARM_cpsr = USR_MODE; \
else \ else \
regs->ARM_cpsr = USR26_MODE; \ regs->ARM_cpsr = USR26_MODE; \
regs->ARM_pc = pc; /* pc */ \ if (elf_hwcap & HWCAP_THUMB && pc & 1) \
regs->ARM_cpsr |= PSR_T_BIT; \
regs->ARM_pc = pc & ~1; /* pc */ \
regs->ARM_sp = sp; /* sp */ \ regs->ARM_sp = sp; /* sp */ \
regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
regs->ARM_r1 = stack[1]; /* r1 (argv) */ \ regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/procinfo.h>
#include <asm/arch/memory.h> #include <asm/arch/memory.h>
#include <asm/proc/processor.h> #include <asm/proc/processor.h>
......
...@@ -46,6 +46,8 @@ struct proc_info_list { ...@@ -46,6 +46,8 @@ struct proc_info_list {
struct cpu_user_fns *user; struct cpu_user_fns *user;
}; };
extern unsigned int elf_hwcap;
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define PROC_INFO_SZ 44 #define PROC_INFO_SZ 44
......
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#if defined(__thumb__)
#define __NR_SYSCALL_BASE 0
#else
#define __NR_SYSCALL_BASE 0x900000 #define __NR_SYSCALL_BASE 0x900000
#endif
/* /*
* This file contains the system call numbers. * This file contains the system call numbers.
...@@ -273,8 +277,16 @@ ...@@ -273,8 +277,16 @@
#define __sys1(x) __sys2(x) #define __sys1(x) __sys2(x)
#ifndef __syscall #ifndef __syscall
#if defined(__thumb__)
#define __syscall(name) \
"push {r7}\n\t" \
"mov r7, #" __sys1(__NR_##name) "\n\t" \
"swi 0\n\t" \
"pop {r7}"
#else
#define __syscall(name) "swi\t" __sys1(__NR_##name) "\n\t" #define __syscall(name) "swi\t" __sys1(__NR_##name) "\n\t"
#endif #endif
#endif
#define __syscall_return(type, res) \ #define __syscall_return(type, res) \
do { \ do { \
...@@ -287,91 +299,103 @@ do { \ ...@@ -287,91 +299,103 @@ do { \
#define _syscall0(type,name) \ #define _syscall0(type,name) \
type name(void) { \ type name(void) { \
long __res; \ register long __res __asm__("r0"); \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
__syscall(name) \ __syscall(name) \
"mov %0,r0" \ :"=r" (__res) \
:"=r" (__res) : : "r0","lr"); \ : \
: "lr"); \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#define _syscall1(type,name,type1,arg1) \ #define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) { \ type name(type1 arg1) { \
long __res; \ register long __r0 __asm__("r0") = (long)arg1; \
register long __res __asm__("r0"); \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"mov\tr0,%1\n\t" \
__syscall(name) \ __syscall(name) \
"mov %0,r0" \
: "=r" (__res) \ : "=r" (__res) \
: "r" ((long)(arg1)) \ : "r" (__r0) \
: "r0","lr"); \ : "lr"); \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#define _syscall2(type,name,type1,arg1,type2,arg2) \ #define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) { \ type name(type1 arg1,type2 arg2) { \
long __res; \ register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __res __asm__("r0"); \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"mov\tr0,%1\n\t" \
"mov\tr1,%2\n\t" \
__syscall(name) \ __syscall(name) \
"mov\t%0,r0" \
: "=r" (__res) \ : "=r" (__res) \
: "r" ((long)(arg1)),"r" ((long)(arg2)) \ : "r" (__r0),"r" (__r1) \
: "r0","r1","lr"); \ : "lr"); \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) { \ type name(type1 arg1,type2 arg2,type3 arg3) { \
long __res; \ register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __res __asm__("r0"); \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"mov\tr0,%1\n\t" \
"mov\tr1,%2\n\t" \
"mov\tr2,%3\n\t" \
__syscall(name) \ __syscall(name) \
"mov\t%0,r0" \
: "=r" (__res) \ : "=r" (__res) \
: "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)) \ : "r" (__r0),"r" (__r1),"r" (__r2) \
: "r0","r1","r2","lr"); \ : "lr"); \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
long __res; \ register long __r0 __asm__("r0") = (long)arg1; \
__asm__ __volatile__ ( \ register long __r1 __asm__("r1") = (long)arg2; \
"mov\tr0,%1\n\t" \ register long __r2 __asm__("r2") = (long)arg3; \
"mov\tr1,%2\n\t" \ register long __r3 __asm__("r3") = (long)arg4; \
"mov\tr2,%3\n\t" \ register long __res __asm__("r0"); \
"mov\tr3,%4\n\t" \ __asm__ __volatile__ ( \
__syscall(name) \ __syscall(name) \
"mov\t%0,r0" \ : "=r" (__res) \
: "=r" (__res) \ : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3) \
: "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)) \ : "lr"); \
: "r0","r1","r2","r3","lr"); \ __syscall_return(type,__res); \
__syscall_return(type,__res); \
} }
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
long __res; \ register long __r0 __asm__("r0") = (long)arg1; \
__asm__ __volatile__ ( \ register long __r1 __asm__("r1") = (long)arg2; \
"mov\tr0,%1\n\t" \ register long __r2 __asm__("r2") = (long)arg3; \
"mov\tr1,%2\n\t" \ register long __r3 __asm__("r3") = (long)arg4; \
"mov\tr2,%3\n\t" \ register long __r4 __asm__("r4") = (long)arg5; \
"mov\tr3,%4\n\t" \ register long __res __asm__("r0"); \
"mov\tr4,%5\n\t" \ __asm__ __volatile__ ( \
__syscall(name) \ __syscall(name) \
"mov\t%0,r0" \ : "=r" (__res) \
: "=r" (__res) \ : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3),"r" (__r4) \
: "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)), \ : "lr"); \
"r" ((long)(arg5)) \ __syscall_return(type,__res); \
: "r0","r1","r2","r3","r4","lr"); \ }
__syscall_return(type,__res); \
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __r3 __asm__("r3") = (long)arg4; \
register long __r4 __asm__("r4") = (long)arg5; \
register long __r5 __asm__("r5") = (long)arg6; \
register long __res __asm__("r0"); \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res) \
: "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3), "r" (__r4),"r" (__r5) \
: "lr"); \
__syscall_return(type,__res); \
} }
#ifdef __KERNEL_SYSCALLS__ #ifdef __KERNEL_SYSCALLS__
......
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