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 11 #ifndef _XTENSA_PLATFORM_H 12 #define _XTENSA_PLATFORM_H 13 14 #include <linux/types.h> 15 #include <linux/pci.h> 16 17 #include <asm/bootparam.h> 18 19 /* 20 * platform_init is called before the mmu is initialized to give the 21 * platform a early hook-up. bp_tag_t is a list of configuration tags 22 * passed from the boot-loader. 23 */ 24 extern void platform_init(bp_tag_t*); 25 26 /* 27 * platform_setup is called from setup_arch with a pointer to the command-line 28 * string. 29 */ 30 extern void platform_setup (char **); 31 32 /* 33 * platform_restart is called to restart the system. 34 */ 35 extern void platform_restart (void); 36 37 /* 38 * platform_halt is called to stop the system and halt. 39 */ 40 extern void platform_halt (void); 41 42 /* 43 * platform_power_off is called to stop the system and power it off. 44 */ 45 extern void platform_power_off (void); 46 47 /* 48 * platform_idle is called from the idle function. 49 */ 50 extern void platform_idle (void); 51 52 /* 53 * platform_heartbeat is called every HZ 54 */ 55 extern void platform_heartbeat (void); 56 57 /* 58 * platform_pcibios_init is called to allow the platform to setup the pci bus. 59 */ 60 extern void platform_pcibios_init (void); 61 62 /* 63 * platform_pcibios_fixup allows to modify the PCI configuration. 64 */ 65 extern int platform_pcibios_fixup (void); 66 67 /* 68 * platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE) 69 */ 70 extern void platform_calibrate_ccount (void); 71 72 /* 73 * Flush and reset the mmu, simulate a processor reset, and 74 * jump to the reset vector. 75 */ 76 void cpu_reset(void) __attribute__((noreturn)); 77 78 /* 79 * Memory caching is platform-dependent in noMMU xtensa configurations. 80 * The following set of functions should be implemented in platform code 81 * in order to enable coherent DMA memory operations when CONFIG_MMU is not 82 * enabled. Default implementations do nothing and issue a warning. 83 */ 84 85 /* 86 * Check whether p points to a cached memory. 87 */ 88 bool platform_vaddr_cached(const void *p); 89 90 /* 91 * Check whether p points to an uncached memory. 92 */ 93 bool platform_vaddr_uncached(const void *p); 94 95 /* 96 * Return pointer to an uncached view of the cached sddress p. 97 */ 98 void *platform_vaddr_to_uncached(void *p); 99 100 /* 101 * Return pointer to a cached view of the uncached sddress p. 102 */ 103 void *platform_vaddr_to_cached(void *p); 104 105 #endif /* _XTENSA_PLATFORM_H */ 106