diff --git a/include/plat/exynos4/plat/machine/timer.h b/include/drivers/timer/exynos4412-mct.h similarity index 71% rename from include/plat/exynos4/plat/machine/timer.h rename to include/drivers/timer/exynos4412-mct.h index d9ff73e6c4dc193a61d9f7de43cf1fda5ef69245..fb325ca6c31321b5307e064b70d5ad6fa26143bc 100644 --- a/include/plat/exynos4/plat/machine/timer.h +++ b/include/drivers/timer/exynos4412-mct.h @@ -10,16 +10,14 @@ * @TAG(DATA61_GPL) */ -#ifndef __PLAT_MACHINE_TIMER_H -#define __PLAT_MACHINE_TIMER_H +#ifndef __DRIVER_TIMER_MCT_EXYNOS4412_H +#define __DRIVER_TIMER_MCT_EXYNOS4412_H -#include <plat/machine/mct.h> - -#define TIMER_CLOCK_HZ 24000000llu +#include <drivers/timer/mct.h> static inline void resetTimer(void) { mct_reset(); } -#endif /* !__PLAT_MACHINE_TIMER_H */ +#endif /* !__DRIVER_TIMER_MCT_EXYNOS4412_H */ diff --git a/include/plat/exynos_common/plat/machine/mct.h b/include/drivers/timer/mct.h similarity index 97% rename from include/plat/exynos_common/plat/machine/mct.h rename to include/drivers/timer/mct.h index d1ac48377b40e3b17aa0eac04509fc1871873392..c6398a77bee6c856654debfaa3a5ea5eaf9a0a44 100644 --- a/include/plat/exynos_common/plat/machine/mct.h +++ b/include/drivers/timer/mct.h @@ -7,8 +7,8 @@ * * @TAG(GD_GPL) */ -#ifndef __PLAT_MACHINE_MCT_H -#define __PLAT_MACHINE_MCT_H +#ifndef __DRIVERS_TIMER_MCT_H +#define __DRIVERS_TIMER_MCT_H #include <stdint.h> @@ -128,4 +128,4 @@ static inline void mct_clear_write_status(void) mct->global.wstat = mct->global.wstat; mct->global.cnt_wstat = mct->global.cnt_wstat; } -#endif /* __PLAT_MACHINE_MCT_H */ +#endif /* __DRIVERS_TIMER_MCT_H */ diff --git a/include/plat/exynos4/plat/machine.h b/include/plat/exynos4/plat/machine.h deleted file mode 100644 index 0d3a823de53e257d2d48488d673949318091889e..0000000000000000000000000000000000000000 --- a/include/plat/exynos4/plat/machine.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2014, General Dynamics C4 Systems - * - * This software may be distributed and modified according to the terms of - * the GNU General Public License version 2. Note that NO WARRANTY is provided. - * See "LICENSE_GPLv2.txt" for details. - * - * @TAG(GD_GPL) - */ - -#ifndef __PLAT_MACHINE_H -#define __PLAT_MACHINE_H - -enum IRQConstants { - maxIRQ = 159 -} platform_interrupt_t; - -#include <arch/machine/gic_pl390.h> - -#endif /* !__PLAT_MACHINE_H */ diff --git a/include/plat/exynos4/plat/machine/hardware.h b/include/plat/exynos4/plat/machine/hardware.h deleted file mode 100644 index 26e6abdfe92107830042acf6b1f0ab7b20c945d7..0000000000000000000000000000000000000000 --- a/include/plat/exynos4/plat/machine/hardware.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2014, General Dynamics C4 Systems - * - * This software may be distributed and modified according to the terms of - * the GNU General Public License version 2. Note that NO WARRANTY is provided. - * See "LICENSE_GPLv2.txt" for details. - * - * @TAG(GD_GPL) - */ - -#ifndef __PLAT_MACHINE_HARDWARE_H -#define __PLAT_MACHINE_HARDWARE_H - -#include <basic_types.h> -#include <linker.h> -#include <plat/machine.h> -#include <plat/machine/devices_gen.h> - -#endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/exynos5/plat/machine.h b/include/plat/exynos5/plat/machine.h deleted file mode 100644 index d0418213fb6014741c9d61089097214374e69fe5..0000000000000000000000000000000000000000 --- a/include/plat/exynos5/plat/machine.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, General Dynamics C4 Systems - * - * This software may be distributed and modified according to the terms of - * the GNU General Public License version 2. Note that NO WARRANTY is provided. - * See "LICENSE_GPLv2.txt" for details. - * - * @TAG(GD_GPL) - */ - -#ifndef __PLAT_MACHINE_H -#define __PLAT_MACHINE_H - -#include <config.h> - -enum IRQConstants { - maxIRQ = 232 -} platform_interrupt_t; - -#include <arch/machine/gic_pl390.h> - -#endif /* !__PLAT_MACHINE_H */ diff --git a/include/plat/exynos5/plat/machine/hardware.h b/include/plat/exynos5/plat/machine/hardware.h deleted file mode 100644 index d7bfb62a49adfdfbb86e280282e95ad91e268449..0000000000000000000000000000000000000000 --- a/include/plat/exynos5/plat/machine/hardware.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2014, General Dynamics C4 Systems - * - * This software may be distributed and modified according to the terms of - * the GNU General Public License version 2. Note that NO WARRANTY is provided. - * See "LICENSE_GPLv2.txt" for details. - * - * @TAG(GD_GPL) - */ - -#ifndef __PLAT_MACHINE_HARDWARE_H -#define __PLAT_MACHINE_HARDWARE_H - -#include <config.h> -#include <basic_types.h> -#include <linker.h> -#include <arch/object/vcpu.h> -#include <plat/machine.h> -#include <plat/machine/devices_gen.h> - -#endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/exynos5/plat/machine/timer.h b/include/plat/exynos5/plat/machine/timer.h deleted file mode 100644 index 5e0eb5b299596d603cf43973b63e32997f98bef8..0000000000000000000000000000000000000000 --- a/include/plat/exynos5/plat/machine/timer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2017, Data61 - * Commonwealth Scientific and Industrial Research Organisation (CSIRO) - * ABN 41 687 119 230. - * - * This software may be distributed and modified according to the terms of - * the GNU General Public License version 2. Note that NO WARRANTY is provided. - * See "LICENSE_GPLv2.txt" for details. - * - * @TAG(DATA61_GPL) - */ - -#ifndef __PLAT_MACHINE_TIMER_H -#define __PLAT_MACHINE_TIMER_H - -#define TIMER_CLOCK_HZ 24000000llu - -#include <arch/machine/generic_timer.h> - -#endif /* !__PLAT_MACHINE_TIMER_H */ diff --git a/src/drivers/timer/exynos4210-mct.c b/src/drivers/timer/exynos4210-mct.c index a9001508f561ca03be93c8724c08fd381a842f0c..20886be1c42a810d15071d20f53550cd908e7be2 100644 --- a/src/drivers/timer/exynos4210-mct.c +++ b/src/drivers/timer/exynos4210-mct.c @@ -19,7 +19,7 @@ #include <plat/machine/devices_gen.h> #include <plat/machine/hardware.h> #include <arch/machine/generic_timer.h> -#include <plat/machine/mct.h> +#include <drivers/timer/mct.h> timer_t *mct = (timer_t *) EXYNOS_MCT_PPTR; diff --git a/src/drivers/timer/exynos4412-mct.c b/src/drivers/timer/exynos4412-mct.c index 7249fe12f5f674da0eb9e2fe3f107d79298ca590..4ab3e7572218d7b6872a9a8abc1a187185668286 100644 --- a/src/drivers/timer/exynos4412-mct.c +++ b/src/drivers/timer/exynos4412-mct.c @@ -14,7 +14,7 @@ #include <plat/machine.h> #include <linker.h> #include <plat/machine/timer.h> -#include <plat/machine/mct.h> +#include <drivers/timer/mct.h> timer_t *mct = (timer_t *) EXYNOS_MCT_PPTR; diff --git a/src/plat/exynos4/config.cmake b/src/plat/exynos4/config.cmake index f3f4d29fc13c4fc30e4d41200730bd1d342427bd..ac50c124bab0a52a050f35a363c27ced61d61435 100644 --- a/src/plat/exynos4/config.cmake +++ b/src/plat/exynos4/config.cmake @@ -18,6 +18,12 @@ if(KernelPlatformExynos4) config_set(KernelPlatform PLAT "exynos4") config_set(KernelArmMach MACH "exynos") list(APPEND KernelDTSList "tools/dts/exynos4.dts") + declare_default_headers( + TIMER_FREQUENCY 24000000llu + MAX_IRQ 159 + TIMER drivers/timer/exynos4412-mct.h + INTERRUPT_CONTROLLER arch/machine/gic_pl390.h + ) endif() add_sources( diff --git a/src/plat/exynos5/config.cmake b/src/plat/exynos5/config.cmake index d813ccbc856bfcf72b46fffa57f9ef8cfce30aa2..d64af0f71938b28697481f2ca9cec88f6f173806 100644 --- a/src/plat/exynos5/config.cmake +++ b/src/plat/exynos5/config.cmake @@ -26,6 +26,12 @@ if(KernelPlatformExynos5250 OR KernelPlatformExynos5410 OR KernelPlatformExynos5 list(APPEND KernelDTSList "tools/dts/${KernelARMPlatform}.dts") list(APPEND KernelDTSList "src/plat/exynos5/overlay-${KernelARMPlatform}.dts") + declare_default_headers( + TIMER_FREQUENCY 24000000llu + MAX_IRQ 232 + TIMER arch/machine/generic_timer.h + INTERRUPT_CONTROLLER arch/machine/gic_pl390.h + ) else() config_set(KernelPlatExynos5 PLAT_EXYNOS5 OFF) config_set(KernelPlatExynos54xx PLAT_EXYNOS54XX OFF)