[U-Boot] [RFC 05/11] arm: K3: Introduce System Firmware loader framework
dannenberg at ti.com
dannenberg at ti.com
Tue May 21 18:42:14 UTC 2019
Hi TF,
On Tue, May 21, 2019 at 05:21:15AM +0000, Chee, Tien Fong wrote:
> On Thu, 2019-05-16 at 15:54 -0500, Andreas Dannenberg wrote:
> > + if (mmc_dev < 0) {
> > + pr_err("%s: Getting MMC device index failed (%d)\n",
> > __func__,
> > + mmc_dev);
> > + return mmc_dev;
> > + }
> > +
> > + ret = uclass_get_device(UCLASS_MMC, mmc_dev, &mmcdev);
> > + if (ret < 0) {
> > + pr_err("%s: Getting MMC device failed (%d)\n",
> > __func__, ret);
> > + return ret;
> > + }
> > +
> > + ret = mmc_initialize(NULL);
> > + if (ret < 0) {
> > + pr_err("%s: Initializing MMC device failed (%d)\n",
> > __func__,
> > + ret);
> > + return ret;
> > + }
> > +
> > + mmc = mmc_get_mmc_dev(mmcdev);
> > + if (!mmc) {
> > + pr_err("%s: Getting underlying MMC device failed\n",
> > __func__);
> > + return -ENODEV;
> > + }
> > +
> > + ret = mmc_init(mmc);
> > + if (ret) {
> > + printf("%s: mmc init failed with error: %d\n",
> > __func__, ret);
> > + return ret;
> > + }
> > +
>
> The probe function in fs loader already support the block init, and the
> block init would init the mmc.
Yes I'm sure this could have gotten simplified if I were to use the DTS
to describe the boot device. But as explained earlier I was exploring a
way to make it work without DTS for added flexibility so I can pick the
boot device at runtime.
--
Andreas Dannenberg
Texas Instruments Inc
More information about the U-Boot
mailing list