2 * linux/arch/arm/boot/compressed/head-sharpsl.S
4 * Copyright (C) 2004-2005 Richard Purdie <rpurdie@rpsys.net>
6 * Sharp's bootloader doesn't pass any kind of machine ID
7 * so we have to figure out the machine for ourselves...
9 * Support for Poodle, Corgi (SL-C700), Shepherd (SL-C750)
10 * Husky (SL-C760), Tosa (SL-C6000), Spitz (SL-C3000),
11 * Akita (SL-C1000) and Borzoi (SL-C3100).
15 #include <linux/linkage.h>
16 #include <asm/mach-types.h>
18 #ifndef CONFIG_PXA_SHARPSL
19 #error What am I doing here...
22 .section ".start", "ax"
26 /* Check for TC6393 - if found we have a Tosa */
28 mov r1, #0x10000000 @ Base address of TC6393 chip
30 ldrh r3, [r1, #8] @ Load TC6393XB Revison: This is 0x0003
32 beq .SHARPEND @ Success -> tosa
34 /* Check for pxa270 - if found, branch */
35 mrc p15, 0, r4, c0, c0 @ Get Processor ID
36 and r4, r4, #0xffffff00
41 /* Check for w100 - if not found we have a Poodle */
42 ldr r1, .W100ADDR @ Base address of w100 chip + regs offset
44 mov r6, #0x31 @ Load Magic Init value
45 str r6, [r1, #0x280] @ to SCRATCH_UMSK
50 mov r6, #0x30 @ Load 2nd Magic Init value
51 str r6, [r1, #0x280] @ to SCRATCH_UMSK
53 ldr r6, [r1, #0] @ Load Chip ID
57 bne .SHARPEND @ We have no w100 - Poodle
59 /* Check for pxa250 - if found we have a Corgi */
63 blo .SHARPEND @ We have a PXA250 - Corgi
65 /* Check for 64MiB flash - if found we have a Shepherd */
68 cmp r3, #0x76 @ 64MiB flash
69 beq .SHARPEND @ We have Shepherd
72 ldr r7, .HUSKYID @ Must be Husky
76 /* Check for 16MiB flash - if found we have Spitz */
79 cmp r3, #0x73 @ 16MiB flash
80 beq .SHARPEND @ We have Spitz
82 /* Check for a second SCOOP chip - if found we have Borzoi */
89 beq .SHARPEND @ We have Borzoi
93 b .SHARPEND @ We have Borzoi
96 .word 0x69052d00 @ PXA255 Processor ID
98 .word 0x69054100 @ PXA270 Processor ID
100 .word 0x57411002 @ w100 Chip ID
102 .word 0x08010000 @ w100 Chip ID Reg Address
106 .word MACH_TYPE_POODLE
108 .word MACH_TYPE_CORGI
110 .word MACH_TYPE_SHEPHERD
112 .word MACH_TYPE_HUSKY
116 .word MACH_TYPE_SPITZ
118 .word MACH_TYPE_AKITA
120 .word MACH_TYPE_BORZOI
123 * Return: r2 - NAND Manufacturer ID
128 mov r1, #0x0c000000 @ Base address of NAND chip
129 ldrb r3, [r1, #24] @ Load FLASHCTL
130 bic r3, r3, #0x11 @ SET NCE
131 orr r3, r3, #0x0a @ SET CLR + FLWP
132 strb r3, [r1, #24] @ Save to FLASHCTL
133 mov r2, #0x90 @ Command "readid"
134 strb r2, [r1, #20] @ Save to FLASHIO
135 bic r3, r3, #2 @ CLR CLE
136 orr r3, r3, #4 @ SET ALE
137 strb r3, [r1, #24] @ Save to FLASHCTL
138 mov r2, #0 @ Address 0x00
139 strb r2, [r1, #20] @ Save to FLASHIO
140 bic r3, r3, #4 @ CLR ALE
141 strb r3, [r1, #24] @ Save to FLASHCTL
143 ldrb r3, [r1, #24] @ Load FLASHCTL
144 tst r3, #32 @ Is chip ready?
146 ldrb r2, [r1, #20] @ NAND Manufacturer ID
147 ldrb r3, [r1, #20] @ NAND Chip ID