mvebu: tclk detection for armada-xp and marvell packet processor with integrated CPU
Hi,
One of the first problems I encountered looking at the Marvell Packet Processor with integrated CPU (I'll refer to that as 'the PP' throughout the rest of this email) was that it has a different TCLK to the armada-xp.
It appears that for both the PP and the armada-xp the TCLK is hard-coded (to 200MHz and 250MHz respectively) and cannot be detected as far as I can see from the various data-sheets. I was hoping to re-use drivers/clk/mvebu/armada-xp.c but I need to figure out how to make axp_get_tclk_freq() give me an appropriate answer depending on the SoC. If this were in the mach-mvebu code I could just use mvebu_get_soc_id() to fetch the device id. Is there an equivalent I could use in generic code?
One option would be to use a different compatible string in the dts. That would also give me a way of handling other differences (the clock-gating is a subset of what's available on the armada-xp). How different would things have to be before it's worth spinning the PP code out into a file of it's own?
Thanks,
Chris
Dear Chris Packham,
Quoted 12 lines · Chris Packham
One of the first problems I encountered looking at the Marvell Packet Processor with integrated CPU (I'll refer to that as 'the PP' throughout the rest of this email) was that it has a different TCLK to the armada-xp.
It appears that for both the PP and the armada-xp the TCLK is hard-coded (to 200MHz and 250MHz respectively) and cannot be detected as far as I can see from the various data-sheets. I was hoping to re-use
drivers/clk/mvebu/armada-xp.cbut I need to figure out how to makeaxp_get_tclk_freq()give me an appropriate answer depending on the SoC. If this were in the mach-mvebu code I could just usemvebu_get_soc_id()to fetch the device id. Is there an equivalent I could use in generic code?
Quoted 5 lines
One option would be to use a different compatible string in the dts. That would also give me a way of handling other differences (the clock-gating is a subset of what's available on the armada-xp). How different would things have to be before it's worth spinning the PP code out into a file of it's own?
To me, it indeed seems like you need a different compatible string here. Whether a separate file from drivers/clk/mvebu/armada-xp.c is needed or not will depend on whether only the tclk frequency differs, or whether also the ratios with other clocks differ.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Quoted 22 lines · Thomas Petazzoni
Dear Chris Packham,
Quoted 12 lines · Chris Packham
One of the first problems I encountered looking at the Marvell Packet Processor with integrated CPU (I'll refer to that as 'the PP' throughout the rest of this email) was that it has a different TCLK to the armada-xp.
It appears that for both the PP and the armada-xp the TCLK is hard-coded (to 200MHz and 250MHz respectively) and cannot be detected as far as I can see from the various data-sheets. I was hoping to re-use
drivers/clk/mvebu/armada-xp.cbut I need to figure out how to makeaxp_get_tclk_freq()give me an appropriate answer depending on the SoC. If this were in the mach-mvebu code I could just usemvebu_get_soc_id()to fetch the device id. Is there an equivalent I could use in generic code?Quoted 5 lines
One option would be to use a different compatible string in the dts. That would also give me a way of handling other differences (the clock-gating is a subset of what's available on the armada-xp). How different would things have to be before it's worth spinning the PP code out into a file of it's own?
Quoted 4 lines
To me, it indeed seems like you need a different compatible string here. Whether a separate file from
drivers/clk/mvebu/armada-xp.cis needed or not will depend on whether only the tclk frequency differs, or whether also the ratios with other clocks differ.
I agree here about the compatibility string. The Kirkwood PP also has a different compat string for some drivers and an .dtsi file.
kirkwood-98dx4122.dtsi
Andrew
Hi Andrew,
Quoted 28 lines · Andrew Lunn
Quoted 22 lines · Thomas Petazzoni
Dear Chris Packham,
Quoted 12 lines · Chris Packham
One of the first problems I encountered looking at the Marvell Packet Processor with integrated CPU (I'll refer to that as 'the PP' throughout the rest of this email) was that it has a different TCLK to the armada-xp.
It appears that for both the PP and the armada-xp the TCLK is hard-coded (to 200MHz and 250MHz respectively) and cannot be detected as far as I can see from the various data-sheets. I was hoping to re-use
drivers/clk/mvebu/armada-xp.cbut I need to figure out how to makeaxp_get_tclk_freq()give me an appropriate answer depending on the SoC. If this were in the mach-mvebu code I could just usemvebu_get_soc_id()to fetch the device id. Is there an equivalent I could use in generic code?Quoted 5 lines
One option would be to use a different compatible string in the dts. That would also give me a way of handling other differences (the clock-gating is a subset of what's available on the armada-xp). How different would things have to be before it's worth spinning the PP code out into a file of it's own?
Quoted 4 lines
To me, it indeed seems like you need a different compatible string here. Whether a separate file from
drivers/clk/mvebu/armada-xp.cis needed or not will depend on whether only the tclk frequency differs, or whether also the ratios with other clocks differ.
Quoted 4 lines
I agree here about the compatibility string. The Kirkwood PP also has a different compat string for some drivers and an .dtsi file.
kirkwood-98dx4122.dtsi
Off topic but, cool bobcat1 support (err, I mean I recognize that official part number).
We have existing products using this and others with a proper kirkwood. Unfortunately they all have fdt unaware bootloaders. Is there an arm equivalent to the cuboot support that powerpc has?
Quoted 3 lines
Andrew
Quoted 4 lines
Quoted 1 line
kirkwood-98dx4122.dtsiOff topic but, cool bobcat1 support (err, I mean I recognize that official part number).
It is very minimal support. I wish there was more, and i would love to play with this chip, or the one you have, but the datasheets is not available.
Quoted 2 lines
We have existing products using this and others with a proper kirkwood. Unfortunately they all have fdt unaware bootloaders.
You can use appended dt. Put the blob on the end of the kernel, and with the right options turn on, it will find it. Also, keymile, how did most of the 98dx4122 work contributed to uboot. So you can probably use a mainline uboot.
Andrew
Hi Thomas,
Quoted 16 lines · Thomas Petazzoni
Dear Chris Packham,
Quoted 12 lines · Chris Packham
One of the first problems I encountered looking at the Marvell Packet Processor with integrated CPU (I'll refer to that as 'the PP' throughout the rest of this email) was that it has a different TCLK to the armada-xp.
It appears that for both the PP and the armada-xp the TCLK is hard-coded (to 200MHz and 250MHz respectively) and cannot be detected as far as I can see from the various data-sheets. I was hoping to re-use
drivers/clk/mvebu/armada-xp.cbut I need to figure out how to makeaxp_get_tclk_freq()give me an appropriate answer depending on the SoC. If this were in the mach-mvebu code I could just usemvebu_get_soc_id()to fetch the device id. Is there an equivalent I could use in generic code?
Quoted 8 lines
Quoted 5 lines
One option would be to use a different compatible string in the dts. That would also give me a way of handling other differences (the clock-gating is a subset of what's available on the armada-xp). How different would things have to be before it's worth spinning the PP code out into a file of it's own?
To me, it indeed seems like you need a different compatible string here.
That's what I've done so far (patch to follow).
Quoted 3 lines
Whether a separate file from
drivers/clk/mvebu/armada-xp.cis needed or not will depend on whether only the tclk frequency differs, or whether also the ratios with other clocks differ.
Yeah I'm still trying to wrestle that information out of Marvell. What I do know is for the eval board I've got the armada register SAR (offset 0x18230) is all zeros. I'm not sure if this is because everything really strapped low or because this register is unused on the PP.
The PP datasheet does have a table of differences with the armada. One of the major ones is the CPU frequency. The armada runs at up to 1.6GHz but the PP runs at up to 800MHz which probably does mean that axp_get_cpu_freq isn't giving the right answer.
I'm not sure how much this matters. For a packet processor with embedded CPU it's not like we need to support power management. The CPU is always on because it's always got something to do. We're not powering CPU peripherals to reduce power consumption, even if we did the power consumed by the packet processing side would eclipse any savings made by the CPU.
Quoted 5 lines
Best regards,
Thomas
Quoted 4 lines
Yeah I'm still trying to wrestle that information out of Marvell. What I do know is for the eval board I've got the armada register SAR (offset
0x18230) is all zeros. I'm not sure if this is because everything really strapped low or because this register is unused on the PP.
Do the CPU SAR pins even make it out of the package? It could be when the synthesised the CPU they hard coded it all and throw away the SAR.
Andrew
Quoted 8 lines · Andrew Lunn
Quoted 4 lines
Yeah I'm still trying to wrestle that information out of Marvell. What I do know is for the eval board I've got the armada register SAR (offset
0x18230) is all zeros. I'm not sure if this is because everything really strapped low or because this register is unused on the PP.Do the CPU SAR pins even make it out of the package? It could be when the synthesised the CPU they hard coded it all and throw away the SAR.
That's a possibility. The other thing that they may have done is incorporated the SAR pins for the CPU with the SAR pins for the packet processor. That could be a little tricky because then I'd have to start opening up windows for the PP registers early in the kernel init.
Hello Chris,
2014-11-17 23:07 GMT+01:00 Chris Packham <[email protected]>:
Quoted 8 lines · Andrew Lunn
Quoted 5 lines
Quoted 4 lines
Yeah I'm still trying to wrestle that information out of Marvell. What I do know is for the eval board I've got the armada register SAR (offset
0x18230) is all zeros. I'm not sure if this is because everything really strapped low or because this register is unused on the PP.
Quoted 8 lines
Quoted 3 lines
Do the CPU SAR pins even make it out of the package? It could be when the synthesised the CPU they hard coded it all and throw away the SAR.
That's a possibility. The other thing that they may have done is incorporated the SAR pins for the CPU with the SAR pins for the packet processor. That could be a little tricky because then I'd have to start opening up windows for the PP registers early in the kernel init.
Sorry to interfere, but is it possible to know what SoC (BobCat2 or AlleyCat3? Afair, those are the two dual-core pj4b-based ones.) and board model you exactly work on? I have some experience with this family, so I there is a chance I may help.
Best regards,
Marcin