[LEDE-DEV] [PATCH] ipq806x: cleanup kernel config

2018-05-17 Thread Ram Chandra Jangir
Disable MSM8960, MSM8974 and APQ8084
 - since these are different SoC's than IPQ806x
Removed unrequired serial configs
 - since ipq806x uses SERIAL_MSM only

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---
 target/linux/ipq806x/config-4.14 | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/target/linux/ipq806x/config-4.14 b/target/linux/ipq806x/config-4.14
index 8970f19..8d31e4f 100644
--- a/target/linux/ipq806x/config-4.14
+++ b/target/linux/ipq806x/config-4.14
@@ -1,7 +1,7 @@
 CONFIG_ALIGNMENT_TRAP=y
 # CONFIG_AMBA_PL08X is not set
-CONFIG_APQ_GCC_8084=y
-CONFIG_APQ_MMCC_8084=y
+# CONFIG_APQ_GCC_8084 is not set
+# CONFIG_APQ_MMCC_8084 is not set
 CONFIG_AR8216_PHY=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
@@ -141,12 +141,7 @@ CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_CRYPTO_XTS=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_GPIO=y
-CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="debug/msm.S"
-CONFIG_DEBUG_QCOM_UARTDM=y
 # CONFIG_DEBUG_UART_8250 is not set
-CONFIG_DEBUG_UART_PHYS=0x1634
-CONFIG_DEBUG_UART_VIRT=0xf634
 CONFIG_DEBUG_UNCOMPRESS=y
 # CONFIG_DEBUG_USER is not set
 CONFIG_DMADEVICES=y
@@ -295,14 +290,14 @@ CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MSM_BUS_SCALING=y
 CONFIG_MSM_GCC_8660=y
 # CONFIG_MSM_GCC_8916 is not set
-CONFIG_MSM_GCC_8960=y
-CONFIG_MSM_GCC_8974=y
+# CONFIG_MSM_GCC_8960 is not set
+# CONFIG_MSM_GCC_8974 is not set
 # CONFIG_MSM_GCC_8994 is not set
 # CONFIG_MSM_GCC_8996 is not set
 # CONFIG_MSM_IOMMU is not set
 # CONFIG_MSM_LCC_8960 is not set
-CONFIG_MSM_MMCC_8960=y
-CONFIG_MSM_MMCC_8974=y
+# CONFIG_MSM_MMCC_8960 is not set
+# CONFIG_MSM_MMCC_8974 is not set
 # CONFIG_MSM_MMCC_8996 is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_M25P80=y
@@ -374,7 +369,7 @@ CONFIG_PHY_QCOM_IPQ806X_SATA=y
 # CONFIG_PHY_QCOM_QUSB2 is not set
 # CONFIG_PHY_QCOM_UFS is not set
 CONFIG_PINCTRL=y
-CONFIG_PINCTRL_APQ8064=y
+# CONFIG_PINCTRL_APQ8064 is not set
 # CONFIG_PINCTRL_APQ8084 is not set
 # CONFIG_PINCTRL_IPQ4019 is not set
 CONFIG_PINCTRL_IPQ8064=y
@@ -386,7 +381,7 @@ CONFIG_PINCTRL_MSM=y
 # CONFIG_PINCTRL_MSM8960 is not set
 # CONFIG_PINCTRL_MSM8994 is not set
 # CONFIG_PINCTRL_MSM8996 is not set
-CONFIG_PINCTRL_MSM8X74=y
+# CONFIG_PINCTRL_MSM8X74 is not set
 # CONFIG_PINCTRL_QCOM_SPMI_PMIC is not set
 # CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set
 # CONFIG_PL330_DMA is not set
@@ -444,7 +439,6 @@ CONFIG_RWSEM_SPIN_ON_OWNER=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_SCHED_INFO is not set
 # CONFIG_SCSI_DMA is not set
-CONFIG_SERIAL_8250_FSL=y
 # CONFIG_SERIAL_AMBA_PL011 is not set
 CONFIG_SERIAL_MSM=y
 CONFIG_SERIAL_MSM_CONSOLE=y
-- 
1.9.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2] ipq806x: add kernel 4.14 support

2018-05-17 Thread Ram Chandra Jangir
Thanks  Michael for confirming this,

Can you please help to update the kernel partition size to 4MB for R7800 and 
send it as patch to community (lede-dev@lists.infradead.org)?
This will help to enable kernel v4.14 for all ipq806x based boards.

John,
I do not have d7800, r7500, r7500v2 & vr2600v and hence seeking help to update 
partition size for these boards.

Thanks,
Ram

-Original Message-
From: Michael Yartys [mailto:michael.yar...@protonmail.com] 
Sent: Saturday, May 05, 2018 2:26 AM
To: Stefan Lippers-Hollmann <s@gmx.de>
Cc: Ram Chandra Jangir <rjan...@codeaurora.org>; msm-...@mcclintock.net; 
lede-dev@lists.infradead.org; nar...@codeaurora.org
Subject: Re: [LEDE-DEV] [PATCH v2] ipq806x: add kernel 4.14 support

Hi

Can confirm that this works on my NETGEAR R7800 (ipq8065). The WLAN PCIe issues 
have been fixed.

I've also included my dmesg output in the attachment.

Thanks a lot for the help, Ram!

Michael

On 4 May 2018 9:40 PM, Stefan Lippers-Hollmann <s@gmx.de> wrote:

> Hi
> 
> On 2018-05-04, Ram Chandra Jangir wrote:
> 
> > -   Rebased the patches for 4.14
> > -   Dropped spi-qup and 0027, 0028, 0029
> > 
> > clk patches since it's already included
> > 
> > in upstream.
> > 
> > 
> > Tested on IPQ AP148 Board:
> > 
> > 1.  NOR boot and NAND boot
> > 2.  Tested USB and PCIe interfaces
> > 3.  WDOG test
> > 4.  cpu frequency scaling
> > 5.  ethernet, 2G and 5G WiFi
> > 6.  ubi sysupgrade
> > 
> > Signed-off-by: Ram Chandra Jangir rjan...@codeaurora.org
> > 
> > 
> > Changes since v1:
> > 
> > Fixes PCIe ext reset for IPQ8065 boards
> 
> With these changes my ZyXEL nbg6817 (ipq8065) works fine (PCIe and
> 
> wlan), thanks a lot!
> 
> New, working, gzip compressed dmesg, attached.
> 
> Regards
> 
> Stefan Lippers-Hollmann
> 
> Lede-dev mailing list
> 
> Lede-dev@lists.infradead.org
> 
> http://lists.infradead.org/mailman/listinfo/lede-dev




___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2] uboot-envtools: Add support for IPQ806x AP148 and DB149

2017-06-28 Thread Ram Chandra Jangir
IPQ806x AP148 and DB149 boards didn't have the UCI ubootenv
section initialized, so the usage of fw_printenv required manual
configuration. With this change, the "fw_printenv" and "fw_setenv"
command will automatically work on NOR and NAND based platforms.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v1:
*Updated based on review comments.

 package/boot/uboot-envtools/files/ipq | 21 +
 1 file changed, 21 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ipq 
b/package/boot/uboot-envtools/files/ipq
index 16c7ba6..164ced0 100644
--- a/package/boot/uboot-envtools/files/ipq
+++ b/package/boot/uboot-envtools/files/ipq
@@ -13,7 +13,28 @@ touch /etc/config/ubootenv
 
 board=$(ipq806x_board_name)
 
+ubootenv_mtdinfo () {
+   UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV)
+   mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
+   mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
+   mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
+   nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev})
+
+   if [ -n "$nor_flash" ]; then
+   ubootenv_size=$mtd_size
+   else
+   # size is fixed to 0x4 in u-boot
+   ubootenv_size=0x4
+   fi
+
+   sectors=$(( $ubootenv_size / $mtd_erase ))
+   echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
+}
+
 case "$board" in
+ap148 | db149)
+   ubootenv_add_uci_config $(ubootenv_mtdinfo)
+   ;;
 ea8500)
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x2" "0x2"
;;
-- 
2.7.2


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] ipq806x: Enable AP148 fit image(.itb) generation

2017-06-26 Thread Ram Chandra Jangir
This change enables .itb image generation for AP148,
It will help us to boot and test AP148 with NOR flash.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---
 target/linux/ipq806x/image/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 4ed05eb..cec778f 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -102,6 +102,7 @@ define Device/AP148
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_DTS := qcom-ipq8064-ap148
+   KERNEL_INSTALL := 1
BLOCKSIZE := 128k
PAGESIZE := 2048
BOARD_NAME := ap148
-- 
2.7.2


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] uboot-envtools: Add support for IPQ806x AP148 and DB149

2017-06-26 Thread Ram Chandra Jangir
IPQ806x AP148 and DB149 boards didn't have the UCI ubootenv
section initialized, so the usage of fw_printenv required manual
configuration. With this change, the "fw_printenv" and "fw_setenv"
command will automatically work on NOR and NAND based platforms.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---
 package/boot/uboot-envtools/files/ipq | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ipq 
b/package/boot/uboot-envtools/files/ipq
index 16c7ba6..01ae220 100644
--- a/package/boot/uboot-envtools/files/ipq
+++ b/package/boot/uboot-envtools/files/ipq
@@ -13,7 +13,29 @@ touch /etc/config/ubootenv
 
 board=$(ipq806x_board_name)
 
+default_uboot_env () {
+   UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV)
+   mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
+   mtd_size=0x$(echo $UBOOTENV_PART | awk '{print $2}')
+   mtd_erase=0x$(echo $UBOOTENV_PART | awk '{print $3}')
+   nor_flash=`find /sys/bus/spi/devices/*/mtd -name ${mtd_dev}`
+
+   if [ -n "$nor_flash" ]; then
+   uboot_env_size=$mtd_size
+   else
+   # size is fixed to 0x4 in u-boot
+   uboot_env_size=0x4
+   fi
+
+   sectors=$(( $uboot_env_size / $mtd_erase ))
+   echo /dev/$mtd_dev 0x0 $uboot_env_size $mtd_erase $sectors
+}
+
 case "$board" in
+ap148 | db149)
+   env=$(default_uboot_env)
+   [ -n "${env}" ] && ubootenv_add_uci_config $env
+   ;;
 ea8500)
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x2" "0x2"
;;
-- 
2.7.2


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v4 1/2] ipq806x: Updated various ipq40xx pin definitions

2017-05-31 Thread Ram Chandra Jangir
This change populates default values for various GPIO functions
in ipq40xx pinctrl driver.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v3:
*Added pinctrl defs,required for nand pinmux pullups.

 ...9-pinctrl-Updated-various-Pin-definitions.patch | 1332 
 1 file changed, 1332 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch

diff --git 
a/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch
 
b/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch
new file mode 100644
index 000..4267d47
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch
@@ -0,0 +1,1332 @@
+From fc6cf61517b8b4ab4678659936fc7572f699d6e7 Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Tue, 28 Mar 2017 14:00:00 +0530
+Subject: [PATCH] ipq4019: pinctrl: Updated various Pin definitions
+
+Populate default values for various GPIO functions
+
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ drivers/pinctrl/qcom/pinctrl-ipq4019.c | 1189 +---
+ 1 file changed,  insertions(+), 78 deletions(-)
+
+diff --git a/drivers/pinctrl/qcom/pinctrl-ipq4019.c 
b/drivers/pinctrl/qcom/pinctrl-ipq4019.c
+index 743d1f4..571eb51 100644
+--- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c
 b/drivers/pinctrl/qcom/pinctrl-ipq4019.c
+@@ -276,16 +276,531 @@ DECLARE_QCA_GPIO_PINS(99);
+
+
+ enum ipq4019_functions {
++  qca_mux_rmii0_refclk,
++  qca_mux_wifi0_rfsilient0,
++  qca_mux_wifi1_rfsilient0,
++  qca_mux_smart2,
++  qca_mux_led4,
++  qca_mux_wifi0_cal,
++  qca_mux_wifi1_cal,
++  qca_mux_wifi_wci0,
++  qca_mux_rmii0_dv,
++  qca_mux_wifi_wci1,
++  qca_mux_rmii1_refclk,
++  qca_mux_blsp_spi1,
++  qca_mux_led5,
++  qca_mux_rmii10,
++  qca_mux_led6,
++  qca_mux_rmii11,
++  qca_mux_led7,
++  qca_mux_rmii1_dv,
++  qca_mux_led8,
++  qca_mux_rmii1_tx,
++  qca_mux_aud_pin,
++  qca_mux_led9,
++  qca_mux_rmii1_rx,
++  qca_mux_led10,
++  qca_mux_wifi0_rfsilient1,
++  qca_mux_wifi1_rfsilient1,
++  qca_mux_led11,
++  qca_mux_boot7,
++  qca_mux_qpic_pad,
++  qca_mux_pcie_clk,
++  qca_mux_tm_clk0,
++  qca_mux_wifi00,
++  qca_mux_wifi10,
++  qca_mux_mdio1,
++  qca_mux_prng_rosc,
++  qca_mux_dbg_out,
++  qca_mux_tm0,
++  qca_mux_wifi01,
++  qca_mux_wifi11,
++  qca_mux_atest_char3,
++  qca_mux_pmu0,
++  qca_mux_boot8,
++  qca_mux_tm1,
++  qca_mux_atest_char2,
++  qca_mux_pmu1,
++  qca_mux_boot9,
++  qca_mux_tm2,
++  qca_mux_atest_char1,
++  qca_mux_tm_ack,
++  qca_mux_wifi03,
++  qca_mux_wifi13,
++  qca_mux_qpic_pad4,
++  qca_mux_atest_char0,
++  qca_mux_tm3,
++  qca_mux_wifi02,
++  qca_mux_wifi12,
++  qca_mux_qpic_pad5,
++  qca_mux_smart3,
++  qca_mux_wcss0_dbg14,
++  qca_mux_tm4,
++  qca_mux_wifi04,
++  qca_mux_wifi14,
++  qca_mux_qpic_pad6,
++  qca_mux_wcss0_dbg15,
++  qca_mux_qdss_tracectl_a,
++  qca_mux_boot18,
++  qca_mux_tm5,
++  qca_mux_qpic_pad7,
++  qca_mux_atest_char,
++  qca_mux_wcss0_dbg4,
++  qca_mux_qdss_traceclk_a,
++  qca_mux_boot19,
++  qca_mux_tm6,
++  qca_mux_wcss0_dbg5,
++  qca_mux_qdss_cti_trig_out_a0,
++  qca_mux_boot14,
++  qca_mux_tm7,
++  qca_mux_chip_rst,
++  qca_mux_wcss0_dbg6,
++  qca_mux_qdss_cti_trig_out_b0,
++  qca_mux_boot11,
++  qca_mux_tm8,
++  qca_mux_wcss0_dbg7,
++  qca_mux_wcss1_dbg7,
++  qca_mux_boot20,
++  qca_mux_tm9,
++  qca_mux_qpic_pad1,
++  qca_mux_wcss0_dbg8,
++  qca_mux_wcss1_dbg8,
++  qca_mux_qpic_pad2,
++  qca_mux_wcss0_dbg9,
++  qca_mux_wcss1_dbg9,
++  qca_mux_qpic_pad3,
++  qca_mux_wcss0_dbg10,
++  qca_mux_wcss1_dbg10,
++  qca_mux_qpic_pad0,
++  qca_mux_wcss0_dbg11,
++  qca_mux_wcss1_dbg11,
++  qca_mux_qpic_pad8,
++  qca_mux_wcss0_dbg12,
++  qca_mux_wcss1_dbg12,
++  qca_mux_wifi034,
++  qca_mux_wifi134,
++  qca_mux_jtag_tdi,
+   qca_mux_gpio,
++  qca_mux_i2s_rx_bclk,
++  qca_mux_jtag_tck,
++  qca_mux_i2s_rx_fsync,
++  qca_mux_jtag_tms,
++  qca_mux_i2s_rxd,
++  qca_mux_smart0,
++  qca_mux_jtag_tdo,
++  qca_mux_jtag_rst,
++  qca_mux_jtag_trst,
++  qca_mux_mdio0,
++  qca_mux_wcss0_dbg18,
++  qca_mux_wcss1_dbg18,
++  qca_mux_qdss_tracedata_a,
++  qca_mux_mdc,
++  qca_mux_wcss0_dbg19,
++  qca_mux_wcss1_dbg19,
+   qca_mux_blsp_uart1,
++  qca_mux_wifi0_uart,
++  qca_mux_wifi1_uart,
++  qca_mux_smart1,
++  qca_mux_wcss0_dbg20,
++  qca_mux_wcss1_dbg20,
++  q

[LEDE-DEV] [PATCH v4 2/2] ipq806x: Enable ubi image for ipq40xx AP-DK04.1-C1 board

2017-05-31 Thread Ram Chandra Jangir
This change add IPQ40xx AP-DK04.1-C1 board image support,
enables ubi image for IPQ40xx AP-DK04.1-C1 board and also
add sysupgrage support for AP-DK04.1-C1 and generates a
sysupgrade.tar image.

Testing:
 *Tested on IPQ40xx AP-DK04.1-C1:
   a. NAND boot
   b. ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v3:
*Rebased the patch with TOT

 target/linux/ipq806x/base-files/lib/upgrade/platform.sh |  1 +
 target/linux/ipq806x/image/Makefile | 15 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 8970285..fd08db3 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -12,6 +12,7 @@ platform_pre_upgrade() {
 
case "$board" in
ap148 |\
+   ap-dk04.1-c1 |\
d7800 |\
nbg6817 |\
r7500 |\
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index de6ddb6..4ed05eb 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -250,7 +250,20 @@ define Device/VR2600v
IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | pad-to 
{KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
 endef
 
+define Device/AP-DK04.1-C1
+   $(call Device/FitImage)
+   $(call Device/UbiFit)
+   DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
+   KERNEL_LOADADDR := 0x80208000
+   KERNEL_INSTALL := 1
+   KERNEL_SIZE := 4048k
+   BLOCKSIZE := 128k
+   PAGESIZE := 2048
+   BOARD_NAME := ap-dk04.1-c1
+   DEVICE_TITLE := QCA AP-DK04.1-C1
+endef
+
 TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 EA8500 FRITZ4040 R7500 \
- R7500v2 R7800 NBG6817 VR2600v
+ R7500v2 R7800 NBG6817 VR2600v AP-DK04.1-C1
 
 $(eval $(call BuildImage))
-- 
2.7.2


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v3 6/6] ipq806x: Enable ubi image for ipq40xx AP-DK04.1-C1 board

2017-05-29 Thread Ram Chandra Jangir
Thanks John,

Actually this was based on https://patchwork.ozlabs.org/patch/752962/ and it
got failed to apply.  I will resend this last patch. 
Can you please help to merge this https://patchwork.ozlabs.org/patch/752962/
, if it takes some time to review/merge then can you please help to merge
the pinctrl patch(852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch)
available in this.
 It is required for qpic nand pin definitions for nand boot.

Thanks,
Ram

On Monday, May 29, 2017 11:56 AM, John Crispin  wrote:

>Hi Ram,

>thanks for splitting the series up, i merged the first  patches into my
tree, however the final patch fails to apply. could you rebase/resend just
that last one please ?

> John

>On 25/05/17 01:31, Ram Chandra Jangir wrote:
> This change enables ubi image for IPQ40xx AP-DK04.1-C1 board, also add 
> sysupgrage support for AP-DK04.1-C1 and generates a sysupgrade.tar 
> image.
>
> Testing:
>   *Tested on IPQ40xx AP-DK04.1-C1:
> a. NAND boot
> b. ubi sysupgrade
>
> Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
> ---
>
> Changes since v2:
>   *Splitted to individual patches
>
>   target/linux/ipq806x/base-files/lib/upgrade/platform.sh | 1 +
>   target/linux/ipq806x/image/Makefile | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
> b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> index 8970285..fd08db3 100644
> --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> @@ -12,6 +12,7 @@ platform_pre_upgrade() {
>   
>   case "$board" in
>   ap148 |\
> + ap-dk04.1-c1 |\
>   d7800 |\
>   nbg6817 |\
>   r7500 |\
> diff --git a/target/linux/ipq806x/image/Makefile 
> b/target/linux/ipq806x/image/Makefile
> index 6ebcde5..c49a73e 100644
> --- a/target/linux/ipq806x/image/Makefile
> +++ b/target/linux/ipq806x/image/Makefile
> @@ -264,6 +264,7 @@ endef
>   
>   define Device/AP-DK04.1-C1
>   $(call Device/FitImage)
> + $(call Device/UbiFit)
>   DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
>   KERNEL_LOADADDR := 0x80208000
>   KERNEL_INSTALL := 1



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v3 6/6] ipq806x: Enable ubi image for ipq40xx AP-DK04.1-C1 board

2017-05-24 Thread Ram Chandra Jangir
This change enables ubi image for IPQ40xx AP-DK04.1-C1
board, also add sysupgrage support for AP-DK04.1-C1 and
generates a sysupgrade.tar image.

Testing:
 *Tested on IPQ40xx AP-DK04.1-C1:
   a. NAND boot
   b. ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v2:
 *Splitted to individual patches

 target/linux/ipq806x/base-files/lib/upgrade/platform.sh | 1 +
 target/linux/ipq806x/image/Makefile | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 8970285..fd08db3 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -12,6 +12,7 @@ platform_pre_upgrade() {
 
case "$board" in
ap148 |\
+   ap-dk04.1-c1 |\
d7800 |\
nbg6817 |\
r7500 |\
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 6ebcde5..c49a73e 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -264,6 +264,7 @@ endef
 
 define Device/AP-DK04.1-C1
$(call Device/FitImage)
+   $(call Device/UbiFit)
DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
KERNEL_LOADADDR := 0x80208000
KERNEL_INSTALL := 1
-- 
2.7.2


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v3 4/6] ipq806x: Add support for custom data mapping in bam_dma dmaengine

2017-05-24 Thread Ram Chandra Jangir
This change adds a new function to support for preparing DMA descriptor
for custom data.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v2:
 *Splitted to individual patches

 ...gine-qcom-bam_dma-Add-custom-data-mapping.patch | 217 +
 1 file changed, 217 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/862-dmaengine-qcom-bam_dma-Add-custom-data-mapping.patch

diff --git 
a/target/linux/ipq806x/patches-4.9/862-dmaengine-qcom-bam_dma-Add-custom-data-mapping.patch
 
b/target/linux/ipq806x/patches-4.9/862-dmaengine-qcom-bam_dma-Add-custom-data-mapping.patch
new file mode 100644
index 000..3b26120
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/862-dmaengine-qcom-bam_dma-Add-custom-data-mapping.patch
@@ -0,0 +1,217 @@
+From 5a7ccdf845d64b385affdcffaf2defbe9848be15 Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Thu, 20 Apr 2017 10:39:00 +0530
+Subject: [PATCH] dmaengine: qcom: bam_dma: Add custom data mapping
+
+Add a new function to support for preparing DMA descriptor
+for custom data.
+
+Signed-off-by: Abhishek Sahu <abs...@codeaurora.org>
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ drivers/dma/qcom/bam_dma.c   | 97 +---
+ include/linux/dma/qcom_bam_dma.h | 14 ++
+ include/linux/dmaengine.h| 14 ++
+ 3 files changed, 119 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
+index 03c4eb3..bde8d70 100644
+--- a/drivers/dma/qcom/bam_dma.c
 b/drivers/dma/qcom/bam_dma.c
+@@ -49,6 +49,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+
+ #include "../dmaengine.h"
+ #include "../virt-dma.h"
+@@ -61,11 +62,6 @@ struct bam_desc_hw {
+
+ #define BAM_DMA_AUTOSUSPEND_DELAY 100
+
+-#define DESC_FLAG_INT BIT(15)
+-#define DESC_FLAG_EOT BIT(14)
+-#define DESC_FLAG_EOB BIT(13)
+-#define DESC_FLAG_NWD BIT(12)
+-
+ struct bam_async_desc {
+   struct virt_dma_desc vd;
+
+@@ -670,6 +666,93 @@ static struct dma_async_tx_descriptor 
*bam_prep_slave_sg(struct dma_chan *chan,
+ }
+
+ /**
++ * bam_prep_dma_custom_mapping - Prep DMA descriptor from custom data
++ *
++ * @chan: dma channel
++ * @data: custom data
++ * @flags: DMA flags
++ */
++static struct dma_async_tx_descriptor *bam_prep_dma_custom_mapping(
++  struct dma_chan *chan,
++  void *data, unsigned long flags)
++{
++  struct bam_chan *bchan = to_bam_chan(chan);
++  struct bam_device *bdev = bchan->bdev;
++  struct bam_async_desc *async_desc;
++  struct qcom_bam_custom_data *desc_data = data;
++  u32 i;
++  struct bam_desc_hw *desc;
++  unsigned int num_alloc = 0;
++
++
++  if (!is_slave_direction(desc_data->dir)) {
++  dev_err(bdev->dev, "invalid dma direction\n");
++  return NULL;
++  }
++
++  /* calculate number of required entries */
++  for (i = 0; i < desc_data->sgl_cnt; i++)
++  num_alloc += DIV_ROUND_UP(
++  sg_dma_len(_data->bam_sgl[i].sgl), BAM_FIFO_SIZE);
++
++  /* allocate enough room to accommodate the number of entries */
++  async_desc = kzalloc(sizeof(*async_desc) +
++  (num_alloc * sizeof(struct bam_desc_hw)), GFP_NOWAIT);
++
++  if (!async_desc)
++  goto err_out;
++
++  if (flags & DMA_PREP_FENCE)
++  async_desc->flags |= DESC_FLAG_NWD;
++
++  if (flags & DMA_PREP_INTERRUPT)
++  async_desc->flags |= DESC_FLAG_EOT;
++  else
++  async_desc->flags |= DESC_FLAG_INT;
++
++  async_desc->num_desc = num_alloc;
++  async_desc->curr_desc = async_desc->desc;
++  async_desc->dir = desc_data->dir;
++
++  /* fill in temporary descriptors */
++  desc = async_desc->desc;
++  for (i = 0; i < desc_data->sgl_cnt; i++) {
++  unsigned int remainder;
++  unsigned int curr_offset = 0;
++
++  remainder = sg_dma_len(_data->bam_sgl[i].sgl);
++
++  do {
++  desc->addr = cpu_to_le32(
++  sg_dma_address(_data->bam_sgl[i].sgl) +
++   curr_offset);
++
++  if (desc_data->bam_sgl[i].dma_flags)
++  desc->flags |= cpu_to_le16(
++  desc_data->bam_sgl[i].dma_flags);
++
++  if (remainder > BAM_FIFO_SIZE) {
++  desc->size = cpu_to_le16(BAM_FIFO_SIZE);
++  remainder -= BAM_FIFO_SIZE;
++  curr_offset += BAM_FIFO_SIZE;
++  } else {
++  desc->size = cpu_to_le16(remainder);
++

[LEDE-DEV] [PATCH v3 5/6] ipq806x: add qpic nand and bam dma node's in ipq4019 dts tree

2017-05-24 Thread Ram Chandra Jangir
This change adds QPIC BAM dma and NAND driver node's in IPQ4019
device tree, also enable this for AP-DK04.1 based boards.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v2:
 *Splitted to individual patches

 ...ts-ipq4019-add-nand-and-qpic-bam-dma-node.patch | 172 +
 1 file changed, 172 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch

diff --git 
a/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch
 
b/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch
new file mode 100644
index 000..44e162b
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch
@@ -0,0 +1,172 @@
+From 02bbf3c46e1e38e9ca699143566903683e3a015d Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Thu, 20 Apr 2017 10:45:00 +0530
+Subject: [PATCH] dts: ipq4019: add nand and qpic bam dma node
+
+This change adds QPIC BAM dma and NAND driver node's in
+IPQ4019 device tree, also enable this for AP-DK04.1 based
+boards.
+
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi | 75 +++
+ arch/arm/boot/dts/qcom-ipq4019.dtsi   | 38 ++
+ 2 files changed, 113 insertions(+)
+
+diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi 
b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
+index 09fb047..e94954e 100644
+--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
 b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
+@@ -101,6 +101,86 @@
+   bias-bus-hold;
+   };
+   };
++
++  nand_pins: nand_pins {
++
++   mux_1 {
++   pins = "gpio52", "gpio53", "gpio54",
++  "gpio55", "gpio56", "gpio61",
++  "gpio62", "gpio63", "gpio69";
++   function = "qpic_pad";
++   bias-disable;
++   };
++
++  mux_2 {
++  pins = "gpio67";
++  function = "qpic_pad0";
++  bias-disable;
++  };
++
++  mux_3 {
++  pins = "gpio64";
++  function = "qpic_pad1";
++  bias-disable;
++  };
++
++  mux_4 {
++  pins = "gpio65";
++  function = "qpic_pad2";
++  bias-disable;
++  };
++
++  mux_5 {
++  pins = "gpio66";
++  function = "qpic_pad3";
++  bias-disable;
++  };
++
++  mux_6 {
++  pins = "gpio57";
++  function = "qpic_pad4";
++  bias-disable;
++  };
++
++  mux_7 {
++  pins = "gpio58";
++  function = "qpic_pad5";
++  bias-disable;
++  };
++
++  mux_8 {
++  pins = "gpio59";
++  function = "qpic_pad6";
++  bias-disable;
++  };
++
++  mux_9 {
++  pins = "gpio60";
++  function = "qpic_pad7";
++  bias-disable;
++  };
++
++  mux_10 {
++  pins = "gpio68";
++  function = "qpic_pad8";
++  bias-disable;
++  };
++
++  pullups {
++  pins = 

[LEDE-DEV] [PATCH v3 3/6] ipq806x: Added bam transaction and support additional CSRs

2017-05-24 Thread Ram Chandra Jangir
This change adds support for below:
- Bam transaction which will be used for any NAND request.
- Reset function for NAND BAM transaction
- Add support for additional CSRs.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v2:
 *Splitted to individual patches

 ...nd-Added-bam-transaction-and-support-addi.patch | 1273 
 1 file changed, 1273 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/861-qcom-mtd-nand-Added-bam-transaction-and-support-addi.patch

diff --git 
a/target/linux/ipq806x/patches-4.9/861-qcom-mtd-nand-Added-bam-transaction-and-support-addi.patch
 
b/target/linux/ipq806x/patches-4.9/861-qcom-mtd-nand-Added-bam-transaction-and-support-addi.patch
new file mode 100644
index 000..674de77
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/861-qcom-mtd-nand-Added-bam-transaction-and-support-addi.patch
@@ -0,0 +1,1273 @@
+From 645c7805f2602569263d7ac78050b2c9e91e3377 Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Thu, 20 Apr 2017 10:23:00 +0530
+Subject: [PATCH] qcom: mtd: nand: Added bam transaction and support
+ additional CSRs
+
+This patch adds the following for NAND BAM DMA support
+ - Bam transaction which will be used for any NAND request.
+It contains the array of command elements, command and
+data sgl. This transaction will be resetted before every
+request.
+ - Allocation function for NAND BAM transaction which will be
+called only once at probe time.
+ - Reset function for NAND BAM transaction which will be called
+before any new NAND request.
+ - Add support for additional CSRs.
+NAND_READ_LOCATION - page offset for reading in BAM DMA mode
+NAND_ERASED_CW_DETECT_CFG - status for erased code words
+NAND_BUFFER_STATUS - status for ECC
+
+Signed-off-by: Abhishek Sahu <abs...@codeaurora.org>
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ drivers/mtd/nand/qcom_nandc.c| 631 +++
+ include/linux/dma/qcom_bam_dma.h | 149 +
+ 2 files changed, 721 insertions(+), 59 deletions(-)
+ create mode 100644 include/linux/dma/qcom_bam_dma.h
+
+diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c
+index 76a0ffc..9d941e3 100644
+--- a/drivers/mtd/nand/qcom_nandc.c
 b/drivers/mtd/nand/qcom_nandc.c
+@@ -22,6 +22,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+
+ /* NANDc reg offsets */
+ #define   NAND_FLASH_CMD  0x00
+@@ -53,6 +54,8 @@
+ #define   NAND_VERSION0xf08
+ #define   NAND_READ_LOCATION_00xf20
+ #define   NAND_READ_LOCATION_10xf24
++#define   NAND_READ_LOCATION_20xf28
++#define   NAND_READ_LOCATION_30xf2c
+
+ /* dummy register offsets, used by write_reg_dma */
+ #define   NAND_DEV_CMD1_RESTORE   0xdead
+@@ -131,6 +134,11 @@
+ #define   ERASED_PAGE (PAGE_ALL_ERASED | PAGE_ERASED)
+ #define   ERASED_CW   (CODEWORD_ALL_ERASED | 
CODEWORD_ERASED)
+
++/* NAND_READ_LOCATION_n bits */
++#define READ_LOCATION_OFFSET   0
++#define READ_LOCATION_SIZE 16
++#define READ_LOCATION_LAST 31
++
+ /* Version Mask */
+ #define   NAND_VERSION_MAJOR_MASK 0xf000
+ #define   NAND_VERSION_MAJOR_SHIFT28
+@@ -148,6 +156,9 @@
+ #define   FETCH_ID0xb
+ #define   RESET_DEVICE0xd
+
++/* NAND_CTRL bits */
++#defineBAM_MODE_EN BIT(0)
++
+ /*
+  * the NAND controller performs reads/writes with ECC in 516 byte chunks.
+  * the driver calls the chunks 'step' or 'codeword' interchangeably
+@@ -169,12 +180,77 @@
+ #define   ECC_BCH_4BITBIT(2)
+ #define   ECC_BCH_8BITBIT(3)
+
++/* Flags used for BAM DMA desc preparation*/
++/* Don't set the EOT in current tx sgl */
++#define DMA_DESC_FLAG_NO_EOT  (0x0001)
++/* Set the NWD flag in current sgl */
++#define DMA_DESC_FLAG_BAM_NWD (0x0002)
++/* Close current sgl and start writing in another sgl */
++#define DMA_DESC_FLAG_BAM_NEXT_SGL(0x0004)
++/*
++ * Erased codeword status is being used two times in single transfer so this
++ * flag will determine the current value of erased codeword status register
++ */
++#define DMA_DESC_ERASED_CW_SET(0x0008)
++
++/* Returns the dma address for reg read buffer */
++#define REG_BUF_DMA_ADDR(chip, vaddr) \
++  ((chip)->reg_read_buf_phys + \
++  ((uint8_t *)(vaddr) - (uint8_t *)(chip)->reg_read_buf))
++
++/* Returns the nand register physical address */
++#define NAND_REG_PHYS_ADDRESS(chip, addr) \
++  ((chip)->base_dma + (addr))
++
++/* command element array size in bam transaction */
++#define BAM_CMD_ELEMENT_SIZE  (256)
++/* command sgl size in bam transaction */
++#define BAM_CMD_SGL_SIZE  (256)
++/* data sgl siz

[LEDE-DEV] [PATCH v3 2/6] ipq806x: Add bam_dma support in qcom_nand driver

2017-05-24 Thread Ram Chandra Jangir
The existing qcom_nand driver supports ADM DMA which is mainly
required for ipq806x family based boards,
IPQ40xx based boards uses BAM DMA in NAND driver, so this patch
adds BAM DMA support with compatible string as qcom,ebi2-nandc-bam.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v2:
 *Splitted to individual patches

 ...nd-Add-bam_dma-support-in-qcom_nand-drive.patch | 382 +
 1 file changed, 382 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/860-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch

diff --git 
a/target/linux/ipq806x/patches-4.9/860-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
 
b/target/linux/ipq806x/patches-4.9/860-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
new file mode 100644
index 000..ad9d1bb
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/860-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
@@ -0,0 +1,382 @@
+From 074036f9de6b8c5fc642e8e2540950f6a35aa804 Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Thu, 20 Apr 2017 10:31:10 +0530
+Subject: [PATCH] qcom: mtd: nand: Add bam_dma support in qcom_nand driver
+
+The current driver only support ADM DMA so this patch adds the
+BAM DMA support in current NAND driver with compatible string
+qcom,ebi2-nandc-bam.
+Added bam channels and data buffers, NAND BAM uses 3 channels:
+command, data tx and data rx, while ADM uses only single channel.
+So this patch adds the BAM channel in device tree and using the
+same in NAND driver allocation function.
+
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ .../devicetree/bindings/mtd/qcom_nandc.txt |  69 +++--
+ drivers/mtd/nand/qcom_nandc.c  | 160 +
+ 2 files changed, 190 insertions(+), 39 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/mtd/qcom_nandc.txt 
b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+index 70dd511..9e5c9be 100644
+--- a/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
 b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+@@ -1,21 +1,26 @@
+ * Qualcomm NAND controller
+
+ Required properties:
+-- compatible: should be "qcom,ipq806x-nand"
++- compatible: "qcom,ipq806x-nand" for IPQ8064 which uses
++  ADM DMA.
++  "qcom,ebi2-nand-bam" - nand drivers using BAM DMA
++  like IPQ4019.
+ - reg:MMIO address range
+ - clocks: must contain core clock and always on clock
+ - clock-names:must contain "core" for the core clock and 
"aon" for the
+   always on clock
+ - dmas:   DMA specifier, consisting of a phandle to the 
ADM DMA
+-  controller node and the channel number to be used for
+-  NAND. Refer to dma.txt and qcom_adm.txt for more details
+-- dma-names:  must be "rxtx"
+-- qcom,cmd-crci:  must contain the ADM command type CRCI block instance
+-  number specified for the NAND controller on the given
+-  platform
+-- qcom,data-crci: must contain the ADM data type CRCI block instance
+-  number specified for the NAND controller on the given
+-  platform
++  or BAM DMA controller node and the channel number to
++  be used for NAND. Refer to dma.txt, qcom_adm.txt(ADM)
++  and qcom_bam_dma.txt(BAM) for more details
++- dma-names:  "rxtx" - ADM
++  "tx", "rx", "cmd" - BAM
++- qcom,cmd-crci:  Only required for ADM DMA. must contain the ADM command
++  type CRCI block instance number specified for the NAND
++  controller on the given platform.
++- qcom,data-crci: Only required for ADM DMA. must contain the ADM data
++  type CRCI block instance number specified for the NAND
++  controller on the given platform.
+ - #address-cells: <1> - subnodes give the chip-select number
+ - #size-cells:<0>
+
+@@ -44,7 +49,7 @@ partition.txt for more detail.
+ Example:
+
+ nand@1ac0 {
+-  compatible = "qcom,ebi2-nandc";
++  compatible = "qcom,ipq806x-nand","qcom.qcom_nand";
+   reg = <0x1ac0 0x800>;
+
+   clocks = < EBI2_CLK>,
+@@ -84,3 +89,45 @@ nand@1ac0 {
+   };
+   };
+ };
++
++nand@79B {
++  compatible = "qcom,ebi2-nandc-bam";
++  reg = <0x79B 0x1000>;
++
++  clocks = < EBI2_CLK>,
++   < EBI2_AON_CLK>;
++  clock-names = "core", "aon";
++
++ 

[LEDE-DEV] [PATCH v3 1/6] ipq806x: Add support to configure ipq40xx GPIO_PULL bits

2017-05-24 Thread Ram Chandra Jangir
GPIO_PULL bits configurations in TLMM_GPIO_CFG register
differs for IPQ40xx from rest of the other qcom SoC's.
This change add support to configure the msm_gpio_pull
bits for ipq40xx, It is required to fix the proper
configurations of gpio-pull bits for nand pins mux.

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v2:
 *Splitted to individual patches

 ...-Add-support-to-configure-ipq40xx-GPIO_PU.patch | 260 +
 1 file changed, 260 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch

diff --git 
a/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch
 
b/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch
new file mode 100644
index 000..bac9e78
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch
@@ -0,0 +1,260 @@
+From e77af7de404eb464f7da9e0daeb8b362cc66a7ba Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Tue, 9 May 2017 11:45:00 +0530
+Subject: [PATCH] msm: pinctrl: Add support to configure ipq40xx GPIO_PULL bits
+
+GPIO_PULL bits configurations in TLMM_GPIO_CFG register
+differs for IPQ40xx from rest of the other qcom SoC's.
+This change add support to configure the msm_gpio_pull
+bits for ipq40xx, It is required to fix the proper
+configurations of gpio-pull bits for nand pins mux.
+
+IPQ40xx SoC:
+2'b10: Internal pull up enable.
+2'b11: Unsupport
+
+For other SoC's:
+2'b10: Keeper
+2'b11: Pull-Up
+
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ drivers/pinctrl/qcom/pinctrl-apq8064.c |  1 +
+ drivers/pinctrl/qcom/pinctrl-apq8084.c |  1 +
+ drivers/pinctrl/qcom/pinctrl-ipq4019.c |  8 
+ drivers/pinctrl/qcom/pinctrl-ipq8064.c |  1 +
+ drivers/pinctrl/qcom/pinctrl-mdm9615.c |  1 +
+ drivers/pinctrl/qcom/pinctrl-msm.c | 21 -
+ drivers/pinctrl/qcom/pinctrl-msm.h | 19 +++
+ drivers/pinctrl/qcom/pinctrl-msm8660.c |  1 +
+ drivers/pinctrl/qcom/pinctrl-msm8916.c |  1 +
+ drivers/pinctrl/qcom/pinctrl-msm8960.c |  1 +
+ drivers/pinctrl/qcom/pinctrl-msm8x74.c |  1 +
+ 11 files changed, 43 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/pinctrl/qcom/pinctrl-apq8064.c 
b/drivers/pinctrl/qcom/pinctrl-apq8064.c
+index cd96699..63e9a7e 100644
+--- a/drivers/pinctrl/qcom/pinctrl-apq8064.c
 b/drivers/pinctrl/qcom/pinctrl-apq8064.c
+@@ -597,6 +597,7 @@ static const struct msm_pinctrl_soc_data apq8064_pinctrl = 
{
+   .groups = apq8064_groups,
+   .ngroups = ARRAY_SIZE(apq8064_groups),
+   .ngpios = NUM_GPIO_PINGROUPS,
++  .gpio_pull = _gpio_pull,
+ };
+
+ static int apq8064_pinctrl_probe(struct platform_device *pdev)
+diff --git a/drivers/pinctrl/qcom/pinctrl-apq8084.c 
b/drivers/pinctrl/qcom/pinctrl-apq8084.c
+index d07e8df..892250e 100644
+--- a/drivers/pinctrl/qcom/pinctrl-apq8084.c
 b/drivers/pinctrl/qcom/pinctrl-apq8084.c
+@@ -1206,6 +1206,7 @@ static const struct msm_pinctrl_soc_data apq8084_pinctrl 
= {
+   .groups = apq8084_groups,
+   .ngroups = ARRAY_SIZE(apq8084_groups),
+   .ngpios = NUM_GPIO_PINGROUPS,
++  .gpio_pull = _gpio_pull,
+ };
+
+ static int apq8084_pinctrl_probe(struct platform_device *pdev)
+diff --git a/drivers/pinctrl/qcom/pinctrl-ipq4019.c 
b/drivers/pinctrl/qcom/pinctrl-ipq4019.c
+index 571eb51..040e03c 100644
+--- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c
 b/drivers/pinctrl/qcom/pinctrl-ipq4019.c
+@@ -1531,6 +1531,13 @@ static const struct msm_pingroup ipq4019_groups[] = {
+   PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
+ };
+
++static const struct msm_pinctrl_gpio_pull ipq4019_gpio_pull = {
++  .no_pull = 0,
++  .pull_down = 1,
++  .keeper = 0,
++  .pull_up = 2,
++};
++
+ static const struct msm_pinctrl_soc_data ipq4019_pinctrl = {
+   .pins = ipq4019_pins,
+   .npins = ARRAY_SIZE(ipq4019_pins),
+@@ -1539,6 +1546,7 @@ static const struct msm_pinctrl_soc_data ipq4019_pinctrl 
= {
+   .groups = ipq4019_groups,
+   .ngroups = ARRAY_SIZE(ipq4019_groups),
+   .ngpios = 100,
++  .gpio_pull = _gpio_pull,
+ };
+
+ static int ipq4019_pinctrl_probe(struct platform_device *pdev)
+diff --git a/drivers/pinctrl/qcom/pinctrl-ipq8064.c 
b/drivers/pinctrl/qcom/pinctrl-ipq8064.c
+index bcb29c0..a927251 100644
+--- a/drivers/pinctrl/qcom/pinctrl-ipq8064.c
 b/drivers/pinctrl/qcom/pinctrl-ipq8064.c
+@@ -630,6 +630,7 @@ static const struct msm_pinctrl_soc_data ipq8064_pinctrl = 
{
+   .groups = ipq8064_groups,
+   .ngroups = ARRAY_SIZE(ipq8064_groups),
+   .ngpios = NUM_GPIO_PINGROUPS,
++  .gpio_pull = _gpio_pull,
+ };
+
+ static int ipq8064_pinctrl_probe(struct platform_device *pdev)
+diff --git a/drivers/pinctrl/qcom/pinctrl-mdm9615.c 
b/drivers/pinctrl/qcom/pinctr

Re: [LEDE-DEV] [PATCH v2] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-23 Thread Ram Chandra Jangir
Thanks Sven,

John has already requested changes in this patch, and I will be sharing the
new patches soon(by tomorrow) which will consider this. 

Thanks,
Ram

>On Donnerstag, 11. Mai 2017 21:59:02 CEST Ram Chandra Jangir wrote:
> ++  mux {
> ++  pins = "gpio52", "gpio53",
"gpio54",
> ++  "gpio55", "gpio56",
"gpio57",
> ++  "gpio58", "gpio59",
"gpio60",
> ++  "gpio61", "gpio62",
"gpio63",
> ++  "gpio64", "gpio65",
"gpio66",
> ++  "gpio67", "gpio68",
"gpio69";
> ++  function = "qpic_pad";
> ++  bias-disable;
> ++  };
> ++

>You are using the function qpic_pad which is not supported for some of the
GPIOs (according to
852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch [1]):

>[1.067122] ipq4019-pinctrl 100.pinctrl: invalid group "gpio57"
for function "qpic_pad"
>[1.068305] ipq4019-pinctrl 100.pinctrl: invalid group "gpio58"
for function "qpic_pad"
>[1.076685] ipq4019-pinctrl 100.pinctrl: invalid group "gpio59"
for function "qpic_pad"
>[1.084991] ipq4019-pinctrl 100.pinctrl: invalid group "gpio60"
for function "qpic_pad"
>[1.093351] ipq4019-pinctrl 100.pinctrl: invalid group "gpio64"
for function "qpic_pad"
>[1.101653] ipq4019-pinctrl 100.pinctrl: invalid group "gpio65"
for function "qpic_pad"
>[1.109987] ipq4019-pinctrl 100.pinctrl: invalid group "gpio66"
for function "qpic_pad"
>[1.118319] ipq4019-pinctrl 100.pinctrl: invalid group "gpio67"
for function "qpic_pad"
>[1.126652] ipq4019-pinctrl 100.pinctrl: invalid group "gpio68"
for function "qpic_pad"

>* "gpio57" would be qpic_pad4
>* "gpio58" would be qpic_pad5
>* "gpio59" would be qpic_pad6
>* 

> ++PINGROUP(52, qpic_pad, mdc, pcie_clk, i2s_tx_mclk, NA, NA,
wcss0_dbg31,
> ++ tm_clk0, wifi00, wifi10, NA, NA, NA, NA),
> ++PINGROUP(53, qpic_pad, mdio1, i2s_tx_bclk, prng_rosc, dbg_out, tm0,
> ++ wifi01, wifi11, NA, NA, NA, NA, NA, NA),
> ++PINGROUP(54, qpic_pad, blsp_spi0, i2s_td1, atest_char3, pmu0, NA,
NA,
> ++ boot8, tm1, NA, NA, NA, NA, NA),
> ++PINGROUP(55, qpic_pad, blsp_spi0, i2s_td2, atest_char2, pmu1, NA,
NA,
> ++ boot9, tm2, NA, NA, NA, NA, NA),
> ++PINGROUP(56, qpic_pad, blsp_spi0, i2s_td3, atest_char1, NA, tm_ack,
> ++ wifi03, wifi13, NA, NA, NA, NA, NA, NA),
> ++PINGROUP(57, qpic_pad4, blsp_spi0, i2s_tx_fsync, atest_char0, NA,
tm3,
> ++ wifi02, wifi12, NA, NA, NA, NA, NA, NA),
> ++PINGROUP(58, qpic_pad5, led2, blsp_i2c0, smart3, smart1,
i2s_rx_mclk,
> ++ NA, wcss0_dbg14, tm4, wifi04, wifi14, NA, NA, NA),
> ++PINGROUP(59, qpic_pad6, blsp_i2c0, smart3, smart1, i2s_spdif_in, NA,
> ++ NA, wcss0_dbg15, qdss_tracectl_a, boot18, tm5, NA, NA, NA),
> ++PINGROUP(60, qpic_pad7, blsp_uart0, smart1, smart3, led0,
i2s_tx_bclk,
> ++ i2s_rx_bclk, atest_char, NA, wcss0_dbg4, qdss_traceclk_a,
> ++ boot19, tm6, NA),
> ++PINGROUP(61, qpic_pad, blsp_uart0, smart1, smart3, led1,
i2s_tx_fsync,
> ++ i2s_rx_fsync, NA, NA, wcss0_dbg5, qdss_cti_trig_out_a0,
> ++ boot14, tm7, NA),
> ++PINGROUP(62, qpic_pad, chip_rst, wifi0_uart, wifi1_uart,
i2s_spdif_out,
> ++ NA, NA, wcss0_dbg6, qdss_cti_trig_out_b0, boot11, tm8, NA,
NA,
> ++ NA),
> ++PINGROUP(63, qpic_pad, wifi0_uart1, wifi1_uart1, wifi1_uart,
i2s_td1,
> ++ i2s_rxd, i2s_spdif_out, i2s_spdif_in, NA, wcss0_dbg7,
> ++ wcss1_dbg7, boot20, tm9, NA),
> ++PINGROUP(64, qpic_pad1, audio_pwm0, NA, wcss0_dbg8, wcss1_dbg8, NA,
NA,
> ++ NA, NA, NA, NA, NA, NA, NA),
> ++PINGROUP(65, qpic_pad2, audio_pwm1, NA, wcss0_dbg9, wcss1_dbg9, NA,
NA,
> ++ NA, NA, NA, NA, NA, NA, NA),
> ++PINGROUP(66, qpic_pad3, audio_pwm2, NA, wcss0_dbg10, wcss1_dbg10,
NA,
> ++ NA, NA, NA, NA, NA, NA, NA, NA),
> ++PINGROUP(67, qpic_pad0, audio_pwm3, NA, wcss0_dbg11, wcss1_dbg11,
NA,
> ++ NA, NA, NA, NA, NA, NA, NA, NA),
> ++PINGROUP(68, qpic_pad8, NA, wcss0_dbg12, wcss1_dbg12, NA, NA, NA,
NA,
> ++ NA, NA, NA, NA, NA, NA),
> ++PINGROUP(69, qpic_pad, NA, wcss0_dbg, NA, NA, NA, NA, NA, NA, NA,
NA,
> ++ NA, NA, NA),

>Kind regards,
>   Sven

> [1] https://patchwork.ozlabs.org/patch/752962/


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2] ipq806x: Add support for ipq40xx AP-DK01.1-C1 and AP-DK04.1-C1

2017-05-23 Thread Ram Chandra Jangir


On Freitag, Monday, May 22, 2017 7:22 PM Sven Eckelmann wrote:
>On Freitag, 21. April 2017 00:25:37 CEST Ram Chandra Jangir wrote:
> +@@ -419,18 +424,19 @@
> +   status = "disabled";
> +
> +   gmac0: gmac0 {
> +   local-mac-address = [00 00 00 00 00 00];
> +-  vlan_tag = <1 0x1f>;
> +-  };
> +-
> +-  gmac1: gmac1 {
> +-  local-mac-address = [00 00 00 00 00 00];
> +   qcom,phy_mdio_addr = <4>;
> +   qcom,poll_required = <1>;
> +   qcom,forced_speed = <1000>;
> +   qcom,forced_duplex = <1>;
> +   vlan_tag = <2 0x20>;
> +   };
> ++
> ++  gmac1: gmac1 {
> ++  local-mac-address = [00 00 00 00 00 00];
> ++  qcom,poll_required_dynamic = <1>;
> ++  vlan_tag = <1 0x1e>;
> ++  };

>Why did you swap the gmac0 and gmac1 interface? I would guess that you have
to fix the network setup for the other devices (qcom-ipq4019-rt-ac58u.dts,
qcom- ipq4019-nbg6617.dts, qcom-ipq4019-fritz4040.dts) when you do that.

>Kind regards,
>   Sven


Thanks Sven,

Normally we configure gmac0 for  WAN group and gmac1 for  LAN group,
existing ipq806x boards are also following the same, and we would like to
continue with the  same convention. I do not see any reason to deviate this
in ipq40xx based boards.
I agree that ac58u nbg6617 and fritz4040 needs some changes, and Christian
can help us to make the same.

Thanks,
Ram


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-15 Thread Ram Chandra Jangir

Thanks Chris Blake,

>First off, thank you very much for this patch and your work on the ipq40xx 
>platform. I have been doing more testing, and it seems that some of the pins 
>in pinctl are not defined to the correct function.
>This is what I am currently seeing on the board:

> [1.278649] ipq4019-pinctrl 100.pinctrl: invalid group "gpio57"
>for function "qpic_pad"
> [1.279841] ipq4019-pinctrl 100.pinctrl: invalid group "gpio58"
>for function "qpic_pad"
> [1.288214] ipq4019-pinctrl 100.pinctrl: invalid group "gpio59"
>for function "qpic_pad"
> [1.296508] ipq4019-pinctrl 100.pinctrl: invalid group "gpio60"
>for function "qpic_pad"
> [1.304905] ipq4019-pinctrl 100.pinctrl: invalid group "gpio64"
>for function "qpic_pad"
> [1.313190] ipq4019-pinctrl 100.pinctrl: invalid group "gpio65"
>for function "qpic_pad"
> [1.321522] ipq4019-pinctrl 100.pinctrl: invalid group "gpio66"
>for function "qpic_pad"
> [1.329856] ipq4019-pinctrl 100.pinctrl: invalid group "gpio67"
>for function "qpic_pad"
> [1.338190] ipq4019-pinctrl 100.pinctrl: invalid group "gpio68"
>for function "qpic_pad"

>With that said, NAND still inits and works. I was also able to clear up the 
>errors by fixing the groups for each GPIO in my DTS with the help of 
>Christian. Example of this is at https://pastebin.com/rQDY3z9c.

>Is this something specific with my board, or some other variation with your 
>patch? I am new to this arch so please excuse me if any of this is noobish. :)

Pinctrl driver has proper definitions & values  for  respective GPIO's  in the 
patch and I did not observe such issues in IPQ4019 DK01, DK04 and other 
variants of Dakota boards, they work fine as expected.

Thanks,
Ram
 


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-15 Thread Ram Chandra Jangir


>Hello Ram,

On Thursday, May 11, 2017 8:39:46 PM CEST Christian Lamparter wrote:
> On Thursday, May 11, 2017 10:15:58 PM CEST Ram Chandra Jangir wrote:
> > I added nand pinmux in https://patchwork.ozlabs.org/patch/761243/ , 
> > Could you please try with this, if it helps you.
> Thanks, I'll forward it to Chris Blake. He can test it once he 
> returns. I'll let you know how it turned out.

>Chris reported:
>[1.40] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xf1
>[1.007580] nand: AMD/Spansion S34ML01G2
>[1.014146] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048,
OOB size: 64
>[1.018135] 11 ofpart partitions found on MTD device qcom_nand.0
>[1.025449] Creating 11 MTD partitions on "qcom_nand.0":

>so, it's working now.
Great and thank you...  

Thanks,
Ram




___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-11 Thread Ram Chandra Jangir


>Hi Christian,

>Hello,

On Monday, May 08, 2017 10:24 PM Ram Chandra Jangir wrote:
> On Saturday, May 06, 2017 11:24 PM  Christian Lamparter wrote:
>On Friday, May 5, 2017 9:19:36 PM CEST Ram Chandra Jangir wrote:
> This change add nand boot support for IPQ40xx based
> AP-DK04.1-C1 board using ubi image, also add sysupgrage support for
> AP-DK04.1-C1 and generates a sysupgrade.tar image.
> 
> Testing:
> *Tested on IPQ40xx AP-DK04.1-C1 and IPQ806x AP148 Board:
>   a. NAND boot
>   b. ubi sysupgrade
> 
> Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>

>Thanks for posting this.

>Chris Blake is currently in the process of adding the Cisco Meraki MR33.
><https://github.com/riptidewave93/LEDE-MR33>
>The MR33 uses the IPQ4029 and has just a Spansion S34ML01G200TFV00 
>128MiB
NAND Flash for storage.

>He reported that with this patch attached. The driver is loading, but 
>it
can't access the nand: 

>[0.860703] nand: second ID read did not match 7f,7f against 01,71
>[0.861633] nand: No NAND device found

>The id is supposed to be 01 (manuf = Spanion), f1 (128MiB).
>both readings are bad.

>I think this is caused by two problems:

>1. 7f, 7f should be 0xff, 0xff. 0x71 should be 0xf1.

>2. It seems that the NAND chip was not ready on the first read. 

>I strongly suspect (due to the MSB error for BIT 7), that at least one 
>I/O
line is missing due to a bad pinctrl/mux setup.

>Could you please add the pinctrl nand definitions to the dts so he can 
>test
again?

>Regards,
>Christian

>IPQ4019 (ex. AP-DK04.1-C1) boards will  have nand boot mode with a
dedicated jumper settings.  Based on nand boot jumper settings change, HW
will automatically take care of initializing  the nand_pins mux at boot
time.
>That is why  we don't need to do initialization of  pinmux in ipq4019
kernel
>boot/dts.   Currently I don't have Cisco Meraki MR33 board with me to give
a
>try.
>I  will give a try for nor-nand  boot on ipq4019 with pinmux initialization
and will update you, if it helps you.

>Thanks,
>Ram

I added nand pinmux in https://patchwork.ozlabs.org/patch/761243/  , Could
you please try with this, if it helps you.
Old patch(has pinctrl definitions):
https://patchwork.ozlabs.org/patch/752962/ 

Thanks,
Ram



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-11 Thread Ram Chandra Jangir
This change add nand boot support for IPQ40xx based
AP-DK04.1-C1 board using ubi image, also add sysupgrage
support for AP-DK04.1-C1 and generates a sysupgrade.tar
image.

Testing:
*Tested on IPQ40xx AP-DK04.1-C1 and IPQ806x AP148 Board:
  a. NAND boot
  b. ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---

Changes since v1:
* added ipq40xx nand pinmux support.

 .../ipq806x/base-files/lib/upgrade/platform.sh |1 +
 target/linux/ipq806x/image/Makefile|1 +
 ...nd-Add-bam_dma-support-in-qcom_nand-drive.patch |  382 ++
 ...nd-Added-bam-transaction-and-support-addi.patch | 1273 
 ...gine-qcom-bam_dma-Add-custom-data-mapping.patch |  217 
 ...ts-ipq4019-add-nand-and-qpic-bam-dma-node.patch |  121 ++
 ...-Add-support-to-configure-ipq40xx-GPIO_PU.patch |  261 
 7 files changed, 2256 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/860-qcom-mtd-nand-Added-bam-transaction-and-support-addi.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/861-dmaengine-qcom-bam_dma-Add-custom-data-mapping.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/862-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/863-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 8970285..fd08db3 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -12,6 +12,7 @@ platform_pre_upgrade() {
 
case "$board" in
ap148 |\
+   ap-dk04.1-c1 |\
d7800 |\
nbg6817 |\
r7500 |\
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 6ebcde5..c49a73e 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -264,6 +264,7 @@ endef
 
 define Device/AP-DK04.1-C1
$(call Device/FitImage)
+   $(call Device/UbiFit)
DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
KERNEL_LOADADDR := 0x80208000
KERNEL_INSTALL := 1
diff --git 
a/target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
 
b/target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
new file mode 100644
index 000..ad9d1bb
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
@@ -0,0 +1,382 @@
+From 074036f9de6b8c5fc642e8e2540950f6a35aa804 Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Thu, 20 Apr 2017 10:31:10 +0530
+Subject: [PATCH] qcom: mtd: nand: Add bam_dma support in qcom_nand driver
+
+The current driver only support ADM DMA so this patch adds the
+BAM DMA support in current NAND driver with compatible string
+qcom,ebi2-nandc-bam.
+Added bam channels and data buffers, NAND BAM uses 3 channels:
+command, data tx and data rx, while ADM uses only single channel.
+So this patch adds the BAM channel in device tree and using the
+same in NAND driver allocation function.
+
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ .../devicetree/bindings/mtd/qcom_nandc.txt |  69 +++--
+ drivers/mtd/nand/qcom_nandc.c  | 160 +
+ 2 files changed, 190 insertions(+), 39 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/mtd/qcom_nandc.txt 
b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+index 70dd511..9e5c9be 100644
+--- a/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
 b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+@@ -1,21 +1,26 @@
+ * Qualcomm NAND controller
+
+ Required properties:
+-- compatible: should be "qcom,ipq806x-nand"
++- compatible: "qcom,ipq806x-nand" for IPQ8064 which uses
++  ADM DMA.
++  "qcom,ebi2-nand-bam" - nand drivers using BAM DMA
++  like IPQ4019.
+ - reg:MMIO address range
+ - clocks: must contain core clock and always on clock
+ - clock-names:must contain "core" for the core clock and 
"aon" for the
+   always on clock
+ - dmas:   DMA specifier, consisting of a phandle to the 
ADM DMA
+-  controller node and the channel number to be used for
+-  NAND. Refer to dma.txt and qcom_adm.txt for more details
+-- dma-names:  must be "rxtx"
+-- qcom,cmd-crci:  must contain the ADM command type CRCI block instance
+-  number specified for the NA

Re: [LEDE-DEV] [PATCH] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-08 Thread Ram Chandra Jangir
Hi Christian,

>Hello,


 On Saturday, May 06, 2017 11:24 PM  Christian Lamparter wrote:
>On Friday, May 5, 2017 9:19:36 PM CEST Ram Chandra Jangir wrote:
> This change add nand boot support for IPQ40xx based
> AP-DK04.1-C1 board using ubi image, also add sysupgrage support for 
> AP-DK04.1-C1 and generates a sysupgrade.tar image.
> 
> Testing:
> *Tested on IPQ40xx AP-DK04.1-C1 and IPQ806x AP148 Board:
>   a. NAND boot
>   b. ubi sysupgrade
> 
> Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>

>Thanks for posting this.

>Chris Blake is currently in the process of adding the Cisco Meraki MR33.
><https://github.com/riptidewave93/LEDE-MR33>
>The MR33 uses the IPQ4029 and has just a Spansion S34ML01G200TFV00 128MiB
NAND Flash for storage.

>He reported that with this patch attached. The driver is loading, but it
can't access the nand: 

>[0.860703] nand: second ID read did not match 7f,7f against 01,71
>[0.861633] nand: No NAND device found

>The id is supposed to be 01 (manuf = Spanion), f1 (128MiB).
>both readings are bad.

>I think this is caused by two problems:

>1. 7f, 7f should be 0xff, 0xff. 0x71 should be 0xf1.

>2. It seems that the NAND chip was not ready on the first read. 

>I strongly suspect (due to the MSB error for BIT 7), that at least one I/O
line is missing due to a bad pinctrl/mux setup.

>Could you please add the pinctrl nand definitions to the dts so he can test
again?

>Regards,
>Christian

IPQ4019 (ex. AP-DK04.1-C1) boards will  have nand boot mode with a dedicated
jumper settings.  Based on nand boot jumper settings change, HW will
automatically take care of initializing  the nand_pins mux at boot time.
That is why  we don't need to do initialization of  pinmux in ipq4019 kernel
boot/dts.   Currently I don't have Cisco Meraki MR33 board with me to give a
try.
I  will give a try for nor-nand  boot on ipq4019 with pinmux initialization
and will update you, if it helps you.

Thanks,
Ram




___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-06 Thread Ram Chandra Jangir

  On Fri, May 5, 2017 at 10:39 PM, Matthew McClintock <msm-...@mcclintock.net> 
wrote:
>On Fri, May 5, 2017 at 12:00 PM, John Crispin <j...@phrozen.org> wrote:
> On 05/05/17 17:49, Ram Chandra Jangir wrote:
>>
>> This change add nand boot support for IPQ40xx based
>> AP-DK04.1-C1 board using ubi image, also add sysupgrage support for 
>> AP-DK04.1-C1 and generates a sysupgrade.tar image.
>>
>> Testing:
>> *Tested on IPQ40xx AP-DK04.1-C1 and IPQ806x AP148 Board:
>>a. NAND boot
>>b. ubi sysupgrade
>>
>> Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
>
> Hi Ram,
>
> have you posted this driver upstream already ?

>It's been posted before:

>https://patchwork.kernel.org/project/linux-arm-msm/list/?submitter=163301

>-M

Thanks Matt,

John:  BAM  DMA engine driver has been also submitted before:
https://patchwork.kernel.org/patch/3807381/ 

Thanks,
Ram


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1

2017-05-05 Thread Ram Chandra Jangir
This change add nand boot support for IPQ40xx based
AP-DK04.1-C1 board using ubi image, also add sysupgrage
support for AP-DK04.1-C1 and generates a sysupgrade.tar
image.

Testing:
*Tested on IPQ40xx AP-DK04.1-C1 and IPQ806x AP148 Board:
  a. NAND boot
  b. ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---
 .../ipq806x/base-files/lib/upgrade/platform.sh |1 +
 target/linux/ipq806x/image/Makefile|1 +
 ...nd-Add-bam_dma-support-in-qcom_nand-drive.patch |  382 ++
 ...nd-Added-bam-transaction-and-support-addi.patch | 1273 
 ...gine-qcom-bam_dma-Add-custom-data-mapping.patch |  217 
 ...ts-ipq4019-add-nand-and-qpic-bam-dma-node.patch |   83 ++
 6 files changed, 1957 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/860-qcom-mtd-nand-Added-bam-transaction-and-support-addi.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/861-dmaengine-qcom-bam_dma-Add-custom-data-mapping.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/862-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 8970285..fd08db3 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -12,6 +12,7 @@ platform_pre_upgrade() {
 
case "$board" in
ap148 |\
+   ap-dk04.1-c1 |\
d7800 |\
nbg6817 |\
r7500 |\
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 6ebcde5..c49a73e 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -264,6 +264,7 @@ endef
 
 define Device/AP-DK04.1-C1
$(call Device/FitImage)
+   $(call Device/UbiFit)
DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
KERNEL_LOADADDR := 0x80208000
KERNEL_INSTALL := 1
diff --git 
a/target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
 
b/target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
new file mode 100644
index 000..ad9d1bb
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.9/859-qcom-mtd-nand-Add-bam_dma-support-in-qcom_nand-drive.patch
@@ -0,0 +1,382 @@
+From 074036f9de6b8c5fc642e8e2540950f6a35aa804 Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjan...@codeaurora.org>
+Date: Thu, 20 Apr 2017 10:31:10 +0530
+Subject: [PATCH] qcom: mtd: nand: Add bam_dma support in qcom_nand driver
+
+The current driver only support ADM DMA so this patch adds the
+BAM DMA support in current NAND driver with compatible string
+qcom,ebi2-nandc-bam.
+Added bam channels and data buffers, NAND BAM uses 3 channels:
+command, data tx and data rx, while ADM uses only single channel.
+So this patch adds the BAM channel in device tree and using the
+same in NAND driver allocation function.
+
+Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
+---
+ .../devicetree/bindings/mtd/qcom_nandc.txt |  69 +++--
+ drivers/mtd/nand/qcom_nandc.c  | 160 +
+ 2 files changed, 190 insertions(+), 39 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/mtd/qcom_nandc.txt 
b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+index 70dd511..9e5c9be 100644
+--- a/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
 b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+@@ -1,21 +1,26 @@
+ * Qualcomm NAND controller
+
+ Required properties:
+-- compatible: should be "qcom,ipq806x-nand"
++- compatible: "qcom,ipq806x-nand" for IPQ8064 which uses
++  ADM DMA.
++  "qcom,ebi2-nand-bam" - nand drivers using BAM DMA
++  like IPQ4019.
+ - reg:MMIO address range
+ - clocks: must contain core clock and always on clock
+ - clock-names:must contain "core" for the core clock and 
"aon" for the
+   always on clock
+ - dmas:   DMA specifier, consisting of a phandle to the 
ADM DMA
+-  controller node and the channel number to be used for
+-  NAND. Refer to dma.txt and qcom_adm.txt for more details
+-- dma-names:  must be "rxtx"
+-- qcom,cmd-crci:  must contain the ADM command type CRCI block instance
+-  number specified for the NAND controller on the given
+-  platform
+-- qcom,data-crci: must contain the ADM data type CRCI block instance
+-  number specified for the NAND controller on the given
+-

Re: [LEDE-DEV] [PATCH 2/2] ipq806x: Add support for ipq40xx subtarget

2017-04-17 Thread Ram Chandra Jangir

Hi Christian,

Thanks for the review and time. Please see my inline comments. I will update
these in  new version of this patch .

>This is what the user sees on the WPJ428:
> [   30.614478] usb 1-1: new high-speed USB device number 3 using 
>xhci-hcd
> [   31.356496] xhci-hcd xhci-hcd.0.auto: Cannot set link state.
> [   31.357151] usb usb2-port1: cannot disable (err = -32)

>Can you please check the usb port functionality on your board too?

>- the board fails to reboot / restart.
>The WPJ428 LEDE-Image will just freeze. The FB4040 and RT-AC58U doesn't
have no issue though and neither does the Stock Image. Can you please check,
if this is working with your image?
[Ram]: I faced lots of network issues/panics and fixed them. Basic board
boot up is fine with usb and checked only basic USB 3.0  functionality. I
have not done thoroughly testing with usb. That's why I did not mention usb
in commit message except network. Will take it on next.
  
> ---
> diff --git a/target/linux/ipq806x/Makefile 
> b/target/linux/ipq806x/Makefile index 5a5551c..b5b36e1 100644
> --- a/target/linux/ipq806x/Makefile
> +++ b/target/linux/ipq806x/Makefile
> @@ -21,7 +21,7 @@ DEFAULT_PACKAGES += \
>   kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \
>   kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
>   kmod-usb3 kmod-usb-dwc3-of-simple kmod-usb-phy-qcom-dwc3 \
> - kmod-ath10k wpad-mini \
> + kmod-ath10k wpad-mini kmod-switch-ar40xx kmod-ipq40xx-edma \

>>the switch and edma driver are already part of the default image.
>>Why do you want to have them as separate packages?
[Ram]: It is good to have enabled them as module instead of inbuilt,
Theoretically ar40xx switch depends on swconfig module which is enabled as
kmod only.

> diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
> b/target/linux/ipq806x/base-files/etc/board.d/02_network
> index 36e0fb3..082105a 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/02_network
> +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
> @@ -48,6 +48,12 @@ nbg6817)
>   ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
>   ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
>   ;;
> +ap-dk01.1-c1|\
> +ap-dk04.1-c1)
> + ucidef_set_interfaces_lan_wan "eth1" "eth0"
> + ucidef_add_switch "switch0" \
> + "0t@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
> + ;;

>For the record: eth1 IS NOT a separate MAC. From what I can tell, the
essedma driver just maps different VLANs to multiple ethX instances. 
>So both eth0 and eth1 share the same PSGMII link to the QCA8075. 
>Therefore I suggest to let the kernel handle the VLAN and switch to:

  > ucidef_add_switch "switch0" \
>"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
>
>   (the ucidef_set_interfaces_lan_wan gets removed)

>>This will create eth0.1 and eth0.2 instead of eth0 and eth1.

[Ram] : I added eth0 as WAN and eth1 along with eth1.1  as lan interfaces.  
   verified IPv4 and IPv6 connectivity, Router can ping device
through WAN interface
   Device on LAN can ping through router.  I will look your
patch after this.

>I've already tested this and made a patch:
<https://github.com/chunkeey/LEDE-IPQ40XX/commit/f4c1345f73bb63d7c5b9acc7e76
6c18b071c7885>
>[@John, I think this should fix the weird VLAN issues you had with your
box] (I'm waiting for AP devices with a AR8036 to see how they behave here)
> diff --git 
> a/target/linux/ipq806x/patches-4.9/851-dts-ipq40xx-Add-support-for-spi
> -nor-32-MB-flash-and-.patch 
> b/target/linux/ipq806x/patches-4.9/851-dts-ipq40xx-Add-support-for-spi
> -nor-32-MB-flash-and-.patch
> new file mode 100644
> index 000..5753f10
> --- /dev/null
> +++ b/target/linux/ipq806x/patches-4.9/851-dts-ipq40xx-Add-support-for
> +++ -spi-nor-32-MB-flash-and-.patch
> @@ -0,0 +1,111 @@
> +From 5f07811771ad92a3413248a240eaedfee09ace93 Mon Sep 17 00:00:00 
> +2001
> +From: Ram Chandra Jangir <rjan...@codeaurora.org>
> +Date: Fri, 24 Mar 2017 14:00:00 +0530
> +Subject: [PATCH] dts: ipq40xx: Add support for spi nor 32 MB flash 
> +and enable  wifi support
> +
> +- Add micron n25q128a11 spi nor 32MB flash and fixes spi nodes
> +  to work on DK01 and DK04 boards.
> +- Add support for default SPI configuration
> +- Enable and fixed WiFi nodes to work with DK boards
> +
> +Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
> +---
> +[...]
> +diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.

Re: [LEDE-DEV] [PATCH 2/2] ipq806x: Add support for ipq40xx subtarget

2017-04-17 Thread Ram Chandra Jangir
Hi Felix,

> What's the reason for making it a separate subtarget?

We would like to add ipq40xx as subtarget for following reasons.
1. ipq40xx is different SoC than existing ipq806x
2. Would like to have SoC specific images, so that kernel configs can be 
tweaked per SoC
3. SoC specific images will be smaller in size & faster boot-time
4. Newer SoC may have exclusive FWs which needs compile time differentiation.
5. There is new SoC(ipq807x) under development, which is based on ARMv8. Hence 
we will need subtarget approach to accommodate new SoC.

Thanks,
Ram

-Original Message-
From: Felix Fietkau [mailto:n...@nbd.name] 
Sent: Friday, April 14, 2017 2:59 PM
To: Ram Chandra Jangir <rjan...@codeaurora.org>; lede-dev@lists.infradead.org
Subject: Re: [LEDE-DEV] [PATCH 2/2] ipq806x: Add support for ipq40xx subtarget

On 2017-04-13 17:10, Ram Chandra Jangir wrote:
> This change adds QCA IPQ40xx SoC based board support
> 
> Supported IPQ40xx boards:
>  - AP-DK01.1-C1 and AP-DK04.1-C1 with nor flash boot.
> 
> Network Test:
>  - Tested IPv4 and IPv6 connectivity
>  - Router can ping device through WAN interface
>  - Device on LAN can ping through router.
>  - WiFi connectivity AP as well as STA
> 
> Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
What's the reason for making it a separate subtarget?
I think it would be better to be able to run ipq806x and ipq40xx from the same 
build. It also saves resources for our snapshot builds.

- Felix



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 2/2] ipq806x: Add support for ipq40xx subtarget

2017-04-13 Thread Ram Chandra Jangir
This change adds QCA IPQ40xx SoC based board support

Supported IPQ40xx boards:
 - AP-DK01.1-C1 and AP-DK04.1-C1 with nor flash boot.

Network Test:
 - Tested IPv4 and IPv6 connectivity
 - Router can ping device through WAN interface
 - Device on LAN can ping through router.
 - WiFi connectivity AP as well as STA

Signed-off-by: Ram Chandra Jangir <rjan...@codeaurora.org>
---
 target/linux/ipq806x/Makefile  |4 +-
 .../ipq806x/base-files/etc/board.d/02_network  |6 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |8 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |6 +
 target/linux/ipq806x/config-4.9|   10 +-
 target/linux/ipq806x/image/Makefile|   30 +-
 target/linux/ipq806x/ipq40xx/config-default|5 +
 target/linux/ipq806x/ipq40xx/target.mk |7 +
 target/linux/ipq806x/modules.mk|   32 +
 ...-Add-support-for-spi-nor-32-MB-flash-and-.patch |  111 ++
 ...9-pinctrl-Updated-various-Pin-definitions.patch | 1332 ++
 ...m-Fix-edma-driver-for-GMAC-avaiable-on-IP.patch | 1937 
 .../854-net-phy-Export-phy-statemachine-API.patch  |   36 +
 .../855-clk-qcom-ipq4019-add-ess-reset.patch   |   58 +
 ...-Fix-mdio-driver-to-work-with-IPQ40xx-SoC.patch |  100 +
 ...arm-dts-Add-ess-switch-device-for-IPQ4019.patch |  486 +
 target/linux/ipq806x/profiles/00-default.mk|3 +-
 17 files changed, 4161 insertions(+), 10 deletions(-)
 create mode 100644 target/linux/ipq806x/ipq40xx/config-default
 create mode 100644 target/linux/ipq806x/ipq40xx/target.mk
 create mode 100644 
target/linux/ipq806x/patches-4.9/851-dts-ipq40xx-Add-support-for-spi-nor-32-MB-flash-and-.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/853-net-qualcomm-Fix-edma-driver-for-GMAC-avaiable-on-IP.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/854-net-phy-Export-phy-statemachine-API.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/855-clk-qcom-ipq4019-add-ess-reset.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/857-ipq40xx-Fix-mdio-driver-to-work-with-IPQ40xx-SoC.patch
 create mode 100644 
target/linux/ipq806x/patches-4.9/858-arm-dts-Add-ess-switch-device-for-IPQ4019.patch

diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index 5a5551c..b5b36e1 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -8,7 +8,7 @@ BOARDNAME:=Qualcomm Atheros IPQ806X
 FEATURES:=squashfs nand ubifs fpu
 CPU_TYPE:=cortex-a15
 CPU_SUBTYPE:=neon-vfpv4
-SUBTARGETS:=ipq806x
+SUBTARGETS:=ipq806x ipq40xx
 MAINTAINER:=John Crispin <j...@phrozen.org>
 
 KERNEL_PATCHVER:=4.9
@@ -21,7 +21,7 @@ DEFAULT_PACKAGES += \
kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \
kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
kmod-usb3 kmod-usb-dwc3-of-simple kmod-usb-phy-qcom-dwc3 \
-   kmod-ath10k wpad-mini \
+   kmod-ath10k wpad-mini kmod-switch-ar40xx kmod-ipq40xx-edma \
uboot-envtools
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 36e0fb3..082105a 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -48,6 +48,12 @@ nbg6817)
ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
;;
+ap-dk01.1-c1|\
+ap-dk04.1-c1)
+   ucidef_set_interfaces_lan_wan "eth1" "eth0"
+   ucidef_add_switch "switch0" \
+   "0t@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
+   ;;
 *)
echo "Unsupported hardware. Network interfaces not intialized"
;;
diff --git 
a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 6526212..46f3f92 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -51,6 +51,10 @@ case "$FIRMWARE" in
fritz4040)
/usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x207 -l 12064 -o 
/lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config")
;;
+   ap-dk01.1-c1 |\
+   ap-dk04.1-c1)
+   ath10kcal_extract "0:ART" 4096 12064
+   ;;
esac
;;
 "ath10k/pre-cal-ahb-a80.wifi.bin")
@@ -58,6 +62,10 @@ case "$FIRMWARE" in
fritz4040)
/usr/bin/fritz_cal_extract -i 1 -