blob: b28b52ce5b5b45d966bdb3cb90a53cac3ff38a69
1 | /*********************************************** |
2 | *****Storage config of board, for ACS use.***** |
3 | ***********************************************/ |
4 | |
5 | #ifndef __STORAGE_H |
6 | #define __STORAGE_H |
7 | |
8 | #include <linux/types.h> |
9 | #include <asm/arch/romboot.h> |
10 | #ifndef __ASSEMBLY__ |
11 | |
12 | //Partition table defines |
13 | #define NAND_PART_SIZE_FULL -1 |
14 | #define MAX_PART_NUM 32 |
15 | #define MAX_PART_NAME_LEN 16 |
16 | //#define SZ_1M 0x100000 |
17 | |
18 | #define STORE_CODE 1 |
19 | #define STORE_CACHE (1<<1) |
20 | #define STORE_DATA (1<<2) |
21 | |
22 | #define SPI_BOOT_FLAG 0 |
23 | #define NAND_BOOT_FLAG 1 |
24 | #define EMMC_BOOT_FLAG 2 |
25 | #define CARD_BOOT_FLAG 3 |
26 | #define SPI_NAND_FLAG 4 |
27 | #define SPI_EMMC_FLAG 5 |
28 | |
29 | #define CARD_TYPE_SHIFT 4 |
30 | #define CARD_TYPE_MASK 0xf |
31 | #define CARD_TYPE_UNKNOWN 0 /* unknown */ |
32 | //#define CARD_TYPE_MMC 1 /* MMC card */ |
33 | //#define CARD_TYPE_SD 2 /* SD card */ |
34 | #define CARD_TYPE_SDIO 3 /* SDIO card */ |
35 | #define CARD_TYPE_SD_COMBO 4 /* SD combo (IO+mem) card */ |
36 | #define CARD_TYPE_NON_SDIO 5 /* NON sdio device (means SD/MMC card) */ |
37 | |
38 | #define AML_GET_CARD_TYPE(val, port) ((val >> (port * CARD_TYPE_SHIFT)) & CARD_TYPE_MASK) |
39 | #define AML_SET_CARD_TYPE(val, port, type) \ |
40 | (val |= ((type & CARD_TYPE_MASK) << (port * CARD_TYPE_SHIFT))) |
41 | |
42 | /* storage device */ |
43 | #define STORAGE_DEV_NOSET (0) |
44 | #define STORAGE_DEV_EMMC (1) |
45 | #define STORAGE_DEV_NAND (2) |
46 | #define STORAGE_DEV_SPI (3) |
47 | #define STORAGE_DEV_SDCARD (4) |
48 | #define STORAGE_DEV_USB (5) |
49 | |
50 | struct partitions { |
51 | char name[MAX_PART_NAME_LEN]; /* identifier string */ |
52 | uint64_t size; /* partition size */ |
53 | uint64_t offset; /* offset within the master space */ |
54 | unsigned mask_flags; /* master flags to mask out for this partition */ |
55 | }; |
56 | |
57 | struct config_nand { |
58 | unsigned enable_slc; |
59 | unsigned order_ce; |
60 | unsigned reserved[2]; |
61 | }; |
62 | |
63 | struct config_mmc { |
64 | unsigned type; |
65 | unsigned port; |
66 | unsigned reserved[2]; |
67 | }; |
68 | |
69 | struct store_config { |
70 | unsigned store_device_flag; // indicate storage devices on each board |
71 | struct config_nand nand_configs; // specital config for nand |
72 | struct config_mmc mmc_configs; // specital config for mmc |
73 | }; |
74 | |
75 | #endif |
76 | #endif |
77 |