Skip to contentSkip to conversation

ARM: Clean arm/lib/cache.c, modify ARM1136 and ARM926 accordingly

PATCH Superseded Hong Xu 3 participants 19 messages Aug 11, 2011 – Oct 21, 2011 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Hong Xu

author
#0 lore raw

cover ARM: Clean arm/lib/cache.c, modify ARM1136 and ARM926 accordingly

This series try to clean the code of arch/arm/lib/cache.c Move ARM1136 cache operations into cpu/arm1136/cache.c Add ARM926EJS cache operations into cpu/arm926ejs/cache.c

Hong Xu (3):
ARM: Clean arch/arm/lib/cache.c
ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c
ARM: ARM926EJS - Add cache operations

arch/arm/cpu/arm1136/Makefile   |    2 +-
arch/arm/cpu/arm1136/cache.c    |   33 +++++++++
arch/arm/cpu/arm926ejs/Makefile |    2 +-
arch/arm/cpu/arm926ejs/cache.c  |  142 +++++++++++++++++++++++++++++++++++++++
arch/arm/lib/cache.c            |   55 +++++++++-------
5 files changed, 208 insertions(+), 26 deletions(-)

create mode 100644 arch/arm/cpu/arm1136/cache.c create mode 100644 arch/arm/cpu/arm926ejs/cache.c

author
#1 lore raw

PATCH 1/3 ARM: Clean arch/arm/lib/cache.c

The default cache operations defined in arch/arm/lib/cache.c do not perform any real cache operation, and instead a WARNING will be emitted.

---
 arch/arm/lib/cache.c |   55 ++++++++++++++++++++++++++++---------------------
 1 files changed, 31 insertions(+), 24 deletions(-)
arch/arm/lib/cache.c +31 -24
index 92b61a2..6af05ec 100644
@@ -20,36 +20,43 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+#include <linux/compiler.h>
+#include <common.h>
 
-/* for now: just dummy functions to satisfy the linker */
+#define EMIT_WARNING printf("WARNING: %s - CPU cache operation is not " \
+"implemented!\n", __func__)
 
-#include <common.h>
+/*
+ * Default implementations
+ *
+ * Warn user if CPU code does not implement necessary cache functions
+ */
+void __weak flush_cache(unsigned long start, unsigned long size)
+{
+	EMIT_WARNING;
+}
 
-void  __flush_cache(unsigned long start, unsigned long size)
+void __weak flush_dcache_all(void)
 {
-#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
-	void arm1136_cache_flush(void);
+	EMIT_WARNING;
+}
 
-	arm1136_cache_flush();
-#endif
-#ifdef CONFIG_ARM926EJS
-	/* test and clean, page 2-23 of arm926ejs manual */
-	asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
-	/* disable write buffer as well (page 2-22) */
-	asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
-#endif
-	return;
+void __weak flush_dcache_range(unsigned long start, unsigned long stop)
+{
+	EMIT_WARNING;
 }
-void  flush_cache(unsigned long start, unsigned long size)
-	__attribute__((weak, alias("__flush_cache")));
 
-/*
- * Default implementation:
- * do a range flush for the entire range
- */
-void	__flush_dcache_all(void)
+void __weak invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+	EMIT_WARNING;
+}
+
+void __weak invalidate_dcache_all(void)
+{
+	EMIT_WARNING;
+}
+
+void __weak invalidate_icache_all(void)
 {
-	flush_cache(0, ~0);
+	EMIT_WARNING;
 }
-void	flush_dcache_all(void)
-	__attribute__((weak, alias("__flush_dcache_all")));
Signature · 1 line
1.7.6
author
#2 lore raw

PATCH 1/3 ARM: Clean arch/arm/lib/cache.c

In reply to Hong Xu

The default cache operations defined in arch/arm/lib/cache.c do not perform any real cache operation, and instead a WARNING will be emitted.

CC Albert Aribaud <[email protected]>
CC Aneesh V <[email protected]>
CC Marek Vasut <[email protected]>
CC Reinhard Meyer <[email protected]>
CC Heiko Schocher <[email protected]>
---
 arch/arm/lib/cache.c |   55 ++++++++++++++++++++++++++++---------------------
 1 files changed, 31 insertions(+), 24 deletions(-)
arch/arm/lib/cache.c +31 -24
index 92b61a2..6af05ec 100644
@@ -20,36 +20,43 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+#include <linux/compiler.h>
+#include <common.h>
 
-/* for now: just dummy functions to satisfy the linker */
+#define EMIT_WARNING printf("WARNING: %s - CPU cache operation is not " \
+"implemented!\n", __func__)
 
-#include <common.h>
+/*
+ * Default implementations
+ *
+ * Warn user if CPU code does not implement necessary cache functions
+ */
+void __weak flush_cache(unsigned long start, unsigned long size)
+{
+	EMIT_WARNING;
+}
 
-void  __flush_cache(unsigned long start, unsigned long size)
+void __weak flush_dcache_all(void)
 {
-#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
-	void arm1136_cache_flush(void);
+	EMIT_WARNING;
+}
 
-	arm1136_cache_flush();
-#endif
-#ifdef CONFIG_ARM926EJS
-	/* test and clean, page 2-23 of arm926ejs manual */
-	asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
-	/* disable write buffer as well (page 2-22) */
-	asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
-#endif
-	return;
+void __weak flush_dcache_range(unsigned long start, unsigned long stop)
+{
+	EMIT_WARNING;
 }
-void  flush_cache(unsigned long start, unsigned long size)
-	__attribute__((weak, alias("__flush_cache")));
 
-/*
- * Default implementation:
- * do a range flush for the entire range
- */
-void	__flush_dcache_all(void)
+void __weak invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+	EMIT_WARNING;
+}
+
+void __weak invalidate_dcache_all(void)
+{
+	EMIT_WARNING;
+}
+
+void __weak invalidate_icache_all(void)
 {
-	flush_cache(0, ~0);
+	EMIT_WARNING;
 }
-void	flush_dcache_all(void)
-	__attribute__((weak, alias("__flush_dcache_all")));
Signature · 1 line
1.7.6
#3 lore raw

PATCH 1/3 ARM: Clean arch/arm/lib/cache.c

Quoted 21 lines · Hong Xu

The default cache operations defined in arch/arm/lib/cache.c do not perform any real cache operation, and instead a WARNING will be emitted.

CC Albert Aribaud <[email protected]>
CC Aneesh V <[email protected]>
CC Marek Vasut <[email protected]>
CC Reinhard Meyer <[email protected]>
CC Heiko Schocher <[email protected]>
---
 arch/arm/lib/cache.c |   55

++++++++++++++++++++++++++++--------------------- 1 files changed, 31 insertions(+), 24 deletions(-)

arch/arm/lib/cache.c +0 -0
index 92b61a2..6af05ec 100644

arch/arm/lib/cache.c line 27

Quoted 9 lines
arch/arm/lib/cache.c +4 -1
@@ -20,36 +20,43 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+#include <linux/compiler.h>
+#include <common.h>
 
-/* for now: just dummy functions to satisfy the linker */
+#define EMIT_WARNING printf("WARNING: %s - CPU cache operation is not " \
+"implemented!\n", __func__)

Maybe use debug() ? Or make the emission of warning conditional, somehow I have the feeling this will make some people unhappy.

Otherwise looks nice and clean.

Quoted 58 lines
arch/arm/lib/cache.c +26 -23
-#include <common.h>
+/*
+ * Default implementations
+ *
+ * Warn user if CPU code does not implement necessary cache functions
+ */
+void __weak flush_cache(unsigned long start, unsigned long size)
+{
+	EMIT_WARNING;
+}
 
-void  __flush_cache(unsigned long start, unsigned long size)
+void __weak flush_dcache_all(void)
 {
-#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
-	void arm1136_cache_flush(void);
+	EMIT_WARNING;
+}
 
-	arm1136_cache_flush();
-#endif
-#ifdef CONFIG_ARM926EJS
-	/* test and clean, page 2-23 of arm926ejs manual */
-	asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
-	/* disable write buffer as well (page 2-22) */
-	asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
-#endif
-	return;
+void __weak flush_dcache_range(unsigned long start, unsigned long stop)
+{
+	EMIT_WARNING;
 }
-void  flush_cache(unsigned long start, unsigned long size)
-	__attribute__((weak, alias("__flush_cache")));
 
-/*
- * Default implementation:
- * do a range flush for the entire range
- */
-void	__flush_dcache_all(void)
+void __weak invalidate_dcache_range(unsigned long start, unsigned long
 stop) +{
+	EMIT_WARNING;
+}
+
+void __weak invalidate_dcache_all(void)
+{
+	EMIT_WARNING;
+}
+
+void __weak invalidate_icache_all(void)
 {
-	flush_cache(0, ~0);
+	EMIT_WARNING;
 }
-void	flush_dcache_all(void)
-	__attribute__((weak, alias("__flush_dcache_all")));
author
#4 lore raw

PATCH 1/3 ARM: Clean arch/arm/lib/cache.c

Hi Marek,

Quoted 28 lines · Marek Vasut
Quoted 27 lines · Hong Xu

The default cache operations defined in arch/arm/lib/cache.c do not perform any real cache operation, and instead a WARNING will be emitted.

CC Albert Aribaud<[email protected]>
CC Aneesh V<[email protected]>
CC Marek Vasut<[email protected]>
CC Reinhard Meyer<[email protected]>
CC Heiko Schocher<[email protected]>
---
  arch/arm/lib/cache.c |   55

++++++++++++++++++++++++++++--------------------- 1 files changed, 31 insertions(+), 24 deletions(-)

arch/arm/lib/cache.c +2 -0
index 92b61a2..6af05ec 100644
@@ -20,36 +20,43 @@
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
   * MA 02111-1307 USA
   */
+#include<linux/compiler.h>
+#include<common.h>
 
Quoted 6 lines

arch/arm/lib/cache.c line 27

Quoted 3 lines
arch/arm/lib/cache.c +2 -1
-/* for now: just dummy functions to satisfy the linker */
+#define EMIT_WARNING printf("WARNING: %s - CPU cache operation is not " \
+"implemented!\n", __func__)

Maybe use debug() ? Or make the emission of warning conditional, somehow I have the feeling this will make some people unhappy.

Just my feelings: It's noisy but it'll give strong message to the user even if the DEBUG is not opened :-)

BR,
Eric

Quoted 4 lines

Otherwise looks nice and clean.

Quoted 3 lines
arch/arm/lib/cache.c +1 -1
-#include<common.h>
+/*

[...]

#5 lore raw

PATCH 1/3 ARM: Clean arch/arm/lib/cache.c

Quoted 42 lines · Hong Xu

Hi Marek,

Quoted 32 lines · Marek Vasut
Quoted 31 lines · Hong Xu

The default cache operations defined in arch/arm/lib/cache.c do not perform any real cache operation, and instead a WARNING will be emitted.

CC Albert Aribaud<[email protected]>
CC Aneesh V<[email protected]>
CC Marek Vasut<[email protected]>
CC Reinhard Meyer<[email protected]>
CC Heiko Schocher<[email protected]>

---

  arch/arm/lib/cache.c |   55

++++++++++++++++++++++++++++--------------------- 1 files changed, 31 insertions(+), 24 deletions(-)

arch/arm/lib/cache.c +2 -0
index 92b61a2..6af05ec 100644
@@ -20,36 +20,43 @@
 
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
   * MA 02111-1307 USA
   */
 
+#include<linux/compiler.h>
+#include<common.h>
 
Quoted 6 lines

arch/arm/lib/cache.c line 29

Quoted 3 lines
arch/arm/lib/cache.c +1 -1
-/* for now: just dummy functions to satisfy the linker */
+#define EMIT_WARNING printf("WARNING: %s - CPU cache operation is not "
 \ +"implemented!\n", __func__)

Maybe use debug() ? Or make the emission of warning conditional, somehow I have the feeling this will make some people unhappy.

Quoted 2 lines

Just my feelings: It's noisy but it'll give strong message to the user even if the DEBUG is not opened :-)

That's not my point, it'll likely become noisy on many boards where cache flushing/invalidating isn't necessary and where is wasn't noisy before and noone cared for it not being implemented.

I'd prefer to see other people thoughts on this.

Cheers

Quoted 10 lines

BR,
Eric

Quoted 4 lines

Otherwise looks nice and clean.

Quoted 2 lines
arch/arm/lib/cache.c +1 -1
-#include<common.h>
+/*

[...]

author
#6 lore raw

PATCH 2/3 ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c

In reply to Hong Xu

arch/arm/lib/cache.c is cleaned and no real cache operation will be defined in this file. So a new file arch/arm/cpu/arm1136/cache.c is created. This file will define the real cache operations.

---
 arch/arm/cpu/arm1136/Makefile |    2 +-
 arch/arm/cpu/arm1136/cache.c  |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm1136/cache.c
arch/arm/cpu/arm1136/Makefile +1 -1
index 930e0d1..5b5f330 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).o
 
 START	= start.o
-COBJS	= cpu.o
+COBJS	= cpu.o cache.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
arch/arm/cpu/arm1136/cache.c new file +33 -0
new file mode 100644
index 0000000..02aa266
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+
+void flush_cache(unsigned long start, unsigned long size)
+{
+#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
+	void arm1136_cache_flush(void);
+
+	arm1136_cache_flush();
+#endif
+}
Signature · 1 line
1.7.6
author
#7 lore raw

PATCH 2/3 ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c

In reply to Hong Xu

arch/arm/lib/cache.c is cleaned and no real cache operation will be defined in this file. So a new file arch/arm/cpu/arm1136/cache.c is created. This file will define the real cache operations.

CC Albert Aribaud <[email protected]>
CC Aneesh V <[email protected]>
CC Marek Vasut <[email protected]>
CC Reinhard Meyer <[email protected]>
CC Heiko Schocher <[email protected]>
---
 arch/arm/cpu/arm1136/Makefile |    2 +-
 arch/arm/cpu/arm1136/cache.c  |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm1136/cache.c
arch/arm/cpu/arm1136/Makefile +1 -1
index 930e0d1..5b5f330 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).o
 
 START	= start.o
-COBJS	= cpu.o
+COBJS	= cpu.o cache.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
arch/arm/cpu/arm1136/cache.c new file +33 -0
new file mode 100644
index 0000000..02aa266
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+
+void flush_cache(unsigned long start, unsigned long size)
+{
+#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
+	void arm1136_cache_flush(void);
+
+	arm1136_cache_flush();
+#endif
+}
Signature · 1 line
1.7.6
#8 lore raw

PATCH 2/3 ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c

Quoted 36 lines · Hong Xu

arch/arm/lib/cache.c is cleaned and no real cache operation will be defined in this file. So a new file arch/arm/cpu/arm1136/cache.c is created. This file will define the real cache operations.

CC Albert Aribaud <[email protected]>
CC Aneesh V <[email protected]>
CC Marek Vasut <[email protected]>
CC Reinhard Meyer <[email protected]>
CC Heiko Schocher <[email protected]>
---
 arch/arm/cpu/arm1136/Makefile |    2 +-
 arch/arm/cpu/arm1136/cache.c  |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm1136/cache.c
arch/arm/cpu/arm1136/Makefile +1 -1
index 930e0d1..5b5f330 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).o
 
 START	= start.o
-COBJS	= cpu.o
+COBJS	= cpu.o cache.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
arch/arm/cpu/arm1136/cache.c new file +0 -0
new file mode 100644
index 0000000..02aa266

arch/arm/cpu/arm1136/cache.c line 3

Quoted 3 lines
arch/arm/cpu/arm1136/cache.c new file +3 -0
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.

Really ?

Quoted 15 lines
arch/arm/cpu/arm1136/cache.c new file +15 -0
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License

arch/arm/cpu/arm1136/cache.c line 28

Quoted 10 lines
arch/arm/cpu/arm1136/cache.c new file +10 -0
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+
+void flush_cache(unsigned long start, unsigned long size)
+{
+#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)

Hm, this is in cpu/arm1136/cache.c ... do we need the macro ?

You can test if this breaks anything by MAKEALL script in uboot tree.

Quoted 5 lines
arch/arm/cpu/arm1136/cache.c new file +5 -0
+	void arm1136_cache_flush(void);
+
+	arm1136_cache_flush();
+#endif
+}
author
#9 lore raw

PATCH 2/3 ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c

Quoted 29 lines · Marek Vasut
Quoted 28 lines · Hong Xu

arch/arm/lib/cache.c is cleaned and no real cache operation will be defined in this file. So a new file arch/arm/cpu/arm1136/cache.c is created. This file will define the real cache operations.

CC Albert Aribaud<[email protected]>
CC Aneesh V<[email protected]>
CC Marek Vasut<[email protected]>
CC Reinhard Meyer<[email protected]>
CC Heiko Schocher<[email protected]>
---
  arch/arm/cpu/arm1136/Makefile |    2 +-
  arch/arm/cpu/arm1136/cache.c  |   33 +++++++++++++++++++++++++++++++++
  2 files changed, 34 insertions(+), 1 deletions(-)

create mode 100644 arch/arm/cpu/arm1136/cache.c

arch/arm/cpu/arm1136/Makefile +1 -1
index 930e0d1..5b5f330 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
  LIB	= $(obj)lib$(CPU).o
 
  START	= start.o
-COBJS	= cpu.o
+COBJS	= cpu.o cache.o
 
Quoted 13 lines

arch/arm/cpu/arm1136/cache.c line 3

Quoted 11 lines
arch/arm/cpu/arm1136/Makefile +0 -0
  SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
  OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
arch/arm/cpu/arm1136/cache.c new file +3 -0
new file mode 100644
index 0000000..02aa266
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.

Really ?

not sure...
Maybe add a copyright line on top of it?

Quoted 29 lines
Quoted 16 lines
arch/arm/cpu/arm1136/cache.c new file +15 -0
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License

arch/arm/cpu/arm1136/cache.c line 28

Quoted 10 lines
arch/arm/cpu/arm1136/cache.c new file +10 -0
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include<common.h>
+
+void flush_cache(unsigned long start, unsigned long size)
+{
+#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)

Hm, this is in cpu/arm1136/cache.c ... do we need the macro ?

Quoted 1 line

You can test if this breaks anything by MAKEALL script in uboot tree.

Thanks, I'll have a close look at it.

BR,
Eric

Quoted 5 lines
Quoted 5 lines
arch/arm/cpu/arm1136/cache.c new file +5 -0
+	void arm1136_cache_flush(void);
+
+	arm1136_cache_flush();
+#endif
+}
#10 lore raw

PATCH 2/3 ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c

Quoted 48 lines · Hong Xu
Quoted 35 lines · Marek Vasut
Quoted 34 lines · Hong Xu

arch/arm/lib/cache.c is cleaned and no real cache operation will be defined in this file. So a new file arch/arm/cpu/arm1136/cache.c is created. This file will define the real cache operations.

CC Albert Aribaud<[email protected]>
CC Aneesh V<[email protected]>
CC Marek Vasut<[email protected]>
CC Reinhard Meyer<[email protected]>
CC Heiko Schocher<[email protected]>

---

  arch/arm/cpu/arm1136/Makefile |    2 +-
  arch/arm/cpu/arm1136/cache.c  |   33 +++++++++++++++++++++++++++++++++
  2 files changed, 34 insertions(+), 1 deletions(-)

create mode 100644 arch/arm/cpu/arm1136/cache.c

(quoted diff) +0 -0

b/arch/arm/cpu/arm1136/Makefile index 930e0d1..5b5f330 100644

arch/arm/cpu/arm1136/Makefile +1 -1
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 
  LIB	= $(obj)lib$(CPU).o
 
  START	= start.o
 
-COBJS	= cpu.o
+COBJS	= cpu.o cache.o
 
  SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
  OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
Quoted 11 lines

arch/arm/cpu/arm1136/cache.c line 3

Quoted 9 lines
arch/arm/cpu/arm1136/cache.c new file +3 -0
new file mode 100644
index 0000000..02aa266
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.

Really ?

Quoted 2 lines

not sure...
Maybe add a copyright line on top of it?

I guess replacing it altogether would be a way to go. It's your code afterall, right?

Quoted 29 lines
Quoted 29 lines
Quoted 16 lines
arch/arm/cpu/arm1136/cache.c new file +15 -0
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License

arch/arm/cpu/arm1136/cache.c line 28

Quoted 10 lines
arch/arm/cpu/arm1136/cache.c new file +10 -0
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include<common.h>
+
+void flush_cache(unsigned long start, unsigned long size)
+{
+#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)

Hm, this is in cpu/arm1136/cache.c ... do we need the macro ?

Quoted 3 lines
Quoted 1 line

You can test if this breaks anything by MAKEALL script in uboot tree.

Thanks, I'll have a close look at it.

Thanks :)

Quoted 9 lines

BR,
Eric

Quoted 5 lines
Quoted 5 lines
arch/arm/cpu/arm1136/cache.c new file +5 -0
+	void arm1136_cache_flush(void);
+
+	arm1136_cache_flush();
+#endif
+}
#11 lore raw

PATCH 2/3 ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c

In reply to Hong Xu

Dear Hong Xu,

Quoted 11 lines · In message <[email protected]> you wrote:

arch/arm/lib/cache.c is cleaned and no real cache operation will be defined in this file. So a new file arch/arm/cpu/arm1136/cache.c is created. This file will define the real cache operations.

CC Albert Aribaud <[email protected]>
CC Aneesh V <[email protected]>
CC Marek Vasut <[email protected]>
CC Reinhard Meyer <[email protected]>
CC Heiko Schocher <[email protected]>
Quoted 5 lines
---
 arch/arm/cpu/arm1136/Makefile |    2 +-
 arch/arm/cpu/arm1136/cache.c  |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm1136/cache.c

Checkpatch says:

WARNING: externs should be avoided in .c files
#143: FILE: arch/arm/cpu/arm1136/cache.c:29:
+ void arm1136_cache_flush(void);

Please clean up and resubmit. Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Time is fluid ... like a river with currents, eddies, backwash.
	-- Spock, "The City on the Edge of Forever", stardate 3134.0
author
#12 lore raw

PATCH 3/3 ARM: ARM926EJS - Add cache operations

In reply to Hong Xu

Add a new file arch/arm/cpu/arm926ejs/cache.c and put cache operations into this file.

---
 arch/arm/cpu/arm926ejs/Makefile |    2 +-
 arch/arm/cpu/arm926ejs/cache.c  |  142 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 143 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/cache.c
arch/arm/cpu/arm926ejs/Makefile +1 -1
index 930e0d1..5b5f330 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).o
 
 START	= start.o
-COBJS	= cpu.o
+COBJS	= cpu.o cache.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
arch/arm/cpu/arm926ejs/cache.c new file +142 -0

142 lines not on this page · raw message

Signature · 1 line
1.7.6
author
#13 lore raw

PATCH 3/3 ARM: ARM926EJS - Add cache operations

In reply to Hong Xu

Add a new file arch/arm/cpu/arm926ejs/cache.c and put cache operations into this file.

CC Albert Aribaud <[email protected]>
CC Aneesh V <[email protected]>
CC Marek Vasut <[email protected]>
CC Reinhard Meyer <[email protected]>
CC Heiko Schocher <[email protected]>
---
 arch/arm/cpu/arm926ejs/Makefile |    2 +-
 arch/arm/cpu/arm926ejs/cache.c  |  142 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 143 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/cache.c
arch/arm/cpu/arm926ejs/Makefile +1 -1
index 930e0d1..5b5f330 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).o
 
 START	= start.o
-COBJS	= cpu.o
+COBJS	= cpu.o cache.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
arch/arm/cpu/arm926ejs/cache.c new file +142 -0

142 lines not on this page · raw message

Signature · 1 line
1.7.6
#14 lore raw

cover ARM: Clean arm/lib/cache.c, modify ARM1136 and ARM926 accordingly

In reply to Hong Xu
Quoted 8 lines · Hong Xu

This series try to clean the code of arch/arm/lib/cache.c Move ARM1136 cache operations into cpu/arm1136/cache.c Add ARM926EJS cache operations into cpu/arm926ejs/cache.c

Hong Xu (3):
ARM: Clean arch/arm/lib/cache.c
ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c
ARM: ARM926EJS - Add cache operations

Hong,

Thanks a lot ! Let me review now :)

Quoted 10 lines
arch/arm/cpu/arm1136/Makefile   |    2 +-
arch/arm/cpu/arm1136/cache.c    |   33 +++++++++
arch/arm/cpu/arm926ejs/Makefile |    2 +-
arch/arm/cpu/arm926ejs/cache.c  |  142
+++++++++++++++++++++++++++++++++++++++ arch/arm/lib/cache.c            | 
 55 +++++++++-------
5 files changed, 208 insertions(+), 26 deletions(-)

create mode 100644 arch/arm/cpu/arm1136/cache.c create mode 100644 arch/arm/cpu/arm926ejs/cache.c

#15 lore raw

cover ARM: Clean arm/lib/cache.c, modify ARM1136 and ARM926 accordingly

In reply to Hong Xu
Quoted 3 lines · Hong Xu

This series try to clean the code of arch/arm/lib/cache.c Move ARM1136 cache operations into cpu/arm1136/cache.c Add ARM926EJS cache operations into cpu/arm926ejs/cache.c

Hi,

any updates?

Thanks, cheers!

Quoted 15 lines

Hong Xu (3):
ARM: Clean arch/arm/lib/cache.c
ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c
ARM: ARM926EJS - Add cache operations

arch/arm/cpu/arm1136/Makefile   |    2 +-
arch/arm/cpu/arm1136/cache.c    |   33 +++++++++
arch/arm/cpu/arm926ejs/Makefile |    2 +-
arch/arm/cpu/arm926ejs/cache.c  |  142
+++++++++++++++++++++++++++++++++++++++ arch/arm/lib/cache.c            | 
 55 +++++++++-------
5 files changed, 208 insertions(+), 26 deletions(-)

create mode 100644 arch/arm/cpu/arm1136/cache.c create mode 100644 arch/arm/cpu/arm926ejs/cache.c

author
#16 lore raw

cover ARM: Clean arm/lib/cache.c, modify ARM1136 and ARM926 accordingly

Hi Marek,

Quoted 8 lines · Marek Vasut
Quoted 3 lines · Hong Xu

This series try to clean the code of arch/arm/lib/cache.c Move ARM1136 cache operations into cpu/arm1136/cache.c Add ARM926EJS cache operations into cpu/arm926ejs/cache.c

Hi,

any updates?

Quite busy in the passed days ;-)
And just turned back. V2 patches are on the way

BR,
Eric

Quoted 18 lines

Thanks, cheers!

Quoted 15 lines

Hong Xu (3):
ARM: Clean arch/arm/lib/cache.c
ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c
ARM: ARM926EJS - Add cache operations

arch/arm/cpu/arm1136/Makefile   |    2 +-
arch/arm/cpu/arm1136/cache.c    |   33 +++++++++
arch/arm/cpu/arm926ejs/Makefile |    2 +-
arch/arm/cpu/arm926ejs/cache.c  |  142
+++++++++++++++++++++++++++++++++++++++ arch/arm/lib/cache.c            |
  55 +++++++++-------
5 files changed, 208 insertions(+), 26 deletions(-)

create mode 100644 arch/arm/cpu/arm1136/cache.c create mode 100644 arch/arm/cpu/arm926ejs/cache.c

#17 lore raw

cover ARM: Clean arm/lib/cache.c, modify ARM1136 and ARM926 accordingly

Quoted 8 lines · Hong Xu

Hi Marek,

Quoted 5 lines · Marek Vasut
Quoted 3 lines · Hong Xu

This series try to clean the code of arch/arm/lib/cache.c Move ARM1136 cache operations into cpu/arm1136/cache.c Add ARM926EJS cache operations into cpu/arm926ejs/cache.c

Quoted 6 lines
Quoted 3 lines

Hi,

any updates?

Quite busy in the passed days ;-)
And just turned back. V2 patches are on the way

Hi, I just tested your patches yesterday and they seem to work. Just those two compile issues, but you're doing great ;-)

Quoted 5 lines

BR,
Eric

Quoted 1 line

Thanks, cheers!

#18 lore raw

cover ARM: Clean arm/lib/cache.c, modify ARM1136 and ARM926 accordingly

In reply to Hong Xu
Quoted 16 lines · Hong Xu

This series try to clean the code of arch/arm/lib/cache.c Move ARM1136 cache operations into cpu/arm1136/cache.c Add ARM926EJS cache operations into cpu/arm926ejs/cache.c

Hong Xu (3):
ARM: Clean arch/arm/lib/cache.c
ARM: ARM1136 - Remove flush_cache from arch/arm/lib/cache.c
ARM: ARM926EJS - Add cache operations

arch/arm/cpu/arm1136/Makefile   |    2 +-
arch/arm/cpu/arm1136/cache.c    |   33 +++++++++
arch/arm/cpu/arm926ejs/Makefile |    2 +-
arch/arm/cpu/arm926ejs/cache.c  |  142
+++++++++++++++++++++++++++++++++++++++ arch/arm/lib/cache.c            | 
 55 +++++++++-------
5 files changed, 208 insertions(+), 26 deletions(-)
Quoted 2 lines

create mode 100644 arch/arm/cpu/arm1136/cache.c create mode 100644 arch/arm/cpu/arm926ejs/cache.c

Hi Hong,

any updates on thius please?

Cheers