wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2000 |
| 3 | * Hans-Joerg Frieden, Hyperion Entertainment |
| 4 | * Hans-JoergF@hyperion-entertainment.com |
| 5 | * |
Wolfgang Denk | bd8ec7e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef _DISK_PART_AMIGA_H |
| 10 | #define _DISK_PART_AMIGA_H |
| 11 | #include <common.h> |
| 12 | |
Patrick Delaunay | 21d3bce | 2017-01-27 11:00:38 +0100 | [diff] [blame] | 13 | #if CONFIG_IS_ENABLED(ISO_PARTITION) |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 30 | struct rigid_disk_block |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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]; |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 44 | |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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; |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 66 | |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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]; |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 73 | |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 74 | u32 reserved_5[10]; |
| 75 | }; |
| 76 | |
| 77 | /* |
| 78 | * Each partition on this drive is defined by such a block |
| 79 | */ |
| 80 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 81 | struct partition_block |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 97 | struct bootcode_block |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 112 | /* |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 113 | * The environment array in the partition block |
| 114 | * describes the partition |
| 115 | */ |
| 116 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 117 | struct amiga_part_geometry |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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_ */ |