From owner-freebsd-current@freebsd.org Wed Dec 19 19:35:28 2018 Return-Path: Delivered-To: freebsd-current@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 30FA21341D19 for ; Wed, 19 Dec 2018 19:35:28 +0000 (UTC) (envelope-from Scoobi_doo@yahoo.com) Received: from sonic314-14.consmr.mail.bf2.yahoo.com (sonic314-14.consmr.mail.bf2.yahoo.com [74.6.132.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3FF16A16C for ; Wed, 19 Dec 2018 19:35:26 +0000 (UTC) (envelope-from Scoobi_doo@yahoo.com) X-YMail-OSG: VaIQJY0VM1mMiIyD.zXxpSp.5jnrZx.7x0RnDQgCR4EDY8_M_zG2W.ABRAd13JV Gj7vn6T0eorAwdynFrAskTSif93owu__KE5Ev7h.tSsBPwSwnZ7p9VD8KlMJ0y1hOzc4ui2lsce6 eJtv1NLiWTOq_mvcQ44qW3s2JCtMHtkUk2tSVA9ATRrO3FpHKoyQ6HnHHMhSB7u4_4y3G2EZ5isR Ebvj0WklH6800kDClsH5CdzmGUL1eUsN073X0Fe2jfk7DIa9ON56Su3SlSOsl6MPzT5emH1C7nSy NvYIx4lyILuSESmxcela6bpDFXr5mOReuez8OE2moUZjRDDecYSXfFTPEm0D8grXmwekfS4VLVZS msP3B_GRQE1RM..tt4YCupyVfPzihdHzmkx78kkRFZkVbzoC98yXZP6iXcntcBjXBf4_OzXheS03 3R6q9YYCZ8AsO16eHq7sk_.ZfQZxdbKeDmocW2i82aAwM3FiLEJvNKcCNOsKi3LJipYZW_luvzVT JpSpoShL5PuRTBGvb1SE_0E3RV8qAXA9SP1DWVjBs36d0IzR31J1pAtBplfk4d48aAnLHRh29Kkn ImSejYHnse0x91hDd7o7HM.gysCc6uqjBKJCvhRRHPeN.4cehv_GmeTiMo1krWBVpJYrk7FUbUNl _IsJz17zAmzBwDMGeDF0JjSZpLqt2uPGAYRZraosnW2NWfEPl5mx9nNcBL6w.krzHZ3wfllrBAu8 mr6Yex2WlXhIkHWjI.8Asqj.cXL2YACSJxMum5yPMkdtgRNPUuMOc_sAQ8nFK5RCwQ5W4m0r_1_5 VoiOtmJbEMXDZG.HrC1b1MxAH2G2fEwp2rKtILdMLlej8Sns4xdRMo5qY7XUp_Cxugr94l9pzmgx uq8NNxIwjka2.i4EfMYx.8_HQlPDliuraXvtE7ca1q.IJS2gsC_Jq.UKM3CzFtSrN6LrhU0e9bJX GvGECYrl5Mobe5af1_TWl8wpxKdjcNP6AebdgVlSltQgLUGgCKRx2LghlWOTgQWgovoEpfbIwTby 3HtAFzOH_bcDWqQWu1PWCtI4B8CdLGmlyxtKamaS1MM9cI4VcewgWmKvgr4yen6jdmXECga.XvJb 12hSLl1V4Dy65pYVZSHAS5o0tQ8Q9aw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.bf2.yahoo.com with HTTP; Wed, 19 Dec 2018 19:35:20 +0000 Received: from 192.34.49.8 (EHLO [10.228.144.28]) ([192.34.49.8]) by smtp402.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 8b75c1e5c0adb277ea85742e68ef4d78; Wed, 19 Dec 2018 19:35:15 +0000 (UTC) Subject: Re: Composite PCI devices in FreeBSD (mfd in Linux) From: Anthony Jenkins To: John Baldwin , Ian Lepore Cc: FreeBSD CURRENT , Gleb Popov <6yearold@gmail.com> References: <1544473194.1860.340.camel@freebsd.org> <05b1183c-6117-267b-42f9-19e750adfa07@FreeBSD.org> <02e30a11-4adf-3efb-d2ce-89c598bda9cf@yahoo.com> Message-ID: <1c3e555d-7289-1219-8c66-07f75a335dc0@yahoo.com> Date: Wed, 19 Dec 2018 14:35:14 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <02e30a11-4adf-3efb-d2ce-89c598bda9cf@yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: D3FF16A16C X-Spamd-Bar: / X-Spamd-Result: default: False [-0.34 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.78)[-0.782,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.67)[-0.667,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.64)[ip: (5.29), ipnet: 74.6.128.0/21(1.67), asn: 26101(1.33), country: US(-0.08)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.48)[0.479,0]; RCVD_IN_DNSWL_NONE(0.00)[124.132.6.74.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 19:35:28 -0000 On 12/19/18 10:41 AM, Anthony Jenkins wrote: > [snip] > > I'm not feeling too confident about the condition of the FreeBSD ig4 > driver; the PCI attach code was calling pci_alloc_msi() wrong, passing > a pointer to the rid (0) instead of a pointer to a count variable, and > not passing bus_alloc_resource_any() an IRQ rid > 0 if it has an MSI.  > I'd be happy(er) if ig4 created a /dev/iic0 node - I figured iicbus(4) > took care of all that... > > https://github.com/ScoobiFreeBSD/freebsd-intel-lpss > Found it!  I didn't declare ig4_iic to include the ig4_lpss as a sub-device.  Now it at least /looks/ like I'm getting I2C devices found on both my DesignWare I2C busses. diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c index 6bbe417..34c1adb 100644 --- a/sys/dev/ichiic/ig4_iic.c +++ b/sys/dev/ichiic/ig4_iic.c @@ -802,3 +802,4 @@ ig4iic_dump(ig4iic_softc_t *sc)  DRIVER_MODULE(iicbus, ig4iic_acpi, iicbus_driver, iicbus_devclass, NULL, NULL);  DRIVER_MODULE(iicbus, ig4iic_pci, iicbus_driver, iicbus_devclass, NULL, NULL); +DRIVER_MODULE(iicbus, ig4iic_lpss, iicbus_driver, iicbus_devclass, NULL, NULL); ajenkins@ajenkins-delllaptop ~/Projects/freebsd-intel-lpss (master) $ ls /dev/ii* /dev/iic0  /dev/iic1 ajenkins@ajenkins-delllaptop ~/Projects/freebsd-intel-lpss (master) $ for i2cbus in iic0 iic1; do sudo i2c -s -f "/dev/${i2cbus}"; done Hardware may not support START/STOP scanning; trying less-reliable read method. Scanning I2C devices on /dev/iic0: 0a Hardware may not support START/STOP scanning; trying less-reliable read method. Scanning I2C devices on /dev/iic1: 2c Anthony