5 #include <linux/config.h>
6 #include <linux/init.h>
7 #include <linux/kexec.h>
13 #include <asm-m68k/machdep.h>
22 /* We export this macro for external modules like Alsa to know if
23 * ppc_md.feature_call is implemented or not
25 #define CONFIG_PPC_HAS_FEATURE_CALLS
27 struct machdep_calls {
28 void (*setup_arch)(void);
29 /* Optional, may be NULL. */
30 int (*show_cpuinfo)(struct seq_file *m);
31 int (*show_percpuinfo)(struct seq_file *m, int i);
32 /* Optional, may be NULL. */
33 unsigned int (*irq_canonicalize)(unsigned int irq);
34 void (*init_IRQ)(void);
35 int (*get_irq)(struct pt_regs *);
37 /* A general init function, called by ppc_init in init/main.c.
38 May be NULL. DEPRECATED ! */
40 /* For compatibility with merged platforms */
41 void (*init_early)(void);
43 void (*restart)(char *cmd);
44 void (*power_off)(void);
47 void (*idle_loop)(void);
48 void (*power_save)(void);
50 long (*time_init)(void); /* Optional, may be NULL */
51 int (*set_rtc_time)(unsigned long nowtime);
52 unsigned long (*get_rtc_time)(void);
53 unsigned char (*rtc_read_val)(int addr);
54 void (*rtc_write_val)(int addr, unsigned char val);
55 void (*calibrate_decr)(void);
57 void (*heartbeat)(void);
58 unsigned long heartbeat_reset;
59 unsigned long heartbeat_count;
61 unsigned long (*find_end_of_memory)(void);
62 void (*setup_io_mappings)(void);
64 void (*early_serial_map)(void);
65 void (*progress)(char *, unsigned short);
66 void (*kgdb_map_scc)(void);
68 unsigned char (*nvram_read_val)(int addr);
69 void (*nvram_write_val)(int addr, unsigned char val);
70 void (*nvram_sync)(void);
73 * optional PCI "hooks"
76 /* Called after scanning the bus, before allocating resources */
77 void (*pcibios_fixup)(void);
79 /* Called after PPC generic resource fixup to perform
80 machine specific fixups */
81 void (*pcibios_fixup_resources)(struct pci_dev *);
83 /* Called for each PCI bus in the system when it's probed */
84 void (*pcibios_fixup_bus)(struct pci_bus *);
86 /* Called when pci_enable_device() is called (initial=0) or
87 * when a device with no assigned resource is found (initial=1).
88 * Returns 0 to allow assignment/enabling of the device. */
89 int (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
91 /* For interrupt routing */
92 unsigned char (*pci_swizzle)(struct pci_dev *, unsigned char *);
93 int (*pci_map_irq)(struct pci_dev *, unsigned char, unsigned char);
95 /* Called in indirect_* to avoid touching devices */
96 int (*pci_exclude_device)(unsigned char, unsigned char);
98 /* Called at then very end of pcibios_init() */
99 void (*pcibios_after_init)(void);
101 /* Get access protection for /dev/mem */
102 pgprot_t (*phys_mem_access_prot)(struct file *file,
107 /* Motherboard/chipset features. This is a kind of general purpose
108 * hook used to control some machine specific features (like reset
109 * lines, chip power control, etc...).
111 long (*feature_call)(unsigned int feature, ...);
114 /* functions for dealing with other cpus */
115 struct smp_ops_t *smp_ops;
116 #endif /* CONFIG_SMP */
119 /* Called to shutdown machine specific hardware not already controlled
121 * XXX Should we move this one out of kexec scope?
123 void (*machine_shutdown)(void);
125 /* Called to do the minimal shutdown needed to run a kexec'd kernel
126 * to run successfully.
127 * XXX Should we move this one out of kexec scope?
129 void (*machine_crash_shutdown)(void);
131 /* Called to do what every setup is needed on image and the
132 * reboot code buffer. Returns 0 on success.
133 * Provide your own (maybe dummy) implementation if your platform
134 * claims to support kexec.
136 int (*machine_kexec_prepare)(struct kimage *image);
138 /* Called to handle any machine specific cleanup on image */
139 void (*machine_kexec_cleanup)(struct kimage *image);
141 /* Called to perform the _real_ kexec.
142 * Do NOT allocate memory or fail here. We are past the point of
145 void (*machine_kexec)(struct kimage *image);
146 #endif /* CONFIG_KEXEC */
149 extern struct machdep_calls ppc_md;
150 extern char cmd_line[COMMAND_LINE_SIZE];
152 extern void setup_pci_ptrs(void);
156 void (*message_pass)(int target, int msg);
158 void (*kick_cpu)(int nr);
159 void (*setup_cpu)(int nr);
160 void (*space_timers)(int nr);
161 void (*take_timebase)(void);
162 void (*give_timebase)(void);
165 /* Poor default implementations */
166 extern void __devinit smp_generic_give_timebase(void);
167 extern void __devinit smp_generic_take_timebase(void);
168 #endif /* CONFIG_SMP */
170 #endif /* _PPC_MACHDEP_H */
171 #endif /* __KERNEL__ */