change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / disk / part_cfg.h
1 //#include "emmc.h"
2
3 #ifndef _DISK_PART_CFG_H
4 #define _DISK_PART_CFG_H
5
6 #include "part_uefi.h"
7
8 /**
9  *
10  *      devide wrapped interface
11  *
12 **/
13 unsigned int _get_device_info(unsigned int *total_sector_number);
14 unsigned int _read_block(unsigned int start_sector,unsigned int sector_number,unsigned char *buf);
15 unsigned int _write_block(unsigned int start_sector,unsigned int sector_number,unsigned char *buf);
16
17 /**
18  *
19  *      partition device relative
20  *
21 **/
22 //typedef unsigned int (*PART_DEVICE_ID)(unsigned int *id);
23 typedef unsigned int (*PART_DEVICE_INFO)(unsigned int *total_sector_number);
24 typedef unsigned int (*PART_READ)(unsigned int start_sector,unsigned int sector_number,unsigned char *buf);
25 typedef unsigned int (*PART_WRITE)(unsigned int start_sector,unsigned int sector_number,unsigned char *buf);
26
27 typedef struct _PART_DEVICE_IO
28 {
29         //PART_DEVICE_ID _get_id;
30         PART_DEVICE_INFO _info;
31         PART_READ       _read;
32         PART_WRITE      _write;
33 } __attribute__ ((packed)) PART_DEVICE_IO,*PPART_DEVICE_IO;
34
35 typedef struct _PART_DEVICE
36 {
37         //unsigned int device_id;
38         unsigned int total_sector;
39         PART_DEVICE_IO *_device_io;
40 } __attribute__ ((packed)) PART_DEVICE,*PPART_DEVICE;
41
42 /**
43  *
44  *      partition relative
45  *
46 **/
47
48 typedef struct _PARTITION_INFO
49 {
50         unsigned int partition_index;
51         unsigned int partition_start_sector;
52         unsigned int partition_total_sector;
53         unsigned int partition_attr;    //must to check by filesystem interface
54 } __attribute__ ((packed)) PARTITION_INFO,*PPARTITION_INFO;
55
56
57 typedef struct _PARTITION_TABLE
58 {
59         unsigned int total_partition;
60         PARTITION_INFO _partition_info[MAX_PARTITION_INFO]; 
61 } __attribute__ ((packed)) PARTITION_TABLE,*PPARTITION_TABLE;
62
63 extern PART_DEVICE emmc_part_device;
64
65 #endif //_DISK_PART_CFG_H