init.S 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * (C) Copyright 2010
  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 <config.h>
  10. #include <asm/mmu.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. */
  21. .section .bootpg,"ax"
  22. .globl tlbtab
  23. tlbtab:
  24. tlbtab_start
  25. /*
  26. * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to
  27. * use the speed up boot process. It is patched after relocation to
  28. * enable SA_I
  29. */
  30. tlbentry(CONFIG_SYS_BOOT_BASE_ADDR, SZ_16M,
  31. CONFIG_SYS_BOOT_BASE_ADDR, 4, AC_RWX | SA_G)
  32. /*
  33. * TLB entries for SDRAM are not needed on this platform.
  34. * They are dynamically generated in the DDR(2) detection
  35. * routine.
  36. */
  37. #ifdef CONFIG_SYS_INIT_RAM_DCACHE
  38. /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
  39. tlbentry(CONFIG_SYS_INIT_RAM_ADDR, SZ_4K, CONFIG_SYS_INIT_RAM_ADDR, 0,
  40. AC_RWX | SA_G)
  41. #endif
  42. tlbentry(CONFIG_SYS_PCI_BASE, SZ_256M, 0x00000000, 0xc,
  43. AC_RW | SA_IG)
  44. tlbentry(CONFIG_SYS_PCI_MEMBASE, SZ_256M, 0x20000000, 0xc,
  45. AC_RW | SA_IG)
  46. tlbentry(CONFIG_SYS_PCIE_MEMBASE, SZ_256M, 0xB0000000, 0xd,
  47. AC_RW | SA_IG)
  48. tlbentry(CONFIG_SYS_PCIE0_CFGBASE, SZ_16M, 0x00000000, 0xd,
  49. AC_RW | SA_IG)
  50. tlbentry(CONFIG_SYS_PCIE1_CFGBASE, SZ_16M, 0x20000000, 0xd,
  51. AC_RW | SA_IG)
  52. tlbentry(CONFIG_SYS_PCIE0_XCFGBASE, SZ_1K, 0x10000000, 0xd,
  53. AC_RW | SA_IG)
  54. tlbentry(CONFIG_SYS_PCIE1_XCFGBASE, SZ_1K, 0x30000000, 0xd,
  55. AC_RW | SA_IG)
  56. /* PCIe UTL register */
  57. tlbentry(CONFIG_SYS_PCIE_BASE, SZ_16K, 0x08010000, 0xc, AC_RW | SA_IG)
  58. /* TLB-entry for FPGA(s) */
  59. tlbentry(CONFIG_SYS_FPGA1_BASE, SZ_16M, CONFIG_SYS_FPGA1_BASE, 4,
  60. AC_RW | SA_IG)
  61. tlbentry(CONFIG_SYS_FPGA1_BASE + (16 << 20), SZ_16M,
  62. CONFIG_SYS_FPGA1_BASE + (16 << 20), 4, AC_RW | SA_IG)
  63. tlbentry(CONFIG_SYS_FPGA2_BASE, SZ_16M, CONFIG_SYS_FPGA2_BASE, 4,
  64. AC_RW | SA_IG)
  65. tlbentry(CONFIG_SYS_FPGA3_BASE, SZ_16M, CONFIG_SYS_FPGA3_BASE, 4,
  66. AC_RW | SA_IG)
  67. /* TLB-entry for OCM */
  68. tlbentry(CONFIG_SYS_OCM_BASE, SZ_1M, 0x00000000, 4,
  69. AC_RWX | SA_I)
  70. /* TLB-entry for Local Configuration registers => peripherals */
  71. tlbentry(CONFIG_SYS_LOCAL_CONF_REGS, SZ_16M,
  72. CONFIG_SYS_LOCAL_CONF_REGS, 4, AC_RWX | SA_IG)
  73. tlbtab_end