Skip to contentSkip to conversation

m68k: Fixes for the m68k

PATCH New Marek Vasut 2 participants 9 messages Oct 3, 2012 – Nov 1, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover m68k: Fixes for the m68k

The m68k wasn't tested for a long time it seems, thus bugs crawled in. This series carries at least some basic fixes, yet bugs still prevail:

Configuring for M5282EVB board...
make: *** [u-boot] Error 1
m68k-linux-gnu-size: './u-boot': No such file
common/libcommon.o:(.data.rel.env_ptr+0x0): undefined reference to `environment'
make: *** [u-boot] Error 1
Configuring for astro_mcf5373l board...
make: *** [u-boot] Error 1
m68k-linux-gnu-size: './u-boot': No such file
cpu_init.c: In function 'cpu_init_f':
cpu_init.c:227:10: warning: unused variable 'wdog' [-Wunused-variable]
mcf5373l.c: In function 'initdram':
mcf5373l.c:99:5: warning: pointer targets in passing argument 1 of 'get_ram_size' differ in signedness [-Wpointer-sign] In file included from mcf5373l.c:25:0:
/tmp/u-boot/include/common.h:422:6: note: expected 'long int *' but argument is of type 'long unsigned int *' fpga.c:185:2: warning: initialization from incompatible pointer type [enabled by default]
fpga.c:185:2: warning: (near initialization for 'altera_fns.write') [enabled by default]
fpga.c: In function 'astro5373l_altera_load':
fpga.c:213:20: warning: assignment from incompatible pointer type [enabled by default]
m68k-linux-gnu-ld.bfd: cannot find lib/zlib.o
make: *** [u-boot] Error 1
Configuring for M52277EVB_stmicro - Board: M52277EVB, Options: CF_SBF,SYS_STMICRO_BOOT,SYS_TEXT_BASE=0x43E00000
text data bss dec hex filename
105755 8186 4080 118021 1cd05 ./u-boot
cpu_init.c: In function 'cpu_init_f':
cpu_init.c:47:9: warning: unused variable 'pll' [-Wunused-variable]
cpu_init.c:46:10: warning: unused variable 'fbcs' [-Wunused-variable]
cpu_init.c:44:10: warning: unused variable 'scm1' [-Wunused-variable]
Configuring for M5235EVB - Board: M5235EVB, Options: SYS_TEXT_BASE=0xFFE00000
text data bss dec hex filename
127862 9326 21096 158284 26a4c ./u-boot
cpu_init.c: In function 'cpu_init_f':
cpu_init.c:64:2: warning: passing argument 1 of 'out_be32' from incompatible pointer type [enabled by default]
In file included from cpu_init.c:31:0:
/tmp/u-boot/include/asm/io.h:223:20: note: expected 'volatile unsigned int *' but argument is of type 'u16 *' cpu_init.c:65:2: warning: passing argument 1 of 'out_be32' from incompatible pointer type [enabled by default]
In file included from cpu_init.c:31:0:
/tmp/u-boot/include/asm/io.h:223:20: note: expected 'volatile unsigned int *' but argument is of type 'u16 *' Configuring for M5235EVB_Flash32 - Board: M5235EVB, Options: NORFLASH_PS32BIT,SYS_TEXT_BASE=0xFFC00000
text data bss dec hex filename
127862 9326 21096 158284 26a4c ./u-boot
cpu_init.c: In function 'cpu_init_f':
cpu_init.c:64:2: warning: passing argument 1 of 'out_be32' from incompatible pointer type [enabled by default]
In file included from cpu_init.c:31:0:
/tmp/u-boot/include/asm/io.h:223:20: note: expected 'volatile unsigned int *' but argument is of type 'u16 *' cpu_init.c:65:2: warning: passing argument 1 of 'out_be32' from incompatible pointer type [enabled by default]
In file included from cpu_init.c:31:0:
/tmp/u-boot/include/asm/io.h:223:20: note: expected 'volatile unsigned int *' but argument is of type 'u16 *' Configuring for idmr board...
text data bss dec hex filename
105682 8298 21756 135736 21238 ./u-boot
cpu_init.c: In function 'init_fbcs':
cpu_init.c:60:2: warning: #warning "Chip Select 0 are not initialized/used" [-Wcpp]
cpu_init.c:52:10: warning: unused variable 'fbcs' [-Wunused-variable]
Configuring for eb_cpu5282 - Board: eb_cpu5282, Options: SYS_TEXT_BASE=0xFFE00000
text data bss dec hex filename
102264 9082 37412 148758 24516 ./u-boot
bus_vcxk.c: In function 'vcxk_init':
bus_vcxk.c:156:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'u_char *' [-Wformat] bus_vcxk.c:156:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'u_short *' [-Wformat] bus_vcxk.c:156:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'u_long *' [-Wformat] cfm_flash.c: In function 'cfm_flash_init':
cfm_flash.c:62:2: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat] cfm_flash.c:62:2: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat] eb_cpu5282.c: In function 'drv_video_init':
eb_cpu5282.c:184:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] Configuring for eb_cpu5282_internal - Board: eb_cpu5282, Options: SYS_TEXT_BASE=0xF0000000
text data bss dec hex filename
102373 9086 37412 148871 24587 ./u-boot
bus_vcxk.c: In function 'vcxk_init':
bus_vcxk.c:156:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'u_char *' [-Wformat] bus_vcxk.c:156:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'u_short *' [-Wformat] bus_vcxk.c:156:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'u_long *' [-Wformat] eb_cpu5282.c: In function 'drv_video_init':
eb_cpu5282.c:184:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] cfm_flash.c: In function 'cfm_flash_init':
cfm_flash.c:62:2: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat] cfm_flash.c:62:2: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat] Configuring for M5253DEMO board...
text data bss dec hex filename
142930 9132 222316 374378 5b66a ./u-boot
flash.c: In function 'flash_erase':
flash.c:196:21: warning: variable 'last' set but not used [-Wunused-but-set-variable]
flash.c: In function 'write_buff':
flash.c:338:10: warning: variable 'port_width' set but not used [-Wunused-but-set-variable]

--------------------- SUMMARY ----------------------------
Boards compiled: 9
Boards with errors: 2 ( M5282EVB astro_mcf5373l )
Boards with warnings but no errors: 7 ( M52277EVB_stmicro M5235EVB M5235EVB_Flash32 idmr eb_cpu5282 eb_cpu5282_internal M5253DEMO )
----------------------------------------------------------

Marek Vasut (5):
m68k: Fix wrong assembler instruction in start.S
m68k: Fix unused variable warning
m68k: Fix unused variable warning in speed.c
m68k: Fix unused variable in board.c
m68k: net: Fix unused variable in mcfmii.c

Philippe De Muyter (1):
m68k: Fix relocation errors in start.S

 arch/m68k/cpu/mcf5227x/start.S    |    2 +-
 arch/m68k/cpu/mcf523x/start.S     |    2 +-
 arch/m68k/cpu/mcf52x2/start.S     |    2 +-
 arch/m68k/cpu/mcf532x/start.S     |    2 +-
 arch/m68k/cpu/mcf5445x/cpu_init.c |    3 ++-
 arch/m68k/cpu/mcf5445x/speed.c    |    9 +++++++--
 arch/m68k/cpu/mcf547x_8x/start.S  |    4 ++--
 arch/m68k/lib/board.c             |    3 ++-
 drivers/net/mcfmii.c              |    4 +---
 9 files changed, 18 insertions(+), 13 deletions(-)
Cc "Jin Zhengxiong-R64188" <[email protected]>
Cc Jason Jin <[email protected]>
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/6 m68k: Fix relocation errors in start.S

From: Philippe De Muyter <[email protected]>

When the environment sectors in the flash are big, one get those errors :

mcf547x_8x/start.S:173: relocation truncated to fit: R_68K_PC16 against
symbol `cpu_init_f' defined in .text section in libmcf547x_8x.a(cpu_init.o)
mcf547x_8x/start.S:174: relocation truncated to fit: R_68K_PC16 against
symbol `board_init_f' defined in .text section in libm68k.a(board.o)

Fix that.

Cc "Jin Zhengxiong-R64188" <[email protected]>
Cc Jason Jin <[email protected]>
---
 arch/m68k/cpu/mcf547x_8x/start.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/m68k/cpu/mcf547x_8x/start.S +2 -2
index ec65cae..d99747b 100644
@@ -164,8 +164,8 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
 	/* board_init_f() does not return */
 
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/6 m68k: Fix wrong assembler instruction in start.S

In reply to Marek Vasut

The jmp _fault generated the following error message, thus change it to bra _fault:

start.S: Assembler messages:
start.S:310: Error: Conversion of PC relative displacement to absolute

Cc "Jin Zhengxiong-R64188" <[email protected]>
Cc Jason Jin <[email protected]>
---
 arch/m68k/cpu/mcf5227x/start.S |    2 +-
 arch/m68k/cpu/mcf523x/start.S  |    2 +-
 arch/m68k/cpu/mcf52x2/start.S  |    2 +-
 arch/m68k/cpu/mcf532x/start.S  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/m68k/cpu/mcf5227x/start.S +1 -1
index c5096a8..a683778 100644
@@ -485,7 +485,7 @@ clear_bss:
 /* exception code */
 	.globl _fault
 _fault:
-	jmp _fault
+	bra _fault
 	.globl	_exc_handler
 
 _exc_handler:
arch/m68k/cpu/mcf523x/start.S +1 -1
index e6a69ab..05f1723 100644
@@ -247,7 +247,7 @@ clear_bss:
 /* exception code */
 	.globl _fault
 _fault:
-	jmp _fault
+	bra _fault
 	.globl	_exc_handler
 
 _exc_handler:
arch/m68k/cpu/mcf52x2/start.S +1 -1
index ee17792..f5e55dd 100644
@@ -307,7 +307,7 @@ clear_bss:
 /* exception code */
 	.globl _fault
 _fault:
-	jmp _fault
+	bra _fault
 
 	.globl	_exc_handler
 _exc_handler:
arch/m68k/cpu/mcf532x/start.S +1 -1
index fe98d76..583ed1d 100644
@@ -261,7 +261,7 @@ clear_bss:
 /* exception code */
 	.globl _fault
 _fault:
-	jmp _fault
+	bra _fault
 	.globl	_exc_handler
 
 _exc_handler:
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/6 m68k: Fix unused variable warning

In reply to Marek Vasut

The fbcs variable was unused, producing the following warning:

cpu_init.c: In function 'cpu_init_f':
cpu_init.c:52:10: warning: unused variable 'fbcs' [-Wunused-variable]

Cc "Jin Zhengxiong-R64188" <[email protected]>
Cc Jason Jin <[email protected]>
---
 arch/m68k/cpu/mcf5445x/cpu_init.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/m68k/cpu/mcf5445x/cpu_init.c +2 -1
index 3f9209f..b6ceac3 100644
@@ -31,6 +31,7 @@
 #include <asm/processor.h>
 #include <asm/rtc.h>
 #include <asm/io.h>
+#include <linux/compiler.h>
 
 #if defined(CONFIG_CMD_NET)
 #include <config.h>
@@ -49,7 +50,7 @@ void cpu_init_f(void)
 {
 	scm1_t *scm1 = (scm1_t *) MMAP_SCM1;
 	gpio_t *gpio = (gpio_t *) MMAP_GPIO;
-	fbcs_t *fbcs = (fbcs_t *) MMAP_FBCS;
+	fbcs_t *fbcs __maybe_unused = (fbcs_t *) MMAP_FBCS;
 
 	out_be32(&scm1->mpr, 0x77777777);
 	out_be32(&scm1->pacra, 0);
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 4/6 m68k: Fix unused variable warning in speed.c

In reply to Marek Vasut

The following warning was produced, fix it:

speed.c: In function 'get_clocks':
speed.c:94:15: warning: variable 'bPci' set but not used [-Wunused-but-set-variable]

Cc "Jin Zhengxiong-R64188" <[email protected]>
Cc Jason Jin <[email protected]>
---
 arch/m68k/cpu/mcf5445x/speed.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/m68k/cpu/mcf5445x/speed.c +7 -2
index 073b7ef..d71b5fe 100644
@@ -91,9 +91,12 @@ int get_clocks(void)
 	pll_t *pll = (pll_t *)MMAP_PLL;
 	int pllmult_nopci[] = { 20, 10, 24, 18, 12, 6, 16, 8 };
 	int pllmult_pci[] = { 12, 6, 16, 8 };
-	int vco = 0, bPci, temp, fbtemp, pcrvalue;
+	int vco = 0, temp, fbtemp, pcrvalue;
 	int *pPllmult = NULL;
 	u16 fbpll_mask;
+#ifdef CONFIG_PCI
+	int bPci;
+#endif
 
 #ifdef CONFIG_M54455EVB
 	u8 *cpld = (u8 *)(CONFIG_SYS_CS2_BASE + 3);
@@ -105,14 +108,16 @@ int get_clocks(void)
 	    ((in_be16(&ccm->ccr) & CCM_CCR_360_FBCONFIG_MASK) == 0x0060)) {
 		pPllmult = &pllmult_pci[0];
 		fbpll_mask = 3;		/* 11b */
+#ifdef CONFIG_PCI
 		bPci = 1;
+#endif
 	} else {
 		pPllmult = &pllmult_nopci[0];
 		fbpll_mask = 7;		/* 111b */
 #ifdef CONFIG_PCI
 		gd->pci_clk = 0;
-#endif
 		bPci = 0;
+#endif
 	}
 
 #ifdef CONFIG_M54455EVB
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 5/6 m68k: Fix unused variable in board.c

In reply to Marek Vasut

The following warning was produced, fix it:

board.c: In function 'board_init_r':
board.c:390:8: warning: unused variable 's' [-Wunused-variable]

Cc "Jin Zhengxiong-R64188" <[email protected]>
Cc Jason Jin <[email protected]>
---
 arch/m68k/lib/board.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/m68k/lib/board.c +2 -1
index 67c9a13..92f935b 100644
@@ -29,6 +29,7 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
+#include <linux/compiler.h>
 
 #include <asm/immap.h>
 
@@ -387,7 +388,7 @@ board_init_f (ulong bootflag)
  */
 void board_init_r (gd_t *id, ulong dest_addr)
 {
-	char *s;
+	char *s __maybe_unused;
 	bd_t *bd;
 
 #ifndef CONFIG_ENV_IS_NOWHERE
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 6/6 m68k: net: Fix unused variable in mcfmii.c

In reply to Marek Vasut

The following warning was produced, fix it:

mcfmii.c: In function 'mcffec_miiphy_write':
mcfmii.c:318:8: warning: variable 'rdreg' set but not used [-Wunused-but-set-variable]

Cc "Jin Zhengxiong-R64188" <[email protected]>
Cc Jason Jin <[email protected]>
---
 drivers/net/mcfmii.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/mcfmii.c +1 -3
index 471c5ef..5e64dbd 100644
@@ -315,13 +315,11 @@ int mcffec_miiphy_read(const char *devname, unsigned char addr, unsigned char re
 int mcffec_miiphy_write(const char *devname, unsigned char addr, unsigned char reg,
 			unsigned short value)
 {
-	short rdreg;		/* register working value */
-
 #ifdef MII_DEBUG
 	printf("miiphy_write(0x%x) @ 0x%x = ", reg, addr);
 #endif
 
-	rdreg = mii_send(mk_mii_write(addr, reg, value));
+	mii_send(mk_mii_write(addr, reg, value));
 
 #ifdef MII_DEBUG
 	printf("0x%04x\n", value);
Signature · 1 line
1.7.10.4
#7 lore raw

cover m68k: Fixes for the m68k

In reply to Marek Vasut
Quoted 2 lines

The m68k wasn't tested for a long time it seems, thus bugs crawled in. This series carries at least some basic fixes, yet bugs still prevail:

[...]

Bump?

Best regards,
Marek Vasut

#8 lore raw

cover m68k: Fixes for the m68k

Quoted 7 lines

-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Thursday, November 01, 2012 10:59 AM
To: u-boot at lists.denx.de
Cc: Jin Zhengxiong-R64188; Jin Zhengxiong-R64188
Subject: Re: [PATCH 0/6] m68k: Fixes for the m68k

Quoted 8 lines
Quoted 2 lines

The m68k wasn't tested for a long time it seems, thus bugs crawled in. This series carries at least some basic fixes, yet bugs still prevail:

[...]

Bump?

Best regards,
Marek Vasut

[Jason Jin-R64188] Those fixes have been applied to u-boot. Thanks a lot.

Best Regards,
Jason