Difference between revisions of "Novena/Dual Core"

From Studio Kousagi Wiki
Jump to: navigation, search
(U-boot)
(Disk Layout)
 
(2 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
This is very tricky, as it means we can't fit a proper u-boot that can read a full filesystem.  
 
This is very tricky, as it means we can't fit a proper u-boot that can read a full filesystem.  
  
 +
An SPL variant of u-boot has been prepared for the DL variant: https://github.com/xobs/u-boot-novena-spl
 +
 +
==Building==
 +
  git clone https://github.com/xobs/u-boot-novena-spl
 +
  cd u-boot-novena-spl
 +
  git checkout 2014.03-imx6dl-novena
 +
  make novena_config  # sets up u-boot for novena configuration
 +
  make
 +
 +
==Deploying==
 +
To copy u-boot onto the disk, you need to use a linux machine with dd:
 +
sudo dd if=u-boot.imx of=/dev/sdX seek=2
 +
 +
Replace /dev/sdX with the drive node of your SD card. seek=2 locates u-boot in the expected location for loading.
 +
 +
==Disk Layout==
 +
This bootloader will expect there to be at least a FAT32 partition. Typically, it's recommended you make a FAT32 partition at the top of disk that is about 32M in size to hold bootloader images, and then the rest of the disk can be partitioned into other filesytems, such as ext4.
 +
 +
The sole requirement for this build is that the code to run from u-boot is called "bootloader".
 +
 +
So, if you're going to go straight to loading a kernel, make sure you build a zImage with appended DTS support (currently experimental). Concatenate the zImage and the .dtb file, and then copy it to the FAT32 partition and give it the name "bootloader". For example:
 +
 +
# don't forget to put u-boot at seek=2 on the disk!
 +
make menuconfig  # don't forget to set the option for concatenated DTS on zImage
 +
make zImage
 +
mkfs.vfat /dev/sdX  # assuming you haven't already done this
 +
mount /dev/sdX /media
 +
 +
cd arch/arm/boot
 +
cat zImage dts/imx6q-aqs.dtb > bootloader
 +
mv bootloader /media/bootloader
 +
umount /media
 +
 +
==Legacy==
 
The current u-boot configured for the DL, as an interim solution, can read a zImage with DTS file concatenated to the end of it from a hard-coded offset off of the top of the boot media.  
 
The current u-boot configured for the DL, as an interim solution, can read a zImage with DTS file concatenated to the end of it from a hard-coded offset off of the top of the boot media.  
 +
 +
TODO: As of writing, there is one copy of a u-boot that works on the DL and we haven't checked it into git. We should really, really do that and put a link to it here. Bad bunnie, bad bad bunnie!
  
 
As a result, to initialize a blank media, you should place the u-boot and construct the kernel as follows:
 
As a result, to initialize a blank media, you should place the u-boot and construct the kernel as follows:

Latest revision as of 17:44, 27 March 2014

Kernel

Currently, the kernel code for the dual core system is identical to the quad-core. The configuration for a particular core is done using device tree hacks.

The key statement to swap out is in the DTS file, change the line that says

#include "imx6q.dtsi"

to

#include "imx6dl.dtsi"

The other key change is, as noted below, the kernel must have the flag turned on to search for a DTS appended to a zImage.

U-boot

The i.MX6-DL chip that Novena works with only has 96kiB of internal SRAM available for u-boot.

This is very tricky, as it means we can't fit a proper u-boot that can read a full filesystem.

An SPL variant of u-boot has been prepared for the DL variant: https://github.com/xobs/u-boot-novena-spl

Building

 git clone https://github.com/xobs/u-boot-novena-spl
 cd u-boot-novena-spl
 git checkout 2014.03-imx6dl-novena
 make novena_config   # sets up u-boot for novena configuration
 make

Deploying

To copy u-boot onto the disk, you need to use a linux machine with dd:

sudo dd if=u-boot.imx of=/dev/sdX seek=2

Replace /dev/sdX with the drive node of your SD card. seek=2 locates u-boot in the expected location for loading.

Disk Layout

This bootloader will expect there to be at least a FAT32 partition. Typically, it's recommended you make a FAT32 partition at the top of disk that is about 32M in size to hold bootloader images, and then the rest of the disk can be partitioned into other filesytems, such as ext4.

The sole requirement for this build is that the code to run from u-boot is called "bootloader".

So, if you're going to go straight to loading a kernel, make sure you build a zImage with appended DTS support (currently experimental). Concatenate the zImage and the .dtb file, and then copy it to the FAT32 partition and give it the name "bootloader". For example:

# don't forget to put u-boot at seek=2 on the disk!
make menuconfig  # don't forget to set the option for concatenated DTS on zImage
make zImage
mkfs.vfat /dev/sdX  # assuming you haven't already done this
mount /dev/sdX /media
cd arch/arm/boot
cat zImage dts/imx6q-aqs.dtb > bootloader
mv bootloader /media/bootloader
umount /media

Legacy

The current u-boot configured for the DL, as an interim solution, can read a zImage with DTS file concatenated to the end of it from a hard-coded offset off of the top of the boot media.

TODO: As of writing, there is one copy of a u-boot that works on the DL and we haven't checked it into git. We should really, really do that and put a link to it here. Bad bunnie, bad bad bunnie!

As a result, to initialize a blank media, you should place the u-boot and construct the kernel as follows:

dd if=u-boot.imx of=/dev/sdX seek=2  # place the u-boot at offset 0x400 == sector 0x2
cd arch/arm/boot
cat zImage dts/your-imx6dl.dtb > zImage.dl  # create a zImage + DTS combo file, kernel must be configured to support this
dd if=zImage.dl of=/dev/sdX seek=256 # place kernel at offset 0x20000 == sector 0x100

The u-boot is hard coded to suck in 0x8000 sectors of data (make sure your kernel is smaller than 0x8000 * 0x200 bytes in size) to offset 0x10008000 in RAM, and then jump to whatever is there (hopefully it's the zImage but you can replace it with other things for diagnostic purposes if you need to).