From d6332f176784ef45df4cd9b54a73b5e47da5c159 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 15 Apr 2019 15:04:07 +0200 Subject: [PATCH] zynq: make nic driver independent of hw kernel Use uncached ram dataspace for RX and TX communication buffers instead of cache maintainance functions that are not part of the Genode API. Fix #3291 --- .../nic/spec/zynq/{hw => }/buffer_descriptor.h | 0 .../nic/spec/zynq/{hw => }/cadence_gem.h | 18 +----------------- .../src/drivers/nic/spec/zynq/{hw => }/main.cc | 0 .../nic/spec/zynq/{hw => }/marvell_phy.h | 0 .../src/drivers/nic/spec/zynq/{hw => }/phyio.h | 0 .../spec/zynq/{hw => }/rx_buffer_descriptor.h | 0 .../nic/spec/zynq/{hw => }/system_control.h | 0 .../drivers/nic/spec/zynq/{hw => }/target.mk | 4 ++-- .../spec/zynq/{hw => }/tx_buffer_descriptor.h | 0 9 files changed, 3 insertions(+), 19 deletions(-) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/buffer_descriptor.h (100%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/cadence_gem.h (98%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/main.cc (100%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/marvell_phy.h (100%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/phyio.h (100%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/rx_buffer_descriptor.h (100%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/system_control.h (100%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/target.mk (57%) rename repos/os/src/drivers/nic/spec/zynq/{hw => }/tx_buffer_descriptor.h (100%) diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/buffer_descriptor.h b/repos/os/src/drivers/nic/spec/zynq/buffer_descriptor.h similarity index 100% rename from repos/os/src/drivers/nic/spec/zynq/hw/buffer_descriptor.h rename to repos/os/src/drivers/nic/spec/zynq/buffer_descriptor.h diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/cadence_gem.h b/repos/os/src/drivers/nic/spec/zynq/cadence_gem.h similarity index 98% rename from repos/os/src/drivers/nic/spec/zynq/hw/cadence_gem.h rename to repos/os/src/drivers/nic/spec/zynq/cadence_gem.h index 639d4fae97..0b72b9d236 100644 --- a/repos/os/src/drivers/nic/spec/zynq/hw/cadence_gem.h +++ b/repos/os/src/drivers/nic/spec/zynq/cadence_gem.h @@ -28,8 +28,6 @@ #include "rx_buffer_descriptor.h" #include "marvell_phy.h" -#include - namespace Genode { /** @@ -486,16 +484,6 @@ namespace Genode } } - void _invalidate_rx_buffers() - { - Kernel::update_data_region(_rx_buf_region, _rx_buf_size); - } - - void _clean_tx_buffers() - { - Kernel::update_data_region(_tx_buf_region, _tx_buf_size); - } - virtual void _handle_irq() { /* 16.3.9 Receiving Frames */ @@ -503,8 +491,6 @@ namespace Genode const Interrupt_status::access_t status = read(); const Rx_status::access_t rxStatus = read(); - _invalidate_rx_buffers(); - if ( Interrupt_status::Rx_complete::get(status) ) { while (_rx_buffer.next_packet()) { @@ -598,7 +584,7 @@ namespace Genode addr_t const base, size_t const size, const int irq) : Genode::Attached_mmio(env, base, size), - Session_component(tx_buf_size, rx_buf_size, Genode::CACHED, + Session_component(tx_buf_size, rx_buf_size, Genode::UNCACHED, rx_block_md_alloc, env), _timer(env), _sys_ctrl(env, _timer), @@ -707,8 +693,6 @@ namespace Genode { _handle_acks(); - _clean_tx_buffers(); - while (_send()); } }; diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/main.cc b/repos/os/src/drivers/nic/spec/zynq/main.cc similarity index 100% rename from repos/os/src/drivers/nic/spec/zynq/hw/main.cc rename to repos/os/src/drivers/nic/spec/zynq/main.cc diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/marvell_phy.h b/repos/os/src/drivers/nic/spec/zynq/marvell_phy.h similarity index 100% rename from repos/os/src/drivers/nic/spec/zynq/hw/marvell_phy.h rename to repos/os/src/drivers/nic/spec/zynq/marvell_phy.h diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/phyio.h b/repos/os/src/drivers/nic/spec/zynq/phyio.h similarity index 100% rename from repos/os/src/drivers/nic/spec/zynq/hw/phyio.h rename to repos/os/src/drivers/nic/spec/zynq/phyio.h diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/rx_buffer_descriptor.h b/repos/os/src/drivers/nic/spec/zynq/rx_buffer_descriptor.h similarity index 100% rename from repos/os/src/drivers/nic/spec/zynq/hw/rx_buffer_descriptor.h rename to repos/os/src/drivers/nic/spec/zynq/rx_buffer_descriptor.h diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/system_control.h b/repos/os/src/drivers/nic/spec/zynq/system_control.h similarity index 100% rename from repos/os/src/drivers/nic/spec/zynq/hw/system_control.h rename to repos/os/src/drivers/nic/spec/zynq/system_control.h diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/target.mk b/repos/os/src/drivers/nic/spec/zynq/target.mk similarity index 57% rename from repos/os/src/drivers/nic/spec/zynq/hw/target.mk rename to repos/os/src/drivers/nic/spec/zynq/target.mk index 3e6ebbc77b..ebdd6b89a6 100644 --- a/repos/os/src/drivers/nic/spec/zynq/hw/target.mk +++ b/repos/os/src/drivers/nic/spec/zynq/target.mk @@ -1,5 +1,5 @@ -REQUIRES = hw arm_v7 +REQUIRES = arm_v7 TARGET = zynq_nic_drv SRC_CC = main.cc -LIBS = base syscall-hw +LIBS = base INC_DIR += $(PRG_DIR) diff --git a/repos/os/src/drivers/nic/spec/zynq/hw/tx_buffer_descriptor.h b/repos/os/src/drivers/nic/spec/zynq/tx_buffer_descriptor.h similarity index 100% rename from repos/os/src/drivers/nic/spec/zynq/hw/tx_buffer_descriptor.h rename to repos/os/src/drivers/nic/spec/zynq/tx_buffer_descriptor.h