patch-2.1.96 linux/arch/arm/kernel/head-armv.S

Next file: linux/arch/arm/kernel/irq.c
Previous file: linux/arch/arm/kernel/head-armo.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.95/linux/arch/arm/kernel/head-armv.S linux/arch/arm/kernel/head-armv.S
@@ -16,19 +16,21 @@
 		.globl	__stext
 /*
  * Entry point and restart point.  Entry *must* be called with r0 == 0,
- * MMU off.
+ * MMU off.  Note! These should be unique!!! Please read Documentation/ARM-README
+ * for more information.
  *
- *  r1 = 0 -> ebsa  (Ram @ 0x00000000)
- *  r1 = 1 -> RPC   (Ram @ 0x10000000)
- *  r1 = 2 -> ebsit (???)
+ *  r1 = 0 -> ebsa110  (Ram @ 0x00000000)
+ *  r1 = 1 -> RPC      (Ram @ 0x10000000)
+ *  r1 = 2 -> ebsit    (???)
  *  r1 = 3 -> nexuspci
+ *  r1 = 4 -> ebsa285  (Ram @ 0x00000000)
  */
 ENTRY(stext)
 ENTRY(_stext)
 __entry:
 		teq	r0, #0					@ check for illegal entry...
 		bne	.Lerror					@ loop indefinitely
-		cmp	r1, #4					@ Unknown machine architecture
+		cmp	r1, #5					@ Unknown machine architecture
 		bge	.Lerror
 @
 @ First thing to do is to get the page tables set up so that we can call the kernel
@@ -57,18 +59,23 @@
 
 		adr	r4, .LCMachTypes
 		add	r4, r4, r1, lsl #4
-		ldmia	r4, {r4, r5, r6}			@ r4 = page dir in physical ram
-
+		ldmia	r4, {r4, r5, r6}
+/*
+ * r4 = page dir in physical ram
+ * r5 = physical address of start of RAM
+ * r6 = I/O address
+ */
 		mov	r0, r4
 		mov	r1, #0
 		add	r2, r0, #0x4000
 1:		str	r1, [r0], #4				@ Clear page table
 		teq	r0, r2
 		bne	1b
-@
-@ Add enough entries to allow the kernel to be called.
-@ It will sort out the real mapping in paging_init
-@
+/*
+ * Add enough entries to allow the kernel to be called.
+ * It will sort out the real mapping in paging_init.
+ * We map in 2MB of memory into 0xC0000000 - 0xC0200000
+ */
 		add	r0, r4, #0x3000
 		mov	r1, #0x0000000c				@ SECT_CACHEABLE | SECT_BUFFERABLE
 		orr	r1, r1, r8
@@ -121,7 +128,7 @@
 
 .Lbranch:	.long	.Lalready_done_mmap			@ Real address of routine
 
-		@ EBSA (pg dir phys, phys ram start, phys i/o)
+		@ EBSA110 (pg dir phys, phys ram start, phys i/o)
 .LCMachTypes:	.long	SYMBOL_NAME(swapper_pg_dir) - 0xc0000000	@ Address of page tables (physical)
 		.long	0					@ Address of RAM
 		.long	0xe0000000				@ I/O address
@@ -145,6 +152,14 @@
 		.long	0x10000000
 		.long	0
 
+		@ EBSA285
+		.long	SYMBOL_NAME(swapper_pg_dir) - 0xc0000000	@ Address of page tables (physical)
+		.long	0					@ Address of RAM
+		.long	0x24000000				@ I/O base address (0x42000000 -> 0xFE000000)
+		.long	0
+
+
+
 .LCProcTypes:	@ ARM6 / 610
 		.long	0x41560600
 		.long	0xffffff00
@@ -168,7 +183,7 @@
 
 		.long	0
 
-.LC0:		.long	SYMBOL_NAME(_edata)
+.LC0:		.long	SYMBOL_NAME(__bss_start)
 		.long	SYMBOL_NAME(arm_id)
 		.long	SYMBOL_NAME(_end)
 		.long	SYMBOL_NAME(init_task_union)+8192
@@ -231,19 +246,84 @@
 		b	SYMBOL_NAME(start_kernel)
 
 #if 1
+
+#if defined(CONFIG_ARCH_RPC)
+		.macro	addruart,rx
+		mov	\rx, #0xe0000000
+		orr	\rx, \rx, #0x00010000
+		orr	\rx, \rx, #0x00000fe0
+		.endm
+
+		.macro	senduart,rd,rx
+		strb	\rd, [\rx]
+		.endm
+
+		.macro	busyuart,rd,rx
+1002:		ldrb	\rd, [\rx, #0x14]
+		and	\rd, \rd, #0x60
+		bne	1002b
+		.endm
+
+		.macro	waituart,rd,rx
+1001:		ldrb	\rd, [\rx, #0x18]
+		tst	\rd, #0x10
+		beq	1001b
+		.endm
+
+#elif defined(CONFIG_ARCH_EBSA110)
+		.macro	addruart,rx
+		mov	\rx, #0xf0000000
+		orr	\rx, \rx, #0x00000be0
+		.endm
+
+		.macro	senduart,rd,rx
+		strb	\rd, [\rx]
+		.endm
+
+		.macro	busyuart,rd,rx
+1002:		ldrb	\rd, [\rx, #0x14]
+		and	\rd, \rd, #0x60
+		bne	1002b
+		.endm
+
+		.macro	waituart,rd,rx
+1001:		ldrb	\rd, [\rx, #0x18]
+		tst	\rd, #0x10
+		beq	1001b
+		.endm
+
+#elif defined(CONFIG_ARCH_EBSA285)
+		.macro	addruart,rx
+		mov	\rx, #0xfe000000
+		.endm
+
+		.macro	senduart,rd,rx
+		str	\rd, [\rx, #0x160]	@ UARTDR
+		.endm
+
+		.macro	busyuart,rd,rx
+1001:		ldr	\rd, [\rx, #0x178]	@ UARTFLG
+		tst	\rd, #1 << 3
+		bne	1001b
+		.endm
+
+		.macro	waituart,rd,rx
+		.endm
+#endif
+
 /*
  * Useful debugging routines
  */
-		.globl	_printhex8
-_printhex8:	mov	r1, #8
+ENTRY(printhex8)
+		mov	r1, #8
 		b	printhex
 
-		.globl	_printhex4
-_printhex4:	mov	r1, #4
+ENTRY(printhex4)
+		mov	r1, #4
 		b	printhex
 
-		.globl	_printhex2
-_printhex2:	mov	r1, #2
+ENTRY(printhex2)
+		mov	r1, #2
 printhex:	ldr	r2, =hexbuf
 		add	r3, r2, r1
 		mov	r1, #0
@@ -258,46 +338,23 @@
 		bne	1b
 		mov	r0, r2
 
-		.globl	_printascii
-_printascii:
-#ifdef CONFIG_ARCH_RPC
-		mov	r3, #0xe0000000
-		orr	r3, r3, #0x00010000
-		orr	r3, r3, #0x00000fe0
-#else
-		mov	r3, #0xf0000000
-		orr	r3, r3, #0x0be0
-#endif
-		b	3f
-1:		ldrb	r2, [r3, #0x18]
-		tst	r2, #0x10
-		beq	1b
-		strb	r1, [r3]
-2:		ldrb	r2, [r3, #0x14]
-		and	r2, r2, #0x60
-		teq	r2, #0x60
-		bne	2b
+ENTRY(printascii)
+		addruart r3
+		b	2f
+1:		waituart r2, r3
+		senduart r1, r3
+		busyuart r2, r3
 		teq	r1, #'\n'
 		moveq	r1, #'\r'
 		beq	1b
-3:		teq	r0, #0
+2:		teq	r0, #0
 		ldrneb	r1, [r0], #1
 		teqne	r1, #0
 		bne	1b
 		mov	pc, lr
 
-		.ltorg
-
-		.globl	_printch
-_printch:
-#ifdef CONFIG_ARCH_RPC
-		mov	r3, #0xe0000000
-		orr	r3, r3, #0x00010000
-		orr	r3, r3, #0x00000fe0
-#else
-		mov	r3, #0xf0000000
-		orr	r3, r3, #0x0be0
-#endif
+ENTRY(printch)
+		addruart r3
 		mov	r1, r0
 		mov	r0, #0
 		b	1b

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov