|
@@ -92,13 +92,16 @@ int PlatformInit(void)
|
|
|
|
|
|
g_BMCInfo.SelfTestByte = 0;
|
|
|
g_BMCInfo.SlotID = PDK_GetSlotID();
|
|
|
+
|
|
|
g_BMCInfo.ChassisID = PDK_GetChassisID();
|
|
|
|
|
|
+ //机箱及刀片信息
|
|
|
g_BMCInfo.ChassisIdentify = FALSE;
|
|
|
g_BMCInfo.PowerGoodFlag = 1;
|
|
|
g_BMCInfo.BladeManageEn = 0;
|
|
|
g_BMCInfo.isChMC = 0;
|
|
|
g_BMCInfo.IndexInChassis = 1;
|
|
|
+ gBladeStatus[g_BMCInfo.IndexInChassis].slotID = g_BMCInfo.SlotID;
|
|
|
|
|
|
//init DevGUID
|
|
|
g_BMCInfo.DeviceGUID[0] = 0x01;
|
|
@@ -135,6 +138,8 @@ int PlatformInit(void)
|
|
|
g_BMCInfo.CurTimerSecond = 0;
|
|
|
g_BMCInfo.BootValidMinutes = 0;
|
|
|
g_BMCInfo.m_Lan_SetInProgress = 0;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
return 0;
|
|
@@ -390,31 +395,34 @@ int PostEventMessage (uint8_t *EventMsg,uint8_t size)
|
|
|
|
|
|
uint8_t PDK_GetSlotID(void)
|
|
|
{
|
|
|
- uint8_t SlotID = 0;
|
|
|
- uint8_t check = 0;
|
|
|
-
|
|
|
- if(stm32_gpio_read(GA0_PORT, GA0_PIN) == GPIO_PIN_RESET)
|
|
|
- SlotID |= 0x01;
|
|
|
- if(stm32_gpio_read(GA1_PORT, GA1_PIN) == GPIO_PIN_RESET)
|
|
|
- SlotID |= 0x02;
|
|
|
- if(stm32_gpio_read(GA2_PORT, GA2_PIN) == GPIO_PIN_RESET)
|
|
|
- SlotID |= 0x04;
|
|
|
- if(stm32_gpio_read(GA3_PORT, GA3_PIN) == GPIO_PIN_RESET)
|
|
|
- SlotID |= 0x08;
|
|
|
- if(stm32_gpio_read(GA4_PORT, GA4_PIN) == GPIO_PIN_RESET)
|
|
|
- SlotID |= 0x10;
|
|
|
-
|
|
|
- if(stm32_gpio_read(GAP_PORT, GAP_PIN) == GPIO_PIN_RESET)
|
|
|
- SlotID |= 0x20;
|
|
|
+ // uint8_t SlotID = 0;
|
|
|
+ // uint8_t check = 0;
|
|
|
|
|
|
- int i;
|
|
|
- for(i=0;i<6;i++)
|
|
|
- check ^= (SlotID>>i)&0x01;
|
|
|
+ // if(stm32_gpio_read(GA0_PORT, GA0_PIN) == GPIO_PIN_RESET)
|
|
|
+ // SlotID |= 0x01;
|
|
|
+ // if(stm32_gpio_read(GA1_PORT, GA1_PIN) == GPIO_PIN_RESET)
|
|
|
+ // SlotID |= 0x02;
|
|
|
+ // if(stm32_gpio_read(GA2_PORT, GA2_PIN) == GPIO_PIN_RESET)
|
|
|
+ // SlotID |= 0x04;
|
|
|
+ // if(stm32_gpio_read(GA3_PORT, GA3_PIN) == GPIO_PIN_RESET)
|
|
|
+ // SlotID |= 0x08;
|
|
|
+ // if(stm32_gpio_read(GA4_PORT, GA4_PIN) == GPIO_PIN_RESET)
|
|
|
+ // SlotID |= 0x10;
|
|
|
+
|
|
|
+ // if(stm32_gpio_read(GAP_PORT, GAP_PIN) == GPIO_PIN_RESET)
|
|
|
+ // SlotID |= 0x20;
|
|
|
+
|
|
|
+ // int i;
|
|
|
+ // for(i=0;i<6;i++)
|
|
|
+ // check ^= (SlotID>>i)&0x01;
|
|
|
+
|
|
|
+ // if(check == 0)
|
|
|
+ // printf("Slot ID check error! GAP = %#x, GA[4:0] = %#x.\n", (SlotID>>5), (SlotID&0x1f));
|
|
|
+
|
|
|
+ // return SlotID&0x1f;
|
|
|
|
|
|
- if(check == 0)
|
|
|
- printf("Slot ID check error! GAP = %#x, GA[4:0] = %#x.\n", (SlotID>>5), (SlotID&0x1f));
|
|
|
+ return 2;
|
|
|
|
|
|
- return SlotID&0x1f;
|
|
|
}
|
|
|
|
|
|
uint8_t PDK_GetChassisID(void)
|