micropython/ports/powerpc
Joel Stanley f03d030080 powerpc/uart: Choose which UART to use at build time, not runtime.
Microwatt may have firmware that places data in r3, which was used to
detect microwatt vs powernv.  This breaks the existing probing of the UART
type in this powerpc port.

Instead build only the appropriate UART into the firmware, selected by
passing the option UART=potato or UART=lpc_serial to the Makefile.

A future enhancement would be to parse the device tree and configure
MicroPython based on the settings.
2020-05-29 22:54:55 +10:00
..
Makefile powerpc/uart: Choose which UART to use at build time, not runtime. 2020-05-29 22:54:55 +10:00
README.md powerpc/uart: Choose which UART to use at build time, not runtime. 2020-05-29 22:54:55 +10:00
frozentest.mpy
frozentest.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
head.S
main.c powerpc/uart: Choose which UART to use at build time, not runtime. 2020-05-29 22:54:55 +10:00
mpconfigport.h all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
mphalport.h all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
powerpc.lds
qstrdefsport.h
uart_lpc_serial.c powerpc/uart: Choose which UART to use at build time, not runtime. 2020-05-29 22:54:55 +10:00
uart_lpc_serial.h
uart_potato.c powerpc/uart: Choose which UART to use at build time, not runtime. 2020-05-29 22:54:55 +10:00
uart_potato.h
unistd.h

README.md

The PowerPC port that runs on microwatt and qemu

This port is intended to be a minimal MicroPython port that runs in QEMU, microwatt simulator with ghdl or microwatt on Xilinx FPGA with potato UART.

Building

By default the port will be built with the potato uart for microwatt:

$ make

To instead build for a machine with LPC serial, such as QEMU powernv:

$ make UART=lpc_serial

Cross compilation for POWERPC

If you need to cross compilers you'll want to grab a powerpc64le compiler (not powerpc or powerpc64).

On Ubuntu (18.04) you'll want:

$ apt install gcc-powerpc64le-linux-gnu

(Use CROSS_COMPILE=powerpc64le-linux-gnu-)

If your distro doesn't have cross compilers, you can get cross compilers here:

(Avoid musl libc as it defines __assert_fail() differently to glibc which breaks the micropython powerpc code)

Then do:

$ make CROSS_COMPILE=<compiler prefix>

Building will produce the build/firmware.bin file which can be used QEMU or microwatt.

To run in QEMU use:

$ ./qemu-system-ppc64 -M powernv -cpu POWER9 -nographic -bios build/firmware.bin