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 void (*calibrate_decr)(void);
48 void (*heartbeat)(void);
49 unsigned long heartbeat_reset;
50 unsigned long heartbeat_count;
52 unsigned long (*find_end_of_memory)(void);
53 void (*setup_io_mappings)(void);
55 void (*progress)(char *, unsigned short);
56 void (*kgdb_map_scc)(void);
58 unsigned char (*nvram_read_val)(int addr);
59 void (*nvram_write_val)(int addr, unsigned char val);
60 void (*nvram_sync)(void);
63 * optional PCI "hooks"
66 /* Called after scanning the bus, before allocating resources */
67 void (*pcibios_fixup)(void);
69 /* Called after PPC generic resource fixup to perform
70 machine specific fixups */
71 void (*pcibios_fixup_resources)(struct pci_dev *);
73 /* Called for each PCI bus in the system when it's probed */
74 void (*pcibios_fixup_bus)(struct pci_bus *);
76 /* Called when pci_enable_device() is called (initial=0) or
77 * when a device with no assigned resource is found (initial=1).
78 * Returns 0 to allow assignment/enabling of the device. */
79 int (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
81 /* For interrupt routing */
82 unsigned char (*pci_swizzle)(struct pci_dev *, unsigned char *);
83 int (*pci_map_irq)(struct pci_dev *, unsigned char, unsigned char);
85 /* Called in indirect_* to avoid touching devices */
86 int (*pci_exclude_device)(unsigned char, unsigned char);
88 /* Called at then very end of pcibios_init() */
89 void (*pcibios_after_init)(void);
91 /* this is for modules, since _machine can be a define -- Cort */
94 /* Motherboard/chipset features. This is a kind of general purpose
95 * hook used to control some machine specific features (like reset
96 * lines, chip power control, etc...).
98 long (*feature_call)(unsigned int feature, ...);
101 /* functions for dealing with other cpus */
102 struct smp_ops_t *smp_ops;
103 #endif /* CONFIG_SMP */
106 extern struct machdep_calls ppc_md;
107 #define COMMAND_LINE_SIZE 512
108 extern char cmd_line[COMMAND_LINE_SIZE];
110 extern void setup_pci_ptrs(void);
113 * Power macintoshes have either a CUDA or a PMU controlling
114 * system reset, power, NVRAM, RTC.
116 typedef enum sys_ctrler_kind {
117 SYS_CTRLER_UNKNOWN = 0,
122 extern sys_ctrler_t sys_ctrler;
126 void (*message_pass)(int target, int msg, unsigned long data, int wait);
128 void (*kick_cpu)(int nr);
129 void (*setup_cpu)(int nr);
130 void (*space_timers)(int nr);
131 void (*take_timebase)(void);
132 void (*give_timebase)(void);
135 /* Poor default implementations */
136 extern void __devinit smp_generic_give_timebase(void);
137 extern void __devinit smp_generic_take_timebase(void);
138 #endif /* CONFIG_SMP */
140 #endif /* _PPC_MACHDEP_H */
141 #endif /* __KERNEL__ */