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: eeprom: add support for Microchip ATECC608 #69920

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

maass-hamburg
Copy link
Collaborator

This adds support for the Microchip ATECC608 (and ATECC508) to be used as a eeprom. It also provides a driver to use it as a entropy source.

The code is mainly adapted from the Microchip cryptoauthlib

In the future it might also be extended to be used with the Crypto API.

@maass-hamburg
Copy link
Collaborator Author

ping

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

The code is mainly adapted from the Microchip cryptoauthlib

Please clarify this statement. The library code referred to is not under the Apache-2.0 license, however the code submitted is.

Was any code copied from the Microchip cryptoauthlib to form this solution?

Would it be possible to instead use the library and create shim drivers in Zephyr?

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

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

@maass-hamburg from the license in the repo:

Subject to your compliance with these terms, you may use the Microchip Software
and any derivatives exclusively with Microchip products. It is your
responsibility to comply with third party license terms applicable to your
use of third party software (including open source software) that may
accompany Microchip Software.

This license is not OSI-approved, and will never be because it restricts which hardware platforms the code can run on. If you took code that was licensed under this particular license then this is a no-go.

@maass-hamburg maass-hamburg force-pushed the ateccx08 branch 4 times, most recently from 211fa4a to 6aa8769 Compare March 22, 2024 09:06
drivers/entropy/entropy_ateccx08.c Outdated Show resolved Hide resolved
drivers/entropy/entropy_ateccx08.c Show resolved Hide resolved
drivers/entropy/entropy_ateccx08.c Outdated Show resolved Hide resolved
@maass-hamburg
Copy link
Collaborator Author

@henrikbrixandersen @carlescufi ping

decsny
decsny previously requested changes May 7, 2024
wake-delay:
type: int
description: delay in us to wait for the device to wake up
default: 1500
Copy link
Member

Choose a reason for hiding this comment

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

default values need justification in the description

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

now added

Copy link
Member

Choose a reason for hiding this comment

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

better to say "default value is the minimum according to the datasheet"

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Given this some more thought - Have you considered if support for this fits better under drivers/crypto? Similar to drivers/crypto/crypto_ataes132a.c?

The currently proposed driver exposes a lot of custom functionality in its header...

@maass-hamburg
Copy link
Collaborator Author

maass-hamburg commented Jul 5, 2024

Given this some more thought - Have you considered if support for this fits better under drivers/crypto? Similar to drivers/crypto/crypto_ataes132a.c?

At the moment my driver only supports the eeprom part and the entropy part, but not the crypto part. I could move it over there, but ATM but it would have any functions of the crypto_driver_api

The currently proposed driver exposes a lot of custom functionality in its header...

Yes, but unfortunately there are currently no general aps for these in zephyr. Like for the One-Time-Programmable Part

@maass-hamburg
Copy link
Collaborator Author

@henrikbrixandersen putting it under crypto would result in a dependency loop with the entropy driver.
How about putting it in drivers/mfd? That would be the right place for devices with multiply functions.

Add support for Microchip ATECC608 EEPROM and
ATECC508 EEPROM.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add entropy support for Microchip ATECC608
and ATECC508.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
@henrikbrixandersen
Copy link
Member

@henrikbrixandersen putting it under crypto would result in a dependency loop with the entropy driver. How about putting it in drivers/mfd? That would be the right place for devices with multiply functions.

An MFD driver with an EEPROM driver "child" would be a much better approach, yes.

@maass-hamburg
Copy link
Collaborator Author

@henrikbrixandersen putting it under crypto would result in a dependency loop with the entropy driver. How about putting it in drivers/mfd? That would be the right place for devices with multiply functions.

An MFD driver with an EEPROM driver "child" would be a much better approach, yes.

that is what i have done. Please take a look

Copy link
Member

Choose a reason for hiding this comment

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

These custom API additions are still way too much IMO. The whole idea of a driver subsystem like the one provided by the Zephyr EEPROM API is to be able to abstract the lower-level functionality into a common, portable API. This does the opposite just to make the device fit into the few API functions, it actually supports.

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

Successfully merging this pull request may close these issues.

6 participants