diff options
author | H. Nikolaus Schaller <hns@goldelico.com> | 2011-06-28 11:13:17 +0200 |
---|---|---|
committer | H. Nikolaus Schaller <hns@goldelico.com> | 2011-06-28 11:13:17 +0200 |
commit | a8d8cd819e3066c9504ad9af45294f4f8c662749 (patch) | |
tree | d7511109e784dcd93f31264b99fc4aa7e06acc04 /board | |
parent | 4a8ad72a304ec18904ea75b6aeb35bf38c46b465 (diff) | |
download | bootable_bootloader_goldelico_gta04-a8d8cd819e3066c9504ad9af45294f4f8c662749.zip bootable_bootloader_goldelico_gta04-a8d8cd819e3066c9504ad9af45294f4f8c662749.tar.gz bootable_bootloader_goldelico_gta04-a8d8cd819e3066c9504ad9af45294f4f8c662749.tar.bz2 |
fixed enabling of VAUX4 and Wi2Wi chip reset
Diffstat (limited to 'board')
-rw-r--r-- | board/goldelico/gta04/gta04.c | 50 | ||||
-rw-r--r-- | board/goldelico/gta04/status.c | 3 |
2 files changed, 48 insertions, 5 deletions
diff --git a/board/goldelico/gta04/gta04.c b/board/goldelico/gta04/gta04.c index 858e699..875f0c4 100644 --- a/board/goldelico/gta04/gta04.c +++ b/board/goldelico/gta04/gta04.c @@ -103,12 +103,11 @@ int board_init(void) */ int get_board_revision(void) { +#ifdef CONFIG_OMAP3_GTA04 + return 6; // configure pinmux for C1/2/3 +#else int revision; - // check if really GTA04 - - return 6; // configure pinmux for C1/2/3 - if (!omap_request_gpio(171) && !omap_request_gpio(172) && !omap_request_gpio(173)) { @@ -130,17 +129,54 @@ int get_board_revision(void) } return revision; +#endif } /* * Routine: misc_init_r * Description: Configure board specific parts */ + +#ifdef CONFIG_OMAP3_GTA04 +#define TCA6507_BUS (2-1) // I2C2 +#define TCA6507_ADDRESS 0x45 + +/* register numbers */ +#define TCA6507_SELECT0 0 +#define TCA6507_SELECT1 1 +#define TCA6507_SELECT2 2 +#endif + int misc_init_r(void) { struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE; struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE; - +#ifdef CONFIG_OMAP3_GTA04 + + /* ITG3200 & HMC5883L VAUX2 = 2.8V */ + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, + /*TWL4030_PM_RECEIVER_VAUX2_VSEL_28*/ 0x09, + TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, + TWL4030_PM_RECEIVER_DEV_GRP_P1); + /* Camera VAUX3 = 2.5V */ + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX3_DEDICATED, + /*TWL4030_PM_RECEIVER_VAUX3_VSEL_25*/ 0x02, + TWL4030_PM_RECEIVER_VAUX3_DEV_GRP, + TWL4030_PM_RECEIVER_DEV_GRP_P1); + + i2c_set_bus_num(TCA6507_BUS); // write I2C2 + i2c_reg_write(TCA6507_ADDRESS, TCA6507_SELECT0, 0); + i2c_reg_write(TCA6507_ADDRESS, TCA6507_SELECT1, 0); + i2c_reg_write(TCA6507_ADDRESS, TCA6507_SELECT2, 0x40); // pull down reset for WLAN&BT chip + i2c_set_bus_num(0); // write I2C1 + + /* Bluetooth VAUX4 = 3.3V -- CHECKME: 3.3 V is not officially supported! We use 0x09 = 2.8V here*/ + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX4_DEDICATED, + /*TWL4030_PM_RECEIVER_VAUX4_VSEL_33*/ 0x09, + TWL4030_PM_RECEIVER_VAUX4_DEV_GRP, + TWL4030_PM_RECEIVER_DEV_GRP_P1); + +#else switch (get_board_revision()) { case REVISION_AXBX: // printf("Beagle Rev Ax/Bx\n"); @@ -178,6 +214,8 @@ int misc_init_r(void) default: printf("Beagle unknown 0x%02x\n", get_board_revision()); } +#endif + twl4030_power_init(); #ifdef CONFIG_OMAP3_GTA04 @@ -189,6 +227,8 @@ int misc_init_r(void) twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); #endif + // FIXME: check this!!! + /* Configure GPIOs to output */ writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe); writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | diff --git a/board/goldelico/gta04/status.c b/board/goldelico/gta04/status.c index ea10357..aebd95e 100644 --- a/board/goldelico/gta04/status.c +++ b/board/goldelico/gta04/status.c @@ -106,8 +106,11 @@ static int isXM = 0; #define GPIO_LED_VIBRA (isXM?2:88) // Vibracall motor #define GPIO_LED_UNUSED (isXM?3:89) // unused +static int status; + void status_set_status(int value) { + status=value; if(!hasTCA6507) { omap_set_gpio_dataout(GPIO_LED_AUX_RED, (value&(1 << 0))); omap_set_gpio_dataout(GPIO_LED_AUX_GREEN, (value&(1 << 1))); |