aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-08-07 06:55:07 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-08-07 06:55:07 -0400
commitc314dfdc358847eef0fc07ec8682e1acc8cadd00 (patch)
tree46cd8005aeafaca0e6298f37e18c6bc0c3b41384 /drivers/mtd/chips
parent8c64038e4c077b2b37c6b27d0c40c77a3ddfaeef (diff)
[MTD] [NOR] Rename and export new cfi_qry_*() functions
They need to be exported, so let's give them less generic-sounding names while we're at it. Original export patch, along with the suggestion about the nomenclature, from Stephen Rothwell. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r--drivers/mtd/chips/cfi_probe.c20
-rw-r--r--drivers/mtd/chips/cfi_util.c26
2 files changed, 25 insertions, 21 deletions
diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
index e706be2ad0cb..e63e6749429a 100644
--- a/drivers/mtd/chips/cfi_probe.c
+++ b/drivers/mtd/chips/cfi_probe.c
@@ -44,14 +44,14 @@ do { \
44 44
45#define xip_enable(base, map, cfi) \ 45#define xip_enable(base, map, cfi) \
46do { \ 46do { \
47 qry_mode_off(base, map, cfi); \ 47 cfi_qry_mode_off(base, map, cfi); \
48 xip_allowed(base, map); \ 48 xip_allowed(base, map); \
49} while (0) 49} while (0)
50 50
51#define xip_disable_qry(base, map, cfi) \ 51#define xip_disable_qry(base, map, cfi) \
52do { \ 52do { \
53 xip_disable(); \ 53 xip_disable(); \
54 qry_mode_on(base, map, cfi); \ 54 cfi_qry_mode_on(base, map, cfi); \
55} while (0) 55} while (0)
56 56
57#else 57#else
@@ -87,7 +87,7 @@ static int __xipram cfi_probe_chip(struct map_info *map, __u32 base,
87 } 87 }
88 88
89 xip_disable(); 89 xip_disable();
90 if (!qry_mode_on(base, map, cfi)) { 90 if (!cfi_qry_mode_on(base, map, cfi)) {
91 xip_enable(base, map, cfi); 91 xip_enable(base, map, cfi);
92 return 0; 92 return 0;
93 } 93 }
@@ -108,13 +108,13 @@ static int __xipram cfi_probe_chip(struct map_info *map, __u32 base,
108 start = i << cfi->chipshift; 108 start = i << cfi->chipshift;
109 /* This chip should be in read mode if it's one 109 /* This chip should be in read mode if it's one
110 we've already touched. */ 110 we've already touched. */
111 if (qry_present(map, start, cfi)) { 111 if (cfi_qry_present(map, start, cfi)) {
112 /* Eep. This chip also had the QRY marker. 112 /* Eep. This chip also had the QRY marker.
113 * Is it an alias for the new one? */ 113 * Is it an alias for the new one? */
114 qry_mode_off(start, map, cfi); 114 cfi_qry_mode_off(start, map, cfi);
115 115
116 /* If the QRY marker goes away, it's an alias */ 116 /* If the QRY marker goes away, it's an alias */
117 if (!qry_present(map, start, cfi)) { 117 if (!cfi_qry_present(map, start, cfi)) {
118 xip_allowed(base, map); 118 xip_allowed(base, map);
119 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n", 119 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
120 map->name, base, start); 120 map->name, base, start);
@@ -124,9 +124,9 @@ static int __xipram cfi_probe_chip(struct map_info *map, __u32 base,
124 * unfortunate. Stick the new chip in read mode 124 * unfortunate. Stick the new chip in read mode
125 * too and if it's the same, assume it's an alias. */ 125 * too and if it's the same, assume it's an alias. */
126 /* FIXME: Use other modes to do a proper check */ 126 /* FIXME: Use other modes to do a proper check */
127 qry_mode_off(base, map, cfi); 127 cfi_qry_mode_off(base, map, cfi);
128 128
129 if (qry_present(map, base, cfi)) { 129 if (cfi_qry_present(map, base, cfi)) {
130 xip_allowed(base, map); 130 xip_allowed(base, map);
131 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n", 131 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
132 map->name, base, start); 132 map->name, base, start);
@@ -141,7 +141,7 @@ static int __xipram cfi_probe_chip(struct map_info *map, __u32 base,
141 cfi->numchips++; 141 cfi->numchips++;
142 142
143 /* Put it back into Read Mode */ 143 /* Put it back into Read Mode */
144 qry_mode_off(base, map, cfi); 144 cfi_qry_mode_off(base, map, cfi);
145 xip_allowed(base, map); 145 xip_allowed(base, map);
146 146
147 printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n", 147 printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n",
@@ -201,7 +201,7 @@ static int __xipram cfi_chip_setup(struct map_info *map,
201 cfi_read_query(map, base + 0xf * ofs_factor); 201 cfi_read_query(map, base + 0xf * ofs_factor);
202 202
203 /* Put it back into Read Mode */ 203 /* Put it back into Read Mode */
204 qry_mode_off(base, map, cfi); 204 cfi_qry_mode_off(base, map, cfi);
205 xip_allowed(base, map); 205 xip_allowed(base, map);
206 206
207 /* Do any necessary byteswapping */ 207 /* Do any necessary byteswapping */
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c
index 8d7553670526..34d40e25d312 100644
--- a/drivers/mtd/chips/cfi_util.c
+++ b/drivers/mtd/chips/cfi_util.c
@@ -24,8 +24,8 @@
24#include <linux/mtd/cfi.h> 24#include <linux/mtd/cfi.h>
25#include <linux/mtd/compatmac.h> 25#include <linux/mtd/compatmac.h>
26 26
27int __xipram qry_present(struct map_info *map, __u32 base, 27int __xipram cfi_qry_present(struct map_info *map, __u32 base,
28 struct cfi_private *cfi) 28 struct cfi_private *cfi)
29{ 29{
30 int osf = cfi->interleave * cfi->device_type; /* scale factor */ 30 int osf = cfi->interleave * cfi->device_type; /* scale factor */
31 map_word val[3]; 31 map_word val[3];
@@ -50,35 +50,39 @@ int __xipram qry_present(struct map_info *map, __u32 base,
50 50
51 return 1; /* "QRY" found */ 51 return 1; /* "QRY" found */
52} 52}
53EXPORT_SYMBOL_GPL(cfi_qry_present);
53 54
54int __xipram qry_mode_on(uint32_t base, struct map_info *map, 55int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map,
55 struct cfi_private *cfi) 56 struct cfi_private *cfi)
56{ 57{
57 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 58 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
58 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); 59 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
59 if (qry_present(map, base, cfi)) 60 if (cfi_qry_present(map, base, cfi))
60 return 1; 61 return 1;
61 /* QRY not found probably we deal with some odd CFI chips */ 62 /* QRY not found probably we deal with some odd CFI chips */
62 /* Some revisions of some old Intel chips? */ 63 /* Some revisions of some old Intel chips? */
63 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 64 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
64 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); 65 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
65 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); 66 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
66 if (qry_present(map, base, cfi)) 67 if (cfi_qry_present(map, base, cfi))
67 return 1; 68 return 1;
68 /* ST M29DW chips */ 69 /* ST M29DW chips */
69 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 70 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
70 cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL); 71 cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL);
71 if (qry_present(map, base, cfi)) 72 if (cfi_qry_present(map, base, cfi))
72 return 1; 73 return 1;
73 /* QRY not found */ 74 /* QRY not found */
74 return 0; 75 return 0;
75} 76}
76void __xipram qry_mode_off(uint32_t base, struct map_info *map, 77EXPORT_SYMBOL_GPL(cfi_qry_mode_on);
77 struct cfi_private *cfi) 78
79void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map,
80 struct cfi_private *cfi)
78{ 81{
79 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 82 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
80 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); 83 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
81} 84}
85EXPORT_SYMBOL_GPL(cfi_qry_mode_off);
82 86
83struct cfi_extquery * 87struct cfi_extquery *
84__xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* name) 88__xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* name)
@@ -104,7 +108,7 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n
104#endif 108#endif
105 109
106 /* Switch it into Query Mode */ 110 /* Switch it into Query Mode */
107 qry_mode_on(base, map, cfi); 111 cfi_qry_mode_on(base, map, cfi);
108 /* Read in the Extended Query Table */ 112 /* Read in the Extended Query Table */
109 for (i=0; i<size; i++) { 113 for (i=0; i<size; i++) {
110 ((unsigned char *)extp)[i] = 114 ((unsigned char *)extp)[i] =
@@ -112,7 +116,7 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n
112 } 116 }
113 117
114 /* Make sure it returns to read mode */ 118 /* Make sure it returns to read mode */
115 qry_mode_off(base, map, cfi); 119 cfi_qry_mode_off(base, map, cfi);
116 120
117#ifdef CONFIG_MTD_XIP 121#ifdef CONFIG_MTD_XIP
118 (void) map_read(map, base); 122 (void) map_read(map, base);