From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBKS-0001Hk-6R for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:58:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDBKL-0006EM-E3 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:58:00 -0400 Received: from mail-am1on0138.outbound.protection.outlook.com ([157.56.112.138]:58128 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBKK-0006Dj-Vr for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:57:53 -0400 From: Date: Wed, 15 Jun 2016 15:41:05 +0200 Message-ID: <1465998071-7355-4-git-send-email-marcin.krzeminski@nokia.com> In-Reply-To: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> References: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 3/9] 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 From: Marcin Krzeminski Allow to have more than four 16MiB regions for bigger flash devices. Signed-off-by: Marcin Krzeminski --- 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 /* Numonyx (Micron) Flag Status Register macros */ #define FSR_4BYTE_ADDR_MODE_ENABLED 0x1 @@ -545,7 +544,7 @@ static void complete_collecting_data(Flash *s) } if (get_addr_length(s) == 3) { - s->cur_addr += (s->ear & 0x3) * MAX_3BYTES_SIZE; + s->cur_addr += s->ear * MAX_3BYTES_SIZE; } s->state = STATE_IDLE; @@ -644,7 +643,7 @@ static void reset_memory(Flash *s) s->four_bytes_address_mode = true; } if (!(s->nonvolatile_cfg & NVCFG_LOWER_SEGMENT_MASK)) { - s->ear = CFG_UPPER_128MB_SEG_ENABLED; + s->ear = s->size / MAX_3BYTES_SIZE - 1; } break; default: -- 2.7.4