From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDRQe-0007NU-6I for qemu-devel@nongnu.org; Thu, 16 Jun 2016 03:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDRQa-0006zO-0R for qemu-devel@nongnu.org; Thu, 16 Jun 2016 03:09:27 -0400 Received: from 7.mo3.mail-out.ovh.net ([46.105.57.200]:60650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDRQZ-0006zK-QA for qemu-devel@nongnu.org; Thu, 16 Jun 2016 03:09:23 -0400 Received: from player772.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo3.mail-out.ovh.net (Postfix) with ESMTP id 127AD100024C for ; Thu, 16 Jun 2016 09:09:17 +0200 (CEST) References: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> <1465998071-7355-4-git-send-email-marcin.krzeminski@nokia.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <57625097.6090905@kaod.org> Date: Thu, 16 Jun 2016 09:09:11 +0200 MIME-Version: 1.0 In-Reply-To: <1465998071-7355-4-git-send-email-marcin.krzeminski@nokia.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/9] m25p80: Allow more than four banks. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcin.krzeminski@nokia.com, qemu-devel@nongnu.org Cc: crosthwaitepeter@gmail.com, pawel.lenkow@itlen.com, peter.maydell@linaro.org On 06/15/2016 03:41 PM, marcin.krzeminski@nokia.com wrote: > From: Marcin Krzeminski >=20 > Allow to have more than four 16MiB regions for bigger flash devices. >=20 > Signed-off-by: Marcin Krzeminski Reviewed-by: C=E9dric Le Goater > --- > hw/block/m25p80.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > 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