part_amiga.h 2.7 KB
Newer Older
1 2 3 4 5
/*
 * (C) Copyright 2000
 * Hans-Joerg Frieden, Hyperion Entertainment
 * Hans-JoergF@hyperion-entertainment.com
 *
6
 * SPDX-License-Identifier:	GPL-2.0+
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 */

#ifndef _DISK_PART_AMIGA_H
#define _DISK_PART_AMIGA_H
#include <common.h>

#ifdef CONFIG_ISO_PARTITION
/* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS
   have 2048 byte blocks */
#define DEFAULT_SECTOR_SIZE   2048
#else
#define DEFAULT_SECTOR_SIZE	512
#endif


#define AMIGA_BLOCK_LIMIT 16

/*
 * Amiga disks have a very open structure. The head for the partition table information
 * is stored somewhere within the first 16 blocks on disk, and is called the
 * "RigidDiskBlock".
 */

wdenk's avatar
wdenk committed
30
struct rigid_disk_block
31 32 33 34 35 36 37 38 39 40 41 42 43
{
    u32 id;
    u32 summed_longs;
    s32 chk_sum;
    u32 host_id;
    u32 block_bytes;
    u32 flags;
    u32 bad_block_list;
    u32 partition_list;
    u32 file_sys_header_list;
    u32 drive_init;
    u32 bootcode_block;
    u32 reserved_1[5];
wdenk's avatar
wdenk committed
44

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
    /* Physical drive geometry */
    u32 cylinders;
    u32 sectors;
    u32 heads;
    u32 interleave;
    u32 park;
    u32 reserved_2[3];
    u32 write_pre_comp;
    u32 reduced_write;
    u32 step_rate;
    u32 reserved_3[5];

    /* logical drive geometry */
    u32 rdb_blocks_lo;
    u32 rdb_blocks_hi;
    u32 lo_cylinder;
    u32 hi_cylinder;
    u32 cyl_blocks;
    u32 auto_park_seconds;
    u32 high_rdsk_block;
    u32 reserved_4;
wdenk's avatar
wdenk committed
66

67 68 69 70 71 72
    char disk_vendor[8];
    char disk_product[16];
    char disk_revision[4];
    char controller_vendor[8];
    char controller_product[16];
    char controller_revision[4];
wdenk's avatar
wdenk committed
73

74 75 76 77 78 79 80
    u32 reserved_5[10];
};

/*
 * Each partition on this drive is defined by such a block
 */

wdenk's avatar
wdenk committed
81
struct partition_block
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
{
    u32 id;
    u32 summed_longs;
    s32 chk_sum;
    u32 host_id;
    u32 next;
    u32 flags;
    u32 reserved_1[2];
    u32 dev_flags;
    char drive_name[32];
    u32 reserved_2[15];
    u32 environment[17];
    u32 reserved_3[15];
};

wdenk's avatar
wdenk committed
97
struct bootcode_block
98 99 100 101 102 103 104 105 106 107 108 109 110 111
{
    u32   id;
    u32   summed_longs;
    s32   chk_sum;
    u32   host_id;
    u32   next;
    u32   load_data[123];
};


#define AMIGA_ID_RDISK                  0x5244534B
#define AMIGA_ID_PART                   0x50415254
#define AMIGA_ID_BOOT                   0x424f4f54

wdenk's avatar
wdenk committed
112
/*
113 114 115 116
 * The environment array in the partition block
 * describes the partition
 */

wdenk's avatar
wdenk committed
117
struct amiga_part_geometry
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
{
    u32 table_size;
    u32 size_blocks;
    u32 unused1;
    u32 surfaces;
    u32 sector_per_block;
    u32 block_per_track;
    u32 reserved;
    u32 prealloc;
    u32 interleave;
    u32 low_cyl;
    u32 high_cyl;
    u32 num_buffers;
    u32 buf_mem_type;
    u32 max_transfer;
    u32 mask;
    s32 boot_priority;
    u32 dos_type;
    u32 baud;
    u32 control;
    u32 boot_blocks;
};

#endif /* _DISK_PART_AMIGA_H_ */