xref: /openbmc/u-boot/disk/part_amiga.h (revision 5957ac2a)
1 /*
2  * (C) Copyright 2000
3  * Hans-Joerg Frieden, Hyperion Entertainment
4  * Hans-JoergF@hyperion-entertainment.com
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 #ifndef _DISK_PART_AMIGA_H
10 #define _DISK_PART_AMIGA_H
11 #include <common.h>
12 
13 #ifdef CONFIG_ISO_PARTITION
14 /* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS
15    have 2048 byte blocks */
16 #define DEFAULT_SECTOR_SIZE   2048
17 #else
18 #define DEFAULT_SECTOR_SIZE	512
19 #endif
20 
21 
22 #define AMIGA_BLOCK_LIMIT 16
23 
24 /*
25  * Amiga disks have a very open structure. The head for the partition table information
26  * is stored somewhere within the first 16 blocks on disk, and is called the
27  * "RigidDiskBlock".
28  */
29 
30 struct rigid_disk_block
31 {
32     u32 id;
33     u32 summed_longs;
34     s32 chk_sum;
35     u32 host_id;
36     u32 block_bytes;
37     u32 flags;
38     u32 bad_block_list;
39     u32 partition_list;
40     u32 file_sys_header_list;
41     u32 drive_init;
42     u32 bootcode_block;
43     u32 reserved_1[5];
44 
45     /* Physical drive geometry */
46     u32 cylinders;
47     u32 sectors;
48     u32 heads;
49     u32 interleave;
50     u32 park;
51     u32 reserved_2[3];
52     u32 write_pre_comp;
53     u32 reduced_write;
54     u32 step_rate;
55     u32 reserved_3[5];
56 
57     /* logical drive geometry */
58     u32 rdb_blocks_lo;
59     u32 rdb_blocks_hi;
60     u32 lo_cylinder;
61     u32 hi_cylinder;
62     u32 cyl_blocks;
63     u32 auto_park_seconds;
64     u32 high_rdsk_block;
65     u32 reserved_4;
66 
67     char disk_vendor[8];
68     char disk_product[16];
69     char disk_revision[4];
70     char controller_vendor[8];
71     char controller_product[16];
72     char controller_revision[4];
73 
74     u32 reserved_5[10];
75 };
76 
77 /*
78  * Each partition on this drive is defined by such a block
79  */
80 
81 struct partition_block
82 {
83     u32 id;
84     u32 summed_longs;
85     s32 chk_sum;
86     u32 host_id;
87     u32 next;
88     u32 flags;
89     u32 reserved_1[2];
90     u32 dev_flags;
91     char drive_name[32];
92     u32 reserved_2[15];
93     u32 environment[17];
94     u32 reserved_3[15];
95 };
96 
97 struct bootcode_block
98 {
99     u32   id;
100     u32   summed_longs;
101     s32   chk_sum;
102     u32   host_id;
103     u32   next;
104     u32   load_data[123];
105 };
106 
107 
108 #define AMIGA_ID_RDISK                  0x5244534B
109 #define AMIGA_ID_PART                   0x50415254
110 #define AMIGA_ID_BOOT                   0x424f4f54
111 
112 /*
113  * The environment array in the partition block
114  * describes the partition
115  */
116 
117 struct amiga_part_geometry
118 {
119     u32 table_size;
120     u32 size_blocks;
121     u32 unused1;
122     u32 surfaces;
123     u32 sector_per_block;
124     u32 block_per_track;
125     u32 reserved;
126     u32 prealloc;
127     u32 interleave;
128     u32 low_cyl;
129     u32 high_cyl;
130     u32 num_buffers;
131     u32 buf_mem_type;
132     u32 max_transfer;
133     u32 mask;
134     s32 boot_priority;
135     u32 dos_type;
136     u32 baud;
137     u32 control;
138     u32 boot_blocks;
139 };
140 
141 #endif /* _DISK_PART_AMIGA_H_ */
142