Discussion:
Cubieboard4, u-boot, flash-kernel
(too old to reply)
Vagrant Cascadian
2015-12-28 22:50:01 UTC
Permalink
I'm trying to get a Cubieboard4 board booting.

It looks like the Cubieboard4 has support in mainline linux since at
least 4.2 (so should work with jessie-backports), but I can't find a
u-boot that will boot it...

I see that Karsten added a flash-kernel entry for it, but it isn't
supported in mainline u-boot or sunxi u-boot...

I'm wondering where to get a u-boot that'll work with the flash-kernel
entry, as it would be nice to not have to treat the Cubieboard4 as a
special snowflake with some ancient vendor u-boot that doesn't support
device trees and other features needed for modern kernels.

The images available at:

http://dl.cubieboard.org/model/cc-a80/Image/

Are running a vendor build of linux 3.4.x, and a u-boot fork based on
u-boot 2011.09:

https://github.com/cubieboard/CC-A80-u-boot


Any suggestions for troubleshooting would be much appreciated!


live well,
vagrant
Karsten Merker
2015-12-29 11:20:01 UTC
Permalink
Post by Vagrant Cascadian
I'm trying to get a Cubieboard4 board booting.
It looks like the Cubieboard4 has support in mainline linux since at
least 4.2 (so should work with jessie-backports), but I can't find a
u-boot that will boot it...
I see that Karsten added a flash-kernel entry for it, but it isn't
supported in mainline u-boot or sunxi u-boot...
I'm wondering where to get a u-boot that'll work with the flash-kernel
entry, as it would be nice to not have to treat the Cubieboard4 as a
special snowflake with some ancient vendor u-boot that doesn't support
device trees and other features needed for modern kernels.
Sorry for the confusion. IIRC somebody from #linux-sunxi had
mentioned that they had a build of mainline u-boot working on the
CC-A80, so I added the flash-kernel machine stanza when the
mainline kernel support was available.

Generic A80 support (Clocks, PIO, RSB, UART, MMC) is available in
mainline u-boot since v2015.07, but you are of course right - a
CC-A80-specific config has indeed not yet entered the mainline
u-boot git, so adding the flash-kernel stanza was probably a bit
premature.

Regards,
Karsten
--
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
Ian Campbell
2015-12-29 16:00:02 UTC
Permalink
Post by Vagrant Cascadian
Post by Vagrant Cascadian
I'm trying to get a Cubieboard4 board booting.
It looks like the Cubieboard4 has support in mainline linux since
at
Post by Vagrant Cascadian
least 4.2 (so should work with jessie-backports), but I can't find
a
Post by Vagrant Cascadian
u-boot that will boot it...
I see that Karsten added a flash-kernel entry for it, but it isn't
supported in mainline u-boot or sunxi u-boot...
I'm wondering where to get a u-boot that'll work with the flash
-kernel
Post by Vagrant Cascadian
entry, as it would be nice to not have to treat the Cubieboard4 as
a
Post by Vagrant Cascadian
special snowflake with some ancient vendor u-boot that doesn't
support
Post by Vagrant Cascadian
device trees and other features needed for modern kernels.
Sorry for the confusion. IIRC somebody from #linux-sunxi had
mentioned that they had a build of mainline u-boot working on the
CC-A80, so I added the flash-kernel machine stanza when the
mainline kernel support was available.
Generic A80 support (Clocks, PIO, RSB, UART, MMC) is available in
mainline u-boot since v2015.07, but you are of course right - a
CC-A80-specific config has indeed not yet entered the mainline
u-boot git, so adding the flash-kernel stanza was probably a bit
premature.
I'd expect that a pretty trivial modification to
configs/Merrii_A80_Optimus_defconfig (to switch the
CONFIG_DEFAULT_DEVICE_TREE option over) would result in something
useful, but I've not tried it (need to setup my CB4, apply h/sink etc).

Posting on linux-sunxi and/or the u-boot list might result in further
insights.

Ian.
Vagrant Cascadian
2016-01-11 21:00:03 UTC
Permalink
Post by Ian Campbell
Post by Karsten Merker
Post by Vagrant Cascadian
I'm trying to get a Cubieboard4 board booting.
It looks like the Cubieboard4 has support in mainline linux since
at
Post by Vagrant Cascadian
least 4.2 (so should work with jessie-backports), but I can't find
a
Post by Vagrant Cascadian
u-boot that will boot it...
...
Post by Ian Campbell
Post by Karsten Merker
Generic A80 support (Clocks, PIO, RSB, UART, MMC) is available in
mainline u-boot since v2015.07, but you are of course right - a
CC-A80-specific config has indeed not yet entered the mainline
u-boot git, so adding the flash-kernel stanza was probably a bit
premature.
I'd expect that a pretty trivial modification to
configs/Merrii_A80_Optimus_defconfig (to switch the
CONFIG_DEFAULT_DEVICE_TREE option over) would result in something
useful, but I've not tried it (need to setup my CB4, apply h/sink etc).
I gave this a quick try, but it wouldn't build an SPL image, and the
image it did built didn't work with whatever SPL was already
on-board. I may just not have the right offsets, though.
Post by Ian Campbell
Posting on linux-sunxi and/or the u-boot list might result in further
insights.
Haven't followed up there yet, other than a few queries in IRC...


live well,
vagrant
ibu ☉ radempa
2016-02-14 19:30:02 UTC
Permalink
Post by Vagrant Cascadian
Post by Ian Campbell
Post by Karsten Merker
Post by Vagrant Cascadian
I'm trying to get a Cubieboard4 board booting.
It looks like the Cubieboard4 has support in mainline linux since
at
Post by Vagrant Cascadian
least 4.2 (so should work with jessie-backports), but I can't find
a
Post by Vagrant Cascadian
u-boot that will boot it...
...
Post by Ian Campbell
Post by Karsten Merker
Generic A80 support (Clocks, PIO, RSB, UART, MMC) is available in
mainline u-boot since v2015.07, but you are of course right - a
CC-A80-specific config has indeed not yet entered the mainline
u-boot git, so adding the flash-kernel stanza was probably a bit
premature.
I'd expect that a pretty trivial modification to
configs/Merrii_A80_Optimus_defconfig (to switch the
CONFIG_DEFAULT_DEVICE_TREE option over) would result in something
useful, but I've not tried it (need to setup my CB4, apply h/sink etc).
I gave this a quick try, but it wouldn't build an SPL image, and the
image it did built didn't work with whatever SPL was already
on-board. I may just not have the right offsets, though.
I've also tried booting a current u-boot from sdmmc, but without success
(NB: I've almost no experience with u-boot): I've compiled (on a 2nd CB4
running Cubietech's wheezy server image) a current u-boot (commit
077678eb0c226e52a1f90edabd3369ab26065b32, 2016-01-12) with
make distclean
make Cubieboard4_config
make all
where I've created a file configs/Cubieboard4_defconfig in advance with
these contents:
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_MACH_SUN9I=y
CONFIG_DRAM_CLK=360
CONFIG_DRAM_ZQ=123
CONFIG_SYS_CLK_FREQ=1008000000
CONFIG_MMC0_CD_PIN="PH18"
# CONFIG_VIDEO is not set
CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-cubieboard4"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_CMD_GPIO=y
CONFIG_SYS_NS16550=y

Experimenting for quite some time I've learnt a few things:

* When putting u-boot.bin onto to sdmmc at offset 8k the system boots
from NAND instead. (I guess the ROM expects the 'eGON.BT0' byte sequence
at 8196.)

* So I copied the first 25MB of cubietech's (installed&running) server
image. At offset 8k it has the boot0 code (less than 32k). (See
https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/boot0).

* The next storage area on the sdmmc (40k+) is not used for u-boot (
I can 'dd if=/dev/zero of=/dev/sda bs=1024 seek=40 count=300' and still
load Cubietech's u-boot-sunxi).

* In fact, at offset 19096k on the sdmmc (38192 sectors, cf.
BOOT1_START_SECTOR_IN_SDMMC in
https://github.com/allwinner-zh/bootloader/blob/master/basic_loader/bsp/bsp_for_a80/include/interinc/spare_head.h)
we find a 'uboot_file_head' (same link) comprising a
'spare_boot_ctrl_head' and a 'spare_boot_data_head' of size 1280 bytes
prepended to a u-boot.bin .

* When I replace this u-boot.bin (at offset 0x12A6500) with my
self-compiled current u-boot and adjust the checksum in
'spare_boot_ctrl_head' (which boot0 checks before 'Jump to secend
Boot.'), then nothing happens on the serial console after boot0 executes
the jump.

At this point I'm stuck. I've no idea how to debug u-boot (without JTAG
and without experience).

Using Cubietech's u-boot-sunxi I've also verified that the
uboot_file_head with subsequent u-boot get's loaded into RAM at
0x2a000000 (which ist different from the other allwinner SOCs where it
is 0x4a000000).

I hope you or somebody else can make use of this information.
If I can contribute anything, please let me know.

Let me also use this occasion to thank you all for your work. I'm a very
happy user of debian on a few cubieboards (and otherwise too), one of
them being a cubietruck to which my keyboard and mouse are connected.

Regards, ibu

Loading...