-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/kinetis: enable HWRNG for k64f #11985
Conversation
@cladmi might want to take a look at this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good. Just a tiny typo.
I tested it in a FRDM-k64f.
* @name Hardware random number generator module configuration | ||
* | ||
* For K64F SCG3 or SCG6 can be used depending on if the the | ||
* peripheral is accessed threw AIPS-lite0 or AIPS-lite1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* peripheral is accessed threw AIPS-lite0 or AIPS-lite1. | |
* peripheral is accessed through AIPS-lite0 or AIPS-lite1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
- Fix SCGx used for RNGA since RNGA is not mapped to SCG3 for K64F.
b9f5f6b
to
0ce2081
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.
I did not know about https://github.com/fjmolinas/RIOT/blob/0ce2081817af689905843885c9a32f4ec50fbd23/cpu/kinetis/include/cpu_conf_kinetis_k.h Thanks for addressing this. |
Contribution description
HWRNG was disabled for
frdm-k64f
in #11454 because 925a908 broke the support.When looking at
kinetis k64
reference manual under (AIPS-Lite0
andAIPS-Lite1
):If the peripheral Bridge for
AIPS-Lite-0
andAIPS-Lite-1
,RNGA
is only mapped inSCGC6
, so it shouldn't useSCGC3
fork64
.See 4.5 and 4.5.2 in RM.
This PR changes the SCGx register used for RNGA to SCG3.
note: this PR doesn't address the fact that the hwrng implementation for kinetis is flawed since it returns 32 bits of a register with 1 bit of entropy
Testing procedure
make -C tests/periph_hwrng/ BOARD=frdm-k64f clean flash -j term
python dist/tools/compile_and_test_for_board/compile_and_test_for_board.py --jobs 2 . frdm-k64f --applications="tests/gnrc_ipv6_nib tests/gnrc_ipv6_nib_6ln tests/gnrc_ndp tests/gnrc_netif tests/gnrc_sixlowpan tests/gnrc_sock_ip tests/gnrc_sock_udp tests/nhdp tests/pkg_c25519 tests/pkg_hacl tests/pkg_libcoap tests/pkg_libcose tests/pkg_libhydrogen tests/pkg_micro-ecc-with-hwrng tests/pkg_monocypher tests/pkg_qdsa tests/pkg_tweetnacl tests/pthread_barrier tests/pthread_rwlock tests/rng tests/trickle"
Issues/PRs references
Related to #11454
Fixes #11447