Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Moderators: mdrjr, odroid

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby chromodoris » Mon Apr 09, 2018 4:40 am

I would like to access the u-boot environment variables directly from
Linux. This implies using fw-printenv/fw-setenv, which themselves
rely on the MTD system (Memory Technology Devices). However,
it seems the kernel is compiled without support for MTD, as I see
Code: Select all
# CONFIG_MTD is not set

in the /boot/config-4.14.32+ file.

Would it be possible to have MTD enabled in the kernel?
chromodoris
 
Posts: 13
Joined: Thu Apr 05, 2018 3:08 am
languages_spoken: english
ODROIDs: HC1, HC2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby umiddelb » Mon Apr 09, 2018 6:02 am

The XU4's u-boot environment is stored on µSD card or eMMC. Just put the following line into `/etc/fw_env.config` and you will be able to access the environment with fw_printenv/fw_setenv:
Code: Select all
/dev/mmcblk0 0x99E00 0x4000

No need to facilitate the MTD subsystem.

Cheers
Uli
umiddelb
 
Posts: 440
Joined: Thu Jan 29, 2015 6:42 am
languages_spoken: English, German
ODROIDs: ODROID-C1, ODROID-XU4, ODROID-C2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby chromodoris » Mon Apr 09, 2018 4:41 pm

umiddelb wrote:The XU4's u-boot environment is stored on µSD card or eMMC. Just put the following line into `/etc/fw_env.config` and you will be able to access the environment with fw_printenv/fw_setenv:
Code: Select all
/dev/mmcblk0 0x99E00 0x4000

No need to facilitate the MTD subsystem.


There's no such thing as mmcblk0 in my boards, only mmcblk1 which is the sdcard and has only
two regular partitions p1 for boot and p2 for rootfs. The system I use is meveric's Debian Stretch
which is based on HardKernel build according to viewtopic.php?f=96&t=30552#p220828.
chromodoris
 
Posts: 13
Joined: Thu Apr 05, 2018 3:08 am
languages_spoken: english
ODROIDs: HC1, HC2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby rooted » Mon Apr 09, 2018 5:11 pm

chromodoris wrote:
umiddelb wrote:The XU4's u-boot environment is stored on µSD card or eMMC. Just put the following line into `/etc/fw_env.config` and you will be able to access the environment with fw_printenv/fw_setenv:
Code: Select all
/dev/mmcblk0 0x99E00 0x4000

No need to facilitate the MTD subsystem.


There's no such thing as mmcblk0 in my boards, only mmcblk1 which is the sdcard and has only
two regular partitions p1 for boot and p2 for rootfs. The system I use is meveric's Debian Stretch
which is based on HardKernel build according to viewtopic.php?f=96&t=30552#p220828.
I do, it's the eMMC

But doing as Uli says it still doesn't work, I get:

Code: Select all
Environment does not start on (erase) block boundary
User avatar
rooted
 
Posts: 5303
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby meveric » Mon Apr 09, 2018 5:35 pm

I think there are different values for SD and eMMC similar to the uboot flash tool that requires different points for flashing.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8979
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby tc424 » Mon Apr 09, 2018 5:53 pm

Hmm, https://wiki.odroid.com/odroid-xu4/soft ... tion_table says it should start at 0xFBE00, but on my card that's just zeroed out .. not sure u-boot on the XU4/HC4 actually uses an environment area? Note that the bootloader area isn't covered by a partition by default, but you can create one if you like - though you probably need to make sure not to change existing partition order:

Code: Select all
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk1p1            2048      806911      402432    c  W95 FAT32 (LBA)
/dev/mmcblk1p2          806912    62322687    30757888   83  Linux
/dev/mmcblk1p3               1        2047        1023+  da  Non-FS data


What are you aiming to achieve? If it's to boot different kernels more easily, I got syslinux style configuration working as described: viewtopic.php?f=93&t=17926&p=219491#p219452
tc424
 
Posts: 12
Joined: Sat Mar 03, 2018 10:26 pm
languages_spoken: english
ODROIDs: HC-1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby chromodoris » Mon Apr 09, 2018 6:36 pm

tc424 wrote:What are you aiming to achieve? If it's to boot different kernels more easily, I got syslinux style configuration working as described: viewtopic.php?f=93&t=17926&p=219491#p219452


I would like to tinker with the environment in order to have it search for boot.ini in an ext4 partition (perhaps in addition to the current
search in vfat only via cfgload). Having a vfat boot partition doesn't support setting up links to various kernel, and initramfs complains
too when it tries to set up its own links. I understand Windows people want to be able to pull out the sdcard and change its configuration
on their desktop, but I don't use Windows at all and /boot is mainly for the board, not for the desktop, so I prefer ext4.

Changing the environment using only the serial console is cumbersome and error prone.

My boards are HC1/HC2, without HDMI, so boot menus are not an option for me.
chromodoris
 
Posts: 13
Joined: Thu Apr 05, 2018 3:08 am
languages_spoken: english
ODROIDs: HC1, HC2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby rooted » Mon Apr 09, 2018 9:46 pm

You could just use ext4load instead of fatload in boot.ini
User avatar
rooted
 
Posts: 5303
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby chromodoris » Mon Apr 09, 2018 10:24 pm

Once I get to boot.ini, yes, ext4load works perfectly well.
The problem is to have u-boot load boot.ini first, as it searches for it only in a vfat partition,
despite it has fuul support for ext4.
chromodoris
 
Posts: 13
Joined: Thu Apr 05, 2018 3:08 am
languages_spoken: english
ODROIDs: HC1, HC2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby rooted » Tue Apr 10, 2018 12:51 am

chromodoris wrote:Once I get to boot.ini, yes, ext4load works perfectly well.
The problem is to have u-boot load boot.ini first, as it searches for it only in a vfat partition,
despite it has fuul support for ext4.
I'm not understanding you, you can use ext4load without a fat partition.

It's how Armbian is setup, no fat partition.

This is how they do it:

Code: Select all
# Load kernel, initrd and dtb in that sequence
ext4load mmc 0:1 0x40008000 /boot/zImage || fatload mmc 0:1 0x40008000 zImage || ext4load mmc 0:1 0x40008000 zImage
ext4load mmc 0:1 0x42000000 /boot/uInitrd || fatload mmc 0:1 0x42000000 uInitrd || ext4load mmc 0:1 0x42000000 uInitrd

# this is for mainline only
if test "${board_name}" = "xu4"; then setenv fdtfile "exynos5422-odroidxu4.dtb"; fi
if test "${board_name}" = "xu3"; then setenv fdtfile "exynos5422-odroidxu3.dtb"; fi
if test "${board_name}" = "xu3l"; then setenv fdtfile "exynos5422-odroidxu3-lite.dtb"; fi

# legacy shares a single DT for all boards
if ext4load mmc 0:1 0x00000000 "/boot/.next" || fatload mmc 0:1 0x00000000 ".next"  || ext4load mmc 0:1 0x00000000 ".next"; then echo "Found mainline kernel configuration"; else setenv fdtfile "exynos5422-odroidxu3.dtb"; fi
ext4load mmc 0:1 0x44000000 /boot/dtb/${fdtfile} || fatload mmc 0:1 0x44000000 dtb/${fdtfile} || ext4load mmc 0:1 0x44000000 dtb/${fdtfile}
User avatar
rooted
 
Posts: 5303
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby tc424 » Tue Apr 10, 2018 1:06 am

rooted wrote:I'm not understanding you, you can use ext4load without a fat partition.


But you need to load a script to invoke ext4load automatically, where do you load that from? I think that's what chromodoris is asking. Obviously if you recompile u-boot or can alter the environment block that will do it, but..
tc424
 
Posts: 12
Joined: Sat Mar 03, 2018 10:26 pm
languages_spoken: english
ODROIDs: HC-1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby chromodoris » Tue Apr 10, 2018 1:40 am

tc424 wrote:But you need to load a script to invoke ext4load automatically, where do you load that from? I think that's what chromodoris is asking.


Exactly.
I know about the various ext4load commands, and if I run them manually from the u-boot prompt in the serial console, it works perfectly, u-boot
knows how to handle both vfat and ext4.

What instruct u-boot that it should load boot.ini is stored in the flash as environment variables. This is what we see if from the u-boot prompt
we run the printenv command one of the variables read:
Code: Select all
bootcmd=cfgload;movi r k 0 40008000;bootz 40008000


I did not know about this cfgload command, so used u-boot help:
Code: Select all
Exynos5422 # help cfgload
cfgload - read 'boot.ini' from FAT partiton

Usage:
cfgload
    - read boot.ini from the first partiton treated as FAT partiton
Exynos5422 #


So this was the reason I asked for accessing flash, in order to change this variable with an if statement somewhere.

However, I just investigated further and looked more precisely at this cfgload command. In fact, it seems to be an
addition, by HardKernel that can be found in their GitHub repository: https://github.com/hardkernel/u-boot/bl ... /cfgload.c.
Looking in the code, there is a very interesting snippet:

Code: Select all
run_command("if fatload mmc 0:1 ${loadaddr} boot.ini;" \
      "   then echo ${msgload} FAT;" \
      "   else if ext4load mmc 0:1 ${loadaddr} /boot.ini;" \
      "   then echo ${msgload} ext4 0:1 /boot.ini;" \
      "   else if ext4load mmc 0:1 ${loadaddr} /boot/boot.ini;" \
      "   then echo ${msgload} ext4 0:1 /boot/boot.ini;" \
      "   else if ext4load mmc 0:2 ${loadaddr} /boot/boot.ini;" \
      "   then echo ${msgload} ext4 0:2 /boot.ini;" \
      "   else if ext4load mmc 0:2 ${loadaddr} /boot.ini;" \
      "   then echo ${msgload} ext4 0:2 /boot/boot.ini;" \
"   fi;fi;fi;fi;fi;", 0);


So maybe despite the help description of the command it supports ext4 too and looks for boot.ini in the first two partitions and both at
the root of the partition and in a directory! I will try it in a few hours, it may be the solution of my needs. This would mean that
just changing the first partition to ext4, or even using a single ext4 partition for rootfs and setting boot.ini in a /boot directory
would run. I'll post the results of this little experiment here, stay tuned.
chromodoris
 
Posts: 13
Joined: Thu Apr 05, 2018 3:08 am
languages_spoken: english
ODROIDs: HC1, HC2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby chromodoris » Tue Apr 10, 2018 2:00 am

I was overoptimistic...

Changed the partition type to linux, the file system type to ext4, replaced all fatload with ext4load in boot.ini,
changed the UUID and file system type in the /boon entry in /etc/fstab, put the SDcard back into the board,
used serial console to monitor and got:
Code: Select all
Exynos5422 # run bootcmd
** Unrecognized filesystem type **
cfgload: no boot.ini or empty file
mmc block read, dev 0, addr 0x40008000, blk start 2047, blk cnt 16384
Bad Linux ARM zImage magic!
Exynos5422 #


I'm back to square 1.
chromodoris
 
Posts: 13
Joined: Thu Apr 05, 2018 3:08 am
languages_spoken: english
ODROIDs: HC1, HC2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby umiddelb » Tue Apr 10, 2018 4:47 am

Please refer to this table here.
The offset for the u-boot environment depends on the u-boot version. The difference between µSD and eMMC is one sector.
The third parameter in `/etc/fw_env.config´ defines the block size. Please try
Code: Select all
/dev/mmcblk0 0x99C00 0x4000 0x100

or
Code: Select all
/dev/mmcblk0 0xFBC00 0x4000 0x100

according to your u-boot version.

Cheers
Uli
umiddelb
 
Posts: 440
Joined: Thu Jan 29, 2015 6:42 am
languages_spoken: English, German
ODROIDs: ODROID-C1, ODROID-XU4, ODROID-C2

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby rooted » Tue Apr 10, 2018 5:57 am

umiddelb wrote:Please refer to this table here.
The offset for the u-boot environment depends on the u-boot version. The difference between µSD and eMMC is one sector.
The third parameter in `/etc/fw_env.config´ defines the block size. Please try
Code: Select all
/dev/mmcblk0 0x99C00 0x4000 0x100

or
Code: Select all
/dev/mmcblk0 0xFBC00 0x4000 0x100

according to your u-boot version.

Cheers
Uli
Thanks Uli, in my case it was:

Code: Select all
/dev/mmcblk0 0x99C00 0x4000 0x100
User avatar
rooted
 
Posts: 5303
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Fri Jun 01, 2018 12:22 am

I see there is still no auto merge/build and it's past due for a manual one;

Code: Select all
> apt update > /dev/null 2>&1 && apt show linux-image-xu3 2>/dev/null | grep Depends | perl -pe 's/.*(4\.14\.[0-9]+)-.*/$1/g'
4.14.40

> curl -s https://www.kernel.org | grep 4.14 | head -n 1 | perl -pe 's/<[^<>]*>| +//g'
4.14.47
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Mon Jun 04, 2018 8:11 pm

Thanks, kernel is current for now.
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby odroid » Mon Jun 04, 2018 8:30 pm

Auto merge/build kernel didn't boot sometimes. We also met some functionality/stability issue too.
So we had to do it manually.
We've been trying to release Kernel update packages 1~2 times per month at least.
User avatar
odroid
Site Admin
 
Posts: 28494
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Mon Jun 04, 2018 8:41 pm

Do you have "auto merge/build/test and email you only if it fails the merge or tests" working?
or are you manually doing it all the time because it needs to be done manually sometimes?
Thanks again anyway.
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Tue Jun 26, 2018 11:37 pm

odroid wrote:...We've been trying to release Kernel update packages 1~2 times per month at least.

4.14.52 would be a good 2nd build of the month.
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby odroid » Thu Jul 12, 2018 11:56 am

4.14.52 was released on June 27th.
4.14.55 has been released today July 12th.
User avatar
odroid
Site Admin
 
Posts: 28494
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Thu Jul 12, 2018 3:23 pm

odroid wrote:4.14.52 was released on June 27th.
4.14.55 has been released today July 12th.


Not so;

Code: Select all
> date ; uname -r ; apt show linux-image-xu3 2>/dev/null | grep Depends
Thu Jul 12 02:22:15 EDT 2018
4.14.47-132
Depends: linux-image-4.14.47-132


or maybe you dropped support for 16, and it's only on 18 ...
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby odroid » Thu Jul 12, 2018 9:46 pm

We will check the kernel update packages for Xenial.
User avatar
odroid
Site Admin
 
Posts: 28494
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Fri Jul 13, 2018 2:49 am

@odroid
Also 18.04 should be listed
https://wiki.odroid.com/accessory/emmc/reference_chart
and
https://wiki.odroid.com/odroid-xu4/os_i ... ntu/ubuntu
(or the 2nd link should be renamed "discontinued" )
Last edited by elatllat on Fri Jul 13, 2018 11:05 am, edited 1 time in total.
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby odroid » Fri Jul 13, 2018 9:16 am

Updated the wiki pages.

We've been using 18.04 images with Orange eMMC for a couple of months.
Can you show me the serial console output on a new topic?
User avatar
odroid
Site Admin
 
Posts: 28494
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Sat Jul 21, 2018 11:34 am

The minimal image should have
Code: Select all
apt autoremove -y
dpkg --purge $(dpkg -l | grep -P "^rc" | perl -pe 's/^.. *//g;s/ .*\n/ /g')

run on it for things like
Code: Select all
Purging configuration files for linux-image-3.10.96-101 (20160702) ...
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby elatllat » Wed Aug 08, 2018 4:08 am

odroid wrote:...We've been trying to release Kernel update packages 1~2 times per month at least.

4.14.55 2018-07-11
4.14.61 2018-08-06

Bump :D
elatllat
 
Posts: 1009
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Kernel 4.14 release for XU4/XU3/HC1/HC2/MC1

Unread postby igorpec » Fri Aug 10, 2018 2:03 am

We also provide daily updates :) If at least building of all kernels succeeds.

armbian-config -> switch to nightly builds and tada. You have the latest.
ARMBIAN - follow on Twitter
linux for ARM development boards with user friendly development tools
User avatar
igorpec
 
Posts: 186
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+

Previous

Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 2 guests