The RTIC is documented in the LS1046ASECRM.pdf, which can be download from
the nxp.com. Please refers to
Chapter 12 Trust Architecture modules
12.1 Run-time integrity checker
(RTIC)......................................................................
.......................................................651
12.1.1 RTIC modes of
operation...................................................................
........................................................651
12.1.2 RTIC initialization and
operation...................................................................
........................................... 651
12.1.3 RTIC use of the Throttle
Register....................................................................
..........................................652
12.1.4 RTIC use of command, configuration, and status
registers...................................................................
.... 652
12.1.5 Initializing
RTIC........................................................................
................................................................ 653
12.1.6 RTIC Memory Block Address/Length
Registers...................................................................
....................653
There are no C level source code samples for it. To run a demo, customer can
touch the registers to enable it. Here are the sample procedures in uboot
with registers level configuration.
#####
Run time integrity checker (RTIC) is a hardware feature that checks the
integrity of the operating environment. You can use RTIC to monitor binary
images, set it up as a static data area, or administrative database that are
constant in nature. As soon as RTIC detects any modification in the memory
regions it monitors, you can either send an interpretation to the host for
post processing, or change the security state of the SoC to lockout
cryptographic key(s) access to protect sensitive date.
Below is a register level prototype to enable RTIC to monitor a pre-defined
memory region.
=> mw.l a0000000 11112222 100 <-# init RAM address
=> md 0x1760000 4 <-display RTIC status
01760000: 00000000 00000400 00000000 00000000 ................
=> mw.l 0x176001c 0xff000000 <- # set RTIC Throttle (RTHR)
=> mw.l 0x176002c 0xffff0000 <- # set RTIC Watchdog Timer (RWDOG)
=> mw.l 0x1760104 000000a0 <- # set RTIC monitor address (RMAA)
=> mw.l 0x176010c 00010000 <- # set RTIC monitor length (RMAL)
=> mw.l 0x1760014 10010000 <- Enable and unlock run time memory (RCTL)
=> mw.l 0x176000c 02000000 <- Hash block A once (RMAL)
=> mw.l 0x176000c 04000000 <- Enable Run Time Check (RMAL)
=> md 0x1760000; md 0x1760000 <- display RTIC Status (RSTA)
01760000: 00000000 01000004 00000000 00000000 ................
01760000: 00000000 01000a04 00000000 00000000 ................
01 = RTIC Busy, 02 = Hash Once Operation Completed. 04=sec violation
00 = no address error for all four blocks
0a = RTD, RTIC is in Run Time mode, All blocks hashed (ABH)
04 = run time state, 02 Single Hash State, 06 = Error State
When the RTIC monitored memory region is modified, the SECMON changes the
state to non-secure and locks out black key access for further cryptographic
operations.
=> md 0x1760000; echo; md 01e90000;
01760000: 00000000 01000004 00000000 00000000 ................
01760010: 00000000 10110000 00000000 ff000000 ................
01e90000: 00000000 00000000 00000000 00000000 ................
01e90010: 00000000 00ad0080 00000000 00000000 ................ <-
Trusted state, OTPMK programmed
=> mw.l a0000000 01234567 <- modify any area monitored
by RTIC block A
=> md 0x1760000; echo; md 01e90000; <- take few cycles for RTIC
to update state!
01760000: 00000000 14000206 00000000 00000000 ................
01760010: 00000000 10100000 00000000 ff000000 ................
01e90000: 00000000 00000000 00000000 00000000 ................
01e90010: 00000000 00a30088 01000000 00000000 ................ <- HPSR:
SSM = Soft fail.OTPMK=0
Recall for the SecMon_HP Status register (HPSR), 0x88 means both OPTMK and
ZMK, and 0x03 means that the security monitor is in a soft fail state.
#####