[U-Boot] [PATCH] powerpc/esdhc: force the bus width to 4bit

Lukasz Majewski l.majewski at samsung.com
Fri Nov 2 08:38:06 CET 2012


Hi Andy,

> >
> > Hmm... looks like it is code done by me :-)
> > So little explanation shall be given.
> >
> > This code is necessary for some targets (like Samsung's Goni) which
> > can only support 4 bit MMC mode.
> >
> >> >>    for (; width >= 0; width--) {
> >> >>    ....
> >> >>
> >> >> So for FSL ESDHC, the width = 3, after implement mmc_switch
> >> >> successfully, will set the bus to 4 * width. Therefore, I will
> >> >> get the 12bit (4 x 3) bus width.
> >> This problem is MMC subsystem's bug.
> >> I think good that will modify the code in mmc.c.
> >> If caps is set to MMC_MODE_4BIT | MMC_MODE_8BIT,
> >> we can see the 12bit support with using "mmcinfo" command
> >>
> >
> > The mmc_set_bus_width(mmc, 4 * width) in conjunction to above code
> > causes the problem.
> >
> > I agree, that this code shall be refactored.
> > Lei, what do you think?
> 
> 
> I am... very confused by this whole thread. And the code associated
> with it. The host_caps field has a bitmask which declares the widths
> supported by a given controller.
> 
> What would possess you to index them by addition, and convert their
> values by multiplication?? It's a bitfield! I'm embarrassed that I
> allowed this code in, and will review future submissions from you with
> a very skeptical eye.

I admit, that this code was a hack, I will even say more (after the "big
picture" presented by You) - I've delivered very low quality code.

Shame on me - my fault. Period. 



> 
> Ah, and further review indicates it is Lei Wen who introduced the idea
> of iterating through a bitfield by subtraction, though I can see how
> iterating through the EXT_CSD *field* definition (which looks a lot
> like a bitfield, but may not be) *might* be considered reasonable.
> 
> Meanwhile, Huang Changming, why would you see this broken code, and
> then decide the best workaround was to cripple our controller by
> eliminating support for 8-bit?
> 
> I'm going to fix this right now. Probably in the quite sensible way
> that Jaehoon Chung suggested.
> 
> Andy


-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group


More information about the U-Boot mailing list