xref: /rk3399_rockchip-uboot/include/part.h (revision b0fce99bfc116c2ddb4506268d6e4a0a7054478d)
1012771d8Swdenk /*
2012771d8Swdenk  * (C) Copyright 2000, 2001
3012771d8Swdenk  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4012771d8Swdenk  *
5012771d8Swdenk  * See file CREDITS for list of people who contributed to this
6012771d8Swdenk  * project.
7012771d8Swdenk  *
8012771d8Swdenk  * This program is free software; you can redistribute it and/or
9012771d8Swdenk  * modify it under the terms of the GNU General Public License as
10012771d8Swdenk  * published by the Free Software Foundation; either version 2 of
11012771d8Swdenk  * the License, or (at your option) any later version.
12012771d8Swdenk  *
13012771d8Swdenk  * This program is distributed in the hope that it will be useful,
14012771d8Swdenk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15012771d8Swdenk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16012771d8Swdenk  * GNU General Public License for more details.
17012771d8Swdenk  *
18012771d8Swdenk  * You should have received a copy of the GNU General Public License
19012771d8Swdenk  * along with this program; if not, write to the Free Software
20012771d8Swdenk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21012771d8Swdenk  * MA 02111-1307 USA
22012771d8Swdenk  */
23012771d8Swdenk #ifndef _PART_H
24012771d8Swdenk #define _PART_H
25012771d8Swdenk 
26012771d8Swdenk 
27012771d8Swdenk typedef struct block_dev_desc {
28012771d8Swdenk 	int           if_type;    /* type of the interface */
29012771d8Swdenk 	int           dev;        /* device number */
30012771d8Swdenk 	unsigned char part_type;  /* partition type */
31012771d8Swdenk 	unsigned char target;			/* target SCSI ID */
32012771d8Swdenk 	unsigned char lun;				/* target LUN */
33012771d8Swdenk 	unsigned char type;				/* device type */
34012771d8Swdenk 	unsigned long lba;        /* number of blocks */
35012771d8Swdenk 	unsigned long blksz;			/* block size */
36012771d8Swdenk 	unsigned char vendor[40]; /* IDE model, SCSI Vendor */
37012771d8Swdenk 	unsigned char product[20];/* IDE Serial no, SCSI product */
38012771d8Swdenk 	unsigned char revision[8];/* firmware revision */
39012771d8Swdenk 	unsigned char removable;	/* removable device */
40*b0fce99bSwdenk 	unsigned long (*block_read)(int dev,
41*b0fce99bSwdenk 				    unsigned long start,
42*b0fce99bSwdenk 				    unsigned long blkcnt,
43*b0fce99bSwdenk 				    unsigned long *buffer);
44012771d8Swdenk }block_dev_desc_t;
45*b0fce99bSwdenk 
46012771d8Swdenk /* Interface types: */
47012771d8Swdenk #define IF_TYPE_UNKNOWN		0
48012771d8Swdenk #define IF_TYPE_IDE		1
49012771d8Swdenk #define IF_TYPE_SCSI		2
50012771d8Swdenk #define IF_TYPE_ATAPI		3
51012771d8Swdenk #define IF_TYPE_USB		4
52012771d8Swdenk #define IF_TYPE_DOC		5
53*b0fce99bSwdenk 
54012771d8Swdenk /* Part types */
55012771d8Swdenk #define	PART_TYPE_UNKNOWN	0x00
56012771d8Swdenk #define PART_TYPE_MAC		0x01
57012771d8Swdenk #define PART_TYPE_DOS		0x02
58012771d8Swdenk #define PART_TYPE_ISO		0x03
59c7de829cSwdenk #define PART_TYPE_AMIGA         0x04
60c7de829cSwdenk 
61*b0fce99bSwdenk /*
62*b0fce99bSwdenk  * Type string for U-Boot bootable partitions
63*b0fce99bSwdenk  */
64*b0fce99bSwdenk #define BOOT_PART_TYPE	"U-Boot"	/* primary boot partition type	*/
65*b0fce99bSwdenk #define BOOT_PART_COMP	"PPCBoot"	/* PPCBoot compatibility type	*/
66*b0fce99bSwdenk 
67012771d8Swdenk /* device types */
68012771d8Swdenk #define DEV_TYPE_UNKNOWN	0xff	/* not connected */
69012771d8Swdenk #define DEV_TYPE_HARDDISK	0x00	/* harddisk */
70012771d8Swdenk #define DEV_TYPE_TAPE 		0x01	/* Tape */
71012771d8Swdenk #define DEV_TYPE_CDROM 		0x05	/* CD-ROM */
72012771d8Swdenk #define DEV_TYPE_OPDISK 	0x07	/* optical disk */
73012771d8Swdenk 
74012771d8Swdenk typedef	struct disk_partition {
75012771d8Swdenk 	ulong	start;		/* # of first block in partition	*/
76012771d8Swdenk 	ulong	size;		/* number of blocks in partition	*/
77012771d8Swdenk 	ulong	blksz;		/* block size in bytes			*/
78012771d8Swdenk 	uchar	name[32];	/* partition name			*/
79012771d8Swdenk 	uchar	type[32];	/* string type description		*/
80012771d8Swdenk } disk_partition_t;
81012771d8Swdenk 
82012771d8Swdenk /* disk/part.c */
83012771d8Swdenk int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
84012771d8Swdenk void print_part (block_dev_desc_t *dev_desc);
85012771d8Swdenk void  init_part (block_dev_desc_t *dev_desc);
86012771d8Swdenk void dev_print(block_dev_desc_t *dev_desc);
87012771d8Swdenk 
88012771d8Swdenk 
89012771d8Swdenk #ifdef CONFIG_MAC_PARTITION
90012771d8Swdenk /* disk/part_mac.c */
91012771d8Swdenk int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
92012771d8Swdenk void print_part_mac (block_dev_desc_t *dev_desc);
93012771d8Swdenk int   test_part_mac (block_dev_desc_t *dev_desc);
94012771d8Swdenk #endif
95012771d8Swdenk 
96012771d8Swdenk #ifdef CONFIG_DOS_PARTITION
97012771d8Swdenk /* disk/part_dos.c */
98012771d8Swdenk int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
99012771d8Swdenk void print_part_dos (block_dev_desc_t *dev_desc);
100012771d8Swdenk int   test_part_dos (block_dev_desc_t *dev_desc);
101012771d8Swdenk #endif
102012771d8Swdenk 
103012771d8Swdenk #ifdef CONFIG_ISO_PARTITION
104012771d8Swdenk /* disk/part_iso.c */
105012771d8Swdenk int get_partition_info_iso (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
106012771d8Swdenk void print_part_iso (block_dev_desc_t *dev_desc);
107012771d8Swdenk int   test_part_iso (block_dev_desc_t *dev_desc);
108012771d8Swdenk #endif
109012771d8Swdenk 
110c7de829cSwdenk #ifdef CONFIG_AMIGA_PARTITION
111c7de829cSwdenk /* disk/part_amiga.c */
112c7de829cSwdenk int get_partition_info_amiga (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
113c7de829cSwdenk void print_part_amiga (block_dev_desc_t *dev_desc);
114c7de829cSwdenk int   test_part_amiga (block_dev_desc_t *dev_desc);
115c7de829cSwdenk #endif
116c7de829cSwdenk 
117012771d8Swdenk #endif /* _PART_H */
118