From nobody Sun Jan 14 13:41:34 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 4TCbzF4XyNz56C1b for ; Sun, 14 Jan 2024 13:41:45 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) (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 4TCbzD3yvXz57V2 for ; Sun, 14 Jan 2024 13:41:44 +0000 (UTC) (envelope-from dfr@rabson.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-5ed10316e22so72235997b3.3 for ; Sun, 14 Jan 2024 05:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rabson-org.20230601.gappssmtp.com; s=20230601; t=1705239703; x=1705844503; 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=EcN47z5hI3HnJ8G11xdMw7TU3MWB3QVbrr5z5OXohyE=; b=WN9ILPNFV8Gp59ohBoukOt/lZfPTn/GW38NMPUPOK6ksnq/oNp7rwLqmkgUYAHFVXC earSNvRl1uCesBc6x7OZBCERfeOLmbfpgWXSpwd9DjX5NrHSeD1fX65YBy6aMGfaV/1L dbGgtGDeFBSprT6UH7g/1FcHqKPLucE+9iobEoBCjWc6FkosGY6devr0WL8biyA4Gae4 M8biiSmCnMjJpVIo6Uf2QCpFAQ7EcwGUXHgIXNIw6vQu4G0JbQ+nPmM5l17brkQEt1/V lzn3Ifm/cB/dxk/Xn7lqdYtL8jSjF0uiD5fVirQlbGrih2up6t2h7RiGy141CM1/CenC l40Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705239703; x=1705844503; 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=EcN47z5hI3HnJ8G11xdMw7TU3MWB3QVbrr5z5OXohyE=; b=F31DGISjCr+USAK0eQDeIz8KOP4jbZJVqoesu17d2Sm0R9CFbNAqGJojG+QMqmZ8zS Hj9uwFM+ZQbQN9EHdJFR66/tMorcSp/mRnZbCJqNmTN2MnHJga9gtVmVZV2A/++iQfcF Wu9tTI9N214QVdpaA83aYiOr+H+BpIGiZGppU1W2quNcwAvZlgpuuTyFpJb3QDwCwwcH XNeWAHHwGydNZMw7JMVdhjf8zGmBGXyipkidqgesYYzUPCYx/fBBjxcNGuoXid4gK9EX 1LHdmlY7cZY2Q9b8lJDJJ7lWoJcdJpRu2g+GHVYCNR0fuuqEe6RHol/wepQkbh3pNSFp 2png== X-Gm-Message-State: AOJu0YwmfVWaE0eZjPkpO/FZDeD+hLhzQra43d3+RXYbm8cPBXrxD7WW V9AbYeSnFAZnmudbc1KWiBxUl3rLcAg2ldK4QbuHDwQPAeEwdw== X-Google-Smtp-Source: AGHT+IEybvnc0MovAS70OEwflzYXWkwHZyDCXpDKrXGfokKZ1UForPmihpmccUqp/fwrLpb0Sa6pfWqOf5o+lXan9zk= X-Received: by 2002:a81:a9ca:0:b0:5f5:aba8:7c3f with SMTP id g193-20020a81a9ca000000b005f5aba87c3fmr2786059ywh.53.1705239703591; Sun, 14 Jan 2024 05:41:43 -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> <9e45c7d7-450c-48e5-8101-c6ea5cb3a023@FreeBSD.org> In-Reply-To: <9e45c7d7-450c-48e5-8101-c6ea5cb3a023@FreeBSD.org> From: Doug Rabson Date: Sun, 14 Jan 2024 13:41:34 +0000 Message-ID: Subject: Re: When will FreeBSD support RPI5? To: Jesper Schmitz Mouridsen Cc: Mark Millard , John Kennedy , ykla , FreeBSD ARM List Content-Type: multipart/alternative; boundary="000000000000ca324c060ee80e74" X-Rspamd-Queue-Id: 4TCbzD3yvXz57V2 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --000000000000ca324c060ee80e74 Content-Type: text/plain; charset="UTF-8" On Sat, 13 Jan 2024 at 19:22, Jesper Schmitz Mouridsen wrote: > > On 13.01.2024 19.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? > > How does the sd card show up? BTW i did put some stuff here [1] > > I could not get bcm_dma to work anyone planning on getting that to work? > it should be similar to 2711 documented in [2] > I haven't tried to do anything with bcm_dma - this is my diff (against 14.0 but I'll probably move over to 15-current soon). I used the generic SDHCI driver in sys/dev/sdhci and it seems to work very well with the RPI 5: diff --git a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c index 88b54467e0c8..d996831816a6 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c @@ -174,6 +174,11 @@ static struct bcm283x_memory_soc_cfg { .soc_compat = "brcm,bcm2838", .busdma_lowaddr = BCM2838_PERIPH_MAXADDR, }, + { + .memmap = bcm2838_memmap, + .soc_compat = "brcm,bcm2712", + .busdma_lowaddr = BCM2838_PERIPH_MAXADDR, + }, }; static struct bcm283x_memory_soc_cfg *booted_soc_memcfg; diff --git a/sys/dev/sdhci/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c index 4a355d6514ad..8f2ccfc98859 100644 --- a/sys/dev/sdhci/sdhci_fdt.c +++ b/sys/dev/sdhci/sdhci_fdt.c @@ -124,6 +124,7 @@ static struct ofw_compat_data compat_data[] = { { "xlnx,zy7_sdhci", SDHCI_FDT_XLNX_ZY7 }, { "rockchip,rk3568-dwcmshc", SDHCI_FDT_RK3568 }, { "xlnx,zynqmp-8.9a", SDHCI_FDT_XLNX_ZMP }, + { "brcm,bcm2712-sdhci", SDHCI_FDT_GENERIC }, { NULL, 0 } }; > > --000000000000ca324c060ee80e74 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, 13 Jan 2024 at 19:22, Jesper = Schmitz Mouridsen <jsm@freebsd.org> wrote:

On 13.01.2024 19.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?

How does the sd card show up? BTW i did put some stuff here [1]

I could not get bcm_dma to work anyone planning on getting that to work? it should be similar to 2711 documented in [2]

I haven't tried to do anything with bcm_dma - this is my diff (= against=C2=A014.0 but I'll probably move over to 15-current soon). I us= ed the generic SDHCI driver in sys/dev/sdhci and it seems to work very well= with the RPI 5:

diff --git = a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c b/sys/arm/broadcom/bcm2835/bcm28= 35_vcbus.c
index 88b54467e0c8..d996831816a6 100644
--- a/sys/arm/broa= dcom/bcm2835/bcm2835_vcbus.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_vcbu= s.c
@@ -174,6 +174,11 @@ static struct bcm283x_memory_soc_cfg {
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .soc_compat =3D "= brcm,bcm2838",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 .busdma_lowaddr =3D BCM2838_PERIPH_MAXADDR,
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 },
+ =C2=A0 =C2=A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 .memmap =3D bcm2838_memmap,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 .soc_compat =3D "brcm,bcm2712",
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .busdma_lowaddr =3D BCM2838_PERIP= H_MAXADDR,
+ =C2=A0 =C2=A0 =C2=A0 },
=C2=A0};

=C2=A0static str= uct bcm283x_memory_soc_cfg *booted_soc_memcfg;
diff --git a/sys/dev/sdhc= i/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c
index 4a355d6514ad..8f2ccfc988= 59 100644
--- a/sys/dev/sdhci/sdhci_fdt.c
+++ b/sys/dev/sdhci/sdhci_f= dt.c
@@ -124,6 +124,7 @@ static struct ofw_compat_data compat_data[] =3D= {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 { "xlnx,zy7_sdhci", =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SDHCI_FDT_XLNX_ZY7 },
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 { "rockchip,rk3568-dwcmshc", =C2=A0 =C2=A0SDHCI_FDT_RK= 3568 },
=C2=A0 =C2=A0 =C2=A0 =C2=A0 { "xlnx,zynqmp-8.9a", =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SDHCI_FDT_XLNX_ZMP },
+ =C2=A0 =C2=A0 = =C2=A0 { "brcm,bcm2712-sdhci", =C2=A0 =C2=A0 =C2=A0 =C2=A0 SDHCI_= FDT_GENERIC },
=C2=A0 =C2=A0 =C2=A0 =C2=A0 { NULL, 0 }
=C2=A0};
=C2=A0

--000000000000ca324c060ee80e74--