From nobody Wed Jan 03 20:45:36 2024 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 4T51vP2vyWz56fvt; Wed, 3 Jan 2024 20:45:37 +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 4T51vN71FHz4PcN; Wed, 3 Jan 2024 20:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704314737; 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=eEDIsG7HrwmVJ1szMlr5rybraZNgghUIyw5sG+0GREI=; b=g6UUBlv9FUGP+8Ecyp1BeSYRm1tyR6gK9qUq/Px8AV42sby5RqR/NmC42uLtu2GYg+potq r7E3Shloa3Ojbqe+6RgtwrAN5PPFH1J8LkTmq5VbQFxaQ5YjFlv65xb6M+2ylPeP2aTE5H GgpQ7JkDOmW3oF9EEjWVP0LuDtirxJIPoYk05Haggik/Mq/IFrmyH+h2KFd94rl9FEPBbL sOXJUQOX/DCaLCet5Isz/7ako4eZe/xgTmY+2pcoHwARXu9cbckKfEAvmwSmUzS+XtbYcf SA/NVAL/8bu+O+ltLHdEZsobitDA6q+VP3LX3Oie/Me/rBBlWAmuWeVJVvW2yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704314737; 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=eEDIsG7HrwmVJ1szMlr5rybraZNgghUIyw5sG+0GREI=; b=GYGz42r2WNLQ7hzOhJyYIP9QQIlwmKIkV4/8UsOD+d6Xe2e9D5RqSf+4dYDbDnOt55fT2W Etuwv+rcW7exfzfbGY+hacsgHznMQX58o/EIAcZ/Dkp04SV95YGWToUhnyd6TAd/ZEl/vI Tau5dM3R1s787gzj7JSQiYc8QBscGn96V6ApJ9uA3Ofb7dkVH/7VWfL+hBYsY7vowzn6jN x6bLY+ut1w9hPkMsptT3xG88fN3lAlrZUtB1NSDo5FSkEichaKtumeV/ewe4KnkHEKvSS9 Qftkflj6MQp31iSeryVnLM3Hd0dliGdgVaD9G6vE0IaH7cj/kPQItE5JYx46ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704314737; a=rsa-sha256; cv=none; b=uVDEH00Cv1UmzQPeLDhiybbb4LG42Sbyvw5HD7uE4JWm2LNkANs/5oc3ZX120KeXEWy1r7 d9853uB31krKR8rligr8uJFaIZCdlni9XacBlhA7TSQ7l3IIX6wvVjwaKAeGEnbpdKA6R+ jgy6rQy+amR5p/p2/9xePt939HT/KUInPawnr+Ch2AmgiLVx0VxZrOanMSVqRx3L6bC9oO UivJ/T/TYHspZo9M1jPEuiVoz0bzLwF9YrsR/9TujDfbOOhlfhN82tNHipU+DRfEghkBZy Ut8zNyh5mBzzjzPn++KPCI13jboOM54qT1MpgMxH9q2Pp+JYd+dtgH7cih0XDA== 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 4T51vN66k1z10yh; Wed, 3 Jan 2024 20:45:36 +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 403KjacP037477; Wed, 3 Jan 2024 20:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 403Kja0c037474; Wed, 3 Jan 2024 20:45:36 GMT (envelope-from git) Date: Wed, 3 Jan 2024 20:45:36 GMT Message-Id: <202401032045.403Kja0c037474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 19cfade3f392 - stable/14 - arm64/riscv nexus: Implement bus_unmap_resource 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 19cfade3f3924a7b5bc23d919e280db7f303ffd0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=19cfade3f3924a7b5bc23d919e280db7f303ffd0 commit 19cfade3f3924a7b5bc23d919e280db7f303ffd0 Author: John Baldwin AuthorDate: 2023-11-23 17:06:51 +0000 Commit: John Baldwin CommitDate: 2024-01-03 20:34:28 +0000 arm64/riscv nexus: Implement bus_unmap_resource Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42725 (cherry picked from commit 71cfd330fc008187ff41db795ae5e6372bf802ab) --- 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 25d23f74d92b..5bd9b15dde2c 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; @@ -139,6 +140,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 @@ -492,6 +494,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)