xref: /openbmc/u-boot/disk/part_iso.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2012771d8Swdenk /*
3012771d8Swdenk  * (C) Copyright 2001
4012771d8Swdenk  * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch.
5012771d8Swdenk  */
6012771d8Swdenk #ifndef _PART_CD_H
7012771d8Swdenk #define _PART_CD_H
8012771d8Swdenk 
9012771d8Swdenk #define BRVD	0x11
10012771d8Swdenk #define PVD_OFFSET 0x10
11012771d8Swdenk 
12012771d8Swdenk 
13012771d8Swdenk typedef struct iso_boot_rec {
14012771d8Swdenk 	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
15012771d8Swdenk 	unsigned char stand_ident[5]; /* "CD001" */
16012771d8Swdenk 	unsigned char vers;					/* Version */
17012771d8Swdenk 	char					ident_str[0x20]; /* Ident String "EL TORITO SPECIFICATION" */
18012771d8Swdenk 	unsigned char unused[0x20];		/* unused */
19012771d8Swdenk 	unsigned char pointer[4];		/* absolute pointer to Boot Catalog */
20012771d8Swdenk } iso_boot_rec_t;
21012771d8Swdenk 
22012771d8Swdenk 
23012771d8Swdenk typedef struct iso_pri_rec {
24012771d8Swdenk 	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
25012771d8Swdenk 	unsigned char stand_ident[5]; /* "CD001" */
26012771d8Swdenk 	unsigned char vers;					/* Version */
27012771d8Swdenk 	unsigned char unused;
28012771d8Swdenk 	char					sysid[32];		/* system Identifier */
29012771d8Swdenk 	char					volid[32];		/* volume Identifier */
30012771d8Swdenk 	unsigned char zeros1[8];		/* unused */
31ef9e6de5SAlexander Graf 	unsigned int volsiz_LE;		/* volume size Little Endian */
32ef9e6de5SAlexander Graf 	unsigned int volsiz_BE;		/* volume size Big Endian */
33012771d8Swdenk 	unsigned char zeros2[32];		/* unused */
34012771d8Swdenk 	unsigned short setsize_LE;	/* volume set size LE */
35012771d8Swdenk 	unsigned short setsize_BE;	/* volume set size BE */
36012771d8Swdenk 	unsigned short seqnum_LE;		/* volume sequence number LE */
37012771d8Swdenk 	unsigned short seqnum_BE;		/* volume sequence number BE */
38012771d8Swdenk 	unsigned short secsize_LE;	/* sector size LE */
39012771d8Swdenk 	unsigned short secsize_BE;	/* sector size BE */
40ef9e6de5SAlexander Graf 	unsigned int pathtablen_LE;/* Path Table size LE */
41ef9e6de5SAlexander Graf 	unsigned int pathtablen_BE;/* Path Table size BE */
42ef9e6de5SAlexander Graf 	unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
43ef9e6de5SAlexander Graf 	unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
44ef9e6de5SAlexander Graf 	unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
45ef9e6de5SAlexander Graf 	unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
46012771d8Swdenk 	unsigned char rootdir[34];	/* directory record for root dir */
47012771d8Swdenk 	char					volsetid[128];/* Volume set identifier */
48012771d8Swdenk 	char					pubid[128];		/* Publisher identifier */
49012771d8Swdenk 	char					dataprepid[128]; /* data preparer identifier */
50012771d8Swdenk 	char					appid[128];		/* application identifier */
51012771d8Swdenk 	char					copyr[37];		/* copyright string */
52012771d8Swdenk 	char					abstractfileid[37]; /* abstract file identifier */
53012771d8Swdenk 	char					bibliofileid[37]; /* bibliographic file identifier */
54012771d8Swdenk 	unsigned char creationdate[17]; /* creation date */
55012771d8Swdenk 	unsigned char modify[17];		/* modification date */
56012771d8Swdenk 	unsigned char expire[17];		/* expiring date */
57012771d8Swdenk 	unsigned char effective[17];/* effective date */
58012771d8Swdenk 	unsigned char filestruc_ver;	/* file structur version */
59012771d8Swdenk } iso_pri_rec_t;
60012771d8Swdenk 
61012771d8Swdenk typedef struct iso_sup_rec {
62012771d8Swdenk 	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
63012771d8Swdenk 	unsigned char stand_ident[5]; /* "CD001" */
64012771d8Swdenk 	unsigned char vers;					/* Version */
65012771d8Swdenk 	unsigned char volumeflags;	/* if bit 0 = 0 => all escape sequences are according ISO 2375 */
66012771d8Swdenk 	char					sysid[32];		/* system Identifier */
67012771d8Swdenk 	char					volid[32];		/* volume Identifier */
68012771d8Swdenk 	unsigned char zeros1[8];		/* unused */
69ef9e6de5SAlexander Graf 	unsigned int volsiz_LE;		/* volume size Little Endian */
70ef9e6de5SAlexander Graf 	unsigned int volsiz_BE;		/* volume size Big Endian */
71012771d8Swdenk 	unsigned char escapeseq[32];/* Escape sequences */
72012771d8Swdenk 	unsigned short setsize_LE;	/* volume set size LE */
73012771d8Swdenk 	unsigned short setsize_BE;	/* volume set size BE */
74012771d8Swdenk 	unsigned short seqnum_LE;		/* volume sequence number LE */
75012771d8Swdenk 	unsigned short seqnum_BE;		/* volume sequence number BE */
76012771d8Swdenk 	unsigned short secsize_LE;	/* sector size LE */
77012771d8Swdenk 	unsigned short secsize_BE;	/* sector size BE */
78ef9e6de5SAlexander Graf 	unsigned int pathtablen_LE;/* Path Table size LE */
79ef9e6de5SAlexander Graf 	unsigned int pathtablen_BE;/* Path Table size BE */
80ef9e6de5SAlexander Graf 	unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
81ef9e6de5SAlexander Graf 	unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
82ef9e6de5SAlexander Graf 	unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
83ef9e6de5SAlexander Graf 	unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
84012771d8Swdenk 	unsigned char rootdir[34];	/* directory record for root dir */
85012771d8Swdenk 	char					volsetid[128];/* Volume set identifier */
86012771d8Swdenk 	char					pubid[128];		/* Publisher identifier */
87012771d8Swdenk 	char					dataprepid[128]; /* data preparer identifier */
88012771d8Swdenk 	char					appid[128];		/* application identifier */
89012771d8Swdenk 	char					copyr[37];		/* copyright string */
90012771d8Swdenk 	char					abstractfileid[37]; /* abstract file identifier */
91012771d8Swdenk 	char					bibliofileid[37]; /* bibliographic file identifier */
92012771d8Swdenk 	unsigned char creationdate[17]; /* creation date */
93012771d8Swdenk 	unsigned char modify[17];		/* modification date */
94012771d8Swdenk 	unsigned char expire[17];		/* expiring date */
95012771d8Swdenk 	unsigned char effective[17];/* effective date */
96012771d8Swdenk 	unsigned char filestruc_ver;	/* file structur version */
97012771d8Swdenk }iso_sup_rec_t;
98012771d8Swdenk 
99012771d8Swdenk typedef struct iso_part_rec {
100012771d8Swdenk 	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
101012771d8Swdenk 	unsigned char stand_ident[5]; /* "CD001" */
102012771d8Swdenk 	unsigned char vers;					/* Version */
103012771d8Swdenk 	unsigned char unused;
104012771d8Swdenk 	char					sysid[32];		 /* system Identifier */
105012771d8Swdenk 	char					volid[32];		/* volume partition Identifier */
106ef9e6de5SAlexander Graf 	unsigned int partloc_LE;		/* volume partition location LE */
107ef9e6de5SAlexander Graf 	unsigned int partloc_BE;		/* volume partition location BE */
108ef9e6de5SAlexander Graf 	unsigned int partsiz_LE;		/* volume partition size LE */
109ef9e6de5SAlexander Graf 	unsigned int partsiz_BE;		/* volume partition size BE */
110012771d8Swdenk }iso_part_rec_t;
111012771d8Swdenk 
112012771d8Swdenk 
113012771d8Swdenk typedef struct iso_val_entry {
114012771d8Swdenk 	unsigned char	header_id;		/* Header ID must be 0x01 */
115012771d8Swdenk 	unsigned char	platform;			/* Platform: 0=x86, 1=PowerPC, 2=MAC */
116012771d8Swdenk 	unsigned char res[2];				/* reserved */
117012771d8Swdenk 	char					manu_str[0x18]; /* Ident String of manufacturer/developer */
118012771d8Swdenk 	unsigned char chk_sum[2];	/* Check sum (all words must be zero)  */
119012771d8Swdenk 	unsigned char key[2];				/* key[0]=55, key[1]=0xAA */
120012771d8Swdenk } iso_val_entry_t;
121012771d8Swdenk 
122012771d8Swdenk typedef struct iso_header_entry {
123012771d8Swdenk 	unsigned char	header_id;		/* Header ID must be 0x90 or 0x91 */
124012771d8Swdenk 	unsigned char	platform;			/* Platform: 0=x86, 1=PowerPC, 2=MAC */
125012771d8Swdenk 	unsigned char numentry[2];	/* number of entries */
126012771d8Swdenk 	char					id_str[0x1C]; /* Ident String of sectionr */
127012771d8Swdenk } iso_header_entry_t;
128012771d8Swdenk 
129012771d8Swdenk 
130012771d8Swdenk typedef struct iso_init_def_entry {
131012771d8Swdenk 	unsigned char	boot_ind;			/* Boot indicator 0x88=bootable 0=not bootable */
132012771d8Swdenk 	unsigned char	boot_media;		/* boot Media Type: 0=no Emulation, 1=1.2MB floppy, 2=1.44MB floppy, 3=2.88MB floppy 4=hd (0x80) */
133012771d8Swdenk 	unsigned char ld_seg[2];		/* Load segment (flat model=addr/10) */
134012771d8Swdenk 	unsigned char systype;			/* System Type copy of byte5 of part table */
135012771d8Swdenk 	unsigned char res;					/* reserved */
136012771d8Swdenk 	unsigned char sec_cnt[2];		/* sector count in VIRTUAL Blocks (0x200) */
137012771d8Swdenk 	unsigned char rel_block_addr[4];	/* relative Block address */
138012771d8Swdenk } iso_init_def_entry_t;
139012771d8Swdenk 
140012771d8Swdenk 
141012771d8Swdenk void print_partition_cd(int dev);
142012771d8Swdenk 
143012771d8Swdenk #endif /* _PART_CD_H */
144