patch-2.3.49 linux/arch/arm/boot/compressed/head-sa1100.S

Next file: linux/arch/arm/config.in
Previous file: linux/arch/arm/boot/compressed/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.48/linux/arch/arm/boot/compressed/head-sa1100.S linux/arch/arm/boot/compressed/head-sa1100.S
@@ -11,6 +11,8 @@
 
 		.section        ".start", #alloc, #execinstr
 
+__SA1100_start:
+
 #ifndef CONFIG_ARCH_SA1100
 #error What am I doing here...
 #endif
@@ -57,6 +59,65 @@
 		bic	r0, r0, #0x0d		@ clear WB, DC, MMU
 		orr	r0, r0, #0x1000		@ set Icache
 		mcr	p15, 0, r0, c1, c0, 0
+
+#ifdef CONFIG_SA1100_BRUTUS
+		@ Initialize UART1 for early serial communication
+		@ since UART3 is used by angelboot.  It is routed to
+		@ alternate GPIO functions on Brutus.
+		b	1f
+
+GPIO_BASE:	.long	0x90040000
+#define GPDR	0x04
+#define GAFR	0x1c
+
+PPC_BASE:	.long	0x90060000
+#define PPAR	0x08
+
+UART1_BASE:	.long	0x80010000
+#define UTCR0           0x00
+#define UTCR1           0x04
+#define UTCR2           0x08
+#define UTCR3           0x0c
+#define UTSR0           0x1c
+#define UTSR1           0x20
+
+#define BAUD_DIV_230400	0x000
+#define BAUD_DIV_115200	0x001
+#define BAUD_DIV_57600	0x003
+#define BAUD_DIV_38400	0x005
+#define BAUD_DIV_19200	0x00b
+#define BAUD_DIV_9600	0x017
+#define BAUD_DIV	BAUD_DIV_9600
+
+1:		ldr	r0, GPIO_BASE
+		ldr	r1, [r0, #GPDR]
+		bic	r1, r1, #1<<15
+		orr	r1, r1, #1<<14
+		str	r1, [r0, #GPDR]
+		ldr	r1, [r0, #GAFR]
+		orr	r1, r1, #(1<<15)|(1<<14)
+		str	r1, [r0, #GAFR]
+		ldr	r0, PPC_BASE
+		ldr	r1, [r0, #PPAR]
+		orr	r1, r1, #1<<12
+		str	r1, [r0, #PPAR]
+		ldr	r0, UART1_BASE
+1:		ldr	r1, [r0, #UTSR1]
+		tst	r1, #1<<0	@ TBY
+		bne	1b
+		mov	r1, #0
+		str	r1, [r0, #UTCR3]
+		mov	r1, #0x08	@ 8N1
+		str	r1, [r0, #UTCR0]
+		mov	r1, #BAUD_DIV
+		str	r1, [r0, #UTCR2]
+		mov	r1, r1, lsr #8
+		str	r1, [r0, #UTCR1]
+		mov	r1, #0x03	@ RXE + TXE
+		str	r1, [r0, #UTCR3]
+		mov	r1, #0xff	@ flush status reg
+		str	r1, [r0, #UTSR0]
+#endif
 
 		@ set registers for entry
 		mov	r0, #0

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)