Skip to content

Commit

Permalink
ppc440: Avoid reporting error when reading non-existent RAM slot
Browse files Browse the repository at this point in the history
When reading base register of RAM slot with no RAM we should not try
to calculate register value because that will result printing an error
due to invalid RAM size. Just return 0 without the error in this case.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
zbalaton authored and dgibson committed Feb 4, 2019
1 parent 52b73c0 commit 4f10ed2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hw/ppc/ppc440_uc.c
Expand Up @@ -613,8 +613,10 @@ static uint32_t dcr_read_sdram(void *opaque, int dcrn)
case SDRAM_R1BAS:
case SDRAM_R2BAS:
case SDRAM_R3BAS:
ret = sdram_bcr(sdram->ram_bases[dcrn - SDRAM_R0BAS],
sdram->ram_sizes[dcrn - SDRAM_R0BAS]);
if (sdram->ram_sizes[dcrn - SDRAM_R0BAS]) {
ret = sdram_bcr(sdram->ram_bases[dcrn - SDRAM_R0BAS],
sdram->ram_sizes[dcrn - SDRAM_R0BAS]);
}
break;
case SDRAM_CONF1HB:
case SDRAM_CONF1LL:
Expand Down

0 comments on commit 4f10ed2

Please sign in to comment.