openpowerbot | [slack] <Ganesan Narayanasamy> https://www.linkedin.com/posts/ganesannarayanasamy_semiconductor-technology-semiconductor-activity-6960785036795142144-IgKs/?utm_source=linkedin_share&utm_medium=member_desktop_web | 06:18 |
---|---|---|
fitzsim | I was simulating Microwatt natively on ppc64le, following the README | 06:52 |
fitzsim | when I tried MicroPython master tip, the simulator would not accept input on standard input (stdin) | 06:53 |
fitzsim | I traced it down to a 16550/Potato UART incompatibility, I think | 06:53 |
fitzsim | when I change UART0_IS_16550 from true to false in soc.vhdl, it works | 06:54 |
fitzsim | even without that change, the checked-in prebuilt micropython firmware does work | 06:55 |
fitzsim | its git revision reports "-dirty" though, and the commit message says that it has added 16550 support | 06:55 |
fitzsim | is that support checked into a MicroPython fork somewhere? | 06:55 |
fitzsim | I think the instructions in microwatt/README.md will produce a MicroPython with a Potato UART, which will fail | 06:56 |
fitzsim | so either README.md should be updated, or 16550 support should be upstreamed to MicroPython? | 06:57 |
fitzsim | (this is assuming there's some reason to prefer 16550 overall, since potato does seem to work, but is commented "legacy" in soc.vhdl) | 06:58 |
openpowerbot | [slack] <joel> I think using the 16550 in micropython makes sense. Most of the testing with microwatt is done with that uart; the potato was used before we had the 16550 hardware | 06:58 |
fitzsim | OK; is there an option in micropython to build with 16550 support? | 06:59 |
openpowerbot | [slack] <joel> see f03d030080ccf89c6ad677c818c949c3bd71ec37 | 06:59 |
openpowerbot | [slack] <joel> (in micropython) | 07:00 |
fitzsim | found it; I did see the lpc_serial vs potato flag | 07:00 |
fitzsim | but neither worked; lpc_serial said it was for QEMU, and didn't seem to produce output, even | 07:01 |
fitzsim | let me try again here, with UART=lpc_serial (does that mean 16550?) | 07:02 |
openpowerbot | [slack] <joel> The lpc uart is the 16550 register layout. However you will need to correct the base address | 07:02 |
fitzsim | ah, OK | 07:02 |
fitzsim | that's what the -dirty is about then | 07:02 |
openpowerbot | [slack] <joel> > ports/powerpc/uart_lpc_serial.c:#define UART_BASE 0xc0002000 | 07:02 |
openpowerbot | [slack] <joel> We would need a way to tell micropython where the uart address is. That could be at build time, or we could add device tree support. | 07:05 |
openpowerbot | [slack] <joel> The hard coded address is for the powernv qemu machine (I think) | 07:05 |
fitzsim | what you pasted is the UART_BASE that I currently have | 07:06 |
fitzsim | I'll check what the correction should be | 07:06 |
fitzsim | output does work, input doesn't | 07:06 |
fitzsim | oh, forgot the option (it's late) | 07:06 |
fitzsim | one sec, retrying | 07:06 |
openpowerbot | [slack] <joel> Ah. That address **is** the microwatt address | 07:07 |
fitzsim | from what I can tell, just building micropython with "make -j64 UART=lpc_serial" causes "./core_tb >/dev/null" to not produce any serial output output | 07:09 |
fitzsim | s/output output/output/ | 07:09 |
openpowerbot | [slack] <joel> Is that because the simulation uses the potato uart? | 07:12 |
fitzsim | I think the simulation is wanting 16550, not potato | 07:13 |
fitzsim | yeah, I reverted my UART0_IS_16550 hack | 07:13 |
fitzsim | so I'm on microwatt 76a7b98840c836fab866864d3fc277af80f4c625, unmodified | 07:14 |
fitzsim | it should be easy for someone else to try to see if my env is messed up somehow | 07:14 |
fitzsim | just follow the microwatt's README.md, but instead of using the pre-built micropython, build it from source (I'm on micropython 579f330508e4ba46f4a71193582c36bdf7aa56bd) | 07:15 |
fitzsim | the latest commit for the pre-built micropython says "tests: Add updated micropython build with 16550 support" | 07:18 |
fitzsim | when simulated, that reports "MicroPython v1.12-571-g16d6cb7f7-dirty on 2020-06-23; bare-metal with POWERPC" | 07:19 |
fitzsim | I tried to rebuild that same version (v1.12-571), but I don't know where 16d6cb7f7 is, nor what local change caused "-dirty" | 07:24 |
openpowerbot | [slack] <joel> Probably on Ben's old laptop 🙂 | 07:25 |
fitzsim | when I build v1.12-571, with UART=potato (the default), I get serial port output, but serial port input is not accepted | 07:25 |
fitzsim | and same version, with UART=lpc_serial I get no serial port output (and presumably the serial port doesn't accept input either, though I can't tell) | 07:26 |
fitzsim | darn, is there hope that the laptop hasn't been decommissioned? ;-) | 07:27 |
fitzsim | or maybe Ben pushed some MicroPython changes to a repo on the Internet somewhere? | 07:27 |
fitzsim | anyway, have to retire for the evening, thanks for the help! | 07:28 |
openpowerbot | [slack] <Paul Mackerras> @Benjamin Herrenschmidt might be able to comment... | 07:28 |
openpowerbot | [slack] <joel> https://github.com/ozbenh/micropython/commit/b2b7eafe2c83e7094a9194d38e67c4fa565ddf7c | 07:29 |
openpowerbot | [slack] <joel> He didn't like the change to make it build time configured, iirc | 07:30 |
openpowerbot | [slack] <joel> @Paul Mackerras do we still use potato in any situations? Simulation? | 07:30 |
fitzsim | ok, trying... | 07:31 |
openpowerbot | [slack] <Paul Mackerras> @joel not sure, maybe | 07:31 |
openpowerbot | [slack] <Paul Mackerras> It looks like core_tb doesn't use potato; soc.vhdl defaults UART0_IS_16550 to true and core_tb.vhdl doesn't change that | 07:33 |
fitzsim | yes, powerpc tip of that repo works, with just "make -j64" | 07:33 |
fitzsim | looks like Ben removed the UART flag | 07:33 |
openpowerbot | [slack] <Paul Mackerras> I can't find any situation where we still use the potato uart... | 07:39 |
fitzsim | will post a patch... | 07:39 |
fitzsim | (just a suggestion; upstreaming something to MicroPython would be better) | 07:39 |
openpowerbot | [slack] <joel> The problem with ben's patch is if you load microwatt from u-boot (or another bootloader), r3 will be set and it will assume qemu | 07:40 |
openpowerbot | [slack] <joel> That's why I made the change (that he reverted) in upstream micropython in the first place | 07:40 |
openpowerbot | [slack] <Benjamin Herrenschmidt> oh my I don't remember any of that 🙂 | 07:41 |
openpowerbot | [slack] <joel> So a proper fix is to finish off `init_devicetree` from his patch, have it parse the device tree and configure it | 07:41 |
fitzsim | http://paste.debian.net/plain/1249281 | 07:41 |
openpowerbot | [slack] <Benjamin Herrenschmidt> can't we just kill potato ? | 07:41 |
openpowerbot | [slack] <Benjamin Herrenschmidt> and make everything use the UART ? | 07:41 |
fitzsim | ok, makes sense | 07:41 |
openpowerbot | [slack] <joel> Yes, lets do that. Still need to detect microwatt vs qemu somehow, to work out the base address | 07:42 |
fitzsim | lpc_serial seemed to be the same UART base address | 07:42 |
fitzsim | #define POTATO_UART_BASE 0xc0002000 | 07:43 |
openpowerbot | [slack] <joel> #define QEMU_UART_BASE 0x60300d00103f8 | 07:43 |
fitzsim | #define UART_BASE 0xc0002000 | 07:43 |
fitzsim | oh, there's also #define LPC_UART_BASE 0x60300d00103f8 yeah | 07:43 |
fitzsim | did read that far | 07:43 |
fitzsim | *didn't read that far | 07:43 |
fitzsim | ok, have to drop now; I'll try the README instructions again sometime; thanks again for the help | 07:45 |
openpowerbot | [slack] <joel> No worries. Thanks for pointing out the broken bits | 07:45 |
openpowerbot | [slack] <joel> We could read the pvr, as a hack | 07:45 |
openpowerbot | [slack] <Paul Mackerras> @Matt Johnston how do you load a program (ppc64le elf binary) into the SPI flash on the orange crab? dfu-util, or do you have a way to do it over jtag with openocd or something? | 11:02 |
openpowerbot | [slack] <Paul Mackerras> dfu-util shows two partitions, one starting at 512k in the flash and the other starting at 1MB. However, the dram init code looks for something at the 4MB point... | 11:02 |
openpowerbot | [slack] <Matt Johnston> yeah, usually I use ecpprog via jtag with a ft232h board. my recollection is that the alternate partition for dfu on the orangecrab dfu firmware doesn't work anyway | 12:21 |
openpowerbot | [slack] <Matt Johnston> @Paul Mackerras yeah, usually I use ecpprog via jtag with a ft232h board. my recollection is that the alternate partition for dfu on the orangecrab dfu firmware doesn't work anyway | 12:23 |
* fitzsim may buy a Butterstick board | 15:20 | |
fitzsim | have people make Linux networking work with its Ethernet port yet? | 15:20 |
openpowerbot | [slack] <Matt Johnston> yep, was using it today | 15:32 |
fitzsim | cool, will buy one; they seem to actually be in stock | 15:34 |
openpowerbot | [slack] <Matt Johnston> a https://store.groupgets.com/products/syzygy-breakout-board-for-butterstick is useful to be able to connect a serial console - the butterstick itself doesn't have gpio pins | 15:40 |
fitzsim | yeah, that was in my cart too, will include that in the order, thanks | 15:55 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!