From patchwork Sat Feb 3 11:02:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Crokaert X-Patchwork-Id: 868884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=crookies-net.20150623.gappssmtp.com header.i=@crookies-net.20150623.gappssmtp.com header.b="B1UjGjXs"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zYWCN2zNzz9t5Q for ; Sat, 3 Feb 2018 22:02:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 467A3887C9; Sat, 3 Feb 2018 11:02:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R9E4Xks7AqPn; Sat, 3 Feb 2018 11:02:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 4E0DB8867D; Sat, 3 Feb 2018 11:02:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 33BB61C0983 for ; Sat, 3 Feb 2018 11:02:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2EB68889F7 for ; Sat, 3 Feb 2018 11:02:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lzrDKbMPcIJm for ; Sat, 3 Feb 2018 11:02:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5C45A88969 for ; Sat, 3 Feb 2018 11:02:15 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id r78so17145886wme.0 for ; Sat, 03 Feb 2018 03:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crookies-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=lFW8Zs+Fhtrp0IPb6SY0ONKBqLRP2T2iJs4MdwxFB4A=; b=B1UjGjXsZbsr4C9R/AsFhydvAT/MI/xSq0Ew+ID2RMiLexmJvuA8E9zjtcCRHJ+vnl vKXcTov2Rgn+s2Aqi2b01znZm0jysnQR7lUFYZiTL2foluwa6LaB3Dd5zunZPcgDEo3R d+R258HMSljo4WRGcIKTuxELwPo2eb1IUTaZ+QVSlS7qqWm4prqUYZf6rk2xMzpsaqyD 6gSubU7iPt8Slw5uTi081BHxnx4RIH9o/5kx/i0Lv9KCOd1/LFwQ8U4FSgQBGNUa6v6U hBh8p6KRaA5fugQzQxFPWGqTGfyHbnrymwl02dms/Un0MrbdUUBWQhyyRtOL4R9LgMpy pKCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lFW8Zs+Fhtrp0IPb6SY0ONKBqLRP2T2iJs4MdwxFB4A=; b=M6kYpj/bQQQNJNjrdTBzkpPlrQ1HkqPdBbRWzQ2BFFHli+RCCK+V8rBO1DAnFc3gKX EWI+ZXRf11ovnyrLUe1Elay3MYaet9IqylqHa95xDORKWgy0dMATisKOIsO7FckbzNCl kUfJjNMJCPzFjLIWhPsBhjeFdnxuCMSrM+j2Vnu9gPY0btXzi8Lk2csBVa5Ztsv/ORmm P5bYCL+ONY9FmxwnP+TYA8fhsDCPq2idMDpJiWYkKkt9aSu0CkXl/xO+wlLNX2BMjlyK TnX1ODN403eJqiSBieCwoL2zk7kGLwGuChUzIc+XAwTFaNKsyrZTAx9Bo8T4UqszlwDT kZ2w== X-Gm-Message-State: AKwxytf797jN2bzARP/lb7xo0hc5hgnlD+y5sXkSwF0XPnsaS1N5EE3u Mfd2SBWyOpLYE7XFiW3KO2YgtvHM X-Google-Smtp-Source: AH8x2275cnV1SA477ytB1JY6NEcEWJCc+c2DXGcf1sLAqCc+GbzqLvlUY4/Z4PW8kMr+q/nbKEFjyg== X-Received: by 10.80.165.201 with SMTP id b9mr70839769edc.211.1517655733218; Sat, 03 Feb 2018 03:02:13 -0800 (PST) Received: from localhost.localdomain ([109.130.238.155]) by smtp.gmail.com with ESMTPSA id f29sm3637197eda.43.2018.02.03.03.02.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Feb 2018 03:02:12 -0800 (PST) From: Pierre CROKAERT To: buildroot@buildroot.org Date: Sat, 3 Feb 2018 12:02:02 +0100 Message-Id: <1517655722-20132-1-git-send-email-pct@crookies.net> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH 1/1] Odroid XU4: Hardkernel new board support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pierre CROKAERT MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch provides support for the board Odroid XU4 This version is using the latest 4.9 kernel released by Hardkernel, and the current u-boot 2017.05 also from Hardkernel. The support was implemented based on comments about Andi's patch (https://patchwork.ozlabs.org/patch/640695/). Signed-off-by: Pierre CROKAERT --- board/hardkernel/odroidxu4/boot.cmd | 10 +++ board/hardkernel/odroidxu4/boot.ini | 5 ++ board/hardkernel/odroidxu4/genimage.cfg | 28 ++++++++ .../odroidxu4/genimage_bootloader_fragment.cfg | 29 +++++++++ board/hardkernel/odroidxu4/post-image.sh | 50 ++++++++++++++ board/hardkernel/odroidxu4/readme.txt | 76 ++++++++++++++++++++++ configs/odroidxu4_defconfig | 28 ++++++++ 7 files changed, 226 insertions(+) create mode 100644 board/hardkernel/odroidxu4/boot.cmd create mode 100644 board/hardkernel/odroidxu4/boot.ini create mode 100644 board/hardkernel/odroidxu4/genimage.cfg create mode 100644 board/hardkernel/odroidxu4/genimage_bootloader_fragment.cfg create mode 100755 board/hardkernel/odroidxu4/post-image.sh create mode 100644 board/hardkernel/odroidxu4/readme.txt create mode 100644 configs/odroidxu4_defconfig diff --git a/board/hardkernel/odroidxu4/boot.cmd b/board/hardkernel/odroidxu4/boot.cmd new file mode 100644 index 0000000..2fb4c16 --- /dev/null +++ b/board/hardkernel/odroidxu4/boot.cmd @@ -0,0 +1,10 @@ +setenv kernelname zImage; +setenv boot_kernel "setenv bootargs \"${console} root=/dev/mmcblk${mmcrootdev}p${mmcrootpart} rootfstype=${rootfstype} rootwait ${opts}\"; +load mmc ${mmcbootdev}:${mmcbootpart} 0x40007FC0 '${kernelname}'; +if load mmc ${mmcbootdev}:${mmcbootpart} 40800000 ${fdtfile}; then + bootz 0x40007FC0 - 40800000; +else + echo Warning! Booting without DTB: '${fdtfile}'!; + bootz 0x40007FC0 -; +fi;" +run boot_kernel; \ No newline at end of file diff --git a/board/hardkernel/odroidxu4/boot.ini b/board/hardkernel/odroidxu4/boot.ini new file mode 100644 index 0000000..8a83a1a --- /dev/null +++ b/board/hardkernel/odroidxu4/boot.ini @@ -0,0 +1,5 @@ +ODROIDXU-UBOOT-CONFIG + +load mmc 0:1 0x44000000 'boot.scr' +source 0x44000000 + diff --git a/board/hardkernel/odroidxu4/genimage.cfg b/board/hardkernel/odroidxu4/genimage.cfg new file mode 100644 index 0000000..13d71cc --- /dev/null +++ b/board/hardkernel/odroidxu4/genimage.cfg @@ -0,0 +1,28 @@ +image boot.vfat { + vfat { + files = { + "boot.ini", + "boot.scr", + "zImage", + "exynos5422-odroidxu4.dtb" + } + } + size = 129M +} + +image sdcard.img { + hdimage { + } + + partition vfat { + partition-type = 0xC + image = "boot.vfat" + offset = 2097152 + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + size = 1024M + } +} diff --git a/board/hardkernel/odroidxu4/genimage_bootloader_fragment.cfg b/board/hardkernel/odroidxu4/genimage_bootloader_fragment.cfg new file mode 100644 index 0000000..a8e8379 --- /dev/null +++ b/board/hardkernel/odroidxu4/genimage_bootloader_fragment.cfg @@ -0,0 +1,29 @@ + partition bl1 { + in-partition-table = "no" + image = "bl1.bin.hardkernel" + offset = 512 + size = 15358 + } + + partition bl2 { + in-partition-table = "no" + image = "bl2.bin.hardkernel.720k_uboot" + offset = 15872 + size = 16384 + } + + partition u-boot { + in-partition-table = "no" + image = "u-boot-dtb.bin" + offset = 32256 + size = 720k + } + + partition tzsw { + in-partition-table = "no" + image = "tzsw.bin.hardkernel" + offset = 769536 + size = 256k + } + + diff --git a/board/hardkernel/odroidxu4/post-image.sh b/board/hardkernel/odroidxu4/post-image.sh new file mode 100755 index 0000000..1722c4b --- /dev/null +++ b/board/hardkernel/odroidxu4/post-image.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" +GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg" +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +cp ${BOARD_DIR}/boot.ini ${BINARIES_DIR}/ + +rm -rf "${GENIMAGE_TMP}" + +genimage \ + --rootpath "${TARGET_DIR}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" + +#dd if=${BINARIES_DIR}/u-boot.bin of=${BINARIES_DIR}/sdcard.img bs=1 count=442 conv=sync,notrunc +#dd if=${BINARIES_DIR}/u-boot.bin of=${BINARIES_DIR}/sdcard.img bs=512 skip=1 seek=1 conv=fsync,notrunc + +signed_bl1_position=0 +bl2_position=30 +uboot_position=62 +tzsw_position=1502 +device="${BINARIES_DIR}/sdcard.img" +uboot="${BINARIES_DIR}/u-boot-dtb.bin" + +env_position=2015 + +# +echo "BL1 fusing" +dd if=${BINARIES_DIR}/bl1.bin.hardkernel of=$device seek=$signed_bl1_position conv=fsync,notrunc + +# +echo "BL2 fusing" +dd if=${BINARIES_DIR}/bl2.bin.hardkernel.720k_uboot of=$device seek=$bl2_position conv=fsync,notrunc + +# +echo "u-boot fusing" +dd if=$uboot of=$device seek=$uboot_position conv=fsync,notrunc + +# +echo "TrustZone S/W fusing" +dd if=${BINARIES_DIR}/tzsw.bin.hardkernel of=$device seek=$tzsw_position conv=fsync,notrunc + +# +echo "u-boot env erase..." +dd if=/dev/zero of=$device seek=$env_position bs=512 count=32 conv=fsync,notrunc + + diff --git a/board/hardkernel/odroidxu4/readme.txt b/board/hardkernel/odroidxu4/readme.txt new file mode 100644 index 0000000..24a0184 --- /dev/null +++ b/board/hardkernel/odroidxu4/readme.txt @@ -0,0 +1,76 @@ +Odroid XU-4 board with Samsung Exynos 5422 SoC + +Introduction +------------ + +The Odroid XU 4 board is developed and shipped by Hrdkernel (hardkernel.com). It +uses the Samsung Exynos 5422 Soc. + +Odroid boot process +------------------- + +The odroid boot process requires three stages of boot plus trust zone: + + boot level 1 + + | + V + + boot level 2 + + | + V + + u-boot + +and they need to be raw copied to the SD card in the following order: + + +----------------+----------------+ + | boot level 1 | 1 block | + +----------------+----------------+ + | boot level 2 | 31 block | + +----------------+----------------+ + | u-boot | 63 block | + +----------------+----------------+ + | trust zone | 2111 block | + +----------------+----------------+ + | boot partition | 4096 block | + +----------------+----------------+ + | rootfs | | + +----------------+----------------+ + + +How to build it +=============== + + $ make odroidxu4_defconfig + +Then you can edit the build options using + + $ make menuconfig + +Compile all and build rootfs image: + + $ make + +Note: you will need to have access to the network, since Buildroot will +download the packages' sources. + +Result of the build +------------------- + +After building, you should obtain all output files in output/images/ + + +How to write the SD card or eMMC +================================ + +Once the build process is finished you will have an image called "sdcard.img" +in the output/images/ directory. + +Copy the bootable "sdcard.img" onto an SD card or eMMC with "dd": + + $ sudo dd if=output/images/sdcard.img of=/dev/sdX + +Insert the SDcard into your ODROID-XU4, and power it up. Your new system +should come up now. diff --git a/configs/odroidxu4_defconfig b/configs/odroidxu4_defconfig new file mode 100644 index 0000000..9feef3e --- /dev/null +++ b/configs/odroidxu4_defconfig @@ -0,0 +1,28 @@ +BR2_arm=y +BR2_cortex_a7=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/hardkernel/odroidxu4/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/hardkernel/linux/archive/jenkins-deb_kernel_5422_4.9-73.tar.gz" +BR2_LINUX_KERNEL_DEFCONFIG="odroidxu4" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="exynos5422-odroidxu4" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="1024M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/hardkernel/u-boot.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="88af53fbcef8386cb4d5f04c19f4b2bcb69e90ca" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="odroid-xu4" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_FORMAT_DTB_BIN=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="sd_fuse/bl1.bin.hardkernel sd_fuse/bl2.bin.hardkernel.720k_uboot sd_fuse/tzsw.bin.hardkernel " +BR2_TARGET_UBOOT_BOOT_SCRIPT=y +BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="board/hardkernel/odroidxu4/boot.cmd" +BR2_PACKAGE_HOST_GENIMAGE=y