diff options
Diffstat (limited to 'include/asm-ppc')
| -rw-r--r-- | include/asm-ppc/machdep.h | 17 | ||||
| -rw-r--r-- | include/asm-ppc/mpc52xx.h | 4 | ||||
| -rw-r--r-- | include/asm-ppc/pgtable.h | 3 | ||||
| -rw-r--r-- | include/asm-ppc/prom.h | 156 | ||||
| -rw-r--r-- | include/asm-ppc/serial.h | 7 |
5 files changed, 28 insertions, 159 deletions
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index a3e8a45e45a9..e1a0a7b213d7 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h | |||
| @@ -19,6 +19,18 @@ struct pci_dev; | |||
| 19 | struct seq_file; | 19 | struct seq_file; |
| 20 | struct file; | 20 | struct file; |
| 21 | 21 | ||
| 22 | /* | ||
| 23 | * This is for compatibility with ARCH=powerpc. | ||
| 24 | */ | ||
| 25 | #define machine_is(x) __MACHINE_IS_##x | ||
| 26 | #define __MACHINE_IS_powermac 0 | ||
| 27 | #define __MACHINE_IS_chrp 0 | ||
| 28 | #ifdef CONFIG_PPC_PREP | ||
| 29 | #define __MACHINE_IS_prep 1 | ||
| 30 | #else | ||
| 31 | #define __MACHINE_IS_prep 0 | ||
| 32 | #endif | ||
| 33 | |||
| 22 | /* We export this macro for external modules like Alsa to know if | 34 | /* We export this macro for external modules like Alsa to know if |
| 23 | * ppc_md.feature_call is implemented or not | 35 | * ppc_md.feature_call is implemented or not |
| 24 | */ | 36 | */ |
| @@ -44,7 +56,7 @@ struct machdep_calls { | |||
| 44 | void (*power_off)(void); | 56 | void (*power_off)(void); |
| 45 | void (*halt)(void); | 57 | void (*halt)(void); |
| 46 | 58 | ||
| 47 | void (*idle)(void); | 59 | void (*idle_loop)(void); |
| 48 | void (*power_save)(void); | 60 | void (*power_save)(void); |
| 49 | 61 | ||
| 50 | long (*time_init)(void); /* Optional, may be NULL */ | 62 | long (*time_init)(void); /* Optional, may be NULL */ |
| @@ -104,9 +116,6 @@ struct machdep_calls { | |||
| 104 | unsigned long size, | 116 | unsigned long size, |
| 105 | pgprot_t vma_prot); | 117 | pgprot_t vma_prot); |
| 106 | 118 | ||
| 107 | /* this is for modules, since _machine can be a define -- Cort */ | ||
| 108 | int ppc_machine; | ||
| 109 | |||
| 110 | /* Motherboard/chipset features. This is a kind of general purpose | 119 | /* Motherboard/chipset features. This is a kind of general purpose |
| 111 | * hook used to control some machine specific features (like reset | 120 | * hook used to control some machine specific features (like reset |
| 112 | * lines, chip power control, etc...). | 121 | * lines, chip power control, etc...). |
diff --git a/include/asm-ppc/mpc52xx.h b/include/asm-ppc/mpc52xx.h index 6167f74635f7..7e9842805a28 100644 --- a/include/asm-ppc/mpc52xx.h +++ b/include/asm-ppc/mpc52xx.h | |||
| @@ -355,6 +355,7 @@ struct mpc52xx_xlb { | |||
| 355 | u32 snoop_window; /* XLB + 0x70 */ | 355 | u32 snoop_window; /* XLB + 0x70 */ |
| 356 | }; | 356 | }; |
| 357 | 357 | ||
| 358 | #define MPC52xx_XLB_CFG_PLDIS (1 << 31) | ||
| 358 | #define MPC52xx_XLB_CFG_SNOOP (1 << 15) | 359 | #define MPC52xx_XLB_CFG_SNOOP (1 << 15) |
| 359 | 360 | ||
| 360 | /* Clock Distribution control */ | 361 | /* Clock Distribution control */ |
| @@ -427,6 +428,9 @@ extern void mpc52xx_calibrate_decr(void); | |||
| 427 | 428 | ||
| 428 | extern void mpc52xx_find_bridges(void); | 429 | extern void mpc52xx_find_bridges(void); |
| 429 | 430 | ||
| 431 | extern void mpc52xx_setup_cpu(void); | ||
| 432 | |||
| 433 | |||
| 430 | 434 | ||
| 431 | /* Matching of PSC function */ | 435 | /* Matching of PSC function */ |
| 432 | struct mpc52xx_psc_func { | 436 | struct mpc52xx_psc_func { |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index e1c62da12e74..570b355162fa 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
| @@ -837,7 +837,8 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma, | |||
| 837 | */ | 837 | */ |
| 838 | #define pgtable_cache_init() do { } while (0) | 838 | #define pgtable_cache_init() do { } while (0) |
| 839 | 839 | ||
| 840 | extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); | 840 | extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep, |
| 841 | pmd_t **pmdp); | ||
| 841 | 842 | ||
| 842 | #include <asm-generic/pgtable.h> | 843 | #include <asm-generic/pgtable.h> |
| 843 | 844 | ||
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h index 6d431d6fb022..adc5ae784924 100644 --- a/include/asm-ppc/prom.h +++ b/include/asm-ppc/prom.h | |||
| @@ -8,126 +8,19 @@ | |||
| 8 | #ifndef _PPC_PROM_H | 8 | #ifndef _PPC_PROM_H |
| 9 | #define _PPC_PROM_H | 9 | #define _PPC_PROM_H |
| 10 | 10 | ||
| 11 | #include <linux/config.h> | 11 | /* This is used in arch/ppc/mm/mem_pieces.h */ |
| 12 | #include <linux/types.h> | ||
| 13 | |||
| 14 | typedef u32 phandle; | ||
| 15 | typedef u32 ihandle; | ||
| 16 | |||
| 17 | struct address_range { | ||
| 18 | unsigned int space; | ||
| 19 | unsigned int address; | ||
| 20 | unsigned int size; | ||
| 21 | }; | ||
| 22 | |||
| 23 | struct interrupt_info { | ||
| 24 | int line; | ||
| 25 | int sense; /* +ve/-ve logic, edge or level, etc. */ | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct reg_property { | 12 | struct reg_property { |
| 29 | unsigned int address; | 13 | unsigned int address; |
| 30 | unsigned int size; | 14 | unsigned int size; |
| 31 | }; | 15 | }; |
| 32 | 16 | ||
| 33 | struct property { | ||
| 34 | char *name; | ||
| 35 | int length; | ||
| 36 | unsigned char *value; | ||
| 37 | struct property *next; | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Note: don't change this structure for now or you'll break BootX ! | ||
| 42 | */ | ||
| 43 | struct device_node { | ||
| 44 | char *name; | ||
| 45 | char *type; | ||
| 46 | phandle node; | ||
| 47 | int n_addrs; | ||
| 48 | struct address_range *addrs; | ||
| 49 | int n_intrs; | ||
| 50 | struct interrupt_info *intrs; | ||
| 51 | char *full_name; | ||
| 52 | struct property *properties; | ||
| 53 | struct device_node *parent; | ||
| 54 | struct device_node *child; | ||
| 55 | struct device_node *sibling; | ||
| 56 | struct device_node *next; /* next device of same type */ | ||
| 57 | struct device_node *allnext; /* next in list of all nodes */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct prom_args; | ||
| 61 | typedef void (*prom_entry)(struct prom_args *); | ||
| 62 | |||
| 63 | /* OBSOLETE: Old style node lookup */ | ||
| 64 | extern struct device_node *find_devices(const char *name); | ||
| 65 | extern struct device_node *find_type_devices(const char *type); | ||
| 66 | extern struct device_node *find_path_device(const char *path); | ||
| 67 | extern struct device_node *find_compatible_devices(const char *type, | ||
| 68 | const char *compat); | ||
| 69 | extern struct device_node *find_all_nodes(void); | ||
| 70 | |||
| 71 | /* New style node lookup */ | ||
| 72 | extern struct device_node *of_find_node_by_name(struct device_node *from, | ||
| 73 | const char *name); | ||
| 74 | extern struct device_node *of_find_node_by_type(struct device_node *from, | ||
| 75 | const char *type); | ||
| 76 | extern struct device_node *of_find_compatible_node(struct device_node *from, | ||
| 77 | const char *type, const char *compat); | ||
| 78 | extern struct device_node *of_find_node_by_path(const char *path); | ||
| 79 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | ||
| 80 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
| 81 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
| 82 | struct device_node *prev); | ||
| 83 | extern struct device_node *of_node_get(struct device_node *node); | ||
| 84 | extern void of_node_put(struct device_node *node); | ||
| 85 | |||
| 86 | /* Other Prototypes */ | ||
| 87 | extern void abort(void); | ||
| 88 | extern unsigned long prom_init(int, int, prom_entry); | ||
| 89 | extern void prom_print(const char *msg); | ||
| 90 | extern void relocate_nodes(void); | ||
| 91 | extern void finish_device_tree(void); | ||
| 92 | extern int device_is_compatible(struct device_node *device, const char *); | ||
| 93 | extern int machine_is_compatible(const char *compat); | ||
| 94 | extern unsigned char *get_property(struct device_node *node, const char *name, | ||
| 95 | int *lenp); | ||
| 96 | extern int prom_add_property(struct device_node* np, struct property* prop); | ||
| 97 | extern void prom_get_irq_senses(unsigned char *, int, int); | ||
| 98 | extern int prom_n_addr_cells(struct device_node* np); | ||
| 99 | extern int prom_n_size_cells(struct device_node* np); | ||
| 100 | |||
| 101 | extern struct resource* | ||
| 102 | request_OF_resource(struct device_node* node, int index, const char* name_postfix); | ||
| 103 | extern int release_OF_resource(struct device_node* node, int index); | ||
| 104 | |||
| 105 | extern void print_properties(struct device_node *node); | ||
| 106 | extern int call_rtas(const char *service, int nargs, int nret, | ||
| 107 | unsigned long *outputs, ...); | ||
| 108 | |||
| 109 | /* | 17 | /* |
| 110 | * PCI <-> OF matching functions | 18 | * These macros assist in performing the address calculations that we |
| 111 | */ | 19 | * need to do to access data when the kernel is running at an address |
| 112 | struct pci_bus; | 20 | * that is different from the address that the kernel is linked at. |
| 113 | struct pci_dev; | 21 | * The reloc_offset() function returns the difference between these |
| 114 | extern int pci_device_from_OF_node(struct device_node *node, | 22 | * two addresses and the macros simplify the process of adding or |
| 115 | u8* bus, u8* devfn); | 23 | * subtracting this offset to/from pointer values. |
| 116 | extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int); | ||
| 117 | extern struct device_node* pci_device_to_OF_node(struct pci_dev *); | ||
| 118 | extern void pci_create_OF_bus_map(void); | ||
| 119 | |||
| 120 | /* | ||
| 121 | * When we call back to the Open Firmware client interface, we usually | ||
| 122 | * have to do that before the kernel is relocated to its final location | ||
| 123 | * (this is because we can't use OF after we have overwritten the | ||
| 124 | * exception vectors with our exception handlers). These macros assist | ||
| 125 | * in performing the address calculations that we need to do to access | ||
| 126 | * data when the kernel is running at an address that is different from | ||
| 127 | * the address that the kernel is linked at. The reloc_offset() function | ||
| 128 | * returns the difference between these two addresses and the macros | ||
| 129 | * simplify the process of adding or subtracting this offset to/from | ||
| 130 | * pointer values. See arch/ppc/kernel/prom.c for how these are used. | ||
| 131 | */ | 24 | */ |
| 132 | extern unsigned long reloc_offset(void); | 25 | extern unsigned long reloc_offset(void); |
| 133 | extern unsigned long add_reloc_offset(unsigned long); | 26 | extern unsigned long add_reloc_offset(unsigned long); |
| @@ -136,45 +29,12 @@ extern unsigned long sub_reloc_offset(unsigned long); | |||
| 136 | #define PTRRELOC(x) ((typeof(x))add_reloc_offset((unsigned long)(x))) | 29 | #define PTRRELOC(x) ((typeof(x))add_reloc_offset((unsigned long)(x))) |
| 137 | #define PTRUNRELOC(x) ((typeof(x))sub_reloc_offset((unsigned long)(x))) | 30 | #define PTRUNRELOC(x) ((typeof(x))sub_reloc_offset((unsigned long)(x))) |
| 138 | 31 | ||
| 139 | |||
| 140 | /* | ||
| 141 | * OF address retreival & translation | ||
| 142 | */ | ||
| 143 | |||
| 144 | |||
| 145 | /* Translate an OF address block into a CPU physical address | ||
| 146 | */ | ||
| 147 | #define OF_BAD_ADDR ((u64)-1) | ||
| 148 | extern u64 of_translate_address(struct device_node *np, u32 *addr); | ||
| 149 | |||
| 150 | /* Extract an address from a device, returns the region size and | ||
| 151 | * the address space flags too. The PCI version uses a BAR number | ||
| 152 | * instead of an absolute index | ||
| 153 | */ | ||
| 154 | extern u32 *of_get_address(struct device_node *dev, int index, | ||
| 155 | u64 *size, unsigned int *flags); | ||
| 156 | extern u32 *of_get_pci_address(struct device_node *dev, int bar_no, | ||
| 157 | u64 *size, unsigned int *flags); | ||
| 158 | |||
| 159 | /* Get an address as a resource. Note that if your address is | ||
| 160 | * a PIO address, the conversion will fail if the physical address | ||
| 161 | * can't be internally converted to an IO token with | ||
| 162 | * pci_address_to_pio(), that is because it's either called to early | ||
| 163 | * or it can't be matched to any host bridge IO space | ||
| 164 | */ | ||
| 165 | extern int of_address_to_resource(struct device_node *dev, int index, | ||
| 166 | struct resource *r); | ||
| 167 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
| 168 | struct resource *r); | ||
| 169 | |||
| 170 | #ifndef CONFIG_PPC_OF | ||
| 171 | /* | 32 | /* |
| 172 | * Fallback definitions for builds where we don't have prom.c included. | 33 | * Fallback definitions since we don't support OF in arch/ppc any more. |
| 173 | */ | 34 | */ |
| 174 | #define machine_is_compatible(x) 0 | 35 | #define machine_is_compatible(x) 0 |
| 175 | #define of_find_compatible_node(f, t, c) NULL | 36 | #define of_find_compatible_node(f, t, c) NULL |
| 176 | #define get_property(p, n, l) NULL | 37 | #define get_property(p, n, l) NULL |
| 177 | #endif | ||
| 178 | 38 | ||
| 179 | #endif /* _PPC_PROM_H */ | 39 | #endif /* _PPC_PROM_H */ |
| 180 | #endif /* __KERNEL__ */ | 40 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h index 485a924e4d06..b74af5461564 100644 --- a/include/asm-ppc/serial.h +++ b/include/asm-ppc/serial.h | |||
| @@ -41,15 +41,10 @@ | |||
| 41 | #else | 41 | #else |
| 42 | 42 | ||
| 43 | /* | 43 | /* |
| 44 | * XXX Assume for now it has PC-style ISA serial ports. | 44 | * XXX Assume it has PC-style ISA serial ports - true for PReP at least. |
| 45 | * This is true for PReP and CHRP at least. | ||
| 46 | */ | 45 | */ |
| 47 | #include <asm/pc_serial.h> | 46 | #include <asm/pc_serial.h> |
| 48 | 47 | ||
| 49 | #if defined(CONFIG_MAC_SERIAL) | ||
| 50 | #define SERIAL_DEV_OFFSET ((_machine == _MACH_prep || _machine == _MACH_chrp) ? 0 : 2) | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #endif /* !CONFIG_GEMINI and others */ | 48 | #endif /* !CONFIG_GEMINI and others */ |
| 54 | #endif /* __ASM_SERIAL_H__ */ | 49 | #endif /* __ASM_SERIAL_H__ */ |
| 55 | #endif /* __KERNEL__ */ | 50 | #endif /* __KERNEL__ */ |
