public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] usb: ehci: mx6: Add support for i.MX6SL
Date: Thu, 19 Jun 2014 15:56:59 +0300	[thread overview]
Message-ID: <53A2DE1B.7080208@compulab.co.il> (raw)
In-Reply-To: <53A07F96.1040806@mail.bg>

Hi Nikolay,

On 06/17/14 20:49, Nikolay Dimitrov wrote:
> Hi Igor,
> 
> On 6/17/2014 9:26 AM, Igor Grinberg wrote:
>> That is exactly what we do already (code is on the way) and IMO what we should aim for.
> I really didn't knew this in the beginning before seeing your answers, this would be definitely easier
> to support.
> 
>> For me it is just an artificial complication which prevents single binary for
>> i.MX6 based boards.
>> Don't get me wrong, I think that in your board code you can choose which
>> approach you want, whether it will be single or multi binary, but this
>> is i.MX6 (and possibly future i.MX*) USB code which can be used on many
>> i.MX6 boards.
> I definitely like the idea, no argument on this.
> 
>> Again, what are we talking about? A couple of bytes? 
> I think it will cost 22 additional bytes per check. Here's a rough example:
> 
> (Code that just assigns the address to the struct pointer -> 10 bytes)
>     p = (mx6_usb_t*)0x55667788;
>     8380:       f247 7388       movw    r3, #30600      ; 0x7788
>     8384:       f2c5 5366       movt    r3, #21862      ; 0x5566
>     8388:       60fb            str     r3, [r7, #12]
> 
> 
> (Code that checks in runtime the CPU type -> 32 bytes)
>     if (is_imx6q())
>     8380:       f7ff ffee       bl      8360 <is_imx6q>
>     8384:       4603            mov     r3, r0
>     8386:       2b00            cmp     r3, #0
>     8388:       d005            beq.n   8396 <main+0x26>
>     {
>         p = (mx6_usb_t*)0x11223344;
>     838a:       f243 3344       movw    r3, #13124      ; 0x3344
>     838e:       f2c1 1322       movt    r3, #4386       ; 0x1122
>     8392:       60fb            str     r3, [r7, #12]
>     8394:       e004            b.n     83a0 <main+0x30>
>     }
>     else
>     {
>         p = (mx6_usb_t*)0x55667788;
>     8396:       f247 7388       movw    r3, #30600      ; 0x7788
>     839a:       f2c5 5366       movt    r3, #21862      ; 0x5566
>     839e:       60fb            str     r3, [r7, #12]
>     }
> 
> If I assume that we have 20 sub-systems in U-Boot, and each needs to check the CPU type
> in 10 places, this makes 4400 bytes difference, which is roughly the size of a moderately
> small driver in U-Boot.

This looks like a very rough estimation.
It also can be improved by various ways.

Anyway, I think that even 4K addition is an acceptable compromise for a
single binary.

> I need to say that I'm in no way expert in ARM assembly, so please
> feel free to point out any mistakes in my assumptions.
> 
> Please don't get me wrong - I don't want to argue at all. I was just wondering about this topic
> and decided to check with you guys just to be sure.

No problem.


-- 
Regards,
Igor.

  reply	other threads:[~2014-06-19 12:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3.1402912801.24865.u-boot@lists.denx.de>
2014-06-16 14:33 ` [U-Boot] [PATCH 1/6] usb: ehci: mx6: Add support for i.MX6SL Nikolay Dimitrov
2014-06-16 14:53   ` Marek Vasut
2014-06-17 16:21     ` Nikolay Dimitrov
2014-06-17 16:36       ` Marek Vasut
2014-06-17  6:26   ` Igor Grinberg
2014-06-17 17:49     ` Nikolay Dimitrov
2014-06-19 12:56       ` Igor Grinberg [this message]
2014-06-16  0:46 Otavio Salvador
2014-06-16  0:49 ` Marek Vasut
2014-06-16  1:11   ` Otavio Salvador
2014-06-16  1:28     ` Marek Vasut
2014-06-16  7:05 ` Igor Grinberg
2014-06-16 11:51   ` Otavio Salvador
2014-06-17 14:56 ` Stefano Babic
2014-06-17 14:58   ` Otavio Salvador

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=53A2DE1B.7080208@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --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