Potential issue with recent OMAP PRCM struct unification
Greetings,
I think <http://patchwork.ozlabs.org/patch/218063/> or something related to it has confused OMAP4 clock init. I haven't entirely unraveled the onion but wanted to ping the list to see if this is known or I'm off in the weeds.
Using u-boot master at commit a268170 in DEBUG mode the SPL says (in part):
Enable clock module - 4a008e20
Enable clock module - 4a008e28
Enable clock module - 4a008e40 << later builds omit Enable clock module - 4a009338 << these two clocks Enable clock module - 4a004528
Enable clock module - 4a004530
Enable clock module - 4a004538
That build works. But by commit 417c558 the 2 clocks noted are omitted and the later call to get_ram_size() hangs.
In tracing this I found that the prcm structure initializes one field (cm_l3instr_intrconn_wp1_clkct) but then enable_non_essential_clocks() passes an array populated using a different field (cm_l3instr_intrconn_wp1_clkctrl) to do_enable_clocks(). That latter uninitialized field is zero which terminates that clock init array and results in the two clock omissions above.
Searching for this and leaving out omap5 for clarity I see:
cashwell.ubuntu:u-boot$ rgrep cm_l3instr_intrconn_wp1_clkct | grep -v omap5./arch/arm/cpu/armv7/omap4/prcm-regs.c: .cm_l3instr_intrconn_wp1_clkct = 0x4a008e40,./arch/arm/cpu/armv7/omap4/hw_data.c: (*prcm)->cm_l3instr_intrconn_wp1_clkctrl,./arch/arm/include/asm/omap_common.h: u32 cm_l3instr_intrconn_wp1_clkctrl;./arch/arm/include/asm/omap_common.h: u32 cm_l3instr_intrconn_wp1_clkct;
On first blush, it looks like having both cm_l3instr_intrconn_wp1_clkct and cm_l3instr_intrconn_wp1_clkctrl is a mistake.
If that's true can anyone say which should be eliminated and whether or not the order of fields in struct prcm_regs matters?
Thanks,
-Mike Cashwell
Hi Mike Cashwell,
Quoted 26 lines · Michael Cashwell
Greetings,
I think <http://patchwork.ozlabs.org/patch/218063/> or something related to it has confused OMAP4 clock init. I haven't entirely unraveled the onion but wanted to ping the list to see if this is known or I'm off in the weeds.
Using u-boot master at commit a268170 in DEBUG mode the SPL says (in part):
Enable clock module -
4a008e20
Enable clock module -4a008e28
Enable clock module -4a008e40<< later builds omit Enable clock module -4a009338<< these two clocks Enable clock module -4a004528
Enable clock module -4a004530
Enable clock module -4a004538That build works. But by commit 417c558 the 2 clocks noted are omitted and the later call to
get_ram_size()hangs.In tracing this I found that the prcm structure initializes one field (
cm_l3instr_intrconn_wp1_clkct) but thenenable_non_essential_clocks()passes an array populated using a different field (cm_l3instr_intrconn_wp1_clkctrl) todo_enable_clocks(). That latter uninitialized field is zero which terminates that clock init array and results in the two clock omissions above.Searching for this and leaving out omap5 for clarity I see:
cashwell.ubuntu:u-boot$ rgrep
cm_l3instr_intrconn_wp1_clkct| grep -v omap5./arch/arm/cpu/armv7/omap4/prcm-regs.c: .cm_l3instr_intrconn_wp1_clkct =0x4a008e40,./arch/arm/cpu/armv7/omap4/hw_data.c: (*prcm)->cm_l3instr_intrconn_wp1_clkctrl,./arch/arm/include/asm/omap_common.h: u32cm_l3instr_intrconn_wp1_clkctrl;./arch/arm/include/asm/omap_common.h: u32cm_l3instr_intrconn_wp1_clkct;
Quoted 4 lines
On first blush, it looks like having both
cm_l3instr_intrconn_wp1_clkctandcm_l3instr_intrconn_wp1_clkctrlis a mistake.If that's true can anyone say which should be eliminated and whether or not the order of fields in struct
prcm_regsmatters?
First, on which board are you testing ?. I tested the mainline on my 4460 ES1.1 PANDA and it booted. Also why are you enabling the non-essential clocks ?
Now enabling non-essential clocks is deprecated and they are **not** by enabled by default. As you said the unnecessary entry in omap_common.h should be removed and typo in prcm-regs.c I can correct this, but does correcting this gets you working again ?
Enabling these two clocks should have nothing to do with boot.
Regards,
Sricharan
Quoted 3 lines · Sricharan R
Quoted 1 line
On first blush, it looks like having both
cm_l3instr_intrconn_wp1_clkctandcm_l3instr_intrconn_wp1_clkctrlis a mistake.First, on which board are you testing ?. I tested the mainline on my 4460 ES1.1 PANDA and it booted.
One custom board still under development and also on the same Pandaboard you have.
But further testing showed that CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION (and the related EMIF defines) stopped working somewhere between commits a268170 and 417c558. Returning to the pre-canned SDRAM modes allowed booting to work again.
The reason I suspected the clocks was that they were the *only* difference in the entire debug log between the working and hanging cases. I don't know why the SDRAM state difference which was the real cause did not produce even a single difference in the log.
Quoted 3 lines
As you said the unnecessary entry in
omap_common.hshould be removed and typo inprcm-regs.cI can correct this, but does correcting this gets you working again ? Enabling these two clocks should have nothing to do with boot.
Correct. As I later found, the clocks in question are non-essential for u-boot and were not causing the hang.
Quoted 1 line
Also why are you enabling the non-essential clocks ?
Because I must be able to boot Linux kernels as far back as 3.0.8 which predates this paradigm shift.
Quoted 1 line
Now enabling non-essential clocks is deprecated and they are **not** by enabled by default.
As a point of clarification, are you asserting that CONFIG_SYS_CLOCKS_ENABLE_ALL and CONFIG_SYS_ENABLE_PADS_ALL have been officially deprecated (e.g.: is planned for removal from u-boot)?
There is no mention of this anywhere within the source tree, including in any documentation or README and, IMO, it would be very premature given that at least 4 Linux kernel lines needing these inits are still within their longterm support window.
But clearly until such removal happens dropping any that were previously handled is a regression.
Thanks for the assistance!
-Mike
Quoted 4 lines · Michael Cashwell
Quoted 2 lines · Sricharan R
Quoted 1 line
On first blush, it looks like having both
cm_l3instr_intrconn_wp1_clkctandcm_l3instr_intrconn_wp1_clkctrlis a mistake.
Quoted 8 lines
Quoted 1 line
First, on which board are you testing ?. I tested the mainline on my 4460 ES1.1 PANDA and it booted.
One custom board still under development and also on the same Pandaboard you have.
But further testing showed that
CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION(and the related EMIF defines) stopped working somewhere between commits a268170 and 417c558. Returning to the pre-canned SDRAM modes allowed booting to work again.The reason I suspected the clocks was that they were the *only* difference in the entire debug log between the working and hanging cases. I don't know why the SDRAM state difference which was the real cause did not produce even a single difference in the log.
Yes, i think AUTOMATIC_SDRAM_DETECTION is broken. I am having some patches to fix and will post shortly. Sorry,that you hit this issue.
But these were any not because of the PRCM changes, it was much before that.
Quoted 12 lines
Quoted 3 lines
As you said the unnecessary entry in
omap_common.hshould be removed and typo inprcm-regs.cI can correct this, but does correcting this gets you working again ? Enabling these two clocks should have nothing to do with boot.Correct. As I later found, the clocks in question are non-essential for u-boot and were not causing the hang.
Quoted 1 line
Also why are you enabling the non-essential clocks ?
Because I must be able to boot Linux kernels as far back as 3.0.8 which predates this paradigm shift.
Quoted 1 line
Now enabling non-essential clocks is deprecated and they are **not** by enabled by default.
Quoted 8 lines
As a point of clarification, are you asserting that
CONFIG_SYS_CLOCKS_ENABLE_ALLandCONFIG_SYS_ENABLE_PADS_ALLhave been officially deprecated (e.g.: is planned for removal from u-boot)?There is no mention of this anywhere within the source tree, including in any documentation or README and, IMO, it would be very premature given that at least 4 Linux kernel lines needing these inits are still within their longterm support window.
But clearly until such removal happens dropping any that were previously handled is a regression.
Thanks for the assistance!
Yes, thats why we still have kept it for testing.
But now, there are already patches to fix this in the kernel being posted, and probably all of them should be fixed shortly. Once that is done, all of this can be removed.
Regards,
Sricharan
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 3 lines · Sricharan R
Quoted 2 lines · Michael Cashwell
On Apr 2, 2013, at 5:32 AM, Sricharan R <[email protected]> wrote:
[snip]
Quoted 21 lines
Quoted 21 lines
Quoted 1 line
Also why are you enabling the non-essential clocks ?
Because I must be able to boot Linux kernels as far back as 3.0.8 which predates this paradigm shift.
Quoted 2 lines
Now enabling non-essential clocks is deprecated and they are **not** by enabled by default.
As a point of clarification, are you asserting that
CONFIG_SYS_CLOCKS_ENABLE_ALLandCONFIG_SYS_ENABLE_PADS_ALLhave been officially deprecated (e.g.: is planned for removal from u-boot)?There is no mention of this anywhere within the source tree, including in any documentation or README and, IMO, it would be very premature given that at least 4 Linux kernel lines needing these inits are still within their longterm support window.
But clearly until such removal happens dropping any that were previously handled is a regression.
Quoted 6 lines
Quoted 2 lines
Thanks for the assistance!
Yes, thats why we still have kept it for testing. But now, there are already patches to fix this in the kernel being posted, and probably all of them should be fixed shortly. Once that is done, all of this can be removed.
So, here's my 2 cents on this. We can't up and drop these options from U-Boot until there's a complete / viable kernel that doesn't need them. I'm _not_ saying we need to test every patchset vs an old kernel or anything, but we shouldn't intentionally make life harder on folks, until we can just pull the option all together (and say use a new kernel, or an older u-boot).
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRWvadAAoJENk4IS6UOR1WDZ4QAKCGo5U7z4xBw+1QQR2Yy+kw +ik7aju3BCw5XA/JxzjTyAao6TZwTcP5ySOvs3AoORXg53cwMY6itH/+1Y3my+4p Cbz0uh1QTEsB+OoIMPHhVWIVBzwyMRkTiDsidbB+eXJhEweYKkMmCZbMpepcAjH1 7+QWbDS+bQT7oSYePwyBTHpjYy/MT+PVIKTAZdmAiKloe2qi5YHQPEsm8q9DlCvW 1L1+ZNkWwbom/dlO6BVufzmpPyPYBLKyyztu60h4Wlw8F4WtWwdYGDt6KBL9aiX+ ZqlmRJtGpHTnXLHvXQ9URLA9xUIlilgGiUDJBKhCCnPQbJNBqjOWENswaU+mINOp 1SHkqVa5qm0MzoNrDeGCJLENRNh0d/7upB6J7+dcc0daAC+hLm6s3I+qC0/PFJmV NQofya9tG+QNvDNVhyGyo12Vq6sZ6Mx2tGzaNLv5uiHVwnLHC8Cx3V0p9yp/8oPt W5XN0pFOgRI52ukxnvxY1E1a9O3ilvWS4wXFfnfuft33m/yIj5+/+AOhdMUZ63UX cOmzqyM+Iy/ubn7Ml8ZKrzOGLe5TDaMdEczSNNGqxJa+53kN02JB3Yffh0JupehC KgRuZtLWQcUJ54E0z0FBLKE7pdkjnkbrhb1c5SQDd0V2006c0wTt8+SjDvglrFbN Bj6z7QcJFL7xNQ+37XBf
=DGtW
-----END PGP SIGNATURE-----
Quoted 36 lines · Tom Rini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 3 lines · Sricharan R
Quoted 2 lines · Michael Cashwell
On Apr 2, 2013, at 5:32 AM, Sricharan R <[email protected]> wrote:
[snip]
Quoted 21 lines
Quoted 21 lines
Quoted 1 line
Also why are you enabling the non-essential clocks ?
Because I must be able to boot Linux kernels as far back as 3.0.8 which predates this paradigm shift.
Quoted 2 lines
Now enabling non-essential clocks is deprecated and they are **not** by enabled by default.
As a point of clarification, are you asserting that
CONFIG_SYS_CLOCKS_ENABLE_ALLandCONFIG_SYS_ENABLE_PADS_ALLhave been officially deprecated (e.g.: is planned for removal from u-boot)?There is no mention of this anywhere within the source tree, including in any documentation or README and, IMO, it would be very premature given that at least 4 Linux kernel lines needing these inits are still within their longterm support window.
But clearly until such removal happens dropping any that were previously handled is a regression.
Quoted 6 lines
Quoted 2 lines
Thanks for the assistance!
Yes, thats why we still have kept it for testing. But now, there are already patches to fix this in the kernel being posted, and probably all of them should be fixed shortly. Once that is done, all of this can be removed.
Quoted 7 lines
So, here's my 2 cents on this. We can't up and drop these options from U-Boot until there's a complete / viable kernel tthhat doesn't need them. I'm _not_ saying we need to test every patchset vs an old kernel or anything, but we shouldn't intentionally make life harder on folks, until we can just pull the option all together (and say use a new kernel, or an older u-boot).
Hmm, Agree this should not be broken unintentionally.
But because we purposefully deprecated this, kernel is now getting fixed. Fixing any thing towards this deprecated one, will again introduce the luxury of not addressing in kernel, which is not good. If we propose of removing this in U-BOOT after every thing is fixed in kernel, we still will have of need of supporting for older kernels..
Regards,
Sricharan
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 45 lines · Sricharan R
Quoted 36 lines · Tom Rini
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Quoted 3 lines · Sricharan R
Quoted 2 lines · Michael Cashwell
On Apr 2, 2013, at 5:32 AM, Sricharan R <[email protected]>
wrote:[snip]
Quoted 22 lines
Quoted 22 lines
Quoted 1 line
Also why are you enabling the non-essential clocks ?
Because I must be able to boot Linux kernels as far back as 3.0.8 which predates this paradigm shift.
Quoted 2 lines
Now enabling non-essential clocks is deprecated and they are **not** by enabled by default.
As a point of clarification, are you asserting that
CONFIG_SYS_CLOCKS_ENABLE_ALLandCONFIG_SYS_ENABLE_PADS_ALLhave been officially deprecated (e.g.: is planned for removal from u-boot)?There is no mention of this anywhere within the source tree,
including in any documentation or README and, IMO, it would
be very premature given that at least 4 Linux kernel lines needing these inits are still within their longterm support window.But clearly until such removal happens dropping any that were
previously handled is a regression.Quoted 6 lines
Quoted 2 lines
Thanks for the assistance!
Yes, thats why we still have kept it for testing. But now, there are already patches to fix this in the kernel being posted, and probably all of them should be fixed shortly. Once that is done, all of this can be removed.
Quoted 8 lines
So, here's my 2 cents on this. We can't up and drop these options from U-Boot until there's a complete / viable kernel tthhat doesn't need them. I'm _not_ saying we need to test every patchset vs an old kernel or anything, but we shouldn't intentionally make life harder on folks, until we can just pull the option all together (and say use a new kernel, or an older u-boot).
Quoted 7 lines
Hmm, Agree this should not be broken unintentionally. But because we purposefully deprecated this, kernel is now getting fixed. Fixing any thing towards this deprecated one, will again introduce the luxury of not addressing in kernel, which is not good. If we propose of removing this in U-BOOT after every thing is fixed in kernel, we still will have of need of supporting for older kernels..
Yes, I'm assuming the kernel folks to continue with adding clocks they need in the right places now that the main event has happened and we aren't enabling more things until / unless we need them. And since I think that's going at reasonable speed, I don't think we need to draw a dated line in the sand, just one that says we shall remove the option, once a reasonable (read: most IO works) kernel tree is available that doesn't need this, we can remove it. Maybe we can set a hope to remove date? How about v2013.07?
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRWwp8AAoJENk4IS6UOR1WTFwP/iqQsntG0x9Ubos4BjWm521T yDp+548n72x2yNXuCBXVKj5IwyMtvjMOeuaHmu/TCish1riSpd96aKLtimfXaZum Me7xfRGzEVGO4VUz8wbzHFZQyfZ6ON9zXjRswSrzj5Rt8Wuc8R7nn10FEsptTWK4 EiID/QjaIr6rl+175h4Qj6js/RrQ76q5iJVkFShSiih++MUISOa7H/msHVbr80G6 S/novDHSRdCGz8OB85tCi+b49qeOSmt3990aW3NXTvkdXDUmBC9BrR1t4n6IyMGi tUwsJ+I0nyV3vQFb/OcxYNlDfsKELNSEtmqQ74OBBfINrmON+5IhouQ8smK43hFT 4yeeoj9Bcu36LcEYRLu29eBKXAhfnfUMQWHQFTRj5VPNlEUhWd+3dm1sgz2wCLro srAAJ4R9Aev+fkhpC2JuzbRrAOyBUN3k05T4P3+XomFGbgkvYkNgOtuy4kb4qMus v0oRT53Ygm0YihKF6wRtktbuYLOEkkSy5zhmEpov7ONQK6BiRtr+14igpFFwJ28x xg+VhKRE4yvuCRccMUKP+afRhJln+53BW/XIJ7D/8Vs39dg2CsO5yg6cDLUyI/Ns BM2BRRVE37A6WliDs5119JeKPou6fnN7H3OmsHFDheSkBztjJxI9nmfrNw9husFn MmqpBh/7hBTDLNTDBELo
=qE1a
-----END PGP SIGNATURE-----
Quoted 57 lines · Tom Rini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 45 lines · Sricharan R
Quoted 36 lines · Tom Rini
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Quoted 3 lines · Sricharan R
Quoted 2 lines · Michael Cashwell
On Apr 2, 2013, at 5:32 AM, Sricharan R <[email protected]>
wrote:[snip]
Quoted 22 lines
Quoted 22 lines
Quoted 1 line
Also why are you enabling the non-essential clocks ?
Because I must be able to boot Linux kernels as far back as 3.0.8 which predates this paradigm shift.
Quoted 2 lines
Now enabling non-essential clocks is deprecated and they are **not** by enabled by default.
As a point of clarification, are you asserting that
CONFIG_SYS_CLOCKS_ENABLE_ALLandCONFIG_SYS_ENABLE_PADS_ALLhave been officially deprecated (e.g.: is planned for removal from u-boot)?There is no mention of this anywhere within the source tree,
including in any documentation or README and, IMO, it would
be very premature given that at least 4 Linux kernel lines needing these inits are still within their longterm support window.But clearly until such removal happens dropping any that were
previously handled is a regression.Quoted 6 lines
Quoted 2 lines
Thanks for the assistance!
Yes, thats why we still have kept it for testing. But now, there are already patches to fix this in the kernel being posted, and probably all of them should be fixed shortly. Once that is done, all of this can be removed.
Quoted 8 lines
So, here's my 2 cents on this. We can't up and drop these options from U-Boot until there's a complete / viable kernel tthhat doesn't need them. I'm _not_ saying we need to test every patchset vs an old kernel or anything, but we shouldn't intentionally make life harder on folks, until we can just pull the option all together (and say use a new kernel, or an older u-boot).
Quoted 7 lines
Hmm, Agree this should not be broken unintentionally. But because we purposefully deprecated this, kernel is now getting fixed. Fixing any thing towards this deprecated one, will again introduce the luxury of not addressing in kernel, which is not good. If we propose of removing this in U-BOOT after every thing is fixed in kernel, we still will have of need of supporting for older kernels..
Quoted 9 lines
Yes, I'm assuming the kernel folks to continue with adding clocks they need in the right places now that the main event has happened and we aren't enabling more things until / unless we need them. And since I think that's going at reasonable speed, I don't think we need to draw a dated line in the sand, just one that says we shall remove the option, once a reasonable (read: most IO works) kernel tree is available that doesn't need this, we can remove it. Maybe we can set a hope to remove date? How about v2013.07?
Yes, sounds good. Hopefully kernel fixed by then
Regards,
Sricharan