Skip to contentSkip to conversation

MIPS: AR913X/AR933X devicetree patchseries

RFC Superseded Antony Pavlov 4 participants 18 messages Feb 1, 2016 2 messages not in the archive

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover MIPS: AR913X/AR933X devicetree patchseries

To use USB support on AR9331 please apply additional Alban Bedel's patches:

* https://patchwork.linux-mips.org/patch/11497/
* https://patchwork.linux-mips.org/patch/11495/

Changes since RFC v3:

* clk: get pll registers base address from devicetree node
* MIPS: dts: qca: ar9132: use short references for usb too
* MIPS: dts: qca: ar9331: add usb support
* MIPS: ath79: Dragino MS14: enable usb support

TODO:

* usb does not work on MR3020: the board just reboots after USB host
initialization; AFAIR we have to use GPIO 8 for USB power activation
(see https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3020.c?rev=32454);
* test usb on Onion Omega;
* clk: clk-ath79.c: take into account [1] and [2]

    [1] https://www.linux-mips.org/archives/linux-mips/2016-01/msg00555.html
    [2] https://www.linux-mips.org/archives/linux-mips/2016-01/msg00736.html

* ar9132_tl_wr1043nd_v1.dts -> tl_wr1043nd_v1.dts
* can we use appended DTB? see https://www.linux-mips.org/archives/linux-mips/2016-01/msg00577.html

Changes since RFC v2:

* add Onion Omega board support;
* add AR9132 SoC clock driver;
* add AR9132 devicetree fixes.

Changes since RFC v1:

* add Dragino MS14 board support;
* add "ref" oscillator input clock for pll-controller; add necessary nodes to board dts files.

Antony Pavlov (15):
WIP: clk: add Atheros AR724X/AR913X/AR933X SoCs clock driver
MIPS: ath79: use clk-ath79.c driver for AR913X/AR933X
WIP: MIPS: ath79: setup.c: disable platform code for OF boards
MIPS: dts: qca: ar9132: use dt-bindings/clock/ath79-clk.h macros
MIPS: dts: qca: ar9132: make extosc-related description shorter
MIPS: dts: qca: ar9132_tl_wr1043nd_v1.dts: drop unused alias node
MIPS: dts: qca: ar9132: use short references for uart, usb and spi nodes
MIPS: dts: qca: simplify Makefile
MIPS: dts: qca: introduce AR9331 devicetree
MIPS: ath79: add initial support for TP-LINK MR3020
devicetree: add Dragino vendor id
MIPS: ath79: add initial support for Dragino MS14 (Dragino 2)
devicetree: add Onion Corporation vendor id
MIPS: ath79: add initial support for Onion Omega
WIP: MIPS: ath79: add devicetree defconfigs

 .../devicetree/bindings/vendor-prefixes.txt        |   2 +
 arch/mips/ath79/Kconfig                            |  15 ++
 arch/mips/ath79/clock.c                            |   7 +-
 arch/mips/ath79/setup.c                            |  17 +-
 arch/mips/boot/dts/qca/Makefile                    |   8 +-
 arch/mips/boot/dts/qca/ar9132.dtsi                 |  23 ++-
 arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts   | 104 +++++-----
 arch/mips/boot/dts/qca/ar9331.dtsi                 | 158 +++++++++++++++
 arch/mips/boot/dts/qca/dragino_ms14.dts            |  80 ++++++++
 arch/mips/boot/dts/qca/omega.dts                   |  54 ++++++
 arch/mips/boot/dts/qca/tl_mr3020.dts               |  72 +++++++
 arch/mips/configs/dragino-ms14-dt-raw_defconfig    |  93 +++++++++
 arch/mips/configs/onion-omega-dt-raw_defconfig     |  85 ++++++++
 arch/mips/configs/tl-mr3020-dt-raw_defconfig       |  85 ++++++++
 arch/mips/configs/tl-wr1043nd_defconfig            |  95 +++++++++
 drivers/clk/Makefile                               |   1 +
 drivers/clk/clk-ath79.c                            | 214 +++++++++++++++++++++
 include/dt-bindings/clock/ath79-clk.h              |  22 +++
 18 files changed, 1055 insertions(+), 80 deletions(-)
 create mode 100644 arch/mips/boot/dts/qca/ar9331.dtsi
 create mode 100644 arch/mips/boot/dts/qca/dragino_ms14.dts
 create mode 100644 arch/mips/boot/dts/qca/omega.dts
 create mode 100644 arch/mips/boot/dts/qca/tl_mr3020.dts
 create mode 100644 arch/mips/configs/dragino-ms14-dt-raw_defconfig
 create mode 100644 arch/mips/configs/onion-omega-dt-raw_defconfig
 create mode 100644 arch/mips/configs/tl-mr3020-dt-raw_defconfig
 create mode 100644 arch/mips/configs/tl-wr1043nd_defconfig
 create mode 100644 drivers/clk/clk-ath79.c
 create mode 100644 include/dt-bindings/clock/ath79-clk.h
Signature · 1 line
2.7.0
#1 lore raw

RFC v4 1/15 WIP: clk: add Atheros AR724X/AR913X/AR933X SoCs clock driver

---
 drivers/clk/Makefile                  |   1 +
 drivers/clk/clk-ath79.c               | 214 ++++++++++++++++++++++++++++++++++
 include/dt-bindings/clock/ath79-clk.h |  22 ++++
 3 files changed, 237 insertions(+)
drivers/clk/Makefile +1 -0
index b038e36..d7ad50e 100644
@@ -18,6 +18,7 @@ endif
 # hardware specific clock types
 # please keep this section sorted lexicographically by file/directory path name
 obj-$(CONFIG_MACH_ASM9260)		+= clk-asm9260.o
+obj-$(CONFIG_ATH79)			+= clk-ath79.o
 obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN)	+= clk-axi-clkgen.o
 obj-$(CONFIG_ARCH_AXXIA)		+= clk-axm5516.o
 obj-$(CONFIG_COMMON_CLK_CDCE706)	+= clk-cdce706.o
drivers/clk/clk-ath79.c new file +214 -0

214 lines not on this page · raw message

include/dt-bindings/clock/ath79-clk.h new file +22 -0
new file mode 100644
index 0000000..1c6fb04
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2014, 2016 Antony Pavlov <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef __DT_BINDINGS_ATH79_CLK_H
+#define __DT_BINDINGS_ATH79_CLK_H
+
+#define ATH79_CLK_REF		0
+#define ATH79_CLK_CPU		1
+#define ATH79_CLK_DDR		2
+#define ATH79_CLK_AHB		3
+#define ATH79_CLK_WDT		4
+#define ATH79_CLK_UART		5
+
+#define ATH79_CLK_END		6
+
+#endif /* __DT_BINDINGS_ATH79_CLK_H */
Signature · 1 line
2.7.0
#2 lore raw

RFC v4 2/15 MIPS: ath79: use clk-ath79.c driver for AR913X/AR933X

In reply to Antony Pavlov
---
 arch/mips/ath79/clock.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/mips/ath79/clock.c +4 -3
index eb5117c..3289073 100644
@@ -24,6 +24,7 @@
 #include <asm/mach-ath79/ath79.h>
 #include <asm/mach-ath79/ar71xx_regs.h>
 #include "common.h"
+#include "machtypes.h"
 
 #define AR71XX_BASE_FREQ	40000000
 #define AR724X_BASE_FREQ	5000000
@@ -441,7 +442,9 @@ static void __init qca955x_clocks_init(void)
 
 void __init ath79_clocks_init(void)
 {
-	if (soc_is_ar71xx())
+	if (IS_ENABLED(CONFIG_OF) && mips_machtype == ATH79_MACH_GENERIC_OF) {
+		/* pass */
+	} else if (soc_is_ar71xx())
 		ar71xx_clocks_init();
 	else if (soc_is_ar724x())
 		ar724x_clocks_init();
@@ -483,8 +486,6 @@ static void __init ath79_clocks_init_dt(struct device_node *np)
 
 CLK_OF_DECLARE(ar7100, "qca,ar7100-pll", ath79_clocks_init_dt);
 CLK_OF_DECLARE(ar7240, "qca,ar7240-pll", ath79_clocks_init_dt);
-CLK_OF_DECLARE(ar9130, "qca,ar9130-pll", ath79_clocks_init_dt);
-CLK_OF_DECLARE(ar9330, "qca,ar9330-pll", ath79_clocks_init_dt);
 CLK_OF_DECLARE(ar9340, "qca,ar9340-pll", ath79_clocks_init_dt);
 CLK_OF_DECLARE(ar9550, "qca,qca9550-pll", ath79_clocks_init_dt);
 #endif
Signature · 1 line
2.7.0
#3 lore raw

RFC v4 3/15 WIP: MIPS: ath79: setup.c: disable platform code for OF boards

In reply to Antony Pavlov

For OF boards we have to skip platform initialization code so we can prove that OF code do all necessary initialization.

---
 arch/mips/ath79/setup.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
arch/mips/ath79/setup.c +9 -8
index be451ee4a..2b31018 100644
@@ -208,15 +208,16 @@ void __init plat_mem_setup(void)
 		__dt_setup_arch(__dtb_start);
 #endif
 
-	ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
-					   AR71XX_RESET_SIZE);
-	ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
-					 AR71XX_PLL_SIZE);
-	ath79_detect_sys_type();
-	ath79_ddr_ctrl_init();
-
-	if (mips_machtype != ATH79_MACH_GENERIC_OF)
+	if (mips_machtype != ATH79_MACH_GENERIC_OF) {
+		ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
+						   AR71XX_RESET_SIZE);
+		ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
+						 AR71XX_PLL_SIZE);
+		ath79_detect_sys_type();
+		ath79_ddr_ctrl_init();
+
 		detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX);
+	}
 
 	_machine_restart = ath79_restart;
 	_machine_halt = ath79_halt;
Signature · 1 line
2.7.0

A message that is not in the archive (sent off-list or not yet received): 1454285440-18916-1-git-send-email-antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#5 lore raw

RFC v4 6/15 MIPS: dts: qca: ar9132_tl_wr1043nd_v1.dts: drop unused alias node

The TP-LINK TL-WR1043ND board has only one serial port, so replacing the default of 0 with 0 does nothing useful.

Moreover, the correct name for aliases node is "aliases" not "alias".

An overview of the "aliases" node usage can be found on the device tree usage page at devicetree.org [1].

Also please see chapter 3.3 ("Aliases node") of the ePAPR 1.1 [2].

[1] http://devicetree.org/Device_Tree_Usage#aliases_Node
[2] https://www.power.org/documentation/epapr-version-1-1/

---
 arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts | 4 ----
 1 file changed, 4 deletions(-)
arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts +0 -4
index 9b4132f..89703cf 100644
@@ -9,10 +9,6 @@
 	compatible = "tplink,tl-wr1043nd-v1", "qca,ar9132";
 	model = "TP-Link TL-WR1043ND Version 1";
 
-	alias {
-		serial0 = "/ahb/apb/uart@18020000";
-	};
-
 	memory@0 {
 		device_type = "memory";
 		reg = <0x0 0x2000000>;
Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

RFC v4 7/15 MIPS: dts: qca: ar9132: use short references for uart, usb and spi nodes

In reply to a message not in the archive
---
 arch/mips/boot/dts/qca/ar9132.dtsi               |  6 +-
 arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts | 86 +++++++++++-------------
 2 files changed, 44 insertions(+), 48 deletions(-)
arch/mips/boot/dts/qca/ar9132.dtsi +3 -3
index e6baa1e..f4023fd 100644
@@ -61,7 +61,7 @@
 				#qca,ddr-wb-channel-cells = <1>;
 			};
 
-			uart@18020000 {
+			uart: uart@18020000 {
 				compatible = "ns8250";
 				reg = <0x18020000 0x20>;
 				interrupts = <3>;
@@ -134,7 +134,7 @@
 			};
 		};
 
-		usb@1b000100 {
+		usb: usb@1b000100 {
 			compatible = "qca,ar7100-ehci", "generic-ehci";
 			reg = <0x1b000100 0x100>;
 
@@ -149,7 +149,7 @@
 			status = "disabled";
 		};
 
-		spi@1f000000 {
+		spi: spi@1f000000 {
 			compatible = "qca,ar9132-spi", "qca,ar7100-spi";
 			reg = <0x1f000000 0x10>;
 
arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts +41 -45

95 lines not on this page · raw message

Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw

RFC v4 9/15 MIPS: dts: qca: introduce AR9331 devicetree

In reply to a message not in the archive

This patch introduces devicetree for Atheros AR9331 SoC (AKA Hornet). The AR9331 chip is a Wi-Fi System-On-Chip (WiSOC), typically used in very cheap Access Points and Routers.

---
 arch/mips/boot/dts/qca/ar9331.dtsi | 158 +++++++++++++++++++++++++++++++++++++
 1 file changed, 158 insertions(+)
arch/mips/boot/dts/qca/ar9331.dtsi new file +158 -0
new file mode 100644
index 0000000..854778b
@@ -0,0 +1,158 @@
+#include <dt-bindings/clock/ath79-clk.h>
+
+/ {
+	compatible = "qca,ar9331";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "mips,mips24Kc";
+			reg = <0>;
+		};
+	};
+
+	cpuintc: interrupt-controller {
+		compatible = "qca,ar7100-cpu-intc";
+
+		interrupt-controller;
+		#interrupt-cells = <1>;
+
+		qca,ddr-wb-channel-interrupts = <2>, <3>;
+		qca,ddr-wb-channels = <&ddr_ctrl 3>, <&ddr_ctrl 2>;
+	};
+
+	extosc: oscillator {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+	};
+
+	ahb {
+		compatible = "simple-bus";
+		ranges;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		interrupt-parent = <&cpuintc>;
+
+		apb {
+			compatible = "simple-bus";
+			ranges;
+
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			interrupt-parent = <&miscintc>;
+
+			ddr_ctrl: memory-controller@18000000 {
+				compatible = "qca,ar7240-ddr-controller";
+				reg = <0x18000000 0x100>;
+
+				#qca,ddr-wb-channel-cells = <1>;
+			};
+
+			uart: uart@18020000 {
+				compatible = "qca,ar9330-uart";
+				reg = <0x18020000 0x14>;
+
+				interrupts = <3>;
+
+				clocks = <&pll ATH79_CLK_UART>;
+				clock-names = "uart";
+
+				status = "disabled";
+			};
+
+			gpio: gpio@18040000 {
+				compatible = "qca,ar7100-gpio";
+				reg = <0x18040000 0x34>;
+				interrupts = <2>;
+
+				ngpios = <30>;
+
+				gpio-controller;
+				#gpio-cells = <2>;
+
+				interrupt-controller;
+				#interrupt-cells = <2>;
+
+				status = "disabled";
+			};
+
+			pll: pll-controller@18050000 {
+				compatible = "qca,ar9330-pll";
+				reg = <0x18050000 0x100
+					0x18060000 0x100>;
+
+				clocks = <&extosc>;
+				clock-names = "ref";
+
+				#clock-cells = <1>;
+			};
+
+			miscintc: interrupt-controller@18060010 {
+				compatible = "qca,ar7240-misc-intc";
+				reg = <0x18060010 0x4>;
+
+				interrupt-parent = <&cpuintc>;
+				interrupts = <6>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+
+			rst: reset-controller@1806001c {
+				compatible = "qca,ar7100-reset";
+				reg = <0x1806001c 0x4>;
+
+				#reset-cells = <1>;
+			};
+
+			usb: usb@1b000100 {
+				compatible = "qca,ar7100-ehci", "generic-ehci";
+				reg = <0x1b000100 0x100>;
+
+				interrupt-parent = <&cpuintc>;
+				interrupts = <3>;
+				resets = <&rst 5>;
+
+				has-transaction-translator;
+
+				phy-names = "usb";
+				phys = <&usb_phy>;
+
+				status = "disabled";
+			};
+
+			spi: spi@1f000000 {
+				compatible = "qca,ar7100-spi";
+				reg = <0x1f000000 0x10>;
+
+				clocks = <&pll ATH79_CLK_AHB>;
+				clock-names = "ahb";
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				status = "disabled";
+			};
+		};
+	};
+
+	usb_phy: usb-phy {
+		compatible = "qca,ar7100-usb-phy";
+
+		reset-names = "usb-phy", "usb-suspend-override";
+		resets = <&rst 4>, <&rst 3>;
+
+		#phy-cells = <0>;
+
+		status = "disabled";
+	};
+};
Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

RFC v4 10/15 MIPS: ath79: add initial support for TP-LINK MR3020

In reply to a message not in the archive

Currently only the UART, SPI-flash and LEDs are supported.

Links:

* http://www.tp-link.com/en/products/details/?model=TL-MR3020
* http://wiki.openwrt.org/toh/tp-link/tl-mr3020
* https://wikidevi.com/wiki/TP-LINK_TL-MR3020

---
 arch/mips/ath79/Kconfig              |  5 +++
 arch/mips/boot/dts/qca/Makefile      |  1 +
 arch/mips/boot/dts/qca/tl_mr3020.dts | 72 ++++++++++++++++++++++++++++++++++++
 3 files changed, 78 insertions(+)
arch/mips/ath79/Kconfig +5 -0
index 13c04cf..4fd53ae 100644
@@ -77,6 +77,11 @@ choice
 	help
 	  Select a devicetree that should be built into the kernel.
 
+	config DTB_TL_MR3020
+		bool "TL-MR3020"
+		select BUILTIN_DTB
+		select SOC_AR933X
+
 	config DTB_TL_WR1043ND_V1
 		bool "TL-WR1043ND Version 1"
 		select BUILTIN_DTB
arch/mips/boot/dts/qca/Makefile +1 -0
index 244329e..04fe47c 100644
@@ -1,5 +1,6 @@
 # All DTBs
 dtb-$(CONFIG_DTB_TL_WR1043ND_V1)	+= ar9132_tl_wr1043nd_v1.dtb
+dtb-$(CONFIG_DTB_TL_MR3020)		+= tl_mr3020.dtb
 
 obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 
arch/mips/boot/dts/qca/tl_mr3020.dts new file +72 -0

72 lines not on this page · raw message

Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#9 lore raw

RFC v4 11/15 devicetree: add Dragino vendor id

In reply to a message not in the archive

Please see http://www.dragino.com/about/about.html for details.

---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 72e2c5a..49d07bf 100644
@@ -68,6 +68,7 @@ digilent	Diglent, Inc.
 dlg	Dialog Semiconductor
 dlink	D-Link Corporation
 dmo	Data Modul AG
+dragino	Dragino Technology Co., Limited
 ea	Embedded Artists AB
 ebv	EBV Elektronik
 edt	Emerging Display Technologies
Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

RFC v4 12/15 MIPS: ath79: add initial support for Dragino MS14 (Dragino 2)

In reply to a message not in the archive

Currently only the UART, SPI-flash, USB host and LEDs are supported.

Links:

* http://www.dragino.com/products/mother-board/item/71-ms14-p.html
* https://wiki.openwrt.org/toh/dragino/ms14

---
 arch/mips/ath79/Kconfig                 |  5 +++
 arch/mips/boot/dts/qca/Makefile         |  1 +
 arch/mips/boot/dts/qca/dragino_ms14.dts | 80 +++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+)
arch/mips/ath79/Kconfig +5 -0
index 4fd53ae..2797581 100644
@@ -77,6 +77,11 @@ choice
 	help
 	  Select a devicetree that should be built into the kernel.
 
+	config DTB_DRAGINO_MS14
+		bool "Dragino MS14 (Dragino 2)"
+		select BUILTIN_DTB
+		select SOC_AR933X
+
 	config DTB_TL_MR3020
 		bool "TL-MR3020"
 		select BUILTIN_DTB
arch/mips/boot/dts/qca/Makefile +1 -0
index 04fe47c..428ebac5 100644
@@ -1,5 +1,6 @@
 # All DTBs
 dtb-$(CONFIG_DTB_TL_WR1043ND_V1)	+= ar9132_tl_wr1043nd_v1.dtb
+dtb-$(CONFIG_DTB_DRAGINO_MS14)		+= dragino_ms14.dtb
 dtb-$(CONFIG_DTB_TL_MR3020)		+= tl_mr3020.dtb
 
 obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
arch/mips/boot/dts/qca/dragino_ms14.dts new file +80 -0

80 lines not on this page · raw message

Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw

RFC v4 13/15 devicetree: add Onion Corporation vendor id

In reply to a message not in the archive

Please see https://onion.io/contact for details.

---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 49d07bf..afb96f7 100644
@@ -166,6 +166,7 @@ nvidia	NVIDIA
 nxp	NXP Semiconductors
 okaya	Okaya Electric America, Inc.
 olimex	OLIMEX Ltd.
+onion	Onion Corporation
 onnn	ON Semiconductor Corp.
 opencores	OpenCores.org
 option	Option NV
Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1454285440-18916-14-git-send-email-antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#14 lore raw

Re: [RFC v4 13/15] devicetree: add Onion Corporation vendor id

Quoted 4 lines · Antony Pavlov

Please see https://onion.io/contact for details.

I already acked this. Please add acks when posting new versions.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#15 lore raw

RFC v4 14/15 MIPS: ath79: add initial support for Onion Omega

In reply to a message not in the archive

Currently only the UART, SPI-flash and LEDs are supported.

Please see https://onion.io/omega for details.

Cc Gabor Juhos <[email protected]>
Cc Alban Bedel <[email protected]>
Cc L. D. Pinney <[email protected]>
Cc Boken Lin <bl-Jj7zZGp/[email protected]>
Cc Jacky Huang <huangfangcheng-9Onoh4P/[email protected]>
Cc linux-mips-6z/[email protected]
---
 arch/mips/ath79/Kconfig          |  5 ++++
 arch/mips/boot/dts/qca/Makefile  |  1 +
 arch/mips/boot/dts/qca/omega.dts | 54 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+)
arch/mips/ath79/Kconfig +5 -0
index 2797581..5273039 100644
@@ -82,6 +82,11 @@ choice
 		select BUILTIN_DTB
 		select SOC_AR933X
 
+	config DTB_ONION_OMEGA
+		bool "Onion Omega"
+		select BUILTIN_DTB
+		select SOC_AR933X
+
 	config DTB_TL_MR3020
 		bool "TL-MR3020"
 		select BUILTIN_DTB
arch/mips/boot/dts/qca/Makefile +1 -0
index 428ebac5..efecdac 100644
@@ -1,6 +1,7 @@
 # All DTBs
 dtb-$(CONFIG_DTB_TL_WR1043ND_V1)	+= ar9132_tl_wr1043nd_v1.dtb
 dtb-$(CONFIG_DTB_DRAGINO_MS14)		+= dragino_ms14.dtb
+dtb-$(CONFIG_DTB_ONION_OMEGA)		+= omega.dtb
 dtb-$(CONFIG_DTB_TL_MR3020)		+= tl_mr3020.dtb
 
 obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
arch/mips/boot/dts/qca/omega.dts new file +54 -0

54 lines not on this page · raw message

Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#16 lore raw

RFC v4 4/15 MIPS: dts: qca: ar9132: use dt-bindings/clock/ath79-clk.h macros

In reply to Antony Pavlov

The old ar9132 clk implementation (see arch/mips/ath79/clock.c) have had only 3 devicetree clks (cpu, ddr, ahb). Two additional clocks (wdt and uart) have realized as aliases for ahb clock. In the old ar9132 clk implementation the wdt and uart clocks were inaccessible via devicetree so index "2" used for reference to ahb clock instead, e.g.

    clocks = <&pll 2>;

In the new ar9132 clk implementation (see drivers/clk/clk-ath79.c) the wdt and uart clks are accessible via devicetree
so appropriate ATH79_CLK_WDT and ATH79_CLK_UART are used in ar9132.dtsi.

---
 arch/mips/boot/dts/qca/ar9132.dtsi | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
arch/mips/boot/dts/qca/ar9132.dtsi +5 -3
index 3ad4ba9..a1b4fa1 100644
@@ -1,3 +1,5 @@
+#include <dt-bindings/clock/ath79-clk.h>
+
 / {
 	compatible = "qca,ar9132";
 
@@ -57,7 +59,7 @@
 				reg = <0x18020000 0x20>;
 				interrupts = <3>;
 
-				clocks = <&pll 2>;
+				clocks = <&pll ATH79_CLK_UART>;
 				clock-names = "uart";
 
 				reg-io-width = <4>;
@@ -100,7 +102,7 @@
 
 				interrupts = <4>;
 
-				clocks = <&pll 2>;
+				clocks = <&pll ATH79_CLK_WDT>;
 				clock-names = "wdt";
 			};
 
@@ -144,7 +146,7 @@
 			compatible = "qca,ar9132-spi", "qca,ar7100-spi";
 			reg = <0x1f000000 0x10>;
 
-			clocks = <&pll 2>;
+			clocks = <&pll ATH79_CLK_AHB>;
 			clock-names = "ahb";
 
 			status = "disabled";
Signature · 1 line
2.7.0
#17 lore raw

RFC v4 5/15 MIPS: dts: qca: ar9132: make extosc-related description shorter

In reply to Antony Pavlov
---
 arch/mips/boot/dts/qca/ar9132.dtsi               |  9 ++++++++-
 arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts | 14 ++++----------
 2 files changed, 12 insertions(+), 11 deletions(-)
arch/mips/boot/dts/qca/ar9132.dtsi +8 -1
index a1b4fa1..e6baa1e 100644
@@ -28,6 +28,13 @@
 					<&ddr_ctrl 0>, <&ddr_ctrl 1>;
 	};
 
+	extosc: oscillator {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+
+		/* The board must provide the extosc clock frequency */
+	};
+
 	ahb {
 		compatible = "simple-bus";
 		ranges;
@@ -89,8 +96,8 @@
 						"qca,ar9130-pll";
 				reg = <0x18050000 0x20>;
 
+				clocks = <&extosc>;
 				clock-names = "ref";
-				/* The board must provides the ref clock */
 
 				#clock-cells = <1>;
 				clock-output-names = "cpu", "ddr", "ahb";
arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts +4 -10
index e535ee3..9b4132f 100644
@@ -18,21 +18,11 @@
 		reg = <0x0 0x2000000>;
 	};
 
-	extosc: oscillator {
-		compatible = "fixed-clock";
-		#clock-cells = <0>;
-		clock-frequency = <40000000>;
-	};
-
 	ahb {
 		apb {
 			uart@18020000 {
 				status = "okay";
 			};
-
-			pll-controller@18050000 {
-				clocks = <&extosc>;
-			};
 		};
 
 		usb@1b000100 {
@@ -118,3 +108,7 @@
 		};
 	};
 };
+
+&extosc {
+	clock-frequency = <40000000>;
+};
Signature · 1 line
2.7.0
#18 lore raw

RFC v4 8/15 MIPS: dts: qca: simplify Makefile

In reply to Antony Pavlov

Do as arch/mips/boot/dts/ralink/Makefile does. Without this patch adding a dtb-file leads
to adding __two__ lines to the Makefile.

---
 arch/mips/boot/dts/qca/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/mips/boot/dts/qca/Makefile +2 -3
index 2d61455d..244329e 100644
@@ -1,8 +1,7 @@
 # All DTBs
-dtb-$(CONFIG_ATH79)			+= ar9132_tl_wr1043nd_v1.dtb
+dtb-$(CONFIG_DTB_TL_WR1043ND_V1)	+= ar9132_tl_wr1043nd_v1.dtb
 
-# Select a DTB to build in the kernel
-obj-$(CONFIG_DTB_TL_WR1043ND_V1)	+= ar9132_tl_wr1043nd_v1.dtb.o
+obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 
 # Force kbuild to make empty built-in.o if necessary
 obj-				+= dummy.o
Signature · 1 line
2.7.0
#19 lore raw

RFC v4 15/15 WIP: MIPS: ath79: add devicetree defconfigs

In reply to Antony Pavlov

This commits add defconfig files
to demonstrate devicetree-enabled ath79 linux kernel. The boards with u-boot_mod-like bootloader are supported:

* TP-LINK MR3020;
* Dragino 2;
* Onion Omega;
* TP-LINK WR1043ND.

Here is a small instruction:

1. download rootfs.mipsI.cpio image into your linux kernel source root dir.

    $ wget https://github.com/frantony/linux/raw/c95a5953e3dd96ad304de515f79acb555e0bc24e/rootfs.mipsI.cpio

2. you have to disable fw_getenv() function because devicetree-enabled kernel will hangs if started from u-boot_mod:

arch/mips/fw/lib/cmdline.c char *fw_getenv(char *envname) · line 55

Quoted 8 lines
arch/mips/fw/lib/cmdline.c +2 -0
@@ -51,6 +51,8 @@ char *fw_getenv(char *envname)
 {
       char *result = NULL;
 
+       return result;
+

3. configure linux kernel, e.g.

3.1 for TP-LINK TL-MR3020

    $ make ARCH=mips tl-mr3020-dt-raw_defconfig

3.2 for Dragino 2

    $ make ARCH=mips dragino-ms14-dt-raw_defconfig

3.3 for Onion Omega

    $ make ARCH=mips onion-omega-dt-raw_defconfig

3.4 for TP-LINK TL-WR1043ND

    $ make ARCH=mips tl-wr1043nd_defconfig

4. compile vmlinux.bin kernel image, e.g.

    $ make ARCH=mips CROSS_COMPILE=<your cross compiler> vmlinux.bin

5. put the vmlinux.bin into the root directory of your tftp-server

6. connect to u-boot_mod console

7. use u-boot_mod to download vmlinux.bin into RAM of your board and run it:

uboot> setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.22 uboot> tftpboot 0x80060000 vmlinux.bin; go 0x80060000

---
 arch/mips/configs/dragino-ms14-dt-raw_defconfig | 93 ++++++++++++++++++++++++
 arch/mips/configs/onion-omega-dt-raw_defconfig  | 85 ++++++++++++++++++++++
 arch/mips/configs/tl-mr3020-dt-raw_defconfig    | 85 ++++++++++++++++++++++
 arch/mips/configs/tl-wr1043nd_defconfig         | 95 +++++++++++++++++++++++++
 4 files changed, 358 insertions(+)
arch/mips/configs/dragino-ms14-dt-raw_defconfig new file +93 -0
new file mode 100644
index 0000000..1c9c0ac
@@ -0,0 +1,93 @@
+CONFIG_ATH79=y
+CONFIG_DTB_DRAGINO_MS14=y
+CONFIG_HZ_100=y
+# CONFIG_SECCOMP is not set
+CONFIG_MIPS_RAW_APPENDED_DTB=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CPUSETS=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_DEBUG=y
+CONFIG_NAMESPACES=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="rootfs.mipsI.cpio"
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_SUSPEND is not set
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_IPV6 is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_NETDEVICES=y
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_AR933X=y
+CONFIG_SERIAL_AR933X_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_SPI=y
+CONFIG_SPI_ATH79=y
+CONFIG_GPIO_SYSFS=y
+# CONFIG_HWMON is not set
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_PHY_SIMPLE_PDEV=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_DNOTIFY is not set
+CONFIG_VFAT_FS=y
+CONFIG_PROC_KCORE=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_STRIP_ASM_SYMS=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_FTRACE is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="init=/bin/sh machtype=DTB console=ttyATH0 root=/dev/ram"
+CONFIG_CMDLINE_OVERRIDE=y
+CONFIG_DEBUG_ZBOOT=y
+CONFIG_CRC_ITU_T=y
arch/mips/configs/onion-omega-dt-raw_defconfig new file +85 -0

85 lines not on this page · raw message

arch/mips/configs/tl-mr3020-dt-raw_defconfig new file +85 -0

85 lines not on this page · raw message

arch/mips/configs/tl-wr1043nd_defconfig new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
2.7.0