A new kernel and device tree: rd235b

From www.chip-community.org
Jump to: navigation, search

April 16 2016(renzo)

THIS IS AN EXPERIMENTAL KERNEL. TRY IT AT YOUR OWN RISK!

I have compiled a new kernel: the local tag is rd235b. The changelog with the previous rd235a includes:

  • patched again spi support to allow transfers larger then the fifo.
  • new device tree to support enc28j60
  • modules for gspca cameras added

... if you want to test my kernel

cd /tmp
wget http://www.raspibo.org/renzo/chiplinux4.3.0rd235b+.tgz
cd /
sudo tar zxf /tmp/chiplinux4.3.0rd235b+.tgz

Now if you have a USB console cable you can test my kernel by editing the bootcmd environment variable:

Stop the boot process and from the uboot prompt type:

=> editenv bootcmd
edit: if test -n ${fel_booted} && test -n ${scriptaddr}; then echo (FEL boot); source ${scriptaddr}; fi; mtdparts; ubi part UBI; ubifsmount ubi0:rootfs; ubifsload $fdt_addr_r /boot/sun5i-r8-chip.dtb; ubifsload $kernel_addr_r /boot/zImage; bootz $kernel_addr_r - $fdt_addr_r

moving on the string using the arrow keys change

  • sun5i-r8-chip.dtb to sun5i-r8-chip.rd235b.enc28j60.dtb (or to sun5i-r8-chip.rd235b.spidev.dtb)
  • /boot/zImage to vmlinuz-4.3.0rd235a+

the line should appear like the following one:

edit: if test -n ${fel_booted} && test -n ${scriptaddr}; then echo (FEL boot); source ${scriptaddr}; fi; mtdparts; ubi part UBI; ubifsmount ubi0:rootfs; ubifsload $fdt_addr_r /boot/sun5i-r8-chip.rd235b.enc28j60.dtb; ubifsload $kernel_addr_r /boot/vmlinuz-4.3.0rd235b+; bootz $kernel_addr_r - $fdt_addr_r

now press return and then

=> boot

If you want to use this new kernel as your standard kernel, type in the following commands:

sudo cp /boot/vmlinuz-4.3.0rd235b+ /boot/zImage
sudo cp /boot/sun5i-r8-chip.dtb /boot/sun5i-r8-chip.dtb.bak
sudo cp /boot/sun5i-r8-chip.rd235b.enc28j60.dtb /boot/sun5i-r8-chip.dtb

(please note that if you don't have a console cable, a.k.a. uart cable, and something goes wrong, I mean chip does not boot, you'll have to reflash entirely your chip)

If you want to revert back to tha NTC kernel type:

sudo cp /boot/zImage.bak /boot/zImage
sudo cp /boot/sun5i-r8-chip.dtb.bak /boot/sun5i-r8-chip.dtb

If you want to compile the kernel yourself

Nothing is hidden.

Follow the instructions provided in the posting Compile the Linux kernel for Chip: my personal HOWTO.

Apply the following changes.

  • copy the file /boot/config-4.3.0rd235b+ (provided in the tar file) to be the .config file in the linux kernel source root directory.
  • copy the file sun5i-r8-chip.rd235b.enc28j60.dts (also included in the tar file) to ./arch/arm/boot/dts/sun5i-r8-chip.dts (in the kernel tree)
  • download and apply the following patch:
$ wget http://www.raspibo.org/renzo/spi-sun4i.patch
$ patch -p 1 < spi-sun4i.patch

This patch combines previous patches by:

Thank you to both developers.