rw4_init.S 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #define VESTA
  2. #include "ppc_40x.h"
  3. #
  4. .align 2
  5. .text
  6. #
  7. # added by linguohui
  8. .extern initb_ebiu0, initb_config, hdw_init_finish
  9. .extern initb_hsmc0, initb_hsmc1, initb_cache
  10. # end added
  11. .globl HdwInit
  12. #
  13. HdwInit:
  14. #
  15. #-----------------------------------------------------------------------*
  16. # If we are not executing from the FLASH get out *
  17. #-----------------------------------------------------------------------*
  18. # SAW keep this or comment out a la Hawthorne?
  19. # r3 contains NIP when used with Linux
  20. # rlwinm r28, r3, 8, 24, 31 # if MSB == 0xFF -> FLASH address
  21. # cmpwi r28, 0xff
  22. # bne locn01
  23. #
  24. #
  25. #------------------------------------------------------------------------
  26. # Init_cpu. Bank registers are setup for the IBM STB.
  27. #------------------------------------------------------------------------
  28. #
  29. # Setup processor core clock to be driven off chip. This is GPI4 bit
  30. # twenty. Setup Open Drain, Output Select, Three-State Control, and
  31. # Three-State Select registers.
  32. #
  33. pb0pesr = 0x054
  34. pb0pear = 0x056
  35. mflr r30
  36. #-----------------------------------------------------------------------------
  37. # Vectors will be at 0x1F000000
  38. # Dummy Machine check handler just does RFI before true handler gets installed
  39. #-----------------------------------------------------------------------------
  40. #if 1 /* xuwentao added*/
  41. #ifdef SDRAM16MB
  42. lis r10,0x0000
  43. addi r10,r10,0x0000
  44. #else
  45. lis r10,0x1F00
  46. addi r10,r10,0x0000
  47. #endif
  48. mtspr evpr,r10 #EVPR: 0x0 or 0x1f000000 depending
  49. isync # on SDRAM memory model used.
  50. lis r10,0xFFFF # clear PB0_PESR because some
  51. ori r10,r10,0xFFFF # transitions from flash,changed by linguohui
  52. mtdcr pb0pesr,r10 # to load RAM image via RiscWatch
  53. lis r10,0x0000 # cause PB0_PESR machine checks
  54. mtdcr pb0pear,r10
  55. addis r10,r10,0x0000 # clear the
  56. mtxer r10 # XER just in case...
  57. #endif /* xuwentao*/
  58. bl initb_ebiu0 # init EBIU
  59. bl initb_config # config PPC and board
  60. #------------------------------------------------------------------------
  61. # EVPR setup moved to top of this function.
  62. #------------------------------------------------------------------------
  63. #
  64. mtlr r30
  65. blr
  66. .end