aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips')
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/01_leds5
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/02_network4
-rw-r--r--target/linux/ramips/dts/MIR3G.dts74
-rw-r--r--target/linux/ramips/image/mt7621.mk2
4 files changed, 59 insertions, 26 deletions
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index a0baa61027..c871dc4e48 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -253,8 +253,9 @@ miniembplug)
set_usb_led "$board:green:mobile"
;;
mir3g)
- ucidef_set_led_netdev "eth" "Ethernet" "$board:red:wan" "eth0"
- set_usb_led "$board:blue:usb"
+ ucidef_set_led_switch "wan-amber" "WAN (amber)" "$board:amber:wan" "switch0" "0x02" "0x08"
+ ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$board:amber:lan1" "switch0" "0x08" "0x08"
+ ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$board:amber:lan2" "switch0" "0x04" "0x08"
;;
miwifi-mini)
ucidef_set_led_default "power" "power" "$board:red:status" "1"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 862e99b0bb..a1a82d62ed 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -124,7 +124,7 @@ ramips_setup_interfaces()
;;
mir3g)
ucidef_add_switch "switch0" \
- "1:wan" "2:lan:2" "3:lan:1" "6@eth0"
+ "2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
;;
psg1218b)
ucidef_add_switch "switch0" \
@@ -429,7 +429,7 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
mir3g)
- lan_mac=$(mtd_get_mac_binary Factory e006)
+ lan_mac=$(mtd_get_mac_binary Factory 0xe006)
;;
miwifi-mini)
wan_mac=$(cat /sys/class/net/eth0/address)
diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts/MIR3G.dts
index 0cdb6d57f3..efe98b0e10 100644
--- a/target/linux/ramips/dts/MIR3G.dts
+++ b/target/linux/ramips/dts/MIR3G.dts
@@ -21,20 +21,36 @@
gpio-leds {
compatible = "gpio-leds";
- wan {
- label = "mir3g:red:wan";
+ status_red {
+ label = "mir3g:red:status";
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
};
- usb {
- label = "mir3g:blue:usb";
+ status_blue {
+ label = "mir3g:blue:status";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
};
- status {
+ status_yellow {
label = "mir3g:yellow:status";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
+
+ wan_amber {
+ label = "mir3g:amber:wan";
+ gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+ };
+
+ lan1_amber {
+ label = "mir3g:amber:lan1";
+ gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+ };
+
+ lan2_amber {
+ label = "mir3g:amber:lan2";
+ gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
+ };
+
};
gpio-keys-polled {
@@ -45,10 +61,21 @@
reset {
label = "reset";
- gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
+ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
+
+ gpio_export {
+ compatible = "gpio-export";
+ #size-cells = <0>;
+
+ usbpower {
+ gpio-export,name = "usbpower";
+ gpio-export,output = <1>;
+ gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+ };
+ };
};
&nand {
@@ -63,7 +90,6 @@
partition@80000 {
label = "Config";
reg = <0x80000 0x40000>;
- read-only;
};
partition@c0000 {
@@ -81,13 +107,11 @@
partition@140000 {
label = "crash";
reg = <0x140000 0x40000>;
- read-only;
};
partition@180000 {
label = "crash_syslog";
reg = <0x180000 0x40000>;
- read-only;
};
partition@1c0000 {
@@ -96,15 +120,22 @@
read-only;
};
- /*
- * kernel0 partition should be erased, so
- * u-boot in failsafe routine switches
- * to next one looking for kernel image.
- * To remind about this fact rename kernel0
- * into kernel_erase.
+ /* uboot expects to find kernels at 0x200000 & 0x600000
+ * referred to as system 1 & system 2 respectively.
+ * a kernel is considered suitable for handing control over
+ * if its linux magic number exists & uImage CRC are correct.
+ * If either of those conditions fail, a matching sys'n'_fail flag
+ * is set in uboot env & a restart performed in the hope that the
+ * alternate kernel is okay.
+ * if neither kernel checksums ok and both are marked failed, system 2
+ * is booted anyway.
+ *
+ * Note uboot's tftp flash install writes the transferred
+ * image to both kernel partitions.
*/
+
partition@200000 {
- label = "kernel_erase";
+ label = "kernel_stock";
reg = <0x200000 0x400000>;
};
@@ -114,12 +145,13 @@
};
/* ubi partition is the result of squashing
- * next consequent stock partitions:
- * - rootfs0 (rootfs partition for stock kernel0),
- * - rootfs1 (rootfs partition for stock failsafe kernel1),
+ * next consecutive stock partitions:
+ * - rootfs0 (rootfs partition for stock kernel0),
+ * - rootfs1 (rootfs partition for stock failsafe kernel1),
* - overlay (used as ubi overlay in stock fw)
* resulting 117,5MiB space for packages.
*/
+
partition@a00000 {
label = "ubi";
reg = <0xa00000 0x7580000>;
@@ -136,7 +168,7 @@
mediatek,mtd-eeprom = <&factory 0x0000>;
ieee80211-freq-limit = <2400000 2500000>;
};
- };
+ };
pcie1 {
wifi@14c3,7662 {
@@ -156,7 +188,7 @@
&pinctrl {
state_default: pinctrl0 {
gpio {
- ralink,group = "jtag", "uart3", "wdt";
+ ralink,group = "jtag", "uart2", "uart3", "wdt";
ralink,function = "gpio";
};
};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 779616292d..8bd7e0318f 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -121,7 +121,7 @@ define Device/mir3g
SUPPORTED_DEVICES += R3G
DEVICE_PACKAGES := \
kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini \
- kmod-softdog
+ uboot-envtools
endef
TARGET_DEVICES += mir3g