cpu_setup_fsl_booke.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * This file contains low level CPU setup functions.
  3. * Kumar Gala <galak@kernel.crashing.org>
  4. * Copyright 2009 Freescale Semiconductor, Inc.
  5. *
  6. * Based on cpu_setup_6xx code by
  7. * Benjamin Herrenschmidt <benh@kernel.crashing.org>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. *
  14. */
  15. #include <asm/processor.h>
  16. #include <asm/cputable.h>
  17. #include <asm/ppc_asm.h>
  18. _GLOBAL(__e500_icache_setup)
  19. mfspr r0, SPRN_L1CSR1
  20. andi. r3, r0, L1CSR1_ICE
  21. bnelr /* Already enabled */
  22. oris r0, r0, L1CSR1_CPE@h
  23. ori r0, r0, (L1CSR1_ICFI | L1CSR1_ICLFR | L1CSR1_ICE)
  24. mtspr SPRN_L1CSR1, r0 /* Enable I-Cache */
  25. isync
  26. blr
  27. _GLOBAL(__e500_dcache_setup)
  28. mfspr r0, SPRN_L1CSR0
  29. andi. r3, r0, L1CSR0_DCE
  30. bnelr /* Already enabled */
  31. msync
  32. isync
  33. li r0, 0
  34. mtspr SPRN_L1CSR0, r0 /* Disable */
  35. msync
  36. isync
  37. li r0, (L1CSR0_DCFI | L1CSR0_CLFC)
  38. mtspr SPRN_L1CSR0, r0 /* Invalidate */
  39. isync
  40. 1: mfspr r0, SPRN_L1CSR0
  41. andi. r3, r0, L1CSR0_CLFC
  42. bne+ 1b /* Wait for lock bits reset */
  43. oris r0, r0, L1CSR0_CPE@h
  44. ori r0, r0, L1CSR0_DCE
  45. msync
  46. isync
  47. mtspr SPRN_L1CSR0, r0 /* Enable */
  48. isync
  49. blr
  50. _GLOBAL(__setup_cpu_e200)
  51. /* enable dedicated debug exception handling resources (Debug APU) */
  52. mfspr r3,SPRN_HID0
  53. ori r3,r3,HID0_DAPUEN@l
  54. mtspr SPRN_HID0,r3
  55. b __setup_e200_ivors
  56. _GLOBAL(__setup_cpu_e500v1)
  57. _GLOBAL(__setup_cpu_e500v2)
  58. mflr r4
  59. bl __e500_icache_setup
  60. bl __e500_dcache_setup
  61. bl __setup_e500_ivors
  62. mtlr r4
  63. blr
  64. _GLOBAL(__setup_cpu_e500mc)
  65. mflr r4
  66. bl __e500_icache_setup
  67. bl __e500_dcache_setup
  68. bl __setup_e500mc_ivors
  69. mtlr r4
  70. blr