18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * asm/bootinfo.h -- Definition of the Linux/m68k boot information structure
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright 1992 by Greg Harp
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
88c2ecf20Sopenharmony_ci * License.  See the file COPYING in the main directory of this archive
98c2ecf20Sopenharmony_ci * for more details.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_M68K_BOOTINFO_H
138c2ecf20Sopenharmony_ci#define _UAPI_ASM_M68K_BOOTINFO_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include <linux/types.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci    /*
228c2ecf20Sopenharmony_ci     *  Bootinfo definitions
238c2ecf20Sopenharmony_ci     *
248c2ecf20Sopenharmony_ci     *  This is an easily parsable and extendable structure containing all
258c2ecf20Sopenharmony_ci     *  information to be passed from the bootstrap to the kernel.
268c2ecf20Sopenharmony_ci     *
278c2ecf20Sopenharmony_ci     *  This way I hope to keep all future changes back/forewards compatible.
288c2ecf20Sopenharmony_ci     *  Thus, keep your fingers crossed...
298c2ecf20Sopenharmony_ci     *
308c2ecf20Sopenharmony_ci     *  This structure is copied right after the kernel by the bootstrap
318c2ecf20Sopenharmony_ci     *  routine.
328c2ecf20Sopenharmony_ci     */
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_cistruct bi_record {
358c2ecf20Sopenharmony_ci	__be16 tag;			/* tag ID */
368c2ecf20Sopenharmony_ci	__be16 size;			/* size of record (in bytes) */
378c2ecf20Sopenharmony_ci	__be32 data[0];			/* data */
388c2ecf20Sopenharmony_ci};
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistruct mem_info {
428c2ecf20Sopenharmony_ci	__be32 addr;			/* physical address of memory chunk */
438c2ecf20Sopenharmony_ci	__be32 size;			/* length of memory chunk (in bytes) */
448c2ecf20Sopenharmony_ci};
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci    /*
508c2ecf20Sopenharmony_ci     *  Tag Definitions
518c2ecf20Sopenharmony_ci     *
528c2ecf20Sopenharmony_ci     *  Machine independent tags start counting from 0x0000
538c2ecf20Sopenharmony_ci     *  Machine dependent tags start counting from 0x8000
548c2ecf20Sopenharmony_ci     */
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define BI_LAST			0x0000	/* last record (sentinel) */
578c2ecf20Sopenharmony_ci#define BI_MACHTYPE		0x0001	/* machine type (__be32) */
588c2ecf20Sopenharmony_ci#define BI_CPUTYPE		0x0002	/* cpu type (__be32) */
598c2ecf20Sopenharmony_ci#define BI_FPUTYPE		0x0003	/* fpu type (__be32) */
608c2ecf20Sopenharmony_ci#define BI_MMUTYPE		0x0004	/* mmu type (__be32) */
618c2ecf20Sopenharmony_ci#define BI_MEMCHUNK		0x0005	/* memory chunk address and size */
628c2ecf20Sopenharmony_ci					/* (struct mem_info) */
638c2ecf20Sopenharmony_ci#define BI_RAMDISK		0x0006	/* ramdisk address and size */
648c2ecf20Sopenharmony_ci					/* (struct mem_info) */
658c2ecf20Sopenharmony_ci#define BI_COMMAND_LINE		0x0007	/* kernel command line parameters */
668c2ecf20Sopenharmony_ci					/* (string) */
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci    /*
708c2ecf20Sopenharmony_ci     *  Linux/m68k Architectures (BI_MACHTYPE)
718c2ecf20Sopenharmony_ci     */
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define MACH_AMIGA		1
748c2ecf20Sopenharmony_ci#define MACH_ATARI		2
758c2ecf20Sopenharmony_ci#define MACH_MAC		3
768c2ecf20Sopenharmony_ci#define MACH_APOLLO		4
778c2ecf20Sopenharmony_ci#define MACH_SUN3		5
788c2ecf20Sopenharmony_ci#define MACH_MVME147		6
798c2ecf20Sopenharmony_ci#define MACH_MVME16x		7
808c2ecf20Sopenharmony_ci#define MACH_BVME6000		8
818c2ecf20Sopenharmony_ci#define MACH_HP300		9
828c2ecf20Sopenharmony_ci#define MACH_Q40		10
838c2ecf20Sopenharmony_ci#define MACH_SUN3X		11
848c2ecf20Sopenharmony_ci#define MACH_M54XX		12
858c2ecf20Sopenharmony_ci#define MACH_M5441X		13
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci    /*
898c2ecf20Sopenharmony_ci     *  CPU, FPU and MMU types (BI_CPUTYPE, BI_FPUTYPE, BI_MMUTYPE)
908c2ecf20Sopenharmony_ci     *
918c2ecf20Sopenharmony_ci     *  Note: we may rely on the following equalities:
928c2ecf20Sopenharmony_ci     *
938c2ecf20Sopenharmony_ci     *      CPU_68020 == MMU_68851
948c2ecf20Sopenharmony_ci     *      CPU_68030 == MMU_68030
958c2ecf20Sopenharmony_ci     *      CPU_68040 == FPU_68040 == MMU_68040
968c2ecf20Sopenharmony_ci     *      CPU_68060 == FPU_68060 == MMU_68060
978c2ecf20Sopenharmony_ci     */
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci#define CPUB_68020		0
1008c2ecf20Sopenharmony_ci#define CPUB_68030		1
1018c2ecf20Sopenharmony_ci#define CPUB_68040		2
1028c2ecf20Sopenharmony_ci#define CPUB_68060		3
1038c2ecf20Sopenharmony_ci#define CPUB_COLDFIRE		4
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci#define CPU_68020		(1 << CPUB_68020)
1068c2ecf20Sopenharmony_ci#define CPU_68030		(1 << CPUB_68030)
1078c2ecf20Sopenharmony_ci#define CPU_68040		(1 << CPUB_68040)
1088c2ecf20Sopenharmony_ci#define CPU_68060		(1 << CPUB_68060)
1098c2ecf20Sopenharmony_ci#define CPU_COLDFIRE		(1 << CPUB_COLDFIRE)
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci#define FPUB_68881		0
1128c2ecf20Sopenharmony_ci#define FPUB_68882		1
1138c2ecf20Sopenharmony_ci#define FPUB_68040		2	/* Internal FPU */
1148c2ecf20Sopenharmony_ci#define FPUB_68060		3	/* Internal FPU */
1158c2ecf20Sopenharmony_ci#define FPUB_SUNFPA		4	/* Sun-3 FPA */
1168c2ecf20Sopenharmony_ci#define FPUB_COLDFIRE		5	/* ColdFire FPU */
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define FPU_68881		(1 << FPUB_68881)
1198c2ecf20Sopenharmony_ci#define FPU_68882		(1 << FPUB_68882)
1208c2ecf20Sopenharmony_ci#define FPU_68040		(1 << FPUB_68040)
1218c2ecf20Sopenharmony_ci#define FPU_68060		(1 << FPUB_68060)
1228c2ecf20Sopenharmony_ci#define FPU_SUNFPA		(1 << FPUB_SUNFPA)
1238c2ecf20Sopenharmony_ci#define FPU_COLDFIRE		(1 << FPUB_COLDFIRE)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define MMUB_68851		0
1268c2ecf20Sopenharmony_ci#define MMUB_68030		1	/* Internal MMU */
1278c2ecf20Sopenharmony_ci#define MMUB_68040		2	/* Internal MMU */
1288c2ecf20Sopenharmony_ci#define MMUB_68060		3	/* Internal MMU */
1298c2ecf20Sopenharmony_ci#define MMUB_APOLLO		4	/* Custom Apollo */
1308c2ecf20Sopenharmony_ci#define MMUB_SUN3		5	/* Custom Sun-3 */
1318c2ecf20Sopenharmony_ci#define MMUB_COLDFIRE		6	/* Internal MMU */
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#define MMU_68851		(1 << MMUB_68851)
1348c2ecf20Sopenharmony_ci#define MMU_68030		(1 << MMUB_68030)
1358c2ecf20Sopenharmony_ci#define MMU_68040		(1 << MMUB_68040)
1368c2ecf20Sopenharmony_ci#define MMU_68060		(1 << MMUB_68060)
1378c2ecf20Sopenharmony_ci#define MMU_SUN3		(1 << MMUB_SUN3)
1388c2ecf20Sopenharmony_ci#define MMU_APOLLO		(1 << MMUB_APOLLO)
1398c2ecf20Sopenharmony_ci#define MMU_COLDFIRE		(1 << MMUB_COLDFIRE)
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci    /*
1438c2ecf20Sopenharmony_ci     * Stuff for bootinfo interface versioning
1448c2ecf20Sopenharmony_ci     *
1458c2ecf20Sopenharmony_ci     * At the start of kernel code, a 'struct bootversion' is located.
1468c2ecf20Sopenharmony_ci     * bootstrap checks for a matching version of the interface before booting
1478c2ecf20Sopenharmony_ci     * a kernel, to avoid user confusion if kernel and bootstrap don't work
1488c2ecf20Sopenharmony_ci     * together :-)
1498c2ecf20Sopenharmony_ci     *
1508c2ecf20Sopenharmony_ci     * If incompatible changes are made to the bootinfo interface, the major
1518c2ecf20Sopenharmony_ci     * number below should be stepped (and the minor reset to 0) for the
1528c2ecf20Sopenharmony_ci     * appropriate machine. If a change is backward-compatible, the minor
1538c2ecf20Sopenharmony_ci     * should be stepped. "Backwards-compatible" means that booting will work,
1548c2ecf20Sopenharmony_ci     * but certain features may not.
1558c2ecf20Sopenharmony_ci     */
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci#define BOOTINFOV_MAGIC			0x4249561A	/* 'BIV^Z' */
1588c2ecf20Sopenharmony_ci#define MK_BI_VERSION(major, minor)	(((major) << 16) + (minor))
1598c2ecf20Sopenharmony_ci#define BI_VERSION_MAJOR(v)		(((v) >> 16) & 0xffff)
1608c2ecf20Sopenharmony_ci#define BI_VERSION_MINOR(v)		((v) & 0xffff)
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_cistruct bootversion {
1658c2ecf20Sopenharmony_ci	__be16 branch;
1668c2ecf20Sopenharmony_ci	__be32 magic;
1678c2ecf20Sopenharmony_ci	struct {
1688c2ecf20Sopenharmony_ci		__be32 machtype;
1698c2ecf20Sopenharmony_ci		__be32 version;
1708c2ecf20Sopenharmony_ci	} machversions[0];
1718c2ecf20Sopenharmony_ci} __packed;
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_M68K_BOOTINFO_H */
177