[openfirmware] Porting OFW to custom hardware

R&D4 r&d4 at dave-tech.it
Tue May 27 19:25:04 CEST 2008


Dear Mitch,

Mitch Bradley wrote:
> I agree, your random crashes sound like memory timing problems.
> 
> After a page fault, you can find out what what happening by typing:
> 
> ok .registers
> ok ftrace
> 
> That is especially helpful for tracking down repeatable problems, but 
> might not be useful for your current random problem.

I agree too.
I also add 'test /cpu' in my build and I've seen that sometimes it does 
not complete the test and the board reboot.

> 
> You might try
> 
> ok memtest

I got:

ok memtest
memtest ?

so I thinks that 'memtest' is not included in my configuration.
I tried to include 'memtest86' (is it the same?) which is included in 
OLPC (correct me if I'm wrong, of course)

I add memtest86 in build/Makefile and add the changes that I can 
identify between OLPC and Neptune (my platform started from lx-devel)
When building I have the following output:

./build neptune.rom
--- ${BP}/cpu/x86/pc/neptune/config.fth is newer than the target file 
neptune.rom
--- ${BP}/cpu/x86/pc/neptune/config.fth is newer than the target file fw.img
--- Rebuilding fw.img
--- Cmd: 
/home/shared/devel/neptune/sw/ofw/openfirmware.git/cpu/x86/Linux/x86forth 
/home/shared/devel/neptune/sw/ofw/openfirmware.git/cpu/x86/build/basefw.dic 
../fw.bth

${BP}/cpu/x86/pc/memtest.fth:9: config-l@ ?
${BP}/cpu/x86/pc/memtest.fth:13: ?linux-elf-map-in ?
${BP}/cpu/x86/pc/memtest.fth:15: elf-map-in ?
make: *** [neptune.rom] Error 1

Does it means that "config-l@" and "elf-map-in" are undefined?
Can you give me some clue in what I'm missing?
(I'm a Forth beginner too, of course.. ;-) )


I also try with:

ok test /memory
Testing memory at: 0f697000 size 000f2000
Testing memory at: 00100000 size 0f4fd000
Testing memory at: 00002000 size 0009e000
ok

But it's a bit "too fast" to be a "real" memory test.. maybe I'm missing 
something ;-)

> 
> [snip]
> You can adapt this technique for whatever settings you need to tune.
> 

Thanks for the clue Mitch, maybe I'll use this tecnique in the next few 
days.

BTW, I change some PLL and SDRAM setting and OFW is somehow stable now. 
I can boot Linux from and USB key:

ok probe-usb
USB2 devices:
/pci/usb at f,5/scsi at 0,0
/pci/usb at f,5/scsi at 0,0/disk
USB1 devices:
ok dir u:
fat-file-system
--A-rwxrwxrwx     72388  2008-05-27 16:10:30  MEMTEST
--A-rwxrwxrwx   1474560  2008-05-27 10:35:24  ROOT.IMG
--A-rwxrwxrwx   1715312  2008-05-26 18:54:00  BZIMAGE
--A-rwxrwxrwx    599474  2008-05-27 16:49:06  INITRD.IMG
ok boot u:\bzImage console=uart,io,0x3f8,115200
Boot device: /usb/disk:\bzImage  Arguments: 
console=uart,io,0x3f8,115200Boot dev
ice: /usb/disk:\bzImage  Arguments: console=uart,io,0x3f8,115200
Linux version 2.6.26-rc3-00285-gf556f19-dirty (amon at linuxserver2) (gcc 
version 3
.4.6 20060404 (Red Hat 3.4.6-3)) #21 Mon May 26 18:53:59 CEST 2008
BIOS-provided physical RAM map:
  BIOS-e801: 0000000000000000 - 000000000009f000 (usable)
  BIOS-e801: 0000000000100000 - 000000000f5fd000 (usable)
Early serial console at I/O port 0x3f8 (options '115200')
console [uart0] enabled
245MB LOWMEM available.
Zone PFN ranges:
   DMA             0 ->     4096
   Normal       4096 ->    62973
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
     0:        0 ->    62973

I 'still dont have an ethernet device on this board so I tried to have 
root on:
* USB key: no success (this has nothing to do with OFW, of course ;-) )
* ramdisk

For the latter I follow the instruction here:

http://wiki.laptop.org/go/Forth_Lesson_12#Linux_Ramdisk

but I have "some trouble":

ok probe-usb
USB2 devices:
/pci/usb at f,5/scsi at 0,0
/pci/usb at f,5/scsi at 0,0/disk
USB1 devices:
ok dir u:
fat-file-system
--A-rwxrwxrwx     72388  2008-05-27 16:10:30  MEMTEST
--A-rwxrwxrwx   1474560  2008-05-27 10:35:24  ROOT.IMG
--A-rwxrwxrwx   1715312  2008-05-26 18:54:00  BZIMAGE
--A-rwxrwxrwx    599474  2008-05-27 16:49:06  INITRD.IMG
ok setenv ramdisk u:\initrd.img
ramdisk =             u:\initrd.img
ok boot u:\bzImage console=uart,io,0x3f8,115200
Boot device: /usb/disk:\bzImage  Arguments: 
console=uart,io,0x3f8,115200Boot dev
ice: /usb/disk:\bzImage  Arguments: console=uart,io,0x3f8,115200
Loading ramdisk image from u:\initrd.img ...

and the system hang (no messages on UART, no reboot)
I think this has something to do with ramdisk loading address (that 
maybe overwrite kernel itself) but I don't really know where to look.. 
any clue?

Thanks in advance and Best Regards,

-- 

Andrea

DAVE Srl - Electronics System House
e-mail address: r&d4 at dave-tech.it


> R&D4 wrote:
>>
>> Dear Mitch,
>>
>> Mitch Bradley wrote:
>>> R&D4 wrote:
>>>> Is this correct?
>>>
>>> That's a good start.
>>
>> Thanks! ;-)
>>
>>>> Of couse, it's a bit hard for me to figure out, for example, where 
>>>> to look for some basic initialization (e.g. PLL, SDRAM, memory 
>>>> mapping).
>>>
>>> I assume you are using the version that I checked in yesterday, that 
>>> removes the olpc dependencies from the lxdevel build.  If not, switch 
>>> to that version.  It will be much easier to work with.
>>
>> Yes, I checkout the latest release (from the dwmw2's git repository 
>> here: http://git.infradead.org/?p=openfirmware.git;a=summary).
>> This is easier then svn for us because we already use git internally.
>>
>>> The PLL init is in "rmstart.fth" - that is "real mode start", which 
>>> is [snip]
>>
>> Thank you very much for this precious informations!
>> Now I'm able to:
>> * enable serial port
>> * boot OFW on our custom board
>>
>> I was also able to remove keyboard initialization from startup and 
>> also able to start debugging some simple Forth programs.
>>
>> There are still some problems (IMHO in my PLL or SDRAM inits) because 
>> I have some weird and random problem like:
>>
>> +cs
>> Type 'i' to interrupt stand-init sequence
>> ff04cfc0  Page Fault
>> ok
>>
>> or
>>
>> Type 'i' to interrupt stand-init sequence
>>
>> Welcome to Dave Neptune
>> Interactive boot
>> Evaluating: master-probe
>> Inflate size error
>> ok
>>
>> When everything goes "well" I got
>>
>> þ+cs
>> Type 'i' to interrupt stand-init sequence
>>
>> Welcome to Dave Neptune
>> Interactive boot
>> USB probe
>> USB2 devices:
>> USB1 devices:
>> Failed to set device address: 1
>> Type any key to interrupt automatic startup
>> Type 'help' for more information.
>>
>> ok
>>
>> and a fully functional shell (but also some random reboots ;-) )
>>
>> I'll keep you informed about the porting status.
>>
>>>>
>>>> AFAIK the "official" documentation is here:
>>>>
>>>> http://www.firmworks.com/open_firmware/literature/
>>>>
>>>> among these documents is there also a guide for porting OFW or about 
>>>> OFW "internals"? ("Open Firmware Command Reference" seems the 
>>>> closest to my needs)
>>>
>>> We did a porting guide for an ARM platform, but we haven't done one 
>>> for x86.   The command reference has a lot of useful information that 
>>> is machine independent.  There is also a manual for how to write 
>>> FCode drivers.  It explains how the device interface works.
>>
>> Thanks, we will buy them soon!
>>
>> Best Regards,




More information about the openfirmware mailing list