Commit Graph

9942 Commits

Author SHA1 Message Date
Yann Gautier 85fb175b5e feat(st-pmic): register the PMIC to regulator framework
Register the PMIC to the regulator framework.

Change-Id: Ic825a8ef08505316db3dbd5944d62ea907f73c4a
Signed-off-by: Pascal Paillet <p.paillet@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-12-22 14:04:32 +01:00
Nicolas Le Bayon ae7792e058 refactor(st-pmic): split initialize_pmic()
print_pmic_info_and_debug() prints the PMIC version ID and displays
regulator information if debug is enabled.
It is under DEBUG flag and called after initialize_pmic() in BL2.

Change-Id: Ib81a625740b7ec6abb49cfca05e44c69efaa4718
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
2021-12-22 14:04:32 +01:00
Yann Gautier bba9fdee58 feat(stm32mp1): add regulator framework compilation
Add required macro PLAT_NB_RDEVS in platform code, and update
platform.mk to compile regulator framework.

Change-Id: I9dc7a0a4c4f5a23d9bedda368d407612c9cd21cd
Signed-off-by: Pascal Paillet <p.paillet@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-12-22 14:04:32 +01:00
Pascal Paillet d5b4a2c4e7 feat(regulator): add a regulator framework
Add a regulator framework to:
- provide an interface to consumers and drivers,
- connect consumers with drivers,
- handle most of devicetree-parsing,
- handle always-on and boot-on regulators,
- handle min/max voltages,

Change-Id: I23c939fdef2c71a416c44c9de332f70db0d2aa53
Signed-off-by: Pascal Paillet <p.paillet@st.com>
2021-12-22 14:04:32 +01:00
Pascal Paillet ea552bf5a5 feat(stpmic1): add new services
Add support for ICC, sink mode, bypass mode,
active discharge and list voltages.
Handle LDO3 sink source mode in a different way to avoid
setting voltage while in sink source mode.

Change-Id: Ib1b909fd8a153f542917f650e43e24317a570534
Signed-off-by: Pascal Paillet <p.paillet@st.com>
2021-12-22 14:04:32 +01:00
Etienne Carriere 13fbfe046e feat(stpmic1): add USB OTG regulators
Add regulators boost, pwr_sw1 and pwr_sw2 regulators related to
USB OTG supply BOOST, SW_OTG and SWIN/SWOUT. These regulators are
needed since manipulated during the suspend/resume power sequence
as per FDT description for stm32mp15x-xxx boards from
STMicroelectronics.

Change-Id: I6217de707e49882bd5a9100db43e0d354908800d
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2021-12-22 14:04:32 +01:00
Nicolas Le Bayon c77c7d9e30 refactor(st-pmic): improve driver usage
Store status of dt_pmic_status() as local static variable,
this avoids parsing DT several times.
In the same way, store nodes in dt_pmic_i2c_config() and
in dt_get_pmic_node() as local static variables.

Change-Id: I4585e9dfdde2847a369bffcc6f2b39ecc2b74de1
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
2021-12-22 14:04:32 +01:00
Nicolas Le Bayon 16e56a75de refactor(stpmic1): set stpmic1_is_regulator_enabled() as boolean
Improve use and readability.

Change-Id: Ia99fc38287f36c9dd12bfe51352afa5da68c0e47
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
2021-12-22 14:04:32 +01:00
Yann Gautier 0c16e7d2fb refactor(stm32mp1): re-order drivers init
SYSCFG can be initialized later, after console is up, to display the
warnings or messages it could issue.
PMIC should be initialized earlier, before SYSCFG init.

Change-Id: Icc3a1366083a1b1fde7f0e173645449b4c04c49b
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-22 14:04:32 +01:00
Yann Gautier 24ab2c0af7 fix(sve): disable ENABLE_SVE_FOR_NS for AARCH32
With patch [1], ENABLE_SVE_FOR_NS is always enable.
Disable it for AARCH32 platforms, as the feature is not supported.
The warning message is replaced with an error, and the second override
is removed.

[1] dc78e62d80 ("feat(sme): enable SME functionality")

Change-Id: Ic9c5e2612c9e00bd0d37ca3b59537e39270c9799
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-22 14:03:19 +01:00
Yann Gautier 33667d299b feat(st): use newly introduced clock framework
Replace calls to stm32mp_clk_enable() / stm32mp_clk_disable() /
stm32mp_clk_get_rate() with clk_enable() / clk_disable() /
clk_get_rate().

Change-Id: I15d2ce57b9499211fa522a1b53eeee9cf584c111
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
2021-12-22 13:08:09 +01:00
Gabriel Fernandez 847c6bc8e6 feat(clk): add a minimal clock framework
This is mainly a clock interface with clk_ops callbacks.
Those callbacks are: enable, disable, get_rate, set_parent,
and is_enabled.
This framework is compiled for STM32MP1.

Change-Id: I5119a2aeaf103ceaae7a60d9e423caf0c148d794
Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
2021-12-22 13:07:23 +01:00
Venkatesh Yadav Abbarapu 2c791499c2 feat(versal): add UART1 as console
Currently only UART0 is handled as console device, fix the
code to support UART1 as console also.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: Ifcd3c331cf6ce4afb0074357c92fc4addb9438b6
2021-12-22 03:56:42 -07:00
Venkatesh Yadav Abbarapu ea66e4af0b feat(zynqmp): add uart1 as console
Currently only UART0 is handled as console device, fix the
code to support UART1 as console also.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I08f69b65b78b967ceb7159f4a467aa5982b1f791
2021-12-22 03:56:16 -07:00
Rex-BC Chen 24dd5a7b71 feat(plat/mediatek/mt8186): add reboot function for PSCI
Add system_reset function in PSCI operations.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I41001484f6244bd6ae7dedcfb6ce71cd6c035a1e
2021-12-22 18:06:53 +08:00
Rex-BC Chen a68346a772 feat(plat/mdeiatek/mt8186): add power-off function for PSCI
Add support for system-off.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Ic734696aab1b71ae85bca6ed08e544a522ce5c95
2021-12-22 18:06:53 +08:00
Rex-BC Chen 572f8adbb0 feat(plat/mediatek/mt8186): apply erratas for MT8186
MT8186 uses Cortex A76 CPU, so we apply these erratas.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I84741535fbe429f664092f624c2da653532204cd
2021-12-22 18:06:53 +08:00
Garmin.Chang 06cb65ef07 feat(plat/mediatek/mt8186): add MCDI drivers
Add MCDI related drivers to handle CPU powered on/off in CPU suspend.

TEST=build pass
BUG=b:202871018

Change-Id: I85aaaf3a0e992a39d17c58f3d9d5ff1b5770f748
Signed-off-by: Garmin.Chang <Garmin.Chang@mediatek.com>
2021-12-22 18:06:53 +08:00
Garmin.Chang 1da57e54b2 feat(plat/mediatek/mt8186): add CPU hotplug
Implement PSCI platform operations to support CPU hotplug and MCDI.

TEST=bringup 8 CPUs successfully on kernel stage.
BUG=b:202871018

Change-Id: Ibd5423b70b3ca3f91edaa48d7ca5bc094e751510
Signed-off-by: Garmin.Chang <Garmin.Chang@mediatek.com>
2021-12-22 18:06:53 +08:00
Yuchen Huang 6e5d76bac8 feat(plat/mediatek/mt8186): add RTC drivers
Add RTC drivers for EOSC calibration.

TEST=build pass
BUG=b:202871018

Signed-off-by: Yuchen Huang <yuchen.huang@mediatek.corp-partner.google.com>
Change-Id: Ib48c07204c4a614072ba710c042794b59e8a902a
2021-12-22 18:06:53 +08:00
Rex-BC Chen 0fe7ae9c64 fix(plat/mediatek/mt8186): extend MMU region size
In mt8186 suspend/resume flow, ATF has to communicate with a subsys by
read/write the subsys registers. However, the register region of subsys
doesn't include in the MMU mapping region. It triggers MMU faults.

This patch extends the MMU region 0 size to cover all mt8186 HW modules.
This patch also remove MMU region 1 because region 0 covers region 1.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I520c51338578bd68756cd02603ce6783f93daf51
2021-12-22 18:06:53 +08:00
Edward-JW Yang 95ea87ffc2 feat(plat/mediatek/mt8186): add DCM driver
DCM means dynamic clock management, and it can dynamically
slow down or gate clocks during CPU or bus idle.

1. Add MCUSYS related DCM drivers.
2. Enable MCUSYS related DCM by default.

TEST=build pass
BUG=b:202871018

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.corp-partner.google.com>
Change-Id: Idc669364c89cde0974d2940bd12987ee833d1965
2021-12-22 18:06:53 +08:00
Guodong Liu af5a0c40af feat(plat/mediatek/mt8186): add pinctrl support
Add MT8186 pinctrl support.

TEST=build pass
BUG=b:202871018

Signed-off-by: Guodong Liu <guodong.liu@mediatek.corp-partner.google.com>
Change-Id: I5b9c1c60a91c74c7d3f45c78a9403544373fa90f
2021-12-22 18:06:53 +08:00
Zhengnan Chen 109b91e38c feat(plat/mediatek/mt8186): add sys_cirq support
Add 8186 sys_cirq info.

TEST=build pass
BUG=b:202871018

Signed-off-by: Zhengnan Chen <zhengnan.chen@mediatek.corp-partner.google.com>
Change-Id: Ib8a1c4e995288bf5f7981ea65f27727715fe5787
2021-12-22 18:06:53 +08:00
Christine Zhu 206f125cc1 feat(plat/mediatek/mt8186): initialize GIC
Initialize GIC for mt8186.

TEST=build pass
BUG=b:202871018

Signed-off-by: Christine Zhu <christine.zhu@mediatek.corp-partner.google.com>
Change-Id: I8d029983c7ce48fa116fafa7fa78c65349308014
2021-12-22 18:06:53 +08:00
Rex-BC Chen 5aab27dc42 feat(plat/mediatek/mt8186): add SiP service
Add the basic SiP service.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I4dcc7383237bb6c1f2494920cde21197754f6367
2021-12-22 18:06:53 +08:00
James Lo 5bc88ec61c feat(plat/mediatek/mt8186): add pwrap and pmic driver
1. Add 8186 pwrap driver to access pmic.
2. Add 6366 pmic driver to support clean PWRHOLD.

TEST=build pass
BUG=b:202871018

Signed-off-by: James Lo <james.lo@mediatek.corp-partner.google.com>
Change-Id: I3bc90460a6a55dff8d3293e04482abcad789bbb2
2021-12-22 18:06:53 +08:00
Rex-BC Chen d73e15e66a feat(plat/mediatek/mt8186): initialize delay_timer
Initialize delay_timer for delay functions.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Ib8f52d1c674537795cc478015c83cca0f872df60
2021-12-22 18:06:53 +08:00
Rex-BC Chen a6a0af57c3 feat(plat/mediatek/mt8186): initialize systimer
Add systimer to support timer function.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I505f7d094410d178e4203e3a9294b851a30ba150
2021-12-22 18:06:53 +08:00
Penny Jan 1b17e34c5d feat(plat/mediatek/mt8186): add EMI MPU basic driver
EMI MPU stands for external memory interface memory protect unit.
MT8186 supports 32 regions and 16 domains.
We add basic driver currently, and will add more settings for
EMI MPU in next patch.

TEST=build pass
BUG=b:202871018

Signed-off-by: Penny Jan <penny.jan@mediatek.corp-partner.google.com>
Change-Id: Ia9e5030164e40e060a05e8f91d2ac88258c2e98e
2021-12-22 18:06:48 +08:00
Bipin Ravi 47833abd77 Merge "fix(errata): workaround for Cortex X2 erratum 2002765" into integration 2021-12-22 01:12:32 +01:00
Bipin Ravi c2d75fa7a3 Merge "fix(errata): workaround for Cortex X2 erratum 2083908" into integration 2021-12-22 01:10:54 +01:00
Mark Dykes c8076a0e69 Merge "fix(doc): update TF-A v2.7 release date in the release information page" into integration 2021-12-21 19:08:44 +01:00
johpow01 e16045de50 fix(errata): workaround for Cortex X2 erratum 2058056
Cortex X2 erratum 2058056 is a Cat B erratum present in the X2 core.
It applies to revisions r0p0, r1p0, and r2p0 and is still open.

There are 2 ways this workaround can be accomplished, the first of
which involves executing a few additional instructions around MSR
writes to CPUECTLR when disabling the prefetcher. (see SDEN for
details)

However, this patch implements the 2nd possible workaround which sets
the prefetcher into its most conservative mode, since this workaround
is generic.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN1775100

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Idb20d9928c986616cd5bedf40bb29d46d384cfd3
2021-12-21 11:52:26 -06:00
Bipin Ravi 3e80e840c1 fix(doc): update TF-A v2.7 release date in the release information page
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: Iae84f82518ab89edc204a23083d5f4168449c2bf
2021-12-21 09:14:48 -06:00
Manish V Badarkhe ab556c9c64 fix(fiptool): avoid packing the zero size images in the FIP
Updated the fiptool to avoid packing the zero size images in
the FIP.
Also, updated the commitlint-json file to cover the fiptool
changes under a separate scope.

Change-Id: Id7ac3dcff0c7318546e49308d0f17b6cbd5eb24b
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-12-20 13:31:38 +00:00
Madhukar Pappireddy f480c9c42b Merge "fix(stm32mp1): correct include order" into integration 2021-12-17 20:04:33 +01:00
johpow01 34ee76dbdf fix(errata): workaround for Cortex X2 erratum 2002765
Cortex X2 erratum 2002765 is a Cat B erratum present in the X2 core.
It applies to revisions r0p0, r1p0, and r2p0 and is still open.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN1775100

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I11576a03bfd8a6b1bd9ffef4430a097d763ca3cf
2021-12-17 18:23:59 +01:00
Madhukar Pappireddy 1d996e567c Merge changes from topic "morello_plat_support" into integration
* changes:
  feat(morello): expose scmi protocols in fdts
  fix(morello): change the AP runtime UART address
  feat(morello): add support for nt_fw_config
  feat(morello): split platform_info sds struct
  feat(morello): add changes to enable TBBR boot
  feat(morello): add DTS for Morello SoC platform
  feat(morello): configure DMC-Bing mode
  feat(morello): zero out the DDR memory space
  feat(morello): add TARGET_PLATFORM flag
  fix(morello): fix SoC reference clock frequency
  fix(arm): use PLAT instead of TARGET_PLATFORM
2021-12-17 15:10:52 +01:00
Yann Gautier ff7675ebf9 fix(stm32mp1): correct include order
Warnings about header files include order were triggered by CI.
Correct the include order to mathc CI requirements.

Change-Id: Iaca959add924e0e1fa2e56fab2348f0ee36e5fa7
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-17 09:53:04 +01:00
johpow01 1db6cd6027 fix(errata): workaround for Cortex X2 erratum 2083908
Cortex X2 erratum 2083908 is a Cat B erratum present in the Cortex
X2 core. It applies to revision r2p0 and is still open.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN1775100

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Id9dca2b042bf48e75fb3013ab37d1c5925824728
2021-12-16 23:22:27 +01:00
Madhukar Pappireddy e6b1a9abb6 Merge "feat(plat/fvp_r): Threat Model for TF-A v8-R64 Support" into integration 2021-12-16 17:18:01 +01:00
Olivier Deprez 65c2d2a844 Merge "fix(amu): add default value for ENABLE_FEAT_FGT and ENABLE_FEAT_ECV flags" into integration 2021-12-16 16:34:28 +01:00
Anurag Koul 87639aab0b feat(morello): expose scmi protocols in fdts
Add 'firmware' node in morello-soc.dts to expose SCMI
support to the kernel. The SCMI protocols supported at
the moment are SCMI Base, Clock and Perf (DVFS).

The current mailbox memory region in MHU SRAM has an issue
with any access not aligned to a 4-byte boundary. So, the SCMI
mailbox memory region has been relocated to AP non-trusted
RAM to get around the problem.

Signed-off-by: Anurag Koul <anurag.koul@arm.com>
Change-Id: Ibcbce8823b751a0fc3be7e9bc3588c1dc47ae024
2021-12-16 19:56:31 +05:30
Chandni Cherukuri 07302a23ec fix(morello): change the AP runtime UART address
SoC UART1 is internally connected to MCP UART1 so this
cannot be used as AP runtime UART instead we use the
IOFPGA UART0 as the AP runtime UART.

Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: Iecefb0d2cb875b3ecf97e0983b06f6e914835021
2021-12-16 19:56:31 +05:30
sah01 6ad6465e5c feat(morello): add support for nt_fw_config
This patch adds support to load nt_fw_config
with the information from plat_info sds
structure which is then passed from BL2 to BL33.

Signed-off-by: sah01 <sahil@arm.com>
Change-Id: I2242da7404c72a4f9c2e3d7f3b5c154890a78526
2021-12-16 19:56:26 +05:30
sah01 4a7a9dafbc feat(morello): split platform_info sds struct
Different platform_info sds struct definition will be used
for fvp and soc.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: I92f0e1b2d0d755ad0405ceebfeb78d6e4c67013d
2021-12-16 19:55:14 +05:30
Manoj Kumar 4af5397753 feat(morello): add changes to enable TBBR boot
This patch adds all SOC and FVP related changes required to boot
a standard TBBR style boot on Morello.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: Ib8f7f326790b13082cbe8db21a980e048e3db88c
2021-12-16 19:55:08 +05:30
Madhukar Pappireddy e119c2056c Merge "docs(ff-a): boot order field of SPs manifest" into integration 2021-12-16 15:17:08 +01:00
Gary Morrison dc669220d5 feat(plat/fvp_r): Threat Model for TF-A v8-R64 Support
Threat model for the current, BL1-only R-class support.

Signed-off-by: Gary Morrison <gary.morrison@arm.com>
Change-Id: I8479d5cb30f3cf3919281cc8dc1f21cada9511e0
2021-12-16 08:10:35 -06:00