Page MenuHomeFreeBSD

amdsmu: Add Krackan Point support
ClosedPublic

Authored by thj on Fri, Apr 24, 1:07 PM.
Tags
None
Referenced Files
F156704662: D56619.diff
Fri, May 15, 7:24 PM
Unknown Object (File)
Thu, May 14, 10:38 AM
Unknown Object (File)
Thu, May 14, 9:12 AM
Unknown Object (File)
Wed, May 13, 7:27 PM
Unknown Object (File)
Wed, May 13, 4:26 PM
Unknown Object (File)
Wed, May 13, 4:11 PM
Unknown Object (File)
Tue, May 12, 1:11 PM
Unknown Object (File)
Mon, May 11, 4:12 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

thj requested review of this revision.Fri, Apr 24, 1:07 PM

The difference for Kracken Point is bit 0x400; I wonder if this can be a bit more clear (rather than constants directly in the table).

(A few moments later) Looks like Linux just has 0x538 / 0x938 inline, so ๐Ÿคทโ€โ™€๏ธ

couple of whitespace oddities but otherwise lgtm

sys/dev/amdsmu/amdsmu.h
28โ€“29
sys/dev/amdsmu/amdsmu_reg.h
38

Linux driver calls these PMC Scratch Registers. It'd be nice if AMD provided a permissively licensed header for these defines.

This revision is now accepted and ready to land.Fri, Apr 24, 2:07 PM

this is PCI_DEVICE_ID_AMD_1AH_M60H_ROOT in the linux driver, which selects the following case for choosing the IP blocks array:

	case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT:
		if (boot_cpu_data.x86_model == 0x70) {
			dev->num_ips = ARRAY_SIZE(soc15_ip_blk_v2);
			dev->ips_ptr = soc15_ip_blk_v2;
		} else {
			dev->num_ips = ARRAY_SIZE(soc15_ip_blk);
			dev->ips_ptr = soc15_ip_blk;
		}
		dev->smu_msg = 0x938;
		break;
	}

So we should ideally have a warning for when the CPU model is 0x70 for now, and then add this second array and support for this when the time comes where someone runs this on a 0x70 machine

sys/dev/amdsmu/amdsmu.h
28โ€“29

could we make these values SMU_REG_MSG_{PHOENIX,KRACKAN} #defines respectively, just to keep consistency with the fact the idlemask registers are #defines?

thj marked an inline comment as done.Mon, Apr 27, 8:48 AM
This revision now requires review to proceed.Mon, Apr 27, 8:48 AM
sys/dev/amdsmu/amdsmu.h
36โ€“37

The one with 25 IP blocks is actually a different list on Linux (soc15_ip_blk_v2). We should probably also have a pointer to either soc15_ip_blk{,_v2} in struct amdsmu_product. I or you can do this in a separate commit though:

static const struct amd_pmc_bit_map soc15_ip_blk_v2[] = {
	{"DISPLAY",     BIT(0)},
	{"CPU",         BIT(1)},
	{"GFX",         BIT(2)},
	{"VDD",         BIT(3)},
	{"VDD_CCX",     BIT(4)},
	{"ACP",         BIT(5)},
	{"VCN_0",       BIT(6)},
	{"VCN_1",       BIT(7)},
	{"ISP",         BIT(8)},
	{"NBIO",        BIT(9)},
	{"DF",          BIT(10)},
	{"USB3_0",      BIT(11)},
	{"USB3_1",      BIT(12)},
	{"LAPIC",       BIT(13)},
	{"USB3_2",      BIT(14)},
	{"USB4_RT0",	BIT(15)},
	{"USB4_RT1",	BIT(16)},
	{"USB4_0",      BIT(17)},
	{"USB4_1",      BIT(18)},
	{"MPM",         BIT(19)},
	{"JPEG_0",      BIT(20)},
	{"JPEG_1",      BIT(21)},
	{"IPU",         BIT(22)},
	{"UMSCH",       BIT(23)},
	{"VPE",         BIT(24)},
};
sys/dev/amdsmu/amdsmu.h
36โ€“37

No worries, I was being naive the driver. I can add this

Handle ip block names being different on model 0x70 cpus

This revision is now accepted and ready to land.Wed, Apr 29, 2:47 PM
This revision was automatically updated to reflect the committed changes.