This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: flash base mask question


On Wed, 2003-11-12 at 11:07, John Newlin wrote:
> In file:
> 
> /packages/devs/flash/arm/uE250/current/include/uE250_stratflash.inl
> 
> There is a line that says:
> 
> #define CYGNUM_FLASH_BASE_MASK  (0xFC000000u) // 32Mb total
> 
> 
> 
> First question:
> Does Mb stand for Megabit or MegaByte?
> 
> 
> If Megabyte should the number not be?
> ~(1024*1024*32-1) which is: 0xfe00_0000  ( i wish c did underscore in
> numbers like verilog)
> 
> 
> If it is megaBIT then it would it not be:
> ~(32/8*1024*1024) which is:  0xffc0_0000
> 
> 
> Or maybe the mask is per device?  There are 2 of these 32MB devices, which
> would then make a total of 64MB and then the mask would make sense to my
> simple brain.
> 
> 
> If the numbers in the file are indeed correct, can someone please explain
> to me how to derive the mask so that I can put the correct mask for my
> device?
> 

It's MegaBytes and in this particular case, the value doesn't match the
comment :-(

The value should be ~((32*1024*1024)-1) == 0xFE000000.  It's used to 
take an arbitrary FLASH device and divine the device base address from
it.  It should correspond to the size of the largest device [set] which
can be installed.

Note: it's only used by the Intel FLASH device drivers in any case.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]