projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some adm5120-hcd cleanups
[openwrt.git]
/
target
/
linux
/
adm5120-2.6
/
files
/
drivers
/
mtd
/
maps
/
adm5120-flash.c
diff --git
a/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120-flash.c
b/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120-flash.c
index
25193a2
..
c077320
100644
(file)
--- a/
target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120-flash.c
+++ b/
target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120-flash.c
@@
-61,7
+61,7
@@
struct adm5120_map_info {
struct map_info map;
void (*switch_bank)(unsigned);
struct adm5120_map_info {
struct map_info map;
void (*switch_bank)(unsigned);
- unsigned long
chip
_size;
+ unsigned long
window
_size;
};
struct adm5120_flash_info {
};
struct adm5120_flash_info {
@@
-158,14
+158,14
@@
static map_word adm5120_flash_read(struct map_info *map, unsigned long ofs)
struct adm5120_map_info *amap = map_to_amap(map);
map_word ret;
struct adm5120_map_info *amap = map_to_amap(map);
map_word ret;
- MAP_DBG(map, "reading from ofs %l
u
\n", ofs);
+ MAP_DBG(map, "reading from ofs %l
X
\n", ofs);
- if (ofs >= amap->
chip
_size)
+ if (ofs >= amap->
window
_size)
return map_word_ff(map);
FLASH_LOCK();
adm5120_flash_switchbank(map, ofs);
return map_word_ff(map);
FLASH_LOCK();
adm5120_flash_switchbank(map, ofs);
- ret = inline_map_read(map, (ofs &
BANK_OFFS_MASK
));
+ ret = inline_map_read(map, (ofs &
(amap->window_size-1)
));
FLASH_UNLOCK();
return ret;
FLASH_UNLOCK();
return ret;
@@
-176,14
+176,14
@@
static void adm5120_flash_write(struct map_info *map, const map_word datum,
{
struct adm5120_map_info *amap = map_to_amap(map);
{
struct adm5120_map_info *amap = map_to_amap(map);
- MAP_DBG(map,"writing to ofs %l
u
\n", ofs);
+ MAP_DBG(map,"writing to ofs %l
X
\n", ofs);
- if (ofs > amap->
chip
_size)
+ if (ofs > amap->
window
_size)
return;
FLASH_LOCK();
adm5120_flash_switchbank(map, ofs);
return;
FLASH_LOCK();
adm5120_flash_switchbank(map, ofs);
- inline_map_write(map, datum, (ofs &
BANK_OFFS_MASK
));
+ inline_map_write(map, datum, (ofs &
(amap->window_size-1)
));
FLASH_UNLOCK();
}
FLASH_UNLOCK();
}
@@
-197,21
+197,21
@@
static void adm5120_flash_copy_from(struct map_info *map, void *to,
MAP_DBG(map, "copy_from, to=%lX, from=%lX, len=%lX\n",
(unsigned long)to, from, (unsigned long)len);
MAP_DBG(map, "copy_from, to=%lX, from=%lX, len=%lX\n",
(unsigned long)to, from, (unsigned long)len);
- if (from > amap->
chip
_size)
+ if (from > amap->
window
_size)
return;
p = (char *)to;
while (len > 0) {
t = len;
return;
p = (char *)to;
while (len > 0) {
t = len;
- if (
from < BANK_SIZE && from+len > BANK_SIZE
)
+ if (
(from < BANK_SIZE) && ((from+len) > BANK_SIZE)
)
t = BANK_SIZE-from;
FLASH_LOCK();
MAP_DBG(map, "copying %lu byte(s) from %lX to %lX\n",
t = BANK_SIZE-from;
FLASH_LOCK();
MAP_DBG(map, "copying %lu byte(s) from %lX to %lX\n",
- (unsigned long)t, (from &
BANK_OFFS_MASK
),
+ (unsigned long)t, (from &
(amap->window_size-1)
),
(unsigned long)p);
adm5120_flash_switchbank(map, from);
(unsigned long)p);
adm5120_flash_switchbank(map, from);
- inline_map_copy_from(map, p, (from &
BANK_OFFS_MASK
), t);
+ inline_map_copy_from(map, p, (from &
(amap->window_size-1)
), t);
FLASH_UNLOCK();
p += t;
from += t;
FLASH_UNLOCK();
p += t;
from += t;
@@
-267,8
+267,8
@@
static int adm5120_flash_initinfo(struct adm5120_flash_info *info,
/* get memory window size */
t = SWITCH_READ(SWITCH_REG_MEMCTRL) >> fdesc->srs_shift;
t &= MEMCTRL_SRS_MASK;
/* get memory window size */
t = SWITCH_READ(SWITCH_REG_MEMCTRL) >> fdesc->srs_shift;
t &= MEMCTRL_SRS_MASK;
- info->amap.
chip
_size = flash_sizes[t];
- if (info->amap.
chip
_size == 0) {
+ info->amap.
window
_size = flash_sizes[t];
+ if (info->amap.
window
_size == 0) {
MAP_ERR(map, "invalid flash size detected\n");
goto err_out;
}
MAP_ERR(map, "invalid flash size detected\n");
goto err_out;
}
@@
-298,7
+298,7
@@
static int adm5120_flash_initinfo(struct adm5120_flash_info *info,
MAP_INFO(map, "probing at 0x%lX, size:%ldKiB, width:%d bits\n",
(unsigned long)map->phys,
MAP_INFO(map, "probing at 0x%lX, size:%ldKiB, width:%d bits\n",
(unsigned long)map->phys,
- (unsigned long)info->amap.
chip
_size >> 10,
+ (unsigned long)info->amap.
window
_size >> 10,
map->bankwidth*8);
return 0;
map->bankwidth*8);
return 0;
@@
-316,7
+316,7
@@
static void adm5120_flash_initbanks(struct adm5120_flash_info *info)
return;
if (info->amap.switch_bank) {
return;
if (info->amap.switch_bank) {
- info->amap.
chip
_size = info->mtd->size;
+ info->amap.
window
_size = info->mtd->size;
return;
}
return;
}
@@
-324,7
+324,7
@@
static void adm5120_flash_initbanks(struct adm5120_flash_info *info)
(unsigned long)map->size >> 10,
(unsigned long)info->mtd->size >> 10);
(unsigned long)map->size >> 10,
(unsigned long)info->mtd->size >> 10);
- info->mtd->size = info->amap.
chip
_size;
+ info->mtd->size = info->amap.
window
_size;
}
#ifdef CONFIG_MTD_PARTITIONS
}
#ifdef CONFIG_MTD_PARTITIONS
@@
-471,13
+471,13
@@
static int adm5120_flash_probe(struct platform_device *dev)
adm5120_flash_initbanks(info);
adm5120_flash_initbanks(info);
- if (info->mtd->size < info->amap.
chip
_size) {
+ if (info->mtd->size < info->amap.
window
_size) {
/* readjust resources */
iounmap(map->virt);
release_resource(info->res);
kfree(info->res);
/* readjust resources */
iounmap(map->virt);
release_resource(info->res);
kfree(info->res);
- info->amap.
chip
_size = info->mtd->size;
+ info->amap.
window
_size = info->mtd->size;
map->size = info->mtd->size;
MAP_INFO(map, "reducing map size to %ldKiB\n",
(unsigned long)map->size >> 10);
map->size = info->mtd->size;
MAP_INFO(map, "reducing map size to %ldKiB\n",
(unsigned long)map->size >> 10);
This page took
0.031693 seconds
and
4
git commands to generate.