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 (*progress
)(char *, unsigned short);
60 void (*kgdb_map_scc
)(void);
62 unsigned char (*nvram_read_val
)(int addr
);
63 void (*nvram_write_val
)(int addr
, unsigned char val
);
64 void (*nvram_sync
)(void);
67 * optional PCI "hooks"
70 /* Called after scanning the bus, before allocating resources */
71 void (*pcibios_fixup
)(void);
73 /* Called after PPC generic resource fixup to perform
74 machine specific fixups */
75 void (*pcibios_fixup_resources
)(struct pci_dev
*);
77 /* Called for each PCI bus in the system when it's probed */
78 void (*pcibios_fixup_bus
)(struct pci_bus
*);
80 /* Called when pci_enable_device() is called (initial=0) or
81 * when a device with no assigned resource is found (initial=1).
82 * Returns 0 to allow assignment/enabling of the device. */
83 int (*pcibios_enable_device_hook
)(struct pci_dev
*, int initial
);
85 /* For interrupt routing */
86 unsigned char (*pci_swizzle
)(struct pci_dev
*, unsigned char *);
87 int (*pci_map_irq
)(struct pci_dev
*, unsigned char, unsigned char);
89 /* Called in indirect_* to avoid touching devices */
90 int (*pci_exclude_device
)(unsigned char, unsigned char);
92 /* Called at then very end of pcibios_init() */
93 void (*pcibios_after_init
)(void);
95 /* this is for modules, since _machine can be a define -- Cort */
98 /* Motherboard/chipset features. This is a kind of general purpose
99 * hook used to control some machine specific features (like reset
100 * lines, chip power control, etc...).
102 long (*feature_call
)(unsigned int feature
, ...);
105 /* functions for dealing with other cpus */
106 struct smp_ops_t
*smp_ops
;
107 #endif /* CONFIG_SMP */
110 extern struct machdep_calls ppc_md
;
111 extern char cmd_line
[COMMAND_LINE_SIZE
];
113 extern void setup_pci_ptrs(void);
116 * Power macintoshes have either a CUDA or a PMU controlling
117 * system reset, power, NVRAM, RTC.
119 typedef enum sys_ctrler_kind
{
120 SYS_CTRLER_UNKNOWN
= 0,
125 extern sys_ctrler_t sys_ctrler
;
129 void (*message_pass
)(int target
, int msg
, unsigned long data
, int wait
);
131 void (*kick_cpu
)(int nr
);
132 void (*setup_cpu
)(int nr
);
133 void (*space_timers
)(int nr
);
134 void (*take_timebase
)(void);
135 void (*give_timebase
)(void);
138 /* Poor default implementations */
139 extern void __devinit
smp_generic_give_timebase(void);
140 extern void __devinit
smp_generic_take_timebase(void);
141 #endif /* CONFIG_SMP */
143 #endif /* _PPC_MACHDEP_H */
144 #endif /* __KERNEL__ */