From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Wed, 10 Jun 2015 14:20:04 -0400 Subject: [U-Boot] [PATCH v2 1/3] ARM: cache: add an empty stub function for invalidate/flush dcache In-Reply-To: <55780842.6040009@atmel.com> References: <1433490452-26402-1-git-send-email-josh.wu@atmel.com> <201506051518.49587.marex@denx.de> <5574F850.7090901@atmel.com> <201506081026.29339.marex@denx.de> <20150608132035.GQ1728@bill-the-cat> <55766366.5090301@atmel.com> <20150609131156.GA1728@bill-the-cat> <55780842.6040009@atmel.com> Message-ID: <20150610182004.GI1728@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Jun 10, 2015 at 05:49:54PM +0800, Josh Wu wrote: > On 6/9/2015 9:11 PM, Tom Rini wrote: > >On Tue, Jun 09, 2015 at 11:54:14AM +0800, Josh Wu wrote: > >>Hi, Tom > >> > >>On 6/8/2015 9:20 PM, Tom Rini wrote: > >>>On Mon, Jun 08, 2015 at 10:26:29AM +0200, Marek Vasut wrote: > >>>>On Monday, June 08, 2015 at 04:05:04 AM, Josh Wu wrote: > >>>>>Hi, Marek > >>>>> > >>>>>On 6/5/2015 9:18 PM, Marek Vasut wrote: > >>>>>>On Friday, June 05, 2015 at 09:47:30 AM, Josh Wu wrote: > >>>>>>>Since some driver like ohci, lcd used dcache functions. But some ARM > >>>>>>>cpu don't implement the invalidate_dcache_range()/flush_dcache_range() > >>>>>>>functions. > >>>>>>> > >>>>>>>To avoid compiling errors this patch adds an weak empty stub function > >>>>>>>for all ARM cpu. > >>>>>>> > >>>>>>>And each cpu can implement its own implementation. If not implemented > >>>>>>>by default it will use an empty function. > >>>>>>> > >>>>>>>Signed-off-by: Josh Wu > >>>>>>>--- > >>>>>>> > >>>>>>>Changes in v2: new added > >>>>>>> > >>>>>>> arch/arm/lib/cache.c | 9 +++++++++ > >>>>>>> 1 file changed, 9 insertions(+) > >>>>>>So, why exactly can't this be entirely common code , but a CPU-specific > >>>>>>code ? :) > >>>>>Do you mean to make those empty functions as common code for all arch > >>>>>cpu to use? > >>>>Yes. > >>>> > >>>>>It seems there is no place to put common code for all arch cpu. > >>>>Isn't that what the common/ directory is for ? ;-) > >>>No, this is making something common for the sake of making it common > >>>rather than good architecutre of the code I think. We aren't going to > >>>share real cache functions just these dummy ones. > >>So it is the right place: arch/arm/lib/cache.c to put the dummy > >>cache function. > >Yes. > > > >>>We may re-evaluate > >>>our dummy ones at some point in the future when people try and use some > >>>particular combination harder, see for example the PowerPC dummy cache > >>>functions we just recently dropped. Thanks! > >>If this patch set are ok for you. I will sent more patches to drop > >>the dummy cache functions in /cpu/ folders. > >Right, that's the best palce I think, baring an existing arch having a > >location for weak cache functions already (like arm does). > > > >>Also the flush_cache() in arch/arm/lib/cache.c can be dropped and > >>just call flush_dcache_range() as the ARM1136, ARM926ejs alreay > >>implemented their own flush_cache(). > >Nope, other things fail if you do that (vpac270_nor_256 and 24 others at > >least so far in my test build). > > Does it fail to compile or on running? As I don't have the board to > test the binary, but I don't find any compile error when I apply > such a patch. It was a link failure for me when I just dropped flush_cache() from arch/arm/lib/cache.c -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: