123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts
- new file mode 100644
- index 000000000000..e828b069afb4
- --- /dev/null
- +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts
- @@ -0,0 +1,14 @@
- +#include "mt7621_phicomm_k2p.dtsi"
- +
- +/ {
- + compatible = "phicomm,k2p-32m", "mediatek,mt7621-soc";
- + model = "Phicomm K2P (32M)";
- +};
- +
- +&firmware {
- + reg = <0xa0000 0x1f60000>;
- +};
- +
- +&flash {
- + broken-flash-reset;
- +};
- diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
- index fa02521ba6c1..1a973a2a82ce 100644
- --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
- +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
- @@ -1,169 +1,10 @@
- -#include "mt7621.dtsi"
- -
- -#include <dt-bindings/gpio/gpio.h>
- -#include <dt-bindings/input/input.h>
- +#include "mt7621_phicomm_k2p.dtsi"
-
- / {
- compatible = "phicomm,k2p", "mediatek,mt7621-soc";
- model = "Phicomm K2P";
- -
- - aliases {
- - led-boot = &led_blue;
- - led-failsafe = &led_blue;
- - led-running = &led_blue;
- - led-upgrade = &led_blue;
- - };
- -
- - leds {
- - compatible = "gpio-leds";
- -
- - stat_r {
- - label = "red:status";
- - gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
- - };
- -
- - stat_y {
- - label = "yellow:status";
- - gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
- - };
- -
- - led_blue: stat_b {
- - label = "blue:status";
- - gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
- - };
- - };
- -
- - keys {
- - compatible = "gpio-keys";
- -
- - reset {
- - label = "reset";
- - gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
- - linux,code = <KEY_RESTART>;
- - };
- - };
- -};
- -
- -&spi0 {
- - status = "okay";
- -
- - flash@0 {
- - compatible = "jedec,spi-nor";
- - reg = <0>;
- - spi-max-frequency = <50000000>;
- -
- - partitions {
- - compatible = "fixed-partitions";
- - #address-cells = <1>;
- - #size-cells = <1>;
- -
- - 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 = "permanent_config";
- - reg = <0x50000 0x50000>;
- - read-only;
- - };
- -
- - partition@a0000 {
- - compatible = "denx,uimage";
- - label = "firmware";
- - reg = <0xa0000 0xf60000>;
- - };
- - };
- - };
- };
-
- -&pcie {
- - status = "okay";
- -};
- -
- -&pcie0 {
- - wifi@0,0 {
- - compatible = "mediatek,mt76";
- - reg = <0x0000 0 0 0 0>;
- - mediatek,mtd-eeprom = <&factory 0x0>;
- -
- - /* 5 GHz (phy1) does not take the address from calibration data,
- - but setting it manually here works */
- - nvmem-cells = <&macaddr_factory_4>;
- - nvmem-cell-names = "mac-address";
- - };
- -};
- -
- -&gmac0 {
- - nvmem-cells = <&macaddr_factory_e000>;
- - nvmem-cell-names = "mac-address";
- -};
- -
- -&switch0 {
- - ports {
- - port@0 {
- - status = "okay";
- - label = "lan1";
- - };
- -
- - port@1 {
- - status = "okay";
- - label = "lan2";
- - };
- -
- - port@2 {
- - status = "okay";
- - label = "lan3";
- - };
- -
- - port@3 {
- - status = "okay";
- - label = "lan4";
- - };
- -
- - port@4 {
- - status = "okay";
- - label = "wan";
- - nvmem-cells = <&macaddr_factory_e006>;
- - nvmem-cell-names = "mac-address";
- - };
- - };
- -};
- -
- -&state_default {
- - gpio {
- - groups = "i2c", "jtag";
- - function = "gpio";
- - };
- -};
- -
- -&factory {
- - compatible = "nvmem-cells";
- - #address-cells = <1>;
- - #size-cells = <1>;
- -
- - macaddr_factory_4: macaddr@4 {
- - reg = <0x4 0x6>;
- - };
- -
- - macaddr_factory_e000: macaddr@e000 {
- - reg = <0xe000 0x6>;
- - };
- -
- - macaddr_factory_e006: macaddr@e006 {
- - reg = <0xe006 0x6>;
- - };
- +&firmware {
- + reg = <0xa0000 0xf60000>;
- };
- diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi b/target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi
- new file mode 100644
- index 000000000000..90458050554c
- --- /dev/null
- +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi
- @@ -0,0 +1,165 @@
- +#include "mt7621.dtsi"
- +
- +#include <dt-bindings/gpio/gpio.h>
- +#include <dt-bindings/input/input.h>
- +
- +/ {
- + aliases {
- + led-boot = &led_blue;
- + led-failsafe = &led_blue;
- + led-running = &led_blue;
- + led-upgrade = &led_blue;
- + };
- +
- + leds {
- + compatible = "gpio-leds";
- +
- + stat_r {
- + label = "red:status";
- + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
- + };
- +
- + stat_y {
- + label = "yellow:status";
- + gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
- + };
- +
- + led_blue: stat_b {
- + label = "blue:status";
- + gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
- + };
- + };
- +
- + keys {
- + compatible = "gpio-keys";
- +
- + reset {
- + label = "reset";
- + gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
- + linux,code = <KEY_RESTART>;
- + };
- + };
- +};
- +
- +&spi0 {
- + status = "okay";
- +
- + flash: flash@0 {
- + compatible = "jedec,spi-nor";
- + reg = <0>;
- + spi-max-frequency = <50000000>;
- +
- + partitions {
- + compatible = "fixed-partitions";
- + #address-cells = <1>;
- + #size-cells = <1>;
- +
- + 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 = "permanent_config";
- + reg = <0x50000 0x50000>;
- + read-only;
- + };
- +
- + firmware: partition@a0000 {
- + compatible = "denx,uimage";
- + label = "firmware";
- + };
- + };
- + };
- +};
- +
- +&pcie {
- + status = "okay";
- +};
- +
- +&pcie0 {
- + wifi@0,0 {
- + compatible = "mediatek,mt76";
- + reg = <0x0000 0 0 0 0>;
- + mediatek,mtd-eeprom = <&factory 0x0>;
- +
- + /* 5 GHz (phy1) does not take the address from calibration data,
- + but setting it manually here works */
- + nvmem-cells = <&macaddr_factory_4>;
- + nvmem-cell-names = "mac-address";
- + };
- +};
- +
- +&gmac0 {
- + nvmem-cells = <&macaddr_factory_e000>;
- + nvmem-cell-names = "mac-address";
- +};
- +
- +&switch0 {
- + ports {
- + port@0 {
- + status = "okay";
- + label = "lan1";
- + };
- +
- + port@1 {
- + status = "okay";
- + label = "lan2";
- + };
- +
- + port@2 {
- + status = "okay";
- + label = "lan3";
- + };
- +
- + port@3 {
- + status = "okay";
- + label = "lan4";
- + };
- +
- + port@4 {
- + status = "okay";
- + label = "wan";
- + nvmem-cells = <&macaddr_factory_e006>;
- + nvmem-cell-names = "mac-address";
- + };
- + };
- +};
- +
- +&state_default {
- + gpio {
- + groups = "i2c", "jtag";
- + function = "gpio";
- + };
- +};
- +
- +&factory {
- + compatible = "nvmem-cells";
- + #address-cells = <1>;
- + #size-cells = <1>;
- +
- + macaddr_factory_4: macaddr@4 {
- + reg = <0x4 0x6>;
- + };
- +
- + macaddr_factory_e000: macaddr@e000 {
- + reg = <0xe000 0x6>;
- + };
- +
- + macaddr_factory_e006: macaddr@e006 {
- + reg = <0xe006 0x6>;
- + };
- +};
- diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
- index 8c3ef04e35f4..b043d14bd12f 100644
- --- a/target/linux/ramips/image/mt7621.mk
- +++ b/target/linux/ramips/image/mt7621.mk
- @@ -829,6 +829,16 @@ define Device/phicomm_k2p
- endef
- TARGET_DEVICES += phicomm_k2p
-
- +define Device/phicomm_k2p-32m
- + IMAGE_SIZE := 32128k
- + DEVICE_VENDOR := Phicomm
- + DEVICE_MODEL := K2P
- + DEVICE_VARIANT := 32M
- + SUPPORTED_DEVICES += k2p-32M
- + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
- +endef
- +TARGET_DEVICES += phicomm_k2p-32m
- +
- define Device/planex_vr500
- $(Device/uimage-lzma-loader)
- IMAGE_SIZE := 65216k
- --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
- +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
- @@ -28,7 +28,8 @@ case "$board" in
- > /sys${DEVPATH}/macaddress
- ;;
- dlink,dir-853-r1|\
- - phicomm,k2p)
- + phicomm,k2p|\
- + phicomm,k2p-32m)
- if [ "$PHYNBR" = "0" ]; then
- base_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1)
- macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress
|