mbox series

[V7,0/7] Add minimal boot support for IPQ9574

Message ID 20230206103337.21000-1-quic_devipriy@quicinc.com (mailing list archive)
Headers show
Series Add minimal boot support for IPQ9574 | expand

Message

Devi Priya Feb. 6, 2023, 10:33 a.m. UTC
The IPQ9574 is Qualcomm's 802.11ax SoC for Routers,
Gateways and Access Points

This series adds minimal board boot support for ipq9574-al02-c7 board

V6 can be found at: https://lore.kernel.org/linux-arm-kernel/20230202150619.22425-1-quic_devipriy@quicinc.com/

Change log is added to the respective patches

Devi Priya (7):
  dt-bindings: clock: Add ipq9574 clock and reset definitions
  clk: qcom: Add Global Clock Controller driver for IPQ9574
  dt-bindings: pinctrl: qcom: Add support for IPQ9574
  pinctrl: qcom: Add IPQ9574 pinctrl driver
  dt-bindings: arm: qcom: Add ipq9574 compatible
  arm64: dts: qcom: Add ipq9574 SoC and AL02 board support
  arm64: defconfig: Enable IPQ9574 SoC base configs

 .../devicetree/bindings/arm/qcom.yaml         |    7 +
 .../bindings/clock/qcom,ipq9574-gcc.yaml      |   72 +
 .../bindings/pinctrl/qcom,ipq9574-tlmm.yaml   |  130 +
 arch/arm64/boot/dts/qcom/Makefile             |    1 +
 arch/arm64/boot/dts/qcom/ipq9574-al02-c7.dts  |   84 +
 arch/arm64/boot/dts/qcom/ipq9574.dtsi         |  278 ++
 arch/arm64/configs/defconfig                  |    2 +
 drivers/clk/qcom/Kconfig                      |    8 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/gcc-ipq9574.c                | 4295 +++++++++++++++++
 drivers/pinctrl/qcom/Kconfig                  |   11 +
 drivers/pinctrl/qcom/Makefile                 |    1 +
 drivers/pinctrl/qcom/pinctrl-ipq9574.c        |  828 ++++
 include/dt-bindings/clock/qcom,ipq9574-gcc.h  |  213 +
 include/dt-bindings/reset/qcom,ipq9574-gcc.h  |  164 +
 15 files changed, 6095 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,ipq9574-gcc.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq9574-tlmm.yaml
 create mode 100644 arch/arm64/boot/dts/qcom/ipq9574-al02-c7.dts
 create mode 100644 arch/arm64/boot/dts/qcom/ipq9574.dtsi
 create mode 100644 drivers/clk/qcom/gcc-ipq9574.c
 create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq9574.c
 create mode 100644 include/dt-bindings/clock/qcom,ipq9574-gcc.h
 create mode 100644 include/dt-bindings/reset/qcom,ipq9574-gcc.h


base-commit: 129af770823407ee115a56c69a04b440fd2fbe61

Comments

Dmitry Baryshkov Feb. 6, 2023, 2:07 p.m. UTC | #1
On 06/02/2023 12:33, Devi Priya wrote:
> Add Global Clock Controller (GCC) driver for ipq9574 based devices
> 
> Co-developed-by: Anusha Rao <quic_anusha@quicinc.com>
> Signed-off-by: Anusha Rao <quic_anusha@quicinc.com>
> Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
> ---
>   Changes in V7:
> 	- Used qcom_cc_probe instead of qcom_cc_really_probe in
> 	  gcc_ipq9574_probe
> 
>   drivers/clk/qcom/Kconfig       |    8 +
>   drivers/clk/qcom/Makefile      |    1 +
>   drivers/clk/qcom/gcc-ipq9574.c | 4295 ++++++++++++++++++++++++++++++++
>   3 files changed, 4304 insertions(+)
>   create mode 100644 drivers/clk/qcom/gcc-ipq9574.c
> 
> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
> index 5ab4b7dfe3c2..a9f01d67a500 100644
> --- a/drivers/clk/qcom/Kconfig
> +++ b/drivers/clk/qcom/Kconfig
> @@ -173,6 +173,14 @@ config IPQ_GCC_8074
>   	  i2c, USB, SD/eMMC, etc. Select this for the root clock
>   	  of ipq8074.
>   
> +config IPQ_GCC_9574
> +	tristate "IPQ9574 Global Clock Controller"
> +	help
> +	  Support for global clock controller on ipq9574 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 ipq9574.
> +
>   config MSM_GCC_8660
>   	tristate "MSM8660 Global Clock Controller"
>   	help
> diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
> index 3194465dd02c..51e6e5eb187b 100644
> --- a/drivers/clk/qcom/Makefile
> +++ b/drivers/clk/qcom/Makefile
> @@ -27,6 +27,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_9574) += gcc-ipq9574.o
>   obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o
>   obj-$(CONFIG_MDM_GCC_9607) += gcc-mdm9607.o
>   obj-$(CONFIG_MDM_GCC_9615) += gcc-mdm9615.o
> diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c
> new file mode 100644
> index 000000000000..718106a9ac7b
> --- /dev/null
> +++ b/drivers/clk/qcom/gcc-ipq9574.c

[skipped]

> +static struct clk_branch gcc_snoc_pcie3_2lane_s_clk = {
> +	.halt_reg = 0x2e054,
> +	.clkr = {
> +		.enable_reg = 0x2e054,
> +		.enable_mask = BIT(0),
> +		.hw.init = &(struct clk_init_data) {
> +			.name = "gcc_snoc_pcie3_2lane_s_clk",
> +			.parent_hws = (const struct clk_hw *[]) {
> +				&pcie3_axi_s_clk_src.clkr.hw
> +			},
> +			.num_parents = 1,
> +			.flags = CLK_SET_RATE_PARENT,
> +			.ops = &clk_branch2_ops,
> +		},
> +	},
> +};
> +
> +static struct clk_regmap_mux pcie0_pipe_clk_src = {
> +	.reg = 0x28064,
> +	.shift = 8,
> +	.width = 2,
> +	.parent_map = gcc_pcie30_phy0_pipe_clk_xo_map,
> +	.clkr = {
> +		.hw.init = &(struct clk_init_data) {
> +			.name = "pcie0_pipe_clk_src",
> +			.parent_data = gcc_pcie30_phy0_pipe_clk_xo,
> +			.num_parents = ARRAY_SIZE(gcc_pcie30_phy0_pipe_clk_xo),
> +			.flags = CLK_SET_RATE_PARENT,
> +			.ops = &clk_regmap_mux_closest_ops,


clk_regmap_phy_mux_ops ?

> +		},
> +	},
> +};
> +
> +static struct clk_regmap_mux pcie1_pipe_clk_src = {
> +	.reg = 0x29064,
> +	.shift = 8,
> +	.width = 2,
> +	.parent_map = gcc_pcie30_phy1_pipe_clk_xo_map,
> +	.clkr = {
> +		.hw.init = &(struct clk_init_data) {
> +			.name = "pcie1_pipe_clk_src",
> +			.parent_data = gcc_pcie30_phy1_pipe_clk_xo,
> +			.num_parents = ARRAY_SIZE(gcc_pcie30_phy1_pipe_clk_xo),
> +			.flags = CLK_SET_RATE_PARENT,
> +			.ops = &clk_regmap_mux_closest_ops,
> +		},
> +	},
> +};
> +
> +static struct clk_regmap_mux pcie2_pipe_clk_src = {
> +	.reg = 0x2a064,
> +	.shift = 8,
> +	.width = 2,
> +	.parent_map = gcc_pcie30_phy2_pipe_clk_xo_map,
> +	.clkr = {
> +		.hw.init = &(struct clk_init_data) {
> +			.name = "pcie2_pipe_clk_src",
> +			.parent_data = gcc_pcie30_phy2_pipe_clk_xo,
> +			.num_parents = ARRAY_SIZE(gcc_pcie30_phy2_pipe_clk_xo),
> +			.flags = CLK_SET_RATE_PARENT,
> +			.ops = &clk_regmap_mux_closest_ops,

clk_regmap_phy_mux_ops ?


> +		},
> +	},
> +};
> +
> +static struct clk_regmap_mux pcie3_pipe_clk_src = {
> +	.reg = 0x2b064,
> +	.shift = 8,
> +	.width = 2,
> +	.parent_map = gcc_pcie30_phy3_pipe_clk_xo_map,
> +	.clkr = {
> +		.hw.init = &(struct clk_init_data) {
> +			.name = "pcie3_pipe_clk_src",
> +			.parent_data = gcc_pcie30_phy3_pipe_clk_xo,
> +			.num_parents = ARRAY_SIZE(gcc_pcie30_phy3_pipe_clk_xo),
> +			.flags = CLK_SET_RATE_PARENT,
> +			.ops = &clk_regmap_mux_closest_ops,

clk_regmap_phy_mux_ops ?

> +		},
> +	},
> +};
Devi Priya Feb. 8, 2023, 9:40 a.m. UTC | #2
Thanks for taking time to review the patch!

On 2/6/2023 7:37 PM, Dmitry Baryshkov wrote:
> On 06/02/2023 12:33, Devi Priya wrote:
>> Add Global Clock Controller (GCC) driver for ipq9574 based devices
>>
>> Co-developed-by: Anusha Rao <quic_anusha@quicinc.com>
>> Signed-off-by: Anusha Rao <quic_anusha@quicinc.com>
>> Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
>> ---
>>   Changes in V7:
>>     - Used qcom_cc_probe instead of qcom_cc_really_probe in
>>       gcc_ipq9574_probe
>>
>>   drivers/clk/qcom/Kconfig       |    8 +
>>   drivers/clk/qcom/Makefile      |    1 +
>>   drivers/clk/qcom/gcc-ipq9574.c | 4295 ++++++++++++++++++++++++++++++++
>>   3 files changed, 4304 insertions(+)
>>   create mode 100644 drivers/clk/qcom/gcc-ipq9574.c
>>
>> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
>> index 5ab4b7dfe3c2..a9f01d67a500 100644
>> --- a/drivers/clk/qcom/Kconfig
>> +++ b/drivers/clk/qcom/Kconfig
>> @@ -173,6 +173,14 @@ config IPQ_GCC_8074
>>         i2c, USB, SD/eMMC, etc. Select this for the root clock
>>         of ipq8074.
>> +config IPQ_GCC_9574
>> +    tristate "IPQ9574 Global Clock Controller"
>> +    help
>> +      Support for global clock controller on ipq9574 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 ipq9574.
>> +
>>   config MSM_GCC_8660
>>       tristate "MSM8660 Global Clock Controller"
>>       help
>> diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
>> index 3194465dd02c..51e6e5eb187b 100644
>> --- a/drivers/clk/qcom/Makefile
>> +++ b/drivers/clk/qcom/Makefile
>> @@ -27,6 +27,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_9574) += gcc-ipq9574.o
>>   obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o
>>   obj-$(CONFIG_MDM_GCC_9607) += gcc-mdm9607.o
>>   obj-$(CONFIG_MDM_GCC_9615) += gcc-mdm9615.o
>> diff --git a/drivers/clk/qcom/gcc-ipq9574.c 
>> b/drivers/clk/qcom/gcc-ipq9574.c
>> new file mode 100644
>> index 000000000000..718106a9ac7b
>> --- /dev/null
>> +++ b/drivers/clk/qcom/gcc-ipq9574.c
> 
> [skipped]
> 
>> +static struct clk_branch gcc_snoc_pcie3_2lane_s_clk = {
>> +    .halt_reg = 0x2e054,
>> +    .clkr = {
>> +        .enable_reg = 0x2e054,
>> +        .enable_mask = BIT(0),
>> +        .hw.init = &(struct clk_init_data) {
>> +            .name = "gcc_snoc_pcie3_2lane_s_clk",
>> +            .parent_hws = (const struct clk_hw *[]) {
>> +                &pcie3_axi_s_clk_src.clkr.hw
>> +            },
>> +            .num_parents = 1,
>> +            .flags = CLK_SET_RATE_PARENT,
>> +            .ops = &clk_branch2_ops,
>> +        },
>> +    },
>> +};
>> +
>> +static struct clk_regmap_mux pcie0_pipe_clk_src = {
>> +    .reg = 0x28064,
>> +    .shift = 8,
>> +    .width = 2,
>> +    .parent_map = gcc_pcie30_phy0_pipe_clk_xo_map,
>> +    .clkr = {
>> +        .hw.init = &(struct clk_init_data) {
>> +            .name = "pcie0_pipe_clk_src",
>> +            .parent_data = gcc_pcie30_phy0_pipe_clk_xo,
>> +            .num_parents = ARRAY_SIZE(gcc_pcie30_phy0_pipe_clk_xo),
>> +            .flags = CLK_SET_RATE_PARENT,
>> +            .ops = &clk_regmap_mux_closest_ops,
> 
> 
> clk_regmap_phy_mux_ops ?
Okay, will update the ops and struct accordingly in the next series
> 
>> +        },
>> +    },
>> +};
>> +
>> +static struct clk_regmap_mux pcie1_pipe_clk_src = {
>> +    .reg = 0x29064,
>> +    .shift = 8,
>> +    .width = 2,
>> +    .parent_map = gcc_pcie30_phy1_pipe_clk_xo_map,
>> +    .clkr = {
>> +        .hw.init = &(struct clk_init_data) {
>> +            .name = "pcie1_pipe_clk_src",
>> +            .parent_data = gcc_pcie30_phy1_pipe_clk_xo,
>> +            .num_parents = ARRAY_SIZE(gcc_pcie30_phy1_pipe_clk_xo),
>> +            .flags = CLK_SET_RATE_PARENT,
>> +            .ops = &clk_regmap_mux_closest_ops,
>> +        },
>> +    },
>> +};
>> +
>> +static struct clk_regmap_mux pcie2_pipe_clk_src = {
>> +    .reg = 0x2a064,
>> +    .shift = 8,
>> +    .width = 2,
>> +    .parent_map = gcc_pcie30_phy2_pipe_clk_xo_map,
>> +    .clkr = {
>> +        .hw.init = &(struct clk_init_data) {
>> +            .name = "pcie2_pipe_clk_src",
>> +            .parent_data = gcc_pcie30_phy2_pipe_clk_xo,
>> +            .num_parents = ARRAY_SIZE(gcc_pcie30_phy2_pipe_clk_xo),
>> +            .flags = CLK_SET_RATE_PARENT,
>> +            .ops = &clk_regmap_mux_closest_ops,
> 
> clk_regmap_phy_mux_ops ?
Okay
> 
> 
>> +        },
>> +    },
>> +};
>> +
>> +static struct clk_regmap_mux pcie3_pipe_clk_src = {
>> +    .reg = 0x2b064,
>> +    .shift = 8,
>> +    .width = 2,
>> +    .parent_map = gcc_pcie30_phy3_pipe_clk_xo_map,
>> +    .clkr = {
>> +        .hw.init = &(struct clk_init_data) {
>> +            .name = "pcie3_pipe_clk_src",
>> +            .parent_data = gcc_pcie30_phy3_pipe_clk_xo,
>> +            .num_parents = ARRAY_SIZE(gcc_pcie30_phy3_pipe_clk_xo),
>> +            .flags = CLK_SET_RATE_PARENT,
>> +            .ops = &clk_regmap_mux_closest_ops,
> 
> clk_regmap_phy_mux_ops ?
Okay
> 
>> +        },
>> +    },
>> +};
> 
Best Regards,
Devi Priya