From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH v2] Add mechanisms for CPU and board-specific Ethernet initialization
Date: Tue, 10 Jun 2008 09:11:50 -0700 [thread overview]
Message-ID: <484EA7C6.5050900@gmail.com> (raw)
In-Reply-To: <1213112264.16606.7.camel@ld0161-tx32>
Jon Loeliger wrote:
> On Tue, 2008-06-10 at 07:03 -0700, Ben Warren wrote:
>
>> +#if defined(CONFIG_TSEC1)
>> + tsec_initialize(bis, 0, CONFIG_TSEC1_NAME);
>> +#endif
>> +#if defined(CONFIG_TSEC2)
>> + tsec_initialize(bis, 1, CONFIG_TSEC2_NAME);
>> +#endif
>> +#if defined(CONFIG_MPC85XX_FEC)
>> + tsec_initialize(bis, 2, CONFIG_MPC85XX_FEC_NAME);
>> +#else
>> +#if defined(CONFIG_TSEC3)
>> + tsec_initialize(bis, 2, CONFIG_TSEC3_NAME);
>> +#endif
>> +#if defined(CONFIG_TSEC4)
>> + tsec_initialize(bis, 3, CONFIG_TSEC4_NAME);
>> +#endif
>> +#endif
>> + return 0;
>> +}
>>
>
> So, why not make a new function in tsec.c called something
> like tsec_initialize_all(bis) with essentially the above
> #ifdef-series and make all of the individual board functions
> just be like:
>
> +int board_eth_init(bd_t *bis)
> +{
> + tsec_initialize_all(bis);
> + return 0;
> +}
>
>
I'd prefer to abstract index information away from the drivers. That
way if you guys come up with a chip that has 8 TSECs, the driver doesn't
have to change. Next release cycle I'm planning on bringing in PHY lib
support, in which case we'll want to pass specific info to each instance
of the TSEC. That said, what you're suggesting would be a good
candidate for a cpu_eth_init() function, that can be overridden by
board_eth_init() if desired. Ya man, I dig it. I'll play around with
that tonight.
> Just a notion. Haven't actually thought about it...
>
>
Please keep not thinking. It's more interesting than most peoples'
fully-baked discussion :)
> jdl
>
>
cheers,
Ben
prev parent reply other threads:[~2008-06-10 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 14:03 [U-Boot-Users] [PATCH v2] Add mechanisms for CPU and board-specific Ethernet initialization Ben Warren
2008-06-10 15:37 ` Jon Loeliger
2008-06-10 16:11 ` Ben Warren [this message]
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=484EA7C6.5050900@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