From 35091282d44633322068feab53150fdcf484a34c Mon Sep 17 00:00:00 2001 From: Gottox Date: Mon, 27 Jan 2014 22:48:49 +0100 Subject: [PATCH 1/5] odroid-u2-base: splitting in odroid-u2-base and odroid-u2-uboot --- srcpkgs/odroid-u2-base/template | 19 +------ .../files/boot-1024x768-noedid.ini | 0 .../files/boot-1080p-edid.ini | 0 .../files/boot-1080p-noedid.ini | 0 .../files/boot-720p-edid.ini | 0 .../files/boot-720p-noedid.ini | 0 .../files/boot-auto_edid.ini | 0 srcpkgs/odroid-u2-uboot/files/config.patch | 13 +++++ srcpkgs/odroid-u2-uboot/files/odroid-led | 48 ++++++++++++++++ .../odroid-u2-uboot/files/odroid-led.default | 5 ++ .../odroid-u2-uboot/files/odroid-led.service | 9 +++ srcpkgs/odroid-u2-uboot/files/smc.patch | 20 +++++++ srcpkgs/odroid-u2-uboot/template | 57 +++++++++++++++++++ 13 files changed, 154 insertions(+), 17 deletions(-) rename srcpkgs/{odroid-u2-base => odroid-u2-uboot}/files/boot-1024x768-noedid.ini (100%) rename srcpkgs/{odroid-u2-base => odroid-u2-uboot}/files/boot-1080p-edid.ini (100%) rename srcpkgs/{odroid-u2-base => odroid-u2-uboot}/files/boot-1080p-noedid.ini (100%) rename srcpkgs/{odroid-u2-base => odroid-u2-uboot}/files/boot-720p-edid.ini (100%) rename srcpkgs/{odroid-u2-base => odroid-u2-uboot}/files/boot-720p-noedid.ini (100%) rename srcpkgs/{odroid-u2-base => odroid-u2-uboot}/files/boot-auto_edid.ini (100%) create mode 100644 srcpkgs/odroid-u2-uboot/files/config.patch create mode 100644 srcpkgs/odroid-u2-uboot/files/odroid-led create mode 100644 srcpkgs/odroid-u2-uboot/files/odroid-led.default create mode 100644 srcpkgs/odroid-u2-uboot/files/odroid-led.service create mode 100644 srcpkgs/odroid-u2-uboot/files/smc.patch create mode 100644 srcpkgs/odroid-u2-uboot/template diff --git a/srcpkgs/odroid-u2-base/template b/srcpkgs/odroid-u2-base/template index 0df5b49335a..092734aa552 100644 --- a/srcpkgs/odroid-u2-base/template +++ b/srcpkgs/odroid-u2-base/template @@ -1,6 +1,6 @@ # Template file for 'odroid-u2-base' pkgname=odroid-u2-base -version=1.5 +version=1.6 revision=1 build_style=meta homepage="http://www.voidlinux.eu" @@ -9,7 +9,7 @@ maintainer="Enno Boland " license="Public Domain" only_for_archs="armv7l" -makedepends="ntp?ntp-daemon dhcpcd openssh-server odroid-u2-kernel" +makedepends="ntp?ntp-daemon dhcpcd openssh-server odroid-u2-kernel odroid-u2-uboot" depends="${makedepends}" hostmakedepends="uboot-mkimage" @@ -21,26 +21,11 @@ replaces="odroid-u2-ubootcfg>=0" _default_scr="boot-auto_edid.scr" -do_build() { - # Building uboot scr's - for source in ${FILESDIR}/*.ini; do - name=$(basename ${source%.ini}) - mkimage -A arm -T script -C none -n "${name}" -d $source ${name}.scr - done - cp ${_default_scr} boot.scr -} - do_install() { # Set proper perms to some devices. vmkdir usr/lib/udev/rules.d echo 'KERNEL=="disp|cedar_dev|mali|ump", MODE="0660", GROUP="video"' > ${DESTDIR}/usr/lib/udev/rules.d/50-odroid-u2.rules - # Install uboot scr's - for scr in *.scr; do - echo $scr - vinstall $scr 600 boot - done - # Install LED utilities vinstall ${FILESDIR}/odroid-led 744 /usr/sbin vinstall ${FILESDIR}/odroid-led.default 744 /etc/default odroid-led diff --git a/srcpkgs/odroid-u2-base/files/boot-1024x768-noedid.ini b/srcpkgs/odroid-u2-uboot/files/boot-1024x768-noedid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-1024x768-noedid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-1024x768-noedid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-1080p-edid.ini b/srcpkgs/odroid-u2-uboot/files/boot-1080p-edid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-1080p-edid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-1080p-edid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-1080p-noedid.ini b/srcpkgs/odroid-u2-uboot/files/boot-1080p-noedid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-1080p-noedid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-1080p-noedid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-720p-edid.ini b/srcpkgs/odroid-u2-uboot/files/boot-720p-edid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-720p-edid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-720p-edid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-720p-noedid.ini b/srcpkgs/odroid-u2-uboot/files/boot-720p-noedid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-720p-noedid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-720p-noedid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-auto_edid.ini b/srcpkgs/odroid-u2-uboot/files/boot-auto_edid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-auto_edid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-auto_edid.ini diff --git a/srcpkgs/odroid-u2-uboot/files/config.patch b/srcpkgs/odroid-u2-uboot/files/config.patch new file mode 100644 index 00000000000..0a3d08270aa --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/files/config.patch @@ -0,0 +1,13 @@ +diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk +index 560c084..03a1fb9 100644 +--- a/arch/arm/cpu/armv7/config.mk ++++ b/arch/arm/cpu/armv7/config.mk +@@ -20,7 +20,7 @@ + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, + # MA 02111-1307 USA + # +-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float ++PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -mfloat-abi=hard -mfpu=vfpv3 + + # If armv7-a is not supported by GCC fall-back to armv5, which is + # supported by more tool-chains diff --git a/srcpkgs/odroid-u2-uboot/files/odroid-led b/srcpkgs/odroid-u2-uboot/files/odroid-led new file mode 100644 index 00000000000..06a622afba3 --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/files/odroid-led @@ -0,0 +1,48 @@ +#!/bin/bash + +usage() { + cat >&2 <&2 + exit 1; +} + +LED=/sys/class/leds/led1/brightness +MAXLED=/sys/class/leds/led1/max_brightness + + + +if [ $# -eq 1 ]; then + [ -z "$1" ] && usage + behavior=$1 +elif [ $# -gt 1 ]; then + usage; +elif [ -f /etc/default/odroid-led ]; then + . /etc/default/odroid-led + behavior=$LED_BOOT_BEHAVIOR + auto_config=1 +else + exit 1 +fi + + +case "$behavior" in + enable) + [ -f $LED -a -f $MAXLED ] || die "LED control file can not be found" + echo 0 > $LED + cat $MAXLED > $LED + ;; + disable) + [ -f $LED ] || die "LED control file can not be found" + echo 0 > $LED + ;; + *) + [ "$auto_config" ] || usage + exit 0; + ;; +esac diff --git a/srcpkgs/odroid-u2-uboot/files/odroid-led.default b/srcpkgs/odroid-u2-uboot/files/odroid-led.default new file mode 100644 index 00000000000..2c098a32daf --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/files/odroid-led.default @@ -0,0 +1,5 @@ +# LED_BOOT_BEHAVIOR: Control the behavior of the blue LED on boot +# enable: turn LED on +# disable: turn LED off +# auto: do nothing (LED will blink) +LED_BOOT_BEHAVIOR=enable diff --git a/srcpkgs/odroid-u2-uboot/files/odroid-led.service b/srcpkgs/odroid-u2-uboot/files/odroid-led.service new file mode 100644 index 00000000000..13d4aef5f90 --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/files/odroid-led.service @@ -0,0 +1,9 @@ +[Unit] +Description=Sets Odroids LED on boot + +[Service] +Type=oneshot +ExecStart=/usr/sbin/odroid-led + +[Install] +WantedBy=multi-user.target diff --git a/srcpkgs/odroid-u2-uboot/files/smc.patch b/srcpkgs/odroid-u2-uboot/files/smc.patch new file mode 100644 index 00000000000..570e87a6213 --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/files/smc.patch @@ -0,0 +1,20 @@ +diff --git a/board/samsung/smdk4x12/smc.c b/board/samsung/smdk4x12/smc.c +index fe3c1ed..b278193 100644 +--- a/board/samsung/smdk4x12/smc.c ++++ b/board/samsung/smdk4x12/smc.c +@@ -22,6 +22,7 @@ static inline u32 exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3) + register u32 reg3 __asm__("r3") = arg3; + + __asm__ volatile ( ++ ".arch_extension sec\n" + "smc 0\n" + : "+r"(reg0), "+r"(reg1), "+r"(reg2), "+r"(reg3) + +@@ -36,6 +37,7 @@ static inline u32 exynos_smc_read(u32 cmd) + register u32 reg1 __asm__("r1") = 0; + + __asm__ volatile ( ++ ".arch_extension sec\n" + "smc 0\n" + : "+r"(reg0), "+r"(reg1) + diff --git a/srcpkgs/odroid-u2-uboot/template b/srcpkgs/odroid-u2-uboot/template new file mode 100644 index 00000000000..a73816aa082 --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/template @@ -0,0 +1,57 @@ +# Template file for 'odroid-u2-uboot' +_githash=50140a35514f845a574bb21a8db04076c505bb42 +pkgname=odroid-u2-uboot +version=v2012.07 +revision=1 +wrksrc="u-boot-${_githash}" +hostmakedepends="uboot-mkimage" +short_desc="Odroid U2 U-Boot files for SD booting" +maintainer="Enno Boland " +license="GPL-2" +homepage="https://github.com/hardkernel/u-boot" +distfiles="https://github.com/hardkernel/u-boot/archive/${_githash}.tar.gz + http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz" +checksum="6478856a6c694f0718fe45dc4c1dc01d5cd1cfaca417ce047fc0619ccb0c0332 + e0db737d9e49f937425e4778b0ab892623bcc389d7c26329ba2e97ae7bb475c4" + +create_srcdir=yes +only_for_archs="armv7l" + +_default_scr="boot-auto_edid.scr" + +do_configure() { + patch -p1 < ${FILESDIR}/smc.patch + patch -p1 < ${FILESDIR}/config.patch + make smdk4412_config +} + +do_build() { + unset CFLAGS CXXFLAGS LDFLAGS + + if [ "$CROSS_BUILD" ]; then + make ARCH=arm CROSS_COMPILE=${XBPS_CROSS_TRIPLET}- + else + make ARCH=arm + fi + + # Building uboot scr's + for source in ${FILESDIR}/*.ini; do + name=$(basename ${source%.ini}) + mkimage -A arm -T script -C none -n "${name}" -d $source ${name}.scr + done + + cp ${_default_scr} boot.scr +} + +do_install() { + vinstall ${XBPS_BUILDDIR}/boot/E4412_S.bl1.HardKernel.bin 600 boot + vinstall ${XBPS_BUILDDIR}/boot/bl2.signed.bin 600 boot + vinstall ${XBPS_BUILDDIR}/boot/E4412_S.tzsw.signed.bin 600 boot + vinstall u-boot.bin 600 boot + + # Install uboot scr's + for scr in *.scr; do + echo $scr + vinstall $scr 600 boot + done +} From fbd0d606fb9600413c27eaf3159bfcb5f1e88831 Mon Sep 17 00:00:00 2001 From: Gottox Date: Mon, 27 Jan 2014 22:58:00 +0100 Subject: [PATCH 2/5] move odroid-led files back. --- srcpkgs/{odroid-u2-uboot/files => odroid-u2-base}/odroid-led | 0 .../{odroid-u2-uboot/files => odroid-u2-base}/odroid-led.default | 0 .../{odroid-u2-uboot/files => odroid-u2-base}/odroid-led.service | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename srcpkgs/{odroid-u2-uboot/files => odroid-u2-base}/odroid-led (100%) rename srcpkgs/{odroid-u2-uboot/files => odroid-u2-base}/odroid-led.default (100%) rename srcpkgs/{odroid-u2-uboot/files => odroid-u2-base}/odroid-led.service (100%) diff --git a/srcpkgs/odroid-u2-uboot/files/odroid-led b/srcpkgs/odroid-u2-base/odroid-led similarity index 100% rename from srcpkgs/odroid-u2-uboot/files/odroid-led rename to srcpkgs/odroid-u2-base/odroid-led diff --git a/srcpkgs/odroid-u2-uboot/files/odroid-led.default b/srcpkgs/odroid-u2-base/odroid-led.default similarity index 100% rename from srcpkgs/odroid-u2-uboot/files/odroid-led.default rename to srcpkgs/odroid-u2-base/odroid-led.default diff --git a/srcpkgs/odroid-u2-uboot/files/odroid-led.service b/srcpkgs/odroid-u2-base/odroid-led.service similarity index 100% rename from srcpkgs/odroid-u2-uboot/files/odroid-led.service rename to srcpkgs/odroid-u2-base/odroid-led.service From ba5811e20abc6f56824976f93553bb462d77243a Mon Sep 17 00:00:00 2001 From: Gottox Date: Tue, 28 Jan 2014 14:26:53 +0100 Subject: [PATCH 3/5] odroid-u2-uboot: splitting to odroid-u2-uboot odroid-u2-boot-fw --- srcpkgs/odroid-u2-base/template | 2 +- srcpkgs/odroid-u2-boot-fw/template | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/odroid-u2-boot-fw/template diff --git a/srcpkgs/odroid-u2-base/template b/srcpkgs/odroid-u2-base/template index 092734aa552..12312981cf3 100644 --- a/srcpkgs/odroid-u2-base/template +++ b/srcpkgs/odroid-u2-base/template @@ -9,7 +9,7 @@ maintainer="Enno Boland " license="Public Domain" only_for_archs="armv7l" -makedepends="ntp?ntp-daemon dhcpcd openssh-server odroid-u2-kernel odroid-u2-uboot" +makedepends="ntp?ntp-daemon dhcpcd openssh-server odroid-u2-kernel odroid-u2-uboot odroid-u2-boot-fw" depends="${makedepends}" hostmakedepends="uboot-mkimage" diff --git a/srcpkgs/odroid-u2-boot-fw/template b/srcpkgs/odroid-u2-boot-fw/template new file mode 100644 index 00000000000..73d30ec5b4e --- /dev/null +++ b/srcpkgs/odroid-u2-boot-fw/template @@ -0,0 +1,21 @@ +# Template file for 'odroid-u2-uboot' +pkgname=odroid-u2-boot-fw +version=1.0 +revision=1 +build_style=meta +wrksrc="boot" +short_desc="Odroid U2 proprietary boot files" +maintainer="Enno Boland " +license="proprietary" +homepage="http://dev.odroid.com/projects/4412boot/wiki/FrontPage" +distfiles="http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz" +checksum="e0db737d9e49f937425e4778b0ab892623bcc389d7c26329ba2e97ae7bb475c4" + +create_srcdir=yes +only_for_archs="armv7l" + +do_install() { + vinstall E4412_S.bl1.HardKernel.bin 600 boot + vinstall bl2.signed.bin 600 boot + vinstall E4412_S.tzsw.signed.bin 600 boot +} From c83319b111a8ea20ec6f748222f34d0bd2a33e63 Mon Sep 17 00:00:00 2001 From: Gottox Date: Tue, 28 Jan 2014 14:33:17 +0100 Subject: [PATCH 4/5] odroid-u2-uboot: use v2010.12 for odroid u3 --- srcpkgs/odroid-u2-uboot/files/config.patch | 6 +++--- srcpkgs/odroid-u2-uboot/template | 15 +++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/srcpkgs/odroid-u2-uboot/files/config.patch b/srcpkgs/odroid-u2-uboot/files/config.patch index 0a3d08270aa..d98d83a5e8c 100644 --- a/srcpkgs/odroid-u2-uboot/files/config.patch +++ b/srcpkgs/odroid-u2-uboot/files/config.patch @@ -1,5 +1,5 @@ diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk -index 560c084..03a1fb9 100644 +index 7f9b171..788caaa 100644 --- a/arch/arm/cpu/armv7/config.mk +++ b/arch/arm/cpu/armv7/config.mk @@ -20,7 +20,7 @@ @@ -9,5 +9,5 @@ index 560c084..03a1fb9 100644 -PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float +PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -mfloat-abi=hard -mfpu=vfpv3 - # If armv7-a is not supported by GCC fall-back to armv5, which is - # supported by more tool-chains + # Make ARMv5 to allow more compilers to work, even though its v7a. + PLATFORM_CPPFLAGS += -march=armv7-a diff --git a/srcpkgs/odroid-u2-uboot/template b/srcpkgs/odroid-u2-uboot/template index a73816aa082..a863f42c4a5 100644 --- a/srcpkgs/odroid-u2-uboot/template +++ b/srcpkgs/odroid-u2-uboot/template @@ -1,7 +1,7 @@ # Template file for 'odroid-u2-uboot' -_githash=50140a35514f845a574bb21a8db04076c505bb42 +_githash=89f2ab95e7304fe02e5267f1282fbc178550d528 pkgname=odroid-u2-uboot -version=v2012.07 +version=v2010.12 revision=1 wrksrc="u-boot-${_githash}" hostmakedepends="uboot-mkimage" @@ -9,10 +9,8 @@ short_desc="Odroid U2 U-Boot files for SD booting" maintainer="Enno Boland " license="GPL-2" homepage="https://github.com/hardkernel/u-boot" -distfiles="https://github.com/hardkernel/u-boot/archive/${_githash}.tar.gz - http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz" -checksum="6478856a6c694f0718fe45dc4c1dc01d5cd1cfaca417ce047fc0619ccb0c0332 - e0db737d9e49f937425e4778b0ab892623bcc389d7c26329ba2e97ae7bb475c4" +distfiles="https://github.com/hardkernel/u-boot/archive/${_githash}.tar.gz" +checksum="29593e636a0d908230910522aab74c09a35b92fee71b165d088f561e85ba3e1d" create_srcdir=yes only_for_archs="armv7l" @@ -20,7 +18,7 @@ only_for_archs="armv7l" _default_scr="boot-auto_edid.scr" do_configure() { - patch -p1 < ${FILESDIR}/smc.patch + make mrproper patch -p1 < ${FILESDIR}/config.patch make smdk4412_config } @@ -44,9 +42,6 @@ do_build() { } do_install() { - vinstall ${XBPS_BUILDDIR}/boot/E4412_S.bl1.HardKernel.bin 600 boot - vinstall ${XBPS_BUILDDIR}/boot/bl2.signed.bin 600 boot - vinstall ${XBPS_BUILDDIR}/boot/E4412_S.tzsw.signed.bin 600 boot vinstall u-boot.bin 600 boot # Install uboot scr's From e8741351458c82153ebe6d1a7bf5d6df56d2575a Mon Sep 17 00:00:00 2001 From: Gottox Date: Tue, 28 Jan 2014 14:34:37 +0100 Subject: [PATCH 5/5] odroid-u2-uboot: remove unused patch --- srcpkgs/odroid-u2-uboot/files/smc.patch | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 srcpkgs/odroid-u2-uboot/files/smc.patch diff --git a/srcpkgs/odroid-u2-uboot/files/smc.patch b/srcpkgs/odroid-u2-uboot/files/smc.patch deleted file mode 100644 index 570e87a6213..00000000000 --- a/srcpkgs/odroid-u2-uboot/files/smc.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/board/samsung/smdk4x12/smc.c b/board/samsung/smdk4x12/smc.c -index fe3c1ed..b278193 100644 ---- a/board/samsung/smdk4x12/smc.c -+++ b/board/samsung/smdk4x12/smc.c -@@ -22,6 +22,7 @@ static inline u32 exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3) - register u32 reg3 __asm__("r3") = arg3; - - __asm__ volatile ( -+ ".arch_extension sec\n" - "smc 0\n" - : "+r"(reg0), "+r"(reg1), "+r"(reg2), "+r"(reg3) - -@@ -36,6 +37,7 @@ static inline u32 exynos_smc_read(u32 cmd) - register u32 reg1 __asm__("r1") = 0; - - __asm__ volatile ( -+ ".arch_extension sec\n" - "smc 0\n" - : "+r"(reg0), "+r"(reg1) -