From owner-freebsd-current@freebsd.org Sun Jun 19 18:36:40 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 58F2EA7ACD7 for ; Sun, 19 Jun 2016 18:36:40 +0000 (UTC) (envelope-from johannes@brilliantservice.co.jp) Received: from mail-vk0-x230.google.com (mail-vk0-x230.google.com [IPv6:2607:f8b0:400c:c05::230]) (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 1C98A17CF for ; Sun, 19 Jun 2016 18:36:39 +0000 (UTC) (envelope-from johannes@brilliantservice.co.jp) Received: by mail-vk0-x230.google.com with SMTP id t129so172338974vka.1 for ; Sun, 19 Jun 2016 11:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brilliantservice-co-jp.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=9NCPtjOhQ9gtLJhDzdu+L6fs8uTMOnZ3U/PtsAFz988=; b=ENHP4cNB4etGZH2TsttpsM2yEsJJBUgRj4l5bFAKVo3POgFQyExqp7mPvTFYpa+8MG 2Y6E05ug+/wjbL8cbNHfOLfZHgo8YmgZ/nEM/BXlvQGtXJMthkN/ANgd/l76t3uFxwK+ Nrcn2cURSL9nRNTDHxahB0PqTw3VWHytnVmQcSQm6p+REoD+kLwuYl2f8x4hYDJ02Vwv IwKG9hR8y/5NecPZ/xAGwyCRd3OzxaqMspI9Ah3B4PSLnO3k7i6s1e6Xp3v7RI8mZsHo b3Z0WKgcQdKe/E+SsB6I1fV07wub2teL8DBj6g5IsDvM+Yr6JQEjn1F6HCl/RgxBC6gY IMxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9NCPtjOhQ9gtLJhDzdu+L6fs8uTMOnZ3U/PtsAFz988=; b=euD1m7/sn2KPb+1vOq5Fksx0Etu5PR1BFa0b+iMB0806FfApifkhDMDw5hg8xChqTX 6tQ+V1SqQH5ASpm07/b+9Ya3sS1c2trSDiB4T6nxFY3d0XPwjh+b5TbpvlxL6UEvVD2z Z+IkxFdFmJPV/Atb1r0qvYxuanoSnRrDG6+3zJ/5QzT8klHJrMBpj6+oqZoNH9eBqvxm FcFOO0D8JUY2tMJvKgYd9nDuAehL6Dzigp21/00kvXG6gszekHZiqNgkglY4WSy7oW0d pHQoG/5zFOZkmB0ZfcRcxKkeM8NalySfhNAyEX0GoI1SLbFo0H7bcbtKmaOopOXRSUhp wKIQ== X-Gm-Message-State: ALyK8tJlwA6WyZquca+b4dBFU+Mxawqw+bsneTqMp/iqgf8r3ct9qeltfIYT/O4cnU20bCs3rlr9IHPWvC/kMewIBQ9/7PaPAKmIZGiXTBdLax8vn1Y1hMkX2z6Zh3wI1XXoVjThEJDfiCz6xtbTR7djPHA= X-Received: by 10.176.2.177 with SMTP id 46mr5223757uah.7.1466361393727; Sun, 19 Jun 2016 11:36:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.40.33 with HTTP; Sun, 19 Jun 2016 11:36:19 -0700 (PDT) From: "Lundberg, Johannes" Date: Sun, 19 Jun 2016 11:36:19 -0700 Message-ID: Subject: Intel Atom I2C To: FreeBSD Current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 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: Sun, 19 Jun 2016 18:36:40 -0000 Hi I am trying to figure out how to get I2C support on Intel Atom x5 (Cherryview), which should be same for Baytrail platforms. On the Serial I/O device (PCI device 24) there are 8 devices. #0 is DMA controller #1-7 are I2C controllers (1 & 2 available on GPIO pins). I assume that all traffic to/from the I2C controllers must go via the DMA controller although I'm not 100% sure. In page 23 in the atom-z8000-datasheet-vol-2 there is a nice table of the PCI configuration space. On Linux they have i2c/busses/i2c-designware-* and dma/dw/* that takes care of the I2C and DMA parts. The ichiic (ig4) driver seems to be working on this platform and looking through the registers it seems to be basically the same as i2c-designware driver, but it doesn't not detect any devices on the I2C bus (/dev/smbx). (I have confirmed that the devices are recognized on Linux on the same device.) We also need a Mailbox (IOSF-SB MBI) driver and it is quite simple so I have already ported this. What is left to do I guess would be to implement a DMA driver that works with ig4 or create a new ig4 driver that is extended to use the DMA controller, and implement the DMA controller driver. Implementing from scratch would be quite the undertaking. Can we leverage any existing DMA infrastructure for this? Any one interested in helping? I have a board called "UP" which is very similar to Raspberry Pi but Intel SoC. It has IC20 and IC21 available on the 40-pin connector. Since it's Intel most stuff just works. Thanks to mmacy accelerated graphics is also working (on separate branch). It really is a great board for anyone who likes to tinker :) References: http://www.up-board.org/ http://lxr.linux.no/#linux+v4.6.2/drivers/i2c/busses http://lxr.linux.no/#linux+v4.6.2/drivers/dma/dw http://www.intel.com/content/www/us/en/processors/atom/atom-z8000-datasheet= -vol-1.html http://www.intel.com/content/www/us/en/processors/atom/atom-z8000-datasheet= -vol-2.html Other TODO stuff: Port Imer's GPIO driver from DragonFly Add support for S0ix sleep states (would be useful for all new Intel low power laptops since Haswell) And more... Thanks! /Johannes --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- =E7=A7=98=E5=AF=86=E4=BF=9D=E6=8C=81=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=EF= =BC=9A=E3=81=93=E3=81=AE=E9=9B=BB=E5=AD=90=E3=83=A1=E3=83=BC=E3=83=AB=E3=81= =AF=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E3=81=AB=E9=80=81=E4=BF=A1=E3=81=97= =E3=81=9F=E3=82=82=E3=81=AE=E3=81=A7=E3=81=82=E3=82=8A=E3=80=81=E7=A7=98=E5= =8C=BF=E7=89=B9=E6=A8=A9=E3=81=AE=E5=AF=BE=E8=B1=A1=E3=81=A8=E3=81=AA=E3=82= =8B=E6=83=85=E5=A0=B1=E3=82=92=E5=90=AB=E3=82=93=E3=81=A7=E3=81=84=E3=81=BE= =E3=81=99=E3=80=82 =E3=82=82=E3=81=97=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E4=BB=A5=E5=A4=96=E3= =81=AE=E6=96=B9=E3=81=8C=E5=8F=97=E4=BF=A1=E3=81=95=E3=82=8C=E3=81=9F=E5=A0= =B4=E5=90=88=E3=80=81=E3=81=93=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AE= =E7=A0=B4=E6=A3=84=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E3=81=93=E3=81=AE=E3= =83=A1=E3=83=BC=E3=83=AB=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=B8=80=E5=88= =87=E3=81=AE=E9=96=8B=E7=A4=BA=E3=80=81 =E8=A4=87=E5=86=99=E3=80=81=E9=85=8D=E5=B8=83=E3=80=81=E3=81=9D=E3=81=AE=E4= =BB=96=E3=81=AE=E5=88=A9=E7=94=A8=E3=80=81=E3=81=BE=E3=81=9F=E3=81=AF=E8=A8= =98=E8=BC=89=E5=86=85=E5=AE=B9=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=8F=E3=81=84= =E3=81=8B=E3=81=AA=E3=82=8B=E8=A1=8C=E5=8B=95=E3=82=82=E3=81=95=E3=82=8C=E3= =81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=8A=E9=A1=98=E3=81=84=E7=94=B3=E3=81= =97=E4=B8=8A=E3=81=92=E3=81=BE=E3=81=99=E3=80=82 --- CONFIDENTIALITY NOTE: The information in this email is confidential and intended solely for the addressee. Disclosure, copying, distribution or any other action of use of this email by person other than intended recipient, is prohibited. If you are not the intended recipient and have received this email in error, please destroy the original message.