Repository navigation
clk, arm64: dts: zuma: HSI0 USI3 clocks and a disabled spi21 (the 8 Pro's GNSS bus) - #210
Conversation
|
@derekross I booted the USI3 bus on my 8 Pro to see that the clocks and the spi21 node from this PR actually come up on real hardware. Short version: they do, and nothing broke. Longer version below so it's clear what this does and doesn't show. What I booted: an older test kernel of mine (7.3-rc6), not built from this branch. It carries an older version of the same clocks and spi21 node as #210 (my older clock IDs, not this exact code), and I used an overlay to switch spi21 on, since in the PR it's disabled. So this is evidence that the approach works, not a test of these exact commits. I haven't booted the branch itself. What I saw:
One side effect to know about: bus numbers shift when spi21 probes. It came up as spi1 and the amps' bus moved from spi1 to spi2. Nothing broke that I saw, but if some code or config names an SPI bus by number, that's where it would show up. Why I'm doing this: spi21 is the bus of the 8 Pro's GNSS chip (a BCM4775x), and your bcm4775x driver and binding are already here. This PR is the first of three small steps (the bus, the PMIC rails in #211, then the gnss node itself). The GNSS chip stayed powered off the whole time, so all this shows is the bus and its clocks. |
|
Thank you, @Somnius. I checked everything against Google's tables. The mux at 0x1020, the divider at 0x1820 (four bits), and the gates at 0x2124, 0x2104 and 0x2108 match Your questions: IDs 11 to 15 are fine, nothing else open adds HSI0 IDs. And one PR for the clocks and the node is fine too, like #199 and #200. Two optional nits: the files' history uses On the bus numbers: nothing in our trees names an SPI bus by number, so it's fine. If the audio package ever needs a stable name, aliases in the board file would pin them. Thanks, a tidy first step for GNSS. |
The Pixel 8 Pro's GNSS receiver sits on HSI0 USI3 (Google's spi_21). Add the IDs for its mux, divider and the three gates, in the same shape as USI2's, after USI2's IDs. Only the header; the clock driver follows. Signed-off-by: Lef <me@lefteros.com>
Add the USI3 mux, divider and gates next to USI2's, with the same shape, parents and flags, so a spi21 node can take its clocks. The registers are Google's, from the zuma CMU_HSI0 tables: the mux CLK_CON_MUX_MUX_CLK_HSI0_USI3 at 0x1020, the divider CLK_CON_DIV_DIV_CLK_HSI0_USI3 at 0x1820, the source gate CLK_CON_GAT_GATE_CLK_HSI0_USI3 at 0x2124, the IP clock gate at 0x2104 and the PCLK gate at 0x2108, bit 21 as for USI2. CLK_IGNORE_UNUSED keeps the gates as the bootloader left them until a spi21 node is enabled; nothing consumes them in the default device tree. The three gate registers join hsi0_regs, as USI2's did. As for USI2, the divider is not in that list and the RSTNSYNC gate is not described. Built, not booted. Signed-off-by: Lef <me@lefteros.com>
A USI wrapper and the SPI controller under it for HSI0 USI3 (Google's spi_21, the Pixel 8 Pro's GNSS receiver bus), laid out like USI2 and its spi20. Both are status = "disabled", so nothing changes for any board that includes zuma.dtsi until one enables them. Values are from Google's zuma USI tables and the stock device tree (one node at 0x111e0000, split here at 0xc0 like spi20): USI registers 0x111e00c0 and SPI registers 0x111e0000, interrupt GIC SPI 409, USI sysreg offset 0x1020. No DMA, no power domain and no pin group, as for spi20: stock's spi_21 has no pin group either. Built, not booted. Signed-off-by: Lef <me@lefteros.com>
89bf3bc to
dd79ff0
Compare
|
@derekross thanks for checking all the numbers against Google's tables. I took both nits. The header commit is now #200 landed and touched the lines next to mine in Checkpatch --strict is clean on all three commits and the husky and akita DTBs and clk-zuma.o build with W=1 and no warnings. In the decompiled DTBs usi3_hsi0 and spi21 are there and disabled on both boards. Mux, divider and gate offsets are the same as before. I haven't booted this rebased branch, only built it. |
|
@Somnius thank you, both prefixes are fixed, and the rebase over #200 keeps both header blocks exactly as they should be: PERIC0's 22 to 27 in the CMU_TOP list and your HSI0 11 to 15, with no shared numbers. The range-diff shows nothing else changed. Our gate passes on today's On "built, not booted": I looked at the test tree you booted on 11-07 ( It's still a draft. When you mark it ready (or tell me it's ready as it is), I'll merge it. It doesn't depend on #209 either way. |
|
@derekross thanks for going through the e98a7 tree against this head. It's ready as it is, so please merge it when you can. I'm leaving out the extra sentence in the DT commit, to avoid another force-push for an optional nit. The "built, not booted" part stays as I wrote it: the boot evidence is from the e98a7 kernel that you compared. Next for GNSS I'll base the node on #187's branch once the rebase is in, as agreed on #156. |
|
Thank you, @Somnius. That's fine about the sentence: the evidence is here in the thread, and |
This adds the clocks and the SPI controller for CMU_HSI0 USI3, which is the bus of the Pixel 8 Pro's GNSS receiver (a BCM4775x, Google's spi_21). It's the first step for GNSS on the 8 Pro: @derekross's bcm4775x driver and binding and @W4HO-ham's S2MPG15 regulators are already here, and what's missing is this bus, the PMIC node for the GNSS rails and the gnss node.
Three commits: the clock IDs in the binding header, the clocks in clk-zuma.c, and usi3_hsi0 with spi21 in zuma.dtsi. All of it copies the USI2 pattern (spi20), with the registers from Google's tables: mux 0x1020, divider 0x1820, gates 0x2124, 0x2104 and 0x2108. The nodes are disabled, so zuma-husky and zuma-akita should be unchanged, and I checked in both decompiled dtbs that usi3_hsi0 and spi21 are disabled. The gates are CLK_IGNORE_UNUSED like USI2's.
I numbered the new IDs 11 to 15 on top of upstream, since nothing here uses USI1. My own USI1 clocks (the amps' spi19) aren't upstream, so whichever lands second takes the next free IDs.
Tested: it builds with W=1 (clk-zuma.o and the husky and akita dtbs) and checkpatch is clean. I haven't booted this branch. An older local version of the same clocks (with different IDs, on my older tree) has been in kernels I booted on my 8 Pro, and clk_summary listed all five USI3 clocks (the mux, the source gate, the divider, the IP gate and the PCLK gate) with nothing enabled, and dmesg has no warning or error mentioning hsi0 or usi3, but that's not this exact code. Nothing talks to the GNSS chip yet.
@derekross, two things I'd like your view on: are IDs 11 to 15 fine for USI3, and do you want this as one PR like this or as separate clock and dts PRs? Same as USI2, the divider isn't in the suspend list and the RSTNSYNC gate isn't described, I left that alone.