Lines Matching refs:state

240 /* This state is used to mark that the next state isn't known yet */
263 /* Remove action bits from state */
296 uint32_t state; /* current chip state */
297 uint32_t nxstate; /* next expected state */
302 uint16_t stateidx; /* current state index */
342 /* NAND flash lines state */
1016 * Returns the string representation of 'state' state.
1018 static char *ns_get_state_name(uint32_t state)
1020 switch (NS_STATE(state)) {
1069 NS_ERR("get_state_name: unknown state, BUG\n");
1103 * Returns state after command is accepted by command number.
1159 * Switch to STATE_READY state.
1163 NS_DBG("switch_to_ready_state: switch to %s state\n",
1166 ns->state = STATE_READY;
1193 * ns->pstates[0], ... ns->pstates[ns->npstates], ns->state
1196 * ns->ops, ns->state, ns->nxstate are initialized, ns->npstate is
1199 * If there are several matches, the current state is pushed to the
1214 * to the STATE_READY state.
1215 * 2. if there are no saved states, switch to the STATE_READY state.
1238 if (NS_STATE(ns->state) != NS_STATE(ops[i].states[ns->npstates]))
1262 * yet fully input and the current state must
1264 * state must be the next state (ns->nxstate).
1271 ns->state = ns->op[ns->stateidx];
1273 NS_DBG("find_operation: operation found, index: %d, state: %s, nxstate %s\n",
1274 idx, ns_get_state_name(ns->state),
1282 NS_DBG("find_operation: no operation found, try again with state %s\n",
1283 ns_get_state_name(ns->state));
1301 ns->pstates[ns->npstates++] = ns->state;
1572 * If state has any action bit, perform this action.
1724 * Switch simulator's state.
1735 ns->state = ns->nxstate;
1738 NS_DBG("switch_state: operation is known, switch to the next state, "
1739 "state: %s, nxstate: %s\n",
1740 ns_get_state_name(ns->state),
1744 if ((ns->state & ACTION_MASK) &&
1745 ns_do_state_action(ns, ns->state) < 0) {
1760 ns->state = ns_get_state_by_command(ns->regs.command);
1767 if ((ns->state & ACTION_MASK) &&
1768 ns_do_state_action(ns, ns->state) < 0) {
1782 * The current state is the last. Return to STATE_READY
1788 if ((ns->state & (STATE_DATAIN_MASK | STATE_DATAOUT_MASK))
1795 NS_DBG("switch_state: operation complete, switch to STATE_READY state\n");
1802 * If the next state is data input/output, switch to it now
1805 ns->state = ns->nxstate;
1809 NS_DBG("switch_state: the next state is data I/O, switch, "
1810 "state: %s, nxstate: %s\n",
1811 ns_get_state_name(ns->state),
1818 switch (NS_STATE(ns->state)) {
1833 NS_ERR("switch_state: BUG! unknown data state\n");
1838 * If the next state is address input, set the internal
1863 NS_ERR("switch_state: BUG! unknown address state\n");
1889 if (!(ns->state & STATE_DATAOUT_MASK)) {
1890 NS_WARN("read_byte: unexpected data output cycle, state is %s return %#x\n",
1891 ns_get_state_name(ns->state), (uint)outb);
1896 if (NS_STATE(ns->state) == STATE_DATAOUT_STATUS) {
1907 switch (NS_STATE(ns->state)) {
1967 if (NS_STATE(ns->state) == STATE_DATAOUT_STATUS
1968 || NS_STATE(ns->state) == STATE_DATAOUT) {
1980 NS_STATE(ns->state) == STATE_DATAOUT_ID && ns->regs.count == 2)) {
1984 * previous command(s)/state(s) and accept the last one.
1986 NS_WARN("write_byte: command (%#x) wasn't expected, expected state is %s, ignore previous states\n",
1993 NS_DBG("command byte corresponding to %s state accepted\n",
2010 if ((ns->state & ACTION_MASK) &&
2011 ns_do_state_action(ns, ns->state) < 0) {
2035 NS_ERR("write_byte: address (%#x) isn't expected, expected state is %s, switch to STATE_READY\n",
2066 if (!(ns->state & STATE_DATAIN_MASK)) {
2067 NS_ERR("write_byte: data input (%#x) isn't expected, state is %s, switch to %s\n",
2068 (uint)byte, ns_get_state_name(ns->state),
2099 if (!(ns->state & STATE_DATAIN_MASK)) {
2100 NS_ERR("write_buf: data input isn't expected, state is %s, switch to STATE_READY\n",
2101 ns_get_state_name(ns->state));
2134 if (!(ns->state & STATE_DATAOUT_MASK)) {
2135 NS_WARN("read_buf: unexpected data output cycle, current state is %s\n",
2136 ns_get_state_name(ns->state));
2140 if (NS_STATE(ns->state) != STATE_DATAOUT) {