Hello All,
Firstly this is sort of building off of the suggestions from the "i2c_writeb vs i2c_raw_write output" thread; I have looked into the smbus_xxx() functions and they might do the trick. So basically what I am trying to do is send the POSTcodes to somewhere I can read them and at the moment the most convenient choices were i2c, spi and now smbus; with smbus looking the most promising. So the easiest way (i thought) would be to modify post_code() function in coreboot/src/console/post.c just temporarily adding a modification at the end of the function. I have included the 'device/smbus.h' header - at the suggestion of Mr. Werner, Mr. Kyosti, and Mr. Laurie - to allow for use (or so I thought) of the smbus functions. The following is a my output from a clean make. I do not know if the email will send in plain text indented as I have it so the error carrot is pointing up under the '->' between 'ops' and 'ops_smbus_bus'; the error instance of the error in post.c is within the #include set as well as seen below post.c(22) is '#include <device/smbus.h>'.
______________________________________________________________________
#
# configuration written to /home/test/coreboot_2/coreboot/.config
#
HOSTCC util/sconfig/lex.yy.o
HOSTCC util/sconfig/sconfig.tab.o
HOSTCC util/sconfig/main.o
HOSTCC util/sconfig/sconfig (link)
SCONFIG mainboard/asrock/imb-a180/devicetree.cb
HOSTCC nvramtool/cli/nvramtool.o
HOSTCC nvramtool/cli/opts.o
HOSTCC nvramtool/cmos_lowlevel.o
HOSTCC nvramtool/cmos_ops.o
HOSTCC nvramtool/common.o
HOSTCC nvramtool/compute_ip_checksum.o
HOSTCC nvramtool/hexdump.o
HOSTCC nvramtool/input_file.o
HOSTCC nvramtool/layout.o
HOSTCC nvramtool/accessors/layout-common.o
HOSTCC nvramtool/accessors/layout-text.o
HOSTCC nvramtool/accessors/layout-bin.o
HOSTCC nvramtool/lbtable.o
HOSTCC nvramtool/reg_expr.o
HOSTCC nvramtool/cbfs.o
HOSTCC nvramtool/accessors/cmos-mem.o
HOSTCC nvramtool/nvramtool (link)
OPTION option_table.h
CC bootblock/mainboard/asrock/imb-a180/static.o
CC bootblock/arch/x86/boot.o
GEN generated/bootblock.ld
CP bootblock/arch/x86/bootblock.ld
HOSTCC util/romcc/romcc (this may take a while)
ROMCC generated/bootblock.inc
Warning: Nonexistent include path: `src/vendorcode/amd/agesa/f16kb/Lib'
CC bootblock/arch/x86/bootblock_romcc.o
CC bootblock/arch/x86/cpu_common.o
GEN build.h
CC bootblock/arch/x86/id.o
CC bootblock/arch/x86/memcpy.o
CC bootblock/arch/x86/memset.o
CC bootblock/arch/x86/mmap_boot.o
CC bootblock/arch/x86/walkcbfs.o
CC bootblock/commonlib/cbfs.o
CC bootblock/commonlib/lz4_wrapper.o
CC bootblock/commonlib/mem_pool.o
CC bootblock/commonlib/region.o
CC bootblock/console/die.o
CC bootblock/console/post.o
In file included from src/console/post.c:22:0:
src/include/device/smbus.h: In function 'ops_smbus_bus':
src/include/device/smbus.h:30:27: error: dereferencing pointer to incomplete type 'struct device_operations'
bops = bus->dev->ops->ops_smbus_bus;
^
make: *** [build/bootblock/console/post.o] Error 1
______________________________________________________________________
I have tried the following without avail:
~ rearranging the #include statements (does not to help at all)
~ looking at the makefile output of an unmodified bootable version I have of coreboot (used for reference and a fresh start if needed) to see if the files contain smbus.h in the inclusions - some do but much further down in the makefile output and the 'smbus.h' is in quotes not <> because it is in the same folder as the referencing file
~ googling "dereferencing pointer to incomplete type", "dereferencing pointer to incomplete struct type", "dereferencing coreboot pointer to incomplete type", etc - which the results are 99% solved by including a header file but the two I need ('device.h' and 'smbus.h') are included
~ adding 'struct device_operations;' to the top of the file - both 'post.c' and 'smbus.h'
~ figuring out where all the structs referenced in the 'bops = ....' they are all in 'src/include/device/device.h' which is included in 'post.c' and 'smbus.h'
~ checking if there are any guards and they either match or arent there ex: in 'device.h' the 'device_operations' struct is in a 'ifndef(__SIMPLE_DEVICE__) guard so I made sure that 'post.c' and 'smbus.h' are not _SIMPLE_DEVICE_
~ going in 'smbus.h' to set the bus->dev->ops to equal a 'struct device_operations' pointer and using said pointer to get 'ops_smbus_bus' with a cast
~ replacing '->' with '.'
I feel like I don't really understand the error because either coreboot provides a 'special case' scenario here, or that I am completely missing something, or that I do not understand the transactions as well as I thought.
Thank you for your time.
HN