All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 05/10] dfu: Only perform DFU board_usb_init() for TRATS
Date: Thu, 29 Nov 2012 20:57:07 -0500	[thread overview]
Message-ID: <50B81273.4040009@ti.com> (raw)
In-Reply-To: <20121130001402.3ffc49a3@jawa>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/29/12 18:14, Lukasz Majewski wrote:
> Hi Tom,
> 
> On 11/28/12 11:08, Lukasz Majewski wrote:
>>>> Hi Tom,
>>>> 
>>>> On 11/28/12 09:47, Lukasz Majewski wrote:
>>>>>>> Hi Pantelis,
>>>>>>> 
>>>>>>>> USB initialization shouldn't happen for all the 
>>>>>>>> boards.
>>>>>>>> 
>>>>>>> 
>>>>>>> The board_usb_init() follows u-boot policy, that SoC 
>>>>>>> IPs (USB) are enabled and configured just before their
>>>>>>>  usage.
>>>>>>> 
>>>>>>> 
>>>>>>>> Signed-off-by: Pantelis Antoniou 
>>>>>>>> <panto@antoniou-consulting.com> --- common/cmd_dfu.c
>>>>>>>>  | 3 +++ 1 file changed, 3 insertions(+)
>>>>>>>> 
>>>>>>>> diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c 
>>>>>>>> index 01d6b3a..327c738 100644 --- a/common/cmd_dfu.c
>>>>>>>>  +++ b/common/cmd_dfu.c @@ -55,7 +55,10 @@ static
>>>>>>>> int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char
>>>>>>>> * const argv[]) goto done; }
>>>>>>>> 
>>>>>>>> +#ifdef CONFIG_TRATS board_usb_init(); +#endif +
>>>>>>> In mine opinion this #ifdef shall be removed and each 
>>>>>>> target board using the DFU shall define 
>>>>>>> board_usb_init() at board file.
>>>>>>> 
>>>>> 
>>>>> But this isn't a called-only-once place.  What are you 
>>>>> really doing here and are you sure it's needed every time 
>>>>> DFU is called?
>>>>> 
>>>> 
>>>> Hmm, you are correct here.
>>>> 
>>>> But I don't have a good alternative for this.
>>>> 
>>>> One solution would be to define a static flag for it at 
>>>> do_dfu function to indicate if this was executed once 
>>>> (however I'm reluctant do this).
>>>> 
>>>> 
>>>> Any ideas?
> 
> I think the answer, and it's what we do on am335x is that 
> arch_misc_init() is what calls the equiv of s3c_udc_probe(...) 
> under the logic of "if we are built with usb gadget support, we 
> want to use it, so init it".
> 
>> I've understood the policy differently:
> 
>> "We are build with gadget support and we _might_ use it, so 
>> enable low level code only when (or just before) we use it".
> 
>> What's about the power consumption? Why IP block which will be 
>> used from time to time shall be enabled and operational?

Frankly, I think this shows we don't have a good setup right now, in
general.  Saying the gadget needs to whack and re-whack the device
into on state (but isn't really turning it off once done) isn't ideal.
 There are also indeed drawbacks to saying "gadget support enabled at
boot-time, let me set it up".  Right now, I don't really have a good
answer.  It also needs to cover things like gadget ethernet where we
don't really want to disappear immediately after each command.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQuBJzAAoJENk4IS6UOR1WWncP/29E2kP1ErctSmBPUkJZASEk
qmW+rYCwxpz3aesC6Dcnc0Urad+MwO9SPbzUFfQcB4CMVXXAXMcahH+4FY8FzTnV
p8QqQjZ0o54xYxEI/evkaEWsTyM3nBBXtMq9II2gwYPMxP88i2JwL1NMOF6o2z+Y
VVNyGO1685JIGU+WMzpoXp4WYjfd/8qv8JHhQ+moGoFe0p7p5c5kokYsbXdcxvyk
rkeJrog8SV+vJQLnu0nUh8Q/pBYftiMDD+U8upQOiYNF1CPgGugX33XJydtYMoA8
rv6an/xh4PXUSJkAJbwp8vrxQqrHD0MYWtZEPwTEToFmTxvvaS2zJ0uOnNLkjanv
dp8RrD38HIczsgMtAVXR9nhFsW89MB2EiXc7N/EoO0BA4E0pac1/+OUfUMwELj16
IKJIHa4BXkHfg/ybQXCxr+GDZEc8YwLGXxzyIw8cS3PffNSkR1fkJcjZwFg190y0
1IjmlF0Dhg0CGweej0WTFuzi3OmHQOvMJcvT0doiI35iVbFvGwhjNUt8dJeDr0Yr
xkhWPhR3+iMXmzle+me+ZUxUe5g2vGqPC6HeGUO/fo0ntqZfITjzznMHKpN8Uxwv
D6Njg2e785ZIgTxcMXKn/Q2xtPBF78/stWeStyIwIAxYOEDw/C+NipWAHEpJdGTp
k8mhP+GKWgatyZ5yqDBA
=01FA
-----END PGP SIGNATURE-----

  reply	other threads:[~2012-11-30  1:57 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29  7:33 [U-Boot] [PATCH 00/10] USB: Gadget & DFU related fixes Pantelis Antoniou
2012-11-29  6:32 ` Marek Vasut
2012-11-29  8:05   ` Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 01/10] usb: Remove obsolete header file Pantelis Antoniou
2012-11-28 14:40   ` Lukasz Majewski
2012-11-28 15:42     ` Tom Rini
2012-11-28 15:45       ` Lukasz Majewski
2012-11-28 16:01     ` Lukasz Majewski
2012-11-28 17:13       ` Pantelis Antoniou
2012-11-28 17:46         ` Lukasz Majewski
2012-11-28 17:54           ` Pantelis Antoniou
2012-11-29  8:13             ` Lukasz Majewski
2012-11-29  8:19               ` Pantelis Antoniou
2012-11-29  8:07           ` Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 02/10] usb: Fix bug when both DFU & ETHER are defined Pantelis Antoniou
2012-11-29  8:19   ` Marek Vasut
2012-11-29  7:33 ` [U-Boot] [PATCH 03/10] g_dnl: Issue connect/disconnect as appropriate Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 04/10] g_dnl: Properly terminate string list Pantelis Antoniou
2012-11-28 15:20   ` Lukasz Majewski
2012-11-29  8:20   ` Marek Vasut
2012-11-29 13:22     ` Pantelis Antoniou
2012-11-29 14:28       ` Marek Vasut
2012-11-29  7:33 ` [U-Boot] [PATCH 05/10] dfu: Only perform DFU board_usb_init() for TRATS Pantelis Antoniou
2012-11-28 14:47   ` Lukasz Majewski
2012-11-28 15:52     ` Tom Rini
2012-11-28 16:08       ` Lukasz Majewski
2012-11-29 17:42         ` Tom Rini
2012-11-29 23:14           ` Lukasz Majewski
2012-11-30  1:57             ` Tom Rini [this message]
2012-12-17 14:28     ` Tom Rini
2012-12-17 17:37       ` Lukasz Majewski
2012-12-17 17:45         ` Tom Rini
2012-11-29  7:33 ` [U-Boot] [PATCH 06/10] dfu: Fix crash when wrong number of arguments given Pantelis Antoniou
2012-11-28 15:17   ` Lukasz Majewski
2012-11-29  7:33 ` [U-Boot] [PATCH 07/10] dfu: Send correct DFU response from composite_setup Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 08/10] dfu: Properly zero out timeout value Pantelis Antoniou
2012-11-28 15:23   ` Lukasz Majewski
2012-11-29  7:33 ` [U-Boot] [PATCH 09/10] dfu: Add a partition type target Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 10/10] dfu: Support larger than memory transfers Pantelis Antoniou
2012-11-29  8:20 ` [U-Boot] [PATCH 00/10] USB: Gadget & DFU related fixes 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=50B81273.4040009@ti.com \
    --to=trini@ti.com \
    --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.