diff options
| author | Koen Kooi <koen@openembedded.org> | 2010-05-03 13:19:06 +0200 |
|---|---|---|
| committer | Koen Kooi <koen@openembedded.org> | 2010-05-03 13:20:48 +0200 |
| commit | 3c7417183b5d6dd7167a1cf71405e38c230ea55d (patch) | |
| tree | d2e0fc19dda658778cb29e880137d02a63d35d5c /recipes | |
| parent | 041d617c483bf1479bc2b5667febb8f5cec7c636 (diff) | |
u-boot git: update beagleboard patches, rebase onto denx git
Diffstat (limited to 'recipes')
38 files changed, 2836 insertions, 46 deletions
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0001-OMAP3-enable-i2c-bus-switching-for-Beagle-and-Overo.patch b/recipes/u-boot/u-boot-git/beagleboard/0001-OMAP3-enable-i2c-bus-switching-for-Beagle-and-Overo.patch new file mode 100644 index 0000000000..921ca10cfe --- /dev/null +++ b/recipes/u-boot/u-boot-git/beagleboard/0001-OMAP3-enable-i2c-bus-switching-for-Beagle-and-Overo.patch @@ -0,0 +1,52 @@ +From fc313d72cbfd788f23a7623d0b8cd9c2af329b7b Mon Sep 17 00:00:00 2001 +From: Steve Sakoman <steve@sakoman.com> +Date: Wed, 10 Feb 2010 13:39:40 -0800 +Subject: [PATCH 01/37] OMAP3: enable i2c bus switching for Beagle and Overo + +--- + drivers/i2c/omap24xx_i2c.c | 6 ++++++ + include/configs/omap3_beagle.h | 1 + + include/configs/omap3_overo.h | 1 + + 3 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c +index ff18991..30a8b4c 100644 +--- a/drivers/i2c/omap24xx_i2c.c ++++ b/drivers/i2c/omap24xx_i2c.c +@@ -435,3 +435,9 @@ int i2c_set_bus_num(unsigned int bus) + + return 0; + } ++ ++int i2c_get_bus_num(void) ++{ ++ return (int) current_bus; ++} ++ +diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h +index 08d79ac..87e3dd0 100644 +--- a/include/configs/omap3_beagle.h ++++ b/include/configs/omap3_beagle.h +@@ -146,6 +146,7 @@ + #define CONFIG_SYS_I2C_BUS 0 + #define CONFIG_SYS_I2C_BUS_SELECT 1 + #define CONFIG_DRIVER_OMAP34XX_I2C 1 ++#define CONFIG_I2C_MULTI_BUS 1 + + /* + * TWL4030 +diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h +index a43500b..0d24758 100644 +--- a/include/configs/omap3_overo.h ++++ b/include/configs/omap3_overo.h +@@ -117,6 +117,7 @@ + #define CONFIG_SYS_I2C_BUS 0 + #define CONFIG_SYS_I2C_BUS_SELECT 1 + #define CONFIG_DRIVER_OMAP34XX_I2C 1 ++#define CONFIG_I2C_MULTI_BUS 1 + + /* + * TWL4030 +-- +1.6.6.1 + diff --git a/recipes/u-boot/u-boot-git/beagleboard/0002-OMAP3-add-board-revision-detection-for-Overo.patch b/recipes/u-boot/u-boot-git/beagleboard/0002-OMAP3-add-board-revision-detection-for-Overo.patch new file mode 100644 index 0000000000..255d72574c --- /dev/null +++ b/recipes/u-boot/u-boot-git/beagleboard/0002-OMAP3-add-board-revision-detection-for-Overo.patch @@ -0,0 +1,187 @@ +From 59c9245c9a52954c8c084e257bbe55443201614b Mon Sep 17 00:00:00 2001 +From: Steve Sakoman <steve@sakoman.com> +Date: Wed, 10 Feb 2010 14:40:56 -0800 +Subject: [PATCH 02/37] OMAP3: add board revision detection for Overo + +--- + board/overo/overo.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++ + board/overo/overo.h | 43 +++++++++++++++++++++--- + 2 files changed, 127 insertions(+), 6 deletions(-) + +diff --git a/board/overo/overo.c b/board/overo/overo.c +index e85be7d..3df1a12 100644 +--- a/board/overo/overo.c ++++ b/board/overo/overo.c +@@ -61,11 +61,101 @@ int board_init(void) + } + + /* ++ * Routine: get_sdio2_config ++ * Description: Return information about the wifi module connection ++ * Returns 0 if the module connects though a level translator ++ * Returns 1 if the module connects directly ++ */ ++int get_sdio2_config(void) { ++ int sdio_direct; ++ ++ if (!omap_request_gpio(130) && !omap_request_gpio(139)){ ++ ++ omap_set_gpio_direction(130, 0); ++ omap_set_gpio_direction(139, 1); ++ ++ sdio_direct = 1; ++ omap_set_gpio_dataout(130, 0); ++ if (omap_get_gpio_datain(139) == 0) { ++ omap_set_gpio_dataout(130, 1); ++ if (omap_get_gpio_datain(139) == 1) ++ sdio_direct = 0; ++ } ++ ++ omap_free_gpio(130); ++ omap_free_gpio(139); ++ } else { ++ printf("Error: unable to acquire sdio2 clk GPIOs\n"); ++ sdio_direct=-1; ++ } ++ ++ return sdio_direct; ++} ++ ++/* ++ * Routine: get_board_revision ++ * Description: Returns the board revision ++ */ ++int get_board_revision(void) { ++ int revision; ++ ++ if (!omap_request_gpio(126) && !omap_request_gpio(127) && ++ !omap_request_gpio(128) && !omap_request_gpio(129)){ ++ ++ omap_set_gpio_direction(126, 1); ++ omap_set_gpio_direction(127, 1); ++ omap_set_gpio_direction(128, 1); ++ omap_set_gpio_direction(129, 1); ++ ++ revision = 0; ++ if (omap_get_gpio_datain(126) == 0) ++ revision += 1; ++ if (omap_get_gpio_datain(127) == 0) ++ revision += 2; ++ if (omap_get_gpio_datain(128) == 0) ++ revision += 4; ++ if (omap_get_gpio_datain(129) == 0) ++ revision += 8; ++ ++ omap_free_gpio(126); ++ omap_free_gpio(127); ++ omap_free_gpio(128); ++ omap_free_gpio(129); ++ } else { ++ printf("Error: unable to acquire board revision GPIOs\n"); ++ revision=-1; ++ } ++ ++ return revision; ++} ++ ++/* + * Routine: misc_init_r + * Description: Configure board specific parts + */ + int misc_init_r(void) + { ++ printf("Board revision: "); ++ switch (get_board_revision()) { ++ case 0: ++ case 1: ++ switch (get_sdio2_config()) { ++ case 0: ++ printf(" 0\n"); ++ MUX_OVERO_SDIO2_TRANSCEIVER(); ++ break; ++ case 1: ++ printf(" 1\n"); ++ MUX_OVERO_SDIO2_DIRECT(); ++ break; ++ default: ++ printf(" unknown\n"); ++ } ++ break; ++ default: ++ printf(" unsupported\n"); ++ } ++ + twl4030_power_init(); + twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); + +diff --git a/board/overo/overo.h b/board/overo/overo.h +index 1873523..e120e09 100644 +--- a/board/overo/overo.h ++++ b/board/overo/overo.h +@@ -206,12 +206,12 @@ const omap3_sysinfo sysinfo = { + MUX_VAL(CP(MMC1_DAT1), (IEN | PTU | EN | M0)) /*MMC1_DAT1*/\ + MUX_VAL(CP(MMC1_DAT2), (IEN | PTU | EN | M0)) /*MMC1_DAT2*/\ + MUX_VAL(CP(MMC1_DAT3), (IEN | PTU | EN | M0)) /*MMC1_DAT3*/\ +- MUX_VAL(CP(MMC1_DAT4), (IEN | PTU | EN | M0)) /*MMC1_DAT4*/\ +- MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M0)) /*MMC1_DAT5*/\ +- MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\ +- MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\ ++ MUX_VAL(CP(MMC1_DAT4), (IEN | PTU | EN | M4)) /*GPIO_126*/\ ++ MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M4)) /*GPIO_127*/\ ++ MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M4)) /*GPIO_128*/\ ++ MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M4)) /*GPIO_129*/\ + /*Wireless LAN */\ +- MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M0)) /*MMC2_CLK*/\ ++ MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\ + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M0)) /*MMC2_CMD*/\ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M0)) /*MMC2_DAT0*/\ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M0)) /*MMC2_DAT1*/\ +@@ -220,7 +220,7 @@ const omap3_sysinfo sysinfo = { + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT0*/\ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT1*/\ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M1)) /*MMC2_DIR_CMD*/\ +- MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M1)) /*MMC2_CLKIN*/\ ++ MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ + /*Bluetooth*/\ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M1)) /*UART2_CTS*/\ + MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M1)) /*UART2_RTS*/\ +@@ -387,5 +387,36 @@ const omap3_sysinfo sysinfo = { + MUX_VAL(CP(SDRC_CKE0), (IDIS | PTU | EN | M0)) /*sdrc_cke0*/\ + MUX_VAL(CP(SDRC_CKE1), (IDIS | PTU | EN | M0)) /*sdrc_cke1*/ + ++#define MUX_OVERO_SDIO2_DIRECT() \ ++ MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M0)) /*MMC2_CLK*/\ ++ MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M0)) /*MMC2_CMD*/\ ++ MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M0)) /*MMC2_DAT0*/\ ++ MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M0)) /*MMC2_DAT1*/\ ++ MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M0)) /*MMC2_DAT2*/\ ++ MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M0)) /*MMC2_DAT3*/\ ++ MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M0)) /*MMC2_DAT4*/\ ++ MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M0)) /*MMC2_DAT5*/\ ++ MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M0)) /*MMC2_DAT6*/\ ++ MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M0)) /*MMC2_DAT7*/\ ++ MUX_VAL(CP(MMC1_DAT4), (IEN | PTD | EN | M4)) /*GPIO_126*/\ ++ MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M4)) /*GPIO_127*/\ ++ MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M4)) /*GPIO_128*/\ ++ MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M4)) /*GPIO_129*/ ++ ++#define MUX_OVERO_SDIO2_TRANSCEIVER() \ ++ MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M0)) /*MMC2_CLK*/\ ++ MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M0)) /*MMC2_CMD*/\ ++ MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M0)) /*MMC2_DAT0*/\ ++ MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M0)) /*MMC2_DAT1*/\ ++ MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M0)) /*MMC2_DAT2*/\ ++ MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M0)) /*MMC2_DAT3*/\ ++ MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT0*/\ ++ MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT1*/\ ++ MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M1)) /*MMC2_DIR_CMD*/\ ++ MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M1)) /*MMC2_CLKIN*/\ ++ MUX_VAL(CP(MMC1_DAT4), (IEN | PTU | EN | M4)) /*GPIO_126*/\ ++ MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M4)) /*GPIO_127*/\ ++ MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M4)) /*GPIO_128*/\ ++ MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M4)) /*GPIO_129*/ + + #endif +-- +1.6.6.1 + diff --git a/recipes/u-boot/u-boot-git/beagleboard/0003-OMAP3-update-Beagle-revision-detection-to-recognize-.patch b/recipes/u-boot/u-boot-git/beagleboard/0003-OMAP3-update-Beagle-revision-detection-to-recognize-.patch new file mode 100644 index 0000000000..d12ff7a1ed --- /dev/null +++ b/recipes/u-boot/u-boot-git/beagleboard/0003-OMAP3-update-Beagle-revision-detection-to-recognize-.patch @@ -0,0 +1,165 @@ +From 9db5da6e8a0d6fb973b71902525ad3298faa39d9 Mon Sep 17 00:00:00 2001 +From: Steve Sakoman <steve@sakoman.com> +Date: Wed, 10 Feb 2010 14:51:48 -0800 +Subject: [PATCH 03/37] OMAP3: update Beagle revision detection to recognize C4 boards + +--- + board/ti/beagle/beagle.c | 77 +++++++++++++++++++++++++++------------------- + board/ti/beagle/beagle.h | 7 +++- + 2 files changed, 51 insertions(+), 33 deletions(-) + +diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c +index 3b4c9e7..ba16dd7 100644 +--- a/board/ti/beagle/beagle.c ++++ b/board/ti/beagle/beagle.c +@@ -38,7 +38,7 @@ + #include <asm/mach-types.h> + #include "beagle.h" + +-static int beagle_revision_c; ++static int beagle_revision; + + /* + * Routine: board_init +@@ -60,41 +60,38 @@ int board_init(void) + /* + * Routine: beagle_get_revision + * Description: Return the revision of the BeagleBoard this code is running on. +- * If it is a revision Ax/Bx board, this function returns 0, +- * on a revision C board you will get a 1. + */ + int beagle_get_revision(void) + { +- return beagle_revision_c; ++ return beagle_revision; + } + + /* + * Routine: beagle_identify +- * Description: Detect if we are running on a Beagle revision Ax/Bx or +- * Cx. This can be done by GPIO_171. If this is low, we are +- * running on a revision C board. ++ * Description: Detect if we are running on a Beagle revision Ax/Bx, ++ * C1/2/3, C4 or D. This can be done by reading ++ * the level of GPIO173, GPIO172 and GPIO171. This should ++ * result in ++ * GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx ++ * GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3 ++ * GPIO173, GPIO172, GPIO171: 1 0 1 => C4 ++ * GPIO173, GPIO172, GPIO171: 0 0 0 => D + */ + void beagle_identify(void) + { +- beagle_revision_c = 0; +- if (!omap_request_gpio(171)) { +- unsigned int val; +- +- omap_set_gpio_direction(171, 1); +- val = omap_get_gpio_datain(171); +- omap_free_gpio(171); +- +- if (val) +- beagle_revision_c = 0; +- else +- beagle_revision_c = 1; +- } +- +- printf("Board revision "); +- if (beagle_revision_c) +- printf("C\n"); +- else +- printf("Ax/Bx\n"); ++ omap_request_gpio(171); ++ omap_request_gpio(172); ++ omap_request_gpio(173); ++ omap_set_gpio_direction(171, 1); ++ omap_set_gpio_direction(172, 1); ++ omap_set_gpio_direction(173, 1); ++ ++ beagle_revision = omap_get_gpio_datain(173) << 2 | ++ omap_get_gpio_datain(172) << 1 | ++ omap_get_gpio_datain(171); ++ omap_free_gpio(171); ++ omap_free_gpio(172); ++ omap_free_gpio(173); + } + + /* +@@ -106,9 +103,31 @@ int misc_init_r(void) + struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE; + struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE; + ++ beagle_identify(); ++ + twl4030_power_init(); + twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); + ++ printf("Board revision "); ++ switch (beagle_revision) { ++ case REVISION_AXBX: ++ printf("Ax/Bx\n"); ++ break; ++ case REVISION_CX: ++ printf("C1/C2/C3\n"); ++ MUX_BEAGLE_C(); ++ break; ++ case REVISION_C4: ++ printf("C4\n"); ++ MUX_BEAGLE_C(); ++ break; ++ case REVISION_D: ++ printf("D\n"); ++ break; ++ default: ++ printf("unknown 0x%02x\n", beagle_revision); ++ } ++ + /* Configure GPIOs to output */ + writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe); + writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | +@@ -120,8 +139,6 @@ int misc_init_r(void) + writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | + GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout); + +- beagle_identify(); +- + dieid_num_r(); + + return 0; +@@ -136,8 +153,4 @@ int misc_init_r(void) + void set_muxconf_regs(void) + { + MUX_BEAGLE(); +- +- if (beagle_revision_c) { +- MUX_BEAGLE_C(); +- } + } +diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h +index 7fe6275..d95fd78 100644 +--- a/board/ti/beagle/beagle.h ++++ b/board/ti/beagle/beagle.h +@@ -34,6 +34,11 @@ const omap3_sysinfo sysinfo = { + }; + + #define BOARD_REVISION_MASK (0x1 << 11) ++/* BeagleBoard revisions */ ++#define REVISION_AXBX 0x7 ++#define REVISION_CX 0x6 ++#define REVISION_C4 0x5 ++#define REVISION_D 0x0 + + /* + * IEN - Input Enable +@@ -264,7 +269,7 @@ const omap3_sysinfo sysinfo = { + MUX_VAL(CP(HDQ_SIO), (IDIS | PTU | EN | M4)) /*GPIO_170*/\ + MUX_VAL(CP(MCSPI1_CLK), (IEN | PTU | EN | M4)) /*GPIO_171*/\ + MUX_VAL(CP(MCSPI1_SIMO), (IEN | PTU | EN | M4)) /*GPIO_172*/\ +- MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOMI*/\ ++ MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTU | EN | M4)) /*GPIO_173*/\ + MUX_VAL(CP(MCSPI1_CS0), (IEN | PTD | EN | M0)) /*McSPI1_CS0*/\ + MUX_VAL(CP(MCSPI1_CS1), (IDIS | PTD | EN | M0)) /*McSPI1_CS1*/\ + MUX_VAL(CP(MCSPI1_CS2), (IDIS | PTD | DIS | M4)) /*GPIO_176*/\ +-- +1.6.6.1 + diff --git a/recipes/u-boot/u-boot-git/beagleboard/0004-OMAP3-Set-VAUX2-to-1.8V-for-EHCI-PHY-on-Beagle-Rev-C.patch b/recipes/u-boot/u-boot-git/beagleboard/0004-OMAP3-Set-VAUX2-to-1.8V-for-EHCI-PHY-on-Beagle-Rev-C.patch new file mode 100644 index 0000000000..549b3fbddf --- /dev/null +++ b/recipes/u-boot/u-boot-git/beagleboard/0004-OMAP3-Set-VAUX2-to-1.8V-for-EHCI-PHY-on-Beagle-Rev-C.patch @@ -0,0 +1,143 @@ +From efc587fb24a5246f5a436a057320687a1b7847c6 Mon Sep 17 00:00:00 2001 +From: Steve Sakoman <steve@sakoman.com> +Date: Wed, 10 Feb 2010 15:23:19 -0800 +Subject: [PATCH 04/37] OMAP3: Set VAUX2 to 1.8V for EHCI PHY on Beagle Rev C4 boards + +--- + board/ti/beagle/beagle.c | 5 +++++ + drivers/power/twl4030.c | 45 +++++++++++++++++++++++++-------------------- + include/twl4030.h | 15 +++++++++++++++ + 3 files changed, 45 insertions(+), 20 deletions(-) + +diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c +index ba16dd7..b4ea7e6 100644 +--- a/board/ti/beagle/beagle.c ++++ b/board/ti/beagle/beagle.c +@@ -120,6 +120,11 @@ int misc_init_r(void) + case REVISION_C4: + printf("C4\n"); + MUX_BEAGLE_C(); ++ /* Set VAUX2 to 1.8V for EHCI PHY */ ++ twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, ++ TWL4030_PM_RECEIVER_VAUX2_VSEL_18, ++ TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, ++ TWL4030_PM_RECEIVER_DEV_GRP_P1); + break; + case REVISION_D: + printf("D\n"); +diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c +index eb066cb..f354834 100644 +--- a/drivers/power/twl4030.c ++++ b/drivers/power/twl4030.c +@@ -59,57 +59,62 @@ void twl4030_power_reset_init(void) + } + } + +- +-/* +- * Power Init +- */ +-#define DEV_GRP_P1 0x20 +-#define VAUX3_VSEL_28 0x03 +-#define DEV_GRP_ALL 0xE0 +-#define VPLL2_VSEL_18 0x05 +-#define VDAC_VSEL_18 0x03 +- + void twl4030_power_init(void) + { + unsigned char byte; + + /* set VAUX3 to 2.8V */ +- byte = DEV_GRP_P1; ++ byte = TWL4030_PM_RECEIVER_DEV_GRP_P1; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VAUX3_DEV_GRP); +- byte = VAUX3_VSEL_28; ++ byte = TWL4030_PM_RECEIVER_VAUX3_VSEL_28; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VAUX3_DEDICATED); + + /* set VPLL2 to 1.8V */ +- byte = DEV_GRP_ALL; ++ byte = TWL4030_PM_RECEIVER_DEV_GRP_ALL; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VPLL2_DEV_GRP); +- byte = VPLL2_VSEL_18; ++ byte = TWL4030_PM_RECEIVER_VPLL2_VSEL_18; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VPLL2_DEDICATED); + + /* set VDAC to 1.8V */ +- byte = DEV_GRP_P1; ++ byte = TWL4030_PM_RECEIVER_DEV_GRP_P1; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VDAC_DEV_GRP); +- byte = VDAC_VSEL_18; ++ byte = TWL4030_PM_RECEIVER_VDAC_VSEL_18; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VDAC_DEDICATED); + } + +-#define VMMC1_VSEL_30 0x02 +- + void twl4030_power_mmc_init(void) + { + unsigned char byte; + +- byte = DEV_GRP_P1; ++ byte = TWL4030_PM_RECEIVER_DEV_GRP_P1; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VMMC1_DEV_GRP); + + /* 3 Volts */ +- byte = VMMC1_VSEL_30; ++ byte = TWL4030_PM_RECEIVER_VMMC1_VSEL_30; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte, + TWL4030_PM_RECEIVER_VMMC1_DEDICATED); + } ++ ++/* ++ * Generic function to select Device Group and Voltage ++ */ ++void twl4030_pmrecv_vsel_cfg(u8 vsel_reg, u8 vsel_val, ++ u8 dev_grp, u8 dev_grp_sel) ++{ ++ /* Select the Device Group */ ++ twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, dev_grp_sel, ++ dev_grp); ++ ++ /* Select the Voltage */ ++ twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, vsel_val, ++ vsel_reg); ++} ++ ++ +diff --git a/include/twl4030.h b/include/twl4030.h +index 2b2f5ae..cc99403 100644 +--- a/include/twl4030.h ++++ b/include/twl4030.h +@@ -471,6 +471,21 @@ + #define TWL4030_USB_PHY_CLK_CTRL_STS 0xFF + + /* ++ * Voltage Selection in PM Receiver Module ++ */ ++#define TWL4030_PM_RECEIVER_VAUX2_VSEL_18 0x05 ++#define TWL4030_PM_RECEIVER_VAUX3_VSEL_28 0x03 ++#define TWL4030_PM_RECEIVER_VPLL2_VSEL_18 0x05 ++#define TWL4030_PM_RECEIVER_VDAC_VSEL_18 0x03 ++#define TWL4030_PM_RECEIVER_VMMC1_VSEL_30 0x02 ++ ++/* ++ * Device Selection in PM Receiver Module ++ */ ++#define TWL4030_PM_RECEIVER_DEV_GRP_P1 0x20 ++#define TWL4030_PM_RECEIVER_DEV_GRP_ALL 0xE0 ++ ++/* + * Convience functions to read and write from TWL4030 + * + * chip_no is the i2c address, it must be one of the chip addresses +-- +1.6.6.1 + diff --git a/recipes/u-boot/u-boot-git/beagleboard/0005-OMAP3-add-entry-for-rev-3.1.2-check-and-display-max-.patch b/recipes/u-boot/u-boot-git/beagleboard/0005-OMAP3-add-entry-for-rev-3.1.2-check-and-display-max-.patch new file mode 100644 index 0000000000..783fe279dc --- /dev/null +++ b/recipes/u-boot/u-boot-git/beagleboard/0005-OMAP3-add-entry-for-rev-3.1.2-check-and-display-max-.patch @@ -0,0 +1,105 @@ +From 27072274450ea8de1994744782397452b99814cc Mon Sep 17 00:00:00 2001 +From: Steve Sakoman <steve@sakoman.com> +Date: Wed, 3 Feb 2010 12:26:30 -0800 +Subject: [PATCH 05/37] OMAP3: add entry for rev 3.1.2, check and display max cpu clock for rev > 3.0 + +--- + cpu/arm_cortexa8/omap3/sys_info.c | 24 ++++++++++++++++++++++-- + include/asm-arm/arch-omap3/cpu.h | 8 +++++++- + include/asm-arm/arch-omap3/omap3.h | 3 ++- + 3 files changed, 31 insertions(+), 4 deletions(-) + +diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c +index 08fb32e..e227f67 100644 +--- a/cpu/arm_cortexa8/omap3/sys_info.c ++++ b/cpu/arm_cortexa8/omap3/sys_info.c +@@ -39,7 +39,10 @@ static char *rev_s[CPU_3XX_MAX_REV] = { + "2.0", + "2.1", + "3.0", +- "3.1"}; ++ "3.1", ++ "UNKNOWN", ++ "UNKNOWN", ++ "3.1.2"}; + + /***************************************************************** + * dieid_num_r(void) - read and set die ID +@@ -104,6 +107,16 @@ u32 get_cpu_rev(void) + } + } + ++/***************************************************************** ++ * get_sku_id(void) - read sku_id to get info on max clock rate ++ *****************************************************************/ ++u32 get_sku_id(void) ++{ ++ struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE; ++ return (readl(&id_base->sku_id) & SKUID_CLK_MASK); ++} ++ ++ + /**************************************************** + * is_mem_sdr() - return 1 if mem type in use is SDR + ****************************************************/ +@@ -291,9 +304,16 @@ int print_cpuinfo (void) + sec_s = "?"; + } + +- printf("OMAP%s-%s ES%s, CPU-OPP2 L3-165MHz\n", ++ printf("OMAP%s-%s ES%s, CPU-OPP2, L3-165MHz, ", + cpu_s, sec_s, rev_s[get_cpu_rev()]); + ++ printf("Max clock-"); ++ if ((get_cpu_rev() >= CPU_3XX_ES31) && (get_sku_id() == SKUID_CLK_720MHZ)) ++ printf("720Mhz\n"); ++ else printf("600Mhz\n"); ++ ++ ++ + return 0; + } + #endif /* CONFIG_DISPLAY_CPUINFO */ +diff --git a/include/asm-arm/arch-omap3/cpu.h b/include/asm-arm/arch-omap3/cpu.h |
