<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Kumar,<div><br></div><div>The assertion errors you are seeing when not setting the physical and virtual memory regions correctly are perfectly normal, they are simply ensuring alignment is sane.</div><div><br></div><div>You should be able to determine the correct physical region/s from your board's datasheets.</div><div><br></div><div>Also note that when setting base_vaddr, it should be identical to the base of your virtual region!</div><div><br></div><div>As for the bad register writes, the address looks like some device exists at that physical address. Maybe check your datasheet for some hints?</div><div><br></div><div>I would suggest the following to begin debugging:</div><div>1) If you qemu has some logging or execution tracing available, turn it on and analyse the trace.</div><div>2) Do some low-level serial printing from within the kernel, i.e. writing directly to serial registers.</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hope this helps,</div><div>Jonathan Sokolowski</div></div></span></div></span></span>
</div>
<br><div><div>On 17/09/2009, at 9:06 AM, Kumar Sanghvi wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi All,<br><br>I need some help with SoC porting part.<br>I have written some code for OKL4 3.0 port for Beagleboard. The code is compiling fine and generating images.<br>I try to load the image in Qemu-omap3 simulator and it exits with below error message:-<br>
"Unassigned mem writew 48070008 = 0xffff pc 80e9b298"<br><br>I try to load the image on Beagleboard and nothing comes on serial terminal.<br><br>It is very possible that my serial code is not written correctly. But, since the simulator is exiting with some memory related messages, I am doubtful if I have set the parameters for<br>
-memory[physical], memory[virtual] and vbase_address correctly.<br><br><br><br>Following is the build command-line. The below error message comes if I don't specify or wrongly specify values for memory[virtual] and vbase_address in arch/arm/tools/machines.py for the cortexa8 definition:-<br>
========================================================================================================================================================<br><span style="color: rgb(0, 0, 153);">[root@localhost okl4_3.0-armv6]# ./tools/build.py MACHINE=beagle PROJECT=examples EXAMPLE=hello TOOLCHAIN=gnu_arm_eabi_toolchain pistachio.TOOLCHAIN=gnu_arm_toolchain PYFREEZE=false kdb_serial=true kdb_breakin=false debug_trace=5 verbose_init=true</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">scons: Reading SConscript files ...</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">scons: done reading SConscript files.</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">scons: Building targets ...</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">[ELF ] build/images/image.elf</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">Error: </span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">Now printing a traceback.</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">Traceback (most recent call last):</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp; File "tools/pyelf/elfweaver.py", line 79, in ?</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; main(sys.argv)</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp; File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-porting/okl4_3.0-armv6/tools/pyelf/weaver/main.py", line 108, in main</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; __commands__[args[1]](args[2:])</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp; File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-porting/okl4_3.0-armv6/tools/pyelf/weaver/merge.py", line 270, in merge_cmd</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; merge(spec_file, options)</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp; File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-porting/okl4_3.0-armv6/tools/pyelf/weaver/merge.py", line 166, in merge</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; namespace, image)</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp; File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-porting/okl4_3.0-armv6/tools/pyelf/weaver/merge.py", line 103, in collect_image_objects</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; pool.collect_xml(el, machine, pools)</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp; File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-porting/okl4_3.0-armv6/tools/pyelf/weaver/pools.py", line 128, in collect_xml</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; pools.add_physical_memory(<a href="http://self.name/">self.name</a>, machine, src=src, base=base, size=size)</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp; File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-porting/okl4_3.0-armv6/tools/pyelf/weaver/pools.py", line 574, in add_physical_memory</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; self.physical_pools[physpool].add_memory(base, size, mem_type)</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp; File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-porting/okl4_3.0-armv6/tools/pyelf/weaver/allocator.py", line 352, in add_memory</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; assert size % self.min_alloc == 0</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">AssertionError</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">scons: *** [build/images/image.elf] Error 1</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">scons: building terminated because of errors.</span><br style="color: rgb(0, 0, 153);">
========================================================================================================================================================<br><br>I then set the following values and build compiles fine generating image<br>
<br><span style="color: rgb(0, 0, 153);">=&gt;platform/omap3530/tools/machines.py:</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp; memory[physical] = [Region(0x80000000, 0x82000000)]</span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">=&gt;arch/arm/tools/machines.py</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp; class armv7(arm):</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; memory = arm.memory.copy()</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; #memory['virtual'] = [Region(0x1000, 0xe0000000)] # Trap NULL pointer derefs.</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; base_vaddr = 0x10000000</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; memory['virtual'] = [Region(0x1000, 0xd0000000)] # Trap NULL pointer derefs.</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; #memory['virtual'] = [Region(0x80000000, 0xd0000000)] # Trap NULL pointer derefs.</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; #memory['virtual'] = [Region(0x1000, 0xe0000000)] # Trap NULL pointer derefs.</span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp; class armv7a(armv7):</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; cpp_defines = armv7.cpp_defines + [("__ARMv__", 7), "__ARMv7A__"]</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp; arch_version = 7</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp; class cortexa8(armv7a):</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_flags = armv7a.c_flags</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpu = "cortexa8"</span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><br>======================================================================================================================================================================<br>I have attached readelf output for the generated elf image with this mail.<br>
<br><span style="color: rgb(0, 0, 153);"></span><br>=======================================================================================================================================================================<br>
<br>Below is sequence of output from qemu-omap3 simulator<br><br>omap3-sim output:-<br><br><span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050c00</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050c04</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050c8c</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050c98</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050c9c</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050cac</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050cbc</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">omap_venc_write: Bad register 0x48050cc0</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">omap_diss_write: Bad register 0x48050044</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">omap_diss_write: Bad register 0x48050048</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">omap_diss_write: Read-only register 0x48050050</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">omap_diss_write: Read-only register 0x48050058</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">omap_disc_write: Bad register 0x48050414</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">omap_disc_write: Bad register 0x480504a8</span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);">At this point, u-boot prompt is available and I give below command at u-boot prompt:-<br><span style="color: rgb(0, 0, 153);">beagleboard#mmcinit;fatload mmc 0 80000000 image.elf;go 80000000</span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">The simulator simply exits with below line:-</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">Unassigned mem writew 48070008 = 0xffff pc 80e9b298&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb(0, 0, 0);"> //This error message might indicate something</span></span><br style="color: rgb(0, 0, 153);">
[root@localhost arm-softmmu]# <br><br>==============================================================================================================================================================<br><br><br>So, at this point, below are some possible failure points:-<br>
1. Parameters for memory[physical],memory[virtual] and base_vaddress are wrongly given, so memory layout is not proper in the generated elf file.<br>2. u-boot arguments given are wrong.<br>3. Serial code written in platform/omap3530/pistachio/kdb/console.c is wrong, as nothing is coming on screen. <br>
4. If serial code is fine, and considering that build is made with 'verbose_init=true', atleast some output should come from arch/arm/pistachio/src/init.cc file.<br>&nbsp;&nbsp; But as nothing is coming on screen, not sure what is happenning.<br>
<br>Really not able to make out where to start debugging / troubleshooting at this point.<br>Please help with any suggestions / advise.<br><br>Thanks,<br>Kumar.<br>
<span>&lt;Beagle-readelf-output.rtf&gt;</span>_______________________________________________<br>Developer mailing list<br><a href="mailto:Developer@okl4.org">Developer@okl4.org</a><br>https://lists.okl4.org/mailman/listinfo/developer<br></blockquote></div><br></div></body></html>