blob: 02decc4a32eacd8574a7b404fb2d7e692d695cb6 [file] [log] [blame]
Artem Senichev67355a82018-03-16 12:35:51 +03001From e89b453239c0b087e5f61aefa59d29a1ae636e08 Mon Sep 17 00:00:00 2001
2From: Artem Senichev <a.senichev@yadro.com>
3Date: Tue, 13 Mar 2018 15:14:49 +0300
4Subject: [PATCH] Add present bits info based on pos
5
6Originally created by MSI (S188)
7
8Signed-off-by: Artem Senichev <a.senichev@yadro.com>
9---
10 src/usr/hwas/hostbootIstep.C | 52 ++++++++++++++++++++++++++++++++++++++++++++
11 1 file changed, 52 insertions(+)
12
13diff --git a/src/usr/hwas/hostbootIstep.C b/src/usr/hwas/hostbootIstep.C
14index af3770295..2dc73f383 100644
15--- a/src/usr/hwas/hostbootIstep.C
16+++ b/src/usr/hwas/hostbootIstep.C
17@@ -188,6 +188,12 @@ void* host_discover_targets( void *io_pArgs )
18
19 // Put out some helpful messages that show which targets we actually found
20 std::map<TARGETING::TYPE,uint64_t> l_presData;
21+ std::map<TARGETING::TYPE,uint64_t> Present_Dimm_P0; //for dimms on CPU P0
22+ std::map<TARGETING::TYPE,uint64_t> Present_Dimm_P1; //for dimms on CPU P1
23+ std::map<TARGETING::TYPE,uint64_t> Present_Dimm_P2; //for dimms on CPU P2
24+ std::map<TARGETING::TYPE,uint64_t> Present_Dimm_P3; //for dimms on CPU P3
25+ TARGETING::TYPE l_type_dimm;
26+
27 for (TargetIterator target = targetService().begin();
28 target != targetService().end();
29 ++target)
30@@ -198,11 +204,50 @@ void* host_discover_targets( void *io_pArgs )
31 }
32 TARGETING::TYPE l_type = target->getAttr<TARGETING::ATTR_TYPE>();
33 TARGETING::ATTR_POSITION_type l_pos = 0;
34+ TARGETING::ATTR_HUID_type l_huid = target->getAttr<TARGETING::ATTR_HUID>(); //for showing HUID
35+
36 if( target->tryGetAttr<TARGETING::ATTR_POSITION>(l_pos) )
37 {
38 l_presData[l_type] |= (0x8000000000000000 >> l_pos);
39+
40+ if (l_type == 0x03 ) //if the type is DIMM
41+ {
42+ l_type_dimm = l_type;
43+ if (l_pos < 64 )
44+ {
45+ //for dimms on CPU P0
46+ Present_Dimm_P0[l_type] |= (0x8000000000000000 >> l_pos);
47+ CONSOLE::displayf(NULL, "MEMORY-INFO| l_pos = 0x%X, l_type =0x%0X, l_huid=0x%X, Present_Dimm_P0[l_type]=%.8X%.8X", l_pos, l_type, l_huid, Present_Dimm_P0[l_type] >> 32, Present_Dimm_P0[l_type] & 0xFFFFFFFF);
48+ }
49+ else if ((l_pos >= 64) && (l_pos < 128))
50+ {
51+ //for dimms on CPU P1
52+ Present_Dimm_P1[l_type] |= (0x8000000000000000 >> (l_pos - 64));
53+ CONSOLE::displayf(NULL, "MEMORY-INFO| l_pos = 0x%X, l_type =0x%0X, l_huid=0x%X, Present_Dimm_P1[l_type]=%.8X%.8X", l_pos, l_type, l_huid, Present_Dimm_P1[l_type] >> 32, Present_Dimm_P1[l_type] & 0xFFFFFFFF);
54+ }
55+ else if ((l_pos >= 128) && (l_pos < 192))
56+ {
57+ //for dimms on CPU P2
58+ Present_Dimm_P2[l_type] |= (0x8000000000000000 >> (l_pos - 128));
59+ CONSOLE::displayf(NULL, "MEMORY-INFO| l_pos = 0x%X, l_type =0x%0X, l_huid=0x%X, Present_Dimm_P2[l_type]=%.8X%.8X", l_pos, l_type, l_huid, Present_Dimm_P2[l_type] >> 32, Present_Dimm_P2[l_type] & 0xFFFFFFFF);
60+ }
61+ else if (l_pos >= 192)
62+ {
63+ //for dimms on CPU P3
64+ Present_Dimm_P3[l_type] |= (0x8000000000000000 >> (l_pos - 192));
65+ CONSOLE::displayf(NULL, "MEMORY-INFO| l_pos = 0x%X, l_type =0x%0X, l_huid=0x%X, Present_Dimm_P3[l_type]=%.8X%.8X", l_pos, l_type, l_huid, Present_Dimm_P3[l_type] >> 32, Present_Dimm_P3[l_type] & 0xFFFFFFFF);
66+ }
67+ }
68 }
69 }
70+
71+ CONSOLE::displayf("HWAS", "=========================================");
72+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P0[03]=%.8X%.8X", Present_Dimm_P0[l_type_dimm] >> 32, Present_Dimm_P0[l_type_dimm] & 0xFFFFFFFF);
73+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P1[03]=%.8X%.8X", Present_Dimm_P1[l_type_dimm] >> 32, Present_Dimm_P1[l_type_dimm] & 0xFFFFFFFF);
74+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P2[03]=%.8X%.8X", Present_Dimm_P2[l_type_dimm] >> 32, Present_Dimm_P2[l_type_dimm] & 0xFFFFFFFF);
75+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P3[03]=%.8X%.8X", Present_Dimm_P3[l_type_dimm] >> 32, Present_Dimm_P3[l_type_dimm] & 0xFFFFFFFF);
76+ CONSOLE::displayf("HWAS", "=========================================");
77+
78 TARGETING::EntityPath l_epath; //use EntityPath's translation functions
79 for( std::map<TARGETING::TYPE,uint64_t>::iterator itr = l_presData.begin();
80 itr != l_presData.end();
81@@ -210,6 +255,13 @@ void* host_discover_targets( void *io_pArgs )
82 {
83 uint8_t l_type = itr->first;
84 uint64_t l_val = itr->second;
85+
86+ if (l_type == 0x03)
87+ {
88+ //to skip DIMM type
89+ continue;
90+ }
91+
92 TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,"PRESENT> %s[%.2X]=%.8X%.8X",
93 l_epath.pathElementTypeAsString(itr->first), l_type, l_val>>32, l_val&0xFFFFFFFF);
94 #if (!defined(CONFIG_CONSOLE_OUTPUT_TRACE) && defined(CONFIG_CONSOLE))
95--
962.14.1
97