aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-envtools/files
diff options
context:
space:
mode:
Diffstat (limited to 'package/boot/uboot-envtools/files')
-rw-r--r--package/boot/uboot-envtools/files/ar71xx55
-rw-r--r--package/boot/uboot-envtools/files/cns3xxx28
-rw-r--r--package/boot/uboot-envtools/files/imx636
-rw-r--r--package/boot/uboot-envtools/files/kirkwood33
-rw-r--r--package/boot/uboot-envtools/files/lantiq31
-rw-r--r--package/boot/uboot-envtools/files/mvebu28
-rw-r--r--package/boot/uboot-envtools/files/mxs26
-rw-r--r--package/boot/uboot-envtools/files/oxnas27
-rw-r--r--package/boot/uboot-envtools/files/ramips33
-rw-r--r--package/boot/uboot-envtools/files/uboot-envtools.sh36
10 files changed, 333 insertions, 0 deletions
diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
new file mode 100644
index 0000000..0c81f32
--- /dev/null
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2014 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/ar71xx.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(ar71xx_board_name)
+
+case "$board" in
+all0258n | \
+cap4200ag | \
+carambola2 | \
+eap300v2 | \
+hornet-ub | \
+hornet-ub-x2 | \
+mr1750 | \
+mr600 | \
+mr600v2 | \
+mr900 | \
+mr900v2 | \
+nbg6716 | \
+om5p-an | \
+om5p | \
+tube2h | \
+wndr3700)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
+ ;;
+alfa-ap96 | \
+all0315n | \
+om2p | \
+om2pv2 | \
+om2p-hs | \
+om2p-hsv2 | \
+om2p-lc)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
+ ;;
+wzr-hp-ag300h)
+ ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
+ ;;
+qihoo-c301)
+ ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/cns3xxx b/package/boot/uboot-envtools/files/cns3xxx
new file mode 100644
index 0000000..a56be15
--- /dev/null
+++ b/package/boot/uboot-envtools/files/cns3xxx
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/cns3xxx.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(cns3xxx_board_name)
+
+case "$board" in
+laguna)
+ # Laguna uboot env size/erasesize vary depending on NOR vs SPI FLASH
+ size=$(grep mtd1 /proc/mtd | awk '{print $2}')
+ erasesize=$(grep mtd1 /proc/mtd | awk '{print $3}')
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x$size" "0x$erasesize"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/imx6 b/package/boot/uboot-envtools/files/imx6
new file mode 100644
index 0000000..d7412b2
--- /dev/null
+++ b/package/boot/uboot-envtools/files/imx6
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Copyright (C) 2013-2014 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/imx6.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(imx6_board_name)
+
+case "$board" in
+*gw5*)
+ if [ -c /dev/mtd1 ]; then
+ # board boots from NAND
+ ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000
+ ubootenv_add_uci_config /dev/mtd1 0x80000 0x20000 0x40000
+ else
+ # board boots from microSD
+ ubootenv_add_uci_config /dev/mmcblk0 0xb1400 0x20000 0x20000
+ ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000 0x20000
+ fi
+ ;;
+"wandboard")
+ ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood
new file mode 100644
index 0000000..98f85da
--- /dev/null
+++ b/package/boot/uboot-envtools/files/kirkwood
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright (C) 2012-2014 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/kirkwood.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(kirkwood_board_name)
+
+case "$board" in
+"ea3500")
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x20000"
+ ;;
+"ea4500" | \
+"guruplug-server-plus" | \
+"ib62x0" | \
+"pogo_e02" | \
+"sheevaplug" | \
+"sheevaplug-esata" )
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-envtools/files/lantiq
new file mode 100644
index 0000000..b152061
--- /dev/null
+++ b/package/boot/uboot-envtools/files/lantiq
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/functions/lantiq.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(lantiq_board_name)
+
+case "$board" in
+GIGASX76X)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
+ ;;
+BTHOMEHUBV2B)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
+ ;;
+P2812HNUF1)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu
new file mode 100644
index 0000000..2362bc3
--- /dev/null
+++ b/package/boot/uboot-envtools/files/mvebu
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright (C) 2014-2015 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/mvebu.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(mvebu_board_name)
+
+case "$board" in
+armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
+ ;;
+armada-xp-linksys-mamba)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/mxs b/package/boot/uboot-envtools/files/mxs
new file mode 100644
index 0000000..ab8b4ef
--- /dev/null
+++ b/package/boot/uboot-envtools/files/mxs
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/mxs.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(mxs_board_name)
+
+case "$board" in
+duckbill)
+ ubootenv_add_uci_config "/dev/mmcblk0" "0x20000" "0x20000"
+ ubootenv_add_uci_config "/dev/mmcblk0" "0x40000" "0x20000"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/oxnas b/package/boot/uboot-envtools/files/oxnas
new file mode 100644
index 0000000..063ffa0
--- /dev/null
+++ b/package/boot/uboot-envtools/files/oxnas
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/oxnas.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(oxnas_board_name)
+
+case "$board" in
+stg212 | \
+kd20)
+ ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x4000" "0x1F000" "1"
+ ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x4000" "0x1F000" "1"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
new file mode 100644
index 0000000..4640f43
--- /dev/null
+++ b/package/boot/uboot-envtools/files/ramips
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2012 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/ramips.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(ramips_board_name)
+
+case "$board" in
+all0239-3g | \
+all0256n | \
+all5002)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
+ ;;
+linkits7688 | \
+wsr-600 | \
+wsr-1166 | \
+br6425)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/uboot-envtools.sh b/package/boot/uboot-envtools/files/uboot-envtools.sh
new file mode 100644
index 0000000..e21b283
--- /dev/null
+++ b/package/boot/uboot-envtools/files/uboot-envtools.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2012 OpenWrt.org
+#
+
+ubootenv_add_uci_config() {
+ local dev=$1
+ local offset=$2
+ local envsize=$3
+ local secsize=$4
+ local numsec=$5
+ uci batch <<EOF
+add ubootenv ubootenv
+set ubootenv.@ubootenv[-1].dev='$dev'
+set ubootenv.@ubootenv[-1].offset='$offset'
+set ubootenv.@ubootenv[-1].envsize='$envsize'
+set ubootenv.@ubootenv[-1].secsize='$secsize'
+set ubootenv.@ubootenv[-1].numsec='$numsec'
+EOF
+ uci commit ubootenv
+}
+
+ubootenv_add_app_config() {
+ local dev
+ local offset
+ local envsize
+ local secsize
+ local numsec
+ config_get dev "$1" dev
+ config_get offset "$1" offset
+ config_get envsize "$1" envsize
+ config_get secsize "$1" secsize
+ config_get numsec "$1" numsec
+ echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config
+}
+