* Serial init / BRG
@ 2007-10-16 14:19 Alan Bennett
2007-10-16 16:31 ` Scott Wood
0 siblings, 1 reply; 3+ messages in thread
From: Alan Bennett @ 2007-10-16 14:19 UTC (permalink / raw)
To: Scott Wood, linuxppc-dev
For some reason I'm unable to track down the right sequence to
initialize my serial ports. (note: my console is working, but
attempts to initialize SCC1 and SCC4 fail). My console has the luxury
of having uboot initialize it and its brg, but SCC1 / SCC4 aren't so
lucky.
A few questions: To use 3 brgs, should I have 1 brg entry and X reg
values or three brg entries in my device tree? what are the third and
fourth reg values of the brg item in the device tree. I'll need 3
separate baud rates on the serial lines. Should I just add code to
initialize the brg's in u-boot or figure out how to get the kernel to
do it?
boot sequence
===========
CPM UART serial mem=e0011a80 pram=e0000000
ttyCPM0 at MMIO 0xe0011a80 (irq = 16) is a CPM UART
CPM UART serial mem=e0011a00 pram=e0008000
CPM uart[1]:init_scc - sup = e0008000
ttyCPM1 at MMIO 0xe0011a00 (irq = 40) is a CPM UART
CPM UART serial mem=e0011a60 pram=e0008300
CPM uart[2]:init_scc - sup = e0008300
ttyCPM2 at MMIO 0xe0011a60 (irq = 43) is a CPM UART
BRG Values after above
=================
brgc1: 0x00000000
brgc2: 0x00000000
brgc3: 0x00000000
brgc4: 0x00000000
brgc5: 0x00000000
brgc6: 0x00000000
brgc7: 0x0001004e
brgc8: 0x00000000
Device Tree:
brg@119f0 {
compatible = "fsl,mpc8272-brg",
"fsl,cpm2-brg",
"fsl,cpm-brg";
reg = <119f0 10 115f0 10>;
};
/* Monitor port/SMC1 */
serial@11a80 {
device_type = "serial";
compatible = "fsl,mpc8248-smc-uart",
"fsl,cpm2-smc-uart";
reg = <11a80 20 0 40>;
interrupts = <4 8>;
interrupt-parent = <&PIC>;
fsl,cpm-brg = <7>;
fsl,cpm-command = <1d000000>;
};
/* "Serial" port/SCC1 */
serial@11a00 {
device_type = "serial";
compatible = "fsl,mpc8248-scc-uart",
"fsl,cpm2-scc-uart";
reg = <11a00 20 8000 100>;
interrupts = <28 8>;
interrupt-parent = <&PIC>;
fsl,cpm-brg = <1>;
fsl,cpm-command = <00800000>;
};
/* "Serial" port/SCC4 */
serial@11a60 {
device_type = "serial";
compatible = "fsl,mpc8248-scc-uart",
"fsl,cpm2-scc-uart";
reg = <11a60 20 8300 100>;
interrupts = <2B 8>;
interrupt-parent = <&PIC>;
fsl,cpm-brg = <4>;
fsl,cpm-command = <0CE00000>;
};
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Serial init / BRG
2007-10-16 14:19 Serial init / BRG Alan Bennett
@ 2007-10-16 16:31 ` Scott Wood
[not found] ` <bfa0697f0710161114y6273af8fre045328b638a9de7@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2007-10-16 16:31 UTC (permalink / raw)
To: Alan Bennett; +Cc: linuxppc-dev
Alan Bennett wrote:
> A few questions: To use 3 brgs, should I have 1 brg entry and X reg
> values or three brg entries in my device tree?
The current brg entry describes all 8 BRGs... don't touch it. :-)
> what are the third and fourth reg values of the brg item in the
> device tree. I'll need 3 separate baud rates on the serial lines.
> Should I just add code to initialize the brg's in u-boot or figure
> out how to get the kernel to do it?
No, the kernel should do it. Are you associating the BRG with the SCC
in the CMXSCR register, and setting up the pins required by SCC1 and
SCC4, in either u-boot or your platform code?
> boot sequence
> ===========
> CPM UART serial mem=e0011a80 pram=e0000000
> ttyCPM0 at MMIO 0xe0011a80 (irq = 16) is a CPM UART
>
> CPM UART serial mem=e0011a00 pram=e0008000
> CPM uart[1]:init_scc - sup = e0008000
> ttyCPM1 at MMIO 0xe0011a00 (irq = 40) is a CPM UART
>
> CPM UART serial mem=e0011a60 pram=e0008300
> CPM uart[2]:init_scc - sup = e0008300
> ttyCPM2 at MMIO 0xe0011a60 (irq = 43) is a CPM UART
>
> BRG Values after above
> =================
> brgc1: 0x00000000
> brgc2: 0x00000000
> brgc3: 0x00000000
> brgc4: 0x00000000
> brgc5: 0x00000000
> brgc6: 0x00000000
> brgc7: 0x0001004e
> brgc8: 0x00000000
This is expected if you haven't opened the other serial ports yet... it
doesn't initialize the brg until then.
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Serial init / BRG
[not found] ` <47152065.9070403@freescale.com>
@ 2007-10-16 21:38 ` Alan Bennett
0 siblings, 0 replies; 3+ messages in thread
From: Alan Bennett @ 2007-10-16 21:38 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
The lockup is only the shell. I echo from ttyCPM0 console and it
"locks" then I echo from an ssh session and the kernel messages still
output from the ttyCPM0 console.
NOTE: I found a severe issue that seems to have unlocked ttyCPM2. BUT
ttyCPM1 still hangs. (a while back, we commented out the out_be in
cpm_setbrg - oops (console debug left over))
with address / value in cpm_setbrg
echo test > /dev/ttyCPM1 # * note still hang *
CPM uart[1]:startup - port->irq 00000028
CPM uart[1]:startup - port->irq 40
cpm_setbrg:107 - brg:0 baud:9600
cpm_setbrg:108 - addr:e00119f0 value:00010140
echo test > /dev/ttyCPM2 * note doesn't hang *
CPM uart[2]:startup - port->irq 0000002b
CPM uart[2]:startup - port->irq 43
cpm_setbrg:107 - brg:3 baud:9600
cpm_setbrg:108 - addr:e00119fc value:00010140
On 10/16/07, Scott Wood <scottwood@freescale.com> wrote:
> Alan Bennett wrote:
> > I also verified that when I attempt to echo to the ports that I reach
> > the appropriate driver
> > i.e.
> > echo "hello" > /dev/ttyCPM1
> > CPM uart[1]:startup - port->irq 40
> > echo "hello" > /dev/ttyCPM2
> > CPM uart[2]:startup - port->irq 43
> > but brg's stay 0x0 and my shell's lock up something fierce.
>
> Hmm... try putting a debugging printk in cpm_setbrg with the address
> and value it's writing.
>
> Is it just the shell that locks up, or the console (i.e. can you still
> get kernel messages)?
>
> > (note: my tree is still based off of one you provided a few weeks
> > back. have the 82xx / ep8248e changes we went through been pushed
> > into linus' git tree?)
>
> It should all be in Linus's tree except the actual ep8248e file, which
> didn't make it this time around due to interdependencies on netdev.
> Note that there are some small device tree changes from the tree you're
> currently using (in particular, muram is now in a node of its own).
>
> -Scott
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-10-16 21:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-16 14:19 Serial init / BRG Alan Bennett
2007-10-16 16:31 ` Scott Wood
[not found] ` <bfa0697f0710161114y6273af8fre045328b638a9de7@mail.gmail.com>
[not found] ` <47152065.9070403@freescale.com>
2007-10-16 21:38 ` Alan Bennett
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).