Subject: Re: [PATCH/v2] powerpc/5200: make BestComm gen_bd microcode exchangeable

From: Albrecht Dreß <[email-masked]>
Date: Mon, 05 Oct 2009 21:42:13 +0200

Am 05.10.09 20:16 schrieb(en) Grant Likely:
> Hmmm.  I've not been comfortable with this change, but it took me a while to put my finger on exactly why.  In principle, I think it is a good idea.  However, I don't want to merge it without any in-tree users.

I could provide my modified microcode (which differs in two words only), for the "standard" task, just with byte swapping for the LPB, but I wonder if it is of much use.  No progress with crc32 calculation in BestComm so far... :-(

> The other concern is that I don't like that the patch is only applicable to gen_bd tasks.

IMHO the big difference between gen_bd on one hand and ATA and FEC on the other is that (afaik) we have *no* other choice than using the implemented tasks for the latter two, obviously using the Freescale's example microcode.  Gen_bd can apparently be used for a plenty of purposes, including LPB (as shown in your driver), maybe PCI (there are examples in Freescale's code), PSC, etc.  Thus, the FEC and ATA drivers should not have an option as to change the microcode, whereas it is just convenient for gen_bd.

> I've been thinking about this for a while, and I'm not exactly thrilled with the bestcomm layout which keeps the bestcomm firmware separate from the only driver that actually uses it (ie FEC firmware & support code is separate from the FEC driver.  Same for ATA).  I don't like the fact that code which is only ever used by the ATA driver is maintained completely separate from it.

That's a good point!  The separate microcode files for ATA and FEC are somewhat confusing.  I guess it's a result of simply copying the Freescale examples into separate files (and that might be a good reason for keeping the microcode separated).  Maybe create new sub-folders below arch/powerpc/sysdev/bestcomm for fec, ata, and gen_bd?  At least some documentation would be great.

> But I may be splitting hairs here and maybe I shouldn't be too concerned about it.  Regardless, I'd think I'd rather see something that isn't totally gen_bd specific.  Perhaps *microcode should be part of the bcom_task structure?

See above - I believe FEC and ATA are somewhat special as they need *exactly* the provided microcode.  And if something cannot be changed without breaking the functionality, there should not be a chance to do so... ;-)

Just my €0.01, though...

Cheers, Albrecht.