blob: dfa70bdb8a8c2b362e5089f8eb5b4e82a5819051 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
wdenk452cfd62002-11-19 11:04:11 +00002/*
3 * (C) Copyright 2000
4 * Hans-Joerg Frieden, Hyperion Entertainment
5 * Hans-JoergF@hyperion-entertainment.com
wdenk452cfd62002-11-19 11:04:11 +00006 */
7
8#ifndef _DISK_PART_AMIGA_H
9#define _DISK_PART_AMIGA_H
wdenk452cfd62002-11-19 11:04:11 +000010
Patrick Delaunay21d3bce2017-01-27 11:00:38 +010011#if CONFIG_IS_ENABLED(ISO_PARTITION)
wdenk452cfd62002-11-19 11:04:11 +000012/* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS
13 have 2048 byte blocks */
14#define DEFAULT_SECTOR_SIZE 2048
15#else
16#define DEFAULT_SECTOR_SIZE 512
17#endif
18
19
20#define AMIGA_BLOCK_LIMIT 16
21
22/*
23 * Amiga disks have a very open structure. The head for the partition table information
24 * is stored somewhere within the first 16 blocks on disk, and is called the
25 * "RigidDiskBlock".
26 */
27
wdenk57b2d802003-06-27 21:31:46 +000028struct rigid_disk_block
wdenk452cfd62002-11-19 11:04:11 +000029{
30 u32 id;
31 u32 summed_longs;
32 s32 chk_sum;
33 u32 host_id;
34 u32 block_bytes;
35 u32 flags;
36 u32 bad_block_list;
37 u32 partition_list;
38 u32 file_sys_header_list;
39 u32 drive_init;
40 u32 bootcode_block;
41 u32 reserved_1[5];
wdenk57b2d802003-06-27 21:31:46 +000042
wdenk452cfd62002-11-19 11:04:11 +000043 /* Physical drive geometry */
44 u32 cylinders;
45 u32 sectors;
46 u32 heads;
47 u32 interleave;
48 u32 park;
49 u32 reserved_2[3];
50 u32 write_pre_comp;
51 u32 reduced_write;
52 u32 step_rate;
53 u32 reserved_3[5];
54
55 /* logical drive geometry */
56 u32 rdb_blocks_lo;
57 u32 rdb_blocks_hi;
58 u32 lo_cylinder;
59 u32 hi_cylinder;
60 u32 cyl_blocks;
61 u32 auto_park_seconds;
62 u32 high_rdsk_block;
63 u32 reserved_4;
wdenk57b2d802003-06-27 21:31:46 +000064
wdenk452cfd62002-11-19 11:04:11 +000065 char disk_vendor[8];
66 char disk_product[16];
67 char disk_revision[4];
68 char controller_vendor[8];
69 char controller_product[16];
70 char controller_revision[4];
wdenk57b2d802003-06-27 21:31:46 +000071
wdenk452cfd62002-11-19 11:04:11 +000072 u32 reserved_5[10];
73};
74
75/*
76 * Each partition on this drive is defined by such a block
77 */
78
wdenk57b2d802003-06-27 21:31:46 +000079struct partition_block
wdenk452cfd62002-11-19 11:04:11 +000080{
81 u32 id;
82 u32 summed_longs;
83 s32 chk_sum;
84 u32 host_id;
85 u32 next;
86 u32 flags;
87 u32 reserved_1[2];
88 u32 dev_flags;
89 char drive_name[32];
90 u32 reserved_2[15];
91 u32 environment[17];
92 u32 reserved_3[15];
93};
94
wdenk57b2d802003-06-27 21:31:46 +000095struct bootcode_block
wdenk452cfd62002-11-19 11:04:11 +000096{
97 u32 id;
98 u32 summed_longs;
99 s32 chk_sum;
100 u32 host_id;
101 u32 next;
102 u32 load_data[123];
103};
104
105
106#define AMIGA_ID_RDISK 0x5244534B
107#define AMIGA_ID_PART 0x50415254
108#define AMIGA_ID_BOOT 0x424f4f54
109
wdenk57b2d802003-06-27 21:31:46 +0000110/*
wdenk452cfd62002-11-19 11:04:11 +0000111 * The environment array in the partition block
112 * describes the partition
113 */
114
wdenk57b2d802003-06-27 21:31:46 +0000115struct amiga_part_geometry
wdenk452cfd62002-11-19 11:04:11 +0000116{
117 u32 table_size;
118 u32 size_blocks;
119 u32 unused1;
120 u32 surfaces;
121 u32 sector_per_block;
122 u32 block_per_track;
123 u32 reserved;
124 u32 prealloc;
125 u32 interleave;
126 u32 low_cyl;
127 u32 high_cyl;
128 u32 num_buffers;
129 u32 buf_mem_type;
130 u32 max_transfer;
131 u32 mask;
132 s32 boot_priority;
133 u32 dos_type;
134 u32 baud;
135 u32 control;
136 u32 boot_blocks;
137};
138
139#endif /* _DISK_PART_AMIGA_H_ */