Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A13 => Topic started by: iso9660 on February 01, 2013, 02:06:15 PM

Title: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: iso9660 on February 01, 2013, 02:06:15 PM
0.- Meet the prerequisites (compilation tools, etc):
sudo apt-get install gcc-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git

1.- Download the kernel branch sunxi-3.4:

git clone https://github.com/linux-sunxi/linux-sunxi.git kernel
cd kernel
git checkout sunxi-3.4


2.- In the recently created kernel folder create the file arch/arm/configs/a13om_defconfig
with the contents at a13_olinuxino_micro_defconfig_full (https://github.com/iso9660/olinuxino-A13-micro/blob/master/a13_olimex_micro_defconfig). This defconfig has usb serial drivers, wifi, lan, and uvc support.

3.- Create a script with the code below and execute it to compile the kernel:

#!/bin/bash
__ARCH=arm
__CROSS_COMPILE=arm-linux-gnueabihf-
__KBUILD_DEBARCH=arm

echo "Args = ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE}"
rm -rf deploy
mkdir deploy
mkdir deploy/fs
make mrproper
make -j5 ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE} a13om_defconfig
make clean
make -j5 ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE} menuconfig
make -j5 ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE} dep
make -j5 ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE} uImage
make -j5 ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE} modules
make ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE} INSTALL_MOD_PATH=deploy/fs modules_install
make ARCH=${__ARCH} CROSS_COMPILE=${__CROSS_COMPILE} INSTALL_FW_PATH=deploy/fs/lib/firmware firmware_install
cp .config deploy/fs/a13_olimex_micro_defconfig
cp arch/arm/boot/uImage deploy/fs/uImage
cd deploy/fs
tar czf ../linux.tar.gz *
cd ../..


4.- When the compilation finish there will be created the file deploy/linux.tar.gz.
This file should be untared in the / path of the second partition of the SD
card containing the A13_Micro_Debian_first_preliminary_release.img image that
you should have  written in a SD card beforehand.
Then in the first partition you should copy the files a13_olimex_micro_defconfig
and uImage that were untared in the / path of the second partition.

5.- Disconect the power and the serial port of the MICRO and reconnect them again.
If you don't do this the board will not propertly load the new kernel (I don't know why).
Title: Re: [Kernel] Instructions to compile kernel 3.4.24 for A13 MICRO board
Post by: jeroends on February 04, 2013, 04:46:43 PM
Excellent tutorial and works (almost) like a charm. Almost because I had to disable the "Suspend to RAM and standby" feature, it simply wouldn't compile and caused a make error.

Maybe nice to notice that some prerequisites are needed if you're starting the first time compiling the kernel (those can be found in de wiki unther the compiling for the "normal" a13 board).

Question: you don't happen to know how to get an spi userspace device? I enabled it by enabling the experimental drivers, but no spi device is created (yet "/sys/class/spi_master/spi2") is created).
Title: Re: [Kernel] Instructions to compile kernel 3.4.24 for A13 MICRO board
Post by: iso9660 on February 04, 2013, 08:26:42 PM
Quote from: jeroends on February 04, 2013, 04:46:43 PM
Maybe nice to notice that some prerequisites are needed if you're starting the first time compiling the kernel (those can be found in de wiki unther the compiling for the "normal" a13 board).

Added prerequisites.

Quote from: jeroends on February 04, 2013, 04:46:43 PM
Question: you don't happen to know how to get an spi userspace device? I enabled it by enabling the experimental drivers, but no spi device is created (yet "/sys/class/spi_master/spi2") is created).

No, I'm sorry, but maybe you could get some help here:
https://groups.google.com/forum/#!forum/linux-sunxi
Title: Re: [Kernel] Instructions to compile kernel 3.4.24 for A13 MICRO board
Post by: iso9660 on February 05, 2013, 10:39:34 AM
Quote from: jeroends on February 04, 2013, 04:46:43 PM
Question: you don't happen to know how to get an spi userspace device? I enabled it by enabling the experimental drivers, but no spi device is created (yet "/sys/class/spi_master/spi2") is created).

I've converted script.bin to a .fex file and I discovered that spi seems to be disabled on boot

...
[spi2_para]
spi_used = 0
...
Title: Re: [Kernel] Instructions to compile kernel 3.4.24 for A13 MICRO board
Post by: Nico on February 05, 2013, 10:51:40 AM
Thanks a lot!
Title: Re: [Kernel] 3.4.24+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: jeroends on February 06, 2013, 01:07:44 AM
QuoteI've converted script.bin to a .fex file and I discovered that spi seems to be disabled on boot

Code: [Select]
...
[spi2_para]
spi_used = 0
...

Unfortunatly I already went that way, I also added:

[spi_devices]
spi_dev_num = 1


Thanks anyway, I'll keep googling untill I got it working
Title: Re: [Kernel] 3.4.24+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: lordlothar on February 06, 2013, 04:43:11 AM
Tried to follow the steps, but always exits with error:

drivers/video/sunxi/disp/OSAL_Pin.c:24:50: error: ../../../../power/axp_power/axp-gpio.h: No such file or directory
drivers/video/sunxi/disp/OSAL_Pin.c: In function 'OSAL_GPIO_Request':
drivers/video/sunxi/disp/OSAL_Pin.c:37: error: implicit declaration of function 'axp_gpio_set_io'
drivers/video/sunxi/disp/OSAL_Pin.c:39: error: implicit declaration of function 'axp_gpio_set_value'
drivers/video/sunxi/disp/OSAL_Pin.c: In function 'OSAL_GPIO_DevREAD_ONEPIN_DATA':
drivers/video/sunxi/disp/OSAL_Pin.c:126: error: implicit declaration of function 'axp_gpio_get_value'
make[3]: *** [drivers/video/sunxi/disp/OSAL_Pin.o] Error 1
make[2]: *** [drivers/video/sunxi/disp] Error 2
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2
cp: cannot stat `arch/arm/boot/uImage': No such file or directory

Title: Re: [Kernel] 3.4.24+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: iso9660 on February 06, 2013, 09:48:22 AM
Quote from: lordlothar on February 06, 2013, 04:43:11 AM
Tried to follow the steps, but always exits with error:

drivers/video/sunxi/disp/OSAL_Pin.c:24:50: error: ../../../../power/axp_power/axp-gpio.h: No such file or directory
drivers/video/sunxi/disp/OSAL_Pin.c: In function 'OSAL_GPIO_Request':
drivers/video/sunxi/disp/OSAL_Pin.c:37: error: implicit declaration of function 'axp_gpio_set_io'
drivers/video/sunxi/disp/OSAL_Pin.c:39: error: implicit declaration of function 'axp_gpio_set_value'
drivers/video/sunxi/disp/OSAL_Pin.c: In function 'OSAL_GPIO_DevREAD_ONEPIN_DATA':
drivers/video/sunxi/disp/OSAL_Pin.c:126: error: implicit declaration of function 'axp_gpio_get_value'
make[3]: *** [drivers/video/sunxi/disp/OSAL_Pin.o] Error 1
make[2]: *** [drivers/video/sunxi/disp] Error 2
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2
cp: cannot stat `arch/arm/boot/uImage': No such file or directory


There was an errata in the instructions I provided. The kernel branch is stage/sunxi-3.4.
Be careful to get that branch and pull the last changes after cloning the repo:

git clone https://github.com/linux-sunxi/linux-sunxi.git kernel
cd kernel
git checkout stage/sunxi-3.4
git pull


At last try to compile without adding more modules, then if you need it add other drivers.
Title: Re: [Kernel] 3.4.24+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: jeroends on February 06, 2013, 05:31:01 PM
QuoteTried to follow the steps, but always exits with error:

That's the reason why I removed
Quote"Suspend to RAM and standby"

Since the micro doesn't have a standby mode, this isn't really needed.
Later on today I'm going to try something else to get the spi userspace device enabled. Going to try to add some board info for the "spidev" in the fex file and driver code.
ex for fex file:
[spi_board0]
modalias = "spidev"
max_speed_hz = 20000000
bus_num = 2
chip_select = 0
mode = 0

Title: Re: [Kernel] 3.4.24+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: lordlothar on February 06, 2013, 11:24:19 PM
I also removed Suspend but it didn't work at first, but got it working at last! So, thank you very very much iso9660! I actually had also to enable experimental features on menuconfig, because my usb adapter uses atheros9170 chipset which was not supported by default at you configuration, but anyway, at last it works! Thanks again!!
Title: Re: [Kernel] 3.4.24+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: sandro on April 15, 2013, 05:49:17 PM
I have this errors when I try to recompile it:

include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
include/asm-generic/gpio.h:221:2: error: implicit declaration of function '__gpio_get_value' [-Werror=implicit-function-declaration]
include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
include/asm-generic/gpio.h:227:2: error: implicit declaration of function '__gpio_set_value' [-Werror=implicit-function-declaration]
drivers/spi/spi_sunxi.c: In function 'spi_sunxi_register_spidev':
drivers/spi/spi_sunxi.c:1836:2: error: implicit declaration of function 'gpio_request' [-Werror=implicit-function-declaration]
drivers/spi/spi_sunxi.c:1837:3: error: implicit declaration of function '__gpio_to_irq' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors


Can you help to solve it?
Thanks
Title: Re: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: voelker on April 24, 2013, 12:12:49 PM
add

CONFIG_GPIOLIB=y

to arch/arm/config/a13om_defconfig

(worked for me)
Title: Re: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: iso9660 on April 25, 2013, 11:44:58 AM
Quote from: voelker on April 24, 2013, 12:12:49 PM
add

CONFIG_GPIOLIB=y

to arch/arm/config/a13om_defconfig

(worked for me)

Thanks, I've updated the config file in the instructions to allow to compile the kernel propertly.
Title: Re: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: chuck_norris on February 02, 2014, 10:46:13 PM
Thanks for this, works pretty well.

But this defconfig don't support any lcds, right?. Anybody knows the kernel modules to have lcd support?
Title: Re: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: pulpo on March 12, 2014, 06:51:21 PM
Anybody knows where I can find the A13_Micro_Debian_first_preliminary_release.img?
It seems that the only available image nowadays is: A13_Micro_Debian_1GHz_GPIO_100kHz_I2C_WIFI_USB_LAN_without_X_and_touch_second_release.img which has a 3.0.52+ kernel and is described as A13-OLinuXino-MICRO Debian 4GB SD-card image release-2.
Title: Re: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: JohnS on March 12, 2014, 07:50:15 PM
I found this using google

https://docs.google.com/file/d/0B-bAEPML8fwlOGE5WXlKWEtEU0E/edit?pli=1

John
Title: Re: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: pulpo on March 13, 2014, 01:37:21 PM
Got it, thanks.
I found nothing using google.
Title: Re: [Kernel] 3.4.29+ for A13 MICRO board with serial, lan, wifi, and uvc drivers.
Post by: pulpo on March 13, 2014, 02:02:06 PM
It seems that this image also has 3.0.52+ kernel.

root@A13Micro:~# uname -a
Linux A13Micro 3.0.52+ #10 PREEMPT Wed Dec 5 16:01:52 EET 2012 armv7l GNU/Linux

How can I obtain the update to 3.4.29+ ? It seems that the method described in this post doesn't work.