Skip to contentSkip to conversation

iMX31: Add support to copy NAND Flash code to RAM

PATCH New Alan Carvalho de Assis 7 participants 13 messages Oct 7, 2008 – Oct 23, 2008

lore
Share & tools
lore
#1 lore raw

PATCH 2/3 iMX31: Add support to copy NAND Flash code to RAM

Quoted 9 lines · Alan Carvalho de Assis

From 473120de8390abd78014cac9fe0925cb49f57fbe Mon Sep 17 00:00:00 2001
From: Alan Carvalho de Assis <[email protected]>
Date: Sun, 5 Oct 2008 19:59:47 -0300
Subject: [PATCH] iMX31: Add support to copy NAND Flash code to RAM

This code is executed from internal 2KB NAND Flash Controller RAM buffer and will copy the remaining U-Boot code from NAND Flash verifying its bad blocks (case it exists).

Quoted 5 lines
---
 cpu/arm1136/mx31/Makefile             |    2 +
 cpu/arm1136/mx31/nand_copy.S          |  263 +++++++++++++++++++++++++++++++++
 include/asm-arm/arch-mx31/mx31-regs.h |   69 +++++++++

Please use the nand_spl infrastructure to whatever extent is practical.

Does this code really need to be in assembly to fit?

-Scott

#2 lore raw

PATCH 2/3 iMX31: Add support to copy NAND Flash code to RAM

Hi Scott,

Quoted 18 lines · Scott Wood
Quoted 10 lines · Alan Carvalho de Assis

From 473120de8390abd78014cac9fe0925cb49f57fbe Mon Sep 17 00:00:00 2001
From: Alan Carvalho de Assis <[email protected]>
Date: Sun, 5 Oct 2008 19:59:47 -0300
Subject: [PATCH] iMX31: Add support to copy NAND Flash code to RAM

This code is executed from internal 2KB NAND Flash Controller RAM buffer and will copy the remaining U-Boot code from NAND Flash verifying its bad blocks (case it exists).

Quoted 6 lines
---
 cpu/arm1136/mx31/Makefile             |    2 +
 cpu/arm1136/mx31/nand_copy.S          |  263
+++++++++++++++++++++++++++++++++
 include/asm-arm/arch-mx31/mx31-regs.h |   69 +++++++++
Quoted 3 lines

Please use the nand_spl infrastructure to whatever extent is practical.

Does this code really need to be in assembly to fit?

I reused the source code from RedBoot. I think using nand_spl is the best approach, but it will needs more effort to complete.

I am afraid about the 2KB NAND loader limitation, this is too tight to fill using C code. I will investigate to verify if it is feasible.

Anyway, right now we can have iMX31PDK booting with this code as an option for users willing to use U-Boot in this board.

Quoted 2 lines

-Scott

Best Regards,

Alan

P.S.: I am sending this email again because I sent it erroneously only to Scott

#4 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Quoted 9 lines · Alan Carvalho de Assis
Quoted 1 line

From ae5af322e53d00d021f6d4aa39c6916e1d3e12b7 Mon Sep 17 00:00:00 2001

From: Alan Carvalho de Assis <[email protected]>
Date: Sun, 5 Oct 2008 20:00:59 -0300
Subject: [PATCH] iMX31: Add support to iMX31PDK board boots from NAND Flash

This patch adds support to iMX31PDK board to boot directly from NAND Flash. In order to it works the previous patches (which reduces start.S size and copy NAND code to RAM) need be applied first.

Quoted 7 lines
---
 board/freescale/mx31pdk/lowlevel_init.S |   95 +++++++++++++++++++++++++++++-
 board/freescale/mx31pdk/u-boot.lds      |    3 +
 include/configs/mx31pdk.h               |   16 ++++--
 3 files changed, 105 insertions(+), 9 deletions(-)

Please rebase against u-boot-arm/master otherwhise ACK execpt some whitespace see comment below

Best Regards,
J.

Quoted 33 lines
board/freescale/mx31pdk/lowlevel_init.S +21 -3
index a94ea7f..71ab612 100644
@@ -20,11 +20,98 @@
  * MA 02111-1307 USA
  */
 
-/*
- * This is just to keep the linker happy.
- */
+#include <asm/arch/mx31-regs.h>
+
+.macro REG reg, val
+	ldr r2, =\reg
+	ldr r3, =\val
+	str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+	ldr r2, =\reg
+	ldr r3, =\val
+	strb r3, [r2]
+.endm
+
+.macro DELAY loops
+	ldr r2, =\loops
+1:
+	subs	r2, r2, #1
+	nop
+	bcs 1b
+.endm

board/freescale/mx31pdk/lowlevel_init.S line 52

Quoted 10 lines
board/freescale/mx31pdk/lowlevel_init.S +6 -1
 
 .globl lowlevel_init
 lowlevel_init:
-	mov	pc, lr
+	/* Store return address on the stack since lr is re-used in this file */
+	/* and all other registers are re-used as well */
+	str lr, [sp]
+
+	/* Also setup the Peripheral Port Remap register inside the core */
+	ldr r0, =ARM_PPMRR        /* start from AIPS 2GB region */

^^^^^^^^
please use tab

Quoted 71 lines
board/freescale/mx31pdk/lowlevel_init.S +64 -0
+	mcr p15, 0, r0, c15, c2, 4
+
+	REG	IPU_CONF, IPU_CONF_DI_EN
+	REG	CCM_CCMR, 0x074B0BF5
+
+	DELAY 0x40000
+
+	REG	CCM_CCMR, 0x074B0BF5 | CCMR_MPE
+	REG	CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS
+
+	/* Set up clock to 532MHz */
+	REG	CCM_PDR0, 0xFF871D58
+	REG	CCM_MPCTL, 0x0033280C
+	REG	CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
+
+	/* Set up CPLD on CS5 */
+	REG	CSCR_U(5), 0x0000D843
+	REG	CSCR_L(5), 0x22252521
+	REG	CSCR_A(5), 0x22220A00
+
+	/* Set up MX31 DDR Memory Controller */
+	REG	0x43FAC26C, 0 /* SDCLK */
+	REG	0x43FAC270, 0 /* CAS */
+	REG	0x43FAC274, 0 /* RAS */
+	REG	0x43FAC27C, 0x1000 /* CS2	CSD0) */
+	REG	0x43FAC284, 0 /* DQM3 */
+	REG	0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10	0x288..0x2DC) */
+	REG	0x43FAC28C, 0
+	REG	0x43FAC290, 0
+	REG	0x43FAC294, 0
+	REG	0x43FAC298, 0
+	REG	0x43FAC29C, 0
+	REG	0x43FAC2A0, 0
+	REG	0x43FAC2A4, 0
+	REG	0x43FAC2A8, 0
+	REG	0x43FAC2AC, 0
+	REG	0x43FAC2B0, 0
+	REG	0x43FAC2B4, 0
+	REG	0x43FAC2B8, 0
+	REG	0x43FAC2BC, 0
+	REG	0x43FAC2C0, 0
+	REG	0x43FAC2C4, 0
+	REG	0x43FAC2C8, 0
+	REG	0x43FAC2CC, 0
+	REG	0x43FAC2D0, 0
+	REG	0x43FAC2D4, 0
+	REG	0x43FAC2D8, 0
+	REG	0x43FAC2DC, 0
+	REG	0xB8001010, 0x00000004
+	REG	0xB8001004, 0x006ac73a
+	REG	0xB8001000, 0x92100000
+	REG	0x80000f00, 0x12344321
+	REG	0xB8001000, 0xa2100000
+	REG	0x80000000, 0x12344321
+	REG	0x80000000, 0x12344321
+	REG	0xB8001000, 0xb2100000
+	REG8	0x80000033, 0xda
+	REG8	0x81000000, 0xff
+	REG	0xB8001000, 0x82226080
+	REG	0x80000000, 0xDEADBEEF
+	REG	0xB8001010, 0x0000000c
+
+	/* Copy from NAND to RAM */
+	b nand_copy
 
board/freescale/mx31pdk/u-boot.lds +0 -0
index 1460adc..8602f3e 100644

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 37

Quoted 3 lines
board/freescale/mx31pdk/u-boot.lds +0 -0
@@ -35,6 +35,9 @@ SECTIONS
 	.text	   :
 	{
 	  cpu/arm1136/start.o	(.text)

^^
please use tab

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 38

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  board/freescale/mx31pdk/lowlevel_init.o	(.text)
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 39

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  cpu/arm1136/mx31/nand_copy.o	(.text)
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 40

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  . = 2K; /* lowlevel NAND needs to fit in 2KB of NFC buffer */
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 41

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +0 -0
 	  *(.text)
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 42

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +0 -0
 	}

Best Regards,
J.

#5 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Hi Jean,

Quoted 147 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Alan Carvalho de Assis
Quoted 1 line

From ae5af322e53d00d021f6d4aa39c6916e1d3e12b7 Mon Sep 17 00:00:00 2001

From: Alan Carvalho de Assis <[email protected]>
Date: Sun, 5 Oct 2008 20:00:59 -0300
Subject: [PATCH] iMX31: Add support to iMX31PDK board boots from NAND Flash

This patch adds support to iMX31PDK board to boot directly from NAND Flash. In order to it works the previous patches (which reduces start.S size and copy NAND code to RAM) need be applied first.

Quoted 7 lines
---
 board/freescale/mx31pdk/lowlevel_init.S |   95 +++++++++++++++++++++++++++++-
 board/freescale/mx31pdk/u-boot.lds      |    3 +
 include/configs/mx31pdk.h               |   16 ++++--
 3 files changed, 105 insertions(+), 9 deletions(-)

Please rebase against u-boot-arm/master otherwhise ACK execpt some whitespace see comment below

Best Regards,
J.

Quoted 33 lines
board/freescale/mx31pdk/lowlevel_init.S +21 -3
index a94ea7f..71ab612 100644
@@ -20,11 +20,98 @@
  * MA 02111-1307 USA
  */
 
-/*
- * This is just to keep the linker happy.
- */
+#include <asm/arch/mx31-regs.h>
+
+.macro REG reg, val
+	ldr r2, =\reg
+	ldr r3, =\val
+	str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+	ldr r2, =\reg
+	ldr r3, =\val
+	strb r3, [r2]
+.endm
+
+.macro DELAY loops
+	ldr r2, =\loops
+1:
+	subs	r2, r2, #1
+	nop
+	bcs 1b
+.endm

board/freescale/mx31pdk/lowlevel_init.S line 52

Quoted 10 lines
board/freescale/mx31pdk/lowlevel_init.S +6 -1
 
 .globl lowlevel_init
 lowlevel_init:
-	mov	pc, lr
+	/* Store return address on the stack since lr is re-used in this file */
+	/* and all other registers are re-used as well */
+	str lr, [sp]
+
+	/* Also setup the Peripheral Port Remap register inside the core */
+	ldr r0, =ARM_PPMRR        /* start from AIPS 2GB region */

^^^^^^^^
please use tab

Quoted 71 lines
board/freescale/mx31pdk/lowlevel_init.S +64 -0
+	mcr p15, 0, r0, c15, c2, 4
+
+	REG	IPU_CONF, IPU_CONF_DI_EN
+	REG	CCM_CCMR, 0x074B0BF5
+
+	DELAY 0x40000
+
+	REG	CCM_CCMR, 0x074B0BF5 | CCMR_MPE
+	REG	CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS
+
+	/* Set up clock to 532MHz */
+	REG	CCM_PDR0, 0xFF871D58
+	REG	CCM_MPCTL, 0x0033280C
+	REG	CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
+
+	/* Set up CPLD on CS5 */
+	REG	CSCR_U(5), 0x0000D843
+	REG	CSCR_L(5), 0x22252521
+	REG	CSCR_A(5), 0x22220A00
+
+	/* Set up MX31 DDR Memory Controller */
+	REG	0x43FAC26C, 0 /* SDCLK */
+	REG	0x43FAC270, 0 /* CAS */
+	REG	0x43FAC274, 0 /* RAS */
+	REG	0x43FAC27C, 0x1000 /* CS2	CSD0) */
+	REG	0x43FAC284, 0 /* DQM3 */
+	REG	0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10	0x288..0x2DC) */
+	REG	0x43FAC28C, 0
+	REG	0x43FAC290, 0
+	REG	0x43FAC294, 0
+	REG	0x43FAC298, 0
+	REG	0x43FAC29C, 0
+	REG	0x43FAC2A0, 0
+	REG	0x43FAC2A4, 0
+	REG	0x43FAC2A8, 0
+	REG	0x43FAC2AC, 0
+	REG	0x43FAC2B0, 0
+	REG	0x43FAC2B4, 0
+	REG	0x43FAC2B8, 0
+	REG	0x43FAC2BC, 0
+	REG	0x43FAC2C0, 0
+	REG	0x43FAC2C4, 0
+	REG	0x43FAC2C8, 0
+	REG	0x43FAC2CC, 0
+	REG	0x43FAC2D0, 0
+	REG	0x43FAC2D4, 0
+	REG	0x43FAC2D8, 0
+	REG	0x43FAC2DC, 0
+	REG	0xB8001010, 0x00000004
+	REG	0xB8001004, 0x006ac73a
+	REG	0xB8001000, 0x92100000
+	REG	0x80000f00, 0x12344321
+	REG	0xB8001000, 0xa2100000
+	REG	0x80000000, 0x12344321
+	REG	0x80000000, 0x12344321
+	REG	0xB8001000, 0xb2100000
+	REG8	0x80000033, 0xda
+	REG8	0x81000000, 0xff
+	REG	0xB8001000, 0x82226080
+	REG	0x80000000, 0xDEADBEEF
+	REG	0xB8001010, 0x0000000c
+
+	/* Copy from NAND to RAM */
+	b nand_copy
 
board/freescale/mx31pdk/u-boot.lds +0 -0
index 1460adc..8602f3e 100644

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 37

Quoted 3 lines
board/freescale/mx31pdk/u-boot.lds +0 -0
@@ -35,6 +35,9 @@ SECTIONS
 	.text	   :
 	{
 	  cpu/arm1136/start.o	(.text)

^^
please use tab

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 38

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  board/freescale/mx31pdk/lowlevel_init.o	(.text)
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 39

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  cpu/arm1136/mx31/nand_copy.o	(.text)
        ^^
Quoted 8 lines

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 40

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  . = 2K; /* lowlevel NAND needs to fit in 2KB of NFC buffer */
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 41

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +0 -0
 	  *(.text)
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 42

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +0 -0
 	}

Best Regards,
J.

I can't rebase [PATCH 3/3] on u-boot-arm/master because it applies over Magnus Lilja's patch "i.MX31: Add basic support for Freescale's i.MX31 PDK board." (968614d8c3f17eb834838de9a390ef4879fb1e77)

Can you please pull this patch from u-boot-arm/testing to u-boot-arm/master ?

I rebased [PATCH 1-2/3] correctly, but will re-post them when I rebase everything.

Best Regards,

Alan

#6 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Quoted 33 lines
Quoted 24 lines
Quoted 15 lines
(quoted diff) +8 -0
+	REG8	0x80000033, 0xda
+	REG8	0x81000000, 0xff
+	REG	0xB8001000, 0x82226080
+	REG	0x80000000, 0xDEADBEEF
+	REG	0xB8001010, 0x0000000c
+
+	/* Copy from NAND to RAM */
+	b nand_copy
board/freescale/mx31pdk/u-boot.lds +0 -0
index 1460adc..8602f3e 100644

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 37

Quoted 3 lines
board/freescale/mx31pdk/u-boot.lds +0 -0
@@ -35,6 +35,9 @@ SECTIONS
 	.text	   :
 	{
 	  cpu/arm1136/start.o	(.text)

^^
please use tab

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 38

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  board/freescale/mx31pdk/lowlevel_init.o	(.text)
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 39

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  cpu/arm1136/mx31/nand_copy.o	(.text)
        ^^
Quoted 8 lines

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 40

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +1 -0
+	  . = 2K; /* lowlevel NAND needs to fit in 2KB of NFC buffer */
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 41

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +0 -0
 	  *(.text)
        ^^

board/freescale/mx31pdk/u-boot.lds SECTIONS · line 42

Quoted 1 line
board/freescale/mx31pdk/u-boot.lds +0 -0
 	}

Best Regards,
J.

Quoted 6 lines

I can't rebase [PATCH 3/3] on u-boot-arm/master because it applies over Magnus Lilja's patch "i.MX31: Add basic support for Freescale's i.MX31 PDK board." (968614d8c3f17eb834838de9a390ef4879fb1e77)

Can you please pull this patch from u-boot-arm/testing to u-boot-arm/master ?

No the patch need to be rebased first.

Magnus could you rebase it?
It will save me times

Best Regards,
J.

#7 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Quoted 11 lines
Quoted 6 lines

I can't rebase [PATCH 3/3] on u-boot-arm/master because it applies over Magnus Lilja's patch "i.MX31: Add basic support for Freescale's i.MX31 PDK board." (968614d8c3f17eb834838de9a390ef4879fb1e77)

Can you please pull this patch from u-boot-arm/testing to u-boot-arm/master ?

No the patch need to be rebased first.

Magnus could you rebase it?
It will save me times

I've updated the patch and it now almost compiles. There's a problem at the last link stage where gnu-ld complains about multiple __udivsi3 definitions and incompatible EABI formats (see below, modulo gmail wrapping).

I can compile the imx31_litekit just fine and that board is very similar to the initial mx31pdk board.

Any ideas on what may be causing this?

/Magnus

UNDEF_SYM=`arm-none-linux-gnueabi-objdump -x board/freescale/mx31pdk/libmx31pdk.a lib_generic/libgeneric.a lib_generic/lzma/liblzma.a board/freescale/common/libfreescale.a cpu/arm1136/libarm1136.a cpu/arm1136/mx31/libmx31.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a common/libcommon.a libfdt/libfdt.a

api/libapi.a post/libpost.a | \
		sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
		cd /opt/git/u-boot && arm-none-linux-gnueabi-ld -Bstatic -T

/opt/git/u-boot/board/freescale/mx31pdk/u-boot.lds -Ttext 0x87f00000
$UNDEF_SYM cpu/arm1136/start.o \
--start-group lib_generic/libgeneric.a lib_generic/lzma/liblzma.a
board/freescale/common/libfreescale.a cpu/arm1136/libarm1136.a
cpu/arm1136/mx31/libmx31.a lib_arm/libarm.a fs/cramfs/libcramfs.a
fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a
fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a
net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a
drivers/block/libblock.a drivers/dma/libdma.a drivers/hwmon/libhwmon.a
drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a
drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a
drivers/mtd/nand_legacy/libnand_legacy.a
drivers/mtd/onenand/libonenand.a drivers/mtd/spi/libspi_flash.a
drivers/net/libnet.a drivers/net/phy/libphy.a
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a
drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a
drivers/serial/libserial.a drivers/usb/libusb.a
drivers/video/libvideo.a common/libcommon.a libfdt/libfdt.a
api/libapi.a post/libpost.a board/freescale/mx31pdk/libmx31pdk.a
--end-group -L /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2 -lgcc \
-Map u-boot.map -o u-boot
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_udivsi3.o):
In function `__aeabi_uidiv':
/usr/src/redhat/BUILD/cross-mlib/source/gcc-4.1.2/gcc/config/arm/lib1funcs.asm:730:
multiple definition of `__udivsi3'
lib_arm/libarm.a(_udivsi3.o):/opt/git/u-boot/lib_arm/_udivsi3.S:17:
first defined here
arm-none-linux-gnueabi-ld: Warning: size of symbol `__udivsi3' changed
from 152 in lib_arm/libarm.a(_udivsi3.o) to 496 in /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_udivsi3.o)
arm-none-linux-gnueabi-ld: ERROR: Source object /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_udivdi3.o) has EABI version 4, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of
file /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_udivdi3.o)
arm-none-linux-gnueabi-ld: ERROR: Source object /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_udivsi3.o) has EABI version 4, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of
file /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_udivsi3.o)
arm-none-linux-gnueabi-ld: ERROR: Source object /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_clz.o) has EABI version 4, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of
file /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_clz.o) /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/libgcc.a(_udivdi3.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0'
make: *** [u-boot] Error 1

#8 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Dear Magnus,

Quoted 5 lines · In message <[email protected]> you…

I've updated the patch and it now almost compiles. There's a problem at the last link stage where gnu-ld complains about multiple __udivsi3 definitions and incompatible EABI formats (see below, modulo gmail wrapping).

Try this patch which I posted today:
ARM: Use do_div() instead of division for "long long".

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
Madness has no purpose.  Or reason.  But it may have a goal.
	-- Spock, "The Alternative Factor", stardate 3088.7
#9 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Wolfgang,

2008/10/22 Wolfgang Denk <[email protected]>:

Quoted 11 lines

Dear Magnus,

Quoted 5 lines · In message <[email protected]> you…

I've updated the patch and it now almost compiles. There's a problem at the last link stage where gnu-ld complains about multiple __udivsi3 definitions and incompatible EABI formats (see below, modulo gmail wrapping).

Try this patch which I posted today:
ARM: Use do_div() instead of division for "long long".

That patch doesn't seem to touch any files that are involved in building i.MX31 boards. I might try the equivalent change though. Although it is a bit puzzling that I can build the i.MX31 Litekit board with the same toolchain.

/Magnus

#10 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

2008/10/22 Magnus Lilja <[email protected]>:

Quoted 13 lines

Wolfgang,

2008/10/22 Wolfgang Denk <[email protected]>:

Quoted 9 lines

Dear Magnus,

Quoted 5 lines · In message <[email protected]> you…

I've updated the patch and it now almost compiles. There's a problem at the last link stage where gnu-ld complains about multiple __udivsi3 definitions and incompatible EABI formats (see below, modulo gmail wrapping).

Quoted 7 lines
Quoted 2 lines

Try this patch which I posted today:
ARM: Use do_div() instead of division for "long long".

That patch doesn't seem to touch any files that are involved in building i.MX31 boards. I might try the equivalent change though. Although it is a bit puzzling that I can build the i.MX31 Litekit board with the same toolchain.

Ok, I've found what's triggering this. The PDK board has CONFIG_MX31_CLK32=32768 while Litekit has CONIFG_MX31_CLK32=32000. That difference nowadays causes problems when linking, I suppose that happened after the merging of CONFIG_MX31_TIMER_HIGH_PRECISION.

Changing the TICK_TO_TIME macro in arm1176/mx31/interrupts.c to a construction that uses do_div() solves the problem.

I don't have the PDK schematics here but since I decided to set CLK32 to 32768 I suppose the board uses that frequency.

I haven't tried my new patch on real hardware yet, but I'll do that tomorrow and post a patch (without the do_div() fix though, perhaps someone else can do that?).

/Magnus

#11 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Magnus,

Quoted 45 lines · Magnus Lilja

From: Magnus Lilja <[email protected]>
Subject: Re: [U-Boot] [PATCH 3/3] iMX31: Add support to iMX31PDK board boots from NAND Flash
To: "Wolfgang Denk" <[email protected]>
Cc: u-boot at lists.denx.de, "Alan Carvalho de Assis" <[email protected]>
Date: Wednesday, October 22, 2008, 4:52 PM
2008/10/22 Magnus Lilja <[email protected]>:

Quoted 7 lines

Wolfgang,

2008/10/22 Wolfgang Denk <[email protected]>:

Quoted 3 lines

Dear Magnus,

In message

<[email protected]>

Quoted 2 lines · you
Quoted 2 lines
Quoted 2 lines

I've updated the patch and it now almost

compiles. There's a problem

Quoted 1 line
Quoted 1 line
Quoted 1 line

at the last link stage where gnu-ld complains

about multiple __udivsi3

Quoted 1 line
Quoted 1 line
Quoted 1 line

definitions and incompatible EABI formats (see

below, modulo gmail

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

wrapping).

Try this patch which I posted today:
ARM: Use do_div() instead of division for

"long long".

Quoted 2 lines

That patch doesn't seem to touch any files that

are involved in

Quoted 1 line

building i.MX31 boards. I might try the equivalent

change though.

Quoted 1 line

Although it is a bit puzzling that I can build the

i.MX31 Litekit

Quoted 1 line

board with the same toolchain.

Ok, I've found what's triggering this. The PDK board has
CONFIG_MX31_CLK32=32768 while Litekit has CONIFG_MX31_CLK32=32000.
That difference nowadays causes problems when linking, I suppose that
happened after the merging of CONFIG_MX31_TIMER_HIGH_PRECISION.

Quoted 7 lines

Changing the TICK_TO_TIME macro in arm1176/mx31/interrupts.c to a
construction that uses do_div() solves the problem.

I don't have the PDK schematics here but since I
decided to set CLK32
to 32768 I suppose the board uses that frequency.

Yes, I confirmed with the schematics. There is a 32768kHz crystal connected to the PMIC that drives the MX31 clock.

Regards,

Fabio Estevam

Quoted 11 lines

I haven't tried my new patch on real hardware yet, but I'll do that
tomorrow and post a patch (without the do_div() fix though, perhaps
someone else can do that?).

/Magnus
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#12 lore raw

PATCH 3/3 iMX31: Add support to iMX31PDK board boots from NAND Flash

Quoted 11 lines

Yes, I confirmed with the schematics. There is a 32768kHz crystal connected to the PMIC that drives the MX31 clock.

Regards,

Fabio Estevam

Quoted 5 lines

I haven't tried my new patch on real hardware yet, but I'll do that
tomorrow and post a patch (without the do_div() fix though, perhaps
someone else can do that?).

Ok, the patches have been posted now. The first one is a quick workaround for the div-problem, if someone has a better solution please use that instead. The second one is my updated basic i.MX31 PDK patch, now rebased and tested on hardware using a JTAG debugger to load it.

Regards, Magnus