diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-06-17 13:56:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-17 14:38:54 -0400 |
commit | e570bd0472b10c9f982fdb58eb39c81445cddb5c (patch) | |
tree | 457461b97a5a48842877bd4d23b7c33ec1395845 | |
parent | 4a71053ec5b5f5bf58963b94429d7af920b88ef9 (diff) |
ssb: add struct for serial flash
This data allow writing for example MTD driver.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/ssb/driver_chipcommon_sflash.c | 7 | ||||
-rw-r--r-- | include/linux/ssb/ssb_driver_mips.h | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/ssb/driver_chipcommon_sflash.c b/drivers/ssb/driver_chipcommon_sflash.c index 1b9e770f5328..205f1c499c46 100644 --- a/drivers/ssb/driver_chipcommon_sflash.c +++ b/drivers/ssb/driver_chipcommon_sflash.c | |||
@@ -73,6 +73,7 @@ static void ssb_sflash_cmd(struct ssb_chipcommon *cc, u32 opcode) | |||
73 | /* Initialize serial flash access */ | 73 | /* Initialize serial flash access */ |
74 | int ssb_sflash_init(struct ssb_chipcommon *cc) | 74 | int ssb_sflash_init(struct ssb_chipcommon *cc) |
75 | { | 75 | { |
76 | struct ssb_sflash *sflash = &cc->dev->bus->mipscore.sflash; | ||
76 | const struct ssb_sflash_tbl_e *e; | 77 | const struct ssb_sflash_tbl_e *e; |
77 | u32 id, id2; | 78 | u32 id, id2; |
78 | 79 | ||
@@ -131,6 +132,12 @@ int ssb_sflash_init(struct ssb_chipcommon *cc) | |||
131 | return -ENOTSUPP; | 132 | return -ENOTSUPP; |
132 | } | 133 | } |
133 | 134 | ||
135 | sflash->window = SSB_FLASH2; | ||
136 | sflash->blocksize = e->blocksize; | ||
137 | sflash->numblocks = e->numblocks; | ||
138 | sflash->size = sflash->blocksize * sflash->numblocks; | ||
139 | sflash->present = true; | ||
140 | |||
134 | pr_info("Found %s serial flash (blocksize: 0x%X, blocks: %d)\n", | 141 | pr_info("Found %s serial flash (blocksize: 0x%X, blocks: %d)\n", |
135 | e->name, e->blocksize, e->numblocks); | 142 | e->name, e->blocksize, e->numblocks); |
136 | 143 | ||
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h index afe79d40a99e..6535e4718fde 100644 --- a/include/linux/ssb/ssb_driver_mips.h +++ b/include/linux/ssb/ssb_driver_mips.h | |||
@@ -20,6 +20,18 @@ struct ssb_pflash { | |||
20 | u32 window_size; | 20 | u32 window_size; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | #ifdef CONFIG_SSB_SFLASH | ||
24 | struct ssb_sflash { | ||
25 | bool present; | ||
26 | u32 window; | ||
27 | u32 blocksize; | ||
28 | u16 numblocks; | ||
29 | u32 size; | ||
30 | |||
31 | void *priv; | ||
32 | }; | ||
33 | #endif | ||
34 | |||
23 | struct ssb_mipscore { | 35 | struct ssb_mipscore { |
24 | struct ssb_device *dev; | 36 | struct ssb_device *dev; |
25 | 37 | ||
@@ -27,6 +39,9 @@ struct ssb_mipscore { | |||
27 | struct ssb_serial_port serial_ports[4]; | 39 | struct ssb_serial_port serial_ports[4]; |
28 | 40 | ||
29 | struct ssb_pflash pflash; | 41 | struct ssb_pflash pflash; |
42 | #ifdef CONFIG_SSB_SFLASH | ||
43 | struct ssb_sflash sflash; | ||
44 | #endif | ||
30 | }; | 45 | }; |
31 | 46 | ||
32 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); | 47 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); |