* re: [POWERPC] 4xx: EP405 boards support for arch/powerpc
@ 2014-10-20 9:06 Dan Carpenter
2014-10-20 10:52 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2014-10-20 9:06 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
Hello Benjamin Herrenschmidt,
The patch 619740384ceb: "[POWERPC] 4xx: EP405 boards support for
arch/powerpc" from Dec 21, 2007, leads to the following static
checker warning:
arch/powerpc/boot/4xx.c:567 ibm405gp_fixup_clocks()
warn: shifting and masking to zero
arch/powerpc/boot/4xx.c
562 fbdv = (pllmr & 0x1e000000) >> 25;
563 if (fbdv == 0)
564 fbdv = 16;
565 cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
566 opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
567 ppdv = ((pllmr & 0x00001800) >> 13) + 1; /* PLB:PCI */
^^^^^^^^^^^^^^^^^^^^^^^^^
This mask and shift means that ppdv is always 1.
568 epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */
569 udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
570
571 /* check for 405GPr */
572 if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) {
573 fwdvb = 8 - (pllmr & 0x00000007);
574 if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */
575 if (psr & 0x00000020) /* New mode enable */
576 m = fwdvb * 2 * ppdv;
577 else
578 m = fwdvb * cbdv * ppdv;
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [POWERPC] 4xx: EP405 boards support for arch/powerpc
2014-10-20 9:06 [POWERPC] 4xx: EP405 boards support for arch/powerpc Dan Carpenter
@ 2014-10-20 10:52 ` Benjamin Herrenschmidt
2014-10-20 19:02 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2014-10-20 10:52 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linuxppc-dev
On Mon, 2014-10-20 at 12:06 +0300, Dan Carpenter wrote:
> Hello Benjamin Herrenschmidt,
>
> The patch 619740384ceb: "[POWERPC] 4xx: EP405 boards support for
> arch/powerpc" from Dec 21, 2007, leads to the following static
> checker warning:
Ah, I even forgot I wrote that ... I'll have to dig out the docs of
that chip, maybe later this week. Thanks !
Cheers,
Ben.
> arch/powerpc/boot/4xx.c:567 ibm405gp_fixup_clocks()
> warn: shifting and masking to zero
>
> arch/powerpc/boot/4xx.c
> 562 fbdv = (pllmr & 0x1e000000) >> 25;
> 563 if (fbdv == 0)
> 564 fbdv = 16;
> 565 cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
> 566 opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
> 567 ppdv = ((pllmr & 0x00001800) >> 13) + 1; /* PLB:PCI */
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> This mask and shift means that ppdv is always 1.
>
> 568 epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */
> 569 udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
> 570
> 571 /* check for 405GPr */
> 572 if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) {
> 573 fwdvb = 8 - (pllmr & 0x00000007);
> 574 if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */
> 575 if (psr & 0x00000020) /* New mode enable */
> 576 m = fwdvb * 2 * ppdv;
> 577 else
> 578 m = fwdvb * cbdv * ppdv;
>
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [POWERPC] 4xx: EP405 boards support for arch/powerpc
2014-10-20 10:52 ` Benjamin Herrenschmidt
@ 2014-10-20 19:02 ` Wolfgang Denk
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2014-10-20 19:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Dan Carpenter
Dear Ben,
In message <1413802359.18300.7.camel@pasglop> you wrote:
>
> Ah, I even forgot I wrote that ... I'll have to dig out the docs of
> that chip, maybe later this week. Thanks !
...
> > 565 cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
> > 566 opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
> > 567 ppdv = ((pllmr & 0x00001800) >> 13) + 1; /* PLB:PCI */
> > ^^^^^^^^^^^^^^^^^^^^^^^^^
> > This mask and shift means that ppdv is always 1.
See 7.7.1 PLL Mode Register (CPC0_PLLMR) page 7.10f:
Bits 17:18 PPDV PCIPLB Frequency Divisor
So that should be (... & 0x00006000) >> 13 ?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Only in our dreams we are free. The rest of the time we need wages.
- Terry Pratchett, _Wyrd Sisters_
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-20 19:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-20 9:06 [POWERPC] 4xx: EP405 boards support for arch/powerpc Dan Carpenter
2014-10-20 10:52 ` Benjamin Herrenschmidt
2014-10-20 19:02 ` Wolfgang Denk
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).