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/dma-mapping.h>
24 void (*message_pass)(int target, int msg);
26 void (*kick_cpu)(int nr);
27 void (*setup_cpu)(int nr);
28 void (*take_timebase)(void);
29 void (*give_timebase)(void);
33 struct machdep_calls {
34 void (*hpte_invalidate)(unsigned long slot,
38 long (*hpte_updatepp)(unsigned long slot,
43 void (*hpte_updateboltedpp)(unsigned long newpp,
45 long (*hpte_insert)(unsigned long hpte_group,
49 unsigned long hpteflags,
52 long (*hpte_remove)(unsigned long hpte_group);
53 void (*flush_hash_range)(unsigned long context,
57 void (*tce_build)(struct iommu_table * tbl,
61 enum dma_data_direction direction);
62 void (*tce_free)(struct iommu_table *tbl,
65 void (*tce_flush)(struct iommu_table *tbl);
67 void (*setup_arch)(void);
68 /* Optional, may be NULL. */
69 void (*get_cpuinfo)(struct seq_file *m);
71 void (*init_IRQ)(void);
72 int (*get_irq)(struct pt_regs *);
75 void (*pcibios_fixup)(void);
77 /* Optional, may be NULL. */
80 void (*restart)(char *cmd);
81 void (*power_off)(void);
83 void (*panic)(char *str);
85 int (*set_rtc_time)(struct rtc_time *);
86 void (*get_rtc_time)(struct rtc_time *);
87 void (*get_boot_time)(struct rtc_time *);
89 void (*calibrate_decr)(void);
91 void (*progress)(char *, unsigned short);
93 /* Debug interface. Low level I/O to some terminal device */
94 void (*udbg_putc)(unsigned char c);
95 unsigned char (*udbg_getc)(void);
96 int (*udbg_getc_poll)(void);
98 /* Interface for platform error logging */
99 void (*log_error)(char *buf, unsigned int err_type, int fatal);
101 ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index);
102 ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index);
103 ssize_t (*nvram_size)(void);
104 int (*nvram_sync)(void);
106 /* Motherboard/chipset features. This is a kind of general purpose
107 * hook used to control some machine specific features (like reset
108 * lines, chip power control, etc...).
110 long (*feature_call)(unsigned int feature, ...);
114 extern struct machdep_calls ppc_md;
115 #define COMMAND_LINE_SIZE 512
116 extern char cmd_line[COMMAND_LINE_SIZE];
117 extern char saved_command_line[COMMAND_LINE_SIZE];
119 /* Functions to produce codes on the leds.
120 * The SRC code should be unique for the message category and should
121 * be limited to the lower 24 bits (the upper 8 are set by these funcs),
122 * and (for boot & dump) should be sorted numerically in the order
125 /* Print a boot progress message. */
126 void ppc64_boot_msg(unsigned int src, const char *msg);
127 /* Print a termination message (print only -- does not stop the kernel) */
128 void ppc64_terminate_msg(unsigned int src, const char *msg);
129 /* Print something that needs attention (device error, etc) */
130 void ppc64_attention_msg(unsigned int src, const char *msg);
131 /* Print a dump progress message. */
132 void ppc64_dump_msg(unsigned int src, const char *msg);
134 static inline void log_error(char *buf, unsigned int err_type, int fatal)
136 if (ppc_md.log_error)
137 ppc_md.log_error(buf, err_type, fatal);
140 #endif /* _PPC64_MACHDEP_H */
141 #endif /* __KERNEL__ */