1 /*******************************************************************************
5 * Initialization for C-environment and basic operation. Adapted from
8 * Revision information:
10 * 20AUG2004 kb_admin initial creation
11 * 12JAN2005 kb_admin updated for 16KB eeprom
12 * Atmel stack prevents loading full size at once
15 * No warranty, expressed or implied, is included with this software. It is
16 * provided "AS IS" and no warranty of any kind including statutory or aspects
17 * relating to merchantability or fitness for any purpose is provided. All
18 * intellectual property rights of others is maintained with the respective
19 * owners. This software is not copyrighted and is intended for reference
24 ******************************************************************************/
26 .equ TWI_EEPROM_SIZE, 0x3000
27 .equ ARM_MODE_USER, 0x10
28 .equ ARM_MODE_FIQ, 0x11
29 .equ ARM_MODE_IRQ, 0x12
30 .equ ARM_MODE_SVC, 0x13
31 .equ ARM_MODE_ABORT, 0x17
32 .equ ARM_MODE_UNDEF, 0x1B
33 .equ ARM_MODE_SYS, 0x1F
41 * Start near top of internal RAM.
43 .equ END_INT_SRAM, 0x4000
44 .equ SVC_STACK_START, (END_INT_SRAM - 0x4)
45 .equ SVC_STACK_USE, 0x21800000
49 /* vectors - must reside at address 0 */
50 /* the format of this table is defined in the datasheet */
53 B undefvec @; Undefined Instruction
55 B swivec @; Software Interrupt
57 B pabtvec @; Prefetch Abort
59 B dabtvec @; Data Abort
62 .long (TWI_EEPROM_SIZE >> 9)
65 .long ((528 << 17) | (13 << 13) | (12 * 2))
67 .long ((1056 << 17) | (13 << 13) | (12 * 2))
71 ldr pc, [pc,#-0xF20] @; IRQ : read the AIC
77 /* Set stack and init for SVC */
78 ldr r1, = SVC_STACK_START
79 mov sp, r1 @; Init stack SYS
81 msr cpsr_c, #(ARM_MODE_SVC | I_BIT | F_BIT)
82 mov sp, r1 @ ; Init stack SYS
84 /* Perform system initialization */
89 ldr r1, = SVC_STACK_USE
90 mov sp, r1 @ ; Move the stack to SDRAM
93 /* Start execution at main */
98 /* main should not return. If it does, spin forever */
103 /* the following section is used to store boot commands in */
104 /* non-volatile memory. */
106 .global BootCommandSection
109 .string "Bootloader for KB9202 Evaluation Board."
110 .string "c 0x20210000 0x10100000 0x80000 "
111 .string "m 0 0 0 0 0 0 "
112 .string "t 0x20000100 console=ttyS0,115200 root=/dev/ram rw initrd=0x20210000,654933"
113 .string "e 0x10000000 "
117 .string "m 42 53 44 0 0 1"
118 .string "ip 206 168 13 194"
119 .string "server_ip 206 168 13 207"
120 .string "tftp 0x20000000 kernel.bin"
121 .string "e 0x20000000"
123 .string "m 42 53 44 0 0 1"
124 .string "k 0x20000000"
125 .string "e 0x20000000"