Skip to content

Fix CPU and CPU-NB frequency reporting for early fam15h CPUs#34

Merged
kevinlekiller merged 1 commit intokevinlekiller:masterfrom
ermo:fam15h-fix
Mar 5, 2022
Merged

Fix CPU and CPU-NB frequency reporting for early fam15h CPUs#34
kevinlekiller merged 1 commit intokevinlekiller:masterfrom
ermo:fam15h-fix

Conversation

@ermo
Copy link
Copy Markdown
Contributor

@ermo ermo commented Mar 5, 2022

Add output of registers used for voltage and frequency on fam15h.

Change the REFCLK variable to be a read-only static variable so the
compiler will complain if an attempt is made to re-assign it.

REFCLK = 200 was erroneously used in CPU frequency calculations, where
the correct formula for fam15h is:

100 * (CpuFid + 0x10h) >> CpuDid

REFCLK = 400 was erroneously used in CPU-NB frequency calculations,
where the correct formula for fam15h is:

200 * (nbdid + 0x4) >> nbfid)

Fixes #33

Add output of registers used for voltage and frequency on fam15h.

Change the REFCLK variable to be a read-only static variable so the
compiler will complain if an attempt is made to re-assign it.

REFCLK = 200 was erroneously used in CPU frequency calculations, where
the correct formula for fam15h is:

`100 * (CpuFid + 0x10h) >> CpuDid`

REFCLK = 400 was erroneously used in CPU-NB frequency calculations,
where the correct formula for fam15h is:

`200 * (nbdid + 0x4) >> nbfid)`
@kevinlekiller
Copy link
Copy Markdown
Owner

Nice work!

I think math.h (and linking math in cmake / makefile) is not required anymore without the pow on line 363.

@kevinlekiller kevinlekiller merged commit a4f5907 into kevinlekiller:master Mar 5, 2022
kevinlekiller pushed a commit that referenced this pull request Mar 5, 2022
@ermo ermo deleted the fam15h-fix branch March 5, 2022 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FX-8350 CPU P-state frequencies are doubled, but CPU-NB frequencies are correctly listed?

2 participants