From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 6 Aug 2015 15:33:44 +0200 Subject: [U-Boot] Using spi_alloc_slave() from SPL In-Reply-To: References: Message-ID: <201508061533.44915.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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