public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mgcoge make ether_scc.c work with CONFIG_NET_MULTI
Date: Mon, 10 Nov 2008 09:53:42 -0800	[thread overview]
Message-ID: <49187526.7000902@gmail.com> (raw)
In-Reply-To: <20081110182727.2d66eeb9@ernst.jennejohn.org>

Hi Gary,

Gary Jennejohn wrote:
> Hi Ben,
>
> Ben Warren <biggerbadderben@gmail.com> wrote:
>   
>> Gary Jennejohn wrote:
>>     
> [snip]
>   
>>>  #if defined(CONFIG_ETHER_ON_SCC) && defined(CONFIG_CMD_NET)
>>>   
>>>       
>> While you're mucking around with this file, please settle on a single 
>> CONFIG that can allow conditional compilation from the Makefile, then 
>> get rid of this stuff.
>>
>>     
>
> You mean get rid of CONFIG_ETHER_ON_SCC and CONFIG_CMD_NET?  But isn't at
> least CONFIG_CMD_NET required to get networking support in other parts of
> U-Boot, which would make it a prerequisite for compiling this?
>
> And eliminating or supplementing CONFIG_ETHER_ON_SCC with a new CONFIG
> would mean changing a whole slew of configuration files, not to mention
> include/net.h.
>
>   
I don't mean get rid of them completely, just move the conditionality to 
the Makefile.  IMHO the CONFIG_ETHER_ON_SCC conditional is enough, you 
don't need to check for CONFIG_CMD_NET.  It the user doesn' t have it 
set, problems will show up all over the place, and very quickly.  I'd 
prefer to change the name of CONFIG_ETHER_ON_SCC to something indicating 
82xx-ness, since this driver is specific to the 82xx family of SOCs, but 
SCCs have been around longer than PowerPC.  One thing you'll notice is 
that most of the config files that mention this option are #undef'ing it 
only.
>>> -int eth_send(volatile void *packet, int length)
>>> +int sec_send(struct eth_device *dev, volatile void *packet, int length)
>>>   
>>>       
>> Please give all these functions, except initialize(), file scope (i.e. 
>> make them static).  I'm not crazy about the name 'sec', but if it's 
>> static the objection doesn't carry much weight.  I also can't think of a 
>> better name.
>>
>>     
>
> Yeah, I should have thought of this when I did the mods.
>
> [snip]
>   
>>> +int sec_initialize(bd_t *bis)
>>>   
>>>       
>> For this function with global namespace, please pick a more descriptive 
>> name.  Maybe 82xx_scc_initialize() or something?
>>
>>     
>
> I called it 82xx_scc_enet_initialize() to make its function clear.
>
>   
Perfect.
>>> --- a/net/eth.c
>>> +++ b/net/eth.c
>>> @@ -48,6 +48,8 @@ extern int ppc_4xx_eth_initialize(bd_t *);
>>>  extern int scc_initialize(bd_t*);
>>>  extern int npe_initialize(bd_t *);
>>>  extern int uec_initialize(int);
>>> +extern int sec_initialize(bd_t *);
>>> +extern int keymile_hdlc_enet_initialize(bd_t *);
>>>  
>>>  #ifdef CONFIG_API
>>>  extern void (*push_packet)(volatile void *, int);
>>> @@ -196,6 +198,12 @@ int eth_initialize(bd_t *bis)
>>>  #if defined(CONFIG_IXP4XX_NPE)
>>>  	npe_initialize(bis);
>>>  #endif
>>> +#if defined(CONFIG_ETHER_ON_SCC) && defined(CONFIG_MPC8260)
>>> +	sec_initialize(bis);
>>> +#endif
>>> +#if defined(CONFIG_KEYMILE_HDLC_ENET)
>>> +	keymile_hdlc_enet_initialize(bis);
>>> +#endif
>>>  	if (!eth_devices) {
>>>  		puts ("No ethernet found.\n");
>>>  		show_boot_progress (-64);
>>>   
>>>       
>> Please don't add anything to this file.  All initializations now go in 
>> cpu_eth_init()/board_eth_init().  There are plenty of examples you can 
>> draw from.  Don't forget to add your initializer function to 
>> include/netdev.h
>>
>>     
>
> OK, that should be easy enough.  I've now done it for keymile.
>
>   
>> You get bonus points if you move this driver to drivers/net
>>
>>     
>
> I'll look into it but make no promises.
>   
That's OK, do what you can.  We all have priorities.

regards,
Ben

  reply	other threads:[~2008-11-10 17:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-09 10:58 [U-Boot] [PATCH] mgcoge make ether_scc.c work with CONFIG_NET_MULTI Gary Jennejohn
2008-11-10  6:09 ` Ben Warren
2008-11-10 17:27   ` Gary Jennejohn
2008-11-10 17:53     ` Ben Warren [this message]
2008-11-11 10:41       ` Gary Jennejohn
2008-11-11 16:07 ` [U-Boot] [PATCH v2] " Gary Jennejohn
2008-12-08 20:50   ` Wolfgang Denk
2008-12-08 21:00     ` Wolfgang Denk
2008-12-08 22:05     ` Ben Warren
2008-12-09  8:56       ` Gary Jennejohn

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=49187526.7000902@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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