ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | Non-development talk: #asahi | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
stsmwg has joined #asahi-dev
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
hightower2 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
stsmwg has quit [Quit: Lost terminal]
leah2 has quit [Ping timeout: 480 seconds]
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
greguu has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
raveling has quit [Ping timeout: 480 seconds]
greguu has joined #asahi-dev
leah2 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
<marcan> jannau: m1n1 gets the links up at least I think, so linux probably takes them down during its init (and then fails to do the right dance to bring them up again)
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
A_L_I_C_E has quit [Read error: Connection reset by peer]
A_L_I_C_E has joined #asahi-dev
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
deteg1337 has quit [Read error: Connection reset by peer]
deteg1337 has joined #asahi-dev
Thsf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
A_L_I_C_E has quit [Quit: Quit]
A_L_I_C_E has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
A_L_I_C_E has quit [Remote host closed the connection]
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
<dottedmag> jannau: Would you like to see the more traces from that two-tile 5K monitor, or the ones I made last year are enough to understand how M1 drives it?
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
newiz has joined #asahi-dev
newiz has quit [Quit: Konversation terminated!]
MajorBiscuit has joined #asahi-dev
Hibyehello_ has joined #asahi-dev
Hibyehello has quit [Read error: Connection reset by peer]
<marcan> ok, re pcie, more registers moved individually, so this is going to be a proper device variant now
deteg1337 has joined #asahi-dev
i509vcb has quit [Quit: Connection closed for inactivity]
chadmed_ has quit [Remote host closed the connection]
<jannau> dottedmag: that's a thunderbolt display? thanks but not at this time. m2* mac mini hdmi out has priority
<dottedmag> jannau: Yep, TB. OK.
<jannau> re pcie: shifting registers to make space for more ports?
<marcan> per port changed too
<marcan> rid2sid got moved out, presumably to make a lot more space there
<marcan> this is probably Mac Pro related, they're preparing for real general purpose PCIe slots
<marcan> looks like MSIs changed too, there's now a table thing
nafod has quit [Quit: Ping timeout (120 seconds)]
nafod has joined #asahi-dev
deteg133_ has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
bps has joined #asahi-dev
A_L_I_C_E has joined #asahi-dev
alex_ has joined #asahi-dev
<alex_> certainly worth looking for USB4 eGPU support there then
alex_ has quit []
nyilas has joined #asahi-dev
nyilas has quit [Remote host closed the connection]
nyilas has joined #asahi-dev
nyilas has quit [Remote host closed the connection]
nyilas has joined #asahi-dev
arekm has quit [Quit: leaving]
arekm has joined #asahi-dev
raveling has joined #asahi-dev
deteg133_ has quit [Remote host closed the connection]
deteg1337 has joined #asahi-dev
<marcan> pushed a bunch of stuff to linux/m1n1 on t602x/bringup for both, but pcie still doesn't work :/
<marcan> ok, config space is fully dead so something is wrong here
<marcan> aaaaargh, it's the power gate
<marcan> [ 1.341841] pci 0000:02:00.0: [17a0:9755] type 00 class 0x080501
<marcan> yay :)
<marcan> pushed, will clean up the commits later
<marcan> # [ 46.861422] mmc0: new ultra high speed SDR104 SDXC card at address 59b4
<marcan> [ 46.878307] mmcblk0: mmc0:59b4 ED2S5 119 GiB
<marcan> [ 46.894306] mmcblk0: p1
<marcan> sd card reader works even :)
<marcan> ok, so now really just DCP/GPU left (and wifi I guess, we'll see how bad the new chips are)
<_jannau_> DCP might just work on the macbooks
<marcan> do you have m1n1 changes?
<marcan> we need the reserved-regions stuff right?
nsklaus has joined #asahi-dev
mkurz has quit [Ping timeout: 480 seconds]
tanty has quit [Remote host closed the connection]
tanty has joined #asahi-dev
<kettenis_> marcan, jannau: regarding reserved-regions, I noticed that U-Boot complained about reserved regions with size 0
<kettenis_> ERROR: reserving fdt memory region failed (addr=0 size=0 flags=0)
<kettenis_> guess that is because the dcp setup stuff in m1n1 doesn't run?
<kettenis_> marcan: added two comments to https://github.com/AsahiLinux/linux/commit/7400cf11996a4715f65a64949db1b0cf407268a9 for things that you probably want to fix when cleaning up the linux pcie diff
<_jannau_> yes, probably due to DCP setup issues on m2 (pro) mini. not intended to end up with empty reserved regions
<kettenis_> U-Boot runs so we can wait until DCP is fixed
raveling has quit [Ping timeout: 480 seconds]
raveling has joined #asahi-dev
hightower3 has joined #asahi-dev
hightower2 has quit [Ping timeout: 480 seconds]
<marcan> pushed the m1n1 changes back to main, hope I didn't regress the other socs :p
cylm_ has joined #asahi-dev
* sven should get back to staring at thunderbolt
<jannau> pcie devices show up on the m2 pro mini but there's an interrupt storm of translation errors for pcie0_dart_2
<jannau> apple-dart 596000000.iommu: translation fault: status:0x80180004 stream:1 code:0x4 (NO PMD FOR IOVA) at 0x1001e2a0000
<jannau> devices are non-functional as far as I can tell
<jannau> kettenis_: the GPU is at least to blame as well "OF: fdt: Reserved memory: failed to reserve memory for node 'uat-handoff': base 0x0000000000000000, size 0 MiB"
<marcan> jannau: that fault has a physical address, something went wrong with the DMA mappings if devices are hitting physical
<marcan> possibly DMA mapping failed entirely and it's trying and failing to use passthrough
<jannau> t602x/bringup (2dfa86cad319) lost the pcie changes
<marcan> yeah I know
<marcan> working on it
<jannau> ok
<marcan> wat, I lost the screen now
<marcan> jannau: the m1n1 change (without any kernel change) broke the screen :D
<marcan> I bet I know what this is
<marcan> hm no, we do have no-map
<marcan> interesting...
<marcan> really interesting...
raveling has quit [Read error: No route to host]
<jannau> marcan: does it screw up the mapping tables?
raveling has joined #asahi-dev
<jannau> try making dart_setup_pt_region() a no-op
<jannau> it's confused by dart-disp0 sid 0 starting at l2 idx 2 instead of 0
<jannau> I thought that was just during fb mapping in display.c
<marcan> what I don't get is why it only happens after the m1n1 change
<jannau> because we don't touch the darts without the m1n1 change
<jannau> dart_setup_pt_region() is only called from dcp_init() so it shouldn't be used
<marcan> isn't it just dart_get_mapping?
<marcan> ah but that does do dart_init
<marcan> oh wait, the locked check
<marcan> but no, that wasn't it...
<jannau> does it lock dart-disp0?
<jannau> when does the screen break? during linux dart probe or earlier?
<marcan> I think it's during Linux dart probe
<marcan> ah, no
<jannau> the reserved mem code seems to be broken with 4 levels in a way I do not understand
<jannau> I didn't try hard though since the locked dart io-pgtbl interaction needs to be rewritten
<marcan> with your patches it worked
<marcan> ok
<marcan> so it's the 4-level thing then
<marcan> jannau: isn't it just that if it's locked we can't change the TCR/TTBR level config so we need to just inherit?
raveling has quit [Read error: Connection timed out]
<jannau> that sounds plausible
deteg1337 has quit [Remote host closed the connection]
deteg1337 has joined #asahi-dev
deteg133_ has joined #asahi-dev
hightower3 has quit [Remote host closed the connection]
deteg1337 has quit [Ping timeout: 480 seconds]
<jannau> marcan: pcie is confused by disabling port01. ethernet and usb xhci work if port01 is left enabled. pcie0_dart_1 needs to be disabled though. SErrors on probe
<marcan> jannau: left enabled as in the DT?
<jannau> yes
deteg133_ has quit [Ping timeout: 480 seconds]
<marcan> sounds like a pcie bug
<jannau> looks like the dart <-> port mapping breaks if there are gaps in the ports
<jannau> or an OF iommu/pcie bug
<kettenis_> so the iommu-map uses bus numbers
<kettenis_> if there is a gap in the ports but not a corresponding gap in the bus numbers that would explain the issue
<jannau> the bus numbers have a gap at the disabled port
<marcan> probably some index confusion somewhere
<marcan> jannau: lol there was another bug, we were always limiting ias to 32 due to fls() being 32-bit
deteg1337 has joined #asahi-dev
<jannau> lol, I grepped for __builtin_clz and was then confused by 'return x ? sizeof(x) * 8 - __builtin_clz(x) : 0;' in builtin-fls.h. I didn't parse that fully and assumed it is a macro taking the width of the argument into account
<marcan> ok, pushed with the fixes
<marcan> now I can actually try DCP :)
<marcan> jannau: dropped your dma-range limit since it's now implied
<marcan> [ 0.439608] apple-dcp 389c00000.dcp: received unknown callback D113
<marcan> [ 0.949179] apple-dcp 389c00000.dcp: unexpected busy command channel
<marcan> whoops
<marcan> got fairly far though :)
kedde has joined #asahi-dev
<jannau> please add a noop callback for that, should be set_idle_caching_state_ap
<marcan> it's upload_trace_start
<marcan> added return true callbacks for all 3
<marcan> [ 0.434703] apple-dcp 389c00000.dcp: RTKit: syslog message: ck_PCC2DBlm_v5.cpp:3306: Quiescing callback
<marcan> [ 0.486200] apple-dcp 389c00000.dcp: RTKit: co-processor has crashed
<marcan> [ 0.486208] apple-dcp 389c00000.dcp: FAR = 0x10000000590
<jannau> so one of the new callbacks moving the others around. not used on m1*/m2
<jannau> I guess either you or me have to look at macos traces
<marcan> D113 was always what I said I think?
<jannau> I think create_nvram_service was inserted as D112
CoolStar has joined #asahi-dev
<jannau> my dcp 13.2 m1n1 work tree is in https://github.com/jannau/m1n1/tree/m2_dptx
<jannau> I left the call/callback list in trace_dcp as is
<marcan> I confirmed D113 with the driver
<marcan> and D112 is still set_idle_caching_state_ap
<jannau> ipc.py can handle both 12.3 and 13.2 but needs the FW version set via env variable for 13.2
<marcan> ah wait no
<marcan> I'm dumb
<marcan> sorry
<jannau> I didn't look at driver or firmware
<marcan> D113 is... get_tiling_state?
<marcan> lots of stuff got inserted there
<jannau> possibly. there should be 3 insertions before D116
<marcan> yes
<marcan> [ 0.454192] apple-dcp 389c00000.dcp: RTKit: syslog message: PPipeDCP_H13P.cpp:17276: Dual pipe enabled offset 1
<marcan> ok so this is wrong, macOS gets disabled there
<marcan> and that's right after the callback, ok
<_jannau_> so change get_tiling_state to a false callback
<marcan> nah, needs to return true and write 0 to the argument
<marcan> so custom
<marcan> jannau: still the same crash, wasn't the dual pipe thing
<_jannau_> at which point is this? before/after the modeset? do you have the last few calls / syslog messages before the crash?
<marcan> fixing the RT bandwidth stuff now
raveling has joined #asahi-dev
<_jannau_> have you checked if the reg layout is still the same? it differs between m1 and m2 iirc
<_jannau_> differences there would explain crashes
<_jannau_> would show in the rt_bandwidth and map_reg cbs
<marcan> jannau: it's dying in set_digital_out_mode
<marcan> I fixed the RT thing
raveling has quit [Ping timeout: 480 seconds]
deteg1337 has quit [Remote host closed the connection]
<marcan> jannau: ha.
<marcan> so it works in 120Hz mode
<marcan> it's dying switching to 60Hz mode
<marcan> I'm going to be annoyed if this is an outright firmware bug that macOS just never hits...
<_jannau_> I'd check the mapped display registers and memory mappings shared between dart-dcp and dart-disp0.4
<_jannau_> disregard that
<_jannau_> then
<marcan> so it dies during a real modeset
<marcan> but I don't know if macOS ever does a real modeset? maybe after DPMS?
<_jannau_> macos display setting offers a selection of the refresh rate
<_jannau_> at least it did in 12.3
<_jannau_> or at least it offered to disable promotion. I don't remember
deteg1337 has joined #asahi-dev
raveling has joined #asahi-dev
<marcan> it's the RT thing I think
deteg133_ has joined #asahi-dev
deteg1337 has quit [Read error: Connection reset by peer]
deteg133_ has quit [Read error: Connection reset by peer]
deteg1337 has joined #asahi-dev
<marcan> I think it's missing the dma mask stuff
raveling has quit [Ping timeout: 480 seconds]
<_jannau_> so 'apple,asc-dram-mask = <0x100 0x00000000>;' instead of <0x1f0 0x00000000>?
<_jannau_> in the dcp dt node
mkurz has joined #asahi-dev
deteg1337 has quit [Remote host closed the connection]
<marcan> actually just 0
<marcan> I'm using the dma-range stuff now
<marcan> but, that's not the issue, the issue is dma_map_resource() is failing
deteg1337 has joined #asahi-dev
<marcan> ohh I think I get it
<marcan> the new u64 in the dcpep_cb_map_reg is the dva
<marcan> we're supposed to just map it there
<marcan> makes sense, this is the design fix for their stupid vuln
<marcan> instead of requesting addrs, just map it by index
i509vcb has joined #asahi-dev
<_jannau_> that means I have to change the locked dart handling so that we can switch to unmanaged dma domains to map things at fixed dva
<marcan> no no
<marcan> it's an output
<marcan> we just map it there and give it the dva
<marcan> we pick the dva
<_jannau_> ah
deteg1337 has quit [Read error: Connection reset by peer]
deteg1337 has joined #asahi-dev
<marcan> works!
<marcan> ok, let me commit :)
<_jannau_> great
<marcan> pushed!
<marcan> I think we can get rid of the asc-dram-mask stuff entirely now, assuming this also works out on M2
<marcan> the dma-range can contain upper bits which does what we want here
<marcan> (even outside the ias)
<marcan> (even if ias is downgraded in locked mode)
<marcan> hopefully I got the DART logic right but I think I did
<marcan> it just needs not to straddle an ias boundary (so the size needs to be right)
deteg1337 has quit [Ping timeout: 480 seconds]
<marcan> jannau: feel free to refactor as you see fit, I left the commits broken out so you can see what I did (except the DT squash)
<marcan> so... wifi left?
<marcan> and gpu
<_jannau_> I think it can be stay as is for now it will get squashed eventually. I don't mind fixups being squashed at the next rebase
deteg1337 has joined #asahi-dev
<_jannau_> we will need a new mesa release to retain 30 bit color support. kwin will use xrgb2101010 with argb8888 cursor overlay if both are available
deteg1337 has quit [Ping timeout: 480 seconds]
Dementor has quit [Read error: Connection reset by peer]
Dementor has joined #asahi-dev
<marcan> oh, did we grow cursor plane support?
<marcan> (and why does that affect mesa?)
<_jannau_> no, just local testing
<_jannau_> I removed the fake support for argb210101010 after alyssa added support for xrgb2101010
<_jannau_> see d11332288beb
<marcan> ahh
deteg1337 has joined #asahi-dev
<marcan> yeah okay
<marcan> we're doing a new mesa soon anyway
deteg1337 has quit [Ping timeout: 480 seconds]
Thsf has joined #asahi-dev
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
bps has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
raveling has joined #asahi-dev
raveling has quit [Ping timeout: 480 seconds]
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
<sven> I also wonder if the older atcphys already keep the fuses on pd power off and/or reset or if apple changed their kext to skip that reset
<sven> would be nice if the fuses could also just be applied from m1n1
<sven> i thought they got dropped but maybe I messed up when I checked that ages ago
<marcan> it's possible we now have to save/restore
<marcan> but I was thinking the same
<marcan> save/restore was my plan for PCIe too given m1n1 sets that up
<marcan> sven: also I think they're now gating the USB_AON power domains which they weren't before, so at least ont t602x they're gating *more*
<marcan> *on the
<marcan> but yeah, we should be able to skip upstreaming the whole atcphy fuse mess if we can move that to m1n1 for older fw/soc compat
deteg1337 has quit [Ping timeout: 480 seconds]
<sven> I’ll take a look this weekend
deteg1337 has joined #asahi-dev
A_L_I_C_E has quit [Ping timeout: 480 seconds]
A_L_I_C_E has joined #asahi-dev
<_jannau_> at least a short reset of the m1 max pcie pd in u-boot doesn't break anything. even the links stayed up. either config space or dart-apcie accesses resulted in SErrors though
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
deteg1337 has quit [Read error: Connection reset by peer]
deteg1337 has joined #asahi-dev
A_L_I_C_E has quit [Ping timeout: 480 seconds]
A_L_I_C_E has joined #asahi-dev
MajorBiscuit has quit [Ping timeout: 480 seconds]
raveling has joined #asahi-dev
chipxxx has quit [Remote host closed the connection]
chipxxx has joined #asahi-dev
chipxxx has quit [Remote host closed the connection]
chipxxx has joined #asahi-dev
raveling has quit [Ping timeout: 480 seconds]
cy8aer has quit [Remote host closed the connection]
siglazin has joined #asahi-dev
Thsf has quit [Ping timeout: 480 seconds]
gabuscus has quit []
hightower2 has joined #asahi-dev
A_L_I_C_E has quit [Read error: Connection reset by peer]
gabuscus has joined #asahi-dev
cy8aer has joined #asahi-dev
raveling has joined #asahi-dev
raveling has quit [Ping timeout: 480 seconds]
raveling has joined #asahi-dev
pthariensflame has joined #asahi-dev
pthariensflame has quit []
siglazin has quit [Remote host closed the connection]
___nick___ has joined #asahi-dev
MajorBiscuit has joined #asahi-dev
___nick___ has quit []
___nick___ has joined #asahi-dev
___nick___ has quit []
___nick___ has joined #asahi-dev
___nick___ has quit [Ping timeout: 480 seconds]
MajorBiscuit has quit [Quit: WeeChat 3.6]
gabuscus has quit []
gabuscus has joined #asahi-dev
gabuscus has quit []
cylm has joined #asahi-dev
gabuscus has joined #asahi-dev
cylm_ has quit [Ping timeout: 480 seconds]
gabuscus has quit []
A_L_I_C_E has joined #asahi-dev
nyilas has quit [Remote host closed the connection]
tanty has quit [Quit: Ciao!]
bcrumb has joined #asahi-dev
chipxxx has quit [Ping timeout: 480 seconds]
deteg1337 has quit [Remote host closed the connection]
tanty has joined #asahi-dev
deteg1337 has joined #asahi-dev
tanty has quit []
bps has joined #asahi-dev
bcrumb has quit [Quit: WeeChat 3.8]
deteg133_ has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
tanty has joined #asahi-dev
axboe_ is now known as axboe
deteg133_ has quit [Ping timeout: 480 seconds]
gabuscus has joined #asahi-dev
deteg1337 has joined #asahi-dev
axboe has quit [Ping timeout: 480 seconds]
bps has quit [Ping timeout: 480 seconds]
axboe has joined #asahi-dev
WindowPa- has quit [Read error: Connection reset by peer]
WindowPain has joined #asahi-dev
A_L_I_C_E has quit [Remote host closed the connection]
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
chadmed_ has joined #asahi-dev
<jannau> marcan: small PCIe copy'n'paste fix for pre t6020-pcie in https://github.com/AsahiLinux/linux/pull/134
deteg1337 has quit [Ping timeout: 480 seconds]
<jannau> t602x/bringup works otherwise on mac studio with both 12.3 and 13.2 firmware
<jannau> with working Night Color (kwin_wayland 5.27.4)
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
<ChaosPrincess> Great, linux manages to power gate something in the time after it starts but before it loads modules and so the mipi link explodes in a serror.
deteg1337 has joined #asahi-dev
<jannau> add pd_ignore_unused to the kernel command line or make the power-domain always-on. Is it shared between two or more devices?
<ChaosPrincess> I am doing pd_ignore_unused for now, i just hoped that i could drop it by adding all the necessary stuff to power-domains
<jannau> do we have a problem with dart runtime PM? dart is probed first due to the iommu dependency, might immediately power-down since it is unused. if the device is not so far probed that it forces the pd on, the pd will power down
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
nsklaus has quit [Quit: ZZZzzz…]
deteg1337 has joined #asahi-dev
<CoolStar> ChaosPrincess: does M1 use MIPI for the webcam? since I noticed an ISP in the DT but haven't looked much further into it
A_L_I_C_E has joined #asahi-dev
deteg1337 has quit [Ping timeout: 480 seconds]
deteg1337 has joined #asahi-dev