From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 29 Nov 2012 12:42:46 -0500 Subject: [U-Boot] [PATCH 05/10] dfu: Only perform DFU board_usb_init() for TRATS In-Reply-To: <20121128170859.6177fe9b@amdc308.digital.local> References: <1354174439-5589-1-git-send-email-panto@antoniou-consulting.com> <1354174439-5589-6-git-send-email-panto@antoniou-consulting.com> <20121128154743.06b3da95@amdc308.digital.local> <50B63336.6060002@ti.com> <20121128170859.6177fe9b@amdc308.digital.local> Message-ID: <50B79E96.7010605@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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 >>>>> --- 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". - -- Tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQIcBAEBAgAGBQJQt56WAAoJENk4IS6UOR1WznYP/23g0QuMB2slIC41OLTeGKfh 11zybSEVZYZmSPfgjEsXqEWh1cYryQNyiNyKIzNfPPyH/ZAA2PuMH7mKMmdp5St6 p7IIhmFwO+phkLGgpLVSJ6PsCGfY68N1r1FU04JJhpteoNmSPtutBWrb2bJ8tib/ 5HHSjUEUSYIgE1OHHVouGUx4KzNwWgyr0nds9WyfJ/X9OnQ22WRuVlkOIpy74NCz r9QSIEOSbmqY6uU+YFFOorgp0Ox97okRJAH0KAsBNxq6PE2NmZard0Qg2m2Ism7L NFbBvlfeF+/m9cicnrnuygyVkkNRcsX5NjWzVilzXQCfYmwBSH2YKPZbpRb3XGmr wNSNqbfSEWG3Oxa+g0NnqI8SPqsTNVXR8X1QsF/f7zIOHlYZfXlbqsDEzITm1YoI S1OEmpYXQQI1kZEOaxfXyJYbMXnA1/y8uItX8Bl/JUMWDQqQMFeJMVS711khGYuR EUVL8YQam6N7Xgzk89sN8UPyOfAbxxOgB5fNyKeuSL+sz0vBaAkmv69gNsdPsfIr vFvfyUKwyMtqhWZO+cG0VU4jzI0S0SMHdh52GtrU6P/3r77MC6zrhVja2EylXqvD p8pSi7eEdeBUMbJ6uMgLd0kxYwh3NWy5NTTR10yKDyTXi8kh/grG89syI5Eiczwj /CW6UuwG8R7T2l2+d1X3 =mdL4 -----END PGP SIGNATURE-----