#
✕ nick:modwizcode
#asahi-dev · 2021-02-05 04:52
modwizcodeoh duh lmao
#asahi-dev · 2021-02-05 04:51
modwizcodeyeah linux is LLP64, int is 4, long and pointers are 8
#asahi-dev · 2021-02-05 03:30
modwizcodeI'm fairly certain there's a small bug in irq-apple-aic.c as well, BITS_TO_LONGS is used which gives the number of longs to represent a given number of bits, but on 64bit arm a long is 8 bytes, the registers in the AIC afaik are 4 byte registers and it uses writel, which isn't write long but actually for writing a u32. My printouts from the emulation confirm it seems to only set half the bits
#asahi-dev · 2021-02-05 00:32
modwizcodeYeah use the old versions for both
#asahi-dev · 2021-02-05 00:30
modwizcodeIt's failing in m1n1 because qemu doesn't give it the values it needs because I've not written that code yet :)
#asahi-dev · 2021-02-05 00:28
modwizcodethe QEMU I have at the moment doesn't have the iBoot entry point that m1n1 expects nor a proper apple style device tree, so m1n1 cannot set things up right when it goes to fill in the 0's so it just won't work.
#asahi-dev · 2021-02-05 00:28
modwizcodeiBoot supplies an apple style device tree which linux can't read, m1n1 reads that, sets up a linux compatible entry point for the secondary CPUs and then before it boots it edit's a regular dtb in memory with the correct addresses for linux to poke.
#asahi-dev · 2021-02-05 00:27
modwizcodeThat's the dynamic part
#asahi-dev · 2021-02-05 00:26
modwizcode(specifically it has more than 1 cpu definition with register properties for spin table startup in linux) that's not what you want if you want to use the single processor setup I had working
#asahi-dev · 2021-02-05 00:26
modwizcodeThe latest version of m1n1 expects different things to poke, and it comes with a new .dts with spots to put them.
#asahi-dev · 2021-02-05 00:25
modwizcodeThe dtb is processed by m1n1 itself the python side just dumps it into memory and calls a proxy function to poke it with the dynamic values from the ADT
#asahi-dev · 2021-02-05 00:16
modwizcodeYou could just checkout that one file though
#asahi-dev · 2021-02-05 00:16
modwizcodeYou need the older m1n1 too I think, although it might work okay for now. But the device tree in m1n1 is basically the same one as in the kernel so you don't want the updated version.
#asahi-dev · 2021-02-05 00:15
modwizcodeThe SMP bringup wouldn't be so terribly hard but I have to create a new blob of ADT with the right nodes
#asahi-dev · 2021-02-05 00:14
modwizcodeI have local patches that get the latest stuff to boot by hacking away a lot of new stuff, but until I get the SMP bringup done it's going to be incompatible
#asahi-dev · 2021-02-05 00:13
modwizcodeamw: if you're using qemu still you cannot use the latest versions of anything
#asahi-dev · 2021-02-05 00:06
modwizcodemmhmm
#asahi-dev · 2021-02-05 00:02
modwizcodeamw: I would assume the work is still in progress.
#asahi-dev · 2021-02-04 23:40
modwizcodeI think the v2 branch is new, I'm presuming changes are coming
#asahi-dev · 2021-02-04 23:30
modwizcodeI think the compilation issue is still a thing though.
#asahi-dev · 2021-02-04 23:30
modwizcodeI didn't realize it was part of the feature framework not part of the config. That makes sense but I guess I wasn't thinking about it
#asahi-dev · 2021-02-04 23:29
modwizcodewell not the commit but that specific file's changes
#asahi-dev · 2021-02-04 23:28
modwizcodeheck I was looking through the commits and missed that one somehow
#asahi-dev · 2021-02-04 23:28
modwizcodeAt least not to anything meaningful
#asahi-dev · 2021-02-04 23:28
modwizcodeI'm not setting MIDR
#asahi-dev · 2021-02-04 23:28
modwizcodeuh
#asahi-dev · 2021-02-04 23:28
modwizcodeI am but I have a m1n1 specific patch just setting them to what it wants. Basically I don't have an SMP bringup figured out for QEMU so I patch anything out
#asahi-dev · 2021-02-04 23:26
modwizcodeYeah it's selected
#asahi-dev · 2021-02-04 23:25
modwizcodeI will double check but I'm like 100% sure
#asahi-dev · 2021-02-04 23:22
modwizcodeAlso probably QEMU specific issue but with this kernel after I load once it setups up timer and FIQ I get a panic with it calling el1_fiq_invalid, seems like the FIQ handlers for EL2 are screwy? I'm trying to debug it now.
#asahi-dev · 2021-02-04 23:21
modwizcodeerror about labels being used with a declaration in a switch, I wrapped the cases with braces to fix.
#asahi-dev · 2021-02-04 23:21
modwizcodemarcan: I tried building your upstream kernel branch and uh it doesn't build for me.
#asahi-dev · 2021-02-03 16:01
modwizcodemarcan: speaking of picocom what omap and imap do you use for that? I always get weird newlines when I throw picocom on the pty for qemu
#asahi-dev · 2021-02-03 14:51
modwizcodeI'm surprised you had to fuss with it but it's possible I never tested again with the current timeouts, and if it didn't work I'd just rerun the commands
#asahi-dev · 2021-02-03 14:50
modwizcodeamw: yes I forgot to mention that I have local timeout adjustments (although the linux loader didn't need adjustments). Tbh the adjustments aren't needed at all now that I enable the FIFO by default in qemu and fixed it from being totally broken.
#asahi-dev · 2021-02-02 02:16
modwizcodebut if you know it you should add it too
#asahi-dev · 2021-02-02 02:16
modwizcodeAlso I never figured out the correct mapping for picocom to not screw up the newlines
#asahi-dev · 2021-02-02 02:15
modwizcodeyou might want to add a bit about how to run the proxy tools with it, since it's not super obvious you can just point them at the PTY
#asahi-dev · 2021-02-02 02:15
modwizcodeno problem!
#asahi-dev · 2021-02-02 01:56
modwizcodeFrom some bits I was poking it seems that maybe the M1 supports an ARM feature that makes the data and instruction caches coherent? I can't find enough specifics about what the feature actually means to fully understand it, it's a virtualization support feature but it requires that the cache coherence be defined in a weird way.
#asahi-dev · 2021-02-02 01:52
modwizcodeAlso maybe UP linux booting but I'm not sure if that's waiting for like... proper support and not chainloading via serial
#asahi-dev · 2021-02-02 01:52
modwizcodeAt least as far as I can tell
#asahi-dev · 2021-02-02 01:52
modwizcodeI think someone should probably edit the tasks page to mention that MMU, SMP spin-up and chicekn bits are all completed for m1n1
#asahi-dev · 2021-02-02 01:49
modwizcodeSeems reasonable I guess
#asahi-dev · 2021-02-02 01:47
modwizcodeDoes m1n1 have it's own wiki?
#asahi-dev · 2021-02-02 01:47
modwizcodeAs long as nobody minds that sounds good.
#asahi-dev · 2021-02-02 01:46
modwizcodeamw: glad to hear it :)
#asahi-dev · 2021-02-02 00:06
modwizcodeI tried to workaround the interrupt/console issues by adding a second UART and declaring it as the exynos uart instead of the apple one but linux seemed a little annoyed with that and so I'm just going to try and solve the actual IRQ issue
#asahi-dev · 2021-02-01 23:33
modwizcodeand my ls showed up on the fb console (I had to patch the m1n1 dts file I think to get that right can't remember)
#asahi-dev · 2021-02-01 23:32
modwizcodeI might have. I was setting up a getty so I don't think I noticed (it's login prompt is smaller)

plus ›