projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'xilinx-for-v2017.03' of git://www.denx.de/git/u-boot-microblaze
[oweals/u-boot.git]
/
drivers
/
mtd
/
spi
/
sandbox.c
diff --git
a/drivers/mtd/spi/sandbox.c
b/drivers/mtd/spi/sandbox.c
index f59134ff9260dbd38b4dcec07bc29b74e7b09ca7..4944059fa3f16c1d8710089f18e92246854bea3b 100644
(file)
--- a/
drivers/mtd/spi/sandbox.c
+++ b/
drivers/mtd/spi/sandbox.c
@@
-88,7
+88,7
@@
struct sandbox_spi_flash {
/* The current flash status (see STAT_XXX defines above) */
u16 status;
/* Data describing the flash we're emulating */
/* The current flash status (see STAT_XXX defines above) */
u16 status;
/* Data describing the flash we're emulating */
- const struct spi_flash_
params
*data;
+ const struct spi_flash_
info
*data;
/* The file on disk to serv up data from */
int fd;
};
/* The file on disk to serv up data from */
int fd;
};
@@
-112,7
+112,7
@@
static int sandbox_sf_probe(struct udevice *dev)
struct sandbox_spi_flash *sbsf = dev_get_priv(dev);
const char *file;
size_t len, idname_len;
struct sandbox_spi_flash *sbsf = dev_get_priv(dev);
const char *file;
size_t len, idname_len;
- const struct spi_flash_
params
*data;
+ const struct spi_flash_
info
*data;
struct sandbox_spi_flash_plat_data *pdata = dev_get_platdata(dev);
struct sandbox_state *state = state_get_current();
struct udevice *bus = dev->parent;
struct sandbox_spi_flash_plat_data *pdata = dev_get_platdata(dev);
struct sandbox_state *state = state_get_current();
struct udevice *bus = dev->parent;
@@
-168,7
+168,7
@@
static int sandbox_sf_probe(struct udevice *dev)
}
debug("%s: device='%s'\n", __func__, spec);
}
debug("%s: device='%s'\n", __func__, spec);
- for (data = spi_flash_
params_table
; data->name; data++) {
+ for (data = spi_flash_
ids
; data->name; data++) {
len = strlen(data->name);
if (idname_len != len)
continue;
len = strlen(data->name);
if (idname_len != len)
continue;
@@
-289,7
+289,7
@@
static int sandbox_sf_process_cmd(struct sandbox_spi_flash *sbsf, const u8 *rx,
/* we only support erase here */
if (sbsf->cmd == CMD_ERASE_CHIP) {
sbsf->erase_size = sbsf->data->sector_size *
/* we only support erase here */
if (sbsf->cmd == CMD_ERASE_CHIP) {
sbsf->erase_size = sbsf->data->sector_size *
- sbsf->data->n
r
_sectors;
+ sbsf->data->n_sectors;
} else if (sbsf->cmd == CMD_ERASE_4K && (flags & SECT_4K)) {
sbsf->erase_size = 4 << 10;
} else if (sbsf->cmd == CMD_ERASE_64K && !(flags & SECT_4K)) {
} else if (sbsf->cmd == CMD_ERASE_4K && (flags & SECT_4K)) {
sbsf->erase_size = 4 << 10;
} else if (sbsf->cmd == CMD_ERASE_64K && !(flags & SECT_4K)) {
@@
-359,7
+359,8
@@
static int sandbox_sf_xfer(struct udevice *dev, unsigned int bitlen,
debug(" id: off:%u tx:", sbsf->off);
if (sbsf->off < IDCODE_LEN) {
/* Extract correct byte from ID 0x00aabbcc */
debug(" id: off:%u tx:", sbsf->off);
if (sbsf->off < IDCODE_LEN) {
/* Extract correct byte from ID 0x00aabbcc */
- id = sbsf->data->jedec >>
+ id = ((JEDEC_MFR(sbsf->data) << 16) |
+ JEDEC_ID(sbsf->data)) >>
(8 * (IDCODE_LEN - 1 - sbsf->off));
} else {
id = 0;
(8 * (IDCODE_LEN - 1 - sbsf->off));
} else {
id = 0;