aboutsummaryrefslogtreecommitdiffstats
path: root/meta-baldeagle/recipes-kernel/linux/linux-yocto/0047-yocto-poky-dora-10.0.0-amd-i2c-dev-add-calls-to-enable-and-disable-IMC-from-fetching-BIOS-code.patch
blob: 6287c826e7a6f36f2d0ef90516c546d97322a427 (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
44
45
46
47
48
49
50
51
From 38595e633e5a1237bdea9cb0aa9193aea40542a8 Mon Sep 17 00:00:00 2001
From: Arindam Nath <arindam.nath@amd.com>
Date: Mon, 4 Aug 2014 19:21:44 +0530
Subject: [PATCH 2/2] yocto: amd: i2c-dev: add calls to enable and disable IMC
 from fetching BIOS code

The patch adds support to disable IMC from fetching BIOS code when
we first open the SMBus device. We can perform SMBus transaction
safely once IMC is disabled. Then when we close the device after
the operation, we enable IMC to start fetching from BIOS ROM again.

Upstream Status: None

Signed-off-by: Arindam Nath <arindam.nath@amd.com>
---
 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 c3ccdea..c92ec4c 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -39,6 +39,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
@@ -512,6 +513,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;
 }
 
@@ -523,6 +526,8 @@ static int i2cdev_release(struct inode *inode, struct file *file)
 	kfree(client);
 	file->private_data = NULL;
 
+	amd_imc_exit_scratch_ram();
+
 	return 0;
 }
 
-- 
1.9.1