From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrvnV-0006Gy-Kh for qemu-devel@nongnu.org; Thu, 19 Jul 2012 14:50:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrvnU-0006wt-3T for qemu-devel@nongnu.org; Thu, 19 Jul 2012 14:50:01 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:24516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrvnT-0006wW-TJ for qemu-devel@nongnu.org; Thu, 19 Jul 2012 14:50:00 -0400 Received: from eusync2.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7F00K7V8BZJ400@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 19 Jul 2012 19:50:23 +0100 (BST) Received: from [106.109.9.94] by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0M7F00KCV8B62Y40@eusync2.samsung.com> for qemu-devel@nongnu.org; Thu, 19 Jul 2012 19:49:55 +0100 (BST) Message-id: <500856CF.1080903@samsung.com> Date: Thu, 19 Jul 2012 22:49:51 +0400 From: Igor Mitsyanko MIME-version: 1.0 References: <1342638220-3600-1-git-send-email-402jagan@gmail.com> <1342638220-3600-3-git-send-email-402jagan@gmail.com> In-reply-to: Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] vexpress: Add NOR1 Flash support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: jagan <402jagan@gmail.com> Cc: Peter Crosthwaite , peter.maydell@linaro.org, qemu-devel@nongnu.org On 07/19/2012 01:16 PM, jagan wrote: > Yes, I have used same drive_get(IF_PFLASH, 0, 0) with two flashes. > As these flashes are two different banks with individual bases address, > I used the same. > > Was there any block allocation problem with this..will you please elaborate. > I couldn't understand about drive_get_next(), I think function can > be useful single drive devices SD/MTD. > > Please suggest your comments. > > Regards, > Jagan. > I'm not sure how it was possible for you to successfully test this patch, pflash_cfi01_register() calls bdrv_attach_dev_nofail() which abort()s when you pass an already attached drive to it. > On Thu, Jul 19, 2012 at 5:27 AM, Peter Crosthwaite > > wrote: > > On Thu, Jul 19, 2012 at 5:03 AM, <402jagan@gmail.com > > wrote: > > From: Jagan <402jagan@gmail.com > > > > > This patch adds support for NOR1 flash (Bank #2) on > > vexpress-a9 platform. It is 64MB CFI01 compliant flash. > > > > Tested on stable u-boot version through Linux. > > > > Signed-off-by: Jagan <402jagan@gmail.com > > > --- > > hw/vexpress.c | 10 +++++++++- > > 1 files changed, 9 insertions(+), 1 deletions(-) > > > > diff --git a/hw/vexpress.c b/hw/vexpress.c > > index 2e889a8..b4262ed 100644 > > --- a/hw/vexpress.c > > +++ b/hw/vexpress.c > > @@ -422,7 +422,15 @@ static void vexpress_common_init(const > VEDBoardInfo *daughterboard, > > } > > > > /* VE_NORFLASH0ALIAS: not modelled */ > > - /* VE_NORFLASH1: not modelled */ > > + /* VE_NORFLASH1: */ > > + dinfo = drive_get(IF_PFLASH, 0, 0); > > Both flashes use drive_get(IF_PFLASH, 0, 0). Doesnt this means they > are both going to back to the same file (one -pflash argument) and > share storage? Should this use drive_get_next() and you specify two > -pflash args, one for each device? > > Regards > Peter > > > + if (!pflash_cfi01_register(map[VE_NORFLASH1], NULL, > "vexpress.flash1", > > + VEXPRESS_FLASH_SIZE, dinfo ? dinfo->bdrv : NULL, > > + VEXPRESS_FLASH_SECT_SIZE, > > + VEXPRESS_FLASH_SIZE / VEXPRESS_FLASH_SECT_SIZE, > > + 4, 0x0089, 0x0018, 0x0000, 0x1, 0)) { > > + fprintf(stderr, "qemu: Error registering flash1 memory.\n"); > > + } > > > > sram_size = 0x2000000; > > memory_region_init_ram(sram, "vexpress.sram", sram_size); > > -- > > 1.7.0.4 > > > > > >