Skip to content

Conversation

@Liam-Ogletree
Copy link

@Liam-Ogletree Liam-Ogletree commented Jul 10, 2025

The AT25XV021A variant is a flash variant of Atmel's AT25 family that adds extra protections, requiring additional writes to the device to program or erase data.

This commit adds a flash driver for AT25XV021A devices instead of modifying (1) the existing AT45 SPI flash driver or (2) the existing AT24/25 EEPROM driver because this variant poses fundamental changes that affect all aspects of the driver.

Notably,

  • AT25XV021A includes a second status register, and the format and functions of the existing status register is changed from the existing drivers.
  • AT25XV021A requires executing page or chip erase commands before writing, making it incompatible with the existing AT24/25 EEPROM driver.
  • AT25XV021A adds a software protection layer that requires extra writes before executing program or erase commands.

Tested writing to and erasing from an AT25XV021A device. Tested reading from an AT25XV021A device across page boundaries. Tested chip erase function. Tested driver initialization from varying initial hardware states.

@github-actions github-actions bot added area: Flash platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) labels Jul 10, 2025
@github-actions
Copy link

Hello @Liam-Ogletree, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from d9a8fa6 to 938b962 Compare July 10, 2025 18:55
@rriveramcrus
Copy link
Contributor

rriveramcrus commented Jul 10, 2025

It would be good to add an entry to tests/drivers/build_all/flash/spi.dtsi

@Liam-Ogletree
Copy link
Author

It would be good to add an entry to tests/drivers/build_all/flash/spi.dtsi

Added an entry to /spi.dtsi for this flash driver.

@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from 938b962 to aca63fe Compare July 11, 2025 14:16
@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch 2 times, most recently from 09c8642 to 2199a6a Compare July 11, 2025 21:10
@Liam-Ogletree Liam-Ogletree requested a review from de-nordic July 15, 2025 18:11
@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from 1a323c3 to 0570b3c Compare July 15, 2025 18:17
@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from 0570b3c to 3a033d7 Compare July 16, 2025 18:39
@Liam-Ogletree Liam-Ogletree requested a review from pdgendt July 22, 2025 03:02
@Liam-Ogletree
Copy link
Author

Hi @de-nordic,

Following up on this PR request -- thank you for your review from July 15th! I think I've addressed the changes requested, but please let me know if there are any additional changes you'd like me to make.

Thanks for your time,
Liam

@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from 3a033d7 to 742b5ab Compare August 15, 2025 14:34
@JarmouniA
Copy link
Contributor

JarmouniA commented Aug 15, 2025

Next time, please do 2 separate pushes for rebase and the changes after a review, so reviewer can easily check the diff using GitHub compare. Preferably do not rebase during ongoing review, leave it to the end (unless really necessary for CI).

@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from 742b5ab to 0abdd53 Compare August 15, 2025 19:36
@Liam-Ogletree
Copy link
Author

Next time, please do 2 separate pushes for rebase and the changes after a review, so reviewer can easily check the diff using GitHub compare. Preferably do not rebase during ongoing review, leave it to the end (unless really necessary for CI).

@JarmouniA -- Sorry about that, makes sense. Appreciate your help/review!

@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from 0abdd53 to 56252d1 Compare August 15, 2025 20:56
@JarmouniA JarmouniA dismissed their stale review August 15, 2025 22:12

addressed

@Liam-Ogletree
Copy link
Author

Hi @de-nordic,

Following up after @JarmouniA's review. Please let me know if you'd like any further changes, but I think I've addressed the changes requested above.

Thanks for your time!
Liam

include: "spi-device.yaml"

properties:
jedec-id:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the spec is for very specific compatible, shouldn't this, if possible, be also set to id for that exact device?

Copy link
Author

Choose a reason for hiding this comment

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

Parts manufactured by Renesas and Adesto (acquired by Renesas in ~2020) have the same JEDEC IDs, and I don't think there are any other AT25XV021A manufacturers today. So, I could make the JEDEC ID a fixed value in the driver and remove this binding, or I could leave it here with a default value for future flexibility.

I went ahead and removed the required: true property and set a default for the JEDEC ID. Please let me know if you'd like me to remove JEDEC ID entirely and hard-code it, or leave it as the default and allow for future flexibility.

Thanks!

type: uint8-array
required: true
description: |
JEDEC ID as manufacturer ID (1 byte) and device ID (2 bytes), e.g.,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just JEDEC id. The format is more complicated than that, and manufacturer of the compatible device can have actually something like 17 bytes of id.

Copy link
Author

Choose a reason for hiding this comment

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

Done

The AT25XV021A variant is a flash variant of Atmel's AT25 family
that adds extra protections, requiring additional writes to the
device to program or erase data.

This commit adds a flash driver for AT25XV021A devices instead of
modifying (1) the existing AT45 SPI flash driver or (2) the
existing AT24/25 EEPROM driver because this variant poses
fundamental changes that affect all aspects of the driver.

Notably,
 - AT25XV021A includes a second status register, and the format
	and functions of the existing status register is
	changed from the existing drivers.
 - AT25XV021A requires executing page or chip erase commands
	before writing, making it incompatible with the
	existing AT24/25 EEPROM driver.
 - AT25XV021A adds a software protection layer that requires
	extra writes before executing program or erase commands.

Tested writing to and erasing from an AT25XV021A device. Tested
reading from an AT25XV021A device across page boundaries. Tested
chip erase function. Tested driver initialization from varying
initial hardware states.

Signed-off-by: Liam Ogletree <[email protected]>
Dummy values mirror at25 and spi-nor implementation.

Signed-off-by: Liam Ogletree <[email protected]>
@Liam-Ogletree Liam-Ogletree force-pushed the add_drivers_flash_at25xv021a branch from 56252d1 to 3c7e8c6 Compare August 22, 2025 19:15
@sonarqubecloud
Copy link

@Liam-Ogletree
Copy link
Author

Hi @de-nordic,

Just wanted to follow up with you since addressing your latest comments. When you get a chance, let me know whether the change to jedec-id satisfies your change request or whether you'd like me to make additional adjustments.

Thank you for your time!
Liam

@Liam-Ogletree
Copy link
Author

Hi @pdgendt,

With de-nordic's recent approval, could I ask you to re-review since you previously reviewed/approved this PR?

Thanks for your time,
Liam

@kartben kartben merged commit 6524cc4 into zephyrproject-rtos:main Sep 2, 2025
26 checks passed
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Hi @Liam-Ogletree!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

@Liam-Ogletree Liam-Ogletree deleted the add_drivers_flash_at25xv021a branch September 5, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Flash platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants