platform.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Platform specific functions
  3. *
  4. * This file is subject to the terms and conditions of the GNU General
  5. * Public License. See the file "COPYING" in the main directory of
  6. * this archive for more details.
  7. *
  8. * Copyright (C) 2001 - 2005 Tensilica Inc.
  9. */
  10. #ifndef _XTENSA_PLATFORM_H
  11. #define _XTENSA_PLATFORM_H
  12. #include <linux/types.h>
  13. #include <linux/pci.h>
  14. #include <asm/bootparam.h>
  15. /*
  16. * platform_init is called before the mmu is initialized to give the
  17. * platform a early hook-up. bp_tag_t is a list of configuration tags
  18. * passed from the boot-loader.
  19. */
  20. extern void platform_init(bp_tag_t*);
  21. /*
  22. * platform_setup is called from setup_arch with a pointer to the command-line
  23. * string.
  24. */
  25. extern void platform_setup (char **);
  26. /*
  27. * platform_restart is called to restart the system.
  28. */
  29. extern void platform_restart (void);
  30. /*
  31. * platform_halt is called to stop the system and halt.
  32. */
  33. extern void platform_halt (void);
  34. /*
  35. * platform_power_off is called to stop the system and power it off.
  36. */
  37. extern void platform_power_off (void);
  38. /*
  39. * platform_idle is called from the idle function.
  40. */
  41. extern void platform_idle (void);
  42. /*
  43. * platform_heartbeat is called every HZ
  44. */
  45. extern void platform_heartbeat (void);
  46. /*
  47. * platform_pcibios_init is called to allow the platform to setup the pci bus.
  48. */
  49. extern void platform_pcibios_init (void);
  50. /*
  51. * platform_pcibios_fixup allows to modify the PCI configuration.
  52. */
  53. extern int platform_pcibios_fixup (void);
  54. /*
  55. * platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE)
  56. */
  57. extern void platform_calibrate_ccount (void);
  58. /*
  59. * Flush and reset the mmu, simulate a processor reset, and
  60. * jump to the reset vector.
  61. */
  62. void cpu_reset(void) __attribute__((noreturn));
  63. /*
  64. * Memory caching is platform-dependent in noMMU xtensa configurations.
  65. * The following set of functions should be implemented in platform code
  66. * in order to enable coherent DMA memory operations when CONFIG_MMU is not
  67. * enabled. Default implementations do nothing and issue a warning.
  68. */
  69. /*
  70. * Check whether p points to a cached memory.
  71. */
  72. bool platform_vaddr_cached(const void *p);
  73. /*
  74. * Check whether p points to an uncached memory.
  75. */
  76. bool platform_vaddr_uncached(const void *p);
  77. /*
  78. * Return pointer to an uncached view of the cached sddress p.
  79. */
  80. void *platform_vaddr_to_uncached(void *p);
  81. /*
  82. * Return pointer to a cached view of the uncached sddress p.
  83. */
  84. void *platform_vaddr_to_cached(void *p);
  85. #endif /* _XTENSA_PLATFORM_H */