clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
Subsystems (5)
v3 cover clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
This patchset is an initial one in the series created in the framework of my Baikal-T1 PCIe/eDMA-related work:
[1: In-progress v3] clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
[2: In-progress v1] PCI: dwc: Various fixes and cleanups
[3: In-progress v1] PCI: dwc: Add dma-ranges/YAML-schema/Baikal-T1 support
[4: In-progress v1] dmaengine: dw-edma: Add RP/EP local DMA controllers support
Since some of the patches in the later patchsets depend on the modifications introduced here, @Lorenzo could you please merge this series through your PCIe subsystem repo? After getting all the required ack'es of course.
Short summary regarding this patchset. A few more modifications are introduced here to finally finish the Baikal-T1 CCU unit support up and prepare the code before adding the Baikal-T1 PCIe/xGMAC support. First of all it turned out I specified wrong DW xGMAC PTP reference clock divider in my initial patches. It must be 8, not 10. Secondly I was wrong to add a joint xGMAC Ref and PTP clock instead of having them separately defined. The SoC manual describes these clocks as separate fixed clock wrappers. Finally in order to close the SoC clock/reset support up we need to add the DDR and PCIe interfaces reset controls support. It's done in two steps. First I've moved the reset-controls-related code into a dedicated module. Then the DDR/PCIe reset-control functionality is added.
Changelog v2:
- Resubmit the series with adding @Philipp to the list of the recipients.
Changelog v3:
- Rebased from v5.17 onto v5.18-rc3.
- No comments. Just resend the series.
Serge Semin (4):
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
clk: baikal-t1: Move reset-controls code into a dedicated module
clk: baikal-t1: Add DDR/PCIe directly controlled resets support
drivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-div.c | 1 + drivers/clk/baikal-t1/ccu-div.h | 6 + drivers/clk/baikal-t1/ccu-rst.c | 373 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 64 +++++ drivers/clk/baikal-t1/clk-ccu-div.c | 102 ++------ include/dt-bindings/reset/bt1-ccu.h | 9 + 8 files changed, 482 insertions(+), 86 deletions(-) create mode 100644 drivers/clk/baikal-t1/ccu-rst.c create mode 100644 drivers/clk/baikal-t1/ccu-rst.h
Signature · 1 line
2.35.1
PATCH v3 1/4 clk: baikal-t1: Fix invalid xGMAC PTP clock divider
Most likely due to copy-paste mistake the divider has been set to 10 while according to the SoC reference manual it's supposed to be 8 thus having PTP clock frequency of 156.25 MHz.
--- drivers/clk/baikal-t1/clk-ccu-div.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/baikal-t1/clk-ccu-div.c +1 -1
@@ -207,7 +207,7 @@ static const struct ccu_div_info sys_info[] = {CCU_DIV_GATE_INFO (CCU_SYS_XGMAC_REF_CLK ,"sys_xgmac_ref_clk" ,"eth_clk" ,CCU_SYS_XGMAC_BASE ,8 ),CCU_DIV_FIXED_INFO (CCU_SYS_XGMAC_PTP_CLK ,"sys_xgmac_ptp_clk" , -"eth_clk" ,10 ), +"eth_clk" ,8 ),CCU_DIV_GATE_INFO (CCU_SYS_USB_CLK ,"sys_usb_clk" ,"eth_clk" ,CCU_SYS_USB_BASE ,10 ), CCU_DIV_VAR_INFO(CCU_SYS_PVT_CLK, "sys_pvt_clk",
Signature · 1 line
2.35.1
PATCH v3 2/4 clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
In reply to Serge SeminBaikal-T1 CCU reference manual says that both xGMAC reference and xGMAC PTP clocks are generated by two different wrappers with the same constant divider thus each producing a 156.25 MHz signal. But for some reason both of these clock sources are gated by a single switch-flag in the CCU registers space - CCU_SYS_XGMAC_BASE.BIT(0). In order to make the clocks handled independently we need to define a shared parental gate so the base clock signal would be switched off only if both of the child-clocks are disabled.
--- drivers/clk/baikal-t1/ccu-div.c | 1 + drivers/clk/baikal-t1/ccu-div.h | 6 ++++++ drivers/clk/baikal-t1/clk-ccu-div.c | 8 +++++--- 3 files changed, 12 insertions(+), 3 deletions(-)
drivers/clk/baikal-t1/ccu-div.c +1 -0
@@ -579,6 +579,7 @@ struct ccu_div *ccu_div_hw_register(const struct ccu_div_init_data *div_init) goto err_free_div; } parent_data.fw_name = div_init->parent_name; + parent_data.name = div_init->parent_name; hw_init.parent_data = &parent_data; hw_init.num_parents =1 ;
drivers/clk/baikal-t1/ccu-div.h +6 -0
@@ -13,6 +13,12 @@#include <linux/bits.h> #include <linux/of.h> +/* +* CCU Divider private clock IDs +* @CCU_SYS_INT_CLK: Internal CCU system clock +*/ +#define CCU_SYS_INT_CLK -1 +/* * CCU Divider private flags * @CCU_DIV_SKIP_ONE: Due to some reason divider can't be set to 1.
drivers/clk/baikal-t1/clk-ccu-div.c +5 -3
@@ -204,10 +204,12 @@ static const struct ccu_div_info sys_info[] = { "eth_clk", CCU_SYS_GMAC1_BASE, 5),CCU_DIV_FIXED_INFO (CCU_SYS_GMAC1_PTP_CLK ,"sys_gmac1_ptp_clk" ,"eth_clk" ,10 ), -CCU_DIV_GATE_INFO (CCU_SYS_XGMAC_REF_CLK ,"sys_xgmac_ref_clk" , -"eth_clk" ,CCU_SYS_XGMAC_BASE ,8 ), +CCU_DIV_GATE_INFO (CCU_SYS_INT_CLK ,"sys_xgmac_clk" , +"eth_clk" ,CCU_SYS_XGMAC_BASE ,1 ), +CCU_DIV_FIXED_INFO (CCU_SYS_XGMAC_REF_CLK ,"sys_xgmac_ref_clk" , +"sys_xgmac_clk" ,8 ),CCU_DIV_FIXED_INFO (CCU_SYS_XGMAC_PTP_CLK ,"sys_xgmac_ptp_clk" , -"eth_clk" ,8 ), +"sys_xgmac_clk" ,8 ),CCU_DIV_GATE_INFO (CCU_SYS_USB_CLK ,"sys_usb_clk" ,"eth_clk" ,CCU_SYS_USB_BASE ,10 ), CCU_DIV_VAR_INFO(CCU_SYS_PVT_CLK, "sys_pvt_clk",
Signature · 1 line
2.35.1
PATCH v3 3/4 clk: baikal-t1: Move reset-controls code into a dedicated module
In reply to Serge SeminBefore adding the directly controlled resets support it's reasonable to move the existing resets control functionality into a dedicated object for the sake of the CCU dividers clock driver simplification. After the new functionality is added clk-ccu-div.c would have got to a mixture of the weakly dependent clocks and resets methods. Splitting the methods up into the two objects will make code easier to read especially seeing it isn't that hard to do.
As before the CCU reset module will support the trigger-like CCU resets only, which are responsible for the AXI-bus, APB-bus and SATA-ref blocks reset. The assert/de-assert-capable reset controls support will be added in the next commit.
--- drivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-rst.c | 258 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 60 +++++++ drivers/clk/baikal-t1/clk-ccu-div.c | 94 ++-------- 5 files changed, 342 insertions(+), 83 deletions(-) create mode 100644 drivers/clk/baikal-t1/ccu-rst.c create mode 100644 drivers/clk/baikal-t1/ccu-rst.h
drivers/clk/baikal-t1/Kconfig +11 -1
@@ -29,7 +29,6 @@ config CLK_BT1_CCU_PLL config CLK_BT1_CCU_DIV bool "Baikal-T1 CCU Dividers support" - select RESET_CONTROLLER select MFD_SYSCON default MIPS_BAIKAL_T1 help
@@ -39,4 +38,15 @@ config CLK_BT1_CCU_DIV either gateable or ungateable. Some of the CCU dividers can be as well used to reset the domains they're supplying clock to. +config CLK_BT1_CCU_RST + bool "Baikal-T1 CCU Resets support" + select RESET_CONTROLLER + select MFD_SYSCON + default MIPS_BAIKAL_T1 + help + Enable this to support the CCU reset blocks responsible for the + AXI-bus and some subsystems reset. These are mainly the trigger-based + reset controls but there are several lines which can be directly + asserted/de-asserted (PCIe and DDR sub-domains). + endif
drivers/clk/baikal-t1/Makefile +1 -0
@@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_CLK_BT1_CCU_PLL) += ccu-pll.o clk-ccu-pll.o obj-$(CONFIG_CLK_BT1_CCU_DIV) += ccu-div.o clk-ccu-div.o +obj-$(CONFIG_CLK_BT1_CCU_RST) += ccu-rst.o
drivers/clk/baikal-t1/ccu-rst.c new file +258 -0
258 lines not on this page · raw message
drivers/clk/baikal-t1/ccu-rst.h new file +60 -0
60 lines not on this page · raw message
drivers/clk/baikal-t1/clk-ccu-div.c +12 -82
159 lines not on this page · raw message
Signature · 1 line
2.35.1
Stephen Boyd
maintainerRe: [PATCH v3 3/4] clk: baikal-t1: Move reset-controls code into a dedicated module
Quoting Serge Semin (2022-05-03 13:57:21)
Quoted 13 lines
Before adding the directly controlled resets support it's reasonable to move the existing resets control functionality into a dedicated object for the sake of the CCU dividers clock driver simplification. After the new functionality is added
clk-ccu-div.cwould have got to a mixture of the weakly dependent clocks and resets methods. Splitting the methods up into the two objects will make code easier to read especially seeing it isn't that hard to do.As before the CCU reset module will support the trigger-like CCU resets only, which are responsible for the AXI-bus, APB-bus and SATA-ref blocks reset. The assert/de-assert-capable reset controls support will be added in the next commit.
Quoted 7 lines
Signed-off-by Serge Semin <[email protected]>--- drivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-rst.c | 258 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 60 +++++++ drivers/clk/baikal-t1/clk-ccu-div.c | 94 ++--------
Perhaps this should be done via the auxiliary bus by having the clk driver register the reset driver and have some private API to pass any data to the reset driver? Then the whole file could be in drivers/reset/, reviewed and maintained by the reset maintainer.
Re: [PATCH v3 3/4] clk: baikal-t1: Move reset-controls code into a dedicated module
Quoted 23 lines · Stephen Boyd
Quoting Serge Semin (2022-05-03 13:57:21)
Quoted 13 lines
Before adding the directly controlled resets support it's reasonable to move the existing resets control functionality into a dedicated object for the sake of the CCU dividers clock driver simplification. After the new functionality is added
clk-ccu-div.cwould have got to a mixture of the weakly dependent clocks and resets methods. Splitting the methods up into the two objects will make code easier to read especially seeing it isn't that hard to do.As before the CCU reset module will support the trigger-like CCU resets only, which are responsible for the AXI-bus, APB-bus and SATA-ref blocks reset. The assert/de-assert-capable reset controls support will be added in the next commit.
Quoted 7 lines
Signed-off-by Serge Semin <[email protected]>--- drivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-rst.c | 258 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 60 +++++++ drivers/clk/baikal-t1/clk-ccu-div.c | 94 ++--------
Quoted 4 lines
Perhaps this should be done via the auxiliary bus by having the clk driver register the reset driver and have some private API to pass any data to the reset driver? Then the whole file could be in
drivers/reset/, reviewed and maintained by the reset maintainer.
I'd rather stick to the current design in the same way as the most of the OF-based platform clock drivers. Completely splitting the reset and clock parts isn't that easy is it seems like (though the main part has been done in the framework of this patchset). AXI/APB-interface reset controls are tightly coupled with the AXI/APB-clock domains at least by having the same CSRs. Due to that the corresponding AXI-clock domains reset functionality will need to be left in the drivers/clk/baikal-t1/clk-ccu* module. It makes the movement isn't that justified and will result in needless code complications and the code coherency worsening.
-Sergey
PATCH v3 4/4 clk: baikal-t1: Add DDR/PCIe directly controlled resets support
In reply to Serge SeminAside with a set of the trigger-like resets Baikal-T1 CCU provides two additional blocks with directly controlled reset signals. In particular it concerns DDR full and initial resets and various PCIe sub-domains resets. Let's add the direct reset assertion/de-assertion of the corresponding flags support into the Baikal-T1 CCU driver then. It will be required at least for the PCIe platform driver. Obviously the DDR controller isn't supposed to be fully reset in the kernel, so the corresponding controls are added just for the sake of the interface implementation completeness.
--- drivers/clk/baikal-t1/ccu-rst.c | 117 +++++++++++++++++++++++++++- drivers/clk/baikal-t1/ccu-rst.h | 4 + include/dt-bindings/reset/bt1-ccu.h | 9 +++ 3 files changed, 129 insertions(+), 1 deletion(-)
drivers/clk/baikal-t1/ccu-rst.c +116 -1
@@ -25,17 +25,33 @@#include "ccu-div.h" #include "ccu-rst.h" +#define CCU_SYS_DDR_BASE 0x02c +#define CCU_SYS_PCIE_BASE 0x144 +#define CCU_RST_MAP (_rst_id, _clk_id) \ { \ .rst_id = _rst_id, \ .clk_id = _clk_id, \ } +#define CCU_RST_DIR (_rst_id, _base, _ofs) \ + { \ + .rst_id = _rst_id, \ + .base = _base, \ + .ofs = _ofs \ + } +struct ccu_rst_map {unsigned int rst_id;unsigned int clk_id; }; +struct ccu_rst_dir { +unsigned int rst_id; +unsigned int base; +unsigned int ofs; +}; +struct ccu_rst_data {struct device_node *np;struct regmap *sys_regs;
@@ -46,6 +62,9 @@ struct ccu_rst_data {unsigned int rsts_map_num;const struct ccu_rst_map *rsts_map; +unsigned int rsts_dir_num; +const struct ccu_rst_dir *rsts_dir; +unsigned int divs_num;struct ccu_div **divs;
@@ -81,6 +100,23 @@ static const struct ccu_rst_map sys_rst_map[] = { CCU_RST_MAP(CCU_SYS_APB_RST, CCU_SYS_APB_CLK), }; +/* +* DDR and PCIe sub-domains can be reset with directly controlled reset +* signals. I wouldn't suggest to reset the DDR controller though at least +* while the Linux kernel is working. +*/ +static const struct ccu_rst_dir sys_rst_dir[] = { +CCU_RST_DIR (CCU_SYS_DDR_FULL_RST ,CCU_SYS_DDR_BASE ,1 ), +CCU_RST_DIR (CCU_SYS_DDR_INIT_RST ,CCU_SYS_DDR_BASE ,2 ), +CCU_RST_DIR (CCU_SYS_PCIE_PCS_PHY_RST ,CCU_SYS_PCIE_BASE ,0 ), +CCU_RST_DIR (CCU_SYS_PCIE_PIPE0_RST ,CCU_SYS_PCIE_BASE ,4 ), +CCU_RST_DIR (CCU_SYS_PCIE_CORE_RST ,CCU_SYS_PCIE_BASE ,8 ), +CCU_RST_DIR (CCU_SYS_PCIE_PWR_RST ,CCU_SYS_PCIE_BASE ,9 ), +CCU_RST_DIR (CCU_SYS_PCIE_STICKY_RST ,CCU_SYS_PCIE_BASE ,10 ), +CCU_RST_DIR (CCU_SYS_PCIE_NSTICKY_RST ,CCU_SYS_PCIE_BASE ,11 ), +CCU_RST_DIR (CCU_SYS_PCIE_HOT_RST ,CCU_SYS_PCIE_BASE ,12 ), +}; +static int ccu_rst_reset (struct reset_controller_dev *rcdev,unsigned long idx) {
@@ -92,12 +128,81 @@ static int ccu_rst_reset(struct reset_controller_dev *rcdev,return -EINVAL ; } +/* +* No CCU divider descriptor means having directly handled reset control, +* which is mapped into the CCU Divider registers. +*/ rst = &data->rsts[idx]; +if (!rst->div) +return -EOPNOTSUPP ; +return ccu_div_reset_domain (rst->div); } +static int ccu_rst_set (struct ccu_rst_data *data, +unsigned long idx,bool high) +{ +struct ccu_rst *rst; + +if (idx >= data->rsts_num) { +pr_err ("Invalid reset ID %lu specified\n" , idx); +return -EINVAL ; + } + +/* +* Having CCU divider descriptor means trigger-like reset control so +* direct assertion/de-assertion is unsupported. +*/ + rst = &data->rsts[idx]; +if (rst->div) +return high ? -EOPNOTSUPP :0 ; + +return regmap_update_bits (data->sys_regs, rst->reg_ctl, + rst->mask, high ? rst->mask :0 ); +} + +static int ccu_rst_assert (struct reset_controller_dev *rcdev, +unsigned long idx) +{ +struct ccu_rst_data *data =to_ccu_rst_data (rcdev); + +return ccu_rst_set (data, idx, true); +} + +static int ccu_rst_deassert (struct reset_controller_dev *rcdev, +unsigned long idx) +{ +struct ccu_rst_data *data =to_ccu_rst_data (rcdev); + +return ccu_rst_set (data, idx, false); +} + +static int ccu_rst_status (struct reset_controller_dev *rcdev, +unsigned long idx) +{ +struct ccu_rst_data *data =to_ccu_rst_data (rcdev); +struct ccu_rst *rst; +u32 val; + +if (idx >= data->rsts_num) { +pr_err ("Invalid reset ID %lu specified\n" , idx); +return -EINVAL ; + } + + rst = &data->rsts[idx]; +if (rst->div) +return -EOPNOTSUPP ; + +regmap_read (data->sys_regs, rst->reg_ctl, &val); + +return !!(val & rst->mask); +} +static const struct reset_control_ops ccu_rst_ops = { .reset = ccu_rst_reset, + .assert = ccu_rst_assert, + .deassert = ccu_rst_deassert, + .status = ccu_rst_status, }; static int ccu_rst_of_idx_get(struct reset_controller_dev *rcdev,
@@ -153,6 +258,8 @@ static struct ccu_rst_data *ccu_rst_create_data(const struct ccu_rst_init_data * }else if (of_device_is_compatible (data->np,"baikal,bt1-ccu-sys" )) { data->rsts_map_num =ARRAY_SIZE (sys_rst_map); data->rsts_map = sys_rst_map; + data->rsts_dir_num =ARRAY_SIZE (sys_rst_dir); + data->rsts_dir = sys_rst_dir; }else {pr_err ("Incompatible DT node '%s' specified\n" ,of_node_full_name (data->np));
@@ -160,7 +267,7 @@ static struct ccu_rst_data *ccu_rst_create_data(const struct ccu_rst_init_data * goto err_kfree_data; } - data->rsts_num = data->rsts_map_num; + data->rsts_num = data->rsts_map_num + data->rsts_dir_num; data->rsts =kcalloc (data->rsts_num,sizeof (*data->rsts),GFP_KERNEL );if (!data->rsts) { ret = -ENOMEM ;
@@ -198,6 +305,14 @@ static int ccu_rst_init_desc(struct ccu_rst_data *data) } } +for (idx =0 ; idx < data->rsts_dir_num; ++idx, ++rst) { +const struct ccu_rst_dir *dir = &data->rsts_dir[idx]; + + rst->id = dir->rst_id; + rst->reg_ctl = dir->base; + rst->mask =BIT (dir->ofs); + } +return 0 ; }
drivers/clk/baikal-t1/ccu-rst.h +4 -0
@@ -33,10 +33,14 @@ struct ccu_rst_init_data {* struct ccu_div - CCU Reset descriptor * @id: Reset identifier. * @div: Pointer to the CCU Divider descriptor (can be NULL). +* @reg_ctl: reset control register base address. +* @mask: reset flag within the control register. */ struct ccu_rst {unsigned int id;struct ccu_div *div; +unsigned int reg_ctl; +unsigned int mask; };#ifdef CONFIG_CLK_BT1_CCU_RST
include/dt-bindings/reset/bt1-ccu.h +9 -0
@@ -21,5 +21,14 @@#define CCU_SYS_SATA_REF_RST 0#define CCU_SYS_APB_RST 1 +#define CCU_SYS_DDR_FULL_RST 2 +#define CCU_SYS_DDR_INIT_RST 3 +#define CCU_SYS_PCIE_PCS_PHY_RST 4 +#define CCU_SYS_PCIE_PIPE0_RST 5 +#define CCU_SYS_PCIE_CORE_RST 6 +#define CCU_SYS_PCIE_PWR_RST 7 +#define CCU_SYS_PCIE_STICKY_RST 8 +#define CCU_SYS_PCIE_NSTICKY_RST 9 +#define CCU_SYS_PCIE_HOT_RST 10#endif /* __DT_BINDINGS_RESET_BT1_CCU_H */
Signature · 1 line
2.35.1
Quoted 29 lines · Serge Semin
This patchset is an initial one in the series created in the framework of my Baikal-T1 PCIe/eDMA-related work:
[1: In-progress v3] clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
[2: In-progress v1] PCI: dwc: Various fixes and cleanups
[3: In-progress v1] PCI: dwc: Add dma-ranges/YAML-schema/Baikal-T1 support
[4: In-progress v1] dmaengine: dw-edma: Add RP/EP local DMA controllers support
Since some of the patches in the later patchsets depend on the modifications introduced here, @Lorenzo could you please merge this series through your PCIe subsystem repo? After getting all the required ack'es of course.
Short summary regarding this patchset. A few more modifications are introduced here to finally finish the Baikal-T1 CCU unit support up and prepare the code before adding the Baikal-T1 PCIe/xGMAC support. First of all it turned out I specified wrong DW xGMAC PTP reference clock divider in my initial patches. It must be 8, not 10. Secondly I was wrong to add a joint xGMAC Ref and PTP clock instead of having them separately defined. The SoC manual describes these clocks as separate fixed clock wrappers. Finally in order to close the SoC clock/reset support up we need to add the DDR and PCIe interfaces reset controls support. It's done in two steps. First I've moved the reset-controls-related code into a dedicated module. Then the DDR/PCIe reset-control functionality is added.
Quoted 8 lines
Changelog v2:
- Resubmit the series with adding @Philipp to the list of the recipients.Changelog v3:
- Rebased from v5.17 onto v5.18-rc3.
- No comments. Just resend the series.
No comments for more than a week. There were no comments in v1 and v2 either. Please at least ack or merge in the series. It would be very appreciated to merge it in through one repo with the rest of the patchsets before the next merge window. @Bjorn, @Lorenzo, @Michael?
-Sergey
Quoted 34 lines
Signed-off-by Serge Semin <[email protected]>Cc Alexey Malahov <[email protected]>Cc Pavel Parkhomenko <[email protected]>Cc Rob Herring <[email protected]>Cc "Krzysztof Wilczyński" <[email protected]>Cc Bjorn Helgaas <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Serge Semin (4):
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
clk: baikal-t1: Move reset-controls code into a dedicated module
clk: baikal-t1: Add DDR/PCIe directly controlled resets supportdrivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-div.c | 1 + drivers/clk/baikal-t1/ccu-div.h | 6 + drivers/clk/baikal-t1/ccu-rst.c | 373 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 64 +++++ drivers/clk/baikal-t1/clk-ccu-div.c | 102 ++------ include/dt-bindings/reset/bt1-ccu.h | 9 + 8 files changed, 482 insertions(+), 86 deletions(-) create mode 100644 drivers/clk/baikal-t1/ccu-rst.c create mode 100644 drivers/clk/baikal-t1/ccu-rst.hSignature · 1 line
2.35.1
Quoted 39 lines · Serge Semin
Quoted 29 lines · Serge Semin
This patchset is an initial one in the series created in the framework of my Baikal-T1 PCIe/eDMA-related work:
[1: In-progress v3] clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
[2: In-progress v1] PCI: dwc: Various fixes and cleanups
[3: In-progress v1] PCI: dwc: Add dma-ranges/YAML-schema/Baikal-T1 support
[4: In-progress v1] dmaengine: dw-edma: Add RP/EP local DMA controllers support
Since some of the patches in the later patchsets depend on the modifications introduced here, @Lorenzo could you please merge this series through your PCIe subsystem repo? After getting all the required ack'es of course.
Short summary regarding this patchset. A few more modifications are introduced here to finally finish the Baikal-T1 CCU unit support up and prepare the code before adding the Baikal-T1 PCIe/xGMAC support. First of all it turned out I specified wrong DW xGMAC PTP reference clock divider in my initial patches. It must be 8, not 10. Secondly I was wrong to add a joint xGMAC Ref and PTP clock instead of having them separately defined. The SoC manual describes these clocks as separate fixed clock wrappers. Finally in order to close the SoC clock/reset support up we need to add the DDR and PCIe interfaces reset controls support. It's done in two steps. First I've moved the reset-controls-related code into a dedicated module. Then the DDR/PCIe reset-control functionality is added.
Quoted 8 lines
Changelog v2:
- Resubmit the series with adding @Philipp to the list of the recipients.Changelog v3:
- Rebased from v5.17 onto v5.18-rc3.
- No comments. Just resend the series.
Quoted 4 lines
No comments for more than a week. There were no comments in v1 and v2 either. Please at least ack or merge in the series. It would be very appreciated to merge it in through one repo with the rest of the patchsets before the next merge window. @Bjorn, @Lorenzo, @Michael?
Hi Sergey,
these changes affect the clock tree and have to be reviewed and merged by the respective maintainers if they think the changes can be accepted.
I don't see any reason why we should, if ACK'ed, take them in the PCI tree, this series does not apply changes to the PCI tree at all and you don't need it as a base for future to-be-merged PCI patches either.
So in short, this series has to go through the usual clock tree review process.
Thanks,
Lorenzo
Quoted 36 lines
-Sergey
Quoted 34 lines
Signed-off-by Serge Semin <[email protected]>Cc Alexey Malahov <[email protected]>Cc Pavel Parkhomenko <[email protected]>Cc Rob Herring <[email protected]>Cc "Krzysztof Wilczyński" <[email protected]>Cc Bjorn Helgaas <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Serge Semin (4):
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
clk: baikal-t1: Move reset-controls code into a dedicated module
clk: baikal-t1: Add DDR/PCIe directly controlled resets supportdrivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-div.c | 1 + drivers/clk/baikal-t1/ccu-div.h | 6 + drivers/clk/baikal-t1/ccu-rst.c | 373 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 64 +++++ drivers/clk/baikal-t1/clk-ccu-div.c | 102 ++------ include/dt-bindings/reset/bt1-ccu.h | 9 + 8 files changed, 482 insertions(+), 86 deletions(-) create mode 100644 drivers/clk/baikal-t1/ccu-rst.c create mode 100644 drivers/clk/baikal-t1/ccu-rst.hSignature · 1 line
2.35.1
Quoted 50 lines · Lorenzo Pieralisi
Quoted 39 lines · Serge Semin
Quoted 29 lines · Serge Semin
This patchset is an initial one in the series created in the framework of my Baikal-T1 PCIe/eDMA-related work:
[1: In-progress v3] clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
[2: In-progress v1] PCI: dwc: Various fixes and cleanups
[3: In-progress v1] PCI: dwc: Add dma-ranges/YAML-schema/Baikal-T1 support
[4: In-progress v1] dmaengine: dw-edma: Add RP/EP local DMA controllers support
Since some of the patches in the later patchsets depend on the modifications introduced here, @Lorenzo could you please merge this series through your PCIe subsystem repo? After getting all the required ack'es of course.
Short summary regarding this patchset. A few more modifications are introduced here to finally finish the Baikal-T1 CCU unit support up and prepare the code before adding the Baikal-T1 PCIe/xGMAC support. First of all it turned out I specified wrong DW xGMAC PTP reference clock divider in my initial patches. It must be 8, not 10. Secondly I was wrong to add a joint xGMAC Ref and PTP clock instead of having them separately defined. The SoC manual describes these clocks as separate fixed clock wrappers. Finally in order to close the SoC clock/reset support up we need to add the DDR and PCIe interfaces reset controls support. It's done in two steps. First I've moved the reset-controls-related code into a dedicated module. Then the DDR/PCIe reset-control functionality is added.
Quoted 8 lines
Changelog v2:
- Resubmit the series with adding @Philipp to the list of the recipients.Changelog v3:
- Rebased from v5.17 onto v5.18-rc3.
- No comments. Just resend the series.Quoted 4 lines
No comments for more than a week. There were no comments in v1 and v2 either. Please at least ack or merge in the series. It would be very appreciated to merge it in through one repo with the rest of the patchsets before the next merge window. @Bjorn, @Lorenzo, @Michael?
Hi Sergey,
these changes affect the clock tree and have to be reviewed and merged by the respective maintainers if they think the changes can be accepted.
Quoted 7 lines
I don't see any reason why we should, if ACK'ed, take them in the PCI tree, this series does not apply changes to the PCI tree at all and you don't need it as a base for future to-be-merged PCI patches either.
So in short, this series has to go through the usual clock tree review process.
Yes, Stephen should be the one taking these patches through the clk tree. Also, there is no need to club both pci and clk patches in a single tree. That's usually done for patches with build dependencies, but here there are none.
Thanks,
Mani
Quoted 39 lines
Thanks,
LorenzoQuoted 36 lines
-Sergey
Quoted 34 lines
Signed-off-by Serge Semin <[email protected]>Cc Alexey Malahov <[email protected]>Cc Pavel Parkhomenko <[email protected]>Cc Rob Herring <[email protected]>Cc "Krzysztof Wilczyński" <[email protected]>Cc Bjorn Helgaas <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Serge Semin (4):
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
clk: baikal-t1: Move reset-controls code into a dedicated module
clk: baikal-t1: Add DDR/PCIe directly controlled resets supportdrivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-div.c | 1 + drivers/clk/baikal-t1/ccu-div.h | 6 + drivers/clk/baikal-t1/ccu-rst.c | 373 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 64 +++++ drivers/clk/baikal-t1/clk-ccu-div.c | 102 ++------ include/dt-bindings/reset/bt1-ccu.h | 9 + 8 files changed, 482 insertions(+), 86 deletions(-) create mode 100644 drivers/clk/baikal-t1/ccu-rst.c create mode 100644 drivers/clk/baikal-t1/ccu-rst.hSignature · 1 line
2.35.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Quoted 41 lines · Manivannan Sadhasivam
Quoted 40 lines · Lorenzo Pieralisi
Quoted 39 lines · Serge Semin
Quoted 37 lines · Serge Semin
This patchset is an initial one in the series created in the framework of my Baikal-T1 PCIe/eDMA-related work:
[1: In-progress v3] clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
[2: In-progress v1] PCI: dwc: Various fixes and cleanups
[3: In-progress v1] PCI: dwc: Add dma-ranges/YAML-schema/Baikal-T1 support
[4: In-progress v1] dmaengine: dw-edma: Add RP/EP local DMA controllers support
Since some of the patches in the later patchsets depend on the modifications introduced here, @Lorenzo could you please merge this series through your PCIe subsystem repo? After getting all the required ack'es of course.
Short summary regarding this patchset. A few more modifications are introduced here to finally finish the Baikal-T1 CCU unit support up and prepare the code before adding the Baikal-T1 PCIe/xGMAC support. First of all it turned out I specified wrong DW xGMAC PTP reference clock divider in my initial patches. It must be 8, not 10. Secondly I was wrong to add a joint xGMAC Ref and PTP clock instead of having them separately defined. The SoC manual describes these clocks as separate fixed clock wrappers. Finally in order to close the SoC clock/reset support up we need to add the DDR and PCIe interfaces reset controls support. It's done in two steps. First I've moved the reset-controls-related code into a dedicated module. Then the DDR/PCIe reset-control functionality is added.
Changelog v2:
- Resubmit the series with adding @Philipp to the list of the recipients.Changelog v3:
- Rebased from v5.17 onto v5.18-rc3.
- No comments. Just resend the series.
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
No comments for more than a week. There were no comments in v1 and v2 either. Please at least ack or merge in the series. It would be very appreciated to merge it in through one repo with the rest of the patchsets before the next merge window. @Bjorn, @Lorenzo, @Michael?
Hello Lorenzo, Manivannan
Quoted 5 lines
Quoted 5 lines
Hi Sergey,
these changes affect the clock tree and have to be reviewed and merged by the respective maintainers if they think the changes can be accepted.
Quoted 7 lines
Quoted 7 lines
I don't see any reason why we should, if ACK'ed, take them in the PCI tree, this series does not apply changes to the PCI tree at all and you don't need it as a base for future to-be-merged PCI patches either.
So in short, this series has to go through the usual clock tree review process.
I do know the normal procedure. But if patches concern different subsystems but for some reason inter-depended somehow it's ok to merge them in via a single repo. In my case the platform clock driver has been updated in a way so to support the reset-controls utilized in the PCIe driver altered in another patchset. So I didn't want to leave the kernel not working in the framework of my platform on any git hash state. That's why I asked to merge the patchsets in via the same repo. The kernel would be still buildable though.
Quoted 4 lines
Yes, Stephen should be the one taking these patches through the clk tree. Also, there is no need to club both pci and clk patches in a single tree. That's usually done for patches with build dependencies, but here there are none.
Well, I didn't expect to have my patchsets review to be that delayed. Now seeing Lorenzo is going to review only DW PCIe fixes and cleanups after which will be gone for two more months I have to admit that my plan of getting the changes accepted in 5.19 won't come true. Really I thought of any subsystem but not of PCIe/DMA that review procedure would last that long.
-Sergey
Quoted 46 lines
Thanks,
ManiQuoted 39 lines
Thanks,
LorenzoQuoted 36 lines
-Sergey
Quoted 34 lines
Signed-off-by Serge Semin <[email protected]>Cc Alexey Malahov <[email protected]>Cc Pavel Parkhomenko <[email protected]>Cc Rob Herring <[email protected]>Cc "Krzysztof Wilczyński" <[email protected]>Cc Bjorn Helgaas <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Serge Semin (4):
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
clk: baikal-t1: Move reset-controls code into a dedicated module
clk: baikal-t1: Add DDR/PCIe directly controlled resets supportdrivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-div.c | 1 + drivers/clk/baikal-t1/ccu-div.h | 6 + drivers/clk/baikal-t1/ccu-rst.c | 373 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 64 +++++ drivers/clk/baikal-t1/clk-ccu-div.c | 102 ++------ include/dt-bindings/reset/bt1-ccu.h | 9 + 8 files changed, 482 insertions(+), 86 deletions(-) create mode 100644 drivers/clk/baikal-t1/ccu-rst.c create mode 100644 drivers/clk/baikal-t1/ccu-rst.hSignature · 1 line
2.35.1Signature · 1 line
மணிவண்ணன் சதாசிவம்
Stephen Boyd
maintainerQuoting Serge Semin (2022-05-12 14:14:31)
Quoted 6 lines · Manivannan Sadhasivam
Quoted 4 lines · Lorenzo Pieralisi
Quoted 3 lines
So in short, this series has to go through the usual clock tree review process.
Quoted 9 lines
I do know the normal procedure. But if patches concern different subsystems but for some reason inter-depended somehow it's ok to merge them in via a single repo. In my case the platform clock driver has been updated in a way so to support the reset-controls utilized in the PCIe driver altered in another patchset. So I didn't want to leave the kernel not working in the framework of my platform on any git hash state. That's why I asked to merge the patchsets in via the same repo. The kernel would be still buildable though.
Is it going to be broken if I merge the clk patches through clk tree? Has it ever worked? Does the kernel still boot, just PCIe fails if the patches are applied?
Quoted 18 lines · Stephen Boyd
Quoting Serge Semin (2022-05-12 14:14:31)
Quoted 6 lines · Manivannan Sadhasivam
Quoted 4 lines · Lorenzo Pieralisi
Quoted 3 lines
So in short, this series has to go through the usual clock tree review process.
Quoted 9 lines
I do know the normal procedure. But if patches concern different subsystems but for some reason inter-depended somehow it's ok to merge them in via a single repo. In my case the platform clock driver has been updated in a way so to support the reset-controls utilized in the PCIe driver altered in another patchset. So I didn't want to leave the kernel not working in the framework of my platform on any git hash state. That's why I asked to merge the patchsets in via the same repo. The kernel would be still buildable though.
Quoted 1 line
Is it going to be broken if I merge the clk patches through clk tree?
No. It won't be broken.
Quoted 1 line
Has it ever worked?
It has and is working well except some minor fixes provided in this petchset:
[PATCH v3 1/4] clk: baikal-t1: Fix invalid xGMAC PTP clock divider [PATCH v3 2/4] clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
Quoted 2 lines
Does the kernel still boot, just PCIe fails if the patches are applied?
Yes, the kernel will be bootable. There won't be any problem if the patches in this series are applied because it is self-consistent. As I said in the cover letter there is an implicit dependency of another series "[PATCH v2 00/17] PCI: dwc: Add dma-ranges/YAML-schema/Baikal-T1 support"
(https://lore.kernel.org/linux-pci/[email protected]/T/#me3c5c248adad9760702b545bd4bacd89d5f8a2bd)
from this one. In particular the functionality implemented in the patch
"[PATCH v2 17/17] PCI: dwc: Add Baikal-T1 PCIe controller support"
(https://lore.kernel.org/linux-pci/[email protected]/T/#m219e11c38c4ab8db0c2520c4050366d641598600)
depends on the patches 3 and 4 of this patchset. But the dependency is implicit hidden under the DT clock/reset bindings layer. The Baikal-T1 PCIe platform driver will just fail to probe the host controller device if this series isn't applied. So the clock/reset patchset can be freely merged in via the clk tree especially seeing the PCIe Host/EP subsystem maintainer is going to be AFK from Wednesday and my series will sadly but likely hang up in limbo for a while.
-Sergey
Hello Stephen, Michael
The series has been here for about two months with no comments. Seeing the dependent patches won't be merged in before the next merge window, could you please merge this series in through your repo?
-Sergey
Quoted 71 lines · Serge Semin
This patchset is an initial one in the series created in the framework of my Baikal-T1 PCIe/eDMA-related work:
[1: In-progress v3] clk: Baikal-T1 DDR/PCIe resets and some xGMAC fixes
[2: In-progress v1] PCI: dwc: Various fixes and cleanups
[3: In-progress v1] PCI: dwc: Add dma-ranges/YAML-schema/Baikal-T1 support
[4: In-progress v1] dmaengine: dw-edma: Add RP/EP local DMA controllers support
Since some of the patches in the later patchsets depend on the modifications introduced here, @Lorenzo could you please merge this series through your PCIe subsystem repo? After getting all the required ack'es of course.
Short summary regarding this patchset. A few more modifications are introduced here to finally finish the Baikal-T1 CCU unit support up and prepare the code before adding the Baikal-T1 PCIe/xGMAC support. First of all it turned out I specified wrong DW xGMAC PTP reference clock divider in my initial patches. It must be 8, not 10. Secondly I was wrong to add a joint xGMAC Ref and PTP clock instead of having them separately defined. The SoC manual describes these clocks as separate fixed clock wrappers. Finally in order to close the SoC clock/reset support up we need to add the DDR and PCIe interfaces reset controls support. It's done in two steps. First I've moved the reset-controls-related code into a dedicated module. Then the DDR/PCIe reset-control functionality is added.
Changelog v2:
- Resubmit the series with adding @Philipp to the list of the recipients.Changelog v3:
- Rebased from v5.17 onto v5.18-rc3.
- No comments. Just resend the series.Signed-off-by Serge Semin <[email protected]>Cc Alexey Malahov <[email protected]>Cc Pavel Parkhomenko <[email protected]>Cc Rob Herring <[email protected]>Cc "Krzysztof Wilczyński" <[email protected]>Cc Bjorn Helgaas <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Serge Semin (4):
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
clk: baikal-t1: Define shared xGMAC ref/ptp clocks parent
clk: baikal-t1: Move reset-controls code into a dedicated module
clk: baikal-t1: Add DDR/PCIe directly controlled resets supportdrivers/clk/baikal-t1/Kconfig | 12 +- drivers/clk/baikal-t1/Makefile | 1 + drivers/clk/baikal-t1/ccu-div.c | 1 + drivers/clk/baikal-t1/ccu-div.h | 6 + drivers/clk/baikal-t1/ccu-rst.c | 373 ++++++++++++++++++++++++++++ drivers/clk/baikal-t1/ccu-rst.h | 64 +++++ drivers/clk/baikal-t1/clk-ccu-div.c | 102 ++------ include/dt-bindings/reset/bt1-ccu.h | 9 + 8 files changed, 482 insertions(+), 86 deletions(-) create mode 100644 drivers/clk/baikal-t1/ccu-rst.c create mode 100644 drivers/clk/baikal-t1/ccu-rst.hSignature · 1 line
2.35.1