Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2492327ybi; Mon, 17 Jun 2019 05:53:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJ9k33C07epnZEkxbTgjARFMJt3/WfPgWwYLP3o2QKjt9PrJVENUxcVBEU0tUUbh5pBQ2p X-Received: by 2002:a62:764d:: with SMTP id r74mr92820363pfc.110.1560776017638; Mon, 17 Jun 2019 05:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560776017; cv=none; d=google.com; s=arc-20160816; b=opqqUSxEuz9yH8/wfUATOZSM150B6QEPwjCrrEsxISa3AWylJZ2++u6SNRTCm2QeuM EByveQyRQ0MOO6GI0uwpm4GYb+LSzoKsH2imfO3MLQ8nBifBJqzKxDZIRuY2O6i7hERW JWWjZX//r3Sb2hA3qlgz60kflVujRXBMHPm0QetTu5CYRhuk22k0czi6POYNMX6aDCCW Fo7B0Y4OeMLBziO5wbXi+lVDyLrkbGG2cNRpysaOhAuaqYpwXt2jXysC7QEdQm5yUz/s KAmMdHVApm/pjGu9AD6UDx9zFHyab3FhUOSMxuhqgcw9Rqiqu6xn1jOs9lHlGodjPgZ5 xtwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=jpBzE5AriRACq24KWXTKtlr/LqZGlu5GK5oqEVfbB1A=; b=q0LLm62nFy/7ADpAgC2d8xerPnkp55VR88MPbLl/fUlFD7oBtsomqymCv71T8CZ0se wo80srK4+e/LlYsJeQAIe/R6KJZrLIX/e7lY60XTu4EiM7Sgwpb2jwjK9bcazz+SMk7Y zPNEjzVqC36W6zJBPapP7mzxFE4sAkZ6+IgNv89dr7511sGSOCqd+1AL4wCv2Owr15cW 3XXeXA+/CRV6dW78g3ZYe9fzj3OhFtV76BjWumlWEsvy/4OrCo8cb841fiEeIqxYbBKV Ss0+2MuF8Zomnmv8szk0FXTr0oFItEJoLoIrzF0pyryNwVZy1zR9qR1/X0405nRHOKmU Axvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si9650602pll.377.2019.06.17.05.53.22; Mon, 17 Jun 2019 05:53:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728160AbfFQMxA (ORCPT + 99 others); Mon, 17 Jun 2019 08:53:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:13071 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727763AbfFQMw7 (ORCPT ); Mon, 17 Jun 2019 08:52:59 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 05:52:58 -0700 X-ExtLoop1: 1 Received: from pipin.fi.intel.com (HELO pipin) ([10.237.72.175]) by orsmga006.jf.intel.com with ESMTP; 17 Jun 2019 05:52:56 -0700 From: Felipe Balbi To: Ran Wang , Rob Herring Cc: Greg Kroah-Hartman , "open list\:DESIGNWARE USB3 DRD IP DRIVER" , open list , Rob Herring , "devicetree\@vger.kernel.org" , Leo Li Subject: RE: [PATCH] usb: dwc3: Enable the USB snooping In-Reply-To: References: <20171115060459.45375-1-ran.wang_1@nxp.com> <87ineb9b5v.fsf@linux.intel.com> <87shdfet90.fsf@linux.intel.com> <87k1eaanjw.fsf@linux.intel.com> Date: Mon, 17 Jun 2019 15:52:52 +0300 Message-ID: <87o92wgyqj.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Ran Wang writes: > Hi Felipe, > > On Thursday, May 30, 2019 17:09, Ran Wang wrote: >>=20 >> >> > >> >> > /* Global Debug Queue/FIFO Space Available Register */ >> > >> >> > #define DWC3_GDBGFIFOSPACE_NUM(n) ((n) & 0x1f) >> > >> >> > #define DWC3_GDBGFIFOSPACE_TYPE(n) (((n) << 5) & 0x1e0) >> > >> >> > @@ -859,6 +867,7 @@ struct dwc3_scratchpad_array { >> > >> >> > * 3 - Reserved >> > >> >> > * @imod_interval: set the interrupt moderation interval in 2= 50ns >> > >> >> > * increments or 0 to disable. >> > >> >> > + * @dma_coherent: set if enable dma-coherent. >> > >> >> >> > >> >> you're not enabling dma coherency, you're enabling cache snoopin= g. >> > >> >> And this property should describe that. Also, keep in mind that >> > >> >> different devices may want different cache types for each of >> > >> >> those fields, so your property would have to be a lot more >> > >> >> complex. Something >> > like: >> > >> >> >> > >> >> snps,cache-type =3D , , ... >> > >> >> >> > >> >> Then driver would have to parse this properly to setup GSBUSCFG0. >> > > >> > > According to the DesignWare Cores SuperSpeed USB 3.0 Controller >> > > Databook (v2.60a), it has described Type Bit Assignments for all >> > > supported >> > master bus type: >> > > AHB, AXI3, AXI4 and Native. I found the bit definition are different >> > > among >> > them. >> > > So, for the example you gave above, feel a little bit confused. >> > > Did you mean: >> > > snps,cache-type =3D , > > > "cacheable">, , >> > >> > yeah, something like that. >>=20 >> I think DATA_RD should be a macro, right? So, where I can put its defin= e? >> Create a dwc3.h in include/dt-bindings/usb/ ? > > Could you please give me some advice here? I'd like to prepare next versi= on patch after > getting this settled. > >> Another question about this remain open is: DWC3 data book's Table 6-5 C= ache >> Type Bit Assignments show that bits definition will differ per MBUS_TYPE= s as >> below: >> ---------------------------------------------------------------- >> MBUS_TYPE| bit[3] |bit[2] |bit[1] |bit[0] >> ---------------------------------------------------------------- >> AHB |Cacheable |Bufferable |Privilegge |Data >> AXI3 |Write Allocate|Read Allocate|Cacheable |Bufferable >> AXI4 |Allocate Other|Allocate |Modifiable |Bufferable >> AXI4 |Other Allocate|Allocate |Modifiable |Bufferable >> Native |Same as AXI |Same as AXI |Same as AXI|Same as AXI >> ---------------------------------------------------------------- >> Note: The AHB, AXI3, AXI4, and PCIe busses use different names for cert= ain >> signals, which have the same meaning: >> Bufferable =3D Posted >> Cacheable =3D Modifiable =3D Snoop (negation of No Snoop) >>=20 >> For Layerscape SoCs, MBUS_TYPE is AXI3. So I am not sure how to use >> snps,cache-type =3D , to cover all MBUS_TYPE? >> (you can notice that AHB and AXI3's cacheable are on different bit) Or I= just need >> to handle AXI3 case? > > Also on this open. Thank you in advance. You could pass two strings and let the driver process them. Something like: snps,cache_type =3D <"data_wr" "write allocate">, <"desc_rd" "cacheable">.= .. And so on. The only thing missing is for the mbus_type to be known by the driver. Is that something we can figure out on any of the HWPARAMS registers or does it have to be told explicitly? Another option would be to pass a string followed by one hex digit for the bits: snps,cache_type =3D <"data_wr" 0x8>, <"desc_rd" 0x2>...; Then we don't need to describe mbus_type since the bits are what matters. Rob, any comments? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAl0HjSQACgkQzL64meEa mQbg7g/+Lx8yM+keMyEm6/45HFbt8dj+svzOYxh0bbIrId4/UkgiphoH7tOEvT/m daGDtnccJ8ec6pGl1gHMweog+R7WEkFjf43hBoJjjGWqExeeNDaP6cKD60v2fU2v fpDbfEs4Y5HKxxaBu65MmRwBbtAg+O0ZXEC2RY5jan9GE/HbuqD5xorbRCtIdo1r a5f5CgMUgIglqJiQ+r9dH2M3BjlCBl+2h9YHs0IuLN9+wtRmE9V82s+b1egjot/N fsp9eB/YCCpuvsw38pis00SyN2KiYB1TSBYKFplZon9j1dPrUomP7dg6CUlp+UGf T3jlokigmXQKNK7vrBjm76fdtTAKLEuXLnVGMxFM+sn/vh95bVamyS6MNYTY/XdA q/0KA4Z3tpPXIF0jDV4H92sKt2qXfDjj0vt8oSpWMB4yLOpkKQtvOcpRqd3AYsbD +xvIOipBs6dtdp6wpvmK7BbobggCUxAObAYiJI4FoaqZbWWWnzd2piXWH5bAGkIp u14xAKyE7Nz20RuARpD+TchfbeAZUnrTF+PJ6LcRNshiGoPWBrRT2oCYjqN9XcE7 K8sd6hxcXXwA4vPmo3faq4s1oiq/ACZWJPeGwCyF4yB+Y7b/I2aEicVSbOV49aiC j6yHlveZA9Z/GX8hVlxmkKLdhR5Uki6HP8wG5Bn2dlBK6tA2Kvk= =7tqt -----END PGP SIGNATURE----- --=-=-=--