1*8d3d810cSminoura /* $NetBSD: bootinfo.h,v 1.4 2001/09/27 09:55:10 minoura Exp $ */ 21bf1486aSitohy 31bf1486aSitohy /* 41bf1486aSitohy * Copyright (c) 1998 ITOH, Yasufumi 51bf1486aSitohy * All rights reserved. 61bf1486aSitohy * 71bf1486aSitohy * Redistribution and use in source and binary forms, with or without 81bf1486aSitohy * modification, are permitted provided that the following conditions 91bf1486aSitohy * are met: 101bf1486aSitohy * 1. Redistributions of source code must retain the above copyright 111bf1486aSitohy * notice, this list of conditions and the following disclaimer. 121bf1486aSitohy * 2. Redistributions in binary form must reproduce the above copyright 131bf1486aSitohy * notice, this list of conditions and the following disclaimer in the 141bf1486aSitohy * documentation and/or other materials provided with the distribution. 151bf1486aSitohy * 161bf1486aSitohy * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 171bf1486aSitohy * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 181bf1486aSitohy * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 191bf1486aSitohy * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 201bf1486aSitohy * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 211bf1486aSitohy * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 221bf1486aSitohy * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 231bf1486aSitohy * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 241bf1486aSitohy * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 251bf1486aSitohy * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 261bf1486aSitohy */ 271bf1486aSitohy 281bf1486aSitohy #ifndef _X68K_BOOTINFO_H_ 291bf1486aSitohy #define _X68K_BOOTINFO_H_ 301bf1486aSitohy 311bf1486aSitohy /* 321bf1486aSitohy * machine dependent boot information 331bf1486aSitohy * passed from boot loader to the NetBSD kernel 341bf1486aSitohy */ 351bf1486aSitohy 361bf1486aSitohy /* 371bf1486aSitohy * NetBSD/x68k uses MAKEBOOTDEV() framework defined in <sys/reboot.h> 381bf1486aSitohy */ 391bf1486aSitohy #include <sys/reboot.h> 401bf1486aSitohy 411bf1486aSitohy /* 421bf1486aSitohy * for non-SCSI devices 431bf1486aSitohy */ 441bf1486aSitohy /* major */ 451bf1486aSitohy #define X68K_MAJOR_FD 2 /* floppy disk */ 461bf1486aSitohy #define X68K_MAJOR_MD 8 /* memory disk */ 47be7984a0Sminoura #define X68K_MAJOR_NE 255 /* network interface: ne */ 481bf1486aSitohy 491bf1486aSitohy #define X68K_MAKEBOOTDEV(major, unit, part) \ 501bf1486aSitohy MAKEBOOTDEV(major, 0, 0, unit, part) 511bf1486aSitohy 521bf1486aSitohy 531bf1486aSitohy /* 541bf1486aSitohy * for SCSI devices 551bf1486aSitohy * 561bf1486aSitohy * device major -> type (8bit) 571bf1486aSitohy * type of interface -> adaptor (4bit) 581bf1486aSitohy * unit # of interface -> controller (4bit) 591bf1486aSitohy * target SCSI ID -> unit (4bit) 601bf1486aSitohy * target LUN -> partition (3bit; bit 4:6) 611bf1486aSitohy * partition -> partition (4bit; bit 0:3) 621bf1486aSitohy * 631bf1486aSitohy * bit #7 of "partition" is reserved for future extension 641bf1486aSitohy */ 651bf1486aSitohy /* major */ 661bf1486aSitohy #define X68K_MAJOR_SD 4 /* SCSI disk */ 671bf1486aSitohy /* X68K_MAJOR_ST 5 XXX not yet */ 681bf1486aSitohy #define X68K_MAJOR_CD 7 /* SCSI CD-ROM */ 691bf1486aSitohy 701bf1486aSitohy /* type_if */ 711bf1486aSitohy #define X68K_BOOT_SCSIIF_OLDBOOT 0 /* old boot used this value */ 721bf1486aSitohy #define X68K_BOOT_SCSIIF_SPC 1 /* spc */ 731bf1486aSitohy #define X68K_BOOT_SCSIIF_MHA 2 /* mha */ 741bf1486aSitohy 751bf1486aSitohy #define X68K_MAKESCSIBOOTDEV(major, type_if, unit_if, scsi_id, lun, part) \ 761bf1486aSitohy MAKEBOOTDEV(major, type_if, unit_if, scsi_id, ((lun) << 4) | (part)) 771bf1486aSitohy 781bf1486aSitohy #define B_X68K_SCSI_IF(val) B_ADAPTOR(val) 791bf1486aSitohy #define B_X68K_SCSI_IF_UN(val) B_CONTROLLER(val) 801bf1486aSitohy 811bf1486aSitohy #define B_X68K_SCSI_ID(val) B_UNIT(val) 82b40f2a1cSitohy #define B_X68K_SCSI_LUN(val) (((val) >> (B_PARTITIONSHIFT + 4)) & 07) 831bf1486aSitohy 841bf1486aSitohy #define B_X68K_SCSI_PART(val) (((val) >> B_PARTITIONSHIFT) & 017) 851bf1486aSitohy 861bf1486aSitohy #if 0 871bf1486aSitohy /* this bit is reserved for future extension */ 88b40f2a1cSitohy #define B_X68K_SCSI_EXT(val) (((val) >> (B_PARTITIONSHIFT + 7)) & 01) 891bf1486aSitohy #endif 901bf1486aSitohy 911bf1486aSitohy 921bf1486aSitohy /* 931bf1486aSitohy * for array initialization 941bf1486aSitohy */ 951bf1486aSitohy 961bf1486aSitohy #define X68K_BOOT_DEV_LIST \ 971bf1486aSitohy { "fd", X68K_MAJOR_FD }, \ 981bf1486aSitohy { "sd", X68K_MAJOR_SD }, \ 991bf1486aSitohy { "cd", X68K_MAJOR_CD }, \ 1001bf1486aSitohy { "md", X68K_MAJOR_MD } 1011bf1486aSitohy 1021bf1486aSitohy #define X68K_BOOT_DEV_STRINGS \ 1031bf1486aSitohy NULL, NULL, "fd", NULL, "sd", NULL, NULL, "cd" 1041bf1486aSitohy 1051bf1486aSitohy #define X68K_BOOT_DEV_IS_SCSI(major) \ 1061bf1486aSitohy ((major) == X68K_MAJOR_SD || \ 1071bf1486aSitohy (major) == X68K_MAJOR_CD) 1081bf1486aSitohy 1091bf1486aSitohy #define X68K_BOOT_SCSIIF_LIST \ 1101bf1486aSitohy { "spc", X68K_BOOT_SCSIIF_SPC },\ 1111bf1486aSitohy { "mha", X68K_BOOT_SCSIIF_MHA } 1121bf1486aSitohy 1131bf1486aSitohy #define X68K_BOOT_SCSIIF_STRINGS \ 1141bf1486aSitohy NULL, "spc", "mha" 1151bf1486aSitohy 116be7984a0Sminoura #define X68K_BOOT_NETIF_LIST \ 117be7984a0Sminoura { "ne", X68K_MAJOR_NE } 118be7984a0Sminoura 119be7984a0Sminoura #define X68K_BOOT_NETIF_STRINGS \ 120be7984a0Sminoura "ne" 121be7984a0Sminoura 122be7984a0Sminoura #define X68K_BOOT_DEV_IS_NETIF(major) \ 123be7984a0Sminoura ((major) == X68K_MAJOR_NE) 124be7984a0Sminoura 125*8d3d810cSminoura 126*8d3d810cSminoura /* Kernel boot interface version */ 127*8d3d810cSminoura #define X68K_BOOTIF_VERS 0 128*8d3d810cSminoura #define X68K_BOOTIF_VERS_COMPAT 0x4e73 /* rte instruction */ 129*8d3d810cSminoura 1301bf1486aSitohy #endif /* _X68K_BOOTINFO_H_ */ 131