Skip to contentSkip to conversation

Malta build errors with 2.6.26-rc1

DISCUSSION Applied Martin Michlmayr 4 participants 12 messages May 12, 2008 – Jun 15, 2008 MIPS

lore
Share & tools
lore
#0 lore raw

Some Malta build errors:

cc1: warnings being treated as errors
arch/mips/mips-boards/malta/malta_int.c: In function ‘gcmp_probe’:
arch/mips/mips-boards/malta/malta_int.c:408: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function ‘arch_init_irq’:
arch/mips/mips-boards/malta/malta_int.c:437: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:441: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function ‘malta_be_handler’:
arch/mips/mips-boards/malta/malta_int.c:656: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:657: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:658: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:704: warning: cast to pointer from integer of different size make[5]: *** [arch/mips/mips-boards/malta/malta_int.o] Error 1

and:

arch/mips/mips-boards/generic/amon.c: In function ‘amon_cpu_avail’:
arch/mips/mips-boards/generic/amon.c:31: error: implicit declaration of function ‘KSEG0ADDR’
cc1: warnings being treated as errors
arch/mips/mips-boards/generic/amon.c:31: warning: cast to pointer from integer of different size arch/mips/mips-boards/generic/amon.c: In function ‘amon_cpu_start’:
arch/mips/mips-boards/generic/amon.c:56: warning: cast to pointer from integer of different size make[4]: *** [arch/mips/mips-boards/malta] Error 2

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#1 lore raw
Quoted 4 lines · Martin Michlmayr

Some Malta build errors:

cc1: warnings being treated as errors arch/mips/mips-boards/malta/malta_int.c: In function ‘gcmp_probe’:

Sorry, I forgot to mention that this is 64-bit Malta. 32-bit compiles fine.

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#2 lore raw
In reply to Martin Michlmayr

2008/5/12 Martin Michlmayr <[email protected]>:

Quoted 17 lines

Some Malta build errors:

cc1: warnings being treated as errors
arch/mips/mips-boards/malta/malta_int.c: In function 'gcmp_probe':
arch/mips/mips-boards/malta/malta_int.c:408: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function 'arch_init_irq':
arch/mips/mips-boards/malta/malta_int.c:437: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:441: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function 'malta_be_handler':
arch/mips/mips-boards/malta/malta_int.c:656: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:657: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:658: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:704: warning: cast to pointer from integer of different size make[5]: *** [arch/mips/mips-boards/malta/malta_int.o] Error 1

and:

Quoted 8 lines

arch/mips/mips-boards/generic/amon.c: In function 'amon_cpu_avail':
arch/mips/mips-boards/generic/amon.c:31: error: implicit declaration of function 'KSEG0ADDR'
cc1: warnings being treated as errors
arch/mips/mips-boards/generic/amon.c:31: warning: cast to pointer from integer of different size arch/mips/mips-boards/generic/amon.c: In function 'amon_cpu_start':
arch/mips/mips-boards/generic/amon.c:56: warning: cast to pointer from integer of different size make[4]: *** [arch/mips/mips-boards/malta] Error 2

Known error. Please see this thread for some suggestions (and be warned that I did not try any of them):

http://marc.info/?t=120966332300004&r=1&w=2

Dmitri

#3 lore raw
Quoted 26 lines · Dmitri Vorobiev
Quoted 17 lines

Some Malta build errors:

cc1: warnings being treated as errors
arch/mips/mips-boards/malta/malta_int.c: In function 'gcmp_probe':
arch/mips/mips-boards/malta/malta_int.c:408: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function 'arch_init_irq':
arch/mips/mips-boards/malta/malta_int.c:437: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:441: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function 'malta_be_handler':
arch/mips/mips-boards/malta/malta_int.c:656: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:657: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:658: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:704: warning: cast to pointer from integer of different size make[5]: *** [arch/mips/mips-boards/malta/malta_int.o] Error 1

and:

Quoted 8 lines

arch/mips/mips-boards/generic/amon.c: In function 'amon_cpu_avail':
arch/mips/mips-boards/generic/amon.c:31: error: implicit declaration of function 'KSEG0ADDR'
cc1: warnings being treated as errors
arch/mips/mips-boards/generic/amon.c:31: warning: cast to pointer from integer of different size arch/mips/mips-boards/generic/amon.c: In function 'amon_cpu_start':
arch/mips/mips-boards/generic/amon.c:56: warning: cast to pointer from integer of different size make[4]: *** [arch/mips/mips-boards/malta] Error 2

Quoted 3 lines

Known error. Please see this thread for some suggestions (and be warned that I did not try any of them):
http://marc.info/?t=120966332300004&r=1&w=2

Isn't that a completely different issue? Anyway, I just tried and I still see the problems above (with 64 bit Malta) still after applying the traps.c patch from Thomas Bogendoerfer.

Is there a maintainer for Malta?

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#4 lore raw
Quoted 27 lines · Martin Michlmayr
Quoted 26 lines · Dmitri Vorobiev
Quoted 25 lines

Some Malta build errors:

cc1: warnings being treated as errors
arch/mips/mips-boards/malta/malta_int.c: In function 'gcmp_probe':
arch/mips/mips-boards/malta/malta_int.c:408: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function 'arch_init_irq':
arch/mips/mips-boards/malta/malta_int.c:437: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:441: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c: In function 'malta_be_handler':
arch/mips/mips-boards/malta/malta_int.c:656: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:657: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:658: warning: cast to pointer from integer of different size arch/mips/mips-boards/malta/malta_int.c:704: warning: cast to pointer from integer of different size make[5]: *** [arch/mips/mips-boards/malta/malta_int.o] Error 1

and:

arch/mips/mips-boards/generic/amon.c: In function 'amon_cpu_avail':
arch/mips/mips-boards/generic/amon.c:31: error: implicit declaration of function 'KSEG0ADDR'
cc1: warnings being treated as errors
arch/mips/mips-boards/generic/amon.c:31: warning: cast to pointer from integer of different size arch/mips/mips-boards/generic/amon.c: In function 'amon_cpu_start':
arch/mips/mips-boards/generic/amon.c:56: warning: cast to pointer from integer of different size make[4]: *** [arch/mips/mips-boards/malta] Error 2

Quoted 7 lines
Quoted 3 lines

Known error. Please see this thread for some suggestions (and be warned that I did not try any of them):
http://marc.info/?t=120966332300004&r=1&w=2

Isn't that a completely different issue? Anyway, I just tried and I still see the problems above (with 64 bit Malta) still after applying the traps.c patch from Thomas Bogendoerfer.

I didn't fix the problems above. The change to traps.c only fixes traps.c for 64bit builds and it's a totally different issue. Looking at the warning/errors someone needs to fix some data types and use CKSEG0ADDR(). I don't have the hardware, so I could only provide an untested patch, if no one else steps forward...

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]
#5 lore raw
Quoted 5 lines · Thomas Bogendoerfer

I didn't fix the problems above. The change to traps.c only fixes traps.c for 64bit builds and it's a totally different issue. Looking at the warning/errors someone needs to fix some data types and use CKSEG0ADDR(). I don't have the hardware, so I could only provide an untested patch, if no one else steps forward...

QEMU emulates Malta, so I (or someone else here) should be able to test the patch.

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#6 lore raw
Quoted 9 lines · Martin Michlmayr
Quoted 5 lines · Thomas Bogendoerfer

I didn't fix the problems above. The change to traps.c only fixes traps.c for 64bit builds and it's a totally different issue. Looking at the warning/errors someone needs to fix some data types and use CKSEG0ADDR(). I don't have the hardware, so I could only provide an untested patch, if no one else steps forward...

QEMU emulates Malta, so I (or someone else here) should be able to test the patch.

Fix 64bit Malta by using CKSEG0ADDR and correct casts

---

 arch/mips/mips-boards/generic/amon.c |    4 ++--
 include/asm-mips/gic.h               |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/mips-boards/generic/amon.c +2 -2
index b7633fd..96236bf 100644
@@ -28,7 +28,7 @@
 
 int amon_cpu_avail(int cpu)
 {
-	struct cpulaunch *launch = (struct cpulaunch *)KSEG0ADDR(CPULAUNCH);
+	struct cpulaunch *launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH);
 
 	if (cpu < 0 || cpu >= NCPULAUNCH) {
 		pr_debug("avail: cpu%d is out of range\n", cpu);
@@ -53,7 +53,7 @@ void amon_cpu_start(int cpu,
 		    unsigned long gp, unsigned long a0)
 {
 	volatile struct cpulaunch *launch =
-		(struct cpulaunch  *)KSEG0ADDR(CPULAUNCH);
+		(struct cpulaunch  *)CKSEG0ADDR(CPULAUNCH);
 
 	if (!amon_cpu_avail(cpu))
 		return;
include/asm-mips/gic.h +2 -2
index 3a492f2..954807d 100644
@@ -24,8 +24,8 @@
 
 #define MSK(n) ((1 << (n)) - 1)
 #define REG32(addr)		(*(volatile unsigned int *) (addr))
-#define REG(base, offs)		REG32((unsigned int)(base) + offs##_##OFS)
-#define REGP(base, phys)	REG32((unsigned int)(base) + (phys))
+#define REG(base, offs)		REG32((unsigned long)(base) + offs##_##OFS)
+#define REGP(base, phys)	REG32((unsigned long)(base) + (phys))
 
 /* Accessors */
 #define GIC_REG(segment, offset) \
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]
Tested-by
#7 lore raw

2008/5/29 Thomas Bogendoerfer <[email protected]>:

Quoted 48 lines · Martin Michlmayr
Quoted 9 lines · Thomas Bogendoerfer
Quoted 5 lines

I didn't fix the problems above. The change to traps.c only fixes traps.c for 64bit builds and it's a totally different issue. Looking at the warning/errors someone needs to fix some data types and use CKSEG0ADDR(). I don't have the hardware, so I could only provide an untested patch, if no one else steps forward...

QEMU emulates Malta, so I (or someone else here) should be able to test the patch.

Fix 64bit Malta by using CKSEG0ADDR and correct casts

---

 arch/mips/mips-boards/generic/amon.c |    4 ++--
 include/asm-mips/gic.h               |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/mips-boards/generic/amon.c +2 -2
index b7633fd..96236bf 100644
@@ -28,7 +28,7 @@
 
 int amon_cpu_avail(int cpu)
 {
-       struct cpulaunch *launch = (struct cpulaunch *)KSEG0ADDR(CPULAUNCH);
+       struct cpulaunch *launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH);
 
       if (cpu < 0 || cpu >= NCPULAUNCH) {
               pr_debug("avail: cpu%d is out of range\n", cpu);
@@ -53,7 +53,7 @@ void amon_cpu_start(int cpu,
                   unsigned long gp, unsigned long a0)
 {
       volatile struct cpulaunch *launch =
-               (struct cpulaunch  *)KSEG0ADDR(CPULAUNCH);
+               (struct cpulaunch  *)CKSEG0ADDR(CPULAUNCH);
 
       if (!amon_cpu_avail(cpu))
               return;
include/asm-mips/gic.h +0 -0
index 3a492f2..954807d 100644

include/asm-mips/gic.h line 31

Quoted 10 lines
include/asm-mips/gic.h +2 -2
@@ -24,8 +24,8 @@
 
 #define MSK(n) ((1 << (n)) - 1)
 #define REG32(addr)            (*(volatile unsigned int *) (addr))
-#define REG(base, offs)                REG32((unsigned int)(base) + offs##_##OFS)
-#define REGP(base, phys)       REG32((unsigned int)(base) + (phys))
+#define REG(base, offs)                REG32((unsigned long)(base) + offs##_##OFS)
+#define REGP(base, phys)       REG32((unsigned long)(base) + (phys))
 
 /* Accessors */
 #define GIC_REG(segment, offset) \

My test was performed using a Malta 4Kc board. I was able to boot the target up to the shell prompt with this patch applied to the current Linus tree.

So, you might want to add

#10 lore raw
In reply to Thomas Bogendoerfer
Quoted 5 lines

I didn't fix the problems above. The change to traps.c only fixes traps.c for 64bit builds and it's a totally different issue. Looking at the warning/errors someone needs to fix some data types and use CKSEG0ADDR(). I don't have the hardware, so I could only provide an untested patch, if no one else steps forward...

Please provide an untested patch. I have hardware here, so I can perform the test for you.

Thanks,
Dmitri

Quoted 7 lines

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea. [ RFC1925, 2.3 ]