Skip to content

Commit

Permalink
bic-utils : add bic-utils for wedge400 (#9)
Browse files Browse the repository at this point in the history
Summary:
1. move bic-util from minipack to common
2. add gpiolib of minipack and wedge400 to bic-util
Pull Request resolved: facebookexternal/openbmc.celestica#9

Test Plan: able to use bic-utils

Reviewed By: mikechoifb

fbshipit-source-id: d941e7cc05
  • Loading branch information
mikechoifb authored and facebook-github-bot committed Apr 16, 2019
1 parent 5e7d665 commit f773125
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
@@ -1,7 +1,7 @@
# Copyright 2018-present Facebook. All Rights Reserved.

SUMMARY = "Bridge IC Utility"
DESCRIPTION = "Util for checking with Bridge IC on Minipack"
DESCRIPTION = "Util for checking with Bridge IC"
SECTION = "base"
PR = "r1"
LICENSE = "GPLv2"
Expand All @@ -12,15 +12,15 @@ SRC_URI = "file://bic-util \

S = "${WORKDIR}/bic-util"

CFLAGS += " -lbic -lipmi -lipmb -lminipack_gpio -lfruid"
CFLAGS += " -lbic -lipmi -lipmb -lfruid"


do_install() {
install -d ${D}${bindir}
install -d ${D}${bindir}
install -m 0755 bic-util ${D}${bindir}/bic-util
}

DEPENDS += "libbic libipmi libipmb libminipack-gpio libfruid"
RDEPENDS_${PN} += "libbic libipmi libipmb libminipack-gpio libfruid"
DEPENDS += "libbic libipmi libipmb libfruid"
RDEPENDS_${PN} += "libbic libipmi libipmb libfruid"

FILES_${PN} = "${bindir}"
File renamed without changes.
13 changes: 11 additions & 2 deletions ...-utils/bic-util/files/bic-util/bic-util.c → ...-utils/bic-util/files/bic-util/bic-util.c 100644 → 100755
Expand Up @@ -27,11 +27,20 @@
#include <stdint.h>
#include <pthread.h>
#include <facebook/bic.h>
#include <facebook/minipack_gpio.h>
#include <openbmc/ipmi.h>
#include <openbmc/fruid.h>
#include <fcntl.h>

#ifdef PLATFORM_MINIPACK
#include <facebook/minipack_gpio.h>
#define platform_gpio_type_to_name minipack_gpio_type_to_name
#endif

#ifdef PLATFORM_WEDGE400
#include <facebook/wedge400_gpio.h>
#define platform_gpio_type_to_name wedge400_gpio_type_to_name
#endif

#define LAST_RECORD_ID 0xFFFF
#define MAX_SENSOR_NUM 0xFF
#define BYTES_ENTIRE_RECORD 0xFF
Expand Down Expand Up @@ -231,7 +240,7 @@ util_get_gpio_config(uint8_t slot_id) {
}

printf("gpio_config for pin#%d (%s):\n",
i, minipack_gpio_type_to_name(i));
i, platform_gpio_type_to_name(i));
printf("Direction: %s", t->bits.dir?"Output,":"Input, ");
printf(" Interrupt: %s", t->bits.ie?"Enabled, ":"Disabled,");
printf(" Trigger: %s", t->bits.edge?"Level ":"Edge ");
Expand Down
@@ -0,0 +1,5 @@
DESCRIPTION = "Util for checking with Bridge IC on Minipack"

CFLAGS += "-DPLATFORM_MINIPACK -lminipack_gpio"
DEPENDS += "libminipack-gpio"
RDEPENDS_${PN} += "libminipack-gpio"
@@ -0,0 +1,5 @@
DESCRIPTION = "Util for checking with Bridge IC on Wedge400"

CFLAGS += "-DPLATFORM_WEDGE400 -lwedge400_gpio"
DEPENDS += "libwedge400-gpio"
RDEPENDS_${PN} += "libwedge400-gpio"

0 comments on commit f773125

Please sign in to comment.