Author Topic: Building u-boot and kernel for mmc on C2  (Read 97922 times)

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Building u-boot and kernel for mmc on C2
« on: July 09, 2013, 12:34:59 am »
I was asked for a quick tutorial on building a uboot/kernel combo for SD booting on the Cubie2.  Note: the process for building an A10 kernel is basically the same.  A different board target must be specified when building u-boot, and sun4i_defconfig is specified when building the kernel.  The A20 kernel runs on both the cubieboard2 and cubietruck.

First, this is not a tutorial for creating a whole distribution; the uboot/kernel combo created here should work with most A10 distributions (no guarantees, though), but various unsupported features will be disabled (e.g., mali GPU, nand driver) depending on the progress made on the specific branches Pretty much all the features working on the A10 are now working on the A20 (CB2 and CB3).  It's been a long road, but well worth it.

Second, you need to be familiar with the process of getting SPL and u-boot onto the SD card: https://github.com/linux-sunxi/u-boot-sunxi/wiki.

Finally, you'll need to have all the required tools for building linux; read the "building" section for your particular platform here: http://linux-sunxi.org/Main_Page.  The actual build process should work on any linux system that has the proper tools installed.  Note that I am running gcc 4.6.3 for armhf; there have been reports of problems with gcc 4.7 building this kernel, and problems with gcc 4.8 and all current ARM kernels.  Keep this in mind, as you may want to explicitly install gcc-4.6-arm-linux-gnueabihf instead of gcc-arm-linux-gnueabihf if you're using anything later than Ubuntu 12.04 (anyone know about Debian or Fedora versions and default cross ARM gcc install?).

There are a few different git branches of this code in various repositories; I describe are the ones I'm using and are known (by me) to work.  If you use a different branch, the overall process should be similar, but not necessarily the same.  If I get around to testing any of the other branches, I'll document any differences in the Notes section at the end.  At this point, all of the "official" repos at linux-sunxi work just fine for both the A10 and A20.

Uboot/SPL:

1. Get the sources from:
Code: [Select]
git clone https://github.com/linux-sunxi/u-boot-sunxi
2. Switch to sunxi branch (should be the default, but no harm being explicit):
Code: [Select]
cd u-boot-sunxi
git checkout sunxi

3. Build u-boot:
Code: [Select]
CROSS_COMPILE=arm-linux-gnueabihf- make cubieboard2SPL and u-boot are now combined in one file called u-boot-sunxi-with-spl.bin.  (Specify "cubieboard" for the A10 cubieboard build or "cubietruck" for the CT; the list of supported boards is in the file boards.cfg.)

Linux kernel:

1. Get the sources from git (Edit -- now points to my git repo):
Code: [Select]
git clone https://github.com/patrickhwood/linux-sunxi
2. Switch to my current branch (Edit -- now updated to 3.4.75 pulled from stage/sunxi-3.4):
Code: [Select]
cd linux-sunxi
git checkout pat-3.4.75

3. Configure build:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun7i_defconfigNote: cubieboard2 and cubietruck now run off the same kernel.  The default setting for the ethernet driver is as a boot-time loadable module, so depending on the board either sunxi_emac or sunxi_gmac needs to be specified in /etc/modules.  Kernels that I build have both drivers built into the kernel and selected by script.bin at boot time, so changes to /etc/modules aren't necessary for them.

3.5:  If you want to do a "menu configuration" now to select more kernel options or drivers, don't just do a "make menuconfig"!  You must do this instead:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
4. Build kernel:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage
5. Build modules:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=output modules_install
uImage will be in arch/arm/boot/uImage; modules will be in output/lib/modules.

Notes:

If your kernel doesn't boot, the most likely cause (other than not setting up the SD card properly -- if you've managed to create other bootable cards, that process is the same and probably isn't your problem) is having a mismatch in the machine ID between u-boot and the kernel.  For some reason this only happens to some people (like me!), so here's the patch to fix it:

In your boot.scr (must be recompiled from boot.cmd) or uEnv.txt, set the machid env variable to 0xf35; if that doesn't work, try machid=0x10bb.

Swap is not enabled by default ; to enable add CONFIG_SWAP=y to .config.

Edit: I don't know if this is still true in the 3.4.xx kernel:  "If you enable bluetooth usb, make it a module (CONFIG_BT=m, CONFIG_BT_HCIBTUSB=m); compiling it directly into the kernel causes it to crash when booting with a BT device plugged in, and even if you wait until the kernel boots to plug in the device, the driver is flaky (e.g., lots of timeouts)."

Edit: The patches and config settings above were rolled into the kernel in the new repo.  The bluetooth note is still important: don't try to build the bluetooth drivers into the kernel -- they should be loadable modules instead.  Nand block device is enabled in this kernel as a built-in driver, so you can repartition nand and put a root filesystem on it. 

Edit: Added INSTALL_MOD_STRIP=1 to the make modules_install command line to reduce module install size.

Edit: Ext4 file systems on nand are now supported with this version of u-boot (not compatible with mmc): https://github.com/patrickhwood/u-boot branch: lichee-dev-a20.

Edit: Changed branch from cedar to pat-3.4.75; changed config from cubieboard2_defconfig to sun7i_defconfig.

Edit: I don't know if this is still true in the 3.4.xx kernel:  "If you enable video for linux (V4L2) or some other media setting that enables video drivers, you'll probably need to set SUNXI_PHYS_MEM_ALLOCATOR to "y", as this is required by one of the low-level video buffer drivers and isn't selected automatically by menuconfig."

Edit: I've also built kernels from the official https://github.com/linux-sunxi/linux-sunxi repository.  The stage/sunxi-3.4 branch represents the most recent, up-to-date kernel code; the sunxi-3.4 branch is a somewhat older but more stable version.  As of Oct 25, this repo includes support for a working cedarx driver on the A20.  A new libcedarx from https://github.com/jemk/libcedarx with patches for the A20 is required.

If you already have an armhf toolchain installed, you can check its version with "arm-linux-gnueabihf-gcc -v".  Mine says "gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)".  If yours is a 4.7.x version, you should uninstall it and install gcc-4.6-arm-linux-gnueabihf.

I'll update this post from time to time as questions get answered and ideas come to me.
« Last Edit: January 30, 2014, 11:21:50 am by patwood »

giovanni.v

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #1 on: July 09, 2013, 04:52:00 am »
There are a few different git branches of this code in various repositories; I describe are the ones I'm using and are known (by me) to work.

Since cubietech sent me the new cubieboard2 for free I started working to support it in my project (thanks CubieTech!).
A matter of minutes, yesterday I spent a lot of time to simply find pointers to the u-boot and kernel sources ... now it's here in a few lines, thanks you anyway.

I found also another git repo:
- https://github.com/jwrdegoede/linux-sunxi/tree/sunxi-3.3-cubieboard2
Seems that include a fix to serial port hanging but actually I'm unable to catch it nor find the real meaningful differences between the two kernel repositories... I hate GIT (and really more github!).

ikeeki

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #2 on: July 09, 2013, 05:35:43 am »
Excellent work, inspirating.

Offline jlopezprado

  • Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #3 on: July 09, 2013, 05:52:55 am »
Quote
I found also another git repo:
- https://github.com/jwrdegoede/linux-sunxi/tree/sunxi-3.3-cubieboard2
Seems that include a fix to serial port hanging but actually I'm unable to catch it nor find the real meaningful differences between the two kernel repositories... I hate GIT (and really more github!).

That one repo is used by armstrap... almost at 0.42 versión.
Im using armstrap to build my images for testing.
EMAC transfer get sticked at 5 MB... same problema at other kernel branches?
Yep! SATA mounted for testing no SD problem.. :)

pacopad

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #4 on: July 09, 2013, 06:43:42 am »
I was asked for a quick tutorial on building a uboot/kernel combo for SD booting on the Cubie2. 

First, this is not a tutorial for creating a whole distribution; the uboot/kernel combo created here should work with most A10 distributions (no guarantees, though), but various unsupported features will be disabled (e.g., mali GPU, nand driver) depending on the progress made on the specific branches.

Second, you need to be familiar with the process of getting SPL and u-boot onto the SD card: https://github.com/linux-sunxi/u-boot-sunxi/wiki.

Finally, you'll need to have all the required tools for building linux; read the "building" section for your particular platform here: http://linux-sunxi.org/Main_Page.  The actual build process should work on any linux system that has the proper tools installed.  Note that I am running gcc 4.6.3 for armhf; there have been reports of problems with gcc 4.7 building earlier (pre-3.2) ARM kernels, and problems with gcc 4.8 and current ARM kernels.  Keep this in mind, as you may want to explicitly install gcc-4.6-arm-linux-gnueabihf.

There are a few different git branches of this code in various repositories; I describe are the ones I'm using and are known (by me) to work.  If you use a different branch, the overall process should be similar, but not necessarily the same.  If I get around to testing any of the other branches, I'll document any differences in the Notes section at the end.

Uboot/SPL:

1. Get the sources from git:
Code: [Select]
git clone git://github.com/hno/u-boot
2. Switch to A20 branch:
Code: [Select]
cd u-boot
git checkout wip/a20

3. Build u-boot:
Code: [Select]
CROSS_COMPILE=arm-linux-gnueabihf- make cubieboard2SPL will be in spl/sunxi-spl.bin and u-boot in u-boot.bin.

Linux kernel:

1. Get the sources from git:
Code: [Select]
git clone git://github.com/cubieboard2/linux-sunxi.git
2. Switch to A20 branch:
Code: [Select]
cd linux-sunxi
git checkout sunxi-3.3-cb2

3. Configure build:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- cubieboard2_defconfig
4. Build kernel:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage
5. Build modules:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 module
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_PATH=output modules_install
uImage will be in arch/arm/boot/uImage; modules will be in output/lib/modules.

Notes: If your kernel doesn't boot, the most likely cause (other than not setting up the SD card properly -- if you've managed to create other bootable cards, that process is the same and probably isn't your problem) is having a mismatch in the machine ID between u-boot and the kernel.  For some reason this only happens to some people (like me!), so here's the patch to fix it:

Code: [Select]
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 81f7cf1..a9cb9d3 100755
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -869,7 +869,7 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
         * locate machine in the list of supported machines.
         */
        for_each_machine_desc(p)
-               if (nr == p->nr) {
+               if (nr == p->nr || p->nr == 0xf35) {
                        printk("Machine: %s\n", p->name);
                        mdesc = p;
                        break;

Notes:

Android limits networking access to users in the inet or inetadmin groups; this was also the case a long time ago (last year) on the A10 kernels.  This can be disabled by removing CONFIG_ANDROID_PARANOID_NETWORK from .config.

Swap is not enabled by default in the 3.3.0 kernel; to enable add CONFIG_SWAP=y to .config.


I'll update this post from time to time as questions get answered and ideas come to me.

Hi PatWood,
Are the sources you used to build the cubibuntu A20 kernel ? I succed to compile the mali.ko and ump.ko from an other 3.3.0+ tree but i can load against the kernel you provide for CuibibuntuA20. I got a module_layout problem. Is it a way to adapt my modules with your kernel ?

Thank you for your answer
Pacopad

giovanni.v

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #5 on: July 09, 2013, 08:08:33 am »
Quote
- https://github.com/jwrdegoede/linux-sunxi/tree/sunxi-3.3-cubieboard2

That one repo is used by armstrap... almost at 0.42 versión.
Neat script but I want a fine grained control so build everything from souce.

Quote
EMAC transfer get sticked at 5 MB... same problema at other kernel branches?

I'm actually planning, reconfiguring kernel,do diffs and re-packaging to suit my build scripts requirements... every build must start from known sources and be reproductible.
However I had read of similar EMAC problem with the A10/first cubieboard so I included nuttcp and done some test, off-topic (sorry!) here the results...

Code: [Select]
~ # uname -a
Linux TeeBX.local 3.0.62-dist #1 Fri Jul 5 21:00:18 UTC 2013 armv7l GNU/Linux

~ # nuttcp -T20 -i1 172.31.255.114
   11.1875 MB /   1.00 sec =   93.8237 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3821 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8384 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3892 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8362 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3861 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8333 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3853 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3635 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8548 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3514 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8701 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3597 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8555 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3634 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8560 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3568 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3897 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8324 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3868 Mbps     0 retrans

  225.0129 MB /  20.09 sec =   93.9463 Mbps 6 %TX 27 %RX 0 retrans 0.52 msRTT

~ # nuttcp -u -Ri300m/50 -i 1 -T5 172.31.255.114
   11.1982 MB /   1.00 sec =   93.9154 Mbps     0 / 11467 ~drop/pkt  0.00 ~%loss
   11.1982 MB /   1.00 sec =   93.9335 Mbps     0 / 11467 ~drop/pkt  0.00 ~%loss
   11.1973 MB /   1.00 sec =   93.9339 Mbps     0 / 11466 ~drop/pkt  0.00 ~%loss
   11.1992 MB /   1.00 sec =   93.9634 Mbps     0 / 11468 ~drop/pkt  0.00 ~%loss
   11.1973 MB /   1.00 sec =   93.9209 Mbps     0 / 11466 ~drop/pkt  0.00 ~%loss

   56.1602 MB /   5.02 sec =   93.9366 Mbps 24 %TX 7 %RX 0 / 57508 drop/pkt 0.00 %loss

--- (last test reversed) ---
~ # nuttcp -u -Ri300m/50 -i 1 -T5 172.31.255.119
   11.3398 MB /   1.01 sec =   93.9097 Mbps 24551 / 36163 ~drop/pkt 67.89 ~%loss
   11.2002 MB /   1.00 sec =   93.9503 Mbps 24976 / 36445 ~drop/pkt 68.53 ~%loss
   11.1992 MB /   1.00 sec =   93.9364 Mbps 25087 / 36555 ~drop/pkt 68.63 ~%loss
   11.2002 MB /   1.00 sec =   93.9504 Mbps 24896 / 36365 ~drop/pkt 68.46 ~%loss
   11.1992 MB /   1.00 sec =   93.9383 Mbps 24998 / 36466 ~drop/pkt 68.55 ~%loss

   56.1562 MB /   5.01 sec =   93.9374 Mbps 99 %TX 6 %RX 124556 / 182060 drop/pkt 68.41 %loss

The percent expression before RX/TX represents the cpu load on receiver/ trasmiter sides, in all tests except the latest one the cubieboard was the receiver trasmitter.
Not so bad. note that the udp test at 300 Mbps/50 packets burst is a potential killer also for any intel dual core...
« Last Edit: July 09, 2013, 08:12:35 am by giovanni.v »

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #6 on: July 09, 2013, 10:53:30 am »
There are a few different git branches of this code in various repositories; I describe are the ones I'm using and are known (by me) to work.

Since cubietech sent me the new cubieboard2 for free I started working to support it in my project (thanks CubieTech!).
A matter of minutes, yesterday I spent a lot of time to simply find pointers to the u-boot and kernel sources ... now it's here in a few lines, thanks you anyway.

I found also another git repo:
- https://github.com/jwrdegoede/linux-sunxi/tree/sunxi-3.3-cubieboard2
Seems that include a fix to serial port hanging but actually I'm unable to catch it nor find the real meaningful differences between the two kernel repositories... I hate GIT (and really more github!).
Both branches are maintained by the same guy and appear to point to the same sources/commits.

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #7 on: July 09, 2013, 10:56:24 am »
I found also another git repo:
- https://github.com/jwrdegoede/linux-sunxi/tree/sunxi-3.3-cubieboard2
Seems that include a fix to serial port hanging but actually I'm unable to catch it nor find the real meaningful differences between the two kernel repositories... I hate GIT (and really more github!).
The serial port bug appears to be on the Olimex board A20, not the cubie2.

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #8 on: July 09, 2013, 10:58:42 am »
Hi PatWood,
Are the sources you used to build the cubibuntu A20 kernel ? I succed to compile the mali.ko and ump.ko from an other 3.3.0+ tree but i can load against the kernel you provide for CuibibuntuA20. I got a module_layout problem. Is it a way to adapt my modules with your kernel ?

Thank you for your answer
Pacopad
Yes, these are the only sources I've been using for the A20 so far; all of my posts regarding A20 kernels/distros that I've built use them.

Where did you get the kernel sources for these modules?  I'd be interested in building it and trying them out.

Pat

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #9 on: July 09, 2013, 11:02:39 am »
I'm actually planning, reconfiguring kernel,do diffs and re-packaging to suit my build scripts requirements... every build must start from known sources and be reproductible.
However I had read of similar EMAC problem with the A10/first cubieboard so I included nuttcp and done some test, off-topic (sorry!) here the results...

Code: [Select]
~ # uname -a
Linux TeeBX.local 3.0.62-dist #1 Fri Jul 5 21:00:18 UTC 2013 armv7l GNU/Linux

~ # nuttcp -T20 -i1 172.31.255.114
   11.1875 MB /   1.00 sec =   93.8237 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3821 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8384 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3892 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8362 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3861 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8333 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3853 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3635 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8548 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3514 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8701 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3597 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8555 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3634 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8560 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3568 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3897 Mbps     0 retrans
   11.1875 MB /   1.00 sec =   93.8324 Mbps     0 retrans
   11.2500 MB /   1.00 sec =   94.3868 Mbps     0 retrans

  225.0129 MB /  20.09 sec =   93.9463 Mbps 6 %TX 27 %RX 0 retrans 0.52 msRTT

~ # nuttcp -u -Ri300m/50 -i 1 -T5 172.31.255.114
   11.1982 MB /   1.00 sec =   93.9154 Mbps     0 / 11467 ~drop/pkt  0.00 ~%loss
   11.1982 MB /   1.00 sec =   93.9335 Mbps     0 / 11467 ~drop/pkt  0.00 ~%loss
   11.1973 MB /   1.00 sec =   93.9339 Mbps     0 / 11466 ~drop/pkt  0.00 ~%loss
   11.1992 MB /   1.00 sec =   93.9634 Mbps     0 / 11468 ~drop/pkt  0.00 ~%loss
   11.1973 MB /   1.00 sec =   93.9209 Mbps     0 / 11466 ~drop/pkt  0.00 ~%loss

   56.1602 MB /   5.02 sec =   93.9366 Mbps 24 %TX 7 %RX 0 / 57508 drop/pkt 0.00 %loss

--- (last test reversed) ---
~ # nuttcp -u -Ri300m/50 -i 1 -T5 172.31.255.119
   11.3398 MB /   1.01 sec =   93.9097 Mbps 24551 / 36163 ~drop/pkt 67.89 ~%loss
   11.2002 MB /   1.00 sec =   93.9503 Mbps 24976 / 36445 ~drop/pkt 68.53 ~%loss
   11.1992 MB /   1.00 sec =   93.9364 Mbps 25087 / 36555 ~drop/pkt 68.63 ~%loss
   11.2002 MB /   1.00 sec =   93.9504 Mbps 24896 / 36365 ~drop/pkt 68.46 ~%loss
   11.1992 MB /   1.00 sec =   93.9383 Mbps 24998 / 36466 ~drop/pkt 68.55 ~%loss

   56.1562 MB /   5.01 sec =   93.9374 Mbps 99 %TX 6 %RX 124556 / 182060 drop/pkt 68.41 %loss

The percent expression before RX/TX represents the cpu load on receiver/ trasmiter sides, in all tests except the latest one the cubieboard was the receiver trasmitter.
Not so bad. note that the udp test at 300 Mbps/50 packets burst is a potential killer also for any intel dual core...
We've experienced emac problems on some A10 boards, especially degradation of speed after running it for a while (from >50mb/sec to < 1mb/sec); however, not on the Cubie and not with normal speed tests (I've run iperf overnight on hackberrys without any problems; our QA people can wedge the port in 30 minutes of testing).  Since we're going to ship cubieboards and not hackberrys, this has become a very low priority for me, so I haven't had any time to see if I can track down the problem (and since it doesn't appear on the cubieboard, it could be a HW issue, another reason why I'm not spending any time on it right now).

pacopad

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #10 on: July 10, 2013, 01:58:33 am »
Hi PatWood,

i compiled manually those drivers : linux-sunxi/modules/mali/DX910-SW-99002-r3p2-01rel0

Both drivers compiles without problems. UMP Drivers loads well and create /dev/ump Mali driver load with errors in dmesg but the system considers it's loaded. Unfortunaly /dev/mali isn't created :(

I'll make other tests today

Pacopad

Hi PatWood,
Are the sources you used to build the cubibuntu A20 kernel ? I succed to compile the mali.ko and ump.ko from an other 3.3.0+ tree but i can load against the kernel you provide for CuibibuntuA20. I got a module_layout problem. Is it a way to adapt my modules with your kernel ?

Thank you for your answer
Pacopad
Yes, these are the only sources I've been using for the A20 so far; all of my posts regarding A20 kernels/distros that I've built use them.

Where did you get the kernel sources for these modules?  I'd be interested in building it and trying them out.

Pat

abstractbill

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #11 on: July 10, 2013, 01:02:01 pm »
Hey, thanks a million for writing up these instructions.  I made a few small notes while following them - perhaps helpful to others:

3.5:  If you want to do "menu config" after step 3, don't type that!  You really have to remember to do "make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig"

5: "make module" should be "make modules"

After doing the above, my modules wouldn't compile.  I had to manually edit .config, and set SUNXI_PHYS_MEM_ALLOCATOR to "y", otherwise I got the following error:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 modules
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  Building modules, stage 2.
  MODPOST 80 modules
WARNING: drivers/net/wireless/bcmdhd/bcmdhd: 'bcmsdh_probe' exported twice. Previous export was in drivers/net/wireless/bcm4330/bcm4330.ko
WARNING: drivers/net/wireless/bcmdhd/bcmdhd: 'bcmsdh_remove' exported twice. Previous export was in drivers/net/wireless/bcm4330/bcm4330.ko
ERROR: "sunxi_mem_free" [drivers/media/video/videobuf-dma-contig.ko] undefined!
ERROR: "sunxi_mem_alloc" [drivers/media/video/videobuf-dma-contig.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Other than that, compilation went smoothly.  I have yet to test it on the cb2 itself, but fingers crossed!

Thanks again!

sedigheh81

  • Guest
Re: Building u-boot and kernel for mmc on C2
« Reply #12 on: July 10, 2013, 03:18:21 pm »
So helpful tutorial!
But what about creating image for onboard NAND?
I used one your suggested images on A20 and it worked great! Now how can I change it to make it work on NAND as well?

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #13 on: July 10, 2013, 03:38:51 pm »
So helpful tutorial!
But what about creating image for onboard NAND?
I used one your suggested images on A20 and it worked great! Now how can I change it to make it work on NAND as well?
"but various unsupported features will be disabled (e.g., mali GPU, nand driver) depending on the progress made on the specific branches."

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Building u-boot and kernel for mmc on C2
« Reply #14 on: July 10, 2013, 03:43:29 pm »
5: "make module" should be "make modules"
Fixed.

Quote
After doing the above, my modules wouldn't compile.  I had to manually edit .config, and set SUNXI_PHYS_MEM_ALLOCATOR to "y", otherwise I got the following error:
 <snip>
Did you enable a module that generated this error? I didn't get it doing a build with an unmodified branch or with any of the changes I made to the config file.  If you know which config parameter, please let me know so I can mention it in the notes.