[PATCH RESEND v6 13/18] EDAC/mc: Re-use generic unique MC index allocation procedure
The EDAC drivers locally maintaining a statically defined memory-controllers counter don't care much about the MC index assigned as long as it's unique so the EDAC core perceives it. Convert these drivers to be using the generic MC index allocation procedure recently added to the EDAC core. Signed-off-by: Serge Semin --- Changelog v4: - Initial patch introduction. --- drivers/edac/dmc520_edac.c | 4 +--- drivers/edac/pasemi_edac.c | 5 + drivers/edac/ppc4xx_edac.c | 5 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/edac/dmc520_edac.c b/drivers/edac/dmc520_edac.c index 4e30b989a1a4..93734a97a67b 100644 --- a/drivers/edac/dmc520_edac.c +++ b/drivers/edac/dmc520_edac.c @@ -173,8 +173,6 @@ struct dmc520_edac { int masks[NUMBER_OF_IRQS]; }; -static int dmc520_mc_idx; - static u32 dmc520_read_reg(struct dmc520_edac *pvt, u32 offset) { return readl(pvt->reg_base + offset); @@ -517,7 +515,7 @@ static int dmc520_edac_probe(struct platform_device *pdev) layers[0].size = dmc520_get_rank_count(reg_base); layers[0].is_virt_csrow = true; - mci = edac_mc_alloc(dmc520_mc_idx++, ARRAY_SIZE(layers), layers, sizeof(*pvt)); + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, sizeof(*pvt)); if (!mci) { edac_printk(KERN_ERR, EDAC_MOD_NAME, "Failed to allocate memory for mc instance\n"); diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c index 1a1c3296ccc8..afebfbda1ea0 100644 --- a/drivers/edac/pasemi_edac.c +++ b/drivers/edac/pasemi_edac.c @@ -57,8 +57,6 @@ #define PASEMI_EDAC_ERROR_GRAIN64 static int last_page_in_mmc; -static int system_mmc_id; - static u32 pasemi_edac_get_error_info(struct mem_ctl_info *mci) { @@ -203,8 +201,7 @@ static int pasemi_edac_probe(struct pci_dev *pdev, layers[1].type = EDAC_MC_LAYER_CHANNEL; layers[1].size = PASEMI_EDAC_NR_CHANS; layers[1].is_virt_csrow = false; - mci = edac_mc_alloc(system_mmc_id++, ARRAY_SIZE(layers), layers, - 0); + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, 0); if (mci == NULL) return -ENOMEM; diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index 1eea3341a916..06d267d40a6a 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c @@ -1214,7 +1214,6 @@ static int ppc4xx_edac_probe(struct platform_device *op) const struct device_node *np = op->dev.of_node; struct mem_ctl_info *mci = NULL; struct edac_mc_layer layers[2]; - static int ppc4xx_edac_instance; /* * At this point, we only support the controller realized on @@ -1265,7 +1264,7 @@ static int ppc4xx_edac_probe(struct platform_device *op) layers[1].type = EDAC_MC_LAYER_CHANNEL; layers[1].size = ppc4xx_edac_nr_chans; layers[1].is_virt_csrow = false; - mci = edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers, + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, sizeof(struct ppc4xx_edac_pdata)); if (mci == NULL) { ppc4xx_edac_printk(KERN_ERR, "%pOF: " @@ -1303,8 +1302,6 @@ static int ppc4xx_edac_probe(struct platform_device *op) goto fail1; } - ppc4xx_edac_instance++; - return 0; fail1: -- 2.43.0
[PATCH v5 15/20] EDAC/mc: Re-use generic unique MC index allocation procedure
The EDAC drivers locally maintaining a statically defined memory-controllers counter don't care much about the MC index assigned as long as it's unique so the EDAC core perceives it. Convert these drivers to be using the generic MC index allocation procedure recently added to the EDAC core. Signed-off-by: Serge Semin --- Changelog v4: - Initial patch introduction. --- drivers/edac/dmc520_edac.c | 4 +--- drivers/edac/pasemi_edac.c | 5 + drivers/edac/ppc4xx_edac.c | 5 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/edac/dmc520_edac.c b/drivers/edac/dmc520_edac.c index 4e30b989a1a4..93734a97a67b 100644 --- a/drivers/edac/dmc520_edac.c +++ b/drivers/edac/dmc520_edac.c @@ -173,8 +173,6 @@ struct dmc520_edac { int masks[NUMBER_OF_IRQS]; }; -static int dmc520_mc_idx; - static u32 dmc520_read_reg(struct dmc520_edac *pvt, u32 offset) { return readl(pvt->reg_base + offset); @@ -517,7 +515,7 @@ static int dmc520_edac_probe(struct platform_device *pdev) layers[0].size = dmc520_get_rank_count(reg_base); layers[0].is_virt_csrow = true; - mci = edac_mc_alloc(dmc520_mc_idx++, ARRAY_SIZE(layers), layers, sizeof(*pvt)); + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, sizeof(*pvt)); if (!mci) { edac_printk(KERN_ERR, EDAC_MOD_NAME, "Failed to allocate memory for mc instance\n"); diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c index 1a1c3296ccc8..afebfbda1ea0 100644 --- a/drivers/edac/pasemi_edac.c +++ b/drivers/edac/pasemi_edac.c @@ -57,8 +57,6 @@ #define PASEMI_EDAC_ERROR_GRAIN64 static int last_page_in_mmc; -static int system_mmc_id; - static u32 pasemi_edac_get_error_info(struct mem_ctl_info *mci) { @@ -203,8 +201,7 @@ static int pasemi_edac_probe(struct pci_dev *pdev, layers[1].type = EDAC_MC_LAYER_CHANNEL; layers[1].size = PASEMI_EDAC_NR_CHANS; layers[1].is_virt_csrow = false; - mci = edac_mc_alloc(system_mmc_id++, ARRAY_SIZE(layers), layers, - 0); + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, 0); if (mci == NULL) return -ENOMEM; diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index 1eea3341a916..06d267d40a6a 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c @@ -1214,7 +1214,6 @@ static int ppc4xx_edac_probe(struct platform_device *op) const struct device_node *np = op->dev.of_node; struct mem_ctl_info *mci = NULL; struct edac_mc_layer layers[2]; - static int ppc4xx_edac_instance; /* * At this point, we only support the controller realized on @@ -1265,7 +1264,7 @@ static int ppc4xx_edac_probe(struct platform_device *op) layers[1].type = EDAC_MC_LAYER_CHANNEL; layers[1].size = ppc4xx_edac_nr_chans; layers[1].is_virt_csrow = false; - mci = edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers, + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, sizeof(struct ppc4xx_edac_pdata)); if (mci == NULL) { ppc4xx_edac_printk(KERN_ERR, "%pOF: " @@ -1303,8 +1302,6 @@ static int ppc4xx_edac_probe(struct platform_device *op) goto fail1; } - ppc4xx_edac_instance++; - return 0; fail1: -- 2.43.0
[PATCH RESEND v10 0/1] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
vger.kernel.org to the list of Ccecipients. Link: https://lore.kernel.org/linux-usb/20210210172850.20849-1-sergey.se...@baikalelectronics.ru Link: https://lore.kernel.org/linux-usb/20210212205521.14280-1-sergey.se...@baikalelectronics.ru Changelog v7: - Replace "of_get_child_by_name(np, "usb") ?: of_get_child_by_name(np, "dwc3");" pattern with using of_get_compatible_child() method in the Qcom DWC3 driver. - Drop the patches: [PATCH v6 01/10] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name [PATCH v6 02/10] arm: dts: keystone: Correct DWC USB3 compatible string [PATCH v6 06/10] arm: dts: keystone: Harmonize DWC USB3 DT nodes name since they have been applied to the corresponding maintainers repos. - Cleanup the list of recipients. - Rebase onto kernel 5.12-rc4. Link: https://lore.kernel.org/lkml/20210324204836.29668-1-sergey.se...@baikalelectronics.ru Changelog v8: - Just resend. Link: https://lore.kernel.org/lkml/20210409113029.7144-1-sergey.se...@baikalelectronics.ru Changelog v9: - Drop the patches: [PATCH RESEND v8 1/8] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name [PATCH RESEND v8 7/8] usb: dwc3: qcom: Detect DWC3 DT-nodes using compatible string since they have been applied to the corresponding maintainers repos. - Rebase onto the kernel 5.19-rcX. Link: https://lore.kernel.org/lkml/20220624141622.7149-1-sergey.se...@baikalelectronics.ru Changelog v10: - Just resend. - Rebase onto the kernel 6.8-rc3. - Drop the already merged in patches: [PATCH RESEND v9 1/5] arc: dts: Harmonize EHCI/OHCI DT nodes name [PATCH RESEND v9 2/5] arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name [PATCH RESEND v9 4/5] arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name [PATCH RESEND v9 5/5] arm64: dts: apm: Harmonize DWC USB3 DT nodes name Cc: Krzysztof Kozlowski Cc: Rob Herring Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (1): powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.43.0
[PATCH RESEND v10 1/1] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.43.0
Re: [PATCH 3/3] PCI: dwc: Add dw_pcie_ep_{read,write}_dbi[2] helpers
On Mon, Nov 13, 2023 at 10:33:00AM +0900, Yoshihiro Shimoda wrote: > The current code calculated some dbi[2] registers' offset by calling > dw_pcie_ep_get_dbi[2]_offset() in each function. To improve code > readability, add dw_pcie_ep_{read,write}_dbi[2} and some data-width > related helpers. Thanks for submitting this cleanup patch. That's exactly what I meant here https://lore.kernel.org/linux-pci/j4g4ijnxd7qyacszlwyi3tdztkw2nmnjwyhdqf2l2yj3h2mvje@iqsrqiodqbhq/ and Mani later here https://lore.kernel.org/linux-pci/20230728023444.GA4433@thinkpad/ Please note a few nitpicks below. > > Signed-off-by: Yoshihiro Shimoda > --- > .../pci/controller/dwc/pcie-designware-ep.c | 230 ++ > 1 file changed, 129 insertions(+), 101 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c > b/drivers/pci/controller/dwc/pcie-designware-ep.c > index 1100671db887..dcbed49c9613 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > @@ -65,24 +65,89 @@ static unsigned int dw_pcie_ep_get_dbi2_offset(struct > dw_pcie_ep *ep, u8 func_no > return dbi2_offset; > } > > +static u32 dw_pcie_ep_read_dbi(struct dw_pcie_ep *ep, u8 func_no, u32 reg, > +size_t size) > +{ > + unsigned int offset = dw_pcie_ep_get_dbi_offset(ep, func_no); > + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); > + > + return dw_pcie_read_dbi(pci, offset + reg, size); > +} > + > +static void dw_pcie_ep_write_dbi(struct dw_pcie_ep *ep, u8 func_no, u32 reg, > + size_t size, u32 val) > +{ > + unsigned int offset = dw_pcie_ep_get_dbi_offset(ep, func_no); > + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); > + > + dw_pcie_write_dbi(pci, offset + reg, size, val); > +} > + > +static void dw_pcie_ep_write_dbi2(struct dw_pcie_ep *ep, u8 func_no, u32 reg, > + size_t size, u32 val) > +{ > + unsigned int offset = dw_pcie_ep_get_dbi2_offset(ep, func_no); > + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); > + > + dw_pcie_write_dbi2(pci, offset + reg, size, val); > +} > + > +static inline void dw_pcie_ep_writel_dbi(struct dw_pcie_ep *ep, u8 func_no, > + u32 reg, u32 val) > +{ > + dw_pcie_ep_write_dbi(ep, func_no, reg, 0x4, val); > +} > + > +static inline u32 dw_pcie_ep_readl_dbi(struct dw_pcie_ep *ep, u8 func_no, > +u32 reg) > +{ > + return dw_pcie_ep_read_dbi(ep, func_no, reg, 0x4); > +} > + > +static inline void dw_pcie_ep_writew_dbi(struct dw_pcie_ep *ep, u8 func_no, > + u32 reg, u16 val) > +{ > + dw_pcie_ep_write_dbi(ep, func_no, reg, 0x2, val); > +} > + > +static inline u16 dw_pcie_ep_readw_dbi(struct dw_pcie_ep *ep, u8 func_no, > +u32 reg) > +{ > + return dw_pcie_ep_read_dbi(ep, func_no, reg, 0x2); > +} > + > +static inline void dw_pcie_ep_writeb_dbi(struct dw_pcie_ep *ep, u8 func_no, > + u32 reg, u8 val) > +{ > + dw_pcie_ep_write_dbi(ep, func_no, reg, 0x1, val); > +} > + > +static inline u8 dw_pcie_ep_readb_dbi(struct dw_pcie_ep *ep, u8 func_no, > + u32 reg) > +{ > + return dw_pcie_ep_read_dbi(ep, func_no, reg, 0x1); > +} > + > +static inline void dw_pcie_ep_writel_dbi2(struct dw_pcie_ep *ep, u8 func_no, > + u32 reg, u32 val) > +{ > + dw_pcie_ep_write_dbi2(ep, func_no, reg, 0x4, val); > +} > + I am not sure whether the methods above are supposed to be defined here instead of being moved to the "pcie-designware.h" header file together with dw_pcie_ep_get_dbi2_offset() and dw_pcie_ep_get_dbi_offset(). The later place seems more suitable seeing the accessors are generic, look similar to the dw_pcie_{write,read}_dbi{,2}() functions and might be useful in the platform drivers. On the other hand no LLDDs would have used it currently. So I'll leave this as a food for thoughts for the driver and subsystem maintainers. > static void __dw_pcie_ep_reset_bar(struct dw_pcie *pci, u8 func_no, > enum pci_barno bar, int flags) > { > - unsigned int dbi_offset, dbi2_offset; > struct dw_pcie_ep *ep = &pci->ep; > u32 reg, reg_dbi2; > > - dbi_offset = dw_pcie_ep_get_dbi_offset(ep, func_no); > - dbi2_offset = dw_pcie_ep_get_dbi2_offset(ep, func_no); > - > - reg = dbi_offset + PCI_BASE_ADDRESS_0 + (4 * bar); > - reg_dbi2 = dbi2_offset + PCI_BASE_ADDRESS_0 + (4 * bar); > + reg = PCI_BASE_ADDRESS_0 + (4 * bar); > + reg_dbi2 = PCI_BASE_ADDRESS_0 + (4 * bar); Semantics of the both variables is identical, could you please drop "reg_dbi2" and just use the "reg" variable instead here? You must have just missed it because a similar change is done in the rest of the places in this patch. > dw_pcie_dbi_
Re: [PATCH 2/3] PCI: dwc: Rename to .get_dbi_offset in struct dw_pcie_ep_ops
On Mon, Nov 13, 2023 at 10:32:59AM +0900, Yoshihiro Shimoda wrote: > Since meaning of .func_conf_select is difficult to understand, > rename it to .get_dbi_offset. This change looks good. Thanks. Reviewed-by: Serge Semin There are redundant initializers will have been left after this patch is applied, but it will be naturally fixed in the next patch. -Serge(y) > > Signed-off-by: Yoshihiro Shimoda > --- > .../pci/controller/dwc/pci-layerscape-ep.c| 5 +- > .../pci/controller/dwc/pcie-designware-ep.c | 108 +- > drivers/pci/controller/dwc/pcie-designware.h | 2 +- > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 4 +- > 4 files changed, 59 insertions(+), 60 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c > b/drivers/pci/controller/dwc/pci-layerscape-ep.c > index 4e4b687ef508..961ff1b719a1 100644 > --- a/drivers/pci/controller/dwc/pci-layerscape-ep.c > +++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c > @@ -184,8 +184,7 @@ static int ls_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 > func_no, > } > } > > -static unsigned int ls_pcie_ep_func_conf_select(struct dw_pcie_ep *ep, > - u8 func_no) > +static unsigned int ls_pcie_ep_get_dbi_offset(struct dw_pcie_ep *ep, u8 > func_no) > { > struct dw_pcie *pci = to_dw_pcie_from_ep(ep); > struct ls_pcie_ep *pcie = to_ls_pcie_ep(pci); > @@ -198,7 +197,7 @@ static const struct dw_pcie_ep_ops ls_pcie_ep_ops = { > .init = ls_pcie_ep_init, > .raise_irq = ls_pcie_ep_raise_irq, > .get_features = ls_pcie_ep_get_features, > - .func_conf_select = ls_pcie_ep_func_conf_select, > + .get_dbi_offset = ls_pcie_ep_get_dbi_offset, > }; > > static const struct ls_pcie_ep_drvdata ls1_ep_drvdata = { > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c > b/drivers/pci/controller/dwc/pcie-designware-ep.c > index ea99a97ce504..1100671db887 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > @@ -43,14 +43,14 @@ dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, u8 > func_no) > return NULL; > } > > -static unsigned int dw_pcie_ep_func_select(struct dw_pcie_ep *ep, u8 func_no) > +static unsigned int dw_pcie_ep_get_dbi_offset(struct dw_pcie_ep *ep, u8 > func_no) > { > - unsigned int func_offset = 0; > + unsigned int dbi_offset = 0; > > - if (ep->ops->func_conf_select) > - func_offset = ep->ops->func_conf_select(ep, func_no); > + if (ep->ops->get_dbi_offset) > + dbi_offset = ep->ops->get_dbi_offset(ep, func_no); > > - return func_offset; > + return dbi_offset; > } > > static unsigned int dw_pcie_ep_get_dbi2_offset(struct dw_pcie_ep *ep, u8 > func_no) > @@ -59,8 +59,8 @@ static unsigned int dw_pcie_ep_get_dbi2_offset(struct > dw_pcie_ep *ep, u8 func_no > > if (ep->ops->get_dbi2_offset) > dbi2_offset = ep->ops->get_dbi2_offset(ep, func_no); > - else if (ep->ops->func_conf_select) /* for backward compatibility */ > - dbi2_offset = ep->ops->func_conf_select(ep, func_no); > + else if (ep->ops->get_dbi_offset) /* for backward compatibility */ > + dbi2_offset = ep->ops->get_dbi_offset(ep, func_no); > > return dbi2_offset; > } > @@ -68,14 +68,14 @@ static unsigned int dw_pcie_ep_get_dbi2_offset(struct > dw_pcie_ep *ep, u8 func_no > static void __dw_pcie_ep_reset_bar(struct dw_pcie *pci, u8 func_no, > enum pci_barno bar, int flags) > { > - unsigned int func_offset, dbi2_offset; > + unsigned int dbi_offset, dbi2_offset; > struct dw_pcie_ep *ep = &pci->ep; > u32 reg, reg_dbi2; > > - func_offset = dw_pcie_ep_func_select(ep, func_no); > + dbi_offset = dw_pcie_ep_get_dbi_offset(ep, func_no); > dbi2_offset = dw_pcie_ep_get_dbi2_offset(ep, func_no); > > - reg = func_offset + PCI_BASE_ADDRESS_0 + (4 * bar); > + reg = dbi_offset + PCI_BASE_ADDRESS_0 + (4 * bar); > reg_dbi2 = dbi2_offset + PCI_BASE_ADDRESS_0 + (4 * bar); > dw_pcie_dbi_ro_wr_en(pci); > dw_pcie_writel_dbi2(pci, reg_dbi2, 0x0); > @@ -102,16 +102,16 @@ static u8 __dw_pcie_ep_find_next_cap(struct dw_pcie_ep > *ep, u8 func_no, > u8 cap_ptr, u8 cap) > { > struct dw_pcie *pci = to_dw_pcie_from_ep(ep); > - unsigned int func_offset = 0; > + unsigned int dbi_offset = 0; > u8 cap_id, next_cap_ptr; > u16 reg; > > if (!cap_ptr) > re
Re: [PATCH 1/3] PCI: dwc: Rename to .init in struct dw_pcie_ep_ops
Hi Yoshihiro. On Mon, Nov 13, 2023 at 10:32:58AM +0900, Yoshihiro Shimoda wrote: > Since the name of dw_pcie_ep_ops indicates that it's for ep obviously, > rename a member .ep_init to .init. Thanks for the series. This change particularly looks good. But since you are fixing the redundant prefixes anyway, could you also fix the dw_pcie_host_ops structure too (drop host_ prefixes from the .host_init() and .host_deinit() fields)? The change was discussed a while ago here https://lore.kernel.org/linux-pci/20230802104049.GB57374@thinkpad/ in the context of your long-going patchset. It's better to be done in the framework of a separate patch released within this series. -Serge(y) > > Signed-off-by: Yoshihiro Shimoda > --- > drivers/pci/controller/dwc/pci-dra7xx.c | 2 +- > drivers/pci/controller/dwc/pci-imx6.c | 2 +- > drivers/pci/controller/dwc/pci-keystone.c | 2 +- > drivers/pci/controller/dwc/pci-layerscape-ep.c| 2 +- > drivers/pci/controller/dwc/pcie-artpec6.c | 2 +- > drivers/pci/controller/dwc/pcie-designware-ep.c | 4 ++-- > drivers/pci/controller/dwc/pcie-designware-plat.c | 2 +- > drivers/pci/controller/dwc/pcie-designware.h | 2 +- > drivers/pci/controller/dwc/pcie-keembay.c | 2 +- > drivers/pci/controller/dwc/pcie-qcom-ep.c | 2 +- > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 2 +- > drivers/pci/controller/dwc/pcie-uniphier-ep.c | 2 +- > 12 files changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c > b/drivers/pci/controller/dwc/pci-dra7xx.c > index b445ffe95e3f..f9182cd6fe67 100644 > --- a/drivers/pci/controller/dwc/pci-dra7xx.c > +++ b/drivers/pci/controller/dwc/pci-dra7xx.c > @@ -436,7 +436,7 @@ dra7xx_pcie_get_features(struct dw_pcie_ep *ep) > } > > static const struct dw_pcie_ep_ops pcie_ep_ops = { > - .ep_init = dra7xx_pcie_ep_init, > + .init = dra7xx_pcie_ep_init, > .raise_irq = dra7xx_pcie_raise_irq, > .get_features = dra7xx_pcie_get_features, > }; > diff --git a/drivers/pci/controller/dwc/pci-imx6.c > b/drivers/pci/controller/dwc/pci-imx6.c > index 74703362aeec..737d4d90fef2 100644 > --- a/drivers/pci/controller/dwc/pci-imx6.c > +++ b/drivers/pci/controller/dwc/pci-imx6.c > @@ -1093,7 +1093,7 @@ imx6_pcie_ep_get_features(struct dw_pcie_ep *ep) > } > > static const struct dw_pcie_ep_ops pcie_ep_ops = { > - .ep_init = imx6_pcie_ep_init, > + .init = imx6_pcie_ep_init, > .raise_irq = imx6_pcie_ep_raise_irq, > .get_features = imx6_pcie_ep_get_features, > }; > diff --git a/drivers/pci/controller/dwc/pci-keystone.c > b/drivers/pci/controller/dwc/pci-keystone.c > index 0def919f89fa..655c7307eb88 100644 > --- a/drivers/pci/controller/dwc/pci-keystone.c > +++ b/drivers/pci/controller/dwc/pci-keystone.c > @@ -944,7 +944,7 @@ ks_pcie_am654_get_features(struct dw_pcie_ep *ep) > } > > static const struct dw_pcie_ep_ops ks_pcie_am654_ep_ops = { > - .ep_init = ks_pcie_am654_ep_init, > + .init = ks_pcie_am654_ep_init, > .raise_irq = ks_pcie_am654_raise_irq, > .get_features = &ks_pcie_am654_get_features, > }; > diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c > b/drivers/pci/controller/dwc/pci-layerscape-ep.c > index 3d3c50ef4b6f..4e4b687ef508 100644 > --- a/drivers/pci/controller/dwc/pci-layerscape-ep.c > +++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c > @@ -195,7 +195,7 @@ static unsigned int ls_pcie_ep_func_conf_select(struct > dw_pcie_ep *ep, > } > > static const struct dw_pcie_ep_ops ls_pcie_ep_ops = { > - .ep_init = ls_pcie_ep_init, > + .init = ls_pcie_ep_init, > .raise_irq = ls_pcie_ep_raise_irq, > .get_features = ls_pcie_ep_get_features, > .func_conf_select = ls_pcie_ep_func_conf_select, > diff --git a/drivers/pci/controller/dwc/pcie-artpec6.c > b/drivers/pci/controller/dwc/pcie-artpec6.c > index 9b572a2b2c9a..27ff425c0698 100644 > --- a/drivers/pci/controller/dwc/pcie-artpec6.c > +++ b/drivers/pci/controller/dwc/pcie-artpec6.c > @@ -370,7 +370,7 @@ static int artpec6_pcie_raise_irq(struct dw_pcie_ep *ep, > u8 func_no, > } > > static const struct dw_pcie_ep_ops pcie_ep_ops = { > - .ep_init = artpec6_pcie_ep_init, > + .init = artpec6_pcie_ep_init, > .raise_irq = artpec6_pcie_raise_irq, > }; > > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c > b/drivers/pci/controller/dwc/pcie-designware-ep.c > index f6207989fc6a..ea99a97ce504 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > @@ -794,8 +794,8 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) > list_add_tail(&ep_func->list, &ep->func_list); > } > > - if (ep->ops->ep_init) > - ep->ops->ep_init(ep); > + if (ep->ops->init) > + ep->ops->init(ep); > > ret = pci_epc_mem_init(epc, ep->phys_base, ep->addr_size, >
[PATCH v4 15/20] EDAC/mc: Re-use generic unique MC index allocation procedure
The EDAC drivers locally maintaining a statically defined memory-controllers counter don't care much about the MC index assigned as long as it's unique so the EDAC core perceives it. Convert these drivers to be using the generic MC index allocation procedure recently added to the EDAC core. Signed-off-by: Serge Semin --- Changelog v4: - Initial patch introduction. --- drivers/edac/dmc520_edac.c | 4 +--- drivers/edac/pasemi_edac.c | 5 + drivers/edac/ppc4xx_edac.c | 5 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/edac/dmc520_edac.c b/drivers/edac/dmc520_edac.c index 1fa5ca57e9ec..abd73ed0ad89 100644 --- a/drivers/edac/dmc520_edac.c +++ b/drivers/edac/dmc520_edac.c @@ -173,8 +173,6 @@ struct dmc520_edac { int masks[NUMBER_OF_IRQS]; }; -static int dmc520_mc_idx; - static u32 dmc520_read_reg(struct dmc520_edac *pvt, u32 offset) { return readl(pvt->reg_base + offset); @@ -517,7 +515,7 @@ static int dmc520_edac_probe(struct platform_device *pdev) layers[0].size = dmc520_get_rank_count(reg_base); layers[0].is_virt_csrow = true; - mci = edac_mc_alloc(dmc520_mc_idx++, ARRAY_SIZE(layers), layers, sizeof(*pvt)); + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, sizeof(*pvt)); if (!mci) { edac_printk(KERN_ERR, EDAC_MOD_NAME, "Failed to allocate memory for mc instance\n"); diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c index 1a1c3296ccc8..afebfbda1ea0 100644 --- a/drivers/edac/pasemi_edac.c +++ b/drivers/edac/pasemi_edac.c @@ -57,8 +57,6 @@ #define PASEMI_EDAC_ERROR_GRAIN64 static int last_page_in_mmc; -static int system_mmc_id; - static u32 pasemi_edac_get_error_info(struct mem_ctl_info *mci) { @@ -203,8 +201,7 @@ static int pasemi_edac_probe(struct pci_dev *pdev, layers[1].type = EDAC_MC_LAYER_CHANNEL; layers[1].size = PASEMI_EDAC_NR_CHANS; layers[1].is_virt_csrow = false; - mci = edac_mc_alloc(system_mmc_id++, ARRAY_SIZE(layers), layers, - 0); + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, 0); if (mci == NULL) return -ENOMEM; diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index 046969b4e82e..2b3d66bd0c28 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c @@ -1214,7 +1214,6 @@ static int ppc4xx_edac_probe(struct platform_device *op) const struct device_node *np = op->dev.of_node; struct mem_ctl_info *mci = NULL; struct edac_mc_layer layers[2]; - static int ppc4xx_edac_instance; /* * At this point, we only support the controller realized on @@ -1265,7 +1264,7 @@ static int ppc4xx_edac_probe(struct platform_device *op) layers[1].type = EDAC_MC_LAYER_CHANNEL; layers[1].size = ppc4xx_edac_nr_chans; layers[1].is_virt_csrow = false; - mci = edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers, + mci = edac_mc_alloc(EDAC_AUTO_MC_NUM, ARRAY_SIZE(layers), layers, sizeof(struct ppc4xx_edac_pdata)); if (mci == NULL) { ppc4xx_edac_printk(KERN_ERR, "%pOF: " @@ -1303,8 +1302,6 @@ static int ppc4xx_edac_probe(struct platform_device *op) goto fail1; } - ppc4xx_edac_instance++; - return 0; fail1: -- 2.41.0
Re: [PATCH v3 3/9] NTB: Remove pci_aer_clear_nonfatal_status() call
Hi Bjorn On Tue, Dec 06, 2022 at 12:09:56PM -0600, Bjorn Helgaas wrote: > On Wed, Sep 28, 2022 at 02:03:55PM +0300, Serge Semin wrote: > > On Wed, Sep 28, 2022 at 06:59:40PM +0800, Zhuo Chen wrote: > > > There is no need to clear error status during init code, so remove it. > > > > Why do you think there isn't? Justify in more details. > > Thanks for taking a look, Sergey! I agree we should leave it or add > the rationale here. > > > > Signed-off-by: Zhuo Chen > > > --- > > > drivers/ntb/hw/idt/ntb_hw_idt.c | 2 -- > > > 1 file changed, 2 deletions(-) > > > > > > diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c > > > b/drivers/ntb/hw/idt/ntb_hw_idt.c > > > index 0ed6f809ff2e..fed03217289d 100644 > > > --- a/drivers/ntb/hw/idt/ntb_hw_idt.c > > > +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c > > > @@ -2657,8 +2657,6 @@ static int idt_init_pci(struct idt_ntb_dev *ndev) > > > ret = pci_enable_pcie_error_reporting(pdev); > > > if (ret != 0) > > > dev_warn(&pdev->dev, "PCIe AER capability disabled\n"); > > > - else /* Cleanup nonfatal error status before getting to init */ > > > - pci_aer_clear_nonfatal_status(pdev); > > I do think drivers should not need to clear errors; I think the PCI > core should be responsible for that. > > And I think the core *does* do that in this path: > > pci_init_capabilities > pci_aer_init > pci_aer_clear_status > pci_aer_raw_clear_status > pci_write_config_dword(pdev, aer + PCI_ERR_COR_STATUS) > pci_write_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS) > > pci_aer_clear_nonfatal_status() clears only non-fatal uncorrectable > errors, while pci_aer_init() clears all correctable and all > uncorrectable errors, so the PCI core is already doing more than > idt_init_pci() does. > > So I think this change is good because it removes some work from the > driver, but let me know if you think otherwise. It's hard to remember now all the details but IIRC back when this driver was developed the "Unsupported Request" flag was left uncleared on our platform even after the probe completion. Most likely an erroneous TLP was generated by some action performed on the device probe stage. The forced cleanup of the AER status solved that problem. On the other hand the problem of having the UnsupReq+ flag set was solved some time after the driver was merged in into the kernel (it was caused by a vendor-specific behavior of the IDT PCIe switch placed on the path between a RP and PCIe NTB). So since the original reason of having the pci_aer_clear_nonfatal_status() method called here was platform specific and fixed now anyway, and the AER flags cleanup is done by the core, then I have no reason to be against the patch. It would be good to add your clarification to the commit message though. Reviewed-by: Serge Semin -Serge(y) > > > > > > > /* First enable the PCI device */ > > > ret = pcim_enable_device(pdev); > > > -- > > > 2.30.1 (Apple Git-130) > > >
Re: [PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api
On Wed, Sep 28, 2022 at 06:59:37PM +0800, Zhuo Chen wrote: > Hello. > > Here comes patch v3, which contains some fixes and optimizations of > aer api usage. The v1 and v2 can be found on the mailing list. > > v3: > - Modifications to comments proposed by Sathyanarayanan. > Remove > pci_aer_clear_nonfatal_status() call in NTB and improve commit log. Failed to see who has requested that... -Sergey > > v2: > - Modifications to comments proposed by Bjorn. Split patch into more > obvious parts. > > Zhuo Chen (9): > PCI/AER: Add pci_aer_clear_uncorrect_error_status() to PCI core > PCI/DPC: Use pci_aer_clear_uncorrect_error_status() to clear > uncorrectable error status > NTB: Remove pci_aer_clear_nonfatal_status() call > scsi: lpfc: Change to use pci_aer_clear_uncorrect_error_status() > PCI/AER: Unexport pci_aer_clear_nonfatal_status() > PCI/AER: Move check inside pcie_clear_device_status(). > PCI/AER: Use pcie_aer_is_native() to judge whether OS owns AER > PCI/ERR: Clear fatal error status when pci_channel_io_frozen > PCI/AER: Refine status clearing process with api > > drivers/ntb/hw/idt/ntb_hw_idt.c | 2 -- > drivers/pci/pci.c | 7 +++-- > drivers/pci/pci.h | 2 ++ > drivers/pci/pcie/aer.c | 45 +++-- > drivers/pci/pcie/dpc.c | 3 +-- > drivers/pci/pcie/err.c | 15 --- > drivers/pci/pcie/portdrv_core.c | 3 +-- > drivers/scsi/lpfc/lpfc_attr.c | 4 +-- > include/linux/aer.h | 4 +-- > 9 files changed, 44 insertions(+), 41 deletions(-) > > -- > 2.30.1 (Apple Git-130) >
Re: [PATCH v3 3/9] NTB: Remove pci_aer_clear_nonfatal_status() call
On Wed, Sep 28, 2022 at 06:59:40PM +0800, Zhuo Chen wrote: > There is no need to clear error status during init code, so remove it. Why do you think there isn't? Justify in more details. -Sergey > > Signed-off-by: Zhuo Chen > --- > drivers/ntb/hw/idt/ntb_hw_idt.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c > index 0ed6f809ff2e..fed03217289d 100644 > --- a/drivers/ntb/hw/idt/ntb_hw_idt.c > +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c > @@ -2657,8 +2657,6 @@ static int idt_init_pci(struct idt_ntb_dev *ndev) > ret = pci_enable_pcie_error_reporting(pdev); > if (ret != 0) > dev_warn(&pdev->dev, "PCIe AER capability disabled\n"); > - else /* Cleanup nonfatal error status before getting to init */ > - pci_aer_clear_nonfatal_status(pdev); > > /* First enable the PCI device */ > ret = pcim_enable_device(pdev); > -- > 2.30.1 (Apple Git-130) >
Re: [PATCH v2 3/9] NTB: Change to use pci_aer_clear_uncorrect_error_status()
On Tue, Sep 27, 2022 at 11:35:18PM +0800, Zhuo Chen wrote: > Status bits for ERR_NONFATAL errors only are cleared in > pci_aer_clear_nonfatal_status(), but we want clear uncorrectable > error status in idt_init_pci(), so we change to use > pci_aer_clear_uncorrect_error_status(). Have the modification changed since: https://lore.kernel.org/linux-pci/20220901181634.99591-2-chenzhu...@bytedance.com/ ? AFAICS it hasn't. Then my ab-tag should have been preserved on v2. One more time: Acked-by: Serge Semin Don't forget to add it should you have some more patchset re-spins. -Sergey > > Signed-off-by: Zhuo Chen > --- > drivers/ntb/hw/idt/ntb_hw_idt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c > index 0ed6f809ff2e..d5f0aa87f817 100644 > --- a/drivers/ntb/hw/idt/ntb_hw_idt.c > +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c > @@ -2657,8 +2657,8 @@ static int idt_init_pci(struct idt_ntb_dev *ndev) > ret = pci_enable_pcie_error_reporting(pdev); > if (ret != 0) > dev_warn(&pdev->dev, "PCIe AER capability disabled\n"); > - else /* Cleanup nonfatal error status before getting to init */ > - pci_aer_clear_nonfatal_status(pdev); > + else /* Cleanup uncorrectable error status before getting to init */ > + pci_aer_clear_uncorrect_error_status(pdev); > > /* First enable the PCI device */ > ret = pcim_enable_device(pdev); > -- > 2.30.1 (Apple Git-130) >
Re: [External] Re: [PATCH 1/3] PCI/AER: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status
On Mon, Sep 12, 2022 at 01:09:05AM +0800, Zhuo Chen wrote: > > > On 9/12/22 12:22 AM, Serge Semin wrote: > > Hi Zhuo > > > > On Fri, Sep 02, 2022 at 02:16:32AM +0800, Zhuo Chen wrote: > > > Status bits for ERR_NONFATAL errors only are cleared in > > > pci_aer_clear_nonfatal_status(), but we want clear uncorrectable > > > error status in ntb_hw_idt.c and lpfc_attr.c. So we add > > > pci_aer_clear_uncorrect_error_status() and change to use it. > > > > What about the next drivers > > > > drivers/scsi/lpfc/lpfc_attr.c > > drivers/crypto/hisilicon/qm.c > > drivers/net/ethernet/intel/ice/ice_main.c > > > > which call the pci_aer_clear_nonfatal_status() method too? > > ‘pci_aer_clear_nonfatal_status()’ in > drivers/net/ethernet/intel/ice/ice_main.c has already been removed and > merged in kernel in: > https://github.com/torvalds/linux/commit/ca415ea1f03abf34fc8e4cc5fc30a00189b4e776 > > ‘pci_aer_clear_nonfatal_status()’ in drivers/crypto/hisilicon/qm.c will be > removed in the next kernel: > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/crypto/hisilicon/qm.c?id=00278564a60e11df8bcca0ececd8b2f55434e406 > > Uncorrectable error status register was intended to be cleared in > drivers/scsi/lpfc/lpfc_attr.c. But originally function was changed in > https://github.com/torvalds/linux/commit/e7b0b847de6db161e3917732276e425bc92a2feb > and > https://github.com/torvalds/linux/commit/894020fdd88c1e9a74c60b67c0f19f1c7696ba2f Got it. Thanks for clarification. -Sergey > > > > > > > > Use pci_aer_clear_nonfatal_status() in dpc_process_error(), which has > > > no functional changes. > > > > > > Since pci_aer_clear_nonfatal_status() is used only internally, move > > > its declaration to the PCI internal header file. Also, no one cares > > > about return value of pci_aer_clear_nonfatal_status(), so make it void. > > > > > > Signed-off-by: Zhuo Chen > > > --- > > > drivers/ntb/hw/idt/ntb_hw_idt.c | 4 ++-- > > > drivers/pci/pci.h | 2 ++ > > > drivers/pci/pcie/aer.c | 23 ++- > > > drivers/pci/pcie/dpc.c | 3 +-- > > > drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- > > > include/linux/aer.h | 4 ++-- > > > 6 files changed, 27 insertions(+), 13 deletions(-) > > > > > > diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c > > > b/drivers/ntb/hw/idt/ntb_hw_idt.c > > > index 733557231ed0..de1dbbc5b9de 100644 > > > --- a/drivers/ntb/hw/idt/ntb_hw_idt.c > > > +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c > > > @@ -2657,8 +2657,8 @@ static int idt_init_pci(struct idt_ntb_dev *ndev) > > > ret = pci_enable_pcie_error_reporting(pdev); > > > if (ret != 0) > > > dev_warn(&pdev->dev, "PCIe AER capability disabled\n"); > > > > > - else /* Cleanup nonfatal error status before getting to init */ > > > - pci_aer_clear_nonfatal_status(pdev); > > > + else /* Cleanup uncorrectable error status before getting to init */ > > > + pci_aer_clear_uncorrect_error_status(pdev); > > > > From the IDT NTB PCIe initialization procedure point of view both of > > these methods are equivalent. So for the IDT NTB part: > > > IDT NTB part is the same as drivers/scsi/lpfc/lpfc_attr.c. The original > function is clear uncorrectable error status register including fatal and > non-fatal error status bits. > > > Acked-by: Serge Semin > > > > -Sergey > > > > > /* First enable the PCI device */ > > > ret = pcim_enable_device(pdev); > > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > > > index e10cdec6c56e..574176f43025 100644 > > > --- a/drivers/pci/pci.h > > > +++ b/drivers/pci/pci.h > > > @@ -686,6 +686,7 @@ void pci_aer_init(struct pci_dev *dev); > > > void pci_aer_exit(struct pci_dev *dev); > > > extern const struct attribute_group aer_stats_attr_group; > > > void pci_aer_clear_fatal_status(struct pci_dev *dev); > > > +void pci_aer_clear_nonfatal_status(struct pci_dev *dev); > > > int pci_aer_clear_status(struct pci_dev *dev); > > > int pci_aer_raw_clear_status(struct pci_dev *dev); > > > #else > > > @@ -693,6 +694,7 @@ static inline void pci_no_aer(void) { } > > > static inline void pci_aer_init(struct pci_dev *d) { } > > > static inline void pci_aer_exit(struct pci_dev *d) { } >
Re: [PATCH 1/3] PCI/AER: Use pci_aer_clear_uncorrect_error_status() to clear uncorrectable error status
Hi Zhuo On Fri, Sep 02, 2022 at 02:16:32AM +0800, Zhuo Chen wrote: > Status bits for ERR_NONFATAL errors only are cleared in > pci_aer_clear_nonfatal_status(), but we want clear uncorrectable > error status in ntb_hw_idt.c and lpfc_attr.c. So we add > pci_aer_clear_uncorrect_error_status() and change to use it. What about the next drivers drivers/scsi/lpfc/lpfc_attr.c drivers/crypto/hisilicon/qm.c drivers/net/ethernet/intel/ice/ice_main.c which call the pci_aer_clear_nonfatal_status() method too? > > Use pci_aer_clear_nonfatal_status() in dpc_process_error(), which has > no functional changes. > > Since pci_aer_clear_nonfatal_status() is used only internally, move > its declaration to the PCI internal header file. Also, no one cares > about return value of pci_aer_clear_nonfatal_status(), so make it void. > > Signed-off-by: Zhuo Chen > --- > drivers/ntb/hw/idt/ntb_hw_idt.c | 4 ++-- > drivers/pci/pci.h | 2 ++ > drivers/pci/pcie/aer.c | 23 ++- > drivers/pci/pcie/dpc.c | 3 +-- > drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- > include/linux/aer.h | 4 ++-- > 6 files changed, 27 insertions(+), 13 deletions(-) > > diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c > index 733557231ed0..de1dbbc5b9de 100644 > --- a/drivers/ntb/hw/idt/ntb_hw_idt.c > +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c > @@ -2657,8 +2657,8 @@ static int idt_init_pci(struct idt_ntb_dev *ndev) > ret = pci_enable_pcie_error_reporting(pdev); > if (ret != 0) > dev_warn(&pdev->dev, "PCIe AER capability disabled\n"); > - else /* Cleanup nonfatal error status before getting to init */ > - pci_aer_clear_nonfatal_status(pdev); > + else /* Cleanup uncorrectable error status before getting to init */ > + pci_aer_clear_uncorrect_error_status(pdev); >From the IDT NTB PCIe initialization procedure point of view both of these methods are equivalent. So for the IDT NTB part: Acked-by: Serge Semin -Sergey > > /* First enable the PCI device */ > ret = pcim_enable_device(pdev); > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > index e10cdec6c56e..574176f43025 100644 > --- a/drivers/pci/pci.h > +++ b/drivers/pci/pci.h > @@ -686,6 +686,7 @@ void pci_aer_init(struct pci_dev *dev); > void pci_aer_exit(struct pci_dev *dev); > extern const struct attribute_group aer_stats_attr_group; > void pci_aer_clear_fatal_status(struct pci_dev *dev); > +void pci_aer_clear_nonfatal_status(struct pci_dev *dev); > int pci_aer_clear_status(struct pci_dev *dev); > int pci_aer_raw_clear_status(struct pci_dev *dev); > #else > @@ -693,6 +694,7 @@ static inline void pci_no_aer(void) { } > static inline void pci_aer_init(struct pci_dev *d) { } > static inline void pci_aer_exit(struct pci_dev *d) { } > static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { } > +static inline void pci_aer_clear_nonfatal_status(struct pci_dev *dev) { } > static inline int pci_aer_clear_status(struct pci_dev *dev) { return > -EINVAL; } > static inline int pci_aer_raw_clear_status(struct pci_dev *dev) { return > -EINVAL; } > #endif > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index 7952e5efd6cf..d2996afa80f6 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -251,13 +251,13 @@ int pci_disable_pcie_error_reporting(struct pci_dev > *dev) > } > EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting); > > -int pci_aer_clear_nonfatal_status(struct pci_dev *dev) > +void pci_aer_clear_nonfatal_status(struct pci_dev *dev) > { > int aer = dev->aer_cap; > u32 status, sev; > > if (!pcie_aer_is_native(dev)) > - return -EIO; > + return; > > /* Clear status bits for ERR_NONFATAL errors only */ > pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_STATUS, &status); > @@ -265,10 +265,7 @@ int pci_aer_clear_nonfatal_status(struct pci_dev *dev) > status &= ~sev; > if (status) > pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_STATUS, status); > - > - return 0; > } > -EXPORT_SYMBOL_GPL(pci_aer_clear_nonfatal_status); > > void pci_aer_clear_fatal_status(struct pci_dev *dev) > { > @@ -286,6 +283,22 @@ void pci_aer_clear_fatal_status(struct pci_dev *dev) > pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_STATUS, status); > } > > +int pci_aer_clear_uncorrect_error_status(struct pci_dev *dev) > +{ > + int aer = dev->aer_cap; > + u32 status; > + > + if (!pcie_aer_is_native(dev)) > + return -EIO; > + > + pci_
Re: [PATCH RESEND v9 4/5] arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name
On Sun, Jun 26, 2022 at 12:42:48PM +0200, Krzysztof Kozlowski wrote: > On 24/06/2022 22:45, Serge Semin wrote: > > On Fri, Jun 24, 2022 at 07:18:57PM +0200, Krzysztof Kozlowski wrote: > >> On 24/06/2022 16:16, Serge Semin wrote: > >>> In accordance with the DWC USB3 bindings the corresponding node > >>> name is suppose to comply with the Generic USB HCD DT schema, which > >>> requires the USB nodes to have the name acceptable by the regexp: > >>> "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly > >>> named. > >>> > >>> Signed-off-by: Serge Semin > >>> Acked-by: Krzysztof Kozlowski > >>> Reviewed-by: Patrice Chotard > >>> --- > >>> arch/arm/boot/dts/stih407-family.dtsi | 2 +- > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> > >>> diff --git a/arch/arm/boot/dts/stih407-family.dtsi > >>> b/arch/arm/boot/dts/stih407-family.dtsi > >>> index 1713f7878117..7ba528315dbe 100644 > >>> --- a/arch/arm/boot/dts/stih407-family.dtsi > >>> +++ b/arch/arm/boot/dts/stih407-family.dtsi > >>> @@ -725,7 +725,7 @@ st_dwc3: dwc3@8f94000 { > >>> > >>> status = "disabled"; > >>> > >>> - dwc3: dwc3@990 { > >>> + dwc3: usb@990 { > >> > > > >> This does not apply. What tree is it based on? > > > > That's weird. The series has been rebased onto the mainline kernel > > v5.19-rc3. > > Do you have the stih407 dtsi fixed on your local repo? > > It conflicts with my change: > https://lore.kernel.org/all/20220526203632.831039-1-krzysztof.kozlow...@linaro.org/ > > I'll apply with local fixups. Ok. Thanks. -Sergey > > > Best regards, > Krzysztof
Re: [PATCH RESEND v9 1/5] arc: dts: Harmonize EHCI/OHCI DT nodes name
On Fri, Jun 24, 2022 at 03:11:43PM -0700, Vineet Gupta wrote: > > On 6/24/22 07:16, Serge Semin wrote: > > In accordance with the Generic EHCI/OHCI bindings the corresponding node > > name is suppose to comply with the Generic USB HCD DT schema, which > > requires the USB nodes to have the name acceptable by the regexp: > > "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible > > nodes are correctly named. > > > > Signed-off-by: Serge Semin > > Acked-by: Alexey Brodkin > > Acked-by: Krzysztof Kozlowski > > This slipped thru cracks. Now on for-curr. Great! Thanks. -Sergey > > Thx, > -Vineet
Re: [PATCH RESEND v9 5/5] arm64: dts: apm: Harmonize DWC USB3 DT nodes name
On Fri, Jun 24, 2022 at 07:17:53PM +0200, Krzysztof Kozlowski wrote: > On 24/06/2022 16:16, Serge Semin wrote: > > In accordance with the DWC USB3 bindings the corresponding node > > name is suppose to comply with the Generic USB HCD DT schema, which > > requires the USB nodes to have the name acceptable by the regexp: > > "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly > > named despite of the warning comment about possible backward > > compatibility issues. > > Sometimes node name is exposed to user-space which depends on it. How > did you check there is no issue here? I well remember the Qcom problem caused by one of my patch: https://lore.kernel.org/lkml/calaqxlx_fnvfndedwtgbfpjszuabfqxqe07dibjfztftwej...@mail.gmail.com/ The next patch caused the same problem, but hasn't been reverted. https://lore.kernel.org/lkml/calaqxlwgujgr7p8vb5s_rimrvyxwm5xf-c4nkkgmh-43web...@mail.gmail.com/ As before I am more inclined to thinking that the problem was mainly caused by the improper node-name utilization. Anyway John later noted that the problem was fixed in the user-space. That why afterwards you were able to provide the commit b77a1c4d6b05 ("arm64: dts: qcom: correct DWC3 node names and unit addresses"). Anyway I am not able to track the way the node-name is used on the affected platform and can't make sure that the dts would be still working well on that devices. But seeing nobody responded/commented on this patch for more than a year we can at least try to merge this in and see whether it causes any problem should the denoted platform is still in use. If it does we can revert the update back and forget about it. -Sergey > > > > > Signed-off-by: Serge Semin > > Acked-by: Krzysztof Kozlowski > > --- > > arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 4 ++-- > > arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 +++--- > > 2 files changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi > > b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi > > index a83c82c50e29..832dd85b00bd 100644 > > --- a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi > > +++ b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi > > @@ -597,8 +597,8 @@ serial0: serial@1060 { > > interrupts = <0x0 0x4c 0x4>; > > }; > > > > - /* Do not change dwusb name, coded for backward compatibility */ > > - usb0: dwusb@1900 { > > + /* Node-name might need to be coded as dwusb for backward > > compatibility */ > > + usb0: usb@1900 { > > status = "disabled"; > > compatible = "snps,dwc3"; > > reg = <0x0 0x1900 0x0 0x10>; > > diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi > > b/arch/arm64/boot/dts/apm/apm-storm.dtsi > > index 0f37e77f5459..1520a945b7f9 100644 > > --- a/arch/arm64/boot/dts/apm/apm-storm.dtsi > > +++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi > > @@ -923,8 +923,8 @@ sata3: sata@1a80 { > > phy-names = "sata-phy"; > > }; > > > > - /* Do not change dwusb name, coded for backward compatibility */ > > - usb0: dwusb@1900 { > > + /* Node-name might need to be coded as dwusb for backward > > compatibility */ > > + usb0: usb@1900 { > > status = "disabled"; > > compatible = "snps,dwc3"; > > reg = <0x0 0x1900 0x0 0x10>; > > @@ -933,7 +933,7 @@ usb0: dwusb@1900 { > > dr_mode = "host"; > > }; > > > > - usb1: dwusb@1980 { > > + usb1: usb@1980 { > > status = "disabled"; > > compatible = "snps,dwc3"; > > reg = <0x0 0x1980 0x0 0x10>; > > > Best regards, > Krzysztof
Re: [PATCH RESEND v9 4/5] arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name
On Fri, Jun 24, 2022 at 07:18:57PM +0200, Krzysztof Kozlowski wrote: > On 24/06/2022 16:16, Serge Semin wrote: > > In accordance with the DWC USB3 bindings the corresponding node > > name is suppose to comply with the Generic USB HCD DT schema, which > > requires the USB nodes to have the name acceptable by the regexp: > > "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly > > named. > > > > Signed-off-by: Serge Semin > > Acked-by: Krzysztof Kozlowski > > Reviewed-by: Patrice Chotard > > --- > > arch/arm/boot/dts/stih407-family.dtsi | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm/boot/dts/stih407-family.dtsi > > b/arch/arm/boot/dts/stih407-family.dtsi > > index 1713f7878117..7ba528315dbe 100644 > > --- a/arch/arm/boot/dts/stih407-family.dtsi > > +++ b/arch/arm/boot/dts/stih407-family.dtsi > > @@ -725,7 +725,7 @@ st_dwc3: dwc3@8f94000 { > > > > status = "disabled"; > > > > - dwc3: dwc3@990 { > > + dwc3: usb@990 { > > This does not apply. What tree is it based on? That's weird. The series has been rebased onto the mainline kernel v5.19-rc3. Do you have the stih407 dtsi fixed on your local repo? -Sergey > > > Best regards, > Krzysztof
Re: [PATCH RESEND v9 2/5] arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name
On Fri, Jun 24, 2022 at 07:14:44PM +0200, Krzysztof Kozlowski wrote: > On 24/06/2022 16:16, Serge Semin wrote: > > In accordance with the Generic EHCI/OHCI bindings the corresponding node > > name is suppose to comply with the Generic USB HCD DT schema, which > > requires the USB nodes to have the name acceptable by the regexp: > > "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible > > nodes are correctly named. > > > > Signed-off-by: Serge Semin > > Acked-by: Vladimir Zapolskiy > > Acked-by: Krzysztof Kozlowski > > --- > > arch/arm/boot/dts/lpc18xx.dtsi | 4 ++-- > > You should split the patchset per architecture, because maybe that's why > no one picks it up? Each patch is sent out to the corresponding mailing list and the maintainers. I don't think splitting the patchset into the subsets will be more efficient especially seeing the initial patchset consisted of 30 patches of which only five left. I was very busy last year with another activities so what was left of this patchset was stalling on my local repo all that time. I have been very surprised to realise that the submitted part still hasn't been merged in for all that time. So I've got back to resubmitting the series. * Though the Qualcom dts have been fixed by you lately. > > Let me pick up ARM bits through my cleanup series. If anyone objects, > please let me know. Ok. Thanks. -Sergey > > Best regards, > Krzysztof
Re: [PATCH v4 15/18] PCI: dwc: Add dw_ prefix to the pcie_port structure name
gkai Hu , "linux-arm-ker...@lists.infradead.org" , Roy Zang , Jingoo Han , "linuxppc-dev@lists.ozlabs.org" , Heiko Stuebner , "linux-ker...@vger.kernel.org" , Serge Semin , Krzysztof Kozlowski , Masami Hiramatsu , Pengutronix Kernel Team , Gustavo Pimentel , Shawn Guo , Lucas Stach Errors-To: linuxppc-dev-bounces+archive=mail-archive@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Jun 10, 2022 at 04:16:42PM +0200, Jesper Nilsson wrote: > On Fri, Jun 10, 2022 at 10:25:31AM +0200, Serge Semin wrote: > > All of the DW PCIe core driver entities have names with the dw_ prefix in > > order to easily distinguish local and common PCIe name spaces. All except > > the pcie_port structure which contains the DW PCIe Root Port descriptor. > > For historical reason the structure has retained the original name since > > commit 340cba6092c2 ("pci: Add PCIe driver for Samsung Exynos") when > > the DW PCIe IP-core support was added to the kernel. Let's finally fix > > that by adding the dw_ prefix to the structure name and by adding the _rp > > suffix to be similar to the EP counterpart. Thus the name will be coherent > > with the common driver naming policy. It shall make the driver code more > > readable eliminating visual confusion between the local and generic PCI > > name spaces. > > Hi Serge, Hi Jesper > > I think that most variable and parameters of this type is named "pp" for > "pcie_port". > If this is the way we want to go, those should be changed also to "rp", right? Basically you may be right, but the change you suggest is much harder to provide and may cause additional problems I have much doubts it is really required. One thing is to update the struct name, but a whole another story is to change the variables definition especially across all the platform drivers involved here and especially of such frequently used object as the DW PCIe Root Port descriptor. First of all what you suggest will affect much-much-much more code lines than this one, which in its turn will eventually cause problems with the backporting of the new patches to the older stable kernels released before the one with the updated names. Secondly it is a matter of a separate patch, which can be added by someone who would think it was really required. So to speak I don't think that changing the variable names worth it especially seeing the driver naming convention isn't perfect at all in many other aspects like using name "pci" of the dw_pcie structure instance. -Sergey > > /Jesper > > > Signed-off-by: Serge Semin > > > > --- > > > > Changelog v4: > > - This is a new patch created on the v4 lap of the series. > > --- > > drivers/pci/controller/dwc/pci-dra7xx.c | 12 +++ > > drivers/pci/controller/dwc/pci-exynos.c | 6 ++-- > > drivers/pci/controller/dwc/pci-imx6.c | 6 ++-- > > drivers/pci/controller/dwc/pci-keystone.c | 20 +-- > > drivers/pci/controller/dwc/pci-layerscape.c | 2 +- > > drivers/pci/controller/dwc/pci-meson.c| 2 +- > > drivers/pci/controller/dwc/pcie-al.c | 6 ++-- > > drivers/pci/controller/dwc/pcie-armada8k.c| 4 +-- > > drivers/pci/controller/dwc/pcie-artpec6.c | 4 +-- > > .../pci/controller/dwc/pcie-designware-host.c | 36 +-- > > .../pci/controller/dwc/pcie-designware-plat.c | 2 +- > > drivers/pci/controller/dwc/pcie-designware.h | 30 > > drivers/pci/controller/dwc/pcie-dw-rockchip.c | 4 +-- > > drivers/pci/controller/dwc/pcie-fu740.c | 2 +- > > drivers/pci/controller/dwc/pcie-histb.c | 10 +++--- > > drivers/pci/controller/dwc/pcie-intel-gw.c| 6 ++-- > > drivers/pci/controller/dwc/pcie-keembay.c | 4 +-- > > drivers/pci/controller/dwc/pcie-kirin.c | 2 +- > > drivers/pci/controller/dwc/pcie-qcom.c| 4 +-- > > drivers/pci/controller/dwc/pcie-spear13xx.c | 6 ++-- > > drivers/pci/controller/dwc/pcie-tegra194.c| 22 ++-- > > drivers/pci/controller/dwc/pcie-uniphier.c| 10 +++--- > > drivers/pci/controller/dwc/pcie-visconti.c| 6 ++-- > > 23 files changed, 103 insertions(+), 103 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c > > b/drivers/pci/controller/dwc/pci-dra7xx.c > > index dfcdeb432dc8..a174b680b2a7 100644 > > --- a/drivers/pci/controller/dwc/pci-dra7xx.c > > +++ b/drivers/pci/controller/dwc/pci-dra7xx.c > > @@ -178,7 +178,7 @@ static void dra7xx_pcie_enable_interrupts(struct > > dra7xx_pcie *dra7xx) > > dra7xx_pcie_enable_msi_interrupts(dra7xx)
[PATCH v4 15/18] PCI: dwc: Add dw_ prefix to the pcie_port structure name
All of the DW PCIe core driver entities have names with the dw_ prefix in order to easily distinguish local and common PCIe name spaces. All except the pcie_port structure which contains the DW PCIe Root Port descriptor. For historical reason the structure has retained the original name since commit 340cba6092c2 ("pci: Add PCIe driver for Samsung Exynos") when the DW PCIe IP-core support was added to the kernel. Let's finally fix that by adding the dw_ prefix to the structure name and by adding the _rp suffix to be similar to the EP counterpart. Thus the name will be coherent with the common driver naming policy. It shall make the driver code more readable eliminating visual confusion between the local and generic PCI name spaces. Signed-off-by: Serge Semin --- Changelog v4: - This is a new patch created on the v4 lap of the series. --- drivers/pci/controller/dwc/pci-dra7xx.c | 12 +++ drivers/pci/controller/dwc/pci-exynos.c | 6 ++-- drivers/pci/controller/dwc/pci-imx6.c | 6 ++-- drivers/pci/controller/dwc/pci-keystone.c | 20 +-- drivers/pci/controller/dwc/pci-layerscape.c | 2 +- drivers/pci/controller/dwc/pci-meson.c| 2 +- drivers/pci/controller/dwc/pcie-al.c | 6 ++-- drivers/pci/controller/dwc/pcie-armada8k.c| 4 +-- drivers/pci/controller/dwc/pcie-artpec6.c | 4 +-- .../pci/controller/dwc/pcie-designware-host.c | 36 +-- .../pci/controller/dwc/pcie-designware-plat.c | 2 +- drivers/pci/controller/dwc/pcie-designware.h | 30 drivers/pci/controller/dwc/pcie-dw-rockchip.c | 4 +-- drivers/pci/controller/dwc/pcie-fu740.c | 2 +- drivers/pci/controller/dwc/pcie-histb.c | 10 +++--- drivers/pci/controller/dwc/pcie-intel-gw.c| 6 ++-- drivers/pci/controller/dwc/pcie-keembay.c | 4 +-- drivers/pci/controller/dwc/pcie-kirin.c | 2 +- drivers/pci/controller/dwc/pcie-qcom.c| 4 +-- drivers/pci/controller/dwc/pcie-spear13xx.c | 6 ++-- drivers/pci/controller/dwc/pcie-tegra194.c| 22 ++-- drivers/pci/controller/dwc/pcie-uniphier.c| 10 +++--- drivers/pci/controller/dwc/pcie-visconti.c| 6 ++-- 23 files changed, 103 insertions(+), 103 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c index dfcdeb432dc8..a174b680b2a7 100644 --- a/drivers/pci/controller/dwc/pci-dra7xx.c +++ b/drivers/pci/controller/dwc/pci-dra7xx.c @@ -178,7 +178,7 @@ static void dra7xx_pcie_enable_interrupts(struct dra7xx_pcie *dra7xx) dra7xx_pcie_enable_msi_interrupts(dra7xx); } -static int dra7xx_pcie_host_init(struct pcie_port *pp) +static int dra7xx_pcie_host_init(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pci); @@ -202,7 +202,7 @@ static const struct irq_domain_ops intx_domain_ops = { .xlate = pci_irqd_intx_xlate, }; -static int dra7xx_pcie_handle_msi(struct pcie_port *pp, int index) +static int dra7xx_pcie_handle_msi(struct dw_pcie_rp *pp, int index) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); unsigned long val; @@ -224,7 +224,7 @@ static int dra7xx_pcie_handle_msi(struct pcie_port *pp, int index) return 1; } -static void dra7xx_pcie_handle_msi_irq(struct pcie_port *pp) +static void dra7xx_pcie_handle_msi_irq(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); int ret, i, count, num_ctrls; @@ -255,8 +255,8 @@ static void dra7xx_pcie_msi_irq_handler(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); struct dra7xx_pcie *dra7xx; + struct dw_pcie_rp *pp; struct dw_pcie *pci; - struct pcie_port *pp; unsigned long reg; u32 bit; @@ -344,7 +344,7 @@ static irqreturn_t dra7xx_pcie_irq_handler(int irq, void *arg) return IRQ_HANDLED; } -static int dra7xx_pcie_init_irq_domain(struct pcie_port *pp) +static int dra7xx_pcie_init_irq_domain(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct device *dev = pci->dev; @@ -475,7 +475,7 @@ static int dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx, { int ret; struct dw_pcie *pci = dra7xx->pci; - struct pcie_port *pp = &pci->pp; + struct dw_pcie_rp *pp = &pci->pp; struct device *dev = pci->dev; pp->irq = platform_get_irq(pdev, 1); diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c index 467c8d1cd7e4..2044d191fba6 100644 --- a/drivers/pci/controller/dwc/pci-exynos.c +++ b/drivers/pci/controller/dwc/pci-exynos.c @@ -249,7 +249,7 @@ static int exynos_pcie_link_up(struct dw_pcie *pci) return (val & PCIE_ELBI_XMLH_LINKUP); } -static int exynos_pcie_host_init(struct pcie_port *pp) +static int exynos_pcie_host_init(struct d
[PATCH RESEND v8 0/7] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
vger.kernel.org to the list of Ccecipients. Link: https://lore.kernel.org/linux-usb/20210210172850.20849-1-sergey.se...@baikalelectronics.ru Link: https://lore.kernel.org/linux-usb/20210212205521.14280-1-sergey.se...@baikalelectronics.ru Changelog v7: - Replace "of_get_child_by_name(np, "usb") ?: of_get_child_by_name(np, "dwc3");" pattern with using of_get_compatible_child() method in the Qcom DWC3 driver. - Drop the patches: [PATCH v6 01/10] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name [PATCH v6 02/10] arm: dts: keystone: Correct DWC USB3 compatible string [PATCH v6 06/10] arm: dts: keystone: Harmonize DWC USB3 DT nodes name since they have been applied to the corresponding maintainers repos. - Cleanup the list of recipients. - Rebase onto kernel 5.12-rc4. Link: https://lore.kernel.org/lkml/20210324204836.29668-1-sergey.se...@baikalelectronics.ru/ Changelog v8: - Just resend. Cc: Khuong Dinh Cc: Patrice Chotard Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linux-arm-...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-snps-...@lists.infradead.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (7): arc: dts: Harmonize EHCI/OHCI DT nodes name arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name arm64: dts: apm: Harmonize DWC USB3 DT nodes name usb: dwc3: qcom: Detect DWC3 DT-nodes using compatible string arm64: dts: qcom: Harmonize DWC USB3 DT nodes name arch/arc/boot/dts/axc003.dtsi| 4 ++-- arch/arc/boot/dts/axc003_idu.dtsi| 4 ++-- arch/arc/boot/dts/axs10x_mb.dtsi | 4 ++-- arch/arc/boot/dts/hsdk.dts | 4 ++-- arch/arc/boot/dts/vdk_axs10x_mb.dtsi | 2 +- arch/arm/boot/dts/lpc18xx.dtsi | 4 ++-- arch/arm/boot/dts/stih407-family.dtsi| 2 +- arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 4 ++-- arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 +++--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/ipq8074.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8996.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8998.dtsi| 2 +- arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- arch/powerpc/boot/dts/akebono.dts| 6 +++--- drivers/usb/dwc3/dwc3-qcom.c | 2 +- 20 files changed, 35 insertions(+), 35 deletions(-) -- 2.30.1
[PATCH RESEND v8 3/7] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.30.1
[PATCH v7 0/7] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
vger.kernel.org to the list of Ccecipients. Link: https://lore.kernel.org/linux-usb/20210210172850.20849-1-sergey.se...@baikalelectronics.ru Link: https://lore.kernel.org/linux-usb/20210212205521.14280-1-sergey.se...@baikalelectronics.ru Changelog v7: - Replace "of_get_child_by_name(np, "usb") ?: of_get_child_by_name(np, "dwc3");" pattern with using of_get_compatible_child() method in the Qcom DWC3 driver. - Drop the patches: [PATCH v6 01/10] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name [PATCH v6 02/10] arm: dts: keystone: Correct DWC USB3 compatible string [PATCH v6 06/10] arm: dts: keystone: Harmonize DWC USB3 DT nodes name since they have been applied to the corresponding maintainers repos. - Cleanup the list of recipients. - Rebase onto kernel 5.12-rc4. Cc: Khuong Dinh Cc: Patrice Chotard Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linux-arm-...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-snps-...@lists.infradead.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (7): arc: dts: Harmonize EHCI/OHCI DT nodes name arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name arm64: dts: apm: Harmonize DWC USB3 DT nodes name usb: dwc3: qcom: Detect DWC3 DT-nodes using compatible string arm64: dts: qcom: Harmonize DWC USB3 DT nodes name arch/arc/boot/dts/axc003.dtsi| 4 ++-- arch/arc/boot/dts/axc003_idu.dtsi| 4 ++-- arch/arc/boot/dts/axs10x_mb.dtsi | 4 ++-- arch/arc/boot/dts/hsdk.dts | 4 ++-- arch/arc/boot/dts/vdk_axs10x_mb.dtsi | 2 +- arch/arm/boot/dts/lpc18xx.dtsi | 4 ++-- arch/arm/boot/dts/stih407-family.dtsi| 2 +- arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 4 ++-- arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 +++--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/ipq8074.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8996.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8998.dtsi| 2 +- arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- arch/powerpc/boot/dts/akebono.dts| 6 +++--- drivers/usb/dwc3/dwc3-qcom.c | 2 +- 20 files changed, 35 insertions(+), 35 deletions(-) -- 2.30.1
[PATCH v7 3/7] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.30.1
Re: [PATCH RESEND v6 00/10] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
On Wed, Feb 10, 2021 at 10:21:47AM -0800, Florian Fainelli wrote: > On 2/10/21 9:28 AM, Serge Semin wrote: > > As the subject states this series is an attempt to harmonize the xHCI, > > EHCI, OHCI and DWC USB3 DT nodes with the DT schema introduced in the > > framework of the patchset [1]. > > > > Firstly as Krzysztof suggested we've deprecated a support of DWC USB3 > > controllers with "synopsys,"-vendor prefix compatible string in favor of > > the ones with valid "snps,"-prefix. It's done in all the DTS files, > > which have been unfortunate to define such nodes. > > > > Secondly we suggest to fix the snps,quirk-frame-length-adjustment property > > declaration in the Amlogic meson-g12-common.dtsi DTS file, since it has > > been erroneously declared as boolean while having uint32 type. Neil said > > it was ok to init that property with 0x20 value. > > > > Thirdly the main part of the patchset concern fixing the xHCI, EHCI/OHCI > > and DWC USB3 DT nodes name as in accordance with their DT schema the > > corresponding node name is suppose to comply with the Generic USB HCD DT > > schema, which requires the USB nodes to have the name acceptable by the > > regexp: "^usb(@.*)?". Such requirement had been applicable even before we > > introduced the new DT schema in [1], but as we can see it hasn't been > > strictly implemented for a lot the DTS files. Since DT schema is now > > available the automated DTS validation shall make sure that the rule isn't > > violated. > > > > Note most of these patches have been a part of the last three patches of > > [1]. But since there is no way to have them merged in in a combined > > manner, I had to move them to the dedicated series and split them up so to > > be accepted by the corresponding subsystem maintainers one-by-one. > > > > [1] Link: > > https://lore.kernel.org/linux-usb/20201014101402.18271-1-sergey.se...@baikalelectronics.ru/ > > Changelog v1: > > - As Krzysztof suggested I've created a script which checked whether the > > node names had been also updated in all the depended dts files. As a > > result I found two more files which should have been also modified: > > arch/arc/boot/dts/{axc003.dtsi,axc003_idu.dtsi} > > - Correct the USB DWC3 nodes name found in > > arch/arm64/boot/dts/apm/{apm-storm.dtsi,apm-shadowcat.dtsi} too. > > > > Link: > > https://lore.kernel.org/linux-usb/20201020115959.2658-1-sergey.se...@baikalelectronics.ru > > Changelog v2: > > - Drop the patch: > > [PATCH 01/29] usb: dwc3: Discard synopsys,dwc3 compatibility string > > and get back the one which marks the "synopsys,dwc3" compatible string > > as deprecated into the DT schema related series. > > - Drop the patches: > > [PATCH 03/29] arm: dts: am437x: Correct DWC USB3 compatible string > > [PATCH 04/29] arm: dts: exynos: Correct DWC USB3 compatible string > > [PATCH 07/29] arm: dts: bcm53x: Harmonize EHCI/OHCI DT nodes name > > [PATCH 08/29] arm: dts: stm32: Harmonize EHCI/OHCI DT nodes name > > [PATCH 16/29] arm: dts: bcm5301x: Harmonize xHCI DT nodes name > > [PATCH 19/29] arm: dts: exynos: Harmonize DWC USB3 DT nodes name > > [PATCH 21/29] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name > > [PATCH 22/29] arm: dts: omap5: Harmonize DWC USB3 DT nodes name > > [PATCH 24/29] arm64: dts: allwinner: h6: Harmonize DWC USB3 DT nodes name > > [PATCH 26/29] arm64: dts: exynos: Harmonize DWC USB3 DT nodes name > > [PATCH 27/29] arm64: dts: layerscape: Harmonize DWC USB3 DT nodes name > > since they have been applied to the corresponding maintainers repos. > > - Fix drivers/usb/dwc3/dwc3-qcom.c to be looking for the "usb@"-prefixed > > sub-node and falling back to the "dwc3@"-prefixed one on failure. > > > > Link: > > https://lore.kernel.org/linux-usb/2020091552.15593-1-sergey.se...@baikalelectronics.ru > > Changelog v3: > > - Drop the patches: > > [PATCH v2 04/18] arm: dts: hisi-x5hd2: Harmonize EHCI/OHCI DT nodes name > > [PATCH v2 06/18] arm64: dts: hisi: Harmonize EHCI/OHCI DT nodes name > > [PATCH v2 07/18] mips: dts: jz47x: Harmonize EHCI/OHCI DT nodes name > > [PATCH v2 08/18] mips: dts: sead3: Harmonize EHCI/OHCI DT nodes name > > [PATCH v2 09/18] mips: dts: ralink: mt7628a: Harmonize EHCI/OHCI DT nodes > > name > > [PATCH v2 11/18] arm64: dts: marvell: cp11x: Harmonize xHCI DT nodes name > > [PATCH v2 12/18] arm: dts: marvell: armada-375: Harmonize DWC USB3 DT > > nodes name > >
[PATCH RESEND v6 00/10] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
.org to the list of Ccecipients. Cc: Vineet Gupta Cc: Rafal Milecki Cc: Wei Xu Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Jason Cooper Cc: Santosh Shilimkar Cc: Shawn Guo Cc: Benoit Cousson Cc: Patrice Chotard Cc: Maxime Ripard Cc: Khuong Dinh Cc: Andy Gross Cc: Alexey Brodkin Cc: Hauke Mehrtens Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Amelie Delaunay Cc: Vladimir Zapolskiy Cc: Paul Cercueil Cc: Matthias Brugger Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Cc: Kukjin Kim Cc: Li Yang Cc: Tony Lindgren Cc: Chen-Yu Tsai Cc: Bjorn Andersson Cc: Jun Li Cc: linux-snps-...@lists.infradead.org Cc: bcm-kernel-feedback-l...@broadcom.com Cc: linux-st...@st-md-mailman.stormreply.com Cc: linux-arm-ker...@lists.infradead.org Cc: linux-m...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-samsung-...@vger.kernel.org Cc: linux-o...@vger.kernel.org Cc: linux-arm-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (10): arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name arm: dts: keystone: Correct DWC USB3 compatible string arc: dts: Harmonize EHCI/OHCI DT nodes name arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name arm: dts: keystone: Harmonize DWC USB3 DT nodes name arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name arm64: dts: apm: Harmonize DWC USB3 DT nodes name usb: dwc3: qcom: Detect DWC3 DT-nodes with "usb"-prefixed names arm64: dts: qcom: Harmonize DWC USB3 DT nodes name arch/arc/boot/dts/axc003.dtsi| 4 ++-- arch/arc/boot/dts/axc003_idu.dtsi| 4 ++-- arch/arc/boot/dts/axs10x_mb.dtsi | 4 ++-- arch/arc/boot/dts/hsdk.dts | 4 ++-- arch/arc/boot/dts/vdk_axs10x_mb.dtsi | 2 +- arch/arm/boot/dts/keystone-k2e.dtsi | 6 +++--- arch/arm/boot/dts/keystone.dtsi | 4 ++-- arch/arm/boot/dts/lpc18xx.dtsi | 4 ++-- arch/arm/boot/dts/ls1021a.dtsi | 2 +- arch/arm/boot/dts/stih407-family.dtsi| 2 +- arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 4 ++-- arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 +++--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/ipq8074.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8996.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8998.dtsi| 2 +- arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- arch/powerpc/boot/dts/akebono.dts| 6 +++--- drivers/usb/dwc3/dwc3-qcom.c | 3 ++- 23 files changed, 42 insertions(+), 41 deletions(-) -- 2.30.0
[PATCH v6 05/10] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.30.0
[PATCH v5 05/10] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.29.2
[PATCH v5 00/10] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
Cc: Benoit Cousson Cc: Patrice Chotard Cc: Maxime Ripard Cc: Khuong Dinh Cc: Andy Gross Cc: Alexey Brodkin Cc: Hauke Mehrtens Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Amelie Delaunay Cc: Vladimir Zapolskiy Cc: Paul Cercueil Cc: Matthias Brugger Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Cc: Kukjin Kim Cc: Li Yang Cc: Tony Lindgren Cc: Chen-Yu Tsai Cc: Bjorn Andersson Cc: Jun Li Cc: linux-snps-...@lists.infradead.org Cc: bcm-kernel-feedback-l...@broadcom.com Cc: linux-st...@st-md-mailman.stormreply.com Cc: linux-arm-ker...@lists.infradead.org Cc: linux-m...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-samsung-...@vger.kernel.org Cc: linux-o...@vger.kernel.org Cc: linux-arm-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (10): arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name arm: dts: keystone: Correct DWC USB3 compatible string arc: dts: Harmonize EHCI/OHCI DT nodes name arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name arm: dts: keystone: Harmonize DWC USB3 DT nodes name arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name arm64: dts: apm: Harmonize DWC USB3 DT nodes name usb: dwc3: qcom: Detect DWC3 DT-nodes with "usb"-prefixed names arm64: dts: qcom: Harmonize DWC USB3 DT nodes name arch/arc/boot/dts/axc003.dtsi| 4 ++-- arch/arc/boot/dts/axc003_idu.dtsi| 4 ++-- arch/arc/boot/dts/axs10x_mb.dtsi | 4 ++-- arch/arc/boot/dts/hsdk.dts | 4 ++-- arch/arc/boot/dts/vdk_axs10x_mb.dtsi | 2 +- arch/arm/boot/dts/keystone-k2e.dtsi | 6 +++--- arch/arm/boot/dts/keystone.dtsi | 4 ++-- arch/arm/boot/dts/lpc18xx.dtsi | 4 ++-- arch/arm/boot/dts/ls1021a.dtsi | 2 +- arch/arm/boot/dts/stih407-family.dtsi| 2 +- arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 4 ++-- arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 +++--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/ipq8074.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8996.dtsi| 4 ++-- arch/arm64/boot/dts/qcom/msm8998.dtsi| 2 +- arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- arch/powerpc/boot/dts/akebono.dts| 6 +++--- drivers/usb/dwc3/dwc3-qcom.c | 3 ++- 23 files changed, 42 insertions(+), 41 deletions(-) -- 2.29.2
[PATCH v4 05/10] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.29.2
[PATCH RESEND v4 00/10] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
c: Bjorn Andersson Cc: Jun Li Cc: linux-snps-...@lists.infradead.org Cc: bcm-kernel-feedback-l...@broadcom.com Cc: linux-st...@st-md-mailman.stormreply.com Cc: linux-arm-ker...@lists.infradead.org Cc: linux-m...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-samsung-...@vger.kernel.org Cc: linux-o...@vger.kernel.org Cc: linux-arm-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (10): arm: dts: keystone: Correct DWC USB3 compatible string arm64: dts: amlogic: meson-g12: Set FL-adj property value arc: dts: Harmonize EHCI/OHCI DT nodes name arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name arm: dts: keystone: Harmonize DWC USB3 DT nodes name arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name arm64: dts: apm: Harmonize DWC USB3 DT nodes name usb: dwc3: qcom: Detect DWC3 DT-nodes with "usb"-prefixed names arm64: dts: qcom: Harmonize DWC USB3 DT nodes name arch/arc/boot/dts/axc003.dtsi | 4 ++-- arch/arc/boot/dts/axc003_idu.dtsi | 4 ++-- arch/arc/boot/dts/axs10x_mb.dtsi | 4 ++-- arch/arc/boot/dts/hsdk.dts| 4 ++-- arch/arc/boot/dts/vdk_axs10x_mb.dtsi | 2 +- arch/arm/boot/dts/keystone-k2e.dtsi | 6 +++--- arch/arm/boot/dts/keystone.dtsi | 4 ++-- arch/arm/boot/dts/lpc18xx.dtsi| 4 ++-- arch/arm/boot/dts/stih407-family.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 2 +- arch/arm64/boot/dts/apm/apm-shadowcat.dtsi| 4 ++-- arch/arm64/boot/dts/apm/apm-storm.dtsi| 6 +++--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- arch/powerpc/boot/dts/akebono.dts | 6 +++--- drivers/usb/dwc3/dwc3-qcom.c | 3 ++- 23 files changed, 42 insertions(+), 41 deletions(-) -- 2.29.2
[PATCH v6 19/19] dt-bindings: usb: intel, keembay-dwc3: Validate DWC3 sub-node
Intel Keem Bay DWC3 compatible DT nodes are supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Let's use the available DWC USB3 DT schema to validate the Intel Keem Bay DWC3 sub-nodes. Note since the generic DWC USB3 DT node is supposed to be named as generic USB HCD ("^usb(@.*)?") one we have to accordingly fix the sub-nodes name regexp and fix the DT node example. Signed-off-by: Serge Semin Acked-by: Wan Ahmad Zainie Reviewed-by: Rob Herring --- Changelog v5: - This is a new patch created for the new Intel Keem Bay bindings file, which has been added just recently. Changelog v6: - Fix typo in the commit log: Qualcomm sub-node should be called as Intel Keem Bay sub-node --- .../devicetree/bindings/usb/intel,keembay-dwc3.yaml | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml b/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml index dd32c10ce6c7..43b91ab62004 100644 --- a/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml @@ -34,11 +34,8 @@ properties: # Required child node: patternProperties: - "^dwc3@[0-9a-f]+$": -type: object -description: - A child node must exist to represent the core DWC3 IP block. - The content of the node is defined in dwc3.txt. + "^usb@[0-9a-f]+$": +$ref: snps,dwc3.yaml# required: - compatible @@ -68,7 +65,7 @@ examples: #address-cells = <1>; #size-cells = <1>; - dwc3@3400 { + usb@3400 { compatible = "snps,dwc3"; reg = <0x3400 0x1>; interrupts = ; -- 2.29.2
[PATCH v6 18/19] dt-bindings: usb: qcom,dwc3: Validate DWC3 sub-node
Qualcomm msm8996/sc7180/sdm845 DWC3 compatible DT nodes are supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Let's use the available DWC USB3 DT schema to validate the Qualcomm DWC3 sub-nodes. Note since the generic DWC USB3 DT node is supposed to be named as generic USB HCD ("^usb(@.*)?") one we have to accordingly fix the sub-nodes name regexp and fix the DT node example. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Discard the "^dwc3@[0-9a-f]+$" nodes from being acceptable as sub-nodes. --- Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index 2cf525d21e05..b336662e838c 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -103,11 +103,8 @@ properties: # Required child node: patternProperties: - "^dwc3@[0-9a-f]+$": -type: object -description: - A child node must exist to represent the core DWC3 IP block - The content of the node is defined in dwc3.txt. + "^usb@[0-9a-f]+$": +$ref: snps,dwc3.yaml# required: - compatible @@ -162,7 +159,7 @@ examples: resets = <&gcc GCC_USB30_PRIM_BCR>; -dwc3@a60 { +usb@a60 { compatible = "snps,dwc3"; reg = <0 0x0a60 0 0xcd00>; interrupts = ; -- 2.29.2
[PATCH v6 17/19] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
TI Keystone DWC3 compatible DT node is supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Since DWC USB3 has now got a DT schema describing its DT node, let's make sure the TI Keystone DWC3 sub-node passes validation against it. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/it'/its" --- Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml index c1b19fc5d0a2..ca7fbe3ed22e 100644 --- a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml @@ -64,9 +64,7 @@ properties: patternProperties: "usb@[a-f0-9]+$": -type: object -description: This is the node representing the DWC3 controller instance - Documentation/devicetree/bindings/usb/dwc3.txt +$ref: snps,dwc3.yaml# required: - compatible -- 2.29.2
[PATCH v6 16/19] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
Amlogic G12A USB DT sub-nodes are supposed to be compatible with the generic DWC USB2 and USB3 devices. Since now we've got DT schemas for both of the later IP cores let's make sure that the Amlogic G12A USB DT nodes are fully evaluated including the DWC sub-nodes. Signed-off-by: Serge Semin Reviewed-by: Neil Armstrong Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl --- Changelog v2: - Use "oneOf: [dwc2.yaml#, snps,dwc3.yaml#]" instead of the bulky "if: properties: compatibe: ..." statement. --- .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml index 1eda16dd4ee0..e349fa5de606 100644 --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml @@ -79,7 +79,9 @@ properties: patternProperties: "^usb@[0-9a-f]+$": -type: object +oneOf: + - $ref: dwc2.yaml# + - $ref: snps,dwc3.yaml# additionalProperties: false -- 2.29.2
[PATCH v6 15/19] dt-bindings: usb: meson-g12a-usb: Fix FL-adj property value
An empty snps,quirk-frame-length-adjustment won't cause any change performed by the driver. Moreover the DT schema validation will fail, since it expects the property being assigned with some value. So set fix the example by setting a valid FL-adj value in accordance with Neil Armstrong comment. Link: https://lore.kernel.org/linux-usb/20201010224121.12672-16-sergey.se...@baikalelectronics.ru/ Signed-off-by: Serge Semin Acked-by: Neil Armstrong Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl --- Note the same problem is in the DT source file arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi . --- .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml index c0058332b967..1eda16dd4ee0 100644 --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml @@ -229,6 +229,6 @@ examples: interrupts = <30>; dr_mode = "host"; snps,dis_u2_susphy_quirk; - snps,quirk-frame-length-adjustment; + snps,quirk-frame-length-adjustment = <0x20>; }; }; -- 2.29.2
[PATCH v6 14/19] dt-bindings: usb: dwc3: Add Frame Length Adj constraints
In accordance with the IP core databook the snps,quirk-frame-length-adjustment property can be set within [0, 0x3F]. Let's make sure the DT schema applies a correct constraints on the property. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index e01a9a93d74a..2247da77eac1 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -243,6 +243,8 @@ properties: length adjustment when the fladj_30mhz_sdbnd signal is invalid or incorrect. $ref: /schemas/types.yaml#/definitions/uint32 +minimum: 0 +maximum: 0x3f snps,rx-thr-num-pkt-prd: description: -- 2.29.2
[PATCH v6 13/19] dt-bindings: usb: dwc3: Add Tx De-emphasis constraints
In accordance with the driver comments the PIPE3 de-emphasis can be tuned to be either -6dB, -2.5dB or disabled. Let's add the de-emphasis property constraints so the DT schema would make sure the controller DT node is equipped with correct value. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/tunned/tuned" - Grammar fix: remove redundant "or" conjunction. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 6253bc5fb18e..e01a9a93d74a 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -156,6 +156,10 @@ properties: The value driven to the PHY is controlled by the LTSSM during USB3 Compliance mode. $ref: /schemas/types.yaml#/definitions/uint8 +enum: + - 0 # -6dB de-emphasis + - 1 # -3.5dB de-emphasis + - 2 # No de-emphasis snps,dis_u3_susphy_quirk: description: When set core will disable USB3 suspend phy -- 2.29.2
[PATCH v6 11/19] dt-bindings: usb: dwc3: Add interrupt-names property support
The controller driver supports two types of DWC USB3 devices: with a common interrupt lane and with individual interrupts for each mode. Add support for both these cases to the DWC USB3 DT schema. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/both of these cases support/support for both these cases" - Drop quotes from around the string constants. Changelog v4: - Discard the block scalar style modifier "|" from the interrupts property description. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 57caca8339ae..87a92e313d24 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -34,8 +34,19 @@ properties: const: snps,dwc3 interrupts: +description: + It's either a single common DWC3 interrupt (dwc_usb3) or individual + interrupts for the host, gadget and DRD modes. +minItems: 1 +maxItems: 3 + + interrupt-names: minItems: 1 maxItems: 3 +oneOf: + - const: dwc_usb3 + - items: + enum: [host, peripheral, otg] clocks: description: -- 2.29.2
[PATCH v6 10/19] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
DWC USB3 DT node is supposed to be compliant with the Generic xHCI Controller schema, but with additional vendor-specific properties, the controller-specific reference clocks and PHYs. So let's convert the currently available legacy text-based DWC USB3 bindings to the DT schema and make sure the DWC USB3 nodes are also validated against the usb-xhci.yaml schema. Note 1. we have to discard the nodename restriction of being prefixed with "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes are supposed to be named as "^usb(@.*)". Note 2. The clock-related properties are marked as optional to match the DWC USB3 driver expectation and to improve the bindings mainainability so in case if there is a glue-node it would the responsible for the clocks initialization. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Discard '|' from the descriptions, since we don't need to preserve the text formatting in any of them. - Drop quotes from around the string constants. - Fix the "clock-names" prop description to be referring the enumerated clock-names instead of the ones from the Databook. Changelog v3: - Apply usb-xhci.yaml# schema only if the controller is supposed to work as either host or otg. Changelog v4: - Apply usb-drd.yaml schema first. If the controller is configured to work in a gadget mode only, then apply the usb.yaml schema too, otherwise apply the usb-xhci.yaml schema. - Discard the Rob'es Reviewed-by tag. Please review the patch one more time. Changelog v5: - Add "snps,dis-split-quirk" property to the DWC USB3 DT schema. - Add a commit log text about the clock-related property changes. - Make sure dr_mode exist to apply the USB-gadget-only schema. Changelog v6: - Fix identations in the "usb-phy" property definition. --- .../devicetree/bindings/usb/dwc3.txt | 128 --- .../devicetree/bindings/usb/snps,dwc3.yaml| 312 ++ 2 files changed, 312 insertions(+), 128 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt deleted file mode 100644 index 1aae2b6160c1.. --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ /dev/null @@ -1,128 +0,0 @@ -synopsys DWC3 CORE - -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties - as described in 'usb/generic.txt' - -Required properties: - - compatible: must be "snps,dwc3" - - reg : Address and length of the register set for the device - - interrupts: Interrupts used by the dwc3 controller. - - clock-names: list of clock names. Ideally should be "ref", -"bus_early", "suspend" but may be less or more. - - clocks: list of phandle and clock specifier pairs corresponding to - entries in the clock-names property. - -Exception for clocks: - clocks are optional if the parent node (i.e. glue-layer) is compatible to - one of the following: -"cavium,octeon-7130-usb-uctl" -"qcom,dwc3" -"samsung,exynos5250-dwusb3" -"samsung,exynos5433-dwusb3" -"samsung,exynos7-dwusb3" -"sprd,sc9860-dwc3" -"st,stih407-dwc3" -"ti,am437x-dwc3" -"ti,dwc3" -"ti,keystone-dwc3" -"rockchip,rk3399-dwc3" -"xlnx,zynqmp-dwc3" - -Optional properties: - - usb-phy : array of phandle for the PHY device. The first element - in the array is expected to be a handle to the USB2/HS PHY and - the second element is expected to be a handle to the USB3/SS PHY - - phys: from the *Generic PHY* bindings - - phy-names: from the *Generic PHY* bindings; supported names are "usb2-phy" - or "usb3-phy". - - resets: set of phandle and reset specifier pairs - - snps,usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM - - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable - - snps,dis-start-transfer-quirk: when set, disable isoc START TRANSFER command - failure SW work-around for DWC_usb31 version 1.70a-ea06 - and prior. - - snps,disable_scramble_quirk: true when SW should disable data scrambling. - Only really useful for FPGA builds. - - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled - - snps,lpm-nyet-threshold: LPM NYET threshold - - snps,u2exit_lfps_quirk: set if we want to enable u2exit lfps quirk - - snps,u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk - - snps,req_p1p2p3_quirk: when set, the core will always request for - P1/P2/P3 transition sequence. - - snps,del_p1p2p3_quirk: when set core
[PATCH v6 12/19] dt-bindings: usb: dwc3: Add synopsys, dwc3 compatible string
The DWC USB3 driver and some DTS files like Exynos 5250, Keystone k2e, etc expects the DWC USB3 DT node to have the compatible string with the "synopsys" vendor prefix. Let's add the corresponding compatible string to the controller DT schema, but mark it as deprecated seeing the Synopsys, Inc. is presented with just "snps" vendor prefix. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Drop quotes from around the compat string constant. Changelog v4: - Get the patch back, since we can't discard the deprecated prefix from the driver. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 87a92e313d24..6253bc5fb18e 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -31,7 +31,10 @@ allOf: properties: compatible: contains: - const: snps,dwc3 + oneOf: +- const: snps,dwc3 +- const: synopsys,dwc3 + deprecated: true interrupts: description: -- 2.29.2
[PATCH v6 08/19] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device
For some reason the "brcm,xhci-brcm-v2" compatible string has been missing in the original bindings file. Add it to the Generic xHCI Controllers DT schema since the controller driver expects it to be supported. Signed-off-by: Serge Semin Acked-by: Florian Fainelli Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/generic-xhci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml index 1ea1d49a8175..23d73df96ea3 100644 --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -26,7 +26,9 @@ properties: - marvell,armada-8k-xhci - const: generic-xhci - description: Broadcom STB SoCs with xHCI -const: brcm,bcm7445-xhci +enum: + - brcm,xhci-brcm-v2 + - brcm,bcm7445-xhci - description: Generic xHCI device const: xhci-platform deprecated: true -- 2.29.2
[PATCH v6 07/19] dt-bindings: usb: Convert xHCI bindings to DT schema
Currently the DT bindings of Generic xHCI Controllers are described by means of the legacy text file. Since such format is deprecated in favor of the DT schema, let's convert the Generic xHCI Controllers bindings file to the corresponding yaml files. There will be two of them: a DT schema for the xHCI controllers on a generic platform and a DT schema validating a generic xHCI controllers properties. The later will be used to validate the xHCI controllers, which aside from some vendor-specific features support the basic xHCI functionality. An xHCI-compatible DT node shall support the standard USB HCD properties and custom ones like: usb2-lpm-disable, usb3-lpm-capable, quirk-broken-port-ped and imod-interval-ns. In addition if a generic xHCI controller is being validated against the DT schema it is also supposed to be equipped with mandatory compatible string, single registers range, single interrupts source, and is supposed to optionally contain up to two reference clocks for the controller core and CSRs. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Add explicit "additionalProperties: true" to the usb-xhci.yaml schema, since additionalProperties/unevaluatedProperties are going to be mandary for each binding. --- .../devicetree/bindings/usb/generic-xhci.yaml | 63 +++ .../devicetree/bindings/usb/usb-xhci.txt | 41 .../devicetree/bindings/usb/usb-xhci.yaml | 42 + 3 files changed, 105 insertions(+), 41 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml new file mode 100644 index ..1ea1d49a8175 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/generic-xhci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: USB xHCI Controller Device Tree Bindings + +maintainers: + - Mathias Nyman + +allOf: + - $ref: "usb-xhci.yaml#" + +properties: + compatible: +oneOf: + - description: Generic xHCI device +const: generic-xhci + - description: Armada 37xx/375/38x/8k SoCs +items: + - enum: + - marvell,armada3700-xhci + - marvell,armada-375-xhci + - marvell,armada-380-xhci + - marvell,armada-8k-xhci + - const: generic-xhci + - description: Broadcom STB SoCs with xHCI +const: brcm,bcm7445-xhci + - description: Generic xHCI device +const: xhci-platform +deprecated: true + + reg: +maxItems: 1 + + interrupts: +maxItems: 1 + + clocks: +minItems: 1 +maxItems: 2 + + clock-names: +minItems: 1 +items: + - const: core + - const: reg + +unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | +usb@f0931000 { + compatible = "generic-xhci"; + reg = <0xf0931000 0x8c8>; + interrupts = <0x0 0x4e 0x0>; +}; diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt deleted file mode 100644 index 0c5cff84a969.. --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt +++ /dev/null @@ -1,41 +0,0 @@ -USB xHCI controllers - -Required properties: - - compatible: should be one or more of - -- "generic-xhci" for generic XHCI device -- "marvell,armada3700-xhci" for Armada 37xx SoCs -- "marvell,armada-375-xhci" for Armada 375 SoCs -- "marvell,armada-380-xhci" for Armada 38x SoCs -- "brcm,bcm7445-xhci" for Broadcom STB SoCs with XHCI -- "xhci-platform" (deprecated) - -When compatible with the generic version, nodes must list the -SoC-specific version corresponding to the platform first -followed by the generic version. - - - reg: should contain address and length of the standard XHCI -register set for the device. - - interrupts: one XHCI interrupt should be described here. - -Optional properties: - - clocks: reference to the clocks - - clock-names: mandatory if there is a second clock, in this case -the name must be "core" for the first clock and "reg" for the -second one - - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM - - usb3-lpm-capable: determines if platform is USB3 LPM capable - - quirk-broken-port-ped: set if the controller has broken port disable mechanism - - imod-interval-ns: default interrupt moderation interval is 5000ns - - phys : see usb-hcd.yaml in the current dire
[PATCH v6 05/19] dt-bindings: usb: usb-hcd: Add "tpl-support" property
The host controller device might be designed to work for the particular products or applications. In that case its DT node is supposed to be equipped with the tpl-support property. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/it'/its" - Discard '|' from the property description, since we don't need to preserve the text formatting. --- Documentation/devicetree/bindings/usb/usb-hcd.yaml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml index 52cc84c400c0..9881ac10380d 100644 --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml @@ -17,6 +17,12 @@ properties: description: Phandle of a companion device $ref: /schemas/types.yaml#/definitions/phandle + tpl-support: +description: + Indicates if the Targeted Peripheral List is supported for given + targeted hosts (non-PC hosts). +type: boolean + additionalProperties: true examples: -- 2.29.2
[PATCH v6 09/19] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file
With minor peculiarities (like uploading some vendor-specific firmware) these are just Generic xHCI controllers fully compatible with its properties. Make sure the Renesas USB xHCI DT nodes are also validated against the Generic xHCI DT schema. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Reviewed-by: Yoshihiro Shimoda Reviewed-by: Lad Prabhakar --- Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml index 0f078bd0a3e5..7e5ed196b52c 100644 --- a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml @@ -11,7 +11,7 @@ maintainers: - Yoshihiro Shimoda allOf: - - $ref: "usb-hcd.yaml" + - $ref: "usb-xhci.yaml" properties: compatible: @@ -69,7 +69,7 @@ required: - power-domains - resets -additionalProperties: false +unevaluatedProperties: false examples: - | -- 2.29.2
[PATCH v6 06/19] dt-bindings: usb: Add generic "usb-phy" property
Even though the Generic PHY framework is the more preferable way of setting the USB PHY up, there are still many dts-files and DT bindings which rely on having the legacy "usb-phy" specified to attach particular USB PHYs to USB cores. Let's have the "usb-phy" property described in the generic USB HCD binding file so it would be validated against the nodes in which it's specified. Mark the property as deprecated to discourage the developers from using it. Signed-off-by: Serge Semin Acked-by: Martin Blumenstingl Reviewed-by: Rob Herring --- Changelog v2: - Discard '|' from the property description, since we don't need to preserve the text formatting. Changelog v4: - Move the "usb-phy" property definition into the usb.yaml schema where all generic USB properties are now defined. --- Documentation/devicetree/bindings/usb/usb.yaml | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml index 53144c4600c0..ebe7f4275c59 100644 --- a/Documentation/devicetree/bindings/usb/usb.yaml +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -24,6 +24,13 @@ properties: description: Name specifier for the USB PHY + usb-phy: +$ref: /schemas/types.yaml#/definitions/phandle-array +description: + List of all the USB PHYs on this HCD to be accepted by the legacy USB + Physical Layer subsystem. +deprecated: true + phy_type: description: Tells USB controllers that we want to configure the core to support a -- 2.29.2
[PATCH v6 00/19] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema
the clock-related properties bindings with respect to the original binding file. - Discard duplicated "additionalProperties" from the usb-hcd.yaml schema. - Make sure dr_mode exist in DW USB3 node to apply the USB-gadget-only schema. - Add a new patch: [PATCH v5 19/19] dt-bindings: usb: intel,keembay-dwc3: Validate DWC3 sub-node since the Intel Keem Bay DWC3 bindings has been just added. Link: https://lore.kernel.org/linux-usb/20201205152427.29537-1-sergey.se...@baikalelectronics.ru Changelog v6: - Fix typo in the commit log: [PATCH v5 19/19] dt-bindings: usb: intel,keembay-dwc3: Validate DWC3 sub-node Qualcomm sub-node should be called as Intel eem Bay sub-node. - Fix identations in the "usb-phy" property definition. - Fix identations in the "maximum-speed" property definition. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Pavel Parkhomenko Cc: Andy Gross Cc: Bjorn Andersson Cc: Manu Gautam Cc: Roger Quadros Cc: Lad Prabhakar Cc: Yoshihiro Shimoda Cc: Neil Armstrong Cc: Kevin Hilman Cc: Martin Blumenstingl Cc: Ahmad Zainie Cc: linux-arm-ker...@lists.infradead.org Cc: linux-snps-...@lists.infradead.org Cc: linux-m...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (19): dt-bindings: usb: usb-hcd: Detach generic USB controller properties dt-bindings: usb: Convert generic USB properties to DT schemas dt-bindings: usb: usb-drd: Add "otg-rev" property constraints dt-bindings: usb: Add "ulpi/serial/hsic" PHY types dt-bindings: usb: usb-hcd: Add "tpl-support" property dt-bindings: usb: Add generic "usb-phy" property dt-bindings: usb: Convert xHCI bindings to DT schema dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file dt-bindings: usb: Convert DWC USB3 bindings to DT schema dt-bindings: usb: dwc3: Add interrupt-names property support dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string dt-bindings: usb: dwc3: Add Tx De-emphasis constraints dt-bindings: usb: dwc3: Add Frame Length Adj constraints dt-bindings: usb: meson-g12a-usb: Fix FL-adj property value dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node dt-bindings: usb: qcom,dwc3: Validate DWC3 sub-node dt-bindings: usb: intel,keembay-dwc3: Validate DWC3 sub-node .../usb/amlogic,meson-g12a-usb-ctrl.yaml | 6 +- .../devicetree/bindings/usb/dwc3.txt | 128 --- .../devicetree/bindings/usb/generic-xhci.yaml | 65 .../devicetree/bindings/usb/generic.txt | 57 --- .../bindings/usb/intel,keembay-dwc3.yaml | 9 +- .../devicetree/bindings/usb/qcom,dwc3.yaml| 9 +- .../bindings/usb/renesas,usb-xhci.yaml| 4 +- .../devicetree/bindings/usb/snps,dwc3.yaml| 332 ++ .../bindings/usb/ti,keystone-dwc3.yaml| 4 +- .../devicetree/bindings/usb/usb-drd.yaml | 78 .../devicetree/bindings/usb/usb-hcd.yaml | 19 +- .../devicetree/bindings/usb/usb-xhci.txt | 41 --- .../devicetree/bindings/usb/usb-xhci.yaml | 42 +++ .../devicetree/bindings/usb/usb.yaml | 60 14 files changed, 600 insertions(+), 254 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml create mode 100644 Documentation/devicetree/bindings/usb/usb-drd.yaml delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml create mode 100644 Documentation/devicetree/bindings/usb/usb.yaml -- 2.29.2
[PATCH v6 02/19] dt-bindings: usb: Convert generic USB properties to DT schemas
The generic USB properties have been described in the legacy bindings text file: Documentation/devicetree/bindings/usb/generic.txt . Let's convert its content into the generic USB, USB HCD and USB DRD DT schemas. So the Generic USB schema will be applicable to all USB controllers, USB HCD - for the generic USB Host controllers and the USB DRD - for the USB Dual-role controllers. Note the USB DRD schema is supposed to work in conjunction with the USB peripheral/gadget and USB host controllers DT schemas. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Discard '|' in all the new properties, since we don't need to preserve the text formatting. - Convert abbreviated form of the "maximum-speed" enum restriction into the multi-lined version of the list. - Drop quotes from around the string constants. Changelog v4: - Redistribute the properties between generic ones, USB HCD-specific and USB DRD-specific. - Discard the Rob'es Reviewed-by tag. Please review the patch one more time. Changelog v6: - Fix identations in the "maximum-speed" property definition. --- .../devicetree/bindings/usb/generic.txt | 57 -- .../devicetree/bindings/usb/usb-drd.yaml | 77 +++ .../devicetree/bindings/usb/usb-hcd.yaml | 5 ++ .../devicetree/bindings/usb/usb.yaml | 22 ++ 4 files changed, 104 insertions(+), 57 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-drd.yaml diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt deleted file mode 100644 index ba472e7aefc9.. --- a/Documentation/devicetree/bindings/usb/generic.txt +++ /dev/null @@ -1,57 +0,0 @@ -Generic USB Properties - -Optional properties: - - maximum-speed: tells USB controllers we want to work up to a certain - speed. Valid arguments are "super-speed-plus", - "super-speed", "high-speed", "full-speed" and - "low-speed". In case this isn't passed via DT, USB - controllers should default to their maximum HW - capability. - - dr_mode: tells Dual-Role USB controllers that we want to work on a - particular mode. Valid arguments are "host", - "peripheral" and "otg". In case this attribute isn't - passed via DT, USB DRD controllers should default to - OTG. - - phy_type: tells USB controllers that we want to configure the core to support - a UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is - selected. Valid arguments are "utmi" and "utmi_wide". - In case this isn't passed via DT, USB controllers should - default to HW capability. - - otg-rev: tells usb driver the release number of the OTG and EH supplement - with which the device and its descriptors are compliant, - in binary-coded decimal (i.e. 2.0 is 0200H). This - property is used if any real OTG features(HNP/SRP/ADP) - is enabled, if ADP is required, otg-rev should be - 0x0200 or above. - - companion: phandle of a companion - - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP - is the basic function of real OTG except you want it - to be a srp-capable only B device. - - srp-disable: tells OTG controllers we want to disable OTG SRP, SRP is - optional for OTG device. - - adp-disable: tells OTG controllers we want to disable OTG ADP, ADP is - optional for OTG device. - - usb-role-switch: boolean, indicates that the device is capable of assigning - the USB data role (USB host or USB device) for a given - USB connector, such as Type-C, Type-B(micro). - see connector/usb-connector.yaml. - - role-switch-default-mode: indicating if usb-role-switch is enabled, the - device default operation mode of controller while usb - role is USB_ROLE_NONE. Valid arguments are "host" and - "peripheral". Defaults to "peripheral" if not - specified. - - -This is an attribute to a USB controller such as: - -dwc3@4a03 { - compatible = "synopsys,dwc3"; - reg = <0x4a03 0xcfff>; - interrupts = <0 92 4> - usb-phy = <&usb2_phy>, <&usb3,phy>; - maximum-speed = "super-sp
[PATCH v6 03/19] dt-bindings: usb: usb-drd: Add "otg-rev" property constraints
There are only four OTG revisions are currently supported by the kernel: 0x0100, 0x0120, 0x0130, 0x0200. Any another value is considered as invalid. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v4: - Move the constraints to the usb-drd.yaml schema where the otg-rev property is now defined. --- Documentation/devicetree/bindings/usb/usb-drd.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/usb-drd.yaml b/Documentation/devicetree/bindings/usb/usb-drd.yaml index f3a64c46dcd0..f229fc8068d9 100644 --- a/Documentation/devicetree/bindings/usb/usb-drd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-drd.yaml @@ -18,6 +18,7 @@ properties: features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be 0x0200 or above. $ref: /schemas/types.yaml#/definitions/uint32 +enum: [0x0100, 0x0120, 0x0130, 0x0200] dr_mode: description: -- 2.29.2
[PATCH v6 04/19] dt-bindings: usb: Add "ulpi/serial/hsic" PHY types
Aside from the UTMI+ there are also ULPI, Serial and HSIC PHY types that can be specified in the phy_type HCD property. Add them to the enumeration of the acceptable values. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/PHY types can be/PHY types that can be" - Drop quotes from around the string constants. Changelog v4: - Move the new PHY types definitions into the usb.yaml schema where the phy_type property is now defined. --- Documentation/devicetree/bindings/usb/usb.yaml | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml index aab74c671ccc..53144c4600c0 100644 --- a/Documentation/devicetree/bindings/usb/usb.yaml +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -27,11 +27,13 @@ properties: phy_type: description: Tells USB controllers that we want to configure the core to support a - UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is selected. In case - this isn't passed via DT, USB controllers should default to HW - capability. + UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is selected, UTMI+ low + pin interface if ULPI is specified, Serial core/PHY interconnect if + serial is specified and High-Speed Inter-Chip feature if HSIC is + selected. In case this isn't passed via DT, USB controllers should + default to HW capability. $ref: /schemas/types.yaml#/definitions/string -enum: [utmi, utmi_wide] +enum: [utmi, utmi_wide, ulpi, serial, hsic] maximum-speed: description: -- 2.29.2
[PATCH v6 01/19] dt-bindings: usb: usb-hcd: Detach generic USB controller properties
There can be three distinctive types of the USB controllers: USB hosts, USB peripherals/gadgets and USB OTG, which can switch from one role to another. In order to have that hierarchy handled in the DT binding files, we need to collect common properties in a common DT schema and specific properties in dedicated schemas. Seeing the usb-hcd.yaml DT schema is dedicated for the USB host controllers only, let's move some common properties from there into the usb.yaml schema. So the later would be available to evaluate all currently supported types of the USB controllers. While at it add an explicit "additionalProperties: true" into the usb-hcd.yaml as setting the additionalProperties/unevaluateProperties properties is going to be get mandatory soon. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v4: - This is a new patch created as a result of the comment left by Chunfeng Yun in v3 Changelog v5: - Discard duplicated additionalProperties property definition. --- .../devicetree/bindings/usb/usb-hcd.yaml | 14 ++--- .../devicetree/bindings/usb/usb.yaml | 29 +++ 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb.yaml diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml index b545b087b342..81f3ad1419d8 100644 --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml @@ -9,18 +9,8 @@ title: Generic USB Host Controller Device Tree Bindings maintainers: - Greg Kroah-Hartman -properties: - $nodename: -pattern: "^usb(@.*)?" - - phys: -$ref: /schemas/types.yaml#/definitions/phandle-array -description: - List of all the USB PHYs on this HCD - - phy-names: -description: - Name specifier for the USB PHY +allOf: + - $ref: usb.yaml# additionalProperties: true diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml new file mode 100644 index ..941ad59fbac5 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic USB Controller Device Tree Bindings + +maintainers: + - Greg Kroah-Hartman + +select: false + +properties: + $nodename: +pattern: "^usb(@.*)?" + + phys: +$ref: /schemas/types.yaml#/definitions/phandle-array +description: + List of all the USB PHYs on this HCD + + phy-names: +description: + Name specifier for the USB PHY + +additionalProperties: true + +... -- 2.29.2
Re: [PATCH v5 19/19] dt-bindings: usb: intel,keembay-dwc3: Validate DWC3 sub-node
Hi Wan, On Sun, Dec 06, 2020 at 09:56:47AM +, Wan Mohamad, Wan Ahmad Zainie wrote: > Hi Serge. > > > -Original Message- > > From: Serge Semin > > Sent: Saturday, December 5, 2020 11:24 PM > > To: Nyman, Mathias ; Felipe Balbi > > ; Krzysztof Kozlowski ; Greg Kroah- > > Hartman ; Rob Herring > > ; Chunfeng Yun ; > > Wan Mohamad, Wan Ahmad Zainie > > > > Cc: Serge Semin ; Serge Semin > > ; Alexey Malahov > > ; Pavel Parkhomenko > > ; Andy Gross > > ; Bjorn Andersson ; > > Manu Gautam ; Roger Quadros > > ; Lad Prabhakar > lad...@bp.renesas.com>; Yoshihiro Shimoda > > ; narmstrong > > ; Kevin Hilman ; > > Martin Blumenstingl ; linux-arm- > > ker...@lists.infradead.org; linux-snps-...@lists.infradead.org; linux- > > m...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux- > > u...@vger.kernel.org; devicet...@vger.kernel.org; linux- > > ker...@vger.kernel.org > > Subject: [PATCH v5 19/19] dt-bindings: usb: intel,keembay-dwc3: Validate > > DWC3 sub-node > > > > Intel Keem Bay DWC3 compatible DT nodes are supposed to have a DWC > > USB3 compatible sub-node to describe a fully functioning USB interface. > > Let's > > use the available DWC USB3 DT schema to validate the Qualcomm DWC3 sub- > > nodes. > > > > Note since the generic DWC USB3 DT node is supposed to be named as > > generic USB HCD ("^usb(@.*)?") one we have to accordingly fix the sub- > > nodes name regexp and fix the DT node example. > > > > Signed-off-by: Serge Semin > > LGTM. With minor change to fix the typo above, Qualcomm to Intel > Keem Bay, > Acked-by: Wan Ahmad Zainie Ah, right. Thanks for noticing that. A probability of copy-paste mistakes increases proportionally to the number sleepless hours.) -Sergey > > > > > --- > > > > Changelog v5: > > - This is a new patch created for the new Intel Keem Bay bindings file, > > which has been added just recently. > > --- > > .../devicetree/bindings/usb/intel,keembay-dwc3.yaml | 9 +++-- > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/usb/intel,keembay- > > dwc3.yaml b/Documentation/devicetree/bindings/usb/intel,keembay- > > dwc3.yaml > > index dd32c10ce6c7..43b91ab62004 100644 > > --- a/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml > > +++ b/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml > > @@ -34,11 +34,8 @@ properties: > > # Required child node: > > > > patternProperties: > > - "^dwc3@[0-9a-f]+$": > > -type: object > > -description: > > - A child node must exist to represent the core DWC3 IP block. > > - The content of the node is defined in dwc3.txt. > > + "^usb@[0-9a-f]+$": > > +$ref: snps,dwc3.yaml# > > > > required: > >- compatible > > @@ -68,7 +65,7 @@ examples: > >#address-cells = <1>; > >#size-cells = <1>; > > > > - dwc3@3400 { > > + usb@3400 { > > compatible = "snps,dwc3"; > > reg = <0x3400 0x1>; > > interrupts = ; > > -- > > 2.29.2 > > Best regards, > Zainie
[PATCH v3 05/10] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.29.2
[PATCH RESEND v3 00/10] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
...@st-md-mailman.stormreply.com Cc: linux-arm-ker...@lists.infradead.org Cc: linux-m...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-samsung-...@vger.kernel.org Cc: linux-o...@vger.kernel.org Cc: linux-arm-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (10): arm: dts: keystone: Correct DWC USB3 compatible string arm64: dts: amlogic: meson-g12: Set FL-adj property value arc: dts: Harmonize EHCI/OHCI DT nodes name arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name arm: dts: keystone: Harmonize DWC USB3 DT nodes name arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name arm64: dts: apm: Harmonize DWC USB3 DT nodes name usb: dwc3: qcom: Detect DWC3 DT-nodes with "usb"-prefixed names arm64: dts: qcom: Harmonize DWC USB3 DT nodes name arch/arc/boot/dts/axc003.dtsi | 4 ++-- arch/arc/boot/dts/axc003_idu.dtsi | 4 ++-- arch/arc/boot/dts/axs10x_mb.dtsi | 4 ++-- arch/arc/boot/dts/hsdk.dts| 4 ++-- arch/arc/boot/dts/vdk_axs10x_mb.dtsi | 2 +- arch/arm/boot/dts/keystone-k2e.dtsi | 6 +++--- arch/arm/boot/dts/keystone.dtsi | 4 ++-- arch/arm/boot/dts/lpc18xx.dtsi| 4 ++-- arch/arm/boot/dts/stih407-family.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 2 +- arch/arm64/boot/dts/apm/apm-shadowcat.dtsi| 4 ++-- arch/arm64/boot/dts/apm/apm-storm.dtsi| 6 +++--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs404.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- arch/powerpc/boot/dts/akebono.dts | 6 +++--- drivers/usb/dwc3/dwc3-qcom.c | 3 ++- 23 files changed, 42 insertions(+), 41 deletions(-) -- 2.29.2
[PATCH v5 19/19] dt-bindings: usb: intel, keembay-dwc3: Validate DWC3 sub-node
Intel Keem Bay DWC3 compatible DT nodes are supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Let's use the available DWC USB3 DT schema to validate the Qualcomm DWC3 sub-nodes. Note since the generic DWC USB3 DT node is supposed to be named as generic USB HCD ("^usb(@.*)?") one we have to accordingly fix the sub-nodes name regexp and fix the DT node example. Signed-off-by: Serge Semin --- Changelog v5: - This is a new patch created for the new Intel Keem Bay bindings file, which has been added just recently. --- .../devicetree/bindings/usb/intel,keembay-dwc3.yaml | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml b/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml index dd32c10ce6c7..43b91ab62004 100644 --- a/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/intel,keembay-dwc3.yaml @@ -34,11 +34,8 @@ properties: # Required child node: patternProperties: - "^dwc3@[0-9a-f]+$": -type: object -description: - A child node must exist to represent the core DWC3 IP block. - The content of the node is defined in dwc3.txt. + "^usb@[0-9a-f]+$": +$ref: snps,dwc3.yaml# required: - compatible @@ -68,7 +65,7 @@ examples: #address-cells = <1>; #size-cells = <1>; - dwc3@3400 { + usb@3400 { compatible = "snps,dwc3"; reg = <0x3400 0x1>; interrupts = ; -- 2.29.2
[PATCH v5 18/19] dt-bindings: usb: qcom,dwc3: Validate DWC3 sub-node
Qualcomm msm8996/sc7180/sdm845 DWC3 compatible DT nodes are supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Let's use the available DWC USB3 DT schema to validate the Qualcomm DWC3 sub-nodes. Note since the generic DWC USB3 DT node is supposed to be named as generic USB HCD ("^usb(@.*)?") one we have to accordingly fix the sub-nodes name regexp and fix the DT node example. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Discard the "^dwc3@[0-9a-f]+$" nodes from being acceptable as sub-nodes. --- Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index 2cf525d21e05..b336662e838c 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -103,11 +103,8 @@ properties: # Required child node: patternProperties: - "^dwc3@[0-9a-f]+$": -type: object -description: - A child node must exist to represent the core DWC3 IP block - The content of the node is defined in dwc3.txt. + "^usb@[0-9a-f]+$": +$ref: snps,dwc3.yaml# required: - compatible @@ -162,7 +159,7 @@ examples: resets = <&gcc GCC_USB30_PRIM_BCR>; -dwc3@a60 { +usb@a60 { compatible = "snps,dwc3"; reg = <0 0x0a60 0 0xcd00>; interrupts = ; -- 2.29.2
[PATCH v5 17/19] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
TI Keystone DWC3 compatible DT node is supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Since DWC USB3 has now got a DT schema describing its DT node, let's make sure the TI Keystone DWC3 sub-node passes validation against it. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/it'/its" --- Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml index c1b19fc5d0a2..ca7fbe3ed22e 100644 --- a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml @@ -64,9 +64,7 @@ properties: patternProperties: "usb@[a-f0-9]+$": -type: object -description: This is the node representing the DWC3 controller instance - Documentation/devicetree/bindings/usb/dwc3.txt +$ref: snps,dwc3.yaml# required: - compatible -- 2.29.2
[PATCH v5 16/19] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
Amlogic G12A USB DT sub-nodes are supposed to be compatible with the generic DWC USB2 and USB3 devices. Since now we've got DT schemas for both of the later IP cores let's make sure that the Amlogic G12A USB DT nodes are fully evaluated including the DWC sub-nodes. Signed-off-by: Serge Semin Reviewed-by: Neil Armstrong Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl --- Changelog v2: - Use "oneOf: [dwc2.yaml#, snps,dwc3.yaml#]" instead of the bulky "if: properties: compatibe: ..." statement. --- .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml index 1eda16dd4ee0..e349fa5de606 100644 --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml @@ -79,7 +79,9 @@ properties: patternProperties: "^usb@[0-9a-f]+$": -type: object +oneOf: + - $ref: dwc2.yaml# + - $ref: snps,dwc3.yaml# additionalProperties: false -- 2.29.2
[PATCH v5 15/19] dt-bindings: usb: meson-g12a-usb: Fix FL-adj property value
An empty snps,quirk-frame-length-adjustment won't cause any change performed by the driver. Moreover the DT schema validation will fail, since it expects the property being assigned with some value. So set fix the example by setting a valid FL-adj value in accordance with Neil Armstrong comment. Link: https://lore.kernel.org/linux-usb/20201010224121.12672-16-sergey.se...@baikalelectronics.ru/ Signed-off-by: Serge Semin Acked-by: Neil Armstrong Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl --- Note the same problem is in the DT source file arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi . --- .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml index c0058332b967..1eda16dd4ee0 100644 --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml @@ -229,6 +229,6 @@ examples: interrupts = <30>; dr_mode = "host"; snps,dis_u2_susphy_quirk; - snps,quirk-frame-length-adjustment; + snps,quirk-frame-length-adjustment = <0x20>; }; }; -- 2.29.2
[PATCH v5 14/19] dt-bindings: usb: dwc3: Add Frame Length Adj constraints
In accordance with the IP core databook the snps,quirk-frame-length-adjustment property can be set within [0, 0x3F]. Let's make sure the DT schema applies a correct constraints on the property. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index e39ad899c92e..feb41f3e6b21 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -243,6 +243,8 @@ properties: length adjustment when the fladj_30mhz_sdbnd signal is invalid or incorrect. $ref: /schemas/types.yaml#/definitions/uint32 +minimum: 0 +maximum: 0x3f snps,rx-thr-num-pkt-prd: description: -- 2.29.2
[PATCH v5 09/19] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file
With minor peculiarities (like uploading some vendor-specific firmware) these are just Generic xHCI controllers fully compatible with its properties. Make sure the Renesas USB xHCI DT nodes are also validated against the Generic xHCI DT schema. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Reviewed-by: Yoshihiro Shimoda --- Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml index 0f078bd0a3e5..7e5ed196b52c 100644 --- a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml @@ -11,7 +11,7 @@ maintainers: - Yoshihiro Shimoda allOf: - - $ref: "usb-hcd.yaml" + - $ref: "usb-xhci.yaml" properties: compatible: @@ -69,7 +69,7 @@ required: - power-domains - resets -additionalProperties: false +unevaluatedProperties: false examples: - | -- 2.29.2
[PATCH v5 10/19] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
DWC USB3 DT node is supposed to be compliant with the Generic xHCI Controller schema, but with additional vendor-specific properties, the controller-specific reference clocks and PHYs. So let's convert the currently available legacy text-based DWC USB3 bindings to the DT schema and make sure the DWC USB3 nodes are also validated against the usb-xhci.yaml schema. Note 1. we have to discard the nodename restriction of being prefixed with "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes are supposed to be named as "^usb(@.*)". Note 2. The clock-related properties are marked as optional to match the DWC USB3 driver expectation and to improve the bindings mainainability so in case if there is a glue-node it would the responsible for the clocks initialization. Signed-off-by: Serge Semin --- Changelog v2: - Discard '|' from the descriptions, since we don't need to preserve the text formatting in any of them. - Drop quotes from around the string constants. - Fix the "clock-names" prop description to be referring the enumerated clock-names instead of the ones from the Databook. Changelog v3: - Apply usb-xhci.yaml# schema only if the controller is supposed to work as either host or otg. Changelog v4: - Apply usb-drd.yaml schema first. If the controller is configured to work in a gadget mode only, then apply the usb.yaml schema too, otherwise apply the usb-xhci.yaml schema. - Discard the Rob'es Reviewed-by tag. Please review the patch one more time. Changelog v5: - Add "snps,dis-split-quirk" property to the DWC USB3 DT schema. - Add a commit log text about the clock-related property changes. - Make sure dr_mode exist to apply the USB-gadget-only schema. --- .../devicetree/bindings/usb/dwc3.txt | 128 --- .../devicetree/bindings/usb/snps,dwc3.yaml| 312 ++ 2 files changed, 312 insertions(+), 128 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt deleted file mode 100644 index 1aae2b6160c1.. --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ /dev/null @@ -1,128 +0,0 @@ -synopsys DWC3 CORE - -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties - as described in 'usb/generic.txt' - -Required properties: - - compatible: must be "snps,dwc3" - - reg : Address and length of the register set for the device - - interrupts: Interrupts used by the dwc3 controller. - - clock-names: list of clock names. Ideally should be "ref", -"bus_early", "suspend" but may be less or more. - - clocks: list of phandle and clock specifier pairs corresponding to - entries in the clock-names property. - -Exception for clocks: - clocks are optional if the parent node (i.e. glue-layer) is compatible to - one of the following: -"cavium,octeon-7130-usb-uctl" -"qcom,dwc3" -"samsung,exynos5250-dwusb3" -"samsung,exynos5433-dwusb3" -"samsung,exynos7-dwusb3" -"sprd,sc9860-dwc3" -"st,stih407-dwc3" -"ti,am437x-dwc3" -"ti,dwc3" -"ti,keystone-dwc3" -"rockchip,rk3399-dwc3" -"xlnx,zynqmp-dwc3" - -Optional properties: - - usb-phy : array of phandle for the PHY device. The first element - in the array is expected to be a handle to the USB2/HS PHY and - the second element is expected to be a handle to the USB3/SS PHY - - phys: from the *Generic PHY* bindings - - phy-names: from the *Generic PHY* bindings; supported names are "usb2-phy" - or "usb3-phy". - - resets: set of phandle and reset specifier pairs - - snps,usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM - - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable - - snps,dis-start-transfer-quirk: when set, disable isoc START TRANSFER command - failure SW work-around for DWC_usb31 version 1.70a-ea06 - and prior. - - snps,disable_scramble_quirk: true when SW should disable data scrambling. - Only really useful for FPGA builds. - - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled - - snps,lpm-nyet-threshold: LPM NYET threshold - - snps,u2exit_lfps_quirk: set if we want to enable u2exit lfps quirk - - snps,u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk - - snps,req_p1p2p3_quirk: when set, the core will always request for - P1/P2/P3 transition sequence. - - snps,del_p1p2p3_quirk: when set core will delay P1/P2/P3 until a certain - amount of 8B10B errors occur. - - snps,de
[PATCH v5 12/19] dt-bindings: usb: dwc3: Add synopsys, dwc3 compatible string
The DWC USB3 driver and some DTS files like Exynos 5250, Keystone k2e, etc expects the DWC USB3 DT node to have the compatible string with the "synopsys" vendor prefix. Let's add the corresponding compatible string to the controller DT schema, but mark it as deprecated seeing the Synopsys, Inc. is presented with just "snps" vendor prefix. Signed-off-by: Serge Semin --- Changelog v2: - Drop quotes from around the compat string constant. Changelog v4: - Get the patch back, since we can't discard the deprecated prefix from the driver. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 94ede43586f7..b1890558affe 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -31,7 +31,10 @@ allOf: properties: compatible: contains: - const: snps,dwc3 + oneOf: +- const: snps,dwc3 +- const: synopsys,dwc3 + deprecated: true interrupts: description: -- 2.29.2
[PATCH v5 13/19] dt-bindings: usb: dwc3: Add Tx De-emphasis constraints
In accordance with the driver comments the PIPE3 de-emphasis can be tuned to be either -6dB, -2.5dB or disabled. Let's add the de-emphasis property constraints so the DT schema would make sure the controller DT node is equipped with correct value. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/tunned/tuned" - Grammar fix: remove redundant "or" conjunction. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index b1890558affe..e39ad899c92e 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -156,6 +156,10 @@ properties: The value driven to the PHY is controlled by the LTSSM during USB3 Compliance mode. $ref: /schemas/types.yaml#/definitions/uint8 +enum: + - 0 # -6dB de-emphasis + - 1 # -3.5dB de-emphasis + - 2 # No de-emphasis snps,dis_u3_susphy_quirk: description: When set core will disable USB3 suspend phy -- 2.29.2
[PATCH v5 07/19] dt-bindings: usb: Convert xHCI bindings to DT schema
Currently the DT bindings of Generic xHCI Controllers are described by means of the legacy text file. Since such format is deprecated in favor of the DT schema, let's convert the Generic xHCI Controllers bindings file to the corresponding yaml files. There will be two of them: a DT schema for the xHCI controllers on a generic platform and a DT schema validating a generic xHCI controllers properties. The later will be used to validate the xHCI controllers, which aside from some vendor-specific features support the basic xHCI functionality. An xHCI-compatible DT node shall support the standard USB HCD properties and custom ones like: usb2-lpm-disable, usb3-lpm-capable, quirk-broken-port-ped and imod-interval-ns. In addition if a generic xHCI controller is being validated against the DT schema it is also supposed to be equipped with mandatory compatible string, single registers range, single interrupts source, and is supposed to optionally contain up to two reference clocks for the controller core and CSRs. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Add explicit "additionalProperties: true" to the usb-xhci.yaml schema, since additionalProperties/unevaluatedProperties are going to be mandary for each binding. --- .../devicetree/bindings/usb/generic-xhci.yaml | 63 +++ .../devicetree/bindings/usb/usb-xhci.txt | 41 .../devicetree/bindings/usb/usb-xhci.yaml | 42 + 3 files changed, 105 insertions(+), 41 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml new file mode 100644 index ..1ea1d49a8175 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/generic-xhci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: USB xHCI Controller Device Tree Bindings + +maintainers: + - Mathias Nyman + +allOf: + - $ref: "usb-xhci.yaml#" + +properties: + compatible: +oneOf: + - description: Generic xHCI device +const: generic-xhci + - description: Armada 37xx/375/38x/8k SoCs +items: + - enum: + - marvell,armada3700-xhci + - marvell,armada-375-xhci + - marvell,armada-380-xhci + - marvell,armada-8k-xhci + - const: generic-xhci + - description: Broadcom STB SoCs with xHCI +const: brcm,bcm7445-xhci + - description: Generic xHCI device +const: xhci-platform +deprecated: true + + reg: +maxItems: 1 + + interrupts: +maxItems: 1 + + clocks: +minItems: 1 +maxItems: 2 + + clock-names: +minItems: 1 +items: + - const: core + - const: reg + +unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | +usb@f0931000 { + compatible = "generic-xhci"; + reg = <0xf0931000 0x8c8>; + interrupts = <0x0 0x4e 0x0>; +}; diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt deleted file mode 100644 index 0c5cff84a969.. --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt +++ /dev/null @@ -1,41 +0,0 @@ -USB xHCI controllers - -Required properties: - - compatible: should be one or more of - -- "generic-xhci" for generic XHCI device -- "marvell,armada3700-xhci" for Armada 37xx SoCs -- "marvell,armada-375-xhci" for Armada 375 SoCs -- "marvell,armada-380-xhci" for Armada 38x SoCs -- "brcm,bcm7445-xhci" for Broadcom STB SoCs with XHCI -- "xhci-platform" (deprecated) - -When compatible with the generic version, nodes must list the -SoC-specific version corresponding to the platform first -followed by the generic version. - - - reg: should contain address and length of the standard XHCI -register set for the device. - - interrupts: one XHCI interrupt should be described here. - -Optional properties: - - clocks: reference to the clocks - - clock-names: mandatory if there is a second clock, in this case -the name must be "core" for the first clock and "reg" for the -second one - - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM - - usb3-lpm-capable: determines if platform is USB3 LPM capable - - quirk-broken-port-ped: set if the controller has broken port disable mechanism - - imod-interval-ns: default interrupt moderation interval is 5000ns - - phys : see usb-hcd.yaml in the current dire
[PATCH v5 05/19] dt-bindings: usb: usb-hcd: Add "tpl-support" property
The host controller device might be designed to work for the particular products or applications. In that case its DT node is supposed to be equipped with the tpl-support property. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/it'/its" - Discard '|' from the property description, since we don't need to preserve the text formatting. --- Documentation/devicetree/bindings/usb/usb-hcd.yaml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml index 52cc84c400c0..9881ac10380d 100644 --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml @@ -17,6 +17,12 @@ properties: description: Phandle of a companion device $ref: /schemas/types.yaml#/definitions/phandle + tpl-support: +description: + Indicates if the Targeted Peripheral List is supported for given + targeted hosts (non-PC hosts). +type: boolean + additionalProperties: true examples: -- 2.29.2
[PATCH v5 11/19] dt-bindings: usb: dwc3: Add interrupt-names property support
The controller driver supports two types of DWC USB3 devices: with a common interrupt lane and with individual interrupts for each mode. Add support for both these cases to the DWC USB3 DT schema. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/both of these cases support/support for both these cases" - Drop quotes from around the string constants. Changelog v4: - Discard the block scalar style modifier "|" from the interrupts property description. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index f645fd918421..94ede43586f7 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -34,8 +34,19 @@ properties: const: snps,dwc3 interrupts: +description: + It's either a single common DWC3 interrupt (dwc_usb3) or individual + interrupts for the host, gadget and DRD modes. +minItems: 1 +maxItems: 3 + + interrupt-names: minItems: 1 maxItems: 3 +oneOf: + - const: dwc_usb3 + - items: + enum: [host, peripheral, otg] clocks: description: -- 2.29.2
[PATCH v5 08/19] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device
For some reason the "brcm,xhci-brcm-v2" compatible string has been missing in the original bindings file. Add it to the Generic xHCI Controllers DT schema since the controller driver expects it to be supported. Signed-off-by: Serge Semin Acked-by: Florian Fainelli Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/generic-xhci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml index 1ea1d49a8175..23d73df96ea3 100644 --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -26,7 +26,9 @@ properties: - marvell,armada-8k-xhci - const: generic-xhci - description: Broadcom STB SoCs with xHCI -const: brcm,bcm7445-xhci +enum: + - brcm,xhci-brcm-v2 + - brcm,bcm7445-xhci - description: Generic xHCI device const: xhci-platform deprecated: true -- 2.29.2
[PATCH v5 06/19] dt-bindings: usb: Add generic "usb-phy" property
Even though the Generic PHY framework is the more preferable way of setting the USB PHY up, there are still many dts-files and DT bindings which rely on having the legacy "usb-phy" specified to attach particular USB PHYs to USB cores. Let's have the "usb-phy" property described in the generic USB HCD binding file so it would be validated against the nodes in which it's specified. Mark the property as deprecated to discourage the developers from using it. Signed-off-by: Serge Semin Acked-by: Martin Blumenstingl Reviewed-by: Rob Herring --- Changelog v2: - Discard '|' from the property description, since we don't need to preserve the text formatting. Changelog v4: - Move the "usb-phy" property definition into the usb.yaml schema where all generic USB properties are now defined. --- Documentation/devicetree/bindings/usb/usb.yaml | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml index 6dc4821e63c3..5400893d693e 100644 --- a/Documentation/devicetree/bindings/usb/usb.yaml +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -24,6 +24,13 @@ properties: description: Name specifier for the USB PHY + usb-phy: +$ref: /schemas/types.yaml#/definitions/phandle-array +description: + List of all the USB PHYs on this HCD to be accepted by the legacy USB + Physical Layer subsystem. +deprecated: true + phy_type: description: Tells USB controllers that we want to configure the core to support a -- 2.29.2
[PATCH v5 04/19] dt-bindings: usb: Add "ulpi/serial/hsic" PHY types
Aside from the UTMI+ there are also ULPI, Serial and HSIC PHY types that can be specified in the phy_type HCD property. Add them to the enumeration of the acceptable values. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/PHY types can be/PHY types that can be" - Drop quotes from around the string constants. Changelog v4: - Move the new PHY types definitions into the usb.yaml schema where the phy_type property is now defined. --- Documentation/devicetree/bindings/usb/usb.yaml | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml index 991c02725e2b..6dc4821e63c3 100644 --- a/Documentation/devicetree/bindings/usb/usb.yaml +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -27,11 +27,13 @@ properties: phy_type: description: Tells USB controllers that we want to configure the core to support a - UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is selected. In case - this isn't passed via DT, USB controllers should default to HW - capability. + UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is selected, UTMI+ low + pin interface if ULPI is specified, Serial core/PHY interconnect if + serial is specified and High-Speed Inter-Chip feature if HSIC is + selected. In case this isn't passed via DT, USB controllers should + default to HW capability. $ref: /schemas/types.yaml#/definitions/string -enum: [utmi, utmi_wide] +enum: [utmi, utmi_wide, ulpi, serial, hsic] maximum-speed: description: -- 2.29.2
[PATCH v5 00/19] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema
the clock-related properties bindings with respect to the original binding file. - Discard duplicated "additionalProperties" from the usb-hcd.yaml schema. - Make sure dr_mode exist in DW USB3 node to apply the USB-gadget-only schema. - Add a new patch: [PATCH v5 19/19] dt-bindings: usb: intel,keembay-dwc3: Validate DWC3 sub-node since the Intel Keem Bay DWC3 bindings has been just added. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Pavel Parkhomenko Cc: Andy Gross Cc: Bjorn Andersson Cc: Manu Gautam Cc: Roger Quadros Cc: Lad Prabhakar Cc: Yoshihiro Shimoda Cc: Neil Armstrong Cc: Kevin Hilman Cc: Martin Blumenstingl Cc: Ahmad Zainie Cc: linux-arm-ker...@lists.infradead.org Cc: linux-snps-...@lists.infradead.org Cc: linux-m...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (19): dt-bindings: usb: usb-hcd: Detach generic USB controller properties dt-bindings: usb: Convert generic USB properties to DT schemas dt-bindings: usb: usb-drd: Add "otg-rev" property constraints dt-bindings: usb: Add "ulpi/serial/hsic" PHY types dt-bindings: usb: usb-hcd: Add "tpl-support" property dt-bindings: usb: Add generic "usb-phy" property dt-bindings: usb: Convert xHCI bindings to DT schema dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file dt-bindings: usb: Convert DWC USB3 bindings to DT schema dt-bindings: usb: dwc3: Add interrupt-names property support dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string dt-bindings: usb: dwc3: Add Tx De-emphasis constraints dt-bindings: usb: dwc3: Add Frame Length Adj constraints dt-bindings: usb: meson-g12a-usb: Fix FL-adj property value dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node dt-bindings: usb: qcom,dwc3: Validate DWC3 sub-node dt-bindings: usb: intel,keembay-dwc3: Validate DWC3 sub-node .../usb/amlogic,meson-g12a-usb-ctrl.yaml | 6 +- .../devicetree/bindings/usb/dwc3.txt | 128 --- .../devicetree/bindings/usb/generic-xhci.yaml | 65 .../devicetree/bindings/usb/generic.txt | 57 --- .../bindings/usb/intel,keembay-dwc3.yaml | 9 +- .../devicetree/bindings/usb/qcom,dwc3.yaml| 9 +- .../bindings/usb/renesas,usb-xhci.yaml| 4 +- .../devicetree/bindings/usb/snps,dwc3.yaml| 332 ++ .../bindings/usb/ti,keystone-dwc3.yaml| 4 +- .../devicetree/bindings/usb/usb-drd.yaml | 78 .../devicetree/bindings/usb/usb-hcd.yaml | 19 +- .../devicetree/bindings/usb/usb-xhci.txt | 41 --- .../devicetree/bindings/usb/usb-xhci.yaml | 42 +++ .../devicetree/bindings/usb/usb.yaml | 60 14 files changed, 600 insertions(+), 254 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml create mode 100644 Documentation/devicetree/bindings/usb/usb-drd.yaml delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml create mode 100644 Documentation/devicetree/bindings/usb/usb.yaml -- 2.29.2
[PATCH v5 03/19] dt-bindings: usb: usb-drd: Add "otg-rev" property constraints
There are only four OTG revisions are currently supported by the kernel: 0x0100, 0x0120, 0x0130, 0x0200. Any another value is considered as invalid. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v4: - Move the constraints to the usb-drd.yaml schema where the otg-rev property is now defined. --- Documentation/devicetree/bindings/usb/usb-drd.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/usb-drd.yaml b/Documentation/devicetree/bindings/usb/usb-drd.yaml index f3a64c46dcd0..f229fc8068d9 100644 --- a/Documentation/devicetree/bindings/usb/usb-drd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-drd.yaml @@ -18,6 +18,7 @@ properties: features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be 0x0200 or above. $ref: /schemas/types.yaml#/definitions/uint32 +enum: [0x0100, 0x0120, 0x0130, 0x0200] dr_mode: description: -- 2.29.2
[PATCH v5 02/19] dt-bindings: usb: Convert generic USB properties to DT schemas
The generic USB properties have been described in the legacy bindings text file: Documentation/devicetree/bindings/usb/generic.txt . Let's convert its content into the generic USB, USB HCD and USB DRD DT schemas. So the Generic USB schema will be applicable to all USB controllers, USB HCD - for the generic USB Host controllers and the USB DRD - for the USB Dual-role controllers. Note the USB DRD schema is supposed to work in conjunction with the USB peripheral/gadget and USB host controllers DT schemas. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Discard '|' in all the new properties, since we don't need to preserve the text formatting. - Convert abbreviated form of the "maximum-speed" enum restriction into the multi-lined version of the list. - Drop quotes from around the string constants. Changelog v4: - Redistribute the properties between generic ones, USB HCD-specific and USB DRD-specific. - Discard the Rob'es Reviewed-by tag. Please review the patch one more time. --- .../devicetree/bindings/usb/generic.txt | 57 -- .../devicetree/bindings/usb/usb-drd.yaml | 77 +++ .../devicetree/bindings/usb/usb-hcd.yaml | 5 ++ .../devicetree/bindings/usb/usb.yaml | 22 ++ 4 files changed, 104 insertions(+), 57 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-drd.yaml diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt deleted file mode 100644 index ba472e7aefc9.. --- a/Documentation/devicetree/bindings/usb/generic.txt +++ /dev/null @@ -1,57 +0,0 @@ -Generic USB Properties - -Optional properties: - - maximum-speed: tells USB controllers we want to work up to a certain - speed. Valid arguments are "super-speed-plus", - "super-speed", "high-speed", "full-speed" and - "low-speed". In case this isn't passed via DT, USB - controllers should default to their maximum HW - capability. - - dr_mode: tells Dual-Role USB controllers that we want to work on a - particular mode. Valid arguments are "host", - "peripheral" and "otg". In case this attribute isn't - passed via DT, USB DRD controllers should default to - OTG. - - phy_type: tells USB controllers that we want to configure the core to support - a UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is - selected. Valid arguments are "utmi" and "utmi_wide". - In case this isn't passed via DT, USB controllers should - default to HW capability. - - otg-rev: tells usb driver the release number of the OTG and EH supplement - with which the device and its descriptors are compliant, - in binary-coded decimal (i.e. 2.0 is 0200H). This - property is used if any real OTG features(HNP/SRP/ADP) - is enabled, if ADP is required, otg-rev should be - 0x0200 or above. - - companion: phandle of a companion - - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP - is the basic function of real OTG except you want it - to be a srp-capable only B device. - - srp-disable: tells OTG controllers we want to disable OTG SRP, SRP is - optional for OTG device. - - adp-disable: tells OTG controllers we want to disable OTG ADP, ADP is - optional for OTG device. - - usb-role-switch: boolean, indicates that the device is capable of assigning - the USB data role (USB host or USB device) for a given - USB connector, such as Type-C, Type-B(micro). - see connector/usb-connector.yaml. - - role-switch-default-mode: indicating if usb-role-switch is enabled, the - device default operation mode of controller while usb - role is USB_ROLE_NONE. Valid arguments are "host" and - "peripheral". Defaults to "peripheral" if not - specified. - - -This is an attribute to a USB controller such as: - -dwc3@4a03 { - compatible = "synopsys,dwc3"; - reg = <0x4a03 0xcfff>; - interrupts = <0 92 4> - usb-phy = <&usb2_phy>, <&usb3,phy>; - maximum-speed = "super-speed"; - dr_mode = "otg"; - phy_type = "utmi_wide
[PATCH v5 01/19] dt-bindings: usb: usb-hcd: Detach generic USB controller properties
There can be three distinctive types of the USB controllers: USB hosts, USB peripherals/gadgets and USB OTG, which can switch from one role to another. In order to have that hierarchy handled in the DT binding files, we need to collect common properties in a common DT schema and specific properties in dedicated schemas. Seeing the usb-hcd.yaml DT schema is dedicated for the USB host controllers only, let's move some common properties from there into the usb.yaml schema. So the later would be available to evaluate all currently supported types of the USB controllers. While at it add an explicit "additionalProperties: true" into the usb-hcd.yaml as setting the additionalProperties/unevaluateProperties properties is going to be get mandatory soon. Signed-off-by: Serge Semin --- Changelog v4: - This is a new patch created as a result of the comment left by Chunfeng Yun in v3 Changelog v5: - Discard duplicated additionalProperties property definition. --- .../devicetree/bindings/usb/usb-hcd.yaml | 14 ++--- .../devicetree/bindings/usb/usb.yaml | 29 +++ 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb.yaml diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml index b545b087b342..81f3ad1419d8 100644 --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml @@ -9,18 +9,8 @@ title: Generic USB Host Controller Device Tree Bindings maintainers: - Greg Kroah-Hartman -properties: - $nodename: -pattern: "^usb(@.*)?" - - phys: -$ref: /schemas/types.yaml#/definitions/phandle-array -description: - List of all the USB PHYs on this HCD - - phy-names: -description: - Name specifier for the USB PHY +allOf: + - $ref: usb.yaml# additionalProperties: true diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml new file mode 100644 index ..941ad59fbac5 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic USB Controller Device Tree Bindings + +maintainers: + - Greg Kroah-Hartman + +select: false + +properties: + $nodename: +pattern: "^usb(@.*)?" + + phys: +$ref: /schemas/types.yaml#/definitions/phandle-array +description: + List of all the USB PHYs on this HCD + + phy-names: +description: + Name specifier for the USB PHY + +additionalProperties: true + +... -- 2.29.2
Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
On Sat, Nov 21, 2020 at 06:42:28AM -0600, Rob Herring wrote: > On Thu, Nov 12, 2020 at 01:29:46PM +0300, Serge Semin wrote: > > On Wed, Nov 11, 2020 at 02:14:23PM -0600, Rob Herring wrote: > > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > > > Controller schema, but with additional vendor-specific properties, the > > > > controller-specific reference clocks and PHYs. So let's convert the > > > > currently available legacy text-based DWC USB3 bindings to the DT schema > > > > and make sure the DWC USB3 nodes are also validated against the > > > > usb-xhci.yaml schema. > > > > > > > > Note we have to discard the nodename restriction of being prefixed with > > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB > > > > nodes > > > > are supposed to be named as "^usb(@.*)". > > > > > > > > Signed-off-by: Serge Semin > > > > > > > > --- > > > > > > > > Changelog v2: > > > > - Discard '|' from the descriptions, since we don't need to preserve > > > > the text formatting in any of them. > > > > - Drop quotes from around the string constants. > > > > - Fix the "clock-names" prop description to be referring the enumerated > > > > clock-names instead of the ones from the Databook. > > > > > > > > Changelog v3: > > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > > > as either host or otg. > > > > > > > > Changelog v4: > > > > - Apply usb-drd.yaml schema first. If the controller is configured > > > > to work in a gadget mode only, then apply the usb.yaml schema too, > > > > otherwise apply the usb-xhci.yaml schema. > > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > > > time. > > > > --- > > > > .../devicetree/bindings/usb/dwc3.txt | 125 > > > > .../devicetree/bindings/usb/snps,dwc3.yaml| 303 ++ > > > > 2 files changed, 303 insertions(+), 125 deletions(-) > > > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > new file mode 100644 > > > > index ..079617891da6 > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > @@ -0,0 +1,303 @@ > > > > +# SPDX-License-Identifier: GPL-2.0 > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: Synopsys DesignWare USB3 Controller > > > > + > > > > +maintainers: > > > > + - Felipe Balbi > > > > + > > > > +description: > > > > + This is usually a subnode to DWC3 glue to which it is connected, but > > > > can also > > > > + be presented as a standalone DT node with an optional vendor-specific > > > > + compatible string. > > > > + > > > > > > +allOf: > > > > + - $ref: usb-drd.yaml# > > > > + - if: > > > > + properties: > > > > +dr_mode: > > > > + const: peripheral > > Another thing, this evaluates to true if dr_mode is not present. You > need to add 'required'? Right. Will something like this do that? + allOf: + - $ref: usb-drd.yaml# + - if: + properties: +dr_mode: + const: peripheral + + required: +- dr_mode +then: + $ref: usb.yaml# +else + $ref: usb-xhci.yaml# > If dr_mode is otg, then don't you need to apply > both usb.yaml and usb-xhci.yaml? No I don't. Since there is no peripheral-specific DT schema, then the only schema any USB-gadget node needs to pass is usb.yaml, which is already included into the usb-xhci.yaml schema. So for pure OTG devices with xHCI host and gadget capabilities it's enough to evaluate: allOf: [$ref: usb-drd.yaml#, $ref: usb-xhci.yaml#]. Please see the sketch/ASCII
Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
On Wed, Nov 11, 2020 at 02:14:23PM -0600, Rob Herring wrote: > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > Controller schema, but with additional vendor-specific properties, the > > controller-specific reference clocks and PHYs. So let's convert the > > currently available legacy text-based DWC USB3 bindings to the DT schema > > and make sure the DWC USB3 nodes are also validated against the > > usb-xhci.yaml schema. > > > > Note we have to discard the nodename restriction of being prefixed with > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes > > are supposed to be named as "^usb(@.*)". > > > > Signed-off-by: Serge Semin > > > > --- > > > > Changelog v2: > > - Discard '|' from the descriptions, since we don't need to preserve > > the text formatting in any of them. > > - Drop quotes from around the string constants. > > - Fix the "clock-names" prop description to be referring the enumerated > > clock-names instead of the ones from the Databook. > > > > Changelog v3: > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > as either host or otg. > > > > Changelog v4: > > - Apply usb-drd.yaml schema first. If the controller is configured > > to work in a gadget mode only, then apply the usb.yaml schema too, > > otherwise apply the usb-xhci.yaml schema. > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > time. > > --- > > .../devicetree/bindings/usb/dwc3.txt | 125 > > .../devicetree/bindings/usb/snps,dwc3.yaml| 303 ++ > > 2 files changed, 303 insertions(+), 125 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt > > b/Documentation/devicetree/bindings/usb/dwc3.txt > > deleted file mode 100644 > > index d03edf9d3935.. > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > > +++ /dev/null > > @@ -1,125 +0,0 @@ > > -synopsys DWC3 CORE > > - > > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties > > - as described in 'usb/generic.txt' > > - > > -Required properties: > > - - compatible: must be "snps,dwc3" > > - - reg : Address and length of the register set for the device > > - - interrupts: Interrupts used by the dwc3 controller. > > - - clock-names: list of clock names. Ideally should be "ref", > > -"bus_early", "suspend" but may be less or more. > > - - clocks: list of phandle and clock specifier pairs corresponding to > > - entries in the clock-names property. > > - > > -Exception for clocks: > > - clocks are optional if the parent node (i.e. glue-layer) is compatible to > > - one of the following: > > -"cavium,octeon-7130-usb-uctl" > > -"qcom,dwc3" > > -"samsung,exynos5250-dwusb3" > > -"samsung,exynos5433-dwusb3" > > -"samsung,exynos7-dwusb3" > > -"sprd,sc9860-dwc3" > > -"st,stih407-dwc3" > > -"ti,am437x-dwc3" > > -"ti,dwc3" > > -"ti,keystone-dwc3" > > -"rockchip,rk3399-dwc3" > > -"xlnx,zynqmp-dwc3" > > - > > -Optional properties: > > - - usb-phy : array of phandle for the PHY device. The first element > > - in the array is expected to be a handle to the USB2/HS PHY and > > - the second element is expected to be a handle to the USB3/SS PHY > > - - phys: from the *Generic PHY* bindings > > - - phy-names: from the *Generic PHY* bindings; supported names are > > "usb2-phy" > > - or "usb3-phy". > > - - resets: set of phandle and reset specifier pairs > > - - snps,usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM > > - - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable > > - - snps,dis-start-transfer-quirk: when set, disable isoc START TRANSFER > > command > > - failure SW work-around for DWC_usb31 version 1.70a-ea06 > > - and prior. > > - - snps,disable_scramble_quirk: true when SW should disable data > >
Re: [PATCH v4 01/18] dt-bindings: usb: usb-hcd: Detach generic USB controller properties
On Wed, Nov 11, 2020 at 01:16:40PM -0600, Rob Herring wrote: > On Wed, 11 Nov 2020 12:08:36 +0300, Serge Semin wrote: > > There can be three distinctive types of the USB controllers: USB hosts, > > USB peripherals/gadgets and USB OTG, which can switch from one role to > > another. In order to have that hierarchy handled in the DT binding files, > > we need to collect common properties in a common DT schema and specific > > properties in dedicated schemas. Seeing the usb-hcd.yaml DT schema is > > dedicated for the USB host controllers only, let's move some common > > properties from there into the usb.yaml schema. So the later would be > > available to evaluate all currently supported types of the USB > > controllers. > > > > While at it add an explicit "additionalProperties: true" into the > > usb-hcd.yaml as setting the additionalProperties/unevaluateProperties > > properties is going to be get mandatory soon. > > > > Signed-off-by: Serge Semin > > > > --- > > > > Changelog v4: > > - This is a new patch created as a result of the comment left > > by Chunfeng Yun in v3 > > --- > > .../devicetree/bindings/usb/usb-hcd.yaml | 14 ++--- > > .../devicetree/bindings/usb/usb.yaml | 29 +++ > > 2 files changed, 32 insertions(+), 11 deletions(-) > > create mode 100644 Documentation/devicetree/bindings/usb/usb.yaml > > > > > My bot found errors running 'make dt_binding_check' on your patch: > > yamllint warnings/errors: > ./Documentation/devicetree/bindings/usb/usb-hcd.yaml:17:1: [error] > duplication of key "additionalProperties" in mapping (key-duplicates) Oh my. Don't know how this has slipped in. It's even more weird given that I've performed dt_binding_check before sending the patches out. Anyway I'll fix the duplication in v5. Please proceed with the series review. -Sergey > > dtschema/dtc warnings/errors: > Traceback (most recent call last): > File "/usr/local/bin/dt-extract-example", line 45, in > binding = yaml.load(open(args.yamlfile, encoding='utf-8').read()) > File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/main.py", line > 343, in load > return constructor.get_single_data() > File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", > line 113, in get_single_data > return self.construct_document(node) > File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", > line 123, in construct_document > for _dummy in generator: > File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", > line 723, in construct_yaml_map > value = self.construct_mapping(node) > File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", > line 440, in construct_mapping > return BaseConstructor.construct_mapping(self, node, deep=deep) > File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", > line 257, in construct_mapping > if self.check_mapping_key(node, key_node, mapping, key, value): > File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", > line 295, in check_mapping_key > raise DuplicateKeyError(*args) > ruamel.yaml.constructor.DuplicateKeyError: while constructing a mapping > in "", line 4, column 1 > found duplicate key "additionalProperties" with value "True" (original value: > "True") > in "", line 17, column 1 > > To suppress this check see: > http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys > > Duplicate keys will become an error in future releases, and are errors > by default when using the new API. > > make[1]: *** [Documentation/devicetree/bindings/Makefile:20: > Documentation/devicetree/bindings/usb/usb-hcd.example.dts] Error 1 > make[1]: *** Deleting file > 'Documentation/devicetree/bindings/usb/usb-hcd.example.dts' > make[1]: *** Waiting for unfinished jobs > make[1]: *** [Documentation/devicetree/bindings/Makefile:59: > Documentation/devicetree/bindings/processed-schema-examples.json] Error 123 > make: *** [Makefile:1364: dt_binding_check] Error 2 > > > See https://patchwork.ozlabs.org/patch/1398034 > > The base for the patch is generally the last rc1. Any dependencies > should be noted. > > If you already ran 'make dt_binding_check' and didn't see the above > error(s), then make sure 'yamllint' is installed and dt-schema is up to > date: > > pip3 install dtschema --upgrade > > Please check and re-submit. >
Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
On Wed, Nov 11, 2020 at 10:34:10AM +0100, Krzysztof Kozlowski wrote: > On Wed, 11 Nov 2020 at 10:32, Serge Semin > wrote: > > > > On Wed, Nov 11, 2020 at 10:16:28AM +0100, Krzysztof Kozlowski wrote: > > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > > > Controller schema, but with additional vendor-specific properties, the > > > > controller-specific reference clocks and PHYs. So let's convert the > > > > currently available legacy text-based DWC USB3 bindings to the DT schema > > > > and make sure the DWC USB3 nodes are also validated against the > > > > usb-xhci.yaml schema. > > > > > > > > Note we have to discard the nodename restriction of being prefixed with > > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB > > > > nodes > > > > are supposed to be named as "^usb(@.*)". > > > > > > > > Signed-off-by: Serge Semin > > > > > > > > --- > > > > > > > > Changelog v2: > > > > - Discard '|' from the descriptions, since we don't need to preserve > > > > the text formatting in any of them. > > > > - Drop quotes from around the string constants. > > > > - Fix the "clock-names" prop description to be referring the enumerated > > > > clock-names instead of the ones from the Databook. > > > > > > > > Changelog v3: > > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > > > as either host or otg. > > > > > > > > Changelog v4: > > > > - Apply usb-drd.yaml schema first. If the controller is configured > > > > to work in a gadget mode only, then apply the usb.yaml schema too, > > > > otherwise apply the usb-xhci.yaml schema. > > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > > > time. > > > > --- > > > > .../devicetree/bindings/usb/dwc3.txt | 125 > > > > .../devicetree/bindings/usb/snps,dwc3.yaml| 303 ++ > > > > 2 files changed, 303 insertions(+), 125 deletions(-) > > > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt > > > > b/Documentation/devicetree/bindings/usb/dwc3.txt > > > > deleted file mode 100644 > > > > index d03edf9d3935.. > > > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > > > > +++ /dev/null > > > > @@ -1,125 +0,0 @@ > > > > -synopsys DWC3 CORE > > > > - > > > > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties > > > > - as described in 'usb/generic.txt' > > > > - > > > > -Required properties: > > > > - - compatible: must be "snps,dwc3" > > > > - - reg : Address and length of the register set for the device > > > > - - interrupts: Interrupts used by the dwc3 controller. > > > > > > - - clock-names: list of clock names. Ideally should be "ref", > > > > -"bus_early", "suspend" but may be less or more. > > > > - - clocks: list of phandle and clock specifier pairs corresponding to > > > > - entries in the clock-names property. > > > > - > > > > -Exception for clocks: > > > > - clocks are optional if the parent node (i.e. glue-layer) is > > > > compatible to > > > > - one of the following: > > > > -"cavium,octeon-7130-usb-uctl" > > > > -"qcom,dwc3" > > > > -"samsung,exynos5250-dwusb3" > > > > -"samsung,exynos5433-dwusb3" > > > > -"samsung,exynos7-dwusb3" > > > > -"sprd,sc9860-dwc3" > > > > -"st,stih407-dwc3" > > > > -"ti,am437x-dwc3" > > > > -"ti,dwc3" > > > > -"ti,keystone-dwc3" > > > > -"rockchip,rk3399-dwc3" > > > > -"xlnx,zynqmp-dwc3" > > > > > > What happened with this part of dtschema? It sees you removed it. > > > > You meant "bindings", right? > > > > I don't think it's a good idea to implement that weak binding in the > > generic DWC USB3 DT schema. Of course I could have created it under > > the allOf conditional schema and stuff. But in that case we would have > > needed to support the clock-related vendor-specific peculiarities in > > both the generic DWC USB3 DT schema and in the vendor-specific binding > > files. That wouldn't be that maintainable. As I see it all the > > vendor-specific clock requirements should be reflected in the > > glue-node DT schema. The DWC USB3 node binding just declares the > > clocks as optional. Moreover the DWC USB3 driver also considers them > > as optional. > > Sure, rationale is good, but it needs to be explained in commit msg. > Otherwise you state that you just "convert" but it's not a simple > conversion. The meaning is changed. Right. I should have explained it in the commit log. It has just slipped out of my mind. If v3 is needed I'll add the proper text in the commit message. -Sergey > > > Best regards, > Krzysztof
Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
On Wed, Nov 11, 2020 at 10:16:28AM +0100, Krzysztof Kozlowski wrote: > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote: > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI > > Controller schema, but with additional vendor-specific properties, the > > controller-specific reference clocks and PHYs. So let's convert the > > currently available legacy text-based DWC USB3 bindings to the DT schema > > and make sure the DWC USB3 nodes are also validated against the > > usb-xhci.yaml schema. > > > > Note we have to discard the nodename restriction of being prefixed with > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes > > are supposed to be named as "^usb(@.*)". > > > > Signed-off-by: Serge Semin > > > > --- > > > > Changelog v2: > > - Discard '|' from the descriptions, since we don't need to preserve > > the text formatting in any of them. > > - Drop quotes from around the string constants. > > - Fix the "clock-names" prop description to be referring the enumerated > > clock-names instead of the ones from the Databook. > > > > Changelog v3: > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work > > as either host or otg. > > > > Changelog v4: > > - Apply usb-drd.yaml schema first. If the controller is configured > > to work in a gadget mode only, then apply the usb.yaml schema too, > > otherwise apply the usb-xhci.yaml schema. > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more > > time. > > --- > > .../devicetree/bindings/usb/dwc3.txt | 125 > > .../devicetree/bindings/usb/snps,dwc3.yaml| 303 ++ > > 2 files changed, 303 insertions(+), 125 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt > > create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt > > b/Documentation/devicetree/bindings/usb/dwc3.txt > > deleted file mode 100644 > > index d03edf9d3935.. > > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > > +++ /dev/null > > @@ -1,125 +0,0 @@ > > -synopsys DWC3 CORE > > - > > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties > > - as described in 'usb/generic.txt' > > - > > -Required properties: > > - - compatible: must be "snps,dwc3" > > - - reg : Address and length of the register set for the device > > - - interrupts: Interrupts used by the dwc3 controller. > > - - clock-names: list of clock names. Ideally should be "ref", > > -"bus_early", "suspend" but may be less or more. > > - - clocks: list of phandle and clock specifier pairs corresponding to > > - entries in the clock-names property. > > - > > -Exception for clocks: > > - clocks are optional if the parent node (i.e. glue-layer) is compatible to > > - one of the following: > > -"cavium,octeon-7130-usb-uctl" > > -"qcom,dwc3" > > -"samsung,exynos5250-dwusb3" > > -"samsung,exynos5433-dwusb3" > > -"samsung,exynos7-dwusb3" > > -"sprd,sc9860-dwc3" > > -"st,stih407-dwc3" > > -"ti,am437x-dwc3" > > -"ti,dwc3" > > -"ti,keystone-dwc3" > > -"rockchip,rk3399-dwc3" > > -"xlnx,zynqmp-dwc3" > > What happened with this part of dtschema? It sees you removed it. You meant "bindings", right? I don't think it's a good idea to implement that weak binding in the generic DWC USB3 DT schema. Of course I could have created it under the allOf conditional schema and stuff. But in that case we would have needed to support the clock-related vendor-specific peculiarities in both the generic DWC USB3 DT schema and in the vendor-specific binding files. That wouldn't be that maintainable. As I see it all the vendor-specific clock requirements should be reflected in the glue-node DT schema. The DWC USB3 node binding just declares the clocks as optional. Moreover the DWC USB3 driver also considers them as optional. -Sergey > > Best regards, > Krzysztof
[PATCH v2 10/18] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
In accordance with the Generic EHCI/OHCI bindings the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible nodes are correctly named. Signed-off-by: Serge Semin Acked-by: Krzysztof Kozlowski --- arch/powerpc/boot/dts/akebono.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts index df18f8dc4642..343326c30380 100644 --- a/arch/powerpc/boot/dts/akebono.dts +++ b/arch/powerpc/boot/dts/akebono.dts @@ -126,7 +126,7 @@ SATA0: sata@301 { interrupts = <93 2>; }; - EHCI0: ehci@3001000 { + EHCI0: usb@3001000 { compatible = "ibm,476gtr-ehci", "generic-ehci"; reg = <0x300 0x1000 0x0 0x1>; interrupt-parent = <&MPIC>; @@ -140,14 +140,14 @@ SD0: sd@300 { interrupt-parent = <&MPIC>; }; - OHCI0: ohci@3001001 { + OHCI0: usb@3001001 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1001 0x0 0x1>; interrupt-parent = <&MPIC>; interrupts = <89 1>; }; - OHCI1: ohci@3001002 { + OHCI1: usb@3001002 { compatible = "ibm,476gtr-ohci", "generic-ohci"; reg = <0x300 0x1002 0x0 0x1>; interrupt-parent = <&MPIC>; -- 2.28.0
[PATCH v2 00/18] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
As the subject states this series is an attempt to harmonize the xHCI, EHCI, OHCI and DWC USB3 DT nodes with the DT schema introduced in the framework of the patchset [1]. Firstly as Krzysztof suggested we've deprecated a support of DWC USB3 controllers with "synopsys,"-vendor prefix compatible string in favor of the ones with valid "snps,"-prefix. It's done in all the DTS files, which have been unfortunate to define such nodes. Secondly we suggest to fix the snps,quirk-frame-length-adjustment property declaration in the Amlogic meson-g12-common.dtsi DTS file, since it has been erroneously declared as boolean while having uint32 type. Neil said it was ok to init that property with 0x20 value. Thirdly the main part of the patchset concern fixing the xHCI, EHCI/OHCI and DWC USB3 DT nodes name as in accordance with their DT schema the corresponding node name is suppose to comply with the Generic USB HCD DT schema, which requires the USB nodes to have the name acceptable by the regexp: "^usb(@.*)?". Such requirement had been applicable even before we introduced the new DT schema in [1], but as we can see it hasn't been strictly implemented for a lot the DTS files. Since DT schema is now available the automated DTS validation shall make sure that the rule isn't violated. Note most of these patches have been a part of the last three patches of [1]. But since there is no way to have them merged in in a combined manner, I had to move them to the dedicated series and split them up so to be accepted by the corresponding subsystem maintainers one-by-one. [1] Link: https://lore.kernel.org/linux-usb/20201014101402.18271-1-sergey.se...@baikalelectronics.ru/ Changelog v1: - As Krzysztof suggested I've created a script which checked whether the node names had been also updated in all the depended dts files. As a result I found two more files which should have been also modified: arch/arc/boot/dts/{axc003.dtsi,axc003_idu.dtsi} - Correct the USB DWC3 nodes name found in arch/arm64/boot/dts/apm/{apm-storm.dtsi,apm-shadowcat.dtsi} too. Changelog v2: - Drop the patch: [PATCH 01/29] usb: dwc3: Discard synopsys,dwc3 compatibility string and get back the one which marks the "synopsys,dwc3" compatible string as deprecated into the DT schema related series. - Drop the patches: [PATCH 03/29] arm: dts: am437x: Correct DWC USB3 compatible string [PATCH 04/29] arm: dts: exynos: Correct DWC USB3 compatible string [PATCH 07/29] arm: dts: bcm53x: Harmonize EHCI/OHCI DT nodes name [PATCH 08/29] arm: dts: stm32: Harmonize EHCI/OHCI DT nodes name [PATCH 16/29] arm: dts: bcm5301x: Harmonize xHCI DT nodes name [PATCH 19/29] arm: dts: exynos: Harmonize DWC USB3 DT nodes name [PATCH 21/29] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name [PATCH 22/29] arm: dts: omap5: Harmonize DWC USB3 DT nodes name [PATCH 24/29] arm64: dts: allwinner: h6: Harmonize DWC USB3 DT nodes name [PATCH 26/29] arm64: dts: exynos: Harmonize DWC USB3 DT nodes name [PATCH 27/29] arm64: dts: layerscape: Harmonize DWC USB3 DT nodes name since they have been applied to the corresponding maintainers repos. - Fix drivers/usb/dwc3/dwc3-qcom.c to be looking for the "usb@"-prefixed sub-node and falling back to the "dwc3@"-prefixed one on failure. Cc: Vineet Gupta Cc: Rafal Milecki Cc: Wei Xu Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Jason Cooper Cc: Santosh Shilimkar Cc: Shawn Guo Cc: Benoit Cousson Cc: Patrice Chotard Cc: Maxime Ripard Cc: Khuong Dinh Cc: Andy Gross Cc: Alexey Brodkin Cc: Hauke Mehrtens Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Amelie Delaunay Cc: Vladimir Zapolskiy Cc: Paul Cercueil Cc: Matthias Brugger Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Cc: Kukjin Kim Cc: Li Yang Cc: Tony Lindgren Cc: Chen-Yu Tsai Cc: Bjorn Andersson Cc: Jun Li Cc: linux-snps-...@lists.infradead.org Cc: bcm-kernel-feedback-l...@broadcom.com Cc: linux-st...@st-md-mailman.stormreply.com Cc: linux-arm-ker...@lists.infradead.org Cc: linux-m...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-samsung-...@vger.kernel.org Cc: linux-o...@vger.kernel.org Cc: linux-arm-...@vger.kernel.org Cc: devicet...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Serge Semin (18): arm: dts: keystone: Correct DWC USB3 compatible string arm64: dts: amlogic: meson-g12: Set FL-adj property value arc: dts: Harmonize EHCI/OHCI DT nodes name arm: dts: hisi-x5hd2: Harmonize EHCI/OHCI DT nodes name arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name arm64: dts: hisi: Harmonize EHCI/OHCI DT nodes name mips: dts: jz47x: Harmonize EHCI/OHCI DT nodes name mips: dts: sead3: Harmonize EHCI/OHCI DT nodes name mips: dts: ralink: mt7628a: Harmonize EHCI/OHCI DT nodes name powerpc: dts: akebono: Harmonize EHCI/OHC
[PATCH v4 18/18] dt-bindings: usb: qcom,dwc3: Validate DWC3 sub-node
Qualcomm msm8996/sc7180/sdm845 DWC3 compatible DT nodes are supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Let's use the available DWC USB3 DT schema to validate the Qualcomm DWC3 sub-nodes. Note since the generic DWC USB3 DT node is supposed to be named as generic USB HCD ("^usb(@.*)?") one we have to accordingly fix the sub-nodes name regexp and fix the DT node example. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Discard the "^dwc3@[0-9a-f]+$" nodes from being acceptable as sub-nodes. --- Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index dac10848dd7f..8f8d781e73a0 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -103,11 +103,8 @@ properties: # Required child node: patternProperties: - "^dwc3@[0-9a-f]+$": -type: object -description: - A child node must exist to represent the core DWC3 IP block - The content of the node is defined in dwc3.txt. + "^usb@[0-9a-f]+$": +$ref: snps,dwc3.yaml# required: - compatible @@ -160,7 +157,7 @@ examples: resets = <&gcc GCC_USB30_PRIM_BCR>; -dwc3@a60 { +usb@a60 { compatible = "snps,dwc3"; reg = <0 0x0a60 0 0xcd00>; interrupts = ; -- 2.28.0
[PATCH v4 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
TI Keystone DWC3 compatible DT node is supposed to have a DWC USB3 compatible sub-node to describe a fully functioning USB interface. Since DWC USB3 has now got a DT schema describing its DT node, let's make sure the TI Keystone DWC3 sub-node passes validation against it. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/it'/its" --- Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml index c1b19fc5d0a2..ca7fbe3ed22e 100644 --- a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml @@ -64,9 +64,7 @@ properties: patternProperties: "usb@[a-f0-9]+$": -type: object -description: This is the node representing the DWC3 controller instance - Documentation/devicetree/bindings/usb/dwc3.txt +$ref: snps,dwc3.yaml# required: - compatible -- 2.28.0
[PATCH v4 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
Amlogic G12A USB DT sub-nodes are supposed to be compatible with the generic DWC USB2 and USB3 devices. Since now we've got DT schemas for both of the later IP cores let's make sure that the Amlogic G12A USB DT nodes are fully evaluated including the DWC sub-nodes. Signed-off-by: Serge Semin Reviewed-by: Neil Armstrong Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl --- Changelog v2: - Use "oneOf: [dwc2.yaml#, snps,dwc3.yaml#]" instead of the bulky "if: properties: compatibe: ..." statement. --- .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml index a4b44a16aaef..7b2dc905c8ce 100644 --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml @@ -78,7 +78,9 @@ properties: patternProperties: "^usb@[0-9a-f]+$": -type: object +oneOf: + - $ref: dwc2.yaml# + - $ref: snps,dwc3.yaml# additionalProperties: false -- 2.28.0
[PATCH v4 15/18] dt-bindings: usb: meson-g12a-usb: Fix FL-adj property value
An empty snps,quirk-frame-length-adjustment won't cause any change performed by the driver. Moreover the DT schema validation will fail, since it expects the property being assigned with some value. So set fix the example by setting a valid FL-adj value in accordance with Neil Armstrong comment. Link: https://lore.kernel.org/linux-usb/20201010224121.12672-16-sergey.se...@baikalelectronics.ru/ Signed-off-by: Serge Semin Acked-by: Neil Armstrong Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl --- Note the same problem is in the DT source file arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi . --- .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml index 5b04a7dfa018..a4b44a16aaef 100644 --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml @@ -209,6 +209,6 @@ examples: interrupts = <30>; dr_mode = "host"; snps,dis_u2_susphy_quirk; - snps,quirk-frame-length-adjustment; + snps,quirk-frame-length-adjustment = <0x20>; }; }; -- 2.28.0
[PATCH v4 12/18] dt-bindings: usb: dwc3: Add synopsys, dwc3 compatible string
The DWC USB3 driver and some DTS files like Exynos 5250, Keystone k2e, etc expects the DWC USB3 DT node to have the compatible string with the "synopsys" vendor prefix. Let's add the corresponding compatible string to the controller DT schema, but mark it as deprecated seeing the Synopsys, Inc. is presented with just "snps" vendor prefix. Signed-off-by: Serge Semin --- Changelog v2: - Drop quotes from around the compat string constant. Changelog v4: - Get the patch back, since we can't discard the deprecated prefix from the driver. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index c205afd66b7c..4f68c5cd7a45 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -28,7 +28,10 @@ allOf: properties: compatible: contains: - const: snps,dwc3 + oneOf: +- const: snps,dwc3 +- const: synopsys,dwc3 + deprecated: true interrupts: description: -- 2.28.0
[PATCH v4 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis constraints
In accordance with the driver comments the PIPE3 de-emphasis can be tuned to be either -6dB, -2.5dB or disabled. Let's add the de-emphasis property constraints so the DT schema would make sure the controller DT node is equipped with correct value. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/tunned/tuned" - Grammar fix: remove redundant "or" conjunction. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 4f68c5cd7a45..64579aed404f 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -153,6 +153,10 @@ properties: The value driven to the PHY is controlled by the LTSSM during USB3 Compliance mode. $ref: /schemas/types.yaml#/definitions/uint8 +enum: + - 0 # -6dB de-emphasis + - 1 # -3.5dB de-emphasis + - 2 # No de-emphasis snps,dis_u3_susphy_quirk: description: When set core will disable USB3 suspend phy -- 2.28.0
[PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
DWC USB3 DT node is supposed to be compliant with the Generic xHCI Controller schema, but with additional vendor-specific properties, the controller-specific reference clocks and PHYs. So let's convert the currently available legacy text-based DWC USB3 bindings to the DT schema and make sure the DWC USB3 nodes are also validated against the usb-xhci.yaml schema. Note we have to discard the nodename restriction of being prefixed with "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes are supposed to be named as "^usb(@.*)". Signed-off-by: Serge Semin --- Changelog v2: - Discard '|' from the descriptions, since we don't need to preserve the text formatting in any of them. - Drop quotes from around the string constants. - Fix the "clock-names" prop description to be referring the enumerated clock-names instead of the ones from the Databook. Changelog v3: - Apply usb-xhci.yaml# schema only if the controller is supposed to work as either host or otg. Changelog v4: - Apply usb-drd.yaml schema first. If the controller is configured to work in a gadget mode only, then apply the usb.yaml schema too, otherwise apply the usb-xhci.yaml schema. - Discard the Rob'es Reviewed-by tag. Please review the patch one more time. --- .../devicetree/bindings/usb/dwc3.txt | 125 .../devicetree/bindings/usb/snps,dwc3.yaml| 303 ++ 2 files changed, 303 insertions(+), 125 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt deleted file mode 100644 index d03edf9d3935.. --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ /dev/null @@ -1,125 +0,0 @@ -synopsys DWC3 CORE - -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties - as described in 'usb/generic.txt' - -Required properties: - - compatible: must be "snps,dwc3" - - reg : Address and length of the register set for the device - - interrupts: Interrupts used by the dwc3 controller. - - clock-names: list of clock names. Ideally should be "ref", -"bus_early", "suspend" but may be less or more. - - clocks: list of phandle and clock specifier pairs corresponding to - entries in the clock-names property. - -Exception for clocks: - clocks are optional if the parent node (i.e. glue-layer) is compatible to - one of the following: -"cavium,octeon-7130-usb-uctl" -"qcom,dwc3" -"samsung,exynos5250-dwusb3" -"samsung,exynos5433-dwusb3" -"samsung,exynos7-dwusb3" -"sprd,sc9860-dwc3" -"st,stih407-dwc3" -"ti,am437x-dwc3" -"ti,dwc3" -"ti,keystone-dwc3" -"rockchip,rk3399-dwc3" -"xlnx,zynqmp-dwc3" - -Optional properties: - - usb-phy : array of phandle for the PHY device. The first element - in the array is expected to be a handle to the USB2/HS PHY and - the second element is expected to be a handle to the USB3/SS PHY - - phys: from the *Generic PHY* bindings - - phy-names: from the *Generic PHY* bindings; supported names are "usb2-phy" - or "usb3-phy". - - resets: set of phandle and reset specifier pairs - - snps,usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM - - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable - - snps,dis-start-transfer-quirk: when set, disable isoc START TRANSFER command - failure SW work-around for DWC_usb31 version 1.70a-ea06 - and prior. - - snps,disable_scramble_quirk: true when SW should disable data scrambling. - Only really useful for FPGA builds. - - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled - - snps,lpm-nyet-threshold: LPM NYET threshold - - snps,u2exit_lfps_quirk: set if we want to enable u2exit lfps quirk - - snps,u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk - - snps,req_p1p2p3_quirk: when set, the core will always request for - P1/P2/P3 transition sequence. - - snps,del_p1p2p3_quirk: when set core will delay P1/P2/P3 until a certain - amount of 8B10B errors occur. - - snps,del_phy_power_chg_quirk: when set core will delay PHY power change - from P0 to P1/P2/P3. - - snps,lfps_filter_quirk: when set core will filter LFPS reception. - - snps,rx_detect_poll_quirk: when set core will disable a 400us delay to start - Polling LFPS after RX.Detect. - - snps,tx_de_emphasis_quirk: when set core will set Tx de-emphasis value. - - snps,tx_de_emphasis: the value driven to the PHY is controlled by
[PATCH v4 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj constraints
In accordance with the IP core databook the snps,quirk-frame-length-adjustment property can be set within [0, 0x3F]. Let's make sure the DT schema applies a correct constraints on the property. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 64579aed404f..cd8527789d64 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -234,6 +234,8 @@ properties: length adjustment when the fladj_30mhz_sdbnd signal is invalid or incorrect. $ref: /schemas/types.yaml#/definitions/uint32 +minimum: 0 +maximum: 0x3f snps,rx-thr-num-pkt-prd: description: -- 2.28.0
[PATCH v4 09/18] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file
With minor peculiarities (like uploading some vendor-specific firmware) these are just Generic xHCI controllers fully compatible with its properties. Make sure the Renesas USB xHCI DT nodes are also validated against the Generic xHCI DT schema. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Reviewed-by: Yoshihiro Shimoda --- Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml index add9f7b66da0..4491567152a1 100644 --- a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml @@ -11,7 +11,7 @@ maintainers: - Yoshihiro Shimoda allOf: - - $ref: "usb-hcd.yaml" + - $ref: "usb-xhci.yaml" properties: compatible: @@ -68,7 +68,7 @@ required: - power-domains - resets -additionalProperties: false +unevaluatedProperties: false examples: - | -- 2.28.0
[PATCH v4 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema
Currently the DT bindings of Generic xHCI Controllers are described by means of the legacy text file. Since such format is deprecated in favor of the DT schema, let's convert the Generic xHCI Controllers bindings file to the corresponding yaml files. There will be two of them: a DT schema for the xHCI controllers on a generic platform and a DT schema validating a generic xHCI controllers properties. The later will be used to validate the xHCI controllers, which aside from some vendor-specific features support the basic xHCI functionality. An xHCI-compatible DT node shall support the standard USB HCD properties and custom ones like: usb2-lpm-disable, usb3-lpm-capable, quirk-broken-port-ped and imod-interval-ns. In addition if a generic xHCI controller is being validated against the DT schema it is also supposed to be equipped with mandatory compatible string, single registers range, single interrupts source, and is supposed to optionally contain up to two reference clocks for the controller core and CSRs. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Add explicit "additionalProperties: true" to the usb-xhci.yaml schema, since additionalProperties/unevaluatedProperties are going to be mandary for each binding. --- .../devicetree/bindings/usb/generic-xhci.yaml | 63 +++ .../devicetree/bindings/usb/usb-xhci.txt | 41 .../devicetree/bindings/usb/usb-xhci.yaml | 42 + 3 files changed, 105 insertions(+), 41 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml new file mode 100644 index ..1ea1d49a8175 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/generic-xhci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: USB xHCI Controller Device Tree Bindings + +maintainers: + - Mathias Nyman + +allOf: + - $ref: "usb-xhci.yaml#" + +properties: + compatible: +oneOf: + - description: Generic xHCI device +const: generic-xhci + - description: Armada 37xx/375/38x/8k SoCs +items: + - enum: + - marvell,armada3700-xhci + - marvell,armada-375-xhci + - marvell,armada-380-xhci + - marvell,armada-8k-xhci + - const: generic-xhci + - description: Broadcom STB SoCs with xHCI +const: brcm,bcm7445-xhci + - description: Generic xHCI device +const: xhci-platform +deprecated: true + + reg: +maxItems: 1 + + interrupts: +maxItems: 1 + + clocks: +minItems: 1 +maxItems: 2 + + clock-names: +minItems: 1 +items: + - const: core + - const: reg + +unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | +usb@f0931000 { + compatible = "generic-xhci"; + reg = <0xf0931000 0x8c8>; + interrupts = <0x0 0x4e 0x0>; +}; diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt deleted file mode 100644 index 0c5cff84a969.. --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt +++ /dev/null @@ -1,41 +0,0 @@ -USB xHCI controllers - -Required properties: - - compatible: should be one or more of - -- "generic-xhci" for generic XHCI device -- "marvell,armada3700-xhci" for Armada 37xx SoCs -- "marvell,armada-375-xhci" for Armada 375 SoCs -- "marvell,armada-380-xhci" for Armada 38x SoCs -- "brcm,bcm7445-xhci" for Broadcom STB SoCs with XHCI -- "xhci-platform" (deprecated) - -When compatible with the generic version, nodes must list the -SoC-specific version corresponding to the platform first -followed by the generic version. - - - reg: should contain address and length of the standard XHCI -register set for the device. - - interrupts: one XHCI interrupt should be described here. - -Optional properties: - - clocks: reference to the clocks - - clock-names: mandatory if there is a second clock, in this case -the name must be "core" for the first clock and "reg" for the -second one - - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM - - usb3-lpm-capable: determines if platform is USB3 LPM capable - - quirk-broken-port-ped: set if the controller has broken port disable mechanism - - imod-interval-ns: default interrupt moderation interval is 5000ns - - phys : see usb-hcd.yaml in the current dire
[PATCH v4 08/18] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device
For some reason the "brcm,xhci-brcm-v2" compatible string has been missing in the original bindings file. Add it to the Generic xHCI Controllers DT schema since the controller driver expects it to be supported. Signed-off-by: Serge Semin Acked-by: Florian Fainelli Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/generic-xhci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml index 1ea1d49a8175..23d73df96ea3 100644 --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -26,7 +26,9 @@ properties: - marvell,armada-8k-xhci - const: generic-xhci - description: Broadcom STB SoCs with xHCI -const: brcm,bcm7445-xhci +enum: + - brcm,xhci-brcm-v2 + - brcm,bcm7445-xhci - description: Generic xHCI device const: xhci-platform deprecated: true -- 2.28.0
[PATCH v4 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support
The controller driver supports two types of DWC USB3 devices: with a common interrupt lane and with individual interrupts for each mode. Add support for both these cases to the DWC USB3 DT schema. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/both of these cases support/support for both these cases" - Drop quotes from around the string constants. Changelog v4: - Discard the block scalar style modifier "|" from the interrupts property description. --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 079617891da6..c205afd66b7c 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -31,8 +31,19 @@ properties: const: snps,dwc3 interrupts: +description: + It's either a single common DWC3 interrupt (dwc_usb3) or individual + interrupts for the host, gadget and DRD modes. +minItems: 1 +maxItems: 3 + + interrupt-names: minItems: 1 maxItems: 3 +oneOf: + - const: dwc_usb3 + - items: + enum: [host, peripheral, otg] clocks: description: -- 2.28.0
[PATCH v4 02/18] dt-bindings: usb: Convert generic USB properties to DT schemas
The generic USB properties have been described in the legacy bindings text file: Documentation/devicetree/bindings/usb/generic.txt . Let's convert its content into the generic USB, USB HCD and USB DRD DT schemas. So the Generic USB schema will be applicable to all USB controllers, USB HCD - for the generic USB Host controllers and the USB DRD - for the USB Dual-role controllers. Note the USB DRD schema is supposed to work in conjunction with the USB peripheral/gadget and USB host controllers DT schemas. Signed-off-by: Serge Semin --- Changelog v2: - Discard '|' in all the new properties, since we don't need to preserve the text formatting. - Convert abbreviated form of the "maximum-speed" enum restriction into the multi-lined version of the list. - Drop quotes from around the string constants. Changelog v4: - Redistribute the properties between generic ones, USB HCD-specific and USB DRD-specific. - Discard the Rob'es Reviewed-by tag. Please review the patch one more time. --- .../devicetree/bindings/usb/generic.txt | 57 -- .../devicetree/bindings/usb/usb-drd.yaml | 77 +++ .../devicetree/bindings/usb/usb-hcd.yaml | 5 ++ .../devicetree/bindings/usb/usb.yaml | 22 ++ 4 files changed, 104 insertions(+), 57 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-drd.yaml diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt deleted file mode 100644 index ba472e7aefc9.. --- a/Documentation/devicetree/bindings/usb/generic.txt +++ /dev/null @@ -1,57 +0,0 @@ -Generic USB Properties - -Optional properties: - - maximum-speed: tells USB controllers we want to work up to a certain - speed. Valid arguments are "super-speed-plus", - "super-speed", "high-speed", "full-speed" and - "low-speed". In case this isn't passed via DT, USB - controllers should default to their maximum HW - capability. - - dr_mode: tells Dual-Role USB controllers that we want to work on a - particular mode. Valid arguments are "host", - "peripheral" and "otg". In case this attribute isn't - passed via DT, USB DRD controllers should default to - OTG. - - phy_type: tells USB controllers that we want to configure the core to support - a UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is - selected. Valid arguments are "utmi" and "utmi_wide". - In case this isn't passed via DT, USB controllers should - default to HW capability. - - otg-rev: tells usb driver the release number of the OTG and EH supplement - with which the device and its descriptors are compliant, - in binary-coded decimal (i.e. 2.0 is 0200H). This - property is used if any real OTG features(HNP/SRP/ADP) - is enabled, if ADP is required, otg-rev should be - 0x0200 or above. - - companion: phandle of a companion - - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP - is the basic function of real OTG except you want it - to be a srp-capable only B device. - - srp-disable: tells OTG controllers we want to disable OTG SRP, SRP is - optional for OTG device. - - adp-disable: tells OTG controllers we want to disable OTG ADP, ADP is - optional for OTG device. - - usb-role-switch: boolean, indicates that the device is capable of assigning - the USB data role (USB host or USB device) for a given - USB connector, such as Type-C, Type-B(micro). - see connector/usb-connector.yaml. - - role-switch-default-mode: indicating if usb-role-switch is enabled, the - device default operation mode of controller while usb - role is USB_ROLE_NONE. Valid arguments are "host" and - "peripheral". Defaults to "peripheral" if not - specified. - - -This is an attribute to a USB controller such as: - -dwc3@4a03 { - compatible = "synopsys,dwc3"; - reg = <0x4a03 0xcfff>; - interrupts = <0 92 4> - usb-phy = <&usb2_phy>, <&usb3,phy>; - maximum-speed = "super-speed"; - dr_mode = "otg"; - phy_type = "utmi_wide"; - otg-rev = <0x02
[PATCH v4 06/18] dt-bindings: usb: Add generic "usb-phy" property
Even though the Generic PHY framework is the more preferable way of setting the USB PHY up, there are still many dts-files and DT bindings which rely on having the legacy "usb-phy" specified to attach particular USB PHYs to USB cores. Let's have the "usb-phy" property described in the generic USB HCD binding file so it would be validated against the nodes in which it's specified. Mark the property as deprecated to discourage the developers from using it. Signed-off-by: Serge Semin Acked-by: Martin Blumenstingl Reviewed-by: Rob Herring --- Changelog v2: - Discard '|' from the property description, since we don't need to preserve the text formatting. Changelog v4: - Move the "usb-phy" property definition into the usb.yaml schema where all generic USB properties are now defined. --- Documentation/devicetree/bindings/usb/usb.yaml | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml index 6dc4821e63c3..5400893d693e 100644 --- a/Documentation/devicetree/bindings/usb/usb.yaml +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -24,6 +24,13 @@ properties: description: Name specifier for the USB PHY + usb-phy: +$ref: /schemas/types.yaml#/definitions/phandle-array +description: + List of all the USB PHYs on this HCD to be accepted by the legacy USB + Physical Layer subsystem. +deprecated: true + phy_type: description: Tells USB controllers that we want to configure the core to support a -- 2.28.0
[PATCH v4 03/18] dt-bindings: usb: usb-drd: Add "otg-rev" property constraints
There are only four OTG revisions are currently supported by the kernel: 0x0100, 0x0120, 0x0130, 0x0200. Any another value is considered as invalid. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v4: - Move the constraints to the usb-drd.yaml schema where the otg-rev property is now defined. --- Documentation/devicetree/bindings/usb/usb-drd.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/usb-drd.yaml b/Documentation/devicetree/bindings/usb/usb-drd.yaml index f3a64c46dcd0..f229fc8068d9 100644 --- a/Documentation/devicetree/bindings/usb/usb-drd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-drd.yaml @@ -18,6 +18,7 @@ properties: features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be 0x0200 or above. $ref: /schemas/types.yaml#/definitions/uint32 +enum: [0x0100, 0x0120, 0x0130, 0x0200] dr_mode: description: -- 2.28.0
[PATCH v4 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property
The host controller device might be designed to work for the particular products or applications. In that case its DT node is supposed to be equipped with the tpl-support property. Signed-off-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Grammar fix: "s/it'/its" - Discard '|' from the property description, since we don't need to preserve the text formatting. --- Documentation/devicetree/bindings/usb/usb-hcd.yaml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml index 52cc84c400c0..9881ac10380d 100644 --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml @@ -17,6 +17,12 @@ properties: description: Phandle of a companion device $ref: /schemas/types.yaml#/definitions/phandle + tpl-support: +description: + Indicates if the Targeted Peripheral List is supported for given + targeted hosts (non-PC hosts). +type: boolean + additionalProperties: true examples: -- 2.28.0
[PATCH v4 01/18] dt-bindings: usb: usb-hcd: Detach generic USB controller properties
There can be three distinctive types of the USB controllers: USB hosts, USB peripherals/gadgets and USB OTG, which can switch from one role to another. In order to have that hierarchy handled in the DT binding files, we need to collect common properties in a common DT schema and specific properties in dedicated schemas. Seeing the usb-hcd.yaml DT schema is dedicated for the USB host controllers only, let's move some common properties from there into the usb.yaml schema. So the later would be available to evaluate all currently supported types of the USB controllers. While at it add an explicit "additionalProperties: true" into the usb-hcd.yaml as setting the additionalProperties/unevaluateProperties properties is going to be get mandatory soon. Signed-off-by: Serge Semin --- Changelog v4: - This is a new patch created as a result of the comment left by Chunfeng Yun in v3 --- .../devicetree/bindings/usb/usb-hcd.yaml | 14 ++--- .../devicetree/bindings/usb/usb.yaml | 29 +++ 2 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb.yaml diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml index 7263b7f2b510..81f3ad1419d8 100644 --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml @@ -9,18 +9,10 @@ title: Generic USB Host Controller Device Tree Bindings maintainers: - Greg Kroah-Hartman -properties: - $nodename: -pattern: "^usb(@.*)?" +allOf: + - $ref: usb.yaml# - phys: -$ref: /schemas/types.yaml#/definitions/phandle-array -description: - List of all the USB PHYs on this HCD - - phy-names: -description: - Name specifier for the USB PHY +additionalProperties: true examples: - | diff --git a/Documentation/devicetree/bindings/usb/usb.yaml b/Documentation/devicetree/bindings/usb/usb.yaml new file mode 100644 index ..941ad59fbac5 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic USB Controller Device Tree Bindings + +maintainers: + - Greg Kroah-Hartman + +select: false + +properties: + $nodename: +pattern: "^usb(@.*)?" + + phys: +$ref: /schemas/types.yaml#/definitions/phandle-array +description: + List of all the USB PHYs on this HCD + + phy-names: +description: + Name specifier for the USB PHY + +additionalProperties: true + +... -- 2.28.0
[PATCH v4 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema
We've performed some work on the Generic USB HCD, xHCI and DWC USB3 DT bindings in the framework of the Baikal-T1 SoC support integration into the kernel. This patchset is a result of that work. First of all we moved the generic USB properties from the legacy text bindings to the USB DT schema. The properties have been distributed between three DT schemas dedicated for particular types of USB controllers: Generic USB controller properties (like node-naming, phys, maximum-speed, etc), Generic USB Host Controller bindings (companion and TPL support), Dual-Role USB Controller (OTG revision, DR mode, HNP/SRP/ADP protocols, etc). So the USB controllers DT bindings from now can validate the nodes against a generic USB-controller schema suitable for the controller functionality. Secondly we converted generic USB xHCI text bindings file into the DT schema. It had to be split up into two bindings: DT schema with generic xHCI properties and a generic xHCI device DT schema. The later will be used to validate the pure xHCI-based nodes, while the former can be utilized by some vendor-specific versions of xHCI. Thirdly, what was primarily intended to be done for Baikal-T1 SoC USB we converted the legacy text-based DWC USB3 bindings to DT schema and altered the result a bit so it would be more coherent with what actually controller and its driver support. Since we've now got the DWC USB3 DT schema, we made it used to validate the sub-nodes of the Qualcom, TI and Amlogic DWC3 DT nodes. Link: https://lore.kernel.org/linux-usb/20201010224121.12672-1-sergey.se...@baikalelectronics.ru/ Changelog v2: - Thanks to Sergei Shtylyov for suggesting the commit logs grammar fixes: [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node - Set FL-adj of the amlogiv,meson-g12a-usb controller with value 0x20 instead of completely removing the property. - Drop the patch: [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value since "wireless" speed type is depracated due to lack of the device supporting it. - Drop quotes from around the compat string constant. - Discard '|' from the property descriptions, since we don't need to preserve the text formatting. - Convert abbreviated form of the "maximum-speed" enum constraint into the multi-lined version of the list. - Fix the DW USB3 "clock-names" prop description to be refererring to the enumerated clock-names instead of the ones from the Databook. - Add explicit "additionalProperties: true" to the usb-xhci.yaml schema, since additionalProperties/unevaluatedProperties are going to be mandary for each binding. - Use "oneOf: [dwc2.yaml#, snps,dwc3.yaml#]" instead of the bulky "if: properties: compatibe: ..." statement. - Discard the "^dwc3@[0-9a-f]+$" nodes from being acceptable as sub-nodes of the Qualcomm DWC3 DT nodes. - Add new patches: [PATCH 18/20] arch: dts: Fix EHCI/OHCI DT nodes name [PATCH 19/20] arch: dts: Fix xHCI DT nodes name [PATCH 20/20] arch: dts: Fix DWC USB3 DT nodes name Link: https://lore.kernel.org/linux-usb/20201014101402.18271-1-sergey.se...@baikalelectronics.ru Changelog v3: - Drop the patches: [PATCH 18/20] arch: dts: Fix EHCI/OHCI DT nodes name [PATCH 19/20] arch: dts: Fix xHCI DT nodes name [PATCH 20/20] arch: dts: Fix DWC USB3 DT nodes name as they are going to be submitted in the framework of a dedicated patchset. - Drop the patch: [PATCH 11/20] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string since it's going to be replaced with the driver/dts fixup and moved to a dedicated patchset. - Apply usb-xhci.yaml# schema for the DWC USB3 node only if the controller is supposed to work as either host or otg. Link: https://lore.kernel.org/linux-usb/20201020112101.19077-1-sergey.se...@baikalelectronics.ru Changelog v4: - Get the patch [PATCH 11/17] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string back, since we can't discard the deprecated prefix from the driver. - Discard the block scalar style modifier "|" from the interrupts property description. - Split the generic USB controller properties into three schemas: Generic USB controllers, USB Host controllers and USB OTG controllers. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Pavel Parkhomenko Cc: Andy Gross Cc: Bjorn Andersson Cc: Manu Gautam Cc: Roger Quadros Cc: Lad Prabhakar Cc: Yoshihiro Shimoda Cc: Neil Armstrong Cc: Kevin Hilman Cc: Martin Blumenstingl Cc: Chunfeng Yun Cc: linux-arm-ker...@lists.infradead.org