Skip to content

Commit

Permalink
lpc: Clear sync no-response field prior to device probe
Browse files Browse the repository at this point in the history
[ Upstream commit 7194e92 ]

Artem Senichev reported[1] his P8 platform was failing to boot from
a43e9a6 ("astbmc: Fail SFC init if SIO is unavailable") with the
following error:

[  110.097168975,3] PLAT: Failed to open PNOR flash controller

I reproduced this behaviour on a Palmetto; we need to ensure the state
of the no-response error bit is clear before proceding with the presence
test.

The fix appears to resolve the failure to open the PNOR flash controller
on Palmetto and doesn't change the expected behaviour on Witherspoon.

[1] #197

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Tested-by: Artem Senichev <a.senichev@yadro.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
amboar authored and stewartsmith committed Oct 31, 2018
1 parent e4197f8 commit 70c83a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hw/lpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ static const struct lpc_error_entry lpc_error_table[] = {
static int64_t lpc_probe_prepare(struct lpcm *lpc)
{
const uint32_t irqmask_addr = lpc_reg_opb_base + LPC_HC_IRQMASK;
const uint32_t irqstat_addr = lpc_reg_opb_base + LPC_HC_IRQSTAT;
uint32_t irqmask;
int rc;

Expand All @@ -481,7 +482,11 @@ static int64_t lpc_probe_prepare(struct lpcm *lpc)
return rc;

irqmask &= ~LPC_HC_IRQ_SYNC_NORESP_ERR;
return opb_write(lpc, irqmask_addr, irqmask, 4);
rc = opb_write(lpc, irqmask_addr, irqmask, 4);
if (rc)
return rc;

return opb_write(lpc, irqstat_addr, LPC_HC_IRQ_SYNC_NORESP_ERR, 4);
}

static int64_t lpc_probe_test(struct lpcm *lpc)
Expand Down

0 comments on commit 70c83a4

Please sign in to comment.