EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

How to find memory data width (x16 or x32?)

Started by Bhavik May 12, 2010
Hello,

I am working on an embedded device in which I need to configure LPDDR
memory.
Since LPDDR does not always support SRR (status register read)
function, I need to find the data width of the memory manually, and
configure the system memory controller accordingly.

Can someone suggest a way to find this?

Thanks for help in advance.
> Since LPDDR does not always support SRR (status register read) > function, I need to find the data width of the memory manually, and > configure the system memory controller accordingly.
Configure it for 32 bits. Do a test write of 0xaaaabbbb. Look at the first 4 bytes, if they're not aaaabbbb then it's not 32 bits wide.
> Configure it for 32 bits. Do a test write of 0xaaaabbbb. Look at the > first 4 bytes, if they're not aaaabbbb then it's not 32 bits wide.
I am sorry, I did not give proper informatio in my mail. I have already tried this, but what happens is that the data gets written even thogh it is 16bits wide. The memory controller seems to perform 2 writes of 16 bits. Anyway, I need to figure out how many Rows and Column lines should be used to address the memory, and this configuration depends on whether memory is 16 bits or 32 bits wide, and also on the size of the memory (as per JEDEC standard for LPDDR). Please take this information also into account. Thanks.
Please elaborate about the problem.

You say that "the memory controller seems to perform 2 writes of 16
bits".  However you also say that you're the one to "configure the
system memory controller".

Can't you just configure it for 32 bit access, and then do the
suggested 0xaaaabbbb test in 32 bit mode, and then configure the
controller AGAIN according to the test result?

Or, if it comes (magically) preconfigured, can't you just read the
configuration registers and thus know what type of memory is currently
configured?

Marc
On May 13, 6:46=A0am, Marc Jet <jetm...@hotmail.com> wrote:

> You say that "the memory controller seems to perform 2 writes of 16 > bits". =A0However you also say that you're the one to "configure the
I kind of gave up after reading the OP's second response. If the memory controller is splitting one 32-bit access into two 16-bit accesses, then either it's configured for 16 bit mode or it's broken.
On 5/12/2010 8:42 AM, Bhavik wrote:
> Hello, > > I am working on an embedded device in which I need to configure LPDDR > memory. > Since LPDDR does not always support SRR (status register read) > function, I need to find the data width of the memory manually, and > configure the system memory controller accordingly. > > Can someone suggest a way to find this? > > Thanks for help in advance.
Wait, what kind of embedded device don't you already know what the data width of the memory is? Don't you have a line item on a BOM somewhere that tells you everything you need to know about the RAM? -- Rob Gaddi, Highland Technology Email address is currently out of order
Marc Jet wrote:
> Please elaborate about the problem. > > You say that "the memory controller seems to perform 2 writes of 16 > bits". However you also say that you're the one to "configure the > system memory controller". > > Can't you just configure it for 32 bit access, and then do the
-----------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ That's the key. *EXPLICITLY* set it to 32b wide. Probe the memory (taking care to understand how a "floating bus" will be read!!) and determine if it is, in fact, 32b wide. If not, configure for 16b. I suspect the OP's problem is the controller defaults to 16b mode. So, the 32b write gets broken into two contiguous 16b writes. Regardless of the actual RAM installed, both of these writes will succeed -- and read back properly. BECAUSE THERE IS ALWAYS AT LEAST 16b WIDE MEMORY PRESENT! The OP needs to *deliberately* force the controller to operate in 32b mode *before* making his first probe...
> suggested 0xaaaabbbb test in 32 bit mode, and then configure the > controller AGAIN according to the test result? > > Or, if it comes (magically) preconfigured, can't you just read the > configuration registers and thus know what type of memory is currently > configured?
Hi Rob,

Rob Gaddi wrote:

> Wait, what kind of embedded device don't you already know what the data > width of the memory is? Don't you have a line item on a BOM somewhere > that tells you everything you need to know about the RAM?
<grin> I often design flexible memory configurations in products and probe for "what's available" during bootstrap. I had one design that supported single *bit* increments in memory widths! :>
On May 13, 11:39=A0am, Rob Gaddi <rga...@technologyhighland.com> wrote:
> On 5/12/2010 8:42 AM, Bhavik wrote: > > > Hello, > > > I am working on an embedded device in which I need to configure LPDDR > > memory. > > Since LPDDR does not always support SRR (status register read) > > function, I need to find the data width of the memory manually, and > > configure the system memory controller accordingly. > > > Can someone suggest a way to find this? > > > Thanks for help in advance. > > Wait, what kind of embedded device don't you already know what the data > width of the memory is? =A0Don't you have a line item on a BOM somewhere > that tells you everything you need to know about the RAM?
Maybe the guy writing the software doesn't know who is buying the hardware next year? Rick
On May 13, 11:40=A0pm, rickman <gnu...@gmail.com> wrote:
> On May 13, 11:39=A0am, Rob Gaddi <rga...@technologyhighland.com> wrote: > > > > > On 5/12/2010 8:42 AM, Bhavik wrote: > > > > Hello, > > > > I am working on an embedded device in which I need to configure LPDDR > > > memory. > > > Since LPDDR does not always support SRR (status register read) > > > function, I need to find the data width of the memory manually, and > > > configure the system memory controller accordingly. > > > > Can someone suggest a way to find this? > > > > Thanks for help in advance. > > > Wait, what kind of embedded device don't you already know what the data > > width of the memory is? =A0Don't you have a line item on a BOM somewher=
e
> > that tells you everything you need to know about the RAM? > > Maybe the guy writing the software doesn't know who is buying the > hardware next year? > > Rick
Lot of replies!! The reason why I want to know about data width of the memory is because I need to setup number of Rows and Columns in the memory controller. And these settings depend on the data width of the memory. It can still work if I setup a bigger value of rows and columns, but It would create memory aliasing problem (or feature!), which I want to avoid. And I want to write a generic code which can be used for different memory sizes and data widths, since my code is going to run on the same platform with different memory configurations. I already have devices with different memory configuration on different chip selects, and there might be more such devices. FYI, I am writing code for Qualcomm qsd8250 platform.

The 2024 Embedded Online Conference