diff options
author | John Crispin <john@openwrt.org> | 2015-11-02 10:18:50 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2015-11-02 10:18:50 +0000 |
commit | 25afe99b31f4ef3d835f96545e370770c230ac44 (patch) | |
tree | 5dbe83834a0a67121c557b7549a13221317f07eb /target/linux/mediatek/base-files | |
parent | 12e0d2737f558e886cf698e939f1758ab6a64947 (diff) | |
download | upstream-25afe99b31f4ef3d835f96545e370770c230ac44.tar.gz upstream-25afe99b31f4ef3d835f96545e370770c230ac44.tar.bz2 upstream-25afe99b31f4ef3d835f96545e370770c230ac44.zip |
mediatek: add support for the new MT7623 Arm SoC
the support is still WIP. next steps are to make the pmic and ethernet work.
this is the first commit to make sure nothing gets lost.
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 47354
Diffstat (limited to 'target/linux/mediatek/base-files')
-rw-r--r-- | target/linux/mediatek/base-files/etc/inittab | 3 | ||||
-rw-r--r-- | target/linux/mediatek/base-files/lib/mediatek.sh | 33 | ||||
-rw-r--r-- | target/linux/mediatek/base-files/lib/preinit/03_preinit_do_mediatek.sh | 12 |
3 files changed, 48 insertions, 0 deletions
diff --git a/target/linux/mediatek/base-files/etc/inittab b/target/linux/mediatek/base-files/etc/inittab new file mode 100644 index 0000000000..870b3cc76d --- /dev/null +++ b/target/linux/mediatek/base-files/etc/inittab @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS S boot +::shutdown:/etc/init.d/rcS K shutdown +ttyS0::askfirst:/bin/ash --login diff --git a/target/linux/mediatek/base-files/lib/mediatek.sh b/target/linux/mediatek/base-files/lib/mediatek.sh new file mode 100644 index 0000000000..8466c72ee3 --- /dev/null +++ b/target/linux/mediatek/base-files/lib/mediatek.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Copyright (C) 2015 OpenWrt.org +# + +mediatek_board_detect() { + local machine + local name + + machine=$(cat /proc/device-tree/model) + + case "$machine" in + "MediaTek MT7623 Evaluation Board") + name="mt7623_evb" + ;; + esac + + [ -z "$name" ] && name="unknown" + + [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" + + echo "$name" > /tmp/sysinfo/board_name + echo "$machine" > /tmp/sysinfo/model +} + +mediatek_board_name() { + local name + + [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) + [ -z "$name" ] && name="unknown" + + echo "$name" +} diff --git a/target/linux/mediatek/base-files/lib/preinit/03_preinit_do_mediatek.sh b/target/linux/mediatek/base-files/lib/preinit/03_preinit_do_mediatek.sh new file mode 100644 index 0000000000..9e5a18db1a --- /dev/null +++ b/target/linux/mediatek/base-files/lib/preinit/03_preinit_do_mediatek.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Copyright (c) 2014 The Linux Foundation. All rights reserved. +# + +do_mediatek() { + . /lib/mediatek.sh + + mediatek_board_detect +} + +boot_hook_add preinit_main do_mediatek |