Commit Graph

431 Commits

Author SHA1 Message Date
Michal Simek
b0eb6d124b fix(versal-net): use api_id directly without FUNCID_MASK
The purpose of this code is to extract api_id from smc_fid but this masking
is done already in the code with using generic mask from smccc.h
(FUNCID_NUM_MASK). That's why remove FUNCID_MASK is which not needed and
actually also equal to already used FUNCID_NUM_MASK.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I1113825baa5d9d58d9d7c5d9d5855fecf62e8d45
2022-10-03 14:03:38 +02:00
HariBabu Gattem
c889088386 fix(zynqmp): resolve MISRA-C:2012 R.10.1 warnings
MISRA Violation: MISRA-C: 2012 R.10.1
- The operand to the operator does not have an essentially
unsigned type.

Signed-off-by: HariBabu Gattem <haribabu.gattem@amd.com>
Change-Id: I0f974e9d6f63dddfab55d55c952a57645d931e40
2022-09-30 10:40:34 +02:00
HariBabu Gattem
cdb62114cf fix(zynqmp): resolve misra 4.6 warnings
MISRA Violation: MISRA-C:2012 R.4.6
- Using basic numerical type int rather than a typedef
that includes size and signedness information.

Signed-off-by: HariBabu Gattem <haribabu.gattem@amd.com>
Change-Id: I3779f7b6e074e33cb66ace3bef2117029badce1e
2022-09-26 12:13:00 +02:00
Claus Pedersen
885e268304 refactor(libc): clean up dependencies in libc
- Removing platform dependencies from libc modules.
- Replacing panicking with actual error handling.
- Debug macros are included indirectly from assert.h. Removing
  "platform_def.h" from assert.h and adding "common/debug.h"
  where the macros are used.
- Removing hack for fixing PLAT_LOG_LEVEL_ASSERT to 40.
  Instead removing assert with expression, as this
  does not provide additional information.

Signed-off-by: Claus Pedersen <claustbp@google.com>
Change-Id: Icc201ea7b63c1277e423c1cfd13fd6816c2bc568
2022-09-22 13:23:49 +02:00
Sai Pavan Boddu
6a079efd90 feat(versal_net): add support for QEMU COSIM platform
QEMU COSIM platform is equivalent to qemu with additional cosim
extensions, so just switching platform_id to QEMU if QEMU_COSIM is
detected.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I922d10b1605c7f900158fa7fbe82571d3b9d4792
2022-09-22 08:45:53 +02:00
Joanna Farley
f47d38ba02 Merge changes from topic "xilinx-versal-net" into integration
* changes:
  feat(versal-net): add support for platform management
  feat(versal-net): add support for IPI
  feat(versal-net): add SMP support for Versal NET
  feat(versal-net): add support for Xilinx Versal NET platform
  feat(versal-net): add documentation for Versal NET SoC
2022-09-21 18:29:58 +02:00
Jay Buddhabhatti
0654ab7f75 feat(versal-net): add support for platform management
Add support for PM EEMI interface for Versal_net. Also use PM
APIs in psci ops. Added TFA_NO_PM flag to disable PM functionality.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: If2b2941c868bc9b0850d7f3adb81eac0e660c149
2022-09-20 19:02:42 +02:00
Michal Simek
0bf622de68 feat(versal-net): add support for IPI
Add support to send IPI to firmware.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Akshay Belsare <Akshay.Belsare@amd.com>
Change-Id: I8cd54c05b6a726e0d398dfc1cdcc7f4cf09ba725
2022-09-20 19:02:39 +02:00
Michal Simek
8529c7694f feat(versal-net): add SMP support for Versal NET
Add SMP support for Versal NET via register access.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Akshay Belsare <Akshay.Belsare@amd.com>
Change-Id: I46d73e2cd678ae720b5255722b6b0611c22659e8
2022-09-20 09:25:32 +02:00
Michal Simek
1d333e6909 feat(versal-net): add support for Xilinx Versal NET platform
New SoC is a78 based with gicv3 and uart over pl011. Communication
interfaces are similar to Versal platform. System starts with Xilinx PLM
firmware which loads TF-A(bl31) to DDR, which is already configured, and
jumps to it. PLM also prepare handoff structure for TF-A with information
what components were load and flags which indicate which EL level SW should
be started.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Akshay Belsare <Akshay.Belsare@amd.com>
Change-Id: I2a16c242a77be6c91be3d198727dc3b9bbb97410
2022-09-20 09:19:43 +02:00
HariBabu Gattem
15dc3e4f8d fix(zynqmp): resolve the misra 4.6 warnings
MISRA Violation: MISRA-C:2012 R.4.6
- Using basic numerical type int rather than a typedef
that includes size and signedness information.

Change-Id: Id85e69b29b124052b4a87462ce27fcdfc00c13c9
Signed-off-by: HariBabu Gattem <haribabu.gattem@amd.com>
2022-09-19 04:17:50 -07:00
Joanna Farley
8edd190e64 Merge "feat(versal): update macro name to generic and move to common place" into integration 2022-09-16 10:56:59 +02:00
Joanna Farley
b86cbe10d2 Merge changes from topic "provencore-spd" into integration
* changes:
  feat(zynqmp): add support for ProvenCore
  feat(services): add a SPD for ProvenCore
  feat(gic): add APIs to raise NS and S-EL1 SGIs
2022-09-16 10:52:37 +02:00
Jeremie Corbier
358aa6b211 feat(zynqmp): add support for ProvenCore
ProvenCore requires secure SGIs to be handled at S-EL1. This patch
overrides the default ZynqMP configuration to handle them at EL3 in case
ProvenCore SPD is enabled.

Signed-off-by: Jeremie Corbier <jeremie.corbier@provenrun.com>
Signed-off-by: Mélanie Favre <melanie.favre@provenrun.com>
Change-Id: I2e36d2983f82fbb9b7acf7e18791b8ed92811b60
2022-09-15 22:26:57 +02:00
Joanna Farley
4e407e0d25 Merge "fix(versal): route GIC IPI interrupts during setup" into integration 2022-09-15 09:16:20 +02:00
Joanna Farley
71f286c211 Merge "fix(zynqmp): move debug bl31 based address back to OCM" into integration 2022-09-15 09:15:21 +02:00
Tanmay Shah
04cc91b43c fix(versal): route GIC IPI interrupts during setup
If primary core is down, then IPI interrupt should be
routed to another core for processing.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: I01d7c4232a18c0c3b3f3f9ddadfa6ff5bd2f2471
2022-09-14 17:46:05 +02:00
Joanna Farley
febefa4dbb Merge changes from topic "xilinx-pm-misc-changes" into integration
* changes:
  fix(xilinx): update define for ZynqMP specific functions
  fix(xilinx): remove unnecessary header include
  fix(xilinx): include missing header
2022-09-14 12:01:37 +02:00
Joanna Farley
77135473c5 Merge changes from topic "xilinx-misc-changes" into integration
* changes:
  chore(zynqmp): fix comment style in zynqmp_def.h
  chore(versal): add missing dot at the end of sentence
  fix(zynqmp): remove additional 0x in %p print
  fix(versal): fix Misra-C violations in bl31_setup and pm_svc_main
2022-09-14 11:52:29 +02:00
Rajan Vaja
24b5b53a59 fix(xilinx): update define for ZynqMP specific functions
Instead of exclude code for Versal, define only for ZynqMP.
For new platforms this code should be excluded so instead of
excluding for all platform, define only for ZynqMP.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I45798dadc0f374c5794f517f7d0158675a75caa9
2022-09-14 10:15:16 +02:00
Rajan Vaja
0ee2dc118c fix(xilinx): remove unnecessary header include
Platform specific IPI header inclusion is not required
in common IPI source file. So remove inclusion of the same.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I6686757f00370c6ec42b5ee2c44ea5cd13da70c0
2022-09-14 10:12:42 +02:00
Rajan Vaja
28ba140021 fix(xilinx): include missing header
pm_ipi.h needs some definitions from stddef.h so include it.
Currently it is working because required file is included
indirectly due to other includes.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ic4a6c469c3152e21eaeb365ba96f3a29f14593bf
2022-09-14 10:12:16 +02:00
Michal Simek
f114fd3b10 chore(zynqmp): fix comment style in zynqmp_def.h
Add missing space in one line comment to follow common coding style.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Idebf8f34bf48444ee20a68ac3e6fd7f5a41bf8b0
2022-09-14 09:35:58 +02:00
Michal Simek
8f4b37f12e chore(versal): add missing dot at the end of sentence
Add missing dot at the end of sentence.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I356e65fd8c572c12795e3492dd02d73f48cb4b67
2022-09-14 09:34:46 +02:00
Michal Simek
05a6107ff1 fix(zynqmp): remove additional 0x in %p print
%p is already printing value in hex that's why 0x prefix is not needed.
Origin message looks like this
"NOTICE:  Can't read DT at 0x0x100000"
and after fixing
"NOTICE:  Can't read DT at 0x100000"

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: If83c485a61441f6105d8cbd797f04060dfce2817
2022-09-14 09:31:33 +02:00
Michal Simek
68ffcd1bb2 fix(versal): fix Misra-C violations in bl31_setup and pm_svc_main
Fix some Misra-C violations. The similar fixes were done by commit
eb0d2b1772 ("fix(zynqmp): resolve misra R15.6 warnings") and commit
dd1fe7178b ("fix(zynqmp): resolve misra R14.4 warnings").

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I3ffa92724a09871f7f99c9ac6c326994c165e9bd
2022-09-14 09:26:23 +02:00
Tanmay Shah
ac6c135c83 fix(zynqmp): ensure memory write finish with dsb()
GICD reg write must complete before core goes to idle
mode. Achieve this with dsb() barrier instruction in IPI
ISR

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: I5af42ca901567ee5e54a5434ebe3e673a92cb9be
2022-09-13 11:19:01 -07:00
Michal Simek
0ba3d7a4ca fix(zynqmp): move debug bl31 based address back to OCM
The commit 389594dfa7 ("fix(zynqmp): move bl31 with DEBUG=1 back to OCM")
tried to move address to OCM but address was actually out of OCM and likely
it was typo. Correct default address should be 0xfffe5000. If TF-A size is
bigger please select location DDR which should be fine for DEBUG cases.

Reported-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I055f3a59cdca527f6029fcc2a19d76be35924d24
2022-09-13 14:33:36 +02:00
Jay Buddhabhatti
f99306d49b feat(versal): update macro name to generic and move to common place
Update TZ_VERSION macro name to generic macro name and move to
common header file so that it can be used for keystoneb.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@xilinx.com>
Acked-by: Tanmay Shah <tanmay.shah@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ic3819eea78b6c7b51ffaa13081026dd191b76125
2022-09-13 14:01:23 +02:00
Tanmay Shah
e497421d7f feat(versal): add infrastructure to handle multiple interrupts
Only one hardcode interrupt handler is supported as of now.
This is IPI interrupt between APU and PMC processor.
This patch adds infrastructure to register multiple interrupt
handlers. This infrastructure was used and tested for two
interrupts and so, interrupt id and handler container size is
2 which is defined by MAX_INTR_EL3. Interrupt id is not used
as container index due to size constraints. User is expected to
adjust MAX_INTR_EL3 based on how many interrupts are handled in
TF-A

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: Id49d94f6773fbb6874ccf89c0d12572efc7e678e
2022-09-13 09:22:47 +02:00
Tanmay Shah
5897e13544 fix(versal): add SGI register call version check
PM_FEATURE_CHECK is supported only for platform
management API. PM_LOAD_PDI command is not intended
for platform management. This patch removes version
check of PM_LOAD_PDI and adds version check of command
that is used for SGI registartion.

Signed-off-by: Tanmay Shah <tanmay.shah@xilinx.com>
Change-Id: I353163109b639acab73120f405a811770e8831a0
2022-09-13 09:22:36 +02:00
Akshay Belsare
4264bd33e7 fix(zynqmp): fix for incorrect afi write mask value
Currently, the AFIFM6_WRCTRL bus-width configuration is not happening
correctly due to the wrong register write mask value. To fix this issue
updated the mask value handling logic.

Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
Signed-off-by: Akshay Belsare <Akshay.Belsare@amd.com>
Acked-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Change-Id: I8443c369a84339018310cfb6cd498d21474da3e4
2022-08-23 11:50:52 +05:30
Joanna Farley
000e25bf6f Merge "fix(versal): use only one space for indentation" into integration 2022-08-08 00:00:44 +02:00
Michal Simek
dee5885913 fix(versal): use only one space for indentation
Trivial patch to remove additional space.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ifa33dee81243c0b21ca0f13b8e4d575646818162
2022-08-04 14:08:32 +02:00
Michal Simek
72583f92e6 fix(versal): fix code indentation issues
Next line should be aligned with the previous code.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I20d82ba5fa70fa252341b62e57fac265241f3391
2022-08-04 09:21:12 +02:00
Michal Simek
80806aa123 fix(versal): fix macro coding style issues
Use only one space between #define and macro name.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ieb9bdd5bcfa56bd265df72692a09c7340fe132cb
2022-08-04 09:21:07 +02:00
Joanna Farley
342a65fb21 Merge "feat(zynqmp): protect eFuses from non-secure access" into integration 2022-08-01 12:05:18 +02:00
Venkatesh Yadav Abbarapu
19f92c4cfe fix(versal): resolve misra 10.1 warnings
MISRA Violation: MISRA-C: 2012 R.10.1
-The operand to the operator does not have an essentially
unsigned type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I4873a620086dfd6f636fe730165a9d13a29e9652
2022-07-31 14:08:53 +05:30
Venkatesh Yadav Abbarapu
f7c48d9e30 fix(versal): resolve the misra 4.6 warnings
MISRA Violation: MISRA-C:2012 R.4.6
- Using basic numerical type int rather than a typedef
that includes size and signedness information.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: Ieff90b5311a3bde8a2cb302ca81c23eeee6d235a
2022-07-31 14:07:11 +05:30
Vesa Jääskeläinen
d0b7286e48 feat(zynqmp): protect eFuses from non-secure access
When configuration option ZYNQMP_SECURE_EFUSES is defined then Xilinx
ZynqMP's PS eFuses can only be accesses from secure state.

This enables eFuses to be reserved and protected only for security use
cases for example in OP-TEE.

Change-Id: I866905e35ce488f50f5f6e1b4667b08a9fa2386d
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2022-07-29 23:57:18 +03:00
Venkatesh Yadav Abbarapu
bfc514f103 fix(xilinx): miscellaneous fixes for xilinx platforms
This patch gathers miscellaneous minor fixes to the xilinx
platforms like tabs for indentation and misra 10.1 warnings.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I4cdb89ffec7d5abc64e065ed5b5e5d10b30ab9f9
2022-07-28 08:57:59 +05:30
Michal Simek
47f8145324 fix(versal): remove clock related macros
TF-A doesn't configure clock on Versal. Setup is done by previous
bootloader (called PLM) that's why there is no need to have macro listed in
headers. Also previous phase can disable access to these registers that's
why better to remove them.

Change-Id: I53ba344ad932c532b0babdce9d2b26e4c2c1b846
Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-07-25 10:16:20 +02:00
Venkatesh Yadav Abbarapu
b86e1aade1 feat(versal): resolve the misra 10.1 warnings
MISRA Violation: MISRA-C:2012 R.10.1
-The operand to the operator does not have an essentially unsigned type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I9cde2f1ebceaad8a41c69489ef1d2e6f21f04ed1
2022-07-20 09:03:22 +05:30
Venkatesh Yadav Abbarapu
205c7ad4cd feat(versal): get the handoff params using IPI
Use the IPI command GET_HANDOFF_PARAM to get the TF-A handoff
params, rather than using the PLM's PPU RAM area. With this
approach this resolves the issue when XPPU is enabled.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Change-Id: I6828c391ad696d2d36e994684aa21b023711ba2d
2022-07-12 09:22:50 +05:30
Venkatesh Yadav Abbarapu
237a7de149 refactor(xilinx): move the atf handoff structure
Move the ATF handoff structure from the plat_startup.c to the
header file plat_startup.h, as these can be used by the platform code.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ifb425d444eb65fe8648952d2ff64d4e92c2b340a
2022-07-12 09:21:56 +05:30
Venkatesh Yadav Abbarapu
7e5f0abf9a refactor(versal): move payload and module ID macros
Move the payload and  module ID macros from the pm_api_sys.c file and
add it in the header file, as these macros can be used other than PM.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Change-Id: I678444b79ac3799a82bd93915e4639b3babf5fb9
2022-07-12 09:21:11 +05:30
Venkatesh Yadav Abbarapu
bfd7c88190 feat(zynqmp): resolve the misra 10.1 warnings
MISRA Violation: MISRA-C:2012 R.10.1
1) The expression of non-boolean essential type is being interpreted as a
boolean value for the operator.
2) The operand to the operator does not have an essentially unsigned type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I97bbc056f4fee167742429e144144ba793bf77b3
2022-07-07 10:20:48 +02:00
Joanna Farley
57ab749758 Merge changes from topic "xlnx_zynqmp_misra_fix1" into integration
* changes:
  fix(zynqmp): resolve the misra 8.6 warnings
  fix(zynqmp): resolve the misra 4.6 warnings
2022-06-30 00:36:46 +02:00
Manish Pandey
9316149ef8 Merge "fix(zynqmp): move bl31 with DEBUG=1 back to OCM" into integration 2022-06-24 13:43:41 +02:00
Manish Pandey
40366cb69d Merge changes from topic "xlnx_versal_misra_fix" into integration
* changes:
  fix(versal): resolve misra 15.6 warnings
  fix(zynqmp): resolve misra 8.13 warnings
  fix(versal): resolve misra 8.13 warnings
  fix(versal): resolve the misra 4.6 warnings
2022-06-24 13:40:01 +02:00