All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mitsyanko <i.mitsyanko@samsung.com>
To: jagan <402jagan@gmail.com>
Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com>,
	peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] vexpress: Add NOR1 Flash support
Date: Fri, 20 Jul 2012 18:19:55 +0400	[thread overview]
Message-ID: <5009690B.7080301@samsung.com> (raw)
In-Reply-To: <CALdT2jzvUv=239tRiyX=NLSR8cu1ojTeZK2wdF_GV79UHphvWA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4863 bytes --]

On 07/20/2012 05:30 PM, jagan wrote:
> I think I understand the situation, like when I called 
> pflash_cfi01_register, it verifies BlockDriverState is < 0.
> Was my understanding correct?
>
> If ie so. I think I need to change drive_get(IF_PFLASH, 0, 0)  to 
> drive_get_next(IF_PFLASH) on second flash access by 
> keeping  drive_get(IF_PFLASH, 0, 0
> on first flash, correct?
>
> But I am wondering why it's still detecting 2 Flashes with 128MB when 
> I tested through u-boot.
> Even I was written Linux and Ramdisk on to flashes again read back and 
> able to boot it, Fine.
>
> Please find the attachment for u-boot log.
>
> I haven't tested -pflash argument through ./qemu-system-arm 
> because it again asking about kernel argument, do I need to test this 
> also?

Now I understand why QEMU didn't abort during your test, If you do not 
specify a -pflash argument then there is no backing drive for any of 
flash banks and they just behave as read-only RAM regions, and in that 
case it doesn't matter whether you used drive_get(IF_PFLASH, 0, 0) or 
drive_get_next(IF_PFLASH) or nothing at all. U-boot should detect both 
banks without any problem, but he wouldn't be able to write anything to 
them.
As Peter already said, you need to use drive_get_next(IF_PFLASH) for 
both flash banks initialization, or use drive_get(IF_PFLASH, 0, 0) for 
first and drive_get(IF_PFLASH, 0, 1) for second bank.

>
> Regards,
> Jagan.
>
> On Fri, Jul 20, 2012 at 6:58 AM, Peter Crosthwaite 
> <peter.crosthwaite@petalogix.com 
> <mailto:peter.crosthwaite@petalogix.com>> wrote:
>
>     On Thu, Jul 19, 2012 at 7:16 PM, jagan <402jagan@gmail.com
>     <mailto:402jagan@gmail.com>> 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(),
>
>     s/drive_get(IF_PFLASH, 0, 0) /drive_get_next(IF_PFLASH)/
>
>     This will mean you have two -fplash arguments on qemu cmd line
>     your two flashes.
>
>     qemu-system-arm ... -pflash nor0.bin -pflash nor1.bin
>
>     Currently you back (or attempt to back) both flashes to the same bdrv
>     which means they share storage. The two flashes will corrupt each
>     others data.
>
>     Regards,
>     Peter
>
>      I think function can be useful
>     > single drive devices SD/MTD.
>     >
>     > Please suggest your comments.
>     >
>     > Regards,
>     > Jagan.
>     >
>     > On Thu, Jul 19, 2012 at 5:27 AM, Peter Crosthwaite
>     > <peter.crosthwaite@petalogix.com
>     <mailto:peter.crosthwaite@petalogix.com>> wrote:
>     >>
>     >> On Thu, Jul 19, 2012 at 5:03 AM,  <402jagan@gmail.com
>     <mailto:402jagan@gmail.com>> wrote:
>     >> > From: Jagan <402jagan@gmail.com <mailto: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
>     <mailto: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
>     >> >
>     >> >
>     >
>     >
>
>


[-- Attachment #2: Type: text/html, Size: 8713 bytes --]

  parent reply	other threads:[~2012-07-20 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 19:03 [Qemu-devel] [PATCH 0/2] vexpress-a9: NOR flash support 402jagan
2012-07-18 19:03 ` [Qemu-devel] [PATCH 1/2] vexpress: Add NOR0 Flash support 402jagan
2012-07-20 14:41   ` Peter Maydell
2012-07-20 15:03     ` jagan
2012-07-18 19:03 ` [Qemu-devel] [PATCH 2/2] vexpress: Add NOR1 " 402jagan
2012-07-18 23:57   ` Peter Crosthwaite
2012-07-19  9:16     ` jagan
2012-07-19 18:49       ` Igor Mitsyanko
2012-07-20  1:28       ` Peter Crosthwaite
2012-07-20 13:30         ` jagan
2012-07-20 14:12           ` jagan
2012-07-20 14:19           ` Igor Mitsyanko [this message]
2012-07-20 14:56             ` jagan
2012-07-23  0:51               ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5009690B.7080301@samsung.com \
    --to=i.mitsyanko@samsung.com \
    --cc=402jagan@gmail.com \
    --cc=peter.crosthwaite@petalogix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.