Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / x68k / include / bootinfo.h
blob947c106976801966938470da6457fbb7d926e5ca
1 /* $NetBSD: bootinfo.h,v 1.3 1999/09/23 15:14:58 minoura Exp $ */
3 /*
4 * Copyright (c) 1998 ITOH, Yasufumi
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #ifndef _X68K_BOOTINFO_H_
29 #define _X68K_BOOTINFO_H_
32 * machine dependent boot information
33 * passed from boot loader to the NetBSD kernel
37 * NetBSD/x68k uses MAKEBOOTDEV() framework defined in <sys/reboot.h>
39 #include <sys/reboot.h>
42 * for non-SCSI devices
44 /* major */
45 #define X68K_MAJOR_FD 2 /* floppy disk */
46 #define X68K_MAJOR_MD 8 /* memory disk */
47 #define X68K_MAJOR_NE 255 /* network interface: ne */
49 #define X68K_MAKEBOOTDEV(major, unit, part) \
50 MAKEBOOTDEV(major, 0, 0, unit, part)
54 * for SCSI devices
56 * device major -> type (8bit)
57 * type of interface -> adaptor (4bit)
58 * unit # of interface -> controller (4bit)
59 * target SCSI ID -> unit (4bit)
60 * target LUN -> partition (3bit; bit 4:6)
61 * partition -> partition (4bit; bit 0:3)
63 * bit #7 of "partition" is reserved for future extension
65 /* major */
66 #define X68K_MAJOR_SD 4 /* SCSI disk */
67 /* X68K_MAJOR_ST 5 XXX not yet */
68 #define X68K_MAJOR_CD 7 /* SCSI CD-ROM */
70 /* type_if */
71 #define X68K_BOOT_SCSIIF_OLDBOOT 0 /* old boot used this value */
72 #define X68K_BOOT_SCSIIF_SPC 1 /* spc */
73 #define X68K_BOOT_SCSIIF_MHA 2 /* mha */
75 #define X68K_MAKESCSIBOOTDEV(major, type_if, unit_if, scsi_id, lun, part) \
76 MAKEBOOTDEV(major, type_if, unit_if, scsi_id, ((lun) << 4) | (part))
78 #define B_X68K_SCSI_IF(val) B_ADAPTOR(val)
79 #define B_X68K_SCSI_IF_UN(val) B_CONTROLLER(val)
81 #define B_X68K_SCSI_ID(val) B_UNIT(val)
82 #define B_X68K_SCSI_LUN(val) (((val) >> (B_PARTITIONSHIFT + 4)) & 07)
84 #define B_X68K_SCSI_PART(val) (((val) >> B_PARTITIONSHIFT) & 017)
86 #if 0
87 /* this bit is reserved for future extension */
88 #define B_X68K_SCSI_EXT(val) (((val) >> (B_PARTITIONSHIFT + 7)) & 01)
89 #endif
93 * for array initialization
96 #define X68K_BOOT_DEV_LIST \
97 { "fd", X68K_MAJOR_FD }, \
98 { "sd", X68K_MAJOR_SD }, \
99 { "cd", X68K_MAJOR_CD }, \
100 { "md", X68K_MAJOR_MD }
102 #define X68K_BOOT_DEV_STRINGS \
103 NULL, NULL, "fd", NULL, "sd", NULL, NULL, "cd"
105 #define X68K_BOOT_DEV_IS_SCSI(major) \
106 ((major) == X68K_MAJOR_SD || \
107 (major) == X68K_MAJOR_CD)
109 #define X68K_BOOT_SCSIIF_LIST \
110 { "spc", X68K_BOOT_SCSIIF_SPC },\
111 { "mha", X68K_BOOT_SCSIIF_MHA }
113 #define X68K_BOOT_SCSIIF_STRINGS \
114 NULL, "spc", "mha"
116 #define X68K_BOOT_NETIF_LIST \
117 { "ne", X68K_MAJOR_NE }
119 #define X68K_BOOT_NETIF_STRINGS \
120 "ne"
122 #define X68K_BOOT_DEV_IS_NETIF(major) \
123 ((major) == X68K_MAJOR_NE)
126 /* Kernel boot interface version */
127 #define X68K_BOOTIF_VERS 0
128 #define X68K_BOOTIF_VERS_COMPAT 0x4e73 /* rte instruction */
130 #endif /* _X68K_BOOTINFO_H_ */