From 1f1d1af041ed13fb38db9912beb26ba975091878 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 18 Dec 2017 13:45:38 +0100 Subject: [PATCH] dde_linux: enable pci config command memory access Issue #2620 --- repos/dde_linux/src/include/lx_kit/internal/pci_dev.h | 6 +++++- repos/dde_linux/src/lx_kit/malloc.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h b/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h index 5fc78eea42..74796155d9 100644 --- a/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h +++ b/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h @@ -122,6 +122,7 @@ class Lx::Pci_dev : public pci_dev, public Lx_kit::List::Element /* setup resources */ bool io = false; + bool mem = false; for (int i = 0; i < Device::NUM_RESOURCES; i++) { Device::Resource res = _client.resource(i); if (res.type() == Device::Resource::INVALID) @@ -141,11 +142,14 @@ class Lx::Pci_dev : public pci_dev, public Lx_kit::List::Element _io_port.session(res.base(), res.size(), _client.io_port(virt_bar)); io = true; } + if (res.type() == Device::Resource::MEMORY) + mem = true; } - /* enable bus master and io bits */ + /* enable bus master, memory and io bits */ uint16_t cmd = _client.config_read(CMD, Device::ACCESS_16BIT); cmd |= io ? 0x1 : 0; + cmd |= mem ? 0x2 : 0; /* enable bus master */ cmd |= 0x4; diff --git a/repos/dde_linux/src/lx_kit/malloc.cc b/repos/dde_linux/src/lx_kit/malloc.cc index 6784d9ca9c..9fb6e456ff 100644 --- a/repos/dde_linux/src/lx_kit/malloc.cc +++ b/repos/dde_linux/src/lx_kit/malloc.cc @@ -253,7 +253,7 @@ class Lx_kit::Malloc : public Lx::Malloc if (msb > SLAB_STOP_LOG2) { Genode::error("slab too large ", - 1UL << msb, "reqested ", size, " cached ", (int)_cached); + 1UL << msb, " requested ", size, " cached ", (int)_cached); return 0; }