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

drivers: sdhc: Add MAX32 SDHC driver #83464

Merged
merged 5 commits into from
Feb 14, 2025

Conversation

mertekren
Copy link
Contributor

@mertekren mertekren commented Dec 31, 2024

This PR adds SDHC support for max32666fthr.

Implement SDHC driver for MAX32666fthr
Add sdhc0 instances for MAX32666 .dtsi file
Add SDHC to MAX32666fthr board driver list

tests:
.\tests\drivers\sdhc
image

.\samples\subsys\fs\fs_sample\

image

.\tests\drivers\disk\disk_performance
image

Dependencies:

@mertekren mertekren changed the title sdhc: max32: Add sdhc for max32666fthr drivers: sdhc: Add MAX32 SDHC driver Jan 3, 2025
@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 3, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

dts/bindings/sdhc/adi,max32-sdhc.yaml Outdated Show resolved Hide resolved
boards/adi/max32666fthr/doc/index.rst Outdated Show resolved Hide resolved
drivers/sdhc/sdhc_max32.c Outdated Show resolved Hide resolved
drivers/sdhc/sdhc_max32.c Outdated Show resolved Hide resolved
drivers/sdhc/sdhc_max32.c Show resolved Hide resolved
* remove this with a better solution in future.
*/
k_sleep(K_MSEC(1));
ret = MXC_SDHC_SendCommand(&sd_cmd_cfg);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question here- is this function blocking? Or does it use interrupts within the HAL layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it's blocking. it loops in while() until register is complete/timeout. we'll try to add interrupt functionality in future.

@MaureenHelm MaureenHelm added this to the v4.1.0 milestone Jan 20, 2025
@mertekren
Copy link
Contributor Author

@mertekren I think you messed up your update to west.yml as it's doing a lot more than updating hal_adi :)

yes i rebased wrong, should be good now. thanks! :)

drivers/sdhc/sdhc_max32.c Outdated Show resolved Hide resolved
drivers/sdhc/sdhc_max32.c Outdated Show resolved Hide resolved
drivers/sdhc/sdhc_max32.c Show resolved Hide resolved
drivers/sdhc/sdhc_max32.c Show resolved Hide resolved
drivers/sdhc/sdhc_max32.c Outdated Show resolved Hide resolved
dts/arm/adi/max32/max32666.dtsi Outdated Show resolved Hide resolved
dts/bindings/sdhc/adi,max32-sdhc.yaml Outdated Show resolved Hide resolved
@mertekren mertekren force-pushed the add-max32-sdhc branch 2 times, most recently from 96adc08 to 005d7c2 Compare January 29, 2025 12:00
west.yml Outdated Show resolved Hide resolved
@fabiobaltieri fabiobaltieri added DNM (manifest) This PR should not be merged (controlled by action-manifest) and removed DNM This PR should not be merged (Do Not Merge) labels Feb 4, 2025
@zephyrbot zephyrbot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Feb 4, 2025
MaureenHelm
MaureenHelm previously approved these changes Feb 4, 2025
@MaureenHelm
Copy link
Member

Needs rebase.

@danieldegrasse can you take another look?

mertekren and others added 5 commits February 13, 2025 23:04
Include sdhc0 in MAX32666 devicetree and add devicetree bindings for
MAX32 SDHC driver

Signed-off-by: Mert Ekren <[email protected]>
This commit adds MAX32666 SDHC driver.

Co-Authored-By: Anil Kara <[email protected]>
Co-Authored-By: Tahsin Mutlugun <[email protected]>
Signed-off-by: Mert Ekren <[email protected]>
Add SDHC to supported list for MAX32666FTHR

Signed-off-by: Mert Ekren <[email protected]>
Add MAX32666fthr for fs_sample testing

Signed-off-by: Mert Ekren <[email protected]>
Add MAX32666fthr sdhc to tests/drivers/disk/disk_performance

Signed-off-by: Mert Ekren <[email protected]>
if (ios->power_mode == SDHC_POWER_OFF) {
MXC_SDHC_PowerDown();
} else {
MXC_SDHC_PowerUp();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this function a no-op if the card is already powered up? If so, I think this is fine- just want to make sure

.get_card_present = sdhc_max32_get_card_present,
.card_busy = sdhc_max32_card_busy,
.get_host_props = sdhc_max32_get_host_props,
.enable_interrupt = NULL,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit- these will be null if simply left out of initializer

@kartben kartben merged commit 0311f8b into zephyrproject-rtos:main Feb 14, 2025
25 checks passed
@kartben
Copy link
Collaborator

kartben commented Feb 14, 2025

@MaureenHelm just in time! :)

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

Successfully merging this pull request may close these issues.

6 participants