Re: Booting mainline on a20-olinuxino/cubietruck

594 views
Skip to first unread message

Axel Theilmann

unread,
Nov 16, 2013, 8:24:59 PM11/16/13
to linux...@googlegroups.com

moin,

> i'm trying to boot the mainline kernel on an A20-olinuxino micro, following

nevermind..it's working now. someone on #linux-sunxi was able to help me.

it was just a console problem, the kernel seems to work fine...


tty, axel


Axel Theilmann

unread,
Nov 16, 2013, 4:45:06 PM11/16/13
to linux...@googlegroups.com

moin,

i'm trying to boot the mainline kernel on an A20-olinuxino micro, following
this description:

http://linux-sunxi.org/Mainline_Kernel_Howto

- kernel is plain 3.12 (tarball from kernel.org)

- with sunxi_defconfig and sun7i-a20-olinuxino-micro.dts/dtb
(i tried the plain sunxi_defconfig from mripards repo and also
tried a modified one with more stuff enabled..)

- uboot is from linux-sunxi/u-boot-sunxi.git with
config A20-OLinuXino_MICRO


u-boot comes up nicely, i load kernel & dtb and can also "fdt print"
the dtb in ram after loading.

when i boot, it looks fine at first:

U-Boot 2013.10-rc2-08403-g7c867fd (Nov 16 2013 - 13:35:07) Allwinner Technology

CPU: Allwinner A20 (SUN7I)
Board: A20-OLinuXino_MICRO
I2C: ready
DRAM: 1 GiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: emac
Hit any key to stop autoboot: 0



sun7i# fatload mmc 0 0x46000000 uImage

sun7i# fatload mmc 0 0x49000000 sun7i-a20-olinuxino-micro.dtb

sun7i# env set fdt_high 0xffffffff

sun7i# bootm 0x46000000 - 0x49000000

## Booting kernel from Legacy Image at 46000000 ...
Image Name: Linux-3.12.0
Created: 2013-11-16 18:40:50 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1771464 Bytes = 1.7 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 49000000
Booting using the fdt blob at 0x49000000
Loading Kernel Image ... OK
Using Device Tree in place at 49000000, end 49004bbe

Starting kernel ...


but after this, complete silence...

either the kernel crashes before its even initialized the uart/console, or
its logging to another uart or something went wrong while starting the kernel.

same behaviour on a cubietruck...


anybody got an idea what might go wrong here?


thanks in advance for your help..


tty, axel

bruce bushby

unread,
Jun 23, 2014, 4:28:24 PM6/23/14
to linux...@googlegroups.com, ho...@dudelab.org
Hi Axel

How did you fix your console problem?  I have the same issue:

This config says starting kernel....and then nothing
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
fatload mmc 0 0x46000000 uImage
fatload mmc 0 0x49000000 sun7i-a20-olinuxino-micro.dtb 
env set fdt_high ffffffff
bootm 0x46000000 - 0x49000000


This config boots and I can login:
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
fatload mmc 0 0x43000000 script.bin
fatload mmc 0 0x48000000 uImage
bootm 0x48000000


But I feel that I should be using the dtb file rather then script.bin ? .... bit confused 

My kernel is built with:
[bruce@core buildroot]$ grep tty configs/olimex_a20-som_defconfig 
BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
[bruce@core buildroot]$



Any tips would be much appreciated!

Thanks

jons...@gmail.com

unread,
Jun 23, 2014, 4:58:48 PM6/23/14
to linux-sunxi, ho...@dudelab.org
Enable early printk in the kernel debug section on menu config. Then
add it to the command line from uboot.

Kernel command line: console=ttyS0,115200 loglevel=9 earlyprintk
root=/dev/nfs ip=192.168.1.51:192.168.1.254:192.168.1.254:255.255.255.0:truck::off
nfsroot=192.168.1.50:/export/work/root rootwait

For development I use tftp in uboot to load the kernel and then nfs
mount the root file system. SD in target only has uboot on it.


sun7i# printenv
baudrate=115200
boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x41000000;
then true; setenv stdout $saved_stdout; source 0x41000000;else setenv
stdout $saved_stdout;fi
bootargs=console=ttyS0,115200 loglevel=9 earlyprintk root=/dev/nfs
ip=dhcp root=192.168.1.50:/work2/root
bootdelay=2
bootenv=uEnv.txt
bootm_size=0x10000000
bootscr=boot.scr
ce=run nbe; run nbb; run nbr
ch=run nbl; run nbb; run nbr
console=ttyS0,115200
device=mmc
ethact=dwmac.1c50000
ethaddr=70:71:bc:b8:ab:ee
fdt_high=ffffffff
fileaddr=49000000
filesize=5e1a
ipaddr=192.168.1.51
kernel=uImage
loadbootenv=fatload $device $partition $scriptaddr ${bootenv} ||
ext2load $device $partition $scriptaddr boot/${bootenv} || ext2load
$device $partition $scriptaddr ${bootenv}
loadbootscr=fatload $device $partition $scriptaddr ${bootscr} ||
ext2load $device $partition $scriptaddr boot/${bootscr} ||ext2load
$device $partition $scriptaddr ${bootscr}
loadkernel=if bootpath=/boot/ && ext2load $device $partition
0x43000000 ${bootpath}${script} && ext2load $device $partition
0x48000000 ${bootpath}${kernel};then true; elif bootpath=/ && fatload
$device $partition 0x43000000 ${script} && fatload $device $partition
0x48000000 ${kernel};then true; elif bootpath=/ && ext2load $device
$partition 0x43000000 ${bootpath}${script} && ext2load $device
$partition 0x48000000 ${bootpath}${kernel};then true; else false;fi
loglevel=8
nbb=setenv bootargs console=ttyS0,115200 loglevel=9 earlyprintk
root=/dev/nfs ip=192.168.1.51:192.168.1.254:192.168.1.254:255.255.255.0:truck::off
nfsroot=192.168.1.50:/export/work/root rootwait
nbe=tftp 0x46000000 /var/lib/tftpboot/eImage && tftp 0x49000000
/var/lib/tftpboot/e.dtb && setenv fdt_high ffffffff
nbl=tftp 0x46000000 /var/lib/tftpboot/uImage && tftp 0x49000000
/var/lib/tftpboot/ct.dtb && setenv fdt_high ffffffff
nbr=bootm 0x46000000 - 0x49000000
panicarg=panic=10
partition=0:1
script=script.bin
scriptaddr=0x44000000
serverip=192.168.1.50
setargs=if test -z \\"$root\\"; then if test \\"$bootpath\\" =
"/boot/"; then root="/dev/mmcblk0p1 rootwait"; else
root="/dev/mmcblk0p2 rootwait"; fi; fi; setenv bootargs
console=${console} root=${root} loglevel=${loglevel} ${panicarg}
${extraargs}
stderr=serial
stdin=serial
stdout=serial
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Jon Smirl
jons...@gmail.com

bruce bushby

unread,
Jun 24, 2014, 6:17:54 PM6/24/14
to linux...@googlegroups.com
Thanks Jon, I have cleared my sdcard and setup tftp/nfs etc.

The exercise has shown I have a uboot/hardware problem in that the network is not working 

If I build uboot using "cubieboard2" .... I don't even get a "link up" 

If I build uboot using "A20-OLinuXino_MICRO"  ... I at least get link up...but I can't ping not can I tftp 

Then I tried setting "cubietruck" 
BR2_TARGET_UBOOT_BOARDNAME="Cubietruck"


and bingo.....network started working and I can at least load my kernel and dtb blob.....unfortunately I don't see anything after "Starting kernel.... "
 but at least I know which board to select when compiling uboot.





U-Boot 2014.04 (Jun 24 2014 - 23:03:23) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Cubietruck
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0 
sun7i# tftp 0x46000000 uImage
Speed: 100, full duplex
Using dwmac.1c50000 device
TFTP from server 192.100.1.10; our IP address is 192.100.1.19
Filename 'uImage'.
Load address: 0x46000000
Loading: #################################################################
         #################################################################
         ################################################
         3.7 MiB/s
done
Bytes transferred = 2607919 (27cb2f hex)
sun7i# tftp 0x49000000 sun7i-a20-cubietruck.dtb
Speed: 100, full duplex
Using dwmac.1c50000 device
TFTP from server 192.100.1.10; our IP address is 192.100.1.19
Filename 'sun7i-a20-cubietruck.dtb'.
Load address: 0x49000000
Loading: ##
         2.9 MiB/s
done
Bytes transferred = 21639 (5487 hex)
sun7i# bootm 0x46000000 - 0x49000000
## Booting kernel from Legacy Image at 46000000 ...
   Image Name:   Linux-3.16.0-rc2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2607855 Bytes = 2.5 MiB
   Load Address: 46000000
   Entry Point:  46000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 49000000
   Booting using the fdt blob at 0x49000000
   XIP Kernel Image ... OK
   Using Device Tree in place at 49000000, end 49008486

Starting kernel ...











--
You received this message because you are subscribed to a topic in the Google Groups "linux-sunxi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linux-sunxi/5mQHoyAjvJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linux-sunxi...@googlegroups.com.

jons...@gmail.com

unread,
Jun 24, 2014, 6:34:29 PM6/24/14
to linux-sunxi
Turn on the earlyprintk support. That will likely make some error
messages appear.

bruce bushby

unread,
Jun 25, 2014, 4:38:03 PM6/25/14
to linux...@googlegroups.com
Doesn't help....which suggests I'm doing something fundamentally wrong.

bootargs=console=ttyS0,115200 loglevel=9 earlyprintk

In my defconfig I have:
CONFIG_PRINTK_TIME=y
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_FS=y

The board I'm using in A20-SOM-EVB ...which was only released in May and is not yet supported ...hence all my issues with uboot (no network) and "dtb" 

Compiling uboot for "cubietruck" allows me to ping and tftp load my uImage....but it gets to Starting Kernel...... and thats it. I suspect thats because ttyS0 is not correctly defined in the dtb I'm using.

I'll ask if anybody has started using these boards....can't imagine the community will ignore them for long. Thanks again for all your help, much appreciated!!!!





jons...@gmail.com

unread,
Jun 25, 2014, 4:46:21 PM6/25/14
to linux-sunxi
Maybe you are loading the DTB too close to the kernel and when the
kernel expands it over writes it

Maxime Ripard

unread,
Jun 25, 2014, 5:20:15 PM6/25/14
to linux...@googlegroups.com
On Wed, Jun 25, 2014 at 09:37:59PM +0100, bruce bushby wrote:
> Doesn't help....which suggests I'm doing something fundamentally wrong.
>
> bootargs=console=ttyS0,115200 loglevel=9 earlyprintk
>
> In my defconfig I have:
> CONFIG_PRINTK_TIME=y
> CONFIG_EARLY_PRINTK=y
> CONFIG_DEBUG_LL=y
> CONFIG_DEBUG_FS=y
>
> The board I'm using in A20-SOM-EVB ...which was only released in May and is
> not yet supported ...hence all my issues with uboot (no network) and "dtb"
>
> Compiling uboot for "cubietruck" allows me to ping and tftp load my
> uImage....but it gets to Starting Kernel...... and thats it. I suspect
> thats because ttyS0 is not correctly defined in the dtb I'm using.

You do realise you could physically damage your board doing so, right?

Please, have an idea of what you are doing, ask for help before doing
anything stupid, or do nothing, but don't do that kind of thing.

> I'll ask if anybody has started using these boards....can't imagine the
> community will ignore them for long. Thanks again for all your help, much
> appreciated!!!!

As you've seen, there's no support for this. We're not ignoring it, we
just don't have that hardware.

So either you wait, or you learn how to do it properly and do so. But
just doing that kind of thing isn't going to work.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
signature.asc

bruce bushby

unread,
Jun 25, 2014, 6:33:52 PM6/25/14
to linux...@googlegroups.com

Hi Maxime 

Nope... didn't think about damaging the board..... I have absolutely no idea what I'm doing :) ...it's just a hobby and I figured the only way to learn is to try.....you really don't want to watch me connecting the breadboard LOL

I try and avoid constantly asking junior questions so tend to exhaust all sense before asking for help....progress is slow but I'm learning. Know any good books that explain how to write dts files?

"....We're not ignoring it, we just don't have that hardware..."  ..... Would you like one? 

Paul Jones

unread,
Jun 25, 2014, 8:29:04 PM6/25/14
to linux...@googlegroups.com

Hi Bruce,

 

I’m just guessing here, but if you can find an A20 board that is similar to the Olimex one you should be able to modify the DTS file so that the pin mapping is correct for your board. You will need the schematics to find which output pins on the CPU are routed to which peripheral.

 

If you find a good source for learning DTS files I’d like to see it – They are still a bit of a mystery to me as well.

 

Cheers,

Paul.

--

bruce bushby

unread,
Jun 26, 2014, 4:29:00 AM6/26/14
to linux...@googlegroups.com

Maxime: Hope I didn't sound sarcastic there, I know the enormous contributions yourself and Free-Electrons have made. Sometimes the only way for us "non-devloper" types to help out is by sending pizza or in this case some hardware. 

Paul: You and me both ....however I did some digging this morning and found some handy links:

This link is a must read:


Also there is this tutorial (no idea if it's any good)


Bruce





--
You received this message because you are subscribed to a topic in the Google Groups "linux-sunxi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linux-sunxi/5mQHoyAjvJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linux-sunxi...@googlegroups.com.

jons...@gmail.com

unread,
Jun 26, 2014, 8:33:34 AM6/26/14
to linux-sunxi
Olimex has instructions up on how to build for this module...

https://www.olimex.com/wiki/A20-SOM

How to generate boot-able SD-card Debian Linux image for A20-OLinuXino?

Follow our blog post with step by step instructions Note that
Linux-Sunxi Kernel is a work-in-progress, this means you can try the
current stage/sunxi-3.4 branch but if something is broken and doesn't
work just revert to the git tags we give in the blog and they should
work for sure

Sunxi u-boot loader The linux-sunxi git page contains a lot of sources
for all Olimex Allwinner boards.
Jon Smirl
jons...@gmail.com

Maxime Ripard

unread,
Jun 26, 2014, 12:10:15 PM6/26/14
to linux...@googlegroups.com
On Wed, Jun 25, 2014 at 03:33:52PM -0700, bruce bushby wrote:
>
> Hi Maxime
>
> Nope... didn't think about damaging the board..... I have absolutely no
> idea what I'm doing :) ...it's just a hobby and I figured the only way to
> learn is to try.....you really don't want to watch me connecting the
> breadboard LOL
>
> I try and avoid constantly asking junior questions so tend to exhaust all
> sense before asking for help....progress is slow but I'm learning. Know any
> good books that explain how to write dts files?

First thing first. Start with u-boot, then the kernel, then
buildroot. You're doing too much at once.

For u-boot, you can follow http://linux-sunxi.org/New_Device_howto

Once you've done that, you can try to look into this talk for example
and write your own dts:

https://events.linuxfoundation.org/sites/events/files/slides/petazzoni-device-tree-dummies.pdf

Buildroot should then be a piece of cake.
signature.asc

bruce bushby

unread,
Jun 27, 2014, 3:35:23 AM6/27/14
to linux...@googlegroups.com
Hi John

Thanks for that! ...and for all your help! I have looked at most of the docs now....the annoying part is you'll start off reading about A20-SOM and then find yourself in a "A20-OLinuXino_MICRO" 3.4 build document. 

Thinking I should start a thread specific to the A20-SOM..... rather then continue hijacking this thread.

Following Maxime's advice, I have focused on uboot and confirmed there is a problem with the network., so will play there until it's 100% and then look at booting mainline with a dtb.


Bruce


Reply all
Reply to author
Forward
0 new messages