aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 23:23:46 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 23:23:46 -0500
commitf093182d313edde9b1f86dbdaf40ba4da2dbd0e7 (patch)
treeecfc614d514bd5b43a98cf4c62fdd2f47d86e33c /include
parentd27ba47e7e8c466c18983a1779d611f82d6a354f (diff)
parent76c8e25b905f99be5ddbe999597ba7c2c33ec64b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/ide.h (renamed from include/asm-ppc/ide.h)29
-rw-r--r--include/asm-powerpc/machdep.h4
-rw-r--r--include/asm-powerpc/ppc-pci.h1
-rw-r--r--include/asm-powerpc/prom.h2
-rw-r--r--include/asm-powerpc/reg.h9
-rw-r--r--include/asm-powerpc/smp.h4
-rw-r--r--include/asm-powerpc/smu.h199
-rw-r--r--include/asm-powerpc/xmon.h1
-rw-r--r--include/asm-ppc/btext.h22
-rw-r--r--include/asm-ppc/io.h12
-rw-r--r--include/asm-ppc/kgdb.h2
-rw-r--r--include/asm-ppc/prom.h2
-rw-r--r--include/asm-ppc64/ide.h30
-rw-r--r--include/asm-ppc64/pci.h8
-rw-r--r--include/asm-ppc64/ppcdebug.h108
-rw-r--r--include/asm-ppc64/prom.h2
-rw-r--r--include/asm-ppc64/udbg.h3
-rw-r--r--include/linux/proc_fs.h9
18 files changed, 261 insertions, 186 deletions
diff --git a/include/asm-ppc/ide.h b/include/asm-powerpc/ide.h
index 7d6e6599fac4..da5f640480cf 100644
--- a/include/asm-ppc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -1,24 +1,27 @@
1/* 1/*
2 * linux/include/asm-ppc/ide.h 2 * Copyright (C) 1994-1996 Linus Torvalds & authors
3 * 3 *
4 * Copyright (C) 1994-1996 Linus Torvalds & authors */ 4 * This file contains the powerpc architecture specific IDE code.
5
6/*
7 * This file contains the ppc architecture specific IDE code.
8 */ 5 */
9 6#ifndef _ASM_POWERPC_IDE_H
10#ifndef __ASMPPC_IDE_H 7#define _ASM_POWERPC_IDE_H
11#define __ASMPPC_IDE_H
12 8
13#ifdef __KERNEL__ 9#ifdef __KERNEL__
14 10
11#ifndef __powerpc64__
15#include <linux/sched.h> 12#include <linux/sched.h>
16#include <asm/mpc8xx.h> 13#include <asm/mpc8xx.h>
14#endif
17 15
18#ifndef MAX_HWIFS 16#ifndef MAX_HWIFS
17#ifdef __powerpc64__
18#define MAX_HWIFS 10
19#else
19#define MAX_HWIFS 8 20#define MAX_HWIFS 8
20#endif 21#endif
22#endif
21 23
24#ifndef __powerpc64__
22#include <linux/config.h> 25#include <linux/config.h>
23#include <linux/hdreg.h> 26#include <linux/hdreg.h>
24#include <linux/ioport.h> 27#include <linux/ioport.h>
@@ -59,9 +62,6 @@ static __inline__ unsigned long ide_default_io_base(int index)
59 return 0; 62 return 0;
60} 63}
61 64
62#define IDE_ARCH_OBSOLETE_INIT
63#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
64
65#ifdef CONFIG_PCI 65#ifdef CONFIG_PCI
66#define ide_init_default_irq(base) (0) 66#define ide_init_default_irq(base) (0)
67#else 67#else
@@ -73,6 +73,11 @@ static __inline__ unsigned long ide_default_io_base(int index)
73#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1) 73#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
74#endif 74#endif
75 75
76#endif /* __powerpc64__ */
77
78#define IDE_ARCH_OBSOLETE_INIT
79#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
80
76#endif /* __KERNEL__ */ 81#endif /* __KERNEL__ */
77 82
78#endif /* __ASMPPC_IDE_H */ 83#endif /* _ASM_POWERPC_IDE_H */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index fa03864d06eb..5670f0cd6143 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -82,7 +82,6 @@ struct machdep_calls {
82 void (*iommu_dev_setup)(struct pci_dev *dev); 82 void (*iommu_dev_setup)(struct pci_dev *dev);
83 void (*iommu_bus_setup)(struct pci_bus *bus); 83 void (*iommu_bus_setup)(struct pci_bus *bus);
84 void (*irq_bus_setup)(struct pci_bus *bus); 84 void (*irq_bus_setup)(struct pci_bus *bus);
85 int (*set_dabr)(unsigned long dabr);
86#endif 85#endif
87 86
88 int (*probe)(int platform); 87 int (*probe)(int platform);
@@ -158,6 +157,9 @@ struct machdep_calls {
158 platform, called once per cpu. */ 157 platform, called once per cpu. */
159 void (*enable_pmcs)(void); 158 void (*enable_pmcs)(void);
160 159
160 /* Set DABR for this platform, leave empty for default implemenation */
161 int (*set_dabr)(unsigned long dabr);
162
161#ifdef CONFIG_PPC32 /* XXX for now */ 163#ifdef CONFIG_PPC32 /* XXX for now */
162 /* A general init function, called by ppc_init in init/main.c. 164 /* A general init function, called by ppc_init in init/main.c.
163 May be NULL. */ 165 May be NULL. */
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h
index a88728fba8f6..13aacff755f3 100644
--- a/include/asm-powerpc/ppc-pci.h
+++ b/include/asm-powerpc/ppc-pci.h
@@ -34,6 +34,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
34 34
35void pci_devs_phb_init(void); 35void pci_devs_phb_init(void);
36void pci_devs_phb_init_dynamic(struct pci_controller *phb); 36void pci_devs_phb_init_dynamic(struct pci_controller *phb);
37void __devinit scan_phb(struct pci_controller *hose);
37 38
38/* PCI address cache management routines */ 39/* PCI address cache management routines */
39void pci_addr_cache_insert_device(struct pci_dev *dev); 40void pci_addr_cache_insert_device(struct pci_dev *dev);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 7587bf5f38c6..f999df1c5c90 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -203,7 +203,7 @@ extern int prom_n_addr_cells(struct device_node* np);
203extern int prom_n_size_cells(struct device_node* np); 203extern int prom_n_size_cells(struct device_node* np);
204extern int prom_n_intr_cells(struct device_node* np); 204extern int prom_n_intr_cells(struct device_node* np);
205extern void prom_get_irq_senses(unsigned char *senses, int off, int max); 205extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
206extern void prom_add_property(struct device_node* np, struct property* prop); 206extern int prom_add_property(struct device_node* np, struct property* prop);
207 207
208#ifdef CONFIG_PPC32 208#ifdef CONFIG_PPC32
209/* 209/*
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index da848412f11b..489cf4c99c21 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -396,6 +396,9 @@
396#define SPRN_VRSAVE 0x100 /* Vector Register Save Register */ 396#define SPRN_VRSAVE 0x100 /* Vector Register Save Register */
397#define SPRN_XER 0x001 /* Fixed Point Exception Register */ 397#define SPRN_XER 0x001 /* Fixed Point Exception Register */
398 398
399#define SPRN_SCOMC 0x114 /* SCOM Access Control */
400#define SPRN_SCOMD 0x115 /* SCOM Access DATA */
401
399/* Performance monitor SPRs */ 402/* Performance monitor SPRs */
400#ifdef CONFIG_PPC64 403#ifdef CONFIG_PPC64
401#define SPRN_MMCR0 795 404#define SPRN_MMCR0 795
@@ -594,7 +597,11 @@ static inline void ppc64_runlatch_off(void)
594 mtspr(SPRN_CTRLT, ctrl); 597 mtspr(SPRN_CTRLT, ctrl);
595 } 598 }
596} 599}
597#endif 600
601extern unsigned long scom970_read(unsigned int address);
602extern void scom970_write(unsigned int address, unsigned long value);
603
604#endif /* CONFIG_PPC64 */
598 605
599#define __get_SP() ({unsigned long sp; \ 606#define __get_SP() ({unsigned long sp; \
600 asm volatile("mr %0,1": "=r" (sp)); sp;}) 607 asm volatile("mr %0,1": "=r" (sp)); sp;})
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 8bcdd0faefea..98581e5a8279 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -86,7 +86,6 @@ extern void __cpu_die(unsigned int cpu);
86#else 86#else
87/* for UP */ 87/* for UP */
88#define smp_setup_cpu_maps() 88#define smp_setup_cpu_maps()
89#define smp_release_cpus()
90 89
91#endif /* CONFIG_SMP */ 90#endif /* CONFIG_SMP */
92 91
@@ -94,6 +93,9 @@ extern void __cpu_die(unsigned int cpu);
94#define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id) 93#define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id)
95#define set_hard_smp_processor_id(CPU, VAL) \ 94#define set_hard_smp_processor_id(CPU, VAL) \
96 do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0) 95 do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0)
96
97extern void smp_release_cpus(void);
98
97#else 99#else
98/* 32-bit */ 100/* 32-bit */
99#ifndef CONFIG_SMP 101#ifndef CONFIG_SMP
diff --git a/include/asm-powerpc/smu.h b/include/asm-powerpc/smu.h
index dee8eefe47bc..76c29a9784dd 100644
--- a/include/asm-powerpc/smu.h
+++ b/include/asm-powerpc/smu.h
@@ -20,16 +20,52 @@
20/* 20/*
21 * Partition info commands 21 * Partition info commands
22 * 22 *
23 * I do not know what those are for at this point 23 * These commands are used to retreive the sdb-partition-XX datas from
24 * the SMU. The lenght is always 2. First byte is the subcommand code
25 * and second byte is the partition ID.
26 *
27 * The reply is 6 bytes:
28 *
29 * - 0..1 : partition address
30 * - 2 : a byte containing the partition ID
31 * - 3 : length (maybe other bits are rest of header ?)
32 *
33 * The data must then be obtained with calls to another command:
34 * SMU_CMD_MISC_ee_GET_DATABLOCK_REC (described below).
24 */ 35 */
25#define SMU_CMD_PARTITION_COMMAND 0x3e 36#define SMU_CMD_PARTITION_COMMAND 0x3e
37#define SMU_CMD_PARTITION_LATEST 0x01
38#define SMU_CMD_PARTITION_BASE 0x02
39#define SMU_CMD_PARTITION_UPDATE 0x03
26 40
27 41
28/* 42/*
29 * Fan control 43 * Fan control
30 * 44 *
31 * This is a "mux" for fan control commands, first byte is the 45 * This is a "mux" for fan control commands. The command seem to
32 * "sub" command. 46 * act differently based on the number of arguments. With 1 byte
47 * of argument, this seem to be queries for fans status, setpoint,
48 * etc..., while with 0xe arguments, we will set the fans speeds.
49 *
50 * Queries (1 byte arg):
51 * ---------------------
52 *
53 * arg=0x01: read RPM fans status
54 * arg=0x02: read RPM fans setpoint
55 * arg=0x11: read PWM fans status
56 * arg=0x12: read PWM fans setpoint
57 *
58 * the "status" queries return the current speed while the "setpoint" ones
59 * return the programmed/target speed. It _seems_ that the result is a bit
60 * mask in the first byte of active/available fans, followed by 6 words (16
61 * bits) containing the requested speed.
62 *
63 * Setpoint (14 bytes arg):
64 * ------------------------
65 *
66 * first arg byte is 0 for RPM fans and 0x10 for PWM. Second arg byte is the
67 * mask of fans affected by the command. Followed by 6 words containing the
68 * setpoint value for selected fans in the mask (or 0 if mask value is 0)
33 */ 69 */
34#define SMU_CMD_FAN_COMMAND 0x4a 70#define SMU_CMD_FAN_COMMAND 0x4a
35 71
@@ -144,7 +180,11 @@
144 * - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is 180 * - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is
145 * used to set the voltage slewing point. The SMU replies with "DONE" 181 * used to set the voltage slewing point. The SMU replies with "DONE"
146 * I yet have to figure out their exact meaning of those 3 bytes in 182 * I yet have to figure out their exact meaning of those 3 bytes in
147 * both cases. 183 * both cases. They seem to be:
184 * x = processor mask
185 * y = op. point index
186 * z = processor freq. step index
187 * I haven't yet decyphered result codes
148 * 188 *
149 */ 189 */
150#define SMU_CMD_POWER_COMMAND 0xaa 190#define SMU_CMD_POWER_COMMAND 0xaa
@@ -152,6 +192,14 @@
152#define SMU_CMD_POWER_SHUTDOWN "SHUTDOWN" 192#define SMU_CMD_POWER_SHUTDOWN "SHUTDOWN"
153#define SMU_CMD_POWER_VOLTAGE_SLEW "VSLEW" 193#define SMU_CMD_POWER_VOLTAGE_SLEW "VSLEW"
154 194
195/*
196 * Read ADC sensors
197 *
198 * This command takes one byte of parameter: the sensor ID (or "reg"
199 * value in the device-tree) and returns a 16 bits value
200 */
201#define SMU_CMD_READ_ADC 0xd8
202
155/* Misc commands 203/* Misc commands
156 * 204 *
157 * This command seem to be a grab bag of various things 205 * This command seem to be a grab bag of various things
@@ -172,6 +220,25 @@
172 * Misc commands 220 * Misc commands
173 * 221 *
174 * This command seem to be a grab bag of various things 222 * This command seem to be a grab bag of various things
223 *
224 * SMU_CMD_MISC_ee_GET_DATABLOCK_REC is used, among others, to
225 * transfer blocks of data from the SMU. So far, I've decrypted it's
226 * usage to retreive partition data. In order to do that, you have to
227 * break your transfer in "chunks" since that command cannot transfer
228 * more than a chunk at a time. The chunk size used by OF is 0xe bytes,
229 * but it seems that the darwin driver will let you do 0x1e bytes if
230 * your "PMU" version is >= 0x30. You can get the "PMU" version apparently
231 * either in the last 16 bits of property "smu-version-pmu" or as the 16
232 * bytes at offset 1 of "smu-version-info"
233 *
234 * For each chunk, the command takes 7 bytes of arguments:
235 * byte 0: subcommand code (0x02)
236 * byte 1: 0x04 (always, I don't know what it means, maybe the address
237 * space to use or some other nicety. It's hard coded in OF)
238 * byte 2..5: SMU address of the chunk (big endian 32 bits)
239 * byte 6: size to transfer (up to max chunk size)
240 *
241 * The data is returned directly
175 */ 242 */
176#define SMU_CMD_MISC_ee_COMMAND 0xee 243#define SMU_CMD_MISC_ee_COMMAND 0xee
177#define SMU_CMD_MISC_ee_GET_DATABLOCK_REC 0x02 244#define SMU_CMD_MISC_ee_GET_DATABLOCK_REC 0x02
@@ -333,6 +400,128 @@ extern int smu_queue_i2c(struct smu_i2c_cmd *cmd);
333 400
334#endif /* __KERNEL__ */ 401#endif /* __KERNEL__ */
335 402
403
404/*
405 * - SMU "sdb" partitions informations -
406 */
407
408
409/*
410 * Partition header format
411 */
412struct smu_sdbp_header {
413 __u8 id;
414 __u8 len;
415 __u8 version;
416 __u8 flags;
417};
418
419
420 /*
421 * demangle 16 and 32 bits integer in some SMU partitions
422 * (currently, afaik, this concerns only the FVT partition
423 * (0x12)
424 */
425#define SMU_U16_MIX(x) le16_to_cpu(x);
426#define SMU_U32_MIX(x) ((((x) & 0xff00ff00u) >> 8)|(((x) & 0x00ff00ffu) << 8))
427
428
429/* This is the definition of the SMU sdb-partition-0x12 table (called
430 * CPU F/V/T operating points in Darwin). The definition for all those
431 * SMU tables should be moved to some separate file
432 */
433#define SMU_SDB_FVT_ID 0x12
434
435struct smu_sdbp_fvt {
436 __u32 sysclk; /* Base SysClk frequency in Hz for
437 * this operating point. Value need to
438 * be unmixed with SMU_U32_MIX()
439 */
440 __u8 pad;
441 __u8 maxtemp; /* Max temp. supported by this
442 * operating point
443 */
444
445 __u16 volts[3]; /* CPU core voltage for the 3
446 * PowerTune modes, a mode with
447 * 0V = not supported. Value need
448 * to be unmixed with SMU_U16_MIX()
449 */
450};
451
452/* This partition contains voltage & current sensor calibration
453 * informations
454 */
455#define SMU_SDB_CPUVCP_ID 0x21
456
457struct smu_sdbp_cpuvcp {
458 __u16 volt_scale; /* u4.12 fixed point */
459 __s16 volt_offset; /* s4.12 fixed point */
460 __u16 curr_scale; /* u4.12 fixed point */
461 __s16 curr_offset; /* s4.12 fixed point */
462 __s32 power_quads[3]; /* s4.28 fixed point */
463};
464
465/* This partition contains CPU thermal diode calibration
466 */
467#define SMU_SDB_CPUDIODE_ID 0x18
468
469struct smu_sdbp_cpudiode {
470 __u16 m_value; /* u1.15 fixed point */
471 __s16 b_value; /* s10.6 fixed point */
472
473};
474
475/* This partition contains Slots power calibration
476 */
477#define SMU_SDB_SLOTSPOW_ID 0x78
478
479struct smu_sdbp_slotspow {
480 __u16 pow_scale; /* u4.12 fixed point */
481 __s16 pow_offset; /* s4.12 fixed point */
482};
483
484/* This partition contains machine specific version information about
485 * the sensor/control layout
486 */
487#define SMU_SDB_SENSORTREE_ID 0x25
488
489struct smu_sdbp_sensortree {
490 u8 model_id;
491 u8 unknown[3];
492};
493
494/* This partition contains CPU thermal control PID informations. So far
495 * only single CPU machines have been seen with an SMU, so we assume this
496 * carries only informations for those
497 */
498#define SMU_SDB_CPUPIDDATA_ID 0x17
499
500struct smu_sdbp_cpupiddata {
501 u8 unknown1;
502 u8 target_temp_delta;
503 u8 unknown2;
504 u8 history_len;
505 s16 power_adj;
506 u16 max_power;
507 s32 gp,gr,gd;
508};
509
510
511/* Other partitions without known structures */
512#define SMU_SDB_DEBUG_SWITCHES_ID 0x05
513
514#ifdef __KERNEL__
515/*
516 * This returns the pointer to an SMU "sdb" partition data or NULL
517 * if not found. The data format is described below
518 */
519extern struct smu_sdbp_header *smu_get_sdb_partition(int id,
520 unsigned int *size);
521
522#endif /* __KERNEL__ */
523
524
336/* 525/*
337 * - Userland interface - 526 * - Userland interface -
338 */ 527 */
@@ -365,8 +554,10 @@ struct smu_user_cmd_hdr
365 __u32 cmdtype; 554 __u32 cmdtype;
366#define SMU_CMDTYPE_SMU 0 /* SMU command */ 555#define SMU_CMDTYPE_SMU 0 /* SMU command */
367#define SMU_CMDTYPE_WANTS_EVENTS 1 /* switch fd to events mode */ 556#define SMU_CMDTYPE_WANTS_EVENTS 1 /* switch fd to events mode */
557#define SMU_CMDTYPE_GET_PARTITION 2 /* retreive an sdb partition */
368 558
369 __u8 cmd; /* SMU command byte */ 559 __u8 cmd; /* SMU command byte */
560 __u8 pad[3]; /* padding */
370 __u32 data_len; /* Lenght of data following */ 561 __u32 data_len; /* Lenght of data following */
371}; 562};
372 563
diff --git a/include/asm-powerpc/xmon.h b/include/asm-powerpc/xmon.h
index 43f7129984c7..ace2072d4a83 100644
--- a/include/asm-powerpc/xmon.h
+++ b/include/asm-powerpc/xmon.h
@@ -7,6 +7,7 @@ struct pt_regs;
7extern int xmon(struct pt_regs *excp); 7extern int xmon(struct pt_regs *excp);
8extern void xmon_printf(const char *fmt, ...); 8extern void xmon_printf(const char *fmt, ...);
9extern void xmon_init(int); 9extern void xmon_init(int);
10extern void xmon_map_scc(void);
10 11
11#endif 12#endif
12#endif 13#endif
diff --git a/include/asm-ppc/btext.h b/include/asm-ppc/btext.h
index 36c7640d00f2..ccaefabe0bf5 100644
--- a/include/asm-ppc/btext.h
+++ b/include/asm-ppc/btext.h
@@ -17,18 +17,18 @@ extern unsigned long disp_BAT[2];
17extern boot_infos_t disp_bi; 17extern boot_infos_t disp_bi;
18extern int boot_text_mapped; 18extern int boot_text_mapped;
19 19
20void btext_init(boot_infos_t *bi); 20extern void init_boot_display(void);
21void btext_welcome(void); 21extern void btext_welcome(void);
22void btext_prepare_BAT(void); 22extern void btext_prepare_BAT(void);
23void btext_setup_display(int width, int height, int depth, int pitch, 23extern void btext_setup_display(int width, int height, int depth, int pitch,
24 unsigned long address); 24 unsigned long address);
25void map_boot_text(void); 25extern void map_boot_text(void);
26void btext_update_display(unsigned long phys, int width, int height, 26extern void btext_update_display(unsigned long phys, int width, int height,
27 int depth, int pitch); 27 int depth, int pitch);
28 28
29void btext_drawchar(char c); 29extern void btext_drawchar(char c);
30void btext_drawstring(const char *str); 30extern void btext_drawstring(const char *str);
31void btext_drawhex(unsigned long v); 31extern void btext_drawhex(unsigned long v);
32 32
33#endif /* __KERNEL__ */ 33#endif /* __KERNEL__ */
34#endif /* __PPC_BTEXT_H */ 34#endif /* __PPC_BTEXT_H */
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index f7f614dfc648..2bfdf9c98459 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -237,9 +237,9 @@ static inline void __raw_writel(__u32 b, volatile void __iomem *addr)
237#define outsl(port, buf, nl) _outsl_ns((port)+___IO_BASE, (buf), (nl)) 237#define outsl(port, buf, nl) _outsl_ns((port)+___IO_BASE, (buf), (nl))
238 238
239/* 239/*
240 * On powermacs, we will get a machine check exception if we 240 * On powermacs and 8xx we will get a machine check exception
241 * try to read data from a non-existent I/O port. Because the 241 * if we try to read data from a non-existent I/O port. Because
242 * machine check is an asynchronous exception, it isn't 242 * the machine check is an asynchronous exception, it isn't
243 * well-defined which instruction SRR0 will point to when the 243 * well-defined which instruction SRR0 will point to when the
244 * exception occurs. 244 * exception occurs.
245 * With the sequence below (twi; isync; nop), we have found that 245 * With the sequence below (twi; isync; nop), we have found that
@@ -258,7 +258,7 @@ extern __inline__ unsigned int name(unsigned int port) \
258{ \ 258{ \
259 unsigned int x; \ 259 unsigned int x; \
260 __asm__ __volatile__( \ 260 __asm__ __volatile__( \
261 op " %0,0,%1\n" \ 261 "0:" op " %0,0,%1\n" \
262 "1: twi 0,%0,0\n" \ 262 "1: twi 0,%0,0\n" \
263 "2: isync\n" \ 263 "2: isync\n" \
264 "3: nop\n" \ 264 "3: nop\n" \
@@ -269,6 +269,7 @@ extern __inline__ unsigned int name(unsigned int port) \
269 ".previous\n" \ 269 ".previous\n" \
270 ".section __ex_table,\"a\"\n" \ 270 ".section __ex_table,\"a\"\n" \
271 " .align 2\n" \ 271 " .align 2\n" \
272 " .long 0b,5b\n" \
272 " .long 1b,5b\n" \ 273 " .long 1b,5b\n" \
273 " .long 2b,5b\n" \ 274 " .long 2b,5b\n" \
274 " .long 3b,5b\n" \ 275 " .long 3b,5b\n" \
@@ -282,11 +283,12 @@ extern __inline__ unsigned int name(unsigned int port) \
282extern __inline__ void name(unsigned int val, unsigned int port) \ 283extern __inline__ void name(unsigned int val, unsigned int port) \
283{ \ 284{ \
284 __asm__ __volatile__( \ 285 __asm__ __volatile__( \
285 op " %0,0,%1\n" \ 286 "0:" op " %0,0,%1\n" \
286 "1: sync\n" \ 287 "1: sync\n" \
287 "2:\n" \ 288 "2:\n" \
288 ".section __ex_table,\"a\"\n" \ 289 ".section __ex_table,\"a\"\n" \
289 " .align 2\n" \ 290 " .align 2\n" \
291 " .long 0b,2b\n" \
290 " .long 1b,2b\n" \ 292 " .long 1b,2b\n" \
291 ".previous" \ 293 ".previous" \
292 : : "r" (val), "r" (port + ___IO_BASE)); \ 294 : : "r" (val), "r" (port + ___IO_BASE)); \
diff --git a/include/asm-ppc/kgdb.h b/include/asm-ppc/kgdb.h
index 1d3c927ce626..b617dac82969 100644
--- a/include/asm-ppc/kgdb.h
+++ b/include/asm-ppc/kgdb.h
@@ -31,7 +31,7 @@ extern void breakpoint(void);
31/* For taking exceptions 31/* For taking exceptions
32 * these are defined in traps.c 32 * these are defined in traps.c
33 */ 33 */
34extern void (*debugger)(struct pt_regs *regs); 34extern int (*debugger)(struct pt_regs *regs);
35extern int (*debugger_bpt)(struct pt_regs *regs); 35extern int (*debugger_bpt)(struct pt_regs *regs);
36extern int (*debugger_sstep)(struct pt_regs *regs); 36extern int (*debugger_sstep)(struct pt_regs *regs);
37extern int (*debugger_iabr_match)(struct pt_regs *regs); 37extern int (*debugger_iabr_match)(struct pt_regs *regs);
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index 75c0637acdc8..3e39827ed566 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -93,7 +93,7 @@ extern int device_is_compatible(struct device_node *device, const char *);
93extern int machine_is_compatible(const char *compat); 93extern int machine_is_compatible(const char *compat);
94extern unsigned char *get_property(struct device_node *node, const char *name, 94extern unsigned char *get_property(struct device_node *node, const char *name,
95 int *lenp); 95 int *lenp);
96extern void prom_add_property(struct device_node* np, struct property* prop); 96extern int prom_add_property(struct device_node* np, struct property* prop);
97extern void prom_get_irq_senses(unsigned char *, int, int); 97extern void prom_get_irq_senses(unsigned char *, int, int);
98extern int prom_n_addr_cells(struct device_node* np); 98extern int prom_n_addr_cells(struct device_node* np);
99extern int prom_n_size_cells(struct device_node* np); 99extern int prom_n_size_cells(struct device_node* np);
diff --git a/include/asm-ppc64/ide.h b/include/asm-ppc64/ide.h
deleted file mode 100644
index 0aae1c590c0e..000000000000
--- a/include/asm-ppc64/ide.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * linux/include/asm-ppc/ide.h
3 *
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
5 *
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.
10 */
11
12/*
13 * This file contains the ppc64 architecture specific IDE code.
14 */
15
16#ifndef __ASMPPC64_IDE_H
17#define __ASMPPC64_IDE_H
18
19#ifdef __KERNEL__
20
21#ifndef MAX_HWIFS
22# define MAX_HWIFS 10
23#endif
24
25#define IDE_ARCH_OBSOLETE_INIT
26#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
27
28#endif /* __KERNEL__ */
29
30#endif /* __ASMPPC64_IDE_H */
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
index 342e2d755550..fafdf885a3cc 100644
--- a/include/asm-ppc64/pci.h
+++ b/include/asm-ppc64/pci.h
@@ -162,6 +162,14 @@ pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus);
162 162
163extern struct pci_controller *init_phb_dynamic(struct device_node *dn); 163extern struct pci_controller *init_phb_dynamic(struct device_node *dn);
164 164
165extern struct pci_dev *of_create_pci_dev(struct device_node *node,
166 struct pci_bus *bus, int devfn);
167
168extern void of_scan_pci_bridge(struct device_node *node,
169 struct pci_dev *dev);
170
171extern void of_scan_bus(struct device_node *node, struct pci_bus *bus);
172
165extern int pci_read_irq_line(struct pci_dev *dev); 173extern int pci_read_irq_line(struct pci_dev *dev);
166 174
167extern void pcibios_add_platform_entries(struct pci_dev *dev); 175extern void pcibios_add_platform_entries(struct pci_dev *dev);
diff --git a/include/asm-ppc64/ppcdebug.h b/include/asm-ppc64/ppcdebug.h
deleted file mode 100644
index fd7f696065c4..000000000000
--- a/include/asm-ppc64/ppcdebug.h
+++ /dev/null
@@ -1,108 +0,0 @@
1#ifndef __PPCDEBUG_H
2#define __PPCDEBUG_H
3/********************************************************************
4 * Author: Adam Litke, IBM Corp
5 * (c) 2001
6 *
7 * This file contains definitions and macros for a runtime debugging
8 * system for ppc64 (This should also work on 32 bit with a few
9 * adjustments.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 *
16 ********************************************************************/
17
18#include <linux/config.h>
19#include <linux/types.h>
20#include <asm/udbg.h>
21#include <stdarg.h>
22
23#define PPCDBG_BITVAL(X) ((1UL)<<((unsigned long)(X)))
24
25/* Defined below are the bit positions of various debug flags in the
26 * ppc64_debug_switch variable.
27 * -- When adding new values, please enter them into trace names below --
28 *
29 * Values 62 & 63 can be used to stress the hardware page table management
30 * code. They must be set statically, any attempt to change them dynamically
31 * would be a very bad idea.
32 */
33#define PPCDBG_MMINIT PPCDBG_BITVAL(0)
34#define PPCDBG_MM PPCDBG_BITVAL(1)
35#define PPCDBG_SYS32 PPCDBG_BITVAL(2)
36#define PPCDBG_SYS32NI PPCDBG_BITVAL(3)
37#define PPCDBG_SYS32X PPCDBG_BITVAL(4)
38#define PPCDBG_SYS32M PPCDBG_BITVAL(5)
39#define PPCDBG_SYS64 PPCDBG_BITVAL(6)
40#define PPCDBG_SYS64NI PPCDBG_BITVAL(7)
41#define PPCDBG_SYS64X PPCDBG_BITVAL(8)
42#define PPCDBG_SIGNAL PPCDBG_BITVAL(9)
43#define PPCDBG_SIGNALXMON PPCDBG_BITVAL(10)
44#define PPCDBG_BINFMT32 PPCDBG_BITVAL(11)
45#define PPCDBG_BINFMT64 PPCDBG_BITVAL(12)
46#define PPCDBG_BINFMTXMON PPCDBG_BITVAL(13)
47#define PPCDBG_BINFMT_32ADDR PPCDBG_BITVAL(14)
48#define PPCDBG_ALIGNFIXUP PPCDBG_BITVAL(15)
49#define PPCDBG_TCEINIT PPCDBG_BITVAL(16)
50#define PPCDBG_TCE PPCDBG_BITVAL(17)
51#define PPCDBG_PHBINIT PPCDBG_BITVAL(18)
52#define PPCDBG_SMP PPCDBG_BITVAL(19)
53#define PPCDBG_BOOT PPCDBG_BITVAL(20)
54#define PPCDBG_BUSWALK PPCDBG_BITVAL(21)
55#define PPCDBG_PROM PPCDBG_BITVAL(22)
56#define PPCDBG_RTAS PPCDBG_BITVAL(23)
57#define PPCDBG_HTABSTRESS PPCDBG_BITVAL(62)
58#define PPCDBG_HTABSIZE PPCDBG_BITVAL(63)
59#define PPCDBG_NONE (0UL)
60#define PPCDBG_ALL (0xffffffffUL)
61
62/* The default initial value for the debug switch */
63#define PPC_DEBUG_DEFAULT 0
64/* #define PPC_DEBUG_DEFAULT PPCDBG_ALL */
65
66#define PPCDBG_NUM_FLAGS 64
67
68extern u64 ppc64_debug_switch;
69
70#ifdef WANT_PPCDBG_TAB
71/* A table of debug switch names to allow name lookup in xmon
72 * (and whoever else wants it.
73 */
74char *trace_names[PPCDBG_NUM_FLAGS] = {
75 /* Known debug names */
76 "mminit", "mm",
77 "syscall32", "syscall32_ni", "syscall32x", "syscall32m",
78 "syscall64", "syscall64_ni", "syscall64x",
79 "signal", "signal_xmon",
80 "binfmt32", "binfmt64", "binfmt_xmon", "binfmt_32addr",
81 "alignfixup", "tceinit", "tce", "phb_init",
82 "smp", "boot", "buswalk", "prom",
83 "rtas"
84};
85#else
86extern char *trace_names[64];
87#endif /* WANT_PPCDBG_TAB */
88
89#ifdef CONFIG_PPCDBG
90/* Macro to conditionally print debug based on debug_switch */
91#define PPCDBG(...) udbg_ppcdbg(__VA_ARGS__)
92
93/* Macro to conditionally call a debug routine based on debug_switch */
94#define PPCDBGCALL(FLAGS,FUNCTION) ifppcdebug(FLAGS) FUNCTION
95
96/* Macros to test for debug states */
97#define ifppcdebug(FLAGS) if (udbg_ifdebug(FLAGS))
98#define ppcdebugset(FLAGS) (udbg_ifdebug(FLAGS))
99#define PPCDBG_BINFMT (test_thread_flag(TIF_32BIT) ? PPCDBG_BINFMT32 : PPCDBG_BINFMT64)
100
101#else
102#define PPCDBG(...) do {;} while (0)
103#define PPCDBGCALL(FLAGS,FUNCTION) do {;} while (0)
104#define ifppcdebug(...) if (0)
105#define ppcdebugset(FLAGS) (0)
106#endif /* CONFIG_PPCDBG */
107
108#endif /*__PPCDEBUG_H */
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index bdb47174ff0e..76bb0266d67c 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -213,6 +213,6 @@ extern int prom_n_addr_cells(struct device_node* np);
213extern int prom_n_size_cells(struct device_node* np); 213extern int prom_n_size_cells(struct device_node* np);
214extern int prom_n_intr_cells(struct device_node* np); 214extern int prom_n_intr_cells(struct device_node* np);
215extern void prom_get_irq_senses(unsigned char *senses, int off, int max); 215extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
216extern void prom_add_property(struct device_node* np, struct property* prop); 216extern int prom_add_property(struct device_node* np, struct property* prop);
217 217
218#endif /* _PPC64_PROM_H */ 218#endif /* _PPC64_PROM_H */
diff --git a/include/asm-ppc64/udbg.h b/include/asm-ppc64/udbg.h
index 8192fb8541cc..e3b927991851 100644
--- a/include/asm-ppc64/udbg.h
+++ b/include/asm-ppc64/udbg.h
@@ -23,9 +23,6 @@ extern int udbg_read(char *buf, int buflen);
23 23
24extern void register_early_udbg_console(void); 24extern void register_early_udbg_console(void);
25extern void udbg_printf(const char *fmt, ...); 25extern void udbg_printf(const char *fmt, ...);
26extern void udbg_ppcdbg(unsigned long flags, const char *fmt, ...);
27extern unsigned long udbg_ifdebug(unsigned long flags);
28extern void __init ppcdbg_initialize(void);
29 26
30extern void udbg_init_uart(void __iomem *comport, unsigned int speed); 27extern void udbg_init_uart(void __iomem *comport, unsigned int speed);
31 28
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 0563581e3a02..65ceeaa30652 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -139,15 +139,12 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver);
139/* 139/*
140 * proc_devtree.c 140 * proc_devtree.c
141 */ 141 */
142#ifdef CONFIG_PROC_DEVICETREE
142struct device_node; 143struct device_node;
144struct property;
143extern void proc_device_tree_init(void); 145extern void proc_device_tree_init(void);
144#ifdef CONFIG_PROC_DEVICETREE
145extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); 146extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
146#else /* !CONFIG_PROC_DEVICETREE */ 147extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
147static inline void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde)
148{
149 return;
150}
151#endif /* CONFIG_PROC_DEVICETREE */ 148#endif /* CONFIG_PROC_DEVICETREE */
152 149
153extern struct proc_dir_entry *proc_symlink(const char *, 150extern struct proc_dir_entry *proc_symlink(const char *,