Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPFS clock fixes required for correct CAN clock modeling #501

Closed
wants to merge 7 commits into from

Conversation

bjoto
Copy link

@bjoto bjoto commented Jan 22, 2024

Pull request for series with
subject: MPFS clock fixes required for correct CAN clock modeling
version: 2
url: https://patchwork.kernel.org/project/linux-riscv/list/?series=818603

@bjoto
Copy link
Author

bjoto commented Jan 22, 2024

Upstream branch: e5075d8
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818603
version: 2

@bjoto
Copy link
Author

bjoto commented Jan 22, 2024

Upstream branch: 3a6dd5f
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818603
version: 2

@bjoto
Copy link
Author

bjoto commented Jan 23, 2024

Upstream branch: e2d6b54
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818603
version: 2

@bjoto bjoto closed this Jan 24, 2024
@bjoto bjoto reopened this Jan 24, 2024
@bjoto
Copy link
Author

bjoto commented Jan 24, 2024

Upstream branch: e2d6b54
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818603
version: 2

There are 3 undocumented outputs of the MSSPLL that are used for the CAN
bus, "user crypto" module and eMMC. Add their clock IDs so that they can
be hooked up in DT.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
The CAN controller on PolarFire SoC has an AHB peripheral clock _and_ a
CAN bus clock. The bus clock was omitted when the binding was written,
but is required for operation. Make up for lost time and add it.

Cautionary tale in adding bindings without having implemented a real
user for them perhaps.

Fixes: c878d51 ("dt-bindings: can: mpfs: document the mpfs CAN controller")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
The MSSPLL is really two stages - there's the PLL itself and 4 outputs,
each with their own divider. The current driver models this as a single
entity, outputting a single clock, used for both the CPU and AHB/AXI
buses. The other 3 outputs are used for the eMMC, "user crypto" and CAN
controller. Split the MSSPLL in two, as a precursor to adding support
for the other 3 outputs, with the PLL itself as one "hw" clock and the
output divider stage as another.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Now that the MSSPLL is split, and the "postdiv" divider of the
cpu/AHB/AXI bus clock is represented by its own "hw" struct, make the
shifts, register offset and width a parameter of the initialisation
macro, rather than using defines that only work for one of the four
outputs.
Configuring this at initialisaion paves the way for using the other
three output clocks, where the register offset, and the bit shift
within that register, will differ.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
@bjoto
Copy link
Author

bjoto commented Jan 25, 2024

Upstream branch: cb4ede9
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=818603
version: 2

The MSSPLL has 4 outputs, of which only the cpu/axi/ahb clock parent is
currently implemented.
Add the CAN clock too, as that'll be needed by the driver for the CAN
controller and uses output 3.
While we are here, the other two missing clocks, used by the eMMC/SD
controller and by the "user crypto".

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
After splitting the MSSPLL in two, the PLL outputs have become
open-coded versions of clk_divider. Drop the custom clk ops structs, and
instead use the generic clk_divider_ops.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
The CAN controller on PolarFire SoC has an AHB peripheral clock _and_ a
CAN bus clock. The bus clock was omitted when the binding was written,
but is required for operation. Make up for lost time and add to the DT.

Fixes: 38a71fc ("riscv: dts: microchip: add mpfs's CAN controllers")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
@bjoto
Copy link
Author

bjoto commented Feb 6, 2024

At least one diff in series https://patchwork.kernel.org/project/linux-riscv/list/?series=818603 irrelevant now. Closing PR.

@bjoto bjoto added the accepted label Feb 6, 2024
@bjoto bjoto closed this Feb 6, 2024
@bjoto bjoto deleted the series/808334=>for-next branch February 6, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants