2 #ifndef _PPC64_MACHDEP_H
3 #define _PPC64_MACHDEP_H
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>
13 #include <linux/seq_file.h>
14 #include <linux/init.h>
15 #include <linux/dma-mapping.h>
17 #include <asm/setup.h>
27 void (*message_pass)(int target, int msg);
29 void (*kick_cpu)(int nr);
30 void (*setup_cpu)(int nr);
31 void (*take_timebase)(void);
32 void (*give_timebase)(void);
36 struct machdep_calls {
37 void (*hpte_invalidate)(unsigned long slot,
41 long (*hpte_updatepp)(unsigned long slot,
46 void (*hpte_updateboltedpp)(unsigned long newpp,
48 long (*hpte_insert)(unsigned long hpte_group,
52 unsigned long hpteflags,
55 long (*hpte_remove)(unsigned long hpte_group);
56 void (*flush_hash_range)(unsigned long context,
60 void (*tce_build)(struct iommu_table * tbl,
64 enum dma_data_direction direction);
65 void (*tce_free)(struct iommu_table *tbl,
68 void (*tce_flush)(struct iommu_table *tbl);
70 void (*setup_arch)(void);
71 /* Optional, may be NULL. */
72 void (*get_cpuinfo)(struct seq_file *m);
74 void (*init_IRQ)(void);
75 int (*get_irq)(struct pt_regs *);
78 void (*pcibios_fixup)(void);
80 /* Optional, may be NULL. */
83 void (*restart)(char *cmd);
84 void (*power_off)(void);
86 void (*panic)(char *str);
88 int (*set_rtc_time)(struct rtc_time *);
89 void (*get_rtc_time)(struct rtc_time *);
90 void (*get_boot_time)(struct rtc_time *);
92 void (*calibrate_decr)(void);
94 void (*progress)(char *, unsigned short);
96 /* Debug interface. Low level I/O to some terminal device */
97 void (*udbg_putc)(unsigned char c);
98 unsigned char (*udbg_getc)(void);
99 int (*udbg_getc_poll)(void);
101 /* Interface for platform error logging */
102 void (*log_error)(char *buf, unsigned int err_type, int fatal);
104 ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index);
105 ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index);
106 ssize_t (*nvram_size)(void);
107 int (*nvram_sync)(void);
109 /* Motherboard/chipset features. This is a kind of general purpose
110 * hook used to control some machine specific features (like reset
111 * lines, chip power control, etc...).
113 long (*feature_call)(unsigned int feature, ...);
117 extern struct machdep_calls ppc_md;
118 extern char cmd_line[COMMAND_LINE_SIZE];
120 /* Functions to produce codes on the leds.
121 * The SRC code should be unique for the message category and should
122 * be limited to the lower 24 bits (the upper 8 are set by these funcs),
123 * and (for boot & dump) should be sorted numerically in the order
126 /* Print a boot progress message. */
127 void ppc64_boot_msg(unsigned int src, const char *msg);
128 /* Print a termination message (print only -- does not stop the kernel) */
129 void ppc64_terminate_msg(unsigned int src, const char *msg);
130 /* Print something that needs attention (device error, etc) */
131 void ppc64_attention_msg(unsigned int src, const char *msg);
132 /* Print a dump progress message. */
133 void ppc64_dump_msg(unsigned int src, const char *msg);
135 static inline void log_error(char *buf, unsigned int err_type, int fatal)
137 if (ppc_md.log_error)
138 ppc_md.log_error(buf, err_type, fatal);
141 #endif /* _PPC64_MACHDEP_H */
142 #endif /* __KERNEL__ */