#asahi · 2021-06-02 21:21
svenbut we'll see#asahi · 2021-06-02 21:21
svenso one of the iommu maintainers at least didn't seem to hate the static pagetable hack#asahi · 2021-06-02 21:20
svenyeah#asahi · 2021-06-02 21:16
sven*:-)#asahi · 2021-06-02 21:16
svenhappy to put just about everything in there ;_0#asahi · 2021-06-02 21:15
svenfor my 4k test i just used dma-ranges = <0x42000000 0 0 0x8 0 0 0xffff0000>; without any good reason#asahi · 2021-06-02 21:14
svenhttps://f.svpe.de/1dbc4689fdf9bbe2296401000144489112e6972d4d4ad4d5c03f4ce5cbd2e0b1_0001-hack-the-dtsi-to-make-linux-happy.patch that's the only patch on top of your uboot dt to make my hacked kernel happy#asahi · 2021-06-02 21:11
svenobviously not great, but it's what i use to boot right now#asahi · 2021-06-02 21:11
sveni think it works without them because the clocks are already turned on in m1n1#asahi · 2021-06-02 21:08
svenyeah, the only issue are the clock bindings. i think if you comment them out in the uboot device tree and add the dart interrupts it works#asahi · 2021-06-02 21:07
svenhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/iommu/dma-iommu.c#n238#asahi · 2021-06-02 21:07
svenlet me find the only code that uses it#asahi · 2021-06-02 21:06
svenkettenis: almost completely#asahi · 2021-06-02 21:06
svenif you want pcie you need to load that through u-boot with some frankenstein device tree#asahi · 2021-06-02 21:05
svenhttps://github.com/svenpeter42/linux/commits/pcie/hack for now. will clean it up a little bit and then push to dart/dev soon#asahi · 2021-06-02 21:04
svennot great, but maybe better than just stopping at a BUG_ON during early boot#asahi · 2021-06-02 21:04
svenso for the 4k pages what i can do for now is just setup a static pagetable to map 0x0..0x100000000 to 0x800000000 and then setup dma-ranges to let the dma layer know about that offset#asahi · 2021-06-02 21:03
svenand that matches with the some function called fullBypassSupported in the kext which checks if bit 1 in the register 0x04 is set#asahi · 2021-06-02 21:03
sveni couldn't get bypass to work no matter which bits i set in the TCR#asahi · 2021-06-02 21:02
svenonly by programming a static pagetable#asahi · 2021-06-02 21:01
sveni'll probably send a v3 of the dart code to get some feedback on the 4k bypass hack but i hope that at least the dt binding should be fine sooner than later#asahi · 2021-06-02 20:58
sveni guess something kicked it every 100 or so ms#asahi · 2021-06-02 20:58
sveni have no idea#asahi · 2021-06-02 20:58
sven64 bytes from 192.168.42.1: seq=0 ttl=64 time=0.812 ms <-- and with working interrupts we're down to <1ms from what used to be ~130ms :-)#asahi · 2021-06-02 20:54
sveni changed the device tree to id #0 iirc#asahi · 2021-06-02 20:53
svenagain, 99% of this is thanks to maz and kettenis. i just did some plumbing to make sure it plays nicely with my dart driver#asahi · 2021-06-02 20:51
sven:-)#asahi · 2021-06-02 20:51
svenaaaaand we have working pcie #asahi · 2021-06-02 20:49
svenyup, that's it. thanks!#asahi · 2021-06-02 20:49
sven:D :D#asahi · 2021-06-02 20:49
sven[ 9.099932] IRQ83 (2) eoi#asahi · 2021-06-02 20:42
svenbut they never seem to fire#asahi · 2021-06-02 20:42
svenyeah, me neither. i've checked and the interrupts in the AIC are unmasked#asahi · 2021-06-02 20:09
svencan we please try to keep it on-topic in here?#asahi · 2021-06-02 18:57
sveni don't get any MSI interrupts though. still have to figure out what's going on there#asahi · 2021-06-02 18:54
svenbut it's getting there#asahi · 2021-06-02 18:53
svenmaz: https://github.com/svenpeter42/linux/commits/pcie/hack it's... not great.#asahi · 2021-06-01 21:04
svenbecause we need more bootloaders!#asahi · 2021-06-01 21:03
svenyes. but i guess one source tree is also fine if that's more maintainable long term#asahi · 2021-06-01 21:02
svenyeah :D#asahi · 2021-06-01 21:01
svenbloom: technically m1n1 and u-boot will become one anyway#asahi · 2021-06-01 21:01
svenbloom: sure, whatever works#asahi · 2021-06-01 20:52
svenit's also for bringing up pcie before loading the linux kernel over serial :D#asahi · 2021-06-01 20:51
svenu-boot then takes care of some more hw initialization and also comes with drivers to boot linux from various peripherals#asahi · 2021-06-01 20:51
svenm1n1 does very low-level hardware initialization (and also provides a nice experimentation / reverse engineering playground)#asahi · 2021-06-01 20:50
svendual boot is already supported by apple's firmware (iBoot)#asahi · 2021-06-01 20:16
svenbloom: shush.. now where's my downstream drm driver though? :-P#asahi · 2021-05-31 20:29
sveni still need to change the device tree between isolation mode and translated mode but i'll see if i can fix that tomorrow#asahi · 2021-05-31 20:29
svenwell.. that static pagetable hack works. looks like we theoretically can boot 4k kernels as well for now#asahi · 2021-05-31 20:08
svenand developing with vs code's remote ssh plugin