From 89a6cc3e1fc88c399201c7c801dfdbb5ea53b2e6 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Wed, 28 Jun 2017 12:07:31 +0200 Subject: [PATCH] WIP target for Nanopi K2 --- config/boards/nanopik2.wip | 19 +++++++++++++++ config/sources/meson64.conf | 47 ++++++++++++++++++++++++------------- 2 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 config/boards/nanopik2.wip diff --git a/config/boards/nanopik2.wip b/config/boards/nanopik2.wip new file mode 100644 index 0000000000..e7f370f73d --- /dev/null +++ b/config/boards/nanopik2.wip @@ -0,0 +1,19 @@ +# S905 K2 quad core +BOARD_NAME="Nanopi K2" +LINUXFAMILY="meson64" +BOOTCONFIG="nanopi-k2_defconfig" +# +MODULES="" +MODULES_NEXT="" +# +KERNEL_TARGET="default" +CLI_TARGET="jessie,xenial:default" +CLI_BETA_TARGET="xenial:default" +DESKTOP_TARGET="xenial:default" +DESKTOP_BETA_TARGET="xenial:default" +# +RECOMMENDED="Ubuntu_xenial_default_desktop:90,Debian_jessie_default:90" +# +BOARDRATING="" +HARDWARE="http://docs.armbian.com/board_details/odroidc2/" +FORUMS="http://forum.armbian.com/index.php/forum/16-amlogic/" \ No newline at end of file diff --git a/config/sources/meson64.conf b/config/sources/meson64.conf index e274feb7ca..f31c386746 100644 --- a/config/sources/meson64.conf +++ b/config/sources/meson64.conf @@ -1,13 +1,16 @@ -BOOTSOURCE='https://github.com/hardkernel/u-boot.git' -BOOTBRANCH='branch:odroidc2-v2015.01' -BOOTDIR='u-boot-odroidc2' -BOOTPATCHDIR='u-boot-odroidc2' -UBOOT_USE_GCC='< 5.0' -BOOTSCRIPT='boot-odroid-c2.ini:boot.ini' +case $BOARD in + nanopik2) + BOOTSOURCE='https://github.com/friendlyarm/u-boot.git' + BOOTBRANCH='branch:nanopi-k2-v2015.01' + BOOTDIR='u-boot-nanopik2' + UBOOT_USE_GCC='< 5.0' + BOOTSCRIPT="boot-odroid-c2.ini:boot.ini" + UBOOT_TARGET_MAP='ARCH=arm;;fip/gxb/u-boot.bin' + HAS_UUID_SUPPORT=yes + ;; +esac -UBOOT_TARGET_MAP='ARCH=arm;;sd_fuse/bl1.bin.hardkernel sd_fuse/u-boot.bin' -HAS_UUID_SUPPORT=yes # NOTE: This u-boot version incorrectly parses boot.scr header # due to wrong data type for 64 bit compiler, so boot.scr doesn't work @@ -25,10 +28,7 @@ GOVERNOR=ondemand write_uboot_platform() { - dd if=$1/bl1.bin.hardkernel of=$2 bs=1 count=442 conv=fsync > /dev/null 2>&1 - dd if=$1/bl1.bin.hardkernel of=$2 bs=512 skip=1 seek=1 conv=fsync > /dev/null 2>&1 - dd if=$1/u-boot.bin of=$2 bs=512 seek=97 conv=fsync > /dev/null 2>&1 - #dd if=/dev/zero of=$2 seek=1249 count=799 bs=512 conv=fsync > /dev/null 2>&1 + dd if=$1/u-boot.bin of=$2 bs=512 seek=1 conv=fsync > /dev/null 2>&1 } family_tweaks() @@ -39,8 +39,23 @@ family_tweaks() sed -i 's/LIRCD_ARGS=.*/LIRCD_ARGS="--uinput"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf cp $SRC/lib/config/lirc.conf.odroidc2 $CACHEDIR/$SDCARD/etc/lirc/lircd.conf - install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$SDCARD/etc/ - sed -e 's/exit 0//g' -i $CACHEDIR/$SDCARD/etc/rc.local - echo "/etc/c2_init.sh" >> $CACHEDIR/$SDCARD/etc/rc.local - echo "exit 0" >> $CACHEDIR/$SDCARD/etc/rc.local + install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$SDCARD/usr/local/bin + # systemd service for c1_init.sh + cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/odroid-c2-hdmi.service + [Unit] + Description=Odroid C2 HDMI init + DefaultDependencies=no + Wants=rsyslog.service systemd-journald.service + Before=syslog.target sysinit.target + After=local-fs.target + + [Service] + Type=oneshot + ExecStart=/usr/local/bin/c2_init.sh + RemainAfterExit=no + + [Install] + WantedBy=sysinit.target + EOF + chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c2-hdmi.service >/dev/null 2>&1" }