[PATCH 4/4] powerpc: Katana750i - Add platform support

Stephen Rothwell sfr at canb.auug.org.au
Tue Jan 15 10:33:46 EST 2008


Hi Mark,

On Mon, 14 Jan 2008 16:00:57 -0700 "Mark A. Greer" <mgreer at mvista.com> wrote:
>
> +++ b/arch/powerpc/platforms/embedded6xx/katana750i.c
> @@ -0,0 +1,314 @@
> +/*
> + * Board setup routines for the Emerson Katana-750i/752i
> + *
> + * Author: Mark A. Greer <mgreer at mvista.com>
> + *
> + * Based on code prpmc2800.c by Dale Farnsworth <dale at farnsworth.org>
> + * and original katana port by Tim Montgomery <timm at artesyncp.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.

A Copyright notice would be nice.

> +static void __init katana750i_setup_arch(void)
> +{
> +	struct device_node *np;
> +	phys_addr_t paddr;
> +	const unsigned int *reg;
> +
> +	/*
> +	 * ioremap mpp and gpp registers in case they are later
> +	 * needed by katana750i_reset_board().
> +	 */
> +	np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-mpp");
> +	reg = of_get_property(np, "reg", NULL);

What happens if np == NULL?

> +	paddr = of_translate_address(np, reg);
> +	of_node_put(np);
> +	mv64x60_mpp_reg_base = ioremap(paddr, reg[1]);
> +
> +	np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp");
> +	reg = of_get_property(np, "reg", NULL);

Ditto.

> +	paddr = of_translate_address(np, reg);
> +	of_node_put(np);
> +	mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
> +
> +#ifdef CONFIG_PCI
> +	mv64x60_pci_init();
> +#endif

Maybe there should be a stub of mv64x60_pci_init for the non PCI case -
that would save the ifdefs in C code.

> +	np = of_find_compatible_node(NULL, NULL, "katana750i,cpld");
> +	reg = of_get_property(np, "reg", NULL);

What if np == NULL?

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080115/b7ddbf2a/attachment.pgp>


More information about the Linuxppc-dev mailing list