2021-04-11
00:02hspak has quit [Ping timeout: 252 seconds]
00:32jeffmiw_ has quit [Remote host closed the connection]
01:03troseman has joined #asahi
01:27zkrx has quit [Ping timeout: 240 seconds]
01:30odmir has quit [Remote host closed the connection]
01:31odmir has joined #asahi
01:33hspak has joined #asahi
01:36odmir has quit [Ping timeout: 268 seconds]
01:42zkrx has joined #asahi
02:03odmir has joined #asahi
02:34odmir has quit [Remote host closed the connection]
02:34odmir has joined #asahi
02:51bdju has quit [Read error: Connection reset by peer]
02:51bdju has joined #asahi
02:57phiologe has quit [Ping timeout: 250 seconds]
02:57phiologe has joined #asahi
03:08marvin24 has quit [Ping timeout: 245 seconds]
03:09marvin24 has joined #asahi
03:50troseman has quit [Ping timeout: 260 seconds]
04:09TheJollyRoger has quit [Remote host closed the connection]
04:10TheJollyRoger has joined #asahi
04:25odmir has quit [Remote host closed the connection]
04:26odmir has joined #asahi
04:30odmir has quit [Ping timeout: 240 seconds]
04:33jeffmiw_ has joined #asahi
04:37jeffmiw_ has quit [Ping timeout: 240 seconds]
05:26tomtastic has quit [Ping timeout: 240 seconds]
05:28tomtastic has joined #asahi
06:39VinDuv has joined #asahi
06:54mxw39 has quit [Quit: Konversation terminated!]
07:53ephe_meral1 has joined #asahi
09:00h_ro[m] has quit [Quit: Idle for 30+ days]
09:37angelXwind has quit [Ping timeout: 240 seconds]
09:39jeffmiw_ has joined #asahi
09:41luca020400 has quit [Quit: WeeChat 3.1]
09:42luca020400 has joined #asahi
09:47akemin_dayo has joined #asahi
09:48jeffmiw_ has quit []
10:05Necrosporus has quit [Ping timeout: 240 seconds]
10:34vimal has quit [Quit: Leaving]
10:42vimal has joined #asahi
10:45Necrosporus has joined #asahi
10:49vimal has quit [Remote host closed the connection]
10:51vimal has joined #asahi
10:55vimal has quit [Client Quit]
11:16klaus has joined #asahi
11:43raster has joined #asahi
12:16inglor has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
12:17inglor has joined #asahi
13:20svenmarcan: https://github.com/svenpeter42/linux/commits/apple-clk here's what i have for the gate clocks. i'll send it to the lists later if that's fine with you
13:22marcansven: isn't this ioremapping a whole page for every 32-bit clock index? this seems sub-optimal
13:23marcanshouldn't it be one clock controller node with clock IDs corresponding to register indices? or perhaps one clock controller with subclock nodes that have reg offsets relative to the parent?
13:24svenfor the first one i'd then have to hardcode child/parent relationships in the driver itself
13:30marcansee https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/clock/clock-bindings.txt
13:30sventhere's a general gpio gate clock driver but that's based on the gpio subssytem. the closest one is renesas,r7s72100-mstp-clocks i think
13:32marcanyou should be able to do the same thing, and just have one single clock controller instance
13:53klaus__ has joined #asahi
14:01klaus___ has joined #asahi
14:03klaus__ has quit [Quit: Lost terminal]
14:15kettenis_assigned-clock-parents is to initially set the muxes when there are multiple parent clocks to choose from
14:17kettenis_the benfit of the "one node per clock" strategy is that you don't have to define clock IDs and can make the clock hierarchy explicit in the device tree instead of coding it in the clock driver
14:18kettenis_but the "one node per clock module" model seems to be preferred by the Linux maintainers these days
14:18zopieux has quit [Quit: zopieux]
14:19choozy has joined #asahi
14:19klaus has quit [Disconnected by services]
14:20klaus___ is now known as kluas
14:20kluas is now known as klaus
14:21zopieux has joined #asahi
14:26choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
14:27kettenis_in the "one node per clock" model you can probably avoid ioremapping the same page multiple times by using a regmap
14:35zopieux has quit [Ping timeout: 258 seconds]
14:37zopieux has joined #asahi
14:39svenif i want a single clock controller node i think i either have to hardcode the parents in the driver or invent some new dt property
14:48glibc has left #asahi [#asahi]
14:49taziden has quit [Ping timeout: 246 seconds]
14:56marcanyou still want one device bound to the overall clock controller, but you can have subnodes for the actual clocks
14:58marcanbut we're doing things right here (see: how I fixed the arm timer to suck less after several SoCs were already using dirty hacks to work around it)
15:00ephe_meral1 has quit [Ping timeout: 250 seconds]
15:01kettenis_if you want the clock nodes to be children of that, it also needs a "simple-mfd" compatible
15:09kettenis_my understanding omap is done that way since there actually is a bus that can be powered on and off
15:26taziden has joined #asahi
15:41vimal has joined #asahi
16:27odmir has joined #asahi
16:31odmir has quit [Ping timeout: 240 seconds]
17:02tmlind has joined #asahi
17:05tmlindmarcan: the "new" clkctrl clocks for omaps use a clockdomain controller + reg offset + gate/mux/divider bit offset, no need to look at any of the old omap54xx-clocks.dtsi stuff for most part
17:06tmlindkettenis: there's a ti specific wrapper ip for each device target on the interconnect that needs to be configured for pm, well the hierarchy also brings genpd stuff for free then
17:07tmlindbut yeah i'd recommend one dts node for a clock controller, then have the binding map the clock instances from that base with offset and optional bits if needed
17:11tmlindthen it's worth checking if each clock controller instance might have some clock domain specific bit for pm for example?
17:12tmlindin any case, don't use any artificial indexing with dts for the instances, makes things hard if you find an extra clock somewhere in between later on :)
17:22odmir_ has joined #asahi
17:46tmlindto me it sounded like you just want #clock-cells = <1>, or <2> if you also need to map bits in a single clock register
17:48raster has quit [Quit: Gettin' stinky!]
17:48tmlindand assigned-clock-parents works just fine for a single node for a clock controller no problem
17:54svento enable access to e.g. the uart mmio region we need to ungate a clock called uart0. but that clock itself is a child of uart_p which is a child of sio which is a child of sio_busif in apple's device tree. if any of the parents are disabled you can't enable the uart0 clock
17:54svenand the question is how and where to encode that toplogy. afaict most drivers just hardcode it in some .c file
17:57choozy has joined #asahi
17:58tmlindyeah so those are on some device that's always powered, probably best to keep it out of the hierarchy, or probe those parts of the hierarchy first
18:01tmlindwell you could just have the clock controller as a top level node, along what's done for gic etc
18:10plainbits has joined #asahi
18:11tmlindhmm so is the clock gate register stuffed somewhre within the uart address space? or is the uart clock gate in some clock controller device with a bunch of clocks?
18:12marcantmlind: it's not about the clock controller itself, it's about encoding the hierarchy of clocks it controls
18:13tmlindyeah ok.. so is the clock controller really a child of the uart or am i missing something?
18:14sventhe clock controller is separate. but the clocks which are children of that controller have a hierarchy
18:15svenso the uart node just gets a clocks = <&clk-controller 25>; or something like that. but that clock with the id 25 needs clock 13 which in turn needs clock 7
18:16tmlindwell you can do the clock tree hierarchy in the clock controller driver, no need to stuff it into dts
18:17marcanif we start hardcoding the tree in the driver, that means the driver becomes soc-specific
18:18tmlindyeah that's where all the drivers are heading though to avoid custom bindings with the logic being the driver needs to understand the hardware :)
18:25marcanbut I would much rather have drivers generic enough that they can work with multiple SoC generations if the register interface and such is the same, so we only need new devicetrees where possible
18:26marcanthe plan is to write some tooling to parse and convert apple devicetrees as a human-guided operation for bringing up new boards and SoCs, but it wouldn't be structured as a straight conversion
18:27marcanmore like a pile of python scripts that can, say, automatically fill in IRQ numbers and clocks and such, but without restricting how our bindings look
18:27tmlindyeah sure. so you're thinking the whole clock hierarchy is there too already in the apple dtb?
18:32sventheir nodes have a "clock-gates" property which indexes into a binary array that's passes as "devices" of the "arm-io/pmgr" node
18:32solarkraft has quit [Ping timeout: 240 seconds]
18:33tmlindwell you could use that to automatically generate the clock controller driver clocks and just expose the top level dts node :)
18:36tmlindyeah that's where linux has been heading good or bad.. see wc -l for drivers/clk and drivers/pinctrl for example
18:37marcanI mean... I don't particularly care about "where linux has been heading" (especially when it's vendor people writing the code) and more about "where linux should head" :-)
18:38tmlindwell one issue is dealing with the sprawling amount of custom bindings, so the binding should be ideally generic, like interrupts-extended for example
18:39tmlindthen some folks do not like the idea of a driver doing something purely based on devicetree data
18:39kettenis_I suppose the reasoning is that since the device tree is bundled with the kernel it doens't matter whether you add the data in the device tree or in the driver
18:39marcanwell, ultimately custom bindings for any given block are pretty much necessary depending on what needs to be expressed, but at least here we were trying to look at ways of expressing this using established patterns
18:40tmlindyeah try to leave out custom bindings, that will save many merge cycles on mailing list discussions :)
18:41marcanand doing this in the DT might mean the difference between a random Ubuntu release booting on newer Macs with just a m1n1 update, and needing to wait a year for a kernel bump
18:41tmlindpersonally, i do not like the ongoing static data bloat in drivers/clk and drivers/pinctrl, and ideally we'd have devicetree provide the necessary data for the booted processor
18:44tmlindsounds like expressing a clock hierarchy in a dts file in a generic way could be few years of mailing list discussions though :)
18:49ephe_meral1 has joined #asahi
18:49kettenis_you still need a small driver to actually set the right bits in the 32-bit clock register
18:52kettenis_as far as we can tell apple has been using the same 32-bit register layout for several enerations of iphones now
18:53kettenis_the only thing that seems to vary is the number of registers (i.e. the number of clocks) and the hierarchy
18:54sventhese clocks are only used to enable access to mmio regions essentially. there are additional clocks that actually have a rate associated with them, which we mostly ignore for now
18:55sven(i think these "clock-ids" clocks are actually mux clocks pre-configured by iboot. but that's an educated guess)
18:56marcankeep in mind there's a power manager core too, I don't know how much of this is real registers and how much is somehow backed by that thing
19:04vimal has quit [Remote host closed the connection]
19:05kettenis_not sure what you mean by this, but the 32-bit clock gate registers are part of a few (two?) larger blocks of mmio space
19:06kettenis_the way corellium implements this you end up mapping a full page for each 32-bit register
19:07vimal has joined #asahi
19:10tmlindso there might be something like a clock controller device, then a bunch of gate or mux registers
19:31odmir_ has quit [Remote host closed the connection]
19:31vimal has quit [Remote host closed the connection]
19:32odmir has joined #asahi
19:35plainbits has quit [Quit: Textual IRC Client: www.textualapp.com]
19:36odmir has quit [Ping timeout: 240 seconds]
19:48vimal has joined #asahi
19:49choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
20:02odmir has joined #asahi
20:07VinDuv has quit [Quit: Leaving.]
20:22radex1 has quit [Quit: WeeChat 3.0]
20:24jeffmiw has quit [Ping timeout: 240 seconds]
20:26artemist has quit [Ping timeout: 276 seconds]
20:27raster has joined #asahi
20:33artemist has joined #asahi
20:36odmir has quit [Ping timeout: 260 seconds]
20:58flying_sausages has quit [Quit: You just lost the game. Peace Out.]
20:59odmir has joined #asahi
21:07jabashque has quit [Quit: Connection closed for inactivity]
21:16raster has quit [Quit: Gettin' stinky!]
21:22ephe_meral1 has quit [Ping timeout: 258 seconds]
21:32odmir has quit [Ping timeout: 240 seconds]
21:43ephe_meral1 has joined #asahi
21:44odmir has joined #asahi
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:01yrlf has joined #asahi
22:05ephe_meral1 has quit [Ping timeout: 240 seconds]
22:06klaus has quit [Ping timeout: 268 seconds]
22:18odmir has quit [Ping timeout: 268 seconds]
22:19klaus has joined #asahi
22:26klaus has quit [Ping timeout: 252 seconds]
22:29odmir has joined #asahi
22:35WhyNotHugoDoes wifi work on the M1? Would existing wifi drivers work if Apple stuck to the same components?
22:53klaus has joined #asahi
22:54troseman has joined #asahi
23:02odmir has quit [Ping timeout: 240 seconds]
23:02troseman_ has joined #asahi
23:02klaus has quit [Ping timeout: 265 seconds]
23:03odmir has joined #asahi
23:05troseman has quit [Ping timeout: 240 seconds]
23:21klaus has joined #asahi
23:26klaus has quit [Ping timeout: 260 seconds]
23:40klaus has joined #asahi
23:48klaus has quit [Ping timeout: 240 seconds]