From: Roger Quadros <rogerq@kernel.org>
To: Chintan Vankar <c-vankar@ti.com>,
AKASHI Takahiro <akashi.tkhro@gmail.com>,
Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Christian Marangi <ansuelsmth@gmail.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Sughosh Ganu <sughosh.ganu@linaro.org>,
Nishanth Menon <nm@ti.com>, Hari Nagalla <hnagalla@ti.com>,
Jonathan Humphreys <j-humphreys@ti.com>,
Andreas Dannenberg <dannenberg@ti.com>,
Simon Glass <sjg@chromium.org>,
Jayesh Choudhary <j-choudhary@ti.com>,
Aniket Limaye <a-limaye@ti.com>,
Aradhya Bhatia <a-bhatia1@ti.com>,
Neha Malcom Francis <n-francis@ti.com>, Andrew Davis <afd@ti.com>,
Ramon Fried <rfried.dev@gmail.com>,
Joe Hershberger <joe.hershberger@ni.com>,
Bryan Brattlof <bb@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
Manorit Chawdhry <m-chawdhry@ti.com>,
Tom Rini <trini@konsulko.com>,
Siddharth Vadapalli <s-vadapalli@ti.com>
Cc: srk@ti.com, danishanwar@ti.com, u-boot@lists.denx.de
Subject: Re: [PATCH 04/13] arm: mach-k3: j721s2_init: Probe AM65 CPSW NUSS for R5/A72 SPL
Date: Tue, 28 Jan 2025 11:56:00 +0200 [thread overview]
Message-ID: <87ef4af8-6086-4091-b7f2-bf7b81941ff4@kernel.org> (raw)
In-Reply-To: <2ded45c3-f452-42b5-ae67-a1a14e3138ef@ti.com>
On 28/01/2025 06:09, Chintan Vankar wrote:
>
>
> On 23/01/25 15:10, Roger Quadros wrote:
>> +Vignesh & Siddharth
>>
>> On 22/01/2025 10:53, Chintan Vankar wrote:
>>>
>>>
>>> On 07/01/25 20:03, Roger Quadros wrote:
>>>>
>>>>
>>>> On 07/01/2025 11:38, Chintan Vankar wrote:
>>>>> To support Ethernet boot on AM68-SK, probe AM65 CPSW NUSS driver in
>>>>> board_init_f().
>>>>>
>>>>> Signed-off-by: Chintan Vankar <c-vankar@ti.com>
>>>>> ---
>>>>> arch/arm/mach-k3/j721s2/j721s2_init.c | 10 ++++++++++
>>>>> 1 file changed, 10 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm/mach-k3/j721s2/j721s2_init.c b/arch/arm/mach-k3/j721s2/j721s2_init.c
>>>>> index 6ce3eb87efb..7208bee5785 100644
>>>>> --- a/arch/arm/mach-k3/j721s2/j721s2_init.c
>>>>> +++ b/arch/arm/mach-k3/j721s2/j721s2_init.c
>>>>> @@ -329,6 +329,16 @@ void board_init_f(ulong dummy)
>>>>> setup_qos();
>>>>> + if (IS_ENABLED(CONFIG_SPL_ETH) && IS_ENABLED(CONFIG_TI_AM65_CPSW_NUSS) &&
>>>>> + spl_boot_device() == BOOT_DEVICE_ETHERNET) {
>>>>> + struct udevice *cpswdev;
>>>>> +
>>>>> + ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(am65_cpsw_nuss),
>>>>> + &cpswdev);
>>>>> + if (ret)
>>>>> + printf("Failed to probe am65_cpsw_nuss driver..\n");
>>>>> + }
>>>>> +
>>>>
>>>> This looks like a hack. Please find out why the Ethernet driver is not being
>>>> probed when SPL tries to load image over net.
>>>>
>>>
>>> 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?
>>
>
> Hello Roger, I have tried to understand your approach, I will work on
> that. But for now, is it possible to merge the seris with the existing
> approach ?
Hi Chintan,
I'm afraid that if we allow this for one board it will set a wrong example
for others.
It is a very simple solution and shouldn't take much time. In case you are
stuck me or Siddharth could help. Thanks!
>
>>> I have discussed the same with Nishanth in following thread:
>>> https://lore.kernel.org/all/ee1d16fd-b99b-4b07-97bb-a896e179157a@ti.com/
>>>
>>>> We have the following defined at the am65-cpsw-nuss driver.
>>>>
>>>> U_BOOT_DRIVER(am65_cpsw_nuss) = {
>>>> .name = "am65_cpsw_nuss",
>>>> .id = UCLASS_MISC,
>>>> .of_match = am65_cpsw_nuss_ids,
>>>> .probe = am65_cpsw_probe_nuss,
>>>> .priv_auto = sizeof(struct am65_cpsw_common),
>>>> };
>>>>
>>>> U_BOOT_DRIVER(am65_cpsw_nuss_port) = {
>>>> .name = "am65_cpsw_nuss_port",
>>>> .id = UCLASS_ETH,
>>>> .probe = am65_cpsw_port_probe,
>>>> .ops = &am65_cpsw_ops,
>>>> .priv_auto = sizeof(struct am65_cpsw_priv),
>>>> .plat_auto = sizeof(struct eth_pdata),
>>>> .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_OS_PREPARE,
>>>> };
>>>>
>>>> It looks like am65_cpsw_probe_nuss() is not being invoked for you.
>>>>
>>>> Can you please check if am65_cpsw_port_probe() was invoked?
>>>> If yes but am65_cpsw_probe_nuss() was not then we need to fix the
>>>> DM hierarchy for AM65_CPSW?
>>>>
>>> None of the probe function is getting invoked here, since we need
>>
>> That is strange. am65_cpsw_probe_nuss() should be called at least for
>> port 0 since it is defined as UCLASS_ETH.
>>
>
> am65_cpsw_probe_nuss() is defined as UCLASS_MISC and not UCLASS_ETH, it
> will get invoked if declared as UCLASS_ETH, as per your suggestion above
> it will need driver changes to invoke the probe function without being
> called explicitly and work properly.
>
>>> Ethernet functionality here we need to probe function in board_init_f().
>>> We have discussed the same at here:
>>> https://lore.kernel.org/r/d68c8045-116a-49c0-9e74-d6a366e6f008@kernel.org/#t
>>>
>>>
>>>>> if (IS_ENABLED(CONFIG_CPU_V7R) && IS_ENABLED(CONFIG_K3_AVS0)) {
>>>>> ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_avs),
>>>>> &dev);
>>>>
>>
--
cheers,
-roger
next prev parent reply other threads:[~2025-01-28 9:56 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 9:38 [PATCH 00/13] Add support for Ethernet boot on AM62p-SK and AM68-SK Chintan Vankar
2025-01-07 9:38 ` [PATCH 01/13] net: tftp: Increase TFTP pkt string length to include null character Chintan Vankar
2025-01-07 14:22 ` Tom Rini
2025-01-09 7:11 ` Vankar, Chintan
2025-01-09 15:27 ` Tom Rini
2025-03-20 7:14 ` Wadim Egorov
2025-03-20 7:26 ` Chintan Vankar
2025-01-07 9:38 ` [PATCH 02/13] arm: mach-k3: j721s2: Update SoC auto-gen data to enable Ethernet boot Chintan Vankar
2025-01-07 13:41 ` Bryan Brattlof
2025-01-07 9:38 ` [PATCH 03/13] arm: mach-k3: j721s2_spl: Alias Ethernet boot to CPGMAC Chintan Vankar
2025-01-07 9:38 ` [PATCH 04/13] arm: mach-k3: j721s2_init: Probe AM65 CPSW NUSS for R5/A72 SPL Chintan Vankar
2025-01-07 14:33 ` Roger Quadros
2025-01-22 8:53 ` Chintan Vankar
2025-01-23 9:40 ` Roger Quadros
2025-01-24 3:52 ` Vignesh Raghavendra
2025-01-28 4:09 ` Chintan Vankar
2025-01-28 9:56 ` Roger Quadros [this message]
2025-01-07 9:38 ` [PATCH 05/13] configs: am68: Add configs for enabling Ethboot in R5SPL Chintan Vankar
2025-01-07 14:38 ` Roger Quadros
2025-01-09 8:43 ` Vankar, Chintan
2025-01-09 16:44 ` Roger Quadros
2025-01-07 9:38 ` [PATCH 06/13] configs: am68: Enable configs required for Ethernet boot Chintan Vankar
2025-01-07 14:40 ` Roger Quadros
2025-01-07 9:38 ` [PATCH 07/13] arm: dts: k3-am68-sk-base-board-u-boot: Add bootph-all property to necessary nodes Chintan Vankar
2025-01-07 9:38 ` [PATCH 08/13] arm: mach-k3: am62p: Update SoC auto-gen data to enable CPSW boot Chintan Vankar
2025-01-07 13:58 ` Bryan Brattlof
2025-01-07 9:38 ` [PATCH 09/13] arm: mach-k3: am62p5_init: Probe AM65 CPSW NUSS for R5/A53 SPL Chintan Vankar
2025-01-07 13:38 ` Bryan Brattlof
2025-01-07 14:18 ` Roger Quadros
2025-01-07 9:38 ` [PATCH 10/13] board: ti: am62px: evm: Enable cache for AM62p Chintan Vankar
2025-01-07 14:23 ` Roger Quadros
2025-01-22 9:22 ` Chintan Vankar
2025-01-07 9:38 ` [PATCH 11/13] configs: am62p: Add configs for enabling ETHBOOT in R5SPL Chintan Vankar
2025-01-07 9:38 ` [PATCH 12/13] configs: am62p: Enable configs required for Ethboot Chintan Vankar
2025-01-07 14:12 ` Bryan Brattlof
2025-01-07 9:38 ` [PATCH 13/13] arch: arm: dts: k3-am62p5-sk-u-boot: Add bootph-all property to necessary nodes Chintan Vankar
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=87ef4af8-6086-4091-b7f2-bf7b81941ff4@kernel.org \
--to=rogerq@kernel.org \
--cc=a-bhatia1@ti.com \
--cc=a-limaye@ti.com \
--cc=afd@ti.com \
--cc=akashi.tkhro@gmail.com \
--cc=ansuelsmth@gmail.com \
--cc=bb@ti.com \
--cc=c-vankar@ti.com \
--cc=danishanwar@ti.com \
--cc=dannenberg@ti.com \
--cc=hnagalla@ti.com \
--cc=ilias.apalodimas@linaro.org \
--cc=j-choudhary@ti.com \
--cc=j-humphreys@ti.com \
--cc=joe.hershberger@ni.com \
--cc=m-chawdhry@ti.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=mikhail.kshevetskiy@iopsys.eu \
--cc=n-francis@ti.com \
--cc=nm@ti.com \
--cc=rfried.dev@gmail.com \
--cc=s-vadapalli@ti.com \
--cc=sjg@chromium.org \
--cc=srk@ti.com \
--cc=sughosh.ganu@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=vigneshr@ti.com \
/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