Booting alternate kernels 4.6~4.7

umiddelb
Posts: 451
Joined: Thu Jan 29, 2015 6:42 am
languages_spoken: English, German
ODROIDs: ODROID-C1, ODROID-XU4, ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by umiddelb » Wed Jun 29, 2016 2:31 pm

brad wrote:...
Now going to try to boot the hardkernel 3.14.x kernel from new u-boot
And ... does it boot the 3.14 HK kernel?

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Wed Jun 29, 2016 4:33 pm

umiddelb wrote:And ... does it boot the 3.14 HK kernel?
No all my attempts so far have failed but I cannot see immediate any clues as to why. I plan to enable debug in u-boot to try to work out what the error is and if I were a betting man all my money would be on a memory alignment issue - Same reason I cannot start 4.x kernel from hardkernel u-boot.

Couple of things on my list to check now are

- Hardkernel U-boot source to see how it loads the Image
- Hard-kernel kernel Makefile to see how it installed the image
- Compiler issues (Currently I compile new u-boot with a gnu 5.3 tool chain, hardkernel is done with a 4.9 elf)
- booting different format of image ie zImage using bootz

I am also going to look into maybe keeping the original u-boot and have it boot into the new u-boot to load newer kernels, this may be the most compatible solution if its possible.

If I can confirm the structure of the u-boot default environment I/we can think about how to incorporate u-571

umiddelb
Posts: 451
Joined: Thu Jan 29, 2015 6:42 am
languages_spoken: English, German
ODROIDs: ODROID-C1, ODROID-XU4, ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by umiddelb » Fri Jul 08, 2016 3:31 am

@brad
Would you mind sharing the u-boot.bin, you've used to boot the mainline kernel. My attempts to 'handcraft' it haven't been successful so far.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Fri Jul 08, 2016 5:46 pm

no worries at all, built frpm the mmc version from BlueMatt's git..
https://github.com/TheBlueMatt/u-boot

Trusted firmware scripts used come from the hardkernel u-boot source tree which can be found here...
https://github.com/hardkernel/u-boot/tr ... 2-v2015.01

I now notice that the fip directory has been updated in hardkernel source at this commit https://github.com/hardkernel/u-boot/co ... 0ec07b1a4e
The fip directory I have used was taken from an earlier version than this commit and I have not tested with the new fip_create to create the image.

Attached file was taken from the sd_fuse directory (ie the version that is written to the sd/mmc) that is used by sd_fuse.sh.

renamed to a txt extension to upload.
Attachments
u-boot.txt
u-boot.bin mmc
(512 KiB) Downloaded 164 times

umiddelb
Posts: 451
Joined: Thu Jan 29, 2015 6:42 am
languages_spoken: English, German
ODROIDs: ODROID-C1, ODROID-XU4, ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by umiddelb » Mon Jul 11, 2016 12:21 am

Hi @brad

thank you very much. At least I have a working u-boot shell now and I was able to boot the 4.7-rc4 kernel. Unfortunately the kernel panics before I get a chance to log in ...

Code: Select all

[   61.570845] Bad mode in Synchronous Abort handler detected on CPU0, code 0x86000006 -- IABT (current EL)
[   61.574683] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.7.0-rc4+ #3
[   61.580874] Hardware name: Hardkernel ODROID-C2 (DT)
[   61.585791] task: ffffff8008c1da80 ti: ffffff8008c10000 task.ti: ffffff8008c10000
[   61.593216] PC is at 0x0
[   61.595714] LR is at stmmac_interrupt+0x16c/0x200
[   61.600366] pc : [<0000000000000000>] lr : [<ffffff800858e904>] pstate: 400001c5
[   61.607703] sp : ffffffc07f78ceb0
[   61.610974] x29: ffffffc07f78ceb0 x28: ffffff8008d0b000 
[   61.616232] x27: ffffffc078caf000 x26: ffffff8008d0b000 
[   61.621493] x25: ffffff8008c15b68 x24: ffffff8008d0bc60 
[   61.626754] x23: 0000000000000000 x22: 0000000000000000 
[   61.632016] x21: ffffffc05fbd0c00 x20: ffffffc05fbd0880 
[   61.637277] x19: ffffffc05fbd0000 x18: 0000000000008090 
[   61.642538] x17: 0000007f841aa9a0 x16: ffffff8008223658 
[   61.647799] x15: 0000000000008088 x14: 0000000000008140 
[   61.653061] x13: 0000000000008130 x12: 0000000000008138 
[   61.658322] x11: 0000000000008128 x10: 0000000000000900 
[   61.663583] x9 : ffffff8008c10000 x8 : 0000000000000040 
[   61.668844] x7 : 0000000000000000 x6 : ffffffc078800000 
[   61.674106] x5 : ffffffc078caf000 x4 : 0000000000000001 
[   61.679367] x3 : 0000000000000000 x2 : 0000000000000000 
[   61.684628] x1 : 0000000000000000 x0 : ffffff8008e60000 
[   61.689889] 
[   61.691360] Internal error: Oops - bad mode: 0 [#1] PREEMPT SMP
[   61.697226] Modules linked in: fuse crc32_arm64 ipv6 autofs4
[   61.702828] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.7.0-rc4+ #3
[   61.709042] Hardware name: Hardkernel ODROID-C2 (DT)
[   61.713958] task: ffffff8008c1da80 ti: ffffff8008c10000 task.ti: ffffff8008c10000
[   61.721381] PC is at 0x0
[   61.723875] LR is at stmmac_interrupt+0x16c/0x200
[   61.728534] pc : [<0000000000000000>] lr : [<ffffff800858e904>] pstate: 400001c5
[   61.735870] sp : ffffffc07f78ceb0
[   61.739140] x29: ffffffc07f78ceb0 x28: ffffff8008d0b000 
[   61.744399] x27: ffffffc078caf000 x26: ffffff8008d0b000 
[   61.749660] x25: ffffff8008c15b68 x24: ffffff8008d0bc60 
[   61.754922] x23: 0000000000000000 x22: 0000000000000000 
[   61.760183] x21: ffffffc05fbd0c00 x20: ffffffc05fbd0880 
[   61.765444] x19: ffffffc05fbd0000 x18: 0000000000008090 
[   61.770705] x17: 0000007f841aa9a0 x16: ffffff8008223658 
[   61.775967] x15: 0000000000008088 x14: 0000000000008140 
[   61.781228] x13: 0000000000008130 x12: 0000000000008138 
[   61.786489] x11: 0000000000008128 x10: 0000000000000900 
[   61.791750] x9 : ffffff8008c10000 x8 : 0000000000000040 
[   61.797012] x7 : 0000000000000000 x6 : ffffffc078800000 
[   61.802273] x5 : ffffffc078caf000 x4 : 0000000000000001 
[   61.807534] x3 : 0000000000000000 x2 : 0000000000000000 
[   61.812795] x1 : 0000000000000000 x0 : ffffff8008e60000 
[   61.818056] 
[   61.819525] Process swapper/0 (pid: 0, stack limit = 0xffffff8008c10020)
[   61.826171] Stack: (0xffffffc07f78ceb0 to 0xffffff8008c14000)
[   61.831862] Call trace:
[   61.834275] [<          (null)>]           (null)
[   61.838939] [<ffffff8008113eb4>] handle_irq_event_percpu+0x74/0x2a8
[   61.845146] [<ffffff8008114138>] handle_irq_event+0x50/0x80
[   61.850666] [<ffffff8008117ccc>] handle_fasteoi_irq+0xdc/0x1e0
[   61.856445] [<ffffff800811326c>] generic_handle_irq+0x34/0x50
[   61.862137] [<ffffff8008113614>] __handle_domain_irq+0x8c/0x100
[   61.868003] [<ffffff8008081504>] gic_handle_irq+0x6c/0xc8
[   61.873348] Exception stack(0xffffff8008c13dd0 to 0xffffff8008c13ef0)
[   61.879732] 3dc0:                                   0000000000000000 ffffff8008a5b440
[   61.887500] 3de0: 0000000000000001 0100000000000000 0000002791edb800 ffffff8008d9e1f0
[   61.895263] 3e00: 002aea540610bc00 0000000e4b1a7932 00000000ffff16f7 ffffff8008c10000
[   61.903025] 3e20: 0000000000000900 0000000000008128 0000000000008138 0000000000008130
[   61.910788] 3e40: 0000000000008140 0000000000008088 ffffff8008223658 0000007f841aa9a0
[   61.918550] 3e60: 0000000000008090 ffffff8008d0c778 ffffff8008d0c000 0000000000000000
[   61.926312] 3e80: ffffff8008d0c000 0000000000000000 0000000000000000 ffffff8008be9320
[   61.934075] 3ea0: ffffff8008c10000 ffffff8008c15000 ffffff8008a39000 ffffff8008c13ef0
[   61.941838] 3ec0: ffffff8008085818 ffffff8008c13ef0 ffffff800808581c 0000000060000145
[   61.949599] 3ee0: ffffff8008c13ef0 ffffff8008085804
[   61.954424] [<ffffff8008084720>] el1_irq+0xa0/0x10c
[   61.959255] [<ffffff800808581c>] arch_cpu_idle+0x3c/0x190
[   61.964604] [<ffffff800810345c>] cpu_startup_entry+0x294/0x350
[   61.970383] [<ffffff800886fb78>] rest_init+0x88/0x98
[   61.975299] [<ffffff8008b40b5c>] start_kernel+0x370/0x384
[   61.980645] [<ffffff8008b401c4>] __primary_switched+0x30/0x6c
[   61.986338] Code: bad PC value
[   61.989369] ---[ end trace 79fc3f00085767bf ]---
[   61.993933] Kernel panic - not syncing: Fatal exception in interrupt
[   62.000223] SMP: stopping secondary CPUs
[   62.004106] Kernel Offset: disabled
[   62.007551] Memory Limit: none
[   62.010571] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
@BlueMatt
The current configuration for the C2 doesn't include the capability to store the working u-boot environment on the MMC (most notably due to the setting `CONFIG_ENV_IS_NOWHERE`). I don't know if there is a reason for this.

BlueMatt
Posts: 14
Joined: Sun Jun 19, 2016 1:44 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by BlueMatt » Mon Jul 11, 2016 7:43 am

The stmmac_interrupt crash you see is only there when your ethernet is hooked up on a gigabit line (switch to 100M and it wont crash). In 4.7-rc7 is shouldn't crash, but I dont think 1G eth will work yet.

re: u-boot conf: I'm not aware of any reason for it either, would probably be fine to replace that.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Mon Jul 11, 2016 9:15 pm

BlueMatt wrote:The stmmac_interrupt crash you see is only there when your ethernet is hooked up on a gigabit line (switch to 100M and it wont crash).
Yes sorry for not making this more known in this thread!

A month or so ago I brought new giga switch to replace the 100Mib one I had connected to the C2, at the time I was testing NFS with the 3.14.y kernel which worked wonderfully!

I went back to booting 4.x kernels (with my new 1Gbit switch) and failed, rebuilt in every possible way using new versions and previous versions that used to work for me.

After 24 hours solid of configuring, building and booting I came to the conclusion than the only thing I had changed was the switch. I though it silly to think that was my issue but spent the 2 mins putting the 100Mbit back on place and Wollah!

I have more grey hairs now I believe so to prevent any more people from going through this a warning....

1Gb networking may have unpredictable boot results on the 4.x kernels are the moment, for best results use a 100Mib switch for now!!!

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Mon Jul 18, 2016 8:19 pm

Some more work merging through linux-next for amlogic and gxbb...
https://git.kernel.org/cgit/linux/kerne ... 5d62647e34

moon.linux
Posts: 1171
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by moon.linux » Thu Aug 04, 2016 5:40 am

Hi Brad,

Thanks for your inputs on update on new u-boot for 4.x kernel.

But I initially I got confuse with all the process of build the mainline u-boot,
so I have tried to write a script base on README from u-boot mainline.

Below is the script.

Code: Select all

#!/bin/bash
set -x #echo on
export CROSS_COMPILE=/opt/toolchains/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export ARCH=arm64

echo -n "---build mainline uboot for odroid c2 ----"
UMLDIR=u-boot-main
git clone git://git.denx.de/u-boot.git $UMLDIR
cd $UMLDIR
make distclean
make odroid-c2_defconfig
make -j4
cd ..

echo -n "---build hardkernel uboot for odroid c2 ----"
HKDIR=odroid-c2
git clone --depth 1 \
       https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 \
       $HKDIR
cd $HKDIR
make distclean
make odroidc2_config
make -j4
cd ..

$HKDIR/fip/fip_create --bl30  $HKDIR/fip/gxb/bl30.bin \
                       --bl301 $HKDIR/fip/gxb/bl301.bin \
                       --bl31  $HKDIR/fip/gxb/bl31.bin \
                       --bl33  $UMLDIR/u-boot.bin \
                       $HKDIR/fip.bin
$HKDIR/fip/fip_create --dump $HKDIR/fip.bin
cat $HKDIR/fip/gxb/bl2.package $HKDIR/fip.bin > $HKDIR/boot_new.bin
$HKDIR/fip/gxb/aml_encrypt_gxb --bootsig \
                                --input $HKDIR/boot_new.bin \
                                --output $UMLDIR/u-boot.img
dd if=$UMLDIR/u-boot.img of=$UMLDIR/u-boot.gxbb bs=512 skip=96

# Note update your sdcard according
DEV=/dev/sdb
BL1=$HKDIR/sd_fuse/bl1.bin.hardkernel
sudo dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
sudo dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
sudo dd if=$UMLDIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
Edited : CROSS_COMPILE and ARCH need to exported.

I need to test tftp booting up so that I could run time test the driver if their is crash.
Below is the output of the u-boot.

Code: Select all

INFO:    PSCI Affinity Map:
INFO:      AffInst: Level 0, MPID 0x0, State ON
INFO:      AffInst: Level 0, MPID 0x1, State OFF
INFO:      AffInst: Level 0, MPID 0x2, State OFF
INFO:      AffInst: Level 0, MPID 0x3, State OFF
bl31 reb▒GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:0;
TE: 110077
no sdio debug board detected

BL2 Built : 11:44:26, Nov 25 2015.
gxb gfb13a3b-c2 - jcao@wonton

Board ID = 8
set vcck to 1100 mv
set vddee to 1050 mv
CPU clk: 1536MHz
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK.
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000017c0
Wait bl30...Done
Sending bl301......OK.
Run bl301...
l31 from SD, src: 0x00020200, des: 0x10100000, size: 0x00011130


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_v1.1.3046-00db630 2015-10-28 15:24:31 xiaobo.gu@droid05]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: ef be adLoad bl33 from SD, src: 0x00034200, des: 0x01000000, size: 0x00036dc0
 de d f0 ad ba ef be ad de not ES chip
[0.224494 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):4d2e34d
NOTICE:  BL3-1: Built : 17:08:35, Oct 29 2015
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9
No match for driver 'eth_designware'
Some drivers were not found


U-Boot 2016.09-rc1-00245-gad6a303 (Aug 04 2016 - 01:36:32 +0530) odroid-c2

DRAM:  2 GiB
No maUsing default environment

In:    serial@4c0
Out:   serial@4c0
Err:   serial@4c0
Net:   No ethernet found.
=>
Attach is the script.
If you find some thing wrong please let me know.
Attachments
u-boot-mainlinec2.sh
build and install u-boot mainline.
(1.47 KiB) Downloaded 117 times
Last edited by moon.linux on Thu Aug 04, 2016 5:25 pm, edited 1 time in total.

moon.linux
Posts: 1171
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by moon.linux » Thu Aug 04, 2016 10:56 am

Hi Brad,
No all my attempts so far have failed but I cannot see immediate any clues as to why. I plan to enable debug in u-boot to try to work out what the error is and if I were a betting man all my money would be on a memory alignment issue - Same reason I cannot start 4.x kernel from hardkernel u-boot.

Couple of things on my list to check now are

- Hardkernel U-boot source to see how it loads the Image
- Hard-kernel kernel Makefile to see how it installed the image
- Compiler issues (Currently I compile new u-boot with a gnu 5.3 tool chain, hardkernel is done with a 4.9 elf)
- booting different format of image ie zImage using bootz

I am also going to look into maybe keeping the original u-boot and have it boot into the new u-boot to load newer kernels, this may be the most compatible solution if its possible.

If I can confirm the structure of the u-boot default environment I/we can think about how to incorporate u-571
u-boot mainline do not set the CONFIG_EXTRA_ENV_SETTINGS option in u-boot/include/config/odroid-c2.h
For example.
http://git.denx.de/?p=u-boot.git;a=blob ... 3d5fe#l107

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Sat Aug 06, 2016 9:18 am

Hi moon.linux, thanks for your efforts on the script looks good and I will test this weekend.

I will also do some testing with the CONFIG_EXTRA_ENV_SETTINGS options.

Cheers, Brad

moon.linux
Posts: 1171
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by moon.linux » Sat Aug 06, 2016 2:12 pm

Hi Brad,

I just want to boot with tftp setting. could you share what need to be enabled for that in the u-boot.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Sat Aug 06, 2016 2:19 pm

Some more changes in Kevin Hilman's amlogic git within the 4.7 integration branch, see log...

https://git.kernel.org/cgit/linux/kerne ... v4.7/integ

sd is now working nicely, and I am going to test the mmc performance now. Still having problems with gigabit Ethernet which I will also look into.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Sat Aug 06, 2016 2:31 pm

moon.linux wrote:Hi Brad,

I just want to boot with tftp setting. could you share what need to be enabled for that in the u-boot.
you can use a snapshot of u-boot prior to this commit http://git.denx.de/?p=u-boot.git;a=comm ... bc2d5b9143 as this was when Ethernet was disabled for further development. Note this has no support for mmc or sdcard only ethernet and loading kernel images from a tftp server.

This snapshot works well for me http://git.denx.de/?p=u-boot.git;a=snap ... 153;sf=tgz

Should have Ethernet working by default and the tftp client enabled after running the defconfig if not make menuconfig and select it under the commands tftp

bleedingedge
Posts: 6
Joined: Sun Apr 10, 2016 3:20 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by bleedingedge » Wed Aug 10, 2016 1:43 pm

Have anyone successfully done 4.7 or 4.8 rc-1?

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Thu Aug 11, 2016 3:43 pm

bleedingedge wrote:Have anyone successfully done 4.7 or 4.8 rc-1?
4.7 is working fine but no mmc support in the stable release
4.8-rc1 should have the mmc drivers enabled (I have not tested as yet)

The 4.7/integ branch in Kevin Hilmans amlogic git is a good place to start if you are looking for a version to test with including mmc.

xxxbugxxxx
Posts: 10
Joined: Thu May 05, 2016 5:50 pm
languages_spoken: english
ODROIDs: c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by xxxbugxxxx » Sat Aug 20, 2016 1:25 pm

http://www.cnx-software.com/2016/08/19/ ... droid-7-0/

Amlogic has just released buildroot with Linux 3.14 with support for Amlogic S905X (p212 board), S905D (p230 board), and S912 (Q200 board) processors, and the company appears to have started working on Linux 4.4 likely for future support for Android 7.0.

Seems this maybe helpful?

ip4368
Posts: 11
Joined: Wed Apr 27, 2016 10:18 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by ip4368 » Sat Aug 20, 2016 9:25 pm

Would anyone briefly explain(detail explanation is appreciated) what need to be done to run kernel 4.7 or even 4.8?
I know that we need to update the uboot first, before 4.7/4.8 is bootable.
I have downloaded the .sh file above and try to update the uboot on the sd card, but seems like it is not working, it can't even boot kernel 3.14
So i haven't try applying new kernels to it.

and i have no idea where is the uboot log located, would anyone mind telling me where can i find the uboot log? thanks

User avatar
memeka
Posts: 4415
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 57 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by memeka » Sat Aug 20, 2016 10:28 pm

ip4368 wrote:Would anyone briefly explain(detail explanation is appreciated) what need to be done to run kernel 4.7 or even 4.8?
I know that we need to update the uboot first, before 4.7/4.8 is bootable.
I have downloaded the .sh file above and try to update the uboot on the sd card, but seems like it is not working, it can't even boot kernel 3.14
So i haven't try applying new kernels to it.

and i have no idea where is the uboot log located, would anyone mind telling me where can i find the uboot log? thanks
you realize that on kernel 4.7 not even the SD-card is working, right? Those using kernel 4.7 are booting the C2 from network file system. If you don't have a root filesystem on a network server, you'll just boot to an error message. Oh and the ethernet needs to be set to 100mb/s, or else it won't work.
also, on 4.8, you might get sd-card working (so you can boot the entire system from sd-card, no need for network-boot), but there's no USB drivers, no HDMI, GPU, VPU, sound, GPIO, etc drivers. So you won't get anything on screen, you need a serial adapter to connect to the odroid.

KARL23
Posts: 15
Joined: Sun Jun 26, 2016 10:59 pm
languages_spoken: english
ODROIDs: c1, c2,xu4
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by KARL23 » Tue Aug 30, 2016 12:06 am


sjuut
Posts: 2
Joined: Thu Jan 08, 2015 5:23 pm
languages_spoken: english
ODROIDs: ODROID C1
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by sjuut » Tue Aug 30, 2016 12:16 am

Would that apply to C1 as well?

BlueMatt
Posts: 14
Joined: Sun Jun 19, 2016 1:44 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by BlueMatt » Wed Aug 31, 2016 11:18 pm

sjuut wrote:Would that apply to C1 as well?
C1 is completely different hardware, so, no, this work does not apply at all to C1. (thought C1 might work, I have no idea).

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Fri Sep 02, 2016 7:43 am

memeka wrote: you realize that on kernel 4.7 not even the SD-card is working, right? Those using kernel 4.7 are booting the C2 from network file system. If you don't have a root filesystem on a network server, you'll just boot to an error message. Oh and the ethernet needs to be set to 100mb/s, or else it won't work.
also, on 4.8, you might get sd-card working (so you can boot the entire system from sd-card, no need for network-boot), but there's no USB drivers, no HDMI, GPU, VPU, sound, GPIO, etc drivers. So you won't get anything on screen, you need a serial adapter to connect to the odroid.
4.7 mmc was working with patches applied, and 4.8 mmc / sd works. I have only been able to boot the kernel on mmc/sd with the new version of u-boot, hardkernel version of u-boot (for me) always fails to mount the root filesystem although it boots the kernel. I suspect has to do with differences in the device tree's

There are some now some development patches now floating around for USB support on both controllers but I have yet to try them as let.

umiddelb
Posts: 451
Joined: Thu Jan 29, 2015 6:42 am
languages_spoken: English, German
ODROIDs: ODROID-C1, ODROID-XU4, ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by umiddelb » Fri Sep 02, 2016 2:47 pm

brad wrote: ... I have only been able to boot the kernel on mmc/sd with the new version of u-boot, hardkernel version of u-boot (for me) always fails to mount the root filesystem although it boots the kernel. I suspect has to do with differences in the device tree's
I was able to boot a 4.8 mainline kernel (supporting both mmc and sd) with HK's u-boot, but I experience strange network freezes/time outs.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Sun Sep 11, 2016 8:50 pm

U-boot master branch now has odroid-c2 ethernet support which I have tested working, mmc support is not available yet without patching.

4.8-next kernel also has a few additions from my last update including..

- emmc, sd card and sdio support
- Infrared remote controller
- AO clock controller
- Secure monitor driver
- Message handeling Unit mailbox
- PWM driver
- efuse/nvmem

Ive also tested patches enabling SCPI, DVFS, cpufreq, mailbox and sensors which is working (temp from sensors is out of scale)

Patches have also been submitted for one of the USB controllers, SPI, SPI Flash Controller & various other cleanups.

Im still having issues with Gigabit Ethernet, 100Mbit still working fine

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Wed Nov 30, 2016 2:05 am

Greetings,

can anyone sum up what will work if one boots latest git uboot and latest official released kernel?

Thanks.

mscdex
Posts: 74
Joined: Sun Jan 04, 2015 11:09 am
languages_spoken: english
ODROIDs: ODROID C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by mscdex » Wed Nov 30, 2016 6:47 am

daggs wrote:Greetings,

can anyone sum up what will work if one boots latest git uboot and latest official released kernel?

Thanks.
See this thread for discussion about the status of the latest mainline kernels on the C2.

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Tue Dec 06, 2016 2:50 am

mscdex wrote:
daggs wrote:Greetings,

can anyone sum up what will work if one boots latest git uboot and latest official released kernel?

Thanks.
See this thread for discussion about the status of the latest mainline kernels on the C2.
thanks.

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Tue Jan 10, 2017 3:27 pm

has anyone tried to boot the offical hk kernel tree with uboot 2017.1?
I see c2 related patches in the tree but when I connect it to power, I see this on my serial:

Code: Select all

GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:F3;USB:8;LOOP:1;EMMC:800;NAND:81;SD:0;;
is it possible that sd support is missing in uboot 2017.1? if so, where can I find patches that supports sd boot?

Thanks.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Thu Jan 12, 2017 2:58 pm

Hi daggs,
yes sd / mmc support is missing. BlueMatts git is working and contains patches for sd / mmc

https://github.com/TheBlueMatt/u-boot/commits/master

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Thu Jan 12, 2017 11:14 pm

brad wrote:Hi daggs,
yes sd / mmc support is missing. BlueMatts git is working and contains patches for sd / mmc

https://github.com/TheBlueMatt/u-boot/commits/master
Greetings Brad,

I've went and ported the diff to 2017.01, it gets compiled well with buildroot but I get the same behaviour.
here is the patch, am I missing something? I'm using sd.
Attachments
0001-add_meson_MMC_driver.patch.gz
meson mmc driver for uboot-2017.01
(4.02 KiB) Downloaded 87 times

moon.linux
Posts: 1171
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by moon.linux » Fri Jan 13, 2017 3:09 am

You cannot cross compile on Odroid C2 u-boot as it requires X86 binary aml_encrypt_gxb to create secure u-boot loader.
Please find this thread for more details. http://forum.odroid.com/viewtopic.php?f=135&t=21922

Did you tried following steps.
http://odroid.com/dokuwiki/doku.php?id= ... 1_firmware

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Fri Jan 13, 2017 4:03 am

moon.linux wrote:You cannot cross compile on Odroid C2 u-boot as it requires X86 binary aml_encrypt_gxb to create secure u-boot loader.
Please find this thread for more details. http://forum.odroid.com/viewtopic.php?f=135&t=21922

Did you tried following steps.
http://odroid.com/dokuwiki/doku.php?id= ... 1_firmware
I didn't said I'm cross compiling on the odroid.
I'm saying I use buildroot on my desktop to generate a working odroidc2 image.

moon.linux
Posts: 1171
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by moon.linux » Fri Jan 13, 2017 5:08 am

I have not tried this steps yet but HK have change the building of secure u-boot.

Code: Select all

git clone git://git.denx.de/u-boot.git
cd u-boot
git checkout tags/v2016.11-rc3
(Download 0001-mmc-meson-Add-meson-gxbb-mmc-driver.patch and copy the file to u-boot directory.)
git am 0001-mmc-meson-Add-meson-gxbb-mmc-driver.patch
make odroid-c2_defconfig
make -j8

Burining
export DIR=odroid-c2
git clone --depth 1 https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 $DIR
$DIR/fip/fip_create --bl30 $DIR/fip/gxb/bl30.bin --bl301 $DIR/fip/gxb/bl301.bin --bl31 $DIR/fip/gxb/bl31.bin --bl33 u-boot.bin $DIR/fip.bin
$DIR/fip/fip_create --dump $DIR/fip.bin
cat $DIR/fip/gxb/bl2.package $DIR/fip.bin > $DIR/boot_new.bin
$DIR/fip/gxb/aml_encrypt_gxb --bootsig \
--input $DIR/boot_new.bin \
--output $DIR/u-boot.img
sudo dd if=$DIR/u-boot.img of=$DIR/u-boot.gxbb bs=512 skip=96
export DEV=/dev/sdc
BL1=$DIR/sd_fuse/bl1.bin.hardkernel
sudo dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
sudo dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
sudo dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
sudo sync
sudo eject $DEV
These are some old command please try these steps and see if it works.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Fri Jan 13, 2017 6:06 am

Yes I think maybe buildroot is only writing the secure firmware to the image and not the uboot component (or at least not booting the uboot)

would be interested to see if scripting the above burning commands into the buildroot. It should hopefully be able to download the arm firmware and tools from hardkernel and use the tools to build and sign the uboot blob.

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Fri Jan 13, 2017 7:13 pm

moon.linux wrote:I have not tried this steps yet but HK have change the building of secure u-boot.

Code: Select all

git clone git://git.denx.de/u-boot.git
cd u-boot
git checkout tags/v2016.11-rc3
(Download 0001-mmc-meson-Add-meson-gxbb-mmc-driver.patch and copy the file to u-boot directory.)
git am 0001-mmc-meson-Add-meson-gxbb-mmc-driver.patch
make odroid-c2_defconfig
make -j8

Burining
export DIR=odroid-c2
git clone --depth 1 https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 $DIR
$DIR/fip/fip_create --bl30 $DIR/fip/gxb/bl30.bin --bl301 $DIR/fip/gxb/bl301.bin --bl31 $DIR/fip/gxb/bl31.bin --bl33 u-boot.bin $DIR/fip.bin
$DIR/fip/fip_create --dump $DIR/fip.bin
cat $DIR/fip/gxb/bl2.package $DIR/fip.bin > $DIR/boot_new.bin
$DIR/fip/gxb/aml_encrypt_gxb --bootsig \
--input $DIR/boot_new.bin \
--output $DIR/u-boot.img
sudo dd if=$DIR/u-boot.img of=$DIR/u-boot.gxbb bs=512 skip=96
export DEV=/dev/sdc
BL1=$DIR/sd_fuse/bl1.bin.hardkernel
sudo dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
sudo dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
sudo dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
sudo sync
sudo eject $DEV
These are some old command please try these steps and see if it works.
will do, thanks.

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Fri Jan 13, 2017 9:38 pm

ok, I'm making progress:

Code: Select all

GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:0;
TE: 310864
no sdio debug board detected 

BL2 Built : 11:44:26, Nov 25 2015. 
gxb gfb13a3b-c2 - jcao@wonton

Board ID = 8
set vcck to 1100 mv
set vddee to 1050 mv
CPU clk: 1536MHz
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK. 
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000012d0
Wait bl30...Done
Sending bl301.....OK. 
Run bl301...
d bl31 from SD, src: 0x00020200, des: 0x10100000, size: 0x00011130


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@droid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: ef be ad de d fLoad bl33 from SD, src: 0x00034200, des: 0x01000000, size: 0x0004b2d0
0 ad ba ef be ad de not ES chip
[0.425455 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):4d2e34d
NOTICE:  BL3-1: Built : 17:08:35, Oct 29 2015
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2017.01 (Jan 12 2017 - 14:42:13 +0200) odroid-c2

DRAM:  2 GiB
MMC:   <NULL>: 0
Using default environment

In:    serial@4c0
Out:   serial@4c0
Err:   serial@4c0
Net:   eth0: ethernet@c9410000
=> 
=> 
when I try to run booti in that shell, I get this:

Code: Select all

=> booti
Bad Linux ARM64 Image magic!
ideas?

moon.linux
Posts: 1171
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by moon.linux » Sat Jan 14, 2017 1:44 am

use bootm instead of booti
you have to set the command manually or look into OdroidC2 environment variables.

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Sat Jan 14, 2017 4:10 am

moon.linux wrote:use bootm instead of booti
you have to set the command manually or look into OdroidC2 environment variables.
shouldn't boot.ini enter here? is this code deletes it from the boot?

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Sat Jan 14, 2017 4:21 am

when pasting the content of boot.ini into that shell, I get this:

Code: Select all

## Flattened Device Tree blob at 10000000
   Booting using the fdt blob at 0x10000000
   Loading Device Tree to 000000007df5b000, end 000000007df651eb ... OK

Starting kernel ...
after calling booti.

bootm returns this:

Code: Select all

bootm ${loadaddr} - ${dtb_loadaddr}
Wrong Image Format for bootm command
ERROR: can't get kernel image!

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Sat Jan 14, 2017 5:45 am

ok, I've switched the order for execution, now I'm embedding the sig before I merge the other parts of the file (like boot.ini).
this is what I see:

Code: Select all

GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:0;
TE: 400161
no sdio debug board detected 

BL2 Built : 11:44:26, Nov 25 2015. 
gxb gfb13a3b-c2 - jcao@wonton

Board ID = 8
set vcck to 1100 mv
set vddee to 1050 mv
CPU clk: 1536MHz
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK. 
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000012d0
Wait bl30...Done
Sending bl301.....OK. 
Run bl301...
ad bl31 from SD, src: 0x00020200, des: 0x10100000, size: 0x00011130


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@droid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: ef be ad de dLoad bl33 from SD, src: 0x00034200, des: 0x01000000, size: 0x000b8260
 f0 ad ba ef be ad de not ES chip
[0.514749 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):4d2e34d
NOTICE:  BL3-1: Built : 17:08:35, Oct 29 2015
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9
it is just gets stuck there.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Sat Jan 14, 2017 7:56 am

The new uboot does not have support for boot.ini commands or feature. This undocumented function is used by the hardkernel u-boot and can probably be made to work in new u-boot also with some work.

boot.ini is a feature to automate boot but still allow user to modify the parameters via a simple text file boot.ini

In mainline uboot it works a little differently we have to create a script in plaintext and compile it into a binary boot.scr file, there is some documentation here...

http://www.denx.de/wiki/DULG/UBootScripts

The reason? Normally boot images and config will be written into on board storage rather than sd card and would not modify the config directly in the flash.

Another alternative is to use default boot setup compiled into the actual u-boot source code (would have to patch).

We can setup some variables (for quick example)...

Code: Select all

#MMC Boot
setenv kernel_addr 11000000
setenv fdt_addr 1000000
setenv initrd_loadaddr 13000000
setenv bootfile Image
setenv fdtfile meson-gxbb-odroidc2.dtb
setenv initrdfile uInitrd
setenv fsargs "setenv bootargs root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rw no_console_suspend fsck.fix=yes"
setenv bootcmd 'fatload mmc 0:1 ${initrd_loadaddr} ${initrdfile} ;fatload mmc 0:1 ${kernel_addr} ${bootfile};fatload mmc 0:1 ${fdt_addr} ${fdtfile};run fsargs ;booti ${kernel_addr} ${initrd_loadaddr} ${fdt_addr}'
The final variable set, the "bootcmd" is what uboot will run by default and automatically when it first boots. Currently the bootcmd does not contain much so we are left with the command prompt in the UART on boot. If we place the above variables into uboot and recompile we can now have a default boot without having to enter commands at the UART prompt.

We need to add some changes to this file to achieve....
http://git.denx.de/?p=u-boot.git;a=blob ... droid-c2.h

There are some other good references in the source for how it is done with other boards..

Eg other odroid board....
http://git.denx.de/?p=u-boot.git;a=blob ... 3d5fe#l107

The CONFIG_EXTRA_ENV_SETTINGS is what needs to be setup better. You can even look in hardkernel uboot source for c2 to see how it is done with boot.ini setup, you can see there that we have default settings compiled into uboot and we override them in boot.ini to get what we want.

brad
Posts: 1026
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 23 times
Been thanked: 50 times
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by brad » Sat Jan 14, 2017 8:03 am

daggs wrote: it is just gets stuck there.
Looks like it cannot find the actual u-boot but gets through all the bootloaders correctly

daggs
Posts: 229
Joined: Tue Mar 22, 2016 6:34 pm
languages_spoken: english, spanish
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by daggs » Sat Jan 14, 2017 5:29 pm

brad wrote:The new uboot does not have support for boot.ini commands or feature. This undocumented function is used by the hardkernel u-boot and can probably be made to work in new u-boot also with some work.

boot.ini is a feature to automate boot but still allow user to modify the parameters via a simple text file boot.ini

In mainline uboot it works a little differently we have to create a script in plaintext and compile it into a binary boot.scr file, there is some documentation here...

http://www.denx.de/wiki/DULG/UBootScripts

The reason? Normally boot images and config will be written into on board storage rather than sd card and would not modify the config directly in the flash.

Another alternative is to use default boot setup compiled into the actual u-boot source code (would have to patch).

We can setup some variables (for quick example)...

Code: Select all

#MMC Boot
setenv kernel_addr 11000000
setenv fdt_addr 1000000
setenv initrd_loadaddr 13000000
setenv bootfile Image
setenv fdtfile meson-gxbb-odroidc2.dtb
setenv initrdfile uInitrd
setenv fsargs "setenv bootargs root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rw no_console_suspend fsck.fix=yes"
setenv bootcmd 'fatload mmc 0:1 ${initrd_loadaddr} ${initrdfile} ;fatload mmc 0:1 ${kernel_addr} ${bootfile};fatload mmc 0:1 ${fdt_addr} ${fdtfile};run fsargs ;booti ${kernel_addr} ${initrd_loadaddr} ${fdt_addr}'
The final variable set, the "bootcmd" is what uboot will run by default and automatically when it first boots. Currently the bootcmd does not contain much so we are left with the command prompt in the UART on boot. If we place the above variables into uboot and recompile we can now have a default boot without having to enter commands at the UART prompt.

We need to add some changes to this file to achieve....
http://git.denx.de/?p=u-boot.git;a=blob ... droid-c2.h

There are some other good references in the source for how it is done with other boards..

Eg other odroid board....
http://git.denx.de/?p=u-boot.git;a=blob ... 3d5fe#l107

The CONFIG_EXTRA_ENV_SETTINGS is what needs to be setup better. You can even look in hardkernel uboot source for c2 to see how it is done with boot.ini setup, you can see there that we have default settings compiled into uboot and we override them in boot.ini to get what we want.
I see, I think I'll stay with stock hk uboot then. the only reason I wanted to use latest uboot was because I assumed it is related to the freezes I have but it seems that it is eth related.
so I'll explore that path, if it won't work, I'll come back to this one.

oreggin
Posts: 3
Joined: Thu Feb 23, 2017 8:10 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Booting alternate kernels 4.6~4.7

Unread post by oreggin » Thu Feb 23, 2017 8:12 pm

Hi Guys,
Can you give us a brief status of this project?
I got a C2 and would like to run a mainline kernel on it.
Regards,
oreggin

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: No registered users and 1 guest