summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
commit7fd36ebeeec9244a7431bb010e6e3c5e4848a0d5 (patch)
tree5fb03a9aafdd1cec5f4f6ff7f1873174cb89b66c /arch/arm/kernel
parentba2dacab305c598cd4c34a604f8e276bf5bab5ff (diff)
Merge with Linux 2.3.99-pre8. Linus must hate me, too man patches ;-)
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/arch.h3
-rw-r--r--arch/arm/kernel/bios32.c3
-rw-r--r--arch/arm/kernel/calls.S4
-rw-r--r--arch/arm/kernel/debug-armv.S27
-rw-r--r--arch/arm/kernel/entry-armv.S20
-rw-r--r--arch/arm/kernel/head-armv.S104
-rw-r--r--arch/arm/kernel/sys_arm.c60
8 files changed, 121 insertions, 101 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 6cc5652e0..d8f14a756 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -19,6 +19,7 @@ O_OBJS_ebsa110 = dma-dummy.o
O_OBJS_footbridge = dma.o dma-footbridge.o $(ISA_DMA_OBJS) hw-footbridge.o isa.o
O_OBJS_nexuspci = dma-dummy.o
O_OBJS_sa1100 = dma-dummy.o fiq.o
+O_OBJS_l7200 = dma-dummy.o fiq.o
O_TARGET := kernel.o
diff --git a/arch/arm/kernel/arch.h b/arch/arm/kernel/arch.h
index 91de77772..87494efed 100644
--- a/arch/arm/kernel/arch.h
+++ b/arch/arm/kernel/arch.h
@@ -33,7 +33,8 @@ struct machine_desc {
};
/*
- * Set of macros to define architecture features
+ * Set of macros to define architecture features. This is built into
+ * a table by the linker.
*/
#define MACHINE_START(_type,_name) \
const struct machine_desc __mach_desc_##_type \
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 835bce140..0d2e68846 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -378,6 +378,9 @@ static int __init netwinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
case DEV(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5000):
return IRQ_NETWINDER_VGA;
+ case DEV(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285):
+ return 0;
+
default:
printk(KERN_ERR "PCI: %02X:%02X [%04X:%04X] unknown device\n",
dev->bus->number, dev->devfn,
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index d8d416c4e..eec058522 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -68,7 +68,7 @@
.long SYMBOL_NAME(sys_ni_syscall) /* was sys_mpx */
.long SYMBOL_NAME(sys_setpgid)
.long SYMBOL_NAME(sys_ni_syscall) /* was sys_ulimit */
- .long SYMBOL_NAME(sys_olduname)
+ .long SYMBOL_NAME(sys_ni_syscall) /* was sys_olduname */
/* 60 */ .long SYMBOL_NAME(sys_umask)
.long SYMBOL_NAME(sys_chroot)
.long SYMBOL_NAME(sys_ustat)
@@ -118,7 +118,7 @@
.long SYMBOL_NAME(sys_newstat)
.long SYMBOL_NAME(sys_newlstat)
.long SYMBOL_NAME(sys_newfstat)
- .long SYMBOL_NAME(sys_uname)
+ .long SYMBOL_NAME(sys_ni_syscall) /* was sys_uname */
/* 110 */ .long SYMBOL_NAME(sys_iopl)
.long SYMBOL_NAME(sys_vhangup)
.long SYMBOL_NAME(sys_ni_syscall)
diff --git a/arch/arm/kernel/debug-armv.S b/arch/arm/kernel/debug-armv.S
index ce7f2f94c..8054f8756 100644
--- a/arch/arm/kernel/debug-armv.S
+++ b/arch/arm/kernel/debug-armv.S
@@ -160,6 +160,33 @@
bne 1001b
.endm
+#elif defined(CONFIG_ARCH_L7200)
+
+ .macro addruart,rx
+
+ mrc p15, 0, \rx, c1, c0
+ tst \rx, #1 @ MMU enabled?
+ moveq \rx, #0x80000000 @ physical base address
+ movne \rx, #0xd0000000 @ virtual address
+ add \rx, \rx, #0x00044000 @ Ser1
+@ add \rx, \rx, #0x00045000 @ Ser2
+ .endm
+
+ .macro senduart,rd,rx
+ str \rd, [\rx, #0x0] @ UARTDR1
+ .endm
+
+ .macro waituart,rd,rx
+1001: ldr \rd, [\rx, #0x18] @ UARTFLG
+ tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
+ bne 1001b
+ .endm
+
+ .macro busyuart,rd,rx
+1001: ldr \rd, [\rx, #0x18] @ UARTFLG
+ tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
+ bne 1001b
+ .endm
#else
#error Unknown architecture
#endif
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 182b1c3b4..bffe289ce 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -400,6 +400,26 @@ ENTRY(soft_irq_mask)
.macro irq_prio_table
.endm
+#elif defined(CONFIG_ARCH_L7200)
+/* Don't use fast interrupts */
+ .macro disable_fiq
+ .endm
+
+ .macro get_irqnr_and_base, irqnr, irqstat, base
+ ldr r4, =0xe0001000 @ Virt addr status reg
+ ldr \irqstat, [r4] @ get interrupts
+ mov \irqnr, #0
+1001: tst \irqstat, #1
+ addeq \irqnr, \irqnr, #1
+ moveq \irqstat, \irqstat, lsr #1
+ tsteq \irqnr, #32
+ beq 1001b
+ teq \irqnr, #32
+ .endm
+
+ .macro irq_prio_table
+ .endm
+
#else
#error Unknown architecture
#endif
diff --git a/arch/arm/kernel/head-armv.S b/arch/arm/kernel/head-armv.S
index 956d9ccd2..38bfc8760 100644
--- a/arch/arm/kernel/head-armv.S
+++ b/arch/arm/kernel/head-armv.S
@@ -63,31 +63,39 @@ ENTRY(_stext)
mov r5, #0
movne pc, r0
+ mov r0, #0 @ catch old NeTTroms
+ mov r1, #5 @ (will go in 2.5)
+#endif
+#ifdef CONFIG_ARCH_L7200
+/*
+ * FIXME - No bootloader, so manually set 'r1' with our architecture number.
+ */
mov r0, #0
- mov r1, #5
+ mov r1, #19
#endif
/*
* Entry point. Entry *must* be called with r0 == 0, with the MMU off.
* r1 contains the unique architecture number. See
- * linux/arch/arm/kernel/setup.c machine_desc[] array for the complete
- * list. If you require a new number, please follow the instructions
- * given in Documentation/arm/README.
+ * linux/arch/arm/kernel/arch.c and linux/include/asm-arm/system.h for
+ * the complete list. If you require a new number, please follow the
+ * instructions given towards the end of Documentation/arm/README.
*/
-__entry: teq r0, #0
- movne r0, #'i'
+__entry: teq r0, #0 @ wrong register vals?
+ movne r0, #'i' @ yes, error 'i'
bne __error
bl __lookup_processor_type
teq r10, #0 @ invalid processor?
- moveq r0, #'p'
+ moveq r0, #'p' @ yes, error 'p'
beq __error
bl __lookup_architecture_type
teq r7, #0 @ invalid architecture?
- moveq r0, #'a'
+ moveq r0, #'a' @ yes, error 'a'
beq __error
bl __create_page_tables
- adr lr, __ret
- add pc, r10, #12 @ flush caches (returns ctrl reg)
+ adr lr, __ret @ return address
+ add pc, r10, #12 @ initialise processor
+ @ (return control reg)
__switch_data: .long __mmap_switched
.long SYMBOL_NAME(__bss_start)
@@ -115,7 +123,8 @@ __ret: ldr lr, __switch_data
.align 5
__mmap_switched:
adr r3, __switch_data + 4
- ldmia r3, {r4, r5, r6, r7, r8, sp} @ Setup stack
+ ldmia r3, {r4, r5, r6, r7, r8, sp} @ r4 = __bss_start
+ @ sp = stack pointer
mov fp, #0 @ Clear BSS
1: cmp r4, r5
@@ -150,8 +159,8 @@ __create_page_tables:
add r4, r5, #SWAPPER_PGDIR_OFFSET
mov r0, r4
mov r3, #0
- add r2, r0, #0x4000 @ Clear page table
-1: str r3, [r0], #4
+ add r2, r0, #0x4000 @ 16k of page table
+1: str r3, [r0], #4 @ Clear page table
str r3, [r0], #4
str r3, [r0], #4
str r3, [r0], #4
@@ -164,19 +173,19 @@ __create_page_tables:
*
* The identity mapping will be removed by paging_init()
*/
- mov r3, #0x0c
- orr r3, r3, r8
- add r3, r3, r5
+ mov r3, #0x0c @ cacheable, bufferable
+ orr r3, r3, r8 @ | pagetable flags
+ add r3, r3, r5 @ + start of RAM
add r0, r4, r5, lsr #18
- str r3, [r0]
- add r0, r4, #(TEXTADDR - 0x8000) >> 18
- str r3, [r0], #4
+ str r3, [r0] @ identity mapping
+ add r0, r4, #(TEXTADDR - 0x8000) >> 18 @ start of kernel
+ str r3, [r0], #4 @ PAGE_OFFSET + 0MB
add r3, r3, #1 << 20
- str r3, [r0], #4
+ str r3, [r0], #4 @ PAGE_OFFSET + 1MB
add r3, r3, #1 << 20
- str r3, [r0], #4
+ str r3, [r0], #4 @ PAGE_OFFSET + 2MB
add r3, r3, #1 << 20
- str r3, [r0], #4
+ str r3, [r0], #4 @ PAGE_OFFSET + 3MB
#ifdef CONFIG_DEBUG_LL
/*
* Map in IO space for serial debugging.
@@ -194,6 +203,10 @@ __create_page_tables:
teq r0, r2
bne 1b
#ifdef CONFIG_ARCH_NETWINDER
+ /*
+ * If we're using the NetWinder, we need to map in
+ * the 16550-type serial port for the debug messages
+ */
teq r1, #5
bne 1f
add r0, r4, #0x3fc0
@@ -228,7 +241,10 @@ __create_page_tables:
* proceed. We ought to tell the user, but since we
* don't have any guarantee that we're even running on
* the right architecture, we do virtually nothing.
- * r0 = ascii error character
+ * r0 = ascii error character:
+ * a = invalid architecture
+ * p = invalid processor
+ * i = invalid calling convention
*
* Generally, only serious errors cause this.
*/
@@ -262,8 +278,11 @@ err_str: .asciz "\nError: "
#endif
/*
- * Read processor ID register (CP#15, CR0), and determine
- * processor type.
+ * Read processor ID register (CP#15, CR0), and look up in the linker-built
+ * supported processor list. Note that we can't use the absolute addresses
+ * for the __proc_info lists since we aren't running with the MMU on
+ * (and therefore, we are not in the correct address space). We have to
+ * calculate the offset.
*
* Returns:
* r5, r6, r7 corrupted
@@ -274,20 +293,24 @@ err_str: .asciz "\nError: "
__lookup_processor_type:
adr r5, 2f
ldmia r5, {r7, r9, r10}
- sub r5, r5, r10
- add r7, r7, r5
+ sub r5, r5, r10 @ convert addresses
+ add r7, r7, r5 @ to our address space
add r10, r9, r5
mrc p15, 0, r9, c0, c0 @ get processor id
1: ldmia r10, {r5, r6, r8} @ value, mask, mmuflags
- eor r5, r5, r9
- tst r5, r6
+ and r6, r6, r9 @ mask wanted bits
+ teq r5, r6
moveq pc, lr
add r10, r10, #36 @ sizeof(proc_info_list)
cmp r10, r7
blt 1b
- mov r10, #0
+ mov r10, #0 @ unknown processor
mov pc, lr
+/*
+ * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
+ * more information about the __proc_info and __arch_info structures.
+ */
2: .long __proc_info_end
.long __proc_info_begin
.long 2b
@@ -295,10 +318,14 @@ __lookup_processor_type:
.long __arch_info_end
/*
- * Lookup machine architecture
- * r1 = machine architecture number
+ * Lookup machine architecture in the linker-build list of architectures.
+ * Note that we can't use the absolute addresses for the __arch_info
+ * lists since we aren't running with the MMU on (and therefore, we are
+ * not in the correct address space). We have to calculate the offset.
+ *
+ * r1 = machine architecture number
* Returns:
- * r4 = unused word
+ * r2, r3, r4 corrupted
* r5 = physical start address of RAM
* r6 = physical address of IO
* r7 = byte offset into page tables for IO
@@ -306,16 +333,17 @@ __lookup_processor_type:
__lookup_architecture_type:
adr r4, 2b
ldmia r4, {r2, r3, r5, r6, r7} @ throw away r2, r3
- sub r5, r4, r5
- add r4, r6, r5
+ sub r5, r4, r5 @ convert addresses
+ add r4, r6, r5 @ to our address space
add r7, r7, r5
-1: ldr r5, [r4]
+1: ldr r5, [r4] @ get machine type
teq r5, r1
beq 2f
add r4, r4, #SIZEOF_MACHINE_DESC
cmp r4, r7
blt 1b
- mov r7, #0
+ mov r7, #0 @ unknown architecture
mov pc, lr
-2: ldmib r4, {r5, r6, r7}
+2: ldmib r4, {r5, r6, r7} @ found, get results
+ mov r7, r7, lsr #18 @ pagetable byte offset
mov pc, lr
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 9abb9e617..93c539ffd 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -248,66 +248,6 @@ out:
return error;
}
-/* Compatability functions - we used to pass 5 parameters as r0, r1, r2, *r3, *(r3+4)
- * We now use r0 - r4, and return an error if the old style calling standard is used.
- * Eventually these functions will disappear.
- */
-asmlinkage int sys_uname(struct old_utsname * name)
-{
- static int warned = 0;
- int err;
-
- if (warned == 0) {
- warned ++;
- printk (KERN_NOTICE "%s (%d): obsolete uname call\n",
- current->comm, current->pid);
- }
-
- if(!name)
- return -EFAULT;
- down_read(&uts_sem);
- err=copy_to_user (name, &system_utsname, sizeof (*name));
- up_read(&uts_sem);
- return err?-EFAULT:0;
-}
-
-asmlinkage int sys_olduname(struct oldold_utsname * name)
-{
- int error;
- static int warned = 0;
-
- if (warned == 0) {
- warned ++;
- printk (KERN_NOTICE "%s (%d): obsolete olduname call\n",
- current->comm, current->pid);
- }
-
- if (!name)
- return -EFAULT;
-
- if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
- return -EFAULT;
-
- down_read(&uts_sem);
-
- error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
- error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
- error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
- error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
- error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
- error |= __put_user(0,name->release+__OLD_UTS_LEN);
- error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
- error |= __put_user(0,name->version+__OLD_UTS_LEN);
- error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
- error |= __put_user(0,name->machine+__OLD_UTS_LEN);
-
- up_read(&uts_sem);
-
- error = error ? -EFAULT : 0;
-
- return error;
-}
-
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;