[Top] [All Lists]

Re: [PATCH 1/4] alchemy: register au1000_eth as a platform driver part

To: Florian Fainelli <>
Subject: Re: [PATCH 1/4] alchemy: register au1000_eth as a platform driver part one
From: Sergei Shtylyov <>
Date: Wed, 29 Jul 2009 17:41:14 +0400
Cc: Manuel Lauss <>, Ralf Baechle <>,
In-reply-to: <>
Organization: MontaVista Software Inc.
Original-recipient: rfc822;
References: <> <> <>
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803

Florian Fainelli wrote:

static int __init au1xxx_platform_init(void)
      unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
-       int i;
+       int i, ni;

      /* Fill up uartclk. */
      for (i = 0; au1x00_uart_data[i].flags; i++)
              au1x00_uart_data[i].uartclk = uartclk;

+       /* Register second MAC if enabled in pinfunc */
+#ifndef CONFIG_SOC_AU1100
+        ni = (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4);
+        if (!(ni + 1))
+               platform_device_register(&au1xxx_eth1_device);

This won't work on Au1200/Au1300 since their SYS_PINFUNC register
has a different bit layout.

And you already know that I'm not very fond of alchemy/common/platform.c
;-) I still think you should add appropriate MAC platform information to
the boards which actually use it.

Yes I know ;) I was just wanting to get this out quickly before you kill 

   I'd NAK such patch (and have already done so, AFAIR).

I will make the au1000-eth devices be registered on a per-board basis.

Please don't. You can register them in platform.c, and yet leave actually board specific platform data in the board files. There's no reason to duplicate the platfrom device itself.

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>