From nobody Tue Oct 18 14:35:18 2022 X-Original-To: dev-commits-src-all@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 4MsGc96vWCz4fxJf for ; Tue, 18 Oct 2022 14:35:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 4MsGc903sCz3L9J for ; Tue, 18 Oct 2022 14:35:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f52.google.com with SMTP id r13so23783892wrj.11 for ; Tue, 18 Oct 2022 07:35:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sI1Oy9Ms4iHckdTqUbR7rN40d1BlTYAqIhSKZ6crGAs=; b=JSbozY0Bs+cWAuf1aX7dbUvHcebxSwyEsEzNYQQTRKrsAhhXJA4o0bsDwsw1MQbzpV mdklTaHiOES62cXncP4VU4P2tb7/878vICIGVpRazgHDyDNHSJN3iKlYKliDUvcSJNh3 l4yvBUNnDFDvWChsbwzu3MS/PhRje3ZHZ4P0dvnjDlvAKWp8yYd/E7MDY+AAOLmsgd4j nJ8I7QtDBNDZUBJZVz3Wz3/pTIJTLZNQ6o7Q4gUaXDsJHAA113mmKqSPfNtEvWDU4Aug WCFL8trz8kJ3sINkOMxD4c3UogQTwrWTIiPQsnGq1FqUIq7jj9VtJJ0wKHsKTjy7OK6J yqTA== X-Gm-Message-State: ACrzQf3IXaS3dVMuz2VsuOavW9Q7AcBUceBCrRFiWyy0VjbEjz048PjV 4Igak2svL33QMZ+99QKeS0U54Q== X-Google-Smtp-Source: AMsMyM4+fk/7OsLibiQ9xL3Krj+tUIgA4CEEjN2RpTRE+3E4SC/7S1QI47zZqB1sSkXdiKMRO0+6Dg== X-Received: by 2002:a5d:59af:0:b0:22e:32be:60f1 with SMTP id p15-20020a5d59af000000b0022e32be60f1mr2061161wrr.81.1666103719342; Tue, 18 Oct 2022 07:35:19 -0700 (PDT) Received: from smtpclient.apple (global-5-142.n-2.net.cam.ac.uk. [131.111.5.142]) by smtp.gmail.com with ESMTPSA id f18-20020adff452000000b0022584c82c80sm11136128wrp.19.2022.10.18.07.35.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Oct 2022 07:35:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: git: 7b5d62bb73e3 - main - ofw: add BUS_GET_DEVICE_PATH interface to openfirm/fdt, somewhat incomplete. From: Jessica Clarke In-Reply-To: <202210180801.29I81Suq044379@gitrepo.freebsd.org> Date: Tue, 18 Oct 2022 15:35:18 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <04FB659A-35ED-4AFD-A3C1-A86309C0906A@freebsd.org> References: <202210180801.29I81Suq044379@gitrepo.freebsd.org> To: Takanori Watanabe X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Rspamd-Queue-Id: 4MsGc903sCz3L9J X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.52:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.52:from] X-ThisMailContainsUnwantedMimeParts: N On 18 Oct 2022, at 09:01, Takanori Watanabe = wrote: >=20 > The branch main has been updated by takawata: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D7b5d62bb73e32d50bb07024ac483532f= bcaafe81 >=20 > commit 7b5d62bb73e32d50bb07024ac483532fbcaafe81 > Author: Takanori Watanabe > AuthorDate: 2022-10-18 06:08:53 +0000 > Commit: Takanori Watanabe > CommitDate: 2022-10-18 07:55:47 +0000 >=20 > ofw: add BUS_GET_DEVICE_PATH interface to openfirm/fdt, somewhat = incomplete. >=20 > This add BUS_GET_DEVICE_PATH interface, > which shows device tree of openfirm/fdt. >=20 > In qemu-system-arm64 with "virt" machine with device-tree firmware, > % devctl getpath OFW cpu0 >=20 > Reviewed by: andrew > Differential Revision: https://reviews.freebsd.org/D37031 > --- > sys/arm/arm/gic_fdt.c | 1 + > sys/arm64/arm64/gic_v3_fdt.c | 1 + > sys/dev/fdt/simplebus.c | 1 + > sys/dev/ofw/ofw_bus_subr.c | 16 ++++++++++++++++ > sys/dev/ofw/ofw_bus_subr.h | 1 + > sys/dev/ofw/ofw_cpu.c | 1 + > sys/sys/bus.h | 1 + > 7 files changed, 22 insertions(+) >=20 > diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c > index 5b1b77024df6..9e5e51429534 100644 > --- a/sys/arm/arm/gic_fdt.c > +++ b/sys/arm/arm/gic_fdt.c > @@ -90,6 +90,7 @@ static device_method_t gic_fdt_methods[] =3D { >=20 > /* Bus interface */ > DEVMETHOD(bus_get_resource_list,gic_fdt_get_resource_list), > + DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path), >=20 > /* ofw_bus interface */ > DEVMETHOD(ofw_bus_get_devinfo, gic_ofw_get_devinfo), > diff --git a/sys/arm64/arm64/gic_v3_fdt.c = b/sys/arm64/arm64/gic_v3_fdt.c > index 16007c5c4147..3ccf2e543b8a 100644 > --- a/sys/arm64/arm64/gic_v3_fdt.c > +++ b/sys/arm64/arm64/gic_v3_fdt.c > @@ -64,6 +64,7 @@ static device_method_t gic_v3_fdt_methods[] =3D { >=20 > /* Bus interface */ > DEVMETHOD(bus_get_resource_list, = gic_v3_fdt_get_resource_list), > + DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path), >=20 > /* ofw_bus interface */ > DEVMETHOD(ofw_bus_get_devinfo, gic_v3_ofw_get_devinfo), > diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c > index 0b1277983da0..a69bdf93e7d6 100644 > --- a/sys/dev/fdt/simplebus.c > +++ b/sys/dev/fdt/simplebus.c > @@ -94,6 +94,7 @@ static device_method_t simplebus_methods[] =3D = { > DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), > DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), > DEVMETHOD(bus_get_property, simplebus_get_property), > + DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path), >=20 > /* ofw_bus interface */ > DEVMETHOD(ofw_bus_get_devinfo, simplebus_get_devinfo), > diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c > index 404bed3c73fa..169bea1f5997 100644 > --- a/sys/dev/ofw/ofw_bus_subr.c > +++ b/sys/dev/ofw/ofw_bus_subr.c > @@ -104,6 +104,22 @@ ofw_bus_gen_child_pnpinfo(device_t cbdev, = device_t child, struct sbuf *sb) > return (0); > }; >=20 > +int > +ofw_bus_gen_get_device_path(device_t cbdev, device_t child, const = char *locator, > + struct sbuf *sb) > +{ > + int rv; > + > + if ( strcmp(locator, BUS_LOCATOR_OFW) =3D=3D 0){ The space after ( shouldn=E2=80=99t be there and ){ should have one. Jess > + rv =3D bus_generic_get_device_path(cbdev, child, = locator, sb); > + if (rv =3D=3D 0){ > + sbuf_printf(sb, "/%s", = ofw_bus_get_name(child)); > + } > + return (rv); > + } > + return (bus_generic_get_device_path(cbdev, child, locator, sb)); > +}; > + > const char * > ofw_bus_gen_get_compat(device_t bus, device_t dev) > { > diff --git a/sys/dev/ofw/ofw_bus_subr.h b/sys/dev/ofw/ofw_bus_subr.h > index 89f291f92373..8dcf517fd58b 100644 > --- a/sys/dev/ofw/ofw_bus_subr.h > +++ b/sys/dev/ofw/ofw_bus_subr.h > @@ -84,6 +84,7 @@ ofw_bus_get_type_t ofw_bus_gen_get_type; >=20 > /* Helper method to report interesting OF properties in pnpinfo */ > bus_child_pnpinfo_t ofw_bus_gen_child_pnpinfo; > +bus_get_device_path_t ofw_bus_gen_get_device_path; >=20 > /* Routines for processing firmware interrupt maps */ > void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); > diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c > index f7bfc10b7b73..8b48e645f1b4 100644 > --- a/sys/dev/ofw/ofw_cpu.c > +++ b/sys/dev/ofw/ofw_cpu.c > @@ -68,6 +68,7 @@ static device_method_t ofw_cpulist_methods[] =3D { > /* Bus interface */ > DEVMETHOD(bus_add_child, bus_generic_add_child), > DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), > + DEVMETHOD(bus_get_device_path, ofw_bus_gen_get_device_path), >=20 > /* ofw_bus interface */ > DEVMETHOD(ofw_bus_get_devinfo, ofw_cpulist_get_devinfo), > diff --git a/sys/sys/bus.h b/sys/sys/bus.h > index 5dead4dd382e..2f9a5a6de588 100644 > --- a/sys/sys/bus.h > +++ b/sys/sys/bus.h > @@ -761,6 +761,7 @@ void bus_data_generation_update(void); > #define BUS_LOCATOR_ACPI "ACPI" > #define BUS_LOCATOR_FREEBSD "FreeBSD" > #define BUS_LOCATOR_UEFI "UEFI" > +#define BUS_LOCATOR_OFW "OFW" >=20 > extern int bus_current_pass; >=20