#asahi · 2021-04-06 14:21
arndIf it's in m1n1, u-boot wouldn't care about the registers either, right?#asahi · 2021-04-06 14:20
arndkettenis_: what is the tradeoff for having the PCIe init code in m1n1 vs u-boot?#asahi · 2021-04-06 14:13
arndI don't think there is any generic way to trigger a PERST from outside the host controller driver#asahi · 2021-04-06 14:12
arndkettenis_: looking through a few Linux drivers that trigger a PERST, I see that most of them do it only during the initial probe, though the Mediatek driver also does it when resuming from suspend#asahi · 2021-04-06 13:46
arndmost of the registers looks like they could be abstracted into a phy driver to keep them out of the base PCIe code, but that doesn't really help the question of how that driver knows the correct values#asahi · 2021-04-06 13:45
arndmarcan: I looked at the known PCIe controllers but see no particular resemblance. Even if it's one of the ones we already support, it's likely that the tuning registers are Apple's add-on#asahi · 2021-04-06 13:34
arndmaybe we already have code that understands them#asahi · 2021-04-06 13:33
arndmarcan: have you checked if the registers match up with one of the common PCIe implementations (dwc, cadence, mobiveil, ...)?#asahi · 2021-04-06 13:31
arndmarcan: can you read back the registers from config space during boot and remember the current values?#asahi · 2021-04-06 13:29
arndFor PCIe init, I would hope that can be done in m1n1 before loading the OS#asahi · 2021-04-06 13:29
arndI fear we have to look at each one individually.#asahi · 2021-04-06 13:27
arndmarcan: what do those registers do? Is this for suspend-to-ram or something else?#asahi · 2021-04-01 11:25
arndout of the three remaining i2c algorithms that remain in drivers/i2c/algos, only the bitbang version is actually used by more than two drivers, the other two each have an ISA (!) frontend and a platform front-end#asahi · 2021-04-01 11:23
arndthe other way would be to have everything in one file, with some #ifdefs to deal with the possible combinations of platform and pci support, but that seems ugly#asahi · 2021-04-01 11:22
arndTraditionally, the algorithm would be in drivers/i2c/algos/, with an abstract probe function, but this is probably more work than necessary#asahi · 2021-04-01 11:21
arndNot sure what the current method is for having multiple i2c drivers with the same i2c_algorithm. I'd probably start out having one module that exports it as i2c_pasemi_algorithm, and then duplicate the probe() function into one module for pci and platform each.#asahi · 2021-04-01 11:13
arndagreed on documenting the interrupt#asahi · 2021-04-01 11:06
arndnevermind, I missed that this is a pci_driver in the original version#asahi · 2021-04-01 11:04
arndah, the driver is so old we didn't document the bindings back then#asahi · 2021-04-01 10:56
arndok#asahi · 2021-04-01 10:55
arndsven: IIRC ojn said he intentionally left out irq support when he wrote that driver originally. You could ask him about that when he shows up on #armlinux the next time#asahi · 2021-04-01 10:54
arnddoesn't have to be in the v4 series, but we may have enough time to get it into the pull request that I will send to torvalds for v5.13#asahi · 2021-04-01 10:54
arndright, that's what I meant#asahi · 2021-04-01 10:52
arndsven, marcan: if we can get consensus on the binding for the i2c port, this might be something to include in the initial dt#asahi · 2021-03-29 13:18
arndright, the quirk is for 0x1b73:0x1000, not for 0x1b73:0x1100#asahi · 2021-03-29 13:17
arndah: /* Some Fresco Logic host controllers advertise MSI, but fail to generate interrupts. Don't even try to enable MSI. */#asahi · 2021-03-29 13:15
arndbut the driver can clearly do it#asahi · 2021-03-29 13:15
arndon my x86 machine, I see that none of the XHCI actually enables MSI-X, it's just one interrupt per instance#asahi · 2021-03-29 13:14
arndtg3 apparently supports up to four queues and one management interrupt in MSI-X mode, so at most five interrupts according to the current driver source#asahi · 2021-03-29 13:11
arndthanks#asahi · 2021-03-29 13:08
arndwhat are the device/vendor IDs on the wifi and ethernet chips?#asahi · 2021-03-29 13:06
arndso we'd prefer to have nine MSIs if supported by that xhci implementation#asahi · 2021-03-29 13:06
arndthis is xhci: xhci->msix_count = min(num_online_cpus() + 1, HCS_MAX_INTRS(xhci->hcs_params1))#asahi · 2021-03-29 13:04
arndbut what is the maximum number of MSIs that any of these three would want to use?#asahi · 2021-03-29 13:03
arndsorry, I meant the first host bridge has three ports that are each wired to one on-board device#asahi · 2021-03-29 13:02
arndkettenis1: the first PCIe port is hardwired to three on-board devices, right? Can any of those actually use more than eight MSIs?#asahi · 2021-03-29 12:56
arndI would also guess this is not enforced by the hardware#asahi · 2021-03-29 12:56
arndin ADT, this is only done for one of the PCI controllers (apice), where each bridge gets eight MSIs, while the other two have a single bridge with 32 MSIs#asahi · 2021-03-29 12:51
arndnevermind, I misread the corellium patches, it's always three distinct ranges#asahi · 2021-03-29 12:47
arndin corellium's dt, it's always 32 MSIs starting at AIC interrupt 704, while in ADT, they are at AIC interrupt 704-735, 738-769 and 818-849, respectively#asahi · 2021-03-29 12:45
arndhmm, the interrupt numbers disagree between corellium and adt#asahi · 2021-03-29 12:45
arndit's always the upper page, after then end of the vm-base/vm-size window in the dart#asahi · 2021-03-29 12:44
arndmaz: are you sure it's non-translated rather than a hardwired passthrough in the dart?#asahi · 2021-03-29 12:26
arndbut if any device can trigger any of the available global MSIs, it makes sense to conceptually have them handled by the aic driver#asahi · 2021-03-29 12:25
arndi.e. if every pci host bridge has the same 32 MSIs at doorbell address 0x00f0ffff00000000, but they are routed to different AIC interrupts, then modeling them as separate irqchips as you say is probably better#asahi · 2021-03-29 12:24
arndmaz: the part I don't understand so far is whether the assignment of specific MSI ranges in ADT is enforced by the hardware, or if that's just done to split up the available numbers evenly#asahi · 2021-03-29 12:22
arndIn ADT, the "msi-parent-controller" property does point at the AIC, but of course that doesn't have to mean anything ;-)#asahi · 2021-03-29 12:20
arndmaz: it would be really nice to just use the generic pci controller though. What code does the mapping of the msi doorbell? If that's in the msi-controller driver, it shouldn't really matter whether that goes through the iommu or is passed through#asahi · 2021-03-29 12:06
arndmaz, kettenis1: based on my understanding of how MSI works on this chip, I think modeling the AIC as the MSI target is both the easiest and the closest to what the hardware actually does#asahi · 2021-03-26 20:24
arndright