From nobody Fri Apr 05 18:20:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VB6Gq1jFcz5GwZM; Fri, 5 Apr 2024 18:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VB6Gq14Wcz4gBV; Fri, 5 Apr 2024 18:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712341219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yo18G6roqdOQI0w0pIgHuAK/9cs/PGaiavtB7PPJGNQ=; b=pZZEFvi76+o4NNzYWS/RWuIIln2FhkFzJ7xzJOx4rfg2Cpa/aubO7EzXhhoPnJzJPDCF93 xAhnIlb+GPqe6YNXHEmR8uGn9ov6BYznbHjs5BpBfrbCgFNIktbRAfXRdOgjxtsZBFDiTa Ch/FgZ/OOdDQSkGZ3EZEyXpZosXoNYbbEzSYXKIPHOr0YslATKR3BvfSbvNcLmvCO/sLw6 eYJjoSg3XXC7e1Tsp/V9l9Jnv3nKTjBVg6a+Jgh9KMKmmtzj6DeySBdDWMp5NImB1tEB28 scLSraPkb+4tWIS/dhnPRyVvwHNelsBtjREtu9i2cujC06pOPCWl2bR2xk63Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712341219; a=rsa-sha256; cv=none; b=NZmo2tJVzqgschan7V85Ff2Snoi1t/UgLUDoi73/rCh2oKsfyk03vbFe9DOCU0GN1lNuZb bU+hq0fZwNeCSPo9sghB03LQZcPIc96hJEcNeVJcnGvgXH+gp9aOehpFKhj/oH4Bcdd3fm XT8UwBz9+JETCY2IBB6J3C5xNntJYnI51T/PYrlpCfxrH/rmV6ROdEtJsDUb9HhTy6Kohc 7JvSNTJ2uU+McfKB7EO0je1OE410acmRTvJ1EmBUKMCqBrw9nHrkM6bDprU2yE5spNVLuq qBEhY9+x7l1KOfc1+emHBawnRjqZvzyAhrV2uzQddpT5rVttP6gzpAEuzuOTAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712341219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yo18G6roqdOQI0w0pIgHuAK/9cs/PGaiavtB7PPJGNQ=; b=ag2sK87qF7AzOxxTgZpkrj3pjRShvUvTgXyLHCWZomA9Ctlz3IIXgEPDDywQA1jdRbort4 dPS1TNEaGNT6Y6MKMRhSox9jAb//3SZb9KMt4PmtrjkX7pX38RoJz5xEwd3+3jG+wvWzM0 +Lup89nDKGCwbT30DuBLjUhcn/olCHjkBlGQzl0vTDo/9T/aagzu6BB3CH6hG0D7wRY1a+ EGOmXcvjjui4zSc3V45c/+s4FLYkrJMnXSTdNqNQWxP7jlry8Qt24ENSmjosPdz/kRH88u 5DPpB93iUFUkDelAzDGdxa9QVJBKjzvjRY6ndWo1dxqwEIh40vOSiXffkTvSkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VB6Gq0Ffyz19PR; Fri, 5 Apr 2024 18:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 435IKI19093961; Fri, 5 Apr 2024 18:20:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 435IKIOb093958; Fri, 5 Apr 2024 18:20:18 GMT (envelope-from git) Date: Fri, 5 Apr 2024 18:20:18 GMT Message-Id: <202404051820.435IKIOb093958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: da2b732288c7 - main - arm64: add CPU part identifiers for Apple M1 and M2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da2b732288c72b347b128e1fa9a169c7bba3beb8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=da2b732288c72b347b128e1fa9a169c7bba3beb8 commit da2b732288c72b347b128e1fa9a169c7bba3beb8 Author: Lexi Winter AuthorDate: 2024-03-23 16:18:24 +0000 Commit: Mark Johnston CommitDate: 2024-04-05 18:18:32 +0000 arm64: add CPU part identifiers for Apple M1 and M2 Part numbers are sourced from Linux (arch/arm64/include/asm/cputype.h). MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1144 --- sys/arm64/arm64/identcpu.c | 19 ++++++++++++++++++- sys/arm64/include/cpu.h | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index c93b1292aca1..01b434fd4f47 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -250,6 +250,23 @@ static const struct cpu_parts cpu_parts_qcom[] = { CPU_PART_NONE, }; +/* Apple */ +static const struct cpu_parts cpu_parts_apple[] = { + { CPU_PART_M1_ICESTORM, "M1 Icestorm" }, + { CPU_PART_M1_FIRESTORM, "M1 Firestorm" }, + { CPU_PART_M1_ICESTORM_PRO, "M1 Pro Icestorm" }, + { CPU_PART_M1_FIRESTORM_PRO, "M1 Pro Firestorm" }, + { CPU_PART_M1_ICESTORM_MAX, "M1 Max Icestorm" }, + { CPU_PART_M1_FIRESTORM_MAX, "M1 Max Firestorm" }, + { CPU_PART_M2_BLIZZARD, "M2 Blizzard" }, + { CPU_PART_M2_AVALANCHE, "M2 Avalanche" }, + { CPU_PART_M2_BLIZZARD_PRO, "M2 Pro Blizzard" }, + { CPU_PART_M2_AVALANCHE_PRO, "M2 Pro Avalanche" }, + { CPU_PART_M2_BLIZZARD_MAX, "M2 Max Blizzard" }, + { CPU_PART_M2_AVALANCHE_MAX, "M2 Max Avalanche" }, + CPU_PART_NONE, +}; + /* Unknown */ static const struct cpu_parts cpu_parts_none[] = { CPU_PART_NONE, @@ -260,7 +277,7 @@ static const struct cpu_parts cpu_parts_none[] = { */ const struct cpu_implementers cpu_implementers[] = { { CPU_IMPL_AMPERE, "Ampere", cpu_parts_none }, - { CPU_IMPL_APPLE, "Apple", cpu_parts_none }, + { CPU_IMPL_APPLE, "Apple", cpu_parts_apple }, { CPU_IMPL_APM, "APM", cpu_parts_apm }, { CPU_IMPL_ARM, "ARM", cpu_parts_arm }, { CPU_IMPL_BROADCOM, "Broadcom", cpu_parts_none }, diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 3057d97a8f69..995be1c96d77 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -132,6 +132,20 @@ #define CPU_PART_KRYO400_GOLD 0x804 #define CPU_PART_KRYO400_SILVER 0x805 +/* Apple part numbers */ +#define CPU_PART_M1_ICESTORM 0x022 +#define CPU_PART_M1_FIRESTORM 0x023 +#define CPU_PART_M1_ICESTORM_PRO 0x024 +#define CPU_PART_M1_FIRESTORM_PRO 0x025 +#define CPU_PART_M1_ICESTORM_MAX 0x028 +#define CPU_PART_M1_FIRESTORM_MAX 0x029 +#define CPU_PART_M2_BLIZZARD 0x032 +#define CPU_PART_M2_AVALANCHE 0x033 +#define CPU_PART_M2_BLIZZARD_PRO 0x034 +#define CPU_PART_M2_AVALANCHE_PRO 0x035 +#define CPU_PART_M2_BLIZZARD_MAX 0x038 +#define CPU_PART_M2_AVALANCHE_MAX 0x039 + #define CPU_IMPL(midr) (((midr) >> 24) & 0xff) #define CPU_PART(midr) (((midr) >> 4) & 0xfff) #define CPU_VAR(midr) (((midr) >> 20) & 0xf)