From owner-freebsd-drivers@FreeBSD.ORG Wed Mar 4 15:49:56 2015 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72D3E367 for ; Wed, 4 Mar 2015 15:49:56 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F0C96AD for ; Wed, 4 Mar 2015 15:49:55 +0000 (UTC) Received: by padfb1 with SMTP id fb1so25227384pad.7 for ; Wed, 04 Mar 2015 07:49:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=N2+l/5BU+OGoJlq7aNrPOoZyiCoJOnVNgUmref1QZAY=; b=IDdMl9ALwQlZ5am3ts6R4XlFmRpJpb3/CQS4BCJQmBE7sJU/CT6k0MYdew9JNOp0j7 AIQZ2I41jMpawamW+e3WXiU7jILfxJ7NhnM6BtFszdjq8ysUbprFWRZaY/mea1QMzE6W DTaHMYzO0tHP8GYHHTuqKA4KVbNlnfijOodE95aS06YwQIJHW4Ee6InpVAMuKX2XkyLP o8uc/y2zh79WkZxgXiXdpqi+LF0lGy//o1XCS+LwFrad8WxMmMs9Au9iDMtseVNELJP2 6w0Tz+hsO3lfJ6iucwr85V1kzXXjl8Khl7hjWyqfXqbNsbnMCpWQkgSQpiWyQ2IORIZ+ /ubw== X-Gm-Message-State: ALoCoQldNJIy+VZ+Dxwr6c2l7JrM0IWebsw6GrbbIdj0LceNOxPsoF56Jc2oiFc5e+kg4NypNHDL X-Received: by 10.66.62.201 with SMTP id a9mr7734455pas.101.1425484194955; Wed, 04 Mar 2015 07:49:54 -0800 (PST) Received: from [10.64.24.149] ([69.53.236.236]) by mx.google.com with ESMTPSA id ia9sm4419313pbc.26.2015.03.04.07.49.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 07:49:53 -0800 (PST) Sender: Warner Losh Subject: Re: call identify, probe and attach on run time? Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_240931C6-A953-4C8C-9BEE-26502F1997C1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b5 From: Warner Losh In-Reply-To: Date: Wed, 4 Mar 2015 08:49:49 -0700 Message-Id: References: To: =?utf-8?Q?Mat=C3=ADas_Perret_Cantoni?= X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 15:49:56 -0000 --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 = 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--