From owner-freebsd-arm@freebsd.org Wed Jun 10 13:37:56 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 57870334744 for ; Wed, 10 Jun 2020 13:37:56 +0000 (UTC) (envelope-from maciphone2@googlemail.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hp2p48g8z417S for ; Wed, 10 Jun 2020 13:37:54 +0000 (UTC) (envelope-from maciphone2@googlemail.com) Received: by mail-ed1-x530.google.com with SMTP id e12so1424869eds.2 for ; Wed, 10 Jun 2020 06:37:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=xTpTwP0W6PYOztHH3e1kZk4BuF9v9ziUN06cjrYPaZs=; b=fjuV69aKoCnJwhfNuAeBzaDk7zmFKy3ERLKHfMjv35ozUuhxeaVBCprQIZnDAyCOpL GnNZ09UVwoaSrdZdaY3kMvme4ZBPkRxKl3IuNDEbljkI+d61Ojpulygxt66IOwYb7wbg Ov4QqaEF8qZ8n7cY3xrZvR4k4tT5ht3M4dn1a12samtPe9hX0saRA9u+WQg2Y5+gwOIK IRzuvbEDX+9Ec1K1KE0RG4TqVm+ZcN/1fWmXkEKOF5jD+lzMqv87/+fuP4uG0tX13SnI KxSVYdTw84x+gKOFNDs+BlE7teglwW/JEm6KbH2ZdWycENdLzJQaFTLqXBgOKY2G8Dw/ CwEg== X-Gm-Message-State: AOAM530QUExIE5OicRBElFJyFV006AiTJnWYon21o3t/16S4C9pD4HF9 7RqxvfcFWpgOaHm9B054uR5zr8hy X-Google-Smtp-Source: ABdhPJxMfIskYBHuCfxnTfMzP8ORDCmzNGdqK8eMwTtKdGrhxMeAA8UCMM8F+kXLC8SrZePgW4EVyA== X-Received: by 2002:a05:6402:228a:: with SMTP id cw10mr2381245edb.147.1591796272616; Wed, 10 Jun 2020 06:37:52 -0700 (PDT) Received: from [192.168.1.167] ([46.114.108.40]) by smtp.googlemail.com with ESMTPSA id m91sm3777131ede.96.2020.06.10.06.37.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2020 06:37:51 -0700 (PDT) From: =?utf-8?Q?Klaus_K=C3=BCchemann?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Report: FreeBSD on Rpi4 8 GB model Date: Wed, 10 Jun 2020 15:37:50 +0200 References: To: Robert Crowston , freebsd-arm@freebsd.org In-Reply-To: Message-Id: <65649C30-79B7-4001-ABBF-71E2C8F52B06@googlemail.com> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49hp2p48g8z417S X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.24 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[googlemail.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[googlemail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[googlemail.com,quarantine]; NEURAL_HAM_SHORT(-0.71)[-0.710]; FREEMAIL_TO(0.00)[protonmail.com,freebsd.org]; RECEIVED_SPAMHAUS_PBL(0.00)[46.114.108.40:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[googlemail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[googlemail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.019]; R_DKIM_ALLOW(-0.20)[googlemail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.01)[-1.007]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::530:from]; RCVD_TLS_ALL(0.00)[] 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: Wed, 10 Jun 2020 13:37:56 -0000 > Am 10.06.2020 um 01:16 schrieb Robert Crowston via freebsd-arm = : >=20 > I figured out how to start the xhci driver. >=20 > The snag is, it seems the message to the VC to reinstall the xhci = firmware 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 started. >=20 > That kind of ordering is not straightforward to arrange, as far as I = can 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 grandchild. >=20 > I think the best way then is to create a shim driver for the xhci = controller whose probe() is designed only to succeed on the Rpi4. The = shim's attach() 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 xhci_pci driver. >=20 > 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 XHCI framework is quite a hack. >=20 > Anyone have any thoughts? Since your driver is dedicated RPi4_ONLY your shim-if_bcm_thing sounds = logical. Especially when we consider that you think that this is the best way,=20 because nobody knows more about your driver than you :-)=20