Welcome, Guest

Author Topic: [HowTo + Image] Arch Linux ARM for A10-OLinuXino-LIME  (Read 5682 times)

progmetalbg

  • Full Member
  • ***
  • Posts: 136
  • Karma: +17/-0
[HowTo + Image] Arch Linux ARM for A10-OLinuXino-LIME
« on: March 11, 2015, 09:07:44 PM »
I cannot find official guide on Arch Linux ARM site for A10-OLinuXino-LIME, but u-boot packages are provided for every Olimex board and sun4i linux kernel supports all AllWinner A10 based boards, so here is how-to based on http://archlinuxarm.org/platforms/armv7/allwinner/cubieboard . It is tested and works!

Install to a micro SD card
Replace sdX in the following instructions with the device name for the SD card as it appears on your computer (in most cases it is either /dev/sdb or /dev/mmcblk0).

1. Zero the beginning of the SD card:
Code: [Select]
dd if=/dev/zero of=/dev/sdX bs=1M count=8
2. Start fdisk to partition the SD card:
Code: [Select]
fdisk /dev/sdXAt the fdisk prompt, delete old partitions and create a new one:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Now type n, then p for primary, 1 for the first partition on the drive, 2048 for the first sector, and then press ENTER to accept the default last sector.
Write the partition table and exit by typing w.

3. Create and mount the ext4 filesystem:
Code: [Select]
mkfs.ext4 -m 1 /dev/sdX1
mkdir mnt
mount /dev/sdX1 mnt

4. Download and extract the root filesystem:
Code: [Select]
wget http://archlinuxarm.org/os/ArchLinuxARM-sun4i-latest.tar.gz
bsdtar -xpf ArchLinuxARM-sun4i-latest.tar.gz -C mnt
sync

5. Install the U-Boot bootloader:
Go to http://os.archlinuxarm.org/armv7h/alarm/ and download the latest u-boot package for A10-OLinuXino-LIME. At the moment it is http://os.archlinuxarm.org/armv7h/alarm/uboot-a10-olinuxino-lime-2015.01-4-armv7h.pkg.tar.xz
Download it locally and open it with graphical archiver program such as Ark or XArchiver, then extract the files in boot folder to mnt. As a final step do:
Code: [Select]
dd if=mnt/boot/u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
umount mnt
sync

Insert the micro SD card into the A10-OLinuXino-LIME, connect ethernet, and apply 5V power.
Use the serial console or SSH to the IP address given to the board by your router. The default root password is 'root'.



Install the U-Boot package

In order to receive updates to the U-Boot bootloader, after logging into the system type:
Code: [Select]
rm /boot/script.bin
rm /boot/u-boot-sunxi-with-spl.bin
pacman -Syu uboot-a10-olinuxino-lime
When prompted, press y and hit enter to flash the bootloader to the SD card.
Merge any pacnew files created by the package overwriting the manually installed bootloader files.



Mainline Kernel

Install the new kernel, which will remove the linux-sun4i package:
Code: [Select]
pacman -Syu linux-armv7Or you can try also the latest release candidate, which at the time of writing this post is 4.0.0-rc3:
Code: [Select]
pacman -Syu linux-armv7-rcReboot the system:
Code: [Select]
reboot*Note that at the moment mainline kernel does not support GPU/VPU and audio, it is only useful for headless systems


Ready to use Arch Linux ARM image

For lazy people only :)
It is 115 MB compressed with XZ Arch Linux ARM image:
https://drive.google.com/file/d/0BwafTA6sZEvVQkp1SHpnTFIwR0E/view?usp=sharing
Download, uncompress and write to microSD card with dd (Linux) or Win32 Disk Imager (Windows).
The uncompressed image fits even 1 GB SD card, you only need to extend the root partition and filesystem to use all unallocated space on the SD card.

balornt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: [HowTo + Image] Arch Linux ARM for A10-OLinuXino-LIME
« Reply #1 on: March 24, 2015, 07:35:39 AM »
I know it isn't exactly the same, but you don't have a similar thread for A13 boards. I am trying to install arch linux on the Olimex A13-SOM with A13-SOM-WIFI board. I followed the instructions here but used the sunxi A13 uboot package instead of the A10 package. An excerpt of the console output is below. I couldn't include all of it in one message. Any help you can offer would be appreciated.

Code: [Select]
CPU:   Allwinner A13 (SUN5I)                                                   
I2C:   ready                                                                   
DRAM:  512 MiB                                                                 
MMC:   SUNXI SD/MMC: 0                                                         
*** Warning - bad CRC, using default environment                               
                                                                               
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   No ethernet found.                                                       
Hit any key to stop autoboot:  0                                               
switch to partitions #0, OK                                                     
mmc0 is current device                                                         
Scanning mmc 0...                                                               
Found U-Boot script /boot/boot.scr                                             
805 bytes read in 153 ms (4.9 KiB/s)                                           
## Executing script at 43100000                                                 
** File not found /boot/zImage **                                               
3905200 bytes read in 452 ms (8.2 MiB/s)                                       
28744 bytes read in 147 ms (190.4 KiB/s)                                       
## Booting kernel from Legacy Image at 48000000 ...                             
   Image Name:   Linux-3.4.103-3-ARCH                                           
   Image Type:   ARM Linux Kernel Image (uncompressed)                         
   Data Size:    3905136 Bytes = 3.7 MiB                                       
   Load Address: 40008000                                                       
   Entry Point:  40008000                                                       
   Verifying Checksum ... OK                                                   
   Loading Kernel Image ... OK                                                 
                                                                               
Starting kernel ...                                                             
                                                                               
[    0.000000] Booting Linux on physical CPU 0                                 
[    0.000000] Initializing cgroup subsys cpuset                               
[    0.000000] Initializing cgroup subsys cpu 

...

[    1.696359] sunxi-rtc sunxi-rtc: setting system clock to 2010-01-01 00:00:00
UTC (1262304000)                                                               
[    1.704946] ALSA device list:                                               
[    1.707912]   #0: sunxi-CODEC  Audio Codec                                   
[    1.712401] Waiting for root device PARTUUID=fbf9c63e-01...                 
[    2.499057] [mmc-msg] mmc 0 detect change, present 1                         
[    2.994119] [mmc-msg] sdc0 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timi
ng LEGACY(SDR12) dt B                                                           
[    3.003069] [mmc-msg] sdc0 power on                                         
[    3.006602] [ccmu] set sdc0 reset status to 0 failed!                       
[    3.011651] [mmc-err] Failed to release sdc0 reset                           
[    3.034114] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1
 timing LEGACY(SDR12) dt B                                                     
[    3.043523] [mmc-msg] sdc0 set round clock 400000, src 24000000             
[    3.126438] [mmc-err] smc 0 err, cmd 52,  RTO                               
[    3.131618] [mmc-err] smc 0 err, cmd 52,  RTO                               
[    3.135992] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1
 timing LEGACY(SDR12) dt B                                                     
[    3.147773] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1
 timing LEGACY(SDR12) dt B                                                     
[    3.159295] [mmc-err] smc 0 err, cmd 5,  RTO                                 
[    3.164382] [mmc-err] smc 0 err, cmd 5,  RTO                                 
[    3.169470] [mmc-err] smc 0 err, cmd 5,  RTO                                 
[    3.174557] [mmc-err] smc 0 err, cmd 5,  RTO                                 
[    3.179474] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1
 timing LEGACY(SDR12) dt B                                                     
[    3.188879] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1
 timing LEGACY(SDR12) dt B                                                     
[    3.200645] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1
 timing LEGACY(SDR12) dt B                                                     
[    3.236585] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1
 timing SD-HS(SDR25) dt B                                                       
[    3.245906] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width
 1 timing SD-HS(SDR25) dt B                                                     
[    3.255437] [mmc-msg] sdc0 set round clock 45333333, src 816000000           
[    3.316681] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width
 4 timing SD-HS(SDR25) dt B                                                     
[    3.326179] mmc0: new high speed SDHC card at address 1234                   
[    3.331979] mmcblk0: mmc0:1234 SA16G 14.4 GiB                               
[    3.338336]  mmcblk0: p1                                                     
[    3.341473] platform reg-20-cs-ldo2: Driver reg-20-cs-ldo2 requests probe def
erral                                                                           
[    3.349169] platform reg-20-cs-ldo3: Driver reg-20-cs-ldo3 requests probe def
erral                                                                           
[    3.356782] platform reg-20-cs-ldo4: Driver reg-20-cs-ldo4 requests probe def
erral                                                                           
[    3.364406] platform reg-20-cs-buck2: Driver reg-20-cs-buck2 requests probe d
eferral                                                                         
[    3.372167] platform reg-20-cs-buck3: Driver reg-20-cs-buck3 requests probe d
eferral                                                                         
[    3.379949] platform reg-20-cs-ldoio0: Driver reg-20-cs-ldoio0 requests probe
 deferral                                                                       
[    3.475275] EXT4-fs (mmcblk0p1): couldn't mount as ext3 due to feature incomp
atibilities                                                                     
[    3.485064] EXT4-fs (mmcblk0p1): couldn't mount as ext2 due to feature incomp
atibilities   

progmetalbg

  • Full Member
  • ***
  • Posts: 136
  • Karma: +17/-0
Re: [HowTo + Image] Arch Linux ARM for A10-OLinuXino-LIME
« Reply #2 on: March 24, 2015, 08:57:56 PM »
Which u-boot did you install and what A13-SOM do you have - 256MB or 512MB version?
Do you need the linux-sunxi kernel 3.0/3.4 that has audio/video support or mainline kernel 3.19?
A13-SOM do not have mainline u-boot and mainline kernel support at the moment and you need a mainline u-boot in order to run recent version of Arch Linux ARM.
Check this official Olimex guide:
https://drive.google.com/file/d/0B-bAEPML8fwla3NhVGdwbGthOXM/edit
You can try to make an image for A13-OLinuXino-MICRO (with only 256MB RAM recognized but this can be fixed by patching u-boot).
Write these files to uSD card:
http://os.archlinuxarm.org/os/sunxi/boot/a13-olinuxino-micro/ and install u-boot with dd
As a rootfs you can try http://os.archlinuxarm.org/os/ArchLinuxARM-sun5i-latest.tar.gz
sun5i is the code name for AllWinner A13 and A10s.
or rootfs containing mainline kernel 3.19: http://os.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz

balornt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: [HowTo + Image] Arch Linux ARM for A10-OLinuXino-LIME
« Reply #3 on: March 24, 2015, 11:26:54 PM »
Which u-boot did you install and what A13-SOM do you have - 256MB or 512MB version?
I have the 512MB version of the SOM although it would be nice to know how to do it for the 256MB version as I will be evaluating both versions of the SOM.
I am using the uboot-a13-olinuxino-2015.01-5-armv7h.pkg.tar.xz uboot for this example although I tried the uboot-a13-olinuxino-micro-2015.01-5-armv7h.pkg.tar.xz version without success. It did have different console output, which I can include if you think it will help.

Do you need the linux-sunxi kernel 3.0/3.4 that has audio/video support or mainline kernel 3.19?
I need audio/video support. If I can do that with mainline then great otherwise 3.0/3.4.

I appreciate the documentation. I'll look into it, but I am still rather new at kernel hacking for embedded devices so I may just stick with debian image provided by Olimex.