pci: Add Linux sysfs implementation of HW.PCI.Dev
In Linux' sysfs, each PCI device has a directory like:
/sys/devices/pci0000:00/0000:00:02.0/
Therein, the file `config` represents the PCI device's configuration
space. Alas, it's not mappable so we work on a read only copy. Should
we ever need dynamic read/write access, we'd have to implement it
using read()/write().
IO and MMIO resources are represented by mappable files, `resource[0-5]`
for uncacheable accesses and `resource[0-5]_wc` for write-combining
access.
Change-Id: I1358e9336edaf75e8eff50808a8169b997817d7e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20554
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/configs/defconfig b/configs/defconfig
index 57a7017..5b96b16 100644
--- a/configs/defconfig
+++ b/configs/defconfig
@@ -7,3 +7,4 @@
CONFIG_HWBASE_POSIX_FILE =
CONFIG_HWBASE_DEFAULT_MMCONF = 16\#f000_0000\#
CONFIG_HWBASE_DIRECT_PCIDEV = y
+CONFIG_HWBASE_LINUX_PCIDEV =
diff --git a/configs/linux b/configs/linux
new file mode 100644
index 0000000..1e22877
--- /dev/null
+++ b/configs/linux
@@ -0,0 +1,10 @@
+CONFIG_HWBASE_DEBUG_NULL =
+CONFIG_HWBASE_DEBUG_TEXT_IO = y
+CONFIG_HWBASE_STATIC_MMIO =
+CONFIG_HWBASE_DYNAMIC_MMIO = y
+CONFIG_HWBASE_TIMER_CLOCK_GETTIME = y
+CONFIG_HWBASE_TIMER_MUTIME =
+CONFIG_HWBASE_POSIX_FILE = y
+CONFIG_HWBASE_DEFAULT_MMCONF = 0
+CONFIG_HWBASE_DIRECT_PCIDEV =
+CONFIG_HWBASE_LINUX_PCIDEV = y
diff --git a/configs/posix b/configs/posix
index be1163e..8be6148 100644
--- a/configs/posix
+++ b/configs/posix
@@ -7,3 +7,4 @@
CONFIG_HWBASE_POSIX_FILE = y
CONFIG_HWBASE_DEFAULT_MMCONF = 0
CONFIG_HWBASE_DIRECT_PCIDEV =
+CONFIG_HWBASE_LINUX_PCIDEV =