diff options
author | Julius Werner <jwerner@chromium.org> | 2015-02-19 14:51:15 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-21 08:22:28 +0200 |
commit | 2f37bd65518865688b9234afce0d467508d6f465 (patch) | |
tree | eba5ed799de966299602b30c70d51dd40eaadd73 /src/soc/rockchip/rk3288/crypto.c | |
parent | 1f60f971fc89ef841e81b978964b38278d597b1d (diff) | |
download | coreboot-2f37bd65518865688b9234afce0d467508d6f465.tar.xz |
arm(64): Globally replace writel(v, a) with write32(a, v)
This patch is a raw application of the following spatch to src/:
@@
expression A, V;
@@
- writel(V, A)
+ write32(A, V)
@@
expression A, V;
@@
- writew(V, A)
+ write16(A, V)
@@
expression A, V;
@@
- writeb(V, A)
+ write8(A, V)
@@
expression A;
@@
- readl(A)
+ read32(A)
@@
expression A;
@@
- readb(A)
+ read8(A)
BRANCH=none
BUG=chromium:444723
TEST=None (depends on next patch)
Change-Id: I5dd96490c85ee2bcbc669f08bc6fff0ecc0f9e27
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 64f643da95d85954c4d4ea91c34a5c69b9b08eb6
Original-Change-Id: I366a2eb5b3a0df2279ebcce572fe814894791c42
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/254864
Reviewed-on: http://review.coreboot.org/9836
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/rockchip/rk3288/crypto.c')
-rw-r--r-- | src/soc/rockchip/rk3288/crypto.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/soc/rockchip/rk3288/crypto.c b/src/soc/rockchip/rk3288/crypto.c index 20fd60a474..e57d1560e7 100644 --- a/src/soc/rockchip/rk3288/crypto.c +++ b/src/soc/rockchip/rk3288/crypto.c @@ -80,17 +80,17 @@ int vb2ex_hwcrypto_digest_init(enum vb2_hash_algorithm hash_alg, return VB2_ERROR_EX_HWCRYPTO_UNSUPPORTED; } - writel(RK_SETBITS(1 << 6), &crypto->ctrl); /* Assert HASH_FLUSH */ + write32(&crypto->ctrl, RK_SETBITS(1 << 6)); /* Assert HASH_FLUSH */ udelay(1); /* for 10+ cycles to */ - writel(RK_CLRBITS(1 << 6), &crypto->ctrl); /* clear out old hash */ + write32(&crypto->ctrl, RK_CLRBITS(1 << 6)); /* clear out old hash */ /* Enable DMA byte swapping for little-endian bus (Byteswap_??FIFO) */ - writel(1 << 5 | 1 << 4 | 1 << 3, &crypto->conf); + write32(&crypto->conf, 1 << 5 | 1 << 4 | 1 << 3); - writel(HRDMA_ERR | HRDMA_DONE, &crypto->intena); /* enable interrupt */ + write32(&crypto->intena, HRDMA_ERR | HRDMA_DONE); /* enable interrupt */ - writel(data_size, &crypto->hash_msg_len); /* program total size */ - writel(1 << 3 | 0x2, &crypto->hash_ctrl); /* swap DOUT, SHA256 */ + write32(&crypto->hash_msg_len, data_size); /* program total size */ + write32(&crypto->hash_ctrl, 1 << 3 | 0x2); /* swap DOUT, SHA256 */ printk(BIOS_DEBUG, "Initialized RK3288 HW crypto for %u byte SHA256\n", data_size); @@ -101,12 +101,12 @@ int vb2ex_hwcrypto_digest_extend(const uint8_t *buf, uint32_t size) { uint32_t intsts; - writel(HRDMA_ERR | HRDMA_DONE, &crypto->intsts); /* clear interrupts */ + write32(&crypto->intsts, HRDMA_ERR | HRDMA_DONE); /* clear interrupts */ /* NOTE: This assumes that the DMA is reading from uncached SRAM. */ - writel((uint32_t)buf, &crypto->hrdmas); - writel(size / sizeof(uint32_t), &crypto->hrdmal); - writel(RK_SETBITS(1 << 3), &crypto->ctrl); /* Set HASH_START */ + write32(&crypto->hrdmas, (uint32_t)buf); + write32(&crypto->hrdmal, size / sizeof(uint32_t)); + write32(&crypto->ctrl, RK_SETBITS(1 << 3)); /* Set HASH_START */ do { intsts = read32(&crypto->intsts); if (intsts & HRDMA_ERR) { |