linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@linux.vnet.ibm.com>
To: "Giuseppe Coviello" <cjg@cruxppc.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] Sam440ep support
Date: Mon, 5 May 2008 13:54:04 -0500	[thread overview]
Message-ID: <20080505135404.5c57720e@zod.rchland.ibm.com> (raw)
In-Reply-To: <a265241c0805051123h595123edrd46bf65a8099c3c2@mail.gmail.com>

On Mon, 5 May 2008 20:23:29 +0200
"Giuseppe Coviello" <cjg@cruxppc.org> wrote:

> This patch adds the support for the sam440ep board.

Urgh.  Could you split this into a number of smaller patches, each with
a proper commit message that doesn't break the build on its own?

See some initial comments below.

> diff --git a/arch/powerpc/boot/cuboot-sam440ep.c
> b/arch/powerpc/boot/cuboot-sam440ep.c
> new file mode 100644
> index 0000000..200b35b
> --- /dev/null
> +++ b/arch/powerpc/boot/cuboot-sam440ep.c
> @@ -0,0 +1,35 @@
> +/*
> + * Old U-boot compatibility for Sam440ep based off bamboo.c code
> + * original copyrights below
> + *
> + * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + *
> + * Copyright 2007 IBM Corporation
> + *
> + * Based on cuboot-ebony.c
> + *
> + * Modified from cuboot-bamboo.c for sam440ep:
> + * Copyright 2008 Giuseppe Coviello <cjg@cruxppc.org>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published
> + * by the Free Software Foundation.
> + */
> +
> +#include "ops.h"
> +#include "stdio.h"
> +#include "44x.h"
> +#include "cuboot.h"
> +
> +#define TARGET_4xx
> +#define TARGET_44x
> +#include "ppcboot.h"
> +
> +static bd_t bd;
> +
> +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
> +		unsigned long r6, unsigned long r7)
> +{
> +	CUBOOT_INIT();
> +	sam440ep_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
> +}

I don't see a reason to split out the bootwrapper support into two
separate files.  You should be able to have a single file for it.

> diff --git a/arch/powerpc/platforms/44x/sam440ep.c
> b/arch/powerpc/platforms/44x/sam440ep.c
> new file mode 100644
> index 0000000..a95eb80
> --- /dev/null
> +++ b/arch/powerpc/platforms/44x/sam440ep.c
> @@ -0,0 +1,66 @@
> +#include <linux/init.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/machdep.h>
> +#include <asm/prom.h>
> +#include <asm/udbg.h>
> +#include <asm/time.h>
> +#include <asm/uic.h>
> +#include <asm/pci-bridge.h>
> +#include <asm/ppc4xx.h>
> +
> +static __initdata struct of_device_id sam440ep_of_bus[] = {
> +	{ .compatible = "ibm,plb4", },
> +	{ .compatible = "ibm,opb", },
> +	{ .compatible = "ibm,ebc", },
> +	{},
> +};
> +
> +static int __init sam440ep_device_probe(void)
> +{
> +	of_platform_bus_probe(NULL, sam440ep_of_bus, NULL);
> +
> +	return 0;
> +}
> +machine_device_initcall(sam440ep, sam440ep_device_probe);
> +
> +static int __init sam440ep_probe(void)
> +{
> +	unsigned long root = of_get_flat_dt_root();
> +
> +	if (!of_flat_dt_is_compatible(root, "acube,sam440ep"))
> +		return 0;
> +
> +	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
> +
> +	return 1;
> +}
> +
> +define_machine(sam440ep) {
> +	.name 			= "Sam440ep",
> +	.probe 			= sam440ep_probe,
> +	.progress 		= udbg_progress,
> +	.init_IRQ 		= uic_init_tree,
> +	.get_irq 		= uic_get_irq,
> +	.restart		= ppc4xx_reset_system,
> +	.calibrate_decr 	= generic_calibrate_decr,
> +};

You don't do anything platform specific at all in this file.  You
should be able to just reuse the bamboo.c file.  Look at Yosemite for
how that is done.

> +static int __init sam440ep_i2c_of_init(void)
> +{
> +	struct device_node *np;
> +	unsigned int i = 0;
> +	struct platform_device *i2c_dev;
> +	int ret;
> +
> +	for_each_compatible_node(np, NULL, "ibm,iic") {
> +		struct resource r[2];
> +
> +		memset(&r, 0, sizeof(r));
> +
> +		ret = of_address_to_resource(np, 0, &r[0]);
> +		if (ret)
> +			goto err;
> +
> +		of_irq_to_resource(np, 0, &r[1]);
> +
> +		i2c_dev = platform_device_register_simple("ibm,iic", i, r, 2);
> +		if (IS_ERR(i2c_dev)) {
> +			ret = PTR_ERR(i2c_dev);
> +			goto err;
> +		}
> +
> +		of_register_i2c_devices(np, i++);
> +	}
> +
> +	return 0;
> +
> +err:
> +	return ret;
> +}
> +
> +arch_initcall(sam440ep_i2c_of_init);

Ok, now I'm confused as to why you aren't doing this in your platform
file (which would make it specific, and therefore justify its existence.

> diff --git a/include/asm-powerpc/dma-mapping.h
> b/include/asm-powerpc/dma-mapping.h
> index bbefb69..3a6235a 100644
> --- a/include/asm-powerpc/dma-mapping.h
> +++ b/include/asm-powerpc/dma-mapping.h

You definitely need to explain what you're doing here with a commit log.

> diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
> index 23b7bc0..e7c64ac 100644
> --- a/sound/core/memalloc.c
> +++ b/sound/core/memalloc.c

This needs to be sent to the sound maintainer.  And I'm sure they
probably won't like the ifdefs.

josh

  parent reply	other threads:[~2008-05-05 18:55 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-05 18:23 [PATCH] Sam440ep support Giuseppe Coviello
2008-05-05 18:27 ` Kumar Gala
2008-05-05 19:50   ` Gerhard Pircher
2008-05-05 23:44     ` Benjamin Herrenschmidt
2008-05-06  7:51       ` Gerhard Pircher
2008-05-06  8:48         ` Benjamin Herrenschmidt
2008-05-06  9:16           ` Gerhard Pircher
2008-05-06 10:12             ` Benjamin Herrenschmidt
2008-05-06 11:14               ` Takashi Iwai
2008-05-06 11:25                 ` Benjamin Herrenschmidt
2008-05-06 11:27                   ` Benjamin Herrenschmidt
2008-05-06 11:31                   ` Takashi Iwai
2008-05-06 11:34                     ` Benjamin Herrenschmidt
2008-05-14 12:26             ` ALSA fixes for non-coherent archs (Re: [PATCH] Sam440ep support) Takashi Iwai
2008-05-14 12:50               ` Gerhard Pircher
2008-05-14 21:01               ` Gerhard Pircher
2008-05-15  5:42                 ` Takashi Iwai
2008-05-19 17:23               ` Giuseppe Coviello
2008-05-20 12:48                 ` Takashi Iwai
2008-05-05 23:38   ` [PATCH] Sam440ep support Benjamin Herrenschmidt
2008-05-05 18:54 ` Josh Boyer [this message]
2008-05-05 23:40   ` Benjamin Herrenschmidt
2008-05-06  0:09     ` Josh Boyer
2008-05-05 23:36 ` Benjamin Herrenschmidt
2008-05-06  4:18   ` Sean MacLennan
2008-05-06 16:37 ` Giuseppe Coviello
2008-05-09 15:53   ` Giuseppe Coviello
2008-05-09 20:26     ` Josh Boyer
2008-05-19 12:47   ` Josh Boyer
2008-05-19 15:20     ` Giuseppe Coviello
2008-05-20 12:50       ` Josh Boyer
2008-05-20 13:34         ` Josh Boyer
2008-05-22 17:51           ` Giuseppe Coviello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080505135404.5c57720e@zod.rchland.ibm.com \
    --to=jwboyer@linux.vnet.ibm.com \
    --cc=cjg@cruxppc.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).