Date: Sun, 19 Aug 2012 14:19:13 +0000 From: aleek@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r240532 - in soc2012/aleek/beaglexm-armv6/sys: arm/ti/twl boot/fdt/dts Message-ID: <20120819141913.4D4FB106564A@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: aleek Date: Sun Aug 19 14:19:12 2012 New Revision: 240532 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240532 Log: minor fixed in TWL Modified: 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/twl/twl_vreg.c ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c Sun Aug 19 11:54:02 2012 (r240531) +++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c Sun Aug 19 14:19:12 2012 (r240532) @@ -598,11 +598,11 @@ if (!xlocked) TWL_VREG_LOCK_DOWNGRADE(sc); -//#ifdef DEBUG +#ifdef DEBUG if (!err) device_printf(sc->sc_dev, "%s : setting voltage to %dmV (vsel: 0x%x)\n", regulator->name, millivolts, vsel); -//#endif +#endif return (err); } @@ -680,11 +680,11 @@ if (!xlocked) TWL_VREG_LOCK_DOWNGRADE(sc); -//#ifdef DEBUG +#ifdef DEBUG if (!err) device_printf(sc->sc_dev, "%s : read voltage is %dmV (vsel: 0x%x)\n", regulator->name, *millivolts, vsel); -//#endif +#endif return (err); } @@ -900,9 +900,37 @@ /* Enable writing to power configuration registers */ if (twl_is_4030(sc->sc_pdev)) { val = 0xC0; - twl_write( sc->sc_pdev, 3, 0x44, &val, 1 ); + if( twl_write( sc->sc_pdev, 3, 0x44, &val, 1 ) != 0 ) + { + device_printf( sc->sc_dev, "Unable to unlock PROTECT_KEY\n" ); + return 0; // @todo XXX return sth else + } val = 0x0C; - twl_write( sc->sc_pdev, 3, 0x44, &val, 1 ); + if( twl_write( sc->sc_pdev, 3, 0x44, &val, 1 ) != 0 ) + { + device_printf( sc->sc_dev, "Unable to unlock PROTECT_KEY\n" ); + return 0; + } + + val = 0x01; + if( twl_write( sc->sc_pdev, 0, 0xFD, &val, 1 ) != 0 ) + { + device_printf( sc->sc_dev, "Unable to power USB PHY\n" ); + return 0; + } + if( twl_read( sc->sc_pdev, 3, 0x46, &val, 1 ) != 0 ) + { + device_printf( sc->sc_dev, "Could not read P1_SW_EVENTS register\n" ); + return 0; + } + val |= 0x06; + if( twl_write( sc->sc_pdev, 3, 0x46, &val, 1 ) != 0 ) + { + device_printf( sc->sc_dev, "Could not write P1_SW_EVENTS register\n" ); + return 0; + } + + } Modified: soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts ============================================================================== --- soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Sun Aug 19 11:54:02 2012 (r240531) +++ soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Sun Aug 19 14:19:12 2012 (r240532) @@ -184,13 +184,22 @@ compatible = "ti,twl4030"; reg = < 0x48 >; voltage-regulators = - "vusb1v5", "1500", - "vusb1v8", "1800", - "vusb3v1", "3100", + "vaux1", "0", + "vaux2", "0", + "vaux3", "0", + "vaux4", "0", + /*"vmmc1", "0",*/ + /*"vmmc2", "0",*/ + /*"vpll1", "0",*/ + "vpll2", "0", + "vsim", "0", + "vdac", "0", + /*"vintana1", "0",*/ + "vintana2", "0", + /*"vintdig", "0",*/ "vusb1v5", "0", "vusb1v8", "0", - "vusb3v1", "0", - "vaux2", "0"; + "vusb3v1", "0"; }; }; /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120819141913.4D4FB106564A>