From nobody Thu Nov 23 17:07:07 2023 X-Original-To: dev-commits-src-main@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 4Sbl0D3PQ0z521vS; Thu, 23 Nov 2023 17:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sbl0D2vPbz3CYT; Thu, 23 Nov 2023 17:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700759228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ikm9jJWq2fho/LbJjsjuf540lLg7To4IaKs8IzrE6o=; b=uqvTZPoRjJ0JpCdFoYNsWt1OTXiOf4tO8e/hOPhCCIm7MqfO6yJisa4I9EZwDpe1IG5RnN GQnBWPddRxr8fVcJRBWCyWZimEPQ7bBJ5YkMc4MQhc13wiNENrUs/mIFaMWM7Q8b+K4R93 9S8yXYnCQMAg83s6HVWZMqCLiBlSfWaBr9mpjYqsi2sOUCgY1TYIb79AgpET/qx0zWs3Mk UBDC2pd1L4jrX/ZyebZGi8sGzsurz7Z9IZimAz+QEksXzt6XjHvRaxNJ0m4bHuTTgpWGvy ziINzTGZX7Y4123FxwNeDkXIQGuQA49yIxS6tMQjUxxwQt6mqz7AWSV9lPv/mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700759228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ikm9jJWq2fho/LbJjsjuf540lLg7To4IaKs8IzrE6o=; b=otV8OJaFop5Ywo+iFSrwpMydpjwRzCM9N5LmRkxVhOH7kkEu1UTb5jKYkaZ9e6X2pQ77/m WB5T6O7UK3gAROYYhxP+o3BM1iWRfBFbZOY1U7qklNYdRyNvWvPM+dLcMIFV4RzCYIDHOQ AEEhONCgiMLseWCSuKC5fPXxw3kbje9FQ0OVBMK9r6aOKfce9nCRyxUQrjkW1ynOubbPJ4 G9sPSyiuQ2rKnbVQ5vPU/EDBqGGZrQvZlrt1pzlGISwPLYllgakIHL9BjvcAFnXB4NW5h6 Zm5WF+d/9uNP4v6D5KeN35G+R71hPi7UwXLbtIme1phaApxJw0duZ/Ka4IuUvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700759228; a=rsa-sha256; cv=none; b=bcJJEHnjATGOfNPhKbp6CuKmrMxR3CtEv/I9EmJh44vTPA8/DsGko+ARNKU1zOYDiGQHqS UjgE+drqVBV743Xz/RLaHpzMPKRAiUpAml7ss8O9uS/bXfguJ49/qh5weIZJ4yJnFSjWGY sYpnTzgTj8ZqcbCWoCAMD5NgVk7/cyHmFn1fm4FamufwKRhBccr8TRgFSdPAcrDU+7KTVQ WRaWDkjEP7VXrNs2vuDWC1L3e9mYiQCshDhCF0UEi7F27dWfsYc9t4txgnjf2wQka2sbzG uTdHsIMTTMXHZ47JdVjECCl0TQwNGmh1wEZzgM5xvAyOIXpJxcPNiyi9eyIMDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sbl0C66JSz197Z; Thu, 23 Nov 2023 17:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3ANH77Zh008833; Thu, 23 Nov 2023 17:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ANH77BG008830; Thu, 23 Nov 2023 17:07:07 GMT (envelope-from git) Date: Thu, 23 Nov 2023 17:07:07 GMT Message-Id: <202311231707.3ANH77BG008830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 71cfd330fc00 - main - arm64/riscv nexus: Implement bus_unmap_resource List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71cfd330fc008187ff41db795ae5e6372bf802ab Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=71cfd330fc008187ff41db795ae5e6372bf802ab commit 71cfd330fc008187ff41db795ae5e6372bf802ab Author: John Baldwin AuthorDate: 2023-11-23 17:06:51 +0000 Commit: John Baldwin CommitDate: 2023-11-23 17:06:51 +0000 arm64/riscv nexus: Implement bus_unmap_resource Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42725 --- sys/arm64/arm64/nexus.c | 17 +++++++++++++++++ sys/riscv/riscv/nexus.c | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 7c4cb073c2ef..a20f8d0289ad 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -112,6 +112,7 @@ static bus_deactivate_resource_t nexus_deactivate_resource; static bus_get_resource_list_t nexus_get_reslist; static bus_map_resource_t nexus_map_resource; static bus_release_resource_t nexus_release_resource; +static bus_unmap_resource_t nexus_unmap_resource; #ifdef SMP static bus_bind_intr_t nexus_bind_intr; @@ -141,6 +142,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif @@ -494,6 +496,21 @@ nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, return (0); } +static int +nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + pmap_unmapdev(map->r_vaddr, map->r_size); + return (0); + default: + return (EINVAL); + } +} + #ifdef FDT static device_method_t nexus_fdt_methods[] = { /* Device interface */ diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c index 936db3e548e9..d92ad7861ae9 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -87,6 +87,7 @@ static bus_deactivate_resource_t nexus_deactivate_resource; static bus_get_resource_list_t nexus_get_reslist; static bus_map_resource_t nexus_map_resource; static bus_release_resource_t nexus_release_resource; +static bus_unmap_resource_t nexus_unmap_resource; static bus_config_intr_t nexus_config_intr; static bus_describe_intr_t nexus_describe_intr; @@ -118,6 +119,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_describe_intr, nexus_describe_intr), DEVMETHOD(bus_setup_intr, nexus_setup_intr), @@ -456,6 +458,20 @@ nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, return (0); } +static int +nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + pmap_unmapdev(map->r_vaddr, map->r_size); + return (0); + default: + return (EINVAL); + } +} + static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr)