Skip site navigation (1)Skip section navigation (2)
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>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]

> On Mar 4, 2015, at 7:39 AM, Matías 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’ll 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’t
have drivers, you’re code will get called and life will be good.

Warner

[-- Attachment #2 --]
-----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-----
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C4528454-FA6B-4C39-ABA2-AD618C37BDC0>