Hello Zoltan, hey list,
On Mon, Nov 21, 2016 at 07:15:21PM +0100, BALATON Zoltan wrote:
> ...
> For forth commands I've found this page useful (not sure if this is linked
> from somewhere):
> http://www.firmworks.com/QuickRef.html
Thank you, I found this (and more) last week. The OLPC sites are the
best for me:
1: http://wiki.laptop.org/go/Open_Firmware
2: http://wiki.laptop.org/go/Forth_Lessons
3: http://wiki.laptop.org/go/Cross_Compiling_Open_Firmware
> ...
> This is a bit confusing. There are multiple implementations of the IEEE
> standard (commonly referred to as Open Firmware) and one of these is also
> called Open Firmware. These are listed under Implementations on the left of
> the page at www.openfirmware.info. Another implementation used by QEMU for
Yes and I looked at them. But they are either very old or not usable for
ppc (too much work to implement a new arch).
> ...
> talking about Open Firmware: the standard or the implementation with the
> same name.
One thing is left which confuses me: In wikipedia and you say, that you
use the name "Open Firmware" (also, besides as name for a standard) for
an implementation. OK.
But the website gives the impression (and G 3 says), that the implementation
has the name "OpenBIOS"...
So I have two statements which don't fit well. Please remember that I am
new to this and did not live through the history.
> ...
> Actually running OpenBIOS on real hardware is not something that is well
> tested (I'm not sure if it was ever tried but I think it wasn't done
> recently) so if you try to do that be prepared for likely needing some
The OLPC project did it, e.g.
> fixing. This is true for any implementation that does not support the
> hardware you want to run it on, then you likely need to port it.
That there will be the need for porting was clear.
> ...
> it's enough to have the basics in there. Not sure how much up to date is
> this but this is discussed in the kernel documentation here:
> https://www.kernel.org/doc/Documentation/devicetree/booting-without-of.txt
>
Thank you, I missed this source.
> As for giving the device tree to OpenBIOS I think it should just know it or
> construct it from discovering the hardware as the point of the device tree
> is to describe the hardware for the operating system so the firmware should
> know the hardware and provide the device tree. It does not get it from
The "firmware" is our handmade init-assemblercode. It has to enable the
machine (beginning from Adam...) to run C-code in its RAM.
If there is no software-interface, then we provide the device-tree maybe in
forth or in a blob. Just thinking loudly.
> ...
> In fact OpenBIOS does not have that many drivers but maybe the basics are
> there, only the platform specific init code might need to be adapted for a
That would be very nice. We give it a try. Maybe with help from you / the
list.
> new board. For ppc these would be in arch/ppc. Running on QEMU is quite a
> bit simpler as we can skip a lot of init code (such as memory controller or
> other hardware) so maybe these are not well implemented or buggy as they
> were not tested with real hardware for a while.
> ...
Did you use OpenBIOS in a recent qemu and have you been able to remote-debug
it there? I was able to load and run the old OpenBIOS code (from svn repo)
on "qemu-system-ppc".
Thank you for your time and suggestions, greetings,
Michael
QEMU emulates two of the three PCI buses found on real hardware because
some clients seem to need both and fail with only one present, but
OpenBIOS only handles a single PCI bus and initialises and puts in the
device tree only one of these: the second one which is where devices are
connected and also marks it bus 0. However, clients getting info from the
device tree may not know about this and thinking there is only one PCI
bus they erroneously use the address of the first bus to access PCI
config registers for devices on the second bus which silently fails as
these requests will go to the other empty bus emulated and return invalid
values. Devices mapped via MMIO still appear to work but they may not be
correctly initialised and some cards are not detected because of this.
Until support for multiple PCI buses is implemented add an empty node in
the device tree for the uninitialised bus to let clients know about it.
This is still not entirely correct as bus-range property does not match
real hardware but this fixes detecting PCI devices (such as USB) under
MorphOS and may also fix enabling the bus master bit needed with some
network cards and allow the workarund for this to be reverted.
Signed-off-by: BALATON Zoltan <balaton(a)eik.bme.hu>
---
arch/ppc/qemu/tree.fs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/ppc/qemu/tree.fs b/arch/ppc/qemu/tree.fs
index 5b6bbc6..e1708de 100644
--- a/arch/ppc/qemu/tree.fs
+++ b/arch/ppc/qemu/tree.fs
@@ -50,6 +50,18 @@ new-device
h# ff800000 encode-int encode+ " ranges" property
finish-device
+\ Add empty node for first pci bus
+\ Remove this when pci driver is fixed to handle multiple buses
+new-device
+ " pci" device-name
+ " pci" device-type
+ h# f0000000 encode-int 02000000 encode-int encode+ " reg" property
+ 3 encode-int " #address-cells" property
+ 2 encode-int " #size-cells" property
+ 1 encode-int " #interrupt-cells" property
+ 0 encode-int 0 encode-int encode+ " bus-range" property
+finish-device
+
\ -------------------------------------------------------------
\ /packages
\ -------------------------------------------------------------
--
2.7.4
I am trying to build openfirmware for an Allwinner A13 board so it can
have a means to call an OS.
I had follow the instructions on the Wiki on my Fedora 23 x64 KDE
machine, while i think i have the
gnu toolchain properly installed, i just get a massive ammount of errors.
That's what i get after make -i...
[madscientist@localhost arm]$ cd mmp2
[madscientist@localhost mmp2]$ ls
addrs.fth config.fth fw.bth make-sdkit.sh physaddr.fth sdkit.fth timer.fth
apbc.fth ddr_elpida_512m.fth galcore.fth mdma.fth pmua.fth sdkit.sh twsi.fth
boardgpio.fth devices.fth gpio.fth mfpr.fth probemem.fth sdregs.fth
twsi-node.fth
boardtwsi.fth dma.fth hash.fth mmp2.bth random.fth showirqs.fth
twsi-package.fth
boot.fth draminit.fth hwaddrs.fth mmuon.fth rawboot.fth soc-config.fth
uart.fth
build dramrecal.fth initmmu.fth
ntim_mmp2_nand_cforth_ddr_elpida_512m.fth rootnode.fth socregs.fth
ulpiphy.fth
cforth.bth dsi.fth irq.fth ntim_mmp2_nand_ofw_ddr_elpida_512m.fth
rtc.fth sp.bth virtaddr.fth
clocks-complex.fth fast-scroll.patch keypad.fth
ntim_mmp2_nand_ofwonly_ddr_elpida_512m.fth sdhcimmp2.fth spimaster.fth
wakeups.fth
clockset.fth fuse.fth lcdcfg.fth
ntim_mmp2_nand_uboot_ddr_elpida_512m.fth sdkit-arm sspspi.fth watchdog.fth
clocks.fth fusepgm.fth lcd.fth ofw.bth sdkit-arm.tgz thermal.fth
[madscientist@localhost mmp2]$ cd build
[madscientist@localhost build]$ make
make[1]: Entering directory
'/home/madscientist/Desktop/openfirmware/cpu/x86/Linux'
cc -c -O -g -m32 -DTARGET_X86 ../../../forth/wrapper/wrapper.c -o wrapper.o
In file included from /usr/include/features.h:389:0,
from /usr/include/stdio.h:27,
from ../../../forth/wrapper/wrapper.c:55:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:56: recipe for target 'wrapper.o' failed
make[1]: *** [wrapper.o] Error 1
make[1]: Leaving directory
'/home/madscientist/Desktop/openfirmware/cpu/x86/Linux'
Makefile:25: recipe for target '../../../x86/Linux/forth' failed
make: *** [../../../x86/Linux/forth] Error 2
[madscientist@localhost build]$ make -i
make[1]: Entering directory
'/home/madscientist/Desktop/openfirmware/cpu/x86/Linux'
cc -c -O -g -m32 -DTARGET_X86 ../../../forth/wrapper/wrapper.c -o wrapper.o
In file included from /usr/include/features.h:389:0,
from /usr/include/stdio.h:27,
from ../../../forth/wrapper/wrapper.c:55:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:56: recipe for target 'wrapper.o' failed
make[1]: [wrapper.o] Error 1 (ignored)
cc -c -O -g -m32 -DTARGET_X86 ../../../forth/wrapper/logger.c -o logger.o
In file included from /usr/include/features.h:389:0,
from /usr/include/stdio.h:27,
from ../../../forth/wrapper/logger.c:16:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:56: recipe for target 'logger.o' failed
make[1]: [logger.o] Error 1 (ignored)
cc -c -O -g -m32 -DTARGET_X86 -I../../../forth/wrapper/zip
../../../forth/wrapper/zip/adler32.c -o adler32.o
In file included from /usr/include/features.h:389:0,
from /usr/include/sys/types.h:25,
from ../../../forth/wrapper/zip/zconf.h:364,
from ../../../forth/wrapper/zip/zlib.h:34,
from ../../../forth/wrapper/zip/zutil.h:22,
from ../../../forth/wrapper/zip/adler32.c:8:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:59: recipe for target 'adler32.o' failed
make[1]: [adler32.o] Error 1 (ignored)
cc -c -O -g -m32 -DTARGET_X86 -I../../../forth/wrapper/zip
../../../forth/wrapper/zip/compress.c -o compress.o
In file included from /usr/include/features.h:389:0,
from /usr/include/sys/types.h:25,
from ../../../forth/wrapper/zip/zconf.h:364,
from ../../../forth/wrapper/zip/zlib.h:34,
from ../../../forth/wrapper/zip/compress.c:9:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:59: recipe for target 'compress.o' failed
make[1]: [compress.o] Error 1 (ignored)
cc -c -O -g -m32 -DTARGET_X86 -I../../../forth/wrapper/zip
../../../forth/wrapper/zip/crc32.c -o crc32.o
In file included from /usr/include/features.h:389:0,
from /usr/include/sys/types.h:25,
from ../../../forth/wrapper/zip/zconf.h:364,
from ../../../forth/wrapper/zip/zlib.h:34,
from ../../../forth/wrapper/zip/zutil.h:22,
from ../../../forth/wrapper/zip/crc32.c:29:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:59: recipe for target 'crc32.o' failed
make[1]: [crc32.o] Error 1 (ignored)
cc -c -O -g -m32 -DTARGET_X86 -I../../../forth/wrapper/zip
../../../forth/wrapper/zip/deflate.c -o deflate.o
In file included from /usr/include/features.h:389:0,
from /usr/include/sys/types.h:25,
from ../../../forth/wrapper/zip/zconf.h:364,
from ../../../forth/wrapper/zip/zlib.h:34,
from ../../../forth/wrapper/zip/zutil.h:22,
from ../../../forth/wrapper/zip/deflate.h:16,
from ../../../forth/wrapper/zip/deflate.c:52:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:59: recipe for target 'deflate.o' failed
make[1]: [deflate.o] Error 1 (ignored)
cc -c -O -g -m32 -DTARGET_X86 -I../../../forth/wrapper/zip
../../../forth/wrapper/zip/trees.c -o trees.o
In file included from /usr/include/features.h:389:0,
from /usr/include/sys/types.h:25,
from ../../../forth/wrapper/zip/zconf.h:364,
from ../../../forth/wrapper/zip/zlib.h:34,
from ../../../forth/wrapper/zip/zutil.h:22,
from ../../../forth/wrapper/zip/deflate.h:16,
from ../../../forth/wrapper/zip/trees.c:37:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:59: recipe for target 'trees.o' failed
make[1]: [trees.o] Error 1 (ignored)
cc -c -O -g -m32 -DTARGET_X86 -I../../../forth/wrapper/zip
../../../forth/wrapper/zip/zutil.c -o zutil.o
In file included from /usr/include/features.h:389:0,
from /usr/include/sys/types.h:25,
from ../../../forth/wrapper/zip/zconf.h:364,
from ../../../forth/wrapper/zip/zlib.h:34,
from ../../../forth/wrapper/zip/zutil.h:22,
from ../../../forth/wrapper/zip/zutil.c:8:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
Makefile:59: recipe for target 'zutil.o' failed
make[1]: [zutil.o] Error 1 (ignored)
cc -m32 -o forth wrapper.o logger.o adler32.o compress.o crc32.o
deflate.o inflate.o trees.o zutil.o
cc: error: wrapper.o: No such file or directory
cc: error: logger.o: No such file or directory
cc: error: adler32.o: No such file or directory
cc: error: compress.o: No such file or directory
cc: error: crc32.o: No such file or directory
cc: error: deflate.o: No such file or directory
cc: error: trees.o: No such file or directory
cc: error: zutil.o: No such file or directory
Makefile:43: recipe for target 'forth' failed
make[1]: [forth] Error 1 (ignored)
make[1]: Leaving directory
'/home/madscientist/Desktop/openfirmware/cpu/x86/Linux'
./build ofw.rom
./build: line 85:
/home/madscientist/Desktop/openfirmware/cpu/x86/Linux/forth: No such
file or directory
Makefile:22: recipe for target 'ofw.rom' failed
make: [ofw.rom] Error 127 (ignored)
sed: can't read ../../build/*.tag: No such file or directory
sed: can't read *.tag: No such file or directory
[madscientist@localhost
build]$https://www.openfirmware.info/Building_OFW_for_ARM
Is something else i can do on my system looking towards building the
binary? Do i have to install x86 32bit libraries or something else?
Respect the Allwinner A13, is is the best choice for using this firmware
or should i try something else?