u-boot/drivers
Bryan O'Donoghue 22191ac353 drivers/crypto/fsl: assign job-rings to non-TrustZone
After enabling TrustZone various parts of the CAAM silicon become
inaccessible to non TrustZone contexts. The job-ring registers are designed
to allow non TrustZone contexts like Linux to still submit jobs to CAAM
even after TrustZone has been enabled.

The default job-ring permissions after the BootROM look like this for
job-ring zero.

ms=0x00008001 ls=0x00008001

The MS field is JRaMIDR_MS (job ring MID most significant).

Referring to "Security Reference Manual for i.MX 7Dual and 7Solo
Applications Processors, Rev. 0, 03/2017" section 8.10.4 we see that
JROWN_NS controls whether or not a job-ring is accessible from non
TrustZone.

Bit 15 (TrustZone) is the logical inverse of bit 3 hence the above value of
0x8001 shows that JROWN_NS=0 and TrustZone=1.

Clearly then as soon as TrustZone becomes active the job-ring registers are
no longer accessible from Linux, which is not what we want.

This patch explicitly sets all job-ring registers to JROWN_NS=1 (non
TrustZone) by default and to the Non-Secure MID 001. Both settings are
required to successfully assign a job-ring to non-secure mode. If a piece
of TrustZone firmware requires ownership of job-ring registers it can unset
the JROWN_NS bit itself.

This patch in conjunction with a modification of the Linux kernel to skip
HWRNG initialisation makes CAAM usable to Linux with TrustZone enabled.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Alex Porosanu <alexandru.porosanu@nxp.com>
Cc: Ruchika Gupta <ruchika.gupta@nxp.com>
Cc: Aneesh Bansal <aneesh.bansal@nxp.com>
Link: https://github.com/OP-TEE/optee_os/issues/1408
Link: https://tinyurl.com/yam5gv9a
Tested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2018-02-04 12:14:11 +01:00
..
adc treewide: replace with error() with pr_err() 2017-10-04 11:59:44 -04:00
ata ata: Migrate CONFIG_MVSATA_IDE to Kconfig 2017-12-12 18:16:06 -05:00
bios_emulator printk: collect printk stuff into <linux/printk.h> with loglevel support 2017-10-04 10:31:17 -04:00
block efi_driver: EFI block driver 2018-01-22 23:09:14 +01:00
bootcount bootcount: add support for bootcounter on EXT filesystem 2017-11-20 09:58:31 +01:00
clk clk: clk_stm32: Add .set_rate callback 2018-01-29 12:48:33 -05:00
core clk: implement clk_set_defaults() 2018-01-28 17:12:36 +01:00
cpu dm: cpu: bmips: add BCM6318 support 2018-01-26 12:38:13 +01:00
crypto drivers/crypto/fsl: assign job-rings to non-TrustZone 2018-02-04 12:14:11 +01:00
ddr drivers/ddr/fsl: Cleanup unused variable 2018-01-30 09:14:07 -08:00
demo dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
dfu dfu: select HASH 2018-01-26 20:02:33 +05:30
dma drivers: dma: ti-edma3: add support for memory fill 2018-01-19 15:49:25 -05:00
firmware drivers: firmware: psci: use pr_* log functions instead of printf() 2017-12-04 10:23:53 -05:00
fpga wait_bit: use wait_for_bit_le32 and remove wait_for_bit 2018-01-24 12:03:43 +05:30
gpio gpio: mxc: add i.MX8M support 2018-02-04 12:00:58 +01:00
i2c Convert CONFIG_SYS_OMAP24_I2C_SLAVE et al to Kconfig 2018-01-30 14:59:32 -05:00
input env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
led dm: core: Update device_bind_driver_to_node() to use ofnode 2017-06-01 07:03:08 -06:00
mailbox dm: mailbox: Update uclass to support livetree 2017-06-01 07:03:15 -06:00
memory memory: Move TI_AEMIF config to KCONFIG 2016-04-18 17:11:43 -04:00
misc misc: ocotp: add i.MX8M support 2018-02-04 12:00:58 +01:00
mmc mmc: fsl_esdhc: support SDR104 and HS200 2018-02-04 12:00:58 +01:00
mtd Xilinx changes for v2018.03 2018-01-31 07:10:55 -05:00
net net: e1000: implement eth_write_hwaddr 2018-02-04 12:00:58 +01:00
nvme nvme: Remove dead codes in nvme_setup_io_queues() 2017-09-03 15:30:34 -04:00
pch dm: Use dm_scan_fdt_dev() directly where possible 2016-07-27 14:15:54 -06:00
pci pci: rmobile: Add RCar Gen2 PCIe controller driver 2018-01-27 20:38:53 +01:00
pcmcia Kconfig; Drop CONFIG_IDE_TI_CARDBUS and associated driver 2017-08-11 15:41:51 -04:00
phy sti: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
pinctrl Merge git://git.denx.de/u-boot-rockchip 2018-01-28 13:56:19 -05:00
power power: pmic/regulator allow dm be omitted by SPL 2018-02-04 12:00:58 +01:00
pwm pwm: imx: Enable PWM support on i.MX53 2017-11-20 09:58:31 +01:00
qe blk: Remove various places that do flush cache after read 2017-09-15 08:05:10 -04:00
ram dm: ram: bmips: add BCM6318 support 2018-01-26 12:38:13 +01:00
remoteproc dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
reset wait_bit: use wait_for_bit_le32 and remove wait_for_bit 2018-01-24 12:03:43 +05:30
rtc rtc: adding RX8010SJ rtc driver 2018-02-04 12:00:58 +01:00
scsi blk: dm: make blk_create_device() take a number of block instead of a size 2017-09-11 21:43:58 -06:00
serial serial: Make full device search optional 2018-01-29 08:18:02 -05:00
soc Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
sound dm: gpio: Add live tree support 2017-06-01 07:03:10 -06:00
spi Merge git://git.denx.de/u-boot-spi 2018-01-26 07:46:34 -05:00
spmi spmi: msm: display the PMIC Arb version (debug) 2018-01-15 11:35:37 -05:00
sysreset db410c: replace reset driver with psci 2018-01-15 16:29:03 -05:00
thermal thermal: ti-bandgap: Add support for temperature sensor 2017-11-21 08:03:38 -05:00
timer atcpit100: timer: Remove arch dependency. 2017-11-30 09:39:31 +08:00
tpm tpm: st33zp24: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
usb Kconfig: gadget: Move CONFIG_USB_FUNCTION_MASS_STORAGE to Kconfig 2018-02-02 07:13:48 -05:00
video Merge git://git.denx.de/u-boot-sunxi 2018-01-26 13:22:40 -05:00
watchdog wdt: Update uclass to make clear that the timeout is in ms 2017-08-13 15:17:34 -04:00
Kconfig bootcount: add support for bootcounter on EXT filesystem 2017-11-20 09:58:31 +01:00
Makefile thermal: ti-bandgap: Add support for temperature sensor 2017-11-21 08:03:38 -05:00