* Initialization order
@ 2026-06-24 15:51 Renaud Barbier
2026-06-24 20:18 ` Ahmad Fatoum
0 siblings, 1 reply; 4+ messages in thread
From: Renaud Barbier @ 2026-06-24 15:51 UTC (permalink / raw)
To: Barebox List
Hello,
I have a LS1021A connected to a device via SPI bus and PCIe bus. To enable the PCIe bus on this device , I need to write registers via the SPI bus.
I created a small SPI driver using the regmap layer to access the chip and I am able to display or write registers via md and mw.
I have tried (core)device_initcall opening the device using open_and_lseek but it is either called after ls_pcie_probe or too early and failed
What would be the best approach to do this initialization before ls_pcie_probe is called?
Cheers,
Renaud
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Initialization order
2026-06-24 15:51 Initialization order Renaud Barbier
@ 2026-06-24 20:18 ` Ahmad Fatoum
2026-06-25 9:02 ` Renaud Barbier
0 siblings, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2026-06-24 20:18 UTC (permalink / raw)
To: Renaud Barbier, Barebox List
Hello Renaud,
On 6/24/26 17:51, Renaud Barbier wrote:
> Hello,
> I have a LS1021A connected to a device via SPI bus and PCIe bus. To enable the PCIe bus on this device , I need to write registers via the SPI bus.
> I created a small SPI driver using the regmap layer to access the chip and I am able to display or write registers via md and mw.
>
> I have tried (core)device_initcall opening the device using open_and_lseek but it is either called after ls_pcie_probe or too early and failed
>
> What would be the best approach to do this initialization before ls_pcie_probe is called?
The easy way would be doing it in the board driver by enabling deep probe and calling
of_device_ensure_probed() on the SPI device to ensure it's available.
The more proper way would be to reflect the dependency in the device tree.
Sascha did some work with creating DT nodes for PCI devices recently,
so maybe he has some advice to share.
Cheers,
Ahmad
>
>
> Cheers,
> Renaud
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Initialization order
2026-06-24 20:18 ` Ahmad Fatoum
@ 2026-06-25 9:02 ` Renaud Barbier
2026-06-25 10:56 ` Ahmad Fatoum
0 siblings, 1 reply; 4+ messages in thread
From: Renaud Barbier @ 2026-06-25 9:02 UTC (permalink / raw)
To: Ahmad Fatoum, Barebox List
What about an init call back like in the pair: arch/arm/boards/tqma93xx/board.c and drivers/mfd/pca9450.c
> -----Original Message-----
> From: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Sent: 24 June 2026 21:19
> To: Renaud Barbier <Renaud.Barbier@ametek.com>; Barebox List
> <barebox@lists.infradead.org>
> Subject: Re: Initialization order
>
> ***NOTICE*** This came from an external source. Use caution when
> replying, clicking links, or opening attachments.
>
> Hello Renaud,
>
> On 6/24/26 17:51, Renaud Barbier wrote:
> > Hello,
> > I have a LS1021A connected to a device via SPI bus and PCIe bus. To enable
> the PCIe bus on this device , I need to write registers via the SPI bus.
> > I created a small SPI driver using the regmap layer to access the chip and I
> am able to display or write registers via md and mw.
> >
> > I have tried (core)device_initcall opening the device using
> > open_and_lseek but it is either called after ls_pcie_probe or too
> > early and failed
> >
> > What would be the best approach to do this initialization before
> ls_pcie_probe is called?
>
> The easy way would be doing it in the board driver by enabling deep probe
> and calling
> of_device_ensure_probed() on the SPI device to ensure it's available.
>
> The more proper way would be to reflect the dependency in the device tree.
> Sascha did some work with creating DT nodes for PCI devices recently, so
> maybe he has some advice to share.
>
> Cheers,
> Ahmad
>
> >
> >
> > Cheers,
> > Renaud
> >
> >
> >
>
>
> --
> Pengutronix e.K. | |
> Steuerwalder Str. 21 |
> https://urldefense.com/v3/__http://www.pengutronix.de/__;!!HKOSU0g!Dk
> wl4WL-Furup3YXUUa_6evqK-EgjByab0YR7X-
> xXNe9xPJQaeIaSFImNWY64ihl_HNxdBOUoLIuj49FCZee6Z82ktU$ |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Initialization order
2026-06-25 9:02 ` Renaud Barbier
@ 2026-06-25 10:56 ` Ahmad Fatoum
0 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-06-25 10:56 UTC (permalink / raw)
To: Renaud Barbier, Barebox List
Hi,
On 6/25/26 11:02 AM, Renaud Barbier wrote:
> What about an init call back like in the pair: arch/arm/boards/tqma93xx/board.c and drivers/mfd/pca9450.c
Not really a fan of these ad-hoc interfaces. In Linux you can register
callbacks for different life cycle stages via bus notifier:
BUS_NOTIFY_*, but we don't have something similar in barebox yet.
Your suggestion reminded me of something we _do_ have: PCI fixups!
Check out ventana_pciesw_early_fixup()
You could add a fixup like that matching your VID/PID in your board code
and call of_ensure_probed() inside on your SPI flash and do your
necessary writes?
Cheers,
Ahmad
>
>> -----Original Message-----
>> From: Ahmad Fatoum <a.fatoum@pengutronix.de>
>> Sent: 24 June 2026 21:19
>> To: Renaud Barbier <Renaud.Barbier@ametek.com>; Barebox List
>> <barebox@lists.infradead.org>
>> Subject: Re: Initialization order
>>
>> ***NOTICE*** This came from an external source. Use caution when
>> replying, clicking links, or opening attachments.
>>
>> Hello Renaud,
>>
>> On 6/24/26 17:51, Renaud Barbier wrote:
>>> Hello,
>>> I have a LS1021A connected to a device via SPI bus and PCIe bus. To enable
>> the PCIe bus on this device , I need to write registers via the SPI bus.
>>> I created a small SPI driver using the regmap layer to access the chip and I
>> am able to display or write registers via md and mw.
>>>
>>> I have tried (core)device_initcall opening the device using
>>> open_and_lseek but it is either called after ls_pcie_probe or too
>>> early and failed
>>>
>>> What would be the best approach to do this initialization before
>> ls_pcie_probe is called?
>>
>> The easy way would be doing it in the board driver by enabling deep probe
>> and calling
>> of_device_ensure_probed() on the SPI device to ensure it's available.
>>
>> The more proper way would be to reflect the dependency in the device tree.
>> Sascha did some work with creating DT nodes for PCI devices recently, so
>> maybe he has some advice to share.
>>
>> Cheers,
>> Ahmad
>>
>>>
>>>
>>> Cheers,
>>> Renaud
>>>
>>>
>>>
>>
>>
>> --
>> Pengutronix e.K. | |
>> Steuerwalder Str. 21 |
>> https://urldefense.com/v3/__http://www.pengutronix.de/__;!!HKOSU0g!Dk
>> wl4WL-Furup3YXUUa_6evqK-EgjByab0YR7X-
>> xXNe9xPJQaeIaSFImNWY64ihl_HNxdBOUoLIuj49FCZee6Z82ktU$ |
>> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
>> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-25 10:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-24 15:51 Initialization order Renaud Barbier
2026-06-24 20:18 ` Ahmad Fatoum
2026-06-25 9:02 ` Renaud Barbier
2026-06-25 10:56 ` Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox