x-loader-omap: programs XM Numonyx RAM banks to overlap

Bug #652861 reported by Peter Maydell on 2010-10-01
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
x-loader (Ubuntu)
Medium
Loïc Minier
Maverick
Medium
Loïc Minier

Bug Description

Package: x-loader
Version: 1.4.4git20100713-1ubuntu2

The patch debian/patches/support_micron_and_numonyx_memory.patch adds support for Numonyx RAM. However when it programs the SDRC it sets up the two banks CS0 and CS1 so that they overlap in memory:

                        __raw_writel(0x2, SDRC_CS_CFG); /* 256MB/bank */
                        __raw_writel(SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM, SDRC_MCFG_0);
                        __raw_writel(SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM, SDRC_MCFG_1);

where SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM is 0x04590019 (possibly with some bits in the BANKALLOCATION field also set). In the SDRC_MCFG_p register bits [17:8] specify the RAMSIZE in units of 2MB. So here the value is 0b01_0000_0000 ie 256*2MB == 512MB. So we're saying that CS0 (and CS1) are banks of 512MB of RAM, but we're setting SDRC_CS_CFG to put them just 256MB apart in the address space.

I'm not sure what this does in the hardware, but it definitely causes problems in qemu : https://bugs.launchpad.net/qemu-maemo/+bug/651332

This doesn't happen for the Micron RAM configuration because there the value we write into the MCFG registers is 0x03588019 | B_ALL, which specifies a 256MB RAMSIZE and the separation is correct.

Either the Numonyx RAM is 512MB a bank (in which case the CS_CFG should be set to 4) or it is 256MB a bank like the Micron, in which case the MCFG values should be changed.

Steve Sakoman (steve-sakoman) wrote :

I'm not sure what the source of the patch is that is being used, but you are correct that it is wrong.

Numonyx is 512MB/bank, currently a single bank, but if configured properly the code will work with a future 2 bank 1GB part.

This patch is done properly in my x-load git repo:

http://www.sakoman.com/cgi-bin/gitweb.cgi?p=x-loader.git;a=commitdiff;h=ee120c894c3377054bda149748eb0621f2f843c8

I'm also not sure what "upstream" is being used for x-load, so can't say for certain that the patch in my tree will apply cleanly.

Peter Maydell (pmaydell) wrote :

> I'm not sure what the source of the patch is that is being used

It was applied to fix https://bugs.launchpad.net/ubuntu/+source/x-loader/+bug/628243 which says that the patch is from this git repo:
http://gitorious.org/beagleboard-validation/x-load/commit/ead751e4a361ce19552ac94bbeba232f12849244

> This patch is done properly in my x-load git repo

(I'm sure you've noticed this but just for the record) It avoids this bug but still has the duff Micron detection code noted in 652850.

Loïc Minier (lool) on 2010-10-27
Changed in x-loader (Ubuntu):
assignee: nobody → Loïc Minier (lool)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package x-loader - 1.4.4git20100713-1ubuntu3

---------------
x-loader (1.4.4git20100713-1ubuntu3) natty; urgency=low

  * Replace contents of support_micron_and_numonyx_memory with
    ee120c894c3377054bda149748eb0621f2f843c8 from Steve Sakoman's
    x-loader.git; this only differs in the else clause when not using Micron
    memory in that it sets up the second bank with the correct size; thanks
    Steve Sakoman and Peter Maydell; LP: #652861.
 -- Loic Minier <email address hidden> Wed, 27 Oct 2010 17:55:40 -0400

Changed in x-loader (Ubuntu):
status: New → Fix Released
Loïc Minier (lool) on 2010-10-27
Changed in x-loader (Ubuntu):
importance: Undecided → Medium
Loïc Minier (lool) on 2010-10-27
Changed in x-loader (Ubuntu Maverick):
importance: Undecided → Medium
assignee: nobody → Loïc Minier (lool)
Loïc Minier (lool) wrote :

Uploaded a package to maverick-proposed

Changed in x-loader (Ubuntu Maverick):
status: New → In Progress

Accepted x-loader into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in x-loader (Ubuntu Maverick):
status: In Progress → Fix Committed
tags: added: verification-needed
Peter Maydell (pmaydell) wrote :

I've tested and confirmed that the new package fixes the problem:
 * built a Linaro image according to http://lists.linaro.org/pipermail/linaro-announce/2010-November/000025.html and tested it under qemu's beaglexm model => fails to boot as expected (hwpack has old version of x-loader-omap)
 * downloaded x-loader-omap 1.4.4git20100713-1ubuntu2.1 and manually updated the hwpack tarball to include it instead of the -1ubuntu2 package
 * rebuilt the Linaro image
 * tested image on qemu beaglexm => successfully detects 512MB of RAM and boots to a shell prompt (bug is fixed :-))
 * tested image on real hardware Beagle XM rev A2 => detects 512MB of RAM and boots to a shell prompt (ie no regression on hardware)

Loïc Minier (lool) on 2010-11-11
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package x-loader - 1.4.4git20100713-1ubuntu2.1

---------------
x-loader (1.4.4git20100713-1ubuntu2.1) maverick-proposed; urgency=low

  * Replace contents of support_micron_and_numonyx_memory with
    ee120c894c3377054bda149748eb0621f2f843c8 from Steve Sakoman's
    x-loader.git; this only differs in the else clause when not using Micron
    memory in that it sets up the second bank with the correct size; thanks
    Steve Sakoman and Peter Maydell; LP: #652861.
 -- Loic Minier <email address hidden> Thu, 28 Oct 2010 11:07:14 -0400

Changed in x-loader (Ubuntu Maverick):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers