5 #include <linux/config.h>
8 #include <asm-m68k/machdep.h>
16 /* We export this macro for external modules like Alsa to know if
17 * ppc_md.feature_call is implemented or not
19 #define CONFIG_PPC_HAS_FEATURE_CALLS
21 struct machdep_calls {
22 void (*setup_arch)(void);
23 /* Optional, may be NULL. */
24 int (*show_cpuinfo)(struct seq_file *m);
25 int (*show_percpuinfo)(struct seq_file *m, int i);
26 /* Optional, may be NULL. */
27 unsigned int (*irq_cannonicalize)(unsigned int irq);
28 void (*init_IRQ)(void);
29 int (*get_irq)(struct pt_regs *);
31 /* A general init function, called by ppc_init in init/main.c.
35 void (*restart)(char *cmd);
36 void (*power_off)(void);
39 long (*time_init)(void); /* Optional, may be NULL */
40 int (*set_rtc_time)(unsigned long nowtime);
41 unsigned long (*get_rtc_time)(void);
42 void (*calibrate_decr)(void);
43 void (*heartbeat)(void);
45 unsigned long (*find_end_of_memory)(void);
46 void (*setup_io_mappings)(void);
48 void (*early_serial_map)(void);
49 void (*progress)(char *, unsigned short);
51 unsigned char (*nvram_read_val)(int addr);
52 void (*nvram_write_val)(int addr, unsigned char val);
54 /* Called from prepare_namespace() */
55 void (*discover_root)(void);
57 /* Tons of keyboard stuff. */
58 int (*kbd_setkeycode)(unsigned int scancode,
59 unsigned int keycode);
60 int (*kbd_getkeycode)(unsigned int scancode);
61 int (*kbd_translate)(unsigned char scancode,
62 unsigned char *keycode,
64 char (*kbd_unexpected_up)(unsigned char keycode);
65 void (*kbd_leds)(unsigned char leds);
66 void (*kbd_init_hw)(void);
67 unsigned char *ppc_kbd_sysrq_xlate;
70 * optional PCI "hooks"
73 /* Called after scanning the bus, before allocating resources */
74 void (*pcibios_fixup)(void);
76 /* Called after PPC generic resource fixup to perform
77 machine specific fixups */
78 void (*pcibios_fixup_resources)(struct pci_dev *);
80 /* Called for each PCI bus in the system when it's probed */
81 void (*pcibios_fixup_bus)(struct pci_bus *);
83 /* Called when pci_enable_device() is called (initial=0) or
84 * when a device with no assigned resource is found (initial=1).
85 * Returns 0 to allow assignment/enabling of the device. */
86 int (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
88 /* For interrupt routing */
89 unsigned char (*pci_swizzle)(struct pci_dev *, unsigned char *);
90 int (*pci_map_irq)(struct pci_dev *, unsigned char, unsigned char);
92 /* Called in indirect_* to avoid touching devices */
93 int (*pci_exclude_device)(unsigned char, unsigned char);
95 /* Called at then very end of pcibios_init() */
96 void (*pcibios_after_init)(void);
98 /* this is for modules, since _machine can be a define -- Cort */
101 /* Motherboard/chipset features. This is a kind of general purpose
102 * hook used to control some machine specific features (like reset
103 * lines, chip power control, etc...).
105 int (*feature_call)(unsigned int feature, ...);
107 /* Hook for board-specific info passed by the bootloader */
108 void (*board_info)(void *bdinfo, int bdinfo_size);
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__ */