diff options
Diffstat (limited to 'c/src/lib/libbsp/arm/beagle/misc')
-rw-r--r-- | c/src/lib/libbsp/arm/beagle/misc/boot.c | 62 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/beagle/misc/i2c.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/beagle/misc/restart.c | 32 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/beagle/misc/system-clocks.c | 140 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/beagle/misc/timer.c | 46 |
5 files changed, 1 insertions, 281 deletions
diff --git a/c/src/lib/libbsp/arm/beagle/misc/boot.c b/c/src/lib/libbsp/arm/beagle/misc/boot.c deleted file mode 100644 index 771df7007d..0000000000 --- a/c/src/lib/libbsp/arm/beagle/misc/boot.c +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file - * - * @ingroup beagle_boot - * - * @brief Boot support implementation. - */ - -/* - * Copyright (c) 2012 Claas Ziemke. All rights reserved. - * - * Claas Ziemke - * Kernerstrasse 11 - * 70182 Stuttgart - * Germany - * <claas.ziemke@gmx.net> - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - -#include <string.h> - -#include <bsp/boot.h> - -void beagle_setup_boot_block( - beagle_boot_block *boot_block, - uint8_t icr, - uint8_t page_count -) -{ - memset(boot_block, 0, sizeof(*boot_block)); - - ++page_count; - - boot_block->field.d0 = icr; - boot_block->field.d2 = icr; - boot_block->field.d4 = page_count; - boot_block->field.d6 = page_count; - boot_block->field.d8 = page_count; - boot_block->field.d10 = page_count; - - icr = (uint8_t) ~((unsigned) icr); - page_count = (uint8_t) ~((unsigned) page_count); - - boot_block->field.d1 = icr; - boot_block->field.d3 = icr; - boot_block->field.d5 = page_count; - boot_block->field.d7 = page_count; - boot_block->field.d9 = page_count; - boot_block->field.d11 = page_count; - - boot_block->field.d12 = 0xaa; -} - -void beagle_set_boot_block_bad( - beagle_boot_block *boot_block -) -{ - boot_block->field.d12 = 0; -} diff --git a/c/src/lib/libbsp/arm/beagle/misc/i2c.c b/c/src/lib/libbsp/arm/beagle/misc/i2c.c index 322c501d3c..ad23f3a2ac 100644 --- a/c/src/lib/libbsp/arm/beagle/misc/i2c.c +++ b/c/src/lib/libbsp/arm/beagle/misc/i2c.c @@ -1,7 +1,7 @@ /** * @file * - * @ingroup beagle_i2c + * @ingroup arm_beagle * * @brief I2C support implementation. */ diff --git a/c/src/lib/libbsp/arm/beagle/misc/restart.c b/c/src/lib/libbsp/arm/beagle/misc/restart.c deleted file mode 100644 index fe7775ae06..0000000000 --- a/c/src/lib/libbsp/arm/beagle/misc/restart.c +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file - * - * @ingroup beagle - * - * @brief Restart implementation. - */ - -/* - * Copyright (c) 2012 Claas Ziemke. All rights reserved. - * - * Claas Ziemke - * Kernerstrasse 11 - * 70182 Stuttgart - * Germany - * <claas.ziemke@gmx.net> - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - -#include <rtems.h> - -#include <libcpu/arm-cp15.h> - -#include <bsp.h> - -void bsp_restart(void *addr) -{ - BEAGLE_DO_RESTART(addr); -} diff --git a/c/src/lib/libbsp/arm/beagle/misc/system-clocks.c b/c/src/lib/libbsp/arm/beagle/misc/system-clocks.c deleted file mode 100644 index 56b5d9aadb..0000000000 --- a/c/src/lib/libbsp/arm/beagle/misc/system-clocks.c +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file - * - * @ingroup beagle - * - * @brief System clocks. - */ - -/* - * Copyright (c) 2012 Claas Ziemke. All rights reserved. - * - * Claas Ziemke - * Kernerstrasse 11 - * 70182 Stuttgart - * Germany - * <claas.ziemke@gmx.net> - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - -#include <bsp.h> -#include <bsp/beagle.h> - -uint32_t beagle_sysclk(void) -{ - uint32_t sysclk_ctrl = BEAGLE_SYSCLK_CTRL; - - return (sysclk_ctrl & 0x1) == 0 ? - BEAGLE_OSCILLATOR_MAIN - : (397 * BEAGLE_OSCILLATOR_RTC); -} - -uint32_t beagle_hclkpll_clk(void) -{ - uint32_t sysclk = beagle_sysclk(); - uint32_t hclkpll_ctrl = BEAGLE_HCLKPLL_CTRL; - uint32_t m = HCLK_PLL_M_GET(hclkpll_ctrl) + 1; - uint32_t n = HCLK_PLL_N_GET(hclkpll_ctrl) + 1; - uint32_t p = 1U << HCLK_PLL_P_GET(hclkpll_ctrl); - uint32_t hclkpll_clk = 0; - - if ((hclkpll_ctrl & HCLK_PLL_BYPASS) != 0) { - if ((hclkpll_ctrl & HCLK_PLL_DIRECT) != 0) { - hclkpll_clk = sysclk; - } else { - hclkpll_clk = sysclk / (2 * p); - } - } else { - if ((hclkpll_ctrl & HCLK_PLL_DIRECT) != 0) { - hclkpll_clk = (m * sysclk) / n; - } else { - if ((hclkpll_ctrl & HCLK_PLL_FBD_FCLKOUT) != 0) { - hclkpll_clk = m * (sysclk / n); - } else { - hclkpll_clk = (m / (2 * p)) * (sysclk / n); - } - } - } - - return hclkpll_clk; -} - -uint32_t beagle_periph_clk(void) -{ - uint32_t pwr_ctrl = BEAGLE_PWR_CTRL; - uint32_t periph_clk = 0; - - if ((pwr_ctrl & PWR_NORMAL_RUN_MODE) != 0) { - uint32_t hclkdiv_ctrl = BEAGLE_HCLKDIV_CTRL; - uint32_t div = HCLK_DIV_PERIPH_CLK_GET(hclkdiv_ctrl) + 1; - - periph_clk = beagle_hclkpll_clk() / div; - } else { - periph_clk = beagle_sysclk(); - } - - return periph_clk; -} - -uint32_t beagle_hclk(void) -{ - uint32_t pwr_ctrl = BEAGLE_PWR_CTRL; - uint32_t hclk = 0; - - if ((pwr_ctrl & PWR_HCLK_USES_PERIPH_CLK) != 0) { - hclk = beagle_periph_clk(); - } else { - if ((pwr_ctrl & PWR_NORMAL_RUN_MODE) != 0) { - uint32_t hclkdiv_ctrl = BEAGLE_HCLKDIV_CTRL; - uint32_t div = 1U << HCLK_DIV_HCLK_GET(hclkdiv_ctrl); - - hclk = beagle_hclkpll_clk() / div; - } else { - hclk = beagle_sysclk(); - } - } - - return hclk; -} - -uint32_t beagle_arm_clk(void) -{ - uint32_t pwr_ctrl = BEAGLE_PWR_CTRL; - uint32_t arm_clk = 0; - - if ((pwr_ctrl & PWR_HCLK_USES_PERIPH_CLK) != 0) { - arm_clk = beagle_periph_clk(); - } else { - if ((pwr_ctrl & PWR_NORMAL_RUN_MODE) != 0) { - arm_clk = beagle_hclkpll_clk(); - } else { - arm_clk = beagle_sysclk(); - } - } - - return arm_clk; -} - -uint32_t beagle_dram_clk(void) -{ - uint32_t hclkdiv_ctrl = BEAGLE_HCLKDIV_CTRL; - uint32_t div = HCLK_DIV_DDRAM_CLK_GET(hclkdiv_ctrl); - uint32_t dram_clk = 0; - - if (div != 0) { - uint32_t pwr_ctrl = BEAGLE_PWR_CTRL; - - if ((pwr_ctrl & PWR_NORMAL_RUN_MODE) != 0) { - dram_clk = beagle_hclkpll_clk(); - } else { - dram_clk = beagle_sysclk(); - } - - dram_clk /= div; - } - - return dram_clk; -} diff --git a/c/src/lib/libbsp/arm/beagle/misc/timer.c b/c/src/lib/libbsp/arm/beagle/misc/timer.c deleted file mode 100644 index 50570e0b00..0000000000 --- a/c/src/lib/libbsp/arm/beagle/misc/timer.c +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file - * - * @ingroup beagle - * - * @brief Benchmark timer support. - */ - -/* - * Copyright (c) 2012 Claas Ziemke. All rights reserved. - * - * Claas Ziemke - * Kernerstrasse 11 - * 70182 Stuttgart - * Germany - * <claas.ziemke@gmx.net> - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - -#include <rtems.h> -#include <rtems/btimer.h> -#include <rtems/timerdrv.h> - -#include <bsp.h> - -static uint32_t benchmark_timer_base; - -void benchmark_timer_initialize(void) -{ - benchmark_timer_base = beagleboard_timer(); -} - -uint32_t benchmark_timer_read(void) -{ - return beagleboard_timer() - benchmark_timer_base; -} - -void benchmark_timer_disable_subtracting_average_overhead( - bool find_average_overhead -) -{ - /* VOID */ -} |