sam460ex: Don't size flash memory to match backing image
commitf30bc99559306eee9ef363bc11bf63a021aee707
authorMarkus Armbruster <armbru@redhat.com>
Fri, 8 Mar 2019 09:46:01 +0000 (8 10:46 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 11 Mar 2019 21:53:44 +0000 (11 22:53 +0100)
tree8be4bd8887bf4c7248c85d737576bc1ca0b48895
parent81c7db723ebd0c677784a728020c7e8845868daf
sam460ex: Don't size flash memory to match backing image

Machine "sam460ex" maps its flash memory at address 0xFFF00000.  When
no image is supplied, its size is 1MiB (0x100000), and 512KiB of ROM
get mapped on top of its second half.  Else, it's the size of the
image rounded up to the next multiple of 64KiB.

The rounding is actually useless: pflash_cfi01_realize() fails with
"failed to read the initial flash content" unless it's a no-op.

I have no idea what happens when the pflash's size exceeds 1MiB.
Useful outcomes seem unlikely.

I guess memory at the end of the address space remains unmapped when
it's smaller than 1MiB.  Again, useful outcomes seem unlikely.

The physical hardware appears to have 512KiB of flash memory:
https://eu.mouser.com/datasheet/2/268/atmel_AT49BV040B-1180330.pdf

For now, just set the flash memory size to 1MiB regardless of image
size, and document the mess.

Cc: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20190308094610.21210-7-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/ppc/sam460ex.c