Revision 2003889f
b/hw/block/pflash_cfi01.c | ||
---|---|---|
193 | 193 |
case 0x60: /* Block /un)lock */ |
194 | 194 |
case 0x70: /* Status Register */ |
195 | 195 |
case 0xe8: /* Write block */ |
196 |
/* Status register read */ |
|
196 |
/* Status register read. Return status from each device in |
|
197 |
* bank. |
|
198 |
*/ |
|
197 | 199 |
ret = pfl->status; |
198 |
if (width > 2) { |
|
200 |
if (pfl->device_width && width > pfl->device_width) { |
|
201 |
int shift = pfl->device_width * 8; |
|
202 |
while (shift + pfl->device_width * 8 <= width * 8) { |
|
203 |
ret |= pfl->status << shift; |
|
204 |
shift += pfl->device_width * 8; |
|
205 |
} |
|
206 |
} else if (!pfl->device_width && width > 2) { |
|
207 |
/* Handle 32 bit flash cases where device width is not |
|
208 |
* set. (Existing behavior before device width added.) |
|
209 |
*/ |
|
199 | 210 |
ret |= pfl->status << 16; |
200 | 211 |
} |
201 | 212 |
DPRINTF("%s: status %x\n", __func__, ret); |
Also available in: Unified diff