drivers/gpu/drm/amd/amdgpu/smuio_v13_0_3.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/smuio_v13_0_3.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/smuio_v13_0_3.c- Extension
.c- Size
- 2957 bytes
- Lines
- 110
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
amdgpu.hsmuio_v13_0_3.hsoc15_common.hsmuio/smuio_13_0_3_offset.hsmuio/smuio_13_0_3_sh_mask.h
Detected Declarations
function filesfunction smuio_v13_0_3_get_socket_idfunction smuio_v13_0_3_get_pkg_type
Annotated Snippet
#include "amdgpu.h"
#include "smuio_v13_0_3.h"
#include "soc15_common.h"
#include "smuio/smuio_13_0_3_offset.h"
#include "smuio/smuio_13_0_3_sh_mask.h"
#define PKG_TYPE_MASK 0x00000003L
/**
* smuio_v13_0_3_get_die_id - query die id from FCH.
*
* @adev: amdgpu device pointer
*
* Returns die id
*/
static u32 smuio_v13_0_3_get_die_id(struct amdgpu_device *adev)
{
u32 data, die_id;
data = RREG32_SOC15(SMUIO, 0, regSMUIO_MCM_CONFIG);
die_id = REG_GET_FIELD(data, SMUIO_MCM_CONFIG, DIE_ID);
return die_id;
}
/**
* smuio_v13_0_3_get_socket_id - query socket id from FCH
*
* @adev: amdgpu device pointer
*
* Returns socket id
*/
static u32 smuio_v13_0_3_get_socket_id(struct amdgpu_device *adev)
{
u32 data, socket_id;
data = RREG32_SOC15(SMUIO, 0, regSMUIO_MCM_CONFIG);
socket_id = REG_GET_FIELD(data, SMUIO_MCM_CONFIG, SOCKET_ID);
return socket_id;
}
/**
* smuio_v13_0_3_get_pkg_type - query package type set by MP1/bootcode
*
* @adev: amdgpu device pointer
*
* Returns package type
*/
static enum amdgpu_pkg_type smuio_v13_0_3_get_pkg_type(struct amdgpu_device *adev)
{
enum amdgpu_pkg_type pkg_type;
u32 data;
data = RREG32_SOC15(SMUIO, 0, regSMUIO_MCM_CONFIG);
data = REG_GET_FIELD(data, SMUIO_MCM_CONFIG, PKG_TYPE);
/* pkg_type[4:0]
*
* bit 1 == 1 APU form factor
*
* b0100 - b1111 - Reserved
*/
switch (data & PKG_TYPE_MASK) {
case 0x0:
pkg_type = AMDGPU_PKG_TYPE_CEM;
break;
case 0x1:
pkg_type = AMDGPU_PKG_TYPE_OAM;
break;
case 0x2:
pkg_type = AMDGPU_PKG_TYPE_APU;
break;
default:
pkg_type = AMDGPU_PKG_TYPE_UNKNOWN;
break;
}
return pkg_type;
}
const struct amdgpu_smuio_funcs smuio_v13_0_3_funcs = {
.get_die_id = smuio_v13_0_3_get_die_id,
.get_socket_id = smuio_v13_0_3_get_socket_id,
.get_pkg_type = smuio_v13_0_3_get_pkg_type,
};
Annotation
- Immediate include surface: `amdgpu.h`, `smuio_v13_0_3.h`, `soc15_common.h`, `smuio/smuio_13_0_3_offset.h`, `smuio/smuio_13_0_3_sh_mask.h`.
- Detected declarations: `function files`, `function smuio_v13_0_3_get_socket_id`, `function smuio_v13_0_3_get_pkg_type`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.