cpu_setup_44x.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * This file contains low level CPU setup functions.
  3. * Valentine Barshak <vbarshak@ru.mvista.com>
  4. * MontaVista Software, Inc (c) 2007
  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(__setup_cpu_440ep)
  19. b __init_fpu_44x
  20. _GLOBAL(__setup_cpu_440epx)
  21. mflr r4
  22. bl __init_fpu_44x
  23. bl __plb_disable_wrp
  24. bl __fixup_440A_mcheck
  25. mtlr r4
  26. blr
  27. _GLOBAL(__setup_cpu_440grx)
  28. mflr r4
  29. bl __plb_disable_wrp
  30. bl __fixup_440A_mcheck
  31. mtlr r4
  32. blr
  33. _GLOBAL(__setup_cpu_460ex)
  34. _GLOBAL(__setup_cpu_460gt)
  35. mflr r4
  36. bl __init_fpu_44x
  37. bl __fixup_440A_mcheck
  38. mtlr r4
  39. blr
  40. _GLOBAL(__setup_cpu_440x5)
  41. _GLOBAL(__setup_cpu_440gx)
  42. _GLOBAL(__setup_cpu_440spe)
  43. b __fixup_440A_mcheck
  44. /* enable APU between CPU and FPU */
  45. _GLOBAL(__init_fpu_44x)
  46. mfspr r3,SPRN_CCR0
  47. /* Clear DAPUIB flag in CCR0 */
  48. rlwinm r3,r3,0,12,10
  49. mtspr SPRN_CCR0,r3
  50. isync
  51. blr
  52. /*
  53. * Workaround for the incorrect write to DDR SDRAM errata.
  54. * The write address can be corrupted during writes to
  55. * DDR SDRAM when write pipelining is enabled on PLB0.
  56. * Disable write pipelining here.
  57. */
  58. #define DCRN_PLB4A0_ACR 0x81
  59. _GLOBAL(__plb_disable_wrp)
  60. mfdcr r3,DCRN_PLB4A0_ACR
  61. /* clear WRP bit in PLB4A0_ACR */
  62. rlwinm r3,r3,0,8,6
  63. mtdcr DCRN_PLB4A0_ACR,r3
  64. isync
  65. blr