Commit graph

13157 commits

Author SHA1 Message Date
Govindraj Raja
4c700c1563 chore: update to use Arm word across TF-A
Align entire TF-A to use Arm in copyright header.

Change-Id: Ief9992169efdab61d0da6bd8c5180de7a4bc2244
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-08 15:12:30 +01:00
Lauren Wehrmeister
29ae73e3fb Merge changes from topic "mb/mb-signer-id" into integration
* changes:
  feat(qemu): add dummy plat_mboot_measure_key() function
  docs(rss): update RSS doc for signer-ID
  feat(imx): add dummy 'plat_mboot_measure_key' function
  feat(tc): implement platform function to measure and publish Public Key
  feat(auth): measure and publicise the Public Key
  feat(fvp): implement platform function to measure and publish Public Key
  feat(fvp): add public key-OID information in RSS metadata structure
  feat(auth): add explicit entries for key OIDs
  feat(rss): set the signer-ID in the RSS metadata
  feat(auth): create a zero-OID for Subject Public Key
  docs: add details about plat_mboot_measure_key function
  feat(measured-boot): introduce platform function to measure and publish Public Key
2023-08-07 16:53:35 +02:00
Manish V Badarkhe
96eb2dc4e3 Merge "chore(xilinx): reorder headers in assembly files" into integration 2023-08-07 15:15:05 +02:00
Manish V Badarkhe
8a26478f0d Merge "chore(xilinx): correct kernel doc warnings for missing functions" into integration 2023-08-07 14:33:38 +02:00
Manish V Badarkhe
16f19ed1fa Merge changes from topic "xlnx_zynmp_tsp" into integration
* changes:
  chore(zynqmp): remove unused configuration from TSP
  fix(zynqmp): resolve runtime error in TSP
2023-08-07 14:32:13 +02:00
Manish V Badarkhe
838917296d Merge "fix(xilinx): add headers to resolve compile time issue" into integration 2023-08-07 12:34:12 +02:00
Akshay Belsare
744d60aab4 fix(xilinx): add headers to resolve compile time issue
Add common/debug.h and libfdt.h files to the common file
for XILINX_OF_BOARD_DTB_ADDR configuration.

Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
Change-Id: I577cc018eda34e186e48594a62c54eb55f11bbd3
2023-08-07 11:33:07 +01:00
Bipin Ravi
bfd856004f Merge changes from topic "sm/errata_refactor" into integration
* changes:
  refactor(cpus): convert Cortex-A15 to use the errata framework
  refactor(cpus): convert the Cortex-X3 to use the cpu helpers
  refactor(cpus): convert Cortex-X3 to use the errata framework
  refactor(cpus): reorder Cortex-X3 errata by ascending order
  refactor(cpus): convert the Cortex-A73 to use the cpu helpers
  refactor(cpus): convert Cortex-A73 to use the errata framework
  refactor(cpus): reorder Cortex-A73 errata by ascending order
  refactor(cpus): convert the Cortex-A35 to use the cpu helpers
  refactor(cpus): convert Cortex-A35 to use the errata framework
2023-08-05 00:50:32 +02:00
Sona Mathew
cbc8cae7ff refactor(cpus): convert Cortex-A15 to use the errata framework
Change-Id: I569b0da3ed5b81b4b6e9a7820d32684376a190a9
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:24:55 -05:00
Sona Mathew
f99a481045 refactor(cpus): convert the Cortex-X3 to use the cpu helpers
Change-Id: I922d3d0e81deb5ff7d89aaa1e7a96ef72d3d6943
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Sona Mathew
1a9d5d1e14 refactor(cpus): convert Cortex-X3 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

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

	aarch64-none-elf-objdump -D <TF-A with
	conversion>/build/../release/bl31/bl31.elf
	vs
	aarch64-none-elf-objdump -D <TF-A clean
	repo>/build/fvp/release/bl31/bl31.elf

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Change-Id: I62e030962edf4e8e8be2c19e7a3176e319468c50
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Sona Mathew
2975bc0c9d refactor(cpus): reorder Cortex-X3 errata by ascending order
Errata report order is enforced to be in ascending order. To achieve
this with the errata framework this has to be done at the definition
level.

Change-Id: I168bf99be0cb0b046d6b641c855f9241991bb0bc
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Sona Mathew
51e9eb101e refactor(cpus): convert the Cortex-A73 to use the cpu helpers
Change-Id: I910c657b3064b8e19eb84656109074ddf0e4ece8
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Sona Mathew
7711223d00 refactor(cpus): convert Cortex-A73 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 and checking
sequences remain unchanged and preserve their git blame. Testing was
conducted by:

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

	aarch64-none-elf-objdump -D <TF-A with
	conversion>/build/../release/bl31/bl31.elf
	vs
	aarch64-none-elf-objdump -D <TF-A clean
	repo>/build/fvp/release/bl31/bl31.elf

 * Build for release with all errata flags enabled and compare
   the disassembly of converted functions with non-converted
   functions.
	CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp DEBUG=0 \
	HW_ASSISTED_COHERENCY=0 BL33=<tf-a-tests>/build/fvp/debug/tftf.bin \
	all fip ERRATA_A73_852427=1 \
	ERRATA_A73_855423=1 \
	WORKAROUND_CVE_2017_5715=1 \
	WORKAROUND_CVE_2018_3639=1 \
	WORKAROUND_CVE_2022_23960=1

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Change-Id: I63e5b2cc42e1e12daee0b727770cbc19ba729ff7
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Sona Mathew
e2da5e0ed7 refactor(cpus): reorder Cortex-A73 errata by ascending order
Errata report order is enforced to be in ascending order. To achieve
this with the errata framework this has to be done at the definition
level.

Change-Id: I70b05cc366c3b6d07a63edd88d23a52dd3d019c1
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Sona Mathew
5c7d12cbd9 refactor(cpus): convert the Cortex-A35 to use the cpu helpers
Change-Id: Idd945cacb46cdbbcbd8309b8a2e7a94887120ff3
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Sona Mathew
40eef67e6e refactor(cpus): convert Cortex-A35 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 and checking
sequences remain unchanged and preserve their git blame. Testing was
conducted by:

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

	aarch64-none-elf-objdump -D <TF-A with
	conversion>/build/../release/bl31/bl31.elf
     	vs
	aarch64-none-elf-objdump -D <TF-A with
	clean repo>/build/fvp/release/bl31/bl31.elf

 * Build for release with all errata flags enabled and ensure the
   changes were identical.
	CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp \
	DEBUG=0 HW_ASSISTED_COHERENCY=0 \
	BL33=<tf-a-tests>/build/fvp/debug/tftf.bin \
	all fip ERRATA_A35_855472=1

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Change-Id: Ib001e9fc269e60369ccfda0245a3e6247f0d6aaa
Signed-off-by: Sona Mathew <SonaRebecca.Mathew@arm.com>
2023-08-04 17:23:18 -05:00
Bipin Ravi
87e3d4f1ac Merge changes from topic "sm_bk/errata_refactor" into integration
* changes:
  refactor(cpus): convert the Cortex-A78AE to use cpu helpers
  refactor(cpus): convert the Denver cpu to use the errata framework
  refactor(cpus): convert the Cortex-A78AE to use the errata framework
  refactor(cpus): convert the Cortex-A5 to use the errata framework
  refactor(cpus): convert the Cortex-A77 to use the bit set helpers
  refactor(cpus): convert the Cortex-A77 to use the errata framework
  refactor(cpus): reorder Cortex-A77 errata by ascending order
2023-08-04 19:25:09 +02:00
Boyan Karatotev
65a5384844 refactor(cpus): convert the Cortex-A78AE to use cpu helpers
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ic4189d943c3e55bc25a82f09f2ad4a5b06f443a3
2023-08-04 11:52:06 -05:00
Boyan Karatotev
15702f280a refactor(cpus): convert the Denver cpu to use the errata framework
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I8f804b237a6a566f1c5d0ca1ab62ea76350fc2a2
2023-08-04 11:50:27 -05:00
Boyan Karatotev
27a8bcdc37 refactor(cpus): convert the Cortex-A78AE 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 and checking
sequences remain unchanged and preserve their git blame.

At this point the binary output of all errata was checked with the
script from commit 19136. The reported discrepancies are immaterial.
All errata have been checked that they get invoked.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ideb6397f4ac7c3c1d04549a57af43bfa7ef25c1d
2023-08-04 11:50:23 -05:00
Boyan Karatotev
aff3fa210b refactor(cpus): convert the Cortex-A5 to use the errata framework
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I8214fdff2c528ccfa64a366ee1f3bc04d52a0bf8
2023-08-04 11:34:28 -05:00
Boyan Karatotev
8a4a91651f refactor(cpus): convert the Cortex-A77 to use the bit set helpers
This makes the implementation itself much more readable. At this point
all errata have been tested with a script [1] to make sure the migration
kept everything the same. It reported 1508412, 1946167, and
CVE_2022_23960 as having some mismatch. The first has a small
non-trivial change that results in identical behaviour. The second is
non-trivial to compare, but manual inspection shows it is identical. The
CVE had no workaround function previously, however, the instructions are
indeed identical. All errata have been checked that they get invoked.

The script's commandline looks like:
  ./script.py cortex_a77 /path/to/tf-a-with-changes /path/to/tf-a-clean/

[1]: the script:
import re
import subprocess
import sys

def full_cpu_name():
    return sys.argv[1]

def old_cpu_name():
    return sys.argv[1].split('_')[1]

def new_build():
    return sys.argv[2]

def old_build():
    return sys.argv[3]

def get_dump(root_dir, symbol):
    # bl31 includes more stuff
    raw_dump = subprocess.run([
            'aarch64-none-elf-objdump', f'--disassemble={symbol}',
            root_dir + '/build/fvp/release/bl31/bl31.elf'
        ], capture_output=True, encoding='ascii'
    ).stdout

    # get rid of objdump verbosity
    raw_dump = raw_dump.split('\n')[7:-1]
    # split arguments and remove addresses at the start
    return [line.split('\t')[2:] for line in raw_dump]

def check_identical(new, old):
    if old and old[-1][0] == 'isb':
        old = old[:-1]
        print('    NOTE: dropped trailing isb (ok on reset)')

    if not new or not old or len(new) != len(old):
        return False

    for newi, oldi in zip(new, old):
        if newi[0] == oldi[0] == 'b':
            # ignore the address, compare just the name
            if newi[1].split(' ')[1] != newi[1].split(' ')[1]:
                return False
            continue # identical, proceed

        if newi != oldi:
            return False
    return True

FLAG_RE = r'report_errata (.*?), '
cpu_path = old_build() + '/lib/cpus/aarch64/' + full_cpu_name() + '.S'
with open(cpu_path) as cpu_src:
    errata_flags = re.findall(FLAG_RE, cpu_src.read())
    errata_ids = [flg.split('_')[-1] for flg in errata_flags]

print('List of flags to build with:')
print(' '.join([flg + '=1' for flg in errata_flags]))
input((
    'Press enter when your patch in argv[2] and '
    'the top of master in argv[3] are both built for release...'
))

for id in errata_ids:
    new_check = get_dump(new_build(),
        f'check_erratum_{full_cpu_name()}_{id}')
    old_check = get_dump(old_build(), f'check_errata_{id}')
    new_wa = get_dump(new_build(), f'erratum_{full_cpu_name()}_{id}_wa')
    old_wa = get_dump(old_build(), f'errata_{old_cpu_name()}_{id}_wa')

    # remove the boilerplate for each (mov, bl, cbz, ret)
    new_wa = new_wa[4:-3]
    old_wa = old_wa[3:-1]

    print(f'Checking {id} . . .')
    if not check_identical(new_check, old_check):
        print(f'  Check {id} check function manually!')
    if not check_identical(new_wa, old_wa):
        print(f'  Check {id} workaround manually!')

print('All previous errata checked against their migrations')

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I987ded7962f3449344feda47e314994f400e85b8
2023-08-04 11:32:44 -05:00
Boyan Karatotev
0b3a4b5af8 refactor(cpus): convert the Cortex-A77 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.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I5b74bf56eee95f54a1fb2fc6d3eccd86e26b522e
2023-08-04 11:32:44 -05:00
Boyan Karatotev
99787a4c0d refactor(cpus): reorder Cortex-A77 errata by ascending order
Errata report order is enforced to be in ascending order. To achieve
this with the errata framework this has to be done at the definition
level.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ica348d2c81e204eae2e08e9ccf677807e02efef9
2023-08-04 11:32:44 -05:00
Bipin Ravi
db8621a2fe Merge changes from topic "ar/errata_refactor" into integration
* changes:
  fix(cpus): workaround for Neoverse N2 erratum 2779511
  fix(errata-abi): added Neoverse N2 to Errata ABI list
  fix(cpus): workaround for Neoverse N2 erratum 2743014
  fix(docs): updated certain Neoverse N2 erratum status in docs
  refactor(cpus): convert Neoverse N2 to use CPU helpers
  refactor(cpus): convert Neoverse N2 to framework
  refactor(cpus): reorder Neoverse N2 errata by ascending order
2023-08-04 18:01:07 +02:00
Bipin Ravi
2d8aee0c60 Merge changes from topic "ar/errata_refactor" into integration
* changes:
  refactor(cpus): convert Neoverse V1 to use CPU helpers
  refactor(cpus): convert Neoverse V1 to framework
  refactor(cpus): reorder Neoverse V1 errata by ascending order
2023-08-04 17:59:26 +02:00
Soby Mathew
f560a13cad Merge "docs(rme): update tftf build command" into integration 2023-08-04 13:19:36 +02:00
Arvind Ram Prakash
f6af21852d refactor(cpus): convert Neoverse V1 to use CPU helpers
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Idb4b47982278cda93a7c0f0a49dfceb75b8d88e4
2023-08-03 23:02:39 +02:00
Arvind Ram Prakash
7f798aaa3e refactor(cpus): convert Neoverse V1 to 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
   able to verify the check functions this way, rest had to 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 DEBUG=0 \
CTX_INCLUDE_AARCH32_REGS=0 HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 \
BL33=./../tf-a-tests/build/fvp/release/tftf.bin \
ERRATA_V1_1618635=1 ERRATA_V1_1774420=1 ERRATA_V1_1791573=1 \
ERRATA_V1_1852267=1 ERRATA_V1_1925756=1 ERRATA_V1_1940577=1 \
ERRATA_V1_1966096=1 ERRATA_V1_2108267=1 ERRATA_V1_2139242=1 \
ERRATA_V1_2216392=1 ERRATA_V1_2294912=1 ERRATA_V1_2372203=1 \
ERRATA_V1_2743093=1 ERRATA_V1_2743233=1 ERRATA_V1_2779461=1 \
WORKAROUND_CVE_2022_23960=1 ERRATA_ABI_SUPPORT=1 all fip

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Ic5697b7cd2a508dee9978d89136fbe168f34626c
2023-08-03 23:02:33 +02:00
Arvind Ram Prakash
b0b712ba76 refactor(cpus): reorder Neoverse V1 errata by ascending order
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I1c531fe166218804e4fc9ebbdeda2bfebdd69081
2023-08-03 23:02:26 +02:00
Lauren Wehrmeister
708d0abdcd Merge changes from topic "gr/errata_refactor" into integration
* changes:
  refactor(cpus): convert the Cortex-A76 to use cpu helpers
  refactor(cpus): convert the Cortex-A76 to use the errata framework
2023-08-03 22:53:46 +02:00
Bipin Ravi
fc22bcf85c Merge changes from topic "gr/errata_refactor" into integration
* changes:
  refactor(cpus): convert the Cortex-A55 to use cpu helpers
  refactor(cpus): convert the Cortex-A55 to use the errata framework
  refactor(cpus): convert the Cortex-A76AE to use cpu helpers
  refactor(cpus): convert the Cortex-A76AE to use the errata framework
  refactor(cpus): convert the Cortex-A78 to use cpu helpers
  refactor(cpus): convert the Cortex-A78 to use the errata framework
  refactor(cpus): reorder Cortex-A78 errata by ascending order
  refactor(cpus): convert the Cortex-A78C to use cpu helpers
  refactor(cpus): convert the Cortex-A78C to use the errata framework
  refactor(cpus): reorder Cortex-A78C errata by ascending order
  refactor(cpus): convert the Cortex-X1 to use cpu helpers
  refactor(cpus): convert the Cortex-X1 to use the errata framework
  refactor(cpus): reorder Cortex-X1 errata by ascending order
  refactor(cpus): use cpu errata wrappers Cortex-A12 aarch32 cpu
  refactor(cpus): use cpu errata wrappers Cortex-A7 and A9 aarch32 cpus
2023-08-03 22:52:10 +02:00
Arvind Ram Prakash
12d28067c9 fix(cpus): workaround for Neoverse N2 erratum 2779511
Neoverse N2 erratum 2779511 is a Cat B erratum that applies to
all revisions <=r0p2 and is fixed in r0p3. The workaround is to
set bit[47] of CPUACTLR3_EL1

SDEN documentation:
https://developer.arm.com/documentation/SDEN1982442/latest

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Iaa0e30de8473ecb1df1fcca3a45904aac2e419b3
2023-08-03 22:42:31 +02:00
Arvind Ram Prakash
7e030b3763 fix(errata-abi): added Neoverse N2 to Errata ABI list
added the missing Neoverse N2 flag required for
enabling Neoverse N2 CPU in Errata ABI

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I06c6fa67e2f1ccc053f1b1b9261e189c56f4347a
2023-08-03 22:42:24 +02:00
Arvind Ram Prakash
eb44035cde fix(cpus): workaround for Neoverse N2 erratum 2743014
Neoverse N2 erratum 2743014 is a Cat B erratum that applies to
all revisions <=r0p2 and is fixed in r0p3. The workaround is to
set CPUACTLR5_EL1[56:55] to 2'b01.

SDEN documentation:
https://developer.arm.com/documentation/SDEN1982442/latest

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Ie7e1be5dea9d1f74738f9fed0fb58bfd41763192
2023-08-03 22:42:18 +02:00
Arvind Ram Prakash
d6d34b3913 fix(docs): updated certain Neoverse N2 erratum status in docs
Certain Neoverse N2 erratum in docs were out of date with the latest
SDEN document and hence updated it to match the latest

SDEN documentation:
https://developer.arm.com/documentation/SDEN1707916/latest

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I5d82a56388a46a09a42b940a633ecebdde0c74e3
2023-08-03 22:42:10 +02:00
Arvind Ram Prakash
b41792cac6 refactor(cpus): convert Neoverse N2 to use CPU helpers
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I063ff1d61bf1e0c4eef31fd55172bb0c321ed1e0
2023-08-03 22:42:04 +02:00
Arvind Ram Prakash
ccb5616272 refactor(cpus): convert Neoverse N2 to 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:

 * 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  CTX_INCLUDE_AARCH32_REGS=0 \
   HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 \
   BL33=./../tf-a-tests/build/fvp/debug/tftf.bin \
   ERRATA_N2_2002655=1 ERRATA_N2_2025414=1 ERRATA_N2_2067956=1 ERRATA_N2_2189731=1 \
   ERRATA_N2_2138956=1 ERRATA_N2_2138953=1 ERRATA_N2_2242415=1 ERRATA_N2_2138958=1 \
   ERRATA_N2_2242400=1 ERRATA_N2_2280757=1 ERRATA_N2_2326639=1 ERRATA_N2_2376738=1 \
   ERRATA_N2_2388450=1 ERRATA_N2_2743014=1 ERRATA_N2_2743089=1 ERRATA_DSU_2313941=1 \
   WORKAROUND_CVE_2022_23960=1 ERRATA_ABI_SUPPORT=1 all fip

 * Build for debug with all errata enabled and step through ArmDS
   at reset to ensure all functions are entered.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I3dd06b5d827de5836eadd58ae28f28e62039f257
2023-08-03 22:41:57 +02:00
Arvind Ram Prakash
a438f434de refactor(cpus): reorder Neoverse N2 errata by ascending order
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Icf4c12f8404d2e7791bd9c008fe261314b047e14
2023-08-03 22:41:50 +02:00
Govindraj Raja
53e02f2a59 refactor(cpus): convert the Cortex-A76 to use cpu helpers
Change-Id: I9c9dff626f073d762b5c8c2d8286e1654ac5c2e5
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:10:28 -05:00
Govindraj Raja
b6120c69fc refactor(cpus): convert the Cortex-A55 to use cpu helpers
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: I45835b223f4734279845610529454fe0148ea43f
2023-08-03 14:10:28 -05:00
Govindraj Raja
6fb2dbd252 refactor(cpus): convert the Cortex-A76 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: I126f09de44b16e8bbb7e32477b880b4650eef23b
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:10:28 -05:00
Govindraj Raja
1de3c3a95b refactor(cpus): convert the Cortex-A55 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: I2ff16be8bb568e37477edbbd7551877cbbde4c60
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:10:28 -05:00
Govindraj Raja
91ba1a5edf refactor(cpus): convert the Cortex-A76AE to use cpu helpers
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: I72627afd0e2f10fb754d5c0de137fc9714ed391f
2023-08-03 14:10:28 -05:00
Govindraj Raja
c62d9c7d27 refactor(cpus): convert the Cortex-A76AE 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.

Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: I1936ab6aaef803f653e79f5c6b590a59b34a8ed1
2023-08-03 14:10:28 -05:00
Govindraj Raja
0a3274591a refactor(cpus): convert the Cortex-A78 to use cpu helpers
Change-Id: I3a65815cee9f78acb79b86990d20cf936aee7023
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-08-03 14:10:28 -05:00
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