From patchwork Mon Feb 3 19:10:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13958101 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76E2020E03A; Mon, 3 Feb 2025 19:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738610134; cv=none; b=kKcVnEHCtN2JJDMMvlWfG7D7CxakT3dNp02jBdAWc6SuASnPWDetT7bP6WFzSIM0SrSvoL1YyPYUJrTQG45aaTXNenWwlLdqWqkBl0nRngiEBY53W3f+Ilch5J8mgl3u5fNGbBERx6wCWvHxQyal15LrelWJLxTbBw81MB55RGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738610134; c=relaxed/simple; bh=d+uS1eRC4uv8qsZyfw2IqkLl0y5gISjVkWAiQ1IdAaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=byS7Z3SfbwmjIVMjZ7/vQyLPH2n8kq39OoUo90fI5k/+bNpaTk1NGwimGOZKCft9EoTtJyQjGy19hEJw7EFf7mkv5AfZzuavDvFnCt3H1IEwyTr4dlYQAP2HBoeiUQLEGzDNJYHTDPgrD142oRGBFawUrNhQYYB23cJKVyNxpyc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LYAHESxf; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LYAHESxf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738610133; x=1770146133; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d+uS1eRC4uv8qsZyfw2IqkLl0y5gISjVkWAiQ1IdAaU=; b=LYAHESxfaQ2EBQzFFhQXnvSrZSNd/n5N/p7p9nMHhicObyC1P5IXWioo GdlXBW2FkXSQe5rQuz52yGCNG8jJjfRzGRg79avoWG2ThXEVsQw3TFxvT nlIwXfUP0u0ZAmFJq1kiujXm8eqcpaiscy7ilHfMQOdMjrBYChZow/DMV ZYoPu7KLERFeBGo+00jye4AqJw4cjtyOFQGJyvrQeyXxUFErqA9I3qoI6 faY4mFCs7yBPWn70X85tfPLFg9jb4JYJDM21xto+JaPx/ovN/TpfifnyF 9KuwChj4h8NuEmeBsSIjSw5MxAws34dr0fag8KGWjVfEo/scE3x5x2GYR Q==; X-CSE-ConnectionGUID: JBwQ4cliRHaiEbt0CiFJsg== X-CSE-MsgGUID: n3Z292rJTwmlmCWftAoGnQ== X-IronPort-AV: E=McAfee;i="6700,10204,11335"; a="43043119" X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="43043119" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2025 11:15:30 -0800 X-CSE-ConnectionGUID: O1XQPjtoSwmwyfT1n0vA2A== X-CSE-MsgGUID: 8QqbGjarSZe1lLH1JTmVMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="110266548" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa007.fm.intel.com with ESMTP; 03 Feb 2025 11:15:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id C5D47164; Mon, 03 Feb 2025 21:15:25 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Thinh Nguyen , Felipe Balbi , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ferry Toth , Andy Shevchenko Subject: [PATCH v2 1/3] dt-bindings: usb: dwc3: Add a property to reserve endpoints Date: Mon, 3 Feb 2025 21:10:53 +0200 Message-ID: <20250203191524.3730346-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250203191524.3730346-1-andriy.shevchenko@linux.intel.com> References: <20250203191524.3730346-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some of the endpoints may be reserved by hardware for different purposes, e.g., tracing control and output. This is the case, for instance, on Intel Merrifield and Moorefield platforms that reserve a few and USB driver may not use them for the regular transfers. Add the respective bindings. Signed-off-by: Andy Shevchenko Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/usb/snps,dwc3-common.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml index c956053fd036..71249b6ba616 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml @@ -65,6 +65,17 @@ properties: mode. type: boolean + snps,reserved-endpoints: + description: + Reserve endpoints for other needs, e.g, for tracing control and output. + When set, the driver will avoid using them for the regular USB transfers. + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 1 + maxItems: 30 + items: + minimum: 2 + maximum: 31 + snps,dis-start-transfer-quirk: description: When set, disable isoc START TRANSFER command failure SW work-around From patchwork Mon Feb 3 19:10:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13958102 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F27A8211495; Mon, 3 Feb 2025 19:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738610134; cv=none; b=AuePp721KHXbHhUW2jT8ZL6fpP/9EI15FG7hV2kziFiyqM4RUOTaJP7HNfSJjv6shDBwYJV8boz0XoOFoH6jG9rPpLgJx2gx1C6TGmnhMbpV5sfVXwmSFG36Qs6iOlXNLtKtoIDBnP98DZlt4OV9HgeQrvL43pkqPEixXtTZ14s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738610134; c=relaxed/simple; bh=qi3vHTjWPQ95vzXYY1SIxCkwYIb7BFGycZRDGyY6K6c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bLLG7KcBxCbIi1xiERKR0BxG7oidvCD4AytrFT0EShZnD1Yljogdav0tDuuu/X8bws7BEDqkn/qYnlsD58AlbXqZEtMJzCBmglzdMHqdbxfBYrc+AxEjxe7MsBOz74ripGGQQtElYyu4v4RqA+u6LpqaS0QVKhGjLhN0zLI1G2A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UQ2gJ7Ga; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UQ2gJ7Ga" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738610133; x=1770146133; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qi3vHTjWPQ95vzXYY1SIxCkwYIb7BFGycZRDGyY6K6c=; b=UQ2gJ7GaoEdwjF3m0laEgy2ZZQ8os+LcS+BRNy0PKCYN+RvmJTO4UAfC RyEEZxnKc8fHqaCsVPf2POGV6t2r8aYi7R+6YLiPe+8VNAr1oKwtM/SBm yk53wclDulHtgnyzFr2LbAq5qXWSmombe/wij42ranBPiQqwzfaZW7KPS /wvhSdiN7MV/rNRQp5HJtd2sU7tZQaKpdnFMIz4HAWuHpdFRBgpq1lT5A KWjJbvYON2Qc5QIxf8pGMH0ILqwwgsRVsVHRXV9n7mqPbECYiHYffAeD1 ysgbkbw8MRLC3zFq3M1qHenBSzHam4HSmq8MSpntL0I8qLl3sEmskMBQx w==; X-CSE-ConnectionGUID: WLZGzHSpSWeKhsLRCcukww== X-CSE-MsgGUID: 8BNF3zfYTs+dPcY5jr4RWw== X-IronPort-AV: E=McAfee;i="6700,10204,11335"; a="43043127" X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="43043127" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2025 11:15:30 -0800 X-CSE-ConnectionGUID: 8PGdqJF2TbqcYi5IduPU/g== X-CSE-MsgGUID: 2rt/8lFUSrCcXMA7XtjeEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="110266549" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa007.fm.intel.com with ESMTP; 03 Feb 2025 11:15:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D7E4E399; Mon, 03 Feb 2025 21:15:25 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Thinh Nguyen , Felipe Balbi , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ferry Toth , Andy Shevchenko Subject: [PATCH v2 2/3] usb: dwc3: gadget: Add support for snps,reserved-endpoints property Date: Mon, 3 Feb 2025 21:10:54 +0200 Message-ID: <20250203191524.3730346-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250203191524.3730346-1-andriy.shevchenko@linux.intel.com> References: <20250203191524.3730346-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The snps,reserved-endpoints property lists the reserved endpoints that shouldn't be used for normal transfers. Add support for that to the driver. While at it, make sure we don't crash by a sudden access to those endpoints in the gadget driver. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/gadget.c | 60 +++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index d27af65eb08a..93b1e389a983 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -547,6 +547,7 @@ static int dwc3_gadget_set_xfer_resource(struct dwc3_ep *dep) int dwc3_gadget_start_config(struct dwc3 *dwc, unsigned int resource_index) { struct dwc3_gadget_ep_cmd_params params; + struct dwc3_ep *dep; u32 cmd; int i; int ret; @@ -563,8 +564,13 @@ int dwc3_gadget_start_config(struct dwc3 *dwc, unsigned int resource_index) return ret; /* Reset resource allocation flags */ - for (i = resource_index; i < dwc->num_eps && dwc->eps[i]; i++) - dwc->eps[i]->flags &= ~DWC3_EP_RESOURCE_ALLOCATED; + for (i = resource_index; i < dwc->num_eps; i++) { + dep = dwc->eps[i]; + if (!dep) + continue; + + dep->flags &= ~DWC3_EP_RESOURCE_ALLOCATED; + } return 0; } @@ -751,9 +757,11 @@ void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc) dwc->last_fifo_depth = fifo_depth; /* Clear existing TXFIFO for all IN eps except ep0 */ - for (num = 3; num < min_t(int, dwc->num_eps, DWC3_ENDPOINTS_NUM); - num += 2) { + for (num = 3; num < min_t(int, dwc->num_eps, DWC3_ENDPOINTS_NUM); num += 2) { dep = dwc->eps[num]; + if (!dep) + continue; + /* Don't change TXFRAMNUM on usb31 version */ size = DWC3_IP_IS(DWC3) ? 0 : dwc3_readl(dwc->regs, DWC3_GTXFIFOSIZ(num >> 1)) & @@ -3395,14 +3403,52 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum) return 0; } +static int dwc3_gadget_parse_reserved_endpoints(struct dwc3 *dwc, const char *propname, + u8 *eps, u8 num) +{ + u8 count; + int ret; + + if (!device_property_present(dwc->dev, propname)) + return 0; + + ret = device_property_count_u8(dwc->dev, propname); + if (ret < 0) + return ret; + count = ret; + + ret = device_property_read_u8_array(dwc->dev, propname, eps, min(num, count)); + if (ret) + return ret; + + return count; +} + static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total) { + const char *propname = "snps,reserved-endpoints"; u8 epnum; + u8 eps[DWC3_ENDPOINTS_NUM]; + u8 count; + u8 num; + int ret; INIT_LIST_HEAD(&dwc->gadget->ep_list); + ret = dwc3_gadget_parse_reserved_endpoints(dwc, propname, eps, ARRAY_SIZE(eps)); + if (ret < 0) { + dev_err(dwc->dev, "failed to read %s\n", propname); + return ret; + } + count = ret; + for (epnum = 0; epnum < total; epnum++) { - int ret; + for (num = 0; num < count; num++) { + if (epnum == eps[num]) + break; + } + if (num < count) + continue; ret = dwc3_gadget_init_endpoint(dwc, epnum); if (ret) @@ -3669,6 +3715,8 @@ static bool dwc3_gadget_endpoint_trbs_complete(struct dwc3_ep *dep, for (i = 0; i < DWC3_ENDPOINTS_NUM; i++) { dep = dwc->eps[i]; + if (!dep) + continue; if (!(dep->flags & DWC3_EP_ENABLED)) continue; @@ -3818,6 +3866,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, u8 epnum = event->endpoint_number; dep = dwc->eps[epnum]; + if (!dep) + return; if (!(dep->flags & DWC3_EP_ENABLED)) { if ((epnum > 1) && !(dep->flags & DWC3_EP_TRANSFER_STARTED)) From patchwork Mon Feb 3 19:10:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13958103 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C5A1139CE3; Mon, 3 Feb 2025 19:16:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738610205; cv=none; b=plSpd1OdCFyluLt3PcDburHvE0G9U1tb/znFkIp+y76st8McBVdm5XOa5xg/6DB56EwPElKJwEkcBkWguIS6ZJfr3dvrLEeRSy2gx/7mvjDSRaV7rTUiMdG50ev7qEVEM87YxBTfQFbDk+hgOjuDH4DB8T6jAnFW1unuQss1J9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738610205; c=relaxed/simple; bh=KyxS/VFzowY3TT/f2zu8rNl6KxCFGMJpC3jrH3DGZZo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bbYRejYsBxBZi6Oh4OQreZwc3pFXq0Ymy888Ea8tr+fYIRzinvpn1xELdoHUicGOKp/OG/wI4Gv8ngGz4TEtjqUPKKK/r/YGqiZo7PicPBXTRPwUpkrNjbUZs9/177n4SYJXbm+vkueJ9mLsNEtmkHF9/7FV1ivQr9zzC65jwKI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hxvI25Pi; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hxvI25Pi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738610204; x=1770146204; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KyxS/VFzowY3TT/f2zu8rNl6KxCFGMJpC3jrH3DGZZo=; b=hxvI25PiA1vQzEM1s4mPyWbYpbrAc02v5geTukYqMWp8aphpRX+eCP9S 4wGoA+OfCDbfoVx8gpt9Gk85MpByWTOz6Rb7oWlpwRXnBcITt09X65cb7 WlZNJxMS3JvLJkclWcHMnFf2yiXW8RYAP5pvyyaLZDWwb5rIEaW6sD1Fe b+9NPY5CeD3T0zo9czzaYU1Ac9lKnutToqerRacgRqRldXHSyBh+nATzI uOa7I+knvOQfVbUNBfG8h1m1BX2zC1IzbHgaJG9XDW+Vzb/GqjvTMBC7O lYIBhlHIkwWja3nQ5tKHEZCJQRGf0w3W//g3w0npuPL4mxnUKuMmhFEiI Q==; X-CSE-ConnectionGUID: TlhJ4PEuR2qbDAkNRfdVJg== X-CSE-MsgGUID: IR2WD9+XQhKtIwCAJ1Yi4w== X-IronPort-AV: E=McAfee;i="6700,10204,11335"; a="50507066" X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="50507066" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2025 11:15:30 -0800 X-CSE-ConnectionGUID: kY0haL5cTzS8OCgAgXJ+gQ== X-CSE-MsgGUID: dozJeq+iQFy14+i5+6Z72g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="110917950" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 03 Feb 2025 11:15:26 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DD2EF353; Mon, 03 Feb 2025 21:15:25 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Thinh Nguyen , Felipe Balbi , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ferry Toth , Andy Shevchenko Subject: [PATCH v2 3/3] usb: dwc3: gadget: Avoid using reserved endpoints on Intel Merrifield Date: Mon, 3 Feb 2025 21:10:55 +0200 Message-ID: <20250203191524.3730346-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250203191524.3730346-1-andriy.shevchenko@linux.intel.com> References: <20250203191524.3730346-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Intel Merrifield SoC uses these endpoints for tracing and they cannot be re-allocated if being used because the side band flow control signals are hard wired to certain endpoints: • 1 High BW Bulk IN (IN#1) (RTIT) • 1 1KB BW Bulk IN (IN#8) + 1 1KB BW Bulk OUT (Run Control) (OUT#8) In device mode, since RTIT (EP#1) and EXI/RunControl (EP#8) uses External Buffer Control (EBC) mode, these endpoints are to be mapped to EBC mode (to be done by EXI target driver). Additionally TRB for RTIT and EXI are maintained in STM (System Trace Module) unit and the EXI target driver will as well configure the TRB location for EP #1 IN and EP#8 (IN and OUT). Since STM/PTI and EXI hardware blocks manage these endpoints and interface to OTG3 controller through EBC interface, there is no need to enable any events (such as XferComplete etc) for these end points. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 052852f80146..54a4ee2b90b7 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -148,11 +148,21 @@ static const struct property_entry dwc3_pci_intel_byt_properties[] = { {} }; +/* + * Intel Merrifield SoC uses these endpoints for tracing and they cannot + * be re-allocated if being used because the side band flow control signals + * are hard wired to certain endpoints: + * - 1 High BW Bulk IN (IN#1) (RTIT) + * - 1 1KB BW Bulk IN (IN#8) + 1 1KB BW Bulk OUT (Run Control) (OUT#8) + */ +static const u8 dwc3_pci_mrfld_reserved_endpoints[] = { 3, 16, 17 }; + static const struct property_entry dwc3_pci_mrfld_properties[] = { PROPERTY_ENTRY_STRING("dr_mode", "otg"), PROPERTY_ENTRY_STRING("linux,extcon-name", "mrfld_bcove_pwrsrc"), PROPERTY_ENTRY_BOOL("snps,dis_u3_susphy_quirk"), PROPERTY_ENTRY_BOOL("snps,dis_u2_susphy_quirk"), + PROPERTY_ENTRY_U8_ARRAY("snps,reserved-endpoints", dwc3_pci_mrfld_reserved_endpoints), PROPERTY_ENTRY_BOOL("snps,usb2-gadget-lpm-disable"), PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"), {}