[okl4-developer] Help with SoC Porting
Jonathan Sokolowski
jsok at ok-labs.com
Thu Sep 17 09:56:39 EST 2009
Hi Kumar,
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.
You should be able to determine the correct physical region/s from
your board's datasheets.
Also note that when setting base_vaddr, it should be identical to the
base of your virtual region!
As for the bad register writes, the address looks like some device
exists at that physical address. Maybe check your datasheet for some
hints?
I would suggest the following to begin debugging:
1) If you qemu has some logging or execution tracing available, turn
it on and analyse the trace.
2) Do some low-level serial printing from within the kernel, i.e.
writing directly to serial registers.
Hope this helps,
Jonathan Sokolowski
On 17/09/2009, at 9:06 AM, Kumar Sanghvi wrote:
> Hi All,
>
> I need some help with SoC porting part.
> I have written some code for OKL4 3.0 port for Beagleboard. The code
> is compiling fine and generating images.
> I try to load the image in Qemu-omap3 simulator and it exits with
> below error message:-
> "Unassigned mem writew 48070008 = 0xffff pc 80e9b298"
>
> I try to load the image on Beagleboard and nothing comes on serial
> terminal.
>
> 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
> -memory[physical], memory[virtual] and vbase_address correctly.
>
>
>
> 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:-
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> [root at 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
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> [ELF ] build/images/image.elf
> Error:
> Now printing a traceback.
>
> Traceback (most recent call last):
> File "tools/pyelf/elfweaver.py", line 79, in ?
> main(sys.argv)
> File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-
> porting/okl4_3.0-armv6/tools/pyelf/weaver/main.py", line 108, in main
> __commands__[args[1]](args[2:])
> File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-
> porting/okl4_3.0-armv6/tools/pyelf/weaver/merge.py", line 270, in
> merge_cmd
> merge(spec_file, options)
> File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-
> porting/okl4_3.0-armv6/tools/pyelf/weaver/merge.py", line 166, in
> merge
> namespace, image)
> 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
> pool.collect_xml(el, machine, pools)
> File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-
> porting/okl4_3.0-armv6/tools/pyelf/weaver/pools.py", line 128, in
> collect_xml
> pools.add_physical_memory(self.name, machine, src=src,
> base=base, size=size)
> 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
> self.physical_pools[physpool].add_memory(base, size, mem_type)
> File "/home/kumar/Hypervisor/OKL/experimental-okl4-30-beagleboard-
> porting/okl4_3.0-armv6/tools/pyelf/weaver/allocator.py", line 352,
> in add_memory
> assert size % self.min_alloc == 0
> AssertionError
>
> scons: *** [build/images/image.elf] Error 1
> scons: building terminated because of errors.
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
>
> I then set the following values and build compiles fine generating
> image
>
> =>platform/omap3530/tools/machines.py:
> memory[physical] = [Region(0x80000000, 0x82000000)]
>
> =>arch/arm/tools/machines.py
> class armv7(arm):
> memory = arm.memory.copy()
> #memory['virtual'] = [Region(0x1000, 0xe0000000)] # Trap NULL
> pointer derefs.
> base_vaddr = 0x10000000
> memory['virtual'] = [Region(0x1000, 0xd0000000)] # Trap NULL
> pointer derefs.
> #memory['virtual'] = [Region(0x80000000, 0xd0000000)] # Trap
> NULL pointer derefs.
> #memory['virtual'] = [Region(0x1000, 0xe0000000)] # Trap NULL
> pointer derefs.
>
> class armv7a(armv7):
> cpp_defines = armv7.cpp_defines + [("__ARMv__", 7), "__ARMv7A__"]
> arch_version = 7
>
> class cortexa8(armv7a):
> c_flags = armv7a.c_flags
> cpu = "cortexa8"
>
>
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> I have attached readelf output for the generated elf image with this
> mail.
>
>
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
>
> Below is sequence of output from qemu-omap3 simulator
>
> omap3-sim output:-
>
> omap_venc_write: Bad register 0x48050c00
> omap_venc_write: Bad register 0x48050c04
> omap_venc_write: Bad register 0x48050c8c
> omap_venc_write: Bad register 0x48050c98
> omap_venc_write: Bad register 0x48050c9c
> omap_venc_write: Bad register 0x48050cac
> omap_venc_write: Bad register 0x48050cbc
> omap_venc_write: Bad register 0x48050cc0
> omap_diss_write: Bad register 0x48050044
> omap_diss_write: Bad register 0x48050048
> omap_diss_write: Read-only register 0x48050050
> omap_diss_write: Read-only register 0x48050058
> omap_disc_write: Bad register 0x48050414
> omap_disc_write: Bad register 0x480504a8
>
> At this point, u-boot prompt is available and I give below command
> at u-boot prompt:-
> beagleboard#mmcinit;fatload mmc 0 80000000 image.elf;go 80000000
>
> The simulator simply exits with below line:-
> Unassigned mem writew 48070008 = 0xffff pc
> 80e9b298 //This error message might indicate
> something
> [root at localhost arm-softmmu]#
>
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
>
>
> So, at this point, below are some possible failure points:-
> 1. Parameters for memory[physical],memory[virtual] and base_vaddress
> are wrongly given, so memory layout is not proper in the generated
> elf file.
> 2. u-boot arguments given are wrong.
> 3. Serial code written in platform/omap3530/pistachio/kdb/console.c
> is wrong, as nothing is coming on screen.
> 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.
> But as nothing is coming on screen, not sure what is happenning.
>
> Really not able to make out where to start debugging /
> troubleshooting at this point.
> Please help with any suggestions / advise.
>
> Thanks,
> Kumar.
> <Beagle-readelf-
> output.rtf>_______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20090917/0ddb4e3d/attachment.htm
More information about the Developer
mailing list