5 #include <linux/config.h>
6 #include <linux/init.h>
11 #include <asm-m68k/machdep.h>
19 /* We export this macro for external modules like Alsa to know if
20 * ppc_md.feature_call is implemented or not
22 #define CONFIG_PPC_HAS_FEATURE_CALLS
24 struct machdep_calls {
25 void (*setup_arch)(void);
26 /* Optional, may be NULL. */
27 int (*show_cpuinfo)(struct seq_file *m);
28 int (*show_percpuinfo)(struct seq_file *m, int i);
29 /* Optional, may be NULL. */
30 unsigned int (*irq_canonicalize)(unsigned int irq);
31 void (*init_IRQ)(void);
32 int (*get_irq)(struct pt_regs *);
34 /* A general init function, called by ppc_init in init/main.c.
38 void (*restart)(char *cmd);
39 void (*power_off)(void);
43 void (*power_save)(void);
45 long (*time_init)(void); /* Optional, may be NULL */
46 int (*set_rtc_time)(unsigned long nowtime);
47 unsigned long (*get_rtc_time)(void);
48 unsigned char (*rtc_read_val)(int addr);
49 void (*rtc_write_val)(int addr, unsigned char val);
50 void (*calibrate_decr)(void);
52 void (*heartbeat)(void);
53 unsigned long heartbeat_reset;
54 unsigned long heartbeat_count;
56 unsigned long (*find_end_of_memory)(void);
57 void (*setup_io_mappings)(void);
59 void (*early_serial_map)(void);
60 void (*progress)(char *, unsigned short);
61 void (*kgdb_map_scc)(void);
63 unsigned char (*nvram_read_val)(int addr);
64 void (*nvram_write_val)(int addr, unsigned char val);
65 void (*nvram_sync)(void);
68 * optional PCI "hooks"
71 /* Called after scanning the bus, before allocating resources */
72 void (*pcibios_fixup)(void);
74 /* Called after PPC generic resource fixup to perform
75 machine specific fixups */
76 void (*pcibios_fixup_resources)(struct pci_dev *);
78 /* Called for each PCI bus in the system when it's probed */
79 void (*pcibios_fixup_bus)(struct pci_bus *);
81 /* Called when pci_enable_device() is called (initial=0) or
82 * when a device with no assigned resource is found (initial=1).
83 * Returns 0 to allow assignment/enabling of the device. */
84 int (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
86 /* For interrupt routing */
87 unsigned char (*pci_swizzle)(struct pci_dev *, unsigned char *);
88 int (*pci_map_irq)(struct pci_dev *, unsigned char, unsigned char);
90 /* Called in indirect_* to avoid touching devices */
91 int (*pci_exclude_device)(unsigned char, unsigned char);
93 /* Called at then very end of pcibios_init() */
94 void (*pcibios_after_init)(void);
96 /* this is for modules, since _machine can be a define -- Cort */
99 /* Motherboard/chipset features. This is a kind of general purpose
100 * hook used to control some machine specific features (like reset
101 * lines, chip power control, etc...).
103 long (*feature_call)(unsigned int feature, ...);
106 /* functions for dealing with other cpus */
107 struct smp_ops_t *smp_ops;
108 #endif /* CONFIG_SMP */
111 extern struct machdep_calls ppc_md;
112 extern char cmd_line[COMMAND_LINE_SIZE];
114 extern void setup_pci_ptrs(void);
117 * Power macintoshes have either a CUDA or a PMU controlling
118 * system reset, power, NVRAM, RTC.
120 typedef enum sys_ctrler_kind {
121 SYS_CTRLER_UNKNOWN = 0,
126 extern sys_ctrler_t sys_ctrler;
130 void (*message_pass)(int target, int msg, unsigned long data, int wait);
132 void (*kick_cpu)(int nr);
133 void (*setup_cpu)(int nr);
134 void (*space_timers)(int nr);
135 void (*take_timebase)(void);
136 void (*give_timebase)(void);
139 /* Poor default implementations */
140 extern void __devinit smp_generic_give_timebase(void);
141 extern void __devinit smp_generic_take_timebase(void);
142 #endif /* CONFIG_SMP */
144 #endif /* _PPC_MACHDEP_H */
145 #endif /* __KERNEL__ */