[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot / 0004-OMAP3-BeagleBoard-Enable-pullups-on-i2c2.patch
1 From 6859e4b88c405ed40c898d259227f158da5f867a Mon Sep 17 00:00:00 2001
2 From: Steve Kipisz <s-kipisz2@ti.com>
3 Date: Thu, 5 Aug 2010 10:36:07 -0500
4 Subject: [PATCH 04/16] OMAP3: BeagleBoard: Enable pullups on i2c2.
6 This allows the reading of EEPROMS on the expansion bus without adding
7 external pull-ups.
8 ---
9 v2 updates
10 * Updated per http://patchwork.ozlabs.org/patch/71997/
11 * Added description
12 * Used OMAP34XX_CTRL_BASE
13 * Used structure and writel to perform write
15 v3 updates
16 * Included v3 in the subject line
17 * Fixed structure name typo that got messed up in generating patch
18 * Removed some extraneous blank lines
20 v4 updates
21 * Fixed typo in typecast
22 ---
23 arch/arm/include/asm/arch-omap3/omap3.h | 14 ++++++++++++++
24 board/ti/beagle/beagle.c | 4 ++++
25 2 files changed, 18 insertions(+), 0 deletions(-)
27 diff --git a/arch/arm/include/asm/arch-omap3/omap3.h b/arch/arm/include/asm/arch-omap3/omap3.h
28 index 3957c79..cc2b541 100644
29 --- a/arch/arm/include/asm/arch-omap3/omap3.h
30 +++ b/arch/arm/include/asm/arch-omap3/omap3.h
31 @@ -50,6 +50,20 @@
32 /* CONTROL */
33 #define OMAP34XX_CTRL_BASE (OMAP34XX_L4_IO_BASE + 0x2000)
35 +#ifndef __ASSEMBLY__
36 +/* Signal Integrity Parameter Control Registers */
37 +struct control_prog_io {
38 + unsigned char res[0x408];
39 + unsigned int io2; /* 0x408 */
40 + unsigned char res2[0x38];
41 + unsigned int io0; /* 0x444 */
42 + unsigned int io1; /* 0x448 */
43 +};
44 +#endif /* __ASSEMBLY__ */
45 +
46 +/* Bit definition for CONTROL_PROG_IO1 */
47 +#define PRG_I2C2_PULLUPRESX 0x00000001
48 +
49 /* UART */
50 #define OMAP34XX_UART1 (OMAP34XX_L4_IO_BASE + 0x6a000)
51 #define OMAP34XX_UART2 (OMAP34XX_L4_IO_BASE + 0x6c000)
52 diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
53 index 929461c..9d03b24 100644
54 --- a/board/ti/beagle/beagle.c
55 +++ b/board/ti/beagle/beagle.c
56 @@ -148,6 +148,10 @@ int misc_init_r(void)
57 {
58 struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
59 struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
60 + struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE;
61 +
62 + /* Enable i2c2 pullup resisters */
63 + writel(~(PRG_I2C2_PULLUPRESX), &prog_io_base->io1);
65 switch (get_board_revision()) {
66 case REVISION_AXBX:
67 --
68 1.6.6.1