ARM: OMAP2+: raw read and write endian fix
All OMAP IP blocks expect LE data, but CPU may operate in BE mode. Need to use endian neutral functions to read/write h/w registers. I.e instead of __raw_read[lw] and __raw_write[lw] functions code need to use read[lw]_relaxed and write[lw]_relaxed functions. If the first simply reads/writes register, the second will byteswap it if host operates in BE mode. Changes are trivial sed like replacement of __raw_xxx functions with xxx_relaxed variant. Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:

committed by
Tony Lindgren

parent
89ca3b8819
commit
edfaf05c2f
@@ -116,7 +116,7 @@ static inline void set_cpu_wakeup_addr(unsigned int cpu_id, u32 addr)
|
||||
{
|
||||
struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
|
||||
|
||||
__raw_writel(addr, pm_info->wkup_sar_addr);
|
||||
writel_relaxed(addr, pm_info->wkup_sar_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -141,7 +141,7 @@ static void scu_pwrst_prepare(unsigned int cpu_id, unsigned int cpu_state)
|
||||
break;
|
||||
}
|
||||
|
||||
__raw_writel(scu_pwr_st, pm_info->scu_sar_addr);
|
||||
writel_relaxed(scu_pwr_st, pm_info->scu_sar_addr);
|
||||
}
|
||||
|
||||
/* Helper functions for MPUSS OSWR */
|
||||
@@ -179,7 +179,7 @@ static void l2x0_pwrst_prepare(unsigned int cpu_id, unsigned int save_state)
|
||||
{
|
||||
struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
|
||||
|
||||
__raw_writel(save_state, pm_info->l2x0_sar_addr);
|
||||
writel_relaxed(save_state, pm_info->l2x0_sar_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -192,10 +192,10 @@ static void save_l2x0_context(void)
|
||||
u32 val;
|
||||
void __iomem *l2x0_base = omap4_get_l2cache_base();
|
||||
if (l2x0_base) {
|
||||
val = __raw_readl(l2x0_base + L2X0_AUX_CTRL);
|
||||
__raw_writel(val, sar_base + L2X0_AUXCTRL_OFFSET);
|
||||
val = __raw_readl(l2x0_base + L2X0_PREFETCH_CTRL);
|
||||
__raw_writel(val, sar_base + L2X0_PREFETCH_CTRL_OFFSET);
|
||||
val = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
|
||||
writel_relaxed(val, sar_base + L2X0_AUXCTRL_OFFSET);
|
||||
val = readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
|
||||
writel_relaxed(val, sar_base + L2X0_PREFETCH_CTRL_OFFSET);
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -386,9 +386,9 @@ int __init omap4_mpuss_init(void)
|
||||
|
||||
/* Save device type on scratchpad for low level code to use */
|
||||
if (omap_type() != OMAP2_DEVICE_TYPE_GP)
|
||||
__raw_writel(1, sar_base + OMAP_TYPE_OFFSET);
|
||||
writel_relaxed(1, sar_base + OMAP_TYPE_OFFSET);
|
||||
else
|
||||
__raw_writel(0, sar_base + OMAP_TYPE_OFFSET);
|
||||
writel_relaxed(0, sar_base + OMAP_TYPE_OFFSET);
|
||||
|
||||
save_l2x0_context();
|
||||
|
||||
|
Reference in New Issue
Block a user