mt6885-fpga.cmm 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ;*****************************************************************************
  2. ; Copyright Statement:
  3. ; --------------------
  4. ; This software is protected by Copyright and the information contained
  5. ; herein is confidential. The software may not be copied and the information
  6. ; contained herein may not be used or disclosed except with the written
  7. ; permission of MediaTek Inc. (C) 2011
  8. ;
  9. ;*****************************************************************************
  10. ;=================================================
  11. ; Specify Core Number
  12. ;=================================================
  13. &NR_CPUS=1
  14. ; cluster 0 corebase: 0x8007000, 0x8007200, 0x8007400, 0x8007600
  15. ; cluster 1 corebase: 0x8009000, 0x8009200, 0x8009400, 0x8009600
  16. &boot_from_emmc=1
  17. ;=================================================
  18. ; Initialize CPU
  19. ;=================================================
  20. SYStem.RESet;
  21. SYStem.Option ENRESET ON;
  22. SYStem.Option ResBreak OFF;
  23. SYStem.Option WaitReset 100.ms;
  24. SYStem.JtagClock 3.MHz;
  25. SYStem.CPU Ananke;
  26. if &NR_CPUS==1
  27. (
  28. SYStem.CONFIG CORENUMBER 1;
  29. SYStem.CONFIG COREBASE 0x8E010000;
  30. SYStem.CONFIG CTIBASE 0x8E020000;
  31. )
  32. ;=================================================
  33. ; Attach and Stop CPU
  34. ;=================================================
  35. SYSTEM.UP
  36. SETUP.IMASKHLL ON
  37. SETUP.IMASKASM ON
  38. ;=================================================
  39. ; Initialize EMI
  40. ;=================================================
  41. &init_emi=1 ; 0: not init
  42. ; 1: init
  43. IF &init_emi==1
  44. (
  45. do mt6885_FPGA_DDR.cmm
  46. )
  47. ;=================================================
  48. ; register
  49. ;=================================================
  50. &RGU=0x10007000
  51. ;=================================================
  52. ; disable wdt (debug purpose)
  53. ;=================================================
  54. D.S SD:&RGU+0x0000 %LE %LONG 0x22000064
  55. ; for pmic power latch (RGU + 0xA4)
  56. D.S SD:&RGU+0x00A4 %LE %LONG 0x66000001
  57. ;=================================================
  58. ; L3C share sram init
  59. ;=================================================
  60. ; Turn off MMU
  61. ;D.S C15:0x1 0x00C50838
  62. ; L3C share enable
  63. D.S SD:0x0C53C8D0 %LE %LONG 0x00070300
  64. ;=================================================
  65. ; Load Preloader Symbol
  66. ;=================================================
  67. Y.SPATH.RESET ; reset all source path
  68. Break.Select Program OnChip
  69. Break.Select Hll OnChip
  70. Break.Select Spot OnChip
  71. Break.Select Read OnChip
  72. Break.Select Write OnChip
  73. R.S T 0
  74. &searchVendorStr="vendor"
  75. &pathlen=STRing.SCAN(OS.PWD(),"&searchVendorStr",0)-1
  76. &alpsPath=STRing.MID(OS.PWD(), 0, &pathlen)
  77. ;&searchLKStr="vendor/mediatek/proprietary/bootable/bootloader/lk"
  78. &searchLKStr="vendor"
  79. &alpsCodePath="&alpsPath\&searchLKStr"
  80. &project="fpga6885_64"
  81. &outPath="../../../../../../../../out/target/product"
  82. &PLoutPath="&outPath/&project/obj/PRELOADER_OBJ/bin"
  83. &ATFoutPath="&outPath/&project/trustzone/ATF_OBJ/debug"
  84. if &boot_from_emmc==0
  85. (
  86. print "loading pre-loader image"
  87. data.load.elf &PLoutPath/preloader_&project.elf /noclear
  88. print "loading ATF image"
  89. data.load.binary &ATFoutPath/bl31.bin 0x54601000 /noclear
  90. print "loading LK image"
  91. data.load.binary ../../build-&project/lk-no-mtk-header.bin 0x56000000 /noclear
  92. print "loading LK symbol"
  93. data.load.elf ../../build-&project/lk /gnu /nocode /StripPART "&searchLKStr" /PATH "&alpsCodePath"
  94. )
  95. else
  96. (
  97. print "loading pre-loader image"
  98. data.load.elf &PLoutPath/preloader_&project.elf /noclear
  99. print "loading LK symbol"
  100. data.load.elf ../../build-&project/lk /gnu /nocode /StripPART "&searchLKStr" /PATH "&alpsCodePath"
  101. )
  102. r.s pc 0x00201000
  103. ;winclear
  104. d.l
  105. ;go
  106. enddo