aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-07-19 13:06:09 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:16 -0400
commit289c05222172b51401dbbb017115655f241d94ab (patch)
tree1fd2c801102a8c4a085f75a08c766d3250491962 /drivers/mtd/chips
parentd037021953922ebdbc34b98b8c4648017b1c6e89 (diff)
mtd: replace DEBUG() with pr_debug()
Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic debugging feature is a generic kernel feature that provides more flexibility. (See Documentation/dynamic-debug-howto.txt) Also fix some punctuation, indentation, and capitalization that went along with the affected lines. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c27
-rw-r--r--drivers/mtd/chips/fwh_lock.h3
-rw-r--r--drivers/mtd/chips/jedec_probe.c32
3 files changed, 25 insertions, 37 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 23175edd563..2302cc00b4a 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -145,8 +145,7 @@ static void fixup_amd_bootblock(struct mtd_info *mtd)
145 if (((major << 8) | minor) < 0x3131) { 145 if (((major << 8) | minor) < 0x3131) {
146 /* CFI version 1.0 => don't trust bootloc */ 146 /* CFI version 1.0 => don't trust bootloc */
147 147
148 DEBUG(MTD_DEBUG_LEVEL1, 148 pr_debug("%s: JEDEC Vendor ID is 0x%02X Device ID is 0x%02X\n",
149 "%s: JEDEC Vendor ID is 0x%02X Device ID is 0x%02X\n",
150 map->name, cfi->mfr, cfi->id); 149 map->name, cfi->mfr, cfi->id);
151 150
152 /* AFAICS all 29LV400 with a bottom boot block have a device ID 151 /* AFAICS all 29LV400 with a bottom boot block have a device ID
@@ -166,8 +165,7 @@ static void fixup_amd_bootblock(struct mtd_info *mtd)
166 * the 8-bit device ID. 165 * the 8-bit device ID.
167 */ 166 */
168 (cfi->mfr == CFI_MFR_MACRONIX)) { 167 (cfi->mfr == CFI_MFR_MACRONIX)) {
169 DEBUG(MTD_DEBUG_LEVEL1, 168 pr_debug("%s: Macronix MX29LV400C with bottom boot block"
170 "%s: Macronix MX29LV400C with bottom boot block"
171 " detected\n", map->name); 169 " detected\n", map->name);
172 extp->TopBottom = 2; /* bottom boot */ 170 extp->TopBottom = 2; /* bottom boot */
173 } else 171 } else
@@ -178,8 +176,7 @@ static void fixup_amd_bootblock(struct mtd_info *mtd)
178 extp->TopBottom = 2; /* bottom boot */ 176 extp->TopBottom = 2; /* bottom boot */
179 } 177 }
180 178
181 DEBUG(MTD_DEBUG_LEVEL1, 179 pr_debug("%s: AMD CFI PRI V%c.%c has no boot block field;"
182 "%s: AMD CFI PRI V%c.%c has no boot block field;"
183 " deduced %s from Device ID\n", map->name, major, minor, 180 " deduced %s from Device ID\n", map->name, major, minor,
184 extp->TopBottom == 2 ? "bottom" : "top"); 181 extp->TopBottom == 2 ? "bottom" : "top");
185 } 182 }
@@ -191,7 +188,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd)
191 struct map_info *map = mtd->priv; 188 struct map_info *map = mtd->priv;
192 struct cfi_private *cfi = map->fldrv_priv; 189 struct cfi_private *cfi = map->fldrv_priv;
193 if (cfi->cfiq->BufWriteTimeoutTyp) { 190 if (cfi->cfiq->BufWriteTimeoutTyp) {
194 DEBUG(MTD_DEBUG_LEVEL1, "Using buffer write method\n" ); 191 pr_debug("Using buffer write method\n" );
195 mtd->write = cfi_amdstd_write_buffers; 192 mtd->write = cfi_amdstd_write_buffers;
196 } 193 }
197} 194}
@@ -443,7 +440,7 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
443 mtd->writesize = 1; 440 mtd->writesize = 1;
444 mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; 441 mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
445 442
446 DEBUG(MTD_DEBUG_LEVEL3, "MTD %s(): write buffer size %d\n", 443 pr_debug("MTD %s(): write buffer size %d\n",
447 __func__, mtd->writebufsize); 444 __func__, mtd->writebufsize);
448 445
449 mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot; 446 mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot;
@@ -1163,7 +1160,7 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
1163 return ret; 1160 return ret;
1164 } 1161 }
1165 1162
1166 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n", 1163 pr_debug("MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n",
1167 __func__, adr, datum.x[0] ); 1164 __func__, adr, datum.x[0] );
1168 1165
1169 /* 1166 /*
@@ -1174,7 +1171,7 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
1174 */ 1171 */
1175 oldd = map_read(map, adr); 1172 oldd = map_read(map, adr);
1176 if (map_word_equal(map, oldd, datum)) { 1173 if (map_word_equal(map, oldd, datum)) {
1177 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): NOP\n", 1174 pr_debug("MTD %s(): NOP\n",
1178 __func__); 1175 __func__);
1179 goto op_done; 1176 goto op_done;
1180 } 1177 }
@@ -1400,7 +1397,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
1400 1397
1401 datum = map_word_load(map, buf); 1398 datum = map_word_load(map, buf);
1402 1399
1403 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n", 1400 pr_debug("MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n",
1404 __func__, adr, datum.x[0] ); 1401 __func__, adr, datum.x[0] );
1405 1402
1406 XIP_INVAL_CACHED_RANGE(map, adr, len); 1403 XIP_INVAL_CACHED_RANGE(map, adr, len);
@@ -1587,7 +1584,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
1587 return ret; 1584 return ret;
1588 } 1585 }
1589 1586
1590 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): ERASE 0x%.8lx\n", 1587 pr_debug("MTD %s(): ERASE 0x%.8lx\n",
1591 __func__, chip->start ); 1588 __func__, chip->start );
1592 1589
1593 XIP_INVAL_CACHED_RANGE(map, adr, map->size); 1590 XIP_INVAL_CACHED_RANGE(map, adr, map->size);
@@ -1675,7 +1672,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
1675 return ret; 1672 return ret;
1676 } 1673 }
1677 1674
1678 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): ERASE 0x%.8lx\n", 1675 pr_debug("MTD %s(): ERASE 0x%.8lx\n",
1679 __func__, adr ); 1676 __func__, adr );
1680 1677
1681 XIP_INVAL_CACHED_RANGE(map, adr, len); 1678 XIP_INVAL_CACHED_RANGE(map, adr, len);
@@ -1801,7 +1798,7 @@ static int do_atmel_lock(struct map_info *map, struct flchip *chip,
1801 goto out_unlock; 1798 goto out_unlock;
1802 chip->state = FL_LOCKING; 1799 chip->state = FL_LOCKING;
1803 1800
1804 DEBUG(MTD_DEBUG_LEVEL3, "MTD %s(): LOCK 0x%08lx len %d\n", 1801 pr_debug("MTD %s(): LOCK 0x%08lx len %d\n",
1805 __func__, adr, len); 1802 __func__, adr, len);
1806 1803
1807 cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, 1804 cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi,
@@ -1837,7 +1834,7 @@ static int do_atmel_unlock(struct map_info *map, struct flchip *chip,
1837 goto out_unlock; 1834 goto out_unlock;
1838 chip->state = FL_UNLOCKING; 1835 chip->state = FL_UNLOCKING;
1839 1836
1840 DEBUG(MTD_DEBUG_LEVEL3, "MTD %s(): LOCK 0x%08lx len %d\n", 1837 pr_debug("MTD %s(): LOCK 0x%08lx len %d\n",
1841 __func__, adr, len); 1838 __func__, adr, len);
1842 1839
1843 cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, 1840 cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi,
diff --git a/drivers/mtd/chips/fwh_lock.h b/drivers/mtd/chips/fwh_lock.h
index 5e3cc80128a..89c6595454a 100644
--- a/drivers/mtd/chips/fwh_lock.h
+++ b/drivers/mtd/chips/fwh_lock.h
@@ -34,8 +34,7 @@ static int fwh_xxlock_oneblock(struct map_info *map, struct flchip *chip,
34 34
35 /* Refuse the operation if the we cannot look behind the chip */ 35 /* Refuse the operation if the we cannot look behind the chip */
36 if (chip->start < 0x400000) { 36 if (chip->start < 0x400000) {
37 DEBUG( MTD_DEBUG_LEVEL3, 37 pr_debug( "MTD %s(): chip->start: %lx wanted >= 0x400000\n",
38 "MTD %s(): chip->start: %lx wanted >= 0x400000\n",
39 __func__, chip->start ); 38 __func__, chip->start );
40 return -EIO; 39 return -EIO;
41 } 40 }
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index d40c410a324..c443f527a53 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -1917,8 +1917,7 @@ static void jedec_reset(u32 base, struct map_info *map, struct cfi_private *cfi)
1917 * as they will ignore the writes and don't care what address 1917 * as they will ignore the writes and don't care what address
1918 * the F0 is written to */ 1918 * the F0 is written to */
1919 if (cfi->addr_unlock1) { 1919 if (cfi->addr_unlock1) {
1920 DEBUG( MTD_DEBUG_LEVEL3, 1920 pr_debug( "reset unlock called %x %x \n",
1921 "reset unlock called %x %x \n",
1922 cfi->addr_unlock1,cfi->addr_unlock2); 1921 cfi->addr_unlock1,cfi->addr_unlock2);
1923 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); 1922 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1924 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); 1923 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
@@ -1941,7 +1940,7 @@ static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int in
1941 uint8_t uaddr; 1940 uint8_t uaddr;
1942 1941
1943 if (!(jedec_table[index].devtypes & cfi->device_type)) { 1942 if (!(jedec_table[index].devtypes & cfi->device_type)) {
1944 DEBUG(MTD_DEBUG_LEVEL1, "Rejecting potential %s with incompatible %d-bit device type\n", 1943 pr_debug("Rejecting potential %s with incompatible %d-bit device type\n",
1945 jedec_table[index].name, 4 * (1<<cfi->device_type)); 1944 jedec_table[index].name, 4 * (1<<cfi->device_type));
1946 return 0; 1945 return 0;
1947 } 1946 }
@@ -2021,7 +2020,7 @@ static inline int jedec_match( uint32_t base,
2021 * there aren't. 2020 * there aren't.
2022 */ 2021 */
2023 if (finfo->dev_id > 0xff) { 2022 if (finfo->dev_id > 0xff) {
2024 DEBUG( MTD_DEBUG_LEVEL3, "%s(): ID is not 8bit\n", 2023 pr_debug("%s(): ID is not 8bit\n",
2025 __func__); 2024 __func__);
2026 goto match_done; 2025 goto match_done;
2027 } 2026 }
@@ -2045,12 +2044,10 @@ static inline int jedec_match( uint32_t base,
2045 } 2044 }
2046 2045
2047 /* the part size must fit in the memory window */ 2046 /* the part size must fit in the memory window */
2048 DEBUG( MTD_DEBUG_LEVEL3, 2047 pr_debug("MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n",
2049 "MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n",
2050 __func__, base, 1 << finfo->dev_size, base + (1 << finfo->dev_size) ); 2048 __func__, base, 1 << finfo->dev_size, base + (1 << finfo->dev_size) );
2051 if ( base + cfi_interleave(cfi) * ( 1 << finfo->dev_size ) > map->size ) { 2049 if ( base + cfi_interleave(cfi) * ( 1 << finfo->dev_size ) > map->size ) {
2052 DEBUG( MTD_DEBUG_LEVEL3, 2050 pr_debug("MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n",
2053 "MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n",
2054 __func__, finfo->mfr_id, finfo->dev_id, 2051 __func__, finfo->mfr_id, finfo->dev_id,
2055 1 << finfo->dev_size ); 2052 1 << finfo->dev_size );
2056 goto match_done; 2053 goto match_done;
@@ -2061,13 +2058,12 @@ static inline int jedec_match( uint32_t base,
2061 2058
2062 uaddr = finfo->uaddr; 2059 uaddr = finfo->uaddr;
2063 2060
2064 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n", 2061 pr_debug("MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n",
2065 __func__, cfi->addr_unlock1, cfi->addr_unlock2 ); 2062 __func__, cfi->addr_unlock1, cfi->addr_unlock2 );
2066 if ( MTD_UADDR_UNNECESSARY != uaddr && MTD_UADDR_DONT_CARE != uaddr 2063 if ( MTD_UADDR_UNNECESSARY != uaddr && MTD_UADDR_DONT_CARE != uaddr
2067 && ( unlock_addrs[uaddr].addr1 / cfi->device_type != cfi->addr_unlock1 || 2064 && ( unlock_addrs[uaddr].addr1 / cfi->device_type != cfi->addr_unlock1 ||
2068 unlock_addrs[uaddr].addr2 / cfi->device_type != cfi->addr_unlock2 ) ) { 2065 unlock_addrs[uaddr].addr2 / cfi->device_type != cfi->addr_unlock2 ) ) {
2069 DEBUG( MTD_DEBUG_LEVEL3, 2066 pr_debug("MTD %s(): 0x%.4x 0x%.4x did not match\n",
2070 "MTD %s(): 0x%.4x 0x%.4x did not match\n",
2071 __func__, 2067 __func__,
2072 unlock_addrs[uaddr].addr1, 2068 unlock_addrs[uaddr].addr1,
2073 unlock_addrs[uaddr].addr2); 2069 unlock_addrs[uaddr].addr2);
@@ -2083,15 +2079,13 @@ static inline int jedec_match( uint32_t base,
2083 * FIXME - write a driver that takes all of the chip info as 2079 * FIXME - write a driver that takes all of the chip info as
2084 * module parameters, doesn't probe but forces a load. 2080 * module parameters, doesn't probe but forces a load.
2085 */ 2081 */
2086 DEBUG( MTD_DEBUG_LEVEL3, 2082 pr_debug("MTD %s(): check ID's disappear when not in ID mode\n",
2087 "MTD %s(): check ID's disappear when not in ID mode\n",
2088 __func__ ); 2083 __func__ );
2089 jedec_reset( base, map, cfi ); 2084 jedec_reset( base, map, cfi );
2090 mfr = jedec_read_mfr( map, base, cfi ); 2085 mfr = jedec_read_mfr( map, base, cfi );
2091 id = jedec_read_id( map, base, cfi ); 2086 id = jedec_read_id( map, base, cfi );
2092 if ( mfr == cfi->mfr && id == cfi->id ) { 2087 if ( mfr == cfi->mfr && id == cfi->id ) {
2093 DEBUG( MTD_DEBUG_LEVEL3, 2088 pr_debug("MTD %s(): ID 0x%.2x:0x%.2x did not change after reset:\n"
2094 "MTD %s(): ID 0x%.2x:0x%.2x did not change after reset:\n"
2095 "You might need to manually specify JEDEC parameters.\n", 2089 "You might need to manually specify JEDEC parameters.\n",
2096 __func__, cfi->mfr, cfi->id ); 2090 __func__, cfi->mfr, cfi->id );
2097 goto match_done; 2091 goto match_done;
@@ -2104,7 +2098,7 @@ static inline int jedec_match( uint32_t base,
2104 * Put the device back in ID mode - only need to do this if we 2098 * Put the device back in ID mode - only need to do this if we
2105 * were truly frobbing a real device. 2099 * were truly frobbing a real device.
2106 */ 2100 */
2107 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): return to ID mode\n", __func__ ); 2101 pr_debug("MTD %s(): return to ID mode\n", __func__ );
2108 if (cfi->addr_unlock1) { 2102 if (cfi->addr_unlock1) {
2109 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); 2103 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2110 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); 2104 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
@@ -2167,13 +2161,11 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
2167 2161
2168 cfi->mfr = jedec_read_mfr(map, base, cfi); 2162 cfi->mfr = jedec_read_mfr(map, base, cfi);
2169 cfi->id = jedec_read_id(map, base, cfi); 2163 cfi->id = jedec_read_id(map, base, cfi);
2170 DEBUG(MTD_DEBUG_LEVEL3, 2164 pr_debug("Search for id:(%02x %02x) interleave(%d) type(%d)\n",
2171 "Search for id:(%02x %02x) interleave(%d) type(%d)\n",
2172 cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type); 2165 cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type);
2173 for (i = 0; i < ARRAY_SIZE(jedec_table); i++) { 2166 for (i = 0; i < ARRAY_SIZE(jedec_table); i++) {
2174 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) { 2167 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) {
2175 DEBUG( MTD_DEBUG_LEVEL3, 2168 pr_debug("MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n",
2176 "MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n",
2177 __func__, cfi->mfr, cfi->id, 2169 __func__, cfi->mfr, cfi->id,
2178 cfi->addr_unlock1, cfi->addr_unlock2 ); 2170 cfi->addr_unlock1, cfi->addr_unlock2 );
2179 if (!cfi_jedec_setup(map, cfi, i)) 2171 if (!cfi_jedec_setup(map, cfi, i))