• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Enabling UART1 to facilitate a 2nd serial interface/ttyS1  (Read 2811 times)
suicidallabrat
Newbie
*

Karma: 0
Posts: 5


View Profile
« 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-
« Last Edit: January 14, 2010, 07:14:30 PM by suicidallabrat » Logged

suicidallabrat
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #1 on: January 16, 2010, 05:53:41 PM »


Is there no one with any input on this?  Any insight at all, no matter how small,  would be greatly appreciated!

Maybe I am posting in the wrong forum  ...should this be in hardware?


SLR-


Logged

jms
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #2 on: January 16, 2010, 08:15:16 PM »

Hi,

We're using the 88F6180 in a product with ttyS1 running  (and no SD) and I started with plug editions of u-boot and kernel.

I certainly didn't do anything like what you have. You just have to make sure that MPSEL is how you want it. The kernel source has its own tables you may not have noticed.

Take a look in arch/arm/mach-feroceon-kw/kw_family/boardEnv/mvBoardEnvSpec.h

You don't need to fiddle with GPIO enables because these are not used as GPIO.

My toolbox includes a userland memory poker I can use to experiment with this sort of thing at runtime.

Jon
Logged

suicidallabrat
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #3 on: January 16, 2010, 10:03:49 PM »

Hey Jon,

Thanks for your response!  Is the mvBoardEnvSpec.h object something that didnt make it out of the Feroceon tree?  I have been building against mainline and orion, not Feroceon, and I dont recall coming across it when I was digging around in orion?


EDIT:  I found it in 2.6.22.18...


THNX!
SLR-
« Last Edit: January 16, 2010, 10:07:50 PM by suicidallabrat » Logged

snake
Newbie
*

Karma: 3
Posts: 37



View Profile
« Reply #4 on: August 10, 2011, 01:29:20 AM »


Hello SLR,

Hope you are still out there and actively participating to this forum.

Would like to know whether you were successful in getting uart1 (ttyS1) in userspace?

Did you also just edit "arch/arm/mach-feroceon-kw/kw_family/boardEnv/mvBoardEnvSpec.h" and change the ff line?

#define RD_88F6281A_MPP8_15                      0x13313311


The value for MPP 13 and 14 are set to 0x3 to select UART1 instead of SDIO. I've tried recompiling the uImage with this setting but still I am getting input/output errors on ttyS1 when trying to access it.


Logged

Pages: [1]
Print
Jump to: