init.S 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * (C) Copyright 2008
  3. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <asm-offsets.h>
  8. #include <ppc_asm.tmpl>
  9. #include <asm/mmu.h>
  10. #include <config.h>
  11. /*
  12. * TLB TABLE
  13. *
  14. * This table is used by the cpu boot code to setup the initial tlb
  15. * entries. Rather than make broad assumptions in the cpu source tree,
  16. * this table lets each board set things up however they like.
  17. *
  18. * Pointer to the table is returned in r1
  19. */
  20. .section .bootpg,"ax"
  21. .globl tlbtab
  22. tlbtab:
  23. tlbtab_start
  24. /* vxWorks needs this as first entry for the Machine Check interrupt */
  25. tlbentry( 0x40000000, SZ_256M, 0, 0, AC_RWX | SA_IG )
  26. /*
  27. * The RAM-boot version skips the SDRAM TLB (identified by EPN=0). This
  28. * entry is already configured for SDRAM via the JTAG debugger and mustn't
  29. * be re-initialized by this RAM-booting U-Boot version.
  30. */
  31. #ifndef CONFIG_SYS_RAMBOOT
  32. /* TLB-entry for DDR SDRAM (Up to 2GB) */
  33. #ifdef CONFIG_4xx_DCACHE
  34. tlbentry( CONFIG_SYS_SDRAM_BASE, SZ_256M, CONFIG_SYS_SDRAM_BASE, 0, AC_RWX | SA_G)
  35. #else
  36. tlbentry( CONFIG_SYS_SDRAM_BASE, SZ_256M, CONFIG_SYS_SDRAM_BASE, 0, AC_RWX | SA_IG )
  37. #endif
  38. #endif /* CONFIG_SYS_RAMBOOT */
  39. /* TLB-entry for EBC */
  40. tlbentry( CONFIG_SYS_BCSR_BASE, SZ_256M, CONFIG_SYS_BCSR_BASE, 1, AC_RWX | SA_IG )
  41. /* BOOT_CS (FLASH) must be forth. Before relocation SA_I can be off to use the
  42. * speed up boot process. It is patched after relocation to enable SA_I
  43. */
  44. tlbentry( CONFIG_SYS_BOOT_BASE_ADDR, SZ_256M, CONFIG_SYS_BOOT_BASE_ADDR, 1, AC_RWX | SA_G )
  45. #ifdef CONFIG_SYS_INIT_RAM_DCACHE
  46. /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
  47. tlbentry( CONFIG_SYS_INIT_RAM_ADDR, SZ_64K, CONFIG_SYS_INIT_RAM_ADDR, 0, AC_RWX | SA_G )
  48. #endif
  49. /* TLB-entry for PCI Memory */
  50. tlbentry( CONFIG_SYS_PCI_MEMBASE, SZ_256M, CONFIG_SYS_PCI_MEMBASE, 1, AC_RW | SA_IG )
  51. tlbentry( CONFIG_SYS_PCI_MEMBASE1, SZ_256M, CONFIG_SYS_PCI_MEMBASE1, 1, AC_RW | SA_IG )
  52. tlbentry( CONFIG_SYS_PCI_MEMBASE2, SZ_256M, CONFIG_SYS_PCI_MEMBASE2, 1, AC_RW | SA_IG )
  53. tlbentry( CONFIG_SYS_PCI_MEMBASE3, SZ_256M, CONFIG_SYS_PCI_MEMBASE3, 1, AC_RW | SA_IG )
  54. /* TLB-entry for NAND */
  55. tlbentry( CONFIG_SYS_NAND_ADDR, SZ_1K, CONFIG_SYS_NAND_ADDR, 1, AC_RWX | SA_IG )
  56. /* TLB-entry for Internal Registers & OCM */
  57. tlbentry( 0xe0000000, SZ_16M, 0xe0000000, 0, AC_RWX | SA_I )
  58. /*TLB-entry PCI registers*/
  59. tlbentry( 0xEEC00000, SZ_1K, 0xEEC00000, 1, AC_RWX | SA_IG )
  60. /* TLB-entry for peripherals */
  61. tlbentry( 0xEF000000, SZ_16M, 0xEF000000, 1, AC_RWX | SA_IG)
  62. /* TLB-entry PCI IO Space - from sr@denx.de */
  63. tlbentry(0xE8000000, SZ_64K, 0xE8000000, 1, AC_RWX | SA_IG)
  64. tlbtab_end