nvmem: stm32: add support for STM32MP15 BSEC to control OTP data
authorFabrice Gasnier <fabrice.gasnier@st.com>
Sat, 13 Apr 2019 10:32:56 +0000 (11:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Apr 2019 17:43:12 +0000 (19:43 +0200)
commit7c1cd8fda8fbcc3701f372003ef0a3b6d31e11f4
tree0226846cbb9d9cc43e8200b93475e31d538dc00f
parentded1b7fc2cf5a4ae3b902b0e46f592ab724b7828
nvmem: stm32: add support for STM32MP15 BSEC to control OTP data

On STM32MP15, OTP area may be read/written by using BSEC (boot, security
and OTP control). BSEC registers set is composed of various regions, among
which control registers and OTP shadow registers.
Secure monitor calls are involved in this process to allow (or deny)
access to the full range of OTP data.
This adds support for reading and writing OTP data using SMC services.
Data content can be aligned on 16-bits or 8-bits. Then take care of it,
since BSEC data is 32-bits wide.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/stm32-romem.c