#
…

2021-02-10

00:00bgb has quit [Ping timeout: 246 seconds]
00:00kettenisusb works and I can type commands using a usb keyboard and load and run the OpenBSD/arm64 UEFI bootloader
00:01kettenisneed to clean up a few things before pushing the changes to my u-boot github repository
00:06raster has quit [Quit: Gettin' stinky!]
00:13bgb has joined #asahi
00:17bgb has quit [Ping timeout: 258 seconds]
00:30bgb has joined #asahi
00:35bgb has quit [Ping timeout: 264 seconds]
00:49bgb has joined #asahi
00:54bgb has quit [Ping timeout: 265 seconds]
01:05bgb has joined #asahi
01:09bgb has quit [Ping timeout: 240 seconds]
01:21bgb has joined #asahi
01:25bgb has quit [Ping timeout: 256 seconds]
01:57qyousef has quit [Ping timeout: 272 seconds]
01:58qyousef has joined #asahi
02:06cexpo has joined #asahi
02:10odmir has quit [Read error: Connection reset by peer]
02:12odmir has joined #asahi
03:19phiologe has quit [Ping timeout: 240 seconds]
03:20phiologe has joined #asahi
03:31Necrosporus has quit [Ping timeout: 256 seconds]
03:35r3n has quit [Ping timeout: 264 seconds]
03:36Necrosporus has joined #asahi
03:39bgb has joined #asahi
03:41cexpo has left #asahi [#asahi]
03:46Tokamak has quit [Ping timeout: 240 seconds]
03:48Tokamak has joined #asahi
03:49gabiruh has quit [Quit: ZNC 1.7.5 - https://znc.in]
03:49gabiruh has joined #asahi
04:06bgb has quit [Ping timeout: 240 seconds]
04:19bgb has joined #asahi
04:23bgb has quit [Ping timeout: 240 seconds]
04:29brinly has quit [Ping timeout: 246 seconds]
04:33brinly has joined #asahi
04:37bgb has joined #asahi
04:37phiologe has quit [*.net *.split]
04:37robinp_ has quit [*.net *.split]
04:37marvin24 has quit [*.net *.split]
04:37jld has quit [*.net *.split]
04:37sbingner has quit [*.net *.split]
04:37Namidairo has quit [*.net *.split]
04:37baryluk has quit [*.net *.split]
04:37TomJepp has quit [*.net *.split]
04:37Chainsaw has quit [*.net *.split]
04:37rafaelmartins has quit [*.net *.split]
04:37korzq has quit [*.net *.split]
04:37jato has quit [*.net *.split]
04:37nspaced has quit [*.net *.split]
04:37delroth[m] has quit [*.net *.split]
04:37dancer[m] has quit [*.net *.split]
04:40tomtastic has quit [Ping timeout: 246 seconds]
04:40tomtastic has joined #asahi
04:41bgb has quit [Ping timeout: 240 seconds]
04:42phiologe has joined #asahi
04:42marvin24 has joined #asahi
04:42baryluk has joined #asahi
04:42jld has joined #asahi
04:42jato has joined #asahi
04:42korzq has joined #asahi
04:42Namidairo has joined #asahi
04:42TomJepp has joined #asahi
04:42nspaced has joined #asahi
04:42delroth[m] has joined #asahi
04:42dancer[m] has joined #asahi
04:42rafaelmartins has joined #asahi
04:42sbingner has joined #asahi
04:42Chainsaw has joined #asahi
04:42robinp_ has joined #asahi
04:43korzq has quit [Max SendQ exceeded]
04:43korzq has joined #asahi
04:43korzq has joined #asahi
04:45bylaws has quit [Ping timeout: 246 seconds]
04:45Bastian[m] has quit [Ping timeout: 246 seconds]
04:45Tokamak has quit [Ping timeout: 264 seconds]
04:45davidrysk[m] has quit [Ping timeout: 246 seconds]
04:45fridtjof[m] has quit [Ping timeout: 246 seconds]
04:45fried_dede[m] has quit [Ping timeout: 246 seconds]
04:45devinvs[m] has quit [Ping timeout: 246 seconds]
04:45assusdan[m] has quit [Ping timeout: 246 seconds]
04:45krishbin[m] has quit [Ping timeout: 246 seconds]
04:45peterkovar[m] has quit [Ping timeout: 246 seconds]
04:45KurtGarloff[m] has quit [Ping timeout: 246 seconds]
04:45jean-franoiswitz has quit [Ping timeout: 246 seconds]
04:45iparaskev[m] has quit [Ping timeout: 246 seconds]
04:45enverb[m] has quit [Ping timeout: 246 seconds]
04:45rustylerp[m] has quit [Ping timeout: 246 seconds]
04:45tr0[m] has quit [Ping timeout: 244 seconds]
04:45dyniec[m] has quit [Ping timeout: 244 seconds]
04:45Avion[m] has quit [Ping timeout: 265 seconds]
04:45Alice[m] has quit [Ping timeout: 240 seconds]
04:45hypergenesis[m] has quit [Ping timeout: 246 seconds]
04:45rockinrobstar[m] has quit [Ping timeout: 246 seconds]
04:45Jasper[m] has quit [Ping timeout: 246 seconds]
04:45undvasistas[m] has quit [Ping timeout: 240 seconds]
04:45ryanhrob[m] has quit [Ping timeout: 240 seconds]
04:45ar88kk[m] has quit [Ping timeout: 240 seconds]
04:45randohacker[m] has quit [Ping timeout: 240 seconds]
04:45dpatterbee[m] has quit [Ping timeout: 240 seconds]
04:45nickray has quit [Ping timeout: 240 seconds]
04:45redbluescreen[m] has quit [Ping timeout: 240 seconds]
04:45blazra has quit [Ping timeout: 240 seconds]
04:45nhlism[m] has quit [Ping timeout: 240 seconds]
04:46delroth[m] has quit [Ping timeout: 258 seconds]
04:46dancer[m] has quit [Ping timeout: 258 seconds]
04:46wolf511[m] has quit [Ping timeout: 260 seconds]
04:46affieuk[m] has quit [Ping timeout: 260 seconds]
04:46xerpi[m] has quit [Ping timeout: 260 seconds]
04:46nutmanja[m] has quit [Ping timeout: 260 seconds]
04:46Lumi[m] has quit [Ping timeout: 260 seconds]
04:46liur[m] has quit [Ping timeout: 260 seconds]
04:46pedrojordao[m] has quit [Ping timeout: 260 seconds]
04:46PedroAraujo[m] has quit [Ping timeout: 260 seconds]
04:46TellowKrinkle[m] has quit [Ping timeout: 260 seconds]
04:46samumartinf[m] has quit [Ping timeout: 260 seconds]
04:46ConeOfAttack[m] has quit [Ping timeout: 260 seconds]
04:46tarik02[m] has quit [Ping timeout: 260 seconds]
04:46bfredl has quit [Ping timeout: 260 seconds]
04:46yuyangchee98[m] has quit [Ping timeout: 260 seconds]
04:46ewlsh[m] has quit [Ping timeout: 265 seconds]
04:46bakk[m] has quit [Ping timeout: 265 seconds]
04:46ponikrf[m] has quit [Ping timeout: 265 seconds]
04:46ldhacker[m] has quit [Ping timeout: 265 seconds]
04:46nirusu[m] has quit [Ping timeout: 265 seconds]
04:46flokk[m] has quit [Ping timeout: 265 seconds]
04:46ah-[m] has quit [Ping timeout: 265 seconds]
04:46Alex[m]3 has quit [Ping timeout: 265 seconds]
04:46erenatas[m] has quit [Ping timeout: 265 seconds]
04:46julian[m]1 has quit [Ping timeout: 265 seconds]
04:46asmon[m] has quit [Ping timeout: 265 seconds]
04:46Jan[m]1 has quit [Ping timeout: 265 seconds]
04:46konradybcio has quit [Ping timeout: 265 seconds]
04:46jevinskie[m] has quit [Ping timeout: 265 seconds]
04:46josiahmendes[m] has quit [Ping timeout: 240 seconds]
04:46clover[m] has quit [Ping timeout: 240 seconds]
04:46sta[m] has quit [Ping timeout: 240 seconds]
04:46bastilian has quit [Ping timeout: 240 seconds]
04:46skillfulman23[m] has quit [Ping timeout: 260 seconds]
04:46smist08[m] has quit [Ping timeout: 260 seconds]
04:46noneucat has quit [Ping timeout: 244 seconds]
04:46foxlet has quit [Ping timeout: 265 seconds]
04:46botoxparty[m] has quit [Ping timeout: 264 seconds]
04:47Eighth_Doctor has quit [Ping timeout: 260 seconds]
04:47jamesmunns[m] has quit [Ping timeout: 260 seconds]
04:47svenpeter has quit [Ping timeout: 260 seconds]
04:47radex|m[m] has quit [Ping timeout: 265 seconds]
04:47user1tt[m] has quit [Ping timeout: 268 seconds]
04:47rootspring[m] has quit [Ping timeout: 268 seconds]
04:47Spectrejan[m] has quit [Ping timeout: 268 seconds]
04:47zvtu[m] has quit [Ping timeout: 240 seconds]
04:47printfn[m] has quit [Ping timeout: 240 seconds]
04:47notafile has quit [Ping timeout: 240 seconds]
04:47ganpa has quit [Ping timeout: 260 seconds]
04:48gabiruh has quit [Quit: ZNC 1.7.5 - https://znc.in]
04:48brentr123[m] has quit [Ping timeout: 240 seconds]
04:48vchernin[m] has quit [Ping timeout: 240 seconds]
04:48ashton314[m] has quit [Ping timeout: 240 seconds]
04:48coinquest[m] has quit [Ping timeout: 240 seconds]
04:48d_u_f_f[m] has quit [Ping timeout: 240 seconds]
04:48daniel[m]7 has quit [Ping timeout: 240 seconds]
04:48ronyrus[m] has quit [Ping timeout: 240 seconds]
04:48izzyisles[m] has quit [Ping timeout: 240 seconds]
04:48noc0lour has quit [Ping timeout: 240 seconds]
04:48Bennett[m] has quit [Ping timeout: 240 seconds]
04:48psydruid has quit [Ping timeout: 240 seconds]
04:48bjornjulander[m] has quit [Ping timeout: 240 seconds]
04:48khronokernel[m] has quit [Ping timeout: 240 seconds]
04:48winocm has quit [Ping timeout: 240 seconds]
04:48gabiruh has joined #asahi
04:48Tokamak has joined #asahi
04:49mofux[m] has quit [Ping timeout: 268 seconds]
04:49shadaj[m] has quit [Ping timeout: 268 seconds]
04:49aimileus has quit [Ping timeout: 268 seconds]
04:49numa[m] has quit [Ping timeout: 268 seconds]
04:49crafteck[m] has quit [Ping timeout: 268 seconds]
04:49mikewilks[m] has quit [Ping timeout: 268 seconds]
04:49the_darkfire_[m] has quit [Ping timeout: 268 seconds]
04:49citruscitrus[m] has quit [Ping timeout: 268 seconds]
04:49sib1234[m] has quit [Ping timeout: 268 seconds]
04:49u3126[m] has quit [Ping timeout: 268 seconds]
04:49hwatwasthat[m] has quit [Ping timeout: 268 seconds]
04:49M1f4a9[m] has quit [Ping timeout: 268 seconds]
04:49thecake21[m] has quit [Ping timeout: 268 seconds]
04:49akda5id[m] has quit [Ping timeout: 268 seconds]
04:49etienneli[m] has quit [Ping timeout: 268 seconds]
04:49_alice has quit [Ping timeout: 268 seconds]
04:49emily has quit [Ping timeout: 268 seconds]
04:54bgb has joined #asahi
04:58bgb has quit [Ping timeout: 240 seconds]
05:01marvin24 has quit [Ping timeout: 258 seconds]
05:01marvin24 has joined #asahi
05:06pedrojordao[m] has joined #asahi
05:06Lumi[m] has joined #asahi
05:06samumartinf[m] has joined #asahi
05:06nutmanja[m] has joined #asahi
05:06TellowKrinkle[m] has joined #asahi
05:06xerpi[m] has joined #asahi
05:06ConeOfAttack[m] has joined #asahi
05:06smist08[m] has joined #asahi
05:06skillfulman23[m] has joined #asahi
05:06PedroAraujo[m] has joined #asahi
05:06affieuk[m] has joined #asahi
05:06bfredl has joined #asahi
05:06tarik02[m] has joined #asahi
05:06wolf511[m] has joined #asahi
05:07liur[m] has joined #asahi
05:07yuyangchee98[m] has joined #asahi
05:10foxlet has joined #asahi
05:10jevinskie[m] has joined #asahi
05:10noneucat has joined #asahi
05:10dyniec[m] has joined #asahi
05:11delroth[m] has joined #asahi
05:11hypergenesis[m] has joined #asahi
05:11dancer[m] has joined #asahi
05:11KurtGarloff[m] has joined #asahi
05:11Jasper[m] has joined #asahi
05:11fridtjof[m] has joined #asahi
05:11krishbin[m] has joined #asahi
05:11devinvs[m] has joined #asahi
05:11jean-franoiswitz has joined #asahi
05:11assusdan[m] has joined #asahi
05:11iparaskev[m] has joined #asahi
05:11peterkovar[m] has joined #asahi
05:11Bastian[m] has joined #asahi
05:11rockinrobstar[m] has joined #asahi
05:11enverb[m] has joined #asahi
05:11davidrysk[m] has joined #asahi
05:12fried_dede[m] has joined #asahi
05:12rustylerp[m] has joined #asahi
05:12dpatterbee[m] has joined #asahi
05:12bylaws has joined #asahi
05:12tr0[m] has joined #asahi
05:12Alex[m]3 has joined #asahi
05:12nirusu[m] has joined #asahi
05:12ewlsh[m] has joined #asahi
05:12erenatas[m] has joined #asahi
05:12julian[m]1 has joined #asahi
05:12flokk[m] has joined #asahi
05:12bastilian has joined #asahi
05:12ah-[m] has joined #asahi
05:12Alice[m] has joined #asahi
05:12ryanhrob[m] has joined #asahi
05:12ponikrf[m] has joined #asahi
05:12sta[m] has joined #asahi
05:12Avion[m] has joined #asahi
05:12randohacker[m] has joined #asahi
05:12ar88kk[m] has joined #asahi
05:12Jan[m]1 has joined #asahi
05:12undvasistas[m] has joined #asahi
05:12ldhacker[m] has joined #asahi
05:12redbluescreen[m] has joined #asahi
05:12bakk[m] has joined #asahi
05:12asmon[m] has joined #asahi
05:12konradybcio has joined #asahi
05:12nickray has joined #asahi
05:12blazra has joined #asahi
05:12nhlism[m] has joined #asahi
05:14clover[m] has joined #asahi
05:14josiahmendes[m] has joined #asahi
05:16psydruid has joined #asahi
05:21notafile has joined #asahi
05:22ganpa has joined #asahi
05:22jamesmunns[m] has joined #asahi
05:22botoxparty[m] has joined #asahi
05:22svenpeter has joined #asahi
05:22zvtu[m] has joined #asahi
05:22printfn[m] has joined #asahi
05:23radex|m[m] has joined #asahi
05:23Eighth_Doctor has joined #asahi
05:24vchernin[m] has joined #asahi
05:24ashton314[m] has joined #asahi
05:24coinquest[m] has joined #asahi
05:24izzyisles[m] has joined #asahi
05:24bjornjulander[m] has joined #asahi
05:24ronyrus[m] has joined #asahi
05:24khronokernel[m] has joined #asahi
05:24noc0lour has joined #asahi
05:24Bennett[m] has joined #asahi
05:24winocm has joined #asahi
05:24brentr123[m] has joined #asahi
05:24daniel[m]7 has joined #asahi
05:24d_u_f_f[m] has joined #asahi
05:24user1tt[m] has joined #asahi
05:24crafteck[m] has joined #asahi
05:24rootspring[m] has joined #asahi
05:24thecake21[m] has joined #asahi
05:24mofux[m] has joined #asahi
05:24sib1234[m] has joined #asahi
05:24citruscitrus[m] has joined #asahi
05:24numa[m] has joined #asahi
05:24shadaj[m] has joined #asahi
05:24mikewilks[m] has joined #asahi
05:24etienneli[m] has joined #asahi
05:24akda5id[m] has joined #asahi
05:24aimileus has joined #asahi
05:24the_darkfire_[m] has joined #asahi
05:24hwatwasthat[m] has joined #asahi
05:24M1f4a9[m] has joined #asahi
05:24_alice has joined #asahi
05:24Spectrejan[m] has joined #asahi
05:24u3126[m] has joined #asahi
05:24emily has joined #asahi
05:25bgb has joined #asahi
05:29bgb has quit [Ping timeout: 256 seconds]
05:55bgb has joined #asahi
05:59bgb has quit [Ping timeout: 246 seconds]
06:01svennice :-)
06:23bgb has joined #asahi
06:27maor26 has joined #asahi
06:28amw has quit [Ping timeout: 246 seconds]
06:33VinDuv has joined #asahi
06:51bgb_ has joined #asahi
06:51bgb has quit [Ping timeout: 240 seconds]
07:13mndza has joined #asahi
07:28VinDuv has quit [Quit: Leaving.]
07:33amw has joined #asahi
08:00raster has joined #asahi
08:15Tokamak has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:20amw has quit [Ping timeout: 246 seconds]
08:56marcanmaz, arnd: so thinking about the DT binding for the MMIO map mode... should it apply to the current node, or only children?
08:56marcanif it applies to the current node and children, that would make it impossible to declare an MMIO mode for a PCI controller but not the actual, dynamically-discovered PCI devices (assuming the PCI code eventually grows support for this too, which isn't in scope for v2 since the default works there)
08:57arndmarcan: the way I suggested would be only for the children
08:57marcanbut if it only applies to children, it wouldn't be usable to set the mode for a single device that needs it
08:57marcanthough I guess a dummy bus could be introduced
08:57marcanbut that feels icky
08:59arndI was thinking similar to how pci and isa nodes work, which use ranges properties to create multiple address ranges, with a flag in the top word (or top bits of the 64-bit address) distinguishing between types of registers
09:00Alex[m]3 has quit [Quit: Idle for 30+ days]
09:00printfn[m] has quit [Quit: Idle for 30+ days]
09:01marcanwhat bugs me about that one is overloading the top bits, which is fine until someone comes along with 64-bit PAs
09:02marcanif we had a separate cell for that it would be ideal, but then we need a bool to signal it, and it would break forwards compat of newer DTs with older kernels
09:06arndmarcan: you can totally have #address-cells=<3> in a regular bus, I don't think that causes issues with the kernel, though it might not work as intended in other consumers of the dt
09:06marcanbut wait, that'd make all the child addresses 3-cell too?
09:08arndyes, unless you have another bus underneath that turns them back into #address=cells=<1> or #address-cells=<2>
09:08marcanwait, wouldn't the *root* have to be address-cells=<3>?
09:08marcanand then the bus can be <2>
09:09marcanand ranges maps 2 -> 3, and the top cell defines the mode
09:09mazI think that's how PCI works.
09:09maz(though it uses the top cell for other purposes, AFAICR)
09:10* mazgoes and reread the OF/PCI stuff...
09:10arndthe root bus could be #address-cells=<3>, but I was thinking <2> here
09:10marcanpci is backwards afaict
09:10marcani.e. it maps 3 to 2
09:11marcanso it maps <io type, addr> -> <addr>
09:11arndwith the /soc node adding a third cell to encode flags like pci and isa
09:11marcanwhich is why it has address-cells=<3>
09:11marcanalso I thought I read mapping code in linux that assumed address-cells was always 2 or 1
09:13marcanit certainly assumes max 64 bits of address, since it uses u64 for everything
09:14arndright, we do limit phys_addr_t/resource_size_t to 64 bits, but 'struct resource' does encode the PCI addresses including the flags
09:14arndthe address gets truncated to the size of resource_size_t
09:14marcanright, and that gets handled by pci bus-specific translation in of/address.c
09:15arndso adding a fourth case (aside from pci, isa and default) in there is slightly ugly, but it's the best I could come up with so far
09:16marcanof_bus_pci_translate just skips the first cell of the address, then goes through the default code which indeed just truncates things implicitly
09:16arndusing the ranges property at least makes it possible to have more complex mappings in the future
09:16marcanand then the map function looks at that
09:19arndmarcan: on PCI, the flags get parsed by the PCI host driver when setting up the pci_host_bridge resources, which get used for assigning resources to child devices
09:20arndtraditionally, open firmware had assigned the resources to devices and listed them as "ranges" and "reg" properties in the device nodes of the pci child nodes, but we don't do that in fdt because Linux is capable of scanning the pci bus itself
09:21marcanthough DTs can still specify stuff to assign configuration to otherwise dynamically discovered, devices, right?
09:23arndyes, you can specify your own DT properties for things that PCI cannot detect, and you can add a probe-only property (don't remember the spelling) in the host bridge to tell the kernel it should not reassign the resources
09:23marcanso the flags for pci are mapped to IORESOURCE_ constants, which is quite... congested
09:23arndyes, I noticed
09:24marcanwe could fit in a IORESOURCE_MEM_NONPOSTED in as the *last* available bit
09:24marcanin that section
09:24arndif it's a custom type, it could be 0x00000500
09:25arndthe types don't have to be distinct bits (see IORESOURCE_REG)
09:25marcanthough this seems to be clearly a subtype of MEM
09:26arndright, it might be better to have IORESOURCE_MEM with an extra flag
09:26arndit's also possible that some of the ioresource flags are entirely unused
09:27arndmost of this originally came from PCMCIA and ISAPnP I think
09:27marcanthis file dates back to... I don't even want to know :)
09:27marcanit predates git at least
09:27marcanand so do *all* the MEM_ flags
09:28marcanbut stepping back, assuming we do it this way, let me get it straight
09:29marcanwhat PCI does is map 3->2, and then the PCI code knows what type it needs and supplies the necessary info when requesting resources via the OF translation code
09:30marcanhere, there is no "PCI code", child nodes are just devices. so if we do the same thing, then every subnode needs to specify posted/nonposted as the top cell
09:30marcan(in its regs)
09:31marcan(unless we add a sub-bus to translate back to 1 or 2 cells)
09:32arndYes, I think that would work for this generation, but there is a small chance that a future SoC would require doing something similar to my suggestion, and then we implement two methods
09:32marcanI may not quite understand your suggestion yet, I thought this is what you were suggesting
09:32arndsorry, I misread what you said
09:34marcanbut then this seems somewhat magic; in PCI we start with knowledge of the type, and this gets mapped to plain MMIO, but those MMIO ranges implicitly encode the type (for any given soc), the IORESOURCE_ flags seem mostly ancillary? only the IO/MEM distinction and the PREFETCH flag apply
09:34marcanhowever, here we'd be mapping "one magic address encoding info" to "an address completely devoid of info" and setting some flags behind the scenes
09:35marcanand then we have the issue of what PCI does, because if we use 3-cell form suddenly now the PCI nodes need to do 3->3, and some resources are going to be IORESOURCE_IO
09:41arndthe pci ranges doing 3->3 conversion should just work fine, all this means is that you can specify in the parent address whether a particular downstream range corresponds to an upstream posted or non-posted area
09:42Bublik has joined #asahi
09:42arndso an mmio range looks like
09:43marcanof_bus_default_translate is broken for this AFAICT; it currently zeroes out the entire destination address
09:43marcanthat memset needs to be, well, removed AFAICT, since it's already setting the translated address cells anyway
09:43marcanthat would then preserve any high cells
09:43arnd<0x43000000 0x5 0x0 (MAP_NONPOSTED | 0x5) 0x0 0x0 0x80000000>
09:43arnd<0x43000000 0x5 0x0 MAP_NONPOSTED 0x5 0x0 0x0 0x80000000>
09:44marcanyeah, that doesn't work right now :) (but it would if we just remove that memset, I wonder where that came from...)
09:45marcanlooks like it was there from the beginning, probably safe to remove unless there are broken DTs out there that rely on that
09:48arndI don't see what you mean. The memset() in of_bus_default_translate() only clears the low 64 bits of the address, as it gets called with a modified addr and na value
09:49arndor do you mean we couldn't use of_bus_default_translate() for the new bus?
09:50arndregarding IORESOURCE_IO, I don't think that is supported at all in the M1, at least the ADT doesn't seem to list it
09:51marcanwait, isn't that modified addr thing *another* bug?
09:51marcanit's supposed to be *pna*
09:52marcanpci does 3 -> 2; pna should already be 2 here
09:52acelogic has quit [Ping timeout: 264 seconds]
09:52marcanthat means the pci code is not properly translating addresses crossing a 4GB boundary
09:53marcanignoring PCI for a second; the generic code first turns the range into an offset, then memcpies the parent address from the range into addr, then calls the translation function, which is supposed to add the offset into the range
09:54marcanthe default translation function right now *zeroes* the entire target address before writing back the translated address to the last one or two cells
09:55arndthat is possible: as I said, we don't actually rely on the translation across PCI host bridges but rather set up the PCI-to-host windows when creating the pci_host_bridge devices in other code
09:55marcanthe PCI one translates one fewer cell than it needs, in 64b cases, and works practically by accident in 32b cases; in the latter case, addr is an invalid pointer to the *end* of the parent address buffer, wait, how does this work again? :)
09:56marcanunless I'm misreading the code, this is broken
09:56marcananyway, the fix is to remove the -1 (actually to just get rid of the pci-specific translation function, just call the default directly) and then remove the memset so that it doesn't clobber any upper cells >2
09:59marcanarnd: this ought to be submittable completely out of band from that series, right? the pci bugfix in particular, probably also removing the memset? the latter just seems generically useful
09:59marcan(as right now the translation isn't correct anyway, even if nothing relies on the upper cells surviving)
10:00arndyes, it could be separate, I'm just not sure yet what changes are actually needed. I think what we need is for ->translate() to take both 'na' and 'pna' arguments like ->map() does, but I'd have to reread it several times more and look at the git history to see how we got to what it is now
10:02marcanI think it's fine with 'pna', as the translation is via an offset anyway; this is assuming we accept that the top cells are not getting treated as "proper ranges"
10:03marcanhowever, `map` right now ignores the top cell for (p)na=3, so there is no matching on that
10:03marcani.e. (1,0,0) will currently match a range for (0,0,0)
10:03vimal has quit [Quit: Leaving]
10:10arndyes, from reading it a little more, I would conclude that it works as intended: ->translate() gets called with the 64-bit address portion of the child address and a copy of the parent's base address from the ranges, and it is documented to assume that it is in fact translatable
10:11marcanit gets called with the *offset*
10:11marcanof the 64bit portions
10:12marcanso the memset is superfluous; all it does is corrupt the upper part of the parent's base address to 0
10:13marcanand of_bus_isa_translate / of_bus_pci_translate are broken; they are skipping the top cell of the *parent* output address array, which is already correcly sized; those buses use an extra cell in the *child* address but that is not what translate() deals with
10:13marcanbut you said that codepath isn't used, right?
10:15arndI'd have to check what powerpc and sparc do for their of-based PCI probe, but I think they still use the PCI BARs for reading the addresses rather than the DT information
10:18arndit seems those use of_pci_address_to_resource(), which reads the resources in the PCI bus node and assumes it does not need to translate those further
10:18marcanAFAICT the bug has been in there from the beginning; d1405b869 added this code
10:19arndah, it does __of_address_to_resource(), which has different paths for IORESOURCE_MEM and IORESOURCE_IO, and assumes it can translate memory addresses without caring about the upper bits, and treating I/O ports special
10:19bgb_ has quit [Ping timeout: 256 seconds]
10:21arndlimiting the intermediate addresses to 64 bit was an intentional simplification at the time, as nothing relied on it, but that probably means it's not a great idea to start relying on it now
10:24marcanjust removing the memcpy, fixing the broken pci/isa translation, and changing the default map function to just compare any higher cells would make this all work with >64-bit intermediate addresses, as long as ranges/offsets do not cross a 64-bit boundary
10:26marcani.e. without having to introduce >64-bit math, it would probably cover all use cases of those higher cells for flags/info, as long as any such high cells are not grouped together (mapping a range >2**64 to cover multiple flag types would be wrong, however leaving those default mapped would be fine)
10:26marcan*the memset
10:27arndright, it might be good to warn if a 64-bit boundary is crossed, but I don't think it's worth trying to handle that correctly
10:29marcanactually, as long as size-cells <= 2, we're pretty much safe modulo wrapping into the upper bits, which isn't something any of the current code handles properly anyway
10:38amw has joined #asahi
10:53kettenisfor OpenBSD I was planning to use the bus_space(9) abstraction to make sure PCIe mmio address space gets mapped nGnRE
10:54kettenisso I think I can get away with that without any hints in the device tree
10:55kettenishaving #addr-cells be 3 outside of pci space would be somewhat painful
10:58arndkettenis: from the man page for bus_space(9), I think this would correspond to Linux's regmap, which lets you abstract all kinds of buses that have some form of indexed registers (mmio, pio, i2c, spi, ...)
11:01kettenisalthough we don't actually use it for i2c
11:01arndin this case, the Linux implementation would presumably require all drivers to use regmap_write()/regmap_read() for accessing any of the internal registers, rather than our normal writel()/readl(). It could still work with drivers that are shared with other machines, but regmap does have a noticeable overhead because it requires an indirect function call instead of a fancy pointer dereference
11:03ketteniswith some cleverness you could avoid the function pointer overhead for the actual access
11:03kettenisbut TBH I don't think you'd want to overhaul this part of the linux kernel design
11:06kettenisbus_space(9) is a fairly clever design, but the API makes your drivers a bit wordy
11:14arndRight, I think haivng a regular __iomem pointer with readl/writel but a special way to map it is the right abstraction for Linux, the question is just where to hand the special logic for creating the page tables
11:14arndthe approach discussed above would have the purpose of encoding it in 'struct resource' in order to have the ioremap_resource() family of functions do the right thing based on an architecture specific change
11:17arndthere are probably other ways to have that flag set, as well as other ways to hack the ioremap() internals function to not require that flag
11:21ephe_meral has joined #asahi
11:30ephe_meral has quit [Ping timeout: 256 seconds]
11:35ephe_meral has joined #asahi
11:51TheJollyRoger has quit [Ping timeout: 268 seconds]
11:55Code_Red1 has joined #asahi
11:56robinp_ has quit [Read error: Connection reset by peer]
12:05ephe_meral has quit [Ping timeout: 264 seconds]
12:14Bublik has quit [Ping timeout: 240 seconds]
12:19Bublik has joined #asahi
12:51amw has quit [Ping timeout: 240 seconds]
13:08acelogic has joined #asahi
13:20ephe_meral has joined #asahi
13:25TheJollyRoger has joined #asahi
14:01TheJollyRoger has quit [Ping timeout: 268 seconds]
14:13robherarnd, marcan: I'm not a fan of a flag for this in DT. A new flag in PCI cells would be tolerable, but if we're talking a flag cell on default buses I'd expect that would not work on any existing code. And if OpenBSD doesn't need a flag, neither should Linux.
14:14robherIf we have resource flags plumbed, we could just handle it in the DT address code like the other Mac quirks.
14:17marcanyeah, the extra cell is definitely going to cause pain for code that (not unreasonably) assumes #address-cells is always <= 2
14:17marcan(including linux to some extent as we found)
14:18marcanrobher: so how do you suggest signaling in the DT what attributes are required for a given mapping? per device?
14:19kettenispart of the reason we (OpenBSD) don't need this flag is because we use nGnRnE by default
14:21robhermarcan: We don't really need per device do we? It's PCI and not-PCI AIUI.
14:22ketteniscorrect (as far as we know at this point)
14:23arndrobher: specifically it's the PCI memory space, so the PCI device node itself has a mix of the two, because its own registers are like the rest of MMIO
14:23robherI'd guess we'd need a way to change the default and then PCI mappings override that.
14:25arndI'd like to see of_address_resource to set a flag in 'struct resource' for any device that needs it, which would nicely happen to work because PCI devices create their resources differently
14:25marcanthere are two options there: either change every PCI driver to not use ioremap() (so we can actually do something about it), or register the PCI address ranges into ioremap() somehow so it can find out that way
14:25robherarnd: It's own registers are in 'reg' and a default bus and the memory space is in ranges, so that should be okay.
14:25arndso there just needs to be a sane DT representation to make it work not just by accident by also on other implementations
14:26marcanthis is one reason why going the other way is easier, because non-PCI drivers are less likely to use plain ioremap, and there is a limited set of them we care about
14:27arndwe might want to introduce a non-devm_ version of ioremap_resource() if some driver wants it, but that should be easy enough to do, and most drivers benefit of using the dev_ioremap_resource() over the many other variants anyway
14:29arndmarcan: in case you end up converting drivers from ioremap() to devm_ioremap_resource(), watch out for the implied 'request_mem_region' that prevents an address from being mapped more than once, but is not implied by the normal ioremap
14:30marcangood point
14:30arndOn the question how to determine whether that flag should be set, an empty property similar to 'dma-coherent' and 'big-endian' sounds reasonable, but I'm unsure whether it should affect only that device or the children
14:31arndif it only affects the device itself, it would make the PCI case work nicely, but it would be required in every single device node
14:31arnd(those that have a reg property)
14:33marcanyeah, somewhat spammy, though I don't mind personally for our DT
14:33robherIdeally those would be in bus nodes.
14:34robherLike dma-ranges is supposed to be.
14:35marcanso defining the ranges and access types within that bus?
14:35robhermarcan: Hopefully only 1 type per bus, but yes.
14:36marcanwell, pci is logically nested within nGnRnE-requiring buses I think
14:38marcan(in particular the pci controllers themselves)
14:39marcan(but also nearby are pci IOMMUs and related things)
14:40robherso the PCI controller picks up the flag from the parent bus for it's regs and PCI children get the flag from the PCI node.
14:43robherA flag property or a flags cell work the same way ultimately. It's just inband vs. OOB WRT ranges.
14:43kettenisthat would fit the OpenBSD bus/driver model nicely and U-Boot wouldn't worry about it
14:44marcanah, so not actually a ranges definition, just a flag property but picked up from buses?
14:44marcan(sorry, got confused by dma-ranges)
14:45marcanlooking it up recursively, or just the immediate parent?
14:45ephe_meral has quit [Ping timeout: 264 seconds]
14:47robhermarcan: Probably recursively or recursively for empty 'ranges' only.
14:47ephe_meral has joined #asahi
14:48marcansince we need to be able to override it, if it's recursive, it should be a property with actual values then
14:49marcan(not just an empty bool)
14:50Bublik has quit [Ping timeout: 240 seconds]
14:52robherI meant whether 'ranges' is empty or not. Empty ranges means inherits parent address space or 1:1 translation. No ranges means not a translatable bus.
14:59marcanrobher: what I'm saying is that if we do more than the immediate parent, we need some way of turning off the setting if it was turned off at a higher level
14:59marcane.g. on the pci controllers
14:59marcanso it can't just be an empty flag property
14:59marcan*turned on at a higher level
15:09choozy has joined #asahi
15:09arndFor endianess, we have a tristate 'big-endian;', 'little-endian;' or no property meaning it is whatever the default for that compatible string is. We could do the same in bus nodes here, with one value meaning 'all children use nGnRnE', one for 'all children use 'nGnRE' registers, and no property meaning either that its inherited from grandparent, or not to do anything special
15:10marcanyeah, that kind of thing would work
15:10marcanposted-io; nonposted-io;
15:16choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
15:29Tokamak has joined #asahi
15:35marcanrobher: if that kind of thing works for you I can give it a whirl for v2
15:40tomtastic has quit [Quit: ZNC - https://znc.in]
15:40robhermarcan: Close enough for a prototype. If a property works, then implying from compatible strings can too. (See 'MacRISC' in the DT address code.) But better to discuss that with a concrete implementation and that wouldn't affect most of it.
15:43tomtastic has joined #asahi
15:53marcansounds good
15:55Cynthia has joined #asahi
15:55Cynthia has quit [Changing host]
16:00ponikrf[m] has quit [Quit: Idle for 30+ days]
16:01acelogic2 has joined #asahi
16:02tomtastic has quit [Quit: ZNC - https://znc.in]
16:03acelogic has quit [Ping timeout: 256 seconds]
16:03micooldra has joined #asahi
16:03tomtastic has joined #asahi
16:08micooldra has quit [Quit: Connection closed]
16:43kettenisthat can now load an UEFI bootloader from a usb disk connected to the type-A ports n the mini
16:44kettenisonly tested with the corellium pre-loader for now
16:52_whitelogger has joined #asahi
16:52mazkettenis: small nit about your CPTR_EL2 change: you should be able to leave the programming via CPACR_EL1 (E2H redirects the access to CPTR_EL2 and shuffle bits around).
16:53mazkettenis: yes, the ARM ARM is unreadable.
16:57kettenisthe bit where it enables the fpu?
16:57mazkettenis: yup.
17:00klardotsh has joined #asahi
17:00kettenisah, so that could save me three instructions
17:01mazcritical path! :)
17:01ketteniswell, this is common code and on some boards it runs in SRAM
17:01mazit's mostly that you can get rid of this patch altogether.
17:01kettenisso every byte counts ;)
17:05kettenisno, I can't
17:05ketteniswithout that change it does *not* enable the fpu
17:06mazthe write to cpacr_el1 should definitely do it.
17:06ephe_meral has quit [Ping timeout: 272 seconds]
17:06kettenisand u-boot dies when the first varargs function gets hit
17:06mazat EL2 with E2H, cpacr_el1 *is* cptr_el2.
17:06kettenistypically that is snprintf
17:07j`eykettenis: why do you need fp/simd?
17:07j`eyyou/you-boot :P
17:07kettenisright but the layout of cptr_el2 changes if E2H is enabled
17:08maznot if you access it via cpacr_el1. that's the whole point of VHE.
17:08ephe_meral has joined #asahi
17:09ketteniswith E2H on, cptr_el2 has the same layout as cpacr_el1 (because they are aliased I suppose)
17:10kettenisis that not how other VHE supporting CPUs behave with W2H on?
17:11mazVHE implementations must be able to use their _EL1 registers from EL2 and see their own state being affected by them.
17:11mazsince you can run an EL1 OS at EL2 almost transparently.
17:11kettenisj'ey I don't know, but if you don't compile with -mgeneral-regs-only varargs functions such as snprintf save the fpu registers on the stack
17:12kettenismaz right, and I suspect that works fine
17:13mazkettenis: it must, or Linux wouldn't boot, for example.
17:13kettenisthat should work for vbar_el1 as well isn't it?
17:13mazindeed.
17:14mazalso, be careful when using _EL1 *and* _EL2 registers from EL2, the two views are not guaranteed to be synchronised (isb is your friend).
17:15kettenisthere is an isb conveniently located close by
17:22kettenisand it works as expected
17:25kettenisalready sent that bit upstream, but I'll roll a v3
17:26choozy has joined #asahi
17:26ephe_meral has quit [Ping timeout: 256 seconds]
17:27kettenisthanks for looking at it
17:28mazno worries.
17:59suskun has joined #asahi
18:00suskun has quit [Remote host closed the connection]
18:01suskun has joined #asahi
18:12VinDuv has joined #asahi
18:18suskun has quit [Ping timeout: 272 seconds]
18:23modwizcodeI wonder what the idea behind the delayed "deferred" style fast IPIs are, I don't know enough about all the uses to understand where that would benefit you
18:47m42uko has quit [Quit: Leaving.]
18:47m42uko has joined #asahi
19:23Tokamak has quit [Ping timeout: 256 seconds]
19:26Tokamak has joined #asahi
19:40KindTwo has joined #asahi
19:40KindOne has quit [Ping timeout: 264 seconds]
19:41KindTwo is now known as KindOne
20:23raster has quit [Quit: Gettin' stinky!]
20:26raster has joined #asahi
21:37raster has quit [Quit: Gettin' stinky!]
21:43raster has joined #asahi
21:45VinDuv has quit [Quit: Leaving.]
21:46raster has quit [Client Quit]
21:47raster has joined #asahi
22:27TheJollyRoger has joined #asahi
22:51mndza has quit [Ping timeout: 265 seconds]
23:14maor26 has quit [Ping timeout: 264 seconds]
23:36zopieux has quit [Quit: zopieux]
23:38zopieux has joined #asahi
23:39raster has quit [Quit: Gettin' stinky!]
23:40choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
23:53zopieux has quit [Ping timeout: 272 seconds]
23:54zopieux has joined #asahi
…