aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuanhong Guo <gch981213@gmail.com>2019-09-03 23:58:07 +0800
committerChuanhong Guo <gch981213@gmail.com>2019-09-04 19:26:01 +0800
commit7a21c85f7013d75bc1d30a62534a99d5f697f085 (patch)
treee3fb739dd8467f6961fea1cbbf36e903d4f0cd2d
parent7290963d0992b9aa412e0066dcf721857fbd40f7 (diff)
downloadupstream-7a21c85f7013d75bc1d30a62534a99d5f697f085.tar.gz
upstream-7a21c85f7013d75bc1d30a62534a99d5f697f085.tar.bz2
upstream-7a21c85f7013d75bc1d30a62534a99d5f697f085.zip
ramips: improve support for Xiaomi Miwifi Nano
This patch does the following things: 1. mark u-boot-env writable 2. add bootcount support Currently, u-boot has a flag_boot_success env variable to reset. Also reset it in our firmware to follow the behavior in vendor's firmware. 3. disable usb support This router doesn't have usb port at all. 4. increase spi clock to 40MHz 5. fix pinmux groups Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
-rwxr-xr-xtarget/linux/ramips/base-files/etc/init.d/bootcount3
-rw-r--r--target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts13
-rw-r--r--target/linux/ramips/image/mt76x8.mk2
3 files changed, 14 insertions, 4 deletions
diff --git a/target/linux/ramips/base-files/etc/init.d/bootcount b/target/linux/ramips/base-files/etc/init.d/bootcount
index 807801a34f..ad3dd97402 100755
--- a/target/linux/ramips/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/base-files/etc/init.d/bootcount
@@ -7,5 +7,8 @@ boot() {
samknows,whitebox-v8)
fw_setenv bootcount 0
;;
+ xiaomi,miwifi-nano)
+ fw_setenv flag_boot_success 1
+ ;;
esac
}
diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts
index 89a12edb7e..347ce6489c 100644
--- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts
+++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts
@@ -52,12 +52,20 @@
&pinctrl {
state_default: pinctrl0 {
gpio {
- ralink,group = "refclk", "wled_an", "gpio";
+ ralink,group = "gpio", "refclk", "wdt", "wled_an";
ralink,function = "gpio";
};
};
};
+&ehci {
+ status = "disabled";
+};
+
+&ohci {
+ status = "disabled";
+};
+
&wmac {
status = "okay";
ralink,mtd-eeprom = <&factory 0x4>;
@@ -73,7 +81,7 @@
m25p80@0 {
compatible = "jedec,spi-nor";
reg = <0>;
- spi-max-frequency = <10000000>;
+ spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
@@ -89,7 +97,6 @@
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
- read-only;
};
factory: partition@40000 {
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index 45fed11b54..a602d9df21 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -560,7 +560,7 @@ define Device/xiaomi_miwifi-nano
IMAGE_SIZE := 16064k
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := MiWiFi Nano
- DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
+ DEVICE_PACKAGES := uboot-envtools
SUPPORTED_DEVICES += miwifi-nano
endef
TARGET_DEVICES += xiaomi_miwifi-nano