Add support for Cadence network controller found in HiFive Unleashed board.

Reviewed by:	markj
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D19798
This commit is contained in:
Ruslan Bukin 2019-04-24 13:44:30 +00:00
parent 7bad03a8b5
commit ef5a75b193

View File

@ -98,6 +98,12 @@ __FBSDID("$FreeBSD$");
#define CGEM_CKSUM_ASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP | \
CSUM_TCP_IPV6 | CSUM_UDP_IPV6)
static struct ofw_compat_data compat_data[] = {
{ "cadence,gem", 1 },
{ "cdns,macb", 1 },
{ NULL, 0 },
};
struct cgem_softc {
if_t ifp;
struct mtx sc_mtx;
@ -1635,7 +1641,7 @@ cgem_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "cadence,gem"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "Cadence CGEM Gigabit Ethernet Interface");