1 1
wildcat_paris

[Device specific] Odroid xu4

Recommended Posts

(edited)

right, he uses bzImage instead zImage and he doesn't use initramfs. let's see...

 

update 4.Juni 2006: Didn't work like described by @Luisbg. If you try by yourself, try in .config with UAS activated.

CONFIG_USB_UAS=y
Edited by jobenvil

Share this post


Link to post
Share on other sites
(edited)

@wildcat_paris Thanks for your update. I'm reading very interesting your link and motivated @Shuah for share her progress with the XU4  community.

 

Update 13. Juni: I built the Kernel 4.7.0-rc2-next following the guides from @ummidelb  and @shuah

 

The main problem that I had is that the SD Card device numbering for mmcblk0 changed to mmcblk1 (probably NAND device is now mmclbk0?) and therefore it was necessary to use UUID in u-boot environment variables and in /etc/fstab. Moreover I had a Hardkernel Ubuntu Image wich had 3.10.84 updated by hardkernel scripts until 3.10.96 with Xenial. After that I put on the top the ARMBIAN Kernel 3.10.110. The u-boot environment variable had to be changed to the original one from Hardkernel:

setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes"
...
...
setenv bootcmd "fatload mmc 0:1 0x40008000 zImage_next; fatload mmc 0:1 0x42000000 uInitrd-4.7.0-rc2-next-20160609; fatload mmc 0:1 0x44000000 exynos5422-odroidxu4_next.dtb; bootz 0x40008000 0x42000000 0x44000000"

But because the HDMI is broken and no serial UART available atm (german reseller has no more and I didn't want to order once again from Korea..) it was difficult to debug when it was not booting.

 

I enabled USB_CONFIG_UAS=y, but didn't work out the box. Probably patches are necessary, like other to fix the CPUs order, the ethernet which is attached to the USB2.0 instead of 5Gbps, etc.

Edited by jobenvil

Share this post


Link to post
Share on other sites

@wildcat_paris Trying to compile next branch (4.2.X) with Armbian tools, I want to send this pull but I realized that even the compilation doesn't break, it doesn't work the created image out of the box and unfortunately, minor tunnings in boot.ini, etc/fstab are necessary to boot the image.

Share this post


Link to post
Share on other sites
(edited)

@jobenvil

 

before digging in your (short) update

 

1/ did you use the old uboot 2012? Maybe some never version can work but unsure

 

2/ did you applied the "Trust plateform" extra firmwares?

 

3/ did you start the first partition @sector 4096 because the extra firmware take more room than the usual "bootloader" used for A20 SoC for example?

 

note1:

I mean the script

sh sd_fusing.sh /dev/sdX

https://archlinuxarm.org/platforms/armv7/samsung/odroid-xu4

 

(I haven't worked on it on my side)

 

note2:

in the meantime I will clone your git to test

 

note3:

sd_fusing

 

 

gr@odroidxu4:/home2/gr/arch_xu4/boot$ cat sd_fusing.sh
#!/usr/bin/bash
####################################
#
# Copyright (C) 2011 Samsung Electronics Co., Ltd.
#              http://www.samsung.com/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
####################################
#
# Modified for Arch Linux ARM package uboot-odroid-xu3
#
####################################

if [ -z $1 ]
then
    echo "usage: ./sd_fusing.sh <SD Reader's device file>"
    exit 0
fi

if [ -b $1 ]
then
    echo "$1 reader is identified."
else
    echo "$1 is NOT identified."
    exit 0
fi

if [ -d /sys/block/${1##*/}boot0 ]; then
    echo "$1 is an eMMC card, disabling ${1##*/}boot0 ro"
    if ! echo 0 > /sys/block/${1##*/}boot0/force_ro; then
        echo "Enabling r/w for $1boot0 failed"
        exit 1
    fi
    emmc=1
fi

####################################
# fusing images

if [ -n "$emmc" ]; then
    signed_bl1_position=0
    bl2_position=30
    uboot_position=62
    tzsw_position=718
    device=$1boot0
else
    signed_bl1_position=1
    bl2_position=31
    uboot_position=63
    tzsw_position=719
    device=$1
fi

#<BL1 fusing>
echo "BL1 fusing"
dd iflag=dsync oflag=dsync if=./bl1.bin of=$device seek=$signed_bl1_position

#<BL2 fusing>
echo "BL2 fusing"
dd iflag=dsync oflag=dsync if=./bl2.bin of=$device seek=$bl2_position

#<u-boot fusing>
echo "u-boot fusing"
dd iflag=dsync oflag=dsync if=./u-boot.bin of=$device seek=$uboot_position

#<TrustZone S/W fusing>
echo "TrustZone S/W fusing"
dd iflag=dsync oflag=dsync if=./tzsw.bin of=$device seek=$tzsw_position

####################################
#<Message Display>
echo "U-boot image is fused successfully."

 

 

 

 

gr@odroidxu4:/home2/gr/arch_xu4/boot$ ll
total 4136
drwxr-xr-x  3 gr gr    4096 Jun  1 05:25 ./
drwxrwxr-x 16 gr gr    4096 Jun 17 11:20 ../
-rw-r--r--  1 gr gr   15616 Aug 30  2014 bl1.bin
-rw-r--r--  1 gr gr   14592 Aug 30  2014 bl2.bin
-rw-r--r--  1 gr gr    2019 Aug 30  2014 boot.ini
drwxr-xr-x  2 gr gr    4096 Apr 12 05:23 dtbs/
-rwxr-xr-x  1 gr gr    1744 Aug 30  2014 sd_fusing.sh*
-rw-r--r--  1 gr gr  262144 Aug 30  2014 tzsw.bin
-rw-r--r--  1 gr gr  331668 Aug 30  2014 u-boot.bin
-rwxr-xr-x  1 gr gr 3584456 Apr 12 05:23 zImage*

 

 

Edited by wildcat_paris

Share this post


Link to post
Share on other sites

@wildcat_paris

 

Answering your questions:

 

1) No, I have the original one based on HardKernel Ubuntu distro which is 2012.07

2) No idea what this is. Do you mean the tsz.bin /bl1/bl2? For what is this good or necessary?

3) Yes, /dev/mmcblk0p1 is starting at 4096.

 

I didn't see any new mention on ODROID Forum regarding newer U-Boot to use with mainline kernel.

 

I tested 4.6.X, 4.7.rc-2, rc-3. I build directly on XU4. It's quicker.

Share this post


Link to post
Share on other sites

@jobenvil

 

I haven't looked at "lib" code, only build an image for XU4

 

u-boot is 2012.07

the tsz/bl1/bl2 should be burned

 

maybe an update of boot.ini is need

 

the current Armbian boot.ini (kernel 3.x)

 

maybe an update has to be done to reference

dtb/exynos5422-odroidxu4.dtb and not dtb/exynos5422-odroidxu3.dtb

and making sure zImage is used

 

 

 

gr@odroidxu4:/boot$ cat boot.ini
ODROIDXU-UBOOT-CONFIG

# U-Boot Parameters
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"

# Mac address configuration
setenv macaddr "00:1e:06:61:7a:55

#------------------------------------------------------------------------------------------------------
# Basic Ubuntu Setup. Don't touch unless you know what you are doing.
# --------------------------------
setenv bootrootfs "console=tty1 loglevel=1 root=/dev/mmcblk0p2 rootwait ro fsck.repair=yes"

# boot parameter for serial console
# console=ttySAC2,115200n8

# boot commands
setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; fatload mmc 0:1 0x44000000 dtb/exynos5422-odroidxu3.dtb; bootz 0x40008000 0x44000000"

# --- Screen Configuration for HDMI --- #
# ---------------------------------------
# Uncomment only ONE line! Leave all commented for automatic selection.
# Uncomment only the setenv line!
# ---------------------------------------
# ODROID-VU forced resolution
# setenv videoconfig "video=HDMI-A-1:1280x800@60"
# -----------------------------------------------
# ODROID-VU forced EDID
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1280x800.bin"
# -----------------------------------------------
# 1920x1080 (1080P) with monitor provided EDID information. (1080p-edid)
# setenv videoconfig "video=HDMI-A-1:1920x1080@60"
# -----------------------------------------------
# 1920x1080 (1080P) without monitor data using generic information (1080p-noedid)
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080.bin"
# -----------------------------------------------
# 1920x1080 50hz (1080P) with monitor provided EDID information. (1080p 50hz-edid)
# setenv videoconfig "video=HDMI-A-1:1920x1080@50"
# -----------------------------------------------
# 1920x1080 50hz (1080P) without monitor data using generic information (1080p 50hz-noedid)
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080_50hz.bin"
# -----------------------------------------------
# 1440x900 with monitor provided EDID information.
# setenv videoconfig "video=HDMI-A-1:1440x900@60"
# -----------------------------------------------
# 1440x900 without monitor data using generic information
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1440x900.bin"
# -----------------------------------------------
# 1280x720 (720P) with monitor provided EDID information. (720p-edid)
# setenv videoconfig "video=HDMI-A-1:1280x720@60"
# -----------------------------------------------
# 1280x720 (720P) without monitor data using generic information (720p-noedid)
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1280x720.bin"
# -----------------------------------------------
# 1024x768 without monitor data using generic information
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1024x768.bin"
# -----------------------------------------------
# 800x600 without monitor data using generic information
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/800x600.bin"
# -----------------------------------------------
# 800x480 without monitor data using generic information (ODROID 7")
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/800x480.bin"
# -----------------------------------------------
# 720x576 without monitor data using generic information
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/720x576.bin"
# -----------------------------------------------
# 720x480 without monitor data using generic information
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/720x480.bin"
# -----------------------------------------------
# 640x480 without monitor data using generic information
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/640x480.bin"


# --- HDMI / DVI Mode Selection ---
# ------------------------------------------
# - HDMI Mode
setenv vout "hdmi"
# - DVI Mode (disables sound over HDMI as per DVI compat)
# setenv vout "dvi"


# --- CPU Governor Setup ---
# Uncomment only one line. New governor is set after 90secs after boot.
# ------------------------------------------
# - Performance (Keep all the CPU's at Maximum frequency)
setenv governor "performance"
# ------------------------------------------
# - Ondemand
# setenv governor "ondemand"
# ------------------------------------------
# - Interactive (Pretty much just like ondemand with more possible customization via sysfs.)
# setenv governor "interactive"
# ------------------------------------------
# - Conservative (Like ondemand, but do the frequency transitions more slowly, great for battery powered applications)
# setenv governor "conservative"
# ------------------------------------------
# - Powersave (Keeps the CPU's to the lowest possible temps)
# setenv governor "powersave"


#------------------------------------------------------------------------------
#
# HDMI-PHY Parameter Control
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#
# HDMI Hot Plug detection
#
#------------------------------------------------------------------------------
#
# Forces the HDMI subsystem to ignore the check if the cable is connected or
# not.
# false : disable the detection and force it as connected.
# true : let cable, board and monitor decide the connection status.
#
# default: true
#
#------------------------------------------------------------------------------
setenv HPD "true"

#------------------------------------------------------------------------------
#
#  TMDS data amplitude control.
#
#------------------------------------------------------------------------------
#
#  1LSB corresponds to 20 mVdiff amplitude level.
#  tx_amp_lvl : 0 = 760 mVdiff(Min), 31 = 1380 mVdiff(Max)
#
#  Hardkernel default hdmi_tx_amp_lvl = 31(1380 mVdiff);
#------------------------------------------------------------------------------
setenv hdmi_tx_amp_lvl  "31"

#------------------------------------------------------------------------------
#
#  TMDS data amplitude fine control for each channel.
#
#------------------------------------------------------------------------------
#
#  1LSB corresponds to 20 mVdiff amplitude level.
#  tx_lvl : 0 = 0 mVdiff(Min), 3 = 60 mVdiff(Max)
#
#  Hardkernel default
#      hdmi_tx_lvl_ch0 = 3, hdmi_tx_lvl_ch1 = 3, hdmi_tx_lvl_ch2 = 3,
#------------------------------------------------------------------------------
setenv hdmi_tx_lvl_ch0      "3"
setenv hdmi_tx_lvl_ch1      "3"
setenv hdmi_tx_lvl_ch2      "3"

#------------------------------------------------------------------------------
#
#  TMDS data pre-emphasis level control.
#
#------------------------------------------------------------------------------
#
#  1LSB corresponds to -0.45dB emphasis level except for 1
#  tx_emp_lvl : 0 = 0 db(Min), 1 = -0.25 db, 2 = 0.7 db, 15 = -7.45 db(Max)
#
#  Hardkernel default hdmi_tx_emp_lvl = 6 (-2.50 db);
#------------------------------------------------------------------------------
setenv hdmi_tx_emp_lvl      "6"

#------------------------------------------------------------------------------
#
#  TMDS clock amplitude control.
#
#------------------------------------------------------------------------------
#
#  1LSB corresponds to 20 mVdiff amplitude level.
#  clk_amp_lvl : 0 = 790 mVdiff(Min), 31 = 1410 mVdiff(Max)
#
#  Hardkernel default hdmi_clk_amp_lvl = 31 (1410 mVdiff)
#------------------------------------------------------------------------------
setenv hdmi_clk_amp_lvl     "31"

#------------------------------------------------------------------------------
#
#  TMDS data source termination resistor control.
#
#------------------------------------------------------------------------------
#
#  tx_res :
#      0 = Source Termination OFF(Min), 1 = 200 ohm, 2 = 300 ohm, 3 = 120 ohm(Max)
#
#  Hardkernrel default hdmi_tx_res = 0 (Source Termination OFF)
#------------------------------------------------------------------------------
setenv hdmi_tx_res      "0"

#------------------------------------------------------------------------------

setenv hdmi_phy_control "hdmi_tx_amp_lvl=${hdmi_tx_amp_lvl} hdmi_tx_lvl_ch0=${hdmi_tx_lvl_ch0} hdmi_tx_lvl_ch1=${hdmi_tx_lvl_ch1} hdmi_tx_lvl_ch2=${hdmi_tx_lvl_ch2} hdmi_tx_emp_lvl=${hdmi_tx_emp_lvl} hdmi_clk_amp_lvl=${hdmi_clk_amp_lvl} hdmi_tx_res=${hdmi_tx_res} HPD=${HPD} vout=${vout}"

# final boot args
setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control}"
# drm.debug=0xff
# Boot the board
boot

 

 

 

Share this post


Link to post
Share on other sites
(edited)

Actually, mi boot.ini looks like:

 

 

ODROIDXU-UBOOT-CONFIG

# U-Boot Parameters
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"

# Mac address configuration
setenv macaddr "00:1e:06:61:7a:39"

#------------------------------------------------------------------------------------------------------
# Basic Ubuntu Setup. Don't touch unless you know what you are doing.
# --------------------------------
# original: setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=a4b494db-320a-4ce2-bb3a-841db943f9c0 rootwait ro"

# working 4.7rc-2 and 4.6.0+
#setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes"

# working armbian 3.10.101:
setenv bootrootfs "console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait ro net.ifnames=0 cgroup_disable=memory,cpu,devices,cpuacct,freezer,blkio swapaccount=0 apparmor=0"

# original hardkernel uInitrd:
#setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; fatload mmc 0:1 0x42000000 uInitrd; fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; bootz 0x40008000 0x42000000 0x44000000"

# working 4.7 :
#setenv bootcmd "fatload mmc 0:1 0x40008000 zImage_next; fatload mmc 0:1 0x42000000 uInitrd-4.7.0-rc2-next-20160609; fatload mmc 0:1 0x44000000 exynos5422-odroidxu4_next.dtb; bootz 0x40008000 0x42000000 0x44000000"

#not working 4.7.0-rc3:
#setenv bootcmd "fatload mmc 0:1 0x40008000 zImage-4.7.0-rc3; fatload mmc 0:1 0x42000000 uInitrd-4.7.0-rc3-g65f0709; fatload mmc 0:1 0x44000000 exynos5422-odroidxu4-4.7.0-rc3.dtb; boot 0x40008000 0x42000000 0x44000000"

# working 4.6.0+ setenv bootcmd "fatload mmc 0:1 0x40008000 zImage_4.6.0+; fatload mmc 0:1 0x42000000 uInitrd-4.6.0+; fatload mmc 0:1 0x44000000 exynos5422-odroidxu4_4.6.0+.dtb; bootz 0x40008000 0x42000000 0x44000000"

# working armbian 3.10.101:
setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; fatload mmc 0:1 0x44000000 dtb/exynos5422-odroidxu3.dtb; bootz 0x40008000 0x44000000"

# --- Screen Configuration for HDMI --- #
# ---------------------------------------
# Uncomment only ONE line! Leave all commented for automatic selection.
# Uncomment only the setenv line!
# ---------------------------------------

 

 

and /media/boot

 

 

root@hiperborea /media/boot # ll
total 36766
-rwxr-xr-x 1 root root 3402084 Jun 10 21:11 zImage
-rwxr-xr-x 1 root root 1891504 Jun 10 21:11 System.map-3.10.101-odroidxu4
-rwxr-xr-x 1 root root  111399 Jun 10 21:11 config-3.10.101-odroidxu4
-rwxr-xr-x 1 root root   54607 Jun 12 13:20 exynos5422-odroidxu4_next.dtb
-rwxr-xr-x 1 root root 4499904 Jun 12 13:20 zImage_next
-rwxr-xr-x 1 root root  105958 Jun 12 13:23 config-4.7.0-rc2-next-20160609
-rwxr-xr-x 1 root root 6245260 Jun 13 08:39 initrd.img-3.10.101-odroidxu4
-rwxr-xr-x 1 root root 5760903 Jun 13 09:02 uInitrd-4.7.0-rc2-next-20160609
-rwxr-xr-x 1 root root   47808 Jun 13 21:17 exynos5422-odroidxu4_4.6.0+.dtb
-rwxr-xr-x 1 root root 4206392 Jun 13 21:19 zImage_4.6.0+
-rwxr-xr-x 1 root root  113418 Jun 13 21:20 config-4.6.0+
-rwxr-xr-x 1 root root 7782354 Jun 13 23:06 uInitrd-4.6.0+
-rwxr-xr-x 1 root root 3402084 Jun 16 11:30 vmlinuz-3.10.101-odroidxu4
-rwxr-xr-x 1 root root    9788 Jun 16 11:56 boot.ini
drwxr-xr-x 2 root root    2048 Jun 16 11:58 dtb


 

 

Edited by wildcat_paris
added [spoiler][/spoiler]

Share this post


Link to post
Share on other sites

yes, this was working like it is mentioned. You should care about the /etc/fstab, wait...

root@hiperborea /media/boot # cat /etc/fstab
# <file system>  < mount point> <type>  <options>                                                                 <dump>  <pass>
#/dev/mmcblk0p2   /              ext4    noatime,barrier=0,commit=5,errors=remount-ro      0       1
UUID=e139ce78-9841-40fe-8823-96a304a09859   /              ext4    defaults,noatime,nodiratime      0       1
UUID=1E66-94B1   /media/boot    vfat    defaults                                          0       0
#/dev/sda1        /media/sda     ext4    defaults,noatime,nodiratime,data=writeback,commit=600,errors=remount-ro      0       2
# Seagate 500GB 7200RPM ST9500325AS
#/dev/sda1        /media/sda     ext4    noatime,barrier=0,errors=remount-ro      0       2
LABEL="data-7200"       /media/sda     ext4    defaults,noatime,nodiratime      0       2
# deleted barrier=0, para error tan largo en disco duro
# Seagate 500GB 5400RPM
#/dev/sdb1        /media/sdb     ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro      0       2
tmpfs            /tmp           tmpfs   defaults,noatime,nosuid,nodev,noexec,mode=1777,size=512M                     0       0
#tmpfs            /var/tmp       tmpfs   defaults    explanation: Verzeichnis /var/tmp sollte generell nicht auf diese Weise ausgelagert werden
LABEL="swap-7200"           none  swap  sw      0   0
/media/sda/album /var/www/Album none bind 0 0

UUID are mandatory

Share this post


Link to post
Share on other sites

@jobenvil

 

newer kernel it is better to use UUID because there is a mess on XU4 with /dev/mmc* and /dev/mmc*boot? between eMMC and SDcard

 

just to make sure, you have done only little changes on your "lib" (adding "next")

 

and done your compilation & updates directly on the XU4, haven't you? please (I have tried to follow you but got quickly lost :)

Share this post


Link to post
Share on other sites

@jobenvil

 

newer kernel it is better to use UUID because there is a mess on XU4 with /dev/mmc* and /dev/mmc*boot? between eMMC and SDcard

 

just to make sure, you have done only little changes on your "lib" (adding "next")

 

and done your compilation & updates directly on the XU4, haven't you? please (I have tried to follow you but got quickly lost :)

Normal and don't worry, mi english is "broken" :-)

 

1) Yes, there is a mess with device drivers. You should use UUID to uniq identification of devices. So you are save if boot search for mmc0 or mmc1

2) Yes, only "next" was added = minor change

3.1) No, I tried to compile and build an image with ARMBIAN tools changing the "next" (see point 2). This compiled well, but the produced image doesn't boot because the boot.ini and fstab needs changes. After properly modifications, the u-boot is loading.

3.2) Yes, I prefer to compile directly on XU4. This takes less than 20 minutes. You get zImage, xu4-dtb and modules. Follow the guide from Uli Middelberg.

Share this post


Link to post
Share on other sites

@jobenvil

 

don't worry about English, I am French :)

 

Thank you for sharing the details. You bring plenty of good news/testing

 

In case I am motivated I will try to update for XU4 "next" with kernel 4.6 (But I prefer DIY on solar panel charger/battery regulator/etc.)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1