alarm/uboot-odroid-xu3 to 2016.07-1

This commit is contained in:
Kevin Mihelich 2016-08-20 20:32:53 +00:00
parent 3e3e6f0769
commit 1503c2f16f
6 changed files with 119 additions and 53 deletions

View file

@ -0,0 +1,25 @@
From fe52a09cdd6e4d70c2a6523a2caaa5e3ce33b3c9 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sun, 15 Nov 2015 18:24:15 -0700
Subject: [PATCH] arch linux arm modifications
---
include/configs/odroid_xu3.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 5196d58..294a657 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -12,7 +12,7 @@
#include <configs/exynos5-common.h>
#undef CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_IDENT_STRING " for ODROID-XU3"
+#define CONFIG_IDENT_STRING " Arch Linux ARM"
#define CONFIG_BOARD_COMMON
--
2.9.0

View file

@ -4,30 +4,58 @@
buildarch=4
pkgname=uboot-odroid-xu3
pkgver=2012.07
pkgrel=3
pkgver=2016.07
pkgrel=1
pkgdesc="U-Boot for ODROID-XU3"
arch=('armv7h')
url="https://github.com/hardkernel/linux/tree/odroidxu3-3.10.y"
url='http://www.denx.de/wiki/U-Boot/WebHome'
license=('GPL')
install=$pkgname.install
backup=('boot/boot.ini')
_commit=814386d3e43b8ab8d81f04aa7fe402952503d8fe
source=("https://github.com/hardkernel/linux/raw/${_commit}/tools/hardkernel/prebuilt_uboot/bl1.bin"
"https://github.com/hardkernel/linux/raw/${_commit}/tools/hardkernel/prebuilt_uboot/bl2.bin"
"https://github.com/hardkernel/linux/raw/${_commit}/tools/hardkernel/prebuilt_uboot/tzsw.bin"
"https://github.com/hardkernel/linux/raw/${_commit}/tools/hardkernel/prebuilt_uboot/u-boot.bin"
backup=('boot/boot.txt' 'boot/boot.scr')
makedepends=('bc' 'dtc' 'git')
_commit=fe2f831fd44a4071f58a42f260164544697aa666
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
"bl1.bin::https://github.com/hardkernel/u-boot/raw/${_commit}/sd_fuse/hardkernel/bl1.bin.hardkernel"
'http://archlinuxarm.org/builder/src/xu3/bl2.bin'
"tzsw.bin::https://github.com/hardkernel/u-boot/raw/${_commit}/sd_fuse/hardkernel/tzsw.bin.hardkernel"
'0001-arch-linux-arm-modifications.patch'
'sd_fusing.sh'
'boot.ini')
md5sums=('3908379f82f972ece88ca1b5a280b5fd'
'8580c2b2701bf5936f42104b3cc5d725'
'boot.txt'
'mkscr')
md5sums=('425a3fa610a7d972e5092a0e92276c70'
'38fb058aa3bcc568f9547c85517949b9'
'09c42bed980921cfc914e97e067ba9a3'
'fd01dda20b999e0b731c7063431a42b3'
'85ff8b8e20fe4c7639ed87781f473512'
'b5616d1971ac48e93e2f92f8cd8eeba8'
'9e3083f40a05692c41f92f0439be0243')
'a24247db919d89e2fadf48b6760cb7f2'
'8a31acf5da5722698f54d1fe15c482bb'
'52306aa4cf2c3499ecfcea026fb2741c'
'021623a04afd29ac3f368977140cfbfd')
prepare() {
cd u-boot-${pkgver}
git apply ../0001-arch-linux-arm-modifications.patch
}
build() {
cd u-boot-${pkgver}
unset CFLAGS CXXFLAGS CPPFLAGS
make distclean
make odroid-xu3_config
make EXTRAVERSION=-${pkgrel}
}
package() {
cd u-boot-${pkgver}
mkdir -p "${pkgdir}"/boot
cp {bl{1,2},tzsw,u-boot}.bin sd_fusing.sh boot.ini "${pkgdir}"/boot
cp u-boot-dtb.bin ${pkgdir}/boot/u-boot.bin
cp ../{{bl{1,2},tzsw}.bin,sd_fusing.sh} "${pkgdir}"/boot
chmod +x "${pkgdir}"/boot/sd_fusing.sh
tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ../boot.txt "${pkgdir}"/boot/boot.scr
cp ../{boot.txt,mkscr} "${pkgdir}"/boot
}

View file

@ -1,25 +1,13 @@
ODROIDXU-UBOOT-CONFIG
# After modifying, run ./mkscr
# U-Boot Parameters
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"
# MAC address configuration
# setenv macaddr "00:1e:ee:61:7a:39"
# Mac address configuration
setenv macaddr "00:1e:06:61:7a:39"
#------------------------------------------------------------------------------------------------------
# Basic Arch Linux ARM Setup. Don't touch unless you know what you are doing.
# --------------------------------
setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=/dev/mmcblk0p1 rootwait rw"
# boot commands
setenv bootcmd "ext4load mmc 0:1 0x40008000 /boot/zImage; ext4load mmc 0:1 0x44000000 /boot/dtbs/exynos5422-odroidxu3.dtb; bootz 0x40008000 - 0x44000000"
# --- Screen Configuration for HDMI --- #
# ---------------------------------------
# --- Screen Configuration for HDMI on linux-odroid-xu3 ---
# ---------------------------------------------------------
# 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"
# -----------------------------------------------
@ -38,9 +26,15 @@ setenv bootcmd "ext4load mmc 0:1 0x40008000 /boot/zImage; ext4load mmc 0:1 0x440
# 1024x768 without monitor data using generic information
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1024x768.bin"
part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs "console=tty1 console=ttySAC2,115200n8 root=PARTUUID=${uuid} rw rootwait smsc95xx.macaddr=${macaddr} ${videoconfig}"
# final boot args
setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr}"
# drm.debug=0xff
# Boot the board
boot
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
bootz ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi

9
alarm/uboot-odroid-xu3/mkscr Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
if [[ ! -x /usr/bin/mkimage ]]; then
echo "mkimage not found. Please install uboot-tools:"
echo " pacman -S uboot-tools"
exit 1
fi
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr

View file

@ -44,13 +44,13 @@ if [ -n "$emmc" ]; then
signed_bl1_position=0
bl2_position=30
uboot_position=62
tzsw_position=718
tzsw_position=2110
device=$1boot0
else
signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
tzsw_position=2111
device=$1
fi

View file

@ -1,26 +1,28 @@
sd_fuse() {
if [ ! -b /dev/mmcblk0 ]; then
device=$1
if [ ! -b /dev/${device} ]; then
echo "No MMC device to flash, exiting."
exit 0
fi
if [ -d /sys/block/mmcblk0boot0 ]; then
echo "/dev/mmcblk0 is an eMMC card, disabling read-only.."
if ! echo 0 > /sys/block/mmcblk0boot0/force_ro; then
echo "Disabling read-only for /dev/mmcblk0boot0 failed."
if [ -d /sys/block/${device}boot0 ]; then
echo "/dev/${device} is an eMMC card, disabling read-only.."
if ! echo 0 > /sys/block/${device}boot0/force_ro; then
echo "Disabling read-only for /dev/${device}boot0 failed."
exit 1
fi
signed_bl1_position=0
bl2_position=30
uboot_position=62
tzsw_position=718
device=/dev/mmcblk0boot0
tzsw_position=2110
device=/dev/${device}boot0
else
signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
device=/dev/mmcblk0
tzsw_position=2111
device=/dev/${device}
fi
echo "BL1 fusing"
@ -34,14 +36,18 @@ sd_fuse() {
}
flash_uboot() {
echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0."
major=$(mountpoint -d / | cut -f 1 -d ':')
minor=$(expr $(mountpoint -d / | cut -f 2 -d ':') - 1)
device=$(cat /proc/partitions | awk {'if ($1 == "'${major}'" && $2 == "'${minor}'") print $4 '})
echo "A new U-Boot version needs to be flashed onto /dev/${device}."
echo "Do you want to do this now? [y|N]"
read -r shouldwe
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
sd_fuse
sd_fuse $device
else
echo "You can do this later by running:"
echo "# cd /boot; ./sd_fusing.sh /dev/mmcblk0"
echo "# cd /boot; ./sd_fusing.sh /dev/${device}"
fi
}
@ -50,5 +56,9 @@ post_install() {
}
post_upgrade() {
if (( $(vercmp $2 2016.07-1) < 0 )); then
echo ' >>> Note: boot.ini is no longer used. Make any customizations within /boot/boot.txt'
echo ' and run ./mkscr within /boot to convert it to the boot.scr file.'
fi
flash_uboot
}