clk: qcom: ipq8074: fix NSS core PLL-s
Subsystems (5)
PATCH v2 1/11 clk: qcom: ipq8074: fix NSS core PLL-s
Like in IPQ6018 the NSS related Alpha PLL-s require initial configuration to work.
So, obtain the regmap that is required for the Alpha PLL configuration and thus utilize the qcom_cc_really_probe() as we already have the regmap. Then utilize the Alpha PLL configs from the downstream QCA 5.4 based kernel to configure them.
This fixes the UBI32 and NSS crypto PLL-s failing to get enabled by the kernel.
--- drivers/clk/qcom/gcc-ipq8074.c | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
drivers/clk/qcom/gcc-ipq8074.c +38 -1
@@ -4371,6 +4371,33 @@ static struct clk_branch gcc_pcie0_axi_s_bridge_clk = { }, }; +static const struct alpha_pll_config ubi32_pll_config = { + .l =0x4e , + .config_ctl_val =0x200d4aa8 , + .config_ctl_hi_val =0x3c2 , + .main_output_mask =BIT (0 ), + .aux_output_mask =BIT (1 ), + .pre_div_val =0x0 , + .pre_div_mask =BIT (12 ), + .post_div_val =0x0 , + .post_div_mask =GENMASK (9 ,8 ), +}; + +static const struct alpha_pll_config nss_crypto_pll_config = { + .l =0x3e , + .alpha =0x0 , + .alpha_hi =0x80 , + .config_ctl_val =0x4001055b , + .main_output_mask =BIT (0 ), + .pre_div_val =0x0 , + .pre_div_mask =GENMASK (14 ,12 ), + .post_div_val =0x1 <<8 , + .post_div_mask =GENMASK (11 ,8 ), + .vco_mask =GENMASK (21 ,20 ), + .vco_val =0x0 , + .alpha_en_mask =BIT (24 ), +}; +static struct clk_hw *gcc_ipq8074_hws[] = { &gpll0_out_main_div2.hw, &gpll6_out_main_div2.hw,
@@ -4772,7 +4799,17 @@ static const struct qcom_cc_desc gcc_ipq8074_desc = {static int gcc_ipq8074_probe (struct platform_device *pdev) { -return qcom_cc_probe (pdev, &gcc_ipq8074_desc); +struct regmap *regmap; + + regmap =qcom_cc_map (pdev, &gcc_ipq8074_desc); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +clk_alpha_pll_configure (&ubi32_pll_main, regmap, &ubi32_pll_config); +clk_alpha_pll_configure (&nss_crypto_pll_main, regmap, + &nss_crypto_pll_config); + +return qcom_cc_really_probe (pdev, &gcc_ipq8074_desc, regmap); }static struct platform_driver gcc_ipq8074_driver = {
Signature · 1 line
2.35.1
PATCH v2 2/11 clk: qcom: ipq8074: SW workaround for UBI32 PLL lock
UBI32 Huayra PLL fails to lock in 5 us in some SoC silicon and thus it will cause the wait_for_pll() to timeout and thus return the error indicating that the PLL failed to lock.
This is bug in Huayra PLL HW for which SW workaround is to set bit 26 of TEST_CTL register.
This is ported from the QCA 5.4 based downstream kernel.
--- drivers/clk/qcom/gcc-ipq8074.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/clk/qcom/gcc-ipq8074.c +3 -0
@@ -4805,6 +4805,9 @@ static int gcc_ipq8074_probe(struct platform_device *pdev)if (IS_ERR (regmap))return PTR_ERR (regmap); +/* SW Workaround for UBI32 Huayra PLL */ +regmap_update_bits (regmap,0x2501c ,BIT (26 ),BIT (26 )); +clk_alpha_pll_configure (&ubi32_pll_main, regmap, &ubi32_pll_config);clk_alpha_pll_configure (&nss_crypto_pll_main, regmap, &nss_crypto_pll_config);
Signature · 1 line
2.35.1
PATCH v2 3/11 clk: qcom: ipq8074: fix NSS port frequency tables
In reply to Robert MarkoNSS port 5 and 6 frequency tables are currently broken and are causing a wide ranges of issue like 1G not working at all on port 6 or port 5 being clocked with 312 instead of 125 MHz as UNIPHY1 gets selected.
So, update the frequency tables with the ones from the downstream QCA 5.4 based kernel which has already fixed this.
--- drivers/clk/qcom/gcc-ipq8074.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/clk/qcom/gcc-ipq8074.c +8 -0
@@ -1788,8 +1788,10 @@ static struct clk_regmap_div nss_port4_tx_div_clk_src = {static const struct freq_tbl ftbl_nss_port5_rx_clk_src[] = {F (19200000 ,P_XO ,1 ,0 ,0 ),F (25000000 ,P_UNIPHY1_RX ,12.5 ,0 ,0 ), +F (25000000 ,P_UNIPHY0_RX ,5 ,0 ,0 ),F (78125000 ,P_UNIPHY1_RX ,4 ,0 ,0 ),F (125000000 ,P_UNIPHY1_RX ,2.5 ,0 ,0 ), +F (125000000 ,P_UNIPHY0_RX ,1 ,0 ,0 ),F (156250000 ,P_UNIPHY1_RX ,2 ,0 ,0 ),F (312500000 ,P_UNIPHY1_RX ,1 ,0 ,0 ), { }
@@ -1828,8 +1830,10 @@ static struct clk_regmap_div nss_port5_rx_div_clk_src = {static const struct freq_tbl ftbl_nss_port5_tx_clk_src[] = {F (19200000 ,P_XO ,1 ,0 ,0 ),F (25000000 ,P_UNIPHY1_TX ,12.5 ,0 ,0 ), +F (25000000 ,P_UNIPHY0_TX ,5 ,0 ,0 ),F (78125000 ,P_UNIPHY1_TX ,4 ,0 ,0 ),F (125000000 ,P_UNIPHY1_TX ,2.5 ,0 ,0 ), +F (125000000 ,P_UNIPHY0_TX ,1 ,0 ,0 ),F (156250000 ,P_UNIPHY1_TX ,2 ,0 ,0 ),F (312500000 ,P_UNIPHY1_TX ,1 ,0 ,0 ), { }
@@ -1867,8 +1871,10 @@ static struct clk_regmap_div nss_port5_tx_div_clk_src = {static const struct freq_tbl ftbl_nss_port6_rx_clk_src[] = {F (19200000 ,P_XO ,1 ,0 ,0 ), +F (25000000 ,P_UNIPHY2_RX ,5 ,0 ,0 ),F (25000000 ,P_UNIPHY2_RX ,12.5 ,0 ,0 ),F (78125000 ,P_UNIPHY2_RX ,4 ,0 ,0 ), +F (125000000 ,P_UNIPHY2_RX ,1 ,0 ,0 ),F (125000000 ,P_UNIPHY2_RX ,2.5 ,0 ,0 ),F (156250000 ,P_UNIPHY2_RX ,2 ,0 ,0 ),F (312500000 ,P_UNIPHY2_RX ,1 ,0 ,0 ),
@@ -1907,8 +1913,10 @@ static struct clk_regmap_div nss_port6_rx_div_clk_src = {static const struct freq_tbl ftbl_nss_port6_tx_clk_src[] = {F (19200000 ,P_XO ,1 ,0 ,0 ), +F (25000000 ,P_UNIPHY2_TX ,5 ,0 ,0 ),F (25000000 ,P_UNIPHY2_TX ,12.5 ,0 ,0 ),F (78125000 ,P_UNIPHY2_TX ,4 ,0 ,0 ), +F (125000000 ,P_UNIPHY2_TX ,1 ,0 ,0 ),F (125000000 ,P_UNIPHY2_TX ,2.5 ,0 ,0 ),F (156250000 ,P_UNIPHY2_TX ,2 ,0 ,0 ),F (312500000 ,P_UNIPHY2_TX ,1 ,0 ,0 ),
Signature · 1 line
2.35.1
PATCH v2 4/11 clk: qcom: ipq8074: add PPE crypto clock
In reply to Robert MarkoThe built-in PPE engine has a dedicated clock for the EIP-197 crypto engine.
So, since the required clock currently missing add support for it.
--- drivers/clk/qcom/gcc-ipq8074.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/clk/qcom/gcc-ipq8074.c +19 -0
@@ -3182,6 +3182,24 @@ static struct clk_branch gcc_nss_ptp_ref_clk = { }, }; +static struct clk_branch gcc_crypto_ppe_clk = { + .halt_reg =0x68310 , + .halt_bit =31 , + .clkr = { + .enable_reg =0x68310 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_crypto_ppe_clk" , + .parent_names = (const char *[]){ +"nss_ppe_clk_src" + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_nssnoc_ce_apb_clk = { .halt_reg =0x6830c , .clkr = {
@@ -4644,6 +4662,7 @@ static struct clk_regmap *gcc_ipq8074_clks[] = { [GCC_PCIE0_RCHNG_CLK_SRC] = &pcie0_rchng_clk_src.clkr, [GCC_PCIE0_RCHNG_CLK] = &gcc_pcie0_rchng_clk.clkr, [GCC_PCIE0_AXI_S_BRIDGE_CLK] = &gcc_pcie0_axi_s_bridge_clk.clkr, + [GCC_CRYPTO_PPE_CLK] = &gcc_crypto_ppe_clk.clkr, };static const struct qcom_reset_map gcc_ipq8074_resets[] = {
Signature · 1 line
2.35.1
kernel test robot
build botRe: [PATCH v2 04/11] clk: qcom: ipq8074: add PPE crypto clock
I love your patch! Yet something to improve:
Hi Robert,
I love your patch! Yet something to improve:
[auto build test ERROR on clk/clk-next]
[also build test ERROR on robh/for-next linus/master v5.18-rc5 next-20220506] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Robert-Marko/clk-qcom-ipq8074-fix-NSS-core-PLL-s/20220508-043100 base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220508/[email protected]/config) compiler: arceb-elf-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/5e068bcac126049b1674076f826b97e3c63ae636
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Robert-Marko/clk-qcom-ipq8074-fix-NSS-core-PLL-s/20220508-043100 git checkout 5e068bcac126049b1674076f826b97e3c63ae636
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Note: the linux-review/Robert-Marko/clk-qcom-ipq8074-fix-NSS-core-PLL-s/20220508-043100 HEAD 5022d9e2153ec876e88b3c4efa587e69642de0d0 builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
>> drivers/clk/qcom/gcc-ipq8074.c:4665:10: error: 'GCC_CRYPTO_PPE_CLK' undeclared here (not in a function); did you mean 'GCC_CRYPTO_AHB_CLK'?
4665 | [GCC_CRYPTO_PPE_CLK] = &gcc_crypto_ppe_clk.clkr,
| ^~~~~~~~~~~~~~~~~~
| GCC_CRYPTO_AHB_CLK
>> drivers/clk/qcom/gcc-ipq8074.c:4665:10: error: array index in initializer not of integer type
drivers/clk/qcom/gcc-ipq8074.c:4665:10: note: (near initialization for 'gcc_ipq8074_clks')
drivers/clk/qcom/gcc-ipq8074.c:4665:32: warning: initialized field overwritten [-Woverride-init]
4665 | [GCC_CRYPTO_PPE_CLK] = &gcc_crypto_ppe_clk.clkr,
| ^ drivers/clk/qcom/gcc-ipq8074.c:4665:32: note: (near initialization for 'gcc_ipq8074_clks[225]')
vim +4665 drivers/clk/qcom/gcc-ipq8074.c
4436
4437 static struct clk_regmap *gcc_ipq8074_clks[] = {
4438 [GPLL0_MAIN] = &gpll0_main.clkr,
4439 [GPLL0] = &gpll0.clkr,
4440 [GPLL2_MAIN] = &gpll2_main.clkr,
4441 [GPLL2] = &gpll2.clkr,
4442 [GPLL4_MAIN] = &gpll4_main.clkr,
4443 [GPLL4] = &gpll4.clkr,
4444 [GPLL6_MAIN] = &gpll6_main.clkr,
4445 [GPLL6] = &gpll6.clkr,
4446 [UBI32_PLL_MAIN] = &ubi32_pll_main.clkr,
4447 [UBI32_PLL] = &ubi32_pll.clkr,
4448 [NSS_CRYPTO_PLL_MAIN] = &nss_crypto_pll_main.clkr,
4449 [NSS_CRYPTO_PLL] = &nss_crypto_pll.clkr,
4450 [PCNOC_BFDCD_CLK_SRC] = &pcnoc_bfdcd_clk_src.clkr,
4451 [GCC_SLEEP_CLK_SRC] = &gcc_sleep_clk_src.clkr,
4452 [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
4453 [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
4454 [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
4455 [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
4456 [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
4457 [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
4458 [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
4459 [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
4460 [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
4461 [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
4462 [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
4463 [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
4464 [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
4465 [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
4466 [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr,
4467 [BLSP1_UART4_APPS_CLK_SRC] = &blsp1_uart4_apps_clk_src.clkr,
4468 [BLSP1_UART5_APPS_CLK_SRC] = &blsp1_uart5_apps_clk_src.clkr,
4469 [BLSP1_UART6_APPS_CLK_SRC] = &blsp1_uart6_apps_clk_src.clkr,
4470 [PCIE0_AXI_CLK_SRC] = &pcie0_axi_clk_src.clkr,
4471 [PCIE0_AUX_CLK_SRC] = &pcie0_aux_clk_src.clkr,
4472 [PCIE0_PIPE_CLK_SRC] = &pcie0_pipe_clk_src.clkr,
4473 [PCIE1_AXI_CLK_SRC] = &pcie1_axi_clk_src.clkr,
4474 [PCIE1_AUX_CLK_SRC] = &pcie1_aux_clk_src.clkr,
4475 [PCIE1_PIPE_CLK_SRC] = &pcie1_pipe_clk_src.clkr,
4476 [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr,
4477 [SDCC1_ICE_CORE_CLK_SRC] = &sdcc1_ice_core_clk_src.clkr,
4478 [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr,
4479 [USB0_MASTER_CLK_SRC] = &usb0_master_clk_src.clkr,
4480 [USB0_AUX_CLK_SRC] = &usb0_aux_clk_src.clkr,
4481 [USB0_MOCK_UTMI_CLK_SRC] = &usb0_mock_utmi_clk_src.clkr,
4482 [USB0_PIPE_CLK_SRC] = &usb0_pipe_clk_src.clkr,
4483 [USB1_MASTER_CLK_SRC] = &usb1_master_clk_src.clkr,
4484 [USB1_AUX_CLK_SRC] = &usb1_aux_clk_src.clkr,
4485 [USB1_MOCK_UTMI_CLK_SRC] = &usb1_mock_utmi_clk_src.clkr,
4486 [USB1_PIPE_CLK_SRC] = &usb1_pipe_clk_src.clkr,
4487 [GCC_XO_CLK_SRC] = &gcc_xo_clk_src.clkr,
4488 [SYSTEM_NOC_BFDCD_CLK_SRC] = &system_noc_bfdcd_clk_src.clkr,
4489 [NSS_CE_CLK_SRC] = &nss_ce_clk_src.clkr,
4490 [NSS_NOC_BFDCD_CLK_SRC] = &nss_noc_bfdcd_clk_src.clkr,
4491 [NSS_CRYPTO_CLK_SRC] = &nss_crypto_clk_src.clkr,
4492 [NSS_UBI0_CLK_SRC] = &nss_ubi0_clk_src.clkr,
4493 [NSS_UBI0_DIV_CLK_SRC] = &nss_ubi0_div_clk_src.clkr,
4494 [NSS_UBI1_CLK_SRC] = &nss_ubi1_clk_src.clkr,
4495 [NSS_UBI1_DIV_CLK_SRC] = &nss_ubi1_div_clk_src.clkr,
4496 [UBI_MPT_CLK_SRC] = &ubi_mpt_clk_src.clkr,
4497 [NSS_IMEM_CLK_SRC] = &nss_imem_clk_src.clkr,
4498 [NSS_PPE_CLK_SRC] = &nss_ppe_clk_src.clkr,
4499 [NSS_PORT1_RX_CLK_SRC] = &nss_port1_rx_clk_src.clkr,
4500 [NSS_PORT1_RX_DIV_CLK_SRC] = &nss_port1_rx_div_clk_src.clkr,
4501 [NSS_PORT1_TX_CLK_SRC] = &nss_port1_tx_clk_src.clkr,
4502 [NSS_PORT1_TX_DIV_CLK_SRC] = &nss_port1_tx_div_clk_src.clkr,
4503 [NSS_PORT2_RX_CLK_SRC] = &nss_port2_rx_clk_src.clkr,
4504 [NSS_PORT2_RX_DIV_CLK_SRC] = &nss_port2_rx_div_clk_src.clkr,
4505 [NSS_PORT2_TX_CLK_SRC] = &nss_port2_tx_clk_src.clkr,
4506 [NSS_PORT2_TX_DIV_CLK_SRC] = &nss_port2_tx_div_clk_src.clkr,
4507 [NSS_PORT3_RX_CLK_SRC] = &nss_port3_rx_clk_src.clkr,
4508 [NSS_PORT3_RX_DIV_CLK_SRC] = &nss_port3_rx_div_clk_src.clkr,
4509 [NSS_PORT3_TX_CLK_SRC] = &nss_port3_tx_clk_src.clkr,
4510 [NSS_PORT3_TX_DIV_CLK_SRC] = &nss_port3_tx_div_clk_src.clkr,
4511 [NSS_PORT4_RX_CLK_SRC] = &nss_port4_rx_clk_src.clkr,
4512 [NSS_PORT4_RX_DIV_CLK_SRC] = &nss_port4_rx_div_clk_src.clkr,
4513 [NSS_PORT4_TX_CLK_SRC] = &nss_port4_tx_clk_src.clkr,
4514 [NSS_PORT4_TX_DIV_CLK_SRC] = &nss_port4_tx_div_clk_src.clkr,
4515 [NSS_PORT5_RX_CLK_SRC] = &nss_port5_rx_clk_src.clkr,
4516 [NSS_PORT5_RX_DIV_CLK_SRC] = &nss_port5_rx_div_clk_src.clkr,
4517 [NSS_PORT5_TX_CLK_SRC] = &nss_port5_tx_clk_src.clkr,
4518 [NSS_PORT5_TX_DIV_CLK_SRC] = &nss_port5_tx_div_clk_src.clkr,
4519 [NSS_PORT6_RX_CLK_SRC] = &nss_port6_rx_clk_src.clkr,
4520 [NSS_PORT6_RX_DIV_CLK_SRC] = &nss_port6_rx_div_clk_src.clkr,
4521 [NSS_PORT6_TX_CLK_SRC] = &nss_port6_tx_clk_src.clkr,
4522 [NSS_PORT6_TX_DIV_CLK_SRC] = &nss_port6_tx_div_clk_src.clkr,
4523 [CRYPTO_CLK_SRC] = &crypto_clk_src.clkr,
4524 [GP1_CLK_SRC] = &gp1_clk_src.clkr,
4525 [GP2_CLK_SRC] = &gp2_clk_src.clkr,
4526 [GP3_CLK_SRC] = &gp3_clk_src.clkr,
4527 [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
4528 [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
4529 [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
4530 [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
4531 [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
4532 [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
4533 [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
4534 [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
4535 [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
4536 [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
4537 [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
4538 [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
4539 [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
4540 [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
4541 [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
4542 [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr,
4543 [GCC_BLSP1_UART4_APPS_CLK] = &gcc_blsp1_uart4_apps_clk.clkr,
4544 [GCC_BLSP1_UART5_APPS_CLK] = &gcc_blsp1_uart5_apps_clk.clkr,
4545 [GCC_BLSP1_UART6_APPS_CLK] = &gcc_blsp1_uart6_apps_clk.clkr,
4546 [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
4547 [GCC_QPIC_AHB_CLK] = &gcc_qpic_ahb_clk.clkr,
4548 [GCC_QPIC_CLK] = &gcc_qpic_clk.clkr,
4549 [GCC_PCIE0_AHB_CLK] = &gcc_pcie0_ahb_clk.clkr,
4550 [GCC_PCIE0_AUX_CLK] = &gcc_pcie0_aux_clk.clkr,
4551 [GCC_PCIE0_AXI_M_CLK] = &gcc_pcie0_axi_m_clk.clkr,
4552 [GCC_PCIE0_AXI_S_CLK] = &gcc_pcie0_axi_s_clk.clkr,
4553 [GCC_PCIE0_PIPE_CLK] = &gcc_pcie0_pipe_clk.clkr,
4554 [GCC_SYS_NOC_PCIE0_AXI_CLK] = &gcc_sys_noc_pcie0_axi_clk.clkr,
4555 [GCC_PCIE1_AHB_CLK] = &gcc_pcie1_ahb_clk.clkr,
4556 [GCC_PCIE1_AUX_CLK] = &gcc_pcie1_aux_clk.clkr,
4557 [GCC_PCIE1_AXI_M_CLK] = &gcc_pcie1_axi_m_clk.clkr,
4558 [GCC_PCIE1_AXI_S_CLK] = &gcc_pcie1_axi_s_clk.clkr,
4559 [GCC_PCIE1_PIPE_CLK] = &gcc_pcie1_pipe_clk.clkr,
4560 [GCC_SYS_NOC_PCIE1_AXI_CLK] = &gcc_sys_noc_pcie1_axi_clk.clkr,
4561 [GCC_USB0_AUX_CLK] = &gcc_usb0_aux_clk.clkr,
4562 [GCC_SYS_NOC_USB0_AXI_CLK] = &gcc_sys_noc_usb0_axi_clk.clkr,
4563 [GCC_USB0_MASTER_CLK] = &gcc_usb0_master_clk.clkr,
4564 [GCC_USB0_MOCK_UTMI_CLK] = &gcc_usb0_mock_utmi_clk.clkr,
4565 [GCC_USB0_PHY_CFG_AHB_CLK] = &gcc_usb0_phy_cfg_ahb_clk.clkr,
4566 [GCC_USB0_PIPE_CLK] = &gcc_usb0_pipe_clk.clkr,
4567 [GCC_USB0_SLEEP_CLK] = &gcc_usb0_sleep_clk.clkr,
4568 [GCC_USB1_AUX_CLK] = &gcc_usb1_aux_clk.clkr,
4569 [GCC_SYS_NOC_USB1_AXI_CLK] = &gcc_sys_noc_usb1_axi_clk.clkr,
4570 [GCC_USB1_MASTER_CLK] = &gcc_usb1_master_clk.clkr,
4571 [GCC_USB1_MOCK_UTMI_CLK] = &gcc_usb1_mock_utmi_clk.clkr,
4572 [GCC_USB1_PHY_CFG_AHB_CLK] = &gcc_usb1_phy_cfg_ahb_clk.clkr,
4573 [GCC_USB1_PIPE_CLK] = &gcc_usb1_pipe_clk.clkr,
4574 [GCC_USB1_SLEEP_CLK] = &gcc_usb1_sleep_clk.clkr,
4575 [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
4576 [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr,
4577 [GCC_SDCC1_ICE_CORE_CLK] = &gcc_sdcc1_ice_core_clk.clkr,
4578 [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
4579 [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
4580 [GCC_MEM_NOC_NSS_AXI_CLK] = &gcc_mem_noc_nss_axi_clk.clkr,
4581 [GCC_NSS_CE_APB_CLK] = &gcc_nss_ce_apb_clk.clkr,
4582 [GCC_NSS_CE_AXI_CLK] = &gcc_nss_ce_axi_clk.clkr,
4583 [GCC_NSS_CFG_CLK] = &gcc_nss_cfg_clk.clkr,
4584 [GCC_NSS_CRYPTO_CLK] = &gcc_nss_crypto_clk.clkr,
4585 [GCC_NSS_CSR_CLK] = &gcc_nss_csr_clk.clkr,
4586 [GCC_NSS_EDMA_CFG_CLK] = &gcc_nss_edma_cfg_clk.clkr,
4587 [GCC_NSS_EDMA_CLK] = &gcc_nss_edma_clk.clkr,
4588 [GCC_NSS_IMEM_CLK] = &gcc_nss_imem_clk.clkr,
4589 [GCC_NSS_NOC_CLK] = &gcc_nss_noc_clk.clkr,
4590 [GCC_NSS_PPE_BTQ_CLK] = &gcc_nss_ppe_btq_clk.clkr,
4591 [GCC_NSS_PPE_CFG_CLK] = &gcc_nss_ppe_cfg_clk.clkr,
4592 [GCC_NSS_PPE_CLK] = &gcc_nss_ppe_clk.clkr,
4593 [GCC_NSS_PPE_IPE_CLK] = &gcc_nss_ppe_ipe_clk.clkr,
4594 [GCC_NSS_PTP_REF_CLK] = &gcc_nss_ptp_ref_clk.clkr,
4595 [GCC_NSSNOC_CE_APB_CLK] = &gcc_nssnoc_ce_apb_clk.clkr,
4596 [GCC_NSSNOC_CE_AXI_CLK] = &gcc_nssnoc_ce_axi_clk.clkr,
4597 [GCC_NSSNOC_CRYPTO_CLK] = &gcc_nssnoc_crypto_clk.clkr,
4598 [GCC_NSSNOC_PPE_CFG_CLK] = &gcc_nssnoc_ppe_cfg_clk.clkr,
4599 [GCC_NSSNOC_PPE_CLK] = &gcc_nssnoc_ppe_clk.clkr,
4600 [GCC_NSSNOC_QOSGEN_REF_CLK] = &gcc_nssnoc_qosgen_ref_clk.clkr,
4601 [GCC_NSSNOC_SNOC_CLK] = &gcc_nssnoc_snoc_clk.clkr,
4602 [GCC_NSSNOC_TIMEOUT_REF_CLK] = &gcc_nssnoc_timeout_ref_clk.clkr,
4603 [GCC_NSSNOC_UBI0_AHB_CLK] = &gcc_nssnoc_ubi0_ahb_clk.clkr,
4604 [GCC_NSSNOC_UBI1_AHB_CLK] = &gcc_nssnoc_ubi1_ahb_clk.clkr,
4605 [GCC_UBI0_AHB_CLK] = &gcc_ubi0_ahb_clk.clkr,
4606 [GCC_UBI0_AXI_CLK] = &gcc_ubi0_axi_clk.clkr,
4607 [GCC_UBI0_NC_AXI_CLK] = &gcc_ubi0_nc_axi_clk.clkr,
4608 [GCC_UBI0_CORE_CLK] = &gcc_ubi0_core_clk.clkr,
4609 [GCC_UBI0_MPT_CLK] = &gcc_ubi0_mpt_clk.clkr,
4610 [GCC_UBI1_AHB_CLK] = &gcc_ubi1_ahb_clk.clkr,
4611 [GCC_UBI1_AXI_CLK] = &gcc_ubi1_axi_clk.clkr,
4612 [GCC_UBI1_NC_AXI_CLK] = &gcc_ubi1_nc_axi_clk.clkr,
4613 [GCC_UBI1_CORE_CLK] = &gcc_ubi1_core_clk.clkr,
4614 [GCC_UBI1_MPT_CLK] = &gcc_ubi1_mpt_clk.clkr,
4615 [GCC_CMN_12GPLL_AHB_CLK] = &gcc_cmn_12gpll_ahb_clk.clkr,
4616 [GCC_CMN_12GPLL_SYS_CLK] = &gcc_cmn_12gpll_sys_clk.clkr,
4617 [GCC_MDIO_AHB_CLK] = &gcc_mdio_ahb_clk.clkr,
4618 [GCC_UNIPHY0_AHB_CLK] = &gcc_uniphy0_ahb_clk.clkr,
4619 [GCC_UNIPHY0_SYS_CLK] = &gcc_uniphy0_sys_clk.clkr,
4620 [GCC_UNIPHY1_AHB_CLK] = &gcc_uniphy1_ahb_clk.clkr,
4621 [GCC_UNIPHY1_SYS_CLK] = &gcc_uniphy1_sys_clk.clkr,
4622 [GCC_UNIPHY2_AHB_CLK] = &gcc_uniphy2_ahb_clk.clkr,
4623 [GCC_UNIPHY2_SYS_CLK] = &gcc_uniphy2_sys_clk.clkr,
4624 [GCC_NSS_PORT1_RX_CLK] = &gcc_nss_port1_rx_clk.clkr,
4625 [GCC_NSS_PORT1_TX_CLK] = &gcc_nss_port1_tx_clk.clkr,
4626 [GCC_NSS_PORT2_RX_CLK] = &gcc_nss_port2_rx_clk.clkr,
4627 [GCC_NSS_PORT2_TX_CLK] = &gcc_nss_port2_tx_clk.clkr,
4628 [GCC_NSS_PORT3_RX_CLK] = &gcc_nss_port3_rx_clk.clkr,
4629 [GCC_NSS_PORT3_TX_CLK] = &gcc_nss_port3_tx_clk.clkr,
4630 [GCC_NSS_PORT4_RX_CLK] = &gcc_nss_port4_rx_clk.clkr,
4631 [GCC_NSS_PORT4_TX_CLK] = &gcc_nss_port4_tx_clk.clkr,
4632 [GCC_NSS_PORT5_RX_CLK] = &gcc_nss_port5_rx_clk.clkr,
4633 [GCC_NSS_PORT5_TX_CLK] = &gcc_nss_port5_tx_clk.clkr,
4634 [GCC_NSS_PORT6_RX_CLK] = &gcc_nss_port6_rx_clk.clkr,
4635 [GCC_NSS_PORT6_TX_CLK] = &gcc_nss_port6_tx_clk.clkr,
4636 [GCC_PORT1_MAC_CLK] = &gcc_port1_mac_clk.clkr,
4637 [GCC_PORT2_MAC_CLK] = &gcc_port2_mac_clk.clkr,
4638 [GCC_PORT3_MAC_CLK] = &gcc_port3_mac_clk.clkr,
4639 [GCC_PORT4_MAC_CLK] = &gcc_port4_mac_clk.clkr,
4640 [GCC_PORT5_MAC_CLK] = &gcc_port5_mac_clk.clkr,
4641 [GCC_PORT6_MAC_CLK] = &gcc_port6_mac_clk.clkr,
4642 [GCC_UNIPHY0_PORT1_RX_CLK] = &gcc_uniphy0_port1_rx_clk.clkr,
4643 [GCC_UNIPHY0_PORT1_TX_CLK] = &gcc_uniphy0_port1_tx_clk.clkr,
4644 [GCC_UNIPHY0_PORT2_RX_CLK] = &gcc_uniphy0_port2_rx_clk.clkr,
4645 [GCC_UNIPHY0_PORT2_TX_CLK] = &gcc_uniphy0_port2_tx_clk.clkr,
4646 [GCC_UNIPHY0_PORT3_RX_CLK] = &gcc_uniphy0_port3_rx_clk.clkr,
4647 [GCC_UNIPHY0_PORT3_TX_CLK] = &gcc_uniphy0_port3_tx_clk.clkr,
4648 [GCC_UNIPHY0_PORT4_RX_CLK] = &gcc_uniphy0_port4_rx_clk.clkr,
4649 [GCC_UNIPHY0_PORT4_TX_CLK] = &gcc_uniphy0_port4_tx_clk.clkr,
4650 [GCC_UNIPHY0_PORT5_RX_CLK] = &gcc_uniphy0_port5_rx_clk.clkr,
4651 [GCC_UNIPHY0_PORT5_TX_CLK] = &gcc_uniphy0_port5_tx_clk.clkr,
4652 [GCC_UNIPHY1_PORT5_RX_CLK] = &gcc_uniphy1_port5_rx_clk.clkr,
4653 [GCC_UNIPHY1_PORT5_TX_CLK] = &gcc_uniphy1_port5_tx_clk.clkr,
4654 [GCC_UNIPHY2_PORT6_RX_CLK] = &gcc_uniphy2_port6_rx_clk.clkr,
4655 [GCC_UNIPHY2_PORT6_TX_CLK] = &gcc_uniphy2_port6_tx_clk.clkr,
4656 [GCC_CRYPTO_AHB_CLK] = &gcc_crypto_ahb_clk.clkr,
4657 [GCC_CRYPTO_AXI_CLK] = &gcc_crypto_axi_clk.clkr,
4658 [GCC_CRYPTO_CLK] = &gcc_crypto_clk.clkr,
4659 [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
4660 [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
4661 [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
4662 [GCC_PCIE0_RCHNG_CLK_SRC] = &pcie0_rchng_clk_src.clkr,
4663 [GCC_PCIE0_RCHNG_CLK] = &gcc_pcie0_rchng_clk.clkr,
4664 [GCC_PCIE0_AXI_S_BRIDGE_CLK] = &gcc_pcie0_axi_s_bridge_clk.clkr,
> 4665 [GCC_CRYPTO_PPE_CLK] = &gcc_crypto_ppe_clk.clkr,
4666 };
4667
Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
PATCH v2 5/11 dt-bindings: clock: qcom: ipq8074: add PPE crypto clock
In reply to Robert MarkoAdd binding for the PPE crypto clock in IPQ8074.
--- include/dt-bindings/clock/qcom,gcc-ipq8074.h | 1 + 1 file changed, 1 insertion(+)
include/dt-bindings/clock/qcom,gcc-ipq8074.h +1 -0
@@ -233,6 +233,7 @@#define GCC_PCIE0_AXI_S_BRIDGE_CLK 224#define GCC_PCIE0_RCHNG_CLK_SRC 225#define GCC_PCIE0_RCHNG_CLK 226 +#define GCC_CRYPTO_PPE_CLK 227#define GCC_BLSP1_BCR 0#define GCC_BLSP1_QUP1_BCR 1
Signature · 1 line
2.35.1
PATCH v2 6/11 clk: qcom: ipq8074: set BRANCH_HALT_DELAY flag for UBI clocks
In reply to Robert MarkoCurrently, attempting to enable the UBI clocks will cause the stuck at off warning to be printed and clk_enable will fail.
[ 14.936694] gcc_ubi1_ahb_clk status stuck at 'off'
Downstream 5.4 QCA kernel has fixed this by seting the BRANCH_HALT_DELAY flag on UBI clocks, so lets do the same.
--- drivers/clk/qcom/gcc-ipq8074.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/clk/qcom/gcc-ipq8074.c +10 -0
@@ -3372,6 +3372,7 @@ static struct clk_branch gcc_nssnoc_ubi1_ahb_clk = {static struct clk_branch gcc_ubi0_ahb_clk = { .halt_reg =0x6820c , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x6820c , .enable_mask =BIT (0 ),
@@ -3389,6 +3390,7 @@ static struct clk_branch gcc_ubi0_ahb_clk = {static struct clk_branch gcc_ubi0_axi_clk = { .halt_reg =0x68200 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68200 , .enable_mask =BIT (0 ),
@@ -3406,6 +3408,7 @@ static struct clk_branch gcc_ubi0_axi_clk = {static struct clk_branch gcc_ubi0_nc_axi_clk = { .halt_reg =0x68204 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68204 , .enable_mask =BIT (0 ),
@@ -3423,6 +3426,7 @@ static struct clk_branch gcc_ubi0_nc_axi_clk = {static struct clk_branch gcc_ubi0_core_clk = { .halt_reg =0x68210 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68210 , .enable_mask =BIT (0 ),
@@ -3440,6 +3444,7 @@ static struct clk_branch gcc_ubi0_core_clk = {static struct clk_branch gcc_ubi0_mpt_clk = { .halt_reg =0x68208 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68208 , .enable_mask =BIT (0 ),
@@ -3457,6 +3462,7 @@ static struct clk_branch gcc_ubi0_mpt_clk = {static struct clk_branch gcc_ubi1_ahb_clk = { .halt_reg =0x6822c , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x6822c , .enable_mask =BIT (0 ),
@@ -3474,6 +3480,7 @@ static struct clk_branch gcc_ubi1_ahb_clk = {static struct clk_branch gcc_ubi1_axi_clk = { .halt_reg =0x68220 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68220 , .enable_mask =BIT (0 ),
@@ -3491,6 +3498,7 @@ static struct clk_branch gcc_ubi1_axi_clk = {static struct clk_branch gcc_ubi1_nc_axi_clk = { .halt_reg =0x68224 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68224 , .enable_mask =BIT (0 ),
@@ -3508,6 +3516,7 @@ static struct clk_branch gcc_ubi1_nc_axi_clk = {static struct clk_branch gcc_ubi1_core_clk = { .halt_reg =0x68230 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68230 , .enable_mask =BIT (0 ),
@@ -3525,6 +3534,7 @@ static struct clk_branch gcc_ubi1_core_clk = {static struct clk_branch gcc_ubi1_mpt_clk = { .halt_reg =0x68228 , + .halt_check =BRANCH_HALT_DELAY , .clkr = { .enable_reg =0x68228 , .enable_mask =BIT (0 ),
Signature · 1 line
2.35.1
PATCH v2 7/11 dt-bindings: clocks: qcom,gcc-ipq8074: support power domains
In reply to Robert MarkoGCC inside of IPQ8074 also provides power management via built-in GDSCs. In order to do so, '#power-domain-cells' must be set to 1.
--- .../devicetree/bindings/clock/qcom,gcc-ipq8074.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml +5 -0
@@ -27,6 +27,9 @@ properties: '#reset-cells': const: 1 + '#power-domain-cells': + const: 1 + reg: maxItems: 1
@@ -39,6 +42,7 @@ required: - reg - '#clock-cells' - '#reset-cells' + - '#power-domain-cells' additionalProperties: false
@@ -49,5 +53,6 @@ examples: reg = <0x01800000 0x80000>; #clock-cells = <1>; #reset-cells = <1>; + #power-domain-cells = <1>; }; ...
Signature · 1 line
2.35.1
Re: [PATCH v2 07/11] dt-bindings: clocks: qcom,gcc-ipq8074: support power domains
Quoted 13 lines · Robert Marko
GCC inside of IPQ8074 also provides power management via built-in GDSCs. In order to do so, '#power-domain-cells' must be set to 1.
Signed-off-by Robert Marko <[email protected]>--- .../devicetree/bindings/clock/qcom,gcc-ipq8074.yaml | 5 +++++ 1 file changed, 5 insertions(+)Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml +0
-0
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml properties: · line 30
Quoted 4 lines
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml +1
-0@@ -27,6 +27,9 @@ properties: '#reset-cells': const: 1 + '#power-domain-cells':
Put it in some order, e.g. before reset-cells.
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml required: · line 45
Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml +3
-0+ const: 1 + reg: maxItems: 1@@ -39,6 +42,7 @@ required: - reg - '#clock-cells' - '#reset-cells' + - '#power-domain-cells'
The same.
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml examples: · line 56
Quoted 8 lines
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml +1
-0additionalProperties: false@@ -49,5 +53,6 @@ examples: reg = <0x01800000 0x80000>; #clock-cells = <1>; #reset-cells = <1>; + #power-domain-cells = <1>;
The same.
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml examples: · line 57
Quoted 2 lines
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml +0
-0};
Best regards,
Krzysztof
PATCH v2 8/11 dt-bindings: clock: qcom: ipq8074: add USB GDSCs
In reply to Robert MarkoAdd bindings for the USB GDSCs found in IPQ8074 GCC.
--- include/dt-bindings/clock/qcom,gcc-ipq8074.h | 3 +++ 1 file changed, 3 insertions(+)
include/dt-bindings/clock/qcom,gcc-ipq8074.h +3 -0
@@ -368,4 +368,7 @@#define GCC_PCIE1_AXI_MASTER_STICKY_ARES 130#define GCC_PCIE0_AXI_SLAVE_STICKY_ARES 131 +#define USB0_GDSC 0 +#define USB1_GDSC 1 +#endif
Signature · 1 line
2.35.1
Re: [PATCH v2 08/11] dt-bindings: clock: qcom: ipq8074: add USB GDSCs
Quoted 7 lines · Robert Marko
Add bindings for the USB GDSCs found in IPQ8074 GCC.
Signed-off-by Robert Marko <[email protected]>--- include/dt-bindings/clock/qcom,gcc-ipq8074.h | 3 +++ 1 file changed, 3 insertions(+)
Best regards,
Krzysztof
PATCH v2 9/11 clk: qcom: ipq8074: add USB GDSCs
In reply to Robert MarkoAdd GDSC-s for each of the two USB controllers built-in the IPQ8074.
---
Changes in v2:
* Use proper GSDCs instead of raw regmap writes.
--- drivers/clk/qcom/Kconfig | 1 + drivers/clk/qcom/gcc-ipq8074.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+)
drivers/clk/qcom/Kconfig +1 -0
@@ -166,6 +166,7 @@ config IPQ_LCC_806X config IPQ_GCC_8074 tristate "IPQ8074 Global Clock Controller" + select QCOM_GDSC help Support for global clock controller on ipq8074 devices. Say Y if you want to use peripheral devices such as UART, SPI,
drivers/clk/qcom/gcc-ipq8074.c +24 -0
@@ -22,6 +22,7 @@#include "clk-alpha-pll.h" #include "clk-regmap-divider.h" #include "clk-regmap-mux.h" +#include "gdsc.h" #include "reset.h" enum {
@@ -4407,6 +4408,22 @@ static struct clk_branch gcc_pcie0_axi_s_bridge_clk = { }, }; +static struct gdsc usb0_gdsc = { + .gdscr =0x3e078 , + .pd = { + .name ="usb0_gdsc" , + }, + .pwrsts =PWRSTS_OFF_ON , +}; + +static struct gdsc usb1_gdsc = { + .gdscr =0x3f078 , + .pd = { + .name ="usb1_gdsc" , + }, + .pwrsts =PWRSTS_OFF_ON , +}; +static const struct alpha_pll_config ubi32_pll_config = { .l =0x4e , .config_ctl_val =0x200d4aa8 ,
@@ -4810,6 +4827,11 @@ static const struct qcom_reset_map gcc_ipq8074_resets[] = { [GCC_PCIE1_AXI_MASTER_STICKY_ARES] = { 0x76040, 6 }, }; +static struct gdsc *gcc_ipq8074_gdscs[] = { + [USB0_GDSC ] = &usb0_gdsc, + [USB1_GDSC ] = &usb1_gdsc, +}; +static const struct of_device_id gcc_ipq8074_match_table[] = { { .compatible ="qcom,gcc-ipq8074" }, { }
@@ -4832,6 +4854,8 @@ static const struct qcom_cc_desc gcc_ipq8074_desc = { .num_resets = ARRAY_SIZE(gcc_ipq8074_resets), .clk_hws = gcc_ipq8074_hws, .num_clk_hws = ARRAY_SIZE(gcc_ipq8074_hws), + .gdscs = gcc_ipq8074_gdscs, + .num_gdscs = ARRAY_SIZE(gcc_ipq8074_gdscs), };static int gcc_ipq8074_probe (struct platform_device *pdev)
Signature · 1 line
2.35.1
PATCH v2 10/11 clk: qcom: ipq8074: dont disable gcc_sleep_clk_src
In reply to Robert MarkoOnce the usb sleep clocks are disabled, clock framework is trying to disable the sleep clock source also.
However, it seems that it cannot be disabled and trying to do so produces:
[ 245.436390] ------------[ cut here ]------------ [ 245.441233] gcc_sleep_clk_src status stuck at 'on' [ 245.441254] WARNING: CPU: 2 PID: 223 at clk_branch_wait+0x130/0x140 [ 245.450435] Modules linked in: xhci_plat_hcd xhci_hcd dwc3 dwc3_qcom leds_gpio [ 245.456601] CPU: 2 PID: 223 Comm: sh Not tainted 5.18.0-rc4 #215 [ 245.463889] Hardware name: Xiaomi AX9000 (DT) [ 245.470050] pstate: 204000c5 (nzCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 245.474307] pc : clk_branch_wait+0x130/0x140 [ 245.481073] lr : clk_branch_wait+0x130/0x140 [ 245.485588] sp : ffffffc009f2bad0 [ 245.489838] x29: ffffffc009f2bad0 x28: ffffff8003e6c800 x27: 0000000000000000 [ 245.493057] x26: 0000000000000000 x25: 0000000000000000 x24: ffffff800226ef20 [ 245.500175] x23: ffffffc0089ff550 x22: 0000000000000000 x21: ffffffc008476ad0 [ 245.507294] x20: 0000000000000000 x19: ffffffc00965ac70 x18: fffffffffffc51a7 [ 245.514413] x17: 68702e3030303837 x16: 3a6d726f6674616c x15: ffffffc089f2b777 [ 245.521531] x14: ffffffc0095c9d18 x13: 0000000000000129 x12: 0000000000000129 [ 245.528649] x11: 00000000ffffffea x10: ffffffc009621d18 x9 : 0000000000000001 [ 245.535767] x8 : 0000000000000001 x7 : 0000000000017fe8 x6 : 0000000000000001 [ 245.542885] x5 : ffffff803fdca6d8 x4 : 0000000000000000 x3 : 0000000000000027 [ 245.550002] x2 : 0000000000000027 x1 : 0000000000000023 x0 : 0000000000000026 [ 245.557122] Call trace: [ 245.564229] clk_branch_wait+0x130/0x140 [ 245.566490] clk_branch2_disable+0x2c/0x40 [ 245.570656] clk_core_disable+0x60/0xb0 [ 245.574561] clk_core_disable+0x68/0xb0 [ 245.578293] clk_disable+0x30/0x50 [ 245.582113] dwc3_qcom_remove+0x60/0xc0 [dwc3_qcom] [ 245.585588] platform_remove+0x28/0x60 [ 245.590361] device_remove+0x4c/0x80 [ 245.594179] device_release_driver_internal+0x1dc/0x230 [ 245.597914] device_driver_detach+0x18/0x30 [ 245.602861] unbind_store+0xec/0x110 [ 245.607027] drv_attr_store+0x24/0x40 [ 245.610847] sysfs_kf_write+0x44/0x60 [ 245.614405] kernfs_fop_write_iter+0x128/0x1c0 [ 245.618052] new_sync_write+0xc0/0x130 [ 245.622391] vfs_write+0x1d4/0x2a0 [ 245.626123] ksys_write+0x58/0xe0 [ 245.629508] __arm64_sys_write+0x1c/0x30 [ 245.632895] invoke_syscall.constprop.0+0x5c/0x110 [ 245.636890] do_el0_svc+0xa0/0x150 [ 245.641488] el0_svc+0x18/0x60 [ 245.644872] el0t_64_sync_handler+0xa4/0x130 [ 245.647914] el0t_64_sync+0x174/0x178 [ 245.652340] ---[ end trace 0000000000000000 ]---
So, add CLK_IS_CRITICAL flag to the clock so that the kernel won't try to disable the sleep clock.
--- drivers/clk/qcom/gcc-ipq8074.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/qcom/gcc-ipq8074.c +1 -0
@@ -663,6 +663,7 @@ static struct clk_branch gcc_sleep_clk_src = { }, .num_parents = 1, .ops = &clk_branch2_ops, + .flags = CLK_IS_CRITICAL, }, }, };
Signature · 1 line
2.35.1
PATCH v2 11/11 arm64: dts: ipq8074: add USB power domains
In reply to Robert MarkoAdd USB power domains provided by GCC GDSCs. Add the required #power-domain-cells to the GCC as well.
--- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/ipq8074.dtsi +5 -0
@@ -383,6 +383,7 @@ gcc: gcc@1800000 { reg = <0x01800000 0x80000>; #clock-cells = <0x1>; #reset-cells = <0x1>; + #power-domain-cells = <1>; }; tcsr_mutex: hwlock@1905000 {
@@ -610,6 +611,8 @@ usb_0: usb@8af8800 { <133330000>, <19200000>; + power-domains = <&gcc USB0_GDSC>; + resets = <&gcc GCC_USB0_BCR>; status = "disabled";
@@ -650,6 +653,8 @@ usb_1: usb@8cf8800 { <133330000>, <19200000>; + power-domains = <&gcc USB1_GDSC>; + resets = <&gcc GCC_USB1_BCR>; status = "disabled";
Signature · 1 line
2.35.1