diff options
-rw-r--r-- | arch/arm/mm/cache-l2x0.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 1c947b4c7f05..5f381af1a7a4 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -784,14 +784,22 @@ static void aurora_resume(void) | |||
784 | } | 784 | } |
785 | } | 785 | } |
786 | 786 | ||
787 | static void __init aurora_broadcast_l2_commands(void) | 787 | /* |
788 | * For Aurora cache in no outer mode, enable via the CP15 coprocessor | ||
789 | * broadcasting of cache commands to L2. | ||
790 | */ | ||
791 | static void __init aurora_enable_no_outer(void __iomem *base, u32 aux, | ||
792 | unsigned num_lock) | ||
788 | { | 793 | { |
789 | __u32 u; | 794 | u32 u; |
790 | /* Enable Broadcasting of cache commands to L2*/ | 795 | |
791 | __asm__ __volatile__("mrc p15, 1, %0, c15, c2, 0" : "=r"(u)); | 796 | asm volatile("mrc p15, 1, %0, c15, c2, 0" : "=r" (u)); |
792 | u |= AURORA_CTRL_FW; /* Set the FW bit */ | 797 | u |= AURORA_CTRL_FW; /* Set the FW bit */ |
793 | __asm__ __volatile__("mcr p15, 1, %0, c15, c2, 0\n" : : "r"(u)); | 798 | asm volatile("mcr p15, 1, %0, c15, c2, 0" : : "r" (u)); |
799 | |||
794 | isb(); | 800 | isb(); |
801 | |||
802 | l2c_enable(base, aux, num_lock); | ||
795 | } | 803 | } |
796 | 804 | ||
797 | static void __init aurora_of_parse(const struct device_node *np, | 805 | static void __init aurora_of_parse(const struct device_node *np, |
@@ -835,7 +843,7 @@ static const struct l2c_init_data of_aurora_with_outer_data __initconst = { | |||
835 | static const struct l2c_init_data of_aurora_no_outer_data __initconst = { | 843 | static const struct l2c_init_data of_aurora_no_outer_data __initconst = { |
836 | .num_lock = 4, | 844 | .num_lock = 4, |
837 | .of_parse = aurora_of_parse, | 845 | .of_parse = aurora_of_parse, |
838 | .enable = l2c_enable, | 846 | .enable = aurora_enable_no_outer, |
839 | .save = aurora_save, | 847 | .save = aurora_save, |
840 | .outer_cache = { | 848 | .outer_cache = { |
841 | .resume = aurora_resume, | 849 | .resume = aurora_resume, |
@@ -1066,16 +1074,10 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) | |||
1066 | data = of_match_node(l2x0_ids, np)->data; | 1074 | data = of_match_node(l2x0_ids, np)->data; |
1067 | 1075 | ||
1068 | /* L2 configuration can only be changed if the cache is disabled */ | 1076 | /* L2 configuration can only be changed if the cache is disabled */ |
1069 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { | 1077 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) |
1070 | if (data->of_parse) | 1078 | if (data->of_parse) |
1071 | data->of_parse(np, &aux_val, &aux_mask); | 1079 | data->of_parse(np, &aux_val, &aux_mask); |
1072 | 1080 | ||
1073 | /* For aurora cache in no outer mode select the | ||
1074 | * correct mode using the coprocessor*/ | ||
1075 | if (data == &of_aurora_no_outer_data) | ||
1076 | aurora_broadcast_l2_commands(); | ||
1077 | } | ||
1078 | |||
1079 | if (cache_id_part_number_from_dt) | 1081 | if (cache_id_part_number_from_dt) |
1080 | cache_id = cache_id_part_number_from_dt; | 1082 | cache_id = cache_id_part_number_from_dt; |
1081 | else | 1083 | else |