[SOLVED] How to configure latest uboot 2015.01-1

This forum is for supported devices using an ARMv7 Allwinner SoC.

[SOLVED] How to configure latest uboot 2015.01-1

Postby starfry » Tue Jan 20, 2015 3:52 pm

Hi, apologies if this is a FAQ but I have been unable to find anything. I am new to the Cubieboard 2 but have been around on arm for some time on the Raspberry Pi and am a long-time Arch user.

I have been grappling with boot settings on my new board (<24 hours in at the moment). I had effected changes by editing eEnv.txt and it seemed to work but after doing an update (pacman -Syu) I believe the way uboot works has changed but I can't find any information about it.

I believe the current way to configure it does not use uEnv.txt but instead you write "boot.txt" and generate "boot.scr" from it by running "mkscr". Is this correct? Is uEnv.txt no longer valid ?

If so, is there any documentation or guidance for boot.txt or how I should set boot arguments now?

I've looked briefly at boot.txt. I can add arguments to the "setenv bootargs" line but is that the right way? I can no longer get my HDMI to work. Here's what I had in eEnv.txt:

$this->bbcode_second_pass_code('', 'console=ttyS0,115200
console=tty0
disp.screen0_output_mode=EDID:1024x768p60
')

I tried this in boot.txt. I was moving my root tp sda6 and that works fine but the disp setting doesn't work.

$this->bbcode_second_pass_code('', 'setenv bootargs console=ttyS0,115200 console=tty0 disp.screen0_output_mode=EDID:1024x768p60 root=/dev/sda6 rw rootwait')

Any guidance appreciated.
Last edited by starfry on Thu Jan 22, 2015 1:55 pm, edited 1 time in total.
starfry
 
Posts: 24
Joined: Wed Jul 18, 2012 7:24 pm

Re: How to configure latest uboot 2015.01-1

Postby starfry » Thu Jan 22, 2015 9:49 am

SO I've been researching this and I believe the update to 2015.01-1 was a radical change because it shifted the source from the sunxi branch (https://github.com/linux-sunxi/u-boot-s ... ec0.tar.gz) to use upstream (ftp://ftp.denx.de/pub/u-boot/u-boot-2015.01.tar.bz2) and there are many differences between the two from a cubieboard/sunxi perspective.

Now, I am no expert on the U-boot code, having only been looking at this for three days. I've tried to decipher the build process but it's complex (just look at the Makefile!!). But what I have discovered is that the default environments in U-Boot are defined by a multitude of "#defines" in C header files and the two versions produce very different default envronments. The 2014.10 has a boot command like this

$this->bbcode_second_pass_code('', '
run boot_ram;mmc dev ${mmcdev};if mmc rescan; then echo SD/MMC found on device ${mmcdev};if r un loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; th en echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loaduimage ...;if run loaduimage; the n run loadscript;run mmcbootm;fi;echo Running default loadzimage ...;if run loadzimage; then if run l oadfdt; then run mmcbootz;fi;fi;fi;
')

whereas, in 2015.01, it's

$this->bbcode_second_pass_code('', '
setenv usb_need_init; setenv scsi_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
')

You'll notice the 2014.10 has "run importbootenv" which evaluates an environment variable "importbootenv" that is undefined on 2014.01 but defined on 2014.10 as

$this->bbcode_second_pass_code('', '
echo Importing environment from mmc (uEnv.txt)...; env import -t $loadaddr $filesize
')

So that's what loads uEnv.txt and it's clearly missing from the latest version. So I can only infer that the uEnv.txt is no longer supported by default (I can add similar code into boot.scr to achieve the same effect).

I'm just wondering if this is an omission or if it is intentional. It seems to be a big difference not to be documented anywhere given everything I can find describes configuring through that file.

Is there anyone that can offer any insight to this?
starfry
 
Posts: 24
Joined: Wed Jul 18, 2012 7:24 pm

Re: How to configure latest uboot 2015.01-1

Postby sehraf » Thu Jan 22, 2015 12:53 pm

$this->bbcode_second_pass_quote('starfry', 'I') believe the current way to configure it does not use uEnv.txt but instead you write "boot.txt" and generate "boot.scr" from it by running "mkscr". Is this correct? Is uEnv.txt no longer valid ?

that's correct and uEnv.txt is no longer needed.

$this->bbcode_second_pass_quote('starfry', 'I')f so, is there any documentation or guidance for boot.txt or how I should set boot arguments now?

im not aware of any documentation (though i guess there are some). As http://linux-sunxi.org/Mainline_U-boot#Boot points out you need the "setenv bootargs ... " command.

Regarding the display: Which kernel are you using? AFAIK the upstream U-Boot version does only support simplefb (the latest -rc kernel should be able to display something as long as you have simplefb enabled in u-boot and the kernel itself)
sehraf
 
Posts: 69
Joined: Mon Feb 03, 2014 10:06 pm

Re: How to configure latest uboot 2015.01-1

Postby starfry » Thu Jan 22, 2015 1:01 pm

I'm using the stock kernel

$this->bbcode_second_pass_code('', '
Linux alarm 3.4.103-5-ARCH #1 SMP PREEMPT Fri Jan 16 06:34:00 MST 2015 armv7l GNU/Linux
')

To get output from the display during the boot phase I modified "bootargs" in "boot.txt" (and, therefore, "boot.scr") to set it up:

$this->bbcode_second_pass_code('', '
setenv bootargs console=tty0 disp.screen0_output_mode=EDID:1024x768p60 console=${console} root=PARTUUID=${uuid} rw rootwait
')

To get output from the booted Linux system, I added two files (their names are irrelevant):

In "/etc/modules-load.d/hdmi.conf"
$this->bbcode_second_pass_code('', '
lcd
hdmi
')

and in "cat /etc/modprobe.d/disp.conf"
$this->bbcode_second_pass_code('', '
options disp screen0_output_mode=EDID:1024x768p60
')

That works for me. I've not gone beyond the command-line as it's only a server and I don't need a gui so I don't know if what I have done is sufficient for a more general use-case.
starfry
 
Posts: 24
Joined: Wed Jul 18, 2012 7:24 pm

Re: How to configure latest uboot 2015.01-1

Postby sehraf » Thu Jan 22, 2015 1:22 pm

I guess the old kernel is causing the problems.
But i'm not familiar with it and won't be able to help you with this :(

The options i see are
  • ask the linux-sunxi guys for help
  • downgrade u-boot
  • upgrade your kernel ( and hope that simplefb does work :mrgreen: )

I hope that i could help at least a bit
sehraf
sehraf
 
Posts: 69
Joined: Mon Feb 03, 2014 10:06 pm

Re: How to configure latest uboot 2015.01-1

Postby starfry » Thu Jan 22, 2015 1:55 pm

From my point of view this is solved, as I really wanted to clarify the change to the configuration of UBoot uEnv.txt / boot.scr and I think I have done that now.

Regarding the specifics of the display stuff, I am using the latest kernel that falls out of a "pacstrap" so "linux-sun7i" version 3.4.103-5. So, in the context of the environment that I am in (ArchLinuxARM on cubieboard2 (sun7i), it is the latest as of now. I concur, however, that it isn't an up to date kernel giiven the mainline (and ArchLinux for that matter) is on 3.18. Getting off topic really but it's interesting that there is such a vast range of kernel versions under ArchLinuxARM for the various different hardware boards.

For my own needs, I have what I need so I'll mark this as solved. :D
starfry
 
Posts: 24
Joined: Wed Jul 18, 2012 7:24 pm


Return to Allwinner

Who is online

Users browsing this forum: No registered users and 2 guests