init.S 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * (C) Copyright 2009
  3. * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
  4. *
  5. * Based on board/amcc/canyonlands/init.S
  6. * (C) Copyright 2008
  7. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. #include <asm-offsets.h>
  12. #include <ppc_asm.tmpl>
  13. #include <config.h>
  14. #include <asm/mmu.h>
  15. /**************************************************************************
  16. * TLB TABLE
  17. *
  18. * This table is used by the cpu boot code to setup the initial tlb
  19. * entries. Rather than make broad assumptions in the cpu source tree,
  20. * this table lets each board set things up however they like.
  21. *
  22. * Pointer to the table is returned in r1
  23. *
  24. *************************************************************************/
  25. .section .bootpg,"ax"
  26. .globl tlbtab
  27. tlbtab:
  28. tlbtab_start
  29. /*
  30. * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to
  31. * use the speed up boot process. It is patched after relocation to
  32. * enable SA_I
  33. */
  34. tlbentry(CONFIG_SYS_BOOT_BASE_ADDR, SZ_16M, CONFIG_SYS_BOOT_BASE_ADDR,
  35. 4, AC_RWX | SA_G) /* TLB 0 */
  36. /*
  37. * TLB entries for SDRAM are not needed on this platform.
  38. * They are dynamically generated in the SPD DDR(2) detection
  39. * routine.
  40. */
  41. #ifdef CONFIG_SYS_INIT_RAM_DCACHE
  42. /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
  43. tlbentry(CONFIG_SYS_INIT_RAM_ADDR, SZ_4K, CONFIG_SYS_INIT_RAM_ADDR,
  44. 0, AC_RWX | SA_G)
  45. #endif
  46. tlbentry(CONFIG_SYS_PCI_BASE, SZ_256M, 0x00000000, 0xC,
  47. AC_RW | SA_IG)
  48. tlbentry(CONFIG_SYS_PCI_MEMBASE, SZ_256M, 0x20000000, 0xC,
  49. AC_RW | SA_IG)
  50. /* TLB-entry for NVRAM */
  51. tlbentry(CONFIG_SYS_NVRAM_BASE, SZ_1M, CONFIG_SYS_NVRAM_BASE, 4,
  52. AC_RW | SA_IG)
  53. /* TLB-entry for UART */
  54. tlbentry(CONFIG_SYS_UART_BASE, SZ_16K, CONFIG_SYS_UART_BASE, 4,
  55. AC_RW | SA_IG)
  56. /* TLB-entry for IO */
  57. tlbentry(CONFIG_SYS_IO_BASE, SZ_16K, CONFIG_SYS_IO_BASE, 4,
  58. AC_RW | SA_IG)
  59. /* TLB-entry for OCM */
  60. tlbentry(CONFIG_SYS_OCM_BASE, SZ_1M, 0x00000000, 4,
  61. AC_RWX | SA_I)
  62. /* TLB-entry for Local Configuration registers => peripherals */
  63. tlbentry(CONFIG_SYS_LOCAL_CONF_REGS, SZ_16M, CONFIG_SYS_LOCAL_CONF_REGS,
  64. 4, AC_RWX | SA_IG)
  65. /* AHB: Internal USB Peripherals (USB, SATA) */
  66. tlbentry(CONFIG_SYS_AHB_BASE, SZ_1M, 0xbff00000, 4,
  67. AC_RWX | SA_IG)
  68. tlbtab_end