MLK-10958 imx: mx6ul support Bus Encryption Engine
authorYe Li <ye.li@nxp.com>
Fri, 23 Mar 2018 08:14:13 +0000 (01:14 -0700)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 11:28:23 +0000 (04:28 -0700)
commitcd03ba8327d46178900a63310d5ef3edd8034350
tree634f3b7290a67b6609200e15d430e6cbd37b7339
parent0e2de4c2d5d2c79e485d164394f03065743ba2c4
MLK-10958 imx: mx6ul support Bus Encryption Engine

This patch is to support Bus Encryption Engine(BEE) for i.MX 6UL.
Supported feature:
1. SNVS key and soft key
2. CTR and ECB mode
3. Specify address region to bee.

Two commands are included:
bee init [key] [mode] [start] [end] - BEE block initial
    "Example: bee init 1 1 0x80000000 0x80010000\n"
bee test [region]
    "Example: bee test 1\n"

Mapping:
[0x10000000 - (0x10000000 + size - 1)] : [start - (start + size - 1)]
[0x30000000 - (0x30000000 + IRAM_SIZE - 1)] : [IRAM_BASE_ADDR -
(IRAM_BASE_ADDR + IRAM_SIZE - 1)]

Whatever start is, start - (start + size -1) will be fixed mapping to
0x10000000 - (0x10000000 + size - 1)

Since default AES region's protected size is SZ_512M, so
on mx6ul evk board, you can not simply run 'bee init', it will
overlap with uboot execution environment, you can use
'bee init 0 0 0x80000000 0x81000000'.

If want to use bee, Need to define CONFIG_CMD_BEE in board configuration
header file, since CONFIG_CMD_BEE default is not enabled.

This patch also checks fuse bit 25 of bank 0 word 4 before initialize bee.
The bit: 0 means bee enabled, 1 means bee disabled.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 9d592121bebbdb9ded0009a2703c7cab01edfa70)
arch/arm/include/asm/arch-mx6/mx6_bee.h [new file with mode: 0644]
arch/arm/mach-imx/mx6/Kconfig
arch/arm/mach-imx/mx6/Makefile
arch/arm/mach-imx/mx6/bee.c [new file with mode: 0644]