How to get a working kernel

108 26902
Edited by tony_zhang at Tue Nov 25, 2014 19:39

hi everyone
i need a kernel 3.14+ , there some new drivers for webcams included like mine.
i read much of tuturials on linux-sunix and here in the forum.
i get all compiled u-boot kernel 3.18-rc2 and merge them all in an debian but it doenst boot.
i build kernel with dtb an write an boot.cmd + parse them to boot.src , but nothing works
i tried many versions from git denx sunix and much other .
tried kernel 3.14 and sunix-next everything with same result, no booting system.

I can't really help you much, but I do have a few hints for you:

1) Kernel 3.19 is supposed to bring support for BananaPi. You can try to find and apply the planned patches to a Kernel 3.18 source, if they are not already in sunxi-next.
2) Forget about Kernel 3.14. The sunxi repos for Kernel 3.14 haven't been touched in quite a while and LeMaker also didn't patch the 3.14 branch in their fork of the sunxi-repo to add support for the BananaPi.
3) Aside from a working Kernel image, you also need a compatible and recent u-boot image. Support for BananaPi in mainline U-boot is supposed to be introduced in early 2015. So you might check the developement versions of uboot-sunxi to see if BananaPi support is already added there.
4) Fedora 21 for ARM is supposed to run on Banana Pi and have a working kernel (3.16 or 3.17) for it. You could try beta images or wait for the official release expected in December and use that uboot, kernel and dtb for BananaPi. I read that they successfully booted a Kernel 3.16 on BananaPi already. But who knows which features are supported and which are missing. Don't expect anything more than support for a headless system.

i think my worst problem is uboot and the boot.cmd files

kernel today i used was sunix-next
  1. git clone -b sunxi-next https://github.com/linux-sunxi
Copy the Code
this is now 3.18-rc2 with sun7i-a20-bananapi.dts inside
  1. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x40008000 uImage modules dtbs
Copy the Code
for u-boot i test different sources
lemaker and some other
boot.cmd (dont know what earlyprintk mean
  1. fatload mmc 0 0x46000000 uImage
  2. fatload mmc 0 0x49000000 sun7i-a20-bananapi.dtb

  3. setenv bootargs console=ttyS0,115200 <earlyprintk> root=/dev/mmcblk0p2 rootwait panic=10 ${extra}

  4. bootm 0x46000000 - 0x49000000
Copy the Code

Update :
i build a working kernel 3.18-rc2 with an debian jessie

Great !

With working GMAC ethernet ?

i can only test 100mbit , that works , have to rebuild the kernel , forget some wifi driver lol
will upload later an image for testing

You can check with Igor, IIRC when he tried GMAC was not working

Apart from an image, I guess it might me more interesting and helpful if you provided instructions on how you built the kernel and u-boot. Thanks.

The most things(steps) explained before but i used for u-boot an tree from denx. I will write it later in my blog.

Edited by a1d3s at Wed Nov 5, 2014 01:09

ok for now , will post here all steps i do without the debootstrap thing for my jessie

  1. cat <<EOT | sfdisk --force --in-order -uS /dev/mmcblk0
  2. 2048,524288,L
  3. 526336,,L
  4. EOT

  5. mkfs.vfat /dev/mmcblk0p1
  6. mkfs.ext4 /dev/mmcblk0p2

  7. apt-get install bc libncurses5-dev gcc-arm-gnueabihf u-boot-tools build-essential binutils-arm-linux-gnueabihf libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot

  8. mkdir bpi
  9. cd bpi

  10. git clone -b sunxi-next https://github.com/linux-sunxi/linux-sunxi

  11. cd linux-sunxi

  12. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig
  13. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

  14. enable loadable module support
  15. enable some usefull drivers like webcam or wifi

  16. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x40008000 uImage dtbs
  17. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules && modules_install

  18. mkdir /mnt/boot
  19. cp arch/arm/boot/uImage /mnt/boot
  20. cp arch/arm/boot/dts/sun7i-a20-bananapi.dtb /mnt/boot

  21. nano /mnt/boot/boot.cmd

  22.         fatload mmc 0 0x46000000 uImage
  23.         fatload mmc 0 0x49000000 sun7i-a20-bananapi.dtb
  24.         setenv bootargs console=ttyS0,115200  root=/dev/mmcblk0p2 rw rootwait panic=10 ${extra}
  25.         bootm 0x46000000 - 0x49000000

  26. mkimage -C none -A arm -T script -d /mnt/boot/boot.cmd /mnt/boot/boot.scr

  27. mkdir /mnt/rootfs
  28. mount /dev/mmcblk0p2 /mnt/rootfs
  29. cp output/* /mnt/rootfs/

  30. cd ..

  31. git clone http://git.denx.de/u-boot-sunxi.git
  32. cd u-boot-sunxi
  33. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Bananapi_defconfig
  34. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
  35. dd if=spl/sunxi-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
  36. dd if=u-boot.img of=/dev/mmcblk0 bs=1024 seek=40
Copy the Code

You have to log in before you can reply Login | Sign Up

Points Rules