aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/powerpc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /Documentation/powerpc
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'Documentation/powerpc')
-rw-r--r--Documentation/powerpc/00-INDEX20
-rw-r--r--Documentation/powerpc/SBC8260_memory_mapping.txt197
-rw-r--r--Documentation/powerpc/cpu_features.txt56
-rw-r--r--Documentation/powerpc/eeh-pci-error-recovery.txt332
-rw-r--r--Documentation/powerpc/hvcs.txt567
-rw-r--r--Documentation/powerpc/mpc52xx.txt39
-rw-r--r--Documentation/powerpc/ppc_htab.txt118
-rw-r--r--Documentation/powerpc/smp.txt34
-rw-r--r--Documentation/powerpc/sound.txt81
-rw-r--r--Documentation/powerpc/zImage_layout.txt47
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 @@
1Index of files in Documentation/powerpc. If you think something about
2Linux/PPC needs an entry here, needs correction or you've written one
3please mail me.
4 Cort Dougan (cort@fsmlabs.com)
5
600-INDEX
7 - this file
8cpu_features.txt
9 - info on how we support a variety of CPUs with minimal compile-time
10 options.
11ppc_htab.txt
12 - info about the Linux/PPC /proc/ppc_htab entry
13smp.txt
14 - use and state info about Linux/PPC on MP machines
15SBC8260_memory_mapping.txt
16 - EST SBC8260 board info
17sound.txt
18 - info on sound support under Linux/PPC
19zImage_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 @@
1Please mail me (Jon Diekema, diekema_jon@si.com or diekema@cideas.com)
2if 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 @@
1Hollis Blanchard <hollis@austin.ibm.com>
25 Jun 2002
3
4This document describes the system (including self-modifying code) used in the
5PPC Linux kernel to support a variety of PowerPC CPUs without requiring
6compile-time selection.
7
8Early in the boot process the ppc32 kernel detects the current CPU type and
9chooses a set of features accordingly. Some examples include Altivec support,
10split instruction and data caches, and if the CPU supports the DOZE and NAP
11sleep modes.
12
13Detection of the feature set is simple. A list of processors can be found in
14arch/ppc/kernel/cputable.c. The PVR register is masked and compared with each
15value in the list. If a match is found, the cpu_features of cur_cpu_spec is
16assigned to the feature bitmask for this processor and a __setup_cpu function
17is called.
18
19C code may test 'cur_cpu_spec[smp_processor_id()]->cpu_features' for a
20particular feature bit. This is done in quite a few places, for example
21in ppc_setup_l2cr().
22
23Implementing cpufeatures in assembly is a little more involved. There are
24several paths that are performance-critical and would suffer if an array
25index, structure dereference, and conditional branch were added. To avoid the
26performance penalty but still allow for runtime (rather than compile-time) CPU
27selection, unused code is replaced by 'nop' instructions. This nop'ing is
28based on CPU 0's capabilities, so a multi-processor system with non-identical
29processors will not work (but such a system would likely have other problems
30anyways).
31
32After detecting the processor type, the kernel patches out sections of code
33that shouldn't be used by writing nop's over it. Using cpufeatures requires
34just 2 macros (found in include/asm-ppc/cputable.h), as seen in head.S
35transfer_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
44If CPU 0 supports Altivec, the code is left untouched. If it doesn't, both
45instructions are replaced with nop's.
46
47The END_FTR_SECTION macro has two simpler variations: END_FTR_SECTION_IFSET
48and END_FTR_SECTION_IFCLR. These simply test if a flag is set (in
49cur_cpu_spec[0]->cpu_features) or is cleared, respectively. These two macros
50should be used in the majority of cases.
51
52The END_FTR_SECTION macros are implemented by storing information about this
53code 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
56nop'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
10Overview:
11---------
12The IBM POWER-based pSeries and iSeries computers include PCI bus
13controller chips that have extended capabilities for detecting and
14reporting a large variety of PCI bus error conditions. These features
15go under the name of "EEH", for "Extended Error Handling". The EEH
16hardware features allow PCI bus errors to be cleared and a PCI
17card to be "rebooted", without also having to reboot the operating
18system.
19
20This is in contrast to traditional PCI error handling, where the
21PCI chip is wired directly to the CPU, and an error would cause
22a CPU machine-check/check-stop condition, halting the CPU entirely.
23Another "traditional" technique is to ignore such errors, which
24can lead to data corruption, both of user data or of kernel data,
25hung/unresponsive adapters, or system crashes/lockups. Thus,
26the idea behind EEH is that the operating system can become more
27reliable and robust by protecting it from PCI errors, and giving
28the OS the ability to "reboot"/recover individual PCI devices.
29
30Future systems from other vendors, based on the PCI-E specification,
31may contain similar features.
32
33
34Causes of EEH Errors
35--------------------
36EEH was originally designed to guard against hardware failure, such
37as PCI cards dying from heat, humidity, dust, vibration and bad
38electrical connections. The vast majority of EEH errors seen in
39"real life" are due to eithr poorly seated PCI cards, or,
40unfortunately quite commonly, due device driver bugs, device firmware
41bugs, and sometimes PCI card hardware bugs.
42
43The most common software bug, is one that causes the device to
44attempt to DMA to a location in system memory that has not been
45reserved for DMA access for that card. This is a powerful feature,
46as it prevents what; otherwise, would have been silent memory
47corruption caused by the bad DMA. A number of device driver
48bugs have been found and fixed in this way over the past few
49years. Other possible causes of EEH errors include data or
50address line parity errors (for example, due to poor electrical
51connectivity due to a poorly seated card), and PCI-X split-completion
52errors (due to software, device firmware, or device PCI hardware bugs).
53The vast majority of "true hardware failures" can be cured by
54physically removing and re-seating the PCI card.
55
56
57Detection and Recovery
58----------------------
59In the following discussion, a generic overview of how to detect
60and recover from EEH errors will be presented. This is followed
61by an overview of how the current implementation in the Linux
62kernel does it. The actual implementation is subject to change,
63and some of the finer points are still being debated. These
64may in turn be swayed if or when other architectures implement
65similar functionality.
66
67When a PCI Host Bridge (PHB, the bus controller connecting the
68PCI bus to the system CPU electronics complex) detects a PCI error
69condition, it will "isolate" the affected PCI card. Isolation
70will block all writes (either to the card from the system, or
71from the card to the system), and it will cause all reads to
72return all-ff's (0xff, 0xffff, 0xffffffff for 8/16/32-bit reads).
73This value was chosen because it is the same value you would
74get if the device was physically unplugged from the slot.
75This includes access to PCI memory, I/O space, and PCI config
76space. Interrupts; however, will continued to be delivered.
77
78Detection and recovery are performed with the aid of ppc64
79firmware. The programming interfaces in the Linux kernel
80into the firmware are referred to as RTAS (Run-Time Abstraction
81Services). The Linux kernel does not (should not) access
82the EEH function in the PCI chipsets directly, primarily because
83there are a number of different chipsets out there, each with
84different interfaces and quirks. The firmware provides a
85uniform abstraction layer that will work with all pSeries
86and iSeries hardware (and be forwards-compatible).
87
88If the OS or device driver suspects that a PCI slot has been
89EEH-isolated, there is a firmware call it can make to determine if
90this is the case. If so, then the device driver should put itself
91into a consistent state (given that it won't be able to complete any
92pending work) and start recovery of the card. Recovery normally
93would consist of reseting the PCI device (holding the PCI #RST
94line high for two seconds), followed by setting up the device
95config space (the base address registers (BAR's), latency timer,
96cache line size, interrupt line, and so on). This is followed by a
97reinitialization of the device driver. In a worst-case scenario,
98the power to the card can be toggled, at least on hot-plug-capable
99slots. In principle, layers far above the device driver probably
100do not need to know that the PCI card has been "rebooted" in this
101way; ideally, there should be at most a pause in Ethernet/disk/USB
102I/O while the card is being reset.
103
104If the card cannot be recovered after three or four resets, the
105kernel/device driver should assume the worst-case scenario, that the
106card has died completely, and report this error to the sysadmin.
107In addition, error messages are reported through RTAS and also through
108syslogd (/var/log/messages) to alert the sysadmin of PCI resets.
109The correct way to deal with failed adapters is to use the standard
110PCI hotplug tools to remove and replace the dead card.
111
112
113Current PPC64 Linux EEH Implementation
114--------------------------------------
115At this time, a generic EEH recovery mechanism has been implemented,
116so that individual device drivers do not need to be modified to support
117EEH recovery. This generic mechanism piggy-backs on the PCI hotplug
118infrastructure, and percolates events up through the hotplug/udev
119infrastructure. Followiing is a detailed description of how this is
120accomplished.
121
122EEH must be enabled in the PHB's very early during the boot process,
123and if a PCI slot is hot-plugged. The former is performed by
124eeh_init() in arch/ppc64/kernel/eeh.c, and the later by
125drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code.
126EEH must be enabled before a PCI scan of the device can proceed.
127Current Power5 hardware will not work unless EEH is enabled;
128although older Power4 can run with it disabled. Effectively,
129EEH can no longer be turned off. PCI devices *must* be
130registered with the EEH code; the EEH code needs to know about
131the I/O address ranges of the PCI device in order to detect an
132error. Given an arbitrary address, the routine
133pci_get_device_by_addr() will find the pci device associated
134with that address (if any).
135
136The default include/asm-ppc64/io.h macros readb(), inb(), insb(),
137etc. include a check to see if the the i/o read returned all-0xff's.
138If so, these make a call to eeh_dn_check_failure(), which in turn
139asks the firmware if the all-ff's value is the sign of a true EEH
140error. If it is not, processing continues as normal. The grand
141total number of these false alarms or "false positives" can be
142seen in /proc/ppc64/eeh (subject to change). Normally, almost
143all of these occur during boot, when the PCI bus is scanned, where
144a large number of 0xff reads are part of the bus scan procedure.
145
146If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will
147print a stack trace to syslog (/var/log/messages). This stack trace
148has proven to be very useful to device-driver authors for finding
149out at what point the EEH error was detected, as the error itself
150usually occurs slightly beforehand.
151
152Next, it uses the Linux kernel notifier chain/work queue mechanism to
153allow any interested parties to find out about the failure. Device
154drivers, or other parts of the kernel, can use
155eeh_register_notifier(struct notifier_block *) to find out about EEH
156events. The event will include a pointer to the pci device, the
157device node and some state info. Receivers of the event can "do as
158they wish"; the default handler will be described further in this
159section.
160
161To assist in the recovery of the device, eeh.c exports the
162following functions:
163
164rtas_set_slot_reset() -- assert the PCI #RST line for 1/8th of a second
165rtas_configure_bridge() -- ask firmware to configure any PCI bridges
166 located topologically under the pci slot.
167eeh_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
171A handler for the EEH notifier_block events is implemented in
172drivers/pci/hotplug/pSeries_pci.c, called handle_eeh_events().
173It saves the device BAR's and then calls rpaphp_unconfig_pci_adapter().
174This last call causes the device driver for the card to be stopped,
175which causes hotplug events to go out to user space. This triggers
176user-space scripts that might issue commands such as "ifdown eth0"
177for ethernet cards, and so on. This handler then sleeps for 5 seconds,
178hoping to give the user-space scripts enough time to complete.
179It then resets the PCI card, reconfigures the device BAR's, and
180any bridges underneath. It then calls rpaphp_enable_pci_slot(),
181which restarts the device driver and triggers more user-space
182events (for example, calling "ifup eth0" for ethernet cards).
183
184
185Device Shutdown and User-Space Events
186-------------------------------------
187This section documents what happens when a pci slot is unconfigured,
188focusing on how the device driver gets shut down, and on how the
189events get delivered to user-space scripts.
190
191Following is an example sequence of events that cause a device driver
192close function to be called during the first phase of an EEH reset.
193The 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---
252Following is the analogous stack trace for events sent to user-space
253when the pci device is unconfigured.
254
255rpa_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
291Pro's and Con's of the Current Design
292-------------------------------------
293There are several issues with the current EEH software recovery design,
294which may be addressed in future revisions. But first, note that the
295big plus of the current design is that no changes need to be made to
296individual device drivers, so that the current design throws a wide net.
297The biggest negative of the design is that it potentially disturbs
298network 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
328Conclusions
329-----------
330There'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===========================================================================
8NOTE: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---------------------------------------------------------------------------
16Table 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---------------------------------------------------------------------------
311. Driver Introduction:
32
33This 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
35space applications access to the system consoles of logically partitioned
36operating systems (Linux and AIX) running on the same partitioned Power5
37ppc64 system. Physical hardware consoles per partition are not practical
38on this hardware so system consoles are accessed by this driver using
39firmware interfaces to virtual terminal devices.
40
41---------------------------------------------------------------------------
422. System Requirements:
43
44This device driver was written using 2.6.4 Linux kernel APIs and will only
45build and run on kernels of this version or later.
46
47This driver was written to operate solely on IBM Power5 ppc64 hardware
48though some care was taken to abstract the architecture dependent firmware
49calls from the driver code.
50
51Sysfs must be mounted on the system so that the user can determine which
52major and minor numbers are associated with each vty-server. Directions
53for sysfs mounting are outside the scope of this document.
54
55---------------------------------------------------------------------------
563. Build Options:
57
58The hvcs driver registers itself as a tty driver. The tty layer
59dynamically allocates a block of major and minor numbers in a quantity
60requested by the registering driver. The hvcs driver asks the tty layer
61for 64 of these major/minor numbers by default to use for hvcs device node
62entries.
63
64If the default number of device entries is adequate then this driver can be
65built into the kernel. If not, the default can be over-ridden by inserting
66the driver as a module with insmod parameters.
67
68---------------------------------------------------------------------------
693.1 Built-in:
70
71The following menuconfig example demonstrates selecting to build this
72driver into the kernel.
73
74 Device Drivers --->
75 Character devices --->
76 <*> IBM Hypervisor Virtual Console Server Support
77
78Begin the kernel make process.
79
80---------------------------------------------------------------------------
813.2 Module:
82
83The following menuconfig example demonstrates selecting to build this
84driver as a kernel module.
85
86 Device Drivers --->
87 Character devices --->
88 <M> IBM Hypervisor Virtual Console Server Support
89
90The make process will build the following kernel modules:
91
92 hvcs.ko
93 hvcserver.ko
94
95To insert the module with the default allocation execute the following
96commands in the order they appear:
97
98 insmod hvcserver.ko
99 insmod hvcs.ko
100
101The hvcserver module contains architecture specific firmware calls and must
102be inserted first, otherwise the hvcs module will not find some of the
103symbols it expects.
104
105To override the default use an insmod parameter as follows (requesting 4
106tty devices as an example):
107
108 insmod hvcs.ko hvcs_parm_num_devs=4
109
110There is a maximum number of dev entries that can be specified on insmod.
111We think that 1024 is currently a decent maximum number of server adapters
112to allow. This can always be changed by modifying the constant in the
113source file before building.
114
115NOTE: The length of time it takes to insmod the driver seems to be related
116to the number of tty interfaces the registering driver requests.
117
118In order to remove the driver module execute the following command:
119
120 rmmod hvcs.ko
121
122The recommended method for installing hvcs as a module is to use depmod to
123build a current modules.dep file in /lib/modules/`uname -r` and then
124execute:
125
126modprobe hvcs hvcs_parm_num_devs=4
127
128The modules.dep file indicates that hvcserver.ko needs to be inserted
129before hvcs.ko and modprobe uses this file to smartly insert the modules in
130the proper order.
131
132The following modprobe command is used to remove hvcs and hvcserver in the
133proper order:
134
135modprobe -r hvcs
136
137---------------------------------------------------------------------------
1384. Installation:
139
140The tty layer creates sysfs entries which contain the major and minor
141numbers allocated for the hvcs driver. The following snippet of "tree"
142output 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
166For 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
181The output from reading the "dev" attribute is the char device major and
182minor numbers that the tty layer has allocated for this driver's use. Most
183systems running hvcs will already have the device entries created or udev
184will do it automatically.
185
186Given the example output above, to manually create a /dev/hvcs* node entry
187mknod 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
194Using mknod to manually create the device entries makes these device nodes
195persistent. Once created they will exist prior to the driver insmod.
196
197Attempting to connect an application to /dev/hvcs* prior to insertion of
198the hvcs module will result in an error message similar to the following:
199
200 "/dev/hvcs*: No such device".
201
202NOTE: Just because there is a device node present doesn't mean that there
203is a vty-server device configured for that node.
204
205---------------------------------------------------------------------------
2065. Connection
207
208Since this driver controls devices that provide a tty interface a user can
209interact with the device node entries using any standard tty-interactive
210method (e.g. "cat", "dd", "echo"). The intent of this driver however, is
211to provide real time console interaction with a Linux partition's console,
212which requires the use of applications that provide bi-directional,
213interactive I/O with a tty device.
214
215Applications (e.g. "minicom" and "screen") that act as terminal emulators
216or perform terminal type control sequence conversion on the data being
217passed through them are NOT acceptable for providing interactive console
218I/O. These programs often emulate antiquated terminal types (vt100 and
219ANSI) and expect inbound data to take the form of one of these supported
220terminal types but they either do not convert, or do not _adequately_
221convert, outbound data into the terminal type of the terminal which invoked
222them (though screen makes an attempt and can apparently be configured with
223much termcap wrestling.)
224
225For this reason kermit and cu are two of the recommended applications for
226interacting with a Linux console via an hvcs device. These programs simply
227act as a conduit for data transfer to and from the tty device. They do not
228require inbound data to take the form of a particular terminal type, nor do
229they cook outbound data to a particular terminal type.
230
231In order to ensure proper functioning of console applications one must make
232sure that once connected to a /dev/hvcs console that the console's $TERM
233env variable is set to the exact terminal type of the terminal emulator
234used to launch the interactive I/O application. If one is using xterm and
235kermit to connect to /dev/hvcs0 when the console prompt becomes available
236one should "export TERM=xterm" on the console. This tells ncurses
237applications that are invoked from the console that they should output
238control sequences that xterm can understand.
239
240As a precautionary measure an hvcs user should always "exit" from their
241session before disconnecting an application such as kermit from the device
242node. If this is not done, the next user to connect to the console will
243continue using the previous user's logged in session which includes
244using the $TERM variable that the previous user supplied.
245
246Hotplug add and remove of vty-server adapters affects which /dev/hvcs* node
247is used to connect to each vty-server adapter. In order to determine which
248vty-server adapter is associated with which /dev/hvcs* node a special sysfs
249attribute has been added to each vty-server sysfs entry. This entry is
250called "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
252index attribute of vty-server adapter 30000004 shows the following.
253
254 Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat index
255 2
256
257This index of '2' means that in order to connect to vty-server adapter
25830000004 the user should interact with /dev/hvcs2.
259
260It should be noted that due to the system hotplug I/O capabilities of a
261system the /dev/hvcs* entry that interacts with a particular vty-server
262adapter is not guarenteed to remain the same across system reboots. Look
263in the Q & A section for more on this issue.
264
265---------------------------------------------------------------------------
2666. Disconnection
267
268As a security feature to prevent the delivery of stale data to an
269unintended target the Power5 system firmware disables the fetching of data
270and discards that data when a connection between a vty-server and a vty has
271been severed. As an example, when a vty-server is immediately disconnected
272from a vty following output of data to the vty the vty adapter may not have
273enough time between when it received the data interrupt and when the
274connection was severed to fetch the data from firmware before the fetch is
275disabled by firmware.
276
277When hvcs is being used to serve consoles this behavior is not a huge issue
278because the adapter stays connected for large amounts of time following
279almost all data writes. When hvcs is being used as a tty conduit to tunnel
280data between two partitions [see Q & A below] this is a huge problem
281because the standard Linux behavior when cat'ing or dd'ing data to a device
282is to open the tty, send the data, and then close the tty. If this driver
283manually terminated vty-server connections on tty close this would close
284the vty-server and vty connection before the target vty has had a chance to
285fetch the data.
286
287Additionally, disconnecting a vty-server and vty only on module removal or
288adapter removal is impractical because other vty-servers in other
289partitions may require the usage of the target vty at any time.
290
291Due to this behavioral restriction disconnection of vty-servers from the
292connected vty is a manual procedure using a write to a sysfs attribute
293outlined below, on the other hand the initial vty-server connection to a
294vty is established automatically by this driver. Manual vty-server
295connection is never required.
296
297In 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.
299Reading this attribute reveals the current connection state of the
300vty-server adapter. A zero means that the vty-server is not connected to a
301vty. A one indicates that a connection is active.
302
303Writing a '0' (zero) to the vterm_state attribute will disconnect the VTERM
304connection between the vty-server and target vty ONLY if the vterm_state
305previously read '1'. The write directive is ignored if the vterm_state
306read '0' or if any value other than '0' was written to the vterm_state
307attribute. The following example will show the method used for verifying
308the 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
318All vty-server connections are automatically terminated when the device is
319hotplug removed and when the module is removed.
320
321---------------------------------------------------------------------------
3227. Configuration
323
324Each vty-server has a sysfs entry in the /sys/devices/vio directory, which
325is symlinked in several other sysfs tree directories, notably under the
326hvcs driver entry, which looks like the following example:
327
328 Pow5:/sys/bus/vio/drivers/hvcs # ls
329 . .. 30000003 30000004 rescan
330
331By design, firmware notifies the hvcs driver of vty-server lifetimes and
332partner vty removals but not the addition of partner vtys. Since an HMC
333Super Admin can add partner info dynamically we have provided the hvcs
334driver sysfs directory with the "rescan" update attribute which will query
335firmware and update the partner info for all the vty-servers that this
336driver manages. Writing a '1' to the attribute triggers the update. An
337explicit example follows:
338
339 Pow5:/sys/bus/vio/drivers/hvcs # echo 1 > rescan
340
341Reading the attribute will indicate a state of '1' or '0'. A one indicates
342that an update is in process. A zero indicates that an update has
343completed or was never executed.
344
345Vty-server entries in this directory are a 32 bit partition unique unit
346address that is created by firmware. An example vty-server sysfs entry
347looks 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
353Each entry is provided, by default with a "name" attribute. Reading the
354"name" attribute will reveal the device type as shown in the following
355example:
356
357 Pow5:/sys/bus/vio/drivers/hvcs/30000003 # cat name
358 vty-server
359
360Each entry is also provided, by default, with a "devspec" attribute which
361reveals the full device specification when read, as shown in the following
362example:
363
364 Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat devspec
365 /vdevice/vty-server@30000004
366
367Each vty-server sysfs dir is provided with two read-only attributes that
368provide 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
385Reading partner_vtys returns a list of partner vtys. Vty unit address
386numbering is only per-partition-unique so entries will frequently repeat.
387
388Reading partner_clcs returns a list of "converged location codes" which are
389composed of a system serial number followed by "-V*", where the '*' is the
390target partition number, and "-C*", where the '*' is the slot of the
391adapter. The first vty partner corresponds to the first clc item, the
392second vty partner to the second clc item, etc.
393
394A 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
396read.
397
398The current_vty can be changed by writing a valid partner clc to the entry
399as in the following example:
400
401 Pow5:/sys/bus/vio/drivers/hvcs/30000004 # echo U5112.428.10304
402 8A-V4-C0 > current_vty
403
404Changing the current_vty when a vty-server is already connected to a vty
405does not affect the current connection. The change takes effect when the
406currently open connection is freed.
407
408Information on the "vterm_state" attribute was covered earlier on the
409chapter entitled "disconnection".
410
411---------------------------------------------------------------------------
4128. Questions & Answers:
413===========================================================================
414Q: What are the security concerns involving hvcs?
415
416A: 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---------------------------------------------------------------------------
432Q: How do I multiplex a console that I grab through hvcs so that other
433people can see it:
434
435A: You can use "screen" to directly connect to the /dev/hvcs* device and
436setup a session on your machine with the console group privileges. As
437pointed out earlier by default screen doesn't provide the termcap settings
438for most terminal emulators to provide adequate character conversion from
439term type "screen" to others. This means that curses based programs may
440not display properly in screen sessions.
441
442---------------------------------------------------------------------------
443Q: Why are the colors all messed up?
444Q: Why are the control characters acting strange or not working?
445Q: Why is the console output all strange and unintelligible?
446
447A: Please see the preceding section on "Connection" for a discussion of how
448applications can affect the display of character control sequences.
449Additionally, just because you logged into the console using and xterm
450doesn'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
452is to export TERM to the terminal type of your terminal emulator when you
453get the console. Additionally make sure to "exit" the console before you
454disconnect from the console. This will ensure that the next user gets
455their own TERM type set when they login.
456
457---------------------------------------------------------------------------
458Q: When I try to CONNECT kermit to an hvcs device I get:
459"Sorry, can't open connection: /dev/hvcs*"What is happening?
460
461A: Some other Power5 console mechanism has a connection to the vty and
462isn't giving it up. You can try to force disconnect the consoles from the
463HMC by right clicking on the partition and then selecting "close terminal".
464Otherwise you have to hunt down the people who have console authority. It
465is possible that you already have the console open using another kermit
466session and just forgot about it. Please review the console options for
467Power5 systems to determine the many ways a system console can be held.
468
469OR
470
471A: 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
473vty-server connection established. They need to free this using the method
474outlined in the section on "Disconnection" in order for others to connect
475to the target vty.
476
477OR
478
479A: The user profile you are using to execute kermit probably doesn't have
480permissions to use the /dev/hvcs* device.
481
482OR
483
484A: You probably haven't inserted the hvcs.ko module yet but the /dev/hvcs*
485entry still exists (on systems without udev).
486
487OR
488
489A: There is not a corresponding vty-server device that maps to an existing
490/dev/hvcs* entry.
491
492---------------------------------------------------------------------------
493Q: When I try to CONNECT kermit to an hvcs device I get:
494"Sorry, write access to UUCP lockfile directory denied."
495
496A: The /dev/hvcs* entry you have specified doesn't exist where you said it
497does? Maybe you haven't inserted the module (on systems with udev).
498
499---------------------------------------------------------------------------
500Q: If I already have one Linux partition installed can I use hvcs on said
501partition to provide the console for the install of a second Linux
502partition?
503
504A: Yes granted that your are connected to the /dev/hvcs* device using
505kermit or cu or some other program that doesn't provide terminal emulation.
506
507---------------------------------------------------------------------------
508Q: Can I connect to more than one partition's console at a time using this
509driver?
510
511A: Yes. Of course this means that there must be more than one vty-server
512configured for this partition and each must point to a disconnected vty.
513
514---------------------------------------------------------------------------
515Q: Does the hvcs driver support dynamic (hotplug) addition of devices?
516
517A: Yes, if you have dlpar and hotplug enabled for your system and it has
518been built into the kernel the hvcs drivers is configured to dynamically
519handle additions of new devices and removals of unused devices.
520
521---------------------------------------------------------------------------
522Q: For some reason /dev/hvcs* doesn't map to the same vty-server adapter
523after a reboot. What happened?
524
525A: Assignment of vty-server adapters to /dev/hvcs* entries is always done
526in the order that the adapters are exposed. Due to hotplug capabilities of
527this driver assignment of hotplug added vty-servers may be in a different
528order than how they would be exposed on module load. Rebooting or
529reloading the module after dynamic addition may result in the /dev/hvcs*
530and vty-server coupling changing if a vty-server adapter was added in a
531slot inbetween two other vty-server adapters. Refer to the section above
532on how to determine which vty-server goes with which /dev/hvcs* node.
533Hint; look at the sysfs "index" attribute for the vty-server.
534
535---------------------------------------------------------------------------
536Q: Can I use /dev/hvcs* as a conduit to another partition and use a tty
537device on that partition as the other end of the pipe?
538
539A: Yes, on Power5 platforms the hvc_console driver provides a tty interface
540for extra /dev/hvc* devices (where /dev/hvc0 is most likely the console).
541In order to get a tty conduit working between the two partitions the HMC
542Super Admin must create an additional "serial server" for the target
543partition with the HMC gui which will show up as /dev/hvc* when the target
544partition is rebooted.
545
546The HMC Super Admin then creates an additional "serial client" for the
547current partition and points this at the target partition's newly created
548"serial server" adapter (remember the slot). This shows up as an
549additional /dev/hvcs* device.
550
551Now 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
553read or write to /dev/hvcs*. Now you have a tty conduit between two
554partitions.
555
556---------------------------------------------------------------------------
5579. Reporting Bugs:
558
559The proper channel for reporting bugs is either through the Linux OS
560distribution company that provided your OS or by posting issues to the
561ppc64 development mailing list at:
562
563linuxppc64-dev@lists.linuxppc.org
564
565This request is to provide a documented and searchable public exchange
566of the problems and solutions surrounding this driver for the benefit of
567all 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 @@
1Linux 2.6.x on MPC52xx family
2-----------------------------
3
4For the latest info, go to http://www.246tNt.com/mpc52xx/
5
6To 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
31Some 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
4This document and the related code was written by me (Cort Dougan), please
5email me (cort@fsmlabs.com) if you have questions, comments or corrections.
6
7Last Change: 2.16.98
8
9This entry in the proc directory is readable by all users but only
10writable by root.
11
12The ppc_htab interface is a user level way of accessing the
13performance monitoring registers as well as providing information
14about the PTE hash table.
15
161. 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
552. 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
1153. 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
4This document and the related code was written by me
5(Cort Dougan, cort@fsmlabs.com) please email me if you have questions,
6comments or corrections.
7
8Last Change: 3.31.99
9
10If you want to help by writing code or testing different hardware please
11email me!
12
131. 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
4Please mail me (Cort Dougan, cort@fsmlabs.com) if you have questions,
5comments or corrections.
6
7Last Change: 6.16.99
8
9This just covers sound on the PReP and CHRP systems for now and later
10will contain information on the PowerMac's.
11
12Sound on PReP has been tested and is working with the PowerStack and IBM
13Power Series onboard sound systems which are based on the cs4231(2) chip.
14The sound options when doing the make config are a bit different from
15the default, though.
16
17The I/O base, irq and dma lines that you enter during the make config
18are ignored and are set when booting according to the machine type.
19This is so that one binary can be used for Motorola and IBM machines
20which use different values and isn't allowed by the driver, so things
21are hacked together in such a way as to allow this information to be
22set automatically on boot.
23
241. 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
542. 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
782. 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
4Please mail me (Cort Dougan, cort@fsmlabs.com) if you have questions,
5comments or corrections.
6
7This document is meant to answer several questions I've had about how
8the PReP system boots and how Linux/PPC interacts with that mechanism.
9It would be nice if we could have information on how other architectures
10boot here as well. If you have anything to contribute, please
11let me know.
12
13
141. 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
432. 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.