git: 4c4a6884ad7f - main - cgem: Add support for the SiFive FU740

Jessica Clarke jrtc27 at FreeBSD.org
Wed Jul 21 01:51:52 UTC 2021


The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=4c4a6884ad7fb18b0777597a4f6c2cdb235dccb6

commit 4c4a6884ad7fb18b0777597a4f6c2cdb235dccb6
Author:     Jessica Clarke <jrtc27 at FreeBSD.org>
AuthorDate: 2021-07-21 01:44:38 +0000
Commit:     Jessica Clarke <jrtc27 at FreeBSD.org>
CommitDate: 2021-07-21 01:51:25 +0000

    cgem: Add support for the SiFive FU740
    
    Note that currently Linux's device tree uses the FU540's compatible
    string, as does upstream U-Boot, but the U-Boot shipped with the board
    based on an older patch series has the correct FU740 name. Thankfully
    they are the same, at least as far as software is concerned.
    
    Whilst here, fix a style(9) nit.
    
    Reviewed by:    philip, kp
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D31034
---
 sys/dev/cadence/if_cgem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/dev/cadence/if_cgem.c b/sys/dev/cadence/if_cgem.c
index 0583e846458a..6001c5ba74a5 100644
--- a/sys/dev/cadence/if_cgem.c
+++ b/sys/dev/cadence/if_cgem.c
@@ -105,12 +105,13 @@ __FBSDID("$FreeBSD$");
 #define HWTYPE_GENERIC_GEM	1
 #define HWTYPE_ZYNQ		2
 #define HWTYPE_ZYNQMP		3
-#define HWTYPE_SIFIVE_FU540	4
+#define HWTYPE_SIFIVE		4
 
 static struct ofw_compat_data compat_data[] = {
 	{ "cdns,zynq-gem",		HWTYPE_ZYNQ },
 	{ "cdns,zynqmp-gem",		HWTYPE_ZYNQMP },
-	{ "sifive,fu540-c000-gem",	HWTYPE_SIFIVE_FU540 },
+	{ "sifive,fu540-c000-gem",	HWTYPE_SIFIVE },
+	{ "sifive,fu740-c000-gem",	HWTYPE_SIFIVE },
 	{ "cdns,gem",			HWTYPE_GENERIC_GEM },
 	{ "cadence,gem",		HWTYPE_GENERIC_GEM },
 	{ NULL,				0 }
@@ -1762,8 +1763,7 @@ cgem_attach(device_t dev)
 			    "could not retrieve reference clock.\n");
 		else if (clk_enable(sc->ref_clk) != 0)
 			device_printf(dev, "could not enable clock.\n");
-	}
-	else if (hwtype == HWTYPE_SIFIVE_FU540) {
+	} else if (hwtype == HWTYPE_SIFIVE) {
 		if (clk_get_by_ofw_name(dev, 0, "pclk", &sc->ref_clk) != 0)
 			device_printf(dev,
 			    "could not retrieve reference clock.\n");


More information about the dev-commits-src-main mailing list