1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * (C) Copyright 2000 4 * Hans-Joerg Frieden, Hyperion Entertainment 5 * Hans-JoergF@hyperion-entertainment.com 6 */ 7 8 #ifndef _DISK_PART_AMIGA_H 9 #define _DISK_PART_AMIGA_H 10 11 #if CONFIG_IS_ENABLED(ISO_PARTITION) 12 /* 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 #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 27 struct rigid_disk_block 28 { 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]; 41 42 /* 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; 63 64 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]; 70 71 u32 reserved_5[10]; 72 }; 73 74 /* 75 * Each partition on this drive is defined by such a block 76 */ 77 78 struct partition_block 79 { 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 94 struct bootcode_block 95 { 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 104 #define AMIGA_ID_RDISK 0x5244534B 105 #define AMIGA_ID_PART 0x50415254 106 #define AMIGA_ID_BOOT 0x424f4f54 107 108 /* 109 * The environment array in the partition block 110 * describes the partition 111 */ 112 113 struct amiga_part_geometry 114 { 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_ */ 138