cpu_setup_44x.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * This file contains low level CPU setup functions.
  4. * Valentine Barshak <[email protected]>
  5. * MontaVista Software, Inc (c) 2007
  6. *
  7. * Based on cpu_setup_6xx code by
  8. * Benjamin Herrenschmidt <[email protected]>
  9. */
  10. #include <asm/processor.h>
  11. #include <asm/cputable.h>
  12. #include <asm/ppc_asm.h>
  13. _GLOBAL(__setup_cpu_440ep)
  14. b __init_fpu_44x
  15. _GLOBAL(__setup_cpu_440epx)
  16. mflr r4
  17. bl __init_fpu_44x
  18. bl __plb_disable_wrp
  19. bl __fixup_440A_mcheck
  20. mtlr r4
  21. blr
  22. _GLOBAL(__setup_cpu_440grx)
  23. mflr r4
  24. bl __plb_disable_wrp
  25. bl __fixup_440A_mcheck
  26. mtlr r4
  27. blr
  28. _GLOBAL(__setup_cpu_460ex)
  29. _GLOBAL(__setup_cpu_460gt)
  30. _GLOBAL(__setup_cpu_460sx)
  31. _GLOBAL(__setup_cpu_apm821xx)
  32. mflr r4
  33. bl __init_fpu_44x
  34. bl __fixup_440A_mcheck
  35. mtlr r4
  36. blr
  37. _GLOBAL(__setup_cpu_440x5)
  38. _GLOBAL(__setup_cpu_440gx)
  39. _GLOBAL(__setup_cpu_440spe)
  40. b __fixup_440A_mcheck
  41. /* enable APU between CPU and FPU */
  42. _GLOBAL(__init_fpu_44x)
  43. mfspr r3,SPRN_CCR0
  44. /* Clear DAPUIB flag in CCR0 */
  45. rlwinm r3,r3,0,12,10
  46. mtspr SPRN_CCR0,r3
  47. isync
  48. blr
  49. /*
  50. * Workaround for the incorrect write to DDR SDRAM errata.
  51. * The write address can be corrupted during writes to
  52. * DDR SDRAM when write pipelining is enabled on PLB0.
  53. * Disable write pipelining here.
  54. */
  55. #define DCRN_PLB4A0_ACR 0x81
  56. _GLOBAL(__plb_disable_wrp)
  57. mfdcr r3,DCRN_PLB4A0_ACR
  58. /* clear WRP bit in PLB4A0_ACR */
  59. rlwinm r3,r3,0,8,6
  60. mtdcr DCRN_PLB4A0_ACR,r3
  61. isync
  62. blr