From owner-freebsd-arm@freebsd.org Sun Jun 14 00:30:45 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 C4D29346CC2 for ; Sun, 14 Jun 2020 00:30:45 +0000 (UTC) (envelope-from crowston@protonmail.com) Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "protonmail.com", Issuer "SwissSign Server Gold CA 2014 - G22" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kwNh2TQNz4fsF for ; Sun, 14 Jun 2020 00:30:43 +0000 (UTC) (envelope-from crowston@protonmail.com) Date: Sun, 14 Jun 2020 00:30:34 +0000 To: =?utf-8?Q?Klaus_K=C3=BCchemann?= From: Robert Crowston Cc: "freebsd-arm@freebsd.org" Reply-To: Robert Crowston Subject: Re: Report: FreeBSD on Rpi4 8 GB model Message-ID: In-Reply-To: <65649C30-79B7-4001-ABBF-71E2C8F52B06@googlemail.com> References: <65649C30-79B7-4001-ABBF-71E2C8F52B06@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch X-Rspamd-Queue-Id: 49kwNh2TQNz4fsF X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.48 / 15.00]; HAS_REPLYTO(0.00)[crowston@protonmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[protonmail.com]; R_SPF_ALLOW(-0.20)[+ip4:185.70.40.0/24]; DKIM_TRACE(0.00)[protonmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[protonmail.com,quarantine]; NEURAL_HAM_SHORT(-0.38)[-0.382]; FREEMAIL_TO(0.00)[googlemail.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[protonmail.com]; ASN(0.00)[asn:62371, ipnet:185.70.40.0/24, country:CH]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[185.70.40.18:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.015]; R_DKIM_ALLOW(-0.20)[protonmail.com:s=protonmail]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.980]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[protonmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[185.70.40.18:from] 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: Sun, 14 Jun 2020 00:30:45 -0000 A fix for the XHCI firmware loading is here: https://reviews.freebsd.org/D2= 5261 (It requires working PCI-E, which is in progress, here: https://reviews.fre= ebsd.org/D25068) A fix for the change to the phy-mode on the genet driver is here: https://r= eviews.freebsd.org/D25251 -- RHC. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Wednesday, 10 June 2020 14:37, Klaus K=C3=BCchemann wrote: > > > > Am 10.06.2020 um 01:16 schrieb Robert Crowston via freebsd-arm freebsd-= arm@freebsd.org: > > I figured out how to start the xhci driver. > > The snag is, it seems the message to the VC to reinstall the xhci firmw= are has to be delivered after the bridge memory window is configured on the= controller by the pci_pci bridge, and before the xhci controller is starte= d. > > That kind of ordering is not straightforward to arrange, as far as I ca= n see: I cannot hack the message onto the end of the pcie attach function, = since we need the bridge child to have attached, but not the xhci grandchil= d. > > I think the best way then is to create a shim driver for the xhci contr= oller whose probe() is designed only to succeed on the Rpi4. The shim's att= ach() will instruct the VC to load the xhci firmware, and then defer to the= generic xhci_pci_attach(). All other methods will be inherited from the xh= ci_pci driver. > > Another idea is to put the logic directly in the xhci_pci.c file, but I= think creating a dependency out to the Rpi4 mailbox API from the generic X= HCI framework is quite a hack. > > Anyone have any thoughts? > > Since your driver is dedicated RPi4_ONLY your shim-if_bcm_thing sounds lo= gical. > Especially when we consider that you think that this is the best way, > because nobody knows more about your driver than you :-)