Date: Fri, 6 Mar 2015 16:03:49 -0300 From: =?UTF-8?Q?Mat=C3=ADas_Perret_Cantoni?= <perretcantonim@gmail.com> To: Warner Losh <imp@bsdimp.com> Cc: freebsd-drivers@freebsd.org Subject: Re: call identify, probe and attach on run time? Message-ID: <CADLKG01cpEb2sFH5Q%2BENLmxOh0ZKtdw3ouq4q7bGi=Mdtr0mmQ@mail.gmail.com> In-Reply-To: <C4528454-FA6B-4C39-ABA2-AD618C37BDC0@bsdimp.com> References: <CADLKG02uCGKARNDTetHjf-TM_bp_rDD43W9H=ARgRhE4jeDZwA@mail.gmail.com> <C4528454-FA6B-4C39-ABA2-AD618C37BDC0@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Thank you Warner, It worked the way you said. 2015-03-04 12:49 GMT-03:00 Warner Losh <imp@bsdimp.com>: > > > On Mar 4, 2015, at 7:39 AM, Mat=C3=ADas Perret Cantoni < > perretcantonim@gmail.com> wrote: > > > > Hello! I'm a newbie at freeBSD and at the development of newbus drivers= , > so > > excuse me if this is too silly: > > > > I'm running FreeBSD on the Zedboard, an arm based board, and I wrote a > > simple newbus driver for reading and writing a specific I/O port (It is > > basically a simplified copy of the Warner Losh example driver for the > > iOpener Led) > > > > I successfully load my driver: > > > > # kldload ./simple_d.ko > > # > > > > But after doing this I can't find the new node neither under /dev nor > with > > devinfo(8). I assume that the identify, probe and attach functions hasn= 't > > been called. Is this correct? > > > > So is there any way of doing this at run time? I mean NOT during > > auto-configuration. > > > > If I can only do it on boot time ... > > ... should I add a node at the Flattened Device Tree? > > ... should I place the driver in some specific directory? > > ... should I re-compile the kernel with the new driver included? > > I think you need to add the node to the FDT that you boot with. > Once you do that, you=E2=80=99ll be able to load and unload the driver. W= ith > the FDT node, it will probe on boot, find no driver and get on with life. > Later, when you load the driver it will probe all the nodes that don=E2= =80=99t > have drivers, you=E2=80=99re code will get called and life will be good. > > Warner >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLKG01cpEb2sFH5Q%2BENLmxOh0ZKtdw3ouq4q7bGi=Mdtr0mmQ>