diff options
Diffstat (limited to 'Documentation/powerpc')
-rw-r--r-- | Documentation/powerpc/00-INDEX | 20 | ||||
-rw-r--r-- | Documentation/powerpc/SBC8260_memory_mapping.txt | 197 | ||||
-rw-r--r-- | Documentation/powerpc/cpu_features.txt | 56 | ||||
-rw-r--r-- | Documentation/powerpc/eeh-pci-error-recovery.txt | 332 | ||||
-rw-r--r-- | Documentation/powerpc/hvcs.txt | 567 | ||||
-rw-r--r-- | Documentation/powerpc/mpc52xx.txt | 39 | ||||
-rw-r--r-- | Documentation/powerpc/ppc_htab.txt | 118 | ||||
-rw-r--r-- | Documentation/powerpc/smp.txt | 34 | ||||
-rw-r--r-- | Documentation/powerpc/sound.txt | 81 | ||||
-rw-r--r-- | Documentation/powerpc/zImage_layout.txt | 47 |
10 files changed, 1491 insertions, 0 deletions
diff --git a/Documentation/powerpc/00-INDEX b/Documentation/powerpc/00-INDEX new file mode 100644 index 000000000000..e7bea0a407b4 --- /dev/null +++ b/Documentation/powerpc/00-INDEX | |||
@@ -0,0 +1,20 @@ | |||
1 | Index of files in Documentation/powerpc. If you think something about | ||
2 | Linux/PPC needs an entry here, needs correction or you've written one | ||
3 | please mail me. | ||
4 | Cort Dougan (cort@fsmlabs.com) | ||
5 | |||
6 | 00-INDEX | ||
7 | - this file | ||
8 | cpu_features.txt | ||
9 | - info on how we support a variety of CPUs with minimal compile-time | ||
10 | options. | ||
11 | ppc_htab.txt | ||
12 | - info about the Linux/PPC /proc/ppc_htab entry | ||
13 | smp.txt | ||
14 | - use and state info about Linux/PPC on MP machines | ||
15 | SBC8260_memory_mapping.txt | ||
16 | - EST SBC8260 board info | ||
17 | sound.txt | ||
18 | - info on sound support under Linux/PPC | ||
19 | zImage_layout.txt | ||
20 | - info on the kernel images for Linux/PPC | ||
diff --git a/Documentation/powerpc/SBC8260_memory_mapping.txt b/Documentation/powerpc/SBC8260_memory_mapping.txt new file mode 100644 index 000000000000..e6e9ee0506c3 --- /dev/null +++ b/Documentation/powerpc/SBC8260_memory_mapping.txt | |||
@@ -0,0 +1,197 @@ | |||
1 | Please mail me (Jon Diekema, diekema_jon@si.com or diekema@cideas.com) | ||
2 | if you have questions, comments or corrections. | ||
3 | |||
4 | * EST SBC8260 Linux memory mapping rules | ||
5 | |||
6 | http://www.estc.com/ | ||
7 | http://www.estc.com/products/boards/SBC8260-8240_ds.html | ||
8 | |||
9 | Initial conditions: | ||
10 | ------------------- | ||
11 | |||
12 | Tasks that need to be perform by the boot ROM before control is | ||
13 | transferred to zImage (compressed Linux kernel): | ||
14 | |||
15 | - Define the IMMR to 0xf0000000 | ||
16 | |||
17 | - Initialize the memory controller so that RAM is available at | ||
18 | physical address 0x00000000. On the SBC8260 is this 16M (64M) | ||
19 | SDRAM. | ||
20 | |||
21 | - The boot ROM should only clear the RAM that it is using. | ||
22 | |||
23 | The reason for doing this is to enhances the chances of a | ||
24 | successful post mortem on a Linux panic. One of the first | ||
25 | items to examine is the 16k (LOG_BUF_LEN) circular console | ||
26 | buffer called log_buf which is defined in kernel/printk.c. | ||
27 | |||
28 | - To enhance boot ROM performance, the I-cache can be enabled. | ||
29 | |||
30 | Date: Mon, 22 May 2000 14:21:10 -0700 | ||
31 | From: Neil Russell <caret@c-side.com> | ||
32 | |||
33 | LiMon (LInux MONitor) runs with and starts Linux with MMU | ||
34 | off, I-cache enabled, D-cache disabled. The I-cache doesn't | ||
35 | need hints from the MMU to work correctly as the D-cache | ||
36 | does. No D-cache means no special code to handle devices in | ||
37 | the presence of cache (no snooping, etc). The use of the | ||
38 | I-cache means that the monitor can run acceptably fast | ||
39 | directly from ROM, rather than having to copy it to RAM. | ||
40 | |||
41 | - Build the board information structure (see | ||
42 | include/asm-ppc/est8260.h for its definition) | ||
43 | |||
44 | - The compressed Linux kernel (zImage) contains a bootstrap loader | ||
45 | that is position independent; you can load it into any RAM, | ||
46 | ROM or FLASH memory address >= 0x00500000 (above 5 MB), or | ||
47 | at its link address of 0x00400000 (4 MB). | ||
48 | |||
49 | Note: If zImage is loaded at its link address of 0x00400000 (4 MB), | ||
50 | then zImage will skip the step of moving itself to | ||
51 | its link address. | ||
52 | |||
53 | - Load R3 with the address of the board information structure | ||
54 | |||
55 | - Transfer control to zImage | ||
56 | |||
57 | - The Linux console port is SMC1, and the baud rate is controlled | ||
58 | from the bi_baudrate field of the board information structure. | ||
59 | On thing to keep in mind when picking the baud rate, is that | ||
60 | there is no flow control on the SMC ports. I would stick | ||
61 | with something safe and standard like 19200. | ||
62 | |||
63 | On the EST SBC8260, the SMC1 port is on the COM1 connector of | ||
64 | the board. | ||
65 | |||
66 | |||
67 | EST SBC8260 defaults: | ||
68 | --------------------- | ||
69 | |||
70 | Chip | ||
71 | Memory Sel Bus Use | ||
72 | --------------------- --- --- ---------------------------------- | ||
73 | 0x00000000-0x03FFFFFF CS2 60x (16M or 64M)/64M SDRAM | ||
74 | 0x04000000-0x04FFFFFF CS4 local 4M/16M SDRAM (soldered to the board) | ||
75 | 0x21000000-0x21000000 CS7 60x 1B/64K Flash present detect (from the flash SIMM) | ||
76 | 0x21000001-0x21000001 CS7 60x 1B/64K Switches (read) and LEDs (write) | ||
77 | 0x22000000-0x2200FFFF CS5 60x 8K/64K EEPROM | ||
78 | 0xFC000000-0xFCFFFFFF CS6 60x 2M/16M flash (8 bits wide, soldered to the board) | ||
79 | 0xFE000000-0xFFFFFFFF CS0 60x 4M/16M flash (SIMM) | ||
80 | |||
81 | Notes: | ||
82 | ------ | ||
83 | |||
84 | - The chip selects can map 32K blocks and up (powers of 2) | ||
85 | |||
86 | - The SDRAM machine can handled up to 128Mbytes per chip select | ||
87 | |||
88 | - Linux uses the 60x bus memory (the SDRAM DIMM) for the | ||
89 | communications buffers. | ||
90 | |||
91 | - BATs can map 128K-256Mbytes each. There are four data BATs and | ||
92 | four instruction BATs. Generally the data and instruction BATs | ||
93 | are mapped the same. | ||
94 | |||
95 | - The IMMR must be set above the kernel virtual memory addresses, | ||
96 | which start at 0xC0000000. Otherwise, the kernel may crash as | ||
97 | soon as you start any threads or processes due to VM collisions | ||
98 | in the kernel or user process space. | ||
99 | |||
100 | |||
101 | Details from Dan Malek <dan_malek@mvista.com> on 10/29/1999: | ||
102 | |||
103 | The user application virtual space consumes the first 2 Gbytes | ||
104 | (0x00000000 to 0x7FFFFFFF). The kernel virtual text starts at | ||
105 | 0xC0000000, with data following. There is a "protection hole" | ||
106 | between the end of kernel data and the start of the kernel | ||
107 | dynamically allocated space, but this space is still within | ||
108 | 0xCxxxxxxx. | ||
109 | |||
110 | Obviously the kernel can't map any physical addresses 1:1 in | ||
111 | these ranges. | ||
112 | |||
113 | |||
114 | Details from Dan Malek <dan_malek@mvista.com> on 5/19/2000: | ||
115 | |||
116 | During the early kernel initialization, the kernel virtual | ||
117 | memory allocator is not operational. Prior to this KVM | ||
118 | initialization, we choose to map virtual to physical addresses | ||
119 | 1:1. That is, the kernel virtual address exactly matches the | ||
120 | physical address on the bus. These mappings are typically done | ||
121 | in arch/ppc/kernel/head.S, or arch/ppc/mm/init.c. Only | ||
122 | absolutely necessary mappings should be done at this time, for | ||
123 | example board control registers or a serial uart. Normal device | ||
124 | driver initialization should map resources later when necessary. | ||
125 | |||
126 | Although platform dependent, and certainly the case for embedded | ||
127 | 8xx, traditionally memory is mapped at physical address zero, | ||
128 | and I/O devices above physical address 0x80000000. The lowest | ||
129 | and highest (above 0xf0000000) I/O addresses are traditionally | ||
130 | used for devices or registers we need to map during kernel | ||
131 | initialization and prior to KVM operation. For this reason, | ||
132 | and since it followed prior PowerPC platform examples, I chose | ||
133 | to map the embedded 8xx kernel to the 0xc0000000 virtual address. | ||
134 | This way, we can enable the MMU to map the kernel for proper | ||
135 | operation, and still map a few windows before the KVM is operational. | ||
136 | |||
137 | On some systems, you could possibly run the kernel at the | ||
138 | 0x80000000 or any other virtual address. It just depends upon | ||
139 | mapping that must be done prior to KVM operational. You can never | ||
140 | map devices or kernel spaces that overlap with the user virtual | ||
141 | space. This is why default IMMR mapping used by most BDM tools | ||
142 | won't work. They put the IMMR at something like 0x10000000 or | ||
143 | 0x02000000 for example. You simply can't map these addresses early | ||
144 | in the kernel, and continue proper system operation. | ||
145 | |||
146 | The embedded 8xx/82xx kernel is mature enough that all you should | ||
147 | need to do is map the IMMR someplace at or above 0xf0000000 and it | ||
148 | should boot far enough to get serial console messages and KGDB | ||
149 | connected on any platform. There are lots of other subtle memory | ||
150 | management design features that you simply don't need to worry | ||
151 | about. If you are changing functions related to MMU initialization, | ||
152 | you are likely breaking things that are known to work and are | ||
153 | heading down a path of disaster and frustration. Your changes | ||
154 | should be to make the flexibility of the processor fit Linux, | ||
155 | not force arbitrary and non-workable memory mappings into Linux. | ||
156 | |||
157 | - You don't want to change KERNELLOAD or KERNELBASE, otherwise the | ||
158 | virtual memory and MMU code will get confused. | ||
159 | |||
160 | arch/ppc/Makefile:KERNELLOAD = 0xc0000000 | ||
161 | |||
162 | include/asm-ppc/page.h:#define PAGE_OFFSET 0xc0000000 | ||
163 | include/asm-ppc/page.h:#define KERNELBASE PAGE_OFFSET | ||
164 | |||
165 | - RAM is at physical address 0x00000000, and gets mapped to | ||
166 | virtual address 0xC0000000 for the kernel. | ||
167 | |||
168 | |||
169 | Physical addresses used by the Linux kernel: | ||
170 | -------------------------------------------- | ||
171 | |||
172 | 0x00000000-0x3FFFFFFF 1GB reserved for RAM | ||
173 | 0xF0000000-0xF001FFFF 128K IMMR 64K used for dual port memory, | ||
174 | 64K for 8260 registers | ||
175 | |||
176 | |||
177 | Logical addresses used by the Linux kernel: | ||
178 | ------------------------------------------- | ||
179 | |||
180 | 0xF0000000-0xFFFFFFFF 256M BAT0 (IMMR: dual port RAM, registers) | ||
181 | 0xE0000000-0xEFFFFFFF 256M BAT1 (I/O space for custom boards) | ||
182 | 0xC0000000-0xCFFFFFFF 256M BAT2 (RAM) | ||
183 | 0xD0000000-0xDFFFFFFF 256M BAT3 (if RAM > 256MByte) | ||
184 | |||
185 | |||
186 | EST SBC8260 Linux mapping: | ||
187 | -------------------------- | ||
188 | |||
189 | DBAT0, IBAT0, cache inhibited: | ||
190 | |||
191 | Chip | ||
192 | Memory Sel Use | ||
193 | --------------------- --- --------------------------------- | ||
194 | 0xF0000000-0xF001FFFF n/a IMMR: dual port RAM, registers | ||
195 | |||
196 | DBAT1, IBAT1, cache inhibited: | ||
197 | |||
diff --git a/Documentation/powerpc/cpu_features.txt b/Documentation/powerpc/cpu_features.txt new file mode 100644 index 000000000000..472739880e87 --- /dev/null +++ b/Documentation/powerpc/cpu_features.txt | |||
@@ -0,0 +1,56 @@ | |||
1 | Hollis Blanchard <hollis@austin.ibm.com> | ||
2 | 5 Jun 2002 | ||
3 | |||
4 | This document describes the system (including self-modifying code) used in the | ||
5 | PPC Linux kernel to support a variety of PowerPC CPUs without requiring | ||
6 | compile-time selection. | ||
7 | |||
8 | Early in the boot process the ppc32 kernel detects the current CPU type and | ||
9 | chooses a set of features accordingly. Some examples include Altivec support, | ||
10 | split instruction and data caches, and if the CPU supports the DOZE and NAP | ||
11 | sleep modes. | ||
12 | |||
13 | Detection of the feature set is simple. A list of processors can be found in | ||
14 | arch/ppc/kernel/cputable.c. The PVR register is masked and compared with each | ||
15 | value in the list. If a match is found, the cpu_features of cur_cpu_spec is | ||
16 | assigned to the feature bitmask for this processor and a __setup_cpu function | ||
17 | is called. | ||
18 | |||
19 | C code may test 'cur_cpu_spec[smp_processor_id()]->cpu_features' for a | ||
20 | particular feature bit. This is done in quite a few places, for example | ||
21 | in ppc_setup_l2cr(). | ||
22 | |||
23 | Implementing cpufeatures in assembly is a little more involved. There are | ||
24 | several paths that are performance-critical and would suffer if an array | ||
25 | index, structure dereference, and conditional branch were added. To avoid the | ||
26 | performance penalty but still allow for runtime (rather than compile-time) CPU | ||
27 | selection, unused code is replaced by 'nop' instructions. This nop'ing is | ||
28 | based on CPU 0's capabilities, so a multi-processor system with non-identical | ||
29 | processors will not work (but such a system would likely have other problems | ||
30 | anyways). | ||
31 | |||
32 | After detecting the processor type, the kernel patches out sections of code | ||
33 | that shouldn't be used by writing nop's over it. Using cpufeatures requires | ||
34 | just 2 macros (found in include/asm-ppc/cputable.h), as seen in head.S | ||
35 | transfer_to_handler: | ||
36 | |||
37 | #ifdef CONFIG_ALTIVEC | ||
38 | BEGIN_FTR_SECTION | ||
39 | mfspr r22,SPRN_VRSAVE /* if G4, save vrsave register value */ | ||
40 | stw r22,THREAD_VRSAVE(r23) | ||
41 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | ||
42 | #endif /* CONFIG_ALTIVEC */ | ||
43 | |||
44 | If CPU 0 supports Altivec, the code is left untouched. If it doesn't, both | ||
45 | instructions are replaced with nop's. | ||
46 | |||
47 | The END_FTR_SECTION macro has two simpler variations: END_FTR_SECTION_IFSET | ||
48 | and END_FTR_SECTION_IFCLR. These simply test if a flag is set (in | ||
49 | cur_cpu_spec[0]->cpu_features) or is cleared, respectively. These two macros | ||
50 | should be used in the majority of cases. | ||
51 | |||
52 | The END_FTR_SECTION macros are implemented by storing information about this | ||
53 | code in the '__ftr_fixup' ELF section. When do_cpu_ftr_fixups | ||
54 | (arch/ppc/kernel/misc.S) is invoked, it will iterate over the records in | ||
55 | __ftr_fixup, and if the required feature is not present it will loop writing | ||
56 | nop's from each BEGIN_FTR_SECTION to END_FTR_SECTION. | ||
diff --git a/Documentation/powerpc/eeh-pci-error-recovery.txt b/Documentation/powerpc/eeh-pci-error-recovery.txt new file mode 100644 index 000000000000..2bfe71beec5b --- /dev/null +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt | |||
@@ -0,0 +1,332 @@ | |||
1 | |||
2 | |||
3 | PCI Bus EEH Error Recovery | ||
4 | -------------------------- | ||
5 | Linas Vepstas | ||
6 | <linas@austin.ibm.com> | ||
7 | 12 January 2005 | ||
8 | |||
9 | |||
10 | Overview: | ||
11 | --------- | ||
12 | The IBM POWER-based pSeries and iSeries computers include PCI bus | ||
13 | controller chips that have extended capabilities for detecting and | ||
14 | reporting a large variety of PCI bus error conditions. These features | ||
15 | go under the name of "EEH", for "Extended Error Handling". The EEH | ||
16 | hardware features allow PCI bus errors to be cleared and a PCI | ||
17 | card to be "rebooted", without also having to reboot the operating | ||
18 | system. | ||
19 | |||
20 | This is in contrast to traditional PCI error handling, where the | ||
21 | PCI chip is wired directly to the CPU, and an error would cause | ||
22 | a CPU machine-check/check-stop condition, halting the CPU entirely. | ||
23 | Another "traditional" technique is to ignore such errors, which | ||
24 | can lead to data corruption, both of user data or of kernel data, | ||
25 | hung/unresponsive adapters, or system crashes/lockups. Thus, | ||
26 | the idea behind EEH is that the operating system can become more | ||
27 | reliable and robust by protecting it from PCI errors, and giving | ||
28 | the OS the ability to "reboot"/recover individual PCI devices. | ||
29 | |||
30 | Future systems from other vendors, based on the PCI-E specification, | ||
31 | may contain similar features. | ||
32 | |||
33 | |||
34 | Causes of EEH Errors | ||
35 | -------------------- | ||
36 | EEH was originally designed to guard against hardware failure, such | ||
37 | as PCI cards dying from heat, humidity, dust, vibration and bad | ||
38 | electrical connections. The vast majority of EEH errors seen in | ||
39 | "real life" are due to eithr poorly seated PCI cards, or, | ||
40 | unfortunately quite commonly, due device driver bugs, device firmware | ||
41 | bugs, and sometimes PCI card hardware bugs. | ||
42 | |||
43 | The most common software bug, is one that causes the device to | ||
44 | attempt to DMA to a location in system memory that has not been | ||
45 | reserved for DMA access for that card. This is a powerful feature, | ||
46 | as it prevents what; otherwise, would have been silent memory | ||
47 | corruption caused by the bad DMA. A number of device driver | ||
48 | bugs have been found and fixed in this way over the past few | ||
49 | years. Other possible causes of EEH errors include data or | ||
50 | address line parity errors (for example, due to poor electrical | ||
51 | connectivity due to a poorly seated card), and PCI-X split-completion | ||
52 | errors (due to software, device firmware, or device PCI hardware bugs). | ||
53 | The vast majority of "true hardware failures" can be cured by | ||
54 | physically removing and re-seating the PCI card. | ||
55 | |||
56 | |||
57 | Detection and Recovery | ||
58 | ---------------------- | ||
59 | In the following discussion, a generic overview of how to detect | ||
60 | and recover from EEH errors will be presented. This is followed | ||
61 | by an overview of how the current implementation in the Linux | ||
62 | kernel does it. The actual implementation is subject to change, | ||
63 | and some of the finer points are still being debated. These | ||
64 | may in turn be swayed if or when other architectures implement | ||
65 | similar functionality. | ||
66 | |||
67 | When a PCI Host Bridge (PHB, the bus controller connecting the | ||
68 | PCI bus to the system CPU electronics complex) detects a PCI error | ||
69 | condition, it will "isolate" the affected PCI card. Isolation | ||
70 | will block all writes (either to the card from the system, or | ||
71 | from the card to the system), and it will cause all reads to | ||
72 | return all-ff's (0xff, 0xffff, 0xffffffff for 8/16/32-bit reads). | ||
73 | This value was chosen because it is the same value you would | ||
74 | get if the device was physically unplugged from the slot. | ||
75 | This includes access to PCI memory, I/O space, and PCI config | ||
76 | space. Interrupts; however, will continued to be delivered. | ||
77 | |||
78 | Detection and recovery are performed with the aid of ppc64 | ||
79 | firmware. The programming interfaces in the Linux kernel | ||
80 | into the firmware are referred to as RTAS (Run-Time Abstraction | ||
81 | Services). The Linux kernel does not (should not) access | ||
82 | the EEH function in the PCI chipsets directly, primarily because | ||
83 | there are a number of different chipsets out there, each with | ||
84 | different interfaces and quirks. The firmware provides a | ||
85 | uniform abstraction layer that will work with all pSeries | ||
86 | and iSeries hardware (and be forwards-compatible). | ||
87 | |||
88 | If the OS or device driver suspects that a PCI slot has been | ||
89 | EEH-isolated, there is a firmware call it can make to determine if | ||
90 | this is the case. If so, then the device driver should put itself | ||
91 | into a consistent state (given that it won't be able to complete any | ||
92 | pending work) and start recovery of the card. Recovery normally | ||
93 | would consist of reseting the PCI device (holding the PCI #RST | ||
94 | line high for two seconds), followed by setting up the device | ||
95 | config space (the base address registers (BAR's), latency timer, | ||
96 | cache line size, interrupt line, and so on). This is followed by a | ||
97 | reinitialization of the device driver. In a worst-case scenario, | ||
98 | the power to the card can be toggled, at least on hot-plug-capable | ||
99 | slots. In principle, layers far above the device driver probably | ||
100 | do not need to know that the PCI card has been "rebooted" in this | ||
101 | way; ideally, there should be at most a pause in Ethernet/disk/USB | ||
102 | I/O while the card is being reset. | ||
103 | |||
104 | If the card cannot be recovered after three or four resets, the | ||
105 | kernel/device driver should assume the worst-case scenario, that the | ||
106 | card has died completely, and report this error to the sysadmin. | ||
107 | In addition, error messages are reported through RTAS and also through | ||
108 | syslogd (/var/log/messages) to alert the sysadmin of PCI resets. | ||
109 | The correct way to deal with failed adapters is to use the standard | ||
110 | PCI hotplug tools to remove and replace the dead card. | ||
111 | |||
112 | |||
113 | Current PPC64 Linux EEH Implementation | ||
114 | -------------------------------------- | ||
115 | At this time, a generic EEH recovery mechanism has been implemented, | ||
116 | so that individual device drivers do not need to be modified to support | ||
117 | EEH recovery. This generic mechanism piggy-backs on the PCI hotplug | ||
118 | infrastructure, and percolates events up through the hotplug/udev | ||
119 | infrastructure. Followiing is a detailed description of how this is | ||
120 | accomplished. | ||
121 | |||
122 | EEH must be enabled in the PHB's very early during the boot process, | ||
123 | and if a PCI slot is hot-plugged. The former is performed by | ||
124 | eeh_init() in arch/ppc64/kernel/eeh.c, and the later by | ||
125 | drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code. | ||
126 | EEH must be enabled before a PCI scan of the device can proceed. | ||
127 | Current Power5 hardware will not work unless EEH is enabled; | ||
128 | although older Power4 can run with it disabled. Effectively, | ||
129 | EEH can no longer be turned off. PCI devices *must* be | ||
130 | registered with the EEH code; the EEH code needs to know about | ||
131 | the I/O address ranges of the PCI device in order to detect an | ||
132 | error. Given an arbitrary address, the routine | ||
133 | pci_get_device_by_addr() will find the pci device associated | ||
134 | with that address (if any). | ||
135 | |||
136 | The default include/asm-ppc64/io.h macros readb(), inb(), insb(), | ||
137 | etc. include a check to see if the the i/o read returned all-0xff's. | ||
138 | If so, these make a call to eeh_dn_check_failure(), which in turn | ||
139 | asks the firmware if the all-ff's value is the sign of a true EEH | ||
140 | error. If it is not, processing continues as normal. The grand | ||
141 | total number of these false alarms or "false positives" can be | ||
142 | seen in /proc/ppc64/eeh (subject to change). Normally, almost | ||
143 | all of these occur during boot, when the PCI bus is scanned, where | ||
144 | a large number of 0xff reads are part of the bus scan procedure. | ||
145 | |||
146 | If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will | ||
147 | print a stack trace to syslog (/var/log/messages). This stack trace | ||
148 | has proven to be very useful to device-driver authors for finding | ||
149 | out at what point the EEH error was detected, as the error itself | ||
150 | usually occurs slightly beforehand. | ||
151 | |||
152 | Next, it uses the Linux kernel notifier chain/work queue mechanism to | ||
153 | allow any interested parties to find out about the failure. Device | ||
154 | drivers, or other parts of the kernel, can use | ||
155 | eeh_register_notifier(struct notifier_block *) to find out about EEH | ||
156 | events. The event will include a pointer to the pci device, the | ||
157 | device node and some state info. Receivers of the event can "do as | ||
158 | they wish"; the default handler will be described further in this | ||
159 | section. | ||
160 | |||
161 | To assist in the recovery of the device, eeh.c exports the | ||
162 | following functions: | ||
163 | |||
164 | rtas_set_slot_reset() -- assert the PCI #RST line for 1/8th of a second | ||
165 | rtas_configure_bridge() -- ask firmware to configure any PCI bridges | ||
166 | located topologically under the pci slot. | ||
167 | eeh_save_bars() and eeh_restore_bars(): save and restore the PCI | ||
168 | config-space info for a device and any devices under it. | ||
169 | |||
170 | |||
171 | A handler for the EEH notifier_block events is implemented in | ||
172 | drivers/pci/hotplug/pSeries_pci.c, called handle_eeh_events(). | ||
173 | It saves the device BAR's and then calls rpaphp_unconfig_pci_adapter(). | ||
174 | This last call causes the device driver for the card to be stopped, | ||
175 | which causes hotplug events to go out to user space. This triggers | ||
176 | user-space scripts that might issue commands such as "ifdown eth0" | ||
177 | for ethernet cards, and so on. This handler then sleeps for 5 seconds, | ||
178 | hoping to give the user-space scripts enough time to complete. | ||
179 | It then resets the PCI card, reconfigures the device BAR's, and | ||
180 | any bridges underneath. It then calls rpaphp_enable_pci_slot(), | ||
181 | which restarts the device driver and triggers more user-space | ||
182 | events (for example, calling "ifup eth0" for ethernet cards). | ||
183 | |||
184 | |||
185 | Device Shutdown and User-Space Events | ||
186 | ------------------------------------- | ||
187 | This section documents what happens when a pci slot is unconfigured, | ||
188 | focusing on how the device driver gets shut down, and on how the | ||
189 | events get delivered to user-space scripts. | ||
190 | |||
191 | Following is an example sequence of events that cause a device driver | ||
192 | close function to be called during the first phase of an EEH reset. | ||
193 | The following sequence is an example of the pcnet32 device driver. | ||
194 | |||
195 | rpa_php_unconfig_pci_adapter (struct slot *) // in rpaphp_pci.c | ||
196 | { | ||
197 | calls | ||
198 | pci_remove_bus_device (struct pci_dev *) // in /drivers/pci/remove.c | ||
199 | { | ||
200 | calls | ||
201 | pci_destroy_dev (struct pci_dev *) | ||
202 | { | ||
203 | calls | ||
204 | device_unregister (&dev->dev) // in /drivers/base/core.c | ||
205 | { | ||
206 | calls | ||
207 | device_del (struct device *) | ||
208 | { | ||
209 | calls | ||
210 | bus_remove_device() // in /drivers/base/bus.c | ||
211 | { | ||
212 | calls | ||
213 | device_release_driver() | ||
214 | { | ||
215 | calls | ||
216 | struct device_driver->remove() which is just | ||
217 | pci_device_remove() // in /drivers/pci/pci_driver.c | ||
218 | { | ||
219 | calls | ||
220 | struct pci_driver->remove() which is just | ||
221 | pcnet32_remove_one() // in /drivers/net/pcnet32.c | ||
222 | { | ||
223 | calls | ||
224 | unregister_netdev() // in /net/core/dev.c | ||
225 | { | ||
226 | calls | ||
227 | dev_close() // in /net/core/dev.c | ||
228 | { | ||
229 | calls dev->stop(); | ||
230 | which is just pcnet32_close() // in pcnet32.c | ||
231 | { | ||
232 | which does what you wanted | ||
233 | to stop the device | ||
234 | } | ||
235 | } | ||
236 | } | ||
237 | which | ||
238 | frees pcnet32 device driver memory | ||
239 | } | ||
240 | }}}}}} | ||
241 | |||
242 | |||
243 | in drivers/pci/pci_driver.c, | ||
244 | struct device_driver->remove() is just pci_device_remove() | ||
245 | which calls struct pci_driver->remove() which is pcnet32_remove_one() | ||
246 | which calls unregister_netdev() (in net/core/dev.c) | ||
247 | which calls dev_close() (in net/core/dev.c) | ||
248 | which calls dev->stop() which is pcnet32_close() | ||
249 | which then does the appropriate shutdown. | ||
250 | |||
251 | --- | ||
252 | Following is the analogous stack trace for events sent to user-space | ||
253 | when the pci device is unconfigured. | ||
254 | |||
255 | rpa_php_unconfig_pci_adapter() { // in rpaphp_pci.c | ||
256 | calls | ||
257 | pci_remove_bus_device (struct pci_dev *) { // in /drivers/pci/remove.c | ||
258 | calls | ||
259 | pci_destroy_dev (struct pci_dev *) { | ||
260 | calls | ||
261 | device_unregister (&dev->dev) { // in /drivers/base/core.c | ||
262 | calls | ||
263 | device_del(struct device * dev) { // in /drivers/base/core.c | ||
264 | calls | ||
265 | kobject_del() { //in /libs/kobject.c | ||
266 | calls | ||
267 | kobject_hotplug() { // in /libs/kobject.c | ||
268 | calls | ||
269 | kset_hotplug() { // in /lib/kobject.c | ||
270 | calls | ||
271 | kset->hotplug_ops->hotplug() which is really just | ||
272 | a call to | ||
273 | dev_hotplug() { // in /drivers/base/core.c | ||
274 | calls | ||
275 | dev->bus->hotplug() which is really just a call to | ||
276 | pci_hotplug () { // in drivers/pci/hotplug.c | ||
277 | which prints device name, etc.... | ||
278 | } | ||
279 | } | ||
280 | then kset_hotplug() calls | ||
281 | call_usermodehelper () with | ||
282 | argv[0]=hotplug_path[] which is "/sbin/hotplug" | ||
283 | --> event to userspace, | ||
284 | } | ||
285 | } | ||
286 | kobject_del() then calls sysfs_remove_dir(), which would | ||
287 | trigger any user-space daemon that was watching /sysfs, | ||
288 | and notice the delete event. | ||
289 | |||
290 | |||
291 | Pro's and Con's of the Current Design | ||
292 | ------------------------------------- | ||
293 | There are several issues with the current EEH software recovery design, | ||
294 | which may be addressed in future revisions. But first, note that the | ||
295 | big plus of the current design is that no changes need to be made to | ||
296 | individual device drivers, so that the current design throws a wide net. | ||
297 | The biggest negative of the design is that it potentially disturbs | ||
298 | network daemons and file systems that didn't need to be disturbed. | ||
299 | |||
300 | -- A minor complaint is that resetting the network card causes | ||
301 | user-space back-to-back ifdown/ifup burps that potentially disturb | ||
302 | network daemons, that didn't need to even know that the pci | ||
303 | card was being rebooted. | ||
304 | |||
305 | -- A more serious concern is that the same reset, for SCSI devices, | ||
306 | causes havoc to mounted file systems. Scripts cannot post-facto | ||
307 | unmount a file system without flushing pending buffers, but this | ||
308 | is impossible, because I/O has already been stopped. Thus, | ||
309 | ideally, the reset should happen at or below the block layer, | ||
310 | so that the file systems are not disturbed. | ||
311 | |||
312 | Reiserfs does not tolerate errors returned from the block device. | ||
313 | Ext3fs seems to be tolerant, retrying reads/writes until it does | ||
314 | succeed. Both have been only lightly tested in this scenario. | ||
315 | |||
316 | The SCSI-generic subsystem already has built-in code for performing | ||
317 | SCSI device resets, SCSI bus resets, and SCSI host-bus-adapter | ||
318 | (HBA) resets. These are cascaded into a chain of attempted | ||
319 | resets if a SCSI command fails. These are completely hidden | ||
320 | from the block layer. It would be very natural to add an EEH | ||
321 | reset into this chain of events. | ||
322 | |||
323 | -- If a SCSI error occurs for the root device, all is lost unless | ||
324 | the sysadmin had the foresight to run /bin, /sbin, /etc, /var | ||
325 | and so on, out of ramdisk/tmpfs. | ||
326 | |||
327 | |||
328 | Conclusions | ||
329 | ----------- | ||
330 | There's forward progress ... | ||
331 | |||
332 | |||
diff --git a/Documentation/powerpc/hvcs.txt b/Documentation/powerpc/hvcs.txt new file mode 100644 index 000000000000..c0a62e116e6e --- /dev/null +++ b/Documentation/powerpc/hvcs.txt | |||
@@ -0,0 +1,567 @@ | |||
1 | =========================================================================== | ||
2 | HVCS | ||
3 | IBM "Hypervisor Virtual Console Server" Installation Guide | ||
4 | for Linux Kernel 2.6.4+ | ||
5 | Copyright (C) 2004 IBM Corporation | ||
6 | |||
7 | =========================================================================== | ||
8 | NOTE:Eight space tabs are the optimum editor setting for reading this file. | ||
9 | =========================================================================== | ||
10 | |||
11 | Author(s) : Ryan S. Arnold <rsa@us.ibm.com> | ||
12 | Date Created: March, 02, 2004 | ||
13 | Last Changed: August, 24, 2004 | ||
14 | |||
15 | --------------------------------------------------------------------------- | ||
16 | Table of contents: | ||
17 | |||
18 | 1. Driver Introduction: | ||
19 | 2. System Requirements | ||
20 | 3. Build Options: | ||
21 | 3.1 Built-in: | ||
22 | 3.2 Module: | ||
23 | 4. Installation: | ||
24 | 5. Connection: | ||
25 | 6. Disconnection: | ||
26 | 7. Configuration: | ||
27 | 8. Questions & Answers: | ||
28 | 9. Reporting Bugs: | ||
29 | |||
30 | --------------------------------------------------------------------------- | ||
31 | 1. Driver Introduction: | ||
32 | |||
33 | This is the device driver for the IBM Hypervisor Virtual Console Server, | ||
34 | "hvcs". The IBM hvcs provides a tty driver interface to allow Linux user | ||
35 | space applications access to the system consoles of logically partitioned | ||
36 | operating systems (Linux and AIX) running on the same partitioned Power5 | ||
37 | ppc64 system. Physical hardware consoles per partition are not practical | ||
38 | on this hardware so system consoles are accessed by this driver using | ||
39 | firmware interfaces to virtual terminal devices. | ||
40 | |||
41 | --------------------------------------------------------------------------- | ||
42 | 2. System Requirements: | ||
43 | |||
44 | This device driver was written using 2.6.4 Linux kernel APIs and will only | ||
45 | build and run on kernels of this version or later. | ||
46 | |||
47 | This driver was written to operate solely on IBM Power5 ppc64 hardware | ||
48 | though some care was taken to abstract the architecture dependent firmware | ||
49 | calls from the driver code. | ||
50 | |||
51 | Sysfs must be mounted on the system so that the user can determine which | ||
52 | major and minor numbers are associated with each vty-server. Directions | ||
53 | for sysfs mounting are outside the scope of this document. | ||
54 | |||
55 | --------------------------------------------------------------------------- | ||
56 | 3. Build Options: | ||
57 | |||
58 | The hvcs driver registers itself as a tty driver. The tty layer | ||
59 | dynamically allocates a block of major and minor numbers in a quantity | ||
60 | requested by the registering driver. The hvcs driver asks the tty layer | ||
61 | for 64 of these major/minor numbers by default to use for hvcs device node | ||
62 | entries. | ||
63 | |||
64 | If the default number of device entries is adequate then this driver can be | ||
65 | built into the kernel. If not, the default can be over-ridden by inserting | ||
66 | the driver as a module with insmod parameters. | ||
67 | |||
68 | --------------------------------------------------------------------------- | ||
69 | 3.1 Built-in: | ||
70 | |||
71 | The following menuconfig example demonstrates selecting to build this | ||
72 | driver into the kernel. | ||
73 | |||
74 | Device Drivers ---> | ||
75 | Character devices ---> | ||
76 | <*> IBM Hypervisor Virtual Console Server Support | ||
77 | |||
78 | Begin the kernel make process. | ||
79 | |||
80 | --------------------------------------------------------------------------- | ||
81 | 3.2 Module: | ||
82 | |||
83 | The following menuconfig example demonstrates selecting to build this | ||
84 | driver as a kernel module. | ||
85 | |||
86 | Device Drivers ---> | ||
87 | Character devices ---> | ||
88 | <M> IBM Hypervisor Virtual Console Server Support | ||
89 | |||
90 | The make process will build the following kernel modules: | ||
91 | |||
92 | hvcs.ko | ||
93 | hvcserver.ko | ||
94 | |||
95 | To insert the module with the default allocation execute the following | ||
96 | commands in the order they appear: | ||
97 | |||
98 | insmod hvcserver.ko | ||
99 | insmod hvcs.ko | ||
100 | |||
101 | The hvcserver module contains architecture specific firmware calls and must | ||
102 | be inserted first, otherwise the hvcs module will not find some of the | ||
103 | symbols it expects. | ||
104 | |||
105 | To override the default use an insmod parameter as follows (requesting 4 | ||
106 | tty devices as an example): | ||
107 | |||
108 | insmod hvcs.ko hvcs_parm_num_devs=4 | ||
109 | |||
110 | There is a maximum number of dev entries that can be specified on insmod. | ||
111 | We think that 1024 is currently a decent maximum number of server adapters | ||
112 | to allow. This can always be changed by modifying the constant in the | ||
113 | source file before building. | ||
114 | |||
115 | NOTE: The length of time it takes to insmod the driver seems to be related | ||
116 | to the number of tty interfaces the registering driver requests. | ||
117 | |||
118 | In order to remove the driver module execute the following command: | ||
119 | |||
120 | rmmod hvcs.ko | ||
121 | |||
122 | The recommended method for installing hvcs as a module is to use depmod to | ||
123 | build a current modules.dep file in /lib/modules/`uname -r` and then | ||
124 | execute: | ||
125 | |||
126 | modprobe hvcs hvcs_parm_num_devs=4 | ||
127 | |||
128 | The modules.dep file indicates that hvcserver.ko needs to be inserted | ||
129 | before hvcs.ko and modprobe uses this file to smartly insert the modules in | ||
130 | the proper order. | ||
131 | |||
132 | The following modprobe command is used to remove hvcs and hvcserver in the | ||
133 | proper order: | ||
134 | |||
135 | modprobe -r hvcs | ||
136 | |||
137 | --------------------------------------------------------------------------- | ||
138 | 4. Installation: | ||
139 | |||
140 | The tty layer creates sysfs entries which contain the major and minor | ||
141 | numbers allocated for the hvcs driver. The following snippet of "tree" | ||
142 | output of the sysfs directory shows where these numbers are presented: | ||
143 | |||
144 | sys/ | ||
145 | |-- *other sysfs base dirs* | ||
146 | | | ||
147 | |-- class | ||
148 | | |-- *other classes of devices* | ||
149 | | | | ||
150 | | `-- tty | ||
151 | | |-- *other tty devices* | ||
152 | | | | ||
153 | | |-- hvcs0 | ||
154 | | | `-- dev | ||
155 | | |-- hvcs1 | ||
156 | | | `-- dev | ||
157 | | |-- hvcs2 | ||
158 | | | `-- dev | ||
159 | | |-- hvcs3 | ||
160 | | | `-- dev | ||
161 | | | | ||
162 | | |-- *other tty devices* | ||
163 | | | ||
164 | |-- *other sysfs base dirs* | ||
165 | |||
166 | For the above examples the following output is a result of cat'ing the | ||
167 | "dev" entry in the hvcs directory: | ||
168 | |||
169 | Pow5:/sys/class/tty/hvcs0/ # cat dev | ||
170 | 254:0 | ||
171 | |||
172 | Pow5:/sys/class/tty/hvcs1/ # cat dev | ||
173 | 254:1 | ||
174 | |||
175 | Pow5:/sys/class/tty/hvcs2/ # cat dev | ||
176 | 254:2 | ||
177 | |||
178 | Pow5:/sys/class/tty/hvcs3/ # cat dev | ||
179 | 254:3 | ||
180 | |||
181 | The output from reading the "dev" attribute is the char device major and | ||
182 | minor numbers that the tty layer has allocated for this driver's use. Most | ||
183 | systems running hvcs will already have the device entries created or udev | ||
184 | will do it automatically. | ||
185 | |||
186 | Given the example output above, to manually create a /dev/hvcs* node entry | ||
187 | mknod can be used as follows: | ||
188 | |||
189 | mknod /dev/hvcs0 c 254 0 | ||
190 | mknod /dev/hvcs1 c 254 1 | ||
191 | mknod /dev/hvcs2 c 254 2 | ||
192 | mknod /dev/hvcs3 c 254 3 | ||
193 | |||
194 | Using mknod to manually create the device entries makes these device nodes | ||
195 | persistent. Once created they will exist prior to the driver insmod. | ||
196 | |||
197 | Attempting to connect an application to /dev/hvcs* prior to insertion of | ||
198 | the hvcs module will result in an error message similar to the following: | ||
199 | |||
200 | "/dev/hvcs*: No such device". | ||
201 | |||
202 | NOTE: Just because there is a device node present doesn't mean that there | ||
203 | is a vty-server device configured for that node. | ||
204 | |||
205 | --------------------------------------------------------------------------- | ||
206 | 5. Connection | ||
207 | |||
208 | Since this driver controls devices that provide a tty interface a user can | ||
209 | interact with the device node entries using any standard tty-interactive | ||
210 | method (e.g. "cat", "dd", "echo"). The intent of this driver however, is | ||
211 | to provide real time console interaction with a Linux partition's console, | ||
212 | which requires the use of applications that provide bi-directional, | ||
213 | interactive I/O with a tty device. | ||
214 | |||
215 | Applications (e.g. "minicom" and "screen") that act as terminal emulators | ||
216 | or perform terminal type control sequence conversion on the data being | ||
217 | passed through them are NOT acceptable for providing interactive console | ||
218 | I/O. These programs often emulate antiquated terminal types (vt100 and | ||
219 | ANSI) and expect inbound data to take the form of one of these supported | ||
220 | terminal types but they either do not convert, or do not _adequately_ | ||
221 | convert, outbound data into the terminal type of the terminal which invoked | ||
222 | them (though screen makes an attempt and can apparently be configured with | ||
223 | much termcap wrestling.) | ||
224 | |||
225 | For this reason kermit and cu are two of the recommended applications for | ||
226 | interacting with a Linux console via an hvcs device. These programs simply | ||
227 | act as a conduit for data transfer to and from the tty device. They do not | ||
228 | require inbound data to take the form of a particular terminal type, nor do | ||
229 | they cook outbound data to a particular terminal type. | ||
230 | |||
231 | In order to ensure proper functioning of console applications one must make | ||
232 | sure that once connected to a /dev/hvcs console that the console's $TERM | ||
233 | env variable is set to the exact terminal type of the terminal emulator | ||
234 | used to launch the interactive I/O application. If one is using xterm and | ||
235 | kermit to connect to /dev/hvcs0 when the console prompt becomes available | ||
236 | one should "export TERM=xterm" on the console. This tells ncurses | ||
237 | applications that are invoked from the console that they should output | ||
238 | control sequences that xterm can understand. | ||
239 | |||
240 | As a precautionary measure an hvcs user should always "exit" from their | ||
241 | session before disconnecting an application such as kermit from the device | ||
242 | node. If this is not done, the next user to connect to the console will | ||
243 | continue using the previous user's logged in session which includes | ||
244 | using the $TERM variable that the previous user supplied. | ||
245 | |||
246 | Hotplug add and remove of vty-server adapters affects which /dev/hvcs* node | ||
247 | is used to connect to each vty-server adapter. In order to determine which | ||
248 | vty-server adapter is associated with which /dev/hvcs* node a special sysfs | ||
249 | attribute has been added to each vty-server sysfs entry. This entry is | ||
250 | called "index" and showing it reveals an integer that refers to the | ||
251 | /dev/hvcs* entry to use to connect to that device. For instance cating the | ||
252 | index attribute of vty-server adapter 30000004 shows the following. | ||
253 | |||
254 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat index | ||
255 | 2 | ||
256 | |||
257 | This index of '2' means that in order to connect to vty-server adapter | ||
258 | 30000004 the user should interact with /dev/hvcs2. | ||
259 | |||
260 | It should be noted that due to the system hotplug I/O capabilities of a | ||
261 | system the /dev/hvcs* entry that interacts with a particular vty-server | ||
262 | adapter is not guarenteed to remain the same across system reboots. Look | ||
263 | in the Q & A section for more on this issue. | ||
264 | |||
265 | --------------------------------------------------------------------------- | ||
266 | 6. Disconnection | ||
267 | |||
268 | As a security feature to prevent the delivery of stale data to an | ||
269 | unintended target the Power5 system firmware disables the fetching of data | ||
270 | and discards that data when a connection between a vty-server and a vty has | ||
271 | been severed. As an example, when a vty-server is immediately disconnected | ||
272 | from a vty following output of data to the vty the vty adapter may not have | ||
273 | enough time between when it received the data interrupt and when the | ||
274 | connection was severed to fetch the data from firmware before the fetch is | ||
275 | disabled by firmware. | ||
276 | |||
277 | When hvcs is being used to serve consoles this behavior is not a huge issue | ||
278 | because the adapter stays connected for large amounts of time following | ||
279 | almost all data writes. When hvcs is being used as a tty conduit to tunnel | ||
280 | data between two partitions [see Q & A below] this is a huge problem | ||
281 | because the standard Linux behavior when cat'ing or dd'ing data to a device | ||
282 | is to open the tty, send the data, and then close the tty. If this driver | ||
283 | manually terminated vty-server connections on tty close this would close | ||
284 | the vty-server and vty connection before the target vty has had a chance to | ||
285 | fetch the data. | ||
286 | |||
287 | Additionally, disconnecting a vty-server and vty only on module removal or | ||
288 | adapter removal is impractical because other vty-servers in other | ||
289 | partitions may require the usage of the target vty at any time. | ||
290 | |||
291 | Due to this behavioral restriction disconnection of vty-servers from the | ||
292 | connected vty is a manual procedure using a write to a sysfs attribute | ||
293 | outlined below, on the other hand the initial vty-server connection to a | ||
294 | vty is established automatically by this driver. Manual vty-server | ||
295 | connection is never required. | ||
296 | |||
297 | In order to terminate the connection between a vty-server and vty the | ||
298 | "vterm_state" sysfs attribute within each vty-server's sysfs entry is used. | ||
299 | Reading this attribute reveals the current connection state of the | ||
300 | vty-server adapter. A zero means that the vty-server is not connected to a | ||
301 | vty. A one indicates that a connection is active. | ||
302 | |||
303 | Writing a '0' (zero) to the vterm_state attribute will disconnect the VTERM | ||
304 | connection between the vty-server and target vty ONLY if the vterm_state | ||
305 | previously read '1'. The write directive is ignored if the vterm_state | ||
306 | read '0' or if any value other than '0' was written to the vterm_state | ||
307 | attribute. The following example will show the method used for verifying | ||
308 | the vty-server connection status and disconnecting a vty-server connection. | ||
309 | |||
310 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat vterm_state | ||
311 | 1 | ||
312 | |||
313 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # echo 0 > vterm_state | ||
314 | |||
315 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat vterm_state | ||
316 | 0 | ||
317 | |||
318 | All vty-server connections are automatically terminated when the device is | ||
319 | hotplug removed and when the module is removed. | ||
320 | |||
321 | --------------------------------------------------------------------------- | ||
322 | 7. Configuration | ||
323 | |||
324 | Each vty-server has a sysfs entry in the /sys/devices/vio directory, which | ||
325 | is symlinked in several other sysfs tree directories, notably under the | ||
326 | hvcs driver entry, which looks like the following example: | ||
327 | |||
328 | Pow5:/sys/bus/vio/drivers/hvcs # ls | ||
329 | . .. 30000003 30000004 rescan | ||
330 | |||
331 | By design, firmware notifies the hvcs driver of vty-server lifetimes and | ||
332 | partner vty removals but not the addition of partner vtys. Since an HMC | ||
333 | Super Admin can add partner info dynamically we have provided the hvcs | ||
334 | driver sysfs directory with the "rescan" update attribute which will query | ||
335 | firmware and update the partner info for all the vty-servers that this | ||
336 | driver manages. Writing a '1' to the attribute triggers the update. An | ||
337 | explicit example follows: | ||
338 | |||
339 | Pow5:/sys/bus/vio/drivers/hvcs # echo 1 > rescan | ||
340 | |||
341 | Reading the attribute will indicate a state of '1' or '0'. A one indicates | ||
342 | that an update is in process. A zero indicates that an update has | ||
343 | completed or was never executed. | ||
344 | |||
345 | Vty-server entries in this directory are a 32 bit partition unique unit | ||
346 | address that is created by firmware. An example vty-server sysfs entry | ||
347 | looks like the following: | ||
348 | |||
349 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # ls | ||
350 | . current_vty devspec name partner_vtys | ||
351 | .. detach_state index partner_clcs vterm_state | ||
352 | |||
353 | Each entry is provided, by default with a "name" attribute. Reading the | ||
354 | "name" attribute will reveal the device type as shown in the following | ||
355 | example: | ||
356 | |||
357 | Pow5:/sys/bus/vio/drivers/hvcs/30000003 # cat name | ||
358 | vty-server | ||
359 | |||
360 | Each entry is also provided, by default, with a "devspec" attribute which | ||
361 | reveals the full device specification when read, as shown in the following | ||
362 | example: | ||
363 | |||
364 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat devspec | ||
365 | /vdevice/vty-server@30000004 | ||
366 | |||
367 | Each vty-server sysfs dir is provided with two read-only attributes that | ||
368 | provide lists of easily parsed partner vty data: "partner_vtys" and | ||
369 | "partner_clcs". | ||
370 | |||
371 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat partner_vtys | ||
372 | 30000000 | ||
373 | 30000001 | ||
374 | 30000002 | ||
375 | 30000000 | ||
376 | 30000000 | ||
377 | |||
378 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat partner_clcs | ||
379 | U5112.428.103048A-V3-C0 | ||
380 | U5112.428.103048A-V3-C2 | ||
381 | U5112.428.103048A-V3-C3 | ||
382 | U5112.428.103048A-V4-C0 | ||
383 | U5112.428.103048A-V5-C0 | ||
384 | |||
385 | Reading partner_vtys returns a list of partner vtys. Vty unit address | ||
386 | numbering is only per-partition-unique so entries will frequently repeat. | ||
387 | |||
388 | Reading partner_clcs returns a list of "converged location codes" which are | ||
389 | composed of a system serial number followed by "-V*", where the '*' is the | ||
390 | target partition number, and "-C*", where the '*' is the slot of the | ||
391 | adapter. The first vty partner corresponds to the first clc item, the | ||
392 | second vty partner to the second clc item, etc. | ||
393 | |||
394 | A vty-server can only be connected to a single vty at a time. The entry, | ||
395 | "current_vty" prints the clc of the currently selected partner vty when | ||
396 | read. | ||
397 | |||
398 | The current_vty can be changed by writing a valid partner clc to the entry | ||
399 | as in the following example: | ||
400 | |||
401 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # echo U5112.428.10304 | ||
402 | 8A-V4-C0 > current_vty | ||
403 | |||
404 | Changing the current_vty when a vty-server is already connected to a vty | ||
405 | does not affect the current connection. The change takes effect when the | ||
406 | currently open connection is freed. | ||
407 | |||
408 | Information on the "vterm_state" attribute was covered earlier on the | ||
409 | chapter entitled "disconnection". | ||
410 | |||
411 | --------------------------------------------------------------------------- | ||
412 | 8. Questions & Answers: | ||
413 | =========================================================================== | ||
414 | Q: What are the security concerns involving hvcs? | ||
415 | |||
416 | A: There are three main security concerns: | ||
417 | |||
418 | 1. The creator of the /dev/hvcs* nodes has the ability to restrict | ||
419 | the access of the device entries to certain users or groups. It | ||
420 | may be best to create a special hvcs group privilege for providing | ||
421 | access to system consoles. | ||
422 | |||
423 | 2. To provide network security when grabbing the console it is | ||
424 | suggested that the user connect to the console hosting partition | ||
425 | using a secure method, such as SSH or sit at a hardware console. | ||
426 | |||
427 | 3. Make sure to exit the user session when done with a console or | ||
428 | the next vty-server connection (which may be from another | ||
429 | partition) will experience the previously logged in session. | ||
430 | |||
431 | --------------------------------------------------------------------------- | ||
432 | Q: How do I multiplex a console that I grab through hvcs so that other | ||
433 | people can see it: | ||
434 | |||
435 | A: You can use "screen" to directly connect to the /dev/hvcs* device and | ||
436 | setup a session on your machine with the console group privileges. As | ||
437 | pointed out earlier by default screen doesn't provide the termcap settings | ||
438 | for most terminal emulators to provide adequate character conversion from | ||
439 | term type "screen" to others. This means that curses based programs may | ||
440 | not display properly in screen sessions. | ||
441 | |||
442 | --------------------------------------------------------------------------- | ||
443 | Q: Why are the colors all messed up? | ||
444 | Q: Why are the control characters acting strange or not working? | ||
445 | Q: Why is the console output all strange and unintelligible? | ||
446 | |||
447 | A: Please see the preceding section on "Connection" for a discussion of how | ||
448 | applications can affect the display of character control sequences. | ||
449 | Additionally, just because you logged into the console using and xterm | ||
450 | doesn't mean someone else didn't log into the console with the HMC console | ||
451 | (vt320) before you and leave the session logged in. The best thing to do | ||
452 | is to export TERM to the terminal type of your terminal emulator when you | ||
453 | get the console. Additionally make sure to "exit" the console before you | ||
454 | disconnect from the console. This will ensure that the next user gets | ||
455 | their own TERM type set when they login. | ||
456 | |||
457 | --------------------------------------------------------------------------- | ||
458 | Q: When I try to CONNECT kermit to an hvcs device I get: | ||
459 | "Sorry, can't open connection: /dev/hvcs*"What is happening? | ||
460 | |||
461 | A: Some other Power5 console mechanism has a connection to the vty and | ||
462 | isn't giving it up. You can try to force disconnect the consoles from the | ||
463 | HMC by right clicking on the partition and then selecting "close terminal". | ||
464 | Otherwise you have to hunt down the people who have console authority. It | ||
465 | is possible that you already have the console open using another kermit | ||
466 | session and just forgot about it. Please review the console options for | ||
467 | Power5 systems to determine the many ways a system console can be held. | ||
468 | |||
469 | OR | ||
470 | |||
471 | A: Another user may not have a connectivity method currently attached to a | ||
472 | /dev/hvcs device but the vterm_state may reveal that they still have the | ||
473 | vty-server connection established. They need to free this using the method | ||
474 | outlined in the section on "Disconnection" in order for others to connect | ||
475 | to the target vty. | ||
476 | |||
477 | OR | ||
478 | |||
479 | A: The user profile you are using to execute kermit probably doesn't have | ||
480 | permissions to use the /dev/hvcs* device. | ||
481 | |||
482 | OR | ||
483 | |||
484 | A: You probably haven't inserted the hvcs.ko module yet but the /dev/hvcs* | ||
485 | entry still exists (on systems without udev). | ||
486 | |||
487 | OR | ||
488 | |||
489 | A: There is not a corresponding vty-server device that maps to an existing | ||
490 | /dev/hvcs* entry. | ||
491 | |||
492 | --------------------------------------------------------------------------- | ||
493 | Q: When I try to CONNECT kermit to an hvcs device I get: | ||
494 | "Sorry, write access to UUCP lockfile directory denied." | ||
495 | |||
496 | A: The /dev/hvcs* entry you have specified doesn't exist where you said it | ||
497 | does? Maybe you haven't inserted the module (on systems with udev). | ||
498 | |||
499 | --------------------------------------------------------------------------- | ||
500 | Q: If I already have one Linux partition installed can I use hvcs on said | ||
501 | partition to provide the console for the install of a second Linux | ||
502 | partition? | ||
503 | |||
504 | A: Yes granted that your are connected to the /dev/hvcs* device using | ||
505 | kermit or cu or some other program that doesn't provide terminal emulation. | ||
506 | |||
507 | --------------------------------------------------------------------------- | ||
508 | Q: Can I connect to more than one partition's console at a time using this | ||
509 | driver? | ||
510 | |||
511 | A: Yes. Of course this means that there must be more than one vty-server | ||
512 | configured for this partition and each must point to a disconnected vty. | ||
513 | |||
514 | --------------------------------------------------------------------------- | ||
515 | Q: Does the hvcs driver support dynamic (hotplug) addition of devices? | ||
516 | |||
517 | A: Yes, if you have dlpar and hotplug enabled for your system and it has | ||
518 | been built into the kernel the hvcs drivers is configured to dynamically | ||
519 | handle additions of new devices and removals of unused devices. | ||
520 | |||
521 | --------------------------------------------------------------------------- | ||
522 | Q: For some reason /dev/hvcs* doesn't map to the same vty-server adapter | ||
523 | after a reboot. What happened? | ||
524 | |||
525 | A: Assignment of vty-server adapters to /dev/hvcs* entries is always done | ||
526 | in the order that the adapters are exposed. Due to hotplug capabilities of | ||
527 | this driver assignment of hotplug added vty-servers may be in a different | ||
528 | order than how they would be exposed on module load. Rebooting or | ||
529 | reloading the module after dynamic addition may result in the /dev/hvcs* | ||
530 | and vty-server coupling changing if a vty-server adapter was added in a | ||
531 | slot inbetween two other vty-server adapters. Refer to the section above | ||
532 | on how to determine which vty-server goes with which /dev/hvcs* node. | ||
533 | Hint; look at the sysfs "index" attribute for the vty-server. | ||
534 | |||
535 | --------------------------------------------------------------------------- | ||
536 | Q: Can I use /dev/hvcs* as a conduit to another partition and use a tty | ||
537 | device on that partition as the other end of the pipe? | ||
538 | |||
539 | A: Yes, on Power5 platforms the hvc_console driver provides a tty interface | ||
540 | for extra /dev/hvc* devices (where /dev/hvc0 is most likely the console). | ||
541 | In order to get a tty conduit working between the two partitions the HMC | ||
542 | Super Admin must create an additional "serial server" for the target | ||
543 | partition with the HMC gui which will show up as /dev/hvc* when the target | ||
544 | partition is rebooted. | ||
545 | |||
546 | The HMC Super Admin then creates an additional "serial client" for the | ||
547 | current partition and points this at the target partition's newly created | ||
548 | "serial server" adapter (remember the slot). This shows up as an | ||
549 | additional /dev/hvcs* device. | ||
550 | |||
551 | Now a program on the target system can be configured to read or write to | ||
552 | /dev/hvc* and another program on the current partition can be configured to | ||
553 | read or write to /dev/hvcs*. Now you have a tty conduit between two | ||
554 | partitions. | ||
555 | |||
556 | --------------------------------------------------------------------------- | ||
557 | 9. Reporting Bugs: | ||
558 | |||
559 | The proper channel for reporting bugs is either through the Linux OS | ||
560 | distribution company that provided your OS or by posting issues to the | ||
561 | ppc64 development mailing list at: | ||
562 | |||
563 | linuxppc64-dev@lists.linuxppc.org | ||
564 | |||
565 | This request is to provide a documented and searchable public exchange | ||
566 | of the problems and solutions surrounding this driver for the benefit of | ||
567 | all users. | ||
diff --git a/Documentation/powerpc/mpc52xx.txt b/Documentation/powerpc/mpc52xx.txt new file mode 100644 index 000000000000..10dd4ab93b85 --- /dev/null +++ b/Documentation/powerpc/mpc52xx.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | Linux 2.6.x on MPC52xx family | ||
2 | ----------------------------- | ||
3 | |||
4 | For the latest info, go to http://www.246tNt.com/mpc52xx/ | ||
5 | |||
6 | To compile/use : | ||
7 | |||
8 | - U-Boot: | ||
9 | # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION | ||
10 | if you wish to ). | ||
11 | # make lite5200_defconfig | ||
12 | # make uImage | ||
13 | |||
14 | then, on U-boot: | ||
15 | => tftpboot 200000 uImage | ||
16 | => tftpboot 400000 pRamdisk | ||
17 | => bootm 200000 400000 | ||
18 | |||
19 | - DBug: | ||
20 | # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION | ||
21 | if you wish to ). | ||
22 | # make lite5200_defconfig | ||
23 | # cp your_initrd.gz arch/ppc/boot/images/ramdisk.image.gz | ||
24 | # make zImage.initrd | ||
25 | # make | ||
26 | |||
27 | then in DBug: | ||
28 | DBug> dn -i zImage.initrd.lite5200 | ||
29 | |||
30 | |||
31 | Some remarks : | ||
32 | - The port is named mpc52xxx, and config options are PPC_MPC52xx. The MGT5100 | ||
33 | is not supported, and I'm not sure anyone is interesting in working on it | ||
34 | so. I didn't took 5xxx because there's apparently a lot of 5xxx that have | ||
35 | nothing to do with the MPC5200. I also included the 'MPC' for the same | ||
36 | reason. | ||
37 | - Of course, I inspired myself from the 2.4 port. If you think I forgot to | ||
38 | mention you/your company in the copyright of some code, I'll correct it | ||
39 | ASAP. | ||
diff --git a/Documentation/powerpc/ppc_htab.txt b/Documentation/powerpc/ppc_htab.txt new file mode 100644 index 000000000000..8b8c7df29fa9 --- /dev/null +++ b/Documentation/powerpc/ppc_htab.txt | |||
@@ -0,0 +1,118 @@ | |||
1 | Information about /proc/ppc_htab | ||
2 | ===================================================================== | ||
3 | |||
4 | This document and the related code was written by me (Cort Dougan), please | ||
5 | email me (cort@fsmlabs.com) if you have questions, comments or corrections. | ||
6 | |||
7 | Last Change: 2.16.98 | ||
8 | |||
9 | This entry in the proc directory is readable by all users but only | ||
10 | writable by root. | ||
11 | |||
12 | The ppc_htab interface is a user level way of accessing the | ||
13 | performance monitoring registers as well as providing information | ||
14 | about the PTE hash table. | ||
15 | |||
16 | 1. Reading | ||
17 | |||
18 | Reading this file will give you information about the memory management | ||
19 | hash table that serves as an extended tlb for page translation on the | ||
20 | powerpc. It will also give you information about performance measurement | ||
21 | specific to the cpu that you are using. | ||
22 | |||
23 | Explanation of the 604 Performance Monitoring Fields: | ||
24 | MMCR0 - the current value of the MMCR0 register | ||
25 | PMC1 | ||
26 | PMC2 - the value of the performance counters and a | ||
27 | description of what events they are counting | ||
28 | which are based on MMCR0 bit settings. | ||
29 | Explanation of the PTE Hash Table fields: | ||
30 | |||
31 | Size - hash table size in Kb. | ||
32 | Buckets - number of buckets in the table. | ||
33 | Address - the virtual kernel address of the hash table base. | ||
34 | Entries - the number of ptes that can be stored in the hash table. | ||
35 | User/Kernel - how many pte's are in use by the kernel or user at that time. | ||
36 | Overflows - How many of the entries are in their secondary hash location. | ||
37 | Percent full - ratio of free pte entries to in use entries. | ||
38 | Reloads - Count of how many hash table misses have occurred | ||
39 | that were fixed with a reload from the linux tables. | ||
40 | Should always be 0 on 603 based machines. | ||
41 | Non-error Misses - Count of how many hash table misses have occurred | ||
42 | that were completed with the creation of a pte in the linux | ||
43 | tables with a call to do_page_fault(). | ||
44 | Error Misses - Number of misses due to errors such as bad address | ||
45 | and permission violations. This includes kernel access of | ||
46 | bad user addresses that are fixed up by the trap handler. | ||
47 | |||
48 | Note that calculation of the data displayed from /proc/ppc_htab takes | ||
49 | a long time and spends a great deal of time in the kernel. It would | ||
50 | be quite hard on performance to read this file constantly. In time | ||
51 | there may be a counter in the kernel that allows successive reads from | ||
52 | this file only after a given amount of time has passed to reduce the | ||
53 | possibility of a user slowing the system by reading this file. | ||
54 | |||
55 | 2. Writing | ||
56 | |||
57 | Writing to the ppc_htab allows you to change the characteristics of | ||
58 | the powerpc PTE hash table and setup performance monitoring. | ||
59 | |||
60 | Resizing the PTE hash table is not enabled right now due to many | ||
61 | complications with moving the hash table, rehashing the entries | ||
62 | and many many SMP issues that would have to be dealt with. | ||
63 | |||
64 | Write options to ppc_htab: | ||
65 | |||
66 | - To set the size of the hash table to 64Kb: | ||
67 | |||
68 | echo 'size 64' > /proc/ppc_htab | ||
69 | |||
70 | The size must be a multiple of 64 and must be greater than or equal to | ||
71 | 64. | ||
72 | |||
73 | - To turn off performance monitoring: | ||
74 | |||
75 | echo 'off' > /proc/ppc_htab | ||
76 | |||
77 | - To reset the counters without changing what they're counting: | ||
78 | |||
79 | echo 'reset' > /proc/ppc_htab | ||
80 | |||
81 | Note that counting will continue after the reset if it is enabled. | ||
82 | |||
83 | - To count only events in user mode or only in kernel mode: | ||
84 | |||
85 | echo 'user' > /proc/ppc_htab | ||
86 | ...or... | ||
87 | echo 'kernel' > /proc/ppc_htab | ||
88 | |||
89 | Note that these two options are exclusive of one another and the | ||
90 | lack of either of these options counts user and kernel. | ||
91 | Using 'reset' and 'off' reset these flags. | ||
92 | |||
93 | - The 604 has 2 performance counters which can each count events from | ||
94 | a specific set of events. These sets are disjoint so it is not | ||
95 | possible to count _any_ combination of 2 events. One event can | ||
96 | be counted by PMC1 and one by PMC2. | ||
97 | |||
98 | To start counting a particular event use: | ||
99 | |||
100 | echo 'event' > /proc/ppc_htab | ||
101 | |||
102 | and choose from these events: | ||
103 | |||
104 | PMC1 | ||
105 | ---- | ||
106 | 'ic miss' - instruction cache misses | ||
107 | 'dtlb' - data tlb misses (not hash table misses) | ||
108 | |||
109 | PMC2 | ||
110 | ---- | ||
111 | 'dc miss' - data cache misses | ||
112 | 'itlb' - instruction tlb misses (not hash table misses) | ||
113 | 'load miss time' - cycles to complete a load miss | ||
114 | |||
115 | 3. Bugs | ||
116 | |||
117 | The PMC1 and PMC2 counters can overflow and give no indication of that | ||
118 | in /proc/ppc_htab. | ||
diff --git a/Documentation/powerpc/smp.txt b/Documentation/powerpc/smp.txt new file mode 100644 index 000000000000..5b581b849ff7 --- /dev/null +++ b/Documentation/powerpc/smp.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | Information about Linux/PPC SMP mode | ||
2 | ===================================================================== | ||
3 | |||
4 | This document and the related code was written by me | ||
5 | (Cort Dougan, cort@fsmlabs.com) please email me if you have questions, | ||
6 | comments or corrections. | ||
7 | |||
8 | Last Change: 3.31.99 | ||
9 | |||
10 | If you want to help by writing code or testing different hardware please | ||
11 | email me! | ||
12 | |||
13 | 1. State of Supported Hardware | ||
14 | |||
15 | PowerSurge Architecture - tested on UMAX s900, Apple 9600 | ||
16 | The second processor on this machine boots up just fine and | ||
17 | enters its idle loop. Hopefully a completely working SMP kernel | ||
18 | on this machine will be done shortly. | ||
19 | |||
20 | The code makes the assumption of only two processors. The changes | ||
21 | necessary to work with any number would not be overly difficult but | ||
22 | I don't have any machines with >2 processors so it's not high on my | ||
23 | list of priorities. If anyone else would like do to the work email | ||
24 | me and I can point out the places that need changed. If you have >2 | ||
25 | processors and don't want to add support yourself let me know and I | ||
26 | can take a look into it. | ||
27 | |||
28 | BeBox | ||
29 | BeBox support hasn't been added to the 2.1.X kernels from 2.0.X | ||
30 | but work is being done and SMP support for BeBox is in the works. | ||
31 | |||
32 | CHRP | ||
33 | CHRP SMP works and is fairly solid. It's been tested on the IBM F50 | ||
34 | with 4 processors for quite some time now. | ||
diff --git a/Documentation/powerpc/sound.txt b/Documentation/powerpc/sound.txt new file mode 100644 index 000000000000..df23d95e03a0 --- /dev/null +++ b/Documentation/powerpc/sound.txt | |||
@@ -0,0 +1,81 @@ | |||
1 | Information about PowerPC Sound support | ||
2 | ===================================================================== | ||
3 | |||
4 | Please mail me (Cort Dougan, cort@fsmlabs.com) if you have questions, | ||
5 | comments or corrections. | ||
6 | |||
7 | Last Change: 6.16.99 | ||
8 | |||
9 | This just covers sound on the PReP and CHRP systems for now and later | ||
10 | will contain information on the PowerMac's. | ||
11 | |||
12 | Sound on PReP has been tested and is working with the PowerStack and IBM | ||
13 | Power Series onboard sound systems which are based on the cs4231(2) chip. | ||
14 | The sound options when doing the make config are a bit different from | ||
15 | the default, though. | ||
16 | |||
17 | The I/O base, irq and dma lines that you enter during the make config | ||
18 | are ignored and are set when booting according to the machine type. | ||
19 | This is so that one binary can be used for Motorola and IBM machines | ||
20 | which use different values and isn't allowed by the driver, so things | ||
21 | are hacked together in such a way as to allow this information to be | ||
22 | set automatically on boot. | ||
23 | |||
24 | 1. Motorola PowerStack PReP machines | ||
25 | |||
26 | Enable support for "Crystal CS4232 based (PnP) cards" and for the | ||
27 | Microsoft Sound System. The MSS isn't used, but some of the routines | ||
28 | that the CS4232 driver uses are in it. | ||
29 | |||
30 | Although the options you set are ignored and determined automatically | ||
31 | on boot these are included for information only: | ||
32 | |||
33 | (830) CS4232 audio I/O base 530, 604, E80 or F40 | ||
34 | (10) CS4232 audio IRQ 5, 7, 9, 11, 12 or 15 | ||
35 | (6) CS4232 audio DMA 0, 1 or 3 | ||
36 | (7) CS4232 second (duplex) DMA 0, 1 or 3 | ||
37 | |||
38 | This will allow simultaneous record and playback, as 2 different dma | ||
39 | channels are used. | ||
40 | |||
41 | The sound will be all left channel and very low volume since the | ||
42 | auxiliary input isn't muted by default. I had the changes necessary | ||
43 | for this in the kernel but the sound driver maintainer didn't want | ||
44 | to include them since it wasn't common in other machines. To fix this | ||
45 | you need to mute it using a mixer utility of some sort (if you find one | ||
46 | please let me know) or by patching the driver yourself and recompiling. | ||
47 | |||
48 | There is a problem on the PowerStack 2's (PowerStack Pro's) using a | ||
49 | different irq/drq than the kernel expects. Unfortunately, I don't know | ||
50 | which irq/drq it is so if anyone knows please email me. | ||
51 | |||
52 | Midi is not supported since the cs4232 driver doesn't support midi yet. | ||
53 | |||
54 | 2. IBM PowerPersonal PReP machines | ||
55 | |||
56 | I've only tested sound on the Power Personal Series of IBM workstations | ||
57 | so if you try it on others please let me know the result. I'm especially | ||
58 | interested in the 43p's sound system, which I know nothing about. | ||
59 | |||
60 | Enable support for "Crystal CS4232 based (PnP) cards" and for the | ||
61 | Microsoft Sound System. The MSS isn't used, but some of the routines | ||
62 | that the CS4232 driver uses are in it. | ||
63 | |||
64 | Although the options you set are ignored and determined automatically | ||
65 | on boot these are included for information only: | ||
66 | |||
67 | (530) CS4232 audio I/O base 530, 604, E80 or F40 | ||
68 | (5) CS4232 audio IRQ 5, 7, 9, 11, 12 or 15 | ||
69 | (1) CS4232 audio DMA 0, 1 or 3 | ||
70 | (7) CS4232 second (duplex) DMA 0, 1 or 3 | ||
71 | (330) CS4232 MIDI I/O base 330, 370, 3B0 or 3F0 | ||
72 | (9) CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15 | ||
73 | |||
74 | This setup does _NOT_ allow for recording yet. | ||
75 | |||
76 | Midi is not supported since the cs4232 driver doesn't support midi yet. | ||
77 | |||
78 | 2. IBM CHRP | ||
79 | |||
80 | I have only tested this on the 43P-150. Build the kernel with the cs4232 | ||
81 | set as a module and load the module with irq=9 dma=1 dma2=2 io=0x550 | ||
diff --git a/Documentation/powerpc/zImage_layout.txt b/Documentation/powerpc/zImage_layout.txt new file mode 100644 index 000000000000..048e0150f571 --- /dev/null +++ b/Documentation/powerpc/zImage_layout.txt | |||
@@ -0,0 +1,47 @@ | |||
1 | Information about the Linux/PPC kernel images | ||
2 | ===================================================================== | ||
3 | |||
4 | Please mail me (Cort Dougan, cort@fsmlabs.com) if you have questions, | ||
5 | comments or corrections. | ||
6 | |||
7 | This document is meant to answer several questions I've had about how | ||
8 | the PReP system boots and how Linux/PPC interacts with that mechanism. | ||
9 | It would be nice if we could have information on how other architectures | ||
10 | boot here as well. If you have anything to contribute, please | ||
11 | let me know. | ||
12 | |||
13 | |||
14 | 1. PReP boot file | ||
15 | |||
16 | This is the file necessary to boot PReP systems from floppy or | ||
17 | hard drive. The firmware reads the PReP partition table entry | ||
18 | and will load the image accordingly. | ||
19 | |||
20 | To boot the zImage, copy it onto a floppy with dd if=zImage of=/dev/fd0h1440 | ||
21 | or onto a PReP hard drive partition with dd if=zImage of=/dev/sda4 | ||
22 | assuming you've created a PReP partition (type 0x41) with fdisk on | ||
23 | /dev/sda4. | ||
24 | |||
25 | The layout of the image format is: | ||
26 | |||
27 | 0x0 +------------+ | ||
28 | | | PReP partition table entry | ||
29 | | | | ||
30 | 0x400 +------------+ | ||
31 | | | Bootstrap program code + data | ||
32 | | | | ||
33 | | | | ||
34 | +------------+ | ||
35 | | | compressed kernel, elf header removed | ||
36 | +------------+ | ||
37 | | | initrd (if loaded) | ||
38 | +------------+ | ||
39 | | | Elf section table for bootstrap program | ||
40 | +------------+ | ||
41 | |||
42 | |||
43 | 2. MBX boot file | ||
44 | |||
45 | The MBX boards can load an elf image, and relocate it to the | ||
46 | proper location in memory - it copies the image to the location it was | ||
47 | linked at. | ||