Page MenuHomeFreeBSD

prci: register the DDR and GEMGX PLLs
ClosedPublic

Authored by mhorne on Jan 28 2020, 7:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 16 2024, 8:20 AM
Unknown Object (File)
Mar 16 2024, 8:20 AM
Unknown Object (File)
Mar 16 2024, 8:20 AM
Unknown Object (File)
Mar 16 2024, 8:20 AM
Unknown Object (File)
Mar 16 2024, 8:08 AM
Unknown Object (File)
Mar 14 2024, 1:01 PM
Unknown Object (File)
Mar 7 2024, 2:28 PM
Unknown Object (File)
Feb 14 2024, 5:40 PM
Subscribers

Details

Summary

The PRCI module exports three PLLs. Currently only the coreclk/corepll
is registered, so add the logic to register the DDR (memory) and GEMGX
(ethernet) clocks as well.

See also: Chapter 7 of the FU540 manual.

Test Plan

I have booted this with the qemu "sifive_u" platform, and dmesg shows
that the clocks are registered. I would prefer this set of changes be
tested on a real SiFive Unleashed though.

Sysctl output showing the new PLLs:

dev.fu540prci.0.clocks: coreclk ddrclk gemgxclk tlclk 
...
hw.clock.gemgxclk.enable_cnt: 0
hw.clock.gemgxclk.childrens: 
hw.clock.gemgxclk.parents: hfclk rtcclk 
hw.clock.gemgxclk.parent: hfclk
hw.clock.gemgxclk.frequency: 0
hw.clock.ddrclk.enable_cnt: 0
hw.clock.ddrclk.childrens: 
hw.clock.ddrclk.parents: hfclk rtcclk 
hw.clock.ddrclk.parent: hfclk
hw.clock.ddrclk.frequency: 0

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

At first glance this looks good.
I have a SiFive FU540 I can test with tomorrow.

I only implemented the core clock because it feeds the SPI / UART / I2C clocks. The DDR and gigabit ethernet clocks were not relevant.

mhorne edited the test plan for this revision. (Show Details)
In D23404#513349, @kp wrote:

At first glance this looks good.
I have a SiFive FU540 I can test with tomorrow.

I only implemented the core clock because it feeds the SPI / UART / I2C clocks. The DDR and gigabit ethernet clocks were not relevant.

Thanks. They will still be unused/irrelevant at present, but my thinking is that it is useful to have so we can eventually set the cgem's reference clock.

Fix DDR and GEMGX clock IDs

In D23404#513349, @kp wrote:

At first glance this looks good.
I have a SiFive FU540 I can test with tomorrow.

I only implemented the core clock because it feeds the SPI / UART / I2C clocks. The DDR and gigabit ethernet clocks were not relevant.

Thanks. They will still be unused/irrelevant at present, but my thinking is that it is useful to have so we can eventually set the cgem's reference clock.

Having looked at D23406 it makes even more sense why we'd want to add these. I'm making a build with all of your patches right now so I can test on my board. I don't expect any issues, they all look good.

This patch series is happy on my SiFive FU540 board, and I'm happy with the patches.

This revision is now accepted and ready to land.Jan 29 2020, 2:47 PM
This revision was automatically updated to reflect the committed changes.