On 23/01/25 15:10, Roger Quadros wrote:
>> Hello Roger,
>>
>> The driver is defined as UCLASS_MISC which should be probed explicitly,
> The driver was originally built without UCLASS_MISC, but
> 
> commit 38922b1f4acc ("net: ti: am65-cpsw: Add support for multi port 
> independent MAC mode")
> 
> Added UCLASS_MISC and states there that 
> " Since top level driver is now UCLASS_MISC, board files would need to
>   instantiate this driver explicitly."
> 
> Not an elegant solution. So we need to fix something in the am65-cpuss driver.
> 
> Looking at drivers/net/mvpp2.c we can see a possible solution.
> 1) don't define .probe for the parent driver (UCLASS_MISC). Instead define 
> .bind
> that will scan the device tree for ports and bind the port device and driver.
> e.g. see mvpp2_base_bind()
> 2) in port driver .probe (UCLASS_ETH), if parent has not been probed
> then call the parent probe (am65_cpsw_probe_nuss) . Also set a flag so parent 
> probe
> only gets called once.
> 3) update all board files no not explicitly probe the am65-cpsw UCLASS_MISC 
> driver.
> 
> Siddharth / Vignesh do you see any issues with this solution?

I like this idea. It may need bit more than moving probe to bind as
there are some reg accesses which shouldn't ideally be done at bind
phase. But should be feasible to drop them.

-- 
Regards
Vignesh
https://ti.com/opensource

Reply via email to