Skip to contentSkip to conversation

OMAP3: Clean up board files

U-Boot dirk.behme at googlemail.com 2 participants 2 messages Nov 15, 2008 – Nov 20, 2008

lore
Share & tools
lore
#0 lore raw

- Use readx/writex instead of direct pointer access
- Replace hardcoded values by macros
- Minor space to tab conversion

No functional change.

---
 board/omap3/beagle/beagle.c        |   78 +++++++++++++++++++-------------
 board/omap3/overo/overo.c          |   90 ++++++++++++++++++++++---------------
 include/asm-arm/arch-omap3/omap3.h |   70 ++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+), 67 deletions(-)
board/omap3/beagle/beagle.c +48 -30
Index: u-boot-arm/board/omap3/beagle/beagle.c
===================================================================
@@ -3,12 +3,12 @@
  * Texas Instruments, <www.ti.com>
  *
  * Author :
- *      Sunil Kumar <[email protected]>
- *      Shashi Ranjan <[email protected]>
+ *	Sunil Kumar <[email protected]>
+ *	Shashi Ranjan <[email protected]>
  *
  * Derived from Beagle Board and 3430 SDP code by
- *      Richard Woodruff <[email protected]>
- *      Syed Mohammed Khasim <[email protected]>
+ *	Richard Woodruff <[email protected]>
+ *	Syed Mohammed Khasim <[email protected]>
  *
  *
  * See file CREDITS for list of people who contributed to this
@@ -56,41 +56,59 @@ int board_init(void)
 
 /******************************************************************************
  * Routine: misc_init_r
- * Description: Init ethernet (done here so udelay works)
+ * Description: Configure power supply
  *****************************************************************************/
 int misc_init_r(void)
 {
 
 	unsigned char byte;
+	unsigned int *gpio5_base = (unsigned int *)OMAP34XX_GPIO5_BASE;
+	unsigned int *gpio6_base = (unsigned int *)OMAP34XX_GPIO6_BASE;
 
 #ifdef CONFIG_DRIVER_OMAP34XX_I2C
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
-	/* set vaux3 to 2.8V */
-	byte = 0x20;
-	i2c_write(0x4B, 0x7A, 1, &byte, 1);
-	byte = 0x03;
-	i2c_write(0x4B, 0x7D, 1, &byte, 1);
-
-	/* set vpll2 to 1.8V */
-	byte = 0xE0;
-	i2c_write(0x4B, 0x8E, 1, &byte, 1);
-	byte = 0x05;
-	i2c_write(0x4B, 0x91, 1, &byte, 1);
+
+	/*
+	 * Configure OMAP3 supply voltages in power management
+	 * companion chip.
+	 */
+
+	/* set VAUX3 to 2.8V */
+	byte = DEV_GRP_P1;
+	i2c_write(PWRMGT_ADDR_ID4, VAUX3_DEV_GRP, 1, &byte, 1);
+	byte = VAUX3_VSEL_28;
+	i2c_write(PWRMGT_ADDR_ID4, VAUX3_DEDICATED, 1, &byte, 1);
+
+	/* set VPLL2 to 1.8V */
+	byte = DEV_GRP_ALL;
+	i2c_write(PWRMGT_ADDR_ID4, VPLL2_DEV_GRP, 1, &byte, 1);
+	byte = VPLL2_VSEL_18;
+	i2c_write(PWRMGT_ADDR_ID4, VPLL2_DEDICATED, 1, &byte, 1);
 
 	/* set VDAC to 1.8V */
-	byte = 0x20;
-	i2c_write(0x4B, 0x96, 1, &byte, 1);
-	byte = 0x03;
-	i2c_write(0x4B, 0x99, 1, &byte, 1);
-
-	byte = 0x33;
-	i2c_write(0x4A, 0xEE, 1, &byte, 1);
-
-	*((uint *) 0x49058034) = 0xFFFFFAF9;
-	*((uint *) 0x49056034) = 0x0F9F0FFF;
-	*((uint *) 0x49058094) = 0x00000506;
-	*((uint *) 0x49056094) = 0xF060F000;
+	byte = DEV_GRP_P1;
+	i2c_write(PWRMGT_ADDR_ID4, VDAC_DEV_GRP, 1, &byte, 1);
+	byte = VDAC_VSEL_18;
+	i2c_write(PWRMGT_ADDR_ID4, VDAC_DEDICATED, 1, &byte, 1);
+
+	/* enable LED */
+	byte = LEDBPWM | LEDAPWM | LEDBON | LEDAON;
+	i2c_write(PWRMGT_ADDR_ID3, LEDEN, 1, &byte, 1);
+
+	/* Configure GPIOs to output */
+	writel(~((GPIO10) | GPIO9 | GPIO3 | GPIO2),
+		gpio6_base + OFFS(GPIO_OE));
+	writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
+		GPIO15 | GPIO14 | GPIO13 | GPIO12),
+		gpio5_base + OFFS(GPIO_OE));
+
+	/* Set GPIOs */
+	writel(GPIO10 | GPIO9 | GPIO3 | GPIO2,
+		gpio6_base + OFFS(GPIO_SETDATAOUT));
+	writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
+		GPIO15 | GPIO14 | GPIO13 | GPIO12,
+		gpio5_base + OFFS(GPIO_SETDATAOUT));
 
 	return 0;
 }
@@ -98,8 +116,8 @@ int misc_init_r(void)
 /******************************************************************************
  * Routine: set_muxconf_regs
  * Description: Setting up the configuration Mux registers specific to the
- *              hardware. Many pins need to be moved from protect to primary
- *              mode.
+ *		hardware. Many pins need to be moved from protect to primary
+ *		mode.
  *****************************************************************************/
 void set_muxconf_regs(void)
 {
board/omap3/overo/overo.c +54 -36

119 lines not on this page · raw message

include/asm-arm/arch-omap3/omap3.h +69 -1

86 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · dirk.behme at googlemail.com

- Use readx/writex instead of direct pointer access
- Replace hardcoded values by macros
- Minor space to tab conversion

No functional change.

Quoted 8 lines
---
 board/omap3/beagle/beagle.c        |   78 +++++++++++++++++++-------------
 board/omap3/overo/overo.c          |   90 ++++++++++++++++++++++---------------
 include/asm-arm/arch-omap3/omap3.h |   70 ++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+), 67 deletions(-)

apply to u-boot-arm/omap3