[PATCH] ARMV7: OMAP3: BeagleBoard: Enable pullups on i2c2.

117 views
Skip to first unread message

Jason Kridner

unread,
Nov 5, 2010, 1:53:57 AM11/5/10
to u-b...@lists.denx.de, beagl...@googlegroups.com, jkri...@beagleboard.org, Steve Kipisz
From: Steve Kipisz <s-ki...@ti.com>


Signed-off-by: Jason Kridner <jkri...@beagleboard.org>
---
arch/arm/include/asm/arch-omap3/omap3.h | 9 +++++++++
board/ti/beagle/beagle.c | 3 +++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap3/omap3.h b/arch/arm/include/asm/arch-omap3/omap3.h
index 3957c79..1860dff 100644
--- a/arch/arm/include/asm/arch-omap3/omap3.h
+++ b/arch/arm/include/asm/arch-omap3/omap3.h
@@ -50,6 +50,15 @@
/* CONTROL */
#define OMAP34XX_CTRL_BASE (OMAP34XX_L4_IO_BASE + 0x2000)

+/* Signal Integrity Parameter Control Registers */
+#define CONTROL_PROG_IO0 0x48002444
+#define CONTROL_PROG_IO1 0x48002448
+#define CONTROL_PROG_IO2 0x48002408
+#define CONTROL_PROG_IO_WKUP1 0x48002A80
+
+/* 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 dd7b6b5..6074eca 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -160,6 +160,9 @@ int misc_init_r(void)
struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;

+ /* Enable i2c2 pullup resisters */
+ *(ulong *)(CONTROL_PROG_IO1) &= ~(PRG_I2C2_PULLUPRESX);
+
switch (get_board_revision()) {
case REVISION_AXBX:
printf("Beagle Rev Ax/Bx\n");
--
1.5.6.4

Premi, Sanjeev

unread,
Nov 5, 2010, 7:58:24 AM11/5/10
to Jason Kridner, u-b...@lists.denx.de, beagl...@googlegroups.com, Kipisz, Steven
> -----Original Message-----
> From: u-boot-...@lists.denx.de
> [mailto:u-boot-...@lists.denx.de] On Behalf Of Jason Kridner
> Sent: Friday, November 05, 2010 11:24 AM
> To: u-b...@lists.denx.de; beagl...@googlegroups.com
> Cc: Kipisz, Steven
> Subject: [U-Boot] [PATCH] ARMV7: OMAP3: BeagleBoard: Enable
> pullups on i2c2.
>
> From: Steve Kipisz <s-ki...@ti.com>
>
>
[sp] Description missing.


> Signed-off-by: Jason Kridner <jkri...@beagleboard.org>
> ---
> arch/arm/include/asm/arch-omap3/omap3.h | 9 +++++++++
> board/ti/beagle/beagle.c | 3 +++
> 2 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-omap3/omap3.h
> b/arch/arm/include/asm/arch-omap3/omap3.h
> index 3957c79..1860dff 100644
> --- a/arch/arm/include/asm/arch-omap3/omap3.h
> +++ b/arch/arm/include/asm/arch-omap3/omap3.h

> @@ -50,6 +50,15 @@/ctr


> /* CONTROL */
> #define OMAP34XX_CTRL_BASE (OMAP34XX_L4_IO_BASE + 0x2000)
>
> +/* Signal Integrity Parameter Control Registers */
> +#define CONTROL_PROG_IO0 0x48002444
> +#define CONTROL_PROG_IO1 0x48002448
> +#define CONTROL_PROG_IO2 0x48002408
> +#define CONTROL_PROG_IO_WKUP1 0x48002A80

[sp] Would be better if they are defined off OMAP34XX_CTRL_BASE
defined just above.

> +
> +/* 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 dd7b6b5..6074eca 100644
> --- a/board/ti/beagle/beagle.c
> +++ b/board/ti/beagle/beagle.c
> @@ -160,6 +160,9 @@ int misc_init_r(void)
> struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
> struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
>
> + /* Enable i2c2 pullup resisters */
> + *(ulong *)(CONTROL_PROG_IO1) &= ~(PRG_I2C2_PULLUPRESX);

[sp] Direct pointer access is not a good practice.
Can you look at struct ctrl and see whether it can be augmented/
similar approach can be used?

> +
> switch (get_board_revision()) {
> case REVISION_AXBX:
> printf("Beagle Rev Ax/Bx\n");
> --
> 1.5.6.4
>

> _______________________________________________
> U-Boot mailing list
> U-B...@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Jason Kridner

unread,
Mar 3, 2011, 11:44:27 AM3/3/11
to u-b...@lists.denx.de, jkri...@beagleboard.org, beagl...@googlegroups.com, Steve Kipisz
From: Steve Kipisz <s-ki...@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

Signed-off-by: Jason Kridner <jkri...@beagleboard.org>
---

arch/arm/include/asm/arch-omap3/omap3.h | 16 ++++++++++++++++
board/ti/beagle/beagle.c | 4 ++++
2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap3/omap3.h b/arch/arm/include/asm/arch-omap3/omap3.h
index 3957c79..88454f2 100644
--- a/arch/arm/include/asm/arch-omap3/omap3.h
+++ b/arch/arm/include/asm/arch-omap3/omap3.h
@@ -50,6 +50,22 @@


/* 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..7ba98f1 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 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:
--
1.5.6.4

Jason Kridner

unread,
Mar 3, 2011, 11:59:22 AM3/3/11
to u-b...@lists.denx.de, jkri...@beagleboard.org, beagl...@googlegroups.com, Steve Kipisz
From: Steve Kipisz <s-ki...@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 <jkri...@beagleboard.org>
---

arch/arm/include/asm/arch-omap3/omap3.h | 14 ++++++++++++++
board/ti/beagle/beagle.c | 4 ++++
2 files changed, 18 insertions(+), 0 deletions(-)

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;

Paulraj, Sandeep

unread,
Apr 18, 2011, 5:36:15 PM4/18/11
to Jason Kridner, u-b...@lists.denx.de, Kipisz, Steven, beagl...@googlegroups.com

>
> From: Steve Kipisz <s-ki...@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 <jkri...@beagleboard.org>

Pushed after making changes to the patch header

Reply all
Reply to author
Forward
0 new messages