[U-Boot] {Spam?} skip relocation

Marcel korgull at home.nl
Sun Jan 2 20:47:27 CET 2011


On Sunday, January 02, 2011 08:00:38 pm Marcel wrote:
> On Sunday, January 02, 2011 07:35:50 pm Marcel wrote:
> > On Sunday, January 02, 2011 10:07:44 am Marcel wrote:
> > > On Saturday, January 01, 2011 11:52:21 pm Albert ARIBAUD wrote:
> > > > Le 01/01/2011 16:31, Marcel a écrit :
> > > > > Hi,
> > > > > 
> > > > > In my previous working version of U-boot I used
> > > > > CONFIG_SKIP_RELOCATION but this doesn't seem to work any more.
> > > > > 
> > > > > Any reason why it doesn't work any more ?
> > > > > Is there another way to skip relocation ?
> > > > 
> > > > It actually has no sense any more. The current code skips the
> > > > relocation if, and only if, U-boot is already running at its final
> > > > destination.
> > > > 
> > > > Trying to run U-boot without relocating and without being at the
> > > > link-time address would not work.
> > > 
> > > OK, that does make sense.
> > > 
> > > In my case u-boot is in NOR.
> > > What do I need to boot from NOR ?
> > 
> > Is there any example that boots from NOR ?
> 
> Below is the config I used about 2-3 month ago. Perhaps anyone has a hint
> how to make it work with the current relocation code ?
> 
> #define CONFIG_ARM926EJS	1	/* This is an ARM926EJS Core */
> #define CONFIG_ICNOVA_ARM9	1	/* It's an  ICnova SAM9G45 OEM boardR */
> #define CONFIG_AT91SAM9G45	1	/* It's an Atmel AT91SAM9G45 SoC */
> #define CONFIG_AT91_LEGACY      1       /* needed for some defines */
> #define CONFIG_ARCH_CPU_INIT
> #undef CONFIG_USE_IRQ			/* we don't need IRQ/FIQ stuff	*/
> 
> /* USB Host */
> #define CONFIG_USB_ATMEL		1
> //#define CONFIG_USB_EHCI			1
> #define CONFIG_USB_OHCI_NEW		1
> #define CONFIG_SYS_USB_OHCI_CPU_INIT	1
> #define CONFIG_SYS_USB_OHCI_REGS_BASE	0x00700000
> #define CONFIG_SYS_USB_OHCI_SLOT_NAME	"at91sam9g45"
> #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	1
> #define CONFIG_DOS_PARTITION		1
> #define CONFIG_USB_STORAGE		1
> 
> /* USB gadget support for Ethernet over USB */
> #define CONFIG_USB_GADGET_ATMEL_USBA  1
> #define CONFIG_ARCH_AT91	      1
> #define CONFIG_USB_GADGET	      1
> #define CONFIG_USB_ETHER	      1
> #define CONFIG_USBNET_MANUFACTURER      "Atmel AT91SAM9G45"
> #define CONFIG_USBNET_DEV_ADDR		"8e:28:0f:fa:3c:39"
> #define CONFIG_USBNET_HOST_ADDR		"0a:fa:63:8b:e8:0a"
> #define CONFIG_USB_CDC_VENDOR_ID        0x0525
> #define CONFIG_USB_CDC_PRODUCT_ID       0xa4a1
> #define CONFIG_USB_RNDIS_VENDOR_ID      0x0525
> #define CONFIG_USB_RNDIS_PRODUCT_ID     0xa4a2
> 
> 
> #include <asm/arch/memory-map.h>
> /* ARM asynchronous clock */
> #define CONFIG_SYS_AT91_MAIN_CLOCK	12000000 /* from 12 MHz crystal */
> #define CONFIG_SYS_HZ			1000
> 
> #define CONFIG_ARCH_CPU_INIT
> 
> #define CONFIG_CMDLINE_TAG	1	/* enable passing of ATAGs */
> #define CONFIG_SETUP_MEMORY_TAGS 1
> #define CONFIG_INITRD_TAG	1
> 
> #define CONFIG_SKIP_LOWLEVEL_INIT
> #define CONFIG_SKIP_RELOCATE_UBOOT
> 
> /*
>  * Hardware drivers
>  */
> #define CONFIG_AT91_GPIO	1
> #define CONFIG_ATMEL_USART	1
> #undef CONFIG_USART0
> #undef CONFIG_USART1
> #undef CONFIG_USART2
> #define CONFIG_USART3		1	/* USART 3 is DBGU */
> 
> #define CONFIG_SYS_USE_NANDFLASH	1
> 
> /* LED */
> #define CONFIG_AT91_LED
> #define	CONFIG_RED_LED		AT91_PIN_PD31	/* this is the user1 led */
> #define	CONFIG_GREEN_LED	AT91_PIN_PD0	/* this is the user2 led */
> 
> #define CONFIG_BOOTDELAY	3
> 
> /*
>  * Command line configuration.
>  */
> #include <config_cmd_default.h>
> #define CONFIG_CMD_ASKENV
> #undef CONFIG_CMD_FPGA
> #undef CONFIG_CMD_IMLS
> 
> #define CONFIG_CMD_NAND		1
> #define CONFIG_CMD_USB		1
> 
> /* SDRAM */
> #define CONFIG_NR_DRAM_BANKS		1
> #define PHYS_SDRAM			0x70000000
> #define PHYS_SDRAM_SIZE			0x08000000	/* 128 megs */
> #define CONFIG_SYS_GBL_DATA_SIZE	128
> #define INTERNAL_SRAM_BASE		0x00300000
> #define INTERNAL_SRAM_SIZE		0x00010000
> #define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM
> #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START +
> PHYS_SDRAM_SIZE)
> #define CONFIG_SYS_INTRAM_BASE		INTERNAL_SRAM_BASE
> #define CONFIG_SYS_INTRAM_SIZE		INTERNAL_SRAM_SIZE
> #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
> #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_INTRAM_BASE +
> CONFIG_SYS_INTRAM_SIZE)
> #define CONFIG_SYS_MALLOC_LEN		(256*1024)
> #define CONFIG_SYS_DMA_ALLOC_LEN	(16384)
> /* Allow 4MB for the kernel run-time image */
> #define CONFIG_SYS_LOAD_ADDR			(PHYS_SDRAM + 0x00400000)
> #define CONFIG_SYS_BOOTPARAMS_LEN		(16 * 1024)
> 
> /* NAND flash */
> #define CONFIG_CMD_MTDPARTS             1
> #define CONFIG_MTD_DEVICE		1
> #define CONFIG_NAND_MAX_CHIPS		1
> //#define CONFIG_NAND_ATMEL
> #define CONFIG_SYS_MAX_NAND_DEVICE	1
> #define CONFIG_SYS_NAND_BASE		0x40000000
> #define CONFIG_SYS_NAND_DBW_8		1
> /* our ALE is AD21 */
> #define CONFIG_SYS_NAND_MASK_ALE	(1 << 21)
> /* our CLE is AD22 */
> #define CONFIG_SYS_NAND_MASK_CLE	(1 << 22)
> #define CONFIG_SYS_NAND_ENABLE_PIN	AT91_PIO_PORTC, 8
> #define CONFIG_SYS_NAND_READY_PIN	AT91_PIO_PORTD, 11
> 
> 
> /* Ethernet */
> #define CONFIG_MACB			1
> #define CONFIG_RMII			1
> #define CONFIG_NET_MULTI		1
> #define CONFIG_NET_RETRY_COUNT		20
> #define CONFIG_RESET_PHY_R		1
> #define CONFIG_NET_DO_NOT_TRY_ANOTHER	1
> #define CONFIG_OVERWRITE_ETHADDR_ONCE	1
> #define CONFIG_CMD_DHCP                 1
> #define CONFIG_CMD_PING		        1
> #define CONFIG_MACB_SEARCH_PHY          1
> /*
>  * BOOTP options
>  */
> #define CONFIG_BOOTP_BOOTFILESIZE	1
> #define CONFIG_BOOTP_BOOTPATH		1
> #define CONFIG_BOOTP_GATEWAY		1
> #define CONFIG_BOOTP_HOSTNAME		1
> #define CONFIG_BOOTP_SUBNETMASK
> 
> /* NOR flash */
> #define CONFIG_CMD_JFFS2                1
> #define CONFIG_SYS_FLASH_SIZE		0x00100000
> #define CONFIG_SYS_FLASH_SECT		8
> #define CONFIG_SYS_FLASH_CFI			1
> #define CONFIG_FLASH_CFI_DRIVER			1
> #define PHYS_FLASH_1				0x10000000
> #define CONFIG_SYS_FLASH_BASE			PHYS_FLASH_1
> #define CONFIG_SYS_MAX_FLASH_SECT		8
> #define CONFIG_SYS_MAX_FLASH_BANKS		1
> 
> #define CONFIG_SYS_MONITOR_SEC	1:0-7
> #define CONFIG_SYS_MONITOR_BASE	CONFIG_SYS_FLASH_BASE
> #define CONFIG_SYS_MONITOR_LEN	(256 << 10)
> #define CONFIG_ENV_IS_IN_FLASH	1
> #define CONFIG_ENV_SIZE		0x20000
> #define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + 0x000E0000)
> 
> #define MTDIDS_DEFAULT		"nand0=nand.0"
> #define MTDPARTS_DEFAULT       
> "mtdparts=nand.0:2M(kernel),16M(root),-(Data)" #undef CONFIG_BOOTARGS
> #undef CONFIG_BOOTCOMMAND
> 
> #define CONFIG_BOOTARGS		"root=1F01 rootfstype=jffs2"
> #define CONFIG_BOOTCOMMAND	\
> 	"mtdparts default; nand read 0x71000000 nand0,0; bootm 0x71000000"
> 
> #define CONFIG_BAUDRATE			115200
> #define CONFIG_SYS_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600  }
> 
> #define CONFIG_SYS_PROMPT		"Sam9> "
> #define CONFIG_SYS_CBSIZE		256
> #define CONFIG_SYS_MAXARGS		16
> #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE +
> sizeof(CONFIG_SYS_PROMPT) + 16)
> #define CONFIG_SYS_LONGHELP		1
> #define CONFIG_CMDLINE_EDITING		1
> #define CONFIG_AUTO_COMPLETE		1
> #define CONFIG_SYS_HUSH_PARSER
> #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
> 
> /*
>  * Size of malloc() pool
>  */
> #define CONFIG_SYS_GBL_DATA_SIZE	128 /* 128 bytes for initial data */
> 
> #define CONFIG_STACKSIZE		(16*2048)	/* regular stack */
> 
> #ifdef CONFIG_USE_IRQ
> #error CONFIG_USE_IRQ not supported
> #endif
> 
> #endif


Forgot to mention a few items :

I flash the NOR at address 0x10020000
TEXT_BASE is 0x10020000

I'm about to give up on this code and move back to older code of 2-3 months 
ago where things worked well. 

My feeling is that I miss something very simple, but I'm looking for it for 
days now and will give up on it by tomorrow and move back to old u-boot code 
of 2-3 months ago just to continue what I really want to get done (making USB 
device work).

Best regards,
Marcel











More information about the U-Boot mailing list