|
|
 |
« on: January 14, 2010, 07:12:32 PM » |
|
I am having problems enabling UART1 on the sheva board. Any help on getting UART1 working would be greatly appreciated!
What I have tried: The chips mpp 13 and 14 are muxed SDIO and UART1 and correspond to the SDIO pins 2 and 7.
I have built a custom u-boot that enables mpp 13 and 14 for UART1 ( modified sheevaplug.c ) - Modified MMP13 and 14: Change from MPP13_SD_CMD, MPP14_SD_D0,
-to-
MPP13_UART1_TXD, MPP14_UART1_RXD,
--- ---
I have also built a kernel (2.6.23RC2) that I have customized to enable UART1:
I patched the following three objects: arch/arm/mach-kirkwood/sheevaplug-setup.c arch/arm/plat-orion/include/plat/mvsdio.h drivers/mmc/host/mvsdio.c
sheevaplug-setup.c:
@@ static struct mvsdio_platform_data sheevaplug_mvsdio_data = { + .gpio_enable = 34, /* MPP34 is the UART1/SDIO switch */ + .gpio_enable_value = 0, /* bit switch, 0 disables SDIO */
@@ static unsigned int sheevaplug_mpp_config[] __initdata = { + MPP13_UART1_TXD, /* Set to UART1 */ + MPP14_UART1_RXD, /* Set to UART1 */ + MPP34_GPIO, /* SD_UART1_SEL */ mvsdio.h: @@ struct mvsdio_platform_data {
+ int gpio_enable; + int gpio_enable_value;
mvsdio.c: @@ struct mvsd_host { + int gpio_enable; + int gpio_enable_value;
@@ static void mvsd_power_up(struct mvsd_host *host) + gpio_set_value(host->gpio_enable, host->gpio_enable_value);
@@ static void mvsd_power_down(struct mvsd_host *host) + gpio_set_value(host->gpio_enable, !host->gpio_enable_value);
@@ out: + if (host->gpio_enable) + gpio_free(host->gpio_enable);
NOTE: This 'if' stanza was already patched in this file as well, which looks like it may probing - which may be a problem for me ( I explain this further down ). @@ static int __init mvsd_probe(struct platform_device *pdev) if (mvsd_data->gpio_enable) { ret = gpio_request(mvsd_data->gpio_enable, DRIVER_NAME " enable"); if (ret) { printk(KERN_ERR "%s: cannot reserve GPIO %d (enable)\n", DRIVER_NAME, mvsd_data->gpio_enable); goto out; } ret = gpio_direction_output(mvsd_data->gpio_enable, !mvsd_data->gpio_enable); if (ret) { printk(KERN_ERR "%s: cannot configure GPO %d (enable)\n", DRIVER_NAME, mvsd_data->gpio_enable); gpio_free(mvsd_data->gpio_enable); goto out; } host->gpio_enable = mvsd_data->gpio_enable; host->gpio_enable_value = mvsd_data->gpio_enable_value; }
--- ---
-The u-boot builds and runs fine.
-The kernel builds and runs fine.
-I am now able to connect to the ttyS1 file descriptor without any I/O errors.
Problem: When I probe the SDIO pins 2(TXD) and 7(RXD) there is a signal polling the SDIO pin2 (which is bussed to the mpp13 ); I thought I turned the SDIO off by switching mpp34, but it seems like something is still polling/probing the interface at a regular interval.
So, I have obviously done this wrong.
THE QUESTION!?
How do I enable the UART1 interface and get it working with ttyS1? What changes to both u-boot and the kernel are needed? ...or, any resources you may think will help me in this endeavor.
THANKS! SLR-
|