From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Wu Date: Mon, 8 Jun 2015 17:15:20 +0800 Subject: [U-Boot] [PATCH v2 1/3] ARM: cache: add an empty stub function for invalidate/flush dcache In-Reply-To: <201506081026.29339.marex@denx.de> 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> Message-ID: <55755D28.9050404@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, Marek On 6/8/2015 4:26 PM, 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 ? ;-) Oh, yes ;-) I just think maybe it's more logical to keep those to the /lib/cache.c as cache are dependent. Another point is if we create a new cache.c in common/, then the cache implementation code are in three files: /cpu/cache.c or cpu.c /lib/cache.c common/cache.c It seems too fragmented. What do you think? Best Regards, Josh Wu > > Best regards, > Marek Vasut