init.S 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * (C) Copyright 2007
  3. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. *
  5. * Copyright (C) 2002 Scott McNutt <smcnutt@artesyncp.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #include <ppc_asm.tmpl>
  10. #include <config.h>
  11. #include <asm/mmu.h>
  12. #include <asm/ppc4xx.h>
  13. /**************************************************************************
  14. * TLB TABLE
  15. *
  16. * This table is used by the cpu boot code to setup the initial tlb
  17. * entries. Rather than make broad assumptions in the cpu source tree,
  18. * this table lets each board set things up however they like.
  19. *
  20. * Pointer to the table is returned in r1
  21. *
  22. *************************************************************************/
  23. .section .bootpg,"ax"
  24. /**************************************************************************
  25. * TLB table for revA
  26. *************************************************************************/
  27. .globl tlbtabA
  28. tlbtabA:
  29. tlbtab_start
  30. /*
  31. * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to use the
  32. * speed up boot process. It is patched after relocation to enable SA_I
  33. */
  34. tlbentry(0xff000000, SZ_16M, 0xff000000, 4, AC_RWX | SA_G)
  35. /*
  36. * TLB entries for SDRAM are not needed on this platform.
  37. * They are dynamically generated in the SPD DDR(2) detection
  38. * routine.
  39. */
  40. tlbentry(CONFIG_SYS_ISRAM_BASE, SZ_256K, 0x00000000, 4, AC_RWX | SA_I)
  41. tlbentry(CONFIG_SYS_FPGA_BASE, SZ_1K, 0xE2000000, 4,AC_RW | SA_I)
  42. tlbentry(CONFIG_SYS_OPER_FLASH, SZ_16M, 0xE7000000, 4,AC_RWX | SA_IG)
  43. tlbentry(CONFIG_SYS_PERIPHERAL_BASE, SZ_4K, 0xF0000000, 4, AC_RW | SA_IG)
  44. tlbentry(CONFIG_SYS_PCI_BASE, SZ_256M, 0x00000000, 0xC, AC_RW | SA_IG)
  45. tlbentry(CONFIG_SYS_PCI_MEMBASE, SZ_256M, 0x10000000, 0xC, AC_RW | SA_IG)
  46. tlbentry(CONFIG_SYS_PCIE_MEMBASE, SZ_256M, 0xB0000000, 0xD, AC_RW | SA_IG)
  47. tlbentry(CONFIG_SYS_PCIE_BASE, SZ_16K, 0x20000000, 0xC, AC_RW | SA_IG)
  48. tlbentry(CONFIG_SYS_PCIE0_CFGBASE, SZ_16M, 0x40000000, 0xC, AC_RW | SA_IG)
  49. tlbentry(CONFIG_SYS_PCIE1_CFGBASE, SZ_16M, 0x80000000, 0xC, AC_RW | SA_IG)
  50. tlbentry(CONFIG_SYS_PCIE2_CFGBASE, SZ_16M, 0xC0000000, 0xC, AC_RW | SA_IG)
  51. tlbentry(CONFIG_SYS_PCIE0_XCFGBASE, SZ_1K, 0x50000000, 0xC, AC_RW | SA_IG)
  52. tlbentry(CONFIG_SYS_PCIE1_XCFGBASE, SZ_1K, 0x90000000, 0xC, AC_RW | SA_IG)
  53. tlbentry(CONFIG_SYS_PCIE2_XCFGBASE, SZ_1K, 0xD0000000, 0xC, AC_RW | SA_IG)
  54. tlbtab_end
  55. /**************************************************************************
  56. * TLB table for revB
  57. *
  58. * Notice: revB of the 440SPe chip is very strict about PLB real addresses
  59. * and ranges to be mapped for config space: it seems to only work with
  60. * d_nnnn_nnnn range (hangs the core upon config transaction attempts when
  61. * set otherwise) while revA uses c_nnnn_nnnn.
  62. *************************************************************************/
  63. .globl tlbtabB
  64. tlbtabB:
  65. tlbtab_start
  66. /*
  67. * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to use the
  68. * speed up boot process. It is patched after relocation to enable SA_I
  69. */
  70. tlbentry(0xff000000, SZ_16M, 0xff000000, 4, AC_RWX | SA_G)
  71. /*
  72. * TLB entries for SDRAM are not needed on this platform.
  73. * They are dynamically generated in the SPD DDR(2) detection
  74. * routine.
  75. */
  76. tlbentry(CONFIG_SYS_ISRAM_BASE, SZ_256K, 0x00000000, 4, AC_RWX | SA_I)
  77. tlbentry(CONFIG_SYS_FPGA_BASE, SZ_1K, 0xE2000000, 4,AC_RW | SA_I)
  78. tlbentry(CONFIG_SYS_OPER_FLASH, SZ_16M, 0xE7000000, 4,AC_RWX | SA_IG)
  79. tlbentry(CONFIG_SYS_PERIPHERAL_BASE, SZ_4K, 0xF0000000, 4, AC_RW | SA_IG)
  80. tlbentry(CONFIG_SYS_PCI_BASE, SZ_256M, 0x00000000, 0xC, AC_RW | SA_IG)
  81. tlbentry(CONFIG_SYS_PCI_MEMBASE, SZ_256M, 0x10000000, 0xC, AC_RW | SA_IG)
  82. tlbentry(CONFIG_SYS_PCIE_MEMBASE, SZ_256M, 0xB0000000, 0xD, AC_RW | SA_IG)
  83. tlbentry(CONFIG_SYS_PCIE0_CFGBASE, SZ_16M, 0x00000000, 0xD, AC_RW | SA_IG)
  84. tlbentry(CONFIG_SYS_PCIE1_CFGBASE, SZ_16M, 0x20000000, 0xD, AC_RW | SA_IG)
  85. tlbentry(CONFIG_SYS_PCIE2_CFGBASE, SZ_16M, 0x40000000, 0xD, AC_RW | SA_IG)
  86. tlbentry(CONFIG_SYS_PCIE0_XCFGBASE, SZ_1K, 0x10000000, 0xD, AC_RW | SA_IG)
  87. tlbentry(CONFIG_SYS_PCIE1_XCFGBASE, SZ_1K, 0x30000000, 0xD, AC_RW | SA_IG)
  88. tlbentry(CONFIG_SYS_PCIE2_XCFGBASE, SZ_1K, 0x50000000, 0xD, AC_RW | SA_IG)
  89. tlbtab_end