1*545236f4Snia /* $NetBSD: md.h,v 1.9 2024/04/09 15:17:25 nia Exp $ */ 250dbef1aSdholland 350dbef1aSdholland /* 450dbef1aSdholland * Copyright 1997 Piermont Information Systems Inc. 550dbef1aSdholland * All rights reserved. 650dbef1aSdholland * 750dbef1aSdholland * Based on code written by Philip A. Nelson for Piermont Information 850dbef1aSdholland * Systems Inc. 950dbef1aSdholland * 1050dbef1aSdholland * Redistribution and use in source and binary forms, with or without 1150dbef1aSdholland * modification, are permitted provided that the following conditions 1250dbef1aSdholland * are met: 1350dbef1aSdholland * 1. Redistributions of source code must retain the above copyright 1450dbef1aSdholland * notice, this list of conditions and the following disclaimer. 1550dbef1aSdholland * 2. Redistributions in binary form must reproduce the above copyright 1650dbef1aSdholland * notice, this list of conditions and the following disclaimer in the 1750dbef1aSdholland * documentation and/or other materials provided with the distribution. 1850dbef1aSdholland * 3. The name of Piermont Information Systems Inc. may not be used to endorse 1950dbef1aSdholland * or promote products derived from this software without specific prior 2050dbef1aSdholland * written permission. 2150dbef1aSdholland * 2250dbef1aSdholland * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' 2350dbef1aSdholland * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2450dbef1aSdholland * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2550dbef1aSdholland * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE 2650dbef1aSdholland * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2750dbef1aSdholland * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2850dbef1aSdholland * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2950dbef1aSdholland * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 3050dbef1aSdholland * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3150dbef1aSdholland * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 3250dbef1aSdholland * THE POSSIBILITY OF SUCH DAMAGE. 3350dbef1aSdholland * 3450dbef1aSdholland */ 3550dbef1aSdholland 3650dbef1aSdholland /* md.h -- Machine specific definitions for evbarm */ 3750dbef1aSdholland 3850dbef1aSdholland #include "mbr.h" 3950dbef1aSdholland 4050dbef1aSdholland /* Constants and defines */ 414103857bSmartin #define PART_BOOT (16*MEG) 42249ed7a6Smartin #define PART_BOOT_LARGE (32*MEG) 434103857bSmartin #define PART_BOOT_TYPE FS_MSDOS 44249ed7a6Smartin #define PART_BOOT_SUBT MBR_PTYPE_FAT16L 454103857bSmartin #define PART_BOOT_MOUNT "/boot" 4650dbef1aSdholland 4750dbef1aSdholland /* Megs required for a full X installation. */ 4850dbef1aSdholland #define XNEEDMB 60 4950dbef1aSdholland 50249ed7a6Smartin #define DEFSWAPSIZE (-1) 51249ed7a6Smartin 52249ed7a6Smartin /* use UFS2 by default for ffs */ 53249ed7a6Smartin #define DEFAULT_UFS2 54249ed7a6Smartin 5550dbef1aSdholland #define HAVE_UFS2_BOOT 5650dbef1aSdholland 57249ed7a6Smartin /* allow using tmpfs for /tmp instead of mfs */ 58249ed7a6Smartin #define HAVE_TMPFS 59249ed7a6Smartin 6050dbef1aSdholland /* 6150dbef1aSdholland * Default filesets to fetch and install during installation 6250dbef1aSdholland * or upgrade. The standard sets are: 63*545236f4Snia * base etc comp games gpufw man manhtml misc rescue tests text xbase xcomp xetc xfont xserver 6450dbef1aSdholland */ 65249ed7a6Smartin #if 0 /* XXX */ 6650dbef1aSdholland #define SET_KERNEL_1_NAME "kern-ADI_BRH" 6750dbef1aSdholland #define SET_KERNEL_2_NAME "kern-INTEGRATOR" 6850dbef1aSdholland #define SET_KERNEL_3_NAME "kern-IQ80310" 6950dbef1aSdholland #define SET_KERNEL_4_NAME "kern-IQ80321" 7050dbef1aSdholland #define SET_KERNEL_5_NAME "kern-MINI2440" 7150dbef1aSdholland #define SET_KERNEL_6_NAME "kern-TEAMASA_NPWR" 7250dbef1aSdholland #define SET_KERNEL_7_NAME "kern-TS7200" 7350dbef1aSdholland #define SET_KERNEL_8_NAME "kern-RPI" 7450dbef1aSdholland #define SET_KERNEL_9_NAME "kern-KUROBOX_PRO" 75249ed7a6Smartin #endif 76249ed7a6Smartin 77249ed7a6Smartin #ifdef _LP64 78249ed7a6Smartin #define SET_KERNEL_1_NAME "kern-GENERIC64" 79249ed7a6Smartin #else 80249ed7a6Smartin #define SET_KERNEL_1_NAME "kern-GENERIC" 81249ed7a6Smartin #endif 8250dbef1aSdholland 8350dbef1aSdholland #define MD_SETS_SELECTED SET_SYSTEM 8450dbef1aSdholland 8550dbef1aSdholland /* 8650dbef1aSdholland * Machine-specific command to write a new label to a disk. 8750dbef1aSdholland * For example, shark uses "/sbin/disklabel -w -r". 8850dbef1aSdholland * Sun ports should probably use DISKLABEL_CMD "/sbin/disklabel -w" 8950dbef1aSdholland * to get incore to ondisk inode translation for the Sun proms. 9050dbef1aSdholland * If not defined, we assume the port does not support disklabels and 9150dbef1aSdholland * hand-edited disklabel will NOT be written by MI code. 9250dbef1aSdholland */ 9350dbef1aSdholland #define DISKLABEL_CMD "disklabel -w -r" 9450dbef1aSdholland 9550dbef1aSdholland /* Special board type routines need a switch */ 96c604f98eSmartin #define BOARD_TYPE_NORMAL 0 /* assume u-boot */ 97c604f98eSmartin #define BOARD_TYPE_RPI 1 /* RPi firmware booted us */ 98c604f98eSmartin #define BOARD_TYPE_ACPI 2 /* generic SBSA machine */ 99a6920367Sjoerg extern int boardtype; 1004103857bSmartin 1014103857bSmartin /* 1024103857bSmartin * Size limit for the initial GPT part, in bytes. This allows us to 1034103857bSmartin * dd u-boot at 8k into the image for allwinner SoCs. 1044103857bSmartin */ 1054103857bSmartin #define MD_GPT_INITIAL_SIZE (8*1024) 1064103857bSmartin 107249ed7a6Smartin 108249ed7a6Smartin #define HAVE_GPT_BOOT /* yes, u-boot can boot us from GPT */ 109249ed7a6Smartin #define NO_DISKLABEL_BOOT /* ... but not directly from disklabel */ 110249ed7a6Smartin 111249ed7a6Smartin #define MD_MAY_SWAP_TO(DISK) may_swap_if_not_sdmmc(DISK) 112249ed7a6Smartin 113249ed7a6Smartin int evbarm_extract_finalize(int); 114249ed7a6Smartin #define MD_SET_EXTRACT_FINALIZE(UP) evbarm_extract_finalize(UP) 115249ed7a6Smartin 116249ed7a6Smartin void evbarm_part_defaults(struct pm_devs*, struct part_usage_info*, 117249ed7a6Smartin size_t num_usage_infos); 118249ed7a6Smartin 119249ed7a6Smartin #define MD_PART_DEFAULTS(A,B,C) evbarm_part_defaults(A,B,C) 120249ed7a6Smartin 121325b9996Smartin #define HAVE_EFI_BOOT 1 /* we support EFI boot partitions */ 122325b9996Smartin 123