From owner-freebsd-current@freebsd.org Tue Jun 21 13:39:10 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFD71AC570A for ; Tue, 21 Jun 2016 13:39:10 +0000 (UTC) (envelope-from imre@vdsz.com) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2151B1E3F for ; Tue, 21 Jun 2016 13:39:09 +0000 (UTC) (envelope-from imre@vdsz.com) Received: from vdsz.de ([188.68.58.236]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0LyeIB-1bU3130LuJ-016BSD; Tue, 21 Jun 2016 15:39:06 +0200 Received: from localhost (vdsz.de [local]) by vdsz.de (OpenSMTPD) with ESMTPA id e66169a1; Tue, 21 Jun 2016 15:39:04 +0200 (CEST) Date: Tue, 21 Jun 2016 15:39:04 +0200 From: Imre Vadasz To: freebsd-current@freebsd.org Cc: johannes@brilliantservice.co.jp Subject: Re: Intel Atom I2C Message-ID: <20160621133904.GA677128@albireo.intra.vdsz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) X-Provags-ID: V03:K0:HSYZAg2KCJlBRCoqsING2HjwxhLCGWYON9SEgZHmRIaghAeg/AC e+VTOAyr5O7VwYuFIQlSxfEnfy8NXhjTkdjEC4rRblRSOgmBy1ISKRjt05MVprMDAoSYUg1 smKxaKGv1PqHbI1rf91vKBSH/fOKobZQrmkPtCgPgxbqm+inlXP/0DBgV/88vFdkt/COkFd 7cOQcGnGRzFio240f6Q6Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:RMcxkkNdJFY=:HDcCUwexan3C00/hvtn/DI EXTdauEd9Z307CZzkYEpo4Od3upL3cXYOEinmJ/GaJ2SQ/oKjmoHqN0JN02DiDqoALw7X89hF Jw/7MF8BrnbYQMkCbAkxrYt9hIN9ioVDFvlNRf1eLIms6l7BHibrv+IXdzezSEBxxGhEs6R4/ 5t3Hahuflj0wC7fcmzCtO66JHsLJshdPy8xe2sedfXqvTql3YYag5B6/kDfzRvLmoYQABppxw TnKX/jGYUJu1ObiMtNJbysYcVvnhWWb/zp1ciSI0IsSM0Hn5uQRYI0xnu6HtvsVhvvFwh4mgo DMczsiCtfBTCSA/+ApzsuYcO6xhK/aP+X43W5bUFsXtSgM9juSF3Q8e1qgnz5x6YQVgJFQ8V+ p0JjH8zklZG4PBGAtLAG1Qg42BA6VoWPsOqg5ljuud6CJOg/OtV7PSK+ZzqCiqleiA77IMygQ aUSwtQeEp6uzHmrfhCE7aciauw3bUPxe1enNv6ESLq0EWCrro5qI776kHnfPcthLNcyvUvx6E dgM8UeG03FDPaIIhS9z3XLgQOOJf2tGtnloRWOHposgvGSzjwwvYte5u/mSXkukSx6KN47aWI hflCWOsI5CKS6fAXO31NyT8Ko9eiLuJoNzzZpquk/1+aJ2wZUxPlG09fnFjgJK0vFUQNNNbBU DLLrUYNdbF8/yBQzxepfD4hQMXJve4NxgGWmhq135DH/rX2pkHj98G0Pq5qpxQEv4pLg= X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 21 Jun 2016 13:39:10 -0000 Hi, No driver for the DMA controller is needed for using the I2C controllers. On many devices the I2C controllers are only mapped as ACPI devices, and not as PCI-devices, but the existing ichiic driver can trivially be adapted to attach via acpi, which is already done by DragonFly's ichiic: https://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/sys/bus/smbus/ichiic/ig4_acpi.c On many Cherryview devices, the I2C controller driver needs to install a handler for ACPI accesses to I2cSerialBus fields inside of GenericSerialBus operation regions. I have already committed the I2cSerialBus operation region Field handling to DraognFly master (implemented by the smbacpi(4) driver which attaches as a child to ichiic: https://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/sys/bus/smbus/smbacpi/smbacpi.c) The I2cSerialBus operation region Field handling is e.g. needed on the HP X2 210 tablet/detachable for the AC adapter and ACPI battery devices, as well as for activating power on the external micro-sd card slot via the sdhc controller's _PS0 ACPI-method. Peripheral devices hanging on the I2c busses usually are detected as ACPI devices, which have I2cSerialBus resource entries. On current Cherryview devices the I2c peripheral devices usually aren't explicitly child devices of the I2c-Controller devices, but the I2cSerialBus resources contain a string which can be dereferenced to get the corresponding I2c-bus device. The same mechanism is used for mapping GPIO pins and GPIO interrupts (with the GpioInt and GpioIo resource entries). Also, since the I2c peripheral devices usually are no longer children of the I2c-bus, the correct device attachement/initialization order needs to be derived via the _DEP acpi methods.