Commit graph

642 commits

Author SHA1 Message Date
Govindraj Raja
20c791e8b0 refactor(cpus): convert the Cortex-A78 to use the errata framework
Testing:
  - Manual comparison of disassembly with and without conversion.
  - Using the test script in gerrit - 19136
  - Building with errata and stepping through from ArmDS and running tftf.

Change-Id: I41e4169fb16ef488e116f6b3b1b5cc78b070c0fb
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:10:18 -05:00
Govindraj Raja
dd0dbe4445 refactor(cpus): reorder Cortex-A78 errata by ascending order
Change-Id: I433b2b1e5b3604bb0a13d167167b0f86255c6903
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:09:00 -05:00
Govindraj Raja
cc0fc5526a refactor(cpus): convert the Cortex-A78C to use cpu helpers
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: I6ef39641a9534e48db27ccd63b6190570dbfe760
2023-08-03 14:09:00 -05:00
Govindraj Raja
3c8de370a0 refactor(cpus): convert the Cortex-A78C to use the errata framework
Testing:
      - Manual comparison of disassembly with and without conversion.
      - Using the test script in gerrit - 19136
      - Building with errata and stepping through from ArmDS and running tftf.

Change-Id: Ib361cdfa43fc1c88d97e346d41b1cbf211c045d9
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:09:00 -05:00
Govindraj Raja
1c857218b2 refactor(cpus): reorder Cortex-A78C errata by ascending order
Change-Id: Id5cf37e22ddbd5baffcd80e2fc5c76f4cdc2ed9f
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:09:00 -05:00
Govindraj Raja
1ff96d6da6 refactor(cpus): convert the Cortex-X1 to use cpu helpers
Change-Id: I0b62fa613eab4a7545408c0da0c05f88f5f28838
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:09:00 -05:00
Govindraj Raja
2110686820 refactor(cpus): convert the Cortex-X1 to use the errata framework
Testing:
  - Manual comparison of disassembly with and without conversion.
  - Using the test script in gerrit - 19136
  - Building with errata and stepping through from ArmDS and running tftf.

Change-Id: Ie3909ef51c28a24728752a08ddf96a48d87d3cd7
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:09:00 -05:00
Govindraj Raja
e76cfe50e7 refactor(cpus): reorder Cortex-X1 errata by ascending order
Change-Id: I1e580dd330b545370b23d4b9704d899f6a679250
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:09:00 -05:00
Lauren Wehrmeister
231305ec0f Merge changes from topic "jc/errata_refactor" into integration
* changes:
  refactor(cpus): convert Cortex-A72 to use cpu helpers
  refactor(cpus): convert the Cortex-A72 to use the errata framework
  refactor(cpus): reorder Cortex-A72 errata by ascending order
2023-08-01 00:04:01 +02:00
Jayanth Dodderi Chidanand
64ea532dab refactor(cpus): convert Cortex-A72 to use cpu helpers
Change-Id: Ic327389e610bff0f71939cb57d661ea84ddef3f6
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-31 15:28:38 +01:00
Jayanth Dodderi Chidanand
989960cf94 refactor(cpus): convert the Cortex-A72 to use the errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

It is important to note that the errata workaround sequences remain
unchanged and preserve their git blame.

Testing was conducted by:
 * Building for release with all errata flags enabled and running
   script in change 19136 to compare output of objdump for each errata.

 * Testing via script was not complete, as it directed to verify the
   check and the workaround functions of few erratas manually.

 * Manual comparison of disassembly of converted functions with non-
   converted functions

   aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/../release/bl31/bl31.elf
     vs
   aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

 * Manual comparison of disassembly of both both files(bl31.elf)
   ensured,the ported changes were identical and hence verified.

 * Build for release with all errata flags enabled and run default tftf
   tests.

   CROSS_COMPILE=aarch64-none-elf- \
   make PLAT=fvp \
   ARCH=aarch64 \
   DEBUG=0 \
   HW_ASSISTED_COHERENCY=1 \
   USE_COHERENT_MEM=0 \
   CTX_INCLUDE_AARCH32_REGS=0 \
   ERRATA_A72_859971=1 \
   ERRATA_A72_1319367=1 \
   WORKAROUND_CVE_2017_5715=1 \
   WORKAROUND_CVE_2018_3639=1 \
   WORKAROUND_CVE_2022_23960=1 \
   BL33=/home/jaychi01/tf_a/tf-a-tests/build/fvp/release/tftf.bin \
   fip all -j12

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure that if Errata are applicable then the workaround
   functions are entered precisely.

Change-Id: I8ee5288f395b0391a242506e7effdb65ab4c4de7
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-31 11:45:33 +01:00
Jayanth Dodderi Chidanand
14197f8e61 refactor(cpus): reorder Cortex-A72 errata by ascending order
Change-Id: I8fa7886a47b37d9e7bd580549971cd59ac3d5606
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-31 11:45:33 +01:00
Govindraj Raja
e488307124 refactor(cpus): use cpu errata wrappers for aarch64 hunter based cpus
Adapt to use errata frame-work cpu macro helpers for following cpus:

- cortex-a520
- cortex-a720
- cortex-x4
- cortex-chaberton
- cortex-blackhawk

- Use sysreg_bit_set helper macro for enabling of any system register
  bit field.
- Use errata_report_shim macro for reporting errata.
- Use cpu_reset_func_start/end helpers for adding cpu reset functions.

Testing:

- Manual comparison of disassembly with and without conversion.
- Using the test script in gerrit - 19136
- Building with erratas and stepping through from ArmDS and running tftf.

Change-Id: I954fb603aa3746e02f2288656b98148d9cfd7843
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-07-28 09:16:59 -05:00
Bipin Ravi
f3c80668c8 Merge "refactor(cpus): convert Cortex-A715 to the errata framework" into integration 2023-07-28 00:22:19 +02:00
Bipin Ravi
6c6cc73770 Merge changes from topics "hm/errata-refactor", "jc/errata_refactor" into integration
* changes:
  refactor(cpus): convert the Cortex-x2 to use cpu helpers
  refactor(cpus): convert the Cortex-x2 to use the errata framework
  refactor(cpus): reorder Cortex-x2 errata by ascending order
  refactor(cpus): convert the Cortex-A65AE to use the errata framework
  refactor(cpus): convert the Cortex-A510 to use cpu helpers
  refactor(cpus): convert the Cortex-A510 to use the errata framework
  refactor(cpus): reorder Cortex-A510 errata by ascending order
  chore(fvp): add Aarch32 Cortex-A53 to the build
  refactor(cpus): add Cortex-A53 errata framework information
  feat(cpus): add errata framework helpers
  chore(brcm): include cpu_helpers.S for bl2 build
2023-07-28 00:09:19 +02:00
Bipin Ravi
79e2fae7cf Merge changes from topic "lw/errata_refactor" into integration
* changes:
  refactor(cpus): convert Neoverse-N1 to use helpers
  refactor(cpus): convert Neoverse-N1 to framework
  refactor(cpus): reorder Neoverse-N1 .S file
  refactor(cpus): convert Neoverse-E1 to framework
2023-07-27 21:01:59 +02:00
Jayanth Dodderi Chidanand
fdd3287829 refactor(cpus): convert the Cortex-x2 to use cpu helpers
Change-Id: Ic1016eb8598dbba08cdfc3bdaa24f90411d83a7c
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-27 09:35:12 +01:00
Jayanth Dodderi Chidanand
a62b1b31d8 refactor(cpus): convert the Cortex-x2 to use the errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

It is important to note that the errata workaround sequences remain
unchanged and preserve their git blame.

Testing was conducted by:
 * Building for release with all errata flags enabled and running script
   in change 19136 to compare output of objdump for each errata.

 * Testing via script was not complete, as it directed to verify the
   check and the workaround functions of few erratas manually.

 * Manual comparison of disassembly of converted functions with non-
   converted functions

   aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/../release/bl31/bl31.elf
     vs
   aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

 * Manual comparison of disassembly of both both files(bl31.elf)
   ensured,the ported changes were identical and hence verified.

* Build for release with all errata flags enabled and run default tftf
   tests.

   CROSS_COMPILE=aarch64-none-elf- \
   make PLAT=fvp \
   ARCH=aarch64 \
   DEBUG=0 \
   HW_ASSISTED_COHERENCY=1 \
   USE_COHERENT_MEM=0 \
   CTX_INCLUDE_AARCH32_REGS=0 \
   ERRATA_X2_2002765=1 \
   ERRATA_X2_2017096=1 \
   ERRATA_X2_2058056=1 \
   ERRATA_X2_2081180=1 \
   ERRATA_X2_2083908=1 \
   ERRATA_X2_2147715=1 \
   ERRATA_X2_2216384=1 \
   ERRATA_X2_2282622=1 \
   ERRATA_X2_2371105=1 \
   ERRATA_X2_2768515=1 \
   WORKAROUND_CVE_2022_23960=1 \
   ERRATA_DSU_2313941=1 \
   BL33=/home/jaychi01/tf_a/tf-a-tests/build/fvp/release/tftf.bin \
   fip all -j12

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure that if Errata are applicable then the workaround
   functions are entered precisely.

Change-Id: Icd2268cdf27f41240c92e3df23b5ad22f3ce3124
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-27 09:35:12 +01:00
Jayanth Dodderi Chidanand
64733b3912 refactor(cpus): reorder Cortex-x2 errata by ascending order
Change-Id: Ic1b2c73f468db6bb434b5b23f345bfc37d2a7833
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-27 09:35:12 +01:00
Jayanth Dodderi Chidanand
38f762a5ee refactor(cpus): convert the Cortex-A65AE to use the errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive
 * This core has only errata related to DSU, which is defined under
   another file dsu_helpers.s but gets applied to A65AE as well.
   Hence symbolic names have been added to get them registered under
   errata framework.

It is important to note that the errata workaround sequences remain
unchanged and preserve their git blame.

Testing was conducted by:
 * Building for release with all errata flags enabled and running
   script in change 19136 to compare output of objdump for each errata.

 * Testing via script was not complete, as it directed to verify the
   check and the workaround functions of few erratas manually.

 * Manual comparison of disassembly of converted functions with non-
   converted functions

   aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/../release/bl31/bl31.elf
     vs
   aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

 * Manual comparison of disassembly of both both files(bl31.elf)
   ensured, the ported changes were identical and hence verified.

 * Build for release with all errata flags enabled and run default
   tftf tests.

   CROSS_COMPILE=aarch64-none-elf- \
   make PLAT=fvp \
   ARCH=aarch64 \
   DEBUG=0 \
   HW_ASSISTED_COHERENCY=1 \
   USE_COHERENT_MEM=0 \
   CTX_INCLUDE_AARCH32_REGS=0 \
   ERRATA_DSU_936184=1 \
   BL33=/home/jaychi01/tf_a/tf-a-tests/build/fvp/release/tftf.bin \
   fip all -j12

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure that if Errata are applicable then the workaround
   functions are entered precisely. In this case, errata is not
   applied as DSU does not has the ACP interface and hence the
   check_errata_dsu_936184 returns 0.

 * In summary, porting work for this CPU, does not adds any new changes
   as we are just creating macros via .equ, henceforth code remains
   identical.

Change-Id: Iab37295319b5ccd69428185b2d22af0ca9c07a5e
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-27 09:35:12 +01:00
Jayanth Dodderi Chidanand
a29cb3c085 refactor(cpus): convert the Cortex-A510 to use cpu helpers
Change-Id: I6d26092525c2d5255a741515071ee7ed873aa52d
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-27 09:35:12 +01:00
Jayanth Dodderi Chidanand
ed6d4a3b48 refactor(cpus): convert the Cortex-A510 to use the errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

It is important to note that the errata workaround sequences remain
unchanged and preserve their git blame.

Note: cortex_a510.S is applicable and being used only by arm_fpga platform.

However, to test the ported changes, below steps were carried out on the
fvp and the obtained results has been verified.

Testing was conducted by:
 * Building for release with all errata flags enabled and running script
   in change 19136 to compare output of objdump for each errata.

 * Testing via script was not complete, as it directed to verify the
   check and the workaround functions of few erratas manually.

 * Manual comparison of disassembly of converted functions with non-
   converted functions

   aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/../release/bl31/bl31.elf
     vs
   aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

 * Manual comparison of disassembly of both both files(bl31.elf)
   ensured, the ported changes were identical and hence verified.

 * Build for release with all errata flags enabled and run default
   tftf tests.

   CROSS_COMPILE=aarch64-none-elf- \
   make PLAT=fvp \
   ARCH=aarch64 \
   DEBUG=0 \
   HW_ASSISTED_COHERENCY=1 \
   USE_COHERENT_MEM=0 \
   CTX_INCLUDE_AARCH32_REGS=0 \
   ERRATA_A510_1922240=1 \
   ERRATA_A510_2288014=1 \
   ERRATA_A510_2042739=1 \
   ERRATA_A510_2041909=1 \
   ERRATA_A510_2250311=1 \
   ERRATA_A510_2218950=1 \
   ERRATA_A510_2172148=1 \
   ERRATA_A510_2347730=1 \
   ERRATA_A510_2371937=1 \
   ERRATA_A510_2666669=1 \
   ERRATA_A510_2684597=1 \
   ERRATA_DSU_2313941=1 \
   BL33=/home/jaychi01/tf_a/tf-a-tests/build/fvp/release/tftf.bin \
   fip all -j12

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure that if Errata are applicable then the
   workaround functions are entered precisely.

Change-Id: Icf7aa25c0b3b30f5e2ad6db83953f7f4f0b201d9
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-27 09:35:12 +01:00
Jayanth Dodderi Chidanand
32d371d30f refactor(cpus): reorder Cortex-A510 errata by ascending order
Change-Id: Id6b4ae42d413f2c501c8200305cdb8068219912b
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-07-27 09:35:12 +01:00
laurenw-arm
12384f28a6 refactor(cpus): convert Neoverse-N1 to use helpers
Conversion to use CPU helpers for Neoverse-N1 testing done with
framework adaptation patch.

Change-Id: I2103f6e64daf0ee4c7b756083e5bf485f15c0e21
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-07-26 09:39:48 -05:00
laurenw-arm
f86098a62c refactor(cpus): convert Neoverse-N1 to framework
For N1, this involves replacing:
  - The reset_func with the standard cpu_reset_func_{start,end}
    to apply errata automatically
  - The <cpu>_errata_report with the errata_report_shim to
    report errata automatically
And for each erratum:
  - The prologue with the workaround_<type>_start to do the checks and
    framework registration automatically at reset or runtime
  - The epilogue with the workaround_<type>_end
  - The checker function with the check_erratum_<type> to check whether
    the erratum applies on the revision of the CPU.

Testing was conducted by:
  - Manual comparison of disassembly of converted functions with non-
    converted functions:

    aarch64-none-elf-objdump -D
    <trusted-firmware-a with conversion>/build/fvp/release/bl31/bl31.elf
      vs
    aarch64-none-elf-objdump -D
    <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

  - Build for debug with all errata enabled and step through ArmDS
    to ensure all functions are entered and the path remains the same
    as before conversion to the new framework.

Change-Id: I2ea612d4c197dd73835fadda81f59732c19534f8
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-07-26 09:39:23 -05:00
Moritz Fischer
40c81ed533 fix(cpus): workaround for Neoverse V2 erratum 2801372
Neoverse V2 erratum 2801372 is a Cat B erratum that applies to
all revisions <=r0p1 and is fixed in r0p2. The workaround is to
insert a dsb before the isb in the power down sequence.

This errata is explained in SDEN 2332927 available at:
https://developer.arm.com/documentation/SDEN2332927

Change-Id: I8716b9785a67270a72ae329dc49a2f2239dfabff
Signed-off-by: Moritz Fischer <moritzf@google.com>
2023-07-21 16:52:36 +02:00
laurenw-arm
1ca5c887ba refactor(cpus): reorder Neoverse-N1 .S file
Moving neoverse_n1_disable_speculative_loads function before reset
function to maintain git blame with refactor to new framework.

Change-Id: I79a4de9955a6f37e289456a743b946c0c4c8c27f
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-07-18 10:49:23 -05:00
laurenw-arm
291bb2f4d0 refactor(cpus): convert Neoverse-E1 to framework
For E1, this involves replacing:
  - The reset_func with the standard cpu_reset_func_{start,end}
    to apply errata automatically
  - The <cpu>_errata_report with the errata_report_shim to
    report errata automatically
And for the E1 DSU erratum, creating symbolic names to the already
existing errata workaround functions to get them registered under
the Errata Framework.

Testing was conducted by:
  - Manual comparison of disassembly of converted functions with non-
    converted functions:

    aarch64-none-elf-objdump -D
    <trusted-firmware-a with conversion>/build/fvp/release/bl31/bl31.elf
      vs
    aarch64-none-elf-objdump -D
    <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

  - Build for debug with all errata enabled and step through ArmDS
    to ensure all functions are entered and the path remains the same
    as before conversion to the new framework.

Change-Id: I0a059574948badbd108333344286c76aeb142e71
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-07-18 10:47:57 -05:00
Lauren Wehrmeister
e2ca9af171 Merge changes from topic "kc/errata_refactor" into integration
* changes:
  refactor(cpus): convert the Cortex-A75 to use cpu helpers
  refactor(cpus): convert the Cortex-A75 to use the errata framework
2023-07-10 23:10:33 +02:00
Madhukar Pappireddy
e87102f32b Merge changes from topic "gr/cpu_rename" into integration
* changes:
  chore: rename hayes to a520
  chore: rename hunter to a720
  chore: rename hunter_elp to cortex-x4
2023-06-29 17:36:44 +02:00
Govindraj Raja
dea3d71e9a chore: rename hayes to a520
Rename Cortex-hayes to Cortes-A520

Change-Id: Ic574b55b1aaf11b5bf7b583e244245e7b54bdb22
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-06-29 17:20:17 +02:00
Govindraj Raja
31b3945527 chore: rename hunter to a720
Rename cortex_hunter to cortex_a720

Change-Id: Id4e0e2cd47051c2e92b3f16373ea06ef4df1d75f
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-06-29 16:20:01 +01:00
Govindraj Raja
870fcb9495 chore: rename hunter_elp to cortex-x4
Rename hunter_elp to cortex-x4

Change-Id: I78c8c009d7bee14b4793dc1d950ed81273216831
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-06-29 09:46:08 -05:00
Lauren Wehrmeister
098312edf7 Merge changes from topic "ms/cpu_errata" into integration
* changes:
  refactor(cpus): add Cortex-A72 errata information
  refactor(cpus): convert Rainier to use errata framework
  refactor(cpus): convert QEMU Max to use the errata framework
2023-06-28 17:28:57 +02:00
Kathleen Capella
6fafbd56d0 refactor(cpus): convert the Cortex-A75 to use cpu helpers
Testing done in conjunction with change 258152.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: I9082c7a5c68e39d6e419c2a00501d63895ca73c7
2023-06-27 17:14:57 -04:00
Kathleen Capella
742bf3ea23 refactor(cpus): convert the Cortex-A75 to use the errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

It is important to note that the errata workaround sequences remain
unchanged and preserve their git blame.

Testing was conducted by:
 * Building for release with all errata flags enabled and running script
   in change 19136 to compare output of objdump for each errata. Only
   ERRATA_A75_764081 and ERRATA_A75_790748 could be verified this way,
   rest had to be manually verified.
 * Manual comparison of disassembly of converted functions with non-
   converted functions

   aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/fvp/release/bl31/bl31.elf
     vs
   aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf

 * Build for release with all errata flags enabled and run default tftf
   tests

   CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp HW_ASSISTED_COHERENCY=1 \
   USE_COHERENT_MEM=0 CTX_INCLUDE_AARCH32_REGS=1 \
   BL33=/home/katcap01/tf-a-tests/build/fvp/debug/tftf.bin \
   ERRATA_A75_764081=1 ERRATA_A75_790748=1 WORKAROUND_CVE_2017_5715=1 \
   WORKAROUND_CVE_2018_3639=1 \
   ERRATA_DSU_798953=1 ERRATA_DSU_936184=1 \
   WORKAROUND_CVE_2022_23960=1 \
   fip all

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.
Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: I0cd393db825fcb5c7ddea3aa2a5934ffc4b6046e
2023-06-27 17:13:41 -04:00
Govindraj Raja
a00e907696 feat(cpus): add support for hermes cpu
Adding basic CPU library code to support the Hermes CPU.

Change-Id: I61946033fe5fafb56ceb2d14d4c796d85b30457e
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-06-27 10:49:38 -05:00
Maksims Svecovs
e8b30c2921 refactor(cpus): convert Rainier to use errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
as well as specifically related to single errata for this CPU:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

Change-Id: I31cacbbdd4caa12b32e2c65ec456b0ab6b1a9101
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
2023-06-27 15:42:10 +01:00
Maksims Svecovs
e5cc52dbf6 refactor(cpus): convert QEMU Max to use the errata framework
This involves replacing:
* the <cpu>_errata_report with the errata_report_shim to report errata
automatically.

Change-Id: I78b65052dcfc1f29b7dec443bd0aaf67d0efb4eb
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
2023-06-27 15:41:56 +01:00
Harrison Mutai
c82fb382b2 refactor(cpus): convert Cortex-A715 to the errata framework
This involves replacing:
 * the reset_func with the standard cpu_reset_func_{start,end} to apply
   errata automatically
 * the <cpu>_errata_report with the errata_report_shim to report errata
   automatically
...and for each erratum:
 * the prologue with the workaround_<type>_start to do the checks and
   framework registration automatically
 * the epilogue with the workaround_<type>_end
 * the checker function with the check_erratum_<type> to make it more
   descriptive

It is important to note that the errata workaround and checking
sequences remain unchanged and preserve their git blame. Testing was
conducted by:

 * Building for release with all errata flags enabled and running script
   in change 19136 to compare output of objdump for each errata.
 * Manual comparison of disassembly of converted functions with non-
   converted functions
 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Change-Id: Ib63b6310997d523fa8bd7f867e53fedec66f1e06
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-06-19 14:41:59 +01:00
Kathleen Capella
ee6d04d449 feat(cpus): conform DSU errata to errata framework PCS
Errata framework expects workarounds to clobber x0 to x8 and checker
functions to clobber x0-x4.

Update DSU errata functions to adhere to the standard, which is documented
here: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19295.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: Ie0e492473ab8b2bee4335b6b1db00796fabdd59d
2023-06-08 15:34:53 -04:00
Manish Pandey
a0f3b552cf Merge "chore: rename Makalu to Cortex-A715" into integration 2023-06-05 16:21:47 +02:00
Harrison Mutai
15889d1332 chore: rename Makalu to Cortex-A715
Change-Id: I017c955cb643e2befb6b01e1b5a07c22172b08b9
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-05-30 09:52:14 +01:00
Boyan Karatotev
dd9fae1ce0 refactor(cpus): convert print_errata_status to C
The function is called in a fully initialised C environment and calls
into other C functions. The Aarch differences are minimal and are hidden
by the pre-existing headers. Converting it results into cleaner code
that is the same across both Aarch64 and Aarch32.

To avoid having to do very ugly pointer arithmetic, define a C struct
for the cpu_ops for both Aarch64 and Aarch32.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Idc07c4064e03143c88a4a0e2d10ceda70ba19a50
2023-05-30 09:31:15 +01:00
Boyan Karatotev
6bb96fa6d6 refactor(cpus): rename errata_report.h to errata.h
The ERRATA_XXX macros, used in cpu_helpers.S, are necessary for the
check_errata_xxx family of functions. The CPU_REV should be used in the
cpu files but for whatever reason the values have been hard-coded so far
(at the cost of readability). It's evident this file is not strictly for
status reporting.

The new purpose of this file is to make it a one-stop-shop for all
things errata.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I1ce22dd36df5aa0bcfc5f2772251f91af8703dfb
2023-05-30 09:31:15 +01:00
Boyan Karatotev
007433d8cf refactor(cpus): move cpu_ops field defines to a header
The cpu_macros.S file is loaded with lots of definitions for the cpu_ops
structure. However, since they are defined as .equ directives they are
inaccessible for C code. Convert them to #defines, put them into order,
refactor them for readability, and extract them to a separate file to
make this possible.

This has the benefit of removing some Aarch differences and a lot of
duplicate code.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I72861794b6c9131285a9297d5918822ed718b228
2023-05-30 09:31:15 +01:00
Chris Kay
11ccf5d99a build(psci): move runtime_errata.S to PSCI
Move the runtime errata source file into the PSCI library, as PSCI is
the only component directly dependent on it, and it doesn't require
internal access to the CPUs library.

Change-Id: I92826714d49b1b0131f62c158543b4c167ab9aa8
Signed-off-by: Chris Kay <chris.kay@arm.com>
2023-05-03 15:36:08 +02:00
Okash Khawaja
baeaf292ce refactor(cpus): use BIT macro in a consistent manner
In assembly code, BIT macro is used with a preceding hash #. Let's
update Cortex X1 code to follow the same convention. Excluding hash
doesn't cause compilation to fail or emit incorrect code.

Signed-off-by: Okash Khawaja <okash@google.com>
Change-Id: If304cdf90542d2edcab3e2d66cd7e905ff7fd047
2023-04-28 13:18:28 +01:00
Manish Pandey
9ec2ca2d45 fix(cpus): do not put RAS check before using esb
If RAS Extension is not implemented esb instruction executes as a NOP.
No need to have a check for RAS presence in the code.
Also, The handler is related to a synchronous exceptions which
implicitly is part of BL31 image only, so remove that check too.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: If4264504cba9f0642b7b9c581ae66cd4deace32b
2023-04-24 17:32:22 +01:00
Bipin Ravi
b516a6f46c Merge "fix(cpus): use hint instruction for "tsb csync"" into integration 2023-04-14 23:01:32 +02:00