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
@@ -70,16 +70,16 @@ static int is_sram_locked(void)
|
||||
if (OMAP2_DEVICE_TYPE_GP == omap_type()) {
|
||||
/* RAMFW: R/W access to all initiators for all qualifier sets */
|
||||
if (cpu_is_omap242x()) {
|
||||
__raw_writel(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-vects */
|
||||
__raw_writel(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */
|
||||
__raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */
|
||||
writel_relaxed(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-vects */
|
||||
writel_relaxed(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */
|
||||
writel_relaxed(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */
|
||||
}
|
||||
if (cpu_is_omap34xx()) {
|
||||
__raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */
|
||||
__raw_writel(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */
|
||||
__raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */
|
||||
__raw_writel(0x0, OMAP34XX_VA_ADDR_MATCH2);
|
||||
__raw_writel(0xFFFFFFFF, OMAP34XX_VA_SMS_RG_ATT0);
|
||||
writel_relaxed(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */
|
||||
writel_relaxed(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */
|
||||
writel_relaxed(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */
|
||||
writel_relaxed(0x0, OMAP34XX_VA_ADDR_MATCH2);
|
||||
writel_relaxed(0xFFFFFFFF, OMAP34XX_VA_SMS_RG_ATT0);
|
||||
}
|
||||
return 0;
|
||||
} else
|
||||
|
Reference in New Issue
Block a user