blob: 3c27bfe8fde2b5f138fb0e1ac13b5607c526d33f [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
wdenk452cfd62002-11-19 11:04:11 +000019#define AMIGA_BLOCK_LIMIT 16
20
21/*
22 * Amiga disks have a very open structure. The head for the partition table information
23 * is stored somewhere within the first 16 blocks on disk, and is called the
24 * "RigidDiskBlock".
25 */
26
wdenk57b2d802003-06-27 21:31:46 +000027struct rigid_disk_block
wdenk452cfd62002-11-19 11:04:11 +000028{
29 u32 id;
30 u32 summed_longs;
31 s32 chk_sum;
32 u32 host_id;
33 u32 block_bytes;
34 u32 flags;
35 u32 bad_block_list;
36 u32 partition_list;
37 u32 file_sys_header_list;
38 u32 drive_init;
39 u32 bootcode_block;
40 u32 reserved_1[5];
wdenk57b2d802003-06-27 21:31:46 +000041
wdenk452cfd62002-11-19 11:04:11 +000042 /* Physical drive geometry */
43 u32 cylinders;
44 u32 sectors;
45 u32 heads;
46 u32 interleave;
47 u32 park;
48 u32 reserved_2[3];
49 u32 write_pre_comp;
50 u32 reduced_write;
51 u32 step_rate;
52 u32 reserved_3[5];
53
54 /* logical drive geometry */
55 u32 rdb_blocks_lo;
56 u32 rdb_blocks_hi;
57 u32 lo_cylinder;
58 u32 hi_cylinder;
59 u32 cyl_blocks;
60 u32 auto_park_seconds;
61 u32 high_rdsk_block;
62 u32 reserved_4;
wdenk57b2d802003-06-27 21:31:46 +000063
wdenk452cfd62002-11-19 11:04:11 +000064 char disk_vendor[8];
65 char disk_product[16];
66 char disk_revision[4];
67 char controller_vendor[8];
68 char controller_product[16];
69 char controller_revision[4];
wdenk57b2d802003-06-27 21:31:46 +000070
wdenk452cfd62002-11-19 11:04:11 +000071 u32 reserved_5[10];
72};
73
74/*
75 * Each partition on this drive is defined by such a block
76 */
77
wdenk57b2d802003-06-27 21:31:46 +000078struct partition_block
wdenk452cfd62002-11-19 11:04:11 +000079{
80 u32 id;
81 u32 summed_longs;
82 s32 chk_sum;
83 u32 host_id;
84 u32 next;
85 u32 flags;
86 u32 reserved_1[2];
87 u32 dev_flags;
88 char drive_name[32];
89 u32 reserved_2[15];
90 u32 environment[17];
91 u32 reserved_3[15];
92};
93
wdenk57b2d802003-06-27 21:31:46 +000094struct bootcode_block
wdenk452cfd62002-11-19 11:04:11 +000095{
96 u32 id;
97 u32 summed_longs;
98 s32 chk_sum;
99 u32 host_id;
100 u32 next;
101 u32 load_data[123];
102};
103
wdenk452cfd62002-11-19 11:04:11 +0000104#define AMIGA_ID_RDISK 0x5244534B
105#define AMIGA_ID_PART 0x50415254
106#define AMIGA_ID_BOOT 0x424f4f54
107
wdenk57b2d802003-06-27 21:31:46 +0000108/*
wdenk452cfd62002-11-19 11:04:11 +0000109 * The environment array in the partition block
110 * describes the partition
111 */
112
wdenk57b2d802003-06-27 21:31:46 +0000113struct amiga_part_geometry
wdenk452cfd62002-11-19 11:04:11 +0000114{
115 u32 table_size;
116 u32 size_blocks;
117 u32 unused1;
118 u32 surfaces;
119 u32 sector_per_block;
120 u32 block_per_track;
121 u32 reserved;
122 u32 prealloc;
123 u32 interleave;
124 u32 low_cyl;
125 u32 high_cyl;
126 u32 num_buffers;
127 u32 buf_mem_type;
128 u32 max_transfer;
129 u32 mask;
130 s32 boot_priority;
131 u32 dos_type;
132 u32 baud;
133 u32 control;
134 u32 boot_blocks;
135};
136
137#endif /* _DISK_PART_AMIGA_H_ */