From owner-freebsd-hackers@freebsd.org Sun Feb 25 17:42:24 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CBDDF03A7C for ; Sun, 25 Feb 2018 17:42:24 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 0747868CDB for ; Sun, 25 Feb 2018 17:42:24 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id q83so13349998wme.5 for ; Sun, 25 Feb 2018 09:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=y1W4hS0dorqzfNjCmr0OfQ/osKUIU5dgEOHHU00H4Uc=; b=BXGdaJzDhJQg8Jv9vwxE4JoZjATLaq8VbnqLL/+CWK8XnrA4jVc7zIVyAnE1FuGWOU m43OqIv546hF8pWDa7i3d+s2Sl50cFwHysHdYlOcM0tRIqZzvs/BiJAc2o5S9udmNGCD l7gwv2sNfXW3Su15qXWO6rDkwliZcCsa/6IDzWB9ajPDc/9l+c9I7TqAmd0mqc4ke6TI glluvj1OmWRF/FSozFS3GvCorpC7lPzdyovFDAZTe8fqaQY1o5dm29eWsDw1t2hMfi1U 3CVmmaMdrJrckNtKy/Lz3noYxGTq6bv5nJ2BYLdTHeYQ5uZnA+5luIaP2jZiYNyfPlnn W73Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=y1W4hS0dorqzfNjCmr0OfQ/osKUIU5dgEOHHU00H4Uc=; b=hEaK9AMMtRgFCiJM027pze5IGjsOZPhw45NfnRx2YEL/bQZ+UUIlrZm/jN1yKPuzTs jAXPYx5OlEcQxEEIcD20ZKfscIen/wvXGyyaITcKH4nWzuj8Eds3B8ouNd/GIEp6yfoE 437Nn8iXlWHU+tl2jxuvFkrPSWUILvIAgx7Z7l1Zq9cnIVTVJ7/TQUpu+iGJCWRIsOu1 QjM4xvJ8Ag6GbwyAbospZwNWZF3hFld4bQBNsvX6zbV+pdhSI4R7UNFfjKlxFHr4jfaz S8BJJsai3ZZkZRzGZSc4Hd89MOo4xyevFezoggFZL2ZuNstEYS6SsATTcLpOJLkUQe5K lmUg== X-Gm-Message-State: APf1xPA/SL9RHbNmYXjIO3mnrqQ88lM11mIWOl4dk49aPF6QdvPGd6Nu buFVmA17QHNNBkSo8IUAtBU= X-Google-Smtp-Source: AG47ELuN2X6MaIruJsggkML+skjg4Ei4c4TaikaIwfdeagofw+CpW8pI+B89TRL39CPLWRQt/nfXHA== X-Received: by 10.28.167.208 with SMTP id q199mr6360997wme.29.1519580543072; Sun, 25 Feb 2018 09:42:23 -0800 (PST) Received: from ernst.home (pD9E23F28.dip0.t-ipconnect.de. [217.226.63.40]) by smtp.gmail.com with ESMTPSA id 56sm8199114wrt.23.2018.02.25.09.42.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2018 09:42:22 -0800 (PST) Date: Sun, 25 Feb 2018 18:42:20 +0100 From: Gary Jennejohn To: Lee D Cc: freebsd-hackers@freebsd.org Subject: Re: Help, please, with getting a custom I2C real time clock module to load Message-ID: <20180225184220.748e9d59@ernst.home> In-Reply-To: References: Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 17:42:24 -0000 On Sun, 25 Feb 2018 09:48:58 -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. > > The I2C driver works fine, but I can't seem to get my RTC driver to > load. The m41t82_probe() function is never even called. > > Both are loaded with kldload at the moment. > > I think the problem is something in DRIVER_MODULE macro that is > preventing the kernel from even trying to let it probe. One clue is > that if I change "iicbus" to "simplebus" in the DRIVER_MODULE macro > of the RTC, it will then at least call m41t82_probe(). > > It's like the kernel thinks that I have no iicbus driver and thus > won't even try to load the RTC module. > > I have turned on "device iic" and "device iicbus" in my kernel config > file. > > No messages are given when I try to load the m41t82 module. It just > silently loads and does nothing. > > Here is a code snippet from my I2C driver: > ------------------------------------------ > > static driver_t i2c_driver = { > "i2c", > i2c_methods, > sizeof(struct i2c_softc), > }; > static devclass_t i2c_devclass; > > DRIVER_MODULE(iicbus, i2c, iicbus_driver, iicbus_devclass, 0, 0); > DRIVER_MODULE(i2c, simplebus, i2c_driver, i2c_devclass, 0, 0); > This should give you a clue: grep DRIVER_MODULE /sys/dev/iicbus/iic.c DRIVER_MODULE(iic, iicbus, iic_driver, iic_devclass, 0, 0); grep DRIVER_MODULE /sys/dev/iicbus/rtc8583.c DRIVER_MODULE(rtc8583, iicbus, rtc8583_driver, rtc8583_devclass, NULL, NULL); [snip] -- Gary Jennejohn