aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/base-files/lib
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-11-02 10:18:50 +0000
committerJohn Crispin <john@openwrt.org>2015-11-02 10:18:50 +0000
commit25afe99b31f4ef3d835f96545e370770c230ac44 (patch)
tree5dbe83834a0a67121c557b7549a13221317f07eb /target/linux/mediatek/base-files/lib
parent12e0d2737f558e886cf698e939f1758ab6a64947 (diff)
downloadupstream-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/lib')
-rw-r--r--target/linux/mediatek/base-files/lib/mediatek.sh33
-rw-r--r--target/linux/mediatek/base-files/lib/preinit/03_preinit_do_mediatek.sh12
2 files changed, 45 insertions, 0 deletions
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