linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Enable Serial Management Controller (SMC) in MPC8265
@ 2009-04-23 23:50 Andres F Marquez
  2009-04-24 16:02 ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Andres F Marquez @ 2009-04-23 23:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nirmala Kakkuppi, Haysam Rachid

Hello,

     I am working with a MPC8265 processor for which I am compiling a
Kernel using LTIB. I just came to a point in my project in which I need
an additional serial port to interface my CPU with a FPGA. Since my
UTOPIA interface is using several serial ports -pins, the only option
that I find available is to use a Serial Management Controller (SMC)
port (SMC1 or SMC2).

      I enabled SCC1 (for the console) and SMC2 through the Kernel
(2.6.25) configuration tool using LTIB. I am able to run my system and
execute minicom to try to configure the needed serial port. I have not
been able to find the tty port that refers to either one of the two SMC
ports. I have tried all the tty's that I get when I do ls /dev/tty* but
none of them seem to work. Below, I provide the list of tty's that I am
getting. ttyCPM0 is being used for the console. ttyCPM1 is the only one
that I am allowed to configure through minicom (for the rest it says
device not found). But even after configuring ttyCPM1 I don't see
anything through the serial lines.

-sh-2.05b# ls /dev/tty*
Using fallback suid method
/dev/tty      /dev/tty7     /dev/ttyP1    /dev/ttyPSC5  /dev/ttyp3
/dev/tty0     /dev/ttyAM0   /dev/ttyP2    /dev/ttyS0    /dev/ttyp4
/dev/tty1     /dev/ttyAM1   /dev/ttyP3    /dev/ttyS1    /dev/ttyp5
/dev/tty2     /dev/ttyAM2   /dev/ttyPSC0  /dev/ttyS2    /dev/ttyp6
/dev/tty3     /dev/ttyAM3   /dev/ttyPSC1  /dev/ttyS3    /dev/ttyp7
/dev/tty4     /dev/ttyCPM0  /dev/ttyPSC2  /dev/ttyp0    /dev/ttyp8
/dev/tty5     /dev/ttyCPM1  /dev/ttyPSC3  /dev/ttyp1    /dev/ttyp9
/dev/tty6     /dev/ttyP0    /dev/ttyPSC4  /dev/ttyp2
-sh-2.05b# 

   I am not sure how to know which one of them belongs to the SMC serial
controllers. 

     After doing some research online, I added an entry in my
mpc8272ads.dts file for the smc serial controller. Below, I provide the
entries for the serial ports (one SCC1 and one SMC2):

                        serial@11a00 {
                                device_type = "serial";
                                compatible = "fsl,mpc8280-scc-uart",
                                             "fsl,cpm2-scc-uart";
                                reg = <11a00 20 8000 100>;
                                interrupts = <28 8>;
                                interrupt-parent = <&PIC>;
                                fsl,cpm-brg = <2>;
                                fsl,cpm-command = <00800000>;
                        };

                        serial@11a92 {
                                device_type = "serial";
                                compatible = "fsl,mpc8280-smc-uart",
                                                "fsl,cpm2-smc-uart";
                                reg = <11a92 20 88fc 2>;
                                interrupts = <5 8>;
                                interrupt-parent = <&PIC>;
                                fsl,cpm-brg = <2>;
                                fsl,cpm-command = <21200000>;
                        };

     I am kind of confused about what I could be missing in order to use
the SMC. I don't even need it to be UART. I just need a serial interface
for a FPGA which I am programming. One thing in which I was successful
was in configuring in uboot the console to run in the SMC2 port -instead
of the default which is SCC1 (I was able to boot uboot and the kernel
through the SMC2 serial port -using NFS). However, I need in my system
both enable (SCC1 and SMC2). I have not been able to do that. I am not
sure if it is possible or not. I have made a lot of changes in the .dts
file but have not been successful. For some reason in uboot, it seems
like the configurations for SCC1 and SMC2 are exclusive. They depend on
where the console is configured (SCC1 or SMC2). Either one can be
configured, but not both at the same time (at least based on uboot
configuration definitions. They are within if's and elif's...). As I
said before, both of them are able to run the console.

Thank you in advance for any help.

Bye.


ANDRES

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Enable Serial Management Controller (SMC) in MPC8265
  2009-04-23 23:50 Enable Serial Management Controller (SMC) in MPC8265 Andres F Marquez
@ 2009-04-24 16:02 ` Scott Wood
  2009-04-27 13:40   ` Andres F Marquez
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2009-04-24 16:02 UTC (permalink / raw)
  To: Andres F Marquez; +Cc: Nirmala Kakkuppi, linuxppc-dev, Haysam Rachid

On Thu, Apr 23, 2009 at 07:50:25PM -0400, Andres F Marquez wrote:
>      I am working with a MPC8265 processor for which I am compiling a
> Kernel using LTIB.

Please contact Freescale support for issues with BSPs.  Around here
you'll be told to upgrade to the latest upstream kernel. :-)

>       I enabled SCC1 (for the console) and SMC2 through the Kernel
> (2.6.25) configuration tool using LTIB. I am able to run my system and
> execute minicom to try to configure the needed serial port. I have not
> been able to find the tty port that refers to either one of the two SMC
> ports.

All CPM serial ports (whether SCC or SMC) will be /dev/ttyCPMn.

> I have tried all the tty's that I get when I do ls /dev/tty* but
> none of them seem to work. Below, I provide the list of tty's that I am
> getting. ttyCPM0 is being used for the console. ttyCPM1 is the only one
> that I am allowed to configure through minicom (for the rest it says
> device not found).

Not allowed?  Don't you have root access to your board?

>      After doing some research online, I added an entry in my
> mpc8272ads.dts file for the smc serial controller. Below, I provide the
> entries for the serial ports (one SCC1 and one SMC2):
> 
>                         serial@11a00 {
>                                 device_type = "serial";
>                                 compatible = "fsl,mpc8280-scc-uart",
>                                              "fsl,cpm2-scc-uart";
>                                 reg = <11a00 20 8000 100>;
>                                 interrupts = <28 8>;
>                                 interrupt-parent = <&PIC>;
>                                 fsl,cpm-brg = <2>;
>                                 fsl,cpm-command = <00800000>;
>                         };
> 
>                         serial@11a92 {
>                                 device_type = "serial";
>                                 compatible = "fsl,mpc8280-smc-uart",
>                                                 "fsl,cpm2-smc-uart";
>                                 reg = <11a92 20 88fc 2>;
>                                 interrupts = <5 8>;
>                                 interrupt-parent = <&PIC>;
>                                 fsl,cpm-brg = <2>;
>                                 fsl,cpm-command = <21200000>;
>                         };

Do you really have both ports on the same BRG?

Change 11a92 to 11a90 -- it's the address of the register block, not the
first register within the block.

You should also change 8280 to 8265, though nothing currently cares.

Finally, I think 2.6.25 is too old to support automatic allocation of SMC
parameter RAM.  Unless they've backported something in the BSP, you'll
have to manually allocate some space, remove that chunk from the muram
node, program SMC2_BASE yourself, and put the address of the actual
parameter RAM in the device tree.  Or, upgrade to the latest upstream
kernel, or complain to Freescale sales and/or support that the BSP kernel
is too old for your desired use.

> For some reason in uboot, it seems like the configurations for SCC1 and
> SMC2 are exclusive. They depend on where the console is configured
> (SCC1 or SMC2). Either one can be configured, but not both at the same
> time (at least based on uboot configuration definitions. They are
> within if's and elif's...). As I said before, both of them are able to
> run the console.

I don't see any obvious pin conflict between SCC1 and SMC2.  It's
probably just a u-boot limitation -- but make sure that the pins get set
up for SMC2 even if u-boot doesn't use it.

-Scott

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Enable Serial Management Controller (SMC) in MPC8265
  2009-04-24 16:02 ` Scott Wood
@ 2009-04-27 13:40   ` Andres F Marquez
  2009-04-27 15:19     ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Andres F Marquez @ 2009-04-27 13:40 UTC (permalink / raw)
  To: Scott Wood; +Cc: Nirmala Kakkuppi, linuxppc-dev, Haysam Rachid

Hello Scott,

Thank you for your support.

     After struggling for several days with this issue we have finally
taken a different approach to solve our problem. We wanted to interface
our CPU (MPC8265) with a FPGA through a serial connection. Now, we are
using a parallel interface through the data bus (defining a new memory
region in uboot -an additional chip select).

     We tried enabling SCC's and SMC's through the kernel configuration
in ltib, but we were always getting the same tty devices device under
"/dev". No matter how many SCC's or SMC's we enable we were always
getting only /dev/ttyCPM0 and /dev/ttyCPM1. To answer your question,
when I said it did not allow me to configure a tty port through minicom,
I meant it complained because the device was not found.

     However, as I said before, we managed to enable it in uboot using
SMC2 as console. The problem we found was that for some reason in uboot
the code is organized in several places to enable either SCC or SMC (but
only as console). We could not find any configuration option to enable
SCC1 as console and SMC2 as serial port at the same time. We tried going
through the uboot code to enable both, but their configuration is
exclusive in several places (only one of them can be enabled at the same
time).

    Due to time constraints, we decided to change our design approach as
stated before (parallel interface).

Thank you again for your help.


-- 
Andres F Marquez
EdgeAccess
Development
amarquez@edgeaccess.net



On Fri, 2009-04-24 at 11:02 -0500, Scott Wood wrote:
> On Thu, Apr 23, 2009 at 07:50:25PM -0400, Andres F Marquez wrote:
> >      I am working with a MPC8265 processor for which I am compiling a
> > Kernel using LTIB.
> 
> Please contact Freescale support for issues with BSPs.  Around here
> you'll be told to upgrade to the latest upstream kernel. :-)
> 
> >       I enabled SCC1 (for the console) and SMC2 through the Kernel
> > (2.6.25) configuration tool using LTIB. I am able to run my system and
> > execute minicom to try to configure the needed serial port. I have not
> > been able to find the tty port that refers to either one of the two SMC
> > ports.
> 
> All CPM serial ports (whether SCC or SMC) will be /dev/ttyCPMn.
> 
> > I have tried all the tty's that I get when I do ls /dev/tty* but
> > none of them seem to work. Below, I provide the list of tty's that I am
> > getting. ttyCPM0 is being used for the console. ttyCPM1 is the only one
> > that I am allowed to configure through minicom (for the rest it says
> > device not found).
> 
> Not allowed?  Don't you have root access to your board?
> 
> >      After doing some research online, I added an entry in my
> > mpc8272ads.dts file for the smc serial controller. Below, I provide the
> > entries for the serial ports (one SCC1 and one SMC2):
> > 
> >                         serial@11a00 {
> >                                 device_type = "serial";
> >                                 compatible = "fsl,mpc8280-scc-uart",
> >                                              "fsl,cpm2-scc-uart";
> >                                 reg = <11a00 20 8000 100>;
> >                                 interrupts = <28 8>;
> >                                 interrupt-parent = <&PIC>;
> >                                 fsl,cpm-brg = <2>;
> >                                 fsl,cpm-command = <00800000>;
> >                         };
> > 
> >                         serial@11a92 {
> >                                 device_type = "serial";
> >                                 compatible = "fsl,mpc8280-smc-uart",
> >                                                 "fsl,cpm2-smc-uart";
> >                                 reg = <11a92 20 88fc 2>;
> >                                 interrupts = <5 8>;
> >                                 interrupt-parent = <&PIC>;
> >                                 fsl,cpm-brg = <2>;
> >                                 fsl,cpm-command = <21200000>;
> >                         };
> 
> Do you really have both ports on the same BRG?
> 
> Change 11a92 to 11a90 -- it's the address of the register block, not the
> first register within the block.
> 
> You should also change 8280 to 8265, though nothing currently cares.
> 
> Finally, I think 2.6.25 is too old to support automatic allocation of SMC
> parameter RAM.  Unless they've backported something in the BSP, you'll
> have to manually allocate some space, remove that chunk from the muram
> node, program SMC2_BASE yourself, and put the address of the actual
> parameter RAM in the device tree.  Or, upgrade to the latest upstream
> kernel, or complain to Freescale sales and/or support that the BSP kernel
> is too old for your desired use.
> 
> > For some reason in uboot, it seems like the configurations for SCC1 and
> > SMC2 are exclusive. They depend on where the console is configured
> > (SCC1 or SMC2). Either one can be configured, but not both at the same
> > time (at least based on uboot configuration definitions. They are
> > within if's and elif's...). As I said before, both of them are able to
> > run the console.
> 
> I don't see any obvious pin conflict between SCC1 and SMC2.  It's
> probably just a u-boot limitation -- but make sure that the pins get set
> up for SMC2 even if u-boot doesn't use it.
> 
> -Scott

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Enable Serial Management Controller (SMC) in MPC8265
  2009-04-27 13:40   ` Andres F Marquez
@ 2009-04-27 15:19     ` Scott Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2009-04-27 15:19 UTC (permalink / raw)
  To: Andres Marquez; +Cc: Nirmala Kakkuppi, linuxppc-dev, Haysam Rachid

Andres F Marquez wrote:
>      After struggling for several days with this issue we have finally
> taken a different approach to solve our problem. We wanted to interface
> our CPU (MPC8265) with a FPGA through a serial connection. Now, we are
> using a parallel interface through the data bus (defining a new memory
> region in uboot -an additional chip select).

That sounds much better.

>      We tried enabling SCC's and SMC's through the kernel configuration
> in ltib,

LTIB doesn't alter device trees AFAIK...  Unless you have more than two 
CPM serial nodes, you won't get more than ttyCPM0 and ttyCPM1.

> but we were always getting the same tty devices device under
> "/dev". No matter how many SCC's or SMC's we enable we were always
> getting only /dev/ttyCPM0 and /dev/ttyCPM1. 

Do you have a static /dev, or are you running mdev or udev?  If the 
latter, then any changes in the kernel or device tree are not going to 
automatically show up in /dev.

-Scott

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-27 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-23 23:50 Enable Serial Management Controller (SMC) in MPC8265 Andres F Marquez
2009-04-24 16:02 ` Scott Wood
2009-04-27 13:40   ` Andres F Marquez
2009-04-27 15:19     ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).