Commit 88f7ef82 authored by Tristan Gingold's avatar Tristan Gingold

fip_urv: do not send pad

parent 8ee50fb0
......@@ -435,13 +435,14 @@ copy_app_to_fip(void)
return 0;
src = &REGS->sh_mem[128 + (rslot << 5)];
d &= 0xffffff0f;
d |= CMD_APP_FLAG;
d = *src++;
d &= 0xffffff0f;
d |= CMD_APP_FLAG;
/* Produce variable */
REGS->fip_var3 = 1;
/* Unpack and copy */
i = 0;
while (1) {
......@@ -455,6 +456,8 @@ copy_app_to_fip(void)
d >>= 8;
}
REGS->fip_var3 = 0;
/* Update slot. */
REGS->app[0].mailboxes.mboxout = (lmb + 1) & 0xffffff03;
......@@ -592,7 +595,7 @@ int main (void)
}
if (fip_status & 1) {
/* Variable received (from FIP) */
/* Variable var1 received (from FIP) */
unsigned char cmd;
unsigned char id;
......@@ -603,12 +606,6 @@ int main (void)
if (cmd & CMD_APP_FLAG) {
/* Just data. */
copy_fip_to_app (cmd);
reply[0] = CMD_ERROR;
reply[1] = 0;
/* Send data or pad. */
rdy = 2;
}
else {
id = REGS->fip_reg[0x03];
......@@ -765,10 +762,9 @@ int main (void)
reply[6] = 0;
reply[7] = 0;
} else {
/* No reply for pad (or error). */
reply[0] = CMD_ERROR;
/* Send a pad. */
rdy = 2;
rdy = 0;
}
}
......@@ -776,31 +772,32 @@ int main (void)
REGS->fip_var1 = 0;
}
if ((fip_status & 2) && rdy) {
int i;
if (fip_status & 2) {
/* var3 can be written. */
/* Produce variable */
REGS->fip_var3 = 1;
/* High priority: answer packet from management. */
if (rdy) {
int i;
if (rdy == 2) {
/* No reply to send (either app data or pad was received). */
if (copy_app_to_fip()) {
/* But we could send data. */
goto wr_done;
}
else
stat_regs[STAT_FIP_PAD]++;
}
/* Produce variable */
REGS->fip_var3 = 1;
/* Write a reply. */
for (i = 0; i < rlen; i++) {
REGS->fip_reg[0x102 + i] = reply[i];
}
/* Write a reply. */
for (i = 0; i < rlen; i++) {
REGS->fip_reg[0x102 + i] = reply[i];
}
wr_done:
REGS->fip_var3 = 0;
REGS->fip_var3 = 0;
rdy = 0;
rdy = 0;
}
else if (copy_app_to_fip()) {
/* done */
}
else {
/* Nothing to do; do not send data, clear var3_rdy. */
REGS->fip_var3 = 2;
}
}
if ((i2c.state & 0x0f) != I2C_CMD_IDLE) {
......
......@@ -252,14 +252,16 @@ static int read_cons_vars(void)
return 0;
case MSTRFIP_DATA_PAYLOAD_ERROR:
ftb->nbr_errors++;
fprintf (stderr, "%s var cons: payload err (%u):",
now(), ftb->nbr_errors);
if (pvar->payload_error & MSTRFIP_FRAME_PAYLOAD_NOT_REFRESH)
fprintf (stderr, " not-refreshed");
if (pvar->payload_error & MSTRFIP_FRAME_PAYLOAD_NOT_SIGNIFICANT)
fprintf (stderr, " not-significant");
fprintf (stderr, "\n");
if (0) {
ftb->nbr_errors++;
fprintf (stderr, "%s var cons: payload err (%u):",
now(), ftb->nbr_errors);
if (pvar->payload_error & MSTRFIP_FRAME_PAYLOAD_NOT_REFRESH)
fprintf (stderr, " not-refreshed");
if (pvar->payload_error & MSTRFIP_FRAME_PAYLOAD_NOT_SIGNIFICANT)
fprintf (stderr, " not-significant");
fprintf (stderr, "\n");
}
return 1;
case MSTRFIP_DATA_NOT_RECEIVED:
......@@ -306,8 +308,8 @@ static int update_prod_vars(void)
pvar->buffer[2] = 0;
pvar->buffer[3] = 0;
if (flag_trace)
fprintf (stderr, "Send padding (%s)\n",
ftb->waitrep ? "waiting for reply" : "idle");
fprintf (stderr, "Send padding (%s)\n",
ftb->waitrep ? "waiting for reply" : "idle");
}
else if (ftb->idx_cmd >= ftb->nbr_cmds) {
/* End of command list. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment