1 #ifndef __LINUX_MTD_QINFO_H
2 #define __LINUX_MTD_QINFO_H
4 #include <linux/mtd/map.h>
5 #include <linux/wait.h>
6 #include <linux/spinlock.h>
7 #include <linux/delay.h>
8 #include <linux/mtd/mtd.h>
9 #include <linux/mtd/flashchip.h>
10 #include <linux/mtd/partitions.h>
12 /* lpddr_private describes lpddr flash chip in memory map
13 * @ManufactId - Chip Manufacture ID
14 * @DevId - Chip Device ID
15 * @qinfo - pointer to qinfo records describing the chip
16 * @numchips - number of chips including virual RWW partitions
17 * @chipshift - Chip/partiton size 2^chipshift
18 * @chips - per-chip data structure
20 struct lpddr_private {
23 struct qinfo_chip *qinfo;
25 unsigned long chipshift;
26 struct flchip chips[0];
29 /* qinfo_query_info structure contains request information for
31 * @major - major number of qinfo record
32 * @major - minor number of qinfo record
33 * @id_str - descriptive string to access the record
34 * @desc - detailed description for the qinfo record
36 struct qinfo_query_info {
44 * qinfo_chip structure contains necessary qinfo records data
45 * @DevSizeShift - Device size 2^n bytes
46 * @BufSizeShift - Program buffer size 2^n bytes
47 * @TotalBlocksNum - Total number of blocks
48 * @UniformBlockSizeShift - Uniform block size 2^UniformBlockSizeShift bytes
49 * @HWPartsNum - Number of hardware partitions
50 * @SuspEraseSupp - Suspend erase supported
51 * @SingleWordProgTime - Single word program 2^SingleWordProgTime u-sec
52 * @ProgBufferTime - Program buffer write 2^ProgBufferTime u-sec
53 * @BlockEraseTime - Block erase 2^BlockEraseTime m-sec
56 /* General device info */
57 uint16_t DevSizeShift;
58 uint16_t BufSizeShift;
59 /* Erase block information */
60 uint16_t TotalBlocksNum;
61 uint16_t UniformBlockSizeShift;
62 /* Partition information */
64 /* Optional features */
65 uint16_t SuspEraseSupp;
66 /* Operation typical time */
67 uint16_t SingleWordProgTime;
68 uint16_t ProgBufferTime;
69 uint16_t BlockEraseTime;
72 /* defines for fixup usage */
73 #define LPDDR_MFR_ANY 0xffff
74 #define LPDDR_ID_ANY 0xffff
75 #define NUMONYX_MFGR_ID 0x0089
76 #define R18_DEVICE_ID_1G 0x893c
78 static inline map_word lpddr_build_cmd(u_long cmd, struct map_info *map)
80 map_word val = { {0} };
85 #define CMD(x) lpddr_build_cmd(x, map)
86 #define CMDVAL(cmd) cmd.x[0]
88 struct mtd_info *lpddr_cmdset(struct map_info *);