From f0da89a98b0a260a41d7e8f7de4707609cdeef20 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 23 Dec 2020 12:30:07 +0800 Subject: [PATCH] ramips: fix k2p 32m reboot problems (#6085) --- .../ramips/dts/mt7621_phicomm_k2p-32m.dts | 51 ++++++++++++++++-- .../linux/ramips/dts/mt7621_phicomm_k2p.dts | 53 +++++++++++++++++-- ...p_default.dtsi => mt7621_phicomm_k2p.dtsi} | 49 ----------------- target/linux/ramips/image/mt7621.mk | 2 +- 4 files changed, 98 insertions(+), 57 deletions(-) rename target/linux/ramips/dts/{mt7621_phicomm_k2p_default.dtsi => mt7621_phicomm_k2p.dtsi} (59%) diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts index 2f744c895..4df16e240 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts @@ -1,12 +1,55 @@ /dts-v1/; -#include "mt7621_phicomm_k2p_default.dtsi" +#include "mt7621_phicomm_k2p.dtsi" / { compatible = "phicomm,k2p-32m", "phicomm,k2p", "mediatek,mt7621-soc"; - model = "Phicomm K2P (32M)"; + model = "Phicomm K2P 32M"; }; -&firmware { - reg = <0xa0000 0x1f60000>; +&spi0 { + status = "okay"; + + m25p80@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + broken-flash-reset; + + 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 0x1f60000>; + }; + }; + }; }; diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts index d7101d600..85739bd90 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -1,7 +1,54 @@ /dts-v1/; -#include "mt7621_phicomm_k2p_default.dtsi" +#include "mt7621_phicomm_k2p.dtsi" -&firmware { - reg = <0xa0000 0xf60000>; +/ { + compatible = "phicomm,k2p", "mediatek,mt7621-soc"; + model = "Phicomm K2P"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + 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>; + }; + }; + }; }; diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p_default.dtsi b/target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi similarity index 59% rename from target/linux/ramips/dts/mt7621_phicomm_k2p_default.dtsi rename to target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi index cf38d43b4..a79d94f80 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p_default.dtsi +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi @@ -5,9 +5,6 @@ #include / { - compatible = "phicomm,k2p", "mediatek,mt7621-soc"; - model = "Phicomm K2P"; - aliases { led-boot = &led_blue; led-failsafe = &led_blue; @@ -49,52 +46,6 @@ }; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - 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"; - reg = <0xa0000 0xf60000>; - }; - }; - }; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index c08846f88..350d14dc3 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -825,7 +825,7 @@ define Device/phicomm_k2p-32m $(Device/phicomm_k2p) IMAGE_SIZE := 32128k DEVICE_VARIANT := 32M - SUPPORTED_DEVICES += k2p-32M + SUPPORTED_DEVICES += k2p-32m endef TARGET_DEVICES += phicomm_k2p-32m