init.S 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Copyright 2007 Freescale Semiconductor.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * Version 2 as published by the Free Software Foundation.
  10. */
  11. #include <config.h>
  12. #include <ppc_asm.tmpl>
  13. #include <ppc_defs.h>
  14. #include <asm/cache.h>
  15. #include <asm/mmu.h>
  16. #include <mpc86xx.h>
  17. #define LAWAR_TRGT_PCI1 0x00000000
  18. #define LAWAR_TRGT_PCIE1 0x00200000
  19. #define LAWAR_TRGT_PCIE2 0x00100000
  20. #define LAWAR_TRGT_LBC 0x00400000
  21. #define LAWAR_TRGT_DDR 0x00f00000
  22. #if !defined(CONFIG_SPD_EEPROM)
  23. #define LAWBAR1 ((CFG_DDR_SDRAM_BASE>>12) & 0xffffff)
  24. #define LAWAR1 (LAWAR_EN | LAWAR_TRGT_DDR | (LAWAR_SIZE & LAWAR_SIZE_512M))
  25. #else
  26. #define LAWBAR1 0
  27. #define LAWAR1 ((LAWAR_TRGT_DDR | (LAWAR_SIZE & LAWAR_SIZE_512M)) & ~LAWAR_EN)
  28. #endif
  29. #define LAWBAR2 ((CFG_PCIE1_MEM_BASE>>12) & 0xffffff)
  30. #define LAWAR2 (LAWAR_EN | LAWAR_TRGT_PCIE1 | (LAWAR_SIZE & LAWAR_SIZE_256M))
  31. #define LAWBAR3 ((CFG_PCIE2_MEM_BASE>>12) & 0xffffff)
  32. #define LAWAR3 (LAWAR_EN | LAWAR_TRGT_PCIE2 | (LAWAR_SIZE & LAWAR_SIZE_256M))
  33. #define LAWBAR4 ((PIXIS_BASE>>12) & 0xffffff)
  34. #define LAWAR4 (LAWAR_EN | LAWAR_TRGT_LBC | (LAWAR_SIZE & LAWAR_SIZE_2M))
  35. #define LAWBAR5 ((CFG_PCIE1_IO_PHYS>>12) & 0xffffff)
  36. #define LAWAR5 (LAWAR_EN | LAWAR_TRGT_PCIE1 | (LAWAR_SIZE & LAWAR_SIZE_1M))
  37. #define LAWBAR6 ((CFG_PCIE2_IO_PHYS>>12) & 0xffffff)
  38. #define LAWAR6 (LAWAR_EN | LAWAR_TRGT_PCIE2 | (LAWAR_SIZE & LAWAR_SIZE_1M))
  39. #define LAWBAR7 ((CFG_FLASH_BASE >>12) & 0xffffff)
  40. #define LAWAR7 (LAWAR_EN | LAWAR_TRGT_LBC | (LAWAR_SIZE & LAWAR_SIZE_256M))
  41. #define LAWBAR8 ((CFG_PCI1_MEM_PHYS>>12) & 0xffffff)
  42. #define LAWAR8 (LAWAR_EN | LAWAR_TRGT_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_256M))
  43. #define LAWBAR9 ((CFG_PCI1_IO_PHYS>>12) & 0xffffff)
  44. #define LAWAR9 (LAWAR_EN | LAWAR_TRGT_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_1M))
  45. .section .bootpg, "ax"
  46. .globl law_entry
  47. law_entry:
  48. lis r7,CFG_CCSRBAR@h
  49. ori r7,r7,CFG_CCSRBAR@l
  50. addi r4,r7,0
  51. addi r5,r7,0
  52. /* Skip LAWAR0, start at LAWAR1 */
  53. lis r6,LAWBAR1@h
  54. ori r6,r6,LAWBAR1@l
  55. stwu r6, 0xc28(r4)
  56. lis r6,LAWAR1@h
  57. ori r6,r6,LAWAR1@l
  58. stwu r6, 0xc30(r5)
  59. /* LAWBAR2, LAWAR2 */
  60. lis r6,LAWBAR2@h
  61. ori r6,r6,LAWBAR2@l
  62. stwu r6, 0x20(r4)
  63. lis r6,LAWAR2@h
  64. ori r6,r6,LAWAR2@l
  65. stwu r6, 0x20(r5)
  66. /* LAWBAR3, LAWAR3 */
  67. lis r6,LAWBAR3@h
  68. ori r6,r6,LAWBAR3@l
  69. stwu r6, 0x20(r4)
  70. lis r6,LAWAR3@h
  71. ori r6,r6,LAWAR3@l
  72. stwu r6, 0x20(r5)
  73. /* LAWBAR4, LAWAR4 */
  74. lis r6,LAWBAR4@h
  75. ori r6,r6,LAWBAR4@l
  76. stwu r6, 0x20(r4)
  77. lis r6,LAWAR4@h
  78. ori r6,r6,LAWAR4@l
  79. stwu r6, 0x20(r5)
  80. /* LAWBAR5, LAWAR5 */
  81. lis r6,LAWBAR5@h
  82. ori r6,r6,LAWBAR5@l
  83. stwu r6, 0x20(r4)
  84. lis r6,LAWAR5@h
  85. ori r6,r6,LAWAR5@l
  86. stwu r6, 0x20(r5)
  87. /* LAWBAR6, LAWAR6 */
  88. lis r6,LAWBAR6@h
  89. ori r6,r6,LAWBAR6@l
  90. stwu r6, 0x20(r4)
  91. lis r6,LAWAR6@h
  92. ori r6,r6,LAWAR6@l
  93. stwu r6, 0x20(r5)
  94. /* LAWBAR7, LAWAR7 */
  95. lis r6,LAWBAR7@h
  96. ori r6,r6,LAWBAR7@l
  97. stwu r6, 0x20(r4)
  98. lis r6,LAWAR7@h
  99. ori r6,r6,LAWAR7@l
  100. stwu r6, 0x20(r5)
  101. /* LAWBAR8, LAWAR8 */
  102. lis r6,LAWBAR8@h
  103. ori r6,r6,LAWBAR8@l
  104. stwu r6, 0x20(r4)
  105. lis r6,LAWAR8@h
  106. ori r6,r6,LAWAR8@l
  107. stwu r6, 0x20(r5)
  108. /* LAWBAR9, LAWAR9 */
  109. lis r6,LAWBAR9@h
  110. ori r6,r6,LAWBAR9@l
  111. stwu r6, 0x20(r4)
  112. lis r6,LAWAR9@h
  113. ori r6,r6,LAWAR9@l
  114. stwu r6, 0x20(r5)
  115. blr