[U-Boot] at91sam9263_nandflash build issues

Marek Vasut marek.vasut at gmail.com
Wed Feb 2 08:49:36 CET 2011


The problem is clear from this IRC log, where "vickylinuxer" described his grief 
(so I included the log, the board really doesn't build). I also did a quick and 
dirty patch (follows the log, it might give you an idea where it breaks, but 
it's a mess -- not all is relevant and it probably breaks it even more).

Cheers

//-------- LOG ---------

05:01 < vickylinuxer> guys i am making u-boot for at91sam9263 with ubifs 
support...which u-boot version i can prefer...
05:02 < vickylinuxer> because u-boot-12-2010 gave so many compilation 
problems...
05:06 < Marex> vickylinuxer: look ... what's the problem ? what board did you 
config it for ?
05:06 < Marex> vickylinuxer: give me the exact xyz for xyz_config
05:10 < vickylinuxer> at91sam9263_nandflash
05:11 < vickylinuxer> atmel board
05:11 < Marex> compiling, checking ... please wait
05:12 < Marex> I see
05:12 < Marex> vickylinuxer: it'll take a bit to fix it all ... wanna tinker with 
it and assist in fixing ?
05:38 < vickylinuxer> yes marex  i want to update from  ver 2010.09 to 
2010.12..but 09 is working good...
05:39 < vickylinuxer> but when compiling uboot-12 i m getting sdram error and so 
on...
05:51 < Marex> vickylinuxer: ok well ... there seems to be more breakage than I 
expected
05:57 < Marex> vickylinuxer: try this http://pastebin.com/2Rq92nNg

//-------- DIFF ---------

diff --git a/config.mk b/config.mk
index 5147c35..fe1d40c 100644
--- a/config.mk
+++ b/config.mk
@@ -261,7 +261,7 @@ $(obj)%.s:  %.c
 
 # If the list of objects to link is empty, just create an empty built-in.o
 cmd_link_o_target = $(if $(strip $1),\
-                     $(LD) $(LDFLAGS) -r -o $@ $1,\
+                     $(LD) -r -o $@ $1,\
                      rm -f $@; $(AR) rcs $@ )
 
 #########################################################################
diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
index bfa1f3a..1cc8bc0 100644
--- a/drivers/serial/atmel_usart.c
+++ b/drivers/serial/atmel_usart.c
@@ -23,6 +23,7 @@
 
 #include <asm/io.h>
 #include <asm/arch/clk.h>
+#include <asm/arch/hardware.h>
 #include <asm/arch/memory-map.h>
 
 #if defined(CONFIG_USART0)
diff --git a/drivers/spi/atmel_dataflash_spi.c b/drivers/spi/atmel_dataflash_spi.c
index 4a5c4aa..d5215c0 100644
--- a/drivers/spi/atmel_dataflash_spi.c
+++ b/drivers/spi/atmel_dataflash_spi.c
@@ -158,12 +158,12 @@ unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
        }
 
        /* arm simple, non interrupt dependent timer */
-       reset_timer_masked();
+       reset_timer();
        timeout = 0;
 
        writel(AT91_SPI_TXTEN + AT91_SPI_RXTEN, AT91_BASE_SPI + AT91_SPI_PTCR);
        while (!(readl(AT91_BASE_SPI + AT91_SPI_SR) & AT91_SPI_RXBUFF) &&
-               ((timeout = get_timer_masked()) < CONFIG_SYS_SPI_WRITE_TOUT));
+               ((timeout = get_timer(0)) < CONFIG_SYS_SPI_WRITE_TOUT));
        writel(AT91_SPI_TXTDIS + AT91_SPI_RXTDIS, AT91_BASE_SPI + 
AT91_SPI_PTCR);
        pDesc->state = IDLE;
 
diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
index f6cb406..3db8bd0 100644
--- a/include/configs/at91sam9263ek.h
+++ b/include/configs/at91sam9263ek.h
@@ -27,6 +27,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_AT91_LEGACY
+#define        CONFIG_AT91FAMILY
+
 /* ARM asynchronous clock */
 #define CONFIG_SYS_AT91_MAIN_CLOCK     16367660        /* 16.367 MHz crystal */
 #define CONFIG_SYS_HZ          1000
@@ -341,6 +344,10 @@
  */
 #define CONFIG_SYS_MALLOC_LEN          ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 
0x1000)
 
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_SDRAM_BASE + 0x1000 - \
+                               GENERATED_GBL_DATA_SIZE)
+
 #define CONFIG_STACKSIZE       (32*1024)       /* regular stack */
 
 #ifdef CONFIG_USE_IRQ


More information about the U-Boot mailing list