Skip to content
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

[dv,spi] Set strong drive strength and fast slew rate for SPI pads #24577

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sha-ron
Copy link
Contributor

@sha-ron sha-ron commented Sep 16, 2024

SPI pads should use strong drive strength and fast slew rate.

@sha-ron sha-ron requested a review from a team as a code owner September 16, 2024 12:15
@sha-ron sha-ron requested review from jadephilipoom and removed request for a team September 16, 2024 12:15
@timothytrippel timothytrippel requested review from andreaskurth and moidx and removed request for jadephilipoom September 17, 2024 15:40
@moidx
Copy link
Contributor

moidx commented Sep 17, 2024

CI has the following error:

E00003 power_virus_systemtest.c:1468] DIF-fail: dif_pinmux_pad_write_attrs(&pinmux, kTopEarlgreyDirectPadsSpiHost0Sck, kDifPinmuxPadKindDio, in_attr, &out_attr) returns 13

Code:

if (reg_value != read_value) {
return kDifError;
}

This only happens in the sival_rom_ext configuration. Need to check if we are locking pinmux register in that case

@moidx moidx self-requested a review September 17, 2024 20:46
@a-will
Copy link
Contributor

a-will commented Sep 17, 2024

CI has the following error:

E00003 power_virus_systemtest.c:1468] DIF-fail: dif_pinmux_pad_write_attrs(&pinmux, kTopEarlgreyDirectPadsSpiHost0Sck, kDifPinmuxPadKindDio, in_attr, &out_attr) returns 13

Code:

if (reg_value != read_value) {
return kDifError;
}

This only happens in the sival_rom_ext configuration. Need to check if we are locking pinmux register in that case

It's happening in all FPGA configurations because these pad attributes are not available. Pad attributes should not be written without proper matching against the configuration.

@moidx
Copy link
Contributor

moidx commented Sep 17, 2024

Thanks @a-will for your quick response.

@sha-ron, you will probably want to constraint this configuration to the follow device types:

  • kDeviceSilicon
  • kDeviceSimDV

@sha-ron
Copy link
Contributor Author

sha-ron commented Sep 18, 2024

Thank you @a-will, @moidx for the review and help with the CI failures. I added constrains on the configurations as suggested. Hopefully Ci will pass now.

@@ -1454,6 +1454,48 @@ bool test_main(void) {
if (kDeviceType == kDeviceSimDV || kDeviceType == kDeviceSimVerilator) {
configure_pinmux_sim();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably be moved to be inside the configure_pinmux_sim() function.

Signed-off-by: Sharon Topaz <[email protected]>

[dv,spi] fix lint issues

Signed-off-by: Sharon Topaz <[email protected]>

[dv,spi] Add kDeviceSimDV, kDeviceSilicon constraints

Signed-off-by: Sharon Topaz <[email protected]>

[dv,spi] Add kDeviceSimDV, kDeviceSilicon constraints to power virus

Signed-off-by: Sharon Topaz <[email protected]>
Comment on lines +700 to +714
CHECK_DIF_OK(
dif_pinmux_pad_write_attrs(&pinmux, kTopEarlgreyDirectPadsSpiHost0Sd0,
kDifPinmuxPadKindDio, in_attr, &out_attr));
CHECK_DIF_OK(
dif_pinmux_pad_write_attrs(&pinmux, kTopEarlgreyDirectPadsSpiHost0Sd1,
kDifPinmuxPadKindDio, in_attr, &out_attr));

CHECK_DIF_OK(
dif_pinmux_pad_write_attrs(&pinmux, kTopEarlgreyDirectPadsSpiHost0Sd2,
kDifPinmuxPadKindDio, in_attr, &out_attr));

CHECK_DIF_OK(
dif_pinmux_pad_write_attrs(&pinmux, kTopEarlgreyDirectPadsSpiHost0Sd3,
kDifPinmuxPadKindDio, in_attr, &out_attr));
// Spi_Device
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these attributes already set on the SPI Host 0 data pins? See lines 580 -- 601 in this file. Unless I am missing something here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think lines 580-601 only set pull up and not drive strength/slew rate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but can you merge this config with the lines I mentioned above? So we don't set the attributes twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, but dif_pinmux_pad_attr_flags

typedef enum dif_pinmux_pad_attr_flags {
doesn't have drive_strength and slew_rate fields. Am I missing something here?

Copy link
Contributor

@pamaury pamaury Sep 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The slew rate is an attribute, not an attribute flag:

dif_pinmux_pad_slew_rate_t slew_rate;

@timothytrippel
Copy link
Contributor

@sha-ron should this change be eventually cherry-picked over to the earlgrey_1.0.0 branch too?

@sha-ron
Copy link
Contributor Author

sha-ron commented Sep 20, 2024

@sha-ron should this change be eventually cherry-picked over to the earlgrey_1.0.0 branch too?

Yes, it should be merged also to earlgrey_1.0.0 branch (it is required for GLS simulation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants