aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-10-03 04:45:36 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-11-26 05:09:08 -0500
commit986ea58dfb52097999cc388880505fc7a10e4779 (patch)
treeea30cc4a08720073e4ce90efb488afdbcb34e035
parent6112ea0862facaeaeab504ee01c0d04bcd22daaf (diff)
zorro/UAPI: Disintegrate include/linux/zorro*.h
The Zorro definitions and device IDs are used by bootstraps, hence they should be exported through UAPI. Unfortunately zorro.h was never marked for export when headers_install was introduced, so it was forgotten during the big UAPI disintegration. In addition, the removal of zorro_ids.h had been sneaked into commit 7e7a43c32a8970ea2bfc3d1af353dcb1a9237769 ("PCI: don't export device IDs to userspace") before, so it was also forgotten. Split off and export the Zorro definitions used by bootstraps. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r--Documentation/zorro.txt3
-rw-r--r--include/linux/zorro.h103
-rw-r--r--include/uapi/linux/Kbuild2
-rw-r--r--include/uapi/linux/zorro.h113
-rw-r--r--include/uapi/linux/zorro_ids.h (renamed from include/linux/zorro_ids.h)0
5 files changed, 119 insertions, 102 deletions
diff --git a/Documentation/zorro.txt b/Documentation/zorro.txt
index d17670400564..90a64d52bea2 100644
--- a/Documentation/zorro.txt
+++ b/Documentation/zorro.txt
@@ -95,8 +95,9 @@ The treatment of these regions depends on the type of Zorro space:
95------------- 95-------------
96 96
97linux/include/linux/zorro.h 97linux/include/linux/zorro.h
98linux/include/uapi/linux/zorro.h
99linux/include/uapi/linux/zorro_ids.h
98linux/arch/m68k/include/asm/zorro.h 100linux/arch/m68k/include/asm/zorro.h
99linux/include/linux/zorro_ids.h
100linux/drivers/zorro 101linux/drivers/zorro
101/proc/bus/zorro 102/proc/bus/zorro
102 103
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 661cbd2a86ee..63fbba0740c2 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -11,107 +11,10 @@
11#ifndef _LINUX_ZORRO_H 11#ifndef _LINUX_ZORRO_H
12#define _LINUX_ZORRO_H 12#define _LINUX_ZORRO_H
13 13
14#include <linux/device.h>
15
16
17 /*
18 * Each Zorro board has a 32-bit ID of the form
19 *
20 * mmmmmmmmmmmmmmmmppppppppeeeeeeee
21 *
22 * with
23 *
24 * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh))
25 * pppppppp 8-bit Product ID (assigned by manufacturer)
26 * eeeeeeee 8-bit Extended Product ID (currently only used
27 * for some GVP boards)
28 */
29
30
31#define ZORRO_MANUF(id) ((id) >> 16)
32#define ZORRO_PROD(id) (((id) >> 8) & 0xff)
33#define ZORRO_EPC(id) ((id) & 0xff)
34
35#define ZORRO_ID(manuf, prod, epc) \
36 ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
37
38typedef __u32 zorro_id;
39 14
15#include <uapi/linux/zorro.h>
40 16
41/* Include the ID list */ 17#include <linux/device.h>
42#include <linux/zorro_ids.h>
43
44
45 /*
46 * GVP identifies most of its products through the 'extended product code'
47 * (epc). The epc has to be ANDed with the GVP_PRODMASK before the
48 * identification.
49 */
50
51#define GVP_PRODMASK (0xf8)
52#define GVP_SCSICLKMASK (0x01)
53
54enum GVP_flags {
55 GVP_IO = 0x01,
56 GVP_ACCEL = 0x02,
57 GVP_SCSI = 0x04,
58 GVP_24BITDMA = 0x08,
59 GVP_25BITDMA = 0x10,
60 GVP_NOBANK = 0x20,
61 GVP_14MHZ = 0x40,
62};
63
64
65struct Node {
66 struct Node *ln_Succ; /* Pointer to next (successor) */
67 struct Node *ln_Pred; /* Pointer to previous (predecessor) */
68 __u8 ln_Type;
69 __s8 ln_Pri; /* Priority, for sorting */
70 __s8 *ln_Name; /* ID string, null terminated */
71} __attribute__ ((packed));
72
73struct ExpansionRom {
74 /* -First 16 bytes of the expansion ROM */
75 __u8 er_Type; /* Board type, size and flags */
76 __u8 er_Product; /* Product number, assigned by manufacturer */
77 __u8 er_Flags; /* Flags */
78 __u8 er_Reserved03; /* Must be zero ($ff inverted) */
79 __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */
80 __u32 er_SerialNumber; /* Available for use by manufacturer */
81 __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */
82 __u8 er_Reserved0c;
83 __u8 er_Reserved0d;
84 __u8 er_Reserved0e;
85 __u8 er_Reserved0f;
86} __attribute__ ((packed));
87
88/* er_Type board type bits */
89#define ERT_TYPEMASK 0xc0
90#define ERT_ZORROII 0xc0
91#define ERT_ZORROIII 0x80
92
93/* other bits defined in er_Type */
94#define ERTB_MEMLIST 5 /* Link RAM into free memory list */
95#define ERTF_MEMLIST (1<<5)
96
97struct ConfigDev {
98 struct Node cd_Node;
99 __u8 cd_Flags; /* (read/write) */
100 __u8 cd_Pad; /* reserved */
101 struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */
102 void *cd_BoardAddr; /* where in memory the board was placed */
103 __u32 cd_BoardSize; /* size of board in bytes */
104 __u16 cd_SlotAddr; /* which slot number (PRIVATE) */
105 __u16 cd_SlotSize; /* number of slots (PRIVATE) */
106 void *cd_Driver; /* pointer to node of driver */
107 struct ConfigDev *cd_NextCD; /* linked list of drivers to config */
108 __u32 cd_Unused[4]; /* for whatever the driver wants */
109} __attribute__ ((packed));
110
111#define ZORRO_NUM_AUTO 16
112
113#ifdef __KERNEL__
114
115#include <linux/init.h> 18#include <linux/init.h>
116#include <linux/ioport.h> 19#include <linux/ioport.h>
117#include <linux/mod_devicetable.h> 20#include <linux/mod_devicetable.h>
@@ -245,6 +148,4 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128);
245#define Z2RAM_CHUNKSHIFT (16) 148#define Z2RAM_CHUNKSHIFT (16)
246 149
247 150
248#endif /* __KERNEL__ */
249
250#endif /* _LINUX_ZORRO_H */ 151#endif /* _LINUX_ZORRO_H */
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 33d2b8fe166d..3ce25b5d75a9 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -426,3 +426,5 @@ header-y += x25.h
426header-y += xattr.h 426header-y += xattr.h
427header-y += xfrm.h 427header-y += xfrm.h
428header-y += hw_breakpoint.h 428header-y += hw_breakpoint.h
429header-y += zorro.h
430header-y += zorro_ids.h
diff --git a/include/uapi/linux/zorro.h b/include/uapi/linux/zorro.h
new file mode 100644
index 000000000000..36a033e23d31
--- /dev/null
+++ b/include/uapi/linux/zorro.h
@@ -0,0 +1,113 @@
1/*
2 * linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions
3 *
4 * Copyright (C) 1995--2003 Geert Uytterhoeven
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _UAPI_LINUX_ZORRO_H
12#define _UAPI_LINUX_ZORRO_H
13
14#include <linux/types.h>
15
16
17 /*
18 * Each Zorro board has a 32-bit ID of the form
19 *
20 * mmmmmmmmmmmmmmmmppppppppeeeeeeee
21 *
22 * with
23 *
24 * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh))
25 * pppppppp 8-bit Product ID (assigned by manufacturer)
26 * eeeeeeee 8-bit Extended Product ID (currently only used
27 * for some GVP boards)
28 */
29
30
31#define ZORRO_MANUF(id) ((id) >> 16)
32#define ZORRO_PROD(id) (((id) >> 8) & 0xff)
33#define ZORRO_EPC(id) ((id) & 0xff)
34
35#define ZORRO_ID(manuf, prod, epc) \
36 ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
37
38typedef __u32 zorro_id;
39
40
41/* Include the ID list */
42#include <linux/zorro_ids.h>
43
44
45 /*
46 * GVP identifies most of its products through the 'extended product code'
47 * (epc). The epc has to be ANDed with the GVP_PRODMASK before the
48 * identification.
49 */
50
51#define GVP_PRODMASK (0xf8)
52#define GVP_SCSICLKMASK (0x01)
53
54enum GVP_flags {
55 GVP_IO = 0x01,
56 GVP_ACCEL = 0x02,
57 GVP_SCSI = 0x04,
58 GVP_24BITDMA = 0x08,
59 GVP_25BITDMA = 0x10,
60 GVP_NOBANK = 0x20,
61 GVP_14MHZ = 0x40,
62};
63
64
65struct Node {
66 struct Node *ln_Succ; /* Pointer to next (successor) */
67 struct Node *ln_Pred; /* Pointer to previous (predecessor) */
68 __u8 ln_Type;
69 __s8 ln_Pri; /* Priority, for sorting */
70 __s8 *ln_Name; /* ID string, null terminated */
71} __packed;
72
73struct ExpansionRom {
74 /* -First 16 bytes of the expansion ROM */
75 __u8 er_Type; /* Board type, size and flags */
76 __u8 er_Product; /* Product number, assigned by manufacturer */
77 __u8 er_Flags; /* Flags */
78 __u8 er_Reserved03; /* Must be zero ($ff inverted) */
79 __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */
80 __u32 er_SerialNumber; /* Available for use by manufacturer */
81 __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */
82 __u8 er_Reserved0c;
83 __u8 er_Reserved0d;
84 __u8 er_Reserved0e;
85 __u8 er_Reserved0f;
86} __packed;
87
88/* er_Type board type bits */
89#define ERT_TYPEMASK 0xc0
90#define ERT_ZORROII 0xc0
91#define ERT_ZORROIII 0x80
92
93/* other bits defined in er_Type */
94#define ERTB_MEMLIST 5 /* Link RAM into free memory list */
95#define ERTF_MEMLIST (1<<5)
96
97struct ConfigDev {
98 struct Node cd_Node;
99 __u8 cd_Flags; /* (read/write) */
100 __u8 cd_Pad; /* reserved */
101 struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */
102 void *cd_BoardAddr; /* where in memory the board was placed */
103 __u32 cd_BoardSize; /* size of board in bytes */
104 __u16 cd_SlotAddr; /* which slot number (PRIVATE) */
105 __u16 cd_SlotSize; /* number of slots (PRIVATE) */
106 void *cd_Driver; /* pointer to node of driver */
107 struct ConfigDev *cd_NextCD; /* linked list of drivers to config */
108 __u32 cd_Unused[4]; /* for whatever the driver wants */
109} __packed;
110
111#define ZORRO_NUM_AUTO 16
112
113#endif /* _UAPI_LINUX_ZORRO_H */
diff --git a/include/linux/zorro_ids.h b/include/uapi/linux/zorro_ids.h
index 74bc53bcfdcf..74bc53bcfdcf 100644
--- a/include/linux/zorro_ids.h
+++ b/include/uapi/linux/zorro_ids.h