[OpenWrt-Devel] [PATCH v2] ipq40xx: Add support for IPQ4019 ap-dk07.1-c1
Christian Lamparter
chunkeey at gmail.com
Fri Sep 7 11:06:28 EDT 2018
On Friday, September 7, 2018 2:10:30 PM CEST Ram Chandra Jangir wrote:
> * SoC: QCA IPQ4019
> * RAM: 512 MiB
> * Flash: 32 MiB of SPI NOR and 128 MiB NAND
> * Wireless: 2.4-GHz 802.11ng, and two 5-GHz 802.11ac
> * IoT :
> CSR8811 radio [ supports BT classic and BLE ]
> SiLabs EFR32MG radio [ supports 802.15.4 ZigBee ]
>
> Tested on IPQ ap-dk07.1-c1 Board:
> 1) NOR boot and NAND boot
> 2) Tested USB and PCIe interfaces
Wait, usb is not enabled in the dts.
> 3) WDOG test
> 4) cpu frequency scaling
Hey, that's great. Glad to hear that it is working.
So, do you know of the upstream status of the cpu frequency
scaling fix that OpenWrt carries:
<https://patchwork.codeaurora.org/patch/473589/>
Because it would be a real shame if that wasn't fixed upstream too,
right?
> 5) ethernet, 2G and 5G WiFi
>
>
> The ap-dk07.1-c1 board is already available in upstream
> linux v4.17
>
> Signed-off-by: Ram Chandra Jangir <rjangir at codeaurora.org>
I do have a few comments down below.
> ---
> Changes since v1:
> Fixed commit message for Wireless 2.4-GHz 802.11ng
> Updated description for 904-Fix-rootfs-*-mount.patch
>
> .../etc/hotplug.d/firmware/11-ath10k-caldata | 6 +-
> target/linux/ipq40xx/image/Makefile | 13 +++
> ...ipq4019-Add-ipq4019-ap.dk07.1-common-data.patch | 99 ++++++++++++++++++++++
> ...4019-Add-qcom-ipq4019-ap.dk07.1-c1-board-.patch | 99 ++++++++++++++++++++++
> ...x-rootfs-conflict-with-OpenWrt-auto-mount.patch | 40 +++++++++
> ...5-dts-qcom-ipq4019-ap.dk07.1-enable-nodes.patch | 79 +++++++++++++++++
> 6 files changed, 334 insertions(+), 2 deletions(-)
> create mode 100644 target/linux/ipq40xx/patches-4.14/902-ARM-dts-ipq4019-Add-ipq4019-ap.dk07.1-common-data.patch
> create mode 100644 target/linux/ipq40xx/patches-4.14/903-ARM-dts-ipq4019-Add-qcom-ipq4019-ap.dk07.1-c1-board-.patch
> create mode 100644 target/linux/ipq40xx/patches-4.14/904-Fix-rootfs-conflict-with-OpenWrt-auto-mount.patch
> create mode 100644 target/linux/ipq40xx/patches-4.14/905-dts-qcom-ipq4019-ap.dk07.1-enable-nodes.patch
>
> diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> index 1d4fd9c..83518c9 100644
> --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> @@ -143,7 +143,8 @@ case "$FIRMWARE" in
> ;;
> compex,wpj428 |\
> openmesh,a42 |\
> - openmesh,a62)
> + openmesh,a62 |\
> + qcom,ap-dk07.1-c1)
> ath10kcal_extract "0:ART" 4096 12064
> ;;
> zyxel,nbg6617 |\
> @@ -179,7 +180,8 @@ case "$FIRMWARE" in
> ;;
> compex,wpj428 |\
> openmesh,a42 |\
> - openmesh,a62)
> + openmesh,a62 |\
> + qcom,ap-dk07.1-c1)
> ath10kcal_extract "0:ART" 20480 12064
> ;;
> zyxel,nbg6617 |\
> diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile
> index 5cd11ca..bee2145 100644
> --- a/target/linux/ipq40xx/image/Makefile
> +++ b/target/linux/ipq40xx/image/Makefile
> @@ -207,6 +207,19 @@ define Device/qcom_ap-dk04.1-c1
> endef
> TARGET_DEVICES += qcom_ap-dk04.1-c1
>
> +define Device/qcom_ap-dk07.1-c1
> + $(call Device/FitImage)
> + $(call Device/UbiFit)
> + BOARD_NAME := ap-dk07.1-c1
This is a new device. So, why do you need a legacy BOARD_NAME for it?
> + DEVICE_DTS := qcom-ipq4019-ap.dk07.1-c1
> + KERNEL_INSTALL := 1
> + KERNEL_SIZE := 4096k
> + BLOCKSIZE := 128k
> + PAGESIZE := 2048
> + DEVICE_TITLE := QCA AP-DK07.1-C1
> +endef
> +TARGET_DEVICES += qcom_ap-dk07.1-c1
What's wrong with calling the device "qcom_ipq4019-ap.dk07.1-c1"?
By the way:
Also, John is preparing to drop ath10k:
<https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=commit;h=f9ccc8f64670e3e15b160cffb19f1ef1a8519e97>
| author John Crispin <john at phrozen.org>
| Wed, 5 Sep 2018 14:51:44 +0200 (14:51 +0200)
| committer John Crispin <john at phrozen.org>
| Thu, 6 Sep 2018 19:00:21 +0200 (19:00 +0200)
| commit f9ccc8f64670e3e15b160cffb19f1ef1a8519e97
|
|treewide: drop ath10k support
|
|people should use ath10k-ct instead
|
|Signed-off-by: John Crispin <john at phrozen.org>
So please make sure that the Wi-Fis are indeed working with ath10k-ct.
> define Device/zyxel_nbg6617
> $(call Device/FitImageLzma)
> DEVICE_DTS := qcom-ipq4018-nbg6617
> diff --git a/target/linux/ipq40xx/patches-4.14/902-ARM-dts-ipq4019-Add-ipq4019-ap.dk07.1-common-data.patch b/target/linux/ipq40xx/patches-4.14/902-ARM-dts-ipq4019-Add-ipq4019-ap.dk07.1-common-data.patch
> new file mode 100644
> index 0000000..bcc109f
> --- /dev/null
> +++ b/target/linux/ipq40xx/patches-4.14/902-ARM-dts-ipq4019-Add-ipq4019-ap.dk07.1-common-data.patch
> @@ -0,0 +1,99 @@
> +From f97b2aaaf0734a3a6dd6effff6ee0aaa0a69cab5 Mon Sep 17 00:00:00 2001
> +From: Sricharan R <sricharan at codeaurora.org>
> +Date: Fri, 25 May 2018 11:41:17 +0530
> +Subject: [PATCH] ARM: dts: ipq4019: Add ipq4019-ap.dk07.1 common data
> +
> +Add the common data for all dk07 based boards.
> +
> +Reviewed-by: Abhishek Sahu <absahu at codeaurora.org>
> +Signed-off-by: Sricharan R <sricharan at codeaurora.org>
> +Signed-off-by: Andy Gross <andy.gross at linaro.org>
> +---
> + arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1.dtsi | 75 +++++++++++++++++++++++++++
> + 1 file changed, 75 insertions(+)
> + create mode 100644 arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1.dtsi
> +
> +diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1.dtsi b/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1.dtsi
> +new file mode 100644
> +index 0000000..9f1a5a66
> +--- /dev/null
> ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1.dtsi
I guess you'll need to push those changes upstream.
> +@@ -0,0 +1,75 @@
> ++// SPDX-License-Identifier: GPL-2.0
> ++// Copyright (c) 2018, The Linux Foundation. All rights reserved.
> ++
> ++#include "qcom-ipq4019.dtsi"
> ++#include <dt-bindings/input/input.h>
> ++#include <dt-bindings/gpio/gpio.h>
I noticed that you included input.h put none of these reference
boards actually define any gpio-keys.
So, what's the reason here? Are these DTS actually for real "boards" or
are they just for show? (Also related: why is there no system/power LED
defined?)
> ++/ {
> ++ model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK07.1";
> ++
> ++ memory {
> ++ device_type = "memory";
> ++ reg = <0x80000000 0x20000000>; /* 512MB */
> ++ };
> ++
> ++ aliases {
> ++ serial0 = &blsp1_uart1;
> ++ serial1 = &blsp1_uart2;
(The alias node and chosen node was removed later in a separate
patch.)
> ++ };
> ++
> ++ chosen {
> ++ stdout-path = "serial0:115200n8";
> ++ };
> ++
> ++ soc {
> ++ pinctrl at 1000000 {
> ++ serial_0_pins: serial0-pinmux {
> ++ pins = "gpio16", "gpio17";
> ++ function = "blsp_uart0";
> ++ bias-disable;
> ++ };
> ++
> ++ i2c_0_pins: i2c-0-pinmux {
> ++ pins = "gpio20", "gpio21";
> ++ function = "blsp_i2c0";
> ++ bias-disable;
> ++ };
> ++
> ++ nand_pins: nand-pins {
> ++ pins = "gpio53", "gpio55", "gpio56",
> ++ "gpio57", "gpio58", "gpio59",
> ++ "gpio60", "gpio62", "gpio63",
> ++ "gpio64", "gpio65", "gpio66",
> ++ "gpio67", "gpio68", "gpio69";
> ++ function = "qpic";
> ++ };
> ++ };
bias-pull-ups and bias-pull-downs are missing here.
Also what happend to gpio52? The "qcom-ipq4019-ap.dk04.1.dtsi" still
defines it and from what I can tell, there seems to be only one valid
way to wire up a nand chip with the SoC.
> ++
> ++ serial at 78af000 {
> ++ pinctrl-0 = <&serial_0_pins>;
> ++ pinctrl-names = "default";
> ++ status = "ok";
> ++ };
I guess it would have been nice to use the label here.
&tlmm {
..
};
&blsp_dma {
};
&blsp1_spi1 {
};
&blsp1_uart1 {
..
};
but no biggy.
> ++
> ++ dma at 7884000 {
> ++ status = "ok";
> ++ };
> ++
> ++ i2c at 78b7000 { /* BLSP1 QUP2 */
> ++ pinctrl-0 = <&i2c_0_pins>;
> ++ pinctrl-names = "default";
> ++ status = "ok";
> ++ };
> ++
> ++ dma at 7984000 {
> ++ status = "ok";
> ++ };
> ++
> ++ qpic-nand at 79b0000 {
> ++ pinctrl-0 = <&nand_pins>;
> ++ pinctrl-names = "default";
> ++ status = "ok";
> ++ };
> ++ };
> ++};
> +--
> +1.9.1
> +
> diff --git a/target/linux/ipq40xx/patches-4.14/903-ARM-dts-ipq4019-Add-qcom-ipq4019-ap.dk07.1-c1-board-.patch b/target/linux/ipq40xx/patches-4.14/903-ARM-dts-ipq4019-Add-qcom-ipq4019-ap.dk07.1-c1-board-.patch
> new file mode 100644
> index 0000000..655a372
> --- /dev/null
> +++ b/target/linux/ipq40xx/patches-4.14/903-ARM-dts-ipq4019-Add-qcom-ipq4019-ap.dk07.1-c1-board-.patch
> @@ -0,0 +1,99 @@
> +From 5ade893ec03c6612a38d53eaf4324f21e18eeef5 Mon Sep 17 00:00:00 2001
> +From: Sricharan R <sricharan at codeaurora.org>
> +Date: Fri, 25 May 2018 11:41:18 +0530
> +Subject: [PATCH] ARM: dts: ipq4019: Add qcom-ipq4019-ap.dk07.1-c1 board file
> +
> +Reviewed-by: Abhishek Sahu <absahu at codeaurora.org>
> +Signed-off-by: Sricharan R <sricharan at codeaurora.org>
> +Signed-off-by: Andy Gross <andy.gross at linaro.org>
> +---
> + arch/arm/boot/dts/Makefile | 1 +
> + arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts | 64 +++++++++++++++++++++++++
> + 2 files changed, 65 insertions(+)
> + create mode 100644 arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts
> +
> +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> +index 2c002b3..eede5df 100644
> +--- a/arch/arm/boot/dts/Makefile
> ++++ b/arch/arm/boot/dts/Makefile
> +@@ -708,6 +708,7 @@
> + qcom-ipq4019-ap.dk01.1-c1.dtb \
> + qcom-ipq4019-a62.dtb \
> + qcom-ipq4019-ap.dk04.1-c1.dtb \
> ++ qcom-ipq4019-ap.dk07.1-c1.dtb \
> + qcom-ipq4028-wpj428.dtb \
> + qcom-ipq4029-gl-b1300.dtb \
> + qcom-ipq4029-mr33.dtb \
> +diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts b/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts
> +new file mode 100644
> +index 0000000..8c7ef65
> +--- /dev/null
> ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts
Same as with the .dtsi: please push those changes upstream.
> +@@ -0,0 +1,64 @@
> ++// SPDX-License-Identifier: GPL-2.0
> ++// Copyright (c) 2018, The Linux Foundation. All rights reserved.
> ++
> ++#include "qcom-ipq4019-ap.dk07.1.dtsi"
> ++
> ++/ {
> ++ model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK07.1-C1";
> ++ compatible = "qcom,ipq4019-ap-dk07.1-c1";
Make that:
compatible = "qcom,ipq4019-ap-dk07.1-c1", "qcom,ipq4019";
> ++
> ++ soc {
> ++ pci at 40000000 {
> ++ status = "ok";
> ++ perst-gpio = <&tlmm 38 0x1>;
> ++ };
The phandle's 3'rd parameter should be GPIO_ACTIVE_LOW and not 0x1.
> ++
> ++ spi at 78b6000 {
> ++ status = "ok";
> ++ };
> ++
> ++ pinctrl at 1000000 {
> ++ serial_1_pins: serial1-pinmux {
> ++ pins = "gpio8", "gpio9",
> ++ "gpio10", "gpio11";
> ++ function = "blsp_uart1";
> ++ bias-disable;
> ++ };
> ++
> ++ spi_0_pins: spi-0-pinmux {
> ++ pinmux {
> ++ function = "blsp_spi0";
> ++ pins = "gpio13", "gpio14", "gpio15";
> ++ bias-disable;
> ++ };
> ++ pinmux_cs {
> ++ function = "gpio";
> ++ pins = "gpio12";
> ++ bias-disable;
> ++ output-high;
> ++ };
> ++ };
> ++ };
> ++
> ++ serial at 78b0000 {
> ++ pinctrl-0 = <&serial_1_pins>;
> ++ pinctrl-names = "default";
> ++ status = "ok";
> ++ };
> ++
> ++ spi at 78b5000 {
> ++ pinctrl-0 = <&spi_0_pins>;
> ++ pinctrl-names = "default";
> ++ status = "ok";
> ++ cs-gpios = <&tlmm 12 0>;
that 0 would be GPIO_ACTIVE_HIGH (altough, the spi subsystem does not
care about high or low there. It has its own: "spi-cs-high; " property
for this purpose.
> ++
> ++ m25p80 at 0 {
> ++ #address-cells = <1>;
> ++ #size-cells = <1>;
> ++ reg = <0>;
> ++ compatible = "n25q128a11";
I think "jedec,spi-nor" is missing here. It must be included for
any SPI NOR flash that supports the JEDE READ ID Opcode.
> ++ spi-max-frequency = <24000000>;
> ++ };
> ++ };
> ++ };
> ++};
> +--
> +1.9.1
> +
> diff --git a/target/linux/ipq40xx/patches-4.14/904-Fix-rootfs-conflict-with-OpenWrt-auto-mount.patch b/target/linux/ipq40xx/patches-4.14/904-Fix-rootfs-conflict-with-OpenWrt-auto-mount.patch
> new file mode 100644
> index 0000000..92b4b3e
> --- /dev/null
> +++ b/target/linux/ipq40xx/patches-4.14/904-Fix-rootfs-conflict-with-OpenWrt-auto-mount.patch
> @@ -0,0 +1,40 @@
> +From ca96c645d61b4462fe6ee3d815717335214f27c2 Mon Sep 17 00:00:00 2001
> +From: Ram Chandra Jangir <rjangir at codeaurora.org>
> +Date: Sat, 9 Jun 2018 20:31:50 +0530
> +Subject: [PATCH] Fix rootfs conflict with OpenWrt auto mounting
> +
> +IPQ4019 nand flash has ubi partition name as 'rootfs', when we
> +boot IPQ4019 ap-dk07.1-c1 board from nand flash(with ubi image),
> +OpenWrt tries to attach mtd device named "ubi" on boot and it
> +fails.
> +Hence we rename this partition name from 'rootfs' to 'ubi' to
> +get it auto mounted.
> +
> +Signed-off-by: Ram Chandra Jangir <rjangir at codeaurora.org>
Really?
Try setting "ubi.mtd" bootargs:
<http://www.linux-mtd.infradead.org/faq/ubi.html#L_attachmtd>
It even comes with a fitting example:
"ubi.mtd=rootfs"
> +---
> + drivers/mtd/mtdpart.c | 9 ++++++---
> + 1 files changed, 6 insertions(+), 3 deletions(-)
> +
> +diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
> +index c87b71c..4980f93 100644
> +--- a/drivers/mtd/mtdpart.c
> ++++ b/drivers/mtd/mtdpart.c
> +@@ -887,9 +887,12 @@ static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part)
> + return;
> +
> + if (!strcmp(part->mtd.name, "rootfs")) {
> +- run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS);
> +-
> +- rootfs_found = 1;
> ++ if(mtd_type_is_nand(master)) {
> ++ part->mtd.name="ubi";
> ++ } else {
> ++ run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS);
> ++ rootfs_found = 1;
> ++ }
> + }
> +
> + if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) &&
> +--
> +2.7.2
> +
> diff --git a/target/linux/ipq40xx/patches-4.14/905-dts-qcom-ipq4019-ap.dk07.1-enable-nodes.patch b/target/linux/ipq40xx/patches-4.14/905-dts-qcom-ipq4019-ap.dk07.1-enable-nodes.patch
> new file mode 100644
> index 0000000..9a32719
> --- /dev/null
> +++ b/target/linux/ipq40xx/patches-4.14/905-dts-qcom-ipq4019-ap.dk07.1-enable-nodes.patch
> @@ -0,0 +1,79 @@
> +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts
> ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts
> +@@ -5,7 +5,7 @@
> +
> + / {
> + model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK07.1-C1";
> +- compatible = "qcom,ipq4019-ap-dk07.1-c1";
> ++ compatible = "qcom,ap-dk07.1-c1", "qcom,ipq4019";
"qcom,ipq4019-ap-dk07.1-c1" should be staying.
> +
> + soc {
> + pci at 40000000 {
> +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1.dtsi
> ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1.dtsi
> +@@ -13,15 +13,6 @@
> + reg = <0x80000000 0x20000000>; /* 512MB */
> + };
> +
> +- aliases {
> +- serial0 = &blsp1_uart1;
> +- serial1 = &blsp1_uart2;
> +- };
> +-
> +- chosen {
> +- stdout-path = "serial0:115200n8";
> +- };
> +-
Sad to see those nodes go. Altough serial1 was not enabled.
So why was it there in the first place? c&p?
> + soc {
> + pinctrl at 1000000 {
> + serial_0_pins: serial0-pinmux {
> +@@ -67,9 +71,49 @@
> + };
> +
> + qpic-nand at 79b0000 {
> ++ compatible = "qcom,ipq4019-nand", "qcom,msm-nand";
> + pinctrl-0 = <&nand_pins>;
> + pinctrl-names = "default";
> + status = "ok";
> ++
> ++ nand at 0 {
> ++ compatible = "qcom,nandcs";
> ++ reg = <0>;
> ++ #address-cells = <1>;
> ++ #size-cells = <1>;
> ++
> ++ nand-ecc-strength = <4>;
> ++ nand-ecc-step-size = <512>;
> ++ nand-bus-width = <8>;
Is u-boot filling in the partitions here?
> ++ };
> ++ };
> ++
> ++ mdio at 90000 {
> ++ status = "okay";
> ++ };
> ++
> ++ ess-switch at c000000 {
> ++ status = "okay";
> ++ switch_mac_mode = <0x0>; /* mac mode for RGMII RMII */
The comment (RGMII/RMII mode) is either wrong or the
switch_mac_mode value is misleading.
> ++ switch_initvlas = <
> ++ 0x0007c 0x54 /* PORT0_STATUS */
> ++ >;
This already is set? Also, the googlized ess-switch ar40xx.c driver we
are stuck with does not parse this property.
> ++ };
> ++
> ++ ess-psgmii at 98000 {
> ++ status = "okay";
> ++ };
> ++
> ++ edma at c080000 {
> ++ status = "okay";
> ++ };
> ++
> ++ wifi at a000000 {
> ++ status = "okay";
> ++ };
> ++
> ++ wifi at a800000 {
> ++ status = "okay";
> + };
> + };
> + };
>
OT: A user reported a kernel panic with the IPQ4019 ap-dk01.1-c1 on
the forum: <https://forum.openwrt.org/t/ipq4018-dk01-1-kernel-panic/20060>
I wonder if this affects the ap-dk04.1-c1 and ap-dk07.1-c1 as well.
Can you please comment on that.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list