iicoc: support building as a module

Only build on RISC-V for now, since we're not aware of any other cores
with this IP supported by FreeBSD.

Reviewed by:	jrtc27, philip
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D32737
This commit is contained in:
Thomas Skibo 2021-11-01 12:31:49 +08:00 committed by Philip Paeps
parent 2a36909a94
commit 99443830fa
3 changed files with 11 additions and 0 deletions

View File

@ -185,6 +185,7 @@ static driver_t iicoc_driver = {
sizeof(struct iicoc_softc),
};
SIMPLEBUS_PNP_INFO(compat_data);
DRIVER_MODULE(iicoc, simplebus, iicoc_driver, iicoc_devclass, 0, 0);
DRIVER_MODULE(ofw_iicbus, iicoc, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0);
MODULE_DEPEND(iicoc, iicbus, 1, 1, 1);

View File

@ -5,5 +5,8 @@ SUBDIR = alpm amdpm amdsmb ichiic ichsmb intpm ismt nfsmb viapm lpbb pcf
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
SUBDIR += imcsmb
.endif
.if ${MACHINE_CPUARCH} == "riscv"
SUBDIR += iicoc
.endif
.include <bsd.subdir.mk>

View File

@ -0,0 +1,7 @@
.PATH: ${SRCTOP}/sys/dev/iicbus
KMOD = iicoc
SRCS = device_if.h bus_if.h iicbus_if.h \
iicoc.c iicoc_fdt.c iicoc_pci.c
.include <bsd.kmod.mk>