Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Feb 2018 11:26:57 -0500
From:      Lee D <embaudarm@gmail.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Help, please, with getting a custom I2C real time clock module to load
Message-ID:  <CANC_bnO9tx5taGGgJQV3GDqVhKAGNd1UaWQ1tTBAdO7LAxSg6w@mail.gmail.com>
In-Reply-To: <1519579387.91697.252.camel@freebsd.org>
References:  <CANC_bnOe1-%2BBQocKfNraJuq4UjbYe=ita=0qsy65EVMdhGQDLQ@mail.gmail.com> <1519579387.91697.252.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 25, 2018 at 12:23 PM, Ian Lepore <ian@freebsd.org> wrote:
> On Sun, 2018-02-25 at 09:48 -0500, Lee D 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.

>
> Right here is where the disconnect is happening.  It's the ofw_iicbus
> driver that needs to declared in the first DRIVER_MODULE() instead of
> iicbus, because ofw_iicbus is the one that knows to look in the fdt
> data for slave devices and add them as children of the bus.  But, the
> extern declarations needed to do that didn't exist until I added them
> last week in r329526.
>
> What i2c drivers have been doing in the past, and the way to work
> around it in the 11.x code you're dealing with, is to leverage one of
> the DRIVER_MODULE() declarations that already exists in ofw_iicbus, by
> naming your driver "iichb" instead of "i2c".  Like this:
>
>     static driver_t i2c_driver = {
>       "iichb",
>       i2c_methods,
>       sizeof(struct i2c_softc),
>     };
>
> Or you could import r329526 into the kernel source you're using and
> rebuild the kernel.  I do intend to MFC that change to 11-stable (in
> fact, I should probably do that today).
>
> When you've got these new drivers working, please consider putting them
> up for review at https://reviews.freebsd.org and we'll get them
> committed to freebsd.
>
> -- Ian
>

Thanks so much for the advice, I was able to get the RTC driver to
load using the iichb trick.  I would be happy to contribute the code
assuming I can get it to work.   I will probably move to 11.1 in the
near future.

Lee



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANC_bnO9tx5taGGgJQV3GDqVhKAGNd1UaWQ1tTBAdO7LAxSg6w>