#
#asahi-dev · 2023-01-22 11:44
svenjannau: especially with thunderbolt this seems to be very annoying to get right and end in even more ugly hacks
#asahi-dev · 2023-01-22 11:44
ChaosPrincessif we intend to unify smc drivers with intel machines, then how to define that data for intel systems where there is no DT
#asahi-dev · 2023-01-22 11:44
svenjannau: fwiw, I think at this point we might as well try to just writer our own small dwc3 driver that calls into the dwc3 core but is more aware of the annoying atcphy dance by hooking into the typec_mux stuff as well
#asahi-dev · 2023-01-22 11:43
marcan(of course we don't have that data for everything, but we do for some machines, and that's nice)
#asahi-dev · 2023-01-22 11:43
marcanwhich varies from board to board
#asahi-dev · 2023-01-22 11:43
marcanI'd rather name those after the power rail they drive or what that power rail is for
#asahi-dev · 2023-01-22 11:42
marcane.g. MPMU buck #1 might be two totally different things on different machines, and naming it "MPMU buck #1" erases all information useful for end users
#asahi-dev · 2023-01-22 11:42
marcankettenis_: some keys have a different meaning on different systems because they are abstractly attached to power rails
#asahi-dev · 2023-01-22 11:38
kettenis_of course if Apple starts using the same key for wildly different purposes this won't work
#asahi-dev · 2023-01-22 11:38
kettenis_seems to work fine so far, although I only support a limited set of keys for now
#asahi-dev · 2023-01-22 11:37
kettenis_in the openbsd aplsmc(4) driver I simply have a list of keys we might be interested in and check which of them exist when the driver attaches
#asahi-dev · 2023-01-22 11:31
marcanwe push back against those silly rules/guidelines :p
#asahi-dev · 2023-01-22 11:31
marcanchadmed_: yeah the "don't build the hwmon_channel_info on the fly" thing falls under "lol subsystem maintainers think they can dictate how hardware works"
#asahi-dev · 2023-01-22 09:58
jeffmiwthanks. I'll see how I could do something similar or along those lines
#asahi-dev · 2023-01-22 09:57
chadmed_idek if thats possible though, i need to read up on how dts are compiled
#asahi-dev · 2023-01-22 09:56
chadmed_then you could just walk the table and build the required structures in the driver
#asahi-dev · 2023-01-22 09:56
chadmed_or something like that
#asahi-dev · 2023-01-22 09:56
chadmed_have an element for each key with smc-key and smc-label props
#asahi-dev · 2023-01-22 09:55
chadmed_i was thinking something like the opp table
#asahi-dev · 2023-01-22 09:53
jeffmiwby the way, if anyone has idea suggestion for the DT data/structure format or something that will be similar, I'm very interested :)
#asahi-dev · 2023-01-22 09:51
chadmed_building the hwmon_channel_info array based on dt info is possible just annoying
#asahi-dev · 2023-01-22 09:51
chadmed_jeffmiw: yeah i was just playing around with how that would look
#asahi-dev · 2023-01-22 09:48
jeffmiwchamed: I'm working on an hwmon driver version that will have configurable labels when we know them and do that from the DT like previously discussed with marcan.
#asahi-dev · 2023-01-22 08:57
svenoh well, here comes the usb curse: if I first use my apple tbt 3->2 adapter and then switch to this startech adapter acio hangs 🙃
#asahi-dev · 2023-01-22 08:56
chadmedthe hwmon docs say something about the way applesmc-intel does it being non-preferred these days, and none of the recent hwmon drivers do anything like that
#asahi-dev · 2023-01-22 08:56
chadmedonly thing is i dont _think_ you can build the hwmon_channel_info struct on the fly
#asahi-dev · 2023-01-22 08:55
chadmedyeah my thought on that was to end up with a per-machine smc binding for the match table, but that makes a bit more sense
#asahi-dev · 2023-01-22 08:53
marcanso we probably want to have it in the DT as separate includes much like the platforms themselves are handled
#asahi-dev · 2023-01-22 08:52
marcanplus there are going to be combinatronics involved, e.g. you have certain SoC-tied things (like CLVR voltage rails on Pro/Max) and some machine-tied things (e.g. j314 vs j316 differences)
#asahi-dev · 2023-01-22 08:50
marcanand could even gain new entries with firmware upgrades
#asahi-dev · 2023-01-22 08:50
marcanit is tied to the platform and SMC firmware
#asahi-dev · 2023-01-22 08:49
marcansince it is fundamentally not tied to the SoC at all
#asahi-dev · 2023-01-22 08:49
marcanso I was thinking we want all those key/name mappings in the DT
#asahi-dev · 2023-01-22 08:49
chadmedbut for now macsmc_f32_to_u32 works as a poc
#asahi-dev · 2023-01-22 08:48
chadmedyeah idk like i said its something im doing wrong that ill figure out
#asahi-dev · 2023-01-22 08:48
marcanI don't get it, that function doesn't do any pointer math at all...
#asahi-dev · 2023-01-22 08:48
chadmedyeah i was
#asahi-dev · 2023-01-22 08:47
marcanare you actually giving it a pointer to the int to write to? :p
#asahi-dev · 2023-01-22 08:47
chadmedim probably passing it something it doesnt like
#asahi-dev · 2023-01-22 08:47
chadmedyeah idk whats going on there, the kernel oopses inside that function though
#asahi-dev · 2023-01-22 08:46
marcana... null deref? for a *float conversion*?
#asahi-dev · 2023-01-22 06:11
chadmedthe scaling on translated floats is incorrect for power readings but that can be easily rectified
#asahi-dev · 2023-01-22 06:08
chadmedits based mostly on jeffmiw's work but generalised so that it will be a bit nicer to maintain and work with multiple machines
#asahi-dev · 2023-01-22 06:07
chadmedi borrowed jeffmiw's float translation function because the one in smc-core kept giving a null pointer dereference, which i will look at fixing at some point
#asahi-dev · 2023-01-22 06:07
chadmedhttps://github.com/chadmed/linux/tree/hwmon-wip-v2 smc hwmon driver prototype
#asahi-dev · 2023-01-22 04:14
eiln:))
#asahi-dev · 2023-01-22 04:09
marcaneiln: nice!
#asahi-dev · 2023-01-22 04:00
eilnbut i hope to release these soon s.t. people can test, including t600x
#asahi-dev · 2023-01-22 04:00
eilnso im trying my best on that
#asahi-dev · 2023-01-22 04:00
eilnand ml is so watered down that ik people are gonna complain without a one-click unstable diffusion notebook to run

plus ›