On Tue, 15 Sep 2015 14:02:28 +0200
Bernhard Nortmann <bernhard.nortm...@web.de> wrote:

> Am 14.09.2015 um 11:55 schrieb Bernhard Nortmann:
> > Hello Siarhei!
> >
> > Am 13.09.2015 um 23:42 schrieb Siarhei Siamashka:
> >> With this change, we are going to print "Warning: no 'soc_sram_info'
> >> data for your SoC" message regardless of what kind of FEL command
> >> is requested in the command line. Simple FEL commands don't need any
> >> SoC-specific information, so we are going to be nagging the users
> >> of the new SoC variants.
> >>
> >> On the other hand, maybe this is not too bad?
> >
> > Good catch. I also think we could "get away" with that, but it may
> > not be the nicest way to deal with it. I would think that handling
> > this might be achieved by initializing sram_info to NULL, and only
> > call aw_fel_get_sram_info() later when sram_info is actually needed
> > ("spl"/"uboot", or script transfer with "write")? It leads to slightly
> > more complicated code, but seems reasonable.
>
> It might be preferable to actually make "fel_version" global.
> aw_fel_get_sram_info() could operate on that data, and cache its result,
> so the soc_sram_info pointer gets initialized only once (upon the first
> request that makes actual use of sram_info). This way it's safe to call
> the function multiple times / wherever needed.
> 
> What do you think?

Yes, caching the pointer inside of aw_fel_get_sram_info() function and
avoiding repeated usb requests is a good idea. Just make it a static
variable instead of global.

-- 
Best regards,
Siarhei Siamashka

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to