Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Aug 2012 16:11:59 +0000
From:      aleek@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r240471 - in soc2012/aleek/beaglexm-armv6/sys: arm/ti arm/ti/omap3 arm/ti/twl boot/fdt/dts
Message-ID:  <20120817161159.B00E4106566B@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: aleek
Date: Fri Aug 17 16:11:59 2012
New Revision: 240471
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240471

Log:
  minor fixes in TWL module

Modified:
  soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm.c
  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/boot/fdt/dts/beagleboardxm.dts

Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm.c	Fri Aug 17 15:53:43 2012	(r240470)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/omap3/omap3_prcm.c	Fri Aug 17 16:11:59 2012	(r240471)
@@ -459,7 +459,6 @@
 	/* Read the input clock freq from the configuration register */
 
 	clknsel = prm_read_4(CLOCK_CTRL_PRM_OFFSET + 0x40); 
-	//clknsel = bus_read_4(mem_res[PRM_INSTANCE_MEM_REGION], CLOCK_CTRL_PRM_OFFSET + 0x40);
 	switch (clknsel & 0x7) {
 		case 0x0:
 			/* 12Mhz */
@@ -491,7 +490,6 @@
 
 	/* Read the value of the clock divider used for the system clock */
 	clksel = prm_read_4(CLOCK_CTRL_PRM_OFFSET + 0x70); 
-	//clksel = bus_read_4(mem_res[PRM_INSTANCE_MEM_REGION], GLOBAL_PRM_OFFSET + 0x70);
 	switch (clksel & 0xC0) {
 		case 0x40:
 			sysclk = oscclk;
@@ -582,15 +580,6 @@
 	 */
 	
 	/* Try MAX_MODULE_ENABLE_WAIT number of times to check if enabled */
-// @TODO XXX trzeba to zrobic
-#if 0
-	if (omap3_clk_wait_on_reg(clk_mem_res, clk_details->idlest_offset,
-	                          (1UL << clk_details->bit_offset), 0) != 0) {
-		printf("Error: failed to enable module with clock %d\n", clkdev->id);
-		return (ETIMEDOUT);
-	}
-#endif
-
 	for( unsigned int i=0; i< MAX_MODULE_ENABLE_WAIT; ++i )
 	{
 		if( ( cm_read_4( clk_details->idlest_offset ) & (1UL << clk_details->bit_offset) ) == 0 )
@@ -761,7 +750,6 @@
 /**
  *	omap3_clk_usbhost_activate - activates a modules iinterface and func clock
  *	@clkdev: pointer to the clock device structure.
- *	@mem_res: array of memory resources mapped when PRCM driver attached
  *	
  *	
  *
@@ -775,7 +763,6 @@
 omap3_clk_hsusbhost_activate(struct ti_clock_dev *clkdev)
 {
 	const struct ti_clk_details* clk_details = omap3_clk_details(clkdev->id);
-	//struct resource* clk_mem_res = mem_res[CM_INSTANCE_MEM_REGION];
 	uint32_t fclken, iclken;
 	unsigned int sysclk;
 
@@ -819,13 +806,6 @@
 	/* Now poll on the IDLEST register to tell us if the module has come up.
 	 * TODO: We need to take into account the parent clocks.
 	 */
-#if 0	
-	if (omap3_clk_wait_on_reg(clk_mem_res, clk_details->idlest_offset, 0x02,
-	    0x00) != 0) {
-		printf("Error: failed to enable module with USB clock %d\n", clkdev->id);
-		return (ETIMEDOUT);
-	}
-#endif
 	for( int i=0; i< MAX_MODULE_ENABLE_WAIT; ++i )
 	{
 		if( ( cm_read_4( clk_details->idlest_offset ) & 0x02 ) == 0x00 )
@@ -840,7 +820,6 @@
 /**
  *	omap3_clk_hsusbhost_deactivate - deactivates a modules clock
  *	@clkdev: pointer to the clock device structure.
- *	@mem_res: array of memory resources mapped when PRCM driver attached
  *	
  *	
  *
@@ -854,7 +833,6 @@
 omap3_clk_hsusbhost_deactivate(struct ti_clock_dev *clkdev )
 {
 	const struct ti_clk_details* clk_details = omap3_clk_details(clkdev->id);
-	//struct resource* clk_mem_res = mem_res[CM_INSTANCE_MEM_REGION]; //@todo remove
 	uint32_t fclken, iclken;
 
 	if (clk_details == NULL)
@@ -924,10 +902,6 @@
 
 
 	/* Wait until the DPLL5 is locked and there is clock activity */
-#if 0
-	return (omap3_clk_wait_on_reg(cm_mem_res, (CLOCK_CTRL_CM_OFFSET + 0x24),
-	                              0x01, 0x01));
-#endif
 	for( int i=0; i< MAX_MODULE_ENABLE_WAIT; ++i )
 	{
 		if( (cm_read_4( (CLOCK_CTRL_CM_OFFSET + 0x24) ) & 0x01 ) == 0x01 )
@@ -967,7 +941,6 @@
 /**
  *	omap3_clk_alwayson_null_func - dummy function for always on clocks
  *	@clkdev: pointer to the clock device structure (ignored)
- *	@mem_res: array of memory resources mapped when PRCM driver attached (ignored)
  *	
  *	
  *

Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c	Fri Aug 17 15:53:43 2012	(r240470)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c	Fri Aug 17 16:11:59 2012	(r240471)
@@ -527,6 +527,7 @@
 
 	/* reading loop */
 	while (1) {
+
 		/* wait for an event */
 		err = ti_i2c_wait(sc, events, &status, timo);
 		if (err != 0) {
@@ -1080,9 +1081,7 @@
 		goto out;
 	}
 
-	/* 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 ;)
 #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 )

Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c	Fri Aug 17 15:53:43 2012	(r240470)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c	Fri Aug 17 16:11:59 2012	(r240471)
@@ -75,9 +75,6 @@
 #include "twl.h"
 #include "twl_vreg.h"
 
-//static int twl_vreg_debug = 10;
-
-
 /*
  * Power Groups bits for the 4030 and 6030 devices
  */
@@ -610,10 +607,11 @@
 	if (!xlocked)
 		TWL_VREG_LOCK_DOWNGRADE(sc);
 
-	//if ((twl_vreg_debug > 1) && !err) todo XXX
+#ifdef DEBUG
 	if (!err)
 		device_printf(sc->sc_dev, "%s : setting voltage to %dmV (vsel: 0x%x)\n",
 		    regulator->name, millivolts, vsel);
+#endif
 
 	return (err);
 }
@@ -691,10 +689,11 @@
 	if (!xlocked)
 		TWL_VREG_LOCK_DOWNGRADE(sc);
 	
-	//if ((twl_vreg_debug > 1) && !err) @todo XXX
+#ifdef DEBUG
 	if (!err)
 		device_printf(sc->sc_dev, "%s : reading voltage is %dmV (vsel: 0x%x)\n",
 		    regulator->name, *millivolts, vsel);
+#endif
 
 	return (err);
 }
@@ -942,25 +941,21 @@
 			
 			LIST_FOREACH(entry, &sc->sc_vreg_list, entries) {
 				if (strcmp(entry->name, name) == 0) {
+					device_printf( sc->sc_dev, "Setting %s voltage to %d\n", entry->name, millivolts );
 					twl_vreg_write_regulator_voltage(sc, entry, millivolts);
 					break;
 				}
 			}
 		}
 	}
-#if 0
-	twl_vreg_set_voltage(sc->sc_dev, "vusb1v5", 0);
-	twl_vreg_set_voltage(sc->sc_dev, "vusb1v8", 0);
-	twl_vreg_set_voltage(sc->sc_dev, "vusb3v1", 0);
-#endif
 	
-//	if (twl_vreg_debug) { @todo XXX
+#ifdef DEBUG
 		LIST_FOREACH(entry, &sc->sc_vreg_list, entries) {
 			err = twl_vreg_read_regulator_voltage(sc, entry, &millivolts);
 			if (!err)
 				device_printf(sc->sc_dev, "%s : %d mV\n", entry->name, millivolts);
 		}
-//	}
+#endif
 
 	return (0);
 }

Modified: soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts	Fri Aug 17 15:53:43 2012	(r240470)
+++ soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts	Fri Aug 17 16:11:59 2012	(r240471)
@@ -159,7 +159,7 @@
 			interrupts = < 12 13 14 15 >;
 			interrupt-parent = <&AINTC>;
 		};
-/*
+
 		mmchs@4809c000 {
 			compatible = "ti,mmchs";
 			reg =<0x4809c000 0x1000 >;
@@ -167,7 +167,7 @@
 			interrupt-parent = <&AINTC>;
 			mmchs-device-id = <1>;
 		};
-*/
+
 		i2c1: i2c@48070000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -180,6 +180,10 @@
 			twl4030@48 {
 				compatible = "ti,twl4030";
 				reg = <0x48>;
+				voltage-regulators =
+					"vusb1v5", "0",
+					"vusb1v8", "0",
+					"vusb3v1", "0";
 			};
 		};
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120817161159.B00E4106566B>