From owner-svn-soc-all@FreeBSD.ORG Thu Aug 9 11:25:21 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 6DA77106564A for ; Thu, 9 Aug 2012 11:25:19 +0000 (UTC) (envelope-from aleek@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 09 Aug 2012 11:25:19 +0000 Date: Thu, 09 Aug 2012 11:25:19 +0000 From: aleek@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120809112519.6DA77106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r240208 - in soc2012/aleek/beaglexm-armv6/sys: arm/ti arm/ti/twl arm/ti/usb boot/fdt/dts X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2012 11:25:21 -0000 Author: aleek Date: Thu Aug 9 11:25:18 2012 New Revision: 240208 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240208 Log: ti_i2c and ti_twl refactoring Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c Thu Aug 9 09:51:00 2012 (r240207) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c Thu Aug 9 11:25:18 2012 (r240208) @@ -180,7 +180,6 @@ static inline uint16_t ti_i2c_read_2(struct ti_i2c_softc *sc, bus_size_t off) { - //device_printf( sc->sc_dev, "%s offset 0x%02lx\n", __FUNCTION__, off ); return bus_read_2(sc->sc_mem_res, off); } @@ -199,7 +198,6 @@ static inline void ti_i2c_write_2(struct ti_i2c_softc *sc, bus_size_t off, uint16_t val) { - //device_printf( sc->sc_dev, "%s offset 0x%02lx\n", __FUNCTION__, off ); bus_write_2(sc->sc_mem_res, off, val); } @@ -219,8 +217,6 @@ static inline uint16_t ti_i2c_read_reg(struct ti_i2c_softc *sc, bus_size_t off) { - /* XXXOMAP3: FIXME add registers mapping here */ - //device_printf( sc->sc_dev, "%s offset 0x%02lx\n", __FUNCTION__, off ); return bus_read_2(sc->sc_mem_res, off); } @@ -240,8 +236,6 @@ static inline void ti_i2c_write_reg(struct ti_i2c_softc *sc, bus_size_t off, uint16_t val) { - //device_printf( sc->sc_dev, "%s offset 0x%02lx\n", __FUNCTION__, off ); - /* XXXOMAP3: FIXME add registers mapping here */ bus_write_2(sc->sc_mem_res, off, val); } @@ -263,13 +257,13 @@ static inline void ti_i2c_set_intr_enable(struct ti_i2c_softc *sc, uint16_t ie) { - /* XXXOMAP3: FIXME */ +#if defined( SOC_TI_AM37X ) || defined( SOC_OMAP3 ) ti_i2c_write_2(sc, I2C_REG_IE, ie); - /* +#elif defined(SOC_TI_AM335X) || defined(SOC_OMAP4) ti_i2c_write_2(sc, I2C_REG_IRQENABLE_CLR, 0xffff); if (ie) ti_i2c_write_2(sc, I2C_REG_IRQENABLE_SET, ie); - */ +#endif } /** @@ -1090,7 +1084,11 @@ /* XXXOMAP3: FIXME get proper revision here */ /* First read the version number of the I2C module */ //@todo aleek fix this change cause dmarion will be pissed ;) - sc->sc_rev = ti_i2c_read_2(sc, I2C_REG_REVNB_LO) & 0xff; +#if defined(SOC_TI_AM335X) || defined(SOC_OMAP4) + sc->sc_rev = ti_i2c_read_2(sc, I2C_REG_REVNB_HI) & 0xff; +#elif defined( SOC_TI_AM37X ) || defined( SOC_OMAP3 ) + sc->sc_rev = ti_i2c_read_2(sc, I2C_REG_REV) & 0xff; +#endif device_printf(dev, "I2C revision %d.%d\n", sc->sc_rev >> 4, sc->sc_rev & 0xf); Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c Thu Aug 9 09:51:00 2012 (r240207) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c Thu Aug 9 11:25:18 2012 (r240208) @@ -558,7 +558,6 @@ int err; uint8_t vsel; int xlocked; - device_printf( sc->sc_dev, "%s\n", __FUNCTION__ ); TWL_VREG_ASSERT_LOCKED(sc); @@ -627,7 +626,6 @@ int en = 0; int xlocked; uint8_t vsel; - device_printf( sc->sc_dev, "%s\n", __FUNCTION__ ); TWL_VREG_ASSERT_LOCKED(sc); @@ -831,14 +829,12 @@ struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); struct twl_regulator_entry *new; - device_printf( sc->sc_dev, "%s:%d\n", __FUNCTION__, __LINE__ ); new = malloc(sizeof(struct twl_regulator_entry), M_DEVBUF, M_NOWAIT | M_ZERO); if (new == NULL) return (NULL); - device_printf( sc->sc_dev, "%s:%d\n", __FUNCTION__, __LINE__ ); strncpy(new->name, name, TWL_VREG_MAX_NAMELEN); new->name[TWL_VREG_MAX_NAMELEN - 1] = '\0'; @@ -851,7 +847,6 @@ new->num_supp_voltages = num_voltages; - device_printf( sc->sc_dev, "%s:%d\n", __FUNCTION__, __LINE__ ); /* Add a sysctl entry for the voltage */ new->oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RD, sc, 0, @@ -892,7 +887,6 @@ int len = 0, prop_len; - device_printf( sc->sc_dev, "%s:%d\n", __FUNCTION__, __LINE__ ); /* Add the regulators from the list */ walker = ®ulators[0]; while (walker->name != NULL) { @@ -907,14 +901,12 @@ walker++; } - device_printf( sc->sc_dev, "%s:%d\n", __FUNCTION__, __LINE__ ); /* Check if the FDT is telling us to set any voltages */ child = ofw_bus_get_node(sc->sc_pdev); if (child) { prop_len = OF_getprop(child, "voltage-regulators", rnames, sizeof(rnames)); - device_printf( sc->sc_dev, "prop_len: %d\n", prop_len ); while (len < prop_len) { name = rnames + len; len += strlen(name) + 1; @@ -966,7 +958,6 @@ struct twl_vreg_softc *sc; sc = device_get_softc((device_t)dev); - device_printf( sc->sc_dev, "%s:%d\n", __FUNCTION__, __LINE__ ); TWL_VREG_XLOCK(sc); @@ -1010,7 +1001,6 @@ /* We have to wait until interrupts are enabled. I2C read and write * only works if the interrupts are available. */ - device_printf( sc->sc_dev, "%s:%d\n", __FUNCTION__, __LINE__ ); sc->sc_init_hook.ich_func = twl_vreg_init; sc->sc_init_hook.ich_arg = dev; Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c Thu Aug 9 09:51:00 2012 (r240207) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/usb/omap_ehci.c Thu Aug 9 11:25:18 2012 (r240208) @@ -294,7 +294,6 @@ omap_ehci_soft_phy_reset(struct omap_ehci_softc *isc, unsigned int port) { unsigned long timeout = (hz < 10) ? 1 : ((100 * hz) / 1000); - timeout = timeout<<2; uint32_t reg; reg = ULPI_FUNC_CTRL_RESET Modified: soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Thu Aug 9 09:51:00 2012 (r240207) +++ soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Thu Aug 9 11:25:18 2012 (r240208) @@ -65,7 +65,7 @@ /* Set of triplets < padname, muxname, padstate> */ scm-pad-config = /* USB */ - /* + "af10", "hsusb1_stp", "output", "ae10", "hsusb1_clk", "output", "af9", "hsusb1_dir", "input_pulldown", @@ -77,7 +77,7 @@ "ae11", "hsusb1_data4", "input_pulldown", "ah9", "hsusb1_data5", "input_pulldown", "af13", "hsusb1_data6", "input_pulldown", - "ae13", "hsusb1_data7", "input_pulldown",*/ + "ae13", "hsusb1_data7", "input_pulldown", "af7", "hsusb2_stp", "output", "ag7", "hsusb2_dir", "input_pulldown",