blob: 02f6c2913555278e6140571a2f863dce834e6262 [file] [log] [blame]
Artem Senichev1bf51752018-03-29 13:40:54 +03001From 4310ba2a3b6e6439b0938e10435e435cef1d5738 Mon Sep 17 00:00:00 2001
Artem Senichev67355a82018-03-16 12:35:51 +03002From: Artem Senichev <a.senichev@yadro.com>
Artem Senichev1bf51752018-03-29 13:40:54 +03003Date: Thu, 29 Mar 2018 11:19:14 +0300
Artem Senichev67355a82018-03-16 12:35:51 +03004Subject: [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---
Artem Senichev1bf51752018-03-29 13:40:54 +030010 src/usr/hwas/hostbootIstep.C | 50 ++++++++++++++++++++++++++++++++++++++++++++
11 1 file changed, 50 insertions(+)
Artem Senichev67355a82018-03-16 12:35:51 +030012
13diff --git a/src/usr/hwas/hostbootIstep.C b/src/usr/hwas/hostbootIstep.C
Artem Senichev1bf51752018-03-29 13:40:54 +030014index af3770295..1330a7e65 100644
Artem Senichev67355a82018-03-16 12:35:51 +030015--- a/src/usr/hwas/hostbootIstep.C
16+++ b/src/usr/hwas/hostbootIstep.C
Artem Senichev1bf51752018-03-29 13:40:54 +030017@@ -188,6 +188,11 @@ void* host_discover_targets( void *io_pArgs )
Artem Senichev67355a82018-03-16 12:35:51 +030018
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
Artem Senichev67355a82018-03-16 12:35:51 +030025+
26 for (TargetIterator target = targetService().begin();
27 target != targetService().end();
28 ++target)
Artem Senichev1bf51752018-03-29 13:40:54 +030029@@ -198,11 +203,49 @@ void* host_discover_targets( void *io_pArgs )
Artem Senichev67355a82018-03-16 12:35:51 +030030 }
31 TARGETING::TYPE l_type = target->getAttr<TARGETING::ATTR_TYPE>();
32 TARGETING::ATTR_POSITION_type l_pos = 0;
33+ TARGETING::ATTR_HUID_type l_huid = target->getAttr<TARGETING::ATTR_HUID>(); //for showing HUID
34+
35 if( target->tryGetAttr<TARGETING::ATTR_POSITION>(l_pos) )
36 {
37 l_presData[l_type] |= (0x8000000000000000 >> l_pos);
38+
Artem Senichev1bf51752018-03-29 13:40:54 +030039+ if (l_type == TARGETING::TYPE_DIMM)
Artem Senichev67355a82018-03-16 12:35:51 +030040+ {
Artem Senichev1bf51752018-03-29 13:40:54 +030041+ if (l_pos < 64)
Artem Senichev67355a82018-03-16 12:35:51 +030042+ {
43+ //for dimms on CPU P0
44+ Present_Dimm_P0[l_type] |= (0x8000000000000000 >> l_pos);
Artem Senichev1bf51752018-03-29 13:40:54 +030045+ 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);
Artem Senichev67355a82018-03-16 12:35:51 +030046+ }
47+ else if ((l_pos >= 64) && (l_pos < 128))
48+ {
49+ //for dimms on CPU P1
50+ Present_Dimm_P1[l_type] |= (0x8000000000000000 >> (l_pos - 64));
Artem Senichev1bf51752018-03-29 13:40:54 +030051+ 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);
Artem Senichev67355a82018-03-16 12:35:51 +030052+ }
53+ else if ((l_pos >= 128) && (l_pos < 192))
54+ {
55+ //for dimms on CPU P2
56+ Present_Dimm_P2[l_type] |= (0x8000000000000000 >> (l_pos - 128));
Artem Senichev1bf51752018-03-29 13:40:54 +030057+ 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);
Artem Senichev67355a82018-03-16 12:35:51 +030058+ }
59+ else if (l_pos >= 192)
60+ {
61+ //for dimms on CPU P3
62+ Present_Dimm_P3[l_type] |= (0x8000000000000000 >> (l_pos - 192));
Artem Senichev1bf51752018-03-29 13:40:54 +030063+ 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);
Artem Senichev67355a82018-03-16 12:35:51 +030064+ }
65+ }
66 }
67 }
68+
69+ CONSOLE::displayf("HWAS", "=========================================");
Artem Senichev1bf51752018-03-29 13:40:54 +030070+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P0=%.8X%.8X", Present_Dimm_P0[TARGETING::TYPE_DIMM] >> 32, Present_Dimm_P0[TARGETING::TYPE_DIMM] & 0xFFFFFFFF);
71+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P1=%.8X%.8X", Present_Dimm_P1[TARGETING::TYPE_DIMM] >> 32, Present_Dimm_P1[TARGETING::TYPE_DIMM] & 0xFFFFFFFF);
72+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P2=%.8X%.8X", Present_Dimm_P2[TARGETING::TYPE_DIMM] >> 32, Present_Dimm_P2[TARGETING::TYPE_DIMM] & 0xFFFFFFFF);
73+ CONSOLE::displayf("HWAS", "PRESENT> DIMM_P3=%.8X%.8X", Present_Dimm_P3[TARGETING::TYPE_DIMM] >> 32, Present_Dimm_P3[TARGETING::TYPE_DIMM] & 0xFFFFFFFF);
Artem Senichev67355a82018-03-16 12:35:51 +030074+ CONSOLE::displayf("HWAS", "=========================================");
75+
76 TARGETING::EntityPath l_epath; //use EntityPath's translation functions
77 for( std::map<TARGETING::TYPE,uint64_t>::iterator itr = l_presData.begin();
78 itr != l_presData.end();
Artem Senichev1bf51752018-03-29 13:40:54 +030079@@ -210,6 +253,13 @@ void* host_discover_targets( void *io_pArgs )
Artem Senichev67355a82018-03-16 12:35:51 +030080 {
81 uint8_t l_type = itr->first;
82 uint64_t l_val = itr->second;
83+
Artem Senichev1bf51752018-03-29 13:40:54 +030084+ if (l_type == TARGETING::TYPE_DIMM)
Artem Senichev67355a82018-03-16 12:35:51 +030085+ {
86+ //to skip DIMM type
87+ continue;
88+ }
89+
90 TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,"PRESENT> %s[%.2X]=%.8X%.8X",
91 l_epath.pathElementTypeAsString(itr->first), l_type, l_val>>32, l_val&0xFFFFFFFF);
92 #if (!defined(CONFIG_CONSOLE_OUTPUT_TRACE) && defined(CONFIG_CONSOLE))
93--
942.14.1
95