linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* CPM uart
@ 2005-04-14  7:26 Marco Schramel
  2005-04-14 12:01 ` Dan Malek
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Schramel @ 2005-04-14  7:26 UTC (permalink / raw)
  To: PPC_LINUX

Hi,

on my target (MPC8270, 2.4.25) SCC1, SCC2 and SCC3 will work fine as ttyS0 .. ttyS2 with console at ttyS0.

It works with this code in arch/ppc/8260_io/uart.c
#define CONFIG_SERIAL_CONSOLE_PORT	0

#define SCC_NUM_BASE	0	/* SCC base tty "number" */
#define SCC_IDX_BASE	        0  	/* table index */
static struct serial_state rs_table[] = {
	/* UART CLK   PORT          IRQ      FLAGS  NUM   */
	{ 0,     0, PROFF_SCC1, SIU_INT_SCC1,   0, SCC_NUM_BASE},          /* SCC1 ttyS0 */
	{ 0,     0, PROFF_SCC2, SIU_INT_SCC2,   0, SCC_NUM_BASE + 1},    /* SCC2 ttyS1 */
	{ 0,     0, PROFF_SCC3, SIU_INT_SCC3,   0, SCC_NUM_BASE +2},     /* SCC3 ttyS2 */


Now i need the two SMC's.
I changed the source to:
#define CONFIG_SERIAL_CONSOLE_PORT	2
#define SCC_NUM_BASE	2	/* SCC base tty "number" */
#define SCC_IDX_BASE  	2	/* table index */
static struct serial_state rs_table[] = {
	/* UART CLK   PORT          IRQ      FLAGS  NUM   */
	{ 0,     0, PROFF_SMC1, SIU_INT_SMC1,   0, 0},    /* SMC1 ttyS0 */
	{ 0,     0, PROFF_SMC2, SIU_INT_SMC2,   0, 1},    /* SMC2 ttyS1 */	
	{ 0,     0, PROFF_SCC1, SIU_INT_SCC1,   0, SCC_NUM_BASE},    /* SCC1 ttyS2 */
	{ 0,     0, PROFF_SCC2, SIU_INT_SCC2,   0, SCC_NUM_BASE + 1},    /* SCC2 ttyS3 */
	{ 0,     0, PROFF_SCC3, SIU_INT_SCC3,   0, SCC_NUM_BASE + 2},    /* SCC3 ttyS4 */
and passed the bootloader the correct console=ttyS2.

During booting kernel hangs on initializing ttyS2 forever.

What could be wrong ? I only changed the io port configuration in the init function.

Thanks in advance
Marco





---------
Marco Schramel

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

* Re: CPM uart
  2005-04-14  7:26 CPM uart Marco Schramel
@ 2005-04-14 12:01 ` Dan Malek
  2005-04-14 12:54   ` Marco Schramel
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Malek @ 2005-04-14 12:01 UTC (permalink / raw)
  To: Marco Schramel; +Cc: PPC_LINUX


On Apr 14, 2005, at 3:26 AM, Marco Schramel wrote:

> During booting kernel hangs on initializing ttyS2 forever.

That is the console port, so take a look at the code for its
initialization for something affected by this configuration.
What kernel are you using?  There have been lots of
updates in recent versions.

> What could be wrong ? I only changed the io port configuration in the 
> init function.

Heh :-)  There are lots of permutations of serial ports that probably
haven't been tested.  You probably found one of them.

Thanks.


	-- Dan

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

* Re: CPM uart
  2005-04-14 12:01 ` Dan Malek
@ 2005-04-14 12:54   ` Marco Schramel
  2005-04-14 15:51     ` Dan Malek
  2005-04-14 23:24     ` Ricardo Scop
  0 siblings, 2 replies; 9+ messages in thread
From: Marco Schramel @ 2005-04-14 12:54 UTC (permalink / raw)
  To: Dan Malek, PPC_LINUX

Hi Dan,

thanks for your answer.

> > During booting kernel hangs on initializing ttyS2 forever.
> 
> That is the console port, so take a look at the code for its
> initialization for something affected by this configuration.
> What kernel are you using?  There have been lots of
> updates in recent versions.

I use kernel version 2.4.25 of denx and the uart version is 
static char *serial_name = "CPM UART driver";
static char *serial_version = "0.01";

Are there newer versions? Sorry, but i am not up to date with the uart.
Is my configuration so extraordinary ;-) ?

Thanks
Marco



-- 
---------
Marco Schramel

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

* Re: CPM uart
       [not found] <1628E43D99629C46988BE46087A3FBB9205B50@ep-01.EmbeddedPlanet.local>
@ 2005-04-14 13:34 ` Marco Schramel
  2005-04-14 13:55   ` Dan Malek
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Schramel @ 2005-04-14 13:34 UTC (permalink / raw)
  To: Steven Blakeslee; +Cc: PPC_LINUX

Hi Steven,

thank you for your answer.


> The selection of the BRGs is hard coded last time I checked.  When you
> add SMC1 and SMC2 it may use the wrong BRG for SCC1.  Check the BRG
> registers, the cmx_smr register and cmx_scr register and make sure
> everything matches up. 

But this original code seems to be ok.

static int rs_brg_map[] = {
	6,	/* BRG7 for SMC1 */
	7,	/* BRG8 for SMC2 */
	0,	/* BRG1 for SCC1 */
	1,	/* BRG2 for SCC2 */
	2,	/* BRG3 for SCC3 */
};


	/* Wire BRG7 to SMC1 and BRG8 to SMC2 */
	immap->im_cpmux.cmx_smr = 0x11;

Best regards
Marco

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

* Re: CPM uart
  2005-04-14 13:34 ` Marco Schramel
@ 2005-04-14 13:55   ` Dan Malek
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Malek @ 2005-04-14 13:55 UTC (permalink / raw)
  To: Marco Schramel; +Cc: Steven Blakeslee, PPC_LINUX


On Apr 14, 2005, at 9:34 AM, Marco Schramel wrote:

>> The selection of the BRGs is hard coded last time I checked.

Newer drivers don't do this.  They are probably stuck in the 
linuxppc_devel
kernels and never made it into the main tree.  The only problem with
BRGs will be with 8xx, where the max is 4 and some variants have fewer.


	-- Dan

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

* Re: CPM uart
  2005-04-14 12:54   ` Marco Schramel
@ 2005-04-14 15:51     ` Dan Malek
  2005-04-14 23:24     ` Ricardo Scop
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Malek @ 2005-04-14 15:51 UTC (permalink / raw)
  To: Marco Schramel; +Cc: PPC_LINUX


On Apr 14, 2005, at 8:54 AM, Marco Schramel wrote:

> I use kernel version 2.4.25 of denx and the uart version is
> static char *serial_name = "CPM UART driver";
> static char *serial_version = "0.01";

I don't remember the progress of the new cpm serial drivers in 2.4,
I've been spending too much time in 2.6.  If you find a 2.4 kernel
with the new serial driver model (drivers/seral/cpm_uart) that
would be a big help.

> Are there newer versions? Sorry, but i am not up to date with the uart.
> Is my configuration so extraordinary ;-) ?

Yes, there are newer versions and I've never tried what you are
doing.  The console code has always been sensitive to configurations.
Although the #defines may look like it will work, the code often isn't
there to support it, and I know wasn't there in that old version of the 
code.

Thanks.

	-- Dan

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

* Re: CPM uart
  2005-04-14 12:54   ` Marco Schramel
  2005-04-14 15:51     ` Dan Malek
@ 2005-04-14 23:24     ` Ricardo Scop
  2005-04-15  2:50       ` Dan Malek
  1 sibling, 1 reply; 9+ messages in thread
From: Ricardo Scop @ 2005-04-14 23:24 UTC (permalink / raw)
  To: Marco Schramel, PPC_LINUX

Hi Marco,

On Thursday 14 April 2005 09:54, Marco Schramel wrote:
> Hi Dan,
>
> thanks for your answer.
>
> > > During booting kernel hangs on initializing ttyS2 forever.
> >
> > That is the console port, so take a look at the code for its
> > initialization for something affected by this configuration.
> > What kernel are you using?  There have been lots of
> > updates in recent versions.
>
> I use kernel version 2.4.25 of denx and the uart version is
                       ^^^^^^^^^^^^^^

Perusing that code, I can see that the console routines assume that there=
 are=20
_no_ SMC ports initialized before the SCC ports in rs_table. This should =
be=20
fixed before attempting to run your system again.

I suggest you to seek all smc_scc_num references inside both the console=20
routines and the #ifdef SCC_CONSOLE ... #endif code snippets. They should=
 be=20
subtracted by SCC_NUM_BASE whenever they're used to access SCC-related st=
uff,=20
AFAIK.

HTH,

Ricardo Scop.

        \|/
    ___ -*-
   (@ @)/|\
  /  V  \|  R SCOP Consult.
 /(     )\  Linux-based communications
--^^---^^+------------------------------
rscop@matrix.com.br
+55 51 999-36-777
Porto Alegre, RS - BRazil

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

* Re: CPM uart
  2005-04-14 23:24     ` Ricardo Scop
@ 2005-04-15  2:50       ` Dan Malek
  2005-04-15  8:38         ` Marco Schramel
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Malek @ 2005-04-15  2:50 UTC (permalink / raw)
  To: Ricardo Scop; +Cc: PPC_LINUX


On Apr 14, 2005, at 7:24 PM, Ricardo Scop wrote:

> I suggest you to seek all smc_scc_num references inside both the 
> console
> routines and the #ifdef SCC_CONSOLE ... #endif code snippets. They 
> should be
> subtracted by SCC_NUM_BASE whenever they're used to access SCC-related 
> stuff,

This has all been corrected in later versions of the driver.  Take a
look at the linuxppc_2.4_devel or some other BK ppc kernels.  Start
at penguinppc.org for kernel access information.

Yes, I know, it shouldn't be in this state, but it is.  Find the 
various kernel
sources and peruse for what fits your requirements.

Thanks.

	-- Dan

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

* Re: CPM uart
  2005-04-15  2:50       ` Dan Malek
@ 2005-04-15  8:38         ` Marco Schramel
  0 siblings, 0 replies; 9+ messages in thread
From: Marco Schramel @ 2005-04-15  8:38 UTC (permalink / raw)
  To: Dan Malek; +Cc: PPC_LINUX

Hi all,

thanks for helping me.
Now it works with my configuration. 
I added SCC_NUM_BASE as it is without console. And now it works.
#ifdef SCC_CONSOLE
				switch (state->smc_scc_num - SCC_NUM_BASE) {  /*SCC_NUM_BASE added*/
				case 0:
					page = CPM_CR_SCC1_PAGE;
					sblock = CPM_CR_SCC1_SBLOCK;
					break;
				case 1:
					page = CPM_CR_SCC2_PAGE;
					sblock = CPM_CR_SCC2_SBLOCK;
					break;
				case 2:
					page = CPM_CR_SCC3_PAGE;
					sblock = CPM_CR_SCC3_SBLOCK;
					break;
				}
#else
.
.
.

Seems the use of SMC in conjunction with console on SCC was not planed in this version.
Furthermore i will test it and post if it fails. 

Best regards
Marco


---------
Marco Schramel

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

end of thread, other threads:[~2005-04-15  8:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-14  7:26 CPM uart Marco Schramel
2005-04-14 12:01 ` Dan Malek
2005-04-14 12:54   ` Marco Schramel
2005-04-14 15:51     ` Dan Malek
2005-04-14 23:24     ` Ricardo Scop
2005-04-15  2:50       ` Dan Malek
2005-04-15  8:38         ` Marco Schramel
     [not found] <1628E43D99629C46988BE46087A3FBB9205B50@ep-01.EmbeddedPlanet.local>
2005-04-14 13:34 ` Marco Schramel
2005-04-14 13:55   ` 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).