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] [PATCH v1 0/4] arm: socfgpa: support of-platdata
Date: Tue, 8 Jan 2019 14:38:49 +0100	[thread overview]
Message-ID: <46a1b6f4-d237-e984-4e9e-f00eef74abfb@denx.de> (raw)
In-Reply-To: <CAAh8qsxN5czhwGNpHfw+P8w2QyYdH7iAB=NB_KDVyvNuMxkwwA@mail.gmail.com>

On 1/8/19 2:07 PM, Simon Goldschmidt wrote:
> On Tue, Jan 8, 2019 at 1:58 PM Marek Vasut <marex@denx.de> wrote:
>>
>> On 1/8/19 1:38 PM, Simon Goldschmidt wrote:
>>> On Tue, Jan 8, 2019 at 1:06 PM Marek Vasut <marex@denx.de> wrote:
>>>>
>>>> On 1/8/19 7:56 AM, Simon Goldschmidt wrote:
>>>>> On Mon, Jan 7, 2019 at 11:59 PM Marek Vasut <marex@denx.de> wrote:
>>>>>>
>>>>>> On 1/7/19 10:14 PM, Simon Goldschmidt wrote:
>>>>>>> This is an initial attempt to support OF_PLATDATA for socfpga gen5.
>>>>>>>
>>>>>>> There are two motivations for this:
>>>>>>> a) reduce code size to eventually support secure boot (where SPL has to
>>>>>>>    authenticate the next stage by loading/checking U-Boot from a FIT
>>>>>>>    image)
>>>>>>> b) to support the cyclone 5 boot ROM's CRC check on the SPL in SRAM
>>>>>>>    (on warm-restart), all bytes to check need to be in one piece. With
>>>>>>>    OF_SEPARATE, this is not the case (.bss is between .rodata and the
>>>>>>>    DTB). Since OF_EMBEDDED has been discouraged, OF_PLATDATA seems to
>>>>>>>    be a good solution.
>>>>>>
>>>>>> I'd much prefer parsing the DT (and thus, decoupling the SW from HW)
>>>>>> than having some ad-hoc plat data again if we can avoid that.
>>>>>
>>>>> So you're against the whole OF_PLATDATA thing or how should I understand
>>>>> that?
>>>>
>>>> If we can avoid it, I'd prefer to do so.
>>>>
>>>>> It's not really ad-hoc, it's the DT converted to C structs. It's just in another
>>>>> format, but it's still (sort of) decoupled SW from HW.
>>>>>
>>>>> As written above, I have two goals I want to achieve with this. Right now, I
>>>>> cannot enable verified boot in SPL because the available OCRAM cannot
>>>>> hold all the code. And it seemed to me OF_PLATDATA could help me there.
>>>>
>>>> Well this might be a long shot, but I discussed this lack of OCRAM
>>>> during 35C3 and there was a suggestion to lock L2 cache lines above ROM
>>>> (so there's some backing store) and use that as extra SRAM. Would that
>>>> help you ?
>>>
>>> I would have joined that discussion if my Family would have let me go during the
>>> holidays :-))
>>>
>>> This is an interesing idea, but actually it's a lack of code/rodata
>>> size. The Intel
>>> docs clearly state that the binary SPL loaded from SPI/MMC must be 60 KiB at
>>> max. I have not checked the code size increase I would get when enabling trusted
>>> boot (SPL loading U-Boot from FIT and verifying it with a public key),
>>> but I'm currently
>>> at ~45 KiB for .text, .rodata and DTB and only 40 bytes for BSS. I'm
>>> booting from SPI.
>>> When booting from MMC, the code is about ~4 KiB smaller but BSS grows to ~600
>>> Bytes.
>>
>> I wonder if there are some huge chunks of code which could be optimized?
>>
>>> Of course the stack and initial malloc area do need some bytes too, but I think
>>> summed up, bss, stack and malloc should probably fit into 4 KiB, so I
>>> currently have
>>> about 15 KiB to add FIT loading and public key verification/hashing. I
>>> don't think that's
>>> enough just from the code size.
>>>
>>> And on socfpga, I think all added code would use the heap, which is
>>> changed to SDRAM
>>> very early, so it's not the RAM that is tight.
>>
>> Can you check readelf and see how the function size looks ? Maybe
>> there's something which is just too big ?
> 
> I'm looking at the map file all the time ;-) The only thing that looks
> too big is
> SDRAM initialization, which is about 16 KiB overall, I think. The rest
> just seems
> to be smaller parts. But the binary blob u32 arrays created by Quartus don't
> help, either: rodata is about 9 KiB.

Can that be somehow optimized ? The ideal approach would be to move it
somehow to DT.

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2019-01-08 13:38 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 21:14 [U-Boot] [PATCH v1 0/4] arm: socfgpa: support of-platdata Simon Goldschmidt
2019-01-07 21:14 ` [U-Boot] [PATCH v1 1/4] arm: socfpga: imply SPL config instead of select Simon Goldschmidt
2019-01-07 22:53   ` Marek Vasut
2019-01-08  6:24     ` Simon Goldschmidt
2019-01-08 11:22       ` Marek Vasut
2019-01-08 12:09         ` Simon Goldschmidt
2019-01-08 12:22           ` Marek Vasut
2019-01-08 12:46             ` Simon Goldschmidt
2019-01-08 12:49               ` Marek Vasut
2019-01-08 14:48                 ` Tom Rini
2019-01-08 14:50                   ` Marek Vasut
2019-01-08 14:58                     ` Tom Rini
2019-01-08 15:04                       ` Simon Goldschmidt
2019-01-08 15:11                         ` Tom Rini
2019-01-08 15:05                       ` Marek Vasut
2019-01-08 15:01                     ` Simon Goldschmidt
2019-01-08 20:52                       ` Simon Goldschmidt
2019-01-08 20:54                         ` Marek Vasut
2019-01-11 20:39     ` Simon Goldschmidt
2019-01-11 22:02       ` Marek Vasut
2019-01-14 15:50         ` Simon Goldschmidt
2019-01-14 15:58           ` Dinh Nguyen
2019-01-14 16:05             ` Simon Goldschmidt
2019-01-14 18:31               ` Marek Vasut
2019-01-14 18:58                 ` Simon Goldschmidt
2019-01-14 19:33                   ` Marek Vasut
2019-01-14 19:43                     ` Simon Goldschmidt
2019-01-14 20:01                       ` Marek Vasut
2019-01-14 20:12                         ` Simon Goldschmidt
2019-01-14 20:23                           ` Marek Vasut
2019-01-14 20:30                             ` Simon Goldschmidt
2019-01-14 20:49                               ` Marek Vasut
2019-01-14 20:59                                 ` Simon Goldschmidt
2019-01-14 21:28                 ` Tom Rini
2019-01-14 21:30                   ` Marek Vasut
2019-01-14 21:35                     ` Simon Goldschmidt
2019-01-14 21:50                     ` Tom Rini
2019-01-14 21:53                       ` Simon Goldschmidt
2019-01-14 21:57                         ` Marek Vasut
2019-01-14 22:26               ` Dinh Nguyen
2019-01-15  6:59                 ` Simon Goldschmidt
2019-01-07 21:14 ` [U-Boot] [PATCH v1 2/4] arm: socfpga: fix compiling with OF_PLATDATA Simon Goldschmidt
2019-01-07 22:53   ` Marek Vasut
2019-01-08  6:32     ` Simon Goldschmidt
2019-01-08 11:46       ` Marek Vasut
2019-01-08 12:14         ` Simon Goldschmidt
2019-01-08 12:23           ` Marek Vasut
2019-01-07 21:14 ` [U-Boot] [PATCH v1 3/4] serial: add an of-platdata driver for "snps, dw-apb-uart" Simon Goldschmidt
2019-01-07 22:12   ` Lukasz Majewski
2019-01-08  6:06     ` Simon Goldschmidt
2019-01-08  7:30       ` Lukasz Majewski
2019-01-08  7:41         ` Simon Goldschmidt
2019-01-08  8:49           ` Lukasz Majewski
2019-01-09  8:35   ` Alexey Brodkin
2019-01-09 11:33     ` Simon Goldschmidt
2019-01-09 18:43     ` Simon Goldschmidt
2019-01-11  8:33       ` Alexey Brodkin
2019-01-11  8:41         ` Simon Goldschmidt
2019-01-11  9:03           ` Alexey Brodkin
2019-01-11 10:00             ` Simon Goldschmidt
2019-01-11  9:22     ` Andy Shevchenko
2019-01-11 10:01       ` Simon Goldschmidt
2019-01-16 21:35         ` Simon Glass
2019-01-10 12:56   ` Simon Glass
2019-01-07 21:14 ` [U-Boot] [PATCH v1 4/4] mmc: socfpga: support of-platdata Simon Goldschmidt
2019-01-07 21:59 ` [U-Boot] [PATCH v1 0/4] arm: socfgpa: " Lukasz Majewski
2019-01-08  6:53   ` Simon Goldschmidt
2019-01-07 22:57 ` Marek Vasut
2019-01-08  6:56   ` Simon Goldschmidt
2019-01-08 11:49     ` Marek Vasut
2019-01-08 12:38       ` Simon Goldschmidt
2019-01-08 12:57         ` Marek Vasut
2019-01-08 13:07           ` Simon Goldschmidt
2019-01-08 13:38             ` Marek Vasut [this message]
2019-01-08 13:51               ` Simon Goldschmidt
2019-01-08 14:43                 ` Marek Vasut
2019-02-01 18:58                   ` Simon Goldschmidt

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=46a1b6f4-d237-e984-4e9e-f00eef74abfb@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.