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 * and Husky (SL-C760).
14 #include <linux/config.h>
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 ldr r1, .W100ADDR @ Base address of w100 chip + regs offset
28 mov r6, #0x31 @ Load Magic Init value
29 str r6, [r1, #0x280] @ to SCRATCH_UMSK
34 mov r6, #0x30 @ Load 2nd Magic Init value
35 str r6, [r1, #0x280] @ to SCRATCH_UMSK
37 ldr r6, [r1, #0] @ Load Chip ID
41 bne .SHARPEND @ We have no w100 - Poodle
43 mrc p15, 0, r6, c0, c0 @ Get Processor ID
44 and r6, r6, #0xffffff00
48 blo .SHARPEND @ We have a PXA250 - Corgi
50 mov r1, #0x0c000000 @ Base address of NAND chip
51 ldrb r3, [r1, #24] @ Load FLASHCTL
52 bic r3, r3, #0x11 @ SET NCE
53 orr r3, r3, #0x0a @ SET CLR + FLWP
54 strb r3, [r1, #24] @ Save to FLASHCTL
55 mov r2, #0x90 @ Command "readid"
56 strb r2, [r1, #20] @ Save to FLASHIO
57 bic r3, r3, #2 @ CLR CLE
58 orr r3, r3, #4 @ SET ALE
59 strb r3, [r1, #24] @ Save to FLASHCTL
60 mov r2, #0 @ Address 0x00
61 strb r2, [r1, #20] @ Save to FLASHIO
62 bic r3, r3, #4 @ CLR ALE
63 strb r3, [r1, #24] @ Save to FLASHCTL
65 ldrb r3, [r1, #24] @ Load FLASHCTL
66 tst r3, #32 @ Is chip ready?
68 ldrb r2, [r1, #20] @ NAND Manufacturer ID
69 ldrb r3, [r1, #20] @ NAND Chip ID
71 cmp r3, #0x76 @ 64MiB flash
72 beq .SHARPEND @ We have Shepherd
73 ldr r7, .HUSKYID @ Must be Husky
77 .word 0x69052d00 @ PXA255 Processor ID
79 .word 0x57411002 @ w100 Chip ID
81 .word 0x08010000 @ w100 Chip ID Reg Address
83 .word MACH_TYPE_POODLE
87 .word MACH_TYPE_SHEPHERD