2 #ifndef _PPC64_MACHDEP_H
3 #define _PPC64_MACHDEP_H
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/config.h>
13 #include <linux/seq_file.h>
14 #include <linux/init.h>
15 #include <linux/dma-mapping.h>
17 #include <asm/setup.h>
28 void (*message_pass)(int target, int msg);
30 void (*kick_cpu)(int nr);
31 void (*setup_cpu)(int nr);
32 void (*take_timebase)(void);
33 void (*give_timebase)(void);
34 int (*cpu_enable)(unsigned int nr);
35 int (*cpu_disable)(void);
36 void (*cpu_die)(unsigned int nr);
37 int (*cpu_bootable)(unsigned int nr);
41 struct machdep_calls {
42 void (*hpte_invalidate)(unsigned long slot,
46 long (*hpte_updatepp)(unsigned long slot,
51 void (*hpte_updateboltedpp)(unsigned long newpp,
53 long (*hpte_insert)(unsigned long hpte_group,
57 unsigned long rflags);
58 long (*hpte_remove)(unsigned long hpte_group);
59 void (*flush_hash_range)(unsigned long context,
62 /* special for kexec, to be called in real mode, linar mapping is
63 * destroyed as well */
64 void (*hpte_clear_all)(void);
66 void (*tce_build)(struct iommu_table * tbl,
70 enum dma_data_direction direction);
71 void (*tce_free)(struct iommu_table *tbl,
74 void (*tce_flush)(struct iommu_table *tbl);
75 void (*iommu_dev_setup)(struct pci_dev *dev);
76 void (*iommu_bus_setup)(struct pci_bus *bus);
77 void (*irq_bus_setup)(struct pci_bus *bus);
79 int (*probe)(int platform);
80 void (*setup_arch)(void);
81 void (*init_early)(void);
82 /* Optional, may be NULL. */
83 void (*get_cpuinfo)(struct seq_file *m);
85 void (*init_IRQ)(void);
86 int (*get_irq)(struct pt_regs *);
87 void (*cpu_irq_down)(int secondary);
90 void (*pcibios_fixup)(void);
91 int (*pci_probe_mode)(struct pci_bus *);
93 void (*restart)(char *cmd);
94 void (*power_off)(void);
96 void (*panic)(char *str);
97 void (*cpu_die)(void);
99 int (*set_rtc_time)(struct rtc_time *);
100 void (*get_rtc_time)(struct rtc_time *);
101 void (*get_boot_time)(struct rtc_time *);
103 void (*calibrate_decr)(void);
105 void (*progress)(char *, unsigned short);
107 /* Interface for platform error logging */
108 void (*log_error)(char *buf, unsigned int err_type, int fatal);
110 ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index);
111 ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index);
112 ssize_t (*nvram_size)(void);
113 int (*nvram_sync)(void);
115 /* Exception handlers */
116 void (*system_reset_exception)(struct pt_regs *regs);
117 int (*machine_check_exception)(struct pt_regs *regs);
119 /* Motherboard/chipset features. This is a kind of general purpose
120 * hook used to control some machine specific features (like reset
121 * lines, chip power control, etc...).
123 long (*feature_call)(unsigned int feature, ...);
125 /* Check availability of legacy devices like i8042 */
126 int (*check_legacy_ioport)(unsigned int baseport);
128 /* Get legacy PCI/IDE interrupt mapping */
129 int (*pci_get_legacy_ide_irq)(struct pci_dev *dev, int channel);
131 /* Get access protection for /dev/mem */
132 pgprot_t (*phys_mem_access_prot)(struct file *file,
133 unsigned long offset,
137 /* Idle loop for this platform, leave empty for default idle loop */
138 int (*idle_loop)(void);
140 /* Function to enable pmcs for this platform, called once per cpu. */
141 void (*enable_pmcs)(void);
144 extern int default_idle(void);
145 extern int native_idle(void);
147 extern struct machdep_calls ppc_md;
148 extern char cmd_line[COMMAND_LINE_SIZE];
150 #ifdef CONFIG_PPC_PMAC
152 * Power macintoshes have either a CUDA, PMU or SMU controlling
153 * system reset, power, NVRAM, RTC.
155 typedef enum sys_ctrler_kind {
156 SYS_CTRLER_UNKNOWN = 0,
161 extern sys_ctrler_t sys_ctrler;
163 #endif /* CONFIG_PPC_PMAC */
167 /* Functions to produce codes on the leds.
168 * The SRC code should be unique for the message category and should
169 * be limited to the lower 24 bits (the upper 8 are set by these funcs),
170 * and (for boot & dump) should be sorted numerically in the order
173 /* Print a boot progress message. */
174 void ppc64_boot_msg(unsigned int src, const char *msg);
175 /* Print a termination message (print only -- does not stop the kernel) */
176 void ppc64_terminate_msg(unsigned int src, const char *msg);
178 static inline void log_error(char *buf, unsigned int err_type, int fatal)
180 if (ppc_md.log_error)
181 ppc_md.log_error(buf, err_type, fatal);
184 #endif /* _PPC64_MACHDEP_H */
185 #endif /* __KERNEL__ */