1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2c7de829cSwdenk /* 3c7de829cSwdenk * (C) Copyright 2000 4c7de829cSwdenk * Hans-Joerg Frieden, Hyperion Entertainment 5c7de829cSwdenk * Hans-JoergF@hyperion-entertainment.com 6c7de829cSwdenk */ 7c7de829cSwdenk 8c7de829cSwdenk #ifndef _DISK_PART_AMIGA_H 9c7de829cSwdenk #define _DISK_PART_AMIGA_H 10c7de829cSwdenk #include <common.h> 11c7de829cSwdenk 121acc0087SPatrick Delaunay #if CONFIG_IS_ENABLED(ISO_PARTITION) 13c7de829cSwdenk /* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS 14c7de829cSwdenk have 2048 byte blocks */ 15c7de829cSwdenk #define DEFAULT_SECTOR_SIZE 2048 16c7de829cSwdenk #else 17c7de829cSwdenk #define DEFAULT_SECTOR_SIZE 512 18c7de829cSwdenk #endif 19c7de829cSwdenk 20c7de829cSwdenk 21c7de829cSwdenk #define AMIGA_BLOCK_LIMIT 16 22c7de829cSwdenk 23c7de829cSwdenk /* 24c7de829cSwdenk * Amiga disks have a very open structure. The head for the partition table information 25c7de829cSwdenk * is stored somewhere within the first 16 blocks on disk, and is called the 26c7de829cSwdenk * "RigidDiskBlock". 27c7de829cSwdenk */ 28c7de829cSwdenk 29c7de829cSwdenk struct rigid_disk_block 30c7de829cSwdenk { 31c7de829cSwdenk u32 id; 32c7de829cSwdenk u32 summed_longs; 33c7de829cSwdenk s32 chk_sum; 34c7de829cSwdenk u32 host_id; 35c7de829cSwdenk u32 block_bytes; 36c7de829cSwdenk u32 flags; 37c7de829cSwdenk u32 bad_block_list; 38c7de829cSwdenk u32 partition_list; 39c7de829cSwdenk u32 file_sys_header_list; 40c7de829cSwdenk u32 drive_init; 41c7de829cSwdenk u32 bootcode_block; 42c7de829cSwdenk u32 reserved_1[5]; 43c7de829cSwdenk 44c7de829cSwdenk /* Physical drive geometry */ 45c7de829cSwdenk u32 cylinders; 46c7de829cSwdenk u32 sectors; 47c7de829cSwdenk u32 heads; 48c7de829cSwdenk u32 interleave; 49c7de829cSwdenk u32 park; 50c7de829cSwdenk u32 reserved_2[3]; 51c7de829cSwdenk u32 write_pre_comp; 52c7de829cSwdenk u32 reduced_write; 53c7de829cSwdenk u32 step_rate; 54c7de829cSwdenk u32 reserved_3[5]; 55c7de829cSwdenk 56c7de829cSwdenk /* logical drive geometry */ 57c7de829cSwdenk u32 rdb_blocks_lo; 58c7de829cSwdenk u32 rdb_blocks_hi; 59c7de829cSwdenk u32 lo_cylinder; 60c7de829cSwdenk u32 hi_cylinder; 61c7de829cSwdenk u32 cyl_blocks; 62c7de829cSwdenk u32 auto_park_seconds; 63c7de829cSwdenk u32 high_rdsk_block; 64c7de829cSwdenk u32 reserved_4; 65c7de829cSwdenk 66c7de829cSwdenk char disk_vendor[8]; 67c7de829cSwdenk char disk_product[16]; 68c7de829cSwdenk char disk_revision[4]; 69c7de829cSwdenk char controller_vendor[8]; 70c7de829cSwdenk char controller_product[16]; 71c7de829cSwdenk char controller_revision[4]; 72c7de829cSwdenk 73c7de829cSwdenk u32 reserved_5[10]; 74c7de829cSwdenk }; 75c7de829cSwdenk 76c7de829cSwdenk /* 77c7de829cSwdenk * Each partition on this drive is defined by such a block 78c7de829cSwdenk */ 79c7de829cSwdenk 80c7de829cSwdenk struct partition_block 81c7de829cSwdenk { 82c7de829cSwdenk u32 id; 83c7de829cSwdenk u32 summed_longs; 84c7de829cSwdenk s32 chk_sum; 85c7de829cSwdenk u32 host_id; 86c7de829cSwdenk u32 next; 87c7de829cSwdenk u32 flags; 88c7de829cSwdenk u32 reserved_1[2]; 89c7de829cSwdenk u32 dev_flags; 90c7de829cSwdenk char drive_name[32]; 91c7de829cSwdenk u32 reserved_2[15]; 92c7de829cSwdenk u32 environment[17]; 93c7de829cSwdenk u32 reserved_3[15]; 94c7de829cSwdenk }; 95c7de829cSwdenk 96c7de829cSwdenk struct bootcode_block 97c7de829cSwdenk { 98c7de829cSwdenk u32 id; 99c7de829cSwdenk u32 summed_longs; 100c7de829cSwdenk s32 chk_sum; 101c7de829cSwdenk u32 host_id; 102c7de829cSwdenk u32 next; 103c7de829cSwdenk u32 load_data[123]; 104c7de829cSwdenk }; 105c7de829cSwdenk 106c7de829cSwdenk 107c7de829cSwdenk #define AMIGA_ID_RDISK 0x5244534B 108c7de829cSwdenk #define AMIGA_ID_PART 0x50415254 109c7de829cSwdenk #define AMIGA_ID_BOOT 0x424f4f54 110c7de829cSwdenk 111c7de829cSwdenk /* 112c7de829cSwdenk * The environment array in the partition block 113c7de829cSwdenk * describes the partition 114c7de829cSwdenk */ 115c7de829cSwdenk 116c7de829cSwdenk struct amiga_part_geometry 117c7de829cSwdenk { 118c7de829cSwdenk u32 table_size; 119c7de829cSwdenk u32 size_blocks; 120c7de829cSwdenk u32 unused1; 121c7de829cSwdenk u32 surfaces; 122c7de829cSwdenk u32 sector_per_block; 123c7de829cSwdenk u32 block_per_track; 124c7de829cSwdenk u32 reserved; 125c7de829cSwdenk u32 prealloc; 126c7de829cSwdenk u32 interleave; 127c7de829cSwdenk u32 low_cyl; 128c7de829cSwdenk u32 high_cyl; 129c7de829cSwdenk u32 num_buffers; 130c7de829cSwdenk u32 buf_mem_type; 131c7de829cSwdenk u32 max_transfer; 132c7de829cSwdenk u32 mask; 133c7de829cSwdenk s32 boot_priority; 134c7de829cSwdenk u32 dos_type; 135c7de829cSwdenk u32 baud; 136c7de829cSwdenk u32 control; 137c7de829cSwdenk u32 boot_blocks; 138c7de829cSwdenk }; 139c7de829cSwdenk 140c7de829cSwdenk #endif /* _DISK_PART_AMIGA_H_ */ 141