[U-Boot] socfpga: initialize MMC
Wolfgang Denk
wd at denx.de
Thu Jul 17 14:01:20 CEST 2014
Dear Chin Liang,
In message <1405594852.2088.8.camel at clsee-VirtualBox.altera.com> you wrote:
>
> > > > + add_dwmci(host, host->bus_hz, host->bus_hz);
> > >
> > > Is there a free(host) anywhere?
>
> Actually the host will be referred throughout the code execution when
> SDMMC access is required. Hence, we can only call the free when exit
> which deems not needed then.
I have to admit that I have hard times trying to understand the
concept of behind this code.
1) The new patches add altera_dwmmc_init() - but is this not
basically a verbatim copy of socfpga_dwmmc_init() which is
alreday in mainline?
Except that the new patches use hardcoded constants (which is BAD)
where the current mainline code uses #defines:
altera_dwmmc_init():
host->bus_hz = 400000;
socfpga_dwmmc_init():
host->bus_hz = CONFIG_SOCFPGA_DWMMC_BUS_HZ;
2) Is it really necessary to always and unconditionally initialyze
the MMC subsystem, even in nobody will ever use any MMC commands in
U-Boot? The rule is that we only initialize hardwar when we
actually use them inside of U-Boot, i. e. if any commands are
executed that access such hardware?
[Ok, this seems to be a generic problem, not specific you your
patch set.]
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The average woman would rather have beauty than brains, because the
average man can see better than he can think.
More information about the U-Boot
mailing list