Hardkernel ODROID-X2

From Linux Exynos
Revision as of 19:53, 11 May 2015 by Tjakobi (Talk | contribs)

Jump to: navigation, search
Hardkernel ODROID-X2
Manufacturer Hardkernel
Dimensions 90 x 94 mm
SoC Samsung Exynos 4412 Prime
DRAM 2 GiB LPDDR2 @ 880 MHz
Power Maxim MAX77686 Power Management IC, RICOH RP505K331B DC/DC-converter for 3.3V system power supply, Fairchild semiconductor FXMA2102L8X level shifter for I2C/UART/HDMI, 5V / 2A 2.5mm x 0.8mm DC input
Video Micro-HDMI, RGB-24bit LCD interface
Audio Maxim MAX98090, 3.5mm headphone jack, 3.5mm microphone jack, HDMI digital
Network 10/100 Mbit ethernet via Microchip LAN9730
Storage SD slot, eMMC module socket
USB (Host/OTG) 2x USB 2.0 Host via Microchip USB3503A, 4x USB 2.0 Host via Microchip LAN9514, 1x Micro-USB 2.0
Camera Samsung S5KECGMIPI 2-lane camera interface
Other 50-pin I/O-expansion for LCD/PWM/I2C/UART/SPI/ADC/GPIO interfaces



The board name "ODROID-X2" including the revision number if clearly printed on the upper side of the board (side where the SoC cooler is located).


This feature matrix shows hardware support of the ODROID-X2 when using the kernel fork by Tobias Jakobi (currently based on vanilla-4.0.y).

Feature Forked Linux Kernel
Serial Yes
Network Yes
eMMC Yes
Audio Yes
IOMMU  ? (needs testing)
CPUFreq Yes (including Boost)
G2D (2D acceleration) Yes
Mali (3D Acceleration) Yes
MFC (Video encoding/decoding) No/Broken

It is recommended to use a recent upstream u-boot build to boot the kernel.

u-boot build

Clone the master branch of the upstream u-boot repository:

   git clone git://git.denx.de/u-boot.git

Proceed by following the instructions in u-boot/doc/README.odroid, which explains the installation of the complete bootloader chain and also partitioning of your boot media (which can be either eMMC or SD).

Using an upstream u-boot build has one potential disadvantage when comparing it to the vendor u-boot branch. The vendor branch clocks the MPLL with 880MHz, while upstream uses 800MHz. This results in slightly reduced memory bandwidth.

kernel setup and build

Clone the kernel fork and fetch a minimal kernel config. We assume that you do these steps on the actual device (probabaly using one of the vendor-provided images as bootstrap platform).

   git clone -b odroid-4.0.y https://github.com/tobiasjakobi/linux-odroid.git && cd linux-odroid
   curl https://raw.githubusercontent.com/tobiasjakobi/odroid-environment/master/sourcecode/system/vanilla-4.0.conf > .config

Proceed by building the kernel (you can of course modify the kernel config first).

   make -j5 && make LOADADDR=0x40008000 uImage

Next we put the kernel image and the devicetree blob (DTB) on the boot filesystem. We assume that the filesystem is correctly mounted in /boot. Depending on your current user's rights you might have to become root for that.

   cp arch/arm/boot/uImage /boot/uImage-4.0-odroid
   cp arch/arm/boot/dts/exynos4412-odroidx2.dtb /boot/odroid-x2-4.0.dtb

u-boot setup

These instructions assume that your boot media is an SD card. You might have to adjust instructions if you're using an eMMC to boot. In particular an eMMC has a dedicated boot area, which is not writable by default (you need to unlock it first).

u-boot stores its configuration data (the u-boot environment, shortened to u-boot env) in the first few blocks of the boot media. For the ODROID-X2 the config region starts at 0x140000 and is 0x1000 bytes long. The default u-boot env that u-boot writes if it doesn't find one is very complex. It is recommend to replace it with a simpler version and provide most of the configuration through the u-boot script.

To prepare the script we store these commands as /boot/boot.cmd.

   if test -n ${oneshot}; then
     setenv oneshot
     setenv filesize
     setenv experimental 1
   # kernel image and dtb load addresses
   setenv uimg_addr "0x40007000"
   setenv fdt_addr "0x41f00000"
   setenv fdt_high "0xffffffff"
   # video config: 1280x720M@50, 1920x1080M@60
   # console config
   # rootfs config
   setenv vid_config "video=HDMI-A-1:1280x720M@60"
   setenv con_config "console=ttySAC1,115200n8"
   setenv rfs_config "root=/dev/mmcblk0p2 rootfstype=ext4 rootwait ro"
   if test -n ${experimental}; then
     setenv uimg_file "uImage-4.1-odroid"
     setenv fdt_file "odroid-x2-4.1.dtb"
     setenv bootargs "${vid_config} ${con_config} ${rfs_config} earlyprintk"
     setenv uimg_file "uImage-4.0-odroid"
     setenv fdt_file "odroid-x2-4.0.dtb"
     setenv bootargs "${vid_config} ${con_config} ${rfs_config}"
   setenv uloadcmd "fatload mmc 0:1 ${uimg_addr} ${uimg_file}; fatload mmc 0:1 ${fdt_addr} ${fdt_file}"
   setenv bootcmd "run uloadcmd; fdt addr ${fdt_addr}; fdt resize; bootm ${uimg_addr} - ${fdt_addr}"

You might want to adjust the content. It currently selects a 720p (60Hz) mode on boot and assumes that the root filesystem is 'ext4' and located on the second partition (/dev/mmcblk0p2). Also it allows for booting a different kernel (based on Linux 4.1 here) when requested, something which we won't use at the moment.

Proceed by creating the u-boot script from the input commands (mkimage is part of the u-boot tools package).

   cd /boot && mkimage -A arm -T script -C none -n "Boot script for ODROID-X2" -d boot.cmd boot.scr

Next we configure the u-boot env, where we want to use the u-boot env utilities (fw_printenv/fw_setenv) for. We start by fetching the utility config, storing it in /etc. Another script is going to be used to actually setup the u-boot env.

   curl https://gist.githubusercontent.com/tobiasjakobi/f533bb8bcba75cc76bb3/raw/5407dcd554d2efe46064c95ce8acd1d69c021857/fw_env.config > /etc/fw_env.config
   curl https://gist.githubusercontent.com/tobiasjakobi/ef307c12e1a9b3379344/raw/61628daaf73b5f630c1acce1aad0a68510067e0c/uboot_simple_env.sh > uboot_simple_env.sh

We proceed by zeroing the region that stores the u-boot env and then writing our env to it. Beware that this is potentially dangerous, so make sure that no critical data is stored in that region.

   dd if=/dev/zero of=/dev/mmcblk0 bs=1 seek=1310720 count=4096
   sh uboot_simple_env.sh

Check the u-boot env by using fw_printenv. It should look something like this.

   bootcmd=run loadscript
   loadscript=fatload mmc 0:1 ${scriptaddr} boot.scr; source ${scriptaddr}

This concludes the u-boot setup. A serial/UART adapter is now recommended. Reboot and monitor logging output on the UART.

Additional guides