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