Author: sir_richard
Date: Tue Nov 23 16:49:28 2010
New Revision: 49741
URL: http://svn.reactos.org/svn/reactos?rev=49741&view=rev
Log:
[ARMLLB]: We made certain assumptions in the "generic" files that are actually board-specific. For example, Versatile does indeed return a strange ULONG as the RTC time (seconds since 1970, I think), but TWL4030 on the ZOOM2 is normal and returns BCD RTC values just like the PC CMOS. Therefore, most of the "Generic" time.c code should move to versatile later. For now, use an IFDEF.
[ARMLLB]: Likewise, not all platforms have a PS/2 controller like the Versatile. ZOOM2 for example has a keypad, so the generic "input" file shouldn't assume keyboard-only. As such, most of the code there should also be made specific, but for now, use an ifdef.
Modified:
trunk/reactos/boot/armllb/fw.c
trunk/reactos/boot/armllb/hw/time.c
Modified: trunk/reactos/boot/armllb/fw.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/fw.c?rev=49741…
==============================================================================
--- trunk/reactos/boot/armllb/fw.c [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/fw.c [iso-8859-1] Tue Nov 23 16:49:28 2010
@@ -49,7 +49,11 @@
LlbFwGetCh(VOID)
{
/* Return the key pressed */
+#ifdef _ZOOM2_
+ return LlbKeypadGetChar();
+#else
return LlbKeyboardGetChar();
+#endif
}
ULONG
Modified: trunk/reactos/boot/armllb/hw/time.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/hw/time.c?rev=…
==============================================================================
--- trunk/reactos/boot/armllb/hw/time.c [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/hw/time.c [iso-8859-1] Tue Nov 23 16:49:28 2010
@@ -11,7 +11,12 @@
#define LEAPS_THRU_END_OF(y) ((y)/4 - (y)/100 + (y)/400)
UCHAR LlbDaysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+#ifndef _ZOOM2_
TIMEINFO LlbTime;
+#else
+extern TIMEINFO LlbTime;
+#endif
BOOLEAN
NTAPI
@@ -82,9 +87,10 @@
/* Read RTC time */
RtcTime = LlbHwRtcRead();
-
+#ifndef _ZOOM2_
/* Convert it */
LlbConvertRtcTime(RtcTime, &LlbTime);
+#endif
return &LlbTime;
}
Author: sir_richard
Date: Tue Nov 23 16:44:19 2010
New Revision: 49737
URL: http://svn.reactos.org/svn/reactos?rev=49737&view=rev
Log:
[ARMLLB]: Initialize hardware before parsing environment variables. This makes more sense, and also allows debug output from the environment scanning code.
Modified:
trunk/reactos/boot/armllb/main.c
Modified: trunk/reactos/boot/armllb/main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/main.c?rev=497…
==============================================================================
--- trunk/reactos/boot/armllb/main.c [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/main.c [iso-8859-1] Tue Nov 23 16:44:19 2010
@@ -16,17 +16,17 @@
/* Make sure we are booting on the correct kind of machine */
if (BoardInfo != LlbHwGetBoardType()) while (TRUE);
+ /* Initialize hardware components */
+ LlbHwInitialize();
+
/* Either QEMU or U-Boot itself should send this information */
LlbEnvParseArguments(Arguments);
- /* Initialize hardware components */
- LlbHwInitialize();
-
/* Clean up the screen */
LlbVideoClearScreen(FALSE);
/* Print header */
- printf("ReactOS ARM Low-Level Boot Loader [" __DATE__ " "__TIME__ "]\n");
+ printf("\nReactOS ARM Low-Level Boot Loader [" __DATE__ " "__TIME__ "]\n");
/* Boot the OS Loader */
LlbBoot();
Author: sir_richard
Date: Tue Nov 23 16:43:32 2010
New Revision: 49736
URL: http://svn.reactos.org/svn/reactos?rev=49736&view=rev
Log:
[ARMLLB]: Add uImage header which uBoot expects on the images it can load nicely (using "go" will not give us ATAGs, "bootm" requires this header). It's a static header instead of requiring the mkImage tool, since we can disable data checksums in uBoot. We basically fake being a Linux kernel and the LLB handles the ATAGs.
[ARMLLB]: Add boot stack for Zoom2.
Modified:
trunk/reactos/boot/armllb/boot.s
Modified: trunk/reactos/boot/armllb/boot.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/boot.s?rev=497…
==============================================================================
--- trunk/reactos/boot/armllb/boot.s [iso-8859-1] (original)
+++ trunk/reactos/boot/armllb/boot.s [iso-8859-1] Tue Nov 23 16:43:32 2010
@@ -13,15 +13,47 @@
NESTED_ENTRY _start
PROLOG_END _start
-#ifdef _OMAP3_
+#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
/*
- * On OMAP3, the boot is directly from TI BootROM that reads NAND flash.
+ * On Beagle, the boot is directly from TI BootROM that reads NAND flash.
* First word is size of program to load.
* Second word is load address of program. Since DDR is not initialized,
* we load to SDRAM at 40200000h. Max 64K.
*/
.word 0x8000
.word 0x40200000
+#elif _ZOOM2_
+ /*
+ * On ZOOM2, we currently load from u-boot to make bring-up easier.
+ *
+ * In order to get ATAG and all that goodness, we have to fool u-boot into
+ * thinking we are a Linux ARM kernel.
+ *
+ * So this is a 'fake' uImage-format header, which will make u-boot grok our
+ * image and correctly execute it.
+ *
+ * Note that a data checksum is in the header, but thankfully we can disable
+ * the check.
+ *
+ * There's also a header checksum, but as long as there's no need to modify
+ * this header, we can leave it static.
+ *
+ * Finally, note that the "Image String" is sized as a 32-byte array in the
+ * uImage header format. The string chosen below is not only accurate, but
+ * also happens to fit exactly in 32 bytes, meaning we don't need to pad.
+ */
+ .word 0x56190527 // Header Magic
+ .word 0x5E4B8444 // Checksum
+ .word 0x483BE54C // Timestamp
+ .word 0x0CA10000 // Image size (64K)
+ .word 0x00000081 // Load address
+ .word 0x40000081 // Entrypoint
+ .word 0x90873DD8 // Data Checksum ('setenv verify n' must be set!)
+ .byte 5 // Linux OS
+ .byte 2 // ARM
+ .byte 2 // Kernel
+ .byte 0 // No compression
+ .ascii "ReactOS ARM Low-Level Bootloader"
#endif
/* Load C entrypoint and setup LLB stack */
@@ -31,8 +63,14 @@
ENTRY_END _start
L_BootStackEnd:
+#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
.long 0x00010000
-
+#elif _ZOOM2_ // On ZOOM2 RAM starts at 0x80000000, not 0
+ .long 0x81014000
+#else
+#error Stack Address Not Defined
+#endif
+
L_LlbStartup:
.long LlbStartup