From 6fa2ae30bbfa0fb0919fcd0dd3b96b185594c7f1 Mon Sep 17 00:00:00 2001 From: Sebastian Schaper Date: Sun, 11 Feb 2024 18:53:07 +0100 Subject: [PATCH] ath79: split dtsi for D-Link COVR-P2500 in preparation of adding COVR-C1200 Signed-off-by: Sebastian Schaper --- .../ath79/dts/qca9563_dlink_covr-p2500-a1.dts | 163 +---------------- .../linux/ath79/dts/qca9563_dlink_covr.dtsi | 168 ++++++++++++++++++ target/linux/ath79/image/generic.mk | 12 +- 3 files changed, 177 insertions(+), 166 deletions(-) create mode 100644 target/linux/ath79/dts/qca9563_dlink_covr.dtsi diff --git a/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts b/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts index 3b0c2afb50..19bf874b64 100644 --- a/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts @@ -1,11 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca956x.dtsi" - -#include -#include -#include -#include +#include "qca9563_dlink_covr.dtsi" / { compatible = "dlink,covr-p2500-a1", "qca,qca9563"; @@ -18,22 +13,6 @@ led-upgrade = &led_power_red; }; - keys { - compatible = "gpio-keys"; - - wps { - label = "wps"; - linux,code = ; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - }; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 2 GPIO_ACTIVE_LOW>; - }; - }; - leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -70,144 +49,4 @@ linux,default-trigger = "phy1radio"; }; }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&fwconcat0 &fwconcat1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = <0x68737173>; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&spi { - 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 0x40000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x40000 0x10000>; - read-only; - }; - - fwconcat0: partition@50000 { - label = "fwconcat0"; - reg = <0x50000 0xe30000>; - }; - - partition@e80000 { - label = "loader"; - reg = <0xe80000 0x10000>; - read-only; - }; - - fwconcat1: partition@e90000 { - label = "fwconcat1"; - reg = <0xe90000 0x160000>; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x10000>; - read-only; - - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; - - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; - }; - }; - }; - }; - }; -}; - -&pcie { - status = "okay"; - - wifi@0,0 { - compatible = "qcom,ath10k"; - reg = <0 0 0 0 0>; - - nvmem-cells = <&precalibration_ath10k>; - nvmem-cell-names = "pre-calibration"; - }; -}; - -&gpio { - phy-reset { - gpio-hog; - gpios = <11 GPIO_ACTIVE_LOW>; - output-low; - line-name = "phy-reset"; - }; -}; - -&mdio0 { - status = "okay"; - - phy0: ethernet-phy@0 { - reg = <0>; - phy-mode = "sgmii"; - qca,mib-poll-interval = <500>; - - qca,ar8327-initvals = < - 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRAP */ - 0x50 0xcc35cc35 /* LED_CTRL0 */ - 0x54 0xcb37cb37 /* LED_CTRL1 */ - 0x58 0x00000000 /* LED_CTRL2 */ - 0x5c 0x00f3cf00 /* LED_CTRL3 */ - 0x7c 0x0000007e /* PORT0_STATUS */ - >; - }; -}; - -ð0 { - status = "okay"; - - pll-data = <0x03000101 0x00000101 0x00001919>; - - phy-mode = "sgmii"; - phy-handle = <&phy0>; -}; - -&wmac { - status = "okay"; - - nvmem-cells = <&calibration_ath9k>; - nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_dlink_covr.dtsi b/target/linux/ath79/dts/qca9563_dlink_covr.dtsi new file mode 100644 index 0000000000..5138cbc796 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_covr.dtsi @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include +#include +#include + +/ { + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = <0x68737173>; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&spi { + 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 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x50000 0xe30000>; + }; + + partition@e80000 { + label = "loader"; + reg = <0xe80000 0x10000>; + read-only; + }; + + fwconcat1: partition@e90000 { + label = "fwconcat1"; + reg = <0xe90000 0x160000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; + }; +}; + +&pcie { + status = "okay"; + + wifi0: wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + + nvmem-cells = <&precalibration_ath10k>; + nvmem-cell-names = "pre-calibration"; + }; +}; + +&gpio { + phy-reset { + gpio-hog; + gpios = <11 GPIO_ACTIVE_LOW>; + output-low; + line-name = "phy-reset"; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRAP */ + 0x50 0xcc35cc35 /* LED_CTRL0 */ + 0x54 0xcb37cb37 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x00f3cf00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&calibration_ath9k>; + nvmem-cell-names = "calibration"; +}; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 3bdc043738..d5d8aa5592 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1007,21 +1007,25 @@ define Device/devolo_magic-2-wifi endef TARGET_DEVICES += devolo_magic-2-wifi -define Device/dlink_covr-p2500-a1 +define Device/dlink_covr $(Device/loader-okli-uimage) SOC := qca9563 DEVICE_VENDOR := D-Link - DEVICE_MODEL := COVR-P2500 - DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct LOADER_FLASH_OFFS := 0x050000 LOADER_KERNEL_MAGIC := 0x68737173 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x68737173 IMAGE_SIZE := 14528k - IMAGES += factory.bin recovery.bin IMAGE/recovery.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | check-size | pad-to 14528k | \ append-loader-okli-uimage $(1) | pad-to 15616k +endef + +define Device/dlink_covr-p2500-a1 + $(Device/dlink_covr) + DEVICE_MODEL := COVR-P2500 + DEVICE_VARIANT := A1 + IMAGES += factory.bin recovery.bin IMAGE/factory.bin := $$(IMAGE/recovery.bin) | \ dlink-sge-image COVR-P2500 | dlink-sge-signature COVR-P2500 endef -- 2.30.2