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