mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Dynamic RAM configuration on iMX6 board
@ 2018-05-04  7:57 Albert, Elmar
  2018-05-04  8:17 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Albert, Elmar @ 2018-05-04  7:57 UTC (permalink / raw)
  To: barebox

Hello everybody,

I'm working on a board using iMX6. There are variants of the board
differing in iMX6S/DL/D/Q and the size of the memory on CS0. The
iMX6S/DL/D variants are using 32bit interface to two DDR3 devices (e.g.
1GByte), the iMX6Q variant is using 64bit interface to four DDR3 devices
(e.g. 2GByte). This is leading in at least two different .imxcfg files
for DRAM-controller initialization.
The DRAM Density and the number of mounted DDR3 devices can be read from
the board via GPIO-pins.

To prevent multiple barebox-images and so multiple pre-programmed
SPI-Flashes on stock in the factory, I'm looking for a solution to
configure the DRAM-Controller dynamically during barebox boot.

Is it possible to have more than one .imxcfg files in one image and if
so, how can it be selected to configure the DRAM controller depending on
board-info read from GPIO-pins?

--

Mit freundlichen Grüßen / Best Regards

Elmar Albert
Embedded R&D

DATA MODUL AG
Landsberger Str. 322
80687 Munich
Germany

Tel: +49 89 56017 197
Fax: +49 89 56017 345

Mail to:  ealbert@data-modul.com
Internet: http://www.data-modul.com


Vertrauliche E-Mail von / Confidential e-mail from: DATA MODUL AG
Vorstand / CEO: Dr. Florian Pesahl
Vorsitzende des Aufsichtsrates / Chairwoman of the Supervisory Board: Kristin D. Russell
Sitz der Gesellschaft / Registered Office: München
Registergericht / Registration Court: München Handelsregister B 85 591



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Dynamic RAM configuration on iMX6 board
  2018-05-04  7:57 Dynamic RAM configuration on iMX6 board Albert, Elmar
@ 2018-05-04  8:17 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2018-05-04  8:17 UTC (permalink / raw)
  To: Albert, Elmar; +Cc: barebox

Hi Elmar,

On Fri, May 04, 2018 at 07:57:03AM +0000, Albert, Elmar wrote:
> Hello everybody,
> 
> I'm working on a board using iMX6. There are variants of the board
> differing in iMX6S/DL/D/Q and the size of the memory on CS0. The
> iMX6S/DL/D variants are using 32bit interface to two DDR3 devices (e.g.
> 1GByte), the iMX6Q variant is using 64bit interface to four DDR3 devices
> (e.g. 2GByte). This is leading in at least two different .imxcfg files
> for DRAM-controller initialization.
> The DRAM Density and the number of mounted DDR3 devices can be read from
> the board via GPIO-pins.
> 
> To prevent multiple barebox-images and so multiple pre-programmed
> SPI-Flashes on stock in the factory, I'm looking for a solution to
> configure the DRAM-Controller dynamically during barebox boot.
> 
> Is it possible to have more than one .imxcfg files in one image and if
> so, how can it be selected to configure the DRAM controller depending on
> board-info read from GPIO-pins?

It's not possible to have multiple .imxcfg in one image.

It is however possible to create a barebox with for multiple boards with
different SDRAM setups. Unfortunately it is rather complicated to get
there. First you need a .imxcfg file which doesn't setup the SDRAM and
which loads (the initial part of) the image to the i.MX6 internal SRAM.
In your entry function you must first decide what hardware you are on.
You must be able to get that information during runtime (Some GPIO or
so?). Once you know which machine you are on setup the SDRAM
accordingly. You can do that by either poking a your former .imxcfg
file into the registers or by using mx6dq_dram_iocfg() and friends. Once
your SDRAM is configured use one of the xload functions to load the
whole image into SDRAM. For SPI NOR that would be
imx6_spi_start_image(). Note that the whole image will be started again,
so you need to detect whether you are running from internal SRAM (in
which case you setup SDRAM) or if you are running from SDRAM already (in
which case you call imx6q_barebox_entry()).
Note that you also need a slightly adjusted entry in
images/Makefile.imx to make sure that the ROM only loads the initial
portion of the image to SRAM.

For an example see the wandboard which does exactly this. It's in
arch/arm/boards/technexion-wandboard/

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2018-05-04  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-04  7:57 Dynamic RAM configuration on iMX6 board Albert, Elmar
2018-05-04  8:17 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox