socsvn commit: r240105 - in soc2012/aleek/beaglexm-armv6/sys:
arm/conf arm/ti arm/ti/twl boot/fdt/dts
aleek at FreeBSD.org
aleek at FreeBSD.org
Sun Aug 5 15:29:50 UTC 2012
Author: aleek
Date: Sun Aug 5 15:29:47 2012
New Revision: 240105
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240105
Log:
added registers map for i2c OMAP3
Modified:
soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM
soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.h
soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_clks.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/conf/BEAGLEBOARD-XM
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Sun Aug 5 14:48:55 2012 (r240104)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Sun Aug 5 15:29:47 2012 (r240105)
@@ -82,7 +82,7 @@
device mmcsd # mmc/sd flash cards
# Boot device is 2nd slice on MMC/SD card
-options ROOTDEVNAME=\"msdosfs:mmcsd0s3\"
+options ROOTDEVNAME=\"msdosfs:mmcsd0s2\"
# Console and misc
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.h
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.h Sun Aug 5 14:48:55 2012 (r240104)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.h Sun Aug 5 15:29:47 2012 (r240105)
@@ -34,6 +34,8 @@
* Simply contains register bit flags.
*/
+#if defined(SOC_TI_AM37X) || defined(SOC_OMAP4)
+
/*
* OMAP4 I2C Registers, Summary 1
*/
@@ -109,5 +111,78 @@
#define I2C_REG_IRQENABLE_CLR 0x30
+#elif defined( SOC_TI_AM37X ) || defined( SOC_OMAP3 )
+
+
+#define I2C_REV 0x00
+#define I2C_IE 0x04
+#define I2C_IE_XDR (1UL << 14) /* Transmit draining interrupt */
+#define I2C_IE_RDR (1UL << 13) /* Receive draining interrupt */
+#define I2C_IE_AAS (1UL << 9) /* Addressed as Slave interrupt */
+#define I2C_IE_BF (1UL << 8) /* Bus Free interrupt */
+#define I2C_IE_AERR (1UL << 7) /* Access Error interrupt */
+#define I2C_IE_STC (1UL << 6) /* Start Condition interrupt */
+#define I2C_IE_GC (1UL << 5) /* General Call interrupt */
+#define I2C_IE_XRDY (1UL << 4) /* Transmit Data Ready interrupt */
+#define I2C_IE_RRDY (1UL << 3) /* Receive Data Ready interrupt */
+#define I2C_IE_ARDY (1UL << 2) /* Register Access Ready interrupt */
+#define I2C_IE_NACK (1UL << 1) /* No Acknowledgment interrupt */
+#define I2C_IE_AL (1UL << 0) /* Arbitration Lost interrupt */
+#define I2C_STAT 0x08
+#define I2C_STAT_XDR (1UL << 14)
+#define I2C_STAT_RDR (1UL << 13)
+#define I2C_STAT_BB (1UL << 12)
+#define I2C_STAT_ROVR (1UL << 11)
+#define I2C_STAT_XUDF (1UL << 10)
+#define I2C_STAT_AAS (1UL << 9)
+#define I2C_STAT_BF (1UL << 8)
+#define I2C_STAT_AERR (1UL << 7)
+#define I2C_STAT_STC (1UL << 6)
+#define I2C_STAT_GC (1UL << 5)
+#define I2C_STAT_XRDY (1UL << 4)
+#define I2C_STAT_RRDY (1UL << 3)
+#define I2C_STAT_ARDY (1UL << 2)
+#define I2C_STAT_NACK (1UL << 1)
+#define I2C_STAT_AL (1UL << 0)
+#define I2C_SYSS 0x10
+#define I2C_BUF 0x14
+#define I2C_CNT 0x18
+#define I2C_DATA 0x1C
+#define I2C_CON 0x24
+#define I2C_CON_I2C_EN (1UL << 15)
+#define I2C_CON_OPMODE_STD (0UL << 12)
+#define I2C_CON_OPMODE_HS (1UL << 12)
+#define I2C_CON_OPMODE_SCCB (2UL << 12)
+#define I2C_CON_OPMODE_MASK (3UL << 13)
+#define I2C_CON_I2C_STB (1UL << 11)
+#define I2C_CON_MST (1UL << 10)
+#define I2C_CON_TRX (1UL << 9)
+#define I2C_CON_XSA (1UL << 8)
+#define I2C_CON_XOA0 (1UL << 7)
+#define I2C_CON_XOA1 (1UL << 6)
+#define I2C_CON_XOA2 (1UL << 5)
+#define I2C_CON_XOA3 (1UL << 4)
+#define I2C_CON_STP (1UL << 1)
+#define I2C_CON_STT (1UL << 0)
+
+#define I2C_OA0 0x28
+#define I2C_SA 0x2C
+#define I2C_PSC 0x30
+#define I2C_SCLL 0x34
+#define I2C_SCLH 0x38
+#define I2C_SYSTEST 0x3C
+#define I2C_BUFSTAT 0x40
+#define I2C_OA1 0x44
+#define I2C_OA2 0x48
+#define I2C_OA3 0x4C
+#define I2C_ACTOA 0x50
+#define I2C_SBLOCK 0x54
+
+#define I2C_OMAP3_SYSC 0x20
+#define I2C_OMAP4_SYSC 0x10
+
+
+#endif
+
#endif /* _TI_I2C_H_ */
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_clks.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_clks.c Sun Aug 5 14:48:55 2012 (r240104)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_clks.c Sun Aug 5 15:29:47 2012 (r240105)
@@ -75,7 +75,7 @@
#include "twl_clks.h"
-static int twl_clks_debug = 1; //@todo XXX make it #if DEBUG
+//static int twl_clks_debug = 1; //@todo XXX make it #if DEBUG
/*
@@ -336,7 +336,8 @@
if (!xlocked)
TWL_CLKS_LOCK_DOWNGRADE(sc);
- if ((twl_clks_debug > 1) && !err)
+ //if ((twl_clks_debug > 1) && !err) //@todo XXX
+ if (!err)
device_printf(sc->sc_dev, "%s : %sabled\n", clk->name,
enable ? "en" : "dis");
@@ -556,14 +557,14 @@
TWL_CLKS_XUNLOCK(sc);
- if (twl_clks_debug) {
+ //if (twl_clks_debug) {//@todo XXX
LIST_FOREACH(entry, &sc->sc_clks_list, link) {
err = twl_clks_is_enabled(sc->sc_dev, entry->name, &enable);
if (!err)
device_printf(sc->sc_dev, "%s : %s\n", entry->name,
enable ? "on" : "off");
}
- }
+ //}
return (0);
}
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 5 14:48:55 2012 (r240104)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c Sun Aug 5 15:29:47 2012 (r240105)
@@ -75,7 +75,7 @@
#include "twl.h"
#include "twl_vreg.h"
-static int twl_vreg_debug = 10;
+//static int twl_vreg_debug = 10;
/*
@@ -596,7 +596,8 @@
if (!xlocked)
TWL_VREG_LOCK_DOWNGRADE(sc);
- if ((twl_vreg_debug > 1) && !err)
+ //if ((twl_vreg_debug > 1) && !err) todo XXX
+ if (!err)
device_printf(sc->sc_dev, "%s : setting voltage to %dmV (vsel: 0x%x)\n",
regulator->name, millivolts, vsel);
@@ -669,7 +670,8 @@
if (!xlocked)
TWL_VREG_LOCK_DOWNGRADE(sc);
- if ((twl_vreg_debug > 1) && !err)
+ //if ((twl_vreg_debug > 1) && !err) @todo XXX
+ if (!err)
device_printf(sc->sc_dev, "%s : reading voltage is %dmV (vsel: 0x%x)\n",
regulator->name, *millivolts, vsel);
@@ -931,13 +933,13 @@
}
- if (twl_vreg_debug) {
+// if (twl_vreg_debug) { @todo XXX
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);
}
- }
+// }
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 5 14:48:55 2012 (r240104)
+++ soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Sun Aug 5 15:29:47 2012 (r240105)
@@ -195,9 +195,9 @@
interrupts = <56>;
interrupt-parent = <&AINTC>;
i2c-device-id = <1>;
- pmic at 48 {
+ pmic at 24 {
compatible = "ti,twl4030";
- reg = <0x48>;
+ reg = <0x24>;
};
};
More information about the svn-soc-all
mailing list