#
…

2021-03-12

00:06bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:12m42uko has quit [Ping timeout: 258 seconds]
01:05TomJepp has quit [Ping timeout: 260 seconds]
02:03m42uko has joined #asahi-dev
02:42riker77_ has joined #asahi-dev
02:44riker77 has quit [Ping timeout: 272 seconds]
02:44riker77_ is now known as riker77
03:12_whitelogger has joined #asahi-dev
03:43PhilippvK has quit [Ping timeout: 260 seconds]
03:43phiologe has joined #asahi-dev
04:02bisko has joined #asahi-dev
04:35h_ro[m] has joined #asahi-dev
04:40odmir has quit [Remote host closed the connection]
05:34taziden has quit [Ping timeout: 272 seconds]
05:44taziden has joined #asahi-dev
05:48acelogic has joined #asahi-dev
06:22VinDuv has joined #asahi-dev
06:36mxw39 has quit [Quit: Konversation terminated!]
06:52rwhitby has quit [Ping timeout: 264 seconds]
07:00acelogic has quit [Ping timeout: 256 seconds]
07:17VinDuv has quit [Quit: Leaving.]
07:32ake has joined #asahi-dev
07:53sventime to implement cdc now :)
07:54arthere's now usb support in m1n1?
07:54svennot yet
07:54svenbut soon once i'm done with this
07:59akeMay I ask about pci? When I tried to read pci config apcie@0x690000000, I got 0xffffffff. Do I need to enable something before being able to access pci config?
08:00marcanake: yes, the PHY needs a bunch of initialization
08:01akeThose tunables found in apcie node in ADT?
08:04akemarcan: thank you very much.
08:15marcanake: those, and some initialization stuff. I haven't looked at it yet, but kettenis has it in u-boot
08:15marcanI'm going to poke around that and USB once I wrap up the v3 comments
08:35svenusb requires some clocks (clock-gates in the ADT which refers to entries in two properties of the pmgr node) to make MMIO reads/writes work and then some magic PHY pokes to allow the drd controller to come out of reset
08:40tanmayd has joined #asahi-dev
08:40marcanlooking forward to uploading kernels at 40MB/s :>
08:41marcansven: you don't use IRQs, right? ideally I want the USB thing to be a polled loop, so the whole thing can run in IRQ/exception context too
08:42svenI have a usb_dwc3_task() function that doesn't block (except for some while(timeout-- && read32(...) & SOME_FLAG)
08:42svenit's essentially just a big state machine
08:43svenyou just need to call that one regularly before the host times out the transfers
08:44marcandoes it need to be called to NAK, or does the hardware handle that?
08:45marcan(I hope the hardware handles that...)
08:47tanmayd has quit [Remote host closed the connection]
08:48svenyeah, that's done in hw
08:50tanmayd has joined #asahi-dev
08:53marcanexcellent
08:54marcanI'm thinking for things like CDC-ACM the host should ~never time out then, right?
08:54marcan(i.e. actual data transfers)
08:54marcaneither way my protocol is mostly synchronous on the host->device side so it doesn't really matter
08:56svenyeah, that's what I assume. during the enumeration phase it (obviously) times out rather quickly
09:00Spectrejan[m] has quit [Quit: Idle for 30+ days]
09:05marcanyeah, should be fine for mmiotrace as long as you plug it in *before* launching the guest of course
09:06marcankinda curious how macOS will react to me randomly stalling MMIO writes when my buffers are full
09:06marcanwe'll see I guess
09:06marcanprobably will just make stuff dog slow if it's the GPU, but I wonder if there are timeouts
09:06marcansven: if you're bored, we're also goingt to need spinlocks in m1n1 :>
09:21bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:43sventhere's also still the frame buffer console I should fix at some point ;)
09:44ketteniswhat's up with the framebuffer console?
09:44svennot inside linux fwiw, the one in m1n1
09:45kettenisbtw, I think I've sorted out the memory map issues in u-boot
09:46kettenisso I'll probably push that to my u-boot repo tonight
09:48ake has quit [Quit: Leaving]
11:40KindOne has quit [Ping timeout: 264 seconds]
11:41KindOne has joined #asahi-dev
11:48tanmayd has quit [Ping timeout: 246 seconds]
12:02tanmayd has joined #asahi-dev
12:26acelogic has joined #asahi-dev
12:27ake has joined #asahi-dev
12:32arnd has quit [Changing host]
12:32arnd has joined #asahi-dev
12:34riker77 has quit [Ping timeout: 272 seconds]
12:36acelogic has quit [Ping timeout: 256 seconds]
12:40riker77 has joined #asahi-dev
12:57acelogic has joined #asahi-dev
13:10ake has quit [Remote host closed the connection]
13:10ake has joined #asahi-dev
13:11ake has quit [Remote host closed the connection]
13:42tarzeau_ is now known as tarzeau
13:48choozy has joined #asahi-dev
13:55luca020400 has quit [Remote host closed the connection]
13:55luca020400 has joined #asahi-dev
14:02ake has joined #asahi-dev
14:07choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
14:42acelogic has quit [Ping timeout: 245 seconds]
14:45ake has quit [Remote host closed the connection]
14:46ake has joined #asahi-dev
14:46ake has quit [Remote host closed the connection]
14:47acelogic has joined #asahi-dev
14:57TomJepp has joined #asahi-dev
15:18ake has joined #asahi-dev
15:24ake has quit [Remote host closed the connection]
15:25ake has joined #asahi-dev
15:25ake has quit [Remote host closed the connection]
15:40bisko has joined #asahi-dev
16:10kettenisis there an easy way to grab the ADT using m1n1?
16:21svenover uart? i think i just used readmem(adt_addr, adt_len)
16:26acelogic has quit [Remote host closed the connection]
16:27ake has joined #asahi-dev
16:27ake has quit [Client Quit]
16:40marcanyeah, pretty much
16:41marcankettenis: open("dt.bin", "wb").write(readmem(ba.devtree - ba.virt_base + ba.phys_base, ba.devtree_size))
16:48svenmarcan: you've just gotten very familiar with memory barriers, haven't you? i have a rather strange bug here that might be related:
16:48svenso I have u32 n_events = read32(SOME_MMIO_REGISTER); if (n_events < 0) return; u32 event = read32(SOMETHING_IN_RAM);
16:49svennow sometimes I see n_events > 0 but then event still has the initial value i memset it to
16:49sven(the usb controller dmas to that SOMETHING_IN_RAM)
16:49svencould the cpu somehow speculate its way to the read32 from RAM, read the "invalid value", then an event actually happens, then the mmio read completes and i end up with that stale event value?
16:50svenadding dmb oshld fixes it, but erm, so does udelay
16:58marcansven: yes, dmb oshld is exactly what you need there
16:58marcanthat's a dma barrier
16:58marcanyou need that between mmio and dma
16:58marcansame with writes and oshst
16:58svenokay, great. that's what i got from the ARM ARM but i don't trust myself reading it
16:58marcanlook at what linux does :)
16:59marcanthis is the whole readl() vs readl_relaxed() thing
16:59svenah.. that would've been a good idea :D
16:59marcan(which was documented in the patch arnd and I wrote)
16:59svenoh, nice. i should read that
17:04svencrw-rw-rw- 1 root wheel 9, 8 Mar 12 18:04 /dev/tty.usbmodemvc7855ac_dirty1 :-)
17:04svenmaybe i should use something else for the serial in the descriptor, heh
17:16VinDuv has joined #asahi-dev
17:42kettenisthanks; for some reason larger reads time out
17:42kettenisbut writing a little loop doing smaller reads did the trick
18:29mxw39 has joined #asahi-dev
18:34odmir has joined #asahi-dev
19:04mxw39 has quit [Quit: Konversation terminated!]
19:06mxw39 has joined #asahi-dev
19:09bisko has quit [Quit: Textual IRC Client: www.textualapp.com]
19:29marcankettenis: what timeout do you get? was this with another M1 as console?
19:35kettenisproxy.UartTimeout: Expected 360448 bytes, got 329929 bytes
19:36kettenisusing the serial thingy that bluerise created for me connected to an OpenBSD arm64 machine
19:36kettenis(an odroid-n2, but I doubt that matters)
19:37kettenisthis is a USB serial dongle that connects to a breadboard with some resistors to connect to the m1
19:38kettenisand then there is a breakout of the PD signals that goes to another OpenBSD arm64 box with a hacked kernel that sends the vendor-specific PD commands to turn on the serial ;)
19:44kettenisin other words, not a particular reliable setup
19:46tanmayd17 has joined #asahi-dev
19:48tanmayd has quit [Ping timeout: 256 seconds]
19:53marcanthat's kind of odd; the read loop retries until it gets all the data, so a timeout means it got 0 bytes at some point
19:53marcanperhaps data is being lost due to buffers getting full at some point?
19:54marcanyou can try reducing the baud rate in setup.py (p.set_baud(1500000) etc) or commenting out that code; if that fixes it then it's probably something along those lines
19:54marcanunfortunately we don't have flow control, so this can happen :)
19:54marcansven's USB code should fix that
19:55kettenisuploading u-boot seems to mostly work
19:55svenjuuuuust gotta fix something that's likely very dumb but keeps bulk xfers from working
19:58marcantimeouts *reading* data would indicate the o-droid isn't keeping up; timeouts *writing* data would mean the M1 isn't keeping up, which shouldn't really happen for memory writes given it's a tight read loop (but can happen if you e.g. trip an IRQ asynchronously and it spends some time printing out info)
19:59marcanI had this issue with my Glasgow UART; it got fixed increasing the on-device FIFO size (yay FPGA implementations)
20:05marcankettenis: awesome, I'll give it a shot later!
20:05kettenisI have a devicetree into which a transplanted the nodes I need to enable PCIe
20:06kettenisincluding the tunables
20:06kettenisseems the tunables are not machine specific
20:06kettenisbut potentially model-specific
20:07kettenisnote that u-boot uses an 115200 serial console
20:09ketteniswhat would be a good way to share the updated t8103.dtsi?
20:10ketteniscloning a full linux kernel tree for that is a bit excessive
20:15ketteniswithout the device tree diff you should still be able to get a prompt on serial and framebuffer
20:16kettenisframebuffer is black on blueish because u-boot doesn't really support 30-bit color
20:31kettenisboots grub, but the grub hits a snag loading a linux kernel
20:32br377 has quit [Quit: WeeChat 1.4]
20:41pg12_ has quit [Read error: Connection reset by peer]
20:42pg12 has joined #asahi-dev
20:43tanmayd17 has quit [Ping timeout: 246 seconds]
20:55KindTwo has joined #asahi-dev
20:57KindOne has quit [Ping timeout: 272 seconds]
20:57KindTwo is now known as KindOne
21:06mxw39 has quit [Quit: Konversation terminated!]
21:10kettenispushed a hack for that
21:11ketteniswith that hack loading a linux kernel and initrd seems to work
21:12mxw39 has joined #asahi-dev
21:31kettenisok, put the device tree in the u-boot repo
21:31kettenisthat should be a convenient place
21:35jannaukettenis: there is also dts/apple-j274.dts in m1n1
21:45kettenisthat one is out of date
21:48kettenisso what I did to test grub is to simply dd the debian debian-10.8.0-arm64-netinst.iso to a USB stick and plug that in
21:52jannauyes, it's a little annoying to update the dts in m1n1 when the one in the kernel tree is not stable
22:03kettenisunavoidable at this stage of development
22:04kettenisbut a well-designed device tree doesn't need to change
22:05kettenisand in this case the copy in the kernel tree should just be there for reference
22:06jannauyes, it's not expected to change except for added devices once the initial bringup is merged
22:15roxfan has quit [Remote host closed the connection]
22:20roxfan has joined #asahi-dev
22:30VinDuv has left #asahi-dev [#asahi-dev]
23:04rwhitby has joined #asahi-dev
23:24choozy has joined #asahi-dev
…