From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 04:39:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B5E32E; Tue, 22 Jul 2014 04:39:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F58D2849; Tue, 22 Jul 2014 04:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4dXIl048000; Tue, 22 Jul 2014 04:39:33 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4dXdb047994; Tue, 22 Jul 2014 04:39:33 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407220439.s6M4dXdb047994@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 22 Jul 2014 04:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268977 - in head/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 04:39:34 -0000 Author: br Date: Tue Jul 22 04:39:32 2014 New Revision: 268977 URL: http://svnweb.freebsd.org/changeset/base/268977 Log: Enable Freescale i.MX I2C driver for i.MX6. Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx_i2c.c head/sys/boot/fdt/dts/arm/imx6.dtsi Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/conf/IMX6 Tue Jul 22 04:39:32 2014 (r268977) @@ -154,8 +154,8 @@ options FREEBSD_BOOT_LOADER # Process # SoC-specific devices device ffec # Freescale Fast Ethernet Controller -#device fsliic # Freescale i2c/iic (not ready yet) -#device iic # iic protocol -#device iicbus # iic bus +device fsliic # Freescale i2c/iic +device iic # iic protocol +device iicbus # iic bus #device imxwdt # Watchdog. WARNING: can't be disabled!!! Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 04:39:32 2014 (r268977) @@ -27,6 +27,7 @@ arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio +arm/freescale/imx/imx_i2c.c optional fsliic # # Optional devices. @@ -52,5 +53,4 @@ arm/freescale/imx/imx6_usbphy.c optiona # #arm/freescale/imx/imx51_iomux.c optional iomux #dev/ata/chipsets/ata-fsl.c optional imxata -#arm/freescale/imx/imx_i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 04:39:32 2014 (r268977) @@ -86,6 +86,12 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-i2c", 1}, + {"fsl,imx-i2c", 1}, + {NULL, 0} +}; + struct i2c_softc { device_t dev; device_t iicbus; @@ -227,7 +233,7 @@ i2c_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); sc = device_get_softc(dev); @@ -246,7 +252,7 @@ i2c_probe(device_t dev) /* Enable I2C */ i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); - device_set_desc(dev, "I2C bus controller"); + device_set_desc(dev, "Freescale i.MX I2C bus controller"); return (BUS_PROBE_DEFAULT); } Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/boot/fdt/dts/arm/imx6.dtsi Tue Jul 22 04:39:32 2014 (r268977) @@ -338,6 +338,27 @@ reg = <0x02100000 0x00100000>; ranges; + i2c1: i2c@021a0000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a0000 0x4000>; + interrupts = < 68 >; + status = "disabled"; + }; + + i2c2: i2c@021a4000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a4000 0x4000>; + interrupts = < 69 >; + status = "disabled"; + }; + + i2c3: i2c@021ac000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a8000 0x4000>; + interrupts = < 70 >; + status = "disabled"; + }; + fec1: ethernet@02188000 { compatible = "fsl,imx6q-fec"; reg = <0x02188000 0x4000>;