#
✕ nick:eiln
#asahi-dev · 2022-12-31 15:04
eiln2) same write goes through in the hypervisor
#asahi-dev · 2022-12-31 15:04
eiln1) readl() works & actual read-only regions (which it's not) dont fault, just the write doesn't go thru
#asahi-dev · 2022-12-31 15:03
eilnbut writel() in this region is giving me a write fault? which is very odd since
#asahi-dev · 2022-12-31 15:03
eilneasiest solution is to map a scratch page, then copy over that new ttbr after init
#asahi-dev · 2022-12-31 15:03
eilni can't patch it in m1n1 because iommu reinitializes the domain w/ a new ttbr
#asahi-dev · 2022-12-31 15:03
eilnthe 3 chans need it for (presumably) address resolution
#asahi-dev · 2022-12-31 15:02
eilnturns out there's a bespoken dapf rule where the ttbr of the 0th prop has to be syncd to the 1st & 2nd
#asahi-dev · 2022-12-31 15:02
eilnall works except weights & input/output tile dma (effectively we're crunching zeros)
#asahi-dev · 2022-12-31 15:02
eilnin a christmas miracle i hacked together something working
#asahi-dev · 2022-12-31 15:02
eilnaah forgive me for being flaky :// i'm on all of this week
#asahi-dev · 2022-12-26 10:04
eilnyeah i'll use the 32b space too
#asahi-dev · 2022-12-26 10:02
eilnpio-vm-base is nonzero but not used (actually the whole pio thing i don't really get)
#asahi-dev · 2022-12-26 09:47
eilnso pds are hacked as always-on to prevent unauth access (can't figure out why tho)
#asahi-dev · 2022-12-26 09:45
eilnoh also attached power domains aren't called when dart's probed and dart probes before i can
#asahi-dev · 2022-12-26 09:45
eilni think it's too far but i could be wrong
#asahi-dev · 2022-12-26 09:44
eilnhttps://github.com/ARM-software/ethos-n-driver-stack/blob/main/kernel-module/juno-r2-ethosn-smmu.dts
#asahi-dev · 2022-12-26 09:44
eilnwhere each buffer type has its own allocator device
#asahi-dev · 2022-12-26 09:44
eilnhttps://github.com/ARM-software/ethos-n-driver-stack/blob/main/kernel-module/ethosn_dma_iommu.c
#asahi-dev · 2022-12-26 09:44
eilnarm's kernel module uses a crazy complex allocator model
#asahi-dev · 2022-12-26 09:44
eilni'd need a "neural network" abstraction and yada yada
#asahi-dev · 2022-12-26 09:43
eilnorder doesn't affect function ofc but idk if it's worth the effort to separate and track the dma types
#asahi-dev · 2022-12-26 09:43
eilnthe "command stream" is tiny and unaligned so what macos likes to do is to pack the weights directly after the cmd
#asahi-dev · 2022-12-26 09:43
eilnbasically the "Command channel" and "Weight channel" equivalent work @ 64 gran but the rest are PAGE_SIZE (technically tile size == page size)
#asahi-dev · 2022-12-26 09:42
eilnhttps://developer.arm.com/documentation/102420/0200/Functional-description/Functional-blocks-/DMA-controller
#asahi-dev · 2022-12-26 09:42
eilnfor reference the dma architecture seems like a modded version of arm's:
#asahi-dev · 2022-12-26 09:42
eiln3) whether to hard-code the "neural" quirks?
#asahi-dev · 2022-12-26 09:42
eiln2) should i reserve the (unused lol) segment-ranges?
#asahi-dev · 2022-12-26 09:41
eiln1) is vm-size a legitimate limit i need a carveout for? there's a vm-base which is bogus so i think it's also bogus?
#asahi-dev · 2022-12-26 09:41
eilnunsure on a couple things though
#asahi-dev · 2022-12-26 09:40
eilnhaven't ported the dmaengine part yet so can't really test but seems to work
#asahi-dev · 2022-12-26 09:40
eilni'm using the raw iommu api to 1) allocate iova block 2) walk down gem pages and iommu_map() each page
#asahi-dev · 2022-12-26 09:39
eilnso ane's DMA channels expect a continuous iova block
#asahi-dev · 2022-12-26 09:39
eilnfinally got time to work on this again
#asahi-dev · 2022-12-11 05:37
eilnthis explains the missing values in the pmgr tracer
#asahi-dev · 2022-12-11 05:31
eilnbut even soft poweroff doesn't restore regs/L2 ~~thankfully~~
#asahi-dev · 2022-12-11 05:31
eilnlogs say ambiguous stuff liek "powerup success! woke up from sleep!"
#asahi-dev · 2022-12-11 05:31
eilnregarding runtime pm/sleep
#asahi-dev · 2022-12-11 05:30
eilnbut i haven't had issues w/ the current pmgr driver so i think it's fine
#asahi-dev · 2022-12-11 05:30
eilnthe domains are masked in a certain order
#asahi-dev · 2022-12-11 05:29
eilnso to whoever's doing that ur probably gonna need this
#asahi-dev · 2022-12-11 05:29
eilnalso ISP-SYS-V works the same way except it's like 12 consec domains
#asahi-dev · 2022-12-11 05:29
eilnon that note i've got a basic mmapper working in the kernel :P
#asahi-dev · 2022-12-11 05:28
eilnso i think the dt patches are appropriate
#asahi-dev · 2022-12-11 05:28
eilnthese differ by device btw since t8103 base is +0xc000 and t6xxx east/south both caps at 0xc000 so pls help me fill that out
#asahi-dev · 2022-12-11 05:28
eilnso i've added all 6 sub-pows as normal power domains
#asahi-dev · 2022-12-11 05:28
eilnsub-pows move as a whole and no one should be messing with those
#asahi-dev · 2022-12-11 05:28
eilnbut the rest of the mmio (the part that does work) needs the sub-power domains on (duh)
#asahi-dev · 2022-12-11 05:27
eilnhttps://gitlab.com/eiln/m1n1/-/commit/38ab3df2c39acb353820bf33dfedf73ff8ccee63
#asahi-dev · 2022-12-11 05:27
eilnjust enough to read the device major/minor code and write to the power tunables region
#asahi-dev · 2022-12-11 05:27
eilnspecifically ANE_SYS enables only a small subset of mmio

plus ›