Help, please, with getting a custom I2C real time clock module to load

Gary Jennejohn gljennjohn at gmail.com
Sun Feb 25 17:42:24 UTC 2018


On Sun, 25 Feb 2018 09:48:58 -0500
Lee D <embaudarm at gmail.com> wrote:

> Hi Everyone,
> 
> I have written a new I2C driver (for the Xilinx Zynq) and a new real
> time clock chip driver (for the ST M41T82) to use with hardware on my
> custom board.  This is for 11.0.1.
> 
> The I2C driver works fine, but I can't seem to get my RTC driver to
> load.  The m41t82_probe() function is never even called.
> 
> Both are loaded with kldload at the moment.
> 
> I think the problem is something in DRIVER_MODULE macro that is
> preventing the kernel from even trying to let it probe.  One clue is
> that if I change "iicbus" to "simplebus" in the DRIVER_MODULE macro
> of the RTC, it will then at least call m41t82_probe().
> 
> It's like the kernel thinks that I have no iicbus driver and thus
> won't even try to load the RTC module.
> 
> I have turned on "device iic" and "device iicbus" in my kernel config
> file.
> 
> No messages are given when I try to load the m41t82 module.  It just
> silently loads and does nothing.
> 
> Here is a code snippet from my I2C driver:
> ------------------------------------------
> 
> static driver_t i2c_driver = {
>   "i2c",
>   i2c_methods,
>   sizeof(struct i2c_softc),
> };
> static devclass_t  i2c_devclass;
> 
> DRIVER_MODULE(iicbus, i2c, iicbus_driver, iicbus_devclass, 0, 0);
> DRIVER_MODULE(i2c, simplebus, i2c_driver, i2c_devclass, 0, 0);
> 

This should give you a clue:

grep DRIVER_MODULE /sys/dev/iicbus/iic.c
DRIVER_MODULE(iic, iicbus, iic_driver, iic_devclass, 0, 0);

grep DRIVER_MODULE /sys/dev/iicbus/rtc8583.c
DRIVER_MODULE(rtc8583, iicbus, rtc8583_driver, rtc8583_devclass, NULL, NULL);

[snip]

-- 
Gary Jennejohn


More information about the freebsd-hackers mailing list