summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-ast2500/recipes-phosphor/sensors/dbus-sensors/0001-Only-allow-drive-sensors-on-bus-2-for-ast2500.patch
blob: c28ae61261f5485b01104d42b8873d0f63f969dc (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
From 8f6c6f3a23c002f5247c407205f3a62dcd0e0c8c Mon Sep 17 00:00:00 2001
From: James Feist <james.feist@linux.intel.com>
Date: Thu, 23 Apr 2020 14:01:38 -0700
Subject: [PATCH] Only allow drive sensors on bus 2 for ast2500

CPLD doesn't allow multi-master, so readings wont work.
Put in a work-around to only allow bus 2 transactions.

Tested: Only valid sensors were installed.

Change-Id: Ib9e75ffd0dd64cf548d15cce9a6052332ac5ec43
Signed-off-by: James Feist <james.feist@linux.intel.com>
---
 src/NVMeSensorMain.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/NVMeSensorMain.cpp b/src/NVMeSensorMain.cpp
index 8eaeb57..25edf01 100644
--- a/src/NVMeSensorMain.cpp
+++ b/src/NVMeSensorMain.cpp
@@ -154,6 +154,12 @@ static void handleSensorConfigurations(
                           << "\n";
             }
 
+            // HACK: cpld on current products doesn't allow multi-master
+            if (rootBus != 2)
+            {
+                continue;
+            }
+
             std::shared_ptr<NVMeSensor> sensorPtr =
                 std::make_shared<NVMeSensor>(
                     objectServer, io, dbusConnection, *sensorName,
-- 
2.17.1