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

linux/hardware/cpu: add some missing AMD CPUs #18748

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Library/Homebrew/extend/os/linux/hardware/cpu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def family
when "GenuineIntel"
intel_family(cpu_family, cpu_model)
when "AuthenticAMD"
amd_family(cpu_family)
amd_family(cpu_family, cpu_model)
end || unknown
end

Expand Down Expand Up @@ -87,7 +87,7 @@ def intel_family(family, cpu_model)
end
end

def amd_family(family)
def amd_family(family, cpu_model)
case family
when 0x06
:amd_k7
Expand All @@ -106,9 +106,21 @@ def amd_family(family)
when 0x16
:jaguar
when 0x17
:zen
case cpu_model
when 0x10..0x2f
:zen
when 0x30..0x3f, 0x47, 0x60..0x7f, 0x84..0x87, 0x90..0xaf
:zen2
end
when 0x19
:zen3
case cpu_model
when ..0x0f, 0x20..0x5f
:zen3
when 0x10..0x1f, 0x60..0x7f, 0xa0..0xaf
:zen4
end
when 0x1a
:zen5
end
end

Expand Down
10 changes: 10 additions & 0 deletions Library/Homebrew/test/hardware/cpu_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
describe "::family" do
let(:cpu_families) do
[
:alderlake,
:amd_k7,
:amd_k8,
:amd_k8_k10_hybrid,
Expand All @@ -38,6 +39,7 @@
:arm_twister,
:arm_typhoon,
:arm_vortex_tempest,
:arrowlake,
:atom,
:bobcat,
:broadwell,
Expand All @@ -47,22 +49,30 @@
:core,
:core2,
:dothan,
:graniterapids,
:haswell,
:icelake,
:ivybridge,
:jaguar,
:kabylake,
:merom,
:nehalem,
:pantherlake,
:penryn,
:ppc,
:prescott,
:presler,
:rocketlake,
:sandybridge,
:sapphirerapids,
:skylake,
:tigerlake,
:westmere,
:zen,
:zen2,
:zen3,
:zen4,
:zen5,
:dunno,
]
end
Expand Down
Loading