#
…

2021-11-16

00:17yuyichao_ has quit [Ping timeout: 480 seconds]
00:40Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
00:48Axenntio has joined #asahi
00:48Axenntio has quit [Remote host closed the connection]
00:53marcanradnic: what hardware?
00:54marcanfwiw hotplugging doesn't work (more than the initial connection); that is expected
01:28aidenfoxiveyhotplug means putting in the USB after the boot process is completed?
01:29X-Scale has joined #asahi
01:33X-Scale` has quit [Ping timeout: 480 seconds]
01:35nskl has quit [Ping timeout: 480 seconds]
01:43yuyichao_ has joined #asahi
02:08aidenfoxivey has quit [Ping timeout: 480 seconds]
02:08chile09[m] is now known as rolodondo9378[m]
02:56marcanhotplug means removing the USB cable and putting it in again (on either end)
02:56marcanthe first connection does work
03:40kov has quit [Quit: Coyote finally caught me]
03:45PhilippvK has joined #asahi
03:48phiologe has quit [Ping timeout: 480 seconds]
04:27jabashque has joined #asahi
04:42aidenfoxivey has joined #asahi
04:46kov has joined #asahi
04:50marvin24_ has joined #asahi
04:53marvin24 has quit [Ping timeout: 480 seconds]
05:12psykose has quit [Ping timeout: 480 seconds]
05:13psykose has joined #asahi
05:37tmlindfyi looks like hotplug of devices works with usb-c to usb-a adapter cable kept plugged in, this sounds like some unhandled interrupt for some usb-c related pin in the phy driver maybe?
05:40tmlindthis still with the old corellium hacked kernel, can't quite yet upgrade :)
05:47radnicSorry for answering late, I have a MacBook Air 13 with 500 GB ssd.
05:48radnicInitial connection works, I see here, if I put it in after the Mac is booted. Did not try disconnecting and connecting again.
05:49radnicFirst attempts were with the USB and power already connected. And the failure still showed. That was when/why, I tried different cable conneciton permutations.
06:03tmlindhmm so is the macbook spi keyboard already working then? maybe i can attempt to upgrade then with some usb wlan dongle..
06:08nskl has joined #asahi
06:17sailorek1234 has joined #asahi
06:39handlerug has quit [Read error: Connection reset by peer]
06:40handlerug has joined #asahi
06:40WhyNotHugo has quit [Read error: Connection reset by peer]
06:40WhyNotHugo has joined #asahi
07:12chamomile has quit [Ping timeout: 480 seconds]
07:12jannautmlind: https://gitlab.arm.com/linux-arm/jg-open/-/tree/m1-keyboard-5.16 has a working keyboard based on the Corellium SPI driver
07:15maor26 has joined #asahi
07:38tmlindjannau: sounds like dwc3 should just need to reinit the phy connection over ulpi/utmi whatever it might be after the repeater reset, i doubt dwc3 needs a reset
07:39tmlindjannau: thanks for the m1-keyboard link
07:42marcantmlind: we already know why this happens; it's a hardware design problem in the mac that requires a complete phy reset every time things are hotplugged at the type C end
07:42marcanwe already have a workaround for it
07:43tmlindi doubt that's the right fix though
07:43marcanit is what macOS does
07:43tmlindi doubt that's the right fix though
07:43marcanand further, macOS *still* has another bug where dwc3 wedges itself hard sometimes
07:43marcanand *that* needs an even bigger reset hammer to fix
07:43marcanwhich is what we'll do
07:44marcanyes, we looked for smaller hammers to use
07:44marcanand then that problem showed up
07:44marcanwhich needed an even bigger one
07:44marcanit's DesignWare, it should be presumed to be buggy and crappy
07:44tmlindprobably the issue is re-establishing the communication from dwc3 to the phy after the repeater reset
07:44marcanthat's *one* issue
07:44marcandwc3 wedging itself hard is another issue
07:45tmlindto me it sounds that dwc3 can hang if the link to phy is misconfigured after repeater reset
07:45marcanthe whole thing is poorly designed because the ace2 autonomously resets the phy without any input from dwc3/software
07:45marcanthat means all bets are off as to what happens on the link
07:45tmlindyeah sounds buggy :)
07:45marcanit's no surprise some conditions can cause it to wedge
07:45marcanand need a hardware reset
07:46tmlindyeah probably read/write to the phy hangs dwc3
07:46marcanhave you read the eUSB2 spec? it's insane :)
07:46marcanUSB-IF somehow manages to make every new standard even crazier than the last
07:46tmlindi had my share of usb already 15 years ago
07:46marcanwell, now we have Type C and eUSB2 to deal with
07:47marcanit's worse :p
07:47marcan(I've been doing USB for ~18 years now too)
07:47tmlindi'm still stuck dealing with crappy usb hardware too :)
07:47tmlindout of the usb hardware out there, dwc3 is quite sane actually
07:48marcanat least it's not dwc2, sure
07:48marcanbut then there's this phy business in front
07:48tmlindno, not dwc2 for sure
07:48tmlindis the repeater interrupt wired somewhere to a gpio line on the soc?
07:48marcaninterrupt?
07:49marcanthe i2c is wired to the ace2 master bus
07:49marcanI forget if there's an irq...
07:49tmlindit should be possible to deal with the repeater and the phy with a custom phy driver
07:49tmlindas long as there's some interrupt..
07:50marcanwe have a notification from the ace2 that a hotplug happened, which is how we currently know to reset the dwc3
07:50marcanin particular when transitioning from host/device mode to none mode
07:50tmlindit should be likely be handled by drivers/phy, then the phy driver notifies dwc3 in a standard way
07:50marcanthere is already a standard way
07:51marcandwc3 already gets notifications from the connector stuff about what mode the port is in
07:51marcanso it can switch roles
07:51marcanthat's what we're using
07:51marcanwe're just adding a quirk that changes the way dwc3 handles role switches
07:51marcanso it does the reset when going through disconnected mode
07:52marcanand yes, there will be a phy driver, but as I said resetting the phy is not enough (I'd have *loved* if it were, but we haven't found a way to bring it back to life after the big wedge without a bigger reset)
07:52marcanof course, if you think you can find one, feel absolutely free to dig around :)
07:52marcanbut even macOS gets wedged by this bug right now
07:52marcanit's on the list of things we currently do better than macos :p
07:53tmlindyeah to me it sounds that also a phy driver is needed, and after the phy reset, dwc3 needs to reinit the ulpi/utmi whatever data connection to the phy
07:53marcanthat's all internal anyway
07:53marcanbut the problem seems to be dwc3 wedges itself in a bad way, not just a phy link issue; ask sven about it
07:54tmlindwell the whole dwc3 probably hangs trying to read/write from the phy :)
07:54marcanthe phy is internal
07:54marcandon't confuse the phy and the eUSB2 repeater
07:54marcanit would've been a lot saner if they'd handled the eUSB2 problem more like a phy, but instead they did some crazy stuff, typical for USB-IF :p
07:54tmlindyeah sounds hacky
07:55tmlindanyways, this all can be dealt with later too, just smells bad
07:55marcanhardware often smells bad
07:55marcanespecially when USB is involved :p
07:56marcanbut as I said, we tried pretty hard to do this a saner way; feel free to try :)
07:56tmlindthe right person to comment on this is really felipe on the mailing lists, he might have some better ideas
07:56tmlindi'm allergic to usb nowadays :p
07:56svenfwiw, macOS does essentially the same thing
07:57marcansven: you know more about the hard dwc3 wedging in device mode, how bad was it?
07:57svencan’t even soft reset the core anymore
07:57tmlindthat's probably because some read/write to the phy already was done at that point..
07:57marcanagain it's not the phy, it's eUSB2 that is dropping out :)
07:57marcanthe phy does not get reset externally
07:58svenand dwc3 really doesn’t enjoy if you reset the phy while it’s not kept in reset itself
07:58marcanbut the eUSB2 repeater has a bunch of weirdo state machines and even a config protocol, so it's possible that some kind of transaction wedges in a nasty way when it gets reset
07:59tmlindlet's see what felipe suggests, has he commented on the related patches?
07:59svennot yet
07:59marcanwasn't this all merged already anyway?
07:59marcanah, I thought it was for some reason
08:00marcanit'll be more fun when we support USB3/USB4/TB3 anyway though
08:00sventhe usb pd stuff was merged
08:00marcanI get the feeling we aren't going to get away without sticking apple tunables in the DT for that one...
08:00svenyeah :/
08:01tmlindfun for years to come!
08:02sventhunderbolt itself is going to be a mess anyway
08:03marcanAIUI this is the first device in existence that does thunderbolt outside of intel controllers/firmware
08:03marcanso this is all new to the kernel
08:03marcanwe have some ARM boards doing DP/USB3 over Type C which is why at least we have all the infra for connector mode switching for that
08:03marcanbut we need to add TB to that mix
08:04marcanand from when I took a look at the existing code... it wasn't the best engineered to begin with :P
08:04maor has joined #asahi
08:05marcansven: USB3 doesn't need the ACIO m3s right?
08:05marcanI guess that's mostly just for TB?
08:05svenonly TB, yes
08:05marcanmakes sense
08:05svenusb3 just needs a few magic register pokes and some tunables IIRC
08:06marcanyeah, I guess those m3s are probably in charge of doing all the LS channel stuff for TB
08:06marcanoh yeah, did you see I found *another* M3?
08:07marcanit's in AVD, and we need to load its firmware, and it has to come from cutting up the kext :/
08:07marcanat least it's not signed though, so if someone is bored enough it could be reverse engineered / reimplemented
08:07slicey has joined #asahi
08:07marcan~35kB or so, depending on the IP core version
08:07sventhat’s not too bad. Still annoying though
08:08marcanI wonder if this is partially because that firmware is lost if the AVD is power gated; wouldn't surprise me
08:10marcanI don't see a power domain that screams AVD/MMX though
08:10marcanah, but AVD at least does claim to power gate itself in the pstate reg
08:10marcanso that's entirely plausible
08:10maor26 has quit [Ping timeout: 480 seconds]
08:12marcansven: for the next pmgr submission I'm thinking of actually dumping in the entire set of pwrstate nodes (like I tested yesterday for t6000), wonder what they'll say :D
08:12marcanon the plus side I was right, zero changes in t6000 there that we need to worry about
08:12marcanI've also decided the syscon nodes are going to be strictly for this, and sized after the pstate reg blocks (so highest reg rounded up to 0x100)
08:13marcan(well, to 16k probably works better)
08:13marcanso anything else from pmgr is going to get separate nodes
08:14marcanI have a script to convert the ADT device list to pwrstate DT nodes, but it still needs manual munging because I don't fully understand/agree with how apple decides what should be powered on and off on boot (they have a bit for that, but they set it on stuff that isn't necessary like UARTs, but they also set it on stuff that absolutely is like SPMI...)
08:14marcanI should commit this, I cleaned up a bunch of the pmgr stuff yesterday
08:22tmlindheh wondering why no upstream patches from corellium.. maybe because of strange directory paths in strings corellium.macho | grep home
08:28marcantmlind: they admitted in their BlackHat talk that the whole thing was just intended as a hypervisor validation platform
08:28marcansame reason Apple has an internal Linux port to these things
08:28marcanso it seems the whole releasing it and saying they'll upstream it was pure PR talk and they never had any intention to do that
08:28marcan(much less maintain it)
08:28marcanthey've been CCed on a ton of the submissions too and never said a word
08:32tmlindyeah what a pity if they cannot really participate, oh well
08:32marcanit kind of goes against their business model so I'm not surprised
08:32marcanif they really wanted to participate they'd share whatever internal hardware documentation they have
08:33marcanbut that would go directly against their business interests
08:33tmlindi heard apple uses linux internally for new hardware bring up or something like that
08:33marcanthere's one chicken bit set with a comment above it (back when apple was releasing source for this) saying it was found on linux
08:33marcanthat's how we know :)
08:33tmlindagain, what a waste of resources if they cannot participate
08:34marcanshrug, given the quality of their port I'm not too worried
08:34marcangiven their entire business is a hypervisor you'd think they'd spend time figuring out register definitions properly...
08:34marcanbut I think they're taking the approach that if it runs it's good enough
08:34tmlindusable mostly as hardware documentation, just like any other arm vendor trees..
08:34marcanmight work for virtualizing iOS, but not great for linux
08:35marcanyeah, but some of it is outright wrong :-)
08:35tmlindof course :)
08:35marcanthey had some GPIO_CONFIG_DONE bit that was actually GPIO_INPUT_BUFFER_ENABLE
08:35marcanand they also had confused sysreg names for different CPU generations in their attempt at porting over the chicken bits (which was dangerously close to the original xnu asm for the same)
08:36marcanI know that approach well because I've been there; hack on it until it works, make the PoC
08:37marcanand for a virtualization product... that's kind of all you need in the end, as long as macOS runs (the m1n1 hypervisor doesn't take a very different approach there, given it's a research tool)
08:37marcanbut when you're upstreaming a port... it actually matters that you understand the hardware and drive it properly
08:37tmlindright, and if the hardware is usable, it might get that kind of attention :)
08:37marcanthis is why I poke around registers to see what I find, I don't just do what macOS does
08:38marcanfound some interesting things in the new interrupt controller, like CPU cluster priority and delivery delays/timeouts (not 100% certain on everything yet, but it's nice to know these features exist)
08:38tmlindyup, the same applies to a lot of soc documentation out there too
08:38marcan(and this is why I was saying we've tried on the USB issue, believe me :p)
08:39tmlindyeah sure
08:40marcan< tmlind> usable mostly as hardware documentation, just like any other arm vendor trees.. <- this is what got Chris mad at me, btw
08:40marcanI mentioned the old sandcastle tree was not upstreamable on a reply somewhere (it wasn't even signed off...)
08:40marcanthen he got mad at me and I mentioned that in that state it would only be useful at docs
08:40marcanthen he stopped talking to me and 2 days later announced they'd "ported" Linux to the M1
08:41tmlindheh ok :)
08:44linearcannon has quit [Read error: No route to host]
09:06j_eytmlind: that keyboard link is just the corellium spi+input patches rebased onto 5.16 (which has the pinctrl driver)
09:09marcanhuh, I was wondering after someone mentioned rowhammer on twitter...
09:09marcanI think these machines might all have ECC RAM?!
09:09marcanif so, about time! (and now I don't want to use any other consumer machine)
09:10marcan(there's an ECC disable bit in AMCC, and it seems to not be set...)
09:10marcan(on neither M1 nor M1 Pro)
09:12tmlindj_ey: yeah i noticed, that's why i started wondering about the corellium patches again
09:12FireFox317marcan, what would you use the ECC ram for?
09:13marcanfirefox317: for not getting random bit errors because RAM bits are too small these days
09:13marcanit is completely ridiculous that *every other storage technology* has used ECC for decades, and ECC RAM is still not standard
09:13marcanthe idea that we can stick billions of bits in chunks of silicon and somehow have zero errors is completely insane
09:14Fruitecc is standard in ddr5 I believe
09:14miniI thought that was a watered down internal thing, not the full thing you'd think of as ECC (with error reporting etc)
09:20jannaumarcan: isn't that just link ecc to make (lp)ddr5 work and not storage ecc
09:20marcanmini: it has error reporting
09:21marcan"AMCC PLANE%d %s error: INTSTS 0x%016llx ECCMULTIBITSERRLOG(Bank/Way/Entry) %#x(%#x/%#x/%#x)" @%s:%d
09:21marcan"AMCC PLANE%d %s error: INTSTS 0x%016llx ECCONEBITERRLOG(Bank/Way/Entry/BitOff) %#x(%#x/%#x/%#x/%#x) ERRBITCNT %#x" @%s:%d
09:21svenohhh, fun!
09:21marcan(we don't have a driver for this yet of course, but it's the same reporting stuff that was barfing on T6000 when I mapped the framebuffer as cached and DISP0 realtime fetches were hitting the CPU cache)
09:22miniis macOS running it in the ECC enabled state?
09:22miniah, you said above already. reading comprehension!
09:23marcanit seems m1n1 already is, if I'm interpreting this right
09:24marcanthe T810x driver has a function to enable ECC, but the T6000 one doesn't; I think these days iBoot would enable it during mem init
09:26minimy comment about 'watered down internal thing' was re ddr5 as a whole, not the m1 specifically
09:26minibut if m1 & especially m1 pro/max have active ECC that's a really nice bonus on an already pretty damn impressive platform
09:27aleasto has joined #asahi
09:28marcanI wonder how we could test this...
09:29Namidairotry to rowhammer them /s
09:31miniit makes sense though - if they're doing a multi-die M1 Max for pro machines, people will want ECC support. and once you've had to build it for that you might as well just use it
09:40JTL> 09:09 <@marcan> I think these machines might all have ECC RAM?!
09:40JTLwait what?
09:40JTLwhich machines exactly? :P
09:41JTLas for testing if ECC is working, since it's soldered you can't passthrough a shim that shorts data pins to ground like some people did with DDR4, so some form of heat/radiation to try and induce errors?
09:42mininone of those pins are exposed, are they? surely they're all buried in apple's packaging because of how the RAM is done?
09:43JTLmini: hence my thinking
09:45marcanJTL: all of them
09:45JTL*all* M1 machines?
09:46marcanso on M1/t8103, there's an mcc_ecc=1 bootarg, but indeed the operation it does is a no-op: the register already has that value
09:46JTLinteresting
09:46aractual ram ecc, not just cache ecc?
09:47miniyou'd really think apple would be only too happy to stick it on their spec sheets
09:47JTLWhen M1 launched I wonder if the (apparent) lack of ECC was just another waste opportunity
09:48marcanah, might be cache ECC
09:48marcanbank/way/entry would suggest cache
09:48* JTLgrimace
09:48JTLyeah...
09:48marcanthe thing is I'm not even sure how you'd do ECC on a system with 16-bit channels
09:49marcanthat's a bit of a problem
09:49marcanDDR5 has 32-bit channels that become 40-bit channels with ECC (2x the ECC overhead of prior standards)
09:49marcanbut LPDDR with 16-bit channels... what are you going to do, make them 24 bits?
09:53marcanalso it seems we might not be using the cache at all in m1n1/linux yet? there is explicit enable code...
09:54marcan(the AMCC cache, not the CPU cache)
09:57chamomile has joined #asahi
10:28slicey has quit [Quit: cya]
10:43bgb has joined #asahi
10:53marcanalso AMCC got interesting in t6000... t8103 had 1 AMCC with 4 planes and 8 channels; t6000 seems to have 4 AMCCs with 4 planes and ? channels, and t6001 has 8 AMCCs.
10:53marcan(and the m1n1 code that checks the TZ regs is not correct on t6000 and works by accident, heh)
10:54bgbmarcan: what is TZ regs? TrustZone?
10:56marcanyes, the only TrustZone feature Apple still use on paper
10:56marcanit's just the carveouts
10:58bgbah, souds like making the device "secure" so that normal world cannot access
11:00marcanit just does that for some RAM regions
11:00marcanmostly NVMe and SEP related
11:00marcanthere is no actual EL3/trustzone on these chips
11:00marcanit's used for coprocessor carveouts instead
11:01marcanwe need to unmap them because otherwise the CPU might speculatively read from them, and cause a SError
11:01marcanthis isn't necessary in a "normal" OS which only maps things on demand, but in m1n1 we want to map all physical RAM by defaults to simplify experiments
11:06bgbgot it, so the "S" bit in MMU page table attribute has no meaning?
11:09bgbmarcan: btw, I met almost the same situation as radnic. I reset the device with "Arduino based PD". does this also relate to the "hotplug" issue?
11:10marcanthe hpm0 thing?
11:10Namidairoso I take it they won't be running any TF-A then
11:10marcanwhich is also why we need to invent a new wheel so m1n1 can provide PSCI from the same EL2 as the kernel
11:11marcansince we'll need something like that for sleep mode
11:11marcan(I talked about this in -dev yesterday)
11:15bgbmarcan: yeah. the hpm0 fail
11:17svenhpm0 init fail is different from the hotplug issue fwiw
11:17sveni kinda hoped that init fail was fixed with that i2c fix
11:18svenI don’t think we’ll ever have hotplug support inside m1n1. getting that to work would be quite annoying without a big benefit
11:20_jannau_I've seen occasionally i2c warnings/errors on the m1 max without noticeable broken functionality
11:22_jannau_could have been chainloading + work on usb init related
11:22svenwithout the hpm init the ports can’t act as a power source
11:23svenso essentially usb host mode won’t work
11:29marcanproblem is if I can't repro I can't fix it :/
11:31bgbsven: so, CDC ACM function should work? but, sometimes ttyACMx not showed on host
11:31svenyes, CDC ACM works even without the hpm init
11:32svenand same here: I’ve never been able to reproduce any of this so I can’t really fix it either
11:32Dcow has joined #asahi
11:32_jannau_don't we skip usb init if hpm init fails?
11:32svenhrm, could be
11:33_jannau_no, we don't
11:41jannauI can't reproduce either on the mac mini in ~25 chainload, 15 reboots both through vdmtool and power button
11:46jannaunothing unexpected on the m1 max either
11:52bgb has quit [Ping timeout: 480 seconds]
11:54bgb_ has joined #asahi
11:55bgb_sounds hw specific
11:56bgb_maz: can you show me how you run perf on your hack/m1-pmu? info on https://paste.debian.net/1218324/ expired
12:01robinp[m] has joined #asahi
12:02mazbgb_: something like "perf state -e PMUNAME/event=0xXX/ELs SOMEPROGRAM", where PMUNAME is one of apple_{ice,fire}storm_pmu, XX is the event number you want, ELs is one of {u,k,uk}, and SOMEPROGRAM the stuff you want to profile. you can count multiple events on multiple PMUs (comma separated).
12:02mazperf stat*
12:06bgb_maz: for perf executable, I just cross compile under linux/tools/perf, and pack it into ramdisk, right?
12:12marcanpushed some MCC magic (in a new mcc.c) to handle the t8103/t6000 MCCs properly and ostensibly do the magic cache enable dance
12:12marcanmaybe things will be magically even faster now :)
12:13robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:14kettenismarcan: with all the pmgr nodes added, Linux will actually turn off some of the power domains?
12:14marcanyes, everything not used
12:14marcan(which is why adding them is a good idea before the drivers are ready)
12:14kettenisunless they're marked as always-on i suppose
12:16mazbgb_: that's up to you. for me, this is an 'apt install' away (and I stopped cross-compiling many years ago...).
12:17maz(or rather, I cross-compile to x86/ppc/mips when I really need it)
12:18kettenisI only cross-compile when bringing up a new architecture ;)
12:20bgb_maz: so, you setup ubuntu distro on Mac?
12:21kettenisanyway, marcan, it would be good if a new pmgr patch set happens soon so I can push my u-boot driver upstream
12:21mazbgb_: Debian.
12:21marcankettenis: yeah, working on that, just got sidetracked by MCC today
12:21mort_the high-level software changes to get gnome to work around the notch feels interesting
12:22mort_*hypothetical high-level software changes
12:23mort_if all goes well, I'm getting a 14" pro tomorrow and will almost certainly play around with avahi
12:23bgb_maz: I don't know how to setup, any instructions or links?
12:25arnd_marcan: regarding ECC, it appears that LPDDR4 and LPDDR5 chips advertised with "integrated ECC" do this by having all the error correction logic in the package and no additional data lines to the host, so they can automatically correct any single-bit errors but would not raise an exception to the host for a double-bit error. I can see announcements of this from LPDDR4 manufacturers but there is no indication that these are being sold (any
12:26arnd_LPDDR5 also adds a "link ECC" option, which would comput a checksum only for data that gets sent between CPU and RAM and checked on the other end.
12:26robinp[m] has joined #asahi
12:27arnd_I think you can have any combination of the two on LPDDR5, but only the "link ECC" would lead to the CPU noticing a problem
12:30mazbgb_: I really don't think you want to adopt my installation method... I installed a complete Debian VM on a USB device, plugged it onto the mini. The kernel gets loaded over USB as a m1n1 payload.
12:30PhilippvK has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
12:33bgb has joined #asahi
12:39bgb_ has quit [Ping timeout: 480 seconds]
12:42X-Scale` has joined #asahi
12:45jannauboot that with linux.py and install it. after installing booting should work with linux.py or m1n1 with payload
12:46X-Scale has quit [Ping timeout: 480 seconds]
12:48mpsjannau: is this standard arm64 debian installed, or tailored for M1?
12:48mpss/installed/installer/
12:49mpsand standard initrd?
12:49maor26 has joined #asahi
12:50jannauthat is the standard installer. all hardware support is provided by the externally provided kernel
12:50jannaui.e. everything important has to be built-in
12:51mpsjannau: thanks for info.
12:51mpsthat could help me because I planning to make something similar for alpine linux (but not these days)
12:53jannauI didn't do anything except finding the URL. I've installed debian that way in the past although not on any apple silicon device
12:53maor has quit [Ping timeout: 480 seconds]
12:59mpsI made/adapted about year ago netboot install for alpine armv7 in qemu VM https://dev.alpinelinux.org/~mps/netboot2/
12:59mpsand local shell script, probably could adapt it
13:04_jannau_I wouldn't spend much on this as this would be only a temporay solution. the expected boot path is m1n1+u-boot payload with efi provided by u-boot
13:07mpsyou mean m1n1 and u-boot combined in one image?
13:09_jannau_yes, that works already since a long time via m1n1 payload mode but nobody has spent time so far preparing an image
13:10mpsaha, there is u-boot fork or patches for M1?
13:10robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:10svenyes, kettenis has a u-boot fork and has been working on upstreaming M1 support
13:10mpslast time I looked u-boot git log didn't seen it
13:11robinp[m] has joined #asahi
13:13robinp[m] has quit []
13:14mps_jannau_: nice news
13:14mort_you'd still need m1n1, right? Or is the plan to eventually make it possible for u-boot to be booted directly by whatever boot firmware macs have
13:15robinp[m] has joined #asahi
13:18mpsaiui m1n1 is (and will) be needed with u-boot
13:19mort_what's the advantage to u-boot then? I get something like grub or gummiboot because they can provide a boot select GUI but afaik uboot doesn't do that
13:19miniu-boot can provide an EFI environment. makes it easier to boot arbitrary linux
13:20j_eymort_: u-boot will probably load grub if thats what the distro normally does
13:21marvin24 has joined #asahi
13:21bgb_ has joined #asahi
13:21Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
13:24mort_by the way, what's the state of graphics currently? I kept up with the GPU reverse engineering posts but I haven't seen any in a while
13:24marvin24_ has quit [Ping timeout: 480 seconds]
13:26bgb has quit [Ping timeout: 480 seconds]
13:34Dcow has joined #asahi
14:00as400 has joined #asahi
14:01as400Hey everyone. I've seen discussion on u-boot.
14:02as400u-boot can provide boot menu as long as it is able to initialize graphics
14:02as400or display
14:03as400So actually no need for loading grub after booting m1n1+u-boot payload
14:04svensure, that's up to the individual linux distributions. we'll promise them m1n1+u-boot and they can figure out the rest :-)
14:04as400oh - good plan I guess
14:05mort_I'm not completely in love with the thought of mac bootloader -> m1n1 -> uboot -> emulated efi environment -> grub -> linux
14:05mazsome of us actually need grub.
14:05as400maz: like what exactly for ? Just curious.
14:07mazas400: imagine you have a zoo of about 40 machine, not two of them the same. you deploy a test kernel on that many boxes. EFI+grub is the only way to do that sanely.
14:09as400Well, in case of u-boot + config file, you just add few lines and you're ready to go.
14:10mazas400: you are missing the point. I don't want to add anything. all I'm doing is 'dpkg -i mykernel.deb', and get the standard distro tools to do their job.
14:10as400maz: ok - indeed I didn't understand you correctly
14:10myon98 has quit [Quit: Bouncer maintainance...]
14:13as400Anyway - is initializing display by u-boot possible already ?
14:15svenit can reuse the framebuffer initialized by iboot
14:15sven(i think. my m1 isn't connected to any screen)
14:16as400that's great
14:16as400same with keyboard ?
14:24sailorek1234 has quit []
14:25sailorek1234 has joined #asahi
14:25sailorek1234 has quit []
14:25robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:31Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
14:35myon98 has joined #asahi
14:36mpsu-boot with numbered menu is quite enough for me
14:44as400I have a question to MBP 14 8-core M1 Pro owners - what is the real time on battery based on your experiences ? Asking because I'm really tempted to buy this baby.
14:44kettenisu-boot + usb keyboard already works
14:44kettenisu-boot + laptop keyboard will probably work before the end of the year
14:44as400kettenis: thanks - great news.
14:45kettenis(the lack of laptop keyboard support annoys me enough for that to happen)
14:46mpskettenis: could you give url of your u-boot fork
14:48mpskettenis: thanks
14:48kettenisbut basic support with working usb is already upstream and should be part of the 2022.01 release
14:48mpsand current u-boot git?
14:49kettenisdevice trees are still a bit of a mess
14:52mpsI'm quite irritated with macos already (using it about one week) and I want to switch it to linux
14:53bgb has joined #asahi
14:53mpsthough I'm short on time these days (as usual on every last two months of year)
14:57kettenisnote that at this point there is no m1 pro/max support in u-boot
14:58svenwhat's missing to clean up that device tree mess btw.? pmgr and nvme? or is there anything else left?
14:59kettenisa few more bindings for things like spmi, spi (including the keyboard)
14:59bgb_ has quit [Ping timeout: 480 seconds]
15:00kettenisand proper device trees for the different models (which janneau is working on)
15:00_jannau_usb-reset to add dwc3 + i2c + cd321x officially
15:06maor has joined #asahi
15:06svenkettenis: so i think i'm in favor of having a separate SART node at this point because of the differences between M1 and Pro/Max
15:06kettenisthat was my thinking as well
15:12maor26 has quit [Ping timeout: 480 seconds]
15:18Dcow has joined #asahi
15:23yuyichao_ has quit [Ping timeout: 480 seconds]
15:36as400 has left #asahi [#asahi]
16:23marcanfwiw I already have proper devicetrees for all the t6k models in my branch (at least for upstream stuff, plus the things I'm merging in)
16:23marcansven: yeah, I agree
16:23marcanmort_: each boot stage does something discretely useful. there is nothing wrong with having things split up into stages.
16:24marcanm1n1 does the init that iBoot doesn't and bridges to the devicetree world; u-boot handles I/O and provides EFI services; grub is provided by distros and is what they know how to integrate and manage.
16:26marcan< sven> (i think. my m1 isn't connected to any screen) <- you should fix that, it makes boot a good 10 seconds slower or so
16:26marcan(dunno why, retries I guess)
16:26svenI have a dumb dongle that pretends to be a hdmi screen connected for that
16:26marcanah, then it *is* connected to a "screen" :p
16:27svenfair :D
16:27marcanalso I still find it hilarious that without a screen it sets up a frambuffer with the portrait screen dimensions of the iPhone 4 or something
16:28akemin_dayowait, it does? that is amazing wwww
16:30marcan width: 640
16:30marcan height: 1136
16:31marcaniPhone 5, apparently
16:31akemin_dayooh, that's the uh, iphone 5 resolution
16:31akemin_dayothe 16:9 dAR
16:34kettenissomething upsets u-boot though if no screen is connected
16:41marcancould be the depth?
16:42marcanit's 32bpp apparently, as opposed to the usual 30
16:42marcan(which actually means 24)
16:43kettenisshouldn't matter, but I'll keep that in mind when I get around to debugging this issue
17:19___nick___ has joined #asahi
17:48___nick___ has quit []
17:51___nick___ has joined #asahi
17:51maor has quit [Quit: Leaving]
17:53gabriele_ has joined #asahi
17:55as400 has joined #asahi
17:56as400Guys, where is iboot located on macs ? SPI flash ?
18:01Dcow has quit [Quit: Textual IRC Client: www.textualapp.com]
18:02Dcow has joined #asahi
18:07jannauhmm, the spi stage doesn't seem to be named iBoot though
18:11hramrach has joined #asahi
18:15as400 has quit [Remote host closed the connection]
18:18djsrv has quit [Quit: ZNC 1.8.2 - https://znc.in]
18:18djsrv has joined #asahi
18:20svenspi for the first stage and then nvme for the second stage
18:21svenApple changed those names quite a bit afaik
18:22svenso It probably used to be known as LLB but I believe it’s just called iboot now
18:23as400 has joined #asahi
18:24as400Thx jannau
18:28as400 has quit [Remote host closed the connection]
18:37INTL has joined #asahi
18:39Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
18:41as400 has joined #asahi
18:42as400sven: isn't LLB the same what's called bootrom on other SOCs ?
18:44Dcow has joined #asahi
18:46as400Ok, I was thinking whether it could be possible to replace LLB and iBoot with u-boot. But it doesn't seem possible.
18:48aidenfoxivey has quit [Ping timeout: 480 seconds]
18:49aidenfoxivey has joined #asahi
18:49as400It would be nice to have open boot process as much as possible.
18:50j_eyI think it's assume that iBoot is always going to be part of it
18:55as400Well, I guess llb and iboot do a lot of hardware init. Which would have to be done by u-boot otherwise. Which is a lot of work.
18:57svenwe _can't_ replace anything prior to what we currently replaced
18:58svenit's all signed and encrypted
19:03as400 has quit [Ping timeout: 480 seconds]
19:25yuyichao_ has joined #asahi
19:30yuyichao has joined #asahi
19:33gabriele_ has quit [Quit: Leaving]
19:34yuyichao_ has quit [Ping timeout: 480 seconds]
19:50kettenishmm, my u-boot watchdog diff actually makes u-boot arm the watchdog
19:50ketteniswhich means that it remains armed (with a 60s timeout) when u-boot hands control to grub or linux
19:54jannauthat seems a bad default. especially in the case of grub
19:55kettenisactually, I think I've got that wrong
19:55kettenisu-boot will continue to tickle the watchdog until ExitBootServices() gets called
19:55kettenisso the 60s timeout starts when control is handed to the kernel
19:57jannaukettenis: do you want to be cc-ed for m1 linux dts changes?
19:58kettenisjannau: yes that would be good
20:03svenmy v2 can at least handle the case when the watchdog is still running
20:04svenif some bit in the watchdog structure is set the watchdog core will make sure to ping it regularly
20:05kettenisthere is a running discussion on the u-boot mailing list about what the behaviour should be
20:06kettenisbut no real consensus
20:06* svendoesn’t even have an opinion
20:06svenboth are fine with me
20:48___nick___ has quit []
20:49___nick___ has joined #asahi
20:50___nick___ has quit []
20:51___nick___ has joined #asahi
21:07aleasto has quit [Quit: Konversation terminated!]
21:08___nick___ has quit [Ping timeout: 480 seconds]
21:59aidenfoxivey has quit [Quit: aidenfoxivey]
21:59aidenfoxivey has joined #asahi
22:14torstenvl has joined #asahi
22:14torstenvl has quit [Remote host closed the connection]
22:20chamomile has quit [Ping timeout: 480 seconds]
22:28psykose has quit [Remote host closed the connection]
22:35chamomile has joined #asahi
22:38psykose has joined #asahi
22:38psykose has quit [Remote host closed the connection]
22:40psykose has joined #asahi
22:48tertu has quit [Quit: so long...]
22:48tertu has joined #asahi
23:02skipwich has joined #asahi
…