Skip to contentSkip to conversation

arm: qcom: Add support for IPQ8014 family of SoCs

PATCH In review Matthew McClintock 4 participants 11 messages Nov 5, 2015 – Nov 6, 2015

Subsystems (13)
lore
Share & tools
lore
#0 lore raw

cover arm: qcom: Add support for IPQ8014 family of SoCs

This patch series adds basic support for IPQ8019 series of SoCs, presently it just boots to prompt via serial but more functionality will follow.

This is partially based off a previously submitted patch series from Varada which can be found here:

https://patchwork.ozlabs.org/patch/509954/

The IPQ8019 has a Quad-Core ARM Cortex A7 with integrated Wifi, GMAC, Swtich, USB, PCIe, and more..

Matthew McClintock (3):
ARM: qcom: add IPQ4019 compatible match
qcom: ipq4019: Add basic board/dts support for IPQ4019 SoC
dts: ipq4019: Add support for IPQ4019 DK01 board

Varadarajan Narayanan (2):
pinctrl: qcom: ipq4019: Add IPQ4019 pinctrl support
clk: qcom: Add IPQ4019 Global Clock Controller support

 .../devicetree/bindings/clock/qcom,gcc.txt         |    1 +
 .../bindings/pinctrl/qcom,ipq4019-pinctrl.txt      |  116 ++
 arch/arm/boot/dts/Makefile                         |    1 +
 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts    |   22 +
 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi      |   49 +
 arch/arm/boot/dts/qcom-ipq4019.dtsi                |  108 ++
 arch/arm/mach-qcom/board.c                         |    1 +
 drivers/clk/qcom/Kconfig                           |    9 +
 drivers/clk/qcom/Makefile                          |    1 +
 drivers/clk/qcom/gcc-ipq4019.c                     | 1680 ++++++++++++++++++++
 drivers/pinctrl/qcom/Kconfig                       |    8 +
 drivers/pinctrl/qcom/Makefile                      |    1 +
 drivers/pinctrl/qcom/pinctrl-ipq4019.c             | 1280 +++++++++++++++
 include/dt-bindings/clock/qcom,gcc-ipq4019.h       |   85 +
 include/dt-bindings/reset/qcom,gcc-ipq4019.h       |   90 ++
 15 files changed, 3452 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
 create mode 100644 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts
 create mode 100644 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi
 create mode 100644 arch/arm/boot/dts/qcom-ipq4019.dtsi
 create mode 100644 drivers/clk/qcom/gcc-ipq4019.c
 create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq4019.c
 create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq4019.h
 create mode 100644 include/dt-bindings/reset/qcom,gcc-ipq4019.h
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

PATCH 1/5 pinctrl: qcom: ipq4019: Add IPQ4019 pinctrl support

From: Varadarajan Narayanan <[email protected]>

Add pinctrl driver support for IPQ4019 platform

---
 .../bindings/pinctrl/qcom,ipq4019-pinctrl.txt      |  116 ++
 drivers/pinctrl/qcom/Kconfig                       |    8 +
 drivers/pinctrl/qcom/Makefile                      |    1 +
 drivers/pinctrl/qcom/pinctrl-ipq4019.c             | 1280 ++++++++++++++++++++
 4 files changed, 1405 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
 create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq4019.c
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt new file +116 -0
new file mode 100644
index 0000000..045c5aa
@@ -0,0 +1,116 @@
+Qualcomm Atheros IPQ4019 TLMM block
+
+Required properties:
+- compatible: "qcom,ipq4019-pinctrl"
+- reg: Should be the base address and length of the TLMM block.
+- interrupts: Should be the parent IRQ of the TLMM block.
+- interrupt-controller: Marks the device node as an interrupt controller.
+- #interrupt-cells: Should be two.
+- gpio-controller: Marks the device node as a GPIO controller.
+- #gpio-cells : Should be two.
+                The first cell is the gpio pin number and the
+                second cell is used for optional parameters.
+
+Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for
+a general description of GPIO and interrupt bindings.
+
+Please refer to pinctrl-bindings.txt in this directory for details of the
+common pinctrl bindings used by client devices, including the meaning of the
+phrase "pin configuration node".
+
+The pin configuration nodes act as a container for an abitrary number of
+subnodes. Each of these subnodes represents some desired configuration for a
+pin, a group, or a list of pins or groups. This configuration can include the
+mux function to select on those pin(s)/group(s), and various pin configuration
+parameters, such as pull-up, drive strength, etc.
+
+The name of each subnode is not important; all subnodes should be enumerated
+and processed purely based on their content.
+
+Each subnode only affects those parameters that are explicitly listed. In
+other words, a subnode that lists a mux function but no pin configuration
+parameters implies no information about any pin configuration parameters.
+Similarly, a pin subnode that describes a pullup parameter implies no
+information about e.g. the mux function.
+
+
+The following generic properties as defined in pinctrl-bindings.txt are valid
+to specify in a pin configuration subnode:
+ pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength.
+
+Non-empty subnodes must specify the 'pins' property.
+Note that not all properties are valid for all pins.
+
+
+Valid values for qcom,pins are:
+  gpio0-gpio70
+    Supports mux, bias and drive-strength
+
+    sdio_cd, sdio_clk, sdio_cmd, sdio_data1, sdio_data1, sdio_data1, sdio_data1,
+    sdio_data5, sdio_data6, sdio_data7
+
+Valid values for qcom,function are:
+smart0, jtag, audio0, mdio0, wcss0_dbg18, wcss1_dbg18, qdss_tracedata_a, mdc,
+wcss0_dbg19, wcss1_dbg19, blsp_uart1, wifi0_uart, wifi1_uart, smart1,
+wcss0_dbg20, wcss1_dbg20, wifi0_uart0, wifi1_uart0, wcss0_dbg21, wcss1_dbg21,
+blsp_i2c0, wcss0_dbg22, wcss1_dbg22, wcss0_dbg23, wcss1_dbg23, blsp_i2c1,
+wcss0_dbg24, wcss1_dbg24, wcss0_dbg25, wcss1_dbg25, pcie_rst, wcss0_dbg26,
+wcss1_dbg26, pcie_clk0, wcss0_dbg27, wcss1_dbg27, led0, blsp_uart0, led1,
+chip_irq0, wifi0_uart1, wifi1_uart1, wcss0_dbg28, wcss1_dbg28, chip_rst,
+audio_spdifout, sdio1, rgmii2, sdio2, rgmii3, sdio3, rgmii_rx, sdio_clk,
+wcss0_dbg29, wcss1_dbg29, wcss0_dbg16, wcss1_dbg16, audio1, wcss0_dbg17,
+wcss1_dbg17, sdio_cd, rgmii0, sdio0, rgmii1, rgmii_txc, audio_td1, sdio_cmd,
+audio_td2, sdio4, audio_td3, sdio5, audio_pwm0, sdio6, audio_pwm1, sdio7,
+rgmii_rxc, audio_pwm2, rgmii_tx, audio_pwm3, wcss0_dbg30, wcss1_dbg30,
+wcss0_dbg31, wcss1_dbg31, rmii00, led2, rmii01, wifi0_wci, wifi1_wci,
+rmii0_tx, rmii0_rx, pcie_clk1, led3, pcie_wakeup, rmii0_refclk,
+wifi0_rfsilient0, wifi1_rfsilient0, smart2, led4, wifi0_cal, wifi1_cal,
+wifi_wci0, rmii0_dv, wifi_wci1, rmii1_refclk, blsp_spi1, led5, rmii10,
+blsp_spi0, led6, rmii11, led7, rmii1_dv, led8, rmii1_tx, aud_pin, led9,
+rmii1_rx, led10, wifi0_rfsilient1, wifi1_rfsilient1, led11, qpic_pad,
+qdss_cti_trig_in_a0, mdio1, audio2, dbg_out, wcss0_dbg, wcss1_dbg, atest_char3,
+pmu0, wcss0_dbg0, wcss1_dbg0, atest_char2, pmu1, wcss0_dbg1, wcss1_dbg1,
+atest_char1, wcss0_dbg2, wcss1_dbg2, qpic_pad4, atest_char0, wcss0_dbg3,
+wcss1_dbg3, qpic_pad5, smart3, wcss0_dbg14, wcss1_dbg14, qpic_pad6,
+wcss0_dbg15, wcss1_dbg15, qdss_tracectl_a, qpic_pad7, atest_char, wcss0_dbg4,
+wcss1_dbg4, qdss_traceclk_a, qpic_pad8, wcss0_dbg5, wcss1_dbg5,
+qdss_cti_trig_out_a0, wcss0_dbg6, wcss1_dbg6, qdss_cti_trig_out_b0, chip_irq1,
+qpic_pad0, wcss0_dbg7, wcss1_dbg7, qdss_cti_trig_in_b0, qpic_pad1, wcss0_dbg8,
+wcss1_dbg8, qpic_pad2, wcss0_dbg9, wcss1_dbg9, qpic_pad3, wcss0_dbg10,
+wcss1_dbg10, wcss0_dbg11, wcss1_dbg11, wcss0_dbg12, wcss1_dbg12, wcss0_dbg13,
+wcss1_dbg13
+
+Example:
+
+	msmgpio: pinctrl@1000000 {
+		compatible = "qcom,ipq4019-pinctrl";
+		reg = <0x1000000 0x300000>;
+
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		interrupts = <0 208 0>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&blsp_uart1>;
+
+		blsp_uart1_default: blsp_uart1_default {
+			mux {
+				qcom,pins = "gpio4", "gpio5";
+				qcom,function = "blsp_uart1";
+			};
+
+			tx {
+				qcom,pins = "gpio4";
+				drive-strength = <4>;
+				bias-disable;
+			};
+
+			rx {
+				qcom,pins = "gpio5";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+		};
+	};
drivers/pinctrl/qcom/Kconfig +8 -0
index 383263a..6b898ef 100644
@@ -23,6 +23,14 @@ config PINCTRL_APQ8084
 	  This is the pinctrl, pinmux, pinconf and gpiolib driver for the
 	  Qualcomm TLMM block found in the Qualcomm APQ8084 platform.
 
+config PINCTRL_IPQ4019
+	tristate "Qualcomm IPQ4019 pin controller driver"
+	depends on GPIOLIB && OF
+	select PINCTRL_MSM
+	help
+	  This is the pinctrl, pinmux, pinconf and gpiolib driver for the
+	  Qualcomm TLMM block found in the Qualcomm IPQ4019 platform.
+
 config PINCTRL_IPQ8064
 	tristate "Qualcomm IPQ8064 pin controller driver"
 	depends on GPIOLIB && OF
drivers/pinctrl/qcom/Makefile +1 -0
index 13b190e..fb9a991 100644
@@ -2,6 +2,7 @@
 obj-$(CONFIG_PINCTRL_MSM)	+= pinctrl-msm.o
 obj-$(CONFIG_PINCTRL_APQ8064)	+= pinctrl-apq8064.o
 obj-$(CONFIG_PINCTRL_APQ8084)	+= pinctrl-apq8084.o
+obj-$(CONFIG_PINCTRL_IPQ4019)	+= pinctrl-ipq4019.o
 obj-$(CONFIG_PINCTRL_IPQ8064)	+= pinctrl-ipq8064.o
 obj-$(CONFIG_PINCTRL_MSM8660)	+= pinctrl-msm8660.o
 obj-$(CONFIG_PINCTRL_MSM8960)	+= pinctrl-msm8960.o
drivers/pinctrl/qcom/pinctrl-ipq4019.c new file +1280 -0

1,280 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer
#2 lore raw

Re: [PATCH 1/5] pinctrl: qcom: ipq4019: Add IPQ4019 pinctrl support

Quoted 23 lines · Matthew McClintock

From: Varadarajan Narayanan <[email protected]>

Add pinctrl driver support for IPQ4019 platform

---
 .../bindings/pinctrl/qcom,ipq4019-pinctrl.txt      |  116 ++
 drivers/pinctrl/qcom/Kconfig                       |    8 +
 drivers/pinctrl/qcom/Makefile                      |    1 +
 drivers/pinctrl/qcom/pinctrl-ipq4019.c             | 1280 ++++++++++++++++++++
 4 files changed, 1405 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
 create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq4019.c
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt new file +0 -0
new file mode 100644
index 0000000..045c5aa

Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt line 4

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt new file +4 -0
@@ -0,0 +1,116 @@
+Qualcomm Atheros IPQ4019 TLMM block
+
+Required properties:
+- compatible: "qcom,ipq4019-pinctrl"

Perhaps the name should have TLMM in it. Whatever that stands for.

Quoted 2 lines
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt new file +2 -0
+- reg: Should be the base address and length of the TLMM block.
+- interrupts: Should be the parent IRQ of the TLMM block.
#3 lore raw

Re: [PATCH 1/5] pinctrl: qcom: ipq4019: Add IPQ4019 pinctrl support

Quoted 21 lines · Rob Herring
Quoted 17 lines · Matthew McClintock

From: Varadarajan Narayanan <[email protected]>

Add pinctrl driver support for IPQ4019 platform

---

.../bindings/pinctrl/qcom,ipq4019-pinctrl.txt      |  116 ++
drivers/pinctrl/qcom/Kconfig                       |    8 +
drivers/pinctrl/qcom/Makefile                      |    1 +
drivers/pinctrl/qcom/pinctrl-ipq4019.c             | 1280 ++++++++++++++++++++
4 files changed, 1405 insertions(+)

create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq4019.c

Quoted 12 lines

Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt line 4

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt new file +4 -0
new file mode 100644
index 0000000..045c5aa
@@ -0,0 +1,116 @@
+Qualcomm Atheros IPQ4019 TLMM block
+
+Required properties:
+- compatible: "qcom,ipq4019-pinctrl"

Perhaps the name should have TLMM in it. Whatever that stands for.

Sure, this was a holdover from Documentation/devicetree/bindings/pinctrl/qcom,ipq8064-pinctrl.txt mostly. Will elaborate on v2 though.

-M

#4 lore raw

PATCH 2/5 clk: qcom: Add IPQ4019 Global Clock Controller support

In reply to Matthew McClintock

From: Varadarajan Narayanan <[email protected]>

This patch adds support for the global clock controller found on the IPQ4019 based devices. This includes UART, I2C, SPI etc.

---
 .../devicetree/bindings/clock/qcom,gcc.txt         |    1 +
 drivers/clk/qcom/Kconfig                           |    9 +
 drivers/clk/qcom/Makefile                          |    1 +
 drivers/clk/qcom/gcc-ipq4019.c                     | 1680 ++++++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-ipq4019.h       |   85 +
 include/dt-bindings/reset/qcom,gcc-ipq4019.h       |   90 ++
 6 files changed, 1866 insertions(+)
 create mode 100644 drivers/clk/qcom/gcc-ipq4019.c
 create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq4019.h
 create mode 100644 include/dt-bindings/reset/qcom,gcc-ipq4019.h
Documentation/devicetree/bindings/clock/qcom,gcc.txt +1 -0
index 54c23f3..ce9f6d1 100644
@@ -7,6 +7,7 @@ Required properties :
 			"qcom,gcc-apq8064"
 			"qcom,gcc-apq8084"
 			"qcom,gcc-ipq8064"
+			"qcom,gcc-ipq4019"
 			"qcom,gcc-msm8660"
 			"qcom,gcc-msm8916"
 			"qcom,gcc-msm8960"
drivers/clk/qcom/Kconfig +9 -0
index 59d1666..586468c 100644
@@ -22,6 +22,15 @@ config APQ_MMCC_8084
 	  Say Y if you want to support multimedia devices such as display,
 	  graphics, video encode/decode, camera, etc.
 
+config IPQ_GCC_4019
+	tristate "IPQ4019 Global Clock Controller"
+	depends on COMMON_CLK_QCOM
+	help
+	  Support for the global clock controller on ipq4019 devices.
+	  Say Y if you want to use peripheral devices such as UART, SPI,
+	  i2c, USB, SD/eMMC, etc.
+
+
 config IPQ_GCC_806X
 	tristate "IPQ806x Global Clock Controller"
 	depends on COMMON_CLK_QCOM
drivers/clk/qcom/Makefile +1 -0
index 50b337a..4925402 100644
@@ -12,6 +12,7 @@ clk-qcom-y += reset.o
 
 obj-$(CONFIG_APQ_GCC_8084) += gcc-apq8084.o
 obj-$(CONFIG_APQ_MMCC_8084) += mmcc-apq8084.o
+obj-$(CONFIG_IPQ_GCC_4019) += gcc-ipq4019.o
 obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o
 obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o
 obj-$(CONFIG_MSM_GCC_8660) += gcc-msm8660.o
drivers/clk/qcom/gcc-ipq4019.c new file +1680 -0

1,680 lines not on this page · raw message

include/dt-bindings/clock/qcom,gcc-ipq4019.h new file +85 -0

85 lines not on this page · raw message

include/dt-bindings/reset/qcom,gcc-ipq4019.h new file +90 -0

90 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#5 lore raw

Re: [PATCH 2/5] clk: qcom: Add IPQ4019 Global Clock Controller support

coccinelle warnings: (new ones prefixed by >>)

Hi Varadarajan,

[auto build test WARNING on: agross-msm/qcom/for-next] [also build test WARNING on: v4.3 next-20151105]

url:    https://github.com/0day-ci/linux/commits/Matthew-McClintock/arm-qcom-Add-support-for-IPQ8014-family-of-SoCs/20151106-061211
base:   git://codeaurora.org/quic/kernel/agross-msm qcom/for-next

coccinelle warnings: (new ones prefixed by >>)

>> drivers/clk/qcom/gcc-ipq4019.c:1661:3-8: No need to set .owner here. The core will do it.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#6 lore raw

[PATCH] clk: qcom: fix platform_no_drv_owner.cocci warnings

In reply to Matthew McClintock
drivers/clk/qcom/gcc-ipq4019.c:1661:3-8: No need to set .owner here. The core will do it.

drivers/clk/qcom/gcc-ipq4019.c:1661:3-8: No need to set .owner here. The core will do it.

Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC Varadarajan Narayanan <[email protected]>

---

 gcc-ipq4019.c |    1 -
 1 file changed, 1 deletion(-)
drivers/clk/qcom/gcc-ipq4019.c +0 -1
@@ -1658,7 +1658,6 @@ static struct platform_driver gcc_ipq401
 	.remove		= gcc_ipq4019_remove,
 	.driver		= {
 		.name	= "qcom,gcc-ipq4019",
-		.owner	= THIS_MODULE,
 		.of_match_table = gcc_ipq4019_match_table,
 	},
 };
#7 lore raw

Re: [PATCH 2/5] clk: qcom: Add IPQ4019 Global Clock Controller support

In reply to Matthew McClintock
Quoted 9 lines · Matthew McClintock
drivers/clk/qcom/gcc-ipq4019.c new file +3 -0
new file mode 100644
index 0000000..3ed76bd
@@ -0,0 +1,1680 @@
+
+#define SPARE_CLOCK_BRANCH_ENA_VOTE		0x0004
+#define GCC_SPARE0_REG				0x0008

[...]

Quoted 4 lines
drivers/clk/qcom/gcc-ipq4019.c new file +4 -0
+#define PLLTEST_PAD_CFG				0x210E0
+#define SYSTEM_NOC_125M_BFDCD_CMD_RCGR		0x210E4
+#define SYSTEM_NOC_125M_BFDCD_CFG_RCGR		0x210E8
+#define SYS_NOC_125M_CBCR			0x210EC

drivers/clk/qcom/gcc-ipq4019.c line 249

Quoted 10 lines
drivers/clk/qcom/gcc-ipq4019.c new file +10 -0
+#define GCC_SLEEP_CMD_RCGR			0x210F0
+#define TCSR_BCR				0x22000
+#define TCSR_AHB_CBCR				0x22004
+#define MPM_BCR					0x24000
+#define MPM_MISC				0x24004
+#define MPM_AHB_CBCR				0x24008
+#define MPM_SLEEP_CBCR				0x2400C
+#define SPDM_BCR				0x25000
+#define MDIO_AHB_CBCR				0x26000
+

Drop all these #defines and put the raw value in the place that they're used. The name of the clk structure is good enough to know what the numbers are for.

drivers/clk/qcom/gcc-ipq4019.c line 339

Quoted 5 lines
drivers/clk/qcom/gcc-ipq4019.c new file +5 -0
+static struct parent_map gcc_xo_ddr_500_200_map[] = {
+	{ .src = P_XO, .cfg = 0, },
+	{ .src = P_FEPLL200, .cfg = 3, },
+	{ .src = P_FEPLL500, .cfg = 2, },
+	{ .src = P_DDRPLLAPSS, .cfg = 1, },

Drop the .src and .cfg stuff and just say { P_DDRPLLAPSS, 1 }

Quoted 64 lines
drivers/clk/qcom/gcc-ipq4019.c new file +64 -0
+};
+
+static const char * const gcc_xo_ddr_500_200[] = {
+	"xo",
+	"fepll200",
+	"fepll500",
+	"ddrpllapss",
+};
+
+static int clk_dummy_is_enabled(struct clk_hw *hw)
+{
+	return 1;
+};
+
+static int clk_dummy_enable(struct clk_hw *hw)
+{
+	return 0;
+};
+
+static void clk_dummy_disable(struct clk_hw *hw)
+{
+	return;
+};
+
+static u8 clk_dummy_get_parent(struct clk_hw *hw)
+{
+	return 0;
+};
+
+static int clk_dummy_set_parent(struct clk_hw *hw, u8 index)
+{
+	return 0;
+};
+
+static int clk_dummy_set_rate(struct clk_hw *hw, unsigned long rate,
+			      unsigned long parent_rate)
+{
+	return 0;
+};
+
+static int clk_dummy_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
+{
+	return req ? req->rate : 0;
+};
+
+static unsigned long clk_dummy_recalc_rate(struct clk_hw *hw,
+					   unsigned long parent_rate)
+{
+	return parent_rate;
+};
+
+const struct clk_ops clk_ipq4019_dummy_ops = {
+	.is_enabled = clk_dummy_is_enabled,
+	.enable = clk_dummy_enable,
+	.disable = clk_dummy_disable,
+	.get_parent = clk_dummy_get_parent,
+	.set_parent = clk_dummy_set_parent,
+	.set_rate = clk_dummy_set_rate,
+	.recalc_rate = clk_dummy_recalc_rate,
+	.determine_rate = clk_dummy_determine_rate,
+};
+
+static struct clk_regmap dummy = {

drivers/clk/qcom/gcc-ipq4019.c

Quoted 10 lines
drivers/clk/qcom/gcc-ipq4019.c new file +10 -0
+	.hw.init = &(struct clk_init_data){
+		.name = "dummy_clk_src",
+		.parent_names = (const char *[]){ "xo"},
+		.num_parents = 1,
+		.ops = &clk_ipq4019_dummy_ops,
+	},
+};
+
+static struct clk_regmap *gcc_ipq4019_clocks[] = {
+	[GCC_DUMMY_CLK] = &dummy,

I highly doubt this is a real clock. Please remove it and all the associated code.

Quoted 2 lines
drivers/clk/qcom/gcc-ipq4019.c new file +2 -0
+	[AUDIO_CLK_SRC] = &audio_clk_src.clkr,
+	[BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,

[..]

drivers/clk/qcom/gcc-ipq4019.c line 1591

Quoted 6 lines
drivers/clk/qcom/gcc-ipq4019.c new file +6 -0
+
+static const struct regmap_config gcc_ipq4019_regmap_config = {
+	.reg_bits	= 32,
+	.reg_stride	= 4,
+	.val_bits	= 32,
+	.max_register	= 0x2DFFF,

Lowercase hexadecimal please.

Quoted 15 lines
drivers/clk/qcom/gcc-ipq4019.c new file +15 -0
+	.fast_io	= true,
+};
+
+static const struct qcom_cc_desc gcc_ipq4019_desc = {
+	.config = &gcc_ipq4019_regmap_config,
+	.clks = gcc_ipq4019_clocks,
+	.num_clks = ARRAY_SIZE(gcc_ipq4019_clocks),
+	.resets = gcc_ipq4019_resets,
+	.num_resets = ARRAY_SIZE(gcc_ipq4019_resets),
+};
+
+static const struct of_device_id gcc_ipq4019_match_table[] = {
+	{ .compatible = "qcom,gcc-ipq4019" },
+	{ }
+};

drivers/clk/qcom/gcc-ipq4019.c line 1616

Quoted 10 lines
drivers/clk/qcom/gcc-ipq4019.c new file +10 -0
+MODULE_DEVICE_TABLE(of, gcc_ipq4019_match_table);
+
+static int gcc_ipq4019_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	const struct of_device_id *id;
+
+	id = of_match_device(gcc_ipq4019_match_table, dev);
+	if (!id)
+		return -ENODEV;

This is done by driver core. We don't need to do it again.

drivers/clk/qcom/gcc-ipq4019.c line 1623

Quoted 7 lines
drivers/clk/qcom/gcc-ipq4019.c new file +7 -0
+
+	/* High speed external clock */
+	clk_register_fixed_rate(dev, "xo", NULL,
+					 CLK_IS_ROOT, 48000000);
+	/* External sleep clock */
+	clk_register_fixed_rate(dev, "gcc_sleep_clk_src", NULL,
+					 CLK_IS_ROOT, 32768);

These should go into DT as xo_board and sleep_clk.

Quoted 13 lines
drivers/clk/qcom/gcc-ipq4019.c new file +13 -0
+
+	/* FE PLL post dividers */
+	clk_register_fixed_rate(dev, "fepll500", NULL, CLK_IS_ROOT,
+				      500000000);
+	clk_register_fixed_rate(dev, "fepll200", NULL, CLK_IS_ROOT,
+				      200000000);
+	clk_register_fixed_rate(dev, "fepll125", NULL, CLK_IS_ROOT,
+				      125000000);
+	clk_register_fixed_rate(dev, "fepll125dly", NULL, CLK_IS_ROOT,
+				      125000000);
+	clk_register_fixed_rate(dev, "fepllwcss2g", NULL, CLK_IS_ROOT,
+				      250000000);
+	clk_register_fixed_rate(dev, "fepllwcss5g", NULL, CLK_IS_ROOT,

drivers/clk/qcom/gcc-ipq4019.c line 1646

Quoted 10 lines
drivers/clk/qcom/gcc-ipq4019.c new file +10 -0
+				      250000000);
+
+	/* DDR PLL post dividers */
+	clk_register_fixed_rate(dev, "ddrpllsdcc1", NULL, CLK_IS_ROOT,
+				      409800000);
+	clk_register_fixed_rate(dev, "ddrpllapss", NULL, CLK_IS_ROOT,
+				      626000000);
+	clk_register_fixed_rate(dev, "pcnoc_clk_src", NULL, CLK_IS_ROOT,
+				      100000000);
+

I don't see why we wouldn't want to root the PLLs in the XO. The PLLs aren't the root of the clock tree. I guess it's fine to make them fixed rate clocks instead of implementing code to read the frequencies at boot. It's not the most flexible design, but ok.

Also, it would be better to make structures for these fixed PLLs and use devm_clk_register() so that this driver can be safely probed and removed at will.

drivers/clk/qcom/gcc-ipq4019.c line 1652

Quoted 6 lines
drivers/clk/qcom/gcc-ipq4019.c new file +6 -0
+	return qcom_cc_probe(pdev, &gcc_ipq4019_desc);
+}
+
+static int gcc_ipq4019_remove(struct platform_device *pdev)
+{
+	qcom_cc_remove(pdev);

This doesn't exist anymore.

Quoted 16 lines
drivers/clk/qcom/gcc-ipq4019.c new file +16 -0
+	return 0;
+}
+
+static struct platform_driver gcc_ipq4019_driver = {
+	.probe		= gcc_ipq4019_probe,
+	.remove		= gcc_ipq4019_remove,
+	.driver		= {
+		.name	= "qcom,gcc-ipq4019",
+		.owner	= THIS_MODULE,
+		.of_match_table = gcc_ipq4019_match_table,
+	},
+};
+
+static int __init gcc_ipq4019_init(void)
+{
+	return platform_driver_register(&gcc_ipq4019_driver);

drivers/clk/qcom/gcc-ipq4019.c line 1678

Quoted 10 lines
drivers/clk/qcom/gcc-ipq4019.c new file +10 -0
+}
+core_initcall(gcc_ipq4019_init);
+
+static void __exit gcc_ipq4019_exit(void)
+{
+	platform_driver_unregister(&gcc_ipq4019_driver);
+}
+module_exit(gcc_ipq4019_exit);
+
+MODULE_ALIAS("platform:gcc-ipq4019.c");

Why the .c? Drop that.

drivers/clk/qcom/gcc-ipq4019.c line 1680

Quoted 2 lines
drivers/clk/qcom/gcc-ipq4019.c new file +2 -0
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("GCC Driver for ipq4019 driver");

Capitalize IPQ. "driver for soc driver" is not so good.

Quoted 15 lines
include/dt-bindings/clock/qcom,gcc-ipq4019.h new file +9 -0
new file mode 100644
index 0000000..40fc405
@@ -0,0 +1,85 @@
+/* Copyright (c) 2015 The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR

include/dt-bindings/clock/qcom,gcc-ipq4019.h line 19

Quoted 10 lines
include/dt-bindings/clock/qcom,gcc-ipq4019.h new file +10 -0
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+#ifndef __QCOM_CLK_IPQ4019_H__
+#define __QCOM_CLK_IPQ4019_H__
+
+#define	GCC_DUMMY_CLK					0

Please drop the tab after #define.

include/dt-bindings/reset/qcom,gcc-ipq4019.h

Quoted 11 lines
include/dt-bindings/clock/qcom,gcc-ipq4019.h new file +6 -0
+#define	AUDIO_CLK_SRC					1
+#define	BLSP1_QUP1_I2C_APPS_CLK_SRC			2
+#define	BLSP1_QUP1_SPI_APPS_CLK_SRC			3
+#define	BLSP1_QUP2_I2C_APPS_CLK_SRC			4
+#define	BLSP1_QUP2_SPI_APPS_CLK_SRC			5
+#define	BLSP1_UART1_APPS_CLK_SRC			6
include/dt-bindings/reset/qcom,gcc-ipq4019.h new file +0 -0
new file mode 100644
index 0000000..2708ae3

Please fold this file into the clock one. There's not really any point to having two files.

include/dt-bindings/reset/qcom,gcc-ipq4019.h line 9

Quoted 10 lines
include/dt-bindings/reset/qcom,gcc-ipq4019.h new file +9 -0
@@ -0,0 +1,90 @@
+#define GCC_PCNOC_BUS_TIMEOUT6_BCR			64
+#define GCC_PCNOC_BUS_TIMEOUT7_BCR			65
+#define GCC_PCNOC_BUS_TIMEOUT8_BCR			66
+#define GCC_PCNOC_BUS_TIMEOUT9_BCR			67
+#define GCC_TCSR_BCR					68
+#define GCC_QDSS_BCR					69
+#define GCC_MPM_BCR					70
+#define GCC_SPDM_BCR					71
+#define AUDIO_BLK_ARES					GCC_AUDIO_BCR

Why have two names for the same thing?

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#8 lore raw

PATCH 3/5 ARM: qcom: add IPQ4019 compatible match

In reply to Matthew McClintock

This will select qcom board type when the machine compatible is qcom,ipq4019.

---
 arch/arm/mach-qcom/board.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-qcom/board.c +1 -0
index 6d8bbf7..b52a6bc 100644
@@ -18,6 +18,7 @@ static const char * const qcom_dt_match[] __initconst = {
 	"qcom,apq8064",
 	"qcom,apq8074-dragonboard",
 	"qcom,apq8084",
+	"qcom,ipq4019",
 	"qcom,ipq8062",
 	"qcom,ipq8064",
 	"qcom,msm8660-surf",
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#9 lore raw

PATCH 4/5 qcom: ipq4019: Add basic board/dts support for IPQ4019 SoC

In reply to Matthew McClintock

Add initial dts files and SoC support for IPQ4019

---
 arch/arm/boot/dts/qcom-ipq4019.dtsi | 108 ++++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)
 create mode 100644 arch/arm/boot/dts/qcom-ipq4019.dtsi
arch/arm/boot/dts/qcom-ipq4019.dtsi new file +108 -0
new file mode 100644
index 0000000..157a9ca
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/dts-v1/;
+
+#include "skeleton.dtsi"
+#include <dt-bindings/reset/qcom,gcc-ipq4019.h>
+#include <dt-bindings/clock/qcom,gcc-ipq4019.h>
+
+/ {
+	model = "Qualcomm Technologies, Inc. IPQ4019";
+	compatible = "qcom,ipq4019";
+	interrupt-parent = <&intc>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a7";
+			reg = <0x0>;
+			clocks = <&gcc GCC_APPS_CLK_SRC>;
+		};
+
+		cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a7";
+			reg = <0x1>;
+			clocks = <&gcc GCC_APPS_CLK_SRC>;
+		};
+
+		cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a7";
+			reg = <0x2>;
+			clocks = <&gcc GCC_APPS_CLK_SRC>;
+		};
+
+		cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a7";
+			reg = <0x3>;
+			clocks = <&gcc GCC_APPS_CLK_SRC>;
+		};
+	};
+
+	soc {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		compatible = "simple-bus";
+
+		intc: interrupt-controller at b000000 {
+			compatible = "qcom,msm-qgic2";
+			interrupt-controller;
+			#interrupt-cells = <3>;
+			reg = <0x0b000000 0x1000>,
+			<0x0b002000 0x1000>;
+		};
+
+		gcc: clock-controller at 1800000 {
+			compatible = "qcom,gcc-ipq4019";
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+			reg = <0x1800000 0x60000>;
+		};
+
+		tlmm: pinctrl at 0x01000000 {
+			compatible = "qcom,ipq4019-pinctrl";
+			reg = <0x01000000 0x300000>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			interrupts = <0 208 0>;
+		};
+
+		serial at 78af000 {
+			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+			reg = <0x78af000 0x200>;
+			interrupts = <0 107 0>;
+			status = "disabled";
+			clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>,
+				<&gcc GCC_BLSP1_AHB_CLK>;
+			clock-names = "core", "iface";
+		};
+
+		serial at 78b0000 {
+			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+			reg = <0x78b0000 0x200>;
+			interrupts = <0 108 0>;
+			status = "disabled";
+			clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>,
+				<&gcc GCC_BLSP1_AHB_CLK>;
+			clock-names = "core", "iface";
+		};
+	};
+};
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#10 lore raw

PATCH 5/5 dts: ipq4019: Add support for IPQ4019 DK01 board

In reply to Matthew McClintock

Initial board support dts files for DK01 board.

---
 arch/arm/boot/dts/Makefile                      |  1 +
 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts | 22 +++++++++++
 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi   | 49 +++++++++++++++++++++++++
 3 files changed, 72 insertions(+)
 create mode 100644 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts
 create mode 100644 arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi
arch/arm/boot/dts/Makefile +1 -0
index bb8fa02..445340d 100644
@@ -491,6 +491,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
 	qcom-apq8074-dragonboard.dtb \
 	qcom-apq8084-ifc6540.dtb \
 	qcom-apq8084-mtp.dtb \
+	qcom-ipq4019-ap.dk01.1-c1.dtb \
 	qcom-ipq8064-ap148.dtb \
 	qcom-msm8660-surf.dtb \
 	qcom-msm8960-cdp.dtb \
arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts new file +22 -0
new file mode 100644
index 0000000..0d92f1b
@@ -0,0 +1,22 @@
+/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include "qcom-ipq4019-ap.dk01.1.dtsi"
+
+/ {
+	model = "Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1";
+
+};
arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi new file +49 -0

49 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project