#
…

2023-04-16

00:17newiz has joined #asahi-dev
01:09___nick___ has quit []
01:11___nick___ has joined #asahi-dev
01:12___nick___ has quit []
01:15___nick___ has joined #asahi-dev
01:25user982492 has joined #asahi-dev
01:32sefidel has quit [Remote host closed the connection]
01:33sefidel has joined #asahi-dev
01:39cylm has quit [Ping timeout: 480 seconds]
01:42hightower4 has joined #asahi-dev
01:46user982492_ has joined #asahi-dev
01:49hightower3 has quit [Ping timeout: 480 seconds]
01:51user982492 has quit [Ping timeout: 480 seconds]
02:00gabuscus has quit []
02:05___nick___ has quit [Ping timeout: 480 seconds]
02:08cylm has joined #asahi-dev
02:13gabuscus has joined #asahi-dev
04:05kettenis has quit [Remote host closed the connection]
04:05kettenis has joined #asahi-dev
04:46kl has quit [Quit: ZNC - https://znc.in]
04:46kilolima has joined #asahi-dev
04:54stipa is now known as Guest11221
04:54stipa has joined #asahi-dev
04:56Guest11221 has quit [Ping timeout: 480 seconds]
05:16user982492_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:49nicolas17 has quit [Quit: Konversation terminated!]
05:57raveling has joined #asahi-dev
06:19pthariensflame has joined #asahi-dev
06:30pthariensflame has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:44raveling has quit [Ping timeout: 480 seconds]
06:49pthariensflame has joined #asahi-dev
06:58pthariensflame has quit [Quit: Textual IRC Client: www.textualapp.com]
07:06raveling has joined #asahi-dev
07:09jannauwhere did we get the SPI pins from? I'm trying to hook the touchbar touchscreen and we don't have the pins for spi3
07:12jannauon t8112
07:13marcanmonitoring GPIO registers with regmon or gpiola while messing with SPI
07:13marcanI need to do that for the NOR SPI on t602x...
07:14ChaosPrincessOn t8103 i randomly guessed them by getting the cs pin from adt and taking 4 pins down from that.
07:14ChaosPrincessMight also work for t8112
07:17marcanI think if you guess wrong it will still work but might mess something else up...
07:22raveling has quit [Ping timeout: 480 seconds]
07:26jannauoh, you don't have any SPI0_PINS in the touchbar PR just cs. that works on t8112 as well
07:26jannausddm associates the touchscreen with the main display
07:27jannauand so does kde
07:30jannaukde has configuration to set the target display
07:33jannauChaosPrincess: the touchbar turned out more popular than I assumed judging by the reaction on my posts yesterday
07:33raveling has joined #asahi-dev
07:34psykoseit might sound stupid but i never really thought of that being good
07:34psykoseusing that touchbar thing on my girlfriends laptop made me want to hit walls
07:34psykoseand this makes it.. more useful...
07:34psykosetruly incomprehensible :p
07:35ChaosPrincessI had a work-issued intel macbook from before they got a hardware esc key. Now _that_ was terrible :P
07:35chadmedit could have been cool but not as a total replacement of real F keys, and no developers took it up except ones paid by apple to do so
07:35chadmedusing it for a plasma panel is a neat idea thoug h
07:36ChaosPrincesschadmed: Yea. And the macos api for it isnt great.
07:36psykoseChaosPrincess: yeah, my girlfriends has touchbar esc
07:36psykosei think she's a psychopath at this point tbh
07:39marcanI think we don't actually need to set the extra pinmuxes
07:39marcanonly CS since we do use that one differently from Apple (I think they use direct GPIO for that instead of the native CS?)
07:39marcananyway I confirmed the spi1 pins on t602x
07:39marcanI guess I might as well do spi2 and spi4
07:40ChaosPrincessI use cs as gpio in the z2 driver too.
07:40ChaosPrincessDont remember exactly why, think using it from the controller didnt work or sth
07:40marcandid you set the pinmux properly?
07:40marcansetting that one way will work with gpio, the other way with spi
07:41ChaosPrincessDont think so
07:42raveling has quit [Ping timeout: 480 seconds]
07:44jannauyou use it just for "cs-gpios". that seems to be a well establish dt property and seems to get picked up by gpiolib-of for us
07:46jannaumaybe not
07:48jannauno, I see it's manually handled in the driver
07:49ChaosPrincessWell, thats just me being bad at writing drivers :P i since got told that i should move it to the parent dt node, and rip out all the manual code and it will be done automatically
07:50kettenisfigured out that the board function to fixup the device tree runs before just before u-boot adds the initrd properties for an initrd it loaded itself
07:50raveling has joined #asahi-dev
07:50kettenisso deleting the initrd properties there is good enough
07:50kettenispushed to the t6020 branch
07:51newiz has quit [Quit: Konversation terminated!]
07:55marcanpushed the SPI DTs to t602x/bringup
07:58raveling has quit [Ping timeout: 480 seconds]
08:04kettenismarcan: so your idea was for the installer to build a separate cpio with selected firmware for u-boot?
08:05kettenisand then cat that to the back of the boot.bin after unpacking the zip file on the ESP?
08:06darkapex1 has quit []
08:06darkapex has joined #asahi-dev
08:07raveling has joined #asahi-dev
08:07jannauChaosPrincess: have you checked if the 200m clock is correct for the touchbar spi? according to macos logs it uses a 24 MHz clock on j493
08:11marcankettenis: yup
08:12marcansame with the distro scripts that do updates
08:14marcanjannau: it should be 24m, that's cargo cult copypasta from the nor spi
08:14marcannor uses 200m, everything else uses 24
08:15raveling has quit [Ping timeout: 480 seconds]
08:17marcanjannau: confirmed on j493 ADT
08:17marcan*ADT+PMGR
08:18kettenisto make sure the ethernet address on j474 is populated
08:19marcangood catch
08:34raveling has joined #asahi-dev
08:37nsklaus has joined #asahi-dev
08:42raveling has quit [Ping timeout: 480 seconds]
08:57marcanpovik: reproduced the cs42l83 issue that altdistros are hitting. it clearly has to do something with kernel config, timing, or something like that.
08:58marcanand it is related to clocking and clock switching
08:58marcangoing to try to fix it
09:01kit_ty_kate has quit [Quit: WeeChat 3.6]
09:03kettenisthe cs42l83 is a bit quirky and needs to have the SCLK running before switching away from the internal oscillator
09:03kettenisotherwise you loose i2c access
09:04kettenisit is not clear to me what bits in the MCA actually turn on the SCLK
09:21raveling has joined #asahi-dev
09:24marcanpovik: we are disabling the MCA clocks before muting the codec
09:24marcankettenis: it's a logic issue
09:24marcanand it's just broken, it pulls the clock before switching off so it never had a chance
09:29raveling has quit [Ping timeout: 480 seconds]
09:38raveling has joined #asahi-dev
09:46raveling has quit [Ping timeout: 480 seconds]
09:57marcanI suspect the clock shutdown might take a while or there is some other timing nuance that makes it work for my usual kernel builds, and also it works for me the first time on my repro kernel
09:57marcanbut it's definitely broken
10:15raveling has joined #asahi-dev
10:16i509vcb has quit [Quit: Connection closed for inactivity]
10:16jannaumarcan: did you test dockchannel/mtp with 13.3? it's broken on the j493. one obvious problem is that the sram requested by rtkit is 2 pages further down. but even after adjusting the sram size in the devicetree it is still broken without error logged
10:17jannaudriver core complains about failing to create a device link to the smc gpio but that appears also with 12.3 and working mtp
10:21jannauprobe succeeds but it looks like no packets arrive
10:33marcanjannau: you're right, it's broken :/
10:34marcanwait sec, sram first
10:35jannaujust double the size
10:38marcanI made it cover everything, looks like it's 1MiB
10:42marcanjannau: yeah it's broken :/
10:42marcanI'll figure it out
11:01marcanjannau: it's oslog
11:02raveling has quit [Ping timeout: 480 seconds]
11:07marcanwe need to actually implement that properly
11:15roxfan has quit [Ping timeout: 480 seconds]
11:15jannaukettenis: linux boot works now with firmware "initrd"
11:16raveling has joined #asahi-dev
11:19jannaulet's see if I can refactor the linux driver to make the link up check not as ugly as it is now
11:20hightower4 has quit []
11:20cylm has quit [Quit: WeeChat 3.6]
11:20kettenisu-boot doesn't do any interrupt setup (since it doesn't use interrupts)
11:21kettenisso that still has to happen in the linux driver
11:21kettenisand that includes MSIs
11:21marcanjannau: also the mtp protocol init message parsing was wrong
11:21marcanfixing that
11:22cylm has joined #asahi-dev
11:25jannauyes, it is intertwined with the other port setup stuff. I currently just added 'if link up's which makes the code hard to read/follow
11:33marcandoes anyone remember what we added oslog for? the current behavior seems patently wrong as far as MTP goes, but I have no idea why it's there at all
11:35sveni vaugely remember someone adding it to get some co-processor to boot (or not hang after a while)
11:38jannauI think I added it for dcp. iirc it just needed to be started
11:40marcanI don't see oslog in my most recent dcp log
11:41kettenismy OpenBSD commit messages says it was for NVMe
11:41marcannvme does have the endpoint
11:41marcanhowever it sends no messages
11:41marcanso I have no idea where the logic came from
11:43marcanit's not implented in u-boot though
11:44ketteniswhich probably means that starting the endopoint for NVMe isn't necessary
11:45jannauin my logs I see endpoint 0x8 for dcp in 12.3, 12.4 and 13.2. it's gone in 13.3
11:46marcanhowever, I still see no messages in my old DCP logs
11:46svenohh... didn't jannau (?) notice that the endpoint was also required for nvme in some firmware version?
11:46svenmaybe that's where that nvme comment comes from :D
11:47marcanbut u-boot doesn't implement it...?
11:47svenmaybe nvme just hangs after a while if it's not started?
11:47svenit does that for syslog
11:48svendunno, it always worked without oslog for me but I don't even know what firmware I'm running
11:49marcanI'm just going to remove it from m1n1 and we'll see if anything breaks :p
11:49marcanOTOH it will need to be added to u-boot for MTP...
12:02jannaut8112 dcp on 12.3 works without starting oslog
12:05marcan12.4 you mean?
12:07jannaubut based on the time I added it it would have been required on m1 with macos 12.x with x < 3
12:07jannauerr, yes. 12.4
12:10marcanyeah, so we can drop it then
12:11kettenismarcan: we don't use the ltssmX regs anywhere in the PCIe drivers
12:11kettenisis there a good reason to add them anyway?
12:12kettenis(I'm considering submitting the bindings upstream to prevent myself from getting burned again)
12:15marcandidn't I drop that?
12:15marcanm1n1 uses it for what looks like a bug workaround which *may* be needed in linux eventually but I'm not sure, we can always add it later
12:19kettenisunless I missed something the regions are still defined in t602x-die0.dts
12:19kettenisbut I won't include them in the binding for now
12:23marcanjannau: pushed m1n1 and the bringup branch, mtp should work now
12:24marcanthe change was backwards-compatible, I had just misinterpreted the protocol
12:32kettenisI'd better fix that on the OpenBSD side as well then
12:39jannaumarcan: m1n1 breaks on j274 without oslog (12.3)
12:39marcanjannau: how does it break?
12:41jannauseems to be dead after display init. I removed it completely though, i.e. not even starting the endpoint
12:41ChaosPrincessmarcan: is there a way to make m1n1 reliably survive sleep
12:44marcanjannau: seems to work for me with what's in m1n1:main (drop the logic, keep the ep start)
12:45marcanhaven't tested it as stage1 though
12:47jannauyes, works with main. without it I need to power cycle it. it's still dead after power cycle via usb-pd
12:47marcanhuh, wow.
12:47marcanthat's quite the crash
12:49jannauor at least m1n1's uart and usb are still dead
12:49marcanit's like the other buffer requests except the field defs are different and the address is in 4K pages
12:52kettenismarcan: strange though it's like they made more space for the address
12:52kettenisand then decided it wasn't enough and made more space by shifting the address
12:52marcanyeah, it's weird...
12:52marcanthey already had 44 bits, which is enough for current machines with up to 42-bit address space everywhere
12:53marcanoh yeah, APPLE_RTKIT_BUFFER_REQUEST_IOVA should be 43, 0 (you don't care, only the GPU cares about those high bits, but just out of technicality)
12:53marcan(the GPU sign-extends so it needs the high bit)
12:54marcanalso I guess I should fix mtp there too
12:54marcanI can do that one
12:55marcanoh actually, don't need to
12:55marcanwe don't even parse that stuff in u-boot
12:56marcanthey did increase the init message lengths though, I hope we aren't going to overflow the fifo with our trick for that...
12:56ketteniswe still have to get the mtp stuff in u-boot upstream at some point...
12:56kettenisbut that is best done once we have bindings
12:58marcannah, we're still good for the size, as long as they don't double it
12:59marcanand yeah, I need to clean up the shutdown path and submit this to linux, *however*, I'm partially slacking on that on purpose so we can figure out the Fn key story
12:59marcanbecause right now the keyboards don't work *at all*, which means doing whatever I want with Fn is not a regression
12:59marcanif we add this driver, I think the keyboard will work to some extent even without other patches, and then we might end up in trouble
13:00roxfan has joined #asahi-dev
13:00marcanOTOH I could just upstream the keyboard stuff with the no Fn emulation idea to begin with, even if we still carry downstream patches to add emulation until the xkb stuff is ready
13:01jannauyes, it should be handled by the default HID keyboard support
13:04marcanif it's just the default keyboard it's fine, it won't match the apple one nor do Fn emu
13:04marcanso yeah, I guess this doesn't block dockchannel
13:05marcanspi though, I think that would get matched already?
13:07jannauI don't think so. iirc the product ids are unique even if the vendor id would matches across different busses
13:26raveling has quit [Ping timeout: 480 seconds]
13:48raveling has joined #asahi-dev
13:56raveling has quit [Ping timeout: 480 seconds]
14:05raveling has joined #asahi-dev
14:11gabuscus has quit [Ping timeout: 480 seconds]
14:15gabuscus has joined #asahi-dev
14:47povikugh. tweaking asoc ordering...
14:48povikmarcan: how did you check hw_free indeed happens before the mute?
14:48poviki thought hw_free is symmetrical to prepare, where we turn on the clocks
14:48povikso that the way it was makes sense
14:48povikalso i am not sure
14:48povik* not sure 'shutdown' is ever called, usually
14:49povikunless the driver is unloaded
14:55marcanpovik: I added WARN_ON(1) to get stack traces and printks to log what is happening
14:55marcanshutdown is called when the device is closed
14:55marcanhw_free is symmetrical to hw_params AIUI
14:59povik16:55 <@marcan> shutdown is called when the device is closed
14:59povikah, you are probably right
14:59povik16:55 <@marcan> hw_free is symmetrical to hw_params AIUI
15:00povikthat would still mean it's ok to turn off the clock there since hw_params happens *before* prepare
15:00povikthough maybe pmdown_time messes up the ordering
15:01marcanhw_free is an ioctl that userspace can send at any time AIUI, and which does not trigger a mute
15:01poviknot after prepare
15:01marcanso if you want to do it that way the codec drivers would have to mute on hw_free too (I think some do)
15:01marcanwell it is calling it after prepare :p
15:01povikerr, i though you wrote hw_params
15:02marcanhw_free is getting called from the ioctl path, while the mute and later shutdown are getting called from the device close path
15:03marcanso clearly hw_free alone isn't going to work unless we add an explicit mute path in there
15:03marcanI won't claim to know what the "right" thing is here but that's what's happening right now
15:03povikmute can happen after hw_free so it's broken
15:03poviki will look at this more later
15:06kettenisI don't see any oslog messages on my machines (all with 13.2 or even older firmware)
15:15marcanpovik: cs43130.c has a hw_free callback that switches to internal clock, so maybe that's the right way
15:16marcanbut on the other hand, I sure would expect a mute to happen before that anyway
15:17povikyeah, maybe that pmdown_time i mentioned is what causes mute to happen later
15:26marcanyeah, that would make sense
15:39roxfan has quit [Ping timeout: 480 seconds]
15:40chipxxx has joined #asahi-dev
16:05jannaustage 1 m1n1 is broken with 13.3.1: "rtkit(dcp): unknown oslog message 103ff8000f0025f"
16:15kettenisso it is sending a message with a pre-assigned address?
16:16kettenisthis is on m2?
16:22svenbah.. so either the fuses need to be re-applied for thunderbolt mode or I just re-introduced that old bug where the first plug event doesn't work *sigh*
16:24jannauno, j274
16:29marcanOK, so that's what the old logic was for, pre-assigned addresses. so we need to check for dva != 0 and reintroduce the old code.
16:29marcanI wonder what that 0xff8 thing is about though...
16:30sosys has joined #asahi-dev
16:30roxfan has joined #asahi-dev
16:34kettenisbut 0xf0025f << 12 = 0x25f000
16:35ketteniswhich doesn't make sense as a memory address either
16:36jannauthat's a dva so we have to lookup what's mapped there
16:37jannaurtkit(dcp): pre-allocated buffer (ep 0x8, dva 0xff8000f0025f, phys 0xbe5bd825f)
16:37marcanneeds the left shift
16:38marcanthe dva is >> 12 in the message
16:48sosys has quit [Ping timeout: 480 seconds]
16:48jannauerr, oslog is probably not the problem. there are two EPIC errors. I ignored them since at least one happens with 13.2 as well
17:14sosys has joined #asahi-dev
17:26sosys has quit [Quit: leaving]
17:48raveling has quit [Ping timeout: 480 seconds]
18:11raveling has joined #asahi-dev
18:14user982492 has joined #asahi-dev
18:16i509vcb has joined #asahi-dev
18:42zalyx0 has quit [Quit: later alligator]
19:00drubrkletern has joined #asahi-dev
19:29landscape15 has joined #asahi-dev
19:32landscape15 has quit []
19:38c10l has quit [Ping timeout: 480 seconds]
19:40c10l has joined #asahi-dev
19:52user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:56user982492 has joined #asahi-dev
19:59raveling has quit [Ping timeout: 480 seconds]
20:13user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:21raveling has joined #asahi-dev
20:29raveling has quit [Ping timeout: 480 seconds]
20:37raveling has joined #asahi-dev
20:45raveling has quit [Ping timeout: 480 seconds]
20:46newiz has joined #asahi-dev
20:51raveling has joined #asahi-dev
20:51drubrkletern has quit [Remote host closed the connection]
20:51kaazooHi, I'm trying out asahi-installer current main branch directly via test.sh on 13" M2 Pro. I switched the m1n1 Git submodule to point to t602x/bringup branch before, in order to have the latest changes. Basic installation seems to have worked, but m1n1 doesn't have required devicetree: "ERROR: Kernel found but no devicetree for apple,j414s available" during boot.
21:04jannauthat will you get you only marginally farther. you will have also to update u-boot and the kernel
21:05jannaudo to the missing devicetree m1n1 will be in proxy mode and you can boot a kernel via usb: https://github.com/AsahiLinux/docs/wiki/Tethered-Boot-Setup-%28For-Developers%29
21:06jannauonce you booted you can start replacing the missing bits
21:50user982492 has joined #asahi-dev
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:02yrlf has joined #asahi-dev
22:14pbsds has quit [Ping timeout: 480 seconds]
22:17raveling has quit [Ping timeout: 480 seconds]
22:40raveling has joined #asahi-dev
22:45zalyx0 has joined #asahi-dev
22:48raveling has quit [Ping timeout: 480 seconds]
22:56zalyx0 has quit [Quit: later alligator]
23:00raveling has joined #asahi-dev
23:04zalyx0 has joined #asahi-dev
23:05zalyx0 has quit []
23:08raveling has quit [Ping timeout: 480 seconds]
23:11chadmed_ has joined #asahi-dev
23:16zalyx0 has joined #asahi-dev
23:47hightower2 has joined #asahi-dev
23:48nsklaus has quit [Quit: ZZZzzz…]
23:53sosys has joined #asahi-dev
23:58nicolas17 has joined #asahi-dev
…