-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ELBERT: refactors EEPROM code to library and fixes PIM8DDM part numbe…
…r in weutil (#126) Summary: This makes two changes to the Elbert wedge-eeprom code: 1. Refactors the elbert-eeprom code into its own library so that it can be used by the Elbert platform-lib code. 2. Fixes an issue where garbage characters are printed at the end of the PIM8DDM part number in weutil. ## Testing EEPROM CIT tests pass. Verified that the PIM8DDM part number is now correct: ``` root@bmc-oob:~# pim_types.sh PIM 2: PIM16Q PIM 3: PIM16Q PIM 4: PIM16Q PIM 5: PIM16Q PIM 6: PIM8DDM PIM 7: PIM16Q PIM 8: PIM16Q PIM 9: PIM16Q root@bmc-oob:~# weutil pim6 Wedge EEPROM pim6: Version: 0 Product Name: ELBERT Product Part Number: 7388-8D System Assembly Part Number: ASY055040104 Facebook PCBA Part Number: Facebook PCB Part Number: ODM PCBA Part Number: PCA015220106 ODM PCBA Serial Number: Product Production State: 0 Product Version: 10 Product Sub-Version: 1 Product Serial Number: JAS20370017 Product Asset Tag: System Manufacturer: System Manufacturing Date: 2020010100 PCB Manufacturer: Assembled At: Local MAC: D4:AF:F7:2F:32:A6 Extended MAC Base: D4:AF:F7:2F:98:D0 Extended MAC Address Size: 139 Location on Fabric: CRC8: 0x0 ``` Pull Request resolved: facebookexternal/openbmc.arista#126 Reviewed By: benwei13 fbshipit-source-id: 2dfb73f46c
- Loading branch information
1 parent
f4d1f80
commit c15a765
Showing
7 changed files
with
84 additions
and
9 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
meta-facebook/meta-elbert/recipes-utils/wedge-eeprom/files/lib/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2020-present Facebook. All Rights Reserved. | ||
# | ||
# This program file is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by the | ||
# Free Software Foundation; version 2 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
# for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program in a file named COPYING; if not, write to the | ||
# Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, | ||
# Boston, MA 02110-1301 USA | ||
|
||
lib: libelbert_eeprom.so | ||
|
||
libelbert_eeprom.so: elbert_eeprom.c | ||
$(CC) $(CFLAGS) -fPIC -c -o elbert_eeprom.o elbert_eeprom.c | ||
$(CC) -shared -o libelbert_eeprom.so elbert_eeprom.o -lc $(LDFLAGS) | ||
|
||
.PHONY: clean | ||
|
||
clean: | ||
rm -rf *.o libelbert_eeprom.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
meta-facebook/meta-elbert/recipes-utils/wedge-eeprom/libelbert-eeprom_0.1.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright 2020-present Facebook. All Rights Reserved. | ||
# | ||
# This program file is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by the | ||
# Free Software Foundation; version 2 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
# for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program in a file named COPYING; if not, write to the | ||
# Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, | ||
# Boston, MA 02110-1301 USA | ||
SUMMARY = "Elbert EEPROM Library" | ||
DESCRIPTION = "library for elbert eeprom" | ||
SECTION = "base" | ||
PR = "r1" | ||
LICENSE = "GPLv2" | ||
LIC_FILES_CHKSUM = "file://elbert_eeprom.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec" | ||
|
||
SRC_URI = "file://lib \ | ||
" | ||
|
||
LDFLAGS += "-llog -lobmc-i2c -lwedge_eeprom" | ||
DEPENDS += "liblog libobmc-i2c libwedge-eeprom" | ||
RDEPENDS_${PN} = "liblog libobmc-i2c libwedge-eeprom" | ||
|
||
S = "${WORKDIR}/lib" | ||
|
||
do_install() { | ||
install -d ${D}${libdir} | ||
install -m 0644 libelbert_eeprom.so ${D}${libdir}/libelbert_eeprom.so | ||
|
||
install -d ${D}${includedir}/facebook | ||
install -m 0644 elbert_eeprom.h ${D}${includedir}/facebook/elbert_eeprom.h | ||
} | ||
|
||
FILES_${PN} = "${libdir}/libelbert_eeprom.so" | ||
FILES_${PN}-dev = "${includedir}/facebook/elbert_eeprom.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters