xref: /openbmc/u-boot/disk/part_mac.h (revision 6e87ae1c)
1 /*
2  * (C) Copyright 2000
3  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 /*
9  * See also Linux sources, fs/partitions/mac.h
10  *
11  * This file describes structures and values related to the standard
12  * Apple SCSI disk partitioning scheme. For more information see:
13  * http://developer.apple.com/techpubs/mac/Devices/Devices-126.html#MARKER-14-92
14  */
15 
16 #ifndef	_DISK_PART_MAC_H
17 #define	_DISK_PART_MAC_H
18 
19 #define MAC_DRIVER_MAGIC	0x4552
20 
21 /*
22  * Driver Descriptor Structure, in block 0.
23  * This block is (and shall remain) 512 bytes long.
24  * Note that there is an alignment problem for the driver descriptor map!
25  */
26 typedef struct mac_driver_desc {
27 	__u16	signature;	/* expected to be MAC_DRIVER_MAGIC	*/
28 	__u16	blk_size;	/* block size of device			*/
29 	__u32	blk_count;	/* number of blocks on device		*/
30 	__u16	dev_type;	/* device type				*/
31 	__u16	dev_id;		/* device id				*/
32 	__u32	data;		/* reserved				*/
33 	__u16	drvr_cnt;	/* number of driver descriptor entries	*/
34 	__u16	drvr_map[247];	/* driver descriptor map		*/
35 } mac_driver_desc_t;
36 
37 /*
38  * Device Driver Entry
39  * (Cannot be included in mac_driver_desc because of alignment problems)
40  */
41 typedef struct mac_driver_entry {
42 	__u32	block;		/* block number of starting block	*/
43 	__u16	size;		/* size of driver, in 512 byte blocks	*/
44 	__u16	type;		/* OS Type				*/
45 } mac_driver_entry_t;
46 
47 
48 #define MAC_PARTITION_MAGIC	0x504d
49 
50 /* type field value for A/UX or other Unix partitions */
51 #define APPLE_AUX_TYPE	"Apple_UNIX_SVR2"
52 
53 /*
54  * Each Partition Map entry (in blocks 1 ... N) has this format:
55  */
56 typedef struct mac_partition {
57 	__u16	signature;	/* expected to be MAC_PARTITION_MAGIC	*/
58 	__u16	sig_pad;	/* reserved				*/
59 	__u32	map_count;	/* # blocks in partition map		*/
60 	__u32	start_block;	/* abs. starting block # of partition	*/
61 	__u32	block_count;	/* number of blocks in partition	*/
62 	uchar	name[32];	/* partition name			*/
63 	uchar	type[32];	/* string type description		*/
64 	__u32	data_start;	/* rel block # of first data block	*/
65 	__u32	data_count;	/* number of data blocks		*/
66 	__u32	status;		/* partition status bits		*/
67 	__u32	boot_start;	/* first block of boot code		*/
68 	__u32	boot_size;	/* size of boot code, in bytes		*/
69 	__u32	boot_load;	/* boot code load address		*/
70 	__u32	boot_load2;	/* reserved				*/
71 	__u32	boot_entry;	/* boot code entry point		*/
72 	__u32	boot_entry2;	/* reserved				*/
73 	__u32	boot_cksum;	/* boot code checksum			*/
74 	uchar	processor[16];	/* Type of Processor			*/
75 	__u16	part_pad[188];	/* reserved				*/
76 #if CONFIG_IS_ENABLED(ISO_PARTITION)
77 	uchar   iso_dummy[2048];/* Reservere enough room for an ISO partition block to fit */
78 #endif
79 } mac_partition_t;
80 
81 #define MAC_STATUS_BOOTABLE	8	/* partition is bootable */
82 
83 #endif	/* _DISK_PART_MAC_H */
84