ppc440: Avoid reporting error when reading non-existent RAM slot
PATCH 1/1 ppc440: Avoid reporting error when reading non-existent RAM slot
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 <[email protected]>
--- hw/ppc/ppc440_uc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
hw/ppc/ppc440_uc.c +4 -2
@@ -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 :
Signature · 1 line
2.13.7
David Gibson
AppliedQuoted 5 lines · BALATON Zoltan
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 <[email protected]>
Applied, thanks.
Quoted 21 lines
--- hw/ppc/ppc440_uc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/ppc/ppc440_uc.c +4
-2@@ -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 :
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson