From nobody Wed Jul 10 17:09:48 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 4WK49857WCz5QpYh; Wed, 10 Jul 2024 17:09:48 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WK4984TRjz4nhn; Wed, 10 Jul 2024 17:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720631388; 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=rL31fnUzq6BMJ/kRRMGxb7z4O2IXW5NabLZGFwYFPDI=; b=mhg+312MtjouLXoynHQ481DT6Euh7OB0/cyRX1jQ9L218vpmN/aijRBl1pLgjZNsIwvnFc w1rnubF8MeGk5WXGK6lxZ1YszDnwpJgn1HeK+lo01S38jzGjSORNmVBlviDlueYKq6v/z5 wZIMcDmZ8PJFX2Dj7GPIJ6WpcXwZbNqcyO2PS+hHBUapW1D9GJHP451LH4dq1jnmbVQ4uj n/r/ROBL4U+TaLmohjWLVQTLKKWBWMzTtm2fuAjh9YwVVDjUYUHsEv9cg6FToce6h8Tn4m SJamFhexDfWsy0LhjRHkrpYP+ckpGzsQB1ECW9w4Y/4JJBLtxUTgJmm6P2jJ7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720631388; a=rsa-sha256; cv=none; b=f7rDYKVbSERIJSaSObbQ+TaUGyCdBydvmFfW4F9Oj0bGBAlJW5jgujKcFD2UpNWiQ7H3tT XTuPLn+yi7crfqKTqSb9AYOhdZLaoK7ValqIkIxjyCIr83Pw5lpHX4QDneCNieLKCeW8Km iGD0yaz8Ha8CGnToNtHDSluzVSfvbL1LP03OgRzzjv9UycTmJY/u1vkQ4kLofsH0caimDO FqAy+MG0aS6wOWi43KqGE5hz/KeQPlURo2sAv17sl/1ZheQXwThQAKWWsrFwI5kuPt3bJ6 RHPN/w4X22G8VrgarQ8h+Wne197pCv8AoVzd9HrbLScpkv7KOM4csjPk+WzJAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720631388; 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=rL31fnUzq6BMJ/kRRMGxb7z4O2IXW5NabLZGFwYFPDI=; b=sjfOvekSycn0oolY4MNsQQcaIISDNYGILx/o7ulp1Pzq84FKVLB0eA/gsvE38WVhZbybFI g9GJu7axEl4W/JH/ZdNEfpY1ZCRgjxjMlu3kgHHvn5Ps+o3qiAxvMm76e1xl1ebFXULrzj +wFYajxd6P6Q8EiGWrBh117sB3YBEo80XzN5gfZ+q9eNNel1lFqtywoMrM8Bxq8MgPxbWx Sp08KCadpGCR2PdY7J+8zWy8at+sqeE4q3N6jpgzu0FGiWWQe+7k+kev6oxQahlovNSqi5 c9CMhn/QVNVtYTGHwZIMQdnYq3Mc4sA0Ndmfl/XQSguPtm8hOp5jonXqHYWNqg== 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 4WK4983llszQ1s; Wed, 10 Jul 2024 17:09:48 +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 46AH9mVg070206; Wed, 10 Jul 2024 17:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AH9mnC070203; Wed, 10 Jul 2024 17:09:48 GMT (envelope-from git) Date: Wed, 10 Jul 2024 17:09:48 GMT Message-Id: <202407101709.46AH9mnC070203@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: 7339a7bd9739 - main - plic: add thead,c900-plic compatible 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 7339a7bd9739f0386344c9bb560894cca84348a4 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7339a7bd9739f0386344c9bb560894cca84348a4 commit 7339a7bd9739f0386344c9bb560894cca84348a4 Author: Mitchell Horne AuthorDate: 2024-07-10 16:57:15 +0000 Commit: Mitchell Horne CommitDate: 2024-07-10 17:09:14 +0000 plic: add thead,c900-plic compatible This allows attachment on Allwinner D1, and others. MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/riscv/riscv/plic.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c index 406aff5bbff0..5280ec0bb333 100644 --- a/sys/riscv/riscv/plic.c +++ b/sys/riscv/riscv/plic.c @@ -99,6 +99,13 @@ struct plic_softc { int ndev; }; +static struct ofw_compat_data compat_data[] = { + { "riscv,plic0", 1 }, + { "sifive,plic-1.0.0", 1 }, + { "thead,c900-plic", 1 }, + { NULL, 0 } +}; + #define RD4(sc, reg) \ bus_read_4(sc->mem_res, (reg)) #define WR4(sc, reg, val) \ @@ -230,8 +237,7 @@ plic_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "riscv,plic0") && - !ofw_bus_is_compatible(dev, "sifive,plic-1.0.0")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "RISC-V PLIC");