linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Input to the timerclk on the MPC8280
@ 2005-01-19 22:08 annamaya
  2005-01-20 11:00 ` Hans Schillstrom
  0 siblings, 1 reply; 5+ messages in thread
From: annamaya @ 2005-01-19 22:08 UTC (permalink / raw)
  To: linuxppc-embedded

I've asked this question on this forum before but it
did not get answered. I tried asking the same question
in the U-Boot forum with no results. So, I am going to
try this again.

According to section 4.1.2 on Page 4-4 in the MPC8280
User's Manual, one should be able to use a combination
of  external clocks on Port C pins 25, 26, 27 and 29,
the CPM cloak and BRG1 to generate a 32KHz or a 4MHz
clock. I am unable to find  any code in u-boot or any
other place that initializes any of these pins to be
external clocks. And as for BRG1, I believe it is
being used for the SMC clock.

I am unable to understand how this is done. Can we
have a timerclk input WITHOUT an external clock
signal? Can I just use the CPM clock to generate this?
How is this being done in U-Boot now?

Thanks much for your help. I really need an answer to
this. 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

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

* Re: Input to the timerclk on the MPC8280
  2005-01-19 22:08 Input to the timerclk on the MPC8280 annamaya
@ 2005-01-20 11:00 ` Hans Schillstrom
  2005-01-20 15:47   ` annamaya
  2005-01-20 16:50   ` annamaya
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Schillstrom @ 2005-01-20 11:00 UTC (permalink / raw)
  To: annamaya; +Cc: linuxppc-embedded

Hi,
I have the same problem on MPC8270,
and solved it two parts in u-boot:
- Setup you PC[26] to somtething else than TMCLK ex. g,p. I/O
    then you an automatic selecttion of BRG1 as source.
    
- Write a proper value in BRGC1 and make shure that 
    bit 16-17 is 0 for selection of CPM as clock source.

and then you have to "move around the brgs" in (2.6.10)
drivers/serial/cpm_uart/cpm_uart_cpm2.c

I moved smc 1&2 to brg7 & 8
scc1 to brg2 etc
scc4 ext clk (48MHz for USB)

void smc1_lineif(struct uart_cpm_port *pinfo)
{
	volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;

	/* SMC1 is only on port D */
	io->iop_ppard |= 0x00c00000;
	io->iop_pdird |= 0x00400000;
	io->iop_pdird &= ~0x00800000;
	io->iop_psord &= ~0x00c00000;
#ifndef CONFIG_RCB8270
	/* Wire BRG1 to SMC1 */
	cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
	pinfo->brg = 1;
#else
        /* Wire BRG7 to SMC1 */
        cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
        cpm2_immr->im_cpmux.cmx_smr |= 0x10;  /* BRG 7 */
        pinfo->brg = 7;
#endif
}

I guess you can do it in many ways ...

Any one that knows why SMC1 & SMC2 gets the same BRG as SCC1 & SCC2

Regards
/Hans
 
On Wed, 2005-01-19 at 23:08, annamaya wrote:
> I've asked this question on this forum before but it
> did not get answered. I tried asking the same question
> in the U-Boot forum with no results. So, I am going to
> try this again.
> 
> According to section 4.1.2 on Page 4-4 in the MPC8280
> User's Manual, one should be able to use a combination
> of  external clocks on Port C pins 25, 26, 27 and 29,
> the CPM cloak and BRG1 to generate a 32KHz or a 4MHz
> clock. I am unable to find  any code in u-boot or any
> other place that initializes any of these pins to be
> external clocks. And as for BRG1, I believe it is
> being used for the SMC clock.
> 
> I am unable to understand how this is done. Can we
> have a timerclk input WITHOUT an external clock
> signal? Can I just use the CPM clock to generate this?
> How is this being done in U-Boot now?
> 
> Thanks much for your help. I really need an answer to
> this. 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - now with 250MB free storage. Learn more.
> http://info.mail.yahoo.com/mail_250
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

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

* Re: Input to the timerclk on the MPC8280
  2005-01-20 11:00 ` Hans Schillstrom
@ 2005-01-20 15:47   ` annamaya
  2005-01-20 16:14     ` Hans Schillstrom
  2005-01-20 16:50   ` annamaya
  1 sibling, 1 reply; 5+ messages in thread
From: annamaya @ 2005-01-20 15:47 UTC (permalink / raw)
  To: Hans Schillstrom; +Cc: linuxppc-embedded

Thanks a lot for the reply. I have some more questions
on this. When and where in U-Boot do you set the value
of BRGC1? Can I do this somewhere in board_init() or
do I have to do it earlier, like in cpu_init? And I
will have to set the values in the DIV16 and CD to
produce an output of 4Mhz or 32Khz. Is that correct?

BTW, how was this ever done on the MPC8260? I dont see
any code in U-Boot for an 8260 board that does sothing
similar?

--- Hans Schillstrom <hans.schillstrom@pwav.com>
wrote:

> Hi,
> I have the same problem on MPC8270,
> and solved it two parts in u-boot:
> - Setup you PC[26] to somtething else than TMCLK ex.
> g,p. I/O
>     then you an automatic selecttion of BRG1 as
> source.
>     
> - Write a proper value in BRGC1 and make sure that 
>     bit 16-17 is 0 for selection of CPM as clock
> source.
> 
> and then you have to "move around the brgs" in
> (2.6.10)
> drivers/serial/cpm_uart/cpm_uart_cpm2.c
> 
> I moved smc 1&2 to brg7 & 8
> scc1 to brg2 etc
> scc4 ext clk (48MHz for USB)
> 
> void smc1_lineif(struct uart_cpm_port *pinfo)
> {
> 	volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
> 
> 	/* SMC1 is only on port D */
> 	io->iop_ppard |= 0x00c00000;
> 	io->iop_pdird |= 0x00400000;
> 	io->iop_pdird &= ~0x00800000;
> 	io->iop_psord &= ~0x00c00000;
> #ifndef CONFIG_RCB8270
> 	/* Wire BRG1 to SMC1 */
> 	cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
> 	pinfo->brg = 1;
> #else
>         /* Wire BRG7 to SMC1 */
>         cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
>         cpm2_immr->im_cpmux.cmx_smr |= 0x10;  /* BRG
> 7 */
>         pinfo->brg = 7;
> #endif
> }
> 
> I guess you can do it in many ways ...
> 
> Any one that knows why SMC1 & SMC2 gets the same BRG
> as SCC1 & SCC2
> 
> Regards
> /Hans
>  
> On Wed, 2005-01-19 at 23:08, annamaya wrote:
> > I've asked this question on this forum before but
> it
> > did not get answered. I tried asking the same
> question
> > in the U-Boot forum with no results. So, I am
> going to
> > try this again.
> > 
> > According to section 4.1.2 on Page 4-4 in the
> MPC8280
> > User's Manual, one should be able to use a
> combination
> > of  external clocks on Port C pins 25, 26, 27 and
> 29,
> > the CPM cloak and BRG1 to generate a 32KHz or a
> 4MHz
> > clock. I am unable to find  any code in u-boot or
> any
> > other place that initializes any of these pins to
> be
> > external clocks. And as for BRG1, I believe it is
> > being used for the SMC clock.
> > 
> > I am unable to understand how this is done. Can we
> > have a timerclk input WITHOUT an external clock
> > signal? Can I just use the CPM clock to generate
> this?
> > How is this being done in U-Boot now?
> > 
> > Thanks much for your help. I really need an answer
> to
> > this. 
> > 
> > 
> > 		
> > __________________________________ 
> > Do you Yahoo!? 
> > Yahoo! Mail - now with 250MB free storage. Learn
> more.
> > http://info.mail.yahoo.com/mail_250
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> >
>
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

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

* Re: Input to the timerclk on the MPC8280
  2005-01-20 15:47   ` annamaya
@ 2005-01-20 16:14     ` Hans Schillstrom
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Schillstrom @ 2005-01-20 16:14 UTC (permalink / raw)
  To: annamaya; +Cc: linuxppc-embedded

Hi,

On Thu, 2005-01-20 at 16:47, annamaya wrote:
> Thanks a lot for the reply. I have some more questions
> on this. When and where in U-Boot do you set the value
> of BRGC1? Can I do this somewhere in board_init() or
> do I have to do it earlier, like in cpu_init? 
I think misc_init_f(), is a good idea
rememer to enable it with CONFIG_MISC_INIT_F

> And I
> will have to set the values in the DIV16 and CD to
> produce an output of 4Mhz or 32Khz. Is that correct?
> 
Yes

> BTW, how was this ever done on the MPC8260? I dont see
> any code in U-Boot for an 8260 board that does sothing
> similar?
> 
I havn't seen it before....

> --- Hans Schillstrom <hans.schillstrom@pwav.com>
> wrote:
> 
> > Hi,
> > I have the same problem on MPC8270,
> > and solved it two parts in u-boot:
> > - Setup you PC[26] to somtething else than TMCLK ex.
> > g,p. I/O
> >     then you an automatic selecttion of BRG1 as
> > source.
> >     
> > - Write a proper value in BRGC1 and make sure that 
> >     bit 16-17 is 0 for selection of CPM as clock
> > source.
> > 
> > and then you have to "move around the brgs" in
> > (2.6.10)
> > drivers/serial/cpm_uart/cpm_uart_cpm2.c
> > 
> > I moved smc 1&2 to brg7 & 8
> > scc1 to brg2 etc
> > scc4 ext clk (48MHz for USB)
> > 
> > void smc1_lineif(struct uart_cpm_port *pinfo)
> > {
> > 	volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
> > 
> > 	/* SMC1 is only on port D */
> > 	io->iop_ppard |= 0x00c00000;
> > 	io->iop_pdird |= 0x00400000;
> > 	io->iop_pdird &= ~0x00800000;
> > 	io->iop_psord &= ~0x00c00000;
> > #ifndef CONFIG_RCB8270
> > 	/* Wire BRG1 to SMC1 */
> > 	cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
> > 	pinfo->brg = 1;
> > #else
> >         /* Wire BRG7 to SMC1 */
> >         cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
> >         cpm2_immr->im_cpmux.cmx_smr |= 0x10;  /* BRG
> > 7 */
> >         pinfo->brg = 7;
> > #endif
> > }
> > 
> > I guess you can do it in many ways ...
> > 
> > Any one that knows why SMC1 & SMC2 gets the same BRG
> > as SCC1 & SCC2
> > 
> > Regards
> > /Hans
> >  
> > On Wed, 2005-01-19 at 23:08, annamaya wrote:
> > > I've asked this question on this forum before but
> > it
> > > did not get answered. I tried asking the same
> > question
> > > in the U-Boot forum with no results. So, I am
> > going to
> > > try this again.
> > > 
> > > According to section 4.1.2 on Page 4-4 in the
> > MPC8280
> > > User's Manual, one should be able to use a
> > combination
> > > of  external clocks on Port C pins 25, 26, 27 and
> > 29,
> > > the CPM cloak and BRG1 to generate a 32KHz or a
> > 4MHz
> > > clock. I am unable to find  any code in u-boot or
> > any
> > > other place that initializes any of these pins to
> > be
> > > external clocks. And as for BRG1, I believe it is
> > > being used for the SMC clock.
> > > 
> > > I am unable to understand how this is done. Can we
> > > have a timerclk input WITHOUT an external clock
> > > signal? Can I just use the CPM clock to generate
> > this?
> > > How is this being done in U-Boot now?
> > > 
> > > Thanks much for your help. I really need an answer
> > to
> > > this. 
> > > 
> > > 
> > > 		
> > > __________________________________ 
> > > Do you Yahoo!? 
> > > Yahoo! Mail - now with 250MB free storage. Learn
> > more.
> > > http://info.mail.yahoo.com/mail_250
> > > _______________________________________________
> > > Linuxppc-embedded mailing list
> > > Linuxppc-embedded@ozlabs.org
> > >
> >
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> > 
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Easier than ever with enhanced search. Learn more.
> http://info.mail.yahoo.com/mail_250

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

* Re: Input to the timerclk on the MPC8280
  2005-01-20 11:00 ` Hans Schillstrom
  2005-01-20 15:47   ` annamaya
@ 2005-01-20 16:50   ` annamaya
  1 sibling, 0 replies; 5+ messages in thread
From: annamaya @ 2005-01-20 16:50 UTC (permalink / raw)
  To: Hans Schillstrom; +Cc: linuxppc-embedded

Hi again,

I was looking at the serial code for U-Boot and
noticed that in the version I have which is 1.1.1,
SMC's are using BRG 6 and BRG 7 and SCC's are using
BRG's 0 through 3. I am guesing that you fixed this in
a older version of U-Boot. I justed wanted you to know
that it looks like this has been fixed in the current
U-Boot code. Thanks for your help again.


--- Hans Schillstrom <hans.schillstrom@pwav.com>
wrote:

> Hi,
> I have the same problem on MPC8270,
> and solved it two parts in u-boot:
> - Setup you PC[26] to somtething else than TMCLK ex.
> g,p. I/O
>     then you an automatic selecttion of BRG1 as
> source.
>     
> - Write a proper value in BRGC1 and make shure that 
>     bit 16-17 is 0 for selection of CPM as clock
> source.
> 
> and then you have to "move around the brgs" in
> (2.6.10)
> drivers/serial/cpm_uart/cpm_uart_cpm2.c
> 
> I moved smc 1&2 to brg7 & 8
> scc1 to brg2 etc
> scc4 ext clk (48MHz for USB)
> 
> void smc1_lineif(struct uart_cpm_port *pinfo)
> {
> 	volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
> 
> 	/* SMC1 is only on port D */
> 	io->iop_ppard |= 0x00c00000;
> 	io->iop_pdird |= 0x00400000;
> 	io->iop_pdird &= ~0x00800000;
> 	io->iop_psord &= ~0x00c00000;
> #ifndef CONFIG_RCB8270
> 	/* Wire BRG1 to SMC1 */
> 	cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
> 	pinfo->brg = 1;
> #else
>         /* Wire BRG7 to SMC1 */
>         cpm2_immr->im_cpmux.cmx_smr &= 0x0f;
>         cpm2_immr->im_cpmux.cmx_smr |= 0x10;  /* BRG
> 7 */
>         pinfo->brg = 7;
> #endif
> }
> 
> I guess you can do it in many ways ...
> 
> Any one that knows why SMC1 & SMC2 gets the same BRG
> as SCC1 & SCC2
> 
> Regards
> /Hans
>  
> On Wed, 2005-01-19 at 23:08, annamaya wrote:
> > I've asked this question on this forum before but
> it
> > did not get answered. I tried asking the same
> question
> > in the U-Boot forum with no results. So, I am
> going to
> > try this again.
> > 
> > According to section 4.1.2 on Page 4-4 in the
> MPC8280
> > User's Manual, one should be able to use a
> combination
> > of  external clocks on Port C pins 25, 26, 27 and
> 29,
> > the CPM cloak and BRG1 to generate a 32KHz or a
> 4MHz
> > clock. I am unable to find  any code in u-boot or
> any
> > other place that initializes any of these pins to
> be
> > external clocks. And as for BRG1, I believe it is
> > being used for the SMC clock.
> > 
> > I am unable to understand how this is done. Can we
> > have a timerclk input WITHOUT an external clock
> > signal? Can I just use the CPM clock to generate
> this?
> > How is this being done in U-Boot now?
> > 
> > Thanks much for your help. I really need an answer
> to
> > this. 
> > 
> > 
> > 		
> > __________________________________ 
> > Do you Yahoo!? 
> > Yahoo! Mail - now with 250MB free storage. Learn
> more.
> > http://info.mail.yahoo.com/mail_250
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> >
>
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 



		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 

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

end of thread, other threads:[~2005-01-20 18:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-19 22:08 Input to the timerclk on the MPC8280 annamaya
2005-01-20 11:00 ` Hans Schillstrom
2005-01-20 15:47   ` annamaya
2005-01-20 16:14     ` Hans Schillstrom
2005-01-20 16:50   ` annamaya

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