diff options
author | Ian Pozella <Ian.Pozella@imgtec.com> | 2017-02-02 09:42:04 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-03-22 11:43:22 +0100 |
commit | 0d271cef8071d0698246b4b50a610b5ff718af01 (patch) | |
tree | fcb0806cd55456e354ba1318eba6e4075ed52f6d /target/linux/pistachio/base-files/lib/pistachio.sh | |
parent | 52c17bff3c861dc28517303e535b880473a54498 (diff) | |
download | upstream-0d271cef8071d0698246b4b50a610b5ff718af01.tar.gz upstream-0d271cef8071d0698246b4b50a610b5ff718af01.tar.bz2 upstream-0d271cef8071d0698246b4b50a610b5ff718af01.zip |
target: add pistachio
The Pistachio target is a MIPS interaptiv based SoC developed by
Imagination Technologies. It includes blocks for i2c, spi, audio,
usb and WiFi.
This also adds the base support for the 'Creator Ci40 (marduk)'
device which uses the Pistachio SoC to create an IoT hub by
including Bluetooth, WiFi and 6lowpan on one board. Additionally 2x
Mikrobus ports are available to expand with further RF technologies
or add sensors. You can find out more here http://creatordev.io.
Note, this commit is just the initial board support hence the
following are not expected to work yet:
* WiFi
* Bluetooth
* 6lowpan
* Audio
* Mikrobus uarts, user leds (clock dependency of 6lowpan chip)
The aim of this commit is to essentially have the same level of
support that currently exists in the mainline kernel.
Signed-off-by: Abhijit Mahajani <Abhijit.Mahajani@imgtec.com>
Signed-off-by: Francois Berder <francois.berder@imgtec.com>
Signed-off-by: Ian Pozella <Ian.Pozella@imgtec.com>
Signed-off-by: Mayank Sirotiya <Mayank.Sirotiya@imgtec.com>
Signed-off-by: Sean Kelly <Sean.Kelly@imgtec.com>
Diffstat (limited to 'target/linux/pistachio/base-files/lib/pistachio.sh')
-rwxr-xr-x | target/linux/pistachio/base-files/lib/pistachio.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/target/linux/pistachio/base-files/lib/pistachio.sh b/target/linux/pistachio/base-files/lib/pistachio.sh new file mode 100755 index 0000000000..f9a16db3ed --- /dev/null +++ b/target/linux/pistachio/base-files/lib/pistachio.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +PISTACHIO_BOARD_NAME= +PISTACHIO_MODEL= + +pistachio_board_detect() { + local machine + local name + + machine=$(cat /proc/device-tree/model) + + case "$machine" in + "IMG Marduk (Creator Ci40)") + name="marduk" + ;; + *) + name="generic" + ;; + esac + + [ -z "$PISTACHIO_BOARD_NAME" ] && PISTACHIO_BOARD_NAME="$name" + [ -z "$PISTACHIO_MODEL" ] && PISTACHIO_MODEL="$machine" + + [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" + + echo "$PISTACHIO_BOARD_NAME" > /tmp/sysinfo/board_name + echo "$PISTACHIO_MODEL" > /tmp/sysinfo/model +} + +pistachio_board_name() { + local name + [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) + [ -z "$name" ] && name="unknown" + + echo "$name" +} |