aboutsummaryrefslogtreecommitdiff
path: root/libflash/ipmi-hiomap.c
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-10-09 00:32:36 -0700
committerStewart Smith <stewart@linux.ibm.com>2018-10-11 01:26:20 -0500
commit9a830ee06c66058b1421c017b25a65a22921e9f6 (patch)
treefad2405598bb7f620b3915599b0de948b614b91a /libflash/ipmi-hiomap.c
parentdd554bacd13c6dea481ea4e1ec9f3c32087295d9 (diff)
downloadskiboot-9a830ee06c66058b1421c017b25a65a22921e9f6.zip
skiboot-9a830ee06c66058b1421c017b25a65a22921e9f6.tar.gz
skiboot-9a830ee06c66058b1421c017b25a65a22921e9f6.tar.bz2
platform: Restructure bmc_platform type
Segregate the BMC platform configuration into hardware and software components. This allows population of platform default values for hardware configuration that may no-longer be accessible by the host. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> [stewart: fixup pci-quirk unit test] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'libflash/ipmi-hiomap.c')
-rw-r--r--libflash/ipmi-hiomap.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c
index 03f6bd8..d36c5f1 100644
--- a/libflash/ipmi-hiomap.c
+++ b/libflash/ipmi-hiomap.c
@@ -226,8 +226,8 @@ static bool hiomap_get_info(struct ipmi_hiomap *ctx)
req[2] = HIOMAP_V2;
msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE,
- bmc_platform->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb,
- &res, req, sizeof(req), 6);
+ bmc_platform->sw->ipmi_oem_hiomap_cmd,
+ ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 6);
ipmi_queue_msg_sync(msg);
if (res.cc != IPMI_CC_NO_ERROR) {
@@ -251,8 +251,8 @@ static bool hiomap_get_flash_info(struct ipmi_hiomap *ctx)
req[0] = HIOMAP_C_GET_FLASH_INFO;
req[1] = ++ctx->seq;
msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE,
- bmc_platform->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb,
- &res, req, sizeof(req), 2 + 2 + 2);
+ bmc_platform->sw->ipmi_oem_hiomap_cmd,
+ ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2 + 2 + 2);
ipmi_queue_msg_sync(msg);
if (res.cc != IPMI_CC_NO_ERROR) {
@@ -294,8 +294,9 @@ static bool hiomap_window_move(struct ipmi_hiomap *ctx, uint8_t command,
unlock(&ctx->lock);
msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE,
- bmc_platform->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb,
- &res, req, sizeof(req), 2 + 2 + 2 + 2);
+ bmc_platform->sw->ipmi_oem_hiomap_cmd,
+ ipmi_hiomap_cmd_cb, &res, req, sizeof(req),
+ 2 + 2 + 2 + 2);
ipmi_queue_msg_sync(msg);
if (res.cc != IPMI_CC_NO_ERROR) {
@@ -348,8 +349,8 @@ static bool hiomap_mark_dirty(struct ipmi_hiomap *ctx, uint64_t offset,
range->size = cpu_to_le16(bytes_to_blocks(ctx, size));
msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE,
- bmc_platform->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb,
- &res, req, sizeof(req), 2);
+ bmc_platform->sw->ipmi_oem_hiomap_cmd,
+ ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2);
ipmi_queue_msg_sync(msg);
if (res.cc != IPMI_CC_NO_ERROR) {
@@ -381,8 +382,8 @@ static bool hiomap_flush(struct ipmi_hiomap *ctx)
req[1] = ++ctx->seq;
msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE,
- bmc_platform->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb,
- &res, req, sizeof(req), 2);
+ bmc_platform->sw->ipmi_oem_hiomap_cmd,
+ ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2);
ipmi_queue_msg_sync(msg);
if (res.cc != IPMI_CC_NO_ERROR) {
@@ -406,8 +407,8 @@ static bool hiomap_ack(struct ipmi_hiomap *ctx, uint8_t ack)
req[2] = ack;
msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE,
- bmc_platform->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb,
- &res, req, sizeof(req), 2);
+ bmc_platform->sw->ipmi_oem_hiomap_cmd,
+ ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2);
ipmi_queue_msg_sync(msg);
if (res.cc != IPMI_CC_NO_ERROR) {
@@ -446,8 +447,8 @@ static bool hiomap_erase(struct ipmi_hiomap *ctx, uint64_t offset,
range->size = cpu_to_le16(bytes_to_blocks(ctx, size));
msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE,
- bmc_platform->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb,
- &res, req, sizeof(req), 2);
+ bmc_platform->sw->ipmi_oem_hiomap_cmd,
+ ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2);
ipmi_queue_msg_sync(msg);
if (res.cc != IPMI_CC_NO_ERROR) {
@@ -787,7 +788,7 @@ int ipmi_hiomap_init(struct blocklevel_device **bl)
struct ipmi_hiomap *ctx;
int rc;
- if (!bmc_platform->ipmi_oem_hiomap_cmd)
+ if (!bmc_platform->sw->ipmi_oem_hiomap_cmd)
/* FIXME: Find a better error code */
return FLASH_ERR_DEVICE_GONE;