#asahi-dev · 2021-11-09 11:44
marcanit'd be a bespoke interface#asahi-dev · 2021-11-09 11:44
marcanyeah#asahi-dev · 2021-11-09 11:43
marcanwhile reloading SMC needs an SMC restart or at least a clean shutdown, if we can even do that#asahi-dev · 2021-11-09 11:43
marcanone advantage of doing the SMC driver with sub-drivers on top is you could reload the subdrivers with impunity#asahi-dev · 2021-11-09 11:42
marcanthere is no sane way of muxing stuff over the mailbox#asahi-dev · 2021-11-09 11:42
marcanyes, exactly#asahi-dev · 2021-11-09 11:41
marcanwith the m1n1 driver I made today#asahi-dev · 2021-11-09 11:41
marcanI did see that too#asahi-dev · 2021-11-09 11:41
marcanand then other drivers that talk to *that*#asahi-dev · 2021-11-09 11:41
marcanwhat we *could* have is one SMC driver that provides the K/V interface#asahi-dev · 2021-11-09 11:41
marcaneither way, we wouldn't have multiple SMC drivers on top of RTKit#asahi-dev · 2021-11-09 11:41
marcancould be I fail it somewhere#asahi-dev · 2021-11-09 11:40
marcanno idea what's up with that...#asahi-dev · 2021-11-09 11:40
marcanalso, uh, I ran into a weird thing where the first command issued after init returns garbage? (low 32 bits of init result end up in high bits?)#asahi-dev · 2021-11-09 11:39
marcanso I'd do the same#asahi-dev · 2021-11-09 11:39
marcanI've never seen it overlap them scrolling through the HV logs#asahi-dev · 2021-11-09 11:39
marcansven: macos always seems to serialize SMC commands#asahi-dev · 2021-11-09 10:19
marcan(byte enables gone wrong)#asahi-dev · 2021-11-09 10:19
marcanwhich is bizarre, usually writes are what break first#asahi-dev · 2021-11-09 10:19
marcan32-bit works fine, any size *writes* work fine#asahi-dev · 2021-11-09 10:18
marcanall 8-bit and 16-bit reads#asahi-dev · 2021-11-09 10:18
marcanalways 0xff/0xffff for any address#asahi-dev · 2021-11-09 10:13
marcanit is#asahi-dev · 2021-11-09 10:06
marcanshould be an easy patch then#asahi-dev · 2021-11-09 10:06
marcanah, cool, I was wondering about that (hadn't looked yet)#asahi-dev · 2021-11-09 09:27
marcan(otherwise I'd just find what it does differently)#asahi-dev · 2021-11-09 09:27
marcanalso this problem also happens in osx#asahi-dev · 2021-11-09 09:27
marcanapple's driver is for multiple SDHC chips and unconditionally uses 32-bit reads/writes for everything#asahi-dev · 2021-11-09 09:27
marcanthough it shouldn't really hurt to do unconditionally#asahi-dev · 2021-11-09 09:26
marcannot sure about the read8/16 override; I'd love to find someone with one of these things in another machine to find out if it works and if any revision registers say anything interesting#asahi-dev · 2021-11-09 09:26
marcandiff for the SD driver: https://mrcn.st/p/tPlPkAR5#asahi-dev · 2021-11-09 09:25
marcanI will say after I poked the CD/WP polarity bits (which I ghidra'd because faking it in the HV and diffing would be a bit silly just to find two bits...) and worked around the read8/16 thing, it worked fine#asahi-dev · 2021-11-09 09:24
marcan:D#asahi-dev · 2021-11-09 09:24
marcan*and* the byte order swap#asahi-dev · 2021-11-09 09:24
marcansven: the wii sdhc had this problem too :D#asahi-dev · 2021-11-09 09:24
marcanthis isn't the first time I see this crap in an SDHC host, but it's weird that it's reads only and apparently nobody hits this on other platforms?#asahi-dev · 2021-11-09 09:23
marcanas do all size writes#asahi-dev · 2021-11-09 09:23
marcanbut 32-bit reads do work#asahi-dev · 2021-11-09 09:23
marcanother than that we also need platform quirks for the SD reader (CD/WP pin polarities), which means yet another OF PCIe device node :-)#asahi-dev · 2021-11-09 09:22
marcanit's weird#asahi-dev · 2021-11-09 09:22
marcanyou'd *think* that's just a chip quirk, but Linux already has support for this specific chip and it doesn't work around it... so either the chip revision in these machines is bugged or this only happens on this platform?#asahi-dev · 2021-11-09 09:22
marcanI did run into a bizarro problem, though. read8/read16 from the SD card reader does not work, it returns all FF. But from the WLAN chip it does.#asahi-dev · 2021-11-09 09:21
marcanmaz: works now, wasn't really much to do other than poke the right SMC GPIOs to enable the devices... I'll bisect out my patches to see what's really necessary#asahi-dev · 2021-11-08 16:59
marcanwell, not getting anywhere so far :p#asahi-dev · 2021-11-08 15:47
marcannow I'm surprised this worked in M1...#asahi-dev · 2021-11-08 15:47
marcan... and the pcie fuse application code in m1n1 is completely broken :D#asahi-dev · 2021-11-08 15:19
marcanok, pcie fuse bits changed for one#asahi-dev · 2021-11-08 14:45
marcanp.write32(0x580000000 + 0x4, 0x0)#asahi-dev · 2021-11-08 14:45
marcan# [cpu1][0xfffffe0012d5bb80] MMIO: W.4 0x580000004 (apcie[1], offset 0x04) = 0x0#asahi-dev · 2021-11-08 14:45
marcanok, so this at least gets pcie not to crash on m1pro, but the links don't come up yet