Hello. I am back. Its really very long time to pen down where I have stop. I will continue with PART III of developing Linus OS for ARM.
As we already configure primary bootloader AR91Bootstrap in PART II. Its time to configure a secondary bootloader.
In most cases, UBoot is the secondary bootloader, which is in charge of downloading kernel binaries from FLASH, SD/MMC, USB or ethernet and starting the kernel.
Download the secondary bootloader (Uboot). It can be downloaded
from the following link:
ftp://ftp.denx.de/pub/u-boot/
we will download the uboot1.3.4.tar.bz2 at the following path:
/home/sanket/Download/Embedded_Linux_Complete/Sources/uboot.
Extract the same in the current directory.
Download uboot patch provided by the AT91 community from the below mentioned link:
ftp://www.linux4sam.org/pub/uboot/u-boot-1.3.4-exp/u-boot-1.3.4-exp.diff
Creating a patch is a standard way of adding newly generated code to a large existing code base. It is created by comparing the updated code with the code base for which the patch is to be generated.
Save this to the ~/Embedded_Linux_Complete/Sources/uboot/uboot1.3.4.
/u-boot-1.3.4$ ls
Apply it (patch) on top of the original uboot in the following way:
/u-boot-1.3.4$ cat u-boot-1.3.4-exp.diff | patch -p1
Once the AT91 uboot sources are available, crosscompiling uboot can be done in two steps : configuration and compiling. Note that both armelf and armlinux ARM GCC crosscompiler types are suitable for uboot building. We will use armnone-linux-gnueabi-gcc.
Here are the building steps for the AT91SAM9260EK board:
/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi- distclean
distclean command removes the binaries and object files files that 'configure' created. Distclean is like make clean with the exception that make clean removes all the files created by make, where as distclean removes all files that are created by make config.
The Uboot can be made to reside on any of the following storage media: Data flash/NAND flash/NOR flash. In our case we are using the dataflash, but NAND flash can also be used since AT91Bootstap supports both. The AT91Bootstrap will pass the environment variables to Uboot while it tries to bring Uboot up.
So while we compile Uboot we will configure it for Dataflash.
/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi- at91sam9260ek_dataflash_cs1_config
These environment variables includes the IP address setting of the host, the server from which Uboot would tftp to retrieve some packages and more. When Uboot is up and running on our board we will try and view all these environment variables.
NOTE: In our case, the software packages have been made to reside in the dataflash. In some cases, they might reside in NAND Flash or NOR flash. While compiling uboot the environment variable location needs to be choosen accordingly.
To compile uboot after configuration,
/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi-
If the compilation goes well, a uboot.bin file would be generated in your current directory which would be ultimately flashed to the dataflash using a software utility called SAMBA (Burning Application for SAM controllers).
Once the bootloader is in place, next step would be to build a kernel image. That we would be discussing in my next post.
continue................
As we already configure primary bootloader AR91Bootstrap in PART II. Its time to configure a secondary bootloader.
In most cases, UBoot is the secondary bootloader, which is in charge of downloading kernel binaries from FLASH, SD/MMC, USB or ethernet and starting the kernel.
Download the secondary bootloader (Uboot). It can be downloaded
from the following link:
ftp://ftp.denx.de/pub/u-boot/
we will download the uboot1.3.4.tar.bz2 at the following path:
/home/sanket/Download/Embedded_Linux_Complete/Sources/uboot.
Extract the same in the current directory.
Download uboot patch provided by the AT91 community from the below mentioned link:
ftp://www.linux4sam.org/pub/uboot/u-boot-1.3.4-exp/u-boot-1.3.4-exp.diff
Creating a patch is a standard way of adding newly generated code to a large existing code base. It is created by comparing the updated code with the code base for which the patch is to be generated.
Save this to the ~/Embedded_Linux_Complete/Sources/uboot/uboot1.3.4.
/u-boot-1.3.4$ ls
Apply it (patch) on top of the original uboot in the following way:
/u-boot-1.3.4$ cat u-boot-1.3.4-exp.diff | patch -p1
Once the AT91 uboot sources are available, crosscompiling uboot can be done in two steps : configuration and compiling. Note that both armelf and armlinux ARM GCC crosscompiler types are suitable for uboot building. We will use armnone-linux-gnueabi-gcc.
Here are the building steps for the AT91SAM9260EK board:
/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi- distclean
distclean command removes the binaries and object files files that 'configure' created. Distclean is like make clean with the exception that make clean removes all the files created by make, where as distclean removes all files that are created by make config.
The Uboot can be made to reside on any of the following storage media: Data flash/NAND flash/NOR flash. In our case we are using the dataflash, but NAND flash can also be used since AT91Bootstap supports both. The AT91Bootstrap will pass the environment variables to Uboot while it tries to bring Uboot up.
So while we compile Uboot we will configure it for Dataflash.
/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi- at91sam9260ek_dataflash_cs1_config
These environment variables includes the IP address setting of the host, the server from which Uboot would tftp to retrieve some packages and more. When Uboot is up and running on our board we will try and view all these environment variables.
NOTE: In our case, the software packages have been made to reside in the dataflash. In some cases, they might reside in NAND Flash or NOR flash. While compiling uboot the environment variable location needs to be choosen accordingly.
To compile uboot after configuration,
/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi-
If the compilation goes well, a uboot.bin file would be generated in your current directory which would be ultimately flashed to the dataflash using a software utility called SAMBA (Burning Application for SAM controllers).
Once the bootloader is in place, next step would be to build a kernel image. That we would be discussing in my next post.
continue................
Welcome back...good to hear from you after long time
ReplyDeleteHey hii... Nice blog....
ReplyDeleteNice to know its possible and easy too... :)