4 #ifndef __LINUX_MTD_PFOW_H
5 #define __LINUX_MTD_PFOW_H
11 #define PFOW_QUERY_STRING_P 0x0000
13 #define PFOW_QUERY_STRING_F 0x0002
15 #define PFOW_QUERY_STRING_O 0x0004
17 #define PFOW_QUERY_STRING_W 0x0006
19 #define PFOW_MANUFACTURER_ID 0x0020
20 #define PFOW_DEVICE_ID 0x0022
22 #define PFOW_PROGRAM_BUFFER_OFFSET 0x0040
24 #define PFOW_PROGRAM_BUFFER_SIZE 0x0042
26 #define PFOW_COMMAND_CODE 0x0080
28 #define PFOW_COMMAND_DATA 0x0084
30 #define PFOW_COMMAND_ADDRESS_L 0x0088
32 #define PFOW_COMMAND_ADDRESS_H 0x008a
34 #define PFOW_DATA_COUNT_L 0x0090
36 #define PFOW_DATA_COUNT_H 0x0092
38 #define PFOW_COMMAND_EXECUTE 0x00c0
40 #define PFOW_CLEAR_PROGRAM_BUFFER 0x00c4
42 #define PFOW_PROGRAM_ERASE_SUSPEND 0x00c8
44 #define PFOW_DSR 0x00cc
48 #define LPDDR_WORD_PROGRAM 0x0041
49 #define LPDDR_BUFF_PROGRAM 0x00E9
50 #define LPDDR_BLOCK_ERASE 0x0020
51 #define LPDDR_LOCK_BLOCK 0x0061
52 #define LPDDR_UNLOCK_BLOCK 0x0062
53 #define LPDDR_READ_BLOCK_LOCK_STATUS 0x0065
54 #define LPDDR_INFO_QUERY 0x0098
55 #define LPDDR_READ_OTP 0x0097
56 #define LPDDR_PROG_OTP 0x00C0
57 #define LPDDR_RESUME 0x00D0
60 #define LPDDR_START_EXECUTION 0x0001
63 #define LPDDR_SUSPEND 0x0001
67 #define DSR_DPS (1<<1)
69 #define DSR_PSS (1<<2)
72 #define DSR_VPPS (1<<3)
73 #define DSR_PROGRAM_STATUS (1<<4)
74 #define DSR_ERASE_STATUS (1<<5)
77 #define DSR_ESS (1<<6)
80 #define DSR_READY_STATUS (1<<7)
83 #define DSR_RPS (0x3<<8)
91 #define DSR_AOS (1<<12)
92 #define DSR_AVAILABLE (1<<15)
97 #define DSR_ERR 0x133A
99 static inline void send_pfow_command(
struct map_info *
map,
100 unsigned long cmd_code,
unsigned long adr,
103 int bits_per_chip = map_bankwidth(map) * 8;
127 static inline void print_drs_error(
unsigned dsr)
129 int prog_status = (dsr &
DSR_RPS) >> 8;
133 if (prog_status & 0x03)
135 "half with 41h command\n");
136 else if (prog_status & 0x02)
138 "in region with Control Mode data\n");
139 else if (prog_status & 0x01)
141 "with Object Mode data\n");
157 "on locked block\n");