From 9ccd1da444ff320abf069322b6063d7d041cdd20 Mon Sep 17 00:00:00 2001 From: Luka Perkov Date: Tue, 10 May 2016 22:52:00 +0000 Subject: target: socfpga: Add Altera SoCFPGA support This patch adds support for the Altera SoCFPGA target. Both generic target and Terasic SoCkit boards are supported. Signed-off-by: Marek Vasut git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49367 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/socfpga/base-files/etc/fw_env.config | 3 +++ .../socfpga/base-files/etc/init.d/sockit_vtcon | 15 +++++++++++++ .../socfpga/base-files/etc/uci-defaults/01_leds | 22 +++++++++++++++++++ .../socfpga/base-files/etc/uci-defaults/02_network | 25 ++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 target/linux/socfpga/base-files/etc/fw_env.config create mode 100755 target/linux/socfpga/base-files/etc/init.d/sockit_vtcon create mode 100644 target/linux/socfpga/base-files/etc/uci-defaults/01_leds create mode 100644 target/linux/socfpga/base-files/etc/uci-defaults/02_network (limited to 'target/linux/socfpga/base-files/etc') diff --git a/target/linux/socfpga/base-files/etc/fw_env.config b/target/linux/socfpga/base-files/etc/fw_env.config new file mode 100644 index 0000000000..f6fe3f9bea --- /dev/null +++ b/target/linux/socfpga/base-files/etc/fw_env.config @@ -0,0 +1,3 @@ +# MTD device name Device offset Env. size Flash sector size +/dev/mtd1 0x0 0x1000 0x10000 +/dev/mtd2 0x0 0x1000 0x10000 diff --git a/target/linux/socfpga/base-files/etc/init.d/sockit_vtcon b/target/linux/socfpga/base-files/etc/init.d/sockit_vtcon new file mode 100755 index 0000000000..6555f5b348 --- /dev/null +++ b/target/linux/socfpga/base-files/etc/init.d/sockit_vtcon @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common + +START=99 + +start() { + . /lib/socfpga.sh + + local board=$(socfpga_board_name) + + # Print something nice on the VTcon (the SPI LCD) + if [ "${board}" = "socfpga-sockit" ] ; then + echo "OpenWRT" > /dev/tty0 + uci show network.lan.ipaddr > /dev/tty0 + fi +} diff --git a/target/linux/socfpga/base-files/etc/uci-defaults/01_leds b/target/linux/socfpga/base-files/etc/uci-defaults/01_leds new file mode 100644 index 0000000000..a04de3b40e --- /dev/null +++ b/target/linux/socfpga/base-files/etc/uci-defaults/01_leds @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copyright (C) 2015 OpenWrt.org +# + +. /lib/functions/uci-defaults.sh +. /lib/socfpga.sh + +board=$(socfpga_board_name) + +case "$board" in +"socfpga-sockit") + ucidef_set_led_netdev "lan" "LAN" "hps:blue:led0" "eth0" + ucidef_set_led_mmc "mmc" "MMC" "hps:blue:led1" "mmc0" + ucidef_set_led_default "health" "health" "hps:blue:led2" "1" + ucidef_set_led_default "fault" "fault" "hps:blue:led3" "1" + ;; +esac + +ucidef_commit_leds + +exit 0 diff --git a/target/linux/socfpga/base-files/etc/uci-defaults/02_network b/target/linux/socfpga/base-files/etc/uci-defaults/02_network new file mode 100644 index 0000000000..479e8202f7 --- /dev/null +++ b/target/linux/socfpga/base-files/etc/uci-defaults/02_network @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Copyright (C) 2015 OpenWrt.org +# + +[ -e /etc/config/network ] && exit 0 + +touch /etc/config/network + +. /lib/functions/uci-defaults.sh +. /lib/socfpga.sh + +board=$(socfpga_board_name) + +ucidef_set_interface_loopback + +case "$board" in +"socfpga-sockit") + ucidef_set_interface_lan 'eth0' + ;; +esac + +uci commit network + +exit 0 -- cgit v1.2.3