[OpenWrt-Devel] ar71xx: disable devicetree support

Message ID ca6243c7d69a27a1ca4ed68f6c232b0ce73fe3e9.1515628352.git.mschiffer@universe-factory.net
State Superseded
Headers show
Series
  • [OpenWrt-Devel] ar71xx: disable devicetree support
Related show

Commit Message

Matthias Schiffer Jan. 10, 2018, 11:52 p.m.
While we'd like to convert ar71xx to DT-based configuration
eventually, we aren't quite there yet, and shipping half-baked DT support
that is not used at all wastes precious space.

Saves ~120KB before LZMA, ~33KB after LZMA.

Run-tested on TP-Link CPE510 and TL-WR841 v7.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 target/linux/ar71xx/config-4.9                     | 21 +------
 .../ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch  | 70 ++++++++++++++++++++++
 ...20-MIPS-ath79-add-support-for-QCA953x-SoC.patch |  4 +-
 ...21-MIPS-ath79-add-support-for-QCA956x-SoC.patch |  4 +-
 4 files changed, 75 insertions(+), 24 deletions(-)
 create mode 100644 target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch

Comments

Tomislav Požega Jan. 11, 2018, 9:43 a.m. | #1
and leave it disabled. whos idea it was anyway to convert ar71xx to DTS?
unnecesary complications from my POV


On 11 January 2018 at 00:52, Matthias Schiffer <
mschiffer@universe-factory.net> wrote:

> While we'd like to convert ar71xx to DT-based configuration
> eventually, we aren't quite there yet, and shipping half-baked DT support
> that is not used at all wastes precious space.
>
> Saves ~120KB before LZMA, ~33KB after LZMA.
>
> Run-tested on TP-Link CPE510 and TL-WR841 v7.
>
> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
> ---
>  target/linux/ar71xx/config-4.9                     | 21 +------
>  .../ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch  | 70
> ++++++++++++++++++++++
>  ...20-MIPS-ath79-add-support-for-QCA953x-SoC.patch |  4 +-
>  ...21-MIPS-ath79-add-support-for-QCA956x-SoC.patch |  4 +-
>  4 files changed, 75 insertions(+), 24 deletions(-)
>  create mode 100644 target/linux/ar71xx/patches-4.
> 9/604-MIPS-ath79-no-of.patch
>
> diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-
> 4.9
> index 4334d25b80..1b9b971688 100644
> --- a/target/linux/ar71xx/config-4.9
> +++ b/target/linux/ar71xx/config-4.9
> @@ -284,7 +284,6 @@ CONFIG_CRYPTO_RNG2=y
>  CONFIG_CRYPTO_WORKQUEUE=y
>  CONFIG_CSRC_R4K=y
>  CONFIG_DMA_NONCOHERENT=y
> -CONFIG_DTC=y
>  CONFIG_EARLY_PRINTK=y
>  CONFIG_ETHERNET_PACKET_MANGLE=y
>  CONFIG_FIXED_PHY=y
> @@ -360,14 +359,12 @@ CONFIG_INITRAMFS_ROOT_UID=0
>  CONFIG_INITRAMFS_SOURCE="../../root"
>  CONFIG_INTEL_XWAY_PHY=y
>  CONFIG_IP17XX_PHY=y
> -CONFIG_IRQCHIP=y
>  CONFIG_IRQ_DOMAIN=y
>  CONFIG_IRQ_FORCED_THREADING=y
>  CONFIG_IRQ_MIPS_CPU=y
>  CONFIG_IRQ_WORK=y
>  CONFIG_LEDS_GPIO=y
>  # CONFIG_LEDS_WNDR3700_USB is not set
> -CONFIG_LIBFDT=y
>  CONFIG_MARVELL_PHY=y
>  CONFIG_MDIO_BITBANG=y
>  CONFIG_MDIO_BOARDINFO=y
> @@ -378,15 +375,10 @@ CONFIG_MIPS_ASID_BITS=8
>  CONFIG_MIPS_ASID_SHIFT=0
>  CONFIG_MIPS_CLOCK_VSYSCALL=y
>  # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
> -# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
>  CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
> -# CONFIG_MIPS_CMDLINE_FROM_DTB is not set
> -# CONFIG_MIPS_ELF_APPENDED_DTB is not set
>  # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
>  CONFIG_MIPS_L1_CACHE_SHIFT=5
>  CONFIG_MIPS_MACHINE=y
> -CONFIG_MIPS_NO_APPENDED_DTB=y
> -# CONFIG_MIPS_RAW_APPENDED_DTB is not set
>  CONFIG_MIPS_SPRAM=y
>  CONFIG_MODULES_USE_ELF_REL=y
>  CONFIG_MTD_CFI_ADV_OPTIONS=y
> @@ -422,17 +414,7 @@ CONFIG_NET_DSA_TAG_TRAILER=y
>  CONFIG_NET_SWITCHDEV=y
>  CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
>  # CONFIG_NO_IOPORT_MAP is not set
> -CONFIG_OF=y
> -CONFIG_OF_ADDRESS=y
> -CONFIG_OF_ADDRESS_PCI=y
> -CONFIG_OF_EARLY_FLATTREE=y
> -CONFIG_OF_FLATTREE=y
> -CONFIG_OF_GPIO=y
> -CONFIG_OF_IRQ=y
> -CONFIG_OF_MDIO=y
> -CONFIG_OF_NET=y
> -CONFIG_OF_PCI=y
> -CONFIG_OF_PCI_IRQ=y
> +# CONFIG_OF is not set
>  CONFIG_PCI=y
>  CONFIG_PCI_AR724X=y
>  CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
> @@ -486,4 +468,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y
>  CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y
>  CONFIG_TICK_CPU_ACCOUNTING=y
>  CONFIG_USB_SUPPORT=y
> -CONFIG_USE_OF=y
> diff --git a/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch
> b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch
> new file mode 100644
> index 0000000000..c0b5459e45
> --- /dev/null
> +++ b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch
> @@ -0,0 +1,70 @@
> +--- a/arch/mips/Kconfig
> ++++ b/arch/mips/Kconfig
> +@@ -195,7 +195,6 @@ config ATH79
> +       select SYS_SUPPORTS_BIG_ENDIAN
> +       select SYS_SUPPORTS_MIPS16
> +       select SYS_SUPPORTS_ZBOOT_UART_PROM
> +-      select USE_OF
> +       help
> +         Support for the Atheros AR71XX/AR724X/AR913X SoCs.
> +
> +--- a/arch/mips/ath79/setup.c
> ++++ b/arch/mips/ath79/setup.c
> +@@ -196,16 +196,20 @@ unsigned int get_c0_compare_int(void)
> +
> + void __init plat_mem_setup(void)
> + {
> ++#ifdef CONFIG_OF
> +       unsigned long fdt_start;
> ++#endif
> +
> +       set_io_port_base(KSEG1);
> +
> ++#ifdef CONFIG_OF
> +       /* Get the position of the FDT passed by the bootloader */
> +       fdt_start = fw_getenvl("fdt_start");
> +       if (fdt_start)
> +               __dt_setup_arch((void *)KSEG0ADDR(fdt_start));
> +       else if (fw_passed_dtb)
> +               __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb));
> ++#endif
> +
> +       if (mips_machtype != ATH79_MACH_GENERIC_OF) {
> +               ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
> +@@ -301,17 +305,21 @@ static int __init ath79_setup(void)
> +
> + arch_initcall(ath79_setup);
> +
> ++#ifdef CONFIG_OF
> + void __init device_tree_init(void)
> + {
> +       unflatten_and_copy_device_tree();
> + }
> ++#endif
> +
> + MIPS_MACHINE(ATH79_MACH_GENERIC,
> +            "Generic",
> +            "Generic AR71XX/AR724X/AR913X based board",
> +            NULL);
> +
> ++#ifdef CONFIG_OF
> + MIPS_MACHINE(ATH79_MACH_GENERIC_OF,
> +            "DTB",
> +            "Generic AR71XX/AR724X/AR913X based board (DT)",
> +            NULL);
> ++#endif
> +--- a/arch/mips/ath79/clock.c
> ++++ b/arch/mips/ath79/clock.c
> +@@ -33,10 +33,12 @@
> + #define AR724X_BASE_FREQ      40000000
> +
> + static struct clk *clks[ATH79_CLK_END];
> ++#ifdef CONFIG_OF
> + static struct clk_onecell_data clk_data = {
> +       .clks = clks,
> +       .clk_num = ARRAY_SIZE(clks),
> + };
> ++#endif
> +
> + static struct clk *__init ath79_add_sys_clkdev(
> +       const char *id, unsigned long rate)
> diff --git a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
> b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-
> support-for-QCA953x-SoC.patch
> index 869fdd6dd0..03ff6c6aac 100644
> --- a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-
> support-for-QCA953x-SoC.patch
> +++ b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-
> support-for-QCA953x-SoC.patch
> @@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and
> DDRCLK_FROM_DDRPLL is reversed.
>   config ATH79_NVRAM
>  --- a/arch/mips/ath79/clock.c
>  +++ b/arch/mips/ath79/clock.c
> -@@ -356,6 +356,91 @@ static void __init ar934x_clocks_init(vo
> +@@ -358,6 +358,91 @@ static void __init ar934x_clocks_init(vo
>         iounmap(dpll_base);
>   }
>
> @@ -136,7 +136,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and
> DDRCLK_FROM_DDRPLL is reversed.
>   static void __init qca955x_clocks_init(void)
>   {
>         unsigned long ref_rate;
> -@@ -451,6 +536,8 @@ void __init ath79_clocks_init(void)
> +@@ -453,6 +538,8 @@ void __init ath79_clocks_init(void)
>                 ar933x_clocks_init();
>         else if (soc_is_ar934x())
>                 ar934x_clocks_init();
> diff --git a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
> b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-
> support-for-QCA956x-SoC.patch
> index dafac99190..e6eaa7123a 100644
> --- a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-
> support-for-QCA956x-SoC.patch
> +++ b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-
> support-for-QCA956x-SoC.patch
> @@ -24,7 +24,7 @@
>   config ATH79_NVRAM
>  --- a/arch/mips/ath79/clock.c
>  +++ b/arch/mips/ath79/clock.c
> -@@ -526,6 +526,100 @@ static void __init qca955x_clocks_init(v
> +@@ -528,6 +528,100 @@ static void __init qca955x_clocks_init(v
>         clk_add_alias("uart", NULL, "ref", NULL);
>   }
>
> @@ -125,7 +125,7 @@
>   void __init ath79_clocks_init(void)
>   {
>         if (soc_is_ar71xx())
> -@@ -540,6 +634,8 @@ void __init ath79_clocks_init(void)
> +@@ -542,6 +636,8 @@ void __init ath79_clocks_init(void)
>                 qca953x_clocks_init();
>         else if (soc_is_qca955x())
>                 qca955x_clocks_init();
> --
> 2.15.1
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
<div dir="ltr">and leave it disabled. whos idea it was anyway to convert ar71xx to DTS? unnecesary complications from my POV<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 January 2018 at 00:52, Matthias Schiffer <span dir="ltr">&lt;<a href="mailto:mschiffer@universe-factory.net" target="_blank">mschiffer@universe-factory.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While we&#39;d like to convert ar71xx to DT-based configuration<br>
eventually, we aren&#39;t quite there yet, and shipping half-baked DT support<br>
that is not used at all wastes precious space.<br>
<br>
Saves ~120KB before LZMA, ~33KB after LZMA.<br>
<br>
Run-tested on TP-Link CPE510 and TL-WR841 v7.<br>
<br>
Signed-off-by: Matthias Schiffer &lt;<a href="mailto:mschiffer@universe-factory.net">mschiffer@universe-factory.<wbr>net</a>&gt;<br>
---<br>
 target/linux/ar71xx/config-4.9                     | 21 +------<br>
 .../ar71xx/patches-4.9/604-<wbr>MIPS-ath79-no-of.patch  | 70 ++++++++++++++++++++++<br>
 ...20-MIPS-ath79-add-support-<wbr>for-QCA953x-SoC.patch |  4 +-<br>
 ...21-MIPS-ath79-add-support-<wbr>for-QCA956x-SoC.patch |  4 +-<br>
 4 files changed, 75 insertions(+), 24 deletions(-)<br>
 create mode 100644 target/linux/ar71xx/patches-4.<wbr>9/604-MIPS-ath79-no-of.patch<br>
<br>
diff --git a/target/linux/ar71xx/config-<wbr>4.9 b/target/linux/ar71xx/config-<wbr>4.9<br>
index 4334d25b80..1b9b971688 100644<br>
--- a/target/linux/ar71xx/config-<wbr>4.9<br>
+++ b/target/linux/ar71xx/config-<wbr>4.9<br>
@@ -284,7 +284,6 @@ CONFIG_CRYPTO_RNG2=y<br>
 CONFIG_CRYPTO_WORKQUEUE=y<br>
 CONFIG_CSRC_R4K=y<br>
 CONFIG_DMA_NONCOHERENT=y<br>
-CONFIG_DTC=y<br>
 CONFIG_EARLY_PRINTK=y<br>
 CONFIG_ETHERNET_PACKET_MANGLE=<wbr>y<br>
 CONFIG_FIXED_PHY=y<br>
@@ -360,14 +359,12 @@ CONFIG_INITRAMFS_ROOT_UID=0<br>
 CONFIG_INITRAMFS_SOURCE=&quot;../..<wbr>/root&quot;<br>
 CONFIG_INTEL_XWAY_PHY=y<br>
 CONFIG_IP17XX_PHY=y<br>
-CONFIG_IRQCHIP=y<br>
 CONFIG_IRQ_DOMAIN=y<br>
 CONFIG_IRQ_FORCED_THREADING=y<br>
 CONFIG_IRQ_MIPS_CPU=y<br>
 CONFIG_IRQ_WORK=y<br>
 CONFIG_LEDS_GPIO=y<br>
 # CONFIG_LEDS_WNDR3700_USB is not set<br>
-CONFIG_LIBFDT=y<br>
 CONFIG_MARVELL_PHY=y<br>
 CONFIG_MDIO_BITBANG=y<br>
 CONFIG_MDIO_BOARDINFO=y<br>
@@ -378,15 +375,10 @@ CONFIG_MIPS_ASID_BITS=8<br>
 CONFIG_MIPS_ASID_SHIFT=0<br>
 CONFIG_MIPS_CLOCK_VSYSCALL=y<br>
 # CONFIG_MIPS_CMDLINE_BUILTIN_<wbr>EXTEND is not set<br>
-# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set<br>
 CONFIG_MIPS_CMDLINE_FROM_<wbr>BOOTLOADER=y<br>
-# CONFIG_MIPS_CMDLINE_FROM_DTB is not set<br>
-# CONFIG_MIPS_ELF_APPENDED_DTB is not set<br>
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set<br>
 CONFIG_MIPS_L1_CACHE_SHIFT=5<br>
 CONFIG_MIPS_MACHINE=y<br>
-CONFIG_MIPS_NO_APPENDED_DTB=y<br>
-# CONFIG_MIPS_RAW_APPENDED_DTB is not set<br>
 CONFIG_MIPS_SPRAM=y<br>
 CONFIG_MODULES_USE_ELF_REL=y<br>
 CONFIG_MTD_CFI_ADV_OPTIONS=y<br>
@@ -422,17 +414,7 @@ CONFIG_NET_DSA_TAG_TRAILER=y<br>
 CONFIG_NET_SWITCHDEV=y<br>
 CONFIG_NO_GENERIC_PCI_IOPORT_<wbr>MAP=y<br>
 # CONFIG_NO_IOPORT_MAP is not set<br>
-CONFIG_OF=y<br>
-CONFIG_OF_ADDRESS=y<br>
-CONFIG_OF_ADDRESS_PCI=y<br>
-CONFIG_OF_EARLY_FLATTREE=y<br>
-CONFIG_OF_FLATTREE=y<br>
-CONFIG_OF_GPIO=y<br>
-CONFIG_OF_IRQ=y<br>
-CONFIG_OF_MDIO=y<br>
-CONFIG_OF_NET=y<br>
-CONFIG_OF_PCI=y<br>
-CONFIG_OF_PCI_IRQ=y<br>
+# CONFIG_OF is not set<br>
 CONFIG_PCI=y<br>
 CONFIG_PCI_AR724X=y<br>
 CONFIG_PCI_DISABLE_COMMON_<wbr>QUIRKS=y<br>
@@ -486,4 +468,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y<br>
 CONFIG_SYS_SUPPORTS_ZBOOT_<wbr>UART_PROM=y<br>
 CONFIG_TICK_CPU_ACCOUNTING=y<br>
 CONFIG_USB_SUPPORT=y<br>
-CONFIG_USE_OF=y<br>
diff --git a/target/linux/ar71xx/patches-<wbr>4.9/604-MIPS-ath79-no-of.patch b/target/linux/ar71xx/patches-<wbr>4.9/604-MIPS-ath79-no-of.patch<br>
new file mode 100644<br>
index 0000000000..c0b5459e45<br>
--- /dev/null<br>
+++ b/target/linux/ar71xx/patches-<wbr>4.9/604-MIPS-ath79-no-of.patch<br>
@@ -0,0 +1,70 @@<br>
+--- a/arch/mips/Kconfig<br>
++++ b/arch/mips/Kconfig<br>
+@@ -195,7 +195,6 @@ config ATH79<br>
+       select SYS_SUPPORTS_BIG_ENDIAN<br>
+       select SYS_SUPPORTS_MIPS16<br>
+       select SYS_SUPPORTS_ZBOOT_UART_PROM<br>
+-      select USE_OF<br>
+       help<br>
+         Support for the Atheros AR71XX/AR724X/AR913X SoCs.<br>
+<br>
+--- a/arch/mips/ath79/setup.c<br>
++++ b/arch/mips/ath79/setup.c<br>
+@@ -196,16 +196,20 @@ unsigned int get_c0_compare_int(void)<br>
+<br>
+ void __init plat_mem_setup(void)<br>
+ {<br>
++#ifdef CONFIG_OF<br>
+       unsigned long fdt_start;<br>
++#endif<br>
+<br>
+       set_io_port_base(KSEG1);<br>
+<br>
++#ifdef CONFIG_OF<br>
+       /* Get the position of the FDT passed by the bootloader */<br>
+       fdt_start = fw_getenvl(&quot;fdt_start&quot;);<br>
+       if (fdt_start)<br>
+               __dt_setup_arch((void *)KSEG0ADDR(fdt_start));<br>
+       else if (fw_passed_dtb)<br>
+               __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb));<br>
++#endif<br>
+<br>
+       if (mips_machtype != ATH79_MACH_GENERIC_OF) {<br>
+               ath79_reset_base = ioremap_nocache(AR71XX_RESET_<wbr>BASE,<br>
+@@ -301,17 +305,21 @@ static int __init ath79_setup(void)<br>
+<br>
+ arch_initcall(ath79_setup);<br>
+<br>
++#ifdef CONFIG_OF<br>
+ void __init device_tree_init(void)<br>
+ {<br>
+       unflatten_and_copy_device_<wbr>tree();<br>
+ }<br>
++#endif<br>
+<br>
+ MIPS_MACHINE(ATH79_MACH_<wbr>GENERIC,<br>
+            &quot;Generic&quot;,<br>
+            &quot;Generic AR71XX/AR724X/AR913X based board&quot;,<br>
+            NULL);<br>
+<br>
++#ifdef CONFIG_OF<br>
+ MIPS_MACHINE(ATH79_MACH_<wbr>GENERIC_OF,<br>
+            &quot;DTB&quot;,<br>
+            &quot;Generic AR71XX/AR724X/AR913X based board (DT)&quot;,<br>
+            NULL);<br>
++#endif<br>
+--- a/arch/mips/ath79/clock.c<br>
++++ b/arch/mips/ath79/clock.c<br>
+@@ -33,10 +33,12 @@<br>
+ #define AR724X_BASE_FREQ      40000000<br>
+<br>
+ static struct clk *clks[ATH79_CLK_END];<br>
++#ifdef CONFIG_OF<br>
+ static struct clk_onecell_data clk_data = {<br>
+       .clks = clks,<br>
+       .clk_num = ARRAY_SIZE(clks),<br>
+ };<br>
++#endif<br>
+<br>
+ static struct clk *__init ath79_add_sys_clkdev(<br>
+       const char *id, unsigned long rate)<br>
diff --git a/target/linux/ar71xx/patches-<wbr>4.9/620-MIPS-ath79-add-<wbr>support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-<wbr>4.9/620-MIPS-ath79-add-<wbr>support-for-QCA953x-SoC.patch<br>
index 869fdd6dd0..03ff6c6aac 100644<br>
--- a/target/linux/ar71xx/patches-<wbr>4.9/620-MIPS-ath79-add-<wbr>support-for-QCA953x-SoC.patch<br>
+++ b/target/linux/ar71xx/patches-<wbr>4.9/620-MIPS-ath79-add-<wbr>support-for-QCA953x-SoC.patch<br>
@@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.<br>
  config ATH79_NVRAM<br>
 --- a/arch/mips/ath79/clock.c<br>
 +++ b/arch/mips/ath79/clock.c<br>
-@@ -356,6 +356,91 @@ static void __init ar934x_clocks_init(vo<br>
+@@ -358,6 +358,91 @@ static void __init ar934x_clocks_init(vo<br>
        iounmap(dpll_base);<br>
  }<br>
<br>
@@ -136,7 +136,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.<br>
  static void __init qca955x_clocks_init(void)<br>
  {<br>
        unsigned long ref_rate;<br>
-@@ -451,6 +536,8 @@ void __init ath79_clocks_init(void)<br>
+@@ -453,6 +538,8 @@ void __init ath79_clocks_init(void)<br>
                ar933x_clocks_init();<br>
        else if (soc_is_ar934x())<br>
                ar934x_clocks_init();<br>
diff --git a/target/linux/ar71xx/patches-<wbr>4.9/621-MIPS-ath79-add-<wbr>support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-<wbr>4.9/621-MIPS-ath79-add-<wbr>support-for-QCA956x-SoC.patch<br>
index dafac99190..e6eaa7123a 100644<br>
--- a/target/linux/ar71xx/patches-<wbr>4.9/621-MIPS-ath79-add-<wbr>support-for-QCA956x-SoC.patch<br>
+++ b/target/linux/ar71xx/patches-<wbr>4.9/621-MIPS-ath79-add-<wbr>support-for-QCA956x-SoC.patch<br>
@@ -24,7 +24,7 @@<br>
  config ATH79_NVRAM<br>
 --- a/arch/mips/ath79/clock.c<br>
 +++ b/arch/mips/ath79/clock.c<br>
-@@ -526,6 +526,100 @@ static void __init qca955x_clocks_init(v<br>
+@@ -528,6 +528,100 @@ static void __init qca955x_clocks_init(v<br>
        clk_add_alias(&quot;uart&quot;, NULL, &quot;ref&quot;, NULL);<br>
  }<br>
<br>
@@ -125,7 +125,7 @@<br>
  void __init ath79_clocks_init(void)<br>
  {<br>
        if (soc_is_ar71xx())<br>
-@@ -540,6 +634,8 @@ void __init ath79_clocks_init(void)<br>
+@@ -542,6 +636,8 @@ void __init ath79_clocks_init(void)<br>
                qca953x_clocks_init();<br>
        else if (soc_is_qca955x())<br>
                qca955x_clocks_init();<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.15.1<br>
______________________________<wbr>_________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.<wbr>org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/cgi-<wbr>bin/mailman/listinfo/openwrt-<wbr>devel</a><br>
</font></span></blockquote></div><br></div>

Patch

diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 4334d25b80..1b9b971688 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -284,7 +284,6 @@  CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
-CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FIXED_PHY=y
@@ -360,14 +359,12 @@  CONFIG_INITRAMFS_ROOT_UID=0
 CONFIG_INITRAMFS_SOURCE="../../root"
 CONFIG_INTEL_XWAY_PHY=y
 CONFIG_IP17XX_PHY=y
-CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_MIPS_CPU=y
 CONFIG_IRQ_WORK=y
 CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_WNDR3700_USB is not set
-CONFIG_LIBFDT=y
 CONFIG_MARVELL_PHY=y
 CONFIG_MDIO_BITBANG=y
 CONFIG_MDIO_BOARDINFO=y
@@ -378,15 +375,10 @@  CONFIG_MIPS_ASID_BITS=8
 CONFIG_MIPS_ASID_SHIFT=0
 CONFIG_MIPS_CLOCK_VSYSCALL=y
 # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
-# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
 CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
-# CONFIG_MIPS_CMDLINE_FROM_DTB is not set
-# CONFIG_MIPS_ELF_APPENDED_DTB is not set
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 CONFIG_MIPS_MACHINE=y
-CONFIG_MIPS_NO_APPENDED_DTB=y
-# CONFIG_MIPS_RAW_APPENDED_DTB is not set
 CONFIG_MIPS_SPRAM=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -422,17 +414,7 @@  CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_SWITCHDEV=y
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 # CONFIG_NO_IOPORT_MAP is not set
-CONFIG_OF=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_ADDRESS_PCI=y
-CONFIG_OF_EARLY_FLATTREE=y
-CONFIG_OF_FLATTREE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
+# CONFIG_OF is not set
 CONFIG_PCI=y
 CONFIG_PCI_AR724X=y
 CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
@@ -486,4 +468,3 @@  CONFIG_SYS_SUPPORTS_ZBOOT=y
 CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_USB_SUPPORT=y
-CONFIG_USE_OF=y
diff --git a/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch
new file mode 100644
index 0000000000..c0b5459e45
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch
@@ -0,0 +1,70 @@ 
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -195,7 +195,6 @@ config ATH79
+ 	select SYS_SUPPORTS_BIG_ENDIAN
+ 	select SYS_SUPPORTS_MIPS16
+ 	select SYS_SUPPORTS_ZBOOT_UART_PROM
+-	select USE_OF
+ 	help
+ 	  Support for the Atheros AR71XX/AR724X/AR913X SoCs.
+ 
+--- a/arch/mips/ath79/setup.c
++++ b/arch/mips/ath79/setup.c
+@@ -196,16 +196,20 @@ unsigned int get_c0_compare_int(void)
+ 
+ void __init plat_mem_setup(void)
+ {
++#ifdef CONFIG_OF
+ 	unsigned long fdt_start;
++#endif
+ 
+ 	set_io_port_base(KSEG1);
+ 
++#ifdef CONFIG_OF
+ 	/* Get the position of the FDT passed by the bootloader */
+ 	fdt_start = fw_getenvl("fdt_start");
+ 	if (fdt_start)
+ 		__dt_setup_arch((void *)KSEG0ADDR(fdt_start));
+ 	else if (fw_passed_dtb)
+ 		__dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb));
++#endif
+ 
+ 	if (mips_machtype != ATH79_MACH_GENERIC_OF) {
+ 		ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
+@@ -301,17 +305,21 @@ static int __init ath79_setup(void)
+ 
+ arch_initcall(ath79_setup);
+ 
++#ifdef CONFIG_OF
+ void __init device_tree_init(void)
+ {
+ 	unflatten_and_copy_device_tree();
+ }
++#endif
+ 
+ MIPS_MACHINE(ATH79_MACH_GENERIC,
+ 	     "Generic",
+ 	     "Generic AR71XX/AR724X/AR913X based board",
+ 	     NULL);
+ 
++#ifdef CONFIG_OF
+ MIPS_MACHINE(ATH79_MACH_GENERIC_OF,
+ 	     "DTB",
+ 	     "Generic AR71XX/AR724X/AR913X based board (DT)",
+ 	     NULL);
++#endif
+--- a/arch/mips/ath79/clock.c
++++ b/arch/mips/ath79/clock.c
+@@ -33,10 +33,12 @@
+ #define AR724X_BASE_FREQ	40000000
+ 
+ static struct clk *clks[ATH79_CLK_END];
++#ifdef CONFIG_OF
+ static struct clk_onecell_data clk_data = {
+ 	.clks = clks,
+ 	.clk_num = ARRAY_SIZE(clks),
+ };
++#endif
+ 
+ static struct clk *__init ath79_add_sys_clkdev(
+ 	const char *id, unsigned long rate)
diff --git a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
index 869fdd6dd0..03ff6c6aac 100644
--- a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
+++ b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
@@ -44,7 +44,7 @@  meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  config ATH79_NVRAM
 --- a/arch/mips/ath79/clock.c
 +++ b/arch/mips/ath79/clock.c
-@@ -356,6 +356,91 @@ static void __init ar934x_clocks_init(vo
+@@ -358,6 +358,91 @@ static void __init ar934x_clocks_init(vo
  	iounmap(dpll_base);
  }
  
@@ -136,7 +136,7 @@  meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  static void __init qca955x_clocks_init(void)
  {
  	unsigned long ref_rate;
-@@ -451,6 +536,8 @@ void __init ath79_clocks_init(void)
+@@ -453,6 +538,8 @@ void __init ath79_clocks_init(void)
  		ar933x_clocks_init();
  	else if (soc_is_ar934x())
  		ar934x_clocks_init();
diff --git a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index dafac99190..e6eaa7123a 100644
--- a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -24,7 +24,7 @@ 
  config ATH79_NVRAM
 --- a/arch/mips/ath79/clock.c
 +++ b/arch/mips/ath79/clock.c
-@@ -526,6 +526,100 @@ static void __init qca955x_clocks_init(v
+@@ -528,6 +528,100 @@ static void __init qca955x_clocks_init(v
  	clk_add_alias("uart", NULL, "ref", NULL);
  }
  
@@ -125,7 +125,7 @@ 
  void __init ath79_clocks_init(void)
  {
  	if (soc_is_ar71xx())
-@@ -540,6 +634,8 @@ void __init ath79_clocks_init(void)
+@@ -542,6 +636,8 @@ void __init ath79_clocks_init(void)
  		qca953x_clocks_init();
  	else if (soc_is_qca955x())
  		qca955x_clocks_init();