Skip to content

Commit

Permalink
m25p80: Introduce COLLECTING_VAR_LEN_DATA state.
Browse files Browse the repository at this point in the history
Some flash allows to stop read at any time.
Allow framework to support this.

Signed-off-by: Marcin Krzeminski <marcin.krzeminski@nokia.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-id: 1466755631-25201-5-git-send-email-marcin.krzeminski@nokia.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
Marcin Krzeminski authored and pm215 committed Jun 27, 2016
1 parent e02b3bf commit 9964674
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hw/block/m25p80.c
Expand Up @@ -330,6 +330,7 @@ typedef enum {
STATE_PAGE_PROGRAM,
STATE_READ,
STATE_COLLECTING_DATA,
STATE_COLLECTING_VAR_LEN_DATA,
STATE_READING_DATA,
} CMDState;

Expand Down Expand Up @@ -872,6 +873,9 @@ static int m25p80_cs(SSISlave *ss, bool select)
Flash *s = M25P80(ss);

if (select) {
if (s->state == STATE_COLLECTING_VAR_LEN_DATA) {
complete_collecting_data(s);
}
s->len = 0;
s->pos = 0;
s->state = STATE_IDLE;
Expand Down Expand Up @@ -905,6 +909,7 @@ static uint32_t m25p80_transfer8(SSISlave *ss, uint32_t tx)
break;

case STATE_COLLECTING_DATA:
case STATE_COLLECTING_VAR_LEN_DATA:
s->data[s->len] = (uint8_t)tx;
s->len++;

Expand Down

0 comments on commit 9964674

Please sign in to comment.