ia64/linux-2.6.18-xen.hg

annotate Documentation/zorro.txt @ 524:7f8b544237bf

netfront: Allow netfront in domain 0.

This is useful if your physical network device is in a utility domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 15 15:18:58 2008 +0100 (2008-04-15)
parents 831230e53067
children
rev   line source
ian@0 1 Writing Device Drivers for Zorro Devices
ian@0 2 ----------------------------------------
ian@0 3
ian@0 4 Written by Geert Uytterhoeven <geert@linux-m68k.org>
ian@0 5 Last revised: September 5, 2003
ian@0 6
ian@0 7
ian@0 8 1. Introduction
ian@0 9 ---------------
ian@0 10
ian@0 11 The Zorro bus is the bus used in the Amiga family of computers. Thanks to
ian@0 12 AutoConfig(tm), it's 100% Plug-and-Play.
ian@0 13
ian@0 14 There are two types of Zorro busses, Zorro II and Zorro III:
ian@0 15
ian@0 16 - The Zorro II address space is 24-bit and lies within the first 16 MB of the
ian@0 17 Amiga's address map.
ian@0 18
ian@0 19 - Zorro III is a 32-bit extension of Zorro II, which is backwards compatible
ian@0 20 with Zorro II. The Zorro III address space lies outside the first 16 MB.
ian@0 21
ian@0 22
ian@0 23 2. Probing for Zorro Devices
ian@0 24 ----------------------------
ian@0 25
ian@0 26 Zorro devices are found by calling `zorro_find_device()', which returns a
ian@0 27 pointer to the `next' Zorro device with the specified Zorro ID. A probe loop
ian@0 28 for the board with Zorro ID `ZORRO_PROD_xxx' looks like:
ian@0 29
ian@0 30 struct zorro_dev *z = NULL;
ian@0 31
ian@0 32 while ((z = zorro_find_device(ZORRO_PROD_xxx, z))) {
ian@0 33 if (!zorro_request_region(z->resource.start+MY_START, MY_SIZE,
ian@0 34 "My explanation"))
ian@0 35 ...
ian@0 36 }
ian@0 37
ian@0 38 `ZORRO_WILDCARD' acts as a wildcard and finds any Zorro device. If your driver
ian@0 39 supports different types of boards, you can use a construct like:
ian@0 40
ian@0 41 struct zorro_dev *z = NULL;
ian@0 42
ian@0 43 while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
ian@0 44 if (z->id != ZORRO_PROD_xxx1 && z->id != ZORRO_PROD_xxx2 && ...)
ian@0 45 continue;
ian@0 46 if (!zorro_request_region(z->resource.start+MY_START, MY_SIZE,
ian@0 47 "My explanation"))
ian@0 48 ...
ian@0 49 }
ian@0 50
ian@0 51
ian@0 52 3. Zorro Resources
ian@0 53 ------------------
ian@0 54
ian@0 55 Before you can access a Zorro device's registers, you have to make sure it's
ian@0 56 not yet in use. This is done using the I/O memory space resource management
ian@0 57 functions:
ian@0 58
ian@0 59 request_mem_region()
ian@0 60 release_mem_region()
ian@0 61
ian@0 62 Shortcuts to claim the whole device's address space are provided as well:
ian@0 63
ian@0 64 zorro_request_device
ian@0 65 zorro_release_device
ian@0 66
ian@0 67
ian@0 68 4. Accessing the Zorro Address Space
ian@0 69 ------------------------------------
ian@0 70
ian@0 71 The address regions in the Zorro device resources are Zorro bus address
ian@0 72 regions. Due to the identity bus-physical address mapping on the Zorro bus,
ian@0 73 they are CPU physical addresses as well.
ian@0 74
ian@0 75 The treatment of these regions depends on the type of Zorro space:
ian@0 76
ian@0 77 - Zorro II address space is always mapped and does not have to be mapped
ian@0 78 explicitly using z_ioremap().
ian@0 79
ian@0 80 Conversion from bus/physical Zorro II addresses to kernel virtual addresses
ian@0 81 and vice versa is done using:
ian@0 82
ian@0 83 virt_addr = ZTWO_VADDR(bus_addr);
ian@0 84 bus_addr = ZTWO_PADDR(virt_addr);
ian@0 85
ian@0 86 - Zorro III address space must be mapped explicitly using z_ioremap() first
ian@0 87 before it can be accessed:
ian@0 88
ian@0 89 virt_addr = z_ioremap(bus_addr, size);
ian@0 90 ...
ian@0 91 z_iounmap(virt_addr);
ian@0 92
ian@0 93
ian@0 94 5. References
ian@0 95 -------------
ian@0 96
ian@0 97 linux/include/linux/zorro.h
ian@0 98 linux/include/asm-{m68k,ppc}/zorro.h
ian@0 99 linux/include/linux/zorro_ids.h
ian@0 100 linux/drivers/zorro
ian@0 101 /proc/bus/zorro
ian@0 102