From nobody Tue Jan 16 14:57:40 2024 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDsZ73fXVz57MvP for ; Tue, 16 Jan 2024 14:57:51 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDsZ64mbDz4LXX for ; Tue, 16 Jan 2024 14:57:50 +0000 (UTC) (envelope-from dfr@rabson.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rabson-org.20230601.gappssmtp.com header.s=20230601 header.b=WO0aiEax; dmarc=none; spf=pass (mx1.freebsd.org: domain of dfr@rabson.org designates 2607:f8b0:4864:20::1130 as permitted sender) smtp.mailfrom=dfr@rabson.org Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-5ed10316e22so90252267b3.3 for ; Tue, 16 Jan 2024 06:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rabson-org.20230601.gappssmtp.com; s=20230601; t=1705417069; x=1706021869; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=74zZBb25nxXCVJVMKf8511wQa/ucTVyVrq9cJB1qt30=; b=WO0aiEaxcOPHka/H1ENVTC7NsBJov0G007AdhxWynp2CG4zRqIfxY/w2Kp7H/C64Wz GSf+E+fh1u78f8NmDv3z3XkOc97GVnnErDRFuSK+52yc+Z8D4pTh3+E/FIbpvDOeYUVs Y7/Q8uyuI+ba9uay5HHjVucWBVIcjVfNpFVs1q4Wk6sN+GN5aPX/RLOy6U795ZCJVhwQ oOpg/WuNkBlA7GmilBiDivwQl7MMAv7tphS5j3gP3ylcjwYGsmG4Uz3XO3EW1GDxYc/l Rse7Mm3X5d31Jp/GkBKLrYTIFM4mfYXwA6bEbksTVhIN9jp0fDfTEOj8inlFP1FEzVjs +foQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705417069; x=1706021869; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=74zZBb25nxXCVJVMKf8511wQa/ucTVyVrq9cJB1qt30=; b=ob5x51ePxckDJZdET+JFwQl0VQvFXrEVLtiWZaP2LolQNJCRm2/IJiih7JXv5lgKxY LL/GYNoQ/KiyIsf3S+v71KtEXW/Xd1wwvmTnVcKzo5NzD+bY9LH2RxrWBnlvAS6zgVVw ANflVZJmYYimRZv0tzgC3NaAJ23CetS9J1bysH9/x+aJwK7waI9Rk0Oi7+pZMZ+A93Jo lDZQrAuVskQ28QxCxSVIsrfhEYDaMnZgmEYacCwhS9LtEMfi73EwbV5dg+R4+65O/tvq bKZ8/81OG2TiVpYZ7JkhqAyAaVvml0ZYRHl7XOOtEdlK7GnUHu9jG/8b8xiGWewgwrjF tk2g== X-Gm-Message-State: AOJu0Yz5uZBWJwTH4KC3lmhHVvMOF0W33Tyx+4PjgQSuRsgh/QgV2Edg Tc/zFpghjETM1ghS/Wc/ZHUDmvqvqc4BRymXgUokml72u8zuOw== X-Google-Smtp-Source: AGHT+IGtWY/UjYYQGsqRRUSTwZYWwiq/Ak1zUaEK/bGN2omtoeDKPiLrit+rL/e6zaUhC5+g56SrNd01/6+NwRWo4pA= X-Received: by 2002:a81:bd12:0:b0:5f1:5400:c724 with SMTP id b18-20020a81bd12000000b005f15400c724mr4997858ywi.15.1705417068978; Tue, 16 Jan 2024 06:57:48 -0800 (PST) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: <5a39810c-5fd8-4969-a222-2561b050b035@FreeBSD.org> <347FE009-A470-4765-A9B9-7C9AB5E954DA@yahoo.com> <76FA010A-338F-4E32-B381-37C7BA63CAFC@yahoo.com> <1C02D1FA-5BF0-4C82-AD0E-6F9E5EB8A0B9@karels.net> In-Reply-To: <1C02D1FA-5BF0-4C82-AD0E-6F9E5EB8A0B9@karels.net> From: Doug Rabson Date: Tue, 16 Jan 2024 14:57:40 +0000 Message-ID: Subject: Re: When will FreeBSD support RPI5? To: Mike Karels Cc: Mark Millard , FreeBSD ARM List Content-Type: multipart/alternative; boundary="00000000000097431e060f115aa9" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[rabson-org.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[dfr]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1130:from]; FREEMAIL_CC(0.00)[yahoo.com,freebsd.org]; DMARC_NA(0.00)[rabson.org]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; DKIM_TRACE(0.00)[rabson-org.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4TDsZ64mbDz4LXX --00000000000097431e060f115aa9 Content-Type: text/plain; charset="UTF-8" On Sat, 13 Jan 2024 at 19:05, Mike Karels wrote: > On 13 Jan 2024, at 12:32, Mark Millard wrote: > > > On Jan 13, 2024, at 07:38, Doug Rabson wrote: > > > >> Getting back to the RPI 5, with a tweak to > arm/broadcom/bcm2835bcm2835_vcbus.c to treat the memory config the same as > RPI 4 and to dev/sdhci/sdhci_fdt.c to treat the RPI 5 sdhci controllers as > generic, I can boot to multiuser mode using the EDK2 firmware from > https://github.com/worproject/rpi5-uefi with ACPI/Device Tree mode set to > Both. > > > > What does FreeBSD do with "Both"? Does it actually use some ACPI > > and some Device Tree? Or does it just use ACPI? Does your > > combination do anything different than just using ACPI? > > > >> This does not have working PCIe or ethernet yet - I think ethernet > ought to work since we seem to have a matching driver in the tree in > dev/cadence. > > > > Sounds like the same status as booting just ACPI with no such > > adjustments too bcm2835bcm2835_vcbus.c or sdhci_fdt.c ? > > > > I think Mike Karels plans on investigating getting Ethernet > > going based on cgem . I've no clue if this is ACPI, DeviceTree, > > or both. > > The cadence/cgem driver uses FDT. I haven't looked at details yet. The > addition > might be as simple as adding a compat string. Hopefully it doesn't > require major > surgery. I just ordered an RPi 5 (8 GB); it will take a while to be > delivered. > The existing driver has the correct compat string but we don't get that far since the rp1 node doesn't get probed and attached. This node is nested under pcie@120000 and the whole subtree never gets explored. Interestingly, if I hack the 2711 driver a little (based on reading Linux sources), I can get that to attach and the rp1 southbridge is visible on the PCI bus with vendor id 0x1de4, device id 0x0001. I made a stub driver for it but that isn't particularly helpful since we need an FDT device to get simplebus to attach and discover all the rp1 sub-devices. I could try to add any ofw children to the pcie device, I guess. By the looks of things, that just needs me to implement ofw_bus_get_devinfo and maybe bus_get_resource_list in the pcie driver. Reading the DTB sources, the 2711 pcie separates out the MSI part as a separate node in the DTB which will need a driver before we can get much further. --00000000000097431e060f115aa9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, 13 Jan 2024 at 19:05, Mike Ka= rels <mike@karels.net> wrote:<= br>
On 13 Jan 2024, at 12:32, Mark Millard wrote:

> On Jan 13, 2024, at 07:38, Doug Rabson <dfr@rabson.org> wrote:
>
>> Getting back to the RPI 5, with a tweak to arm/broadcom/bcm2835bcm= 2835_vcbus.c to treat the memory config the same as RPI 4 and to dev/sdhci/= sdhci_fdt.c to treat the RPI 5 sdhci controllers as generic, I can boot to = multiuser mode using the EDK2 firmware from https://github.co= m/worproject/rpi5-uefi with ACPI/Device Tree mode set to Both.
>
> What does FreeBSD do with "Both"? Does it actually use some = ACPI
> and some Device Tree? Or does it just use ACPI? Does your
> combination do anything different than just using ACPI?
>
>> This does not have working PCIe or ethernet yet - I think ethernet= ought to work since we seem to have a matching driver in the tree in dev/c= adence.
>
> Sounds like the same status as booting just ACPI with no such
> adjustments too bcm2835bcm2835_vcbus.c or sdhci_fdt.c ?
>
> I think Mike Karels plans on investigating getting Ethernet
> going based on cgem . I've no clue if this is ACPI, DeviceTree, > or both.

The cadence/cgem driver uses FDT.=C2=A0 I haven't looked at details yet= .=C2=A0 The addition
might be as simple as adding a compat string.=C2=A0 Hopefully it doesn'= t require major
surgery.=C2=A0 I just ordered an RPi 5 (8 GB); it will take a while to be d= elivered.

The existing driver has the c= orrect compat string but we don't get that far since the rp1 node doesn= 't get probed and attached. This node is nested under=C2=A0pcie@120000 = and the whole subtree never gets explored. Interestingly, if I hack the 271= 1 driver a little (based on reading Linux sources), I can get that to attac= h and the rp1 southbridge is visible on the PCI bus with vendor id=C2=A00x1= de4, device id=C2=A00x0001. I made a stub driver for it but that isn't = particularly helpful since we need an FDT device to get simplebus to attach= and discover all the rp1 sub-devices.

I could try= to add any ofw children to the pcie device, I guess. By the looks of thing= s, that just needs me to implement ofw_bus_get_devinfo and maybe bus_get_re= source_list in the pcie driver. Reading the DTB sources, the 2711 pcie sepa= rates out the MSI part as a separate node in the DTB which will need a driv= er before we can get much further.
=C2=A0
<= /div> --00000000000097431e060f115aa9--