Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30209 )
Change subject: soc/intel/common/block/lpc: create LPC_GET_DEV macro
......................................................................
Patch Set 2: Code-Review-1
(1 comment)
https://review.coreboot.org/c/coreboot/+/30209/2/src/soc/intel/common/block/...
File src/soc/intel/common/block/lpc/lpc_lib.c:
https://review.coreboot.org/c/coreboot/+/30209/2/src/soc/intel/common/block/...
PS2, Line 29: #if !defined(__SIMPLE_DEVICE__)
: #include <device/device.h>
: #define LPC_GET_DEV pcidev_on_root(PCH_DEV_SLOT_LPC, 0x0)
: #else
: #define LPC_GET_DEV PCH_DEV_LPC
: #endif
Compiles fine as by Aamir's suggestion, btw.
yes compilation will work as long as #define __SIMPLE_DEVICE__ is there.
No, I meant this patch but with PCH_DEV_LPC from soc/pci_devs.h instead
of your new macro works fine.
But i don't know why we have this guard at first place and want to compile this entire file as part of simple device. is that saving anything ? general query.
It provides a stable API even if the file is compiled for ramstage and
pre-ram stages. Hence, avoids the need for any #if in platform code. It
makes it harder, though, to have common definitions like PCH_DEV_LPC,
because you can't use them anymore to get a `struct device *`. That's
why there are some explicit calls to pcidev_on_root() below.
--
To view, visit
https://review.coreboot.org/c/coreboot/+/30209
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I84a6102bf3849e9d4fe28e4c6a11bc7badcf5114
Gerrit-Change-Number: 30209
Gerrit-PatchSet: 2
Gerrit-Owner: Subrata Banik
subrata.banik@intel.com
Gerrit-Reviewer: Aamir Bohra
aamir.bohra@intel.com
Gerrit-Reviewer: Aaron Durbin
adurbin@chromium.org
Gerrit-Reviewer: Angel Pons
th3fanbus@gmail.com
Gerrit-Reviewer: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Reviewer: Duncan Laurie
dlaurie@chromium.org
Gerrit-Reviewer: Furquan Shaikh
furquan@google.com
Gerrit-Reviewer: Martin Roth
martinroth@google.com
Gerrit-Reviewer: Nico Huber
nico.h@gmx.de
Gerrit-Reviewer: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: Patrick Rudolph
siro@das-labor.org
Gerrit-Reviewer: Pratikkumar V Prajapati
pratikkumar.v.prajapati@intel.com
Gerrit-Reviewer: Subrata Banik
subrata.banik@intel.com
Gerrit-Reviewer: V Sowmya
v.sowmya@intel.com
Gerrit-Reviewer: Wonkyu Kim
wonkyu.kim@intel.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-Comment-Date: Mon, 17 Feb 2020 09:42:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Subrata Banik
subrata.banik@intel.com
Comment-In-Reply-To: Aamir Bohra
aamir.bohra@intel.com
Comment-In-Reply-To: Nico Huber
nico.h@gmx.de
Gerrit-MessageType: comment