Question on mpc52xx_common.c

Grant Likely grant.likely at secretlab.ca
Fri Apr 4 06:00:29 EST 2008


(cc'ing the mailing list in my reply)

On Thu, Apr 3, 2008 at 10:27 AM, Detlev Zundel <dzu at denx.de> wrote:
> I wrote,
>
>  > debugging a lite5200b kernel (linux-2.6-denx equivalent of 2.6.25-rc8) I
>  > noticed that in mpc52xx_map_common_devices (mpc52xx_common.c:161) the
>  > cdm module is tentatively mapped.  It seems strange to me that there is no
>  > error checking here.  Is a FDT without an cdm entry usable at all?

Sure, why not?  If the firmware has already set it up correctly and no
devices using it are in use, then the kernel should be okay.  :-)
That said, I can't imagine choosing to not put the cdm node into the
device tree.

>  > Checking for the usage of mpc52xx_cdm I found mpc52xx_set_psc_clkdiv
>  > (mpc52xx_common.c:186) only returning ENODEV when no CDM module is
>  > mapped - but still not even a warning.  Now the only user of
>  > set_psc_clkdiv seems to be drivers/spi/mpc52xx_psc_spi.c:342 where the
>  > return value is not even checked....
>  >
>  > Wouldn't at least a warning on a failed mapping be in order here?

By rights, the psc_spi driver should be fixed to report an error.
Other than that, there are no users of the CDM in-tree right now.

>
>  And yes, I've seen that the lite5200 specific code warns on a missing
>  cdm node but thats no help for other platforms....

And that's because older lite5200 firmware doesn't setup the CDM correctly.

Now, all of the mpc5200 common code needs some work I think.  There
are too many places where bestcomm or other code redundantly goes
looking for common device nodes.  I'd like to amalgamate a bunch of
that stuff to map them all at platform initialization time and provide
an api for retrieving the mapped region or for controlling the shared
device.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list