aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-kernel/linux/files/0002-yocto-amd-i2c-dev-add-calls-to-enable-and-disable-IM.patch
blob: c4aa791520e39cd0ad17f31a14b146ed7bca089d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 6d365974c73b25976a5c5b7572af2dab13ad39d0 Mon Sep 17 00:00:00 2001
From: Sanjay R Mehta <sanju.mehta@amd.com>
Date: Tue, 27 Sep 2016 16:14:53 +0530
Subject: [PATCH 2/2] yocto amd i2c dev add calls to enable and disable IMC
 from fetching BIOS code

---
 drivers/i2c/i2c-dev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 2413ec9..6a3419d 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -34,6 +34,7 @@
 #include <linux/i2c-dev.h>
 #include <linux/jiffies.h>
 #include <linux/uaccess.h>
+#include <linux/amd_imc.h>
 
 /*
  * An i2c_dev represents an i2c_adapter ... an I2C or SMBus master, not a
@@ -510,6 +511,8 @@ static int i2cdev_open(struct inode *inode, struct file *file)
 	client->adapter = adap;
 	file->private_data = client;
 
+	amd_imc_enter_scratch_ram();
+
 	return 0;
 }
 
@@ -521,6 +524,8 @@ static int i2cdev_release(struct inode *inode, struct file *file)
 	kfree(client);
 	file->private_data = NULL;
 
+	amd_imc_exit_scratch_ram();
+
 	return 0;
 }
 
-- 
2.7.4