From nobody Tue Dec 10 21:31:15 2024 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 4Y7BkD0zmdz5gf7f; Tue, 10 Dec 2024 21:31:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y7BkD0Rwdz4Z16; Tue, 10 Dec 2024 21:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733866276; 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=GeFTPdRdI59CaqYktVNLEzcTM27D9yb5FuDQsFtvVHs=; b=KIA84XE9a7b3DgiFaIwelAfhdlxHHxhBJTJfN1rH+6MTjyghzqEb1T0yxkCZIEDIwEt5mF 6NqwXVr/tiOHpN/Dh2Qx/vctGfkEK/reM+LKFn0Rl5Bz9777KS16GIGdykMMLi7ZICjxVa Vj9q90cK0dDaqq9rLWjRtH86NYXrzsbXpH8j/jLPtMDnAgB+LPlukUoSUWxugJWu+JdBM1 taVtI+BBTmt2TsJUfo8gi5dxzzftqRU6SeWYCtAMsm+79+S3v2HCmh5PtM00OttpvBONM9 aVIKyBGe5M7XXB2jRSS+Gj2A49AAIFcNPEVKUreNfa5A4Gafgu2nki7j6tp9Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733866276; 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=GeFTPdRdI59CaqYktVNLEzcTM27D9yb5FuDQsFtvVHs=; b=dZHcMQftpoPRHvSNYjGu0w/+eJ8rUDn4xBikXfZodU7mTZdjblr5ZjzUG13vBSWjHkPfiO ewy2XHdPnzcbM2dl2sV6H9Ry9NVsaDVEd/ew3ZpdMaH+PIP7XLZamv+ts4/jnCPQ3SgZxj 1EdZCa9JnhufYwdILyocXFjjkQgiaKYTM8pRuSTpNvgDlx/NG9rM4dUTpthioXcDuHwWOD XOx5uFzFyu85aNj5djTSrY3MBNp14JTYbxUqspeDItk1z9vEhJ1Eijpb8GPN+3zZMYvWW8 m3GKWClzQYAJpG3T5CosPpRnByw8zMBFdBVyhd+9SFzu/Mvyq9Z87dpb0J4gYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733866276; a=rsa-sha256; cv=none; b=CI0HwDio9l/bg5EfkWO0UhtPUymO3WffkQxoXs55WVBDO91gPIJkH/1qPxESzwkqPNyScF mZ2Ph4dMrR09VJBCC+WAZ+VX4fYDobd3sM1+oJXDGuZcW/ZH/Sjc8aLIBJrZ+C0vM0vqnu yDcsTIciZIzM9GANiW6F8yjygmCWSvotXbY4hrG9UxgOn66cuJ1ibfKDFi2blmSi5YVhXk y1x0YFY4MkfMrqnTWSavY6WwgHfKqgPGBFhb0JtBvM/phOhH7gF0eMwnbkGzmvGGpNALTp HfhN++YSCDFT16mlqn4vlm7AvwIhBqF/Y8wm4tMWupA9GnH+fkGIa8gqHd5Azw== 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 4Y7BkD03jtzgQJ; Tue, 10 Dec 2024 21:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BALVFet094309; Tue, 10 Dec 2024 21:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BALVFLp094306; Tue, 10 Dec 2024 21:31:15 GMT (envelope-from git) Date: Tue, 10 Dec 2024 21:31:15 GMT Message-Id: <202412102131.4BALVFLp094306@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: 85471971305d - main - riscv: enable Allwinner if_awg 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 85471971305d3c13ef5f2894b44cdf93b5e80f12 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=85471971305d3c13ef5f2894b44cdf93b5e80f12 commit 85471971305d3c13ef5f2894b44cdf93b5e80f12 Author: Mitchell Horne AuthorDate: 2024-12-10 20:43:59 +0000 Commit: Mitchell Horne CommitDate: 2024-12-10 21:28:38 +0000 riscv: enable Allwinner if_awg Enable the driver and dependencies (aw_sid, nvmem). Add compat strings, etc. Found on the Allwinner D1. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47923 --- share/man/man4/man4.arm/aw_sid.4 | 6 +++++- sys/arm/allwinner/aw_sid.c | 27 +++++++++++++++++++++++++++ sys/arm/allwinner/if_awg.c | 2 ++ sys/riscv/allwinner/files.allwinner | 2 ++ sys/riscv/conf/GENERIC | 1 + sys/riscv/conf/std.allwinner | 2 ++ 6 files changed, 39 insertions(+), 1 deletion(-) diff --git a/share/man/man4/man4.arm/aw_sid.4 b/share/man/man4/man4.arm/aw_sid.4 index be441033d242..5cd2f3d5e072 100644 --- a/share/man/man4/man4.arm/aw_sid.4 +++ b/share/man/man4/man4.arm/aw_sid.4 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 6, 2018 +.Dd October 8, 2024 .Dt AW_SID 4 .Os .Sh NAME @@ -53,6 +53,10 @@ allwinner,sun50i-a64-sid allwinner,sun8i-a83t-sid .It allwinner,sun8i-h3-sid +.It +allwinner,sun50i-h5-sid +.It +allwinner,sun20i-d1-sid .El .Sh SYSCTL VARIABLES The following read-only variables are available via diff --git a/sys/arm/allwinner/aw_sid.c b/sys/arm/allwinner/aw_sid.c index a333eadc20aa..ba5faca33c5e 100644 --- a/sys/arm/allwinner/aw_sid.c +++ b/sys/arm/allwinner/aw_sid.c @@ -169,6 +169,27 @@ static struct aw_sid_efuse h5_efuses[] = { }, }; +static struct aw_sid_efuse d1_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "calibration", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 4, + .id = AW_SID_FUSE_THSSENSOR, + .public = true, + }, +}; + struct aw_sid_conf { struct aw_sid_efuse *efuses; size_t nfuses; @@ -204,6 +225,11 @@ static const struct aw_sid_conf h5_conf = { .nfuses = nitems(h5_efuses), }; +static const struct aw_sid_conf d1_conf = { + .efuses = d1_efuses, + .nfuses = nitems(d1_efuses), +}; + static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-sid", (uintptr_t)&a10_conf}, { "allwinner,sun7i-a20-sid", (uintptr_t)&a20_conf}, @@ -211,6 +237,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun8i-a83t-sid", (uintptr_t)&a83t_conf}, { "allwinner,sun8i-h3-sid", (uintptr_t)&h3_conf}, { "allwinner,sun50i-h5-sid", (uintptr_t)&h5_conf}, + { "allwinner,sun20i-d1-sid", (uintptr_t)&d1_conf}, { NULL, 0 } }; diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index 29a75e5a4d9b..98e879d22d3d 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -143,12 +143,14 @@ enum awg_type { EMAC_A83T = 1, EMAC_H3, EMAC_A64, + EMAC_D1, }; static struct ofw_compat_data compat_data[] = { { "allwinner,sun8i-a83t-emac", EMAC_A83T }, { "allwinner,sun8i-h3-emac", EMAC_H3 }, { "allwinner,sun50i-a64-emac", EMAC_A64 }, + { "allwinner,sun20i-d1-emac", EMAC_D1 }, { NULL, 0 } }; diff --git a/sys/riscv/allwinner/files.allwinner b/sys/riscv/allwinner/files.allwinner index e29300c627a1..f6be2cf97e57 100644 --- a/sys/riscv/allwinner/files.allwinner +++ b/sys/riscv/allwinner/files.allwinner @@ -1,7 +1,9 @@ arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_syscon.c optional syscon +arm/allwinner/aw_sid.c optional aw_sid nvmem arm/allwinner/aw_wdog.c optional aw_wdog +arm/allwinner/if_awg.c optional awg syscon # Allwinner clock drivers dev/clk/allwinner/aw_ccung.c optional aw_ccu fdt diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 4e01c39bc008..4fdb1bdd6403 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -83,6 +83,7 @@ device rcons # pseudo devices device clk device hwreset +device nvmem device phy device regulator device syscon diff --git a/sys/riscv/conf/std.allwinner b/sys/riscv/conf/std.allwinner index f04e88c98b5b..4f3d98250cc5 100644 --- a/sys/riscv/conf/std.allwinner +++ b/sys/riscv/conf/std.allwinner @@ -7,6 +7,8 @@ options SOC_ALLWINNER_D1 device aw_ccu # Allwinner clock controller device aw_rtc # Allwinner Real-time Clock +device aw_sid # Allwinner Secure ID EFUSE device aw_wdog # Allwinner Watchdog +device awg # Allwinner EMAC Gigabit Ethernet files "../allwinner/files.allwinner"