From owner-freebsd-hackers@freebsd.org Mon Feb 26 16:27:40 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 1635EF31185 for ; Mon, 26 Feb 2018 16:27:40 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: from mail-ot0-x22f.google.com (mail-ot0-x22f.google.com [IPv6:2607:f8b0:4003:c0f::22f]) (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 950D27CCF8; Mon, 26 Feb 2018 16:27:39 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: by mail-ot0-x22f.google.com with SMTP id m22so456890otf.10; Mon, 26 Feb 2018 08:27:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fpW0/oEAQAnx/HWMwBtZURUgAovfivmdvDKvszry5lM=; b=aziSCyfV1q6Ml/dSIhhvK16Y5xQ4FF/4LD0nOLmRclKSCzHygy1511xpIWjOsZ37kS r5Pp891EgvpZgf8qXWFZVFpuSMr7qwd3k2xQZM4KLYrdx6WeujpXWz6f/SGeX7u7HL4s gqeVVJtbk9sXiiKjLACUlSeXyJ/S8DztRxQuetCA3i76j9DSJE51gFMpnwGL6WcLae0T 8ZoMjJUXaBCDJk4UK4nlcvEh2UYM5Xe5/AOWBHm2Czxrb1rT787TcqpgW6+U5wA1pTTu YVifarRoZl3uYjbxp0CeGIlPCprwvKn+zCm3jidkqRIPQsF6cLIZl6v5+l5TN9WtvYCp k5jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fpW0/oEAQAnx/HWMwBtZURUgAovfivmdvDKvszry5lM=; b=eZMuRdWu+NbKVActtIpyiF3u2ekOgBwqXoIw0FuuL4DrMUhu1v7DtfMbiqxgn54h+r chRwGzuM2f/piXEIndBahQvjE43cnyaz/mzW8G6Wrr4AAsKdGFiu5VMGTx23MRZIykHo EpDtFoqe7O7XBYDGFVdS07nzsWiTUYtTpznBKsqF3EnDHs8E1uPPm9oLgLBsijUM7VbR YSOrBwmDi5JK8t7sIr0G+GwHc1dyElvvUbLsrZgYreNjhKAEmii5UkOJOhwpRR8JAzoK G6HO5krfATmbvqpI0ZA+mlc0wIRR30Aah10QFDXwDL8gNoBFRYKA8ArFA+h/tW5stJ5Y 6ktg== X-Gm-Message-State: APf1xPA9xIk5D3cosUGnqJSJ9ZqkTjzuh/Hkh96RN+Ke1q25sp5K39+T KIAQLeWGUphbJKM4qjdOGheK/Xmp/heXiuiAMtM= X-Google-Smtp-Source: AH8x227UqhTl73n0yiv21Y4rs5CsLqDvzui0Ll+DCx46+C15sCkr+4Xhz9kS5rUKVRr89fwJ5CeMYvI6KKdnxZyD52Q= X-Received: by 10.157.53.10 with SMTP id o10mr7674935otc.283.1519662457682; Mon, 26 Feb 2018 08:27:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.45.194 with HTTP; Mon, 26 Feb 2018 08:26:57 -0800 (PST) In-Reply-To: <1519579387.91697.252.camel@freebsd.org> References: <1519579387.91697.252.camel@freebsd.org> From: Lee D Date: Mon, 26 Feb 2018 11:26:57 -0500 Message-ID: Subject: Re: Help, please, with getting a custom I2C real time clock module to load To: Ian Lepore Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" 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: Mon, 26 Feb 2018 16:27:40 -0000 On Sun, Feb 25, 2018 at 12:23 PM, Ian Lepore wrote: > On Sun, 2018-02-25 at 09:48 -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. > > Right here is where the disconnect is happening. It's the ofw_iicbus > driver that needs to declared in the first DRIVER_MODULE() instead of > iicbus, because ofw_iicbus is the one that knows to look in the fdt > data for slave devices and add them as children of the bus. But, the > extern declarations needed to do that didn't exist until I added them > last week in r329526. > > What i2c drivers have been doing in the past, and the way to work > around it in the 11.x code you're dealing with, is to leverage one of > the DRIVER_MODULE() declarations that already exists in ofw_iicbus, by > naming your driver "iichb" instead of "i2c". Like this: > > static driver_t i2c_driver = { > "iichb", > i2c_methods, > sizeof(struct i2c_softc), > }; > > Or you could import r329526 into the kernel source you're using and > rebuild the kernel. I do intend to MFC that change to 11-stable (in > fact, I should probably do that today). > > When you've got these new drivers working, please consider putting them > up for review at https://reviews.freebsd.org and we'll get them > committed to freebsd. > > -- Ian > Thanks so much for the advice, I was able to get the RTC driver to load using the iichb trick. I would be happy to contribute the code assuming I can get it to work. I will probably move to 11.1 in the near future. Lee