072-ARM-l2c-clean-up-l2c_configure.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. From 50beefde30224888d6d63224405ace4bdd4b32a0 Mon Sep 17 00:00:00 2001
  2. From: Russell King <rmk+kernel@arm.linux.org.uk>
  3. Date: Fri, 15 May 2015 11:05:54 +0100
  4. Subject: [PATCH 72/74] ARM: l2c: clean up l2c_configure()
  5. l2c_configure() does not follow the pattern of other l2c_* functions.
  6. Fix this so that it does to avoid future confusion.
  7. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  8. ---
  9. arch/arm/mm/cache-l2x0.c | 23 ++++++++++++++---------
  10. 1 file changed, 14 insertions(+), 9 deletions(-)
  11. --- a/arch/arm/mm/cache-l2x0.c
  12. +++ b/arch/arm/mm/cache-l2x0.c
  13. @@ -110,15 +110,7 @@ static inline void l2c_unlock(void __iom
  14. static void l2c_configure(void __iomem *base)
  15. {
  16. - if (outer_cache.configure) {
  17. - outer_cache.configure(&l2x0_saved_regs);
  18. - return;
  19. - }
  20. -
  21. l2c_write_sec(l2x0_saved_regs.aux_ctrl, base, L2X0_AUX_CTRL);
  22. -
  23. - if (l2x0_data->configure)
  24. - l2x0_data->configure(base);
  25. }
  26. /*
  27. @@ -130,7 +122,11 @@ static void l2c_enable(void __iomem *bas
  28. unsigned long flags;
  29. l2x0_saved_regs.aux_ctrl = aux;
  30. - l2c_configure(base);
  31. +
  32. + if (outer_cache.configure)
  33. + outer_cache.configure(&l2x0_saved_regs);
  34. + else
  35. + l2x0_data->configure(base);
  36. l2c_unlock(base, num_lock);
  37. @@ -252,6 +248,7 @@ static const struct l2c_init_data l2c210
  38. .num_lock = 1,
  39. .enable = l2c_enable,
  40. .save = l2c_save,
  41. + .configure = l2c_configure,
  42. .outer_cache = {
  43. .inv_range = l2c210_inv_range,
  44. .clean_range = l2c210_clean_range,
  45. @@ -409,6 +406,7 @@ static const struct l2c_init_data l2c220
  46. .num_lock = 1,
  47. .enable = l2c220_enable,
  48. .save = l2c_save,
  49. + .configure = l2c_configure,
  50. .outer_cache = {
  51. .inv_range = l2c220_inv_range,
  52. .clean_range = l2c220_clean_range,
  53. @@ -569,6 +567,8 @@ static void l2c310_configure(void __iome
  54. {
  55. unsigned revision;
  56. + l2c_configure(base);
  57. +
  58. /* restore pl310 setup */
  59. l2c_write_sec(l2x0_saved_regs.tag_latency, base,
  60. L310_TAG_LATENCY_CTRL);
  61. @@ -1066,6 +1066,7 @@ static const struct l2c_init_data of_l2c
  62. .of_parse = l2x0_of_parse,
  63. .enable = l2c_enable,
  64. .save = l2c_save,
  65. + .configure = l2c_configure,
  66. .outer_cache = {
  67. .inv_range = l2c210_inv_range,
  68. .clean_range = l2c210_clean_range,
  69. @@ -1084,6 +1085,7 @@ static const struct l2c_init_data of_l2c
  70. .of_parse = l2x0_of_parse,
  71. .enable = l2c220_enable,
  72. .save = l2c_save,
  73. + .configure = l2c_configure,
  74. .outer_cache = {
  75. .inv_range = l2c220_inv_range,
  76. .clean_range = l2c220_clean_range,
  77. @@ -1416,6 +1418,7 @@ static const struct l2c_init_data of_aur
  78. .enable = l2c_enable,
  79. .fixup = aurora_fixup,
  80. .save = aurora_save,
  81. + .configure = l2c_configure,
  82. .outer_cache = {
  83. .inv_range = aurora_inv_range,
  84. .clean_range = aurora_clean_range,
  85. @@ -1435,6 +1438,7 @@ static const struct l2c_init_data of_aur
  86. .enable = aurora_enable_no_outer,
  87. .fixup = aurora_fixup,
  88. .save = aurora_save,
  89. + .configure = l2c_configure,
  90. .outer_cache = {
  91. .resume = l2c_resume,
  92. },
  93. @@ -1608,6 +1612,7 @@ static void __init tauros3_save(void __i
  94. static void tauros3_configure(void __iomem *base)
  95. {
  96. + l2c_configure(base);
  97. writel_relaxed(l2x0_saved_regs.aux2_ctrl,
  98. base + TAUROS3_AUX2_CTRL);
  99. writel_relaxed(l2x0_saved_regs.prefetch_ctrl,