[coreboot-gerrit] Change in coreboot[master]: mb: Replace AMD's MSR addresses with macros

Elyes HAOUAS (Code Review) gerrit at coreboot.org
Fri Oct 12 12:31:05 CEST 2018


Elyes HAOUAS has uploaded this change for review. ( https://review.coreboot.org/29069


Change subject: mb: Replace AMD's MSR addresses with macros
......................................................................

mb: Replace AMD's MSR addresses with macros

Change-Id: I020431ba8eb61f5ce256088b919c049985331d64
Signed-off-by: Elyes HAOUAS <ehaouas at noos.fr>
---
M src/mainboard/amd/thatcher/mainboard.c
M src/mainboard/asus/f2a85-m/mainboard.c
M src/mainboard/msi/ms7721/mainboard.c
3 files changed, 21 insertions(+), 18 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/29069/1

diff --git a/src/mainboard/amd/thatcher/mainboard.c b/src/mainboard/amd/thatcher/mainboard.c
index ca62c2c..ef8f9c1 100644
--- a/src/mainboard/amd/thatcher/mainboard.c
+++ b/src/mainboard/amd/thatcher/mainboard.c
@@ -16,6 +16,7 @@
 #include <console/console.h>
 #include <device/device.h>
 #include <cpu/x86/msr.h>
+#include <cpu/amd/msr.h>
 
 /*************************************************
  * enable the dedicated function in thatcher board.
@@ -26,18 +27,18 @@
 
 	printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
 
-	msr = rdmsr(0xC0011020);
+	msr = rdmsr(LS_CFG_MSR);
 	msr.lo &= ~(1 << 28);
-	wrmsr(0xC0011020, msr);
+	wrmsr(LS_CFG_MSR, msr);
 
-	msr = rdmsr(0xC0011022);
+	msr = rdmsr(DC_CFG_MSR);
 	msr.lo &= ~(1 << 4);
 	msr.lo &= ~(1 << 13);
-	wrmsr(0xC0011022, msr);
+	wrmsr(DC_CFG_MSR, msr);
 
-	msr = rdmsr(0xC0011023);
+	msr = rdmsr(BU_CFG_MSR);
 	msr.lo &= ~(1 << 23);
-	wrmsr(0xC0011023, msr);
+	wrmsr(BU_CFG_MSR, msr);
 }
 
 struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/asus/f2a85-m/mainboard.c b/src/mainboard/asus/f2a85-m/mainboard.c
index 09645f3..2a0e618 100644
--- a/src/mainboard/asus/f2a85-m/mainboard.c
+++ b/src/mainboard/asus/f2a85-m/mainboard.c
@@ -15,6 +15,7 @@
 
 #include <console/console.h>
 #include <cpu/x86/msr.h>
+#include <cpu/amd/msr.h>
 #include <device/device.h>
 
 /*************************************************
@@ -26,18 +27,18 @@
 
 	printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
 
-	msr = rdmsr(0xC0011020);
+	msr = rdmsr(LS_CFG_MSR);
 	msr.lo &= ~(1 << 28);
-	wrmsr(0xC0011020, msr);
+	wrmsr(LS_CFG_MSR, msr);
 
-	msr = rdmsr(0xC0011022);
+	msr = rdmsr(DC_CFG_MSR);
 	msr.lo &= ~(1 << 4);
 	msr.lo &= ~(1 << 13);
-	wrmsr(0xC0011022, msr);
+	wrmsr(DC_CFG_MSR, msr);
 
-	msr = rdmsr(0xC0011023);
+	msr = rdmsr(BU_CFG_MSR);
 	msr.lo &= ~(1 << 23);
-	wrmsr(0xC0011023, msr);
+	wrmsr(BU_CFG_MSR, msr);
 }
 
 struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/msi/ms7721/mainboard.c b/src/mainboard/msi/ms7721/mainboard.c
index 09645f3..2a0e618 100644
--- a/src/mainboard/msi/ms7721/mainboard.c
+++ b/src/mainboard/msi/ms7721/mainboard.c
@@ -15,6 +15,7 @@
 
 #include <console/console.h>
 #include <cpu/x86/msr.h>
+#include <cpu/amd/msr.h>
 #include <device/device.h>
 
 /*************************************************
@@ -26,18 +27,18 @@
 
 	printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
 
-	msr = rdmsr(0xC0011020);
+	msr = rdmsr(LS_CFG_MSR);
 	msr.lo &= ~(1 << 28);
-	wrmsr(0xC0011020, msr);
+	wrmsr(LS_CFG_MSR, msr);
 
-	msr = rdmsr(0xC0011022);
+	msr = rdmsr(DC_CFG_MSR);
 	msr.lo &= ~(1 << 4);
 	msr.lo &= ~(1 << 13);
-	wrmsr(0xC0011022, msr);
+	wrmsr(DC_CFG_MSR, msr);
 
-	msr = rdmsr(0xC0011023);
+	msr = rdmsr(BU_CFG_MSR);
 	msr.lo &= ~(1 << 23);
-	wrmsr(0xC0011023, msr);
+	wrmsr(BU_CFG_MSR, msr);
 }
 
 struct chip_operations mainboard_ops = {

-- 
To view, visit https://review.coreboot.org/29069
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I020431ba8eb61f5ce256088b919c049985331d64
Gerrit-Change-Number: 29069
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes HAOUAS <ehaouas at noos.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181012/09535688/attachment.html>


More information about the coreboot-gerrit mailing list