Path: blob/main/sys/contrib/device-tree/Bindings/crypto/fsl-sec4.txt
48375 views
=====================================================================1SEC 4 Device Tree Binding2Copyright (C) 2008-2011 Freescale Semiconductor Inc.34CONTENTS5-Overview6-SEC 4 Node7-Job Ring Node8-Run Time Integrity Check (RTIC) Node9-Run Time Integrity Check (RTIC) Memory Node10-Secure Non-Volatile Storage (SNVS) Node11-Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node12-Full Example1314NOTE: the SEC 4 is also known as Freescale's Cryptographic Accelerator15Accelerator and Assurance Module (CAAM).1617=====================================================================18Overview1920DESCRIPTION2122SEC 4 h/w can process requests from 2 types of sources.231. DPAA Queue Interface (HW interface between Queue Manager & SEC 4).242. Job Rings (HW interface between cores & SEC 4 registers).2526High Speed Data Path Configuration:2728HW interface between QM & SEC 4 and also BM & SEC 4, on DPAA-enabled parts29such as the P4080. The number of simultaneous dequeues the QI can make is30equal to the number of Descriptor Controller (DECO) engines in a particular31SEC version. E.g., the SEC 4.0 in the P4080 has 5 DECOs and can thus32dequeue from 5 subportals simultaneously.3334Job Ring Data Path Configuration:3536Each JR is located on a separate 4k page, they may (or may not) be made visible37in the memory partition devoted to a particular core. The P4080 has 4 JRs, so38up to 4 JRs can be configured; and all 4 JRs process requests in parallel.3940=====================================================================41SEC 4 Node4243Description4445Node defines the base address of the SEC 4 block.46This block specifies the address range of all global47configuration registers for the SEC 4 block. It48also receives interrupts from the Run Time Integrity Check49(RTIC) function within the SEC 4 block.5051PROPERTIES5253- compatible54Usage: required55Value type: <string>56Definition: Must include "fsl,sec-v4.0"5758- fsl,sec-era59Usage: optional60Value type: <u32>61Definition: A standard property. Define the 'ERA' of the SEC62device.6364- #address-cells65Usage: required66Value type: <u32>67Definition: A standard property. Defines the number of cells68for representing physical addresses in child nodes.6970- #size-cells71Usage: required72Value type: <u32>73Definition: A standard property. Defines the number of cells74for representing the size of physical addresses in75child nodes.7677- reg78Usage: required79Value type: <prop-encoded-array>80Definition: A standard property. Specifies the physical81address and length of the SEC4 configuration registers.82registers8384- ranges85Usage: required86Value type: <prop-encoded-array>87Definition: A standard property. Specifies the physical address88range of the SEC 4.0 register space (-SNVS not included). A89triplet that includes the child address, parent address, &90length.9192- interrupts93Usage: required94Value type: <prop_encoded-array>95Definition: Specifies the interrupts generated by this96device. The value of the interrupts property97consists of one interrupt specifier. The format98of the specifier is defined by the binding document99describing the node's interrupt parent.100101- clocks102Usage: required if SEC 4.0 requires explicit enablement of clocks103Value type: <prop_encoded-array>104Definition: A list of phandle and clock specifier pairs describing105the clocks required for enabling and disabling SEC 4.0.106107- clock-names108Usage: required if SEC 4.0 requires explicit enablement of clocks109Value type: <string>110Definition: A list of clock name strings in the same order as the111clocks property.112113Note: All other standard properties (see the Devicetree Specification)114are allowed but are optional.115116117EXAMPLE118119iMX6QDL/SX requires four clocks120121crypto@300000 {122compatible = "fsl,sec-v4.0";123fsl,sec-era = <2>;124#address-cells = <1>;125#size-cells = <1>;126reg = <0x300000 0x10000>;127ranges = <0 0x300000 0x10000>;128interrupt-parent = <&mpic>;129interrupts = <92 2>;130clocks = <&clks IMX6QDL_CLK_CAAM_MEM>,131<&clks IMX6QDL_CLK_CAAM_ACLK>,132<&clks IMX6QDL_CLK_CAAM_IPG>,133<&clks IMX6QDL_CLK_EIM_SLOW>;134clock-names = "mem", "aclk", "ipg", "emi_slow";135};136137138iMX6UL does only require three clocks139140crypto: crypto@2140000 {141compatible = "fsl,sec-v4.0";142#address-cells = <1>;143#size-cells = <1>;144reg = <0x2140000 0x3c000>;145ranges = <0 0x2140000 0x3c000>;146interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;147148clocks = <&clks IMX6UL_CLK_CAAM_MEM>,149<&clks IMX6UL_CLK_CAAM_ACLK>,150<&clks IMX6UL_CLK_CAAM_IPG>;151clock-names = "mem", "aclk", "ipg";152};153154=====================================================================155Job Ring (JR) Node156157Child of the crypto node defines data processing interface to SEC 4158across the peripheral bus for purposes of processing159cryptographic descriptors. The specified address160range can be made visible to one (or more) cores.161The interrupt defined for this node is controlled within162the address range of this node.163164- compatible165Usage: required166Value type: <string>167Definition: Must include "fsl,sec-v4.0-job-ring"168169- reg170Usage: required171Value type: <prop-encoded-array>172Definition: Specifies a two JR parameters: an offset from173the parent physical address and the length the JR registers.174175- fsl,liodn176Usage: optional-but-recommended177Value type: <prop-encoded-array>178Definition:179Specifies the LIODN to be used in conjunction with180the ppid-to-liodn table that specifies the PPID to LIODN mapping.181Needed if the PAMU is used. Value is a 12 bit value182where value is a LIODN ID for this JR. This property is183normally set by boot firmware.184185- interrupts186Usage: required187Value type: <prop_encoded-array>188Definition: Specifies the interrupts generated by this189device. The value of the interrupts property190consists of one interrupt specifier. The format191of the specifier is defined by the binding document192describing the node's interrupt parent.193194EXAMPLE195jr@1000 {196compatible = "fsl,sec-v4.0-job-ring";197reg = <0x1000 0x1000>;198fsl,liodn = <0x081>;199interrupt-parent = <&mpic>;200interrupts = <88 2>;201};202203204=====================================================================205Run Time Integrity Check (RTIC) Node206207Child node of the crypto node. Defines a register space that208contains up to 5 sets of addresses and their lengths (sizes) that209will be checked at run time. After an initial hash result is210calculated, these addresses are checked by HW to monitor any211change. If any memory is modified, a Security Violation is212triggered (see SNVS definition).213214215- compatible216Usage: required217Value type: <string>218Definition: Must include "fsl,sec-v4.0-rtic".219220- #address-cells221Usage: required222Value type: <u32>223Definition: A standard property. Defines the number of cells224for representing physical addresses in child nodes. Must225have a value of 1.226227- #size-cells228Usage: required229Value type: <u32>230Definition: A standard property. Defines the number of cells231for representing the size of physical addresses in232child nodes. Must have a value of 1.233234- reg235Usage: required236Value type: <prop-encoded-array>237Definition: A standard property. Specifies a two parameters:238an offset from the parent physical address and the length239the SEC4 registers.240241- ranges242Usage: required243Value type: <prop-encoded-array>244Definition: A standard property. Specifies the physical address245range of the SEC 4 register space (-SNVS not included). A246triplet that includes the child address, parent address, &247length.248249EXAMPLE250rtic@6000 {251compatible = "fsl,sec-v4.0-rtic";252#address-cells = <1>;253#size-cells = <1>;254reg = <0x6000 0x100>;255ranges = <0x0 0x6100 0xe00>;256};257258=====================================================================259Run Time Integrity Check (RTIC) Memory Node260A child node that defines individual RTIC memory regions that are used to261perform run-time integrity check of memory areas that should not modified.262The node defines a register that contains the memory address &263length (combined) and a second register that contains the hash result264in big endian format.265266- compatible267Usage: required268Value type: <string>269Definition: Must include "fsl,sec-v4.0-rtic-memory".270271- reg272Usage: required273Value type: <prop-encoded-array>274Definition: A standard property. Specifies two parameters:275an offset from the parent physical address and the length:2762771. The location of the RTIC memory address & length registers.2782. The location RTIC hash result.279280- fsl,rtic-region281Usage: optional-but-recommended282Value type: <prop-encoded-array>283Definition:284Specifies the HW address (36 bit address) for this region285followed by the length of the HW partition to be checked;286the address is represented as a 64 bit quantity followed287by a 32 bit length.288289- fsl,liodn290Usage: optional-but-recommended291Value type: <prop-encoded-array>292Definition:293Specifies the LIODN to be used in conjunction with294the ppid-to-liodn table that specifies the PPID to LIODN295mapping. Needed if the PAMU is used. Value is a 12 bit value296where value is a LIODN ID for this RTIC memory region. This297property is normally set by boot firmware.298299EXAMPLE300rtic-a@0 {301compatible = "fsl,sec-v4.0-rtic-memory";302reg = <0x00 0x20 0x100 0x80>;303fsl,liodn = <0x03c>;304fsl,rtic-region = <0x12345678 0x12345678 0x12345678>;305};306307=====================================================================308Secure Non-Volatile Storage (SNVS) Node309310Node defines address range and the associated311interrupt for the SNVS function. This function312monitors security state information & reports313security violations. This also included rtc,314system power off and ON/OFF key.315316- compatible317Usage: required318Value type: <string>319Definition: Must include "fsl,sec-v4.0-mon" and "syscon".320321- reg322Usage: required323Value type: <prop-encoded-array>324Definition: A standard property. Specifies the physical325address and length of the SEC4 configuration326registers.327328- #address-cells329Usage: required330Value type: <u32>331Definition: A standard property. Defines the number of cells332for representing physical addresses in child nodes. Must333have a value of 1.334335- #size-cells336Usage: required337Value type: <u32>338Definition: A standard property. Defines the number of cells339for representing the size of physical addresses in340child nodes. Must have a value of 1.341342- ranges343Usage: required344Value type: <prop-encoded-array>345Definition: A standard property. Specifies the physical address346range of the SNVS register space. A triplet that includes347the child address, parent address, & length.348349- interrupts350Usage: optional351Value type: <prop_encoded-array>352Definition: Specifies the interrupts generated by this353device. The value of the interrupts property354consists of one interrupt specifier. The format355of the specifier is defined by the binding document356describing the node's interrupt parent.357358EXAMPLE359sec_mon@314000 {360compatible = "fsl,sec-v4.0-mon", "syscon";361reg = <0x314000 0x1000>;362ranges = <0 0x314000 0x1000>;363interrupt-parent = <&mpic>;364interrupts = <93 2>;365};366367=====================================================================368Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node369370A SNVS child node that defines SNVS LP RTC.371372- compatible373Usage: required374Value type: <string>375Definition: Must include "fsl,sec-v4.0-mon-rtc-lp".376377- interrupts378Usage: required379Value type: <prop_encoded-array>380Definition: Specifies the interrupts generated by this381device. The value of the interrupts property382consists of one interrupt specifier. The format383of the specifier is defined by the binding document384describing the node's interrupt parent.385386- regmap387Usage: required388Value type: <phandle>389Definition: this is phandle to the register map node.390391- offset392Usage: option393value type: <u32>394Definition: LP register offset. default it is 0x34.395396- clocks397Usage: optional, required if SNVS LP RTC requires explicit398enablement of clocks399Value type: <prop_encoded-array>400Definition: a clock specifier describing the clock required for401enabling and disabling SNVS LP RTC.402403- clock-names404Usage: optional, required if SNVS LP RTC requires explicit405enablement of clocks406Value type: <string>407Definition: clock name string should be "snvs-rtc".408409EXAMPLE410sec_mon_rtc_lp@1 {411compatible = "fsl,sec-v4.0-mon-rtc-lp";412interrupts = <93 2>;413regmap = <&snvs>;414offset = <0x34>;415clocks = <&clks IMX7D_SNVS_CLK>;416clock-names = "snvs-rtc";417};418419=====================================================================420System ON/OFF key driver421422The snvs-pwrkey is designed to enable POWER key function which controlled423by SNVS ONOFF, the driver can report the status of POWER key and wakeup424system if pressed after system suspend.425426- compatible:427Usage: required428Value type: <string>429Definition: Mush include "fsl,sec-v4.0-pwrkey".430431- interrupts:432Usage: required433Value type: <prop_encoded-array>434Definition: The SNVS ON/OFF interrupt number to the CPU(s).435436- linux,keycode:437Usage: option438Value type: <int>439Definition: Keycode to emit, KEY_POWER by default.440441- wakeup-source:442Usage: option443Value type: <boo>444Definition: Button can wake-up the system.445446- regmap:447Usage: required:448Value type: <phandle>449Definition: this is phandle to the register map node.450451EXAMPLE:452snvs-pwrkey@020cc000 {453compatible = "fsl,sec-v4.0-pwrkey";454regmap = <&snvs>;455interrupts = <0 4 0x4>456linux,keycode = <116>; /* KEY_POWER */457wakeup-source;458};459460=====================================================================461FULL EXAMPLE462463crypto: crypto@300000 {464compatible = "fsl,sec-v4.0";465#address-cells = <1>;466#size-cells = <1>;467reg = <0x300000 0x10000>;468ranges = <0 0x300000 0x10000>;469interrupt-parent = <&mpic>;470interrupts = <92 2>;471472sec_jr0: jr@1000 {473compatible = "fsl,sec-v4.0-job-ring";474reg = <0x1000 0x1000>;475interrupt-parent = <&mpic>;476interrupts = <88 2>;477};478479sec_jr1: jr@2000 {480compatible = "fsl,sec-v4.0-job-ring";481reg = <0x2000 0x1000>;482interrupt-parent = <&mpic>;483interrupts = <89 2>;484};485486sec_jr2: jr@3000 {487compatible = "fsl,sec-v4.0-job-ring";488reg = <0x3000 0x1000>;489interrupt-parent = <&mpic>;490interrupts = <90 2>;491};492493sec_jr3: jr@4000 {494compatible = "fsl,sec-v4.0-job-ring";495reg = <0x4000 0x1000>;496interrupt-parent = <&mpic>;497interrupts = <91 2>;498};499500rtic@6000 {501compatible = "fsl,sec-v4.0-rtic";502#address-cells = <1>;503#size-cells = <1>;504reg = <0x6000 0x100>;505ranges = <0x0 0x6100 0xe00>;506507rtic_a: rtic-a@0 {508compatible = "fsl,sec-v4.0-rtic-memory";509reg = <0x00 0x20 0x100 0x80>;510};511512rtic_b: rtic-b@20 {513compatible = "fsl,sec-v4.0-rtic-memory";514reg = <0x20 0x20 0x200 0x80>;515};516517rtic_c: rtic-c@40 {518compatible = "fsl,sec-v4.0-rtic-memory";519reg = <0x40 0x20 0x300 0x80>;520};521522rtic_d: rtic-d@60 {523compatible = "fsl,sec-v4.0-rtic-memory";524reg = <0x60 0x20 0x500 0x80>;525};526};527};528529sec_mon: sec_mon@314000 {530compatible = "fsl,sec-v4.0-mon";531reg = <0x314000 0x1000>;532ranges = <0 0x314000 0x1000>;533534sec_mon_rtc_lp@34 {535compatible = "fsl,sec-v4.0-mon-rtc-lp";536regmap = <&sec_mon>;537offset = <0x34>;538interrupts = <93 2>;539clocks = <&clks IMX7D_SNVS_CLK>;540clock-names = "snvs-rtc";541};542543snvs-pwrkey@020cc000 {544compatible = "fsl,sec-v4.0-pwrkey";545regmap = <&sec_mon>;546interrupts = <0 4 0x4>;547linux,keycode = <116>; /* KEY_POWER */548wakeup-source;549};550};551552=====================================================================553554555