Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358834
b: refs/heads/master
c: fe1229b
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel committed Feb 5, 2013
1 parent 7fe2082 commit c6011ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a6870e928d1b2a97d95e7bf1aaefd3da34b83a85
refs/heads/master: fe1229b968e1bd391ce7a89bff51aed10d02b578
35 changes: 18 additions & 17 deletions trunk/drivers/iommu/tegra-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,36 +327,37 @@ static struct smmu_device *smmu_handle; /* unique for a system */
/*
* SMMU register accessors
*/
static inline u32 smmu_read(struct smmu_device *smmu, size_t offs)
static bool inline smmu_valid_reg(struct smmu_device *smmu,
void __iomem *addr)
{
int i;

for (i = 0; i < smmu->nregs; i++) {
void __iomem *addr = smmu->regbase + offs;

BUG_ON(addr < smmu->regs[i]);
if (addr < smmu->regs[i])
break;
if (addr <= smmu->rege[i])
return readl(addr);
return true;
}

BUG();
return false;
}

static inline void smmu_write(struct smmu_device *smmu, u32 val, size_t offs)
static inline u32 smmu_read(struct smmu_device *smmu, size_t offs)
{
int i;
void __iomem *addr = smmu->regbase + offs;

for (i = 0; i < smmu->nregs; i++) {
void __iomem *addr = smmu->regbase + offs;
BUG_ON(!smmu_valid_reg(smmu, addr));

BUG_ON(addr < smmu->regs[i]);
if (addr <= smmu->rege[i]) {
writel(val, addr);
return;
}
}
return readl(addr);
}

static inline void smmu_write(struct smmu_device *smmu, u32 val, size_t offs)
{
void __iomem *addr = smmu->regbase + offs;

BUG_ON(!smmu_valid_reg(smmu, addr));

BUG();
writel(val, addr);
}

#define VA_PAGE_TO_PA(va, page) \
Expand Down

0 comments on commit c6011ec

Please sign in to comment.