Skip to content

Commit

Permalink
follow up
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Tyshchenko <[email protected]>
  • Loading branch information
Oleksandr Tyshchenko committed Feb 28, 2018
1 parent 41dcdee commit 55491c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions xen/drivers/passthrough/arm/ipmmu-vmsa-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ static int __init rcar_sysc_init(void)
u32 syscier, syscimr;
int i;

/*
* As this function might be called more then once, just return if we
* have already initialized sysc.
*/
if (rcar_sysc_base)
return 0;

Expand Down Expand Up @@ -135,8 +139,6 @@ static bool __init rcar_sysc_power_is_off(const struct rcar_sysc_ch *sysc_ch)
{
unsigned int status;

rcar_sysc_init();

status = readl(rcar_sysc_base + sysc_ch->chan_offs + PWRSR_OFFS);
if (status & BIT(sysc_ch->chan_bit))
return true;
Expand All @@ -149,8 +151,6 @@ static int __init rcar_sysc_power_on(const struct rcar_sysc_ch *sysc_ch)
unsigned int status;
int ret = 0, i, j;

rcar_sysc_init();

writel(BIT(sysc_ch->isr_bit), rcar_sysc_base + SYSCISCR);

/* Submit power resume request until it was accepted */
Expand Down Expand Up @@ -219,6 +219,8 @@ static int __init ipmmu_power_on(struct dt_device_node *np)
if (pd < 0 || pd == RCAR_GEN3_PD_ALWAYS_ON)
return 0;

rcar_sysc_init();

for (i = 0; i < ARRAY_SIZE(rcar_sysc_chs); i++) {
if (rcar_sysc_chs[i].isr_bit != pd)
continue;
Expand Down
4 changes: 3 additions & 1 deletion xen/drivers/passthrough/arm/ipmmu-vmsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ static void set_archdata(struct device *dev, struct ipmmu_vmsa_archdata *p)
#define IMUASID_ASID0_SHIFT 0

#define IMSCTLR 0x0500
#define IMSCTLR_DISCACHE 0xE0000000


#ifdef CONFIG_RCAR_DDR_BACKUP
#define HW_REGISTER_BACKUP_SIZE ARRAY_SIZE(root_pgtable0_reg)
Expand Down Expand Up @@ -1155,7 +1157,7 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain,
*/
if (domain->mmus[0]->is_mmu_tlb_disabled)
ipmmu_ctx_write1(domain, IMSCTLR,
ipmmu_ctx_read(domain, IMSCTLR) | 0xE0000000);
ipmmu_ctx_read(domain, IMSCTLR) | IMSCTLR_DISCACHE);

ipmmu_ctx_write1(domain, IMCTR,
ipmmu_ctx_read(domain, IMCTR) | IMCTR_FLUSH);
Expand Down

0 comments on commit 55491c5

Please sign in to comment.