amd / esmi_oob_library

for hosting E-SMI Out-of-band code
Other
18 stars 7 forks source link

Correct recipe for yocto integration #2

Open Kostr opened 2 years ago

Kostr commented 2 years ago

I'm trying to integrate esmi_oob_library to the OpenBMC (48915: meta-amd: Add APML recipe | https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/48915)

Unfortunately it is not possible with the current version of CMakeLists.txt if we don't override cmake do_install task. The build fails with the following error:

ERROR: amd-apml-1.0+gitAUTOINC+697a8ccf50-r0 do_package: QA Issue: amd-apml: Files/directories were installed but not shipped in any package:
  /usr/esmi_oob/include
  /usr/esmi_oob/include/esmi_oob
  /usr/esmi_oob/include/esmi_oob/esmi_rmi.h
  /usr/esmi_oob/include/esmi_oob/esmi_tsi.h
  /usr/esmi_oob/include/esmi_oob/esmi_common.h
  /usr/esmi_oob/include/esmi_oob/esmi_mailbox.h
  /usr/esmi_oob/include/esmi_oob/esmi_i2c.h
  /usr/esmi_oob/include/esmi_oob/esmi_cpuid_msr.h
  /usr/esmi_oob/lib/libesmi_oob64.so.0.1.0
  /usr/esmi_oob/lib/libesmi_oob64.so
  /usr/esmi_oob/lib/libesmi_oob64.so.0
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
amd-apml: 11 installed and not shipped files. [installed-vs-shipped]

It looks like install paths needs some correction. The path prefix should be /usr, but not /usr/esmi_oob.

Also it would be good to have an option for examples compilation. By them I mean:

nchatrad commented 1 year ago

Hi, Thanks for the patch. SInce we have rearchitected the code. Can you rebase this patch, using the latest version of the APML library.

Kostr commented 1 year ago

Hi @nchatrad ! I can't build esmi_oob_library because of the missing file <linux/amd-apml.h>: https://github.com/amd/esmi_oob_library/blob/00cc0fb0265af1d240a0aff5ed96f90a73ff8c51/include/esmi_oob/apml.h#L47

Is it merged upstream? I don't see it in the https://github.com/torvalds/linux/tree/master/include/linux

This file is present in the https://github.com/amd/apml_modules repo. But this repo looks like a some alternative to the upstream versions of RMI & TSI drivers: https://github.com/torvalds/linux/blob/master/drivers/hwmon/sbrmi.c https://github.com/torvalds/linux/blob/master/drivers/hwmon/sbtsi_temp.c

Shouldn't the amd-apml.h header be committed to the Linux kernel?

nchatrad commented 1 year ago

Hi Kostr, As you can see https://github.com/amd/apml_modules repo is evolving with support for new features and platforms. Our plan is to maintain apml_modules as out of tree modules, until a point where we think it is time to be submitted upstream.

Kostr commented 1 year ago

@nchatrad I'll try to investigate how to create a Yocto recipe that depends on these out-of-tree modules. But can you also maintain some branch that is in sync with the upstream kernel code?

yiangyang commented 1 year ago
./esmi_oob_library/include/esmi_oob/apml.h:47:10: fatal error: linux/amd-apml.h: No such file or directory
 #include <linux/amd-apml.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

I have the same question, and I can't compile it...

nchatrad commented 1 year ago

Hi @yiangyang This file is present in the https://github.com/amd/apml_modules repo. Which is marked as a dependency for the APML library to function.

ojayanth commented 7 months ago

@nchatrad After adding apml_modules recipe and forcing to set Kernel config "CONFIG_MODULES=y" , build is failing with below error.

| /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/apml_sbtsi.c:434:18: error: initialization of 'int ()(struct i2c_client )' from incompatible pointer type 'int ()(struct i2c_client , const struct i2c_device_id )' [-Werror=incompatible-pointer-types] | 434 | .probe = sbtsi_i2c_probe, | | ^~~~~~~ | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/apml_sbtsi.c:434:18: note: (near initialization for 'sbtsi_driver.probe') | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/sbrmi.c:663:18: error: initialization of 'int ()(struct i2c_client )' from incompatible pointer type 'int ()(struct i2c_client , const struct i2c_device_id )' [-Werror=incompatible-pointer-types] | 663 | .probe = sbrmi_i2c_probe, | | ^~~~~~~ | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/sbrmi.c:663:18: note: (near initialization for 'sbrmi_driver.probe') | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/apml_alertl.c: In function 'get_apml_dev_byphandle': | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/apml_alertl.c:146:32: error: 'i3c_bus_type' undeclared (first use in this function); did you mean 'i2c_bus_type'? | 146 | dev = bus_find_device(&i3c_bus_type, NULL, d_node, sbrmi_match_i3c); | | ^~~~ | | i2c_bus_type | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/apml_alertl.c:146:32: note: each undeclared identifier is reported only once for each function it appears in | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/apml_alertl.c: In function 'apml_alertl_probe': | /mnt/work/ojayanth/review/openbmc/build/sp5/tmp/work/sp5-openbmc-linux-gnueabi/apml-modules/1.0/git/apml_alertl.c:205:24: error: implicit declaration of function 'of_get_gpio' [-Werror=implicit-function-declaration] | 205 | gpio_alert_l = of_get_gpio(dev->of_node, 0); | | ^~~ | cc1: some warnings being treated as errors | cc1: some warnings being treated as errors

akky16 commented 5 months ago

@ojayanth We have pushed the required patches to https://github.com/amd/apml_modules, to address the issue mentioned in above comment. Please use the latest APML kernel modules for compilation.