diff --git a/repos/base-sel4/recipes/src/base-sel4-imx6q_sabrelite/content.mk b/repos/base-sel4/recipes/src/base-sel4-imx6q_sabrelite/content.mk index 53fb32c480..cf9a157eb8 100644 --- a/repos/base-sel4/recipes/src/base-sel4-imx6q_sabrelite/content.mk +++ b/repos/base-sel4/recipes/src/base-sel4-imx6q_sabrelite/content.mk @@ -35,7 +35,8 @@ etc/board.conf: content: mv lib/mk/spec/arm/ld-sel4.mk lib/mk/spec/arm/ld.mk; - sed -i "s/imx6_timer/timer/" src/timer/epit/imx6/target.inc + cp -r $(GENODE_DIR)/repos/imx/src/timer/epit src/timer/epit + sed -i "s/imx6_timer/timer/" src/timer/epit/target.mk find lib/mk/spec -name kernel-sel4-*.mk -o -name syscall-sel4-*.mk |\ grep -v "sel4-imx6q_sabrelite.mk" | xargs rm -rf diff --git a/repos/base-sel4/src/timer/epit/imx6q_sabrelite/target.mk b/repos/base-sel4/src/timer/epit/imx6q_sabrelite/target.mk deleted file mode 100644 index e7199f8433..0000000000 --- a/repos/base-sel4/src/timer/epit/imx6q_sabrelite/target.mk +++ /dev/null @@ -1 +0,0 @@ -include $(call select_from_repositories,src/timer/epit/imx6/target.inc) diff --git a/repos/base/src/timer/epit/imx6/target.inc b/repos/base/src/timer/epit/imx6/target.inc deleted file mode 100644 index 4b3638bf7a..0000000000 --- a/repos/base/src/timer/epit/imx6/target.inc +++ /dev/null @@ -1,9 +0,0 @@ -TARGET = imx6_timer -REQUIRES = arm_v7 -GEN_DIR := $(dir $(call select_from_repositories,src/timer/main.cc)) -INC_DIR += $(GEN_DIR)/epit -SRC_CC += epit/time_source.cc epit/imx6/timer.cc - -include $(GEN_DIR)/target.inc - -vpath %.cc $(GEN_DIR) diff --git a/repos/base/src/timer/epit/imx6/timer.cc b/repos/base/src/timer/epit/imx6/timer.cc deleted file mode 100644 index ca9073062e..0000000000 --- a/repos/base/src/timer/epit/imx6/timer.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* - * \brief Time source for i.MX6 (EPIT2) - * \author Norman Feske - * \author Martin Stein - * \author Stefan Kalkowski - * \author Alexander Boettcher - * \date 2009-06-16 - */ - -/* - * Copyright (C) 2009-2017 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 - -enum { - EPIT_2_IRQ = 89, - EPIT_2_MMIO_BASE = 0x020d4000, - EPIT_2_MMIO_SIZE = 0x00004000 -}; - -using namespace Genode; - -Timer::Time_source::Time_source(Env &env) -: - Attached_mmio(env, {(char *)EPIT_2_MMIO_BASE, EPIT_2_MMIO_SIZE}), - Signalled_time_source(env), - _timer_irq(env, unsigned(EPIT_2_IRQ)) -{ - _timer_irq.sigh(_signal_handler); - while (read()) ; -} diff --git a/repos/base/src/timer/epit/time_source.cc b/repos/base/src/timer/epit/time_source.cc deleted file mode 100644 index f51eb02312..0000000000 --- a/repos/base/src/timer/epit/time_source.cc +++ /dev/null @@ -1,55 +0,0 @@ -/* - * \brief Time source that uses the Enhanced Periodic Interrupt Timer (Freescale) - * \author Norman Feske - * \author Martin Stein - * \author Stefan Kalkowski - * \author Alexander Boettcher - * \date 2009-06-16 - */ - -/* - * Copyright (C) 2009-2017 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, - Genode::Timeout_handler &handler) -{ - unsigned long const ticks = (unsigned long)((1ULL * duration.value * TICKS_PER_MS) / 1000); - _handler = &handler; - _timer_irq.ack_irq(); - _cleared_ticks = 0; - - /* disable timer */ - write(0); - - /* clear interrupt and install timeout */ - write(1); - write(Cr::prepare_one_shot()); - write(Cnt::MAX - ticks); - - /* start timer */ - write(1); -} - - -Duration Timer::Time_source::curr_time() -{ - unsigned long const uncleared_ticks = Cnt::MAX - read() - _cleared_ticks; - unsigned long const uncleared_us = timer_ticks_to_us(uncleared_ticks, TICKS_PER_MS); - - /* update time only on IRQs and if rate is under 1000 per second */ - if (_irq || uncleared_us > 1000) { - _curr_time.add(Genode::Microseconds(uncleared_us)); - _cleared_ticks += uncleared_ticks; - } - return _curr_time; -} diff --git a/repos/base/src/timer/epit/time_source.h b/repos/base/src/timer/epit/time_source.h deleted file mode 100644 index 7f44e8fc1e..0000000000 --- a/repos/base/src/timer/epit/time_source.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * \brief Time source that uses the Enhanced Periodic Interrupt Timer (Freescale) - * \author Norman Feske - * \author Martin Stein - * \author Stefan Kalkowski - * \date 2009-06-16 - */ - -/* - * Copyright (C) 2009-2017 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<0x14>, - public Genode::Signalled_time_source -{ - private: - - enum { TICKS_PER_MS = 66000 }; - - struct Cr : Register<0x0, 32> - { - struct En : Bitfield<0, 1> { }; - struct En_mod : Bitfield<1, 1> { enum { RELOAD = 1 }; }; - struct Oci_en : Bitfield<2, 1> { }; - struct Swr : Bitfield<16, 1> { }; - struct Clk_src : Bitfield<24, 2> { enum { HIGH_FREQ_REF_CLK = 2 }; }; - - static access_t prepare_one_shot() - { - access_t cr = 0; - En_mod::set(cr, En_mod::RELOAD); - Oci_en::set(cr, 1); - Clk_src::set(cr, Clk_src::HIGH_FREQ_REF_CLK); - return cr; - } - }; - - struct Sr : Register<0x4, 32> { struct Ocif : Bitfield<0, 1> { }; }; - struct Cmpr : Register<0xc, 32> { }; - struct Cnt : Register<0x10, 32> { enum { MAX = ~(access_t)0 }; }; - - Genode::Irq_connection _timer_irq; - Genode::Duration _curr_time { Genode::Microseconds(0) }; - Genode::Microseconds const _max_timeout { Genode::timer_ticks_to_us(Cnt::MAX / 2, TICKS_PER_MS) }; - unsigned long _cleared_ticks { 0 }; - - public: - - Time_source(Genode::Env &env); - - - /************************* - ** Genode::Time_source ** - *************************/ - - Genode::Duration curr_time() override; - void set_timeout(Genode::Microseconds, Genode::Timeout_handler &) override; - Genode::Microseconds max_timeout() const override { return _max_timeout; }; -}; - -#endif /* _TIME_SOURCE_H_ */