-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
(stm32) drivers: stm32_tamp: add support for stm32mp25x platforms + backup register config from DT #7129
Conversation
Patchset reorganized and most of the comments applied. Some answers to you suggestions remaining. |
core/drivers/stm32_tamp.c
Outdated
bkpregs_count = fdt32_to_cpu(cuint[0]); | ||
|
||
pdata->bkpregs_conf->zone2_end = bkpregs_count + | ||
fdt32_to_cpu(cuint[1]); |
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.
Check DT property consistency?
assert(pdata->bkpregs_conf->zone2_end + fdt32_to_cpu(cuint[2]) ==
stm32_tamp_dev->hwconf1 & _TAMP_HWCFGR1_BKPREG);
More than checking the consistency, it would highlight why we expect 3 cells but read only the 2 first.
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.
Cannot do this at this stage of the probe sequence. I'll keep as is.
Comments addressed. Added a temporary |
core/include/drivers/stm32_tamp.h
Outdated
*/ | ||
struct stm32_bkpregs_conf { | ||
uint32_t nb_zone1_regs; | ||
uint32_t nb_zone2_regs; | ||
uint32_t *rif_offsets; |
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.
Can discard changes in stm32_tamp.h.
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.
Comment for commit "drivers: stm32_tamp: configure the backup registers when driver is probing".
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.
2 added comments. (+ note the minor signedness issue than makes build to fail)
Comments addressed |
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.
Comments for commit "drivers: stm32_tamp: add stm32mp25 support for RIF configuration".
core/drivers/stm32_tamp.c
Outdated
* | ||
* (BHK => First 8 registers) | ||
*/ | ||
pdata->bkpregs_conf.rif_offsets = calloc(4, sizeof(uint32_t)); |
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.
s/4/TAMP_RIF_OFFSET_CNT/
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.
Also adding a define for the number of zones.
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.
Comments for commit "drivers: stm32_tamp: configure the backup registers when driver is probing".
Comments addressed |
|
Add st,backup-zones property in TAMP node in stm32mp131.dtsi. It defines the topology of the backup registers zones. The number of zones on stm32mp13x platforms is 3. Signed-off-by: Gatien Chevallier <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
Add st,backup-zones property in TAMP node in stm32mp151.dtsi. It defines the topology of the backup registers zones. The number of zones on stm32mp13x platforms is 3. Signed-off-by: Gatien Chevallier <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
Add support for the RIF configuration of the TAMP peripheral. It covers the TAMP resources such as monotonic counters but also backup registers regions and sub-regions. Create a stm32_tamp_platdata structure to hold platform data. Add temporary stm32_bkpregs_conf_new structure that will be used by the new implementation and renamed to stm32_bkpregs_conf when the old one disappear. Signed-off-by: Gatien Chevallier <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
Add TAMP peripheral node in stm32mp251.dtsi. The TAMP peripheral manages monotonic counters, tamper events and backup registers. Signed-off-by: Gatien Chevallier <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
Add a TAMP RIF configuration for stm32mp257f-ev1 board to configure backup registers and TAMP resources. Signed-off-by: Gatien Chevallier <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
…obing Update the driver to be able to configure the backup registers when the driver is probing and remove call to stm32_tamp_set_secure_bkpregs() in plat-stm32mp1 main.c. Remove old implementation of stm32_bkpregs_conf structure and rename stm32_bkpregs_conf_new to stm32_bkpregs_conf. Signed-off-by: Gatien Chevallier <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
Default enable TAMP peripheral support for stm32mp2x platforms. Signed-off-by: Gatien Chevallier <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
Tags applied, thanks |
This P-R implements the backup registers configuration from the device tree and the stm32mp25x support.
It has a dependency on #7125 and should be merged afterwards.
There is a default st,backup-zones property at SoC level as it is mandatory to configure the backup registers secure level on our platforms. It can be superseeded at platform level.