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: entropy: add maxq10xx #83797

Merged
merged 2 commits into from
Mar 23, 2025

Conversation

maass-hamburg
Copy link
Collaborator

add maxq10xx entropy device.

@m-byte
Copy link
Contributor

m-byte commented Jan 10, 2025

This looks weird to me. IMHO, the MAXQ10xx is a multi function device, not just a random number generator. Therefore, it should be implemented as such.

@ozersa
Copy link
Collaborator

ozersa commented Jan 17, 2025

This looks weird to me. IMHO, the MAXQ10xx is a multi function device, not just a random number generator. Therefore, it should be implemented as such.

Agreed, maxq10xx family is secure authenticator that supports multiple function, the implementation of them shall not be restrict it for TRNG. I think there might be a new driver class folder like: "drivers/auth" for authenticator OR existing crypto driver interface be extended then used as crypto device.

@maass-hamburg
Copy link
Collaborator Author

@ozersa I already changed it to mfd. so that the crypto or auth driver can be added later

@maass-hamburg
Copy link
Collaborator Author

ping @ceolin @ozersa

ceolin
ceolin previously approved these changes Feb 18, 2025
Copy link
Member

@ceolin ceolin left a comment

Choose a reason for hiding this comment

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

It looks ok to me.

@maass-hamburg
Copy link
Collaborator Author

ping @ozersa

ozersa
ozersa previously approved these changes Mar 1, 2025
Copy link
Collaborator

@ozersa ozersa left a comment

Choose a reason for hiding this comment

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

Thanks for enabling maxq10xx on zephyr.
Sorry for late response.

Comment on lines 6 to 31
#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ1XX_H_
#define ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ1XX_H_

#include <zephyr/device.h>
#include <zephyr/kernel.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Get the semaphore reference for a MAXQ1xx instance. Callers
* should pass the return value to k_sem_take/k_sem_give
*
* @param[in] dev Pointer to device struct of the driver instance
*
* @return Address of the semaphore
*/
struct k_sem *mfd_maxq10xx_get_lock(const struct device *dev);


#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ1XX_H_ */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ1XX_H_
#define ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ1XX_H_
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Get the semaphore reference for a MAXQ1xx instance. Callers
* should pass the return value to k_sem_take/k_sem_give
*
* @param[in] dev Pointer to device struct of the driver instance
*
* @return Address of the semaphore
*/
struct k_sem *mfd_maxq10xx_get_lock(const struct device *dev);
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ1XX_H_ */
#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ10XX_H_
#define ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ10XX_H_
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Get the semaphore reference for a MAXQ1xx instance. Callers
* should pass the return value to k_sem_take/k_sem_give
*
* @param[in] dev Pointer to device struct of the driver instance
*
* @return Address of the semaphore
*/
struct k_sem *mfd_maxq10xx_get_lock(const struct device *dev);
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_MAXQ10XX_H_ */

@kartben kartben added this to the v4.2.0 milestone Mar 3, 2025
Copy link
Collaborator

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

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

Overall nice! Just some minor remarks.

add maxq10xx entropy device.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
add maxq10xx mfd device to tests

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
@maass-hamburg maass-hamburg dismissed stale reviews from ozersa and ceolin via 3223822 March 5, 2025 11:04
@maass-hamburg
Copy link
Collaborator Author

@ceolin please re-approve as the maintainer

@kartben kartben merged commit 7c11db9 into zephyrproject-rtos:main Mar 23, 2025
21 checks passed
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.

8 participants