diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-19 09:11:21 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-19 09:11:21 -0400 |
commit | 143a1dec7e04e0a9712ff93e779aabfb21dfd97c (patch) | |
tree | 3a60a4e630d792fb3cdc6e962ce0ecfd94bb2672 /include | |
parent | 7ed476d17f04473f70d796cb6c172bdcfcc9b8e5 (diff) |
powerpc: Merge machdep.h
A few things change for consistency between ppc32 and ppc64:
idle functions return void; *_get_boot_time functions return
unsigned long (i.e. time_t) rather than filling in a struct rtc_time
(since that's useful to the callers and easier for pmac to
generate); *_get_rtc_time and *_set_rtc_time functions take
a struct rtc_time; irq_canonicalize is gone; nvram_sync returns
void.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/machdep.h (renamed from include/asm-ppc64/machdep.h) | 121 | ||||
-rw-r--r-- | include/asm-powerpc/rtas.h | 2 |
2 files changed, 114 insertions, 9 deletions
diff --git a/include/asm-ppc64/machdep.h b/include/asm-powerpc/machdep.h index d35d9d3e44cf..f060553b997a 100644 --- a/include/asm-ppc64/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _PPC64_MACHDEP_H | 1 | #ifndef _PPC64_MACHDEP_H |
3 | #define _PPC64_MACHDEP_H | 2 | #define _PPC64_MACHDEP_H |
3 | #ifdef __KERNEL__ | ||
4 | 4 | ||
5 | /* | 5 | /* |
6 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
@@ -16,6 +16,11 @@ | |||
16 | 16 | ||
17 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
18 | 18 | ||
19 | /* We export this macro for external modules like Alsa to know if | ||
20 | * ppc_md.feature_call is implemented or not | ||
21 | */ | ||
22 | #define CONFIG_PPC_HAS_FEATURE_CALLS | ||
23 | |||
19 | struct pt_regs; | 24 | struct pt_regs; |
20 | struct pci_bus; | 25 | struct pci_bus; |
21 | struct device_node; | 26 | struct device_node; |
@@ -39,6 +44,7 @@ struct smp_ops_t { | |||
39 | #endif | 44 | #endif |
40 | 45 | ||
41 | struct machdep_calls { | 46 | struct machdep_calls { |
47 | #ifdef CONFIG_PPC64 | ||
42 | void (*hpte_invalidate)(unsigned long slot, | 48 | void (*hpte_invalidate)(unsigned long slot, |
43 | unsigned long va, | 49 | unsigned long va, |
44 | int large, | 50 | int large, |
@@ -74,6 +80,7 @@ struct machdep_calls { | |||
74 | void (*iommu_dev_setup)(struct pci_dev *dev); | 80 | void (*iommu_dev_setup)(struct pci_dev *dev); |
75 | void (*iommu_bus_setup)(struct pci_bus *bus); | 81 | void (*iommu_bus_setup)(struct pci_bus *bus); |
76 | void (*irq_bus_setup)(struct pci_bus *bus); | 82 | void (*irq_bus_setup)(struct pci_bus *bus); |
83 | #endif | ||
77 | 84 | ||
78 | int (*probe)(int platform); | 85 | int (*probe)(int platform); |
79 | void (*setup_arch)(void); | 86 | void (*setup_arch)(void); |
@@ -86,6 +93,7 @@ struct machdep_calls { | |||
86 | void (*cpu_irq_down)(int secondary); | 93 | void (*cpu_irq_down)(int secondary); |
87 | 94 | ||
88 | /* PCI stuff */ | 95 | /* PCI stuff */ |
96 | /* Called after scanning the bus, before allocating resources */ | ||
89 | void (*pcibios_fixup)(void); | 97 | void (*pcibios_fixup)(void); |
90 | int (*pci_probe_mode)(struct pci_bus *); | 98 | int (*pci_probe_mode)(struct pci_bus *); |
91 | 99 | ||
@@ -95,9 +103,13 @@ struct machdep_calls { | |||
95 | void (*panic)(char *str); | 103 | void (*panic)(char *str); |
96 | void (*cpu_die)(void); | 104 | void (*cpu_die)(void); |
97 | 105 | ||
106 | long (*time_init)(void); /* Optional, may be NULL */ | ||
107 | |||
98 | int (*set_rtc_time)(struct rtc_time *); | 108 | int (*set_rtc_time)(struct rtc_time *); |
99 | void (*get_rtc_time)(struct rtc_time *); | 109 | void (*get_rtc_time)(struct rtc_time *); |
100 | void (*get_boot_time)(struct rtc_time *); | 110 | unsigned long (*get_boot_time)(void); |
111 | unsigned char (*rtc_read_val)(int addr); | ||
112 | void (*rtc_write_val)(int addr, unsigned char val); | ||
101 | 113 | ||
102 | void (*calibrate_decr)(void); | 114 | void (*calibrate_decr)(void); |
103 | 115 | ||
@@ -109,7 +121,7 @@ struct machdep_calls { | |||
109 | ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index); | 121 | ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index); |
110 | ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index); | 122 | ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index); |
111 | ssize_t (*nvram_size)(void); | 123 | ssize_t (*nvram_size)(void); |
112 | int (*nvram_sync)(void); | 124 | void (*nvram_sync)(void); |
113 | 125 | ||
114 | /* Exception handlers */ | 126 | /* Exception handlers */ |
115 | void (*system_reset_exception)(struct pt_regs *regs); | 127 | void (*system_reset_exception)(struct pt_regs *regs); |
@@ -134,14 +146,100 @@ struct machdep_calls { | |||
134 | pgprot_t vma_prot); | 146 | pgprot_t vma_prot); |
135 | 147 | ||
136 | /* Idle loop for this platform, leave empty for default idle loop */ | 148 | /* Idle loop for this platform, leave empty for default idle loop */ |
137 | int (*idle_loop)(void); | 149 | void (*idle_loop)(void); |
138 | 150 | ||
139 | /* Function to enable pmcs for this platform, called once per cpu. */ | 151 | /* Function to enable performance monitor counters for this |
152 | platform, called once per cpu. */ | ||
140 | void (*enable_pmcs)(void); | 153 | void (*enable_pmcs)(void); |
154 | |||
155 | #ifdef CONFIG_PPC32 /* XXX for now */ | ||
156 | /* Optional, may be NULL. */ | ||
157 | int (*show_cpuinfo)(struct seq_file *m); | ||
158 | int (*show_percpuinfo)(struct seq_file *m, int i); | ||
159 | |||
160 | /* A general init function, called by ppc_init in init/main.c. | ||
161 | May be NULL. */ | ||
162 | void (*init)(void); | ||
163 | |||
164 | void (*idle)(void); | ||
165 | void (*power_save)(void); | ||
166 | |||
167 | void (*heartbeat)(void); | ||
168 | unsigned long heartbeat_reset; | ||
169 | unsigned long heartbeat_count; | ||
170 | |||
171 | unsigned long (*find_end_of_memory)(void); | ||
172 | void (*setup_io_mappings)(void); | ||
173 | |||
174 | void (*early_serial_map)(void); | ||
175 | void (*kgdb_map_scc)(void); | ||
176 | |||
177 | unsigned char (*nvram_read_val)(int addr); | ||
178 | void (*nvram_write_val)(int addr, unsigned char val); | ||
179 | |||
180 | /* | ||
181 | * optional PCI "hooks" | ||
182 | */ | ||
183 | |||
184 | /* Called after PPC generic resource fixup to perform | ||
185 | machine specific fixups */ | ||
186 | void (*pcibios_fixup_resources)(struct pci_dev *); | ||
187 | |||
188 | /* Called for each PCI bus in the system when it's probed */ | ||
189 | void (*pcibios_fixup_bus)(struct pci_bus *); | ||
190 | |||
191 | /* Called when pci_enable_device() is called (initial=0) or | ||
192 | * when a device with no assigned resource is found (initial=1). | ||
193 | * Returns 0 to allow assignment/enabling of the device. */ | ||
194 | int (*pcibios_enable_device_hook)(struct pci_dev *, int initial); | ||
195 | |||
196 | /* For interrupt routing */ | ||
197 | unsigned char (*pci_swizzle)(struct pci_dev *, unsigned char *); | ||
198 | int (*pci_map_irq)(struct pci_dev *, unsigned char, unsigned char); | ||
199 | |||
200 | /* Called in indirect_* to avoid touching devices */ | ||
201 | int (*pci_exclude_device)(unsigned char, unsigned char); | ||
202 | |||
203 | /* Called at then very end of pcibios_init() */ | ||
204 | void (*pcibios_after_init)(void); | ||
205 | |||
206 | /* this is for modules, since _machine can be a define -- Cort */ | ||
207 | int ppc_machine; | ||
208 | |||
209 | #ifdef CONFIG_KEXEC | ||
210 | /* Called to shutdown machine specific hardware not already controlled | ||
211 | * by other drivers. | ||
212 | * XXX Should we move this one out of kexec scope? | ||
213 | */ | ||
214 | void (*machine_shutdown)(void); | ||
215 | |||
216 | /* Called to do the minimal shutdown needed to run a kexec'd kernel | ||
217 | * to run successfully. | ||
218 | * XXX Should we move this one out of kexec scope? | ||
219 | */ | ||
220 | void (*machine_crash_shutdown)(void); | ||
221 | |||
222 | /* Called to do what every setup is needed on image and the | ||
223 | * reboot code buffer. Returns 0 on success. | ||
224 | * Provide your own (maybe dummy) implementation if your platform | ||
225 | * claims to support kexec. | ||
226 | */ | ||
227 | int (*machine_kexec_prepare)(struct kimage *image); | ||
228 | |||
229 | /* Called to handle any machine specific cleanup on image */ | ||
230 | void (*machine_kexec_cleanup)(struct kimage *image); | ||
231 | |||
232 | /* Called to perform the _real_ kexec. | ||
233 | * Do NOT allocate memory or fail here. We are past the point of | ||
234 | * no return. | ||
235 | */ | ||
236 | void (*machine_kexec)(struct kimage *image); | ||
237 | #endif /* CONFIG_KEXEC */ | ||
238 | #endif /* CONFIG_PPC32 */ | ||
141 | }; | 239 | }; |
142 | 240 | ||
143 | extern int default_idle(void); | 241 | extern void default_idle(void); |
144 | extern int native_idle(void); | 242 | extern void native_idle(void); |
145 | 243 | ||
146 | extern struct machdep_calls ppc_md; | 244 | extern struct machdep_calls ppc_md; |
147 | extern char cmd_line[COMMAND_LINE_SIZE]; | 245 | extern char cmd_line[COMMAND_LINE_SIZE]; |
@@ -161,6 +259,13 @@ extern sys_ctrler_t sys_ctrler; | |||
161 | 259 | ||
162 | #endif /* CONFIG_PPC_PMAC */ | 260 | #endif /* CONFIG_PPC_PMAC */ |
163 | 261 | ||
262 | extern void setup_pci_ptrs(void); | ||
263 | |||
264 | #ifdef CONFIG_SMP | ||
265 | /* Poor default implementations */ | ||
266 | extern void __devinit smp_generic_give_timebase(void); | ||
267 | extern void __devinit smp_generic_take_timebase(void); | ||
268 | #endif /* CONFIG_SMP */ | ||
164 | 269 | ||
165 | 270 | ||
166 | /* Functions to produce codes on the leds. | 271 | /* Functions to produce codes on the leds. |
@@ -180,5 +285,5 @@ static inline void log_error(char *buf, unsigned int err_type, int fatal) | |||
180 | ppc_md.log_error(buf, err_type, fatal); | 285 | ppc_md.log_error(buf, err_type, fatal); |
181 | } | 286 | } |
182 | 287 | ||
183 | #endif /* _PPC64_MACHDEP_H */ | ||
184 | #endif /* __KERNEL__ */ | 288 | #endif /* __KERNEL__ */ |
289 | #endif /* _PPC64_MACHDEP_H */ | ||
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index 5c904d371963..2c050332471d 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -190,7 +190,7 @@ extern void rtas_progress(char *s, unsigned short hex); | |||
190 | extern void rtas_initialize(void); | 190 | extern void rtas_initialize(void); |
191 | 191 | ||
192 | struct rtc_time; | 192 | struct rtc_time; |
193 | extern void rtas_get_boot_time(struct rtc_time *rtc_time); | 193 | extern unsigned long rtas_get_boot_time(void); |
194 | extern void rtas_get_rtc_time(struct rtc_time *rtc_time); | 194 | extern void rtas_get_rtc_time(struct rtc_time *rtc_time); |
195 | extern int rtas_set_rtc_time(struct rtc_time *rtc_time); | 195 | extern int rtas_set_rtc_time(struct rtc_time *rtc_time); |
196 | 196 | ||