xref: /reactos/boot/armllb/boot.s (revision 40ee59d6)
1/*
2 * PROJECT:         ReactOS Boot Loader
3 * LICENSE:         BSD - See COPYING.ARM in the top level directory
4 * FILE:            boot/armllb/boot.s
5 * PURPOSE:         Implements the entry point for ARM machines
6 * PROGRAMMERS:     ReactOS Portable Systems Group
7 */
8
9    .title "ARM LLB Entry Point"
10    .include "ntoskrnl/include/internal/arm/kxarm.h"
11    .include "ntoskrnl/include/internal/arm/ksarm.h"
12
13    NESTED_ENTRY _start
14    PROLOG_END _start
15
16#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
17    /*
18     * On Beagle, the boot is directly from TI BootROM that reads NAND flash.
19     * First word is size of program to load.
20     * Second word is load address of program. Since DDR is not initialized,
21     * we load to SDRAM at 40200000h. Max 64K.
22     */
23    .word 0x8000
24    .word 0x40200000
25#elif _ZOOM2_
26	/*
27	 * On ZOOM2, we currently load from u-boot to make bring-up easier.
28	 *
29	 * In order to get ATAG and all that goodness, we have to fool u-boot into
30	 * thinking we are a Linux ARM kernel.
31	 *
32	 * So this is a 'fake' uImage-format header, which will make u-boot grok our
33	 * image and correctly execute it.
34	 *
35	 * Note that a data checksum is in the header, but thankfully we can disable
36	 * the check.
37	 *
38	 * There's also a header checksum, but as long as there's no need to modify
39	 * this header, we can leave it static.
40	 *
41	 * Finally, note that the "Image String" is sized as a 32-byte array in the
42	 * uImage header format. The string chosen below is not only accurate, but
43	 * also happens to fit exactly in 32 bytes, meaning we don't need to pad.
44	 */
45	.word 0x56190527 // Header Magic
46	.word 0x5E4B8444 // Checksum
47	.word 0x483BE54C // Timestamp
48	.word 0x0CA10000 // Image size (64K)
49	.word 0x00000081 // Load address
50	.word 0x40000081 // Entrypoint
51	.word 0x90873DD8 // Data Checksum ('setenv verify n' must be set!)
52	.byte 5 		 // Linux OS
53	.byte 2 		 // ARM
54	.byte 2 		 // Kernel
55	.byte 0 		 // No compression
56	.ascii "ReactOS ARM Low-Level Bootloader"
57#endif
58
59    /* Load C entrypoint and setup LLB stack */
60    ldr lr, L_LlbStartup
61    ldr sp, L_BootStackEnd
62    bx lr
63    ENTRY_END _start
64
65L_BootStackEnd:
66#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
67    .long 0x00010000
68#elif _ZOOM2_ // On ZOOM2 RAM starts at 0x80000000, not 0
69	.long 0x81014000
70#else
71#error Stack Address Not Defined
72#endif
73
74L_LlbStartup:
75    .long LlbStartup
76
77/* EOF */
78