This is the multi-page printable view of this section. Click here to print.
Component Design
1 - CM107A_GuardCfgAndDiagc
Guard Configuration And Diagnostics RH850
( GuardCfgAndDiagc )
FDD CM107A
1.2.1. IPG – Internal Peripheral Guard 4
1.2.2. PEG – PE Guard Function 4
2. Sub-Functions in this Document 5
3.1 Sub-function: (GuardCfgAndDiagcInit1) 5
3.1.2. Guard Configuration Section: PEG Slave Guard Configuration 6
3.1.3. Guard Configuration Section: IPG Slave Guard Configuration 13
3.1.4. Guard Configuration Section: PBG Slave Guard Configuration 19
4.1 Sub-Function (GuardCfgAndDiagcInit2) 28
4.2 Sub-Function: (GuardCfgAndDiagcInit3) 28
3.1.11. Verification Method 50
4. Revision Record & Change Approval 50
High Level Description
This document describes the microcontroller configuration for the micro slave guard function. This function will selectively enable access to microcontroller resources. On reset most of these resources are unprotected so the net behavior of the slave guard function is to constrain access.
Ref. Renesas’ Hardware User’s Manual Ver 1.10 Dtd Feb 2016
1.1. Overview
The RH850 P1M MCU provides protection features to prevent erroneous access to memory and the control registers of the peripheral circuits using the slave guard function.
1.2. Slave Guards
There are three sections to the guard function:
PEG – Processor Element Guard
IPG – Internal Peripheral Guard
PBG – Peripheral Bus Guard
Fig 4.1-1 from SAN 1.20 edited to correct the Flexray PROTSPID to match the value shown in the HWUM 1.1
1.2.1. IPG – Internal Peripheral Guard
The IPG section protects the CPU peripherals against illegal accesses by SW components running on the CPU itself.
The IPG provides the following features:
Detects violation of peripheral device protection.
Stores unauthorized access information
Blocks unauthorized access.
Notifies violation through an exception.
Invalidates subsequent access (post violation).
1.2.2. PEG – PE Guard Function
The PE guard system section prevents unauthorized access to the resources in the PE from an external master. This section protects access to the local RAM in the PE.
The PEG provides the following features:
Protects local RAM against illegal access from FlexRay and the DMA.
Detects PE access violation.
Blocks unauthorized access.
Provides notification of an unauthorized access through the ECM.
Allows protection of up to 4 areas with 4K granularity.
1.2.3. PBG – Peripheral Bus Guards
The PBG protects the control registers in the peripheral circuits and memories from illegal access by the PE, Flexray and the DMA. The PBG module is divided into multiple PBG groups, each of which is provided a maximum of 16 protection channels.
A single PBG channel can designate the access against which a single peripheral circuit should be protected. Each PBG group can hold the information of the access that has been rejected.
The PBG provides the following features:
For protection against read access, an undefined value is read.
For protection against write access, the write access is ignored.
Provides notification of an unauthorized access through the ECM.
Stores unauthorized access information.
Sub-Functions in this Document
Below is a linked list of all sub-functions owned by this document.
Sub-Function Name | Link |
---|---|
GuardCfgAndDiagcInit1 | 4.1 |
GuardCfgAndDiagcInit2 | 4.2 |
GuardCfgAndDiagcInit3 | 4.3 |
Sub-functions
Sub-function: (GuardCfgAndDiagcInit1)
Return to subfunction list: return
NTCs
N/A
SAN Linkage
See the SAN Linkage paragraph of each of the sections which make up this sub-function.
Description
This sub-function configures the RH850/P1M. This has been described in three sections which correspond to the portions of the guard hardware facilities which the microcontroller provides.
Rationale
This sub-function has been defined in terms of the sections which correspond to the hardware resources. This seems to have helped to organize the information but what was thought to be an additional benefit, supporting distinct initialization times for the different guard hardware, has not been used and has not been maintained.
Implementation
See the Implementation paragraph of each of the sections which make up this sub-function.
Initialization (GuardCfgAndDiagcInit1)
PegInin();
IpgInin();
PbgInin();
Reference
See the Reference paragraph of each of the sections which make up this sub-function.
Verification Method
See the Verification Method paragraph of each of the sections which make up this sub-function.
Guard Configuration Section: PEG Slave Guard Configuration
Return to sub-function list link: return
Provides notification of an unauthorized access to the ECM.
NTCs
N/A
SAN Linkage
SAN-169: After reset, the access to the local RAM by bus masters other than the PE (CPU) itself is disabled. Thus, protection- setting registers shall be configured to authorize desired accesses by the DMA and FlexRay. These registers are not protected by PEG and can be thus protected by means of the MPU or the IPG.
Description
This sub-function configures the RH850/P1M for the PEG. The PEG provides and limits access of masters other than the PE (the Flexray and DMA channels) to LRAM.
Rationale
Using the 4Kbyte resolution of the PEGG memory protection capability, the external masters (Flexray and DMA channels) have write access to the same one 4K block of LRAM and may read all 128Kbytes. PEG0 registers define and control the writable 4Kbyte memory block in the highest 4K addresses of LRAM: 0xFEBFF000 through 0xFEBFFFFF. PEGG1 registers define and control the readable 128Kbyte memory block which is all of LRAM: 0xFEBE0000 through 0xFEBFFFFF. Two PEGG register sets remain unused.
DMA channels which move data from peripheral to LRAM, from LRAM to peripheral, or from LRAM to LRAM will have different SPIDs. Their access rights will be determined by the SPIDs.
Implementation
PEG Protection Targets – Following access types are allowed or restricted for bus masters of each SPID:
SPID 0 – Read access allowed, Write access allowed.
SPID 1 – Read access restricted, Write access restricted.
SPID 2 – Read access allowed, Write access restricted.
SPID 3 – Read access allowed, Write access allowed.
Per the IPG setup in section 4.1, the PEG registers cannot be changed in user mode.
DMA channels will be assigned SPIDs corresponding to their respective LRAM and peripheral access requirements (SPID 2 or 3).
Flexray uses SPID 3. Currently, the intent is to make no use of the Flexray’s memory access capability but the SPID 3 ability to write to only the special 4K block and to read the entire LRAM matches well with possible future designs.
The CPU is, thus far, only using the Reset initialized SPID value of 1.
The “CAUTION” note following Table 3.63 of the HWUM states “PEGGnBA.GnEN is cleared by writing to the PEGGnMK register.” Therefore, the PEGGnMK must be written before PEGGnBA for every PEGGnBA where a “1” is desired in the GnEN bit.
Register Configuration Summary:
Register | Value | Comments | Access | |
---|---|---|---|---|
SV | UM | |||
PEGSP | 0x0001 | Enable detection of accesses by any external master with an enabled SPID. | RW | RW* |
PEGG0BA | 0xFEBF F095 PEGG0BA.G0BASE = 0xFEBFF PEGG0BA.G0SP3 = 1 PEGG0BA.G0SP2 = 0 PEGG0BA.G0SP1 = 0 PEGG0BA.G0SP0 = 1 PEGG0BA.G0WR = 1 PEGG0BA.G0RD = 0 PEGG0BA.G0EN = 1 | Initialized to Local RAM start address in high order 20 bits. Write access allowed for SPID 3 and SPID 0. Write Access not allowed for SPID 2 and 1. | RW | RW* |
PEGG0MK | 0x0000 0000 PEGG0MK.G0MASK = 0x00000 | This memory region consists of one 4Kbyte block so a zero mask makes all 20 bits of the G0BASE field of PEGG0BA significant. | RW | RW* |
PEGG1BA | 0xFEBE 00D3 PEGG1BA.G1BASE = 0xFEBE0 PEGG1BA.G1SP3 = 1 PEGG1BA.G1SP2 = 1 PEGG1BA.G1SP1 = 0 PEGG1BA.G1SP0 = 1 PEGG1BA.G1WR = 0 PEGG1BA.G1RD = 1 PEGG1BA.G1EN = 1 | Initialized to 128Kb Local RAM’s start address. Read access allowed for SPID 2, SPID 3 and SPID 0. Read Access not allowed for SPID 1. | RW | RW* |
PEGG1MK | 0x0001 F000 PEGG1MK.G1MASK = 0x0001F | With five mask bits set to one, only fifteen of the 20 bits of the G1BASE field of PEGG1BA are compared. The entire local RAM is made read accessible here since (32- 15 =) 17 bits addresses 128 Kbyte. | RW | RW* |
PEGG2BA | 0 | Set to or allow to remain at the value of zero established by reset. | RW | RW* |
PEGG2MK | 0 | Set to or allow to remain at the value of zero established by reset. | RW | RW* |
PEGG3BA | 0 | Set to or allow to remain at the value of zero established by reset. | RW | RW* |
PEGG3MK | 0 | Set to or allow to remain at the value of zero established by reset. | RW | RW* |
* the access rights shown are the “after reset” defaults, these are modified by the value written to IPGPMTUM4 as described in this document.
Initialization (PegInin)
PEGG0MK = 0x0000 0000; //write each MK before the corresponding BA!!!
//side effect of writing PEGGnMK: it clears PEGGnBA.GnEN
PEGG0BA = 0xFEBF F095;
PEGG1MK = 0x0001 F000;
PEGG1BA = 0xFEBE 00D3;
//PEGG2MK = 0x0000 0000; // no register write is required as default values are appropriate
//PEGG2BA = 0x0000 0000; // no register write is required as default values are appropriate
//PEGG3MK = 0x0000 0000; // no register write is required as default values are appropriate
//PEGG3BA = 0x0000 0000; // no register write is required as default values are appropriate
PEGSP = 0x0001; //enable PEG
Reference
Verification Method
N/A
Guard Configuration Section: IPG Slave Guard Configuration
Return to sub-function list link: return
Provides notification of an unauthorized access to the ECM.
NTCs
N/A
SAN Linkage
SAN-153: The IPG function is not automatically enabled (initial setting). If a specific protection of the mentioned peripherals is intended, then the CPU shall set the E bit in IPGENUM while in the supervisor mode or if write permission for user mode is set by IPGPMTUM4 register.
Description
This sub-function configures the RH850/P1M IPG.
Rationale
It is desired to allow the processor (PE) user mode read access to all peripherals including H-bus (Flexray). In contrast, user mode write access will be allowed only to necessary devices: P-bus groups 0 to 3 and 5 and the H Bus. The processor (PE) has been granted no user mode execute access to any peripherals. All other IPG protected resources: COMPTEST, INTC1, SysErrGen, and user mode access to IPG and PBG registers are limited to read access.
This initialization must run after the startup PBG test so that the correct values are left in the guard registers for the initial Critical register check and for periodic operation.
Implementation
Register Configuration Summary:
Register | Value | Comments | Access | |
---|---|---|---|---|
SV | UM | |||
IPGENUM | 0x03 IPGENUM.IRE = 1 IPGENUM.E = 1 | Enable storing of access violation information in IPGECRUM and IPGADRUM and enable the peripheral device protection. | RW | * |
IPGPMTUM0 | 0x33 IPGPMTUM0.X1 = 0 IPGPMTUM0.W1 = 1 IPGPMTUM0.R1 = 1 IPGPMTUM0.X0 = 0 IPGPMTUM0.W0 = 1 IPGPMTUM0.R0 = 1 | Allow user mode Read and Write access to P-bus groups 0 to 3 and 5 and to the H Bus and restrict user mode execute access to P-bus groups 0 to 3 and 5 and to the H-bus. | RW | * |
IPGPMTUM2 | 0x11 IPGPMTUM2.W1 = 0 IPGPMTUM2.R1 = 1 IPGPMTUM2.W0 = 0 IPGPMTUM2.R0 = 1 | Allow user mode read access to COMPTEST and INTC1 and restrict user mode write access to COMPTEST and INTC1 | RW | * |
IPGPMTUM3 | 0x10 IPGPMTUM3.W1 = 0 IPGPMTUM3.R1 = 1 | Allow user mode read access to SysErrGen and restrict user mode write access to SysErrGen | RW | * |
IPGPMTUM4 | 0x01 IPGPMTUM4.W0 = 0 IPGPMTUM4.R0 = 1 | Allow user mode read access to own IPG and PEG in User Mode and restrict user mode write access to own IPG and PEG in User Mode. | RW | * |
* - on reset neither read nor write access is allowed in UM. Later, UM read access is enabled by the IPG initialize setting.
Initialization (IpgInin)
//must be in supervisor mode to write these!
IPGPMTUM0 = 0x33; //(8 bit) initialize
IPGPMTUM2 = 0x11; //(8 bit) initialize
IPGPMTUM3 = 0x10; //(8 bit) initialize
IPGPMTUM4 = 0x01; //(8 bit) initialize
IPGENUM = 0x03; //(8 bit) initialize to enable the protections selected above.
//it may be ok to do IPGENUM earlier but it seems safest to do it last of IPGs
Reference
Verification Method
N/A
Guard Configuration Section: PBG Slave Guard Configuration
Return to sub-function list link: return
Provides notification of an unauthorized access to the ECM.
NTCs
N/A
SAN Linkage
SAN-186: After reset, access by the bus masters is enabled. Protection setting registers should be configured to inhibit respectively authorize desired accesses. The PBG protection register of each PBG channel supports a write protection function by a lock bit. When the lock bit is set to “1”, any further write to the protection setting register is ignored. This bit can only be cleared by reset.
The PBG protection register of each PBG channel supports a write protection function by a lock bit (except for PBG0A) [Rev1.20 SAN-P1x-0410]. For PBG0A the customer should ensure that the guard setting settings are not accidently changed (e.g. periodic check of the protection setting register, MPU and so on).
Description
This sub-function configures the RH850/P1M PBG. The PBG provides and restricts DMA, Flexray and PE access to peripherals.
Rationale
PE is being given read and write access to all peripheral groups.
WARNING: Required DMA channels’ use of peripheral interfaces were traced via the Hardware User’s manual to PBG group and channel numbers (the peripheral registers used by each channel is mapped to an entry in the table in para 31.4.2). Because of this unavoidable coupling, changes to FDD CM200A_DmaCfgAndUse_PeripheralCfg are extremely likely to require corresponding changes here and vice versa.
DMA Channel | SRC | DST | PBG RESOURCE | HW Manual 31.4.2 Group | HW Manual 31.4.2 Channel |
---|---|---|---|---|---|
0 | SPI Register (CSIH1) | Local RAM (Motor Control) | CSIH1 group B | PBG2A | 11 |
1 | ADC Register (ADCD0) | Local RAM (Motor Control) | ADCD0 | PBG3A | 10 |
2 | SPI Register (CSIH3) | Local RAM (Motor Control) | CSIH3 group B | PBG2A | 15 |
3 | Local RAM (Motor Control) | TSG3 (TSG31) | TSG31 | PBG1A | 8 |
4 | Local RAM (Motor Control) | TSG3 (TSG31) | TSG31 | PBG1A | 8 |
5 | none | none | none | unused | unused |
6 | none | none | none | unused | unused |
7 | none | none | none | unused | unused |
8 | none | none | none | unused | unused |
9 | Local RAM (Motor Control) | Local RAM | none | N/A | N/A |
10 | Local RAM (Motor Control) | SPI Register (CSIH3) | CSIH3 group B | PBG2A | 15 |
12 | Local RAM (Motor Control) | SPI Register (CSIH1) | CSIH1 group B | PBG2A | 11 |
14 | ADC Register (ADCD1) | Local RAM (Motor Control) | ADCD1 | PBG3A | 11 |
15 | Local RAM (Motor Control) | Local RAM (Motor Control) | none | N/A | N/A |
A system controlling access by PEID, SPID was established with the following operations allowed:
PEID | SPID | peripheral reads | peripheral writes | RAM reads | RAM writes |
---|---|---|---|---|---|
1 | 0 | X | X | ||
1 | 1 | X | X | ||
1 | 2 | X | X | ||
1 | 3 | X | X |
Flexray’s use of PEID (Processor Identification number) 4 means that this PBG design grants it NO ACCESS to peripherals since both PEID and SPID must match to get PBG access. PEID match is not required for PEGG access so Flexray does get RAM access based on its SPID 3.
Each DMA channel must use the PEID and SPID which provides the access it needs to perform its reads and writes. SPID 1 is reserved for the PE only. NOTE that PE access to LRAM does not use the same access sources as other masters so this table need not provide LRAM access to the PE.
The DMA SPIDs needed by each PBG group, channel pair were gathered from these.
PBG Group | PBG Channel | SPIDs which need access | |||
---|---|---|---|---|---|
| 8 | 2 | |||
2A | 11 | 2, 3 | |||
2A | 15 | 2, 3 | |||
3A | 10 | 3 | |||
3A | 11 | 3 |
Adding in allowing SPID 1 to provide access to every peripheral group for PE1, PROTUM = 1 where access during periodic update is needed, default values for RESERVED fields, read/write controls and the use of PEID of 1 by all DMA channels established nearly all of the values for all of the PBG protection registers.
Further special case additions are:
PE access in user mode also occurs to PBG group, channel (0A, 1) and (5A, 0) so these require setting UM bits of two corresponding PBG registers. The (0A, 1) access is necessary to set up periodic DMA operations. The (5A, 0) access is related to flash write protection. The (5A, 0) access has been found difficult to do without but it may be reviewed in future since it enables writing of flash in user mode.
Further requirements for user mode access for the following group, channel pairs are:
(1B, 0) - OSTM0
(1B, 1) - OSTM1
(1B, 3) - OSTM1_CLKSEL
(2A, 7) - BIST
Implementation
Note: The high order one of the two fields which Renesas calls “Reserved” is here renamed “RESERVED0” and the low order one is renamed “RESERVED1”.
The following fields have the same value across all FSGDxxPROTn registers:
FSGDxxPROTn.RESERVED0 = 1 Renesas does not describe any detail of the function of this field.
FSGDxxPROTn.PROTPEID = 0b00000010 enables only processor ID (PEID) 1 masters’ access
to this resource group
FSGDxxPROTn.RESERVED1 = 255 Renesas does not describe any detail of the function of this field.
FSGDxxPROTn.PROTDEB = 1 enables access to a debug master
FSGDxxPROTn.PROTRDPDEF = 1 denies default read access, a master must pass the filter and PROTRD
FSGDxxPROTn.PROTWRPDEF = 1 denies default write access, a master must pass the filter and PROTWR
FSGDxxPROTn.PROTRD = 1 enables read access to a master which passes the filter
FSGDxxPROTn.PROTWR = 1 enables write access to a master which passes the filter
One field has what is ‘close’ to a constant value for all of the PBG registers. FSGDxxPROTn.PROTLOCK has the value zero for the two registers of the ‘0A’ group and the value one for all of the rest of the PBG registers. FSGDxxPROTn.PROTLOCK disables writing to the register FSGDxxPROTn. Registers FSGD0ADPROT0 and FSGD0ADPROT1 do not have this bit. Note that this bit is zeroed by any reset source in all registers where it appears.
The remaining field values vary from register to register. These fields are:
FSGDxxPROTn.PROTUM enables access to a master in user mode (must match the filter otherwise)
FSGDxxPROTn.PROTSPID specifies with a bit each, which SPIDs pass the filter
Register Configuration Summary:
Register | Group | Channel | Value | Channel Specific Settings | Access | |
---|---|---|---|---|---|---|
SV | UM | |||||
FSGD0ADPROT0 | PBG0A | 0 | 0x0405FE5F | FSGD0ADPROT0.PROTUM = 0 FSGD0ADPROT0.PROTSPID = 0b0010 | R/W | R/W |
FSGD0ADPROT1 | PBG0A | 1 | 0x0605FE5F | FSGD0ADPROT1.PROTUM = 1 FSGD0ADPROT1.PROTSPID = 0b0010 | R/W | R/W |
FSGD1ADPROT0 | PBG1A | 0 | 0x8605FE5F | FSGD1ADPROT0.PROTUM = 1 FSGD1ADPROT0.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT1 | PBG1A | 1 | 0x8605FE5F | FSGD1ADPROT1.PROTUM = 1 FSGD1ADPROT1.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT2 | PBG1A | 2 | 0x8605FE5F | FSGD1ADPROT2.PROTUM = 1 FSGD1ADPROT2.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT3 | PBG1A | 3 | 0x8605FE5F | FSGD1ADPROT3.PROTUM = 1 FSGD1ADPROT3.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT4 | PBG1A | 4 | 0x8605FE5F | FSGD1ADPROT4.PROTUM = 1 FSGD1ADPROT4.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT5 | PBG1A | 5 | 0x8605FE5F | FSGD1ADPROT5.PROTUM = 1 FSGD1ADPROT5.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT6 | PBG1A | 6 | 0x8605FE5F | FSGD1ADPROT6.PROTUM = 1 FSGD1ADPROT6.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT7 | PBG1A | 7 | 0x8605FE5F | FSGD1ADPROT7.PROTUM = 1 FSGD1ADPROT7.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT8 | PBG1A | 8 | 0x8605FEDF | FSGD1ADPROT8.PROTUM = 1 FSGD1ADPROT8.PROTSPID = 0b0110 | R/W* | R/W* |
FSGD1ADPROT9 | PBG1A | 9 | 0x8605FE5F | FSGD1ADPROT9.PROTUM = 1 FSGD1ADPROT9.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT10 | PBG1A | 10 | 0x8605FE5F | FSGD1ADPROT10.PROTUM = 1 FSGD1ADPROT10.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT11 | PBG1A | 11 | 0x8605FE5F | FSGD1ADPROT11.PROTUM = 1 FSGD1ADPROT11.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT12 | PBG1A | 12 | 0x8605FE5F | FSGD1ADPROT12.PROTUM = 1 FSGD1ADPROT12.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT13 | PBG1A | 13 | 0x8605FE5F | FSGD1ADPROT13.PROTUM = 1 FSGD1ADPROT13.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1ADPROT14 | PBG1A | 14 | 0x8605FE5F | FSGD1ADPROT14.PROTUM = 1 FSGD1ADPROT14.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT0 | PBG1B | 0 | 0x8605FE5F | FSGD1BDPROT0.PROTUM = 1 FSGD1BDPROT0.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT1 | PBG1B | 1 | 0x8605FE5F | FSGD1BDPROT1.PROTUM = 1 FSGD1BDPROT1.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT2 | PBG1B | 2 | 0x8405FE5F | FSGD1BDPROT2.PROTUM = 0 FSGD1BDPROT2.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT3 | PBG1B | 3 | 0x8605FE5F | FSGD1BDPROT3.PROTUM = 1 FSGD1BDPROT3.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT4 | PBG1B | 4 | 0x8605FE5F | FSGD1BDPROT4.PROTUM = 1 FSGD1BDPROT4.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT5 | PBG1B | 5 | 0x8605FE5F | FSGD1BDPROT5.PROTUM = 1 FSGD1BDPROT5.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT6 | PBG1B | 6 | 0x8605FE5F | FSGD1BDPROT6.PROTUM = 1 FSGD1BDPROT6.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT7 | PBG1B | 7 | 0x8605FE5F | FSGD1BDPROT7.PROTUM = 1 FSGD1BDPROT7.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT8 | PBG1B | 8 | 0x8605FE5F | FSGD1BDPROT8.PROTUM = 1 FSGD1BDPROT8.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT9 | PBG1B | 9 | 0x8605FE5F | FSGD1BDPROT9.PROTUM = 1 FSGD1BDPROT9.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT10 | PBG1B | 10 | 0x8605FE5F | FSGD1BDPROT10.PROTUM = 1 FSGD1BDPROT10.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT11 | PBG1B | 11 | 0x8605FE5F | FSGD1BDPROT11.PROTUM = 1 FSGD1BDPROT11.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT12 | PBG1B | 12 | 0x8605FE5F | FSGD1BDPROT12.PROTUM = 1 FSGD1BDPROT12.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT13 | PBG1B | 13 | 0x8605FE5F | FSGD1BDPROT13.PROTUM = 1 FSGD1BDPROT13.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD1BDPROT14 | PBG1B | 14 | 0x8605FE5F | FSGD1BDPROT14.PROTUM = 1 FSGD1BDPROT14.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT0 | PBG2A | 0 | 0x8605FE5F | FSGD2ADPROT0.PROTUM = 1 FSGD2ADPROT0.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT1 | PBG2A | 1 | 0x8605FE5F | FSGD2ADPROT1.PROTUM = 1 FSGD2ADPROT1.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT2 | PBG2A | 2 | 0x8405FE5F | FSGD2ADPROT2.PROTUM = 0 FSGD2ADPROT2.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT3 | PBG2A | 3 | 0x8405FE5F | FSGD2ADPROT3.PROTUM = 0 FSGD2ADPROT3.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT4 | PBG2A | 4 | 0x8405FE5F | FSGD2ADPROT4.PROTUM = 0 FSGD2ADPROT4.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT5 | PBG2A | 5 | 0x8405FE5F | FSGD2ADPROT5.PROTUM = 0 FSGD2ADPROT5.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT6 | PBG2A | 6 | 0x8405FE5F | FSGD2ADPROT6.PROTUM = 0 FSGD2ADPROT6.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT7 | PBG2A | 7 | 0x8605FE5F | FSGD2ADPROT7.PROTUM = 1 FSGD2ADPROT7.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT8 | PBG2A | 8 | 0x8605FE5F | FSGD2ADPROT8.PROTUM = 1 FSGD2ADPROT8.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT9 | PBG2A | 9 | 0x8605FE5F | FSGD2ADPROT9.PROTUM = 1 FSGD2ADPROT9.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT10 | PBG2A | 10 | 0x8605FE5F | FSGD2ADPROT10.PROTUM = 1 FSGD2ADPROT10.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT11 | PBG2A | 11 | 0x8605FFDF | FSGD2ADPROT11.PROTUM = 1 FSGD2ADPROT11.PROTSPID = 0b1110 | R/W* | R/W* |
FSGD2ADPROT12 | PBG2A | 12 | 0x8605FE5F | FSGD2ADPROT12.PROTUM = 1 FSGD2ADPROT12.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT13 | PBG2A | 13 | 0x8605FE5F | FSGD2ADPROT13.PROTUM = 1 FSGD2ADPROT13.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT14 | PBG2A | 14 | 0x8605FE5F | FSGD2ADPROT14.PROTUM = 1 FSGD2ADPROT14.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD2ADPROT15 | PBG2A | 15 | 0x8605FFDF | FSGD2ADPROT15.PROTUM = 1 FSGD2ADPROT15.PROTSPID = 0b1110 | R/W* | R/W* |
FSGD3ADPROT0 | PBG3A | 0 | 0x8405FE5F | FSGD3ADPROT0.PROTUM = 0 FSGD3ADPROT0.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT1 | PBG3A | 1 | 0x8405FE5F | FSGD3ADPROT1.PROTUM = 0 FSGD3ADPROT1.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT2 | PBG3A | 2 | 0x8405FE5F | FSGD3ADPROT2.PROTUM = 0 FSGD3ADPROT2.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT3 | PBG3A | 3 | 0x8605FE5F | FSGD3ADPROT3.PROTUM = 1 FSGD3ADPROT3.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT4 | PBG3A | 4 | 0x8605FE5F | FSGD3ADPROT4.PROTUM = 1 FSGD3ADPROT4.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT5 | PBG3A | 5 | 0x8405FE5F | FSGD3ADPROT5.PROTUM = 0 FSGD3ADPROT5.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT6 | PBG3A | 6 | 0x8405FE5F | FSGD3ADPROT6.PROTUM = 0 FSGD3ADPROT6.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT7 | PBG3A | 7 | 0x8405FE5F | FSGD3ADPROT7.PROTUM = 0 FSGD3ADPROT7.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT8 | PBG3A | 8 | 0x8405FE5F | FSGD3ADPROT8.PROTUM = 0 FSGD3ADPROT8.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT9 | PBG3A | 9 | 0x8405FE5F | FSGD3ADPROT9.PROTUM = 0 FSGD3ADPROT9.PROTSPID = 0b0010 | R/W* | R/W* |
FSGD3ADPROT10 | PBG3A | 10 | 0x8605FF5F | FSGD3ADPROT10.PROTUM = 1 FSGD3ADPROT10.PROTSPID = 0b1010 | R/W* | R/W* |
FSGD3ADPROT11 | PBG3A | 11 | 0x8605FF5F | FSGD3ADPROT11.PROTUM = 1 FSGD3ADPROT11.PROTSPID = 0b1010 | R/W* | R/W* |
FSGD5ADPROT0 | PBG5A | 0 | 0x8605FE5F | FSGD5ADPROT0.PROTUM = 1 FSGD5ADPROT0.PROTSPID = 0b0010 | R/W* | R/W* |
*Also SAN-186 describes a lock bit on these registers. If the lock bit is set there is only one write which will function until the next reset.
Initialization (PbgInin)
FSGD0ADPROT0 = 0x405FE5F;
FSGD0ADPROT1 = 0x605FE5F;
FSGD1ADPROT0 = 0x8605FE5F;
FSGD1ADPROT1 = 0x8605FE5F;
FSGD1ADPROT2 = 0x8605FE5F;
FSGD1ADPROT3 = 0x8605FE5F;
FSGD1ADPROT4 = 0x8605FE5F;
FSGD1ADPROT5 = 0x8605FE5F;
FSGD1ADPROT6 = 0x8605FE5F;
FSGD1ADPROT7 = 0x8605FE5F;
FSGD1ADPROT8 = 0x8605FEDF;
FSGD1ADPROT9 = 0x8605FE5F;
FSGD1ADPROT10 = 0x8605FE5F;
FSGD1ADPROT11 = 0x8605FE5F;
FSGD1ADPROT12 = 0x8605FE5F;
FSGD1ADPROT13 = 0x8605FE5F;
FSGD1ADPROT14 = 0x8605FE5F;
FSGD1BDPROT0 = 0x8605FE5F;
FSGD1BDPROT1 = 0x8605FE5F;
FSGD1BDPROT2 = 0x8405FE5F;
FSGD1BDPROT3 = 0x8605FE5F;
FSGD1BDPROT4 = 0x8605FE5F;
FSGD1BDPROT5 = 0x8605FE5F;
FSGD1BDPROT6 = 0x8605FE5F;
FSGD1BDPROT7 = 0x8605FE5F;
FSGD1BDPROT8 = 0x8605FE5F;
FSGD1BDPROT9 = 0x8605FE5F;
FSGD1BDPROT10 = 0x8605FE5F;
FSGD1BDPROT11 = 0x8605FE5F;
FSGD1BDPROT12 = 0x8605FE5F;
FSGD1BDPROT13 = 0x8605FE5F;
FSGD1BDPROT14 = 0x8605FE5F;
FSGD2ADPROT0 = 0x8605FE5F;
FSGD2ADPROT1 = 0x8605FE5F;
FSGD2ADPROT2 = 0x8405FE5F;
FSGD2ADPROT3 = 0x8405FE5F;
FSGD2ADPROT4 = 0x8405FE5F;
FSGD2ADPROT5 = 0x8405FE5F;
FSGD2ADPROT6 = 0x8405FE5F;
FSGD2ADPROT7 = 0x8605FE5F;
FSGD2ADPROT8 = 0x8605FE5F;
FSGD2ADPROT9 = 0x8605FE5F;
FSGD2ADPROT10 = 0x8605FE5F;
FSGD2ADPROT11 = 0x8605FFDF;
FSGD2ADPROT12 = 0x8605FE5F;
FSGD2ADPROT13 = 0x8605FE5F;
FSGD2ADPROT14 = 0x8605FE5F;
FSGD2ADPROT15 = 0x8605FFDF;
FSGD3ADPROT0 = 0x8405FE5F;
FSGD3ADPROT1 = 0x8405FE5F;
FSGD3ADPROT2 = 0x8405FE5F;
FSGD3ADPROT3 = 0x8605FE5F;
FSGD3ADPROT4 = 0x8605FE5F;
FSGD3ADPROT5 = 0x8405FE5F;
FSGD3ADPROT6 = 0x8405FE5F;
FSGD3ADPROT7 = 0x8405FE5F;
FSGD3ADPROT8 = 0x8405FE5F;
FSGD3ADPROT9 = 0x8405FE5F;
FSGD3ADPROT10 = 0x8605FF5F;
FSGD3ADPROT11 = 0x8605FF5F;
FSGD5ADPROT0 = 0x8605FE5F;
Reference
Verification Method
N/A
Sub-Function (GuardCfgAndDiagcInit2)
Return to subfunction list: return
This is an empty Initialization function that contains no logic.
GuardCfgAndDiagcInit2 is an RTE function which is required for memory mapping PIM and Calibration definitions.
Sub-Function: (GuardCfgAndDiagcInit3)
Return to sub-function list link: return
NTCs
N/A
SAN Linkage
Ver 1.20 SAN-P1x-0403:
4.5.2 Failure Control The logic of the peripheral bus guard for each group is targeted by LBIST. For the PBG3A group, the SW test described in the subsequent section shall be additionally executed to increase the DC with respect to latent faults and to cover the error signal path to ECM [SAN-P1x-0407].
4.5.3.1 A SW test at start-up shall be executed for PBG3A (can be optionally performed for other peripheral guard groups) by forcibly violating the access permission attributes such as access with wrong address or write attempt when no write permission is set.
4.5.3.2 SW Test Procedure In order to test the peripheral guard of group 3A, the flow given in Figure 4.5-3 shall be followed. In this flow each Filter within the guard is associated with a target module (such as ADCD0 etc..) of group 3A.
29.1 The LBIST checks all error signal paths from the modules to the ECM that are themselves targeted by the LBIST except the error signal paths from the DMA compare unit, the PBG3A, and from OR-gate for data parity. For these items, countermeasures are already described in the dedicated chapters in this document.
Description
This sub-function performs a test that the PBG guard is functional. In particular, it verifies that the signal path which reports each of twelve PBG group 3A members read and write violations to the ECM. These are not tested by the BIST so it is a shortfall reported by the SAN.
Rationale
This test must be run before the PBG is initialized so that it does not overwrite the initialization values needed during execution of periodic functions. At this time the PBG registers are accessible. Also, PBG critical register monitoring (initial) must occur after the PBG has been set up for periodic running, not per the SAN PBG startup test.
This test is one of a group that will be run after some subset of all types of resets has occurred. By convention, all of these tests are always entered and each calls a function (ChkForStrtUpTest) which determines whether the test should perform its test or trivially return.
The design doesn’t match the SAN flowchart for several reasons:
The SAN flowchart tests only that the error is seen at the ERRSLVxxSTAT register. This does not accomplish the goal of verifying the signal path from the PBG3A module to the ECM per section 29.1 of the SAN. The design verifies that the error is caught in the ERRSLVxxSTAT register in addition to reaching ECMMESSTR0 which confirms the functional path to the ECM.
The SAN flowchart details testing one “access” while looping through the 12 PBG 3A sections, then branches back to the beginning if both read and write tests have not been completed. The design tests read and then write of each of the 12 sections in turn verifying that both access types cause error signals to reach ERRSLVxxSTAT and the ECM.
The SAN flowchart leaves each PBG 3A register with a value that allows reading and writing. The design stores the entry value of each PBG 3A register before testing it and restores that value before exiting.
The SAN flowchart does not address the impact of this error’s drive to the SYSERR function. Because of this, the SEGCONT register must have two bits cleared during testing to prevent SYSERR exceptions. Similarly, the driving of the ERROROUT pin must be masked off from the error signals which will occur during the test. These must be restored before the test returns.
The SAN flowchart has ignored the reality that the test must access regions protected by the PBG 3A registers that are not the same data length/type. The design has addressed this code-level matter.
Implementation
The test loops through all twelve sections of the PBG 3A group. The sections where the targets register is 8, 16 or 32 bits have been grouped and are tested in group order. Each pass of the test loop in the functions which handle 8, 16 or 32 bits ones verifies that first a read access, then a write access records a violation at the group 3A error status register and at the ECM level in bit 26 of ECMMESSTR0. The PBG protection registers and their corresponding test targets are listed in the following tables:
Index | 8 Bit Register |
---|---|
0 | PBGFSGD3ADPROT0,DNFA0CTL |
1 | PBGFSGD3ADPROT1,PORTJJPIBC0 |
2 | PBGFSGD3ADPROT5,FCLA0CTL0 |
3 | PBGFSGD3ADPROT6,FCLA1CTL0 |
4 | PBGFSGD3ADPROT7,FCLA2CTL0 |
5 | PBGFSGD3ADPROT8,FCLA3CTL0 |
6 | PBGFSGD3ADPROT9,FCLA4CTL0 |
7 | PBGFSGD3ADPROT10,ADCD0THACR |
8 | PBGFSGD3ADPROT11,ADCD1THACR |
Index | 16 Bit Register |
---|---|
0 | PBGFSGD3ADPROT3,PORTPMC0 |
Index | 32 Bit Register |
---|---|
0 | PBGFSGD3ADPROT2,PORTJJPCR0_0 |
1 | PBGFSGD3ADPROT4,PORTPCR0_0 |
Any error detected during testing is recorded using the function SetMcuDiagcIdnData with a first parameter value McuDiagc1.MCUDIAGC_PBGSTRTUPTST. Further information is encoded into a second parameter according to the following table:
ECM Failure | PBG Failure | Configure Failure | Write Error | Read Error |
---|---|---|---|---|
Bit 10 | Bit 9 | Bit 8 | Bit 7 | Bit 6 |
1 - ECM Error | 1 - PBG Error | 1 - Configuration Failed | 1 - Write Error | 1 - Read Error |
0 - No Error | 0 - No Error | 0 - No Error | 0 - No Error | 0 - No Error |
Register Size | Index | ||||
---|---|---|---|---|---|
Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
00 - 8 Bit Reg | Taken from the appropriate length register table “Index” field above. | ||||
01 - 16 Bit Reg | |||||
10 - 32 Bit Reg |
All other bits of the second parameter are zero. The only exception to this encoding is when an error is found flagged in register PBGERRSLV3ASTAT before testing has begun. In this case, the second parameter is set to all ones.
NOTE: Renesas has not documented that the SEGFLAG bits function is upstream of SEGCONT. That is, in this case the SEGFLAG.VCIF and VCPF will be set by this test’s generation of PBG3A violations even though the SEGCONT.VCIE and VCPE, having been set to zero, prevent the signal from causing any SYSERR reset. This is addressed in the design by clearing SEGFLAG.VCIF and VCPF before setting SEGCONT.VCIE and VCPE after all test loops have completed.
ANOTHER NOTE: The pseudocode below includes a commented off post-test check for most of the syserr generating exceptions that had to be blocked during the test. Once unit testing has confirmed that these are not being tripped it is thought that the check is not of value in the production executable code. There are some Syserr generating exceptions that had to be blocked during the test which can not be captured in any way. For a reference on the errors which may escape – see the function of the VCIE bit in the SEGCONT register.
THIRD NOTE: This code writes to and reads from SEG registers SEGCONT and SEGFLAG. These are protected by IPG (guard) bits. The current IPG settings elsewhere in this FDD allow reading but cause writing to be a guard violation. To avoid this, this test must run before the guard is initialized by GuardCfgAndDiagcInit. This ordering is controlled elsewhere.
Initialization
extrn void ChkForStrtUpTest (Boolean* ExecStrtUpTest);
//configure, read back and set error code if it doesn’t verify
//”Configure Nth Filter” in the SAN Flowchart
static void ConfigureFilterN( uint32_t* volatile PbgProtReg, uint32 value, uint32* TestFailStsPtr)
{
* PbgProtReg = value; //write to PbgProt register
if (value != * PbgProtReg)
*TestFailStsPtr |= (uint32)(1<<8); //pass an error code - configuration
}
//check that the error showed up, clear/verify the error, and set error code if needed
static void ChkForPBGErr(Uint32 PbgProtReg, uint32* TestFailStsPtr)
{
if (0 == (PBGERRSLV3ASTAT & 1)) // ERRSLV3ASTAT
{
*TestFailStsPtr |= ( 1<<9) ; //pass an error code - PBG level
}
else
{
PBGERRSLV3ACTL = 1; //clear error bit by write to ERRSLV3ACTL
if (0 != (PBGERRSLV3ASTAT & 1)) // ERRSLV3ASTAT
*TestFailStsPtr |= (1<<9 ) ; //pass an error code - PBG level
}
}
//check that the error showed up at the ECM, clear/verify the error, and set error code if needed
static void ChkForECMErr ( Uint32 PbgProtReg, uint32* TestFailStsPtr)
{
// test that the data got to the ECM
if (0 == (ECMESSTR0 & (1<<26)))
*TestFailStsPtr |= (1<<10) ; //error code ECM
// clear the ECM bit
WrProtdRegEcm_u32 (1<<26, &ECMESSTC0);
if (0 != (ECMMESSTR0 & (1<<26) ))
*TestFailStsPtr |= (1<<10); //error code ECM
}
static void testPbg8BitTargets(uint32* TestFailStsPtr)
{
typedef struct
{
uint32* PbgProtnReg;
uint8* PortReg;
}PbgTestRec;
PbgTestRec PbgTestRecAry[9]=
{
{&PBGFSGD3ADPROT0,&DNFA0CTL},
{&PBGFSGD3ADPROT1,&PORTJJPIBC0},
{&PBGFSGD3ADPROT5,&FCLA0CTL0},
{&PBGFSGD3ADPROT6,&FCLA1CTL0},
{&PBGFSGD3ADPROT7,&FCLA2CTL0},
{&PBGFSGD3ADPROT8,&FCLA3CTL0},
{&PBGFSGD3ADPROT9,&FCLA4CTL0},
{&PBGFSGD3ADPROT10,&ADCD0THACR},
{&PBGFSGD3ADPROT11,&ADCD1THACR}
};
uint32* PbgProtnReg;
uint8* PortReg;
uint8 volatile Bucket;
uint32 SavePbgProtReg;
uint8_t LoopCntr = 0U;
while ( LoopCntr < 9U && (0 == (*TestFailStsPtr)) )
{
PbgProtnReg = PbgTestRecAry[LoopCntr].PbgProtnReg;
PortReg = PbgTestRecAry[LoopCntr].PortReg;
SavePbgProtReg = * PbgProtnReg;
// NO ACCESS PERMISSION 0x405FE5C
ConfigureFilterN( PbgProtnReg, 0x405FE5C, TestFailStsPtr);
//read from the port, should generate error
Bucket = *PortReg;
ChkForPBGErr(TestFailStsPtr);
ChkForECMErr(TestFailStsPtr);
if ( 0 < (*TestFailStsPtr) )
*TestFailStsPtr |= 1<<6;
else
{
// write to the port, should generate error
*PortReg = Bucket;
ChkForPBGErr(TestFailStsPtr);
ChkForECMErr(TestFailStsPtr);
if ( 0 < (*TestFailStsPtr) )
*TestFailStsPtr |= 1<<7;
}
// Restore PBG register value
ConfigureFilterN( PbgProtnReg, SavePbgProtReg, TestFailStsPtr);
LoopCntr++;
}
if ( 0 < (* TestFailStsPtr))
*PbgStrtUpTestFailSts |= ( 0U << 4) | //[4:5] 0B 🡪 8 bit
(uint32)(LoopCntr -1U); //index into 8 bit list
}
} // testPbg8BitTargets
static void testPbg16BitTargets(uint32* TestFailStsPtr)
{
typedef struct
{
uint32* PbgProtnReg;
uint16* PortReg;
}PbgTestRec;
PbgTestRec PbgTestRecAry[1]=
{
{&PBGFSGD3ADPROT3,&PORTPMC0}
};
uint32* PbgProtnReg;
uint16* PortReg;
uint16 volatile Bucket;
uint32 SavePbgProtReg;
uint8 LoopCntr = 0;
// while ( LoopCntr < ?U && (0 == (*TestFailStsPtr)) ) // if more of these are added
{
PbgProtnReg = PbgTestRecAry[LoopCntr].PbgProtnReg;
PortReg = PbgTestRecAry[LoopCntr].PortReg;
SavePbgProtReg = * PbgProtnReg;
// NO ACCESS PERMISSION 0x405FE5C
ConfigureFilterN( PbgProtnReg, 0x405FE5C, TestFailStsPtr);
//read from the port, should generate error
Bucket = *PortReg;
ChkForPBGErr( TestFailStsPtr);
ChkForECMErr( TestFailStsPtr);
if ( 0 < (*TestFailStsPtr) )
*TestFailStsPtr |= 1<<6;
else
{
// write to the port, should generate error
*PortReg = Bucket;
ChkForPBGErr(TestFailStsPtr);
ChkForECMErr(TestFailStsPtr);
if ( 0 < (*TestFailStsPtr) )
*TestFailStsPtr |= 1<<7;
}
// Restore PBG register value
ConfigureFilterN( PbgProtnReg, SavePbgProtReg, TestFailStsPtr);
LoopCntr++;
}
if ( 0 < (* TestFailStsPtr))
*PbgStrtUpTestFailSts |= ((uint32)1U<<4U) | //[4:5] 01B 🡪 16 bit
(uint32)(LoopCntr -1U); //index into 16 bit list
} // testPbg16BitTargets
static void testPbg32BitTargets( uint32* TestFailStsPtr)
{
typedef struct
{
uint32* PbgProtnReg;
uint32* PortReg;
}PbgTestRec;
PbgTestRec PbgTestRecAry[2]=
{
{&PBGFSGD3ADPROT2,&PORTJJPCR0_0},
{&PBGFSGD3ADPROT4,&PORTPCR0_0}
};
uint32* PbgProtnReg;
uint32* PortReg;
uint32 volatile Bucket;
uint32 SavePbgProtReg;
uint8 LoopCntr;
while ( LoopCntr < 2U && (0 == (*TestFailStsPtr)) )
{
PbgProtnReg = PbgTestRecAry[LoopCntr].PbgProtnReg;
PortReg = PbgTestRecAry[LoopCntr].PortReg;
SavePbgProtReg = * PbgProtnReg;
// NO ACCESS PERMISSION 0x405FE5C
ConfigureFilterN( PbgProtnReg, 0x405FE5C, TestFailStsPtr);
//read from the port, should generate error
Bucket = *PortReg;
ChkForPBGErr( TestFailStsPtr);
ChkForECMErr( TestFailStsPtr);
if ( 0 < (*TestFailStsPtr) )
*TestFailStsPtr |= 1<<6;
else
{
// write to the port, should generate error
*PortReg = Bucket;
ChkForPBGErr( TestFailStsPtr);
ChkForECMErr( TestFailStsPtr);
if ( 0 < (*TestFailStsPtr) )
*TestFailStsPtr |= 1<<7;
}
// Restore PBG register value
ConfigureFilterN( PbgProtnReg, SavePbgProtReg, TestFailStsPtr);
LoopCntr++;
}
if ( 0 < (* TestFailStsPtr))
*PbgStrtUpTestFailSts |= ((uint32)1U<<5U) | // [4:5] 10B 🡪 32 bit
(uint32)(LoopCntr -1U); //index into 32 bit list
} // testPbg32BitTargets
// this code assumes that the ECM has NOT been configured to generate exceptions or
// interrupts on PBG error detection. It DOES assume that SYSERR occurs on PBG violation
// detection is configured so this code briefly disables that but restores it before returning.
// run this test in Supervisor mode!!!!
void GuardCfgAndDiagcInit3 ( void )
{
uint32* volatile testPeripheralAddr; // peripheral test address
uint32 erroroutPinMaskSave = ECMEMK0;
uint32 savePbgProtectionReg;
uint32 saveSegCont = SEGCONT;
uint32 TestFailSts = 0;
Boolean ExecStrtUpTest;
ChkForStrtUpTest ( &ExecStrtUpTest);
if ( (true == ExecStrtUpTest) && (0 == (PBGERRSLV3ASTAT & 1)) && (0 == (ECMESSTR0 & (1<<26))) )
{
// set BIT26 to prevent (mask off) test induced PBG error from getting to the ERROROUT pin
WrProtdRegEcm_u32 ( erroroutPinMaskSave| (1 << 26), &ECMEMK0);
// the following line requires Supervisor mode!!!!
SEGCONT.VCIE = 0; // turn off syserr response to several VCIE things
SEGCONT.VPGE = 0; // turn off syserr response to PBG write violation
asm(“syncm”); //ensure the written value has settled
testPbg8BitTargets( &TestFailSts);
if ( 0 == TestFailSts)
testPbg16BitTargets( &TestFailSts );
if ( 0 == TestFailSts)
testPbg32BitTargets( &TestFailSts );
// Cleanup
SEGFLAG.VPGF = 0; // clear VPGF, this gets set despite VPGE being 0
SEGFLAG.VCIF = 0; // clear VCIF, this gets set despite VCIE being 0
SEGCONT = SaveSegCont; // restore entry SEGCONT content
//check that this test didn’t generate errors other than the intended
// ones in bit 26 while VCIE was zeroed.
// 0x1003 8000 checks for bus data parity error bit 28
// (DTSRAM, DF, CF ) 2bit ECC errors or CF address parity bits 15, 16, 17
//if ( (*ECMMESSTR0) & 0x1003 8000 )
// DoSyserr();
// restore the mask to the ERROROUT pin
WrProtdRegEcm_u32 ( erroroutPinMaskSave, &ECMEMK0);
}
else if (true == ExecStrtUpTest)
{
TestFailSts = 0xFFFFFFFFU;
}
else {}
if (TestFailSts)
SetMcuDiagcIdnData ( McuDiagc1.MCUDIAGC_PBGSTRTUPTST,
TestFailSts); //pass an error code
} //end of the function
Reference
Figure 4.5.3 from SAN ver 1.20
Verification Method
N/A
Revision Record & Change Approval
Rev | Date | Change Control # | Drw | Change Description |
01.00.00 | 06AU15 | EA4#1822 | EC | Initial Release |
01.01.00 | 22OC15 | EA4#1822 | EC | Update from Integration adds user mode to four PBG chan. |
02.00.00 | 10Feb16 | EA4#2752 | EC | Removed some references to PBG lock bits, add startup PBG 3A test, added references to SAN Ver 1.20, made PBG group 0A group critical registers’ monitoring periodic, added detail about H-bus (flexray) access rights to peripherals and RAM related to Anomaly EA4#3071. |
02.01.00 | 24Feb16 | EA4#2752 | EC | Changed one PBG target register where HWUM had identified the wrong PBG protection set, corrected lengths of some PBG target registers, revised pseudocode to more literally align with SAN flowchart and to align with coding standards |
03.00.00 | 28Mar2016 | EA4#4975 | EC | Update PBG values and rationale to incorporate the ‘protlock’ lock bits and the correct Flexray SPID now documented by HWUM 1.10 DTD Feb 2016. Add time delay to pseudo code in the area where Renesas advises it is needed beyond the areas documented in the HWUM. Added check on ECM reg to Renesas recommended pretest check. |
03.00.01 | 05Apr2016 | EA4#4975 | GM | Removed AND condition for else if statement under GuardCfgAndDiagcInit3 implementation |
2 - CM107A_GuardCfgAndDiagc_FDD_Review_Checklist
Overview
Peer Review InstructionsTechnical Review Checklist
Template Change Log
Sheet 1: Peer Review Instructions
Instructions for Functional Design Package Peer Review | ||
PRE-MEETING | ||
Function Owner | Confirm that requirements are reviewed and approved PRIOR to the FDP peer review | |
Function Owner | Start with latest version of the template for any "first reviews" - Continue to use existing temmplate for re-reviews | |
Function Owner | Provide the functional design package (changed documents) to the invited attendees 1-2 working days in advance of review | |
Function Owner | Notify the assigned peer reviewer and make sure they are prepared to do their function in the meeting | |
Function Owner | Identify necessary attendance and invite to meeting | |
Function Owner | Complete the "Author" column information for sections 1 through 3 prior to the review | |
Function Owner | Complete the attendance invitation list in section 5 | |
Function Owner | For Re-reviews only: Complete the column "remarks by author" to identify actions taken to address items found in earlier reviews. | |
DURING MEETING | ||
Function Owner | Present document changes to the review team | |
Peer Reviewer | Capture attendance of the review | |
Peer Reviewer | Capture actions and issues in section 4. Identify issue summary, Document type, Reference (Requirement ID, section number, etc), Defect Type and indicate status as "OPEN" | |
POST MEETING | ||
Function Owner | Follow up on all "open" items. Update "Summary of Resolution" to indicate what was done or decided. | |
Function Owner | Schedule follow up review OR review open items with peer reviewer and obtain agreement to close | |
Peer Reviewer | Close change request in system and confirm all associated tasks are complete. Upload peer review checklist (this document) with any FDP updates |
Sheet 2: Technical Review Checklist
Sheet 3: Template Change Log
Rev | Change | Author |
01.00.05 | Added lesson learned #3.5 | MDK |
01.00.06 | Added lesson learned #3.6, 3.7 - Structure and writing of NVM in mfiles and models. | MDK |
01.00.07 | Clarified 3.6 and 3.7 Added lessons learned for NTCs not being set in IRQs or periodics faster than 2ms/ | MDK |
01.00.08 | Added section 1.6 to look for critical static register analysis | MDK |
03.00.00 | Add config of PBG lock bits, remove excess SYNCMs | EC |