public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Using spi_alloc_slave() from SPL
Date: Thu, 06 Aug 2015 19:03:24 +0200	[thread overview]
Message-ID: <55C3935C.8020305@denx.de> (raw)
In-Reply-To: <201508061628.38401.marex@denx.de>

Hi Marek,

On 06/08/2015 16:28, Marek Vasut wrote:
> On Thursday, August 06, 2015 at 04:14:34 PM, Fabio Estevam wrote:
>> Hi Stefano and Marek,
>>
>> Thanks for the suggestions.
>>
>> On Thu, Aug 6, 2015 at 10:38 AM, Stefano Babic <sbabic@denx.de> wrote:
>>> There is the possibility to set a malloc area inside SPL:
>>>
>>> CONFIG_SYS_SPL_MALLOC_START
>>> CONFIG_SYS_SPL_MALLOC_SIZE
>>> you do not need a lot of space, and you can try to put it inside the
>>> IRAM.
>>>
>>> This should guarantee that spi_alloc_slave() works.
>>
>> So I tried moving them to the internal RAM:
>>
>> --- a/include/configs/imx6_spl.h
>> +++ b/include/configs/imx6_spl.h
>> @@ -70,8 +70,8 @@
>>  #else
>>  #define CONFIG_SPL_BSS_START_ADDR      0x18200000
>>  #define CONFIG_SPL_BSS_MAX_SIZE                0x100000        /* 1 MB */
>> -#define CONFIG_SYS_SPL_MALLOC_START    0x18300000
>> -#define CONFIG_SYS_SPL_MALLOC_SIZE     0x3200000       /* 50 MB */
>> +#define CONFIG_SYS_SPL_MALLOC_START    0x900000
>> +#define CONFIG_SYS_SPL_MALLOC_SIZE     0x8000
>>  #define CONFIG_SYS_TEXT_BASE           0x17800000
>>  #endif
>>  #endif
>>
>> but still getting spi_alloc_slave() to fail.
> 
> You want to avoid this "CONFIG_SYS_SPL_MALLOC_*" stuff, as it increases the
> SPL size by 3kiB compared to MALLOC_F . Also, MALLOC_F needs just the base
> address of the malloc area to work (see my email).

It does not matter at the moment, because Fabio's issue is not yet
solved. But is it not CONFIG_SYS_SPL_MALLOC the preferred way for SPL ?
Setting the array with MALLOC_F looks like a hack. And
CONFIG_SYS_SPL_MALLOC is *already* set for i.MX6, lool at
include/configs/imx6_spl.h:

#define CONFIG_SYS_SPL_MALLOC_START     0x18300000
#define CONFIG_SYS_SPL_MALLOC_SIZE      0x3200000       /* 50 MB */

This is in RAM, of course. Increasing the size by 3KiB is not IMHO for
i.MX6 a problem, there is enough space in IRAM. But what is surprising
is that Fabio gets a Null pointer by malloc().

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  parent reply	other threads:[~2015-08-06 17:03 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
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 [this message]
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=55C3935C.8020305@denx.de \
    --to=sbabic@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox