aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-amd/0060-yocto-amd-i2c-dev-add-calls-to-enable-and-disable-IM.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-amd/0060-yocto-amd-i2c-dev-add-calls-to-enable-and-disable-IM.patch')
-rw-r--r--common/recipes-kernel/linux/linux-amd/0060-yocto-amd-i2c-dev-add-calls-to-enable-and-disable-IM.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-amd/0060-yocto-amd-i2c-dev-add-calls-to-enable-and-disable-IM.patch b/common/recipes-kernel/linux/linux-amd/0060-yocto-amd-i2c-dev-add-calls-to-enable-and-disable-IM.patch
new file mode 100644
index 00000000..3fa9c407
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-amd/0060-yocto-amd-i2c-dev-add-calls-to-enable-and-disable-IM.patch
@@ -0,0 +1,51 @@
+From ae1353dc647641a2a9f2614eeb7f761e0c63586c 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 60/60] 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
+