2 * BK Id: SCCS/s.machdep.h 1.48 10/16/02 10:15:45 paulus
8 #include <linux/config.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_cannonicalize)(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);
42 long (*time_init)(void); /* Optional, may be NULL */
43 int (*set_rtc_time)(unsigned long nowtime);
44 unsigned long (*get_rtc_time)(void);
45 void (*calibrate_decr)(void);
46 void (*heartbeat)(void);
48 unsigned long (*find_end_of_memory)(void);
49 void (*setup_io_mappings)(void);
51 void (*early_serial_map)(void);
52 void (*progress)(char *, unsigned short);
54 unsigned char (*nvram_read_val)(int addr);
55 void (*nvram_write_val)(int addr, unsigned char val);
57 /* Called from prepare_namespace() */
58 void (*discover_root)(void);
60 /* Tons of keyboard stuff. */
61 int (*kbd_setkeycode)(unsigned int scancode,
62 unsigned int keycode);
63 int (*kbd_getkeycode)(unsigned int scancode);
64 int (*kbd_translate)(unsigned char scancode,
65 unsigned char *keycode,
67 char (*kbd_unexpected_up)(unsigned char keycode);
68 void (*kbd_leds)(unsigned char leds);
69 void (*kbd_init_hw)(void);
70 unsigned char *ppc_kbd_sysrq_xlate;
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 /* this is for modules, since _machine can be a define -- Cort */
104 /* Motherboard/chipset features. This is a kind of general purpose
105 * hook used to control some machine specific features (like reset
106 * lines, chip power control, etc...).
108 int (*feature_call)(unsigned int feature, ...);
111 /* functions for dealing with other cpus */
112 struct smp_ops_t *smp_ops;
113 #endif /* CONFIG_SMP */
116 extern struct machdep_calls ppc_md;
117 extern char cmd_line[];
119 extern void setup_pci_ptrs(void);
122 * Power macintoshes have either a CUDA or a PMU controlling
123 * system reset, power, NVRAM, RTC.
125 typedef enum sys_ctrler_kind {
126 SYS_CTRLER_UNKNOWN = 0,
131 extern sys_ctrler_t sys_ctrler;
135 void (*message_pass)(int target, int msg, unsigned long data, int wait);
137 void (*kick_cpu)(int nr);
138 void (*setup_cpu)(int nr);
140 #endif /* CONFIG_SMP */
142 #endif /* _PPC_MACHDEP_H */
143 #endif /* __KERNEL__ */