From ee6f5f3b1b0f8dfa11058442f18b8346f40a8a7d Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 8 Jan 2024 12:57:57 +0100 Subject: [PATCH] base: remove deprecated driver files As far as I can tell, these file are not used anymore. Ref #4081 --- .../drivers/platform/bcm2837_control.h | 61 --------------- repos/base/src/timer/gpt/imx7/target.inc | 9 --- repos/base/src/timer/gpt/imx7/timer.cc | 29 ------- repos/base/src/timer/gpt/time_source.cc | 75 ------------------ repos/base/src/timer/gpt/time_source.h | 76 ------------------- 5 files changed, 250 deletions(-) delete mode 100644 repos/base/include/drivers/platform/bcm2837_control.h delete mode 100644 repos/base/src/timer/gpt/imx7/target.inc delete mode 100644 repos/base/src/timer/gpt/imx7/timer.cc delete mode 100644 repos/base/src/timer/gpt/time_source.cc delete mode 100644 repos/base/src/timer/gpt/time_source.h diff --git a/repos/base/include/drivers/platform/bcm2837_control.h b/repos/base/include/drivers/platform/bcm2837_control.h deleted file mode 100644 index d5f200621c..0000000000 --- a/repos/base/include/drivers/platform/bcm2837_control.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * \brief Driver for the platform specific functionality for bcm2837 - * \author Tomasz Gajewski - * \date 2019-12-28 - */ - -/* - * Copyright (C) 2011-2019 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -#ifndef _INCLUDE__DRIVERS__PLATFORM__BCM2837_CONTROL_H_ -#define _INCLUDE__DRIVERS__PLATFORM__BCM2837_CONTROL_H_ - -/* Genode includes */ -#include - - -namespace Genode { class Bcm2837_control; } - - -class Genode::Bcm2837_control : Mmio -{ - public: - - struct ControlRegister : public Register<0x0, 32> - { - struct CoreTimeClockSource : Bitfield<8,1> { }; - struct TimerIncrement : Bitfield<9,1> { }; - }; - - struct CoreTimerPrescaler : public Register<0x8, 32> - { - }; - - inline Bcm2837_control(addr_t const base); - - inline void initialize_timer_frequency(); -}; - - -Genode::Bcm2837_control::Bcm2837_control(addr_t const base) -: - Mmio(base) -{ } - - -void Genode::Bcm2837_control::initialize_timer_frequency() -{ - /* - * Set prescaler value to achieve divider value equal to 1. - * Value taken from chapter "3.1.1 Timer clock" from QA7_rev3.4.pdf - * document describing the BCM2836 chip. - */ - write(0x80000000); -} - - -#endif /* _INCLUDE__DRIVERS__PLATFORM__BCM2837_CONTROL_H_ */ diff --git a/repos/base/src/timer/gpt/imx7/target.inc b/repos/base/src/timer/gpt/imx7/target.inc deleted file mode 100644 index 88b3156972..0000000000 --- a/repos/base/src/timer/gpt/imx7/target.inc +++ /dev/null @@ -1,9 +0,0 @@ -TARGET = imx7_timer_drv -REQUIRES = arm_v7 -GEN_DIR := $(BASE_DIR)/src/timer -INC_DIR += $(GEN_DIR)/gpt -SRC_CC += gpt/time_source.cc gpt/imx7/timer.cc - -include $(GEN_DIR)/target.inc - -vpath %.cc $(GEN_DIR) diff --git a/repos/base/src/timer/gpt/imx7/timer.cc b/repos/base/src/timer/gpt/imx7/timer.cc deleted file mode 100644 index b62e97c4a6..0000000000 --- a/repos/base/src/timer/gpt/imx7/timer.cc +++ /dev/null @@ -1,29 +0,0 @@ -/* - * \brief Time source for i.MX7 (GPT1) - * \author Stefan Kalkowski - * \date 2019-04-13 - */ - -/* - * Copyright (C) 2019 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* local include */ -#include - -using namespace Genode; - -enum { - MMIO_BASE = 0x302d0000, - MMIO_SIZE = 0x1000, - IRQ = 87, -}; - - -Timer::Time_source::Time_source(Env &env) -: Attached_mmio(env, MMIO_BASE, MMIO_SIZE), - Signalled_time_source(env), - _timer_irq(env, unsigned(IRQ)) { _initialize(); } diff --git a/repos/base/src/timer/gpt/time_source.cc b/repos/base/src/timer/gpt/time_source.cc deleted file mode 100644 index 7580152b6f..0000000000 --- a/repos/base/src/timer/gpt/time_source.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* - * \brief Time source that uses the General Purpose Timer (Freescale) - * \author Stefan Kalkowski - * \date 2019-04-13 - */ - -/* - * Copyright (C) 2019 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* local includes */ -#include - -using namespace Genode; - - -void Timer::Time_source::set_timeout(Genode::Microseconds duration, - Timeout_handler &handler) -{ - _handler = &handler; - - /* set to minimum ticks value to not miss a too short timeout */ - uint32_t const ticks = - max((uint32_t)1, (uint32_t)((duration.value * TICKS_PER_MS) / 1000)); - - /* clear interrupts */ - if (read()) { - write(0xffffffff); - _timer_irq.ack_irq(); - } - - /* set new timeout */ - write(read() + ticks); -} - - -Duration Timer::Time_source::curr_time() -{ - Cnt::access_t cur_cnt = read(); - Genode::Microseconds us(timer_ticks_to_us(cur_cnt - _last_cnt, TICKS_PER_MS)); - _last_cnt = cur_cnt; - _curr_time.add(us); - return _curr_time; -} - - -Microseconds Timer::Time_source::max_timeout() const -{ - static unsigned long max = timer_ticks_to_us(0xffffffff, TICKS_PER_MS); - return Genode::Microseconds(max); -} - - -void Timer::Time_source::_initialize() -{ - _timer_irq.sigh(_signal_handler); - - write(0); - write(0); - write(0); - write(0); - write(0); - write(0); - write(0); - write(Cr::Clk_src::HIGH_FREQ_REF_CLK); - while (read()) ; - write(0); - write(1); - write(1); - write(1); - write(1); -} diff --git a/repos/base/src/timer/gpt/time_source.h b/repos/base/src/timer/gpt/time_source.h deleted file mode 100644 index 4a5a3d1e50..0000000000 --- a/repos/base/src/timer/gpt/time_source.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * \brief Time source that uses the General Purpose Timer (Freescale) - * \author Stefan Kalkowski - * \date 2019-04-13 - */ - -/* - * Copyright (C) 2019 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -#ifndef _TIME_SOURCE_H_ -#define _TIME_SOURCE_H_ - -/* Genode includes */ -#include -#include -#include - -/* local includes */ -#include - -namespace Timer { class Time_source; } - - -class Timer::Time_source : private Genode::Attached_mmio, - public Genode::Signalled_time_source -{ - private: - - enum { TICKS_PER_MS = 500 }; - - struct Cr : Register<0x0, 32> - { - struct En : Bitfield<0, 1> { }; - struct En_mod : Bitfield<1, 1> { }; - struct Clk_src : Bitfield<6, 3> { enum { HIGH_FREQ_REF_CLK = 2 }; }; - struct Frr : Bitfield<9, 1> { }; - struct Swr : Bitfield<15, 1> { }; - }; - - struct Pr : Register<0x4, 32> { }; - struct Sr : Register<0x8, 32> { }; - struct Ir : Register<0xc, 32> { }; - struct Ocr1 : Register<0x10, 32> { }; - struct Ocr2 : Register<0x14, 32> { }; - struct Ocr3 : Register<0x18, 32> { }; - struct Icr1 : Register<0x1c, 32> { }; - struct Icr2 : Register<0x20, 32> { }; - struct Cnt : Register<0x24, 32> { }; - - - Genode::Irq_connection _timer_irq; - Genode::Duration _curr_time { Genode::Microseconds(0) }; - Cnt::access_t _last_cnt { 0 }; - - void _initialize(); - - public: - - Time_source(Genode::Env &env); - - - /************************* - ** Genode::Time_source ** - *************************/ - - Genode::Duration curr_time() override; - void set_timeout(Genode::Microseconds duration, - Genode::Timeout_handler &handler) override; - Genode::Microseconds max_timeout() const override; -}; - -#endif /* _TIME_SOURCE_H_ */