-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC:SOF:APL:set I2S slave before enabling DSP #813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASoC:SOF:APL:set I2S slave before enabling DSP #813
Conversation
@zhuyingjiang im not aware of what the sequence should be but in the commit, you set the slave mode after powering up the DSP's. It seems to contradict the commit message? |
|
@zhuyingjiang also wondering why we do it only for APL and not the other cavs platforms? |
That is "during power up sequence", which include:
|
@ranj063 this is for issue #778, and from the cAVS 1.8 spec, I can't find the "I2S Force Dynamic Clock Gating" bit, but it does have "set slave" in SSC1 register. |
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhuyingjiang the ask is to make sure valid sequences are programmed, not just to mirror what others did and hope for the best. You need to get access to the documentation and double-check all values, I did what I could to verify but you need to go deeper. In addition it's not quite right to a new operation just for a sequence that takes place inside the boot flow.
sound/soc/sof/ops.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this abstraction layer is not needed, this is a platform-specific operation that should be part of the initial DSP boot process. There's no point in exposing this to the core or add an intel-specific operation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart OK, I will get the doc of BDW/HSW and see if they are the same step of doing so, and I will still check if the clock gating step is not needed, if yes, we do not need this layer.
sound/soc/sof/sof-priv.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, this is not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks!
sound/soc/sof/intel/apl.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a shortcut to set the SCLKDIR (bit 25) and SFRMDIR (bit 24) fields of register SSC1 (offset 4 of SSP base). For both fields 1 means slave and 0 master.
You'd want to test that these bits are actually set since access from the host might be disabled on some platforms due to the access policy.
The registers are identical for cAVS 1.8, but you may need to check that the base SSP address is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart OK, will do, but cAVS1.8 less the clock gating registers , will verify on cAVS1.5 if APL_DISABLE_ALL_SSP_CLK_GT operation can be omit.
sound/soc/sof/intel/apl.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes 6 bits, and looks awfully correlated to the number of SSPs. for other platforms you'd need to adjust this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the same time, I do not see anything in the IP reference on this, except for some bits called "I2S Force Dynamic Clock Gating" and "I2S Extension Force Dynamic Clock Gating" which have a different bit field in the CLKSTS register. clearly you need to make sure the registers you are using are valid, not just copy/paste from somewhere else without verifying the right bits are programmed with the right values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart OK, will check if "I2S Force Dynamic Clock Gating" setting can be omit.
|
@plbossart Do you means on all platform including BDW/HSW, APL(cAVS1.5), and CNL(cAVS1.8) need enable the feature? I will get the BDW/HSW specs and go deep with the specs then refine the PR. |
|
On 4/12/19 10:17 PM, Zhu, Yingjiang wrote:
@plbossart <https://github.com/plbossart> Do you means on all platform
including BDW/HSW, APL(cAVS1.5), and CNL(cAVS1.8) need enable the
feature? I will get the BDW/HSW specs and go deep with the specs then
refine the PR.
Thanks!
I only changed the APL related is because that the issue #778
<#778> has the "[APL][GLK]
harden" in title, so this is a misunderstanding.
it's only needed on SKL+, e.g. cAVS 1.5 and 1.8.
|
3ebe44a to
25bf592
Compare
|
@zhuyingjiang The ask was to enable the SSP as slave before the firmware is loaded, not to use the SSP as slave unconditionally! The firmware should do what the topology wants. The benefit is that if the topology does want slave mode, then there is no transition to master first which drives the clocks before stopping to drive them. Also it's possible that some platforms set the access policy in the BIOS/Coreboot and the writing from the host fails. That's ok. Those platforms would not use slave mode anyways. |
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments below.
sound/soc/sof/intel/cnl.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
certainly not 8. where did you read this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart yes, it is 8 for max, but maybe some ports reserved.
From cAVS1.8 HAS:
I2SPC | 3 | I2S Port Count.Value of 0 – 8 is allowed
and on our current WHL RVP, the I2SPC is 3, but there have base address from 0x10000 (I2S0) to 0x17000 (I2S7). The last 5 are reserved, we can write but will not take effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So use 3 then...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks!
@plbossart The code I attached above to modify in Firmware side is to do debug and validate. it is not submit to FW repo. From the spec, the host need to set the SSP to slave after poweron to avoid distortion, then when the DSP owns the access right it can set it according to the topology, by reading from the IPC message the host sent |
25bf592 to
72ee42f
Compare
|
@plbossart updated, with separate patch. |
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments below.
You want to use ASoC: SOF: Intel: hda: as the commit title prefix, thanks.
sound/soc/sof/intel/hda.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, I only see 3 SSPs for CNL/WHL/CML. You are confusing IP options and SOC reality, please look at the right documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, changed.
72ee42f to
3a75b1e
Compare
|
@plbossart @ranj063 Changed the commit message and the CNL SSP count. |
|
@zhuyingjiang can you add a space after each colon between sections in your subject of each commits, e.g. |
The DSP SSP device memory can be conditionally accessed by the host(depending on access policy). Add the SSP base memory offset of APL and CNL. Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
add SSP info of APL and CNL, to the sof_intel_dsp_desc structure. The max SSP count the platform support and the SSP base address. Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
3a75b1e to
ecb2123
Compare
|
@keyonjie Updated, thanks! |
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zhuyingjiang for taking the feedback into account, looks almost good.
One last change to polish this PR, please fix the last commit message:
By default, the I2S ports are configured in master mode during
DSP powerup sequences, and the FS and BCLK lines will be driven on startup, even when the topology file explicitly requires the SSP to be slave.
This may be problematic for external components configured in master mode who don't expect the Intel SOC/PCH to drive. Fix by configuring the SSP as slave before the SSP outputs are enabled to avoid this transient behavior.
When the topology file configures the SSP as clock master, the initial slave configuration will be overridden.
Also please be consistent in commit titles, using Intel with a capital 'I' shows you've paid attention to details.
By default, the I2S ports are configured in master mode during DSP powerup sequences, the FS and BCLK lines will be driven on startup, even when the topology file explicitly requires the SSP to be slave. This may be problematic for external components configured in master mode who don't expect the Intel SOC/PCH to drive. Fix by configuring the SSP as slave before the SSP outputs are enabled to avoid this transient behavior. When the topology file configures the SSP as clock master, the initial slave configuration will be overridden. Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
ecb2123 to
c77ad74
Compare
|
@plbossart Updated, thanks! |
|
one additional reviewer needed. |
ranj063
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart the change looks good to me. I havent read the documentation to confirm the APL/CNL SSP counts but if you are good with it, it should be fine.
thanks @ranj063 |
By default, the I2S ports are in master mode, during
DSP powerup sequences, this may cause distortion on
some boards for drives FS and BCLK high.
So we need to set it as slave before enabling DSP.
closes #778
Signed-off-by: Zhu Yingjiang yingjiang.zhu@linux.intel.com