Add minimal boot support for IPQ5018
Subsystems (10)
PATCH 4/7 dt-bindings: pinctrl: qcom: Add ipq5018 pinctrl bindings
In reply to Varadarajan NarayananAdd device tree binding Documentation details for ipq5018 pinctrl driver.
--- .../bindings/pinctrl/qcom,ipq5018-pinctrl.yaml | 143 +++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.yaml new file +143 -0
@@ -0,0 +1,143 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/qcom,ipq5018-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. IPQ5018 TLMM block + +maintainers: + - Nitheesh Sekar <[email protected]> + +description: | + This binding describes the Top Level Mode Multiplexer block found in the + IPQ5018 platform. + +properties: + compatible: + const: qcom,ipq5018-pinctrl + + reg: + maxItems: 1 + + interrupts: + description: Specifies the TLMM summary IRQ + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells': + description: + Specifies the PIN numbers and Flags, as defined in defined in + include/dt-bindings/interrupt-controller/irq.h + const: 2 + + gpio-controller: true + + '#gpio-cells': + description: Specifying the pin number and flags, as defined in + include/dt-bindings/gpio/gpio.h + const: 2 + + gpio-ranges: + maxItems: 1 + +#PIN CONFIGURATION NODES +patternProperties: + '-pinmux$': + type: object + description: + Pinctrl node's client devices use subnodes for desired pin configuration. + Client device subnodes use below standard properties. + $ref: "/schemas/pinctrl/pincfg-node.yaml" + + properties: + pins: + description: + List of gpio pins affected by the properties specified in this + subnode. + items: + oneOf: + - pattern: "^gpio([1-9]|[1-7][0-9]|80)$" + minItems: 1 + maxItems: 4 + + function: + description: + Specify the alternative function to be configured for the specified + pins. + enum: [ atest_char, atest_char0, atest_char1, atest_char2, atest_char3, + audio_pdm0, audio_pdm1, audio_rxbclk, audio_rxd, audio_rxfsync, + audio_rxmclk, audio_txbclk, audio_txd, audio_txfsync, audio_txmclk, + blsp0_i2c, blsp0_spi, blsp0_uart0, blsp0_uart1, blsp1_i2c0, + blsp1_i2c1, blsp1_spi0, blsp1_spi1, blsp1_uart0, blsp1_uart1, + blsp1_uart2, blsp2_i2c0, blsp2_i2c1, blsp2_spi, blsp2_spi0, + blsp2_spi1, btss0, btss1, btss10, btss11, btss12, btss13, btss2, + btss3, btss4, btss5, btss6, btss7, btss8, btss9, burn0, burn1, + cri_trng, cri_trng0, cri_trng1, cxc_clk, cxc_data, dbg_out, eud_gpio, + gcc_plltest, gcc_tlmm, gpio, mac0, mac1, mdc, mdio, pcie0_clk, + pcie0_wake, pcie1_clk, pcie1_wake, pll_test, prng_rosc, pwm0, pwm1, + pwm2, pwm3, qdss_cti_trig_in_a0, qdss_cti_trig_in_a1, + qdss_cti_trig_in_b0, qdss_cti_trig_in_b1, qdss_cti_trig_out_a0, + qdss_cti_trig_out_a1, qdss_cti_trig_out_b0, qdss_cti_trig_out_b1, + qdss_traceclk_a, qdss_traceclk_b, qdss_tracectl_a, qdss_tracectl_b, + qdss_tracedata_a, qdss_tracedata_b, qspi_clk, qspi_cs, qspi0, qspi1, + qspi2, qspi3, reset_out, sdc1_clk, sdc1_cmd, sdc10, sdc11, sdc12, + sdc13, wci0, wci1, wci2, wci3, wci4, wci5, wci6, wci7, wsa_swrm, + wsi_clk3, wsi_data3, wsis_reset, xfem0, xfem1, xfem2, xfem3, xfem4, + xfem5, xfem6, xfem7 ] + + drive-strength: + enum: [2, 4, 6, 8, 10, 12, 14, 16] + default: 2 + description: + Selects the drive strength for the specified pins, in mA. + + bias-pull-down: true + + bias-pull-up: true + + bias-disable: true + + output-high: true + + output-low: true + + required: + - pins + - function + + additionalProperties: false + +required: + - compatible + - reg + - interrupts + - interrupt-controller + - '#interrupt-cells' + - gpio-controller + - '#gpio-cells' + - gpio-ranges + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + tlmm: pinctrl@1000000 { + compatible = "qcom,ipq5018-pinctrl"; + reg = <0x01000000 0x300000>; + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; + interrupt-controller; + #interrupt-cells = <2>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&tlmm 0 80>; + + serial3-pinmux { + pins = "gpio44", "gpio45"; + function = "blsp2_uart"; + drive-strength = <8>; + bias-pull-down; + }; + };
Signature · 1 line
2.7.4
PATCH 3/7 clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018
In reply to Varadarajan NarayananAdd support for the global clock controller found on IPQ5018 based devices.
--- drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-ipq5018.c | 3833 ++++++++++++++++++++++++++++++++++++++++ include/linux/clk-provider.h | 4 +- 4 files changed, 3844 insertions(+), 2 deletions(-) create mode 100644 drivers/clk/qcom/gcc-ipq5018.c
drivers/clk/qcom/Kconfig +8 -0
@@ -155,6 +155,14 @@ config IPQ_GCC_8074 i2c, USB, SD/eMMC, etc. Select this for the root clock of ipq8074. +config IPQ_GCC_5018 + tristate "IPQ5018 Global Clock Controller" + help + Support for global clock controller on ipq5018 devices. + Say Y if you want to use peripheral devices such as UART, SPI, + i2c, USB, SD/eMMC, etc. Select this for the root clock + of ipq5018. + config MSM_GCC_8660 tristate "MSM8660 Global Clock Controller" help
drivers/clk/qcom/Makefile +1 -0
@@ -25,6 +25,7 @@ obj-$(CONFIG_IPQ_GCC_4019) += gcc-ipq4019.o obj-$(CONFIG_IPQ_GCC_6018) += gcc-ipq6018.o obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o obj-$(CONFIG_IPQ_GCC_8074) += gcc-ipq8074.o +obj-$(CONFIG_IPQ_GCC_5018) += gcc-ipq5018.o obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o obj-$(CONFIG_MDM_GCC_9615) += gcc-mdm9615.o obj-$(CONFIG_MDM_LCC_9615) += lcc-mdm9615.o
drivers/clk/qcom/gcc-ipq5018.c new file +3833 -0
2,979 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
cover Add minimal boot support for IPQ5018
The IPQ5018 is Qualcomm's 802.11ax SoC for Routers, Gateways and Access Points.
This series adds minimal board boot support for ipq5018-mp03.1-c2 board.
Varadarajan Narayanan (7):
clk: qcom: clk-alpha-pll: Add support for Stromer PLLs
dt-bindings: arm64: ipq5018: Add binding descriptions for clock and
reset
clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018
dt-bindings: pinctrl: qcom: Add ipq5018 pinctrl bindings
pinctrl: qcom: Add IPQ5018 pinctrl driver
arm64: dts: Add ipq5018 SoC and MP03 board support
arm64: defconfig: Enable IPQ5018 SoC base configs
Documentation/devicetree/bindings/arm/qcom.yaml | 7 + .../devicetree/bindings/clock/qcom,gcc.yaml | 3 + .../bindings/pinctrl/qcom,ipq5018-pinctrl.yaml | 143 + arch/arm64/boot/dts/qcom/Makefile | 1 + arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts | 30 + arch/arm64/boot/dts/qcom/ipq5018.dtsi | 201 + arch/arm64/configs/defconfig | 3 + drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/clk-alpha-pll.c | 156 +- drivers/clk/qcom/clk-alpha-pll.h | 5 + drivers/clk/qcom/gcc-ipq5018.c | 3833 ++++++++++++++++++++ drivers/pinctrl/qcom/Kconfig | 10 + drivers/pinctrl/qcom/Makefile | 1 + drivers/pinctrl/qcom/pinctrl-ipq5018.c | 903 +++++ include/dt-bindings/clock/qcom,gcc-ipq5018.h | 183 + include/dt-bindings/reset/qcom,gcc-ipq5018.h | 119 + include/linux/clk-provider.h | 4 +- 18 files changed, 5608 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.yaml create mode 100644 arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts create mode 100644 arch/arm64/boot/dts/qcom/ipq5018.dtsi create mode 100644 drivers/clk/qcom/gcc-ipq5018.c create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq5018.c create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq5018.h create mode 100644 include/dt-bindings/reset/qcom,gcc-ipq5018.h
Signature · 1 line
2.7.4
PATCH 6/7 arm64: dts: Add ipq5018 SoC and MP03 board support
Add initial device tree support for the Qualcomm IPQ5018 SoC and MP03.1-C2 board.
--- Documentation/devicetree/bindings/arm/qcom.yaml | 7 + arch/arm64/boot/dts/qcom/Makefile | 1 + arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts | 30 ++++ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 201 ++++++++++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts create mode 100644 arch/arm64/boot/dts/qcom/ipq5018.dtsi
Documentation/devicetree/bindings/arm/qcom.yaml +7 -0
@@ -28,6 +28,7 @@ description: | apq8074 apq8084 apq8096 + ipq5018 ipq6018 ipq8074 mdm9615
@@ -49,6 +50,7 @@ description: | hk01 idp liquid + mp03 mtp qrd sbc
@@ -142,6 +144,11 @@ properties: - items: - enum: + - qcom,ipq5018-mp03 + - const: qcom,ipq5018 + + - items: + - enum: - qcom,ipq8064-ap148 - const: qcom,ipq8064
arch/arm64/boot/dts/qcom/Makefile +1 -0
@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_QCOM) += apq8096-db820c.dtb dtb-$(CONFIG_ARCH_QCOM) += apq8096-ifc6640.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq6018-cp01-c1.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq8074-hk01.dtb +dtb-$(CONFIG_ARCH_QCOM) += ipq5018-mp03.1-c2.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-longcheer-l8150.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a3u-eur.dtb
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +30 -0
@@ -0,0 +1,30 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * IPQ5018 CP01 board device tree source + * + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + */ + +/dts-v1/; + +#include "ipq5018.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03-C2"; + compatible = "qcom,ipq5018-mp03", "qcom,ipq5018"; + + aliases { + serial0 = &blsp1_uart1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " swiotlb=1"; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_1_pins>; + pinctrl-names = "default"; + status = "ok"; +};
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +201 -0
201 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 2/7 dt-bindings: arm64: ipq5018: Add binding descriptions for clock and reset
In reply to Varadarajan NarayananThis patch adds support for the global clock controller found on the IPQ5018 based devices.
--- .../devicetree/bindings/clock/qcom,gcc.yaml | 3 + include/dt-bindings/clock/qcom,gcc-ipq5018.h | 183 +++++++++++++++++++++ include/dt-bindings/reset/qcom,gcc-ipq5018.h | 119 ++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq5018.h create mode 100644 include/dt-bindings/reset/qcom,gcc-ipq5018.h
Documentation/devicetree/bindings/clock/qcom,gcc.yaml +3 -0
@@ -18,6 +18,8 @@ description: | - dt-bindings/clock/qcom,gcc-apq8084.h - dt-bindings/reset/qcom,gcc-apq8084.h - dt-bindings/clock/qcom,gcc-ipq4019.h + - dt-bindings/clock/qcom,gcc-ipq5018.h + - dt-bindings/reset/qcom,gcc-ipq5018.h - dt-bindings/clock/qcom,gcc-ipq6018.h - dt-bindings/reset/qcom,gcc-ipq6018.h - dt-bindings/clock/qcom,gcc-ipq806x.h (qcom,gcc-ipq8064)
@@ -39,6 +41,7 @@ properties: enum: - qcom,gcc-apq8084 - qcom,gcc-ipq4019 + - qcom,gcc-ipq5018 - qcom,gcc-ipq6018 - qcom,gcc-ipq8064 - qcom,gcc-msm8660
include/dt-bindings/clock/qcom,gcc-ipq5018.h new file +183 -0
183 lines not on this page · raw message
include/dt-bindings/reset/qcom,gcc-ipq5018.h new file +119 -0
119 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 5/7 pinctrl: qcom: Add IPQ5018 pinctrl driver
In reply to Varadarajan NarayananThis adds the pinctrl definitions for the TLMM of IPQ5018.
--- drivers/pinctrl/qcom/Kconfig | 10 + drivers/pinctrl/qcom/Makefile | 1 + drivers/pinctrl/qcom/pinctrl-ipq5018.c | 903 +++++++++++++++++++++++++++++++++ 3 files changed, 914 insertions(+) create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq5018.c
drivers/pinctrl/qcom/Kconfig +10 -0
@@ -34,6 +34,16 @@ config PINCTRL_IPQ4019 This is the pinctrl, pinmux, pinconf and gpiolib driver for the Qualcomm TLMM block found in the Qualcomm IPQ4019 platform. +config PINCTRL_IPQ5018 + tristate "Qualcomm Technologies, Inc. IPQ5018 pin controller driver" + depends on GPIOLIB && OF + select PINCTRL_MSM + help + This is the pinctrl, pinmux, pinconf and gpiolib driver for + the Qualcomm Technologies Inc. TLMM block found on the + Qualcomm Technologies Inc. IPQ5018 platform. Select this for + IPQ5018. + config PINCTRL_IPQ8064 tristate "Qualcomm IPQ8064 pin controller driver" depends on GPIOLIB && OF
drivers/pinctrl/qcom/Makefile +1 -0
@@ -4,6 +4,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_IPQ5018) += pinctrl-ipq5018.o obj-$(CONFIG_PINCTRL_IPQ8064) += pinctrl-ipq8064.o obj-$(CONFIG_PINCTRL_IPQ8074) += pinctrl-ipq8074.o obj-$(CONFIG_PINCTRL_IPQ6018) += pinctrl-ipq6018.o
drivers/pinctrl/qcom/pinctrl-ipq5018.c new file +903 -0
903 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 1/7 clk: qcom: clk-alpha-pll: Add support for Stromer PLLs
In reply to Varadarajan NarayananAdd programming sequence support for managing the Stromer PLLs.
--- drivers/clk/qcom/clk-alpha-pll.c | 156 ++++++++++++++++++++++++++++++++++++++- drivers/clk/qcom/clk-alpha-pll.h | 5 ++ 2 files changed, 160 insertions(+), 1 deletion(-)
drivers/clk/qcom/clk-alpha-pll.c +155 -1
@@ -116,6 +116,19 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { [PLL_OFF_OPMODE] = 0x38, [PLL_OFF_ALPHA_VAL] = 0x40, }, + + [CLK_ALPHA_PLL_TYPE_STROMER] = { + [PLL_OFF_L_VAL] = 0x08, + [PLL_OFF_ALPHA_VAL] = 0x10, + [PLL_OFF_ALPHA_VAL_U] = 0x14, + [PLL_OFF_USER_CTL] = 0x18, + [PLL_OFF_USER_CTL_U] = 0x1c, + [PLL_OFF_CONFIG_CTL] = 0x20, + [PLL_OFF_CONFIG_CTL_U] = 0xff, + [PLL_OFF_TEST_CTL] = 0x30, + [PLL_OFF_TEST_CTL_U] = 0x34, + [PLL_OFF_STATUS] = 0x28, + }, };EXPORT_SYMBOL_GPL (clk_alpha_pll_regs);
@@ -127,6 +140,8 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);#define ALPHA_BITWIDTH 32U#define ALPHA_SHIFT (w) min(w, ALPHA_BITWIDTH) +#define PLL_STATUS_REG_SHIFT 8 +#define PLL_HUAYRA_M_WIDTH 8#define PLL_HUAYRA_M_SHIFT 8#define PLL_HUAYRA_M_MASK 0xff
@@ -210,7 +225,7 @@ static int wait_for_pll(struct clk_alpha_pll *pll, u32 mask, bool inverse,void clk_alpha_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap,const struct alpha_pll_config *config) { -u32 val, mask; +u32 val, val_u, mask, mask_u;regmap_write (regmap,PLL_L_VAL (pll), config->l);regmap_write (regmap,PLL_ALPHA_VAL (pll), config->alpha);
@@ -240,14 +255,143 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, mask |= config->pre_div_mask; mask |= config->post_div_mask; mask |= config->vco_mask; + mask |= config->alpha_en_mask; + mask |= config->alpha_mode_mask;regmap_update_bits (regmap,PLL_USER_CTL (pll), mask, val); +/* Stromer APSS PLL does not enable LOCK_DET by default, so enable it */ + val_u = config->status_reg_val <<PLL_STATUS_REG_SHIFT ; + val_u |= config->lock_det; + + mask_u = config->status_reg_mask; + mask_u |= config->lock_det; + +if (val_u !=0 ) +regmap_update_bits (regmap,PLL_USER_CTL_U (pll), mask_u, val_u); + +if (config->test_ctl_val !=0 ) +regmap_write (regmap,PLL_TEST_CTL (pll), config->test_ctl_val); + +if (config->test_ctl_hi_val !=0 ) +regmap_write (regmap,PLL_TEST_CTL_U (pll), config->test_ctl_hi_val); +if (pll->flags &SUPPORTS_FSM_MODE )qcom_pll_set_fsm_mode (regmap,PLL_MODE (pll),6 ,0 ); }EXPORT_SYMBOL_GPL (clk_alpha_pll_configure); +static unsigned long +alpha_pll_stromer_calc_rate (u64 prate,u32 l,u64 a) +{ +return (prate * l) + ((prate * a) >>ALPHA_REG_BITWIDTH ); +} + +static unsigned long +alpha_pll_stromer_round_rate (unsigned long rate,unsigned long prate,u32 *l,u64 *a) +{ +u64 remainder; +u64 quotient; + + quotient = rate; + remainder =do_div (quotient, prate); + *l = quotient; + +if (!remainder) { + *a =0 ; +return rate; + } + + quotient = remainder <<ALPHA_REG_BITWIDTH ; + + remainder =do_div (quotient, prate); + +if (remainder) + quotient++; + + *a = quotient; +return alpha_pll_stromer_calc_rate (prate, *l, *a); +} + +static unsigned long +clk_alpha_pll_stromer_recalc_rate (struct clk_hw *hw,unsigned long parent_rate) +{ +u32 l, low, high, ctl; +u64 a =0 , prate = parent_rate; +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); + +regmap_read (pll->clkr.regmap,PLL_L_VAL (pll), &l); + +regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &ctl); +if (ctl &PLL_ALPHA_EN ) { +regmap_read (pll->clkr.regmap,PLL_ALPHA_VAL (pll), &low); +regmap_read (pll->clkr.regmap,PLL_ALPHA_VAL_U (pll), + &high); + a = (u64 )high <<ALPHA_BITWIDTH | low; + } + +return alpha_pll_stromer_calc_rate (prate, l, a); +} + +static int clk_alpha_pll_stromer_determine_rate (struct clk_hw *hw, +struct clk_rate_request *req) +{ +unsigned long rate = req->rate; +u32 l; +u64 a; + + rate =alpha_pll_stromer_round_rate (rate, req->best_parent_rate, &l, &a); + +return 0 ; +} + +static int clk_alpha_pll_stromer_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long prate) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 l; +int ret; +u64 a; + + rate =alpha_pll_stromer_round_rate (rate, prate, &l, &a); + +/* Write desired values to registers */ +regmap_write (pll->clkr.regmap,PLL_L_VAL (pll), l); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL (pll), a); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL_U (pll), + a >>ALPHA_BITWIDTH ); + +regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll), +PLL_ALPHA_EN ,PLL_ALPHA_EN ); + +if (!clk_hw_is_enabled (hw)) +return 0 ; + +/* Stromer PLL supports Dynamic programming. +* It allows the PLL frequency to be changed on-the-fly without first +* execution of a shutdown procedure followed by a bring up procedure. +*/ + +regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_UPDATE , +PLL_UPDATE ); +/* Make sure PLL_UPDATE request goes through */ +mb (); + +/* Wait for PLL_UPDATE to be cleared */ + ret =wait_for_pll_update (pll); +if (ret) +return ret; + +/* Wait 11or more PLL clk_ref ticks[to be explored more on wait] */ + +/* Poll LOCK_DET for one */ + ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + +return 0 ; +} +static int clk_alpha_pll_hwfsm_enable (struct clk_hw *hw) {int ret;
@@ -898,6 +1042,16 @@ const struct clk_ops clk_alpha_pll_hwfsm_ops = { };EXPORT_SYMBOL_GPL (clk_alpha_pll_hwfsm_ops); +const struct clk_ops clk_alpha_pll_stromer_ops = { + .enable = clk_alpha_pll_enable, + .disable = clk_alpha_pll_disable, + .is_enabled = clk_alpha_pll_is_enabled, + .recalc_rate = clk_alpha_pll_stromer_recalc_rate, + .determine_rate = clk_alpha_pll_stromer_determine_rate, + .set_rate = clk_alpha_pll_stromer_set_rate, +}; +EXPORT_SYMBOL_GPL (clk_alpha_pll_stromer_ops); +const struct clk_ops clk_alpha_pll_fixed_trion_ops = { .enable = clk_trion_pll_enable, .disable = clk_trion_pll_disable,
drivers/clk/qcom/clk-alpha-pll.h +5 -0
@@ -15,6 +15,7 @@ enum {CLK_ALPHA_PLL_TYPE_FABIA ,CLK_ALPHA_PLL_TYPE_TRION ,CLK_ALPHA_PLL_TYPE_LUCID =CLK_ALPHA_PLL_TYPE_TRION , +CLK_ALPHA_PLL_TYPE_STROMER , CLK_ALPHA_PLL_TYPE_MAX, };
@@ -121,6 +122,9 @@ struct alpha_pll_config {u32 post_div_mask;u32 vco_val;u32 vco_mask; +u32 status_reg_val; +u32 status_reg_mask; +u32 lock_det; };extern const struct clk_ops clk_alpha_pll_ops;
@@ -129,6 +133,7 @@ extern const struct clk_ops clk_alpha_pll_hwfsm_ops;extern const struct clk_ops clk_alpha_pll_postdiv_ops;extern const struct clk_ops clk_alpha_pll_huayra_ops;extern const struct clk_ops clk_alpha_pll_postdiv_ro_ops; +extern const struct clk_ops clk_alpha_pll_stromer_ops;extern const struct clk_ops clk_alpha_pll_fabia_ops;extern const struct clk_ops clk_alpha_pll_fixed_fabia_ops;
Signature · 1 line
2.7.4
PATCH 7/7 arm64: defconfig: Enable IPQ5018 SoC base configs
In reply to Varadarajan NarayananEnables clk & pinctrl related configs
--- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/configs/defconfig +3 -0
@@ -473,6 +473,7 @@ CONFIG_PINCTRL_IMX8MQ=y CONFIG_PINCTRL_IMX8QXP=y CONFIG_PINCTRL_IMX8DXL=y CONFIG_PINCTRL_IPQ8074=y +CONFIG_PINCTRL_IPQ5018=y CONFIG_PINCTRL_IPQ6018=y CONFIG_PINCTRL_MSM8916=y CONFIG_PINCTRL_MSM8994=y
@@ -851,6 +852,8 @@ CONFIG_QCOM_CLK_APCS_MSM8916=y CONFIG_QCOM_CLK_SMD_RPM=y CONFIG_QCOM_CLK_RPMH=y CONFIG_IPQ_GCC_8074=y +CONFIG_IPQ_GCC_5018=y +CONFIG_IPQ_APSS_5018=y CONFIG_IPQ_GCC_6018=y CONFIG_MSM_GCC_8916=y CONFIG_MSM_GCC_8994=y
Signature · 1 line
2.7.4
Rob Herring
maintainerRe: [PATCH 4/7] dt-bindings: pinctrl: qcom: Add ipq5018 pinctrl bindings
In reply to Varadarajan NarayananQuoted 9 lines · Varadarajan Narayanan
Add device tree binding Documentation details for ipq5018 pinctrl driver.
Signed-off-by Varadarajan Narayanan <[email protected]>--- .../bindings/pinctrl/qcom,ipq5018-pinctrl.yaml | 143 +++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.yaml
My bot found errors running 'make dt_binding_check' on your patch:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.example.dt.yaml: pinctrl@1000000: serial3-pinmux:function:0: 'blsp2_uart' is not one of ['atest_char', 'atest_char0', 'atest_char1', 'atest_char2', 'atest_char3', 'audio_pdm0', 'audio_pdm1', 'audio_rxbclk', 'audio_rxd', 'audio_rxfsync', 'audio_rxmclk', 'audio_txbclk', 'audio_txd', 'audio_txfsync', 'audio_txmclk', 'blsp0_i2c', 'blsp0_spi', 'blsp0_uart0', 'blsp0_uart1', 'blsp1_i2c0', 'blsp1_i2c1', 'blsp1_spi0', 'blsp1_spi1', 'blsp1_uart0', 'blsp1_uart1', 'blsp1_uart2', 'blsp2_i2c0', 'blsp2_i2c1', 'blsp2_spi', 'blsp2_spi0', 'blsp2_spi1', 'btss0', 'btss1', 'btss10', 'btss11', 'btss12', 'btss13', 'btss2', 'btss3', 'btss4', 'btss5', 'btss6', 'btss7', 'btss8', 'btss9', 'burn0', 'burn1', 'cri_trng', 'cri_trng0', 'cri_trng1', 'cxc_clk', 'cxc_data', 'dbg_out', 'eud_gpio', 'gcc_plltest', 'gcc_tlmm', 'gpio', 'mac0', 'mac1', 'mdc', 'mdio', 'pcie0_clk', 'pcie0_wake', 'pcie1_clk', 'pcie1_wake', 'pll_te
st', 'prng_rosc', 'pwm0', 'pwm1', 'pwm2', 'pwm3', 'qdss_cti_trig_in_a0', 'qdss_cti_trig_in_a1', 'qdss_cti_trig_in_b0', 'qdss_cti_trig_in_b1', 'qdss_cti_trig_out_a0', 'qdss_cti_trig_out_a1', 'qdss_cti_trig_out_b0', 'qdss_cti_trig_out_b1', 'qdss_traceclk_a', 'qdss_traceclk_b', 'qdss_tracectl_a', 'qdss_tracectl_b', 'qdss_tracedata_a', 'qdss_tracedata_b', 'qspi_clk', 'qspi_cs', 'qspi0', 'qspi1', 'qspi2', 'qspi3', 'reset_out', 'sdc1_clk', 'sdc1_cmd', 'sdc10', 'sdc11', 'sdc12', 'sdc13', 'wci0', 'wci1', 'wci2', 'wci3', 'wci4', 'wci5', 'wci6', 'wci7', 'wsa_swrm', 'wsi_clk3', 'wsi_data3', 'wsis_reset', 'xfem0', 'xfem1', 'xfem2', 'xfem3', 'xfem4', 'xfem5', 'xfem6', 'xfem7']
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.yaml
See https://patchwork.ozlabs.org/patch/1372367
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
Re: [PATCH 5/7] pinctrl: qcom: Add IPQ5018 pinctrl driver
In reply to Varadarajan NarayananQuoted 1 line · Varadarajan Narayanan
drivers/pinctrl/qcom/pinctrl-ipq5018.c +0
-0
[..]
Quoted 1 line
+static const struct
msm_functionipq5018_functions[] = {
[..]
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 748
Quoted 6 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +6
-0+FUNCTION (qspi_clk), +FUNCTION (qspi_cs), +FUNCTION (qspi0), +FUNCTION (qspi1), +FUNCTION (qspi2), + FUNCTION(qspi3),
Instead of having one function name per pin it typically leads to cleaner DT if you group these under the same name (i.e. "qspi")
Same seems to apply to sdc, wci, xfem at least.
Quoted 20 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +20
-0+FUNCTION (reset_out), +FUNCTION (sdc1_clk), +FUNCTION (sdc1_cmd), +FUNCTION (sdc10), +FUNCTION (sdc11), +FUNCTION (sdc12), +FUNCTION (sdc13), +FUNCTION (wci0), +FUNCTION (wci1), +FUNCTION (wci2), +FUNCTION (wci3), +FUNCTION (wci4), +FUNCTION (wci5), +FUNCTION (wci6), +FUNCTION (wci7), +FUNCTION (wsa_swrm), +FUNCTION (wsi_clk3), +FUNCTION (wsi_data3), +FUNCTION (wsis_reset), + FUNCTION(xfem0),
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 778
Quoted 10 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +10
-0+FUNCTION (xfem1), +FUNCTION (xfem2 ), +FUNCTION (xfem3 ), +FUNCTION (xfem4 ), +FUNCTION (xfem5 ), +FUNCTION (xfem6 ), + FUNCTION(xfem7), +}; +static const struct msm_pingroup ipq5018_groups[] = { + PINGROUP(0, atest_char0, _, qdss_cti_trig_out_a0, wci0, wci0, xfem0,
What's up with wci0 being both function 4 and 5?
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 781
Quoted 3 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +3
-0+ _, _, _), + PINGROUP(1, atest_char1, _, qdss_cti_trig_in_a0, wci1, wci1, xfem1, + _, _, _),
Please don't like break these, better blow the line length limit in favor or readability.
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 785
Quoted 4 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +4
-0+PINGROUP (2 , atest_char2, _, qdss_cti_trig_out_a1, wci2, wci2, xfem2, + _, _, _), +PINGROUP (3 , atest_char3, _, qdss_cti_trig_in_a1, wci3, wci3, xfem3, + _, _, _),
Regards,
Bjorn
Re: [PATCH 5/7] pinctrl: qcom: Add IPQ5018 pinctrl driver
Quoted 5 lines · Bjorn Andersson
Quoted 1 line · Varadarajan Narayanan
drivers/pinctrl/qcom/pinctrl-ipq5018.c +0
-0[..]
Quoted 1 line
+static const struct
msm_functionipq5018_functions[] = {[..]
Quoted 9 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 748
Quoted 6 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +6
-0+FUNCTION (qspi_clk), +FUNCTION (qspi_cs), +FUNCTION (qspi0), +FUNCTION (qspi1), +FUNCTION (qspi2), + FUNCTION(qspi3),Instead of having one function name per pin it typically leads to cleaner DT if you group these under the same name (i.e. "qspi")
Ok.
Quoted 22 lines
Same seems to apply to sdc, wci, xfem at least.
Quoted 20 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +20
-0+FUNCTION (reset_out), +FUNCTION (sdc1_clk), +FUNCTION (sdc1_cmd), +FUNCTION (sdc10), +FUNCTION (sdc11), +FUNCTION (sdc12), +FUNCTION (sdc13), +FUNCTION (wci0), +FUNCTION (wci1), +FUNCTION (wci2), +FUNCTION (wci3), +FUNCTION (wci4), +FUNCTION (wci5), +FUNCTION (wci6), +FUNCTION (wci7), +FUNCTION (wsa_swrm), +FUNCTION (wsi_clk3), +FUNCTION (wsi_data3), +FUNCTION (wsis_reset), + FUNCTION(xfem0),
Quoted 8 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 776
Quoted 8 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +8
-0+FUNCTION (xfem1), +FUNCTION (xfem2), +FUNCTION (xfem3), +FUNCTION (xfem4), +FUNCTION (xfem5), +FUNCTION (xfem6), + FUNCTION(xfem7), +};
Ok.
Quoted 4 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 778
Quoted 2 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +2
-0+static const struct msm_pingroup ipq5018_groups[] = { + PINGROUP(0, atest_char0, _, qdss_cti_trig_out_a0, wci0, wci0, xfem0,What's up with wci0 being both function 4 and 5?
Will check this.
Quoted 11 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 781
Quoted 3 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +3
-0+ _, _, _), + PINGROUP(1, atest_char1, _, qdss_cti_trig_in_a0, wci1, wci1, xfem1, + _, _, _),Please don't like break these, better blow the line length limit in favor or readability.
drivers/pinctrl/qcom/pinctrl-ipq5018.c line 785
Quoted 4 lines
drivers/pinctrl/qcom/pinctrl-ipq5018.c +4
-0+PINGROUP (2 , atest_char2, _, qdss_cti_trig_out_a1, wci2, wci2, xfem2, + _, _, _), +PINGROUP (3 , atest_char3, _, qdss_cti_trig_in_a1, wci3, wci3, xfem3, + _, _, _),
Ok.
Quoted 2 lines
Regards,
Bjorn
Will post updated patches soon.
Thanks
Varada
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 4/7] dt-bindings: pinctrl: qcom: Add ipq5018 pinctrl bindings
In reply to Rob HerringQuoted 18 lines · Rob Herring
Quoted 9 lines · Varadarajan Narayanan
Add device tree binding Documentation details for ipq5018 pinctrl driver.
Signed-off-by Varadarajan Narayanan <[email protected]>--- .../bindings/pinctrl/qcom,ipq5018-pinctrl.yaml | 143 +++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.yamlMy bot found errors running 'make
dt_binding_check' on your patch:/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.example.dt.yaml: pinctrl@1000000: serial3-pinmux:function:0: '
blsp2_uart' is not one of ['atest_char', 'atest_char0', 'atest_char1', 'atest_char2', 'atest_char3', 'audio_pdm0', 'audio_pdm1', 'audio_rxbclk', 'audio_rxd', 'audio_rxfsync', 'audio_rxmclk', 'audio_txbclk', 'audio_txd', 'audio_txfsync', 'audio_txmclk', 'blsp0_i2c', 'blsp0_spi', 'blsp0_uart0', 'blsp0_uart1', 'blsp1_i2c0', 'blsp1_i2c1', 'blsp1_spi0', 'blsp1_spi1', 'blsp1_uart0', 'blsp1_uart1', 'blsp1_uart2', 'blsp2_i2c0', 'blsp2_i2c1', 'blsp2_spi', 'blsp2_spi0', 'blsp2_spi1', 'btss0', 'btss1', 'btss10', 'btss11', 'btss12', 'btss13', 'btss2', 'btss3', 'btss4', 'btss5', 'btss6', 'btss7', 'btss8', 'btss9', 'burn0', 'burn1', 'cri_trng', 'cri_trng0', 'cri_trng1', 'cxc_clk', 'cxc_data', 'dbg_out', 'eud_gpio', 'gcc_plltest', 'gcc_tlmm', 'gpio', 'mac0', 'mac1', 'mdc', 'mdio', 'pcie0_clk', 'pcie0_wake', 'pcie1_clk', 'pcie1_wake', 'pll_test', 'prng_rosc', 'pwm0', 'pwm1', 'pwm2', 'pwm3', 'qdss_cti_trig_in_a0', 'qdss_cti_trig_in_a1', 'qdss_cti_trig_in_b0', 'qdss_cti_trig_in_b1', 'qdss_cti_trig_out_a0', 'qdss_cti_trig_out_a1', 'qdss_cti_trig_out_b0', 'qdss_cti_trig_out_b1', 'qdss_traceclk_a', 'qdss_traceclk_b', 'qdss_tracectl_a', 'qdss_tracectl_b', 'qdss_tracedata_a', 'qdss_tracedata_b', 'qspi_clk', 'qspi_cs', 'qspi0', 'qspi1', 'qspi2', 'qspi3', 'reset_out', 'sdc1_clk', 'sdc1_cmd', 'sdc10', 'sdc11', 'sdc12', 'sdc13', 'wci0', 'wci1', 'wci2', 'wci3', 'wci4', 'wci5', 'wci6', 'wci7', 'wsa_swrm', 'wsi_clk3', 'wsi_data3', 'wsis_reset', 'xfem0', 'xfem1', 'xfem2', 'xfem3', 'xfem4', 'xfem5', 'xfem6', 'xfem7']
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pinctrl/qcom,ipq5018-pinctrl.yaml
Quoted 8 lines
See https://patchwork.ozlabs.org/patch/1372367
If you already ran 'make
dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date:pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
Ok, will check and post updated patches
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Rob Herring
maintainerRe: [PATCH 2/7] dt-bindings: arm64: ipq5018: Add binding descriptions for clock and reset
In reply to Varadarajan NarayananQuoted 39 lines · Varadarajan Narayanan
This patch adds support for the global clock controller found on the IPQ5018 based devices.
Signed-off-by Varadarajan Narayanan <[email protected]>--- .../devicetree/bindings/clock/qcom,gcc.yaml | 3 + include/dt-bindings/clock/qcom,gcc-ipq5018.h | 183 +++++++++++++++++++++ include/dt-bindings/reset/qcom,gcc-ipq5018.h | 119 ++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq5018.h create mode 100644 include/dt-bindings/reset/qcom,gcc-ipq5018.hDocumentation/devicetree/bindings/clock/qcom,gcc.yaml +3
-0@@ -18,6 +18,8 @@ description: | - dt-bindings/clock/qcom,gcc-apq8084.h - dt-bindings/reset/qcom,gcc-apq8084.h - dt-bindings/clock/qcom,gcc-ipq4019.h + - dt-bindings/clock/qcom,gcc-ipq5018.h + - dt-bindings/reset/qcom,gcc-ipq5018.h - dt-bindings/clock/qcom,gcc-ipq6018.h - dt-bindings/reset/qcom,gcc-ipq6018.h - dt-bindings/clock/qcom,gcc-ipq806x.h (qcom,gcc-ipq8064)@@ -39,6 +41,7 @@ properties: enum: - qcom,gcc-apq8084 - qcom,gcc-ipq4019 + - qcom,gcc-ipq5018 - qcom,gcc-ipq6018 - qcom,gcc-ipq8064 - qcom,gcc-msm8660include/dt-bindings/clock/qcom,gcc-ipq5018.h new file +0
-0
include/dt-bindings/clock/qcom,gcc-ipq5018.h line 1
Quoted 1 line
include/dt-bindings/clock/qcom,gcc-ipq5018.h new file +1
-0@@ -0,0 +1,183 @@ +/* SPDX-License-Identifier: GPL-2.0+ */
Only care about Linux and GPL OSs? And your employer is okay with GPL3 (and GPL4, ...)?
IOW, dual license please.
Rob Herring
maintainerRe: [PATCH 6/7] arm64: dts: Add ipq5018 SoC and MP03 board support
In reply to Varadarajan NarayananQuoted 6 lines · Varadarajan Narayanan
Add initial device tree support for the Qualcomm IPQ5018 SoC and MP03.1-C2 board.
Signed-off-by Varadarajan Narayanan <[email protected]>--- Documentation/devicetree/bindings/arm/qcom.yaml | 7 +
Bindings and dts files should be separate patches.
Quoted 57 lines
arch/arm64/boot/dts/qcom/Makefile | 1 + arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts | 30 ++++ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 201 ++++++++++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts create mode 100644 arch/arm64/boot/dts/qcom/ipq5018.dtsiDocumentation/devicetree/bindings/arm/qcom.yaml +7
-0@@ -28,6 +28,7 @@ description: | apq8074 apq8084 apq8096 + ipq5018 ipq6018 ipq8074 mdm9615@@ -49,6 +50,7 @@ description: | hk01 idp liquid + mp03 mtp qrd sbc@@ -142,6 +144,11 @@ properties: - items: - enum: + - qcom,ipq5018-mp03 + - const: qcom,ipq5018 + + - items: + - enum: - qcom,ipq8064-ap148 - const: qcom,ipq8064arch/arm64/boot/dts/qcom/Makefile +1
-0@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_QCOM) += apq8096-db820c.dtb dtb-$(CONFIG_ARCH_QCOM) += apq8096-ifc6640.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq6018-cp01-c1.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq8074-hk01.dtb +dtb-$(CONFIG_ARCH_QCOM) += ipq5018-mp03.1-c2.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-longcheer-l8150.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a3u-eur.dtbarch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +0
-0
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts line 1
Quoted 1 line
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +1
-0@@ -0,0 +1,30 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
Your employer is okay with GPL3 (and later)?
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts line 5
Quoted 4 lines
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +4
-0+/* + * IPQ5018 CP01 board device tree source + * + * Copyright (c) 2019, The Linux Foundation. All rights reserved.
It's 2020.
Quoted 7 lines
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +7
-0+ */ + +/dts-v1/; + +#include "ipq5018.dtsi" + +/ {
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts line 22
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +10
-0+ model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03-C2"; + compatible = "qcom,ipq5018-mp03", "qcom,ipq5018"; + + aliases { + serial0 = &blsp1_uart1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " swiotlb=1";
Not an upstream property.
Quoted 21 lines
arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +8
-0+ }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_1_pins>; + pinctrl-names = "default"; + status = "ok"; +};arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +7
-0@@ -0,0 +1,201 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * IPQ5018 SoC device tree source + * + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + */ +
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 17
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/clock/qcom,gcc-ipq5018.h> +#include <dt-bindings/reset/qcom,gcc-ipq5018.h> + +/ { + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&intc>; + + clocks {
Drop the container node.
Quoted 36 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +36
-0+ sleep_clk: sleep-clk { + compatible = "fixed-clock"; + clock-frequency = <32000>; + #clock-cells = <0>; + }; + + xo: xo { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + #clock-cells = <0>; + }; + }; + + cpus: cpus { + #address-cells = <1>; + #size-cells = <0>; + + CPU0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + reg = <0x0>; + enable-method = "psci"; + next-level-cache = <&L2_0>; + }; + + CPU1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + enable-method = "psci"; + reg = <0x1>; + next-level-cache = <&L2_0>; + }; + + L2_0: l2-cache { + compatible = "cache"; + cache-level = <0x2>;
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 63
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+ }; + }; + + pmuv8: pmu { + compatible = "arm,cortex-a53-pmu"; + interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) | + IRQ_TYPE_LEVEL_HIGH)>; + }; + + psci: psci {
Drop unused (and likely never needed) labels.
Quoted 6 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +6
-0+ compatible = "arm,psci-1.0"; + method = "smc"; + }; + + reserved-memory { + #address-cells = <2>;
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 79
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+ #size-cells = <2>; + ranges; + + tz: tz@4ac00000 { + reg = <0x0 0x4ac00000 0x0 0x00400000>; + no-map; + }; + }; + + soc: soc {
soc@0
Build dtbs with W=1 and fix any warnings. This should be one.
Quoted 15 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +15
-0+ #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0xffffffff>; + dma-ranges; + compatible = "simple-bus"; + + tlmm: pinctrl@1000000 { + compatible = "qcom,ipq5018-pinctrl"; + reg = <0x01000000 0x300000>; + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&tlmm 0 80>; + interrupt-controller; + #interrupt-cells = <2>;
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 104
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+ + serial_1_pins: serial1-pinmux { + pins = "gpio31", "gpio32", "gpio33", "gpio34"; + function = "blsp1_uart1"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + gcc: gcc@1800000 {
clock-controller@...
Quoted 20 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +20
-0+ compatible = "qcom,gcc-ipq5018"; + reg = <0x01800000 0x80000>; + clocks = <&xo>, <&sleep_clk>; + clock-names = "xo", "sleep_clk"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + blsp1_uart1: serial@78af000 { + compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; + reg = <0x078af000 0x200>; + interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>, + <&gcc GCC_BLSP1_AHB_CLK>; + clock-names = "core", "iface"; + status = "disabled"; + }; + + intc: interrupt-controller@b000000 { + compatible = "qcom,msm-qgic2";
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 134
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+ interrupt-controller; + #interrupt-cells = <0x3>; + reg = <0x0b000000 0x1000>, /*GICD*/ + <0x0b002000 0x1000>, /*GICC*/ + <0x0b001000 0x1000>, /*GICH*/ + <0x0b004000 0x1000>; /*GICV*/ + interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; + }; + + timer {
Not memory mapped, move to top-level.
Quoted 56 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +56
-0+ compatible = "arm,armv8-timer"; + interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; + }; + + timer@b120000 { + #address-cells = <1>; + #size-cells = <1>; + ranges; + compatible = "arm,armv7-timer-mem"; + reg = <0x0b120000 0x1000>; + clock-frequency = <19200000>; + + frame@b120000 { + frame-number = <0>; + interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b121000 0x1000>, + <0x0b122000 0x1000>; + }; + + frame@b123000 { + frame-number = <1>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + reg = <0xb123000 0x1000>; + status = "disabled"; + }; + + frame@b124000 { + frame-number = <2>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b124000 0x1000>; + status = "disabled"; + }; + + frame@b125000 { + frame-number = <3>; + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b125000 0x1000>; + status = "disabled"; + }; + + frame@b126000 { + frame-number = <4>; + interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b126000 0x1000>; + status = "disabled"; + }; + + frame@b127000 { + frame-number = <5>; + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b127000 0x1000>; + status = "disabled";
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 200
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+ }; + + frame@b128000 { + frame-number = <6>; + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b128000 0x1000>; + status = "disabled"; + }; + }; + };
No memory node...
Rob
Quoted 4 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +1
-0+};Signature · 1 line
2.7.4
Stephen Boyd
maintainerRe: [PATCH 3/7] clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018
In reply to Varadarajan NarayananQuoting Varadarajan Narayanan (2020-09-27 22:15:36)
Quoted 5 lines
drivers/clk/qcom/Kconfig +0
-0
drivers/clk/qcom/Kconfig config IPQ_GCC_8074 · line 164
Quoted 10 lines
drivers/clk/qcom/Kconfig +7
-0@@ -155,6 +155,14 @@ config IPQ_GCC_8074 i2c, USB, SD/eMMC, etc. Select this for the root clock of ipq8074. +config IPQ_GCC_5018 + tristate "IPQ5018 Global Clock Controller" + help + Support for global clock controller on ipq5018 devices. + Say Y if you want to use peripheral devices such as UART, SPI, + i2c, USB, SD/eMMC, etc. Select this for the root clock + of ipq5018.
What is the root clock of ipq5018? Please drop that last sentence.
Quoted 12 lines
drivers/clk/qcom/Kconfig +1
-0+ config MSM_GCC_8660 tristate "MSM8660 Global Clock Controller" helpdrivers/clk/qcom/gcc-ipq5018.c new file +2
-0@@ -0,0 +1,3833 @@ +// SPDX-License-Identifier: GPL-2.0+ +
drivers/clk/qcom/gcc-ipq5018.c line 12
Quoted 10 lines
drivers/clk/qcom/gcc-ipq5018.c new file +10
-0+#include <linux/kernel.h> +#include <linux/err.h> +#include <linux/platform_device.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/clk-provider.h> +#include <linux/regmap.h> + +#include <linux/reset-controller.h>
Why is this attached to dt-bindings? Please remove that newline above and move this away from dt-bindings below.
Quoted 4 lines
drivers/clk/qcom/gcc-ipq5018.c new file +4
-0+#include <dt-bindings/clock/qcom,gcc-ipq5018.h> +#include <dt-bindings/reset/qcom,gcc-ipq5018.h> + +#include "common.h"
drivers/clk/qcom/gcc-ipq5018.c line 26
Quoted 10 lines
drivers/clk/qcom/gcc-ipq5018.c new file +10
-0+#include "clk-regmap.h" +#include "clk-pll.h" +#include "clk-rcg.h" +#include "clk-branch.h" +#include "clk-alpha-pll.h" +#include "clk-regmap-divider.h" +#include "clk-regmap-mux.h" +#include "reset.h" + +#define F (f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
This is in clk-rcg.h already.
drivers/clk/qcom/gcc-ipq5018.c line 301
Quoted 5 lines
drivers/clk/qcom/gcc-ipq5018.c new file +5
-0+ +static const char *const gcc_usb3phy_0_cc_pipe_clk_xo[] = { +"usb3phy_0_cc_pipe_clk" , +"xo" , +};
All these names structures need to change, see next comment.
drivers/clk/qcom/gcc-ipq5018.c line 467
Quoted 11 lines
drivers/clk/qcom/gcc-ipq5018.c new file +11
-0+ +static struct clk_rcg2 apss_ahb_clk_src = { + .cmd_rcgr =0x46000 , + .mnd_width =0 , + .hid_width =5 , + .freq_tbl = ftbl_apss_ahb_clk_src, + .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, + .clkr.hw.init = &(struct clk_init_data ){ + .name ="apss_ahb_clk_src" , + .parent_names = gcc_xo_gpll0_gpll0_out_main_div2, + .num_parents =3 ,
Please migrate to the new way of specifying clks with clk_init_data::clk_parent_data
drivers/clk/qcom/gcc-ipq5018.c line 469
Quoted 2 lines
drivers/clk/qcom/gcc-ipq5018.c new file +2
-0+ .ops = &clk_rcg2_ops, + .flags = CLK_IS_CRITICAL | CLK_IGNORE_UNUSED,
Why is it critical and ignore unused? Do you need this clk to be here at all? Can we just enable it when this driver probes with a register write and then ignore it from there on out?
Quoted 19 lines
drivers/clk/qcom/gcc-ipq5018.c new file +19
-0+ }, +}; + +static struct clk_regmap_div apss_ahb_postdiv_clk_src = { + .reg =0x46018 , + .shift =4 , + .width =4 , + .clkr = { + .hw.init = &(struct clk_init_data ){ + .name ="apss_ahb_postdiv_clk_src" , + .parent_names = (const char *[]){ +"apss_ahb_clk_src" + }, + .num_parents =1 , + .ops = &clk_regmap_div_ops, + }, + }, +}; +
[...]
drivers/clk/qcom/gcc-ipq5018.c line 2481
Quoted 13 lines
drivers/clk/qcom/gcc-ipq5018.c new file +13
-0+ +static struct clk_branch gcc_qdss_dap_clk = { + .halt_reg =0x29084 , + .clkr = { + .enable_reg =0x29084 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_qdss_dap_clk" , + .parent_names = (const char *[]){ +"qdss_tsctr_clk_src" + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ,
Whenever CLK_IS_CRITICAL is there please document why it is needed. And if possible remove the clk structure and hit the clk on in driver probe so we don't waste memory modeling something that never matters. Typically that can only be done if nothing references this clk as a parent or if we're willing to break the clk tree and ignore describing parents. In this case it's a branch so probably nothing else is under it so we can just turn it on during probe and stop caring.
Quoted 22 lines
drivers/clk/qcom/gcc-ipq5018.c new file +22
-0+ .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_qdss_cfg_ahb_clk = { + .halt_reg =0x29008 , + .clkr = { + .enable_reg =0x29008 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_qdss_cfg_ahb_clk" , + .parent_names = (const char *[]){ +"pcnoc_clk_src" + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +
[...]
drivers/clk/qcom/gcc-ipq5018.c line 2566
Quoted 13 lines
drivers/clk/qcom/gcc-ipq5018.c new file +13
-0+ +static struct clk_branch gcc_qdss_stm_clk = { + .halt_reg =0x29044 , + .clkr = { + .enable_reg =0x29044 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_qdss_stm_clk" , + .parent_names = (const char *[]){ +"qdss_stm_clk_src" + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED ,
Why ignore unused? Probably should just be turned on somewhere else?
Quoted 9 lines
drivers/clk/qcom/gcc-ipq5018.c new file +9
-0+ .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_qdss_traceclkin_clk = { + .halt_reg =0x29060 , + .clkr = { + .enable_reg =0x29060 ,
[...]
Quoted 7 lines
drivers/clk/qcom/gcc-ipq5018.c new file +7
-0+ +static int gcc_ipq5018_probe (struct platform_device *pdev) +{ +int i, ret; +struct regmap *regmap; +struct clk *clk; +struct qcom_cc_desc ipq5018_desc = gcc_ipq5018_desc;
drivers/clk/qcom/gcc-ipq5018.c line 3784
Quoted 10 lines
drivers/clk/qcom/gcc-ipq5018.c new file +10
-0+ + regmap =qcom_cc_map (pdev, &ipq5018_desc); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +for (i =0 ; i <ARRAY_SIZE (gcc_ipq5018_hws); i++) { + clk =devm_clk_register (&pdev->dev, gcc_ipq5018_hws[i]); +if (IS_ERR (clk)) +return PTR_ERR (clk); + }
We really need to move this into the qcom_cc_desc so it is part of qcom_cc_really_probe()
drivers/clk/qcom/gcc-ipq5018.c line 3789
Quoted 5 lines
drivers/clk/qcom/gcc-ipq5018.c new file +5
-0+/*Gen2 PHY*/ +clk_register_fixed_rate (&pdev->dev,"pcie20_phy0_pipe_clk" ,NULL , +CLK_IS_ROOT ,125000000 ); +clk_register_fixed_rate (&pdev->dev,"pcie20_phy1_pipe_clk" ,NULL , +CLK_IS_ROOT ,125000000 );
These should be coming from some pcie phy and part of the DT binding as a 'clocks' element that this device consumes.
drivers/clk/qcom/gcc-ipq5018.c line 3799
Quoted 10 lines
drivers/clk/qcom/gcc-ipq5018.c new file +10
-0+ +clk_alpha_pll_configure (&ubi32_pll_main, regmap, &ubi32_pll_config); + + ret =qcom_cc_really_probe (pdev, &ipq5018_desc, regmap); +if (ret) { +dev_err (&pdev->dev,"Failed to register ipq5018 GCC clocks\n" ); +return ret; + } + +dev_info (&pdev->dev,"Registered ipq5018 GCC clocks provider" );
Please drop this noise.
drivers/clk/qcom/gcc-ipq5018.c line 3808
Quoted 9 lines
drivers/clk/qcom/gcc-ipq5018.c new file +9
-0+ +return ret; +} + +static int gcc_ipq5018_remove (struct platform_device *pdev) +{ +return 0 ; +} +
If there isn't anything in the remove function it can be omitted.
Quoted 15 lines
drivers/clk/qcom/gcc-ipq5018.c new file +15
-0+static struct platform_driver gcc_ipq5018_driver = { + .probe = gcc_ipq5018_probe, + .remove = gcc_ipq5018_remove, + .driver = { + .name ="qcom,gcc-ipq5018" , + .owner =THIS_MODULE , + .of_match_table = gcc_ipq5018_match_table, + }, +}; + +static int __init gcc_ipq5018_init (void ) +{ +return platform_driver_register (&gcc_ipq5018_driver); +} +core_initcall (gcc_ipq5018_init);
drivers/clk/qcom/gcc-ipq5018.c line 3833
Quoted 10 lines
drivers/clk/qcom/gcc-ipq5018.c new file +10
-0+ +static void __exit gcc_ipq5018_exit(void) +{ +platform_driver_unregister (&gcc_ipq5018_driver); +} +module_exit (gcc_ipq5018_exit); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. GCC IPQ5018 Driver" ); +MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("platform:gcc-ipq5018" );
I think alias isn't needed anymore.
include/linux/clk-provider.h line 24
Quoted 12 lines
include/linux/clk-provider.h +2
-2@@ -20,8 +20,8 @@#define CLK_SET_PARENT_GATE BIT(1)/* must be gated across re-parent */ #define CLK_SET_RATE_PARENT BIT(2)/* propagate rate change up one level */ #define CLK_IGNORE_UNUSED BIT(3)/* do not gate even if unused */ -/* unused */ -/* unused */ +#define CLK_IS_ROOT BIT(4)/* root clk, has no parent */ +#define CLK_IS_BASIC BIT(5)/* Basic clk, can't do a to_clk_foo() */
Please no. Drop this hunk.
Quoted 3 lines
include/linux/clk-provider.h +0
-0#define CLK_GET_RATE_NOCACHE BIT(6)/* do not use the cached clk rate */ #define CLK_SET_RATE_NO_REPARENT BIT(7)/* don't re-parent on rate change */ #define CLK_GET_ACCURACY_NOCACHE BIT(8)/* do not use the cached clk accuracy */
Stephen Boyd
maintainerRe: [PATCH 1/7] clk: qcom: clk-alpha-pll: Add support for Stromer PLLs
In reply to Varadarajan NarayananCan you check your get_maintainers script invocation? Not sure why arm64 maintainers are Cced on a clk patch.
Quoting Varadarajan Narayanan (2020-09-27 22:15:34)
Quoted 14 lines
Add programming sequence support for managing the Stromer PLLs.
Signed-off-by Varadarajan Narayanan <[email protected]>--- drivers/clk/qcom/clk-alpha-pll.c | 156 ++++++++++++++++++++++++++++++++++++++- drivers/clk/qcom/clk-alpha-pll.h | 5 ++ 2 files changed, 160 insertions(+), 1 deletion(-)drivers/clk/qcom/clk-alpha-pll.c +0
-0
drivers/clk/qcom/clk-alpha-pll.c const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { · line 119
Quoted 4 lines
drivers/clk/qcom/clk-alpha-pll.c +1
-0@@ -116,6 +116,19 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { [PLL_OFF_OPMODE] = 0x38, [PLL_OFF_ALPHA_VAL] = 0x40, }, +
Nitpick: Drop this newline.
Quoted 16 lines
drivers/clk/qcom/clk-alpha-pll.c +12
-0+ [CLK_ALPHA_PLL_TYPE_STROMER ] = { + [PLL_OFF_L_VAL ] =0x08 , + [PLL_OFF_ALPHA_VAL ] =0x10 , + [PLL_OFF_ALPHA_VAL_U ] =0x14 , + [PLL_OFF_USER_CTL ] =0x18 , + [PLL_OFF_USER_CTL_U ] =0x1c , + [PLL_OFF_CONFIG_CTL ] =0x20 , + [PLL_OFF_CONFIG_CTL_U ] =0xff , + [PLL_OFF_TEST_CTL ] =0x30 , + [PLL_OFF_TEST_CTL_U ] =0x34 , + [PLL_OFF_STATUS ] =0x28 , + }, };EXPORT_SYMBOL_GPL (clk_alpha_pll_regs );
drivers/clk/qcom/clk-alpha-pll.c EXPORT_SYMBOL_GPL(clk_alpha_pll_regs); · line 143
Quoted 4 lines
drivers/clk/qcom/clk-alpha-pll.c +1
-0@@ -127,6 +140,8 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);#define ALPHA_BITWIDTH 32U#define ALPHA_SHIFT (w) min(w, ALPHA_BITWIDTH) +#define PLL_STATUS_REG_SHIFT 8
This should have an ALPHA_ prefix.
Quoted 11 lines
drivers/clk/qcom/clk-alpha-pll.c +3
-0+#define PLL_HUAYRA_M_WIDTH 8#define PLL_HUAYRA_M_SHIFT 8#define PLL_HUAYRA_M_MASK 0xff@@ -240,14 +255,143 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, mask |= config->pre_div_mask; mask |= config->post_div_mask; mask |= config->vco_mask; + mask |= config->alpha_en_mask; + mask |= config->alpha_mode_mask;
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 270
Quoted 10 lines
drivers/clk/qcom/clk-alpha-pll.c +8
-0regmap_update_bits (regmap,PLL_USER_CTL (pll), mask, val); +/* Stromer APSS PLL does not enable LOCK_DET by default, so enable it */ + val_u = config->status_reg_val <<PLL_STATUS_REG_SHIFT ; + val_u |= config->lock_det; + + mask_u = config->status_reg_mask; + mask_u |= config->lock_det; + +if (val_u !=0 )
if (val_u) is more canonical.
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 273
Quoted 3 lines
drivers/clk/qcom/clk-alpha-pll.c +3
-0+regmap_update_bits (regmap,PLL_USER_CTL_U (pll), mask_u, val_u); + +if (config->test_ctl_val !=0 )
Same comment
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 276
Quoted 3 lines
drivers/clk/qcom/clk-alpha-pll.c +3
-0+regmap_write (regmap,PLL_TEST_CTL (pll), config->test_ctl_val); + +if (config->test_ctl_hi_val !=0 )
Same comment
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 287
Quoted 11 lines
drivers/clk/qcom/clk-alpha-pll.c +6
-0+regmap_write (regmap,PLL_TEST_CTL_U (pll), config->test_ctl_hi_val); +if (pll->flags &SUPPORTS_FSM_MODE )qcom_pll_set_fsm_mode (regmap,PLL_MODE (pll),6 ,0 ); }EXPORT_SYMBOL_GPL (clk_alpha_pll_configure); +static unsigned long +alpha_pll_stromer_calc_rate (u64 prate,u32 l,u64 a) +{ +return (prate * l) + ((prate * a) >>ALPHA_REG_BITWIDTH );
Is this not already in this file? Why can't we use alpha_pll_calc_rate()?
Quoted 46 lines
drivers/clk/qcom/clk-alpha-pll.c +46
-0+} + +static unsigned long +alpha_pll_stromer_round_rate (unsigned long rate,unsigned long prate,u32 *l,u64 *a) +{ +u64 remainder; +u64 quotient; + + quotient = rate; + remainder =do_div (quotient, prate); + *l = quotient; + +if (!remainder) { + *a =0 ; +return rate; + } + + quotient = remainder <<ALPHA_REG_BITWIDTH ; + + remainder =do_div (quotient, prate); + +if (remainder) + quotient++; + + *a = quotient; +return alpha_pll_stromer_calc_rate (prate, *l, *a); +} + +static unsigned long +clk_alpha_pll_stromer_recalc_rate (struct clk_hw *hw,unsigned long parent_rate) +{ +u32 l, low, high, ctl; +u64 a =0 , prate = parent_rate; +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); + +regmap_read (pll->clkr.regmap,PLL_L_VAL (pll), &l); + +regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &ctl); +if (ctl &PLL_ALPHA_EN ) { +regmap_read (pll->clkr.regmap,PLL_ALPHA_VAL (pll), &low); +regmap_read (pll->clkr.regmap,PLL_ALPHA_VAL_U (pll), + &high); + a = (u64 )high <<ALPHA_BITWIDTH | low; + } + +return alpha_pll_stromer_calc_rate (prate, l, a);
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 343
Quoted 10 lines
drivers/clk/qcom/clk-alpha-pll.c +10
-0+} + +static int clk_alpha_pll_stromer_determine_rate (struct clk_hw *hw, +struct clk_rate_request *req) +{ +unsigned long rate = req->rate; +u32 l; +u64 a; + + rate =alpha_pll_stromer_round_rate (rate, req->best_parent_rate, &l, &a);
Why assign to rate if nobody is going to look at it? Should probably be set to req->rate instead?
Quoted 5 lines
drivers/clk/qcom/clk-alpha-pll.c +5
-0+ +return 0 ; +} + +static int clk_alpha_pll_stromer_set_rate(struct clk_hw *hw, unsigned long rate,
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 358
Quoted 10 lines
drivers/clk/qcom/clk-alpha-pll.c +10
-0+ unsigned long prate) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 l; +int ret; +u64 a; + + rate =alpha_pll_stromer_round_rate (rate, prate, &l, &a); + +/* Write desired values to registers */
Please drop this useless comment.
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 370
Quoted 12 lines
drivers/clk/qcom/clk-alpha-pll.c +12
-0+regmap_write (pll->clkr.regmap,PLL_L_VAL (pll), l); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL (pll), a); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL_U (pll), + a >>ALPHA_BITWIDTH ); + +regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll), +PLL_ALPHA_EN ,PLL_ALPHA_EN ); + +if (!clk_hw_is_enabled (hw)) +return 0 ; + +/* Stromer PLL supports Dynamic programming.
The /* goes on a line by itself.
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 373
Quoted 3 lines
drivers/clk/qcom/clk-alpha-pll.c +3
-0+* It allows the PLL frequency to be changed on-the-fly without first +* execution of a shutdown procedure followed by a bring up procedure. +*/
Cool feature. Maybe that can go into the header file though?
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 378
Quoted 5 lines
drivers/clk/qcom/clk-alpha-pll.c +5
-0+ +regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_UPDATE , +PLL_UPDATE ); +/* Make sure PLL_UPDATE request goes through */ +mb ();
regmap APIs already have memory barriers so this isn't needed?
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 380
Quoted 2 lines
drivers/clk/qcom/clk-alpha-pll.c +2
-0+ +/* Wait for PLL_UPDATE to be cleared */
I think the code already says this so we can just drop this comment.
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 386
Quoted 6 lines
drivers/clk/qcom/clk-alpha-pll.c +6
-0+ ret =wait_for_pll_update (pll); +if (ret) +return ret; + +/* Wait 11or more PLL clk_ref ticks[to be explored more on wait] */ +
Is this a TODO?
drivers/clk/qcom/clk-alpha-pll.c void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, · line 387
Quoted 1 line
drivers/clk/qcom/clk-alpha-pll.c +1
-0+/* Poll LOCK_DET for one */
I think the code already says this so we can just drop this comment.
Quoted 10 lines
drivers/clk/qcom/clk-alpha-pll.c +7
-0+ ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + +return 0 ; +} +static int clk_alpha_pll_hwfsm_enable (struct clk_hw *hw) {int ret;
Re: [PATCH 1/7] clk: qcom: clk-alpha-pll: Add support for Stromer PLLs
In reply to Varadarajan NarayananHi, are you going to resubmit this patch? Looks like MDM9607 uses Stromer PLL for its CPU clocks and could benefit from it.
Konrad
Re: [PATCH 1/7] clk: qcom: clk-alpha-pll: Add support for Stromer PLLs
On Sat, Dec 26, 2020 at 01:51:28AM +0100, Konrad Dybcio wrote:
Konrad,
Quoted 3 lines
Hi, are you going to resubmit this patch? Looks like MDM9607 uses Stromer PLL for its CPU clocks and could benefit from it.
Yes. But will take some time since we are held up with additional activities.
Thanks
Varada
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 6/7] arm64: dts: Add ipq5018 SoC and MP03 board support
In reply to Varadarajan NarayananQuoted 172 lines · Varadarajan Narayanan
Add initial device tree support for the Qualcomm IPQ5018 SoC and MP03.1-C2 board.
Signed-off-by Varadarajan Narayanan <[email protected]>--- Documentation/devicetree/bindings/arm/qcom.yaml | 7 + arch/arm64/boot/dts/qcom/Makefile | 1 + arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts | 30 ++++ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 201 ++++++++++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts create mode 100644 arch/arm64/boot/dts/qcom/ipq5018.dtsiDocumentation/devicetree/bindings/arm/qcom.yaml +7
-0@@ -28,6 +28,7 @@ description: | apq8074 apq8084 apq8096 + ipq5018 ipq6018 ipq8074 mdm9615@@ -49,6 +50,7 @@ description: | hk01 idp liquid + mp03 mtp qrd sbc@@ -142,6 +144,11 @@ properties: - items: - enum: + - qcom,ipq5018-mp03 + - const: qcom,ipq5018 + + - items: + - enum: - qcom,ipq8064-ap148 - const: qcom,ipq8064arch/arm64/boot/dts/qcom/Makefile +1
-0@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_QCOM) += apq8096-db820c.dtb dtb-$(CONFIG_ARCH_QCOM) += apq8096-ifc6640.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq6018-cp01-c1.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq8074-hk01.dtb +dtb-$(CONFIG_ARCH_QCOM) += ipq5018-mp03.1-c2.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-longcheer-l8150.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a3u-eur.dtbarch/arm64/boot/dts/qcom/ipq5018-mp03.1-c2.dts new file +30
-0@@ -0,0 +1,30 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * IPQ5018 CP01 board device tree source + * + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + */ + +/dts-v1/; + +#include "ipq5018.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03-C2"; + compatible = "qcom,ipq5018-mp03", "qcom,ipq5018"; + + aliases { + serial0 = &blsp1_uart1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " swiotlb=1"; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_1_pins>; + pinctrl-names = "default"; + status = "ok"; +};arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +73
-0@@ -0,0 +1,201 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * IPQ5018 SoC device tree source + * + * Copyright (c) 2019, The Linux Foundation. All rights reserved. + */ + +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/clock/qcom,gcc-ipq5018.h> +#include <dt-bindings/reset/qcom,gcc-ipq5018.h> + +/ { + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&intc>; + + clocks { + sleep_clk: sleep-clk { + compatible = "fixed-clock"; + clock-frequency = <32000>; + #clock-cells = <0>; + }; + + xo: xo { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + #clock-cells = <0>; + }; + }; + + cpus: cpus { + #address-cells = <1>; + #size-cells = <0>; + + CPU0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + reg = <0x0>; + enable-method = "psci"; + next-level-cache = <&L2_0>; + }; + + CPU1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + enable-method = "psci"; + reg = <0x1>; + next-level-cache = <&L2_0>; + }; + + L2_0: l2-cache { + compatible = "cache"; + cache-level = <0x2>; + }; + }; + + pmuv8: pmu { + compatible = "arm,cortex-a53-pmu"; + interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) | + IRQ_TYPE_LEVEL_HIGH)>; + }; + + psci: psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + tz: tz@4ac00000 {
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 83
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+ reg = <0x0 0x4ac00000 0x0 0x00400000>; + no-map; + }; + }; + + soc: soc { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0xffffffff>; + dma-ranges;
You can't have an empty dma-ranges when the bus and the parent node has different #address/size-cells.
See 77e9c198b155 ("arm64: dts: qcom: clear the warnings caused by empty dma-ranges")
Quoted 41 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +41
-0+ compatible = "simple-bus"; + + tlmm: pinctrl@1000000 { + compatible = "qcom,ipq5018-pinctrl"; + reg = <0x01000000 0x300000>; + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&tlmm 0 80>; + interrupt-controller; + #interrupt-cells = <2>; + + serial_1_pins: serial1-pinmux { + pins = "gpio31", "gpio32", "gpio33", "gpio34"; + function = "blsp1_uart1"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + gcc: gcc@1800000 { + compatible = "qcom,gcc-ipq5018"; + reg = <0x01800000 0x80000>; + clocks = <&xo>, <&sleep_clk>; + clock-names = "xo", "sleep_clk"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + blsp1_uart1: serial@78af000 { + compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; + reg = <0x078af000 0x200>; + interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>, + <&gcc GCC_BLSP1_AHB_CLK>; + clock-names = "core", "iface"; + status = "disabled"; + }; + + intc: interrupt-controller@b000000 { + compatible = "qcom,msm-qgic2";
arch/arm64/boot/dts/qcom/ipq5018.dtsi line 134
Quoted 10 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +10
-0+ interrupt-controller; + #interrupt-cells = <0x3>; + reg = <0x0b000000 0x1000>, /*GICD*/ + <0x0b002000 0x1000>, /*GICC*/ + <0x0b001000 0x1000>, /*GICH*/ + <0x0b004000 0x1000>; /*GICV*/ + interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; + }; + + timer {
This isn't a mmio device, so move it outside /soc
Thanks,
Bjorn
Quoted 70 lines
arch/arm64/boot/dts/qcom/ipq5018.dtsi new file +67
-0+ compatible = "arm,armv8-timer"; + interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; + }; + + timer@b120000 { + #address-cells = <1>; + #size-cells = <1>; + ranges; + compatible = "arm,armv7-timer-mem"; + reg = <0x0b120000 0x1000>; + clock-frequency = <19200000>; + + frame@b120000 { + frame-number = <0>; + interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b121000 0x1000>, + <0x0b122000 0x1000>; + }; + + frame@b123000 { + frame-number = <1>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + reg = <0xb123000 0x1000>; + status = "disabled"; + }; + + frame@b124000 { + frame-number = <2>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b124000 0x1000>; + status = "disabled"; + }; + + frame@b125000 { + frame-number = <3>; + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b125000 0x1000>; + status = "disabled"; + }; + + frame@b126000 { + frame-number = <4>; + interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b126000 0x1000>; + status = "disabled"; + }; + + frame@b127000 { + frame-number = <5>; + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b127000 0x1000>; + status = "disabled"; + }; + + frame@b128000 { + frame-number = <6>; + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x0b128000 0x1000>; + status = "disabled"; + }; + }; + }; +};Signature · 1 line
2.7.4