Commit c00e4c54 authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Shawn Guo

ARM: i.MX: system.c: Convert goto to if statement

Using goto here doesn't bring any advantages and only makes the code
flow less clear. No functional changes.
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent ead81266
...@@ -106,26 +106,24 @@ void __init imx_init_l2cache(void) ...@@ -106,26 +106,24 @@ void __init imx_init_l2cache(void)
goto out; goto out;
} }
if (readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN) if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
goto skip_if_enabled; /* Configure the L2 PREFETCH and POWER registers */
val = readl_relaxed(l2x0_base + L310_PREFETCH_CTRL);
/* Configure the L2 PREFETCH and POWER registers */ val |= 0x70800000;
val = readl_relaxed(l2x0_base + L310_PREFETCH_CTRL); /*
val |= 0x70800000; * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
/* * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
* The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0 * But according to ARM PL310 errata: 752271
* The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2 * ID: 752271: Double linefill feature can cause data corruption
* But according to ARM PL310 errata: 752271 * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2
* ID: 752271: Double linefill feature can cause data corruption * Workaround: The only workaround to this erratum is to disable the
* Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2 * double linefill feature. This is the default behavior.
* Workaround: The only workaround to this erratum is to disable the */
* double linefill feature. This is the default behavior. if (cpu_is_imx6q())
*/ val &= ~(1 << 30 | 1 << 23);
if (cpu_is_imx6q()) writel_relaxed(val, l2x0_base + L310_PREFETCH_CTRL);
val &= ~(1 << 30 | 1 << 23); }
writel_relaxed(val, l2x0_base + L310_PREFETCH_CTRL);
skip_if_enabled:
iounmap(l2x0_base); iounmap(l2x0_base);
of_node_put(np); of_node_put(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment