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 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | #ifndef _DISK_PART_AMIGA_H |
| 26 | #define _DISK_PART_AMIGA_H |
| 27 | #include <common.h> |
| 28 | |
| 29 | #ifdef CONFIG_ISO_PARTITION |
| 30 | /* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS |
| 31 | have 2048 byte blocks */ |
| 32 | #define DEFAULT_SECTOR_SIZE 2048 |
| 33 | #else |
| 34 | #define DEFAULT_SECTOR_SIZE 512 |
| 35 | #endif |
| 36 | |
| 37 | |
| 38 | #define AMIGA_BLOCK_LIMIT 16 |
| 39 | |
| 40 | /* |
| 41 | * Amiga disks have a very open structure. The head for the partition table information |
| 42 | * is stored somewhere within the first 16 blocks on disk, and is called the |
| 43 | * "RigidDiskBlock". |
| 44 | */ |
| 45 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 46 | struct rigid_disk_block |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 47 | { |
| 48 | u32 id; |
| 49 | u32 summed_longs; |
| 50 | s32 chk_sum; |
| 51 | u32 host_id; |
| 52 | u32 block_bytes; |
| 53 | u32 flags; |
| 54 | u32 bad_block_list; |
| 55 | u32 partition_list; |
| 56 | u32 file_sys_header_list; |
| 57 | u32 drive_init; |
| 58 | u32 bootcode_block; |
| 59 | u32 reserved_1[5]; |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 60 | |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 61 | /* Physical drive geometry */ |
| 62 | u32 cylinders; |
| 63 | u32 sectors; |
| 64 | u32 heads; |
| 65 | u32 interleave; |
| 66 | u32 park; |
| 67 | u32 reserved_2[3]; |
| 68 | u32 write_pre_comp; |
| 69 | u32 reduced_write; |
| 70 | u32 step_rate; |
| 71 | u32 reserved_3[5]; |
| 72 | |
| 73 | /* logical drive geometry */ |
| 74 | u32 rdb_blocks_lo; |
| 75 | u32 rdb_blocks_hi; |
| 76 | u32 lo_cylinder; |
| 77 | u32 hi_cylinder; |
| 78 | u32 cyl_blocks; |
| 79 | u32 auto_park_seconds; |
| 80 | u32 high_rdsk_block; |
| 81 | u32 reserved_4; |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 82 | |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 83 | char disk_vendor[8]; |
| 84 | char disk_product[16]; |
| 85 | char disk_revision[4]; |
| 86 | char controller_vendor[8]; |
| 87 | char controller_product[16]; |
| 88 | char controller_revision[4]; |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 89 | |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 90 | u32 reserved_5[10]; |
| 91 | }; |
| 92 | |
| 93 | /* |
| 94 | * Each partition on this drive is defined by such a block |
| 95 | */ |
| 96 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 97 | struct partition_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 flags; |
| 105 | u32 reserved_1[2]; |
| 106 | u32 dev_flags; |
| 107 | char drive_name[32]; |
| 108 | u32 reserved_2[15]; |
| 109 | u32 environment[17]; |
| 110 | u32 reserved_3[15]; |
| 111 | }; |
| 112 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 113 | struct bootcode_block |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 114 | { |
| 115 | u32 id; |
| 116 | u32 summed_longs; |
| 117 | s32 chk_sum; |
| 118 | u32 host_id; |
| 119 | u32 next; |
| 120 | u32 load_data[123]; |
| 121 | }; |
| 122 | |
| 123 | |
| 124 | #define AMIGA_ID_RDISK 0x5244534B |
| 125 | #define AMIGA_ID_PART 0x50415254 |
| 126 | #define AMIGA_ID_BOOT 0x424f4f54 |
| 127 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 128 | /* |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 129 | * The environment array in the partition block |
| 130 | * describes the partition |
| 131 | */ |
| 132 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 133 | struct amiga_part_geometry |
wdenk | 452cfd6 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 134 | { |
| 135 | u32 table_size; |
| 136 | u32 size_blocks; |
| 137 | u32 unused1; |
| 138 | u32 surfaces; |
| 139 | u32 sector_per_block; |
| 140 | u32 block_per_track; |
| 141 | u32 reserved; |
| 142 | u32 prealloc; |
| 143 | u32 interleave; |
| 144 | u32 low_cyl; |
| 145 | u32 high_cyl; |
| 146 | u32 num_buffers; |
| 147 | u32 buf_mem_type; |
| 148 | u32 max_transfer; |
| 149 | u32 mask; |
| 150 | s32 boot_priority; |
| 151 | u32 dos_type; |
| 152 | u32 baud; |
| 153 | u32 control; |
| 154 | u32 boot_blocks; |
| 155 | }; |
| 156 | |
| 157 | #endif /* _DISK_PART_AMIGA_H_ */ |