All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Using spi_alloc_slave() from SPL
Date: Thu, 6 Aug 2015 15:33:44 +0200	[thread overview]
Message-ID: <201508061533.44915.marex@denx.de> (raw)
In-Reply-To: <CAOMZO5ChvMsYsFK4wq_RNE5wFFv+HS7VQ6vZhdajvCVdgrDXKg@mail.gmail.com>

On Thursday, August 06, 2015 at 03:25:22 PM, Fabio Estevam wrote:
> Hi,
> 
> I am trying to use spi_flash_probe() inside SPL on a custom mx6 board.
> 
> The idea is to read some parameters from the SPI NOR flash and configure
> the DDR accordingly.
> 
> This is similar to what gw_ventana_spl.c does, but it reads from i2c
> eeprom instead of SPI NOR.
> 
> Here are the changes just to illustrate the problem:

I understand that you need to call spi_flash_probe() in board_init_f()
at which point you still have no malloc() area available, so it fails
with -ENOMEM or something like that, correct ?

What you can probably try is to define CONFIG_SYS_MALLOC_F_LEN and do
the following before doing spi_flash_probe():

static u8 array[128] __aligned(32);

gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
gd->malloc_ptr = array;

This might work, but is nasty.

Best regards,
Marek Vasut

  reply	other threads:[~2015-08-06 13:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 13:25 [U-Boot] Using spi_alloc_slave() from SPL Fabio Estevam
2015-08-06 13:33 ` Marek Vasut [this message]
2015-08-06 13:38 ` Stefano Babic
2015-08-06 14:14   ` Fabio Estevam
2015-08-06 14:28     ` Marek Vasut
2015-08-06 16:44       ` Fabio Estevam
2015-08-06 17:03       ` Stefano Babic
2015-08-06 18:24         ` Fabio Estevam
2015-08-06 19:29           ` Fabio Estevam
2015-08-06 19:31           ` Simon Glass
2015-08-06 22:13             ` Fabio Estevam
2015-08-13 12:37               ` Nikolay Dimitrov
2015-11-10  0:05                 ` Fabio Estevam
2015-11-10 14:41                   ` Fabio Estevam
2015-11-09 23:28               ` Fabio Estevam
2015-08-06 22:22         ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201508061533.44915.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.