[U-Boot] Micrel Controller KSZ8841-16MBL
Ben Warren
biggerbadderben at gmail.com
Wed Jun 23 02:26:09 CEST 2010
Hi Steve,
On 6/22/2010 4:44 PM, Steve Sakoman wrote:
> On Tue, Jun 15, 2010 at 9:14 AM, Ben Warren<biggerbadderben at gmail.com> wrote:
>
>> Hi Douglas,
>>
>> On Tue, Jun 15, 2010 at 7:24 AM, Douglas Lopes Pereira<
>> douglaslopespereira at gmail.com> wrote:
>>
>>
>>> Hi all,
>>>
>>> I managed to get KS8841 driver recognized by u-boot. But I'm certain that
>>> it was not in the correct way.
>>>
>>> The driver I've found on BlackFin forum was written for a 2008 u-boot
>>> version and we are working on a 1.3.1 (very old) version. So I just modify
>>> some function calls.
>>>
>>> The problem is that the KS8841 driver does not have a ks884x_initialize
>>> function. So we created it. All it does is create and fill an eth_device
>>> structure. Register it using eth_register function and them it should
>>> initialize the PHY (that is what I suppose it should do).
>>>
>>> Since I am not sure on how to do that, I just called the ks884x_init
>>> function.
>>>
>>> It ends in a TRAP message just after the Micrel device being printed at the
>>> console.
>>>
>>> Could anyone point me out some directions to get my driver correctly
>>> initialized?
>>>
>>> Looks like that driver's using the old API. I have my new one almost
>>>
>> finished and will send it to you today. Hopefully debugging it will be
>> trivial.
>>
> I've just started looking at doing a KS8851 driver (on SPI) for one of
> the OMAP4 boards.
>
> Did you start from scratch with the KS8841 driver or did you begin
> with Micrel sample code?
>
> The Micrel sample u-boot driver clearly can't be used as is since it
> doesn't even come close to following the coding style guidelines
> (CamelCase, etc) and is for an older u-boot revision.
>
> I'm debating whether it makes more sense to correct the coding style
> on the vendor code, or just start from scratch. Any advice based on
> your experience?
>
>
A few years ago I wrote a driver for KS8841 and got it working (16-bit
memory-mapped on PowerPC). I started with the Micrel driver, but as you
know it's pretty ugly. Last week I dusted off that old driver and got
it to compile with the latest U-boot, but wasn't able to test it because
the company that I worked for is long gone. It's hopefully close to
functional, but still has too many style issues to post publicly. I
sent the driver to Douglas off-line, and am awaiting feedback. If you'd
like, I can send it to you too. It'd be nice to have a single driver
that handles different chips, but with configurable accessors.
> Steve
>
regards,
Ben
More information about the U-Boot
mailing list