[U-Boot] [PATCH] Add NanoBone board support

Mark Jackson mpfj-list at newflow.co.uk
Mon Apr 22 12:04:51 CEST 2013


On 16/04/13 20:22, Tom Rini wrote:
> On Tue, Apr 16, 2013 at 08:14:13PM +0100, Mark Jackson wrote:
> 
>> On 16/04/13 16:48, Tom Rini wrote:
>>> On Tue, Apr 16, 2013 at 04:02:34PM +0100, Mark Jackson wrote:

<snip>

>>>> +static struct cpsw_platform_data cpsw_data = {
>>>> +	.mdio_base		= CPSW_MDIO_BASE,
>>>> +	.cpsw_base		= CPSW_BASE,
>>>> +	.mdio_div		= 0xff,
>>>> +	.channels		= 8,
>>>> +	.cpdma_reg_ofs		= 0x800,
>>>> +	.slaves			= 2,
>>>
>>> Is this all that was needed for both interfaces to work in U-Boot, along
>>> with a config change or two?  If so, I should take a stab at getting
>>> both working on the EVM-SK.
>>
>> Yes ... the config change is just to set CONFIG_PHY_ADDR to the
>> correct value.
>>
>> Unfortunately, since the CONFIG_PHY_ADDR value is "hard-coded" into
>> quite a bit of the uboot code, to change ports, you need to
>> re-compile !!  Not ideal, and I don't suppose it's too much work to
>> get both
>> working together, but I don't see much demand for it.
> 
> Ah, so it's not quite right :(  Other platforms support multiple
> interfaces, but I don't know how they're setup.

Tom

I can see in drivers/net/cpsw.c:-

static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave)
{
...
	phydev = phy_connect(priv->bus,
			CONFIG_PHY_ADDR,
			dev,
			slave->data->phy_if);
...
}

As you can see the hardcoded CONFIG_PHY_ADDR is being used, despite the
fact that it might be different for each slave.

Could you just replace that with "slave->data->phy_id" ?

I'll give it a try and see what happens.

Cheers
Mark J.


More information about the U-Boot mailing list