6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/config.h>
22 struct machdep_calls {
23 void (*hpte_invalidate)(unsigned long slot,
24 unsigned long secondary,
26 int large, int local);
27 long (*hpte_updatepp)(unsigned long slot,
28 unsigned long secondary,
32 void (*hpte_updateboltedpp)(unsigned long newpp,
34 long (*hpte_insert)(unsigned long vpn,
36 unsigned long hpteflags,
39 long (*hpte_remove)(unsigned long hpte_group);
41 void (*tce_build)(struct TceTable * tbl,
45 void (*tce_free_one)(struct TceTable *tbl,
48 void (*smp_message_pass)(int target,
52 int (*smp_probe)(void);
53 void (*smp_kick_cpu)(int nr);
54 void (*smp_setup_cpu)(int nr);
56 void (*setup_arch)(void);
57 /* Optional, may be NULL. */
58 void (*setup_residual)(struct seq_file *m, int cpu_id);
59 /* Optional, may be NULL. */
60 void (*get_cpuinfo)(struct seq_file *m);
61 /* Optional, may be NULL. */
62 unsigned int (*irq_cannonicalize)(unsigned int irq);
63 void (*init_IRQ)(void);
64 void (*init_ras_IRQ)(void);
65 int (*get_irq)(struct pt_regs *);
67 /* A general init function, called by ppc_init in init/main.c.
71 void (*restart)(char *cmd);
72 void (*power_off)(void);
75 long (*time_init)(void); /* Optional, may be NULL */
76 int (*set_rtc_time)(struct rtc_time *);
77 void (*get_rtc_time)(struct rtc_time *);
78 void (*get_boot_time)(struct rtc_time *);
79 void (*calibrate_decr)(void);
81 void (*progress)(char *, unsigned short);
84 unsigned char (*nvram_read_val)(int addr);
85 void (*nvram_write_val)(int addr, unsigned char val);
87 /* Tons of keyboard stuff. */
88 int (*kbd_setkeycode)(unsigned int scancode,
89 unsigned int keycode);
90 int (*kbd_getkeycode)(unsigned int scancode);
91 int (*kbd_translate)(unsigned char scancode,
92 unsigned char *keycode,
94 char (*kbd_unexpected_up)(unsigned char keycode);
95 void (*kbd_leds)(unsigned char leds);
96 void (*kbd_init_hw)(void);
97 #ifdef CONFIG_MAGIC_SYSRQ
98 unsigned char *ppc_kbd_sysrq_xlate;
101 /* Debug interface. Low level I/O to some terminal device */
102 void (*udbg_putc)(unsigned char c);
103 unsigned char (*udbg_getc)(void);
104 int (*udbg_getc_poll)(void);
107 int (*pcibios_read_config_byte)(struct device_node *dn, int offset, u8 *val);
108 int (*pcibios_read_config_word)(struct device_node *dn, int offset, u16 *val);
109 int (*pcibios_read_config_dword)(struct device_node *dn, int offset, u32 *val);
110 int (*pcibios_write_config_byte)(struct device_node *dn, int offset, u8 val);
111 int (*pcibios_write_config_word)(struct device_node *dn, int offset, u16 val);
112 int (*pcibios_write_config_dword)(struct device_node *dn, int offset, u32 val);
114 /* Called after scanning the bus, before allocating
117 void (*pcibios_fixup)(void);
119 /* Called for each PCI bus in the system
122 void (*pcibios_fixup_bus)(struct pci_bus *);
124 /* Called when pci_enable_device() is called (initial=0) or
125 * when a device with no assigned resource is found (initial=1).
126 * Returns 0 to allow assignement/enabling of the device
128 int (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
130 void* (*pci_dev_io_base)(unsigned char bus, unsigned char devfn, int physical);
131 void* (*pci_dev_mem_base)(unsigned char bus, unsigned char devfn);
132 int (*pci_dev_root_bridge)(unsigned char bus, unsigned char devfn);
134 /* this is for modules, since _machine can be a define -- Cort */
138 extern struct machdep_calls ppc_md;
139 extern char cmd_line[512];
141 extern void setup_pci_ptrs(void);
144 /* Functions to produce codes on the leds.
145 * The SRC code should be unique for the message category and should
146 * be limited to the lower 24 bits (the upper 8 are set by these funcs),
147 * and (for boot & dump) should be sorted numerically in the order
150 /* Print a boot progress message. */
151 void ppc64_boot_msg(unsigned int src, const char *msg);
152 /* Print a termination message (print only -- does not stop the kernel) */
153 void ppc64_terminate_msg(unsigned int src, const char *msg);
154 /* Print something that needs attention (device error, etc) */
155 void ppc64_attention_msg(unsigned int src, const char *msg);
156 /* Print a dump progress message. */
157 void ppc64_dump_msg(unsigned int src, const char *msg);
160 #endif /* _PPC_MACHDEP_H */
161 #endif /* __KERNEL__ */