On 12/13/2012 11:29 AM, Florian Fainelli wrote:
> Hello Rafal,
> 
> Le 12/11/12 12:32, Rafał Miłecki a écrit :
>> ---
>> It works, but is missing failure paths (handling allocation errors, etc.)
>>
>> Don't use it in any production environment!
>> ---
>>   drivers/bcma/driver_chipcommon_pmu.c        |    2 +-
>>   drivers/net/ethernet/broadcom/Makefile      |    1 +
>>   drivers/net/ethernet/broadcom/bgmac.c       | 1200
>> +++++++++++++++++++++++++++
>>   drivers/net/ethernet/broadcom/bgmac.h       |  424 ++++++++++
>>   include/linux/bcma/bcma_driver_chipcommon.h |    2 +
>>   5 files changed, 1628 insertions(+), 1 deletions(-)
>>   create mode 100644 drivers/net/ethernet/broadcom/bgmac.c
>>   create mode 100644 drivers/net/ethernet/broadcom/bgmac.h
>>
>> diff --git a/drivers/bcma/driver_chipcommon_pmu.c
>> b/drivers/bcma/driver_chipcommon_pmu.c
>> index e0abb38..ee94e23 100644
>> --- a/drivers/bcma/driver_chipcommon_pmu.c
>> +++ b/drivers/bcma/driver_chipcommon_pmu.c
>> @@ -264,7 +264,7 @@ static u32 bcma_pmu_clock_bcm4706(struct
>> bcma_drv_cc *cc, u32 pll0, u32 m)
>>   }
>>     /* query bus clock frequency for PMU-enabled chipcommon */
>> -static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
>> +u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
>>   {
>>       struct bcma_bus *bus = cc->core->bus;
> 
> At some point, you and Hauke should think about making a SSB/BCMA clock
> driver so that a consumer can just do something like clk_get("gmac") and
> have everything it needs (rate, clock bits enabling etc ...).
> 
> [snip]
> 
> The more I look at the defines below, the more I ask myself whether this
> deserves a separate ethernet driver or if it would not be nicer to just
> enhance b44 with gigabit support, in particular:
> 
> - gmac and b44 share almost the same register offsets and register layouts
> - the differences like DMA engine can be figured out at runtime
> - it should not be too hard to provide an abstraction of the MIB counters
> - the actual dma_desc is different between the two  versions of the
> core, but once again this is not too complicated to abstract
> 
> To start with, we can certainly live with a separate driver, but once
> you reach the point where you want to get this mainline, someone else
> will probably ask the same question as I do.
> 
> We basically had the same concerns when we switched from 10/100 Ethernet
> with the BCM63xx driver to support Gigabit, and besides some changes in
> the DMA hardware, the control plane of the Ethernet MAC remains the
> same, which is pretty much the case here too.

I already thought about adding support for the gigabit core to b44, but
there is not much to share expect for the general control flow.

1. The b44 cores are only in devices supported by ssb, the gmac core
just on SoCs using bcma.
2. The gmac core uses a so called 64 bit dma engine and b44 uses a 32
bit dma engine, they are similar, but most of the offsets are different
and they are using different address widths. The DMA code could also be
shared with b43 (32 + 64 bit) and brcmsmac (64 bit), as all chips use
the same dma engine.
3. The chips supported by b44 and the gmac cores are sharing most of
their registers, but many of the offsets are different, so all the chip
specific parts have to be implemented twice.

It looks like the gmac core is based in the cores b44 supports, and
Broadcom also uses one driver to support both chips, but all the chip
specific code (mostly everything mentioned in the specs) is just used
for the gmac core and not for the 100 MBit/s core.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to