Date: Wed, 4 Mar 2015 08:49:49 -0700 From: Warner Losh <imp@bsdimp.com> To: =?utf-8?Q?Mat=C3=ADas_Perret_Cantoni?= <perretcantonim@gmail.com> Cc: freebsd-drivers@freebsd.org Subject: Re: call identify, probe and attach on run time? Message-ID: <C4528454-FA6B-4C39-ABA2-AD618C37BDC0@bsdimp.com> In-Reply-To: <CADLKG02uCGKARNDTetHjf-TM_bp_rDD43W9H=ARgRhE4jeDZwA@mail.gmail.com> References: <CADLKG02uCGKARNDTetHjf-TM_bp_rDD43W9H=ARgRhE4jeDZwA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_240931C6-A953-4C8C-9BEE-26502F1997C1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 4, 2015, at 7:39 AM, Mat=C3=ADas Perret Cantoni = <perretcantonim@gmail.com> wrote: >=20 > Hello! I'm a newbie at freeBSD and at the development of newbus = drivers, so > excuse me if this is too silly: >=20 > 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) >=20 > I successfully load my driver: >=20 > # kldload ./simple_d.ko > # >=20 > 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? >=20 > So is there any way of doing this at run time? I mean NOT during > auto-configuration. >=20 > 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. = With 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 --Apple-Mail=_240931C6-A953-4C8C-9BEE-26502F1997C1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJU9ymdAAoJEGwc0Sh9sBEAjsAP/3f+zDVJIp3sxrF5J/G18XFC 2GVncY8ubVSmzH8O2WxyrmrRyF9ex/KYY9+vV2qGaojHIwRtC6sEK0fDIKCUDecG LD+sUcPIi12JygUoZNS1ju8uMKOTN+uMIJBz4Wsai/AHYr46a8XKg0k2X+TMW6x7 Ql8bwng+b5K6kRdHUHzwEZnb8ziuoI/p/oKq3rMIxnwcUowZvciwMs9iDkhtAW3Q ZNYAx5HAM+A2dTYfnFeR1FSckdKnNEOJamaimttn4nPpWXGr4OdMlti6+h1RyFtq alcCMguFFu5pj8GOqRWFMXFTyM04AjR7ysPWDjscf7expXbuH5LKH8hllZOb3PJG kim9M7p3ZtrDBOR69HqHh9Fy7M7W8Q2zSKHo1ga9BO5eK7vSzoHT6EFAOyZY3PrL QKJoeizcRTkq92bFR2tNxsb4njlwNeG9PZsbfZHB+TgixlIgHE+69EgF7Z4YdEDH sr9svfCrQr6+aRItR13f3+8bB4ged8QvYRaQgD8EWiQHEF1EDOr3oBCw5kZtIJgb 8EYz+1poqP8seGE5PtXK5OWchvXqzWJEaRqXcVU4Ty2ajpwVODzUKWlWbWLgmqT5 VRX1U7vBl1svdWgyMN+Z6+g8sboSNJ+2T8d37c8BGf7k2gauG9m7wa3GbuJkNaf7 N/aQXoSQLWdVzrnOamdi =P3YG -----END PGP SIGNATURE----- --Apple-Mail=_240931C6-A953-4C8C-9BEE-26502F1997C1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C4528454-FA6B-4C39-ABA2-AD618C37BDC0>