From nobody Sun Apr 03 15:30:21 2022 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 D42D71A41141; Sun, 3 Apr 2022 15:30:21 +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 4KWdC15g3wz4V88; Sun, 3 Apr 2022 15:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648999821; 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=OiWTe/IDJMBuVLkhjY4NH9rsw8T++R464Fiahqc1riM=; b=xZJb4Ell0eVuxzIC294cH4ZqodC6m4Q/PbsAj/bv3JhIZqqXzcyLFwoYEByYlmVgaY6lHJ O8gJhp6rFgNAEcWFCzrjfp8DMAJect2dY/goIW0vYHD0X+8ys4ASGsdW6dLywDZhuRiJnm AjPZAYT8stwONSUsW/1btP+4K4T3syRYEbzOiIURtPWQBv5Zx9Qylz2H9OZ0IopK5iHN35 qd+csF3KZFmRSZdjjXdmTtz5SYSAYeEiXT2qOjwMkxsJyHh6M5RvZ+/HVDuEoucGr+0HeS GLtE3H6upeJ44waTN1KXZ7ZUFudcBZGYKek9M0gtw4ET5nIxJHeQNcawrSMvlg== 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 9F09D1FDB1; Sun, 3 Apr 2022 15:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 233FULoD005664; Sun, 3 Apr 2022 15:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 233FULD6005658; Sun, 3 Apr 2022 15:30:21 GMT (envelope-from git) Date: Sun, 3 Apr 2022 15:30:21 GMT Message-Id: <202204031530.233FULD6005658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 242cd60a0a67 - main - cgem: Support building as a loadable kernel module 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 242cd60a0a670ff7cc446436bedd129fbdce062c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648999821; 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=OiWTe/IDJMBuVLkhjY4NH9rsw8T++R464Fiahqc1riM=; b=thnmodm5s36g8TiKeFDrYvYSXduWnaSgw8XeRzzL6+ZhzK/4vQS9KK7IwNMwAbaLUs5ock 848yI6dss89j1TTL23pqbXWwrHm3Rs/9QiwaMUIKvL2EuUW1BZxGUdphNyKWco+W/TS4kX nP0QdxB4zPMlCs/Pfz4kXpfagwrfvDNT7ILF45mo7Y2NhZSy4YnLJce6imTwJTYFwg6MA7 BIYplcdOjH43oALGPOp9Q8zO820xy3dt/MuTVsQrXZoEYfCAhkq0X4WnoquktVMMXUEEPe sgyo9syh9BBALirFhgzAqDF1V4tBL7gdxcj8NRkfcRt2Kggo3U7YMWzEwVzJUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648999821; a=rsa-sha256; cv=none; b=dgOMn9rGWjAEbrsRw36EhHnwUtkX1mhB6y/GDco6XrRdLt1i8nTNjRKZVqy5Lsv/qd8uNe sxraVChwxrl1RhS0pyVY4IAQXd2ySLya6f7wB2Wvlm8VWNoUmBjYKrJQSOytZO8ZgMapmq VHhL/p9Ddk25b+q7sCK/TN+n4uZiHR5yZ+i5BQ6T1t9qHiCLk8hMEkC/GhZezHbbUjZvS0 SuLVeC0NbW6CNdW7g1mywetLUDJW7+FiPD72SdTBc0oEahXA842vanQJbgjulSxJNQ6i1D 78ee72YhHynr/SVOszRiJkZK3JQMUc7DseV1dl7WRPUmYqAtVTEA8G49tqBEvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=242cd60a0a670ff7cc446436bedd129fbdce062c commit 242cd60a0a670ff7cc446436bedd129fbdce062c Author: Milan Obuch AuthorDate: 2022-04-02 16:53:37 +0000 Commit: Mitchell Horne CommitDate: 2022-04-03 15:28:37 +0000 cgem: Support building as a loadable kernel module For development, building a driver as kernel module is both convenient and a time saver (no need for reboot on some change, testing it requires just kldunload and kldload, a matter of seconds). For some special cases, it may be even desirable to postpone initializing the network interface after some action is done (loading a FPGA bitstream may be required for Zynq/ZynqMP based hardware as an example). Building is limited to ARM, ARM64 and RISC-V architectures (for Zynq, ZynqMP, PolarFire Soc based boards, and HiFive based boards are known to use CGEM at the moment). Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34687 --- sys/modules/Makefile | 6 ++++++ sys/modules/if_cgem/Makefile | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 3731e9c1e453..944a76163748 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -147,6 +147,7 @@ SUBDIR= \ ${_ice_ddp} \ ${_ida} \ if_bridge \ + ${_if_cgem} \ if_disc \ if_edsc \ ${_if_enc} \ @@ -575,6 +576,11 @@ _ice_ddp= ice_ddp .endif .endif +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ + ${MACHINE_CPUARCH} == "riscv" +_if_cgem= if_cgem +.endif + # These rely on 64bit atomics .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" _mps= mps diff --git a/sys/modules/if_cgem/Makefile b/sys/modules/if_cgem/Makefile new file mode 100644 index 000000000000..5d552994449a --- /dev/null +++ b/sys/modules/if_cgem/Makefile @@ -0,0 +1,7 @@ +.PATH: ${SRCTOP}/sys/dev/cadence + +KMOD= if_cgem +SRCS= if_cgem.c +SRCS+= bus_if.h device_if.h miibus_if.h ofw_bus_if.h + +.include