summaryrefslogtreecommitdiff
path: root/src/drivers/pc80/tpm
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2015-02-19 14:51:15 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-04-21 08:22:28 +0200
commit2f37bd65518865688b9234afce0d467508d6f465 (patch)
treeeba5ed799de966299602b30c70d51dd40eaadd73 /src/drivers/pc80/tpm
parent1f60f971fc89ef841e81b978964b38278d597b1d (diff)
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/drivers/pc80/tpm')
-rw-r--r--src/drivers/pc80/tpm/tpm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/drivers/pc80/tpm/tpm.c b/src/drivers/pc80/tpm/tpm.c
index 68758aa7eb..012f61dbed 100644
--- a/src/drivers/pc80/tpm/tpm.c
+++ b/src/drivers/pc80/tpm/tpm.c
@@ -160,7 +160,7 @@ static u32 vendor_dev_id CAR_GLOBAL;
static inline u8 tpm_read_status(int locality)
{
- u8 value = readb(TIS_REG(locality, TIS_REG_STS));
+ u8 value = read8(TIS_REG(locality, TIS_REG_STS));
TPM_DEBUG_IO_READ(TIS_REG_STS, value);
return value;
}
@@ -168,12 +168,12 @@ static inline u8 tpm_read_status(int locality)
static inline void tpm_write_status(u8 sts, int locality)
{
TPM_DEBUG_IO_WRITE(TIS_REG_STS, sts);
- writeb(sts, TIS_REG(locality, TIS_REG_STS));
+ write8(TIS_REG(locality, TIS_REG_STS), sts);
}
static inline u8 tpm_read_data(int locality)
{
- u8 value = readb(TIS_REG(locality, TIS_REG_DATA_FIFO));
+ u8 value = read8(TIS_REG(locality, TIS_REG_DATA_FIFO));
TPM_DEBUG_IO_READ(TIS_REG_DATA_FIFO, value);
return value;
}
@@ -181,21 +181,21 @@ static inline u8 tpm_read_data(int locality)
static inline void tpm_write_data(u8 data, int locality)
{
TPM_DEBUG_IO_WRITE(TIS_REG_STS, data);
- writeb(data, TIS_REG(locality, TIS_REG_DATA_FIFO));
+ write8(TIS_REG(locality, TIS_REG_DATA_FIFO), data);
}
static inline u16 tpm_read_burst_count(int locality)
{
u16 count;
- count = readb(TIS_REG(locality, TIS_REG_BURST_COUNT));
- count |= readb(TIS_REG(locality, TIS_REG_BURST_COUNT + 1)) << 8;
+ count = read8(TIS_REG(locality, TIS_REG_BURST_COUNT));
+ count |= read8(TIS_REG(locality, TIS_REG_BURST_COUNT + 1)) << 8;
TPM_DEBUG_IO_READ(TIS_REG_BURST_COUNT, count);
return count;
}
static inline u8 tpm_read_access(int locality)
{
- u8 value = readb(TIS_REG(locality, TIS_REG_ACCESS));
+ u8 value = read8(TIS_REG(locality, TIS_REG_ACCESS));
TPM_DEBUG_IO_READ(TIS_REG_ACCESS, value);
return value;
}
@@ -203,12 +203,12 @@ static inline u8 tpm_read_access(int locality)
static inline void tpm_write_access(u8 data, int locality)
{
TPM_DEBUG_IO_WRITE(TIS_REG_ACCESS, data);
- writeb(data, TIS_REG(locality, TIS_REG_ACCESS));
+ write8(TIS_REG(locality, TIS_REG_ACCESS), data);
}
static inline u32 tpm_read_did_vid(int locality)
{
- u32 value = readl(TIS_REG(locality, TIS_REG_DID_VID));
+ u32 value = read32(TIS_REG(locality, TIS_REG_DID_VID));
TPM_DEBUG_IO_READ(TIS_REG_DID_VID, value);
return value;
}
@@ -216,7 +216,7 @@ static inline u32 tpm_read_did_vid(int locality)
static inline void tpm_write_int_vector(int vector, int locality)
{
TPM_DEBUG_IO_WRITE(TIS_REG_INT_VECTOR, vector);
- writeb(vector & 0xf, TIS_REG(locality, TIS_REG_INT_VECTOR));
+ write8(TIS_REG(locality, TIS_REG_INT_VECTOR), vector & 0xf);
}
static inline void tpm_write_int_polarity(int polarity, int locality)
@@ -224,7 +224,7 @@ static inline void tpm_write_int_polarity(int polarity, int locality)
/* Set polarity and leave all other bits at 0 */
u32 value = (polarity & 0x3) << 3;
TPM_DEBUG_IO_WRITE(TIS_REG_INT_ENABLE, value);
- writel(value, TIS_REG(locality, TIS_REG_INT_ENABLE));
+ write32(TIS_REG(locality, TIS_REG_INT_ENABLE), value);
}
/*