All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Question about cfi flash driver can not work well in cacheable region !
@ 2019-06-03  9:27 Rick Chen
  2019-06-03 13:05 ` Stefan Roese
  0 siblings, 1 reply; 3+ messages in thread
From: Rick Chen @ 2019-06-03  9:27 UTC (permalink / raw
  To: u-boot

Hi Stefan and other seniors

I encounter some problems about cfi flash driver.
And hope you can give some comments to resolve it.
Followings are the flash verification status and descriptions :

When I verify cfi flash which it's address base is in cacheable region
(0x88000000) and cache is enabled in system.
The flash detection, write and erase action will be failure somehow.
The failure messages will be as below:

#################
# Detection failure #
#################
Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
0 Bytes

###########
# Erase fail #
###########
protect off all; erase 0x88000000 0x8bffffff;
Error: start and/or end address not on sector boundary
RISC-V #

###########
# Write fail #
###########
RISC-V # cp.b 0x20000000 0x8bf00000 0x1444
RISC-V #

But when I disable cache in system, they will all pass the verification.

################
# Detection pass #
################
Flash: 64 MiB

#############
# erase pass #
#############
protect off all; erase 0x88000000 0x8bffffff;
Un-Protect Flash Bank # 1

................................................
................................................
................................................
................................................
................................................
................................................
................................................
................................................
................................................
................................................
................................ done
Erased 512 sectors
RISC-V #

##############
# write pass #
##############
RISC-V # cp.b 0x20000000 0x8bf00000 0x1444
Copy to Flash... done
RISC-V #

How can I enable cache and let cfi flash can work fine to get better
performance ?

Do you have any comments ?

Thanks
Rick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] Question about cfi flash driver can not work well in cacheable region !
  2019-06-03  9:27 [U-Boot] Question about cfi flash driver can not work well in cacheable region ! Rick Chen
@ 2019-06-03 13:05 ` Stefan Roese
  2019-06-04  1:21   ` Rick Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Roese @ 2019-06-03 13:05 UTC (permalink / raw
  To: u-boot

Hi Rick,

On 03.06.19 11:27, Rick Chen wrote:
> Hi Stefan and other seniors
> 
> I encounter some problems about cfi flash driver.
> And hope you can give some comments to resolve it.
> Followings are the flash verification status and descriptions :
> 
> When I verify cfi flash which it's address base is in cacheable region
> (0x88000000) and cache is enabled in system.
> The flash detection, write and erase action will be failure somehow.
> The failure messages will be as below:
> 
> #################
> # Detection failure #
> #################
> Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
> 0 Bytes
> 
> ###########
> # Erase fail #
> ###########
> protect off all; erase 0x88000000 0x8bffffff;
> Error: start and/or end address not on sector boundary
> RISC-V #
> 
> ###########
> # Write fail #
> ###########
> RISC-V # cp.b 0x20000000 0x8bf00000 0x1444
> RISC-V #
> 
> But when I disable cache in system, they will all pass the verification.
> 
> ################
> # Detection pass #
> ################
> Flash: 64 MiB
> 
> #############
> # erase pass #
> #############
> protect off all; erase 0x88000000 0x8bffffff;
> Un-Protect Flash Bank # 1
> 
> ................................................
> ................................................
> ................................................
> ................................................
> ................................................
> ................................................
> ................................................
> ................................................
> ................................................
> ................................................
> ................................ done
> Erased 512 sectors
> RISC-V #
> 
> ##############
> # write pass #
> ##############
> RISC-V # cp.b 0x20000000 0x8bf00000 0x1444
> Copy to Flash... done
> RISC-V #
> 
> How can I enable cache and let cfi flash can work fine to get better
> performance ?

The CFI driver expects the flash to be located on a uncached area.
Is it possible on your architecture to map some areas uncached
and others cached? That's how it was done in the old PowerPC days,
when parallel flash (via CFI) was still used much more frequently.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] Question about cfi flash driver can not work well in cacheable region !
  2019-06-03 13:05 ` Stefan Roese
@ 2019-06-04  1:21   ` Rick Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Rick Chen @ 2019-06-04  1:21 UTC (permalink / raw
  To: u-boot

Hi Stefan

Stefan Roese <sr@denx.de> 於 2019年6月3日 週一 下午9:05寫道:
>
> Hi Rick,
>
> On 03.06.19 11:27, Rick Chen wrote:
> > Hi Stefan and other seniors
> >
> > I encounter some problems about cfi flash driver.
> > And hope you can give some comments to resolve it.
> > Followings are the flash verification status and descriptions :
> >
> > When I verify cfi flash which it's address base is in cacheable region
> > (0x88000000) and cache is enabled in system.
> > The flash detection, write and erase action will be failure somehow.
> > The failure messages will be as below:
> >
> > #################
> > # Detection failure #
> > #################
> > Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
> > 0 Bytes
> >
> > ###########
> > # Erase fail #
> > ###########
> > protect off all; erase 0x88000000 0x8bffffff;
> > Error: start and/or end address not on sector boundary
> > RISC-V #
> >
> > ###########
> > # Write fail #
> > ###########
> > RISC-V # cp.b 0x20000000 0x8bf00000 0x1444
> > RISC-V #
> >
> > But when I disable cache in system, they will all pass the verification.
> >
> > ################
> > # Detection pass #
> > ################
> > Flash: 64 MiB
> >
> > #############
> > # erase pass #
> > #############
> > protect off all; erase 0x88000000 0x8bffffff;
> > Un-Protect Flash Bank # 1
> >
> > ................................................
> > ................................................
> > ................................................
> > ................................................
> > ................................................
> > ................................................
> > ................................................
> > ................................................
> > ................................................
> > ................................................
> > ................................ done
> > Erased 512 sectors
> > RISC-V #
> >
> > ##############
> > # write pass #
> > ##############
> > RISC-V # cp.b 0x20000000 0x8bf00000 0x1444
> > Copy to Flash... done
> > RISC-V #
> >
> > How can I enable cache and let cfi flash can work fine to get better
> > performance ?
>
> The CFI driver expects the flash to be located on a uncached area.
> Is it possible on your architecture to map some areas uncached

Yes.
We have configuresd the flash address base in the uncached area in
another platform before.
And it would not be affected by enabling cache.

> and others cached? That's how it was done in the old PowerPC days,
> when parallel flash (via CFI) was still used much more frequently.
>

Now I know it much more.
Thanks for sharing the useful advice.

B.R
Rick

> Thanks,
> Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-04  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-03  9:27 [U-Boot] Question about cfi flash driver can not work well in cacheable region ! Rick Chen
2019-06-03 13:05 ` Stefan Roese
2019-06-04  1:21   ` Rick Chen

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.