* [PATCH v7 0/2] Add driver support for ESWIN EIC7700 SoC USB controller
@ 2025-11-10 2:43 caohang
2025-11-10 2:44 ` [PATCH v7 1/2] dt-bindings: usb: Add ESWIN EIC7700 " caohang
2025-11-10 2:45 ` [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver caohang
0 siblings, 2 replies; 5+ messages in thread
From: caohang @ 2025-11-10 2:43 UTC (permalink / raw)
To: gregkh, robh, krzk+dt, conor+dt, Thinh.Nguyen, p.zabel,
linux-kernel, linux-usb, devicetree
Cc: ningyu, linmin, pinkesh.vaghela, Hang Cao
From: Hang Cao <caohang@eswincomputing.com>
Add support for ESWIN EIC7700 USB driver controller.
Changes in v7->v6:
- Updates: dwc3-generic-plat.c
- Rename dwc3_plat_config to dwc3_generic_config.
- Refine the error message in probe function.
- Link to V6:https://lore.kernel.org/all/20251106104938.1386-1-caohang@eswincomputing.com/
Changes in v6->v5:
- Updates: dwc3-generic-plat.c
- Update commit message.
- Add dwc3_plat_config structure.
- Add dwc3_eic7700_init function.
- Link to V5:https://lore.kernel.org/all/20251104065045.1464-1-caohang@eswincomputing.com/
Changes in v5->v4:
- Updates: eswin,eic7700-usb.yaml
- Remove the unnecessary properties of quirk.
- Updates: dwc3-generic-plat.c
- Rebase to usb-testing branch of gregkh/usb.git.
- Add eic7700 pre init in probe function.
Changes in v4->v3:
- Updates:
- Removed config option patch dependency from cover letter, because the patch
was applied.
- Remove dwc3-eic7700.c instead of dwc3-generic-plat.c.
- Updates: eswin,eic7700-usb.yaml
- Add usb_en clock.
- Add usb_rst reset.
- Update eswin,hsp-sp-csr description.
- Remove the last two unused items of eswin,hsp-sp-csr.
- Updates: dwc3-generic-plat.c
- Add eswin,eic7700-dwc3 to the compatible table.
- Add the dwc3_generic_match_data structure.
- Add the eic7700_dwc3_bus_init function to initialize the bus.
- Add the init_ops callback in the probe function.
- Link to V3: https://lore.kernel.org/all/20250915085329.2058-1-caohang@eswincomputing.com/
Changes in v3->v2:
- Updates: eswin,eic7700-usb.yaml
- Sort the attributes according to the DTS coding style.
- Remove the #address-cells and #size-cells attributes.
- Fold the child node into the parent.
- Update commit message.
- Updates: dwc3-eic7700.c
- Use dwc3 core as a library.
- Add system and runtime pm.
- Use pm_ptr and remove the __maybe_unused tags.
- Add new author name
- Add prepare and complete function
- Update commit message.
- Link to V2: https://lore.kernel.org/lkml/20250730073953.1623-1-zhangsenchuan@eswincomputing.com/
Changes in v2->v1:
- Updates: eswin,eic7700-usb.yaml
- Drop the redundant descriptions.
- Supplement the constraints of resets.
- Replace "eswin,hsp_sp_csr" with "eswin,hsp-sp-csr"
and add items description.
- Drop numa-node-id, This is not necessary.
- Add patternProperties and match the rules defined
in the "snps,dwc3.yaml" file.
- Add "#address-cells" "#size-cells".
- Update the space indentation, remove the redundant labels,
and sort the attributes according to the DTS encoding style.
- Drop the "status = "disabled" attribute.
- Update the common usb node names and fold the child
nodes into the parent nodes.
- The warning detected by the robot has been resolved.
- Updates: dwc3-eic7700.c
- Remove dwc3_mode_show dwc3_mode_store dwc3_eswin_get_extcon_dev,
dwc3_eswin_device_notifier and dwc3_eswin_host_notifier, usb role
detection and switching are not supported.
- Remove the hub-rst attribute, remove the dwc3_hub_rst_show and
dwc3_hub_rst_store functions, this feature is not supported.
- Use syscon_regmap_lookup_by_phandle_args instead of the
syscon_regmap_lookup_by_phandle function.
- Use dev_err_probe in probe function.
- Drop mutex_lock, which is not required.
- Remove clk_prepare_enable and of_clk_get, and manage multiple
clocks using devm_clk_bulk_get_all_enabled.
- Remove the device_init_wakeup related functions, which were
used incorrectly.
- Remove MODULE_ALIAS, which is used incorrectly.
- The warning detected by the robot has been resolved.
- Link to V1: https://lore.kernel.org/lkml/20250516095237.1516-1-zhangsenchuan@eswincomputing.com/
Hang Cao (2):
dt-bindings: usb: Add ESWIN EIC7700 USB controller
usb: dwc3: eic7700: Add EIC7700 USB driver
.../bindings/usb/eswin,eic7700-usb.yaml | 94 +++++++++++++++++++
drivers/usb/dwc3/dwc3-generic-plat.c | 71 ++++++++++++--
2 files changed, 158 insertions(+), 7 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/eswin,eic7700-usb.yaml
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v7 1/2] dt-bindings: usb: Add ESWIN EIC7700 USB controller
2025-11-10 2:43 [PATCH v7 0/2] Add driver support for ESWIN EIC7700 SoC USB controller caohang
@ 2025-11-10 2:44 ` caohang
2025-11-10 2:45 ` [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver caohang
1 sibling, 0 replies; 5+ messages in thread
From: caohang @ 2025-11-10 2:44 UTC (permalink / raw)
To: gregkh, robh, krzk+dt, conor+dt, Thinh.Nguyen, p.zabel,
linux-kernel, linux-usb, devicetree
Cc: ningyu, linmin, pinkesh.vaghela, Hang Cao, Senchuan Zhang
From: Hang Cao <caohang@eswincomputing.com>
Add Device Tree binding documentation for the ESWIN EIC7700
usb controller module.
Signed-off-by: Senchuan Zhang <zhangsenchuan@eswincomputing.com>
Signed-off-by: Hang Cao <caohang@eswincomputing.com>
---
.../bindings/usb/eswin,eic7700-usb.yaml | 94 +++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/eswin,eic7700-usb.yaml
diff --git a/Documentation/devicetree/bindings/usb/eswin,eic7700-usb.yaml b/Documentation/devicetree/bindings/usb/eswin,eic7700-usb.yaml
new file mode 100644
index 000000000000..41c3b1b98991
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/eswin,eic7700-usb.yaml
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/eswin,eic7700-usb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ESWIN EIC7700 SoC Usb Controller
+
+maintainers:
+ - Wei Yang <yangwei1@eswincomputing.com>
+ - Senchuan Zhang <zhangsenchuan@eswincomputing.com>
+ - Hang Cao <caohang@eswincomputing.com>
+
+description:
+ The Usb controller on EIC7700 SoC.
+
+allOf:
+ - $ref: snps,dwc3-common.yaml#
+
+properties:
+ compatible:
+ const: eswin,eic7700-dwc3
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ interrupt-names:
+ items:
+ - const: peripheral
+
+ clocks:
+ maxItems: 3
+
+ clock-names:
+ items:
+ - const: aclk
+ - const: cfg
+ - const: usb_en
+
+ resets:
+ maxItems: 2
+
+ reset-names:
+ items:
+ - const: vaux
+ - const: usb_rst
+
+ eswin,hsp-sp-csr:
+ description:
+ HSP CSR is to control and get status of different high-speed peripherals
+ (such as Ethernet, USB, SATA, etc.) via register, which can tune
+ board-level's parameters of PHY, etc.
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ items:
+ - items:
+ - description: phandle to HSP Register Controller hsp_sp_csr node.
+ - description: USB bus register offset.
+ - description: AXI low power register offset.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - interrupts
+ - interrupt-names
+ - resets
+ - reset-names
+ - eswin,hsp-sp-csr
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ usb@50480000 {
+ compatible = "eswin,eic7700-dwc3";
+ reg = <0x50480000 0x10000>;
+ clocks = <&clock 135>,
+ <&clock 136>,
+ <&hspcrg 18>;
+ clock-names = "aclk", "cfg", "usb_en";
+ interrupt-parent = <&plic>;
+ interrupts = <85>;
+ interrupt-names = "peripheral";
+ resets = <&reset 84>, <&hspcrg 2>;
+ reset-names = "vaux", "usb_rst";
+ dr_mode = "peripheral";
+ maximum-speed = "high-speed";
+ phy_type = "utmi";
+ eswin,hsp-sp-csr = <&hsp_sp_csr 0x800 0x818>;
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver
2025-11-10 2:43 [PATCH v7 0/2] Add driver support for ESWIN EIC7700 SoC USB controller caohang
2025-11-10 2:44 ` [PATCH v7 1/2] dt-bindings: usb: Add ESWIN EIC7700 " caohang
@ 2025-11-10 2:45 ` caohang
2025-11-10 17:47 ` kernel test robot
2025-11-10 21:35 ` kernel test robot
1 sibling, 2 replies; 5+ messages in thread
From: caohang @ 2025-11-10 2:45 UTC (permalink / raw)
To: gregkh, robh, krzk+dt, conor+dt, Thinh.Nguyen, p.zabel,
linux-kernel, linux-usb, devicetree
Cc: ningyu, linmin, pinkesh.vaghela, Hang Cao, Senchuan Zhang
From: Hang Cao <caohang@eswincomputing.com>
The EIC7700 instantiates two USB 3.0 DWC3 IPs, each of which is backward
compatible with USB interfaces. It supports Super-speed (5Gb/s), DRD mode,
and compatible with xHCI 1.1, etc. Each of instances supports 16 endpoints
in device's mode and max 64 devices in host's mode.
This module needs to interact with the NOC via the AXI master bus, thus
requiring some HSP configuration operations to achieve this. Ops include
bus filter, pm signal or status to usb bus and so on.
Signed-off-by: Senchuan Zhang <zhangsenchuan@eswincomputing.com>
Signed-off-by: Hang Cao <caohang@eswincomputing.com>
---
drivers/usb/dwc3/dwc3-generic-plat.c | 71 +++++++++++++++++++++++++---
1 file changed, 64 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-generic-plat.c b/drivers/usb/dwc3/dwc3-generic-plat.c
index e869c7de7bc8..704cd1c490ea 100644
--- a/drivers/usb/dwc3/dwc3-generic-plat.c
+++ b/drivers/usb/dwc3/dwc3-generic-plat.c
@@ -10,8 +10,16 @@
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
#include "glue.h"
+#define EIC7700_HSP_BUS_FILTER_EN BIT(0)
+#define EIC7700_HSP_BUS_CLKEN_GM BIT(9)
+#define EIC7700_HSP_BUS_CLKEN_GS BIT(16)
+#define EIC7700_HSP_AXI_LP_XM_CSYSREQ BIT(0)
+#define EIC7700_HSP_AXI_LP_XS_CSYSREQ BIT(16)
+
struct dwc3_generic {
struct device *dev;
struct dwc3 dwc;
@@ -20,6 +28,11 @@ struct dwc3_generic {
struct reset_control *resets;
};
+struct dwc3_generic_config {
+ int (*init)(struct dwc3_generic *dwc3g);
+ struct dwc3_properties properties;
+};
+
#define to_dwc3_generic(d) container_of((d), struct dwc3_generic, dwc)
static void dwc3_generic_reset_control_assert(void *data)
@@ -27,9 +40,38 @@ static void dwc3_generic_reset_control_assert(void *data)
reset_control_assert(data);
}
+static int dwc3_eic7700_init(struct dwc3_generic *dwc3g)
+{
+ struct device *dev = dwc3g->dev;
+ struct regmap *regmap;
+ u32 hsp_usb_axi_lp;
+ u32 hsp_usb_bus;
+ u32 args[2];
+ u32 val;
+
+ regmap = syscon_regmap_lookup_by_phandle_args(dev->of_node,
+ "eswin,hsp-sp-csr",
+ ARRAY_SIZE(args), args);
+ if (IS_ERR(regmap)) {
+ dev_err(dev, "No hsp-sp-csr phandle specified\n");
+ return PTR_ERR(regmap);
+ }
+
+ hsp_usb_bus = args[0];
+ hsp_usb_axi_lp = args[1];
+
+ regmap_read(regmap, hsp_usb_bus, &val);
+ regmap_write(regmap, hsp_usb_bus, val | EIC7700_HSP_BUS_FILTER_EN |
+ EIC7700_HSP_BUS_CLKEN_GM | EIC7700_HSP_BUS_CLKEN_GS);
+
+ regmap_write(regmap, hsp_usb_axi_lp, EIC7700_HSP_AXI_LP_XM_CSYSREQ |
+ EIC7700_HSP_AXI_LP_XS_CSYSREQ);
+ return 0;
+}
+
static int dwc3_generic_probe(struct platform_device *pdev)
{
- const struct dwc3_properties *properties;
+ const struct dwc3_generic_config *plat_config;
struct dwc3_probe_data probe_data = {};
struct device *dev = &pdev->dev;
struct dwc3_generic *dwc3g;
@@ -77,12 +119,21 @@ static int dwc3_generic_probe(struct platform_device *pdev)
probe_data.res = res;
probe_data.ignore_clocks_and_resets = true;
- properties = of_device_get_match_data(dev);
- if (properties)
- probe_data.properties = *properties;
- else
+ plat_config = of_device_get_match_data(dev);
+ if (!plat_config) {
probe_data.properties = DWC3_DEFAULT_PROPERTIES;
+ goto core_probe;
+ }
+ probe_data.properties = plat_config->properties;
+ if (plat_config->init) {
+ ret = plat_config->init(dwc3g);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to init
+ platform\n");
+ }
+
+core_probe:
ret = dwc3_core_probe(&probe_data);
if (ret)
return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
@@ -150,13 +201,19 @@ static const struct dev_pm_ops dwc3_generic_dev_pm_ops = {
dwc3_generic_runtime_idle)
};
-static const struct dwc3_properties fsl_ls1028_dwc3 = {
- .gsbuscfg0_reqinfo = 0x2222,
+static const struct dwc3_generic_config fsl_ls1028_dwc3 = {
+ .properties.gsbuscfg0_reqinfo = 0x2222,
+};
+
+static const struct dwc3_generic_config eic7700_dwc3 = {
+ .init = dwc3_eic7700_init,
+ .properties = DWC3_DEFAULT_PROPERTIES,
};
static const struct of_device_id dwc3_generic_of_match[] = {
{ .compatible = "spacemit,k1-dwc3", },
{ .compatible = "fsl,ls1028a-dwc3", &fsl_ls1028_dwc3},
+ { .compatible = "eswin,eic7700-dwc3", &eic7700_dwc3},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, dwc3_generic_of_match);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver
2025-11-10 2:45 ` [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver caohang
@ 2025-11-10 17:47 ` kernel test robot
2025-11-10 21:35 ` kernel test robot
1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2025-11-10 17:47 UTC (permalink / raw)
To: caohang, gregkh, robh, krzk+dt, conor+dt, Thinh.Nguyen, p.zabel,
linux-kernel, linux-usb, devicetree
Cc: oe-kbuild-all, ningyu, linmin, pinkesh.vaghela, Hang Cao,
Senchuan Zhang
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on usb/usb-next next-20251110]
[cannot apply to usb/usb-linus robh/for-next pza/reset/next pza/imx-drm/next linus/master v6.18-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/caohang-eswincomputing-com/dt-bindings-usb-Add-ESWIN-EIC7700-USB-controller/20251110-104957
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/20251110024500.104-1-caohang%40eswincomputing.com
patch subject: [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver
config: xtensa-randconfig-r073-20251110 (https://download.01.org/0day-ci/archive/20251111/202511110121.BwTv4Fex-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 13.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251111/202511110121.BwTv4Fex-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511110121.BwTv4Fex-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
drivers/usb/dwc3/dwc3-generic-plat.c: In function 'dwc3_generic_probe':
>> drivers/usb/dwc3/dwc3-generic-plat.c:132:56: warning: missing terminating " character
132 | return dev_err_probe(dev, ret, "failed to init
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:132:56: error: missing terminating " character
132 | return dev_err_probe(dev, ret, "failed to init
| ^~~~~~~~~~~~~~~
>> drivers/usb/dwc3/dwc3-generic-plat.c:133:54: error: stray '\' in program
133 | platform\n");
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:133:46: error: 'platform' undeclared (first use in this function)
133 | platform\n");
| ^~~~~~~~
drivers/usb/dwc3/dwc3-generic-plat.c:133:46: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/usb/dwc3/dwc3-generic-plat.c:133:54: error: expected ')' before 'n'
133 | platform\n");
| ^~
| )
drivers/usb/dwc3/dwc3-generic-plat.c:132:45: note: to match this '('
132 | return dev_err_probe(dev, ret, "failed to init
| ^
drivers/usb/dwc3/dwc3-generic-plat.c:133:56: warning: missing terminating " character
133 | platform\n");
| ^
drivers/usb/dwc3/dwc3-generic-plat.c:133:56: error: missing terminating " character
133 | platform\n");
| ^~~
>> drivers/usb/dwc3/dwc3-generic-plat.c:133:56: error: expected ';' before '}' token
133 | platform\n");
| ^
| ;
134 | }
| ~
vim +132 drivers/usb/dwc3/dwc3-generic-plat.c
71
72 static int dwc3_generic_probe(struct platform_device *pdev)
73 {
74 const struct dwc3_generic_config *plat_config;
75 struct dwc3_probe_data probe_data = {};
76 struct device *dev = &pdev->dev;
77 struct dwc3_generic *dwc3g;
78 struct resource *res;
79 int ret;
80
81 dwc3g = devm_kzalloc(dev, sizeof(*dwc3g), GFP_KERNEL);
82 if (!dwc3g)
83 return -ENOMEM;
84
85 dwc3g->dev = dev;
86
87 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
88 if (!res) {
89 dev_err(&pdev->dev, "missing memory resource\n");
90 return -ENODEV;
91 }
92
93 dwc3g->resets = devm_reset_control_array_get_optional_exclusive(dev);
94 if (IS_ERR(dwc3g->resets))
95 return dev_err_probe(dev, PTR_ERR(dwc3g->resets), "failed to get resets\n");
96
97 ret = reset_control_assert(dwc3g->resets);
98 if (ret)
99 return dev_err_probe(dev, ret, "failed to assert resets\n");
100
101 /* Not strict timing, just for safety */
102 udelay(2);
103
104 ret = reset_control_deassert(dwc3g->resets);
105 if (ret)
106 return dev_err_probe(dev, ret, "failed to deassert resets\n");
107
108 ret = devm_add_action_or_reset(dev, dwc3_generic_reset_control_assert, dwc3g->resets);
109 if (ret)
110 return ret;
111
112 ret = devm_clk_bulk_get_all_enabled(dwc3g->dev, &dwc3g->clks);
113 if (ret < 0)
114 return dev_err_probe(dev, ret, "failed to get clocks\n");
115
116 dwc3g->num_clocks = ret;
117 dwc3g->dwc.dev = dev;
118 probe_data.dwc = &dwc3g->dwc;
119 probe_data.res = res;
120 probe_data.ignore_clocks_and_resets = true;
121
122 plat_config = of_device_get_match_data(dev);
123 if (!plat_config) {
124 probe_data.properties = DWC3_DEFAULT_PROPERTIES;
125 goto core_probe;
126 }
127
128 probe_data.properties = plat_config->properties;
129 if (plat_config->init) {
130 ret = plat_config->init(dwc3g);
131 if (ret)
> 132 return dev_err_probe(dev, ret, "failed to init
> 133 platform\n");
134 }
135
136 core_probe:
137 ret = dwc3_core_probe(&probe_data);
138 if (ret)
139 return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
140
141 return 0;
142 }
143
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver
2025-11-10 2:45 ` [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver caohang
2025-11-10 17:47 ` kernel test robot
@ 2025-11-10 21:35 ` kernel test robot
1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2025-11-10 21:35 UTC (permalink / raw)
To: caohang, gregkh, robh, krzk+dt, conor+dt, Thinh.Nguyen, p.zabel,
linux-kernel, linux-usb, devicetree
Cc: llvm, oe-kbuild-all, ningyu, linmin, pinkesh.vaghela, Hang Cao,
Senchuan Zhang
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on usb/usb-next next-20251110]
[cannot apply to usb/usb-linus robh/for-next pza/reset/next pza/imx-drm/next linus/master v6.18-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/caohang-eswincomputing-com/dt-bindings-usb-Add-ESWIN-EIC7700-USB-controller/20251110-104957
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/20251110024500.104-1-caohang%40eswincomputing.com
patch subject: [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver
config: arm-defconfig (https://download.01.org/0day-ci/archive/20251111/202511110504.qfGuRVHY-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 996639d6ebb86ff15a8c99b67f1c2e2117636ae7)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251111/202511110504.qfGuRVHY-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511110504.qfGuRVHY-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/usb/dwc3/dwc3-generic-plat.c:132:35: warning: missing terminating '"' character [-Winvalid-pp-token]
132 | return dev_err_probe(dev, ret, "failed to init
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:132:35: error: expected expression
drivers/usb/dwc3/dwc3-generic-plat.c:133:21: warning: missing terminating '"' character [-Winvalid-pp-token]
133 | platform\n");
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:145:1: error: function definition is not allowed here
145 | {
| ^
drivers/usb/dwc3/dwc3-generic-plat.c:152:1: error: function definition is not allowed here
152 | {
| ^
drivers/usb/dwc3/dwc3-generic-plat.c:167:1: error: function definition is not allowed here
167 | {
| ^
drivers/usb/dwc3/dwc3-generic-plat.c:184:1: error: function definition is not allowed here
184 | {
| ^
drivers/usb/dwc3/dwc3-generic-plat.c:189:1: error: function definition is not allowed here
189 | {
| ^
drivers/usb/dwc3/dwc3-generic-plat.c:194:1: error: function definition is not allowed here
194 | {
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:199:22: error: use of undeclared identifier 'dwc3_generic_suspend'; did you mean 'pm_generic_suspend'?
199 | SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
| ^~~~~~~~~~~~~~~~~~~~
| pm_generic_suspend
include/linux/pm.h:314:26: note: expanded from macro 'SYSTEM_SLEEP_PM_OPS'
314 | .suspend = pm_sleep_ptr(suspend_fn), \
| ^~~~~~~~~~
include/linux/pm.h:473:65: note: expanded from macro 'pm_sleep_ptr'
473 | #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
| ^~~~
include/linux/util_macros.h:136:38: note: expanded from macro 'PTR_IF'
136 | #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
| ^~~
include/linux/pm.h:840:12: note: 'pm_generic_suspend' declared here
840 | extern int pm_generic_suspend(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:199:44: error: use of undeclared identifier 'dwc3_generic_resume'; did you mean 'pm_generic_resume'?
199 | SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
| ^~~~~~~~~~~~~~~~~~~
| pm_generic_resume
include/linux/pm.h:315:25: note: expanded from macro 'SYSTEM_SLEEP_PM_OPS'
315 | .resume = pm_sleep_ptr(resume_fn), \
| ^~~~~~~~~
include/linux/pm.h:473:65: note: expanded from macro 'pm_sleep_ptr'
473 | #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
| ^~~~
include/linux/util_macros.h:136:38: note: expanded from macro 'PTR_IF'
136 | #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
| ^~~
include/linux/pm.h:843:12: note: 'pm_generic_resume' declared here
843 | extern int pm_generic_resume(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:199:22: error: use of undeclared identifier 'dwc3_generic_suspend'; did you mean 'pm_generic_suspend'?
199 | SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
| ^~~~~~~~~~~~~~~~~~~~
| pm_generic_suspend
include/linux/pm.h:316:25: note: expanded from macro 'SYSTEM_SLEEP_PM_OPS'
316 | .freeze = pm_sleep_ptr(suspend_fn), \
| ^~~~~~~~~~
include/linux/pm.h:473:65: note: expanded from macro 'pm_sleep_ptr'
473 | #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
| ^~~~
include/linux/util_macros.h:136:38: note: expanded from macro 'PTR_IF'
136 | #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
| ^~~
include/linux/pm.h:840:12: note: 'pm_generic_suspend' declared here
840 | extern int pm_generic_suspend(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:199:44: error: use of undeclared identifier 'dwc3_generic_resume'; did you mean 'pm_generic_resume'?
199 | SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
| ^~~~~~~~~~~~~~~~~~~
| pm_generic_resume
include/linux/pm.h:317:23: note: expanded from macro 'SYSTEM_SLEEP_PM_OPS'
317 | .thaw = pm_sleep_ptr(resume_fn), \
| ^~~~~~~~~
include/linux/pm.h:473:65: note: expanded from macro 'pm_sleep_ptr'
473 | #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
| ^~~~
include/linux/util_macros.h:136:38: note: expanded from macro 'PTR_IF'
136 | #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
| ^~~
include/linux/pm.h:843:12: note: 'pm_generic_resume' declared here
843 | extern int pm_generic_resume(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:199:22: error: use of undeclared identifier 'dwc3_generic_suspend'; did you mean 'pm_generic_suspend'?
199 | SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
| ^~~~~~~~~~~~~~~~~~~~
| pm_generic_suspend
include/linux/pm.h:318:27: note: expanded from macro 'SYSTEM_SLEEP_PM_OPS'
318 | .poweroff = pm_sleep_ptr(suspend_fn), \
| ^~~~~~~~~~
include/linux/pm.h:473:65: note: expanded from macro 'pm_sleep_ptr'
473 | #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
| ^~~~
include/linux/util_macros.h:136:38: note: expanded from macro 'PTR_IF'
136 | #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
| ^~~
include/linux/pm.h:840:12: note: 'pm_generic_suspend' declared here
840 | extern int pm_generic_suspend(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:199:44: error: use of undeclared identifier 'dwc3_generic_resume'; did you mean 'pm_generic_resume'?
199 | SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
| ^~~~~~~~~~~~~~~~~~~
| pm_generic_resume
include/linux/pm.h:319:26: note: expanded from macro 'SYSTEM_SLEEP_PM_OPS'
319 | .restore = pm_sleep_ptr(resume_fn),
| ^~~~~~~~~
include/linux/pm.h:473:65: note: expanded from macro 'pm_sleep_ptr'
473 | #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
| ^~~~
include/linux/util_macros.h:136:38: note: expanded from macro 'PTR_IF'
136 | #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
| ^~~
include/linux/pm.h:843:12: note: 'pm_generic_resume' declared here
843 | extern int pm_generic_resume(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:200:17: error: use of undeclared identifier 'dwc3_generic_runtime_suspend'; did you mean 'pm_generic_runtime_suspend'?
200 | RUNTIME_PM_OPS(dwc3_generic_runtime_suspend, dwc3_generic_runtime_resume,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| pm_generic_runtime_suspend
include/linux/pm.h:338:21: note: expanded from macro 'RUNTIME_PM_OPS'
338 | .runtime_suspend = suspend_fn, \
| ^~~~~~~~~~
include/linux/pm_runtime.h:68:12: note: 'pm_generic_runtime_suspend' declared here
68 | extern int pm_generic_runtime_suspend(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:200:47: error: use of undeclared identifier 'dwc3_generic_runtime_resume'; did you mean 'pm_generic_runtime_resume'?
200 | RUNTIME_PM_OPS(dwc3_generic_runtime_suspend, dwc3_generic_runtime_resume,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| pm_generic_runtime_resume
include/linux/pm.h:339:20: note: expanded from macro 'RUNTIME_PM_OPS'
339 | .runtime_resume = resume_fn, \
| ^~~~~~~~~
include/linux/pm_runtime.h:69:12: note: 'pm_generic_runtime_resume' declared here
69 | extern int pm_generic_runtime_resume(struct device *dev);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:201:10: error: use of undeclared identifier 'dwc3_generic_runtime_idle'; did you mean 'dwc3_runtime_idle'?
201 | dwc3_generic_runtime_idle)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| dwc3_runtime_idle
include/linux/pm.h:340:18: note: expanded from macro 'RUNTIME_PM_OPS'
340 | .runtime_idle = idle_fn,
| ^~~~~~~
drivers/usb/dwc3/glue.h:74:5: note: 'dwc3_runtime_idle' declared here
74 | int dwc3_runtime_idle(struct dwc3 *dwc);
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:201:10: error: incompatible function pointer types initializing 'int (*)(struct device *)' with an expression of type 'int (struct dwc3 *)' [-Wincompatible-function-pointer-types]
201 | dwc3_generic_runtime_idle)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/usb/dwc3/dwc3-generic-plat.c:223:13: error: use of undeclared identifier 'dwc3_generic_remove'; did you mean 'dwc3_generic_probe'?
223 | .remove = dwc3_generic_remove,
| ^~~~~~~~~~~~~~~~~~~
| dwc3_generic_probe
drivers/usb/dwc3/dwc3-generic-plat.c:72:12: note: 'dwc3_generic_probe' declared here
72 | static int dwc3_generic_probe(struct platform_device *pdev)
| ^
>> drivers/usb/dwc3/dwc3-generic-plat.c:223:13: error: incompatible function pointer types initializing 'void (*)(struct platform_device *)' with an expression of type 'int (struct platform_device *)' [-Wincompatible-function-pointer-types]
223 | .remove = dwc3_generic_remove,
| ^~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
vim +132 drivers/usb/dwc3/dwc3-generic-plat.c
71
72 static int dwc3_generic_probe(struct platform_device *pdev)
73 {
74 const struct dwc3_generic_config *plat_config;
75 struct dwc3_probe_data probe_data = {};
76 struct device *dev = &pdev->dev;
77 struct dwc3_generic *dwc3g;
78 struct resource *res;
79 int ret;
80
81 dwc3g = devm_kzalloc(dev, sizeof(*dwc3g), GFP_KERNEL);
82 if (!dwc3g)
83 return -ENOMEM;
84
85 dwc3g->dev = dev;
86
87 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
88 if (!res) {
89 dev_err(&pdev->dev, "missing memory resource\n");
90 return -ENODEV;
91 }
92
93 dwc3g->resets = devm_reset_control_array_get_optional_exclusive(dev);
94 if (IS_ERR(dwc3g->resets))
95 return dev_err_probe(dev, PTR_ERR(dwc3g->resets), "failed to get resets\n");
96
97 ret = reset_control_assert(dwc3g->resets);
98 if (ret)
99 return dev_err_probe(dev, ret, "failed to assert resets\n");
100
101 /* Not strict timing, just for safety */
102 udelay(2);
103
104 ret = reset_control_deassert(dwc3g->resets);
105 if (ret)
106 return dev_err_probe(dev, ret, "failed to deassert resets\n");
107
108 ret = devm_add_action_or_reset(dev, dwc3_generic_reset_control_assert, dwc3g->resets);
109 if (ret)
110 return ret;
111
112 ret = devm_clk_bulk_get_all_enabled(dwc3g->dev, &dwc3g->clks);
113 if (ret < 0)
114 return dev_err_probe(dev, ret, "failed to get clocks\n");
115
116 dwc3g->num_clocks = ret;
117 dwc3g->dwc.dev = dev;
118 probe_data.dwc = &dwc3g->dwc;
119 probe_data.res = res;
120 probe_data.ignore_clocks_and_resets = true;
121
122 plat_config = of_device_get_match_data(dev);
123 if (!plat_config) {
124 probe_data.properties = DWC3_DEFAULT_PROPERTIES;
125 goto core_probe;
126 }
127
128 probe_data.properties = plat_config->properties;
129 if (plat_config->init) {
130 ret = plat_config->init(dwc3g);
131 if (ret)
> 132 return dev_err_probe(dev, ret, "failed to init
133 platform\n");
134 }
135
136 core_probe:
137 ret = dwc3_core_probe(&probe_data);
138 if (ret)
139 return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
140
141 return 0;
142 }
143
144 static void dwc3_generic_remove(struct platform_device *pdev)
> 145 {
146 struct dwc3 *dwc = platform_get_drvdata(pdev);
147
148 dwc3_core_remove(dwc);
149 }
150
151 static int dwc3_generic_suspend(struct device *dev)
152 {
153 struct dwc3 *dwc = dev_get_drvdata(dev);
154 struct dwc3_generic *dwc3g = to_dwc3_generic(dwc);
155 int ret;
156
157 ret = dwc3_pm_suspend(dwc);
158 if (ret)
159 return ret;
160
161 clk_bulk_disable_unprepare(dwc3g->num_clocks, dwc3g->clks);
162
163 return 0;
164 }
165
166 static int dwc3_generic_resume(struct device *dev)
167 {
168 struct dwc3 *dwc = dev_get_drvdata(dev);
169 struct dwc3_generic *dwc3g = to_dwc3_generic(dwc);
170 int ret;
171
172 ret = clk_bulk_prepare_enable(dwc3g->num_clocks, dwc3g->clks);
173 if (ret)
174 return ret;
175
176 ret = dwc3_pm_resume(dwc);
177 if (ret)
178 return ret;
179
180 return 0;
181 }
182
183 static int dwc3_generic_runtime_suspend(struct device *dev)
184 {
185 return dwc3_runtime_suspend(dev_get_drvdata(dev));
186 }
187
188 static int dwc3_generic_runtime_resume(struct device *dev)
189 {
190 return dwc3_runtime_resume(dev_get_drvdata(dev));
191 }
192
193 static int dwc3_generic_runtime_idle(struct device *dev)
194 {
195 return dwc3_runtime_idle(dev_get_drvdata(dev));
196 }
197
198 static const struct dev_pm_ops dwc3_generic_dev_pm_ops = {
> 199 SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
> 200 RUNTIME_PM_OPS(dwc3_generic_runtime_suspend, dwc3_generic_runtime_resume,
> 201 dwc3_generic_runtime_idle)
202 };
203
204 static const struct dwc3_generic_config fsl_ls1028_dwc3 = {
205 .properties.gsbuscfg0_reqinfo = 0x2222,
206 };
207
208 static const struct dwc3_generic_config eic7700_dwc3 = {
209 .init = dwc3_eic7700_init,
210 .properties = DWC3_DEFAULT_PROPERTIES,
211 };
212
213 static const struct of_device_id dwc3_generic_of_match[] = {
214 { .compatible = "spacemit,k1-dwc3", },
215 { .compatible = "fsl,ls1028a-dwc3", &fsl_ls1028_dwc3},
216 { .compatible = "eswin,eic7700-dwc3", &eic7700_dwc3},
217 { /* sentinel */ }
218 };
219 MODULE_DEVICE_TABLE(of, dwc3_generic_of_match);
220
221 static struct platform_driver dwc3_generic_driver = {
222 .probe = dwc3_generic_probe,
> 223 .remove = dwc3_generic_remove,
224 .driver = {
225 .name = "dwc3-generic-plat",
226 .of_match_table = dwc3_generic_of_match,
227 .pm = pm_ptr(&dwc3_generic_dev_pm_ops),
228 },
229 };
230 module_platform_driver(dwc3_generic_driver);
231
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-11-10 21:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 2:43 [PATCH v7 0/2] Add driver support for ESWIN EIC7700 SoC USB controller caohang
2025-11-10 2:44 ` [PATCH v7 1/2] dt-bindings: usb: Add ESWIN EIC7700 " caohang
2025-11-10 2:45 ` [PATCH v7 2/2] usb: dwc3: eic7700: Add EIC7700 USB driver caohang
2025-11-10 17:47 ` kernel test robot
2025-11-10 21:35 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).