Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From a7340d61cfa8bc5a00794344f551972110c38263 Mon Sep 17 00:00:00 2001
- From: VecH <vech2k@gmail.com>
- Date: Sun, 17 Feb 2019 20:56:31 +0900
- Subject: [PATCH] Add support Nexx WT3020 flash 16M
- ---
- target/linux/ramips/base-files/lib/ramips.sh | 3 +
- target/linux/ramips/dts/WT3020-16M.dts | 102 +++++++++++++++++++
- target/linux/ramips/image/mt7620.mk | 10 ++
- tools/firmware-utils/src/mkporayfw.c | 34 ++++---
- 4 files changed, 134 insertions(+), 15 deletions(-)
- create mode 100644 target/linux/ramips/dts/WT3020-16M.dts
- diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
- index 5741cbd2ee..f53f28a22a 100755
- --- a/target/linux/ramips/base-files/lib/ramips.sh
- +++ b/target/linux/ramips/base-files/lib/ramips.sh
- @@ -658,6 +658,9 @@ ramips_board_detect() {
- *"WT3020 (8M)")
- name="wt3020-8M"
- ;;
- + *"WT3020 (16M)")
- + name="wt3020-16M"
- + ;;
- *"WZR-AGL300NH")
- name="wzr-agl300nh"
- ;;
- diff --git a/target/linux/ramips/dts/WT3020-16M.dts b/target/linux/ramips/dts/WT3020-16M.dts
- new file mode 100644
- index 0000000000..a55bfa684a
- --- /dev/null
- +++ b/target/linux/ramips/dts/WT3020-16M.dts
- @@ -0,0 +1,102 @@
- +/dts-v1/;
- +
- +#include "mt7620n.dtsi"
- +
- +#include <dt-bindings/gpio/gpio.h>
- +#include <dt-bindings/input/input.h>
- +
- +/ {
- + compatible = "wt3020", "ralink,mt7620n-soc";
- + model = "Nexx WT3020 (16M)";
- +
- + gpio-keys-polled {
- + compatible = "gpio-keys-polled";
- + #address-cells = <1>;
- + #size-cells = <0>;
- + poll-interval = <20>;
- +
- + reset {
- + label = "reset";
- + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
- + linux,code = <KEY_RESTART>;
- + };
- + };
- +
- + gpio-leds {
- + compatible = "gpio-leds";
- +
- + power {
- + label = "wt3020:blue:power";
- + gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
- + };
- + };
- +};
- +
- +&gpio2 {
- + status = "okay";
- +};
- +
- +&gpio3 {
- + status = "okay";
- +};
- +
- +&spi0 {
- + status = "okay";
- +
- + m25p80@0 {
- + #address-cells = <1>;
- + #size-cells = <1>;
- + compatible = "jedec,spi-nor";
- + reg = <0>;
- + spi-max-frequency = <10000000>;
- +
- + partition@0 {
- + label = "u-boot";
- + reg = <0x0 0x30000>;
- + read-only;
- + };
- +
- + partition@30000 {
- + label = "u-boot-env";
- + reg = <0x30000 0x10000>;
- + read-only;
- + };
- +
- + factory: partition@40000 {
- + label = "factory";
- + reg = <0x40000 0x10000>;
- + read-only;
- + };
- +
- + partition@50000 {
- + label = "firmware";
- + reg = <0x50000 0xfb0000>;
- + };
- + };
- +};
- +
- +&ehci {
- + status = "okay";
- +};
- +
- +&ohci {
- + status = "okay";
- +};
- +
- +ðernet {
- + mtd-mac-address = <&factory 0x4>;
- + mediatek,portmap = "wllll";
- +};
- +
- +&wmac {
- + ralink,mtd-eeprom = <&factory 0>;
- +};
- +
- +&pinctrl {
- + state_default: pinctrl0 {
- + default {
- + ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
- + ralink,function = "gpio";
- + };
- + };
- +};
- diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
- index f627627192..e6e114b9d5 100644
- --- a/target/linux/ramips/image/mt7620.mk
- +++ b/target/linux/ramips/image/mt7620.mk
- @@ -541,6 +541,16 @@ define Device/wn3000rpv3
- endef
- TARGET_DEVICES += wn3000rpv3
- +define Device/wt3020-16M
- + DTS := WT3020-16M
- + IMAGES += factory.bin
- + IMAGE_SIZE := $(ralink_default_fw_size_16M)
- + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
- + poray-header -B WT3020 -F 16M
- + DEVICE_TITLE := Nexx WT3020 (16MB)
- +endef
- +TARGET_DEVICES += wt3020-16M
- +
- define Device/wrh-300cr
- DTS := WRH-300CR
- IMAGE_SIZE := $(ralink_default_fw_size_16M)
- diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c
- index 6ec4f320d9..0cb0e8b694 100644
- --- a/tools/firmware-utils/src/mkporayfw.c
- +++ b/tools/firmware-utils/src/mkporayfw.c
- @@ -135,6 +135,9 @@ static struct flash_layout layouts[] = {
- }, {
- .id = "8M",
- .fw_max_len = 0x7c0000,
- + }, {
- + .id = "16M",
- + .fw_max_len = 0xfc0000,
- }, {
- /* terminating entry */
- }
- @@ -221,21 +224,22 @@ static struct board_info boards[] = {
- .hw_id = HWID_NEXX_WT1520,
- .layout_id = "8M",
- .key = KEY_NEXX_1,
- - }, {
- - .id = "WT3020",
- - .hw_id = HWID_NEXX_WT3020,
- - .layout_id = "4M",
- - .key = KEY_NEXX_2,
- - }, {
- - .id = "WT3020",
- - .hw_id = HWID_NEXX_WT3020,
- - .layout_id = "8M",
- - .key = KEY_NEXX_2,
- - }, {
- -
- -
- -
- -
- + }, {
- + .id = "WT3020",
- + .hw_id = HWID_NEXX_WT3020,
- + .layout_id = "4M",
- + .key = KEY_NEXX_2,
- + }, {
- + .id = "WT3020",
- + .hw_id = HWID_NEXX_WT3020,
- + .layout_id = "8M",
- + .key = KEY_NEXX_2,
- + }, {
- + .id = "WT3020",
- + .hw_id = HWID_NEXX_WT3020,
- + .layout_id = "16M",
- + .key = KEY_NEXX_2,
- + }, {
- /* terminating entry */
- }
- };
- --
- 2.17.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement