From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDrJ8-0005qP-Mq for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:47:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDrJ4-0006V9-HF for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:47:25 -0400 Received: from mail-am1on0131.outbound.protection.outlook.com ([157.56.112.131]:3776 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDrJ4-0006Uv-2a for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:47:22 -0400 From: Date: Fri, 17 Jun 2016 12:28:27 +0200 Message-ID: <1466159314-28597-4-git-send-email-marcin.krzeminski@nokia.com> In-Reply-To: <1466159314-28597-1-git-send-email-marcin.krzeminski@nokia.com> References: <1466159314-28597-1-git-send-email-marcin.krzeminski@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 03/10] m25p80: Allow more than four banks. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: crosthwaitepeter@gmail.com, pawel.lenkow@itlen.com, rfsw-patches@mlist.emea.nsn-intra.net, peter.maydell@linaro.org, clg@fr.ibm.com, clg@kaod.org From: Marcin Krzeminski Allow to have more than four 16MiB regions for bigger flash devices. Signed-off-by: Marcin Krzeminski Reviewed-by: C=C3=A9dric Le Goater --- hw/block/m25p80.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 342f7c9..6910c52 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -129,7 +129,6 @@ typedef struct FlashPartInfo { #define EVCFG_QUAD_IO_ENABLED (1 << 7) #define NVCFG_4BYTE_ADDR_MASK (1 << 0) #define NVCFG_LOWER_SEGMENT_MASK (1 << 1) -#define CFG_UPPER_128MB_SEG_ENABLED 0x3 =20 /* Numonyx (Micron) Flag Status Register macros */ #define FSR_4BYTE_ADDR_MODE_ENABLED 0x1 @@ -545,7 +544,7 @@ static void complete_collecting_data(Flash *s) } =20 if (get_addr_length(s) =3D=3D 3) { - s->cur_addr +=3D (s->ear & 0x3) * MAX_3BYTES_SIZE; + s->cur_addr +=3D s->ear * MAX_3BYTES_SIZE; } =20 s->state =3D STATE_IDLE; @@ -644,7 +643,7 @@ static void reset_memory(Flash *s) s->four_bytes_address_mode =3D true; } if (!(s->nonvolatile_cfg & NVCFG_LOWER_SEGMENT_MASK)) { - s->ear =3D CFG_UPPER_128MB_SEG_ENABLED; + s->ear =3D s->size / MAX_3BYTES_SIZE - 1; } break; default: --=20 2.7.4