summaryrefslogtreecommitdiffstats
path: root/bsps/sparc/leon3/include/bsp
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-19 09:26:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-07-14 12:21:33 +0200
commitd85c505ab0d9699600b3e5724a4badf6dbc1314b (patch)
treef7d440f7af4a718c7db4dbf0e9f83e41195b354d /bsps/sparc/leon3/include/bsp
parentbsp/leon3: Move system control register support (diff)
downloadrtems-d85c505ab0d9699600b3e5724a4badf6dbc1314b.tar.bz2
bsp/leon3: Use new GPTIMER register block API
Diffstat (limited to 'bsps/sparc/leon3/include/bsp')
-rw-r--r--bsps/sparc/leon3/include/bsp/leon3.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/bsps/sparc/leon3/include/bsp/leon3.h b/bsps/sparc/leon3/include/bsp/leon3.h
index 75abc34fb7..aa3898e530 100644
--- a/bsps/sparc/leon3/include/bsp/leon3.h
+++ b/bsps/sparc/leon3/include/bsp/leon3.h
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (C) 2021 embedded brains GmbH & Co. KG
+ * Copyright (C) 2014, 2021 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,6 +37,7 @@
#define LIBBSP_SPARC_LEON3_BSP_LEON3_H
#include <grlib/apbuart-regs.h>
+#include <grlib/gptimer-regs.h>
#include <bsp/irqimpl.h>
@@ -152,6 +153,47 @@ static inline uint32_t leon3_get_data_cache_config_register( void )
}
/**
+ * @brief This constant defines the index of the GPTIMER timer used by the
+ * clock driver.
+ */
+#if defined(RTEMS_MULTIPROCESSING)
+#define LEON3_CLOCK_INDEX \
+ ( rtems_configuration_get_user_multiprocessing_table() ? LEON3_Cpu_Index : 0 )
+#else
+#define LEON3_CLOCK_INDEX 0
+#endif
+
+/**
+ * @brief This constant defines the index of the GPTIMER timer used by the
+ * CPU counter if the CPU counter uses the GPTIMER.
+ */
+#if defined(RTEMS_SMP)
+#define LEON3_COUNTER_GPTIMER_INDEX ( LEON3_CLOCK_INDEX + 1 )
+#else
+#define LEON3_COUNTER_GPTIMER_INDEX LEON3_CLOCK_INDEX
+#endif
+
+/**
+ * @brief This constant defines the frequency set by the boot loader of the
+ * first GPTIMER instance.
+ *
+ * We assume that a boot loader (usually GRMON) initialized the GPTIMER 0 to
+ * run with 1MHz. This is used to determine all clock frequencies of the PnP
+ * devices. See also ambapp_freq_init() and ambapp_freq_get().
+ */
+#define LEON3_GPTIMER_0_FREQUENCY_SET_BY_BOOT_LOADER 1000000
+
+/**
+ * @brief This pointer provides the GPTIMER register block address.
+ */
+extern gptimer *LEON3_Timer_Regs;
+
+/**
+ * @brief This pointer provides the GPTIMER device information block.
+ */
+extern struct ambapp_dev *LEON3_Timer_Adev;
+
+/**
* @brief Gets the LEON up-counter low register (%ASR23) value.
*
* @return Returns the register value.