blob: 42f5eb0f941c87f4fa8503a219c3c1314306d634 [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
10#include <common.h>
11
Patrick Delaunay21d3bce2017-01-27 11:00:38 +010012#if CONFIG_IS_ENABLED(ISO_PARTITION)
wdenk452cfd62002-11-19 11:04:11 +000013/* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS
14 have 2048 byte blocks */
15#define DEFAULT_SECTOR_SIZE 2048
16#else
17#define DEFAULT_SECTOR_SIZE 512
18#endif
19
20
21#define AMIGA_BLOCK_LIMIT 16
22
23/*
24 * Amiga disks have a very open structure. The head for the partition table information
25 * is stored somewhere within the first 16 blocks on disk, and is called the
26 * "RigidDiskBlock".
27 */
28
wdenk57b2d802003-06-27 21:31:46 +000029struct rigid_disk_block
wdenk452cfd62002-11-19 11:04:11 +000030{
31 u32 id;
32 u32 summed_longs;
33 s32 chk_sum;
34 u32 host_id;
35 u32 block_bytes;
36 u32 flags;
37 u32 bad_block_list;
38 u32 partition_list;
39 u32 file_sys_header_list;
40 u32 drive_init;
41 u32 bootcode_block;
42 u32 reserved_1[5];
wdenk57b2d802003-06-27 21:31:46 +000043
wdenk452cfd62002-11-19 11:04:11 +000044 /* Physical drive geometry */
45 u32 cylinders;
46 u32 sectors;
47 u32 heads;
48 u32 interleave;
49 u32 park;
50 u32 reserved_2[3];
51 u32 write_pre_comp;
52 u32 reduced_write;
53 u32 step_rate;
54 u32 reserved_3[5];
55
56 /* logical drive geometry */
57 u32 rdb_blocks_lo;
58 u32 rdb_blocks_hi;
59 u32 lo_cylinder;
60 u32 hi_cylinder;
61 u32 cyl_blocks;
62 u32 auto_park_seconds;
63 u32 high_rdsk_block;
64 u32 reserved_4;
wdenk57b2d802003-06-27 21:31:46 +000065
wdenk452cfd62002-11-19 11:04:11 +000066 char disk_vendor[8];
67 char disk_product[16];
68 char disk_revision[4];
69 char controller_vendor[8];
70 char controller_product[16];
71 char controller_revision[4];
wdenk57b2d802003-06-27 21:31:46 +000072
wdenk452cfd62002-11-19 11:04:11 +000073 u32 reserved_5[10];
74};
75
76/*
77 * Each partition on this drive is defined by such a block
78 */
79
wdenk57b2d802003-06-27 21:31:46 +000080struct partition_block
wdenk452cfd62002-11-19 11:04:11 +000081{
82 u32 id;
83 u32 summed_longs;
84 s32 chk_sum;
85 u32 host_id;
86 u32 next;
87 u32 flags;
88 u32 reserved_1[2];
89 u32 dev_flags;
90 char drive_name[32];
91 u32 reserved_2[15];
92 u32 environment[17];
93 u32 reserved_3[15];
94};
95
wdenk57b2d802003-06-27 21:31:46 +000096struct bootcode_block
wdenk452cfd62002-11-19 11:04:11 +000097{
98 u32 id;
99 u32 summed_longs;
100 s32 chk_sum;
101 u32 host_id;
102 u32 next;
103 u32 load_data[123];
104};
105
106
107#define AMIGA_ID_RDISK 0x5244534B
108#define AMIGA_ID_PART 0x50415254
109#define AMIGA_ID_BOOT 0x424f4f54
110
wdenk57b2d802003-06-27 21:31:46 +0000111/*
wdenk452cfd62002-11-19 11:04:11 +0000112 * The environment array in the partition block
113 * describes the partition
114 */
115
wdenk57b2d802003-06-27 21:31:46 +0000116struct amiga_part_geometry
wdenk452cfd62002-11-19 11:04:11 +0000117{
118 u32 table_size;
119 u32 size_blocks;
120 u32 unused1;
121 u32 surfaces;
122 u32 sector_per_block;
123 u32 block_per_track;
124 u32 reserved;
125 u32 prealloc;
126 u32 interleave;
127 u32 low_cyl;
128 u32 high_cyl;
129 u32 num_buffers;
130 u32 buf_mem_type;
131 u32 max_transfer;
132 u32 mask;
133 s32 boot_priority;
134 u32 dos_type;
135 u32 baud;
136 u32 control;
137 u32 boot_blocks;
138};
139
140#endif /* _DISK_PART_AMIGA_H_ */