Patchwork [U-Boot,v3] OMAP3: BeagleBoard: Enable pullups on i2c2.

login
register
mail settings
Submitter Jason Kridner
Date March 3, 2011, 4:59 p.m.
Message ID <1299171562-4581-1-git-send-email-jkridner@beagleboard.org>
Download mbox | patch
Permalink /patch/85301/
State Accepted
Commit d4e53f063dd25e071444b87303573e7440deeb89
Delegated to: Sandeep Paulraj
Headers show

Comments

Jason Kridner - March 3, 2011, 4:59 p.m.
From: Steve Kipisz <s-kipisz2@ti.com>

This allows the reading of EEPROMS on the expansion bus without adding
external pull-ups.
---
v2 updates
 * Updated per http://patchwork.ozlabs.org/patch/71997/
 * Added description
 * Used OMAP34XX_CTRL_BASE
 * Used structure and writel to perform write

v3 updates
 * Included v3 in the subject line
 * Fixed structure name typo that got messed up in generating patch
 * Removed some extraneous blank lines

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
---
 arch/arm/include/asm/arch-omap3/omap3.h |   14 ++++++++++++++
 board/ti/beagle/beagle.c                |    4 ++++
 2 files changed, 18 insertions(+), 0 deletions(-)
Sandeep Paulraj - April 18, 2011, 9:36 p.m.
> 
> From: Steve Kipisz <s-kipisz2@ti.com>
> 
> This allows the reading of EEPROMS on the expansion bus without adding
> external pull-ups.
> ---
> v2 updates
>  * Updated per http://patchwork.ozlabs.org/patch/71997/
>  * Added description
>  * Used OMAP34XX_CTRL_BASE
>  * Used structure and writel to perform write
> 
> v3 updates
>  * Included v3 in the subject line
>  * Fixed structure name typo that got messed up in generating patch
>  * Removed some extraneous blank lines
> 
> Signed-off-by: Jason Kridner <jkridner@beagleboard.org>

Pushed after making changes to the patch header

Patch

diff --git a/arch/arm/include/asm/arch-omap3/omap3.h b/arch/arm/include/asm/arch-omap3/omap3.h
index 3957c79..cc2b541 100644
--- a/arch/arm/include/asm/arch-omap3/omap3.h
+++ b/arch/arm/include/asm/arch-omap3/omap3.h
@@ -50,6 +50,20 @@ 
 /* CONTROL */
 #define OMAP34XX_CTRL_BASE		(OMAP34XX_L4_IO_BASE + 0x2000)
 
+#ifndef __ASSEMBLY__
+/* Signal Integrity Parameter Control Registers */
+struct control_prog_io {
+	unsigned char res[0x408];
+	unsigned int io2;		/* 0x408 */
+	unsigned char res2[0x38];
+	unsigned int io0;		/* 0x444 */
+	unsigned int io1;		/* 0x448 */
+};
+#endif /* __ASSEMBLY__ */
+
+/* Bit definition for CONTROL_PROG_IO1 */
+#define PRG_I2C2_PULLUPRESX		0x00000001
+
 /* UART */
 #define OMAP34XX_UART1			(OMAP34XX_L4_IO_BASE + 0x6a000)
 #define OMAP34XX_UART2			(OMAP34XX_L4_IO_BASE + 0x6c000)
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 929461c..3884ca1 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -148,6 +148,10 @@  int misc_init_r(void)
 {
 	struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
 	struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
+	struct control_prog_io *prog_io_base = (struct gpio *)OMAP34XX_CTRL_BASE;
+
+	/* Enable i2c2 pullup resisters */
+	writel(~(PRG_I2C2_PULLUPRESX), &prog_io_base->io1);
 
 	switch (get_board_revision()) {
 	case REVISION_AXBX: