[PATCH v2 2/5] net: dwc_eth_qos: Add StarFive ethernet driver glue layer

yanhong wang yanhong.wang at starfivetech.com
Thu Mar 30 04:03:30 CEST 2023



On 2023/3/30 4:02, Simon Glass wrote:
> Hi Yanhong,
> 
> On Wed, 29 Mar 2023 at 23:29, Yanhong Wang
> <yanhong.wang at starfivetech.com> wrote:
>>
>> The StarFive ETHQOS hardware has its own clock and reset,so add a
>> corresponding glue driver to configure them.
>>
>> Signed-off-by: Yanhong Wang <yanhong.wang at starfivetech.com>
>> ---
>>  drivers/net/Kconfig                |   7 +
>>  drivers/net/Makefile               |   1 +
>>  drivers/net/dwc_eth_qos.c          |   6 +
>>  drivers/net/dwc_eth_qos.h          |   1 +
>>  drivers/net/dwc_eth_qos_starfive.c | 249 +++++++++++++++++++++++++++++
>>  5 files changed, 264 insertions(+)
>>  create mode 100644 drivers/net/dwc_eth_qos_starfive.c
>>
> 
> [..]
> 
>> +static struct eqos_ops eqos_jh7110_ops = {
>> +       .eqos_inval_desc = eqos_inval_desc_generic,
>> +       .eqos_flush_desc = eqos_flush_desc_generic,
>> +       .eqos_inval_buffer = eqos_inval_buffer_generic,
>> +       .eqos_flush_buffer = eqos_flush_buffer_generic,
>> +       .eqos_probe_resources = eqos_probe_resources_jh7110,
>> +       .eqos_remove_resources = eqos_remove_resources_jh7110,
>> +       .eqos_stop_resets = eqos_stop_resets_jh7110,
>> +       .eqos_start_resets = eqos_start_resets_jh7110,
>> +       .eqos_stop_clks = eqos_stop_clks_jh7110,
>> +       .eqos_start_clks = eqos_start_clks_jh7110,
>> +       .eqos_calibrate_pads = eqos_null_ops,
>> +       .eqos_disable_calibration = eqos_null_ops,
>> +       .eqos_set_tx_clk_speed = eqos_set_tx_clk_speed_jh7110,
>> +       .eqos_get_enetaddr = eqos_null_ops,
>> +       .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_jh7110
>> +};
> 
> What is eqos_ops? Why is this layer needed in U-Boot?
> 
The JH7110 uses the Synopsys Designware Ethernet QOS (Quality Of Service) IP block, 
the driver implementation uses 'dwc_eth_qos.c,' but there are some differences 
in clock and reset, so there is a corresponding glue layer. This glue layer references 
the implementation of 'dwc_eth_qos_imx.c' and 'dwc_eth_qos_qcom.c'.

> Can you not use driver model directly?
> If you use the driver model directly, many of the implementations are the same 
as "dwc_eth_qos.c", so to avoid duplicate implementations, just add the glue layer.

> Regards,
> Simon


More information about the U-Boot mailing list