2021-04-06
00:43raster has quit [Quit: Gettin' stinky!]
01:13HannaM has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
02:05phiologe has quit [Ping timeout: 250 seconds]
02:06phiologe has joined #asahi
02:31odmir has quit [Remote host closed the connection]
03:03phiologe has quit [Ping timeout: 250 seconds]
03:03phiologe has joined #asahi
03:07marvin24 has quit [Ping timeout: 245 seconds]
03:08marvin24 has joined #asahi
06:01klaus has quit [Ping timeout: 260 seconds]
06:56jeffmiw_ has joined #asahi
06:56ephe_meral1 has joined #asahi
07:00jeffmiw_ has quit [Ping timeout: 252 seconds]
07:09francisstokes has joined #asahi
07:37francisstokes has quit []
07:37fstokesman[m] has joined #asahi
08:26vimal has quit [Ping timeout: 260 seconds]
08:29raster has joined #asahi
08:31luca020400 has quit [Read error: Connection reset by peer]
08:31luca020400 has joined #asahi
08:35vimal has joined #asahi
08:38furkan has quit [Ping timeout: 240 seconds]
08:46furkan has joined #asahi
09:00Augur[m] has quit [Quit: Idle for 30+ days]
09:11furkan has quit [Ping timeout: 268 seconds]
09:14furkan has joined #asahi
09:56pg12_ has quit [Quit: pg12_]
09:57pg12 has joined #asahi
10:04pg12 has quit [Remote host closed the connection]
10:06pg12 has joined #asahi
10:15choozy has joined #asahi
10:52furkan has quit [Ping timeout: 268 seconds]
11:02odmir has joined #asahi
11:06odmir has quit [Ping timeout: 240 seconds]
11:09furkan has joined #asahi
11:53choozy has quit [Ping timeout: 250 seconds]
13:21robhermarcan: We generally try to not have lists of registers. That fine grained is hard to get both right and complete.
13:25marcanrobher: how do you handle things like bootloader-trained memory timing configs? that's a similar kind of issue
13:25marcanbasically we have data like this to pass through: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/amdgpu/cik.c#n180
13:25marcanI want to avoid most of it by initializing in m1n1, but I think some of it will have to happen in the kernel
13:26marcanit might be possible to just hardcode this stuff in the kernel like AMD for some cases, but that loses generality (and means upstreaming, to some extent, blobs; copyright-wise I don't think register lists have an issue, but it seems a waste not to use the ones in the Apple device tree, which would be more general and avoid the distribution question entirely)
13:28marcanit's init stuff; right now one fairly short set is the PCIe root port configs that need to be set after a PCIe reset, and I think for *that* one we can turn it into higher-level driver logic
13:29marcansuspend-to-ram will be a whole separate can of worms, but I don't want to think about that until we have most drivers working to begin with and I can start testing real power consumption
13:30marcanbut if we need model-specifity there is probably some saner way of describing that than a blob of pokes
13:31marcanarnd: apparently these need to be applied after PCIe reset, so doing it in m1n1 means the kernel isn't allowed to do a reset
13:31arndmarcan: can you read back the registers from config space during boot and remember the current values?
13:33kettenis_yes, but in my opinion building logic in the OS driver (and duplicating it in various OSes and U-Boot) isn't sane
13:33arndmarcan: have you checked if the registers match up with one of the common PCIe implementations (dwc, cadence, mobiveil, ...)?
13:34marcanbut yeah, I'm not trying to come up with the answer to this case so much as get an idea for what the right direction for the DT is if we wind up having to pass this kind of stuff after all
13:35svenfwiw, i suspect that usb will also need quite a few tunables to get usb3 working. some of them for the PHY but i believe there are also quite some in the drd node
13:37Necrosporusdragons?
13:45arndmarcan: 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
13:46arndmost 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
13:48marvin24 has quit [Ping timeout: 276 seconds]
13:48kettenis_arndb: so most of the various pcie-related tunables can be applied by m1n1 and "stick" even if you then disable/enable clock gating or reset the PHY
13:49kettenis_but the config space ones I listed on the wiki page that marcan quoted require significant more bringup of the PCIe controller and don't survive a PERST
13:52kettenis_but if m1n1 takes stuff out of PERST, U-boot and/or the OS need to be careful about doing it again
13:52marvin24 has joined #asahi
14:12arndkettenis_: 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
14:13arndI don't think there is any generic way to trigger a PERST from outside the host controller driver
14:25kettenis_maybe it is possible to bring the RC ports out of reset and let u-boot take care of the more complicated stuff
14:26arndbus scanning and resource assignment probably makes sense to keep in u-boot, since that is complicated and u-boot has platform independent code for it
14:27arndunless m1n1 wants to support booting from a PCIe attached device (network, usb storage, ...) itself
14:33odmir has joined #asahi
14:34svennot sure what marcan's plans are but bringing in a full pcie + usb ethernet to m1n1 feels just a little bit overkill to me ;)
14:36HannaM has joined #asahi
14:36frode_0xa has quit [Quit: leaving]
14:37frode_0xa has joined #asahi
14:37arndI think u-boot has a port of the Linux USB network drivers, so it can support a lot of hardware
14:38frode_0xa has quit [Client Quit]
14:38odmir has quit [Ping timeout: 260 seconds]
14:38arndThe main use that I could see would be USB keyboard and mass storage support on the Type A ports
14:38frode_0xa has joined #asahi
14:39jeffmiw_ has joined #asahi
14:40sventrue. and if we wanted those we could first add support for those on the type c ports which doesn't require pcie bringup and then later just re-use that code.
14:43jeffmiw_ has quit [Ping timeout: 260 seconds]
14:43frode_0xa has quit [Quit: leaving]
14:45frode_0xa has joined #asahi
14:47Stary has joined #asahi
14:47Stary has quit [Changing host]
14:52robherThose are only Tegra194 specific registers because we don't have a second user, but 0x8xx registers are DWC port logic registers. One of the extended cap registers lines up with what we used to hard code (I got rid of all the hardcoded offsets recently).
14:57robherIf there's enough memory space for ECAM, then put all the PCIe setup in bootloader. Unless you want power management...
14:59robher'shadow' may refer to the port logic registers having writable versions of PCI config registers.
15:03kettenis_robher: what is the policy for documenting devicetree that the Linux kernel wouldn't care about but that we need to pass information from m1n1 to u-boot?
15:12odmir has joined #asahi
15:14robherkettenis_: bindings should be documented. Who is the consumer should be mostly irrelevant.
15:18robherkettenis_: To look at it another way, for every node in a dts there should be a schema covering it and all the properties. At least that's the goal of where we want to get to with schemas.
15:21marcanarnd, sven, kettenis_: with u-boot I see no reason to put pcie init in m1n1, at least not in the core or in normal builds. having proxyclient scripts to do it anyway may make sense for experiments.
15:21marcanI expect us to either do that directly in linux (with APFS support) at runtime, or copy them at install time from 1TR
15:25marcanI should diff the wlan firmware against other broadcom stuff. wouldn't be surprised at all if it's the same silicon, just rebranded for apple, as some common part
15:27kettenis_the broadcom wifi needs a "nvram.txt" file with settings that are specefic to how the chip is integrated
15:29marcanalso, I can tell you from experience that using a generic one on a new device works pretty often :)
15:31kettenis_yeah, it might not fully meet the regulation for RFI, but as long as you stay away from our radio telescopes I ewon't complain
15:42kettenis_and difficult to build a transmatter for those bands that doesn't spill over into the neighbouring spectrum
15:50kettenis_anyway, back on topic, I'm going to play a bit more with having m1n1 doing some of the RC port initialization and having u-boot do the remainder
15:51arndThe tg3 driver has code to load firmware from user space, but it's only 3 to 7 KB, and apparently many variants have that in the builtin eeprom
15:54svenlooks like the ADT even tells us the topology for the gated clocks :) UART1 --> UART_P --> SIO --> SIO_BUSIF; I2C0 --> SIO --> SIO_BUSIF; etc.
16:00PedroArajo[m] has quit [Quit: Idle for 30+ days]
16:11HannaM has quit [Read error: Connection reset by peer]
16:17vimal has quit [Remote host closed the connection]
16:17vimal has joined #asahi
16:53odmir has quit [Remote host closed the connection]
17:27VinDuv has joined #asahi
17:37amonakov has left #asahi [#asahi]
17:52marvin24 has quit [Ping timeout: 245 seconds]
17:53marvin24 has joined #asahi
18:24wicast has quit [Ping timeout: 260 seconds]
18:26wicast has joined #asahi
19:46ephe_meral1 has quit [Ping timeout: 260 seconds]
20:10choozy has joined #asahi
20:14Bublik_ has joined #asahi
20:16Bublik has quit [Ping timeout: 240 seconds]
20:44VinDuv has quit [Quit: Leaving.]
21:04raster has quit [Quit: Gettin' stinky!]
21:12rjeffman has quit [Ping timeout: 260 seconds]
21:52jeffmiw_ has joined #asahi
21:56jeffmiw_ has quit [Ping timeout: 246 seconds]
21:59raster has joined #asahi
22:49raster has quit [Quit: Gettin' stinky!]
22:59riker77 has quit [Quit: Quitting IRC - gone for good...]
22:59riker77 has joined #asahi