linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE: Problems with serial ports
@ 2000-04-28 10:36 Kim Jørgensen
  2000-04-28 13:00 ` Dan Malek
  0 siblings, 1 reply; 5+ messages in thread
From: Kim Jørgensen @ 2000-04-28 10:36 UTC (permalink / raw)
  To: 'linuxppc-embedded@lists.linuxppc.org'


>> Linux runs fine on the board using smc1 as console, but I can't receive
or
>> transmit anything on smc2 and scc2.
>
>The SCC2 is used for Ethernet, and SMC2 is probably reserved for the
>Embedded Planet TDM audio codec.  If you don't use Ethernet, you can
>enable SCC2 for serial use.  You have to manually edit the
>arch/ppc/8xx_io/uart.c port table.

I did that, I added scc2 to rs_table in uart.c and the kernel seams to find
all the
serial ports:

CPM UART driver version 0.03
ttyS00 at 0x0280 is a SMC
ttyS01 at 0x0380 is a SMC
ttyS02 at 0x0100 is a SCC

>  I am working on a configurable
>version, just haven't found anything terribly fool-proof yet.  I also
>have a very different new driver I am testing for the uart.

Is the new driver available?


I tried to use scc2 as console under startup and smc1 as console by the
kernel. (I just changed serial_init to serial_scc_init in head.S)
This works ok, I get the startup messages on scc2 and the kernel messages
and bash prompt on smc1.
Now I can transmit and receive data on scc2 (ttyS2), but still not on smc2.
It seams like scc2 and smc1 is not initialised properly by uart.c.
Can anyone tell me what is wrong?

Kim Jorgensen


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Problems with serial ports
@ 2000-04-25  7:39 Kim Jørgensen
  2000-04-25 16:33 ` Dan Malek
  0 siblings, 1 reply; 5+ messages in thread
From: Kim Jørgensen @ 2000-04-25  7:39 UTC (permalink / raw)
  To: 'linuxppc-embedded@lists.linuxppc.org'


Hi.

I got a custom MPC823 board with 3 serial ports (smc1, smc2 and scc2), and a
2.2.13 kernel form mvista.

Linux runs fine on the board using smc1 as console, but I can't receive or
transmit anything on smc2 and scc2.

I am using the program miniterm to setup and test these ports; I have used
this program on my RH i686 machine without any problems.

I have used scc2 as console too, without any problem. But I still can't use
smc1 and smc2. I look like an initialisation problem to me. Can anyone help
with this?


Btw. There is a problem in m8xx_cpm_setbrg in commproc.c. I can't set any
serial port to run any lower than 1200 baud. This is caused by
BRG_UART_CLK/rate (clock divider) getting larger than 4096, which is the
maximum (at least on a mpc823).
I solved the problem like this:

#define BRG_INT_CLK		(((bd_t *)res)->bi_intfreq * 1000000)
#define BRG_UART_CLK		(BRG_INT_CLK/16)
#define BRG_UART_CLK_DIV16	(BRG_UART_CLK/16)

void
m8xx_cpm_setbrg(uint brg, uint rate)
{
	volatile uint	*bp;

	/* This is good enough to get SMCs running.....
	*/
	bp = (uint *)&cpmp->cp_brgc1;
	bp += brg;
	if((BRG_UART_CLK / rate) < 4096)
	    *bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN;
	else
	    *bp = ((BRG_UART_CLK_DIV16 / rate) << 1) | CPM_BRG_EN |
CPM_BRG_DIV16;
}

Kim Jorgensen


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2000-04-28 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-28 10:36 Problems with serial ports Kim Jørgensen
2000-04-28 13:00 ` Dan Malek
2000-04-28 14:59   ` Magnus Damm
  -- strict thread matches above, loose matches on Subject: below --
2000-04-25  7:39 Kim Jørgensen
2000-04-25 16:33 ` Dan Malek

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).