Skip to content

Commit

Permalink
fby4: sd: Obtain BIOS information via PLDM SMBIOS
Browse files Browse the repository at this point in the history
# Description:
- Enable KSC for setting bios information.

# Motivation:
- Support BMC can obtain BIOS version by standard PLDM command.

# Test plan:
- BMC can get bios version from bic.

# Log:

[First query]
root@bmc:/tmp#  pldmtool raw -m 40 -v -d 0x80 0x01 0x05 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
pldmtool: Tx: 80 01 05 00 00 00 00 00 00 00 00
pldmtool: Rx: 00 01 05 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

[Power on the host]
root@bmc:/tmp# busctl set-property xyz.openbmc_project.State.Host4 /xyz/openbmc_project/state/host4 xyz.openbmc_project.State.Host RequestedHostTransition s "xyz.openbmc_project.State.Host.Transition.On"

[Wait for post code complete and query again]
root@bmc:/tmp#  pldmtool raw -m 40 -v -d 0x80 0x01 0x05 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
pldmtool: Tx: 80 01 05 00 00 00 00 00 00 00 00
pldmtool: Rx: 00 01 05 00 00 00 00 00 05 00 0c 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 34 54 52 5f 31 31 30 38 00 00
                                                         |
                                                        [bios version: first text string]                              [Y4TR_1108]
  • Loading branch information
ChrisWang-wiwynn committed Nov 30, 2023
1 parent 7cea00d commit a24905d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions meta-facebook/yv4-sd/boards/ast1030_evb.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,8 @@
dma-mode;
dma-ringbuf-size = <0x4000>;
};

&kcs3 {
status = "okay";
addr = <0xca2>;
};
2 changes: 2 additions & 0 deletions meta-facebook/yv4-sd/src/platform/plat_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "plat_pldm_monitor.h"
#include "plat_class.h"
#include "pcc.h"
#include "plat_kcs.h"

void pal_pre_init()
{
Expand Down Expand Up @@ -78,6 +79,7 @@ void pal_post_init()
{
plat_mctp_init();
pcc_init();
kcs_init();
pldm_load_state_effecter_table(PLAT_PLDM_MAX_STATE_EFFECTER_IDX);
pldm_assign_gpio_effecter_id(PLAT_EFFECTER_ID_GPIO_HIGH_BYTE);
}
Expand Down
24 changes: 24 additions & 0 deletions meta-facebook/yv4-sd/src/platform/plat_kcs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "plat_kcs.h"
#include "kcs.h"

void kcs_init(void)
{
char *kcs_config[] = { "KCS3" };
kcs_device_init(kcs_config, ARRAY_SIZE(kcs_config));
}
22 changes: 22 additions & 0 deletions meta-facebook/yv4-sd/src/platform/plat_kcs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef PLAT_KCS_H
#define PLAT_KCS_H

void kcs_init(void);

#endif

0 comments on commit a24905d

Please sign in to comment.