Topic: A problem compiling the bootloader

hi, I tried to compile the bootloader by myself. Strange thing is when I look into the disassembly code, accessing the registers of the NAND Flash Controller(NFC) is bytewise (STRB, LDRB) not as disassembly code for the original bootloader halfword wise accessing the NFC (STRH, LDRH). Does anyone know why?

the source code for the bootloader is version 1.2.   GNU Toolchain (gcc 4.1.2),   chumby v1.2 kernel.

Another question is regarding some code in the "splstartup.S" file in the bootloader.
-----------------------------------
...
_start:
        ldr     r1,=StackInit

        and     r1,r1,#3
        ldr     sp,[r1]
...
----------------------------------- 
Why there is the instruction "and     r1,r1,#3". It does not make sense to me. Shouldn't  be "and     r1,r1,~3"?

Can someone help me for this? thanks!

Re: A problem compiling the bootloader

Unfortunately, bunnie never updated the bootloader source to compile under gcc 4.1.2, so you'll have to use the older toolchain (the one used for the alpha prototypes, gcc 3.3.2) to compile it.   He has a bug assigned to fix that but hasn't done so - I believe this is the only code where this is the case.

Re: A problem compiling the bootloader

Hey, thank you Duane for your soon reply smile

I also have a question about booting messages which are output from the UART.
----------------------------------------------------------------------------
...
Creating 8 MTD partitions on "mx21ads-nand":
0x00000000-0x00100000 : "Boot Loader"
ftl_cs: FTL header not found.
0x00100000-0x00300000 : "PSP"
ftl_cs: FTL header not found.
0x00300000-0x00580000 : "Kernel2"
ftl_cs: FTL header not found.
0x00580000-0x00d80000 : "Root Disk2"
ftl_cs: FTL header not found.
0x00d80000-0x01080000 : "Kernel1"
ftl_cs: FTL header not found.
0x01080000-0x02680000 : "Root Disk1"
ftl_cs: FTL header not found.
0x02680000-0x03e80000 : "Cache"
ftl_cs: FTL header not found.
0x03f80000-0x04000000 : "MSP"VFS:
...
Mounted root (cramfs filesystem) readonly.
Freeing init memory: 104K
Chumby Rootdisk - RFS1 (ken@chumby.com)BUG: soft lockup detected on CPU#0!

---------------------------------------------------------------------
Does this "FTL header not found" matter the booting or not? Looking into the original binaries(mtdblock0 ~ mtdblock7), I did not find the test string "FTL00" which is used to test this. 
What's the problem with the "BUG: soft lockup detected on CPU#0!". The kernel booting fails here. It seems relating to the watchdog.

Finally, do you have the complete booting message when the Chumby successfully boot? I will appreciate that if would like to share it with me so that I can use it as a reference. 
Thanks again! : )

Re: A problem compiling the bootloader

This is in the realm of Ken and bunnie - hopefully they'll chime in and help.

I should note that messing with the boot loader is a very tricky business, as yo probably know - it's highly risky and really easy to end up with a brick.