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

Added support for MSI GT 1030 LP #19

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions GPUSensors/NouveauSensors/gp100.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ bool gp100_identify(struct nouveau_device *device)
device->cname = "GP107";
break;

case 0x138:
case 0x13b:
device->cname = "GP108";
break;
Expand Down
11 changes: 11 additions & 0 deletions GPUSensors/RadeonSensors/RadeonSensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ bool RadeonSensors::managedStart(IOService *provider)
!strncasecmp("HAINAN", card.bios_name, 64)) {
card.int_thermal_type = THERMAL_TYPE_SI;
}
else if (!strncasecmp("POLARIS", card.bios_name, 64)) {
card.int_thermal_type = THERMAL_TYPE_PL;
}
}

// Use driver's configuration to resolve temperature sensor type
Expand Down Expand Up @@ -284,6 +287,10 @@ bool RadeonSensors::managedStart(IOService *provider)
card.int_thermal_type = THERMAL_TYPE_CI;
break;

case CHIP_FAMILY_POLARIS:
card.int_thermal_type = THERMAL_TYPE_PL;
break;

case CHIP_FAMILY_KAVERI:
case CHIP_FAMILY_KABINI:
card.int_thermal_type = THERMAL_TYPE_KV;
Expand Down Expand Up @@ -319,6 +326,10 @@ bool RadeonSensors::managedStart(IOService *provider)
card.get_core_temp = ci_get_temp;
radeon_info(&card, "adding Sea Islands (CI) thermal sensor\n");
break;
case THERMAL_TYPE_PL:
card.get_core_temp = pl_get_temp;
radeon_info(&card, "adding Arctic Islands (Polaris) thermal sensor\n");
break;
case THERMAL_TYPE_KV:
card.get_core_temp = kv_get_temp;
radeon_info(&card, "adding Sea Islands (Kaveri) thermal sensor\n");
Expand Down
19 changes: 19 additions & 0 deletions GPUSensors/RadeonSensors/cik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ int ci_get_temp(struct radeon_device *rdev)
return actual_temp;
}

/* get temperature in millidegrees */
int pl_get_temp(struct radeon_device *rdev)
{
u32 temp;
int actual_temp = 0;

temp = (RREG32_IND(CG_MULT_THERMAL_STATUS) & CTF_TEMP_MASK) >>
CTF_TEMP_SHIFT;

if (temp & 0x200)
actual_temp = 255;
else
actual_temp = temp & 0x1ff;

//actual_temp = actual_temp * 1000;

return actual_temp;
}

/* get temperature in millidegrees */
int kv_get_temp(struct radeon_device *rdev)
{
Expand Down
17 changes: 17 additions & 0 deletions GPUSensors/RadeonSensors/cik.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@
#include "radeon.h"

#define RREG32_SMC(reg) tn_smc_rreg(rdev, (reg))
#define RREG32_IND(reg) mm_smc_rreg(rdev, (reg))
#define TN_SMC_IND_INDEX_0 0x200
#define TN_SMC_IND_DATA_0 0x204
#define MM_SMC_IND_INDEX_11 (0x1AC * 4)
#define MM_SMC_IND_DATA_11 (0x1AD * 4)

static inline u32 tn_smc_rreg(struct radeon_device *rdev, u32 reg)
{
Expand All @@ -56,8 +59,22 @@ static inline u32 tn_smc_rreg(struct radeon_device *rdev, u32 reg)
return r;
}

static inline u32 mm_smc_rreg(struct radeon_device *rdev, u32 reg)
{
//unsigned long flags;
u32 r;

//spin_lock_irqsave(&rdev->smc_idx_lock, flags);
WREG32(MM_SMC_IND_INDEX_11, (reg));
r = RREG32(MM_SMC_IND_DATA_11);

//spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
return r;
}


int ci_get_temp(struct radeon_device *rdev);
int pl_get_temp(struct radeon_device *rdev);
int kv_get_temp(struct radeon_device *rdev);

#endif
1 change: 1 addition & 0 deletions GPUSensors/RadeonSensors/radeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum radeon_int_thermal_type {
THERMAL_TYPE_SI,
THERMAL_TYPE_EMC2103_WITH_INTERNAL,
THERMAL_TYPE_CI,
THERMAL_TYPE_PL,
THERMAL_TYPE_KV,
};

Expand Down
2 changes: 2 additions & 0 deletions GPUSensors/RadeonSensors/radeon_chipinfo_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -700,4 +700,6 @@ static RADEONCardInfo RADEONCards[] = {
{ 0x67B9, CHIP_FAMILY_HAWAII, 0, 0, 0, 0, 0 },
{ 0x67BA, CHIP_FAMILY_HAWAII, 0, 0, 0, 0, 0 },
{ 0x67BE, CHIP_FAMILY_HAWAII, 0, 0, 0, 0, 0 },
{ 0x67EF, CHIP_FAMILY_POLARIS, 0, 0, 0, 0, 0 },
{ 0x67DF, CHIP_FAMILY_POLARIS, 0, 0, 0, 0, 0 },
};
1 change: 1 addition & 0 deletions GPUSensors/RadeonSensors/radeon_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ enum radeon_family {
CHIP_FAMILY_KAVERI,
CHIP_FAMILY_KABINI,
CHIP_FAMILY_HAWAII,
CHIP_FAMILY_POLARIS,
CHIP_FAMILY_MULLINS,
CHIP_FAMILY_LAST
};
Expand Down