#
…

2021-12-21

00:03chengsun has quit [Quit: Quit]
00:21joe[_]D has quit []
00:23Dcow has joined #asahi-dev
00:27yuyichao_ has quit [Ping timeout: 480 seconds]
00:43bmrgz has quit [Quit: Page closed]
01:07chengsun has joined #asahi-dev
01:14chengsun has quit [Quit: Quit]
01:15chengsun has joined #asahi-dev
01:18Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:18Dcow has joined #asahi-dev
02:02DarkShadow44 has quit [Quit: ZNC - https://znc.in]
03:01DarkShadow44 has joined #asahi-dev
03:06marcankettenis: oh wow, didn't realize you were on serial. yeah, use --no-sepfw over serial to avoid that.
03:06marcanit should work but it still takes an annoyingly long time over serial, hence the arg
03:07marcanohh right, the CPU thing also pulls the ADT
03:07marcanthat was unintentional
03:08marcanpushed, it won't do that on --no-sepfw now
03:28chadmed has joined #asahi-dev
03:31c10l0 has joined #asahi-dev
03:35yuyichao has joined #asahi-dev
03:37c10l has quit [Ping timeout: 480 seconds]
03:38yuyichao has quit []
03:40yuyichao has joined #asahi-dev
03:46c10l0 has quit []
03:47c10l0 has joined #asahi-dev
03:47c10l0 is now known as c10l
03:49yuyichao has quit [Quit: Konversation terminated!]
04:01phiologe has quit [Ping timeout: 480 seconds]
04:02Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:03Dcow has joined #asahi-dev
04:05Dcow has quit []
04:06yuyichao has joined #asahi-dev
04:07yuyichao has quit []
04:07tpw_rulesso i figured out the reboot hang problem.
04:09tpw_rulesnever gets called
04:10tpw_rulesthe efi spec: https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf says on page 266 (physical 316) that "The ResetSystem() function does not return" so i'm not sure what the kernel is doing trying to call stuff after that
04:11tpw_rulesfortunately the system resets anyway because the watchdog gets initialized with its default 30 second timeout before the EFI function is called
04:12tpw_rulesor rather, programmed with its default 30 second timeout at boot, then turned on during shutdown, possibly by systemd
04:15yuyichao has joined #asahi-dev
04:40tpw_rulesactually, this is probably u-boot's fault for claiming it can reset the board when it can't. setting CONFIG_EFI_HAVE_RUNTIME_RESET=n fixes the problem. presumably once the PSCI stuff y'all mention gets worked out it will work
05:00Dcow has joined #asahi-dev
05:00c10l has quit [Quit: The Lounge - https://thelounge.chat]
05:00c10l has joined #asahi-dev
05:17Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:33Dcow has joined #asahi-dev
05:38Dcow_ has quit [Ping timeout: 480 seconds]
05:59amwjannau: Can I put a reference to your notes at https://ab34.de/u/asahi.txt on the Wiki?
06:16marcantpw_rules: fun, I guess that will also work once we implement PSCI :p (but we'd have to teach u-boot about the new PSCI call method too)
06:20tpw_rulesdoes anybody know how to get symbols for grub's efi binary? i'm trying to figure out why it hangs when booting a kernel
06:20tpw_rulesfor exactly 53.6 seconds (or 2**29 100ns units)
06:21tpw_rulesmarcan: did you have a chance to glance through the guide? i'm really hoping the asahi installer can handle all the partitioning in the future
06:21marcannot yet, but yes, I'll take care of the partitioning
06:22_jannau_amw: in prinicle sure. at the moment it will result in non working keyboard/trackpad due to changed defaults
06:22marcanthe current installer is basically a PoC of the stub creation
06:22marcanwhich makes life much easier for developers, but it's missing all the boring bits around partitioning :)
06:22tpw_rulesare you going to have to ship your own partitioner? even `diskutil` seems hopelessly broken
06:23marcanwe need to use diskutil for APFS resizes and creating the EFI stub partition, since we need to mount the latter
06:23_jannau_amw: is there reason to clone the repo if you just want the config?
06:23amw_jannau_: ok - thanks it's just so succint summary for people to go to.
06:23marcanand I'm not aware of any "reload partition table" API or similar
06:23marcana bunch of this stuff is gated by entitlements
06:23marcan(e.g. diskutil calls corestorage)
06:24tpw_rulesi couldn't figure out how to make it set a partition to an efi system one
06:24amw_jannau_: I only clone it if I want to preserve an exact revision as there is so much re-basing going on
06:24marcanwe do have raw disk access, can't remember if to the GPT though but I think so?
06:24tpw_rulesor do you mean the macos stub partition
06:24marcanIIRC there is some way but I need to experiment
06:24marcanbut yes, as long as we can write the GPT we can fix up the partition types
06:24tpw_rulesbut i found out diskutil does not parse non-sorted gpt tables correctly: https://pastebin.com/LSv0zYAE
06:24marcanand yeah *EFI system partition
06:25marcanI *thought* there was a way to specify the UUID, but let me see
06:25tpw_rulesi might have discounted it if it exists because i didn't want to try to type it
06:25tpw_rulesat least that's my excuse
06:26tpw_rulesanyway it's my bedtime
06:27marcanah, so we *can* create partitions with arbitrary EFI types, but what we can't do is *format* them
06:28marcanand using eraseVolume changes the type, hmm
06:31amw_jannau_: Just a brief note + link on developer quick start (has big LARGELY OBSOLETE section from marcan above it) - if you want to check it
06:31marcanso one dumb thing we can do is format it as FAT32, take a disk image in RAM, then format it as EFI, and dump the disk image back
06:31marcanthen mount works
06:31marcanor we can ship mkdosfs
06:31marcanI kind of want to avoid touching the GPT outside of diskutil, but it seems formatting ourselves should work
06:34marcanhttps://github.com/maxpat78/FATtools this might be a convenient way to do it from python
06:34Redecorating[m]is /System/Library/Filesystems/msdos.fs/Contents/Resources/newfs_msdos there on the recovery filesystem? that might work too
06:34marcanah, good point, let's see
06:36marcanindeed, it's there
06:36marcanlet's see if it works
06:39marcanyup, that worked :)
06:39marcanI'm not sure about changing the volume name though, it showed up as "NO NAME"
06:40Redecorating[m]-v might change that
06:40marcanah, "diskutil rename" works and conveniently renames the mountpoint
06:40marcanoh, or that, which I somehow missed
06:40marcanyup, works great
06:40marcanwell, that solves this problem then!
06:46marcany'know, maybe I should write a blog post about this (how the partitioning/installer will work)
06:59bps2 has joined #asahi-dev
07:49thunfisch has quit [Ping timeout: 480 seconds]
07:56marcansomeone already mentioned it comes from ACPI
07:56marcanthe remaining question is the antenna SKU
07:57marcanRedecorating[m]: ah it was you, lol, sorry
07:57marcanand yeah, I'll do that a bit later this week
07:58Redecorating[m]the only places the antenna is in `ioreg -l` for me is under RequestedFiles and IO80211CountryCode
08:02MajorBiscuit has joined #asahi-dev
08:02marcanthat's runtime info, but the CountryCode thing is suspicious
08:02marcanbecause that comes from the wifi module
08:02marcanso I wonder if it's in there somehow?
08:03marcanbut then... where does the real country code come from?
08:13Major_Biscuit has joined #asahi-dev
08:15MajorBiscuit has quit [Ping timeout: 480 seconds]
08:37ketteniswhat do you mean with the "real" country code...
08:42marcanthe actual country the device was sold in, if that's anywhere...
08:50kettenistpw_rules: it looks like some PSCI functionality is incorrectly enabled in u-boot right now
08:53kettenismarcan: what actually happens on the M1 when you issue an smc instruction?
08:59j`eyshould be an undefined instruction exception
09:01kit_ty_kate has quit [Quit: WeeChat 2.9]
09:04mazit doesn't, unfortunately.
09:05mazfrom EL1, it generates a exception with an EC that is reserved...
09:06mazah, and of course it generates it to EL2, instead of staying at EL1.
09:06mazi had some good fun tracing that one in KVM.
09:07j`eyso much for clarifying by reading the arm arm :P
09:07j`ey(CheckForSMCUndefOrTrap)
09:08mazthey are above that.
09:12kettenismarcan: with that m1n1 change things work again
09:13mazj`ey: kvm [13218]: Unknown exception class: esr: 0xfe000020 -- UNRECOGNIZED EC
09:14mazj`ey: that's an SMC in a KVM guest (EC=0b111111).
09:15j`eymaz: and then we inject an undefined exception to el1, looking at kvm_handle_unknown_ec
09:16kettenisok, disabling the PSCI_RESET code makes all the other PSCI code in u-boot go away
09:16kettenisso I pushed that change
09:18mazj`ey: yup, that's the only sensible thing to do.
09:18mazwe have no idea what the guest wants to do anyway.
09:23kettenistpw_rules: disable PSCI_RESET makes sure CONFIG_EFI_HAVE_RUNTIME_RESET isn't set, so this should make u-boot stop advertising EFI runtime reset support
09:41Dcow_ has joined #asahi-dev
09:43mazj`ey: FWIW, SMC correctly UNDEFs at EL2 (there is nowhere else to report it anyway)
09:52nabaiste^ has quit [Ping timeout: 480 seconds]
09:57thunfisch has joined #asahi-dev
10:00bps2 has quit [Ping timeout: 480 seconds]
10:14Glanzmann has joined #asahi-dev
10:15Glanzmannamw: https://ab34.de/u/asahi.txt are my notes, from my site feel free to add it. But better use the new shorter url: https://tg.st/u/asahi.txt
10:16Glanzmannamw: I also considered improving this steps to be able to install debian in less than 10 minutes (I also thought about doing a debian live system if you just want to try it and discard it afterwards), but probably that is not necessary because marcan will do the installer soon anyway.
10:26blassphemy[m] has joined #asahi-dev
10:33Glanzmann has quit [Quit: EOF]
10:36aleasto has joined #asahi-dev
10:40marcanmaz: that is a configurable cpu chicken bit
10:40marcanwe can turn off that SMC behavior in m1n1
10:41marcanI'm not sure why they have it
10:42marcanit came along with the macOS chicken bits, since it uses it
10:42marcanchange that to reg_clr, it should be compliant then
10:42mazmarcan: I think they use it in hvf to emulate SMC, but that's just gross.
10:43marcanyeah, I suspected such
10:44mazI'd rather we turn that off by default, because the behaviour really isn't compliant with the architecture.
10:44mazand maybe leave that as an option for people who really want the taste the madness!
10:44mazto taste*
10:45marcanmaz: done
10:47mazmarcan: now you are forcing me to update the box... ;-)
10:48marcanyou can always just chainload :p
10:50mazwell, that's what I do already. just need to rebuild the test m1n1/u-boot bundle... once I have sorted the NV branch...
10:53bps2 has joined #asahi-dev
11:07bps2 has quit [Ping timeout: 480 seconds]
11:13Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:24amwGlanzmann: Woops! Sorry - i just assumed the github was the author!
11:31marcan(for those not reading #asahi, pushed the wifi stuff to wifi/take1)
11:38amwGlanzmann: FWIW I got debian X working mostly following your steps. I had to install a particular set of packages to get X + mouse working - still can't get the touch pad to work though
12:04chadmedjannau was working on the touchpad. aiui applespi has issues with how this particular touchpad reports HID events, pressure etc
12:14Dcow_ has joined #asahi-dev
12:35chadmed has quit [Remote host closed the connection]
12:36amwchadmed: Could see any newer touchpad patches in Jannau's github branches - presume it's still to be decoded
12:39j`eyamw: it should work, it's likely a config issue
12:44Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:56phire has quit [Ping timeout: 480 seconds]
13:32Dcow_ has joined #asahi-dev
14:02Guest7760 is now known as svenpeter[m]
14:34yuyichao has quit [Ping timeout: 480 seconds]
14:51zsxh has quit [Ping timeout: 480 seconds]
15:03yuyichao has joined #asahi-dev
15:22Glanzmann has joined #asahi-dev
15:23Glanzmannamw: Perfect. Touchpad worked for me out of the box without doing anything. Jannau gave me some tips (added to asahi.txt) how to use the touchpad. When I'm back home I'll try wifi and also send you my package list. With that touchpad works out of the box. I used xorg (are using X or wayland)?
15:25Glanzmannamw: are you* using X or wayland? (kde and gnome os debian testing wayland - fvwm2 the window manager I use is for example xorg)
15:29Glanzmannamw: On which device you're trying the x config?
15:32marcanGlanzmann: if you aren't doing development, please move to #asahi
15:34Glanzmann has quit [Quit: EOF]
15:47mazmarcan: gave the SMC trap change a go, works as expected. thanks!
16:31Glanzmann has joined #asahi-dev
16:31Glanzmann has left #asahi-dev [#asahi-dev]
17:06tpw_rules has quit [Ping timeout: 480 seconds]
17:09tpw_rules has joined #asahi-dev
17:30kit_ty_kate has joined #asahi-dev
17:30yuyichao_ has joined #asahi-dev
17:33yuyichao has quit [Ping timeout: 480 seconds]
18:08Major_Biscuit has quit [Ping timeout: 480 seconds]
18:44yuyichao has joined #asahi-dev
18:48yuyichao_ has quit [Ping timeout: 480 seconds]
19:00Major_Biscuit has joined #asahi-dev
19:04kettenismarcan: any thoughts yet on the device tree bindings for the SMC GPIOs?
19:05marcankettenis: I'm thinking smc would be a parent node with subnodes for individual features, then one of those would just be a standard gpio controller
19:05kettenisI currently use a "pwren-gpios" property on the PCIe host bridge port
19:05marcanah, you mean on the other wis
19:05marcanyes, I was wondering about that
19:06marcanmaybe maz has an opinion there?
19:06marcan(or maybe there's something already?)
19:06marcangiven this needs to come up before the root port does link training, since we don't do hotplug yet...
19:06kettenisthere is a precedent for this for the hifive unmatched PCIe bridge
19:07kettenison the SMC node, corellium has this ugly "gpio-13: 00800000" property
19:07kettenisthat obviously needs some thought
19:08kettenisso some good RE-ing of how the "gP??" SMC key really works would not go amiss
19:11marcanoops, that wasn't dead yet :)
19:11marcankettenis: there's that really weird read behavior, yeah
19:11marcanand obviously corellium are not, er, something to reference for correctness :p
19:11marcanI'll poke around some more
19:12marcanrobher: would be nice to hear your opinion on the general idea for the bindings before I start writing it that way
19:13marcantl;dr one parent node that implements a key/value interface, then a bunch of child nodes each bound by a subdriver that implements a given feature (gpio, battery, hwmon, etc)
19:13marcanthe parent node would not be a simple-bus derivative; the driver there would be in charge of probing child nodes
19:14marcanI think this makes sense because it lets us use the compatible mechanism to identify SMC features/quirks across devices (and makes it more reusable), and allows for obvious things like "the mac mini does not have a battery so does not instantiate that driver"
19:15marcanan alternative way would be to ditch all the explicit description in the DT and just have one monolithic driver attempt to autoprobe everything...
19:15marcan(which is what applesmc.c does on intel systems...)
19:16robhermarcan: It's a judgement call. If the child devices have DT resources then it makes sense. But often it is just a node with only compatible just for convenience of instantiating (Linux) drivers.
19:16marcansome of them would provide DT services, e.g. gpio would be a gpio provider
19:16robherIt's always easier to add nodes later.
19:17marcanI guess part of the question is whether we can autodetect ~everything or whether we're going to need DT props at some point
19:17marcanif we need to start specifying per-platform props it starts making sense to break it apart like that
19:18marcanI guess the general driver model would be the same in both cases, it mostly just changes how the subdrivers are instantiated, so it wouldn't be too hard to make the call a bit later
19:20kettenisthe keys are discoverable
19:20tpw_ruleskettenis: so it turns out u-boot's efi layer polls usb keyboards each time grub reads a sector to check if a new key is available. this leads to a 53 second delay when one is attached after selecting a boot option, unless you press a key
19:20marcanand also we can just read-probe
19:20kettenistpw_rules: a know issue
19:21marcanwe're definitely going to have a sysfs interface with all the keys for experiments/debug anyway
19:21marcanwell, debugfs I guess
19:22tpw_ruleskettenis: is there a link anywhere?
19:25kettenisthere was a post on the mailing list somewhere this year
19:27j`eymarcan: how will the smc-gpio wifi enable get triggered?
19:29robhermarcan: The mfd subsystem can handle doing things both ways.
19:30kettenisj`ey: probably the pcie host bridge driver will have to do that
19:30kettenisthat's how u-boot currently handles it
19:38yuyichao_ has joined #asahi-dev
19:39tpw_ruleskettenis: i cannot find it
19:42yuyichao has quit [Ping timeout: 480 seconds]
19:51kettenisyeah sorry, can't remember the details
19:52tpw_rulesis this something you'd patch in your tree
19:52kettenisbut this does need to be fixed upstream
19:53kettenisthe mail I remember was about a fix that got rejected
19:59tpw_rulesyeah all the relevant functions in the upstream tree don't seem to have been touched
20:02aleasto has quit [Remote host closed the connection]
20:14kettenisyes, that looks familliar
20:16ketteniswould be great if you could get that issue fixed
20:18tpw_rulesthere are several other ways to fix it but i'm not sure which will appease upstream
20:30___nick___ has joined #asahi-dev
20:30___nick___ has quit []
20:32___nick___ has joined #asahi-dev
20:36sveni usually submit what I think is the best way. chances are the first submission has to be rewritten anyway ;)
20:58Major_Biscuit has quit [Ping timeout: 480 seconds]
21:08___nick___ has quit [Ping timeout: 480 seconds]
21:17tpw_rulesi found a keyboard which runs into this problem: https://patchwork.ozlabs.org/project/uboot/patch/20200914023921.119630-3-jason.wessel@windriver.com/ but it looks like the patch never made it into u-boot
21:59ar has quit [Ping timeout: 480 seconds]
22:08ar has joined #asahi-dev
22:20Major_Biscuit has joined #asahi-dev
22:48Major_Biscuit has quit [Ping timeout: 480 seconds]
23:02gladiac is now known as Guest9080
23:02gladiac has joined #asahi-dev
23:07Guest9080 has quit [Ping timeout: 480 seconds]
23:58yuyichao_ has quit [Ping timeout: 480 seconds]
…