diff options
Diffstat (limited to 'board/overo/overo.c')
-rw-r--r-- | board/overo/overo.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/board/overo/overo.c b/board/overo/overo.c index 4a60917..1b67f1f 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -103,6 +103,39 @@ int get_board_revision(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: misc_init_r * Description: Configure board specific parts */ @@ -116,6 +149,20 @@ int misc_init_r(void) #endif printf("Board revision: %d\n", get_board_revision()); + + switch (get_sdio2_config()) { + case 0: + printf("Tranceiver detected on mmc2\n"); + MUX_OVERO_SDIO2_TRANSCEIVER(); + break; + case 1: + printf("Direct connection on mmc2\n"); + MUX_OVERO_SDIO2_DIRECT(); + break; + default: + printf("Unable to detect mmc2 connection type\n"); + } + dieid_num_r(); return 0; |