From owner-freebsd-arm@freebsd.org Thu Oct 1 03:35:46 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEE5A3F0D0A for ; Thu, 1 Oct 2020 03:35:46 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1zKs5jPvz49bq for ; Thu, 1 Oct 2020 03:35:45 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 7amKlssVM1lvycgWVfM_pQ.hAFivUuxVDdCzgnolhcB3IFkK3bnK0nA1XdX_vxH rzQbroZ9Ym2Iz0YWoTxPTtV8ZGcGp84YNk_wv6Dfr4bktcgfg1u4AmR.bokVbQy4v6XAe21CkCYo rDfvD7EOpT3hqd.VBLB7lTDW4WHR6.DaGSnVywbE_K4ywTD_h2z72frw27TuJgCphxc8VI6cG1_O oZF3DFNN91u8NXehwPEFFZB9E1kxVa4HwIMVMz67Ovg6Vvnm09RZkwQ.SngDLfIpdN4lq5pb5.pI odob8CoOGIb7oRzvY1AHNbyGrXNLurvv9izbYZXxUedsguTuy6uw8DmkTlnnTLQ4OWLdan0HPG3m VV1yj0dB6IAHxVi8cFwX3kTXiNtHlY6_dkve2Gzf320HCnf9xCHGB6ctdJhci2bZwsche34fqGNT aSKr1nDVFPNlahjbs_3eYz83..GgWYitTmY3HNiHGZkMSBYs.jwmGWqDP0hwq4eL.Ny8UnrsMyH4 .t9ccp7Ahap.s0U1cNNA3n2VOPE.oKBKk0ARxomU7YZvgaUroY6A0CGxAnSm3Nl.oEI622bz0_Jg vTD23mLKLGZyLZAYg6zcTTgpfOLsgJIb8uNQVbfxxDmifrW7LgWZwy1fI2U3K96JQMy_k1gQBVcO bdO2Ee.fp_qq_2rd4_YU73F4BOycrVhd_ezere5HQWtisymZ9P3vzyiY_LnmjSKXgO2rHQz5udyR CVv70h2amyIwL_43uaX9tFzu.ZL_x6s7x2CBmcEDcRvn31zo0FWpGoqMudjciRu3Jgj3zrIPA1dK izf2NihJVweAIZXV4nXKz9nZRIVmo3fqIjQMbA6FfHm_De.vMJphQvPQbKC0bRYW0k6qMX.jqIbd ieZ4REhe6ZM1ZRkFzGbTS3odvLycSexjVRsav31M48QkFkQzpf00FwXRO1Cgyz3DMKJeeawMcoqf Fnlc755LFUQIahh1NOy8Pyze.4dnvQo2.lOmwasXdGvKBXtZ8Kiucg5rstxSKWHcZTQzUI9lChEH nIDLEgSFbq0wjpxXh9K5sbr1Lp1xDA6wjgxDe_i1jfhRVsre1.S9JIOBczgrnj7MT4TAORKHzI0m cRGBTkOiREnZBv36.5aXTcKwH1Bc_STchDCsuBiO4Cu0bNuxNCMtdAsUtin66Bw57SnJVAQ.qYvc 2Q4lJuhRcyU8q7xgvJE93_vYjXJaMjK71TAVUUS9R_A40mCaFvKw62Tv0U5n_slrjkskph2zcMfQ Z5burahbIzyqcHNrKU.JQywe4fU1XRqtZ4lNt6VBVKlaPgYq1wx9NtNpe77aBJK9Tz5SpB2dCA0e HDcmXaOdExFG_U0LQ03tGTfDyV1qDtptNJbnIieUhhjAWcRGygUJuLaJ7oeZLD0SVLwoN8XZDbBr RxB1Io9aaEjtD4h7kMPkwc._66FXuR3Kd4iZSQdYM2NG16uG53QyMTm0THaKvJmcb99IIlDb9c7h p3sbtnushQok3_N4ZiI5RoLqssafc0xME6v8VtZz1zfAU.CMQjX7qp1G8ZNgy_SKcaulRqj2H1tr _3nuwOigDOkycf2Y05yNjp7HlRUWGmrAGBA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Thu, 1 Oct 2020 03:35:43 +0000 Received: by smtp424.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 53be656cd6b87014279276bd5c46e95e; Thu, 01 Oct 2020 03:35:42 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: RPi4B's DMA11 (DMA4 engine example) vs. xHCI/pcie From: Mark Millard In-Reply-To: <93A90975-39F1-4DA3-87E0-89E07505108A@yahoo.com> Date: Wed, 30 Sep 2020 20:35:41 -0700 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <658D626D-4307-44F2-9B8A-1CE132EEB0F2@yahoo.com> References: <8C6DE44F-6CE2-4C74-8748-3BBFB54AE183@yahoo.com> <0FE382AB-8DE3-4467-9CB0-E8582AC70EA2@yahoo.com> <85FEDC51-B5B0-4ED4-A5ED-62B63EF9D5A8@yahoo.com> <903FE769-ED46-4FBC-A272-4D2C89A9CD7A@yahoo.com> <93A90975-39F1-4DA3-87E0-89E07505108A@yahoo.com> To: Robert Crowston X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4C1zKs5jPvz49bq X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.28 / 15.00]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.74)[-0.743]; FREEMAIL_TO(0.00)[protonmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.027]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.01)[-1.009]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.204:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.204:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-arm] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 03:35:46 -0000 On 2020-Sep-30, at 15:40, Mark Millard wrote: > On 2020-Sep-30, at 14:15, Robert Crowston = wrote: >=20 >> Very interesting analysis. Certainly uncovered a few things I wasn't = aware of. >>=20 >> By default sc->sc_bus.dma_bits in xhci_init is 64 bits; I toggle it = back to 32 bits in the xhci shim I wrote for the Pi 4. You can see that = output in a verbose dmesg. >>=20 >=20 > My biggest worry from all that material, for things as they currently > are, is that it appears that FreeBSD could try to use a RPi4B DMA LITE > engine but not follow its limitations when doing so. For example, > ending up using a smaller size DMA transfer than intended (just 16 = bits > for size). (Other RPi's might have the same issue?) So I looked at BCM2835-ARM-Peripherals.pdf, comparing to rpi_DATA_2711_1p0.pdf and: BCM2835-ARM-Peripherals.pdf indicated DMA engines 7-14 are all DMA LITE engines for the context it was covering. DMA 0-6 are normal DMA engines. So the RPi4B reduced the number of DMA LITE engines (now only 7-10) and filled the removed slots (11-14) with the new type DMA4 engines. So I learn from this some about how to interpret "brcm,bcm2835-dma" as shown by what the RPi4B is doing: dma@7e007000 { compatible =3D "brcm,bcm2835-dma"; reg =3D <0x7e007000 0x00000b00>; interrupts =3D * 0x0000000007ef645c = [0x00000084]; interrupt-names =3D "dma0", "dma1", "dma2", = "dma3", "dma4", "dma5", "dma6", "dma7", "dma8", "dma9", "dma10"; #dma-cells =3D <0x00000001>; brcm,dma-channel-mask =3D <0x000001f5>; phandle =3D <0x0000000b>; }; The brcm,dma-channel-mask value and name list is different than in prior examples of "brcm,bcm2835-dma" but the subset that is present follows = the original protocol. For example, how to tell DMA (normal) from DMA LITE works the same [a debug register bit to check] --but only within the = subset present. Seeing "brcm,bcm2835-dma" should not lead to presuming some fixed number = of interrupts or dma-channels to process. The protocol for DMA (normal) vs. DMA LITE does not even apply to the new RPi4B DMA4 engines (11-14): dma@7e007b00 { compatible =3D "brcm,bcm2711-dma"; reg =3D <0x00000000 0x7e007b00 0x00000000 = 0x00000400>; interrupts =3D <0x00000000 0x00000059 0x00000004 = 0x00000000 0x0000005a 0x00000004 0x00000000 0x0000005b 0x00000004 = 0x00000000 0x0000005c 0x00000004>; interrupt-names =3D "dma11", "dma12", "dma13", = "dma14"; #dma-cells =3D <0x00000001>; brcm,dma-channel-mask =3D <0x00007000>; phandle =3D <0x0000003d>; }; 11-14 have a new, distinct protocol in various respects. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)