public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Matt Sealey <matt@genesi-usa•com>
To: Grant Likely <grant.likely@secretlab•ca>
Cc: linuxppc-dev@ozlabs•org, olaf@aepfle•de, sven@genesi-usa•com
Subject: Re: [RFC] add phy-handle property for fec_mpc52xx
Date: Wed, 09 Jan 2008 16:56:17 +0000	[thread overview]
Message-ID: <4784FCB1.3010509@genesi-usa.com> (raw)
In-Reply-To: <20080109163058.21643.30876.stgit@trillian.secretlab.ca>

Okay I have a better suggestion.

Apply all the prom_init fixes you like. But, instead of swizzling on the
individual nodes, do it blanket for the firmware version.

For instance, wrap the entire efika fixups stuff with a check for the
openprom property "built-on" - this is the date the firmware was built.
efika.forth will change this!

Just make sure it's less than.. let's say, a certain version of efika.forth,
and I will roll a version which has a higher version and some extra features
like CAN/I2C exposure.

If you run efika.forth it will not touch the device tree. If you don't, it
will add the small amount of patches. Add a huge comment that this hunk of
code should be scheduled for deletion at some later date. Put a Kconfig
around it so it can be taken out, even, at distro option.

Does that sound better? Right now I'm a little too busy to write and
compile test code for it so I will not venture to submit a patch..
do we want to work on a comprehensive, required efika.forth release
that fixes these things together, or is it just my job for now?

-- 
Matt Sealey <matt@genesi-usa•com>
Genesi, Manager, Developer Relations

Grant Likely wrote:
> From: Olaf Hering <olaf@aepfle•de>
> 
> The new network driver fec_mpc52xx will not work on efika because the
> firmware does not provide all required properties.
> http://www.powerdeveloper.org/asset/by-id/46 has a Forth script to
> create more properties. But only the phy stuff is required to get a
> working network.
> 
> This should go into the kernel because its appearently
> impossible to boot the script via tftp and then load the real boot
> binary (yaboot or zimage).
> 
> (Olaf's s-o-b line needs to go here)
> Signed-off-by: Grant Likely <grant.likely@secretlab•ca>
> ---
> 
> Here's my respin of Olaf's patch to move it to fixup_device_tree_efika()
> and to make it check if the nodes exist before blindly creating them.
> 
> Cheers,
> g.
> 
>  arch/powerpc/kernel/prom_init.c |   39 +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 1add6ef..5d89a21 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -2216,6 +2216,45 @@ static void __init fixup_device_tree_efika(void)
>  			prom_printf("fixup_device_tree_efika: ",
>  				"skipped entry %x - setprop error\n", i);
>  	}
> +
> +	/* Make sure ethernet mdio bus node exists */
> +	node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio"));
> +	if (!PHANDLE_VALID(node)) {
> +		prom_printf("Adding Ethernet MDIO node\n");
> +		call_prom("interpret", 1, 1,
> +			" s\" /builtin\" find-device"
> +			" new-device"
> +				" 1 encode-int s\" #address-cells\" property"
> +				" 0 encode-int s\" #size-cells\" property"
> +				" s\" mdio\" 2dup device-name device-type"
> +				" s\" mpc5200b-fec-phy\" encode-string"
> +				" s\" compatible\" property"
> +				" 0xf0003000 0x400 reg"
> +				" 0x2 encode-int"
> +				" 0x5 encode-int encode+"
> +				" 0x3 encode-int encode+"
> +				" s\" interrupts\" property"
> +			" finish-device");
> +	};
> +
> +	/* Make sure ethernet phy device node exist */
> +	node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio/ethernet-phy"));
> +	if (!PHANDLE_VALID(node)) {
> +		prom_printf("Adding Ethernet PHY node\n");
> +		call_prom("interpret", 1, 1,
> +			" s\" /builtin/mdio\" find-device"
> +			" new-device"
> +				" s\" ethernet-phy\" device-name"
> +				" 0x10 encode-int s\" reg\" property"
> +				" my-self"
> +				" ihandle>phandle"
> +			" finish-device"
> +			" s\" /builtin/ethernet\" find-device"
> +				" encode-int"
> +				" s\" phy-handle\" property"
> +			" device-end");
> +	}
> +
>  }
>  #else
>  #define fixup_device_tree_efika()
> 

  reply	other threads:[~2008-01-09 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09 16:32 [RFC] add phy-handle property for fec_mpc52xx Grant Likely
2008-01-09 16:56 ` Matt Sealey [this message]
2008-01-09 17:18   ` Sven Luther
2008-01-09 17:44     ` Matt Sealey
2008-01-10  5:01 ` Benjamin Herrenschmidt
2008-01-10  5:06   ` Grant Likely
2008-01-10 11:46 ` Olaf Hering

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=4784FCB1.3010509@genesi-usa.com \
    --to=matt@genesi-usa$(echo .)com \
    --cc=grant.likely@secretlab$(echo .)ca \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=olaf@aepfle$(echo .)de \
    --cc=sven@genesi-usa$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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