arm: kirkwood: add dreamplug (fdt) support.
Hi Jason
Great to see this work going forward. I hope we can cooperating in the future. I have an out of tree kirkwood board i would like to supported via DT, and i also have a QNAP T119+ i can use for testing.
I have some patches under development which will help. I've been porting the different Orion machines to use Mike Turquette generic CLK and clkdev so that the device drivers can determine for themselves what the clock is. tclk is then removed from the platform data structures, making DT a little bit simpler. This work should also solve the kirkwood clock gating which is going to be an issue for DT. For example, your board file is probably currently calling kirkwood_spi_init(), in order to use SPI. This does:
kirkwood_clk_ctrl |= CGC_RUNIT;
and so ensures that the RUNIT clock does not get turned off in a lateinit call. Once you have DT, this flag is not going to be set, and so you have the danger of the clock to the SPI core gets turned off. The clk framework should solve this, since the SPI device driver will claim the clock and ensure it keeps running.
I'm hoping the next version of Mike Turquette patches get included in the tree soon, so i can finish my patches for integration.
Andrew
PATCH v4 2/3 arm: kirkwood: add dreamplug (fdt) support.
Quoted 5 lines · Andrew Lunn
Hi Jason
Great to see this work going forward. I hope we can cooperating in the future. I have an out of tree kirkwood board i would like to supported via DT, and i also have a QNAP T119+ i can use for testing.
Awesome, I don't have one of those.
Quoted 3 lines
I have some patches under development which will help. I've been porting the different Orion machines to use Mike Turquette generic CLK and clkdev...
It appears that changing core platform code across an entire architecture is quite difficult. ;-) I hope it gets merged, but I'm not going to hold my breath.
Quoted 7 lines
...so that the device drivers can determine for themselves what the clock is. tclk is then removed from the platform data structures, making DT a little bit simpler. This work should also solve the kirkwood clock gating which is going to be an issue for DT. For example, your board file is probably currently calling
kirkwood_spi_init(), in order to use SPI. This does:
Quoted 7 lines
kirkwood_clk_ctrl|=CGC_RUNIT;and so ensures that the RUNIT clock does not get turned off in a lateinit call. Once you have DT, this flag is not going to be set, and so you have the danger of the clock to the SPI core gets turned off. The clk framework should solve this, since the SPI device driver will claim the clock and ensure it keeps running.
Why not convert kirkwood_clock_gate() (mach-kirkwood/common.c:480) to make use of of_device_is_available() ? That would eliminate one global variable. That wouldn't even require a change to the devicetrees, since it returns 1 if 'status' doesn't exist (or is set to "okay" or "ok").
I don't even see where CGC_RUNIT is used in kirkwood_clock_gate(), except at line 528. Maybe I'm missing something, a lot of this is new to me.
thx,
Jason.
PATCH v4 2/3 arm: kirkwood: add dreamplug (fdt) support.
In reply to Andrew LunnQuoted 5 lines · Andrew Lunn
Hi Jason
Great to see this work going forward. I hope we can cooperating in the future. I have an out of tree kirkwood board i would like to supported via DT, and i also have a QNAP T119+ i can use for testing.
Awesome, I don't have one of those.
Quoted 3 lines
I have some patches under development which will help. I've been porting the different Orion machines to use Mike Turquette generic CLK and clkdev...
It appears that changing core platform code across an entire architecture is quite difficult. ;-) I hope it gets merged, but I'm not going to hold my breath.
Quoted 7 lines
...so that the device drivers can determine for themselves what the clock is. tclk is then removed from the platform data structures, making DT a little bit simpler. This work should also solve the kirkwood clock gating which is going to be an issue for DT. For example, your board file is probably currently calling
kirkwood_spi_init(), in order to use SPI. This does:
Quoted 7 lines
kirkwood_clk_ctrl|=CGC_RUNIT;and so ensures that the RUNIT clock does not get turned off in a lateinit call. Once you have DT, this flag is not going to be set, and so you have the danger of the clock to the SPI core gets turned off. The clk framework should solve this, since the SPI device driver will claim the clock and ensure it keeps running.
Why not convert kirkwood_clock_gate() (mach-kirkwood/common.c:480) to make use of of_device_is_available() ? That would eliminate one global variable. That wouldn't even require a change to the devicetrees, since it returns 1 if 'status' doesn't exist (or is set to "okay" or "ok").
I don't even see where CGC_RUNIT is used in kirkwood_clock_gate(), except at line 528. Maybe I'm missing something, a lot of this is new to me.
thx,
Jason.
PATCH v4 2/3 arm: kirkwood: add dreamplug (fdt) support.
In reply to Andrew LunnAndrew,
Quoted 1 line · Andrew Lunn
I have some patches under development which will help.
Any chance you could shoot those to me? (on-list preferable) I'm thinking we could convert it to an interim solution eg kirkwood_{get,put}_clock() that would be easy to migrate to generic CLK/clkdev once it lands.
thx,
Jason.
PATCH v4 2/3 arm: kirkwood: add dreamplug (fdt) support.
Quoted 9 lines · Jason
Andrew,
Quoted 1 line · Andrew Lunn
I have some patches under development which will help.
Any chance you could shoot those to me? (on-list preferable) I'm thinking we could convert it to an interim solution eg kirkwood_{get,put}_clock() that would be easy to migrate to generic CLK/clkdev once it lands.
Hi Jason
It is not that easy. It is not kirkwood, but all platform orion, so includes dove, orion5x, mv78xx0 and kirkwood. All these share the same device drivers, since they all share the same SoC peripheral cores. However, only kirkwood has per peripheral gated clocks and all the others share tclk.
I've also broke orion5x twice so far with my patches, since i don't have any hardware with that SoC. So this time i was hoping to ask for testing on orion5x before submitting to mainline.
Mike did say he hoped the generic clk would be ready last week. Maybe we should ping him and ask for a new ETA?
Andrew
PATCH v4 2/3 arm: kirkwood: add dreamplug (fdt) support.
Quoted 15 lines · Andrew Lunn
Quoted 7 lines · Jason
Quoted 1 line · Andrew Lunn
I have some patches under development which will help.
Any chance you could shoot those to me? (on-list preferable) I'm thinking we could convert it to an interim solution eg kirkwood_{get,put}_clock() that would be easy to migrate to generic CLK/clkdev once it lands.
It is not that easy. It is not kirkwood, but all platform orion, so includes dove, orion5x, mv78xx0 and kirkwood. All these share the same device drivers, since they all share the same SoC peripheral cores. However, only kirkwood has per peripheral gated clocks and all the others share tclk.
Quoted 6 lines
I've also broke orion5x twice so far with my patches, since i don't have any hardware with that SoC. So this time i was hoping to ask for testing on orion5x before submitting to mainline.
Mike did say he hoped the generic clk would be ready last week. Maybe we should ping him and ask for a new ETA?
Nah, it'll be ready when it's ready. I'll keep things the way they are and gut through the conversion once his stuff is in mainline.
thx,
Jason.