[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Hang in machine_early_init



I am having a problem with hanging after copying code in
machine_early_int.  The code flow is given at the bottom.  Notice that I
added out some print statements which give the following lines

	FS-BOOT: Booting image...
	Found romfs @ 0x3018a000 (0x000f6000)
	#### klimit 3019d000 ####
	Moving 0x000f6000 bytes from 0x3018a000 to 0x3019cf20
	New klimit: 0x30293000
	MemSet1 __bss_start 0x3018a000
	MemSet1 __bss_stop 0x3019cf20
	MemSet1 __bss_stop-__bss_start 0x12f20



However, I have some concerns about this range of memory.  Since I am
not using a boot loader, I just copied image.bin from 0x3000_0000 to
0x3028_0026 and then branched to 0x3000_0000.  So the below code seems
to be deleting parts of the downloaded code.  This, I expect is my
problem and I need to re-locate portions of this code.  I was under the
impression, that I should just be able to call this image and it will
relocate itself.  I may be wrong here...  

How do I fix this, without using U-BOOT?


Ken 



void machine_early_init(const char *cmdline)
{
	unsigned long *src, *dst = (unsigned long *)0x0;

#ifdef CONFIG_MTD_UCLINUX_EBSS
	{
		int size;
		extern char *klimit;
		extern char *_ebss;

		/* if CONFIG_MTD_UCLINUX_EBSS is defined, assume ROMFS
is at the
		 * end of kernel, which is ROMFS_LOCATION defined above.
*/
		//size = romfs_get_size((struct romfs_super_block
*)__init_end);
		size = PAGE_ALIGN(get_romfs_len(get_romfs_base()));
		early_printk("Found romfs @ 0x%08x (0x%08x)\n",
				get_romfs_base(), size);
		early_printk("#### klimit %p ####\n", klimit);
		BUG_ON(size < 0); /* What else can we do? */

		/* Use memmove to handle likely case of memory overlap
*/
		early_printk("Moving 0x%08x bytes from 0x%08x to
0x%08x\n",
			size, get_romfs_base(), &_ebss);
		memmove(&_ebss, get_romfs_base(), size);

		/* update klimit */
		klimit += PAGE_ALIGN(size);
		early_printk("New klimit: 0x%08x\n",klimit);
	}
#endif

	early_printk("MemSet1 __bss_start 0x%x \n",__bss_start);
	early_printk("MemSet1 __bss_stop 0x%x \n",__bss_stop);
	early_printk("MemSet1 __bss_stop-__bss_start 0x%x
\n",__bss_stop-__bss_start);
	memset(__bss_start, 0, __bss_stop-__bss_start);  <<---- LAST
CODE EXECUTED
	early_printk("MemSet2\n");	 <<--- THIS CODE DOES NOT APPEAR
EXECUTED
	memset(_ssbss, 0, _esbss-_ssbss);

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/