File indexing completed on 2025-05-11 08:23:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <rtems.h>
0012 #include <bsp/irq.h>
0013 #include <bsp.h>
0014 #include <s3c24xx.h>
0015
0016 void Clock_isr(rtems_irq_hdl_param arg);
0017 static void clock_isr_on(const rtems_irq_connect_data *unused);
0018 static void clock_isr_off(const rtems_irq_connect_data *unused);
0019 static int clock_isr_is_on(const rtems_irq_connect_data *irq);
0020
0021 rtems_irq_connect_data clock_isr_data = {
0022 .name = BSP_INT_TIMER4,
0023 .hdl = Clock_isr,
0024 .handle = NULL,
0025 .on = clock_isr_on,
0026 .off = clock_isr_off,
0027 .isOn = clock_isr_is_on,
0028 };
0029
0030
0031
0032
0033
0034
0035 #define Clock_driver_support_at_tick(arg) \
0036 do { \
0037 ClearPending(BIT_TIMER4); \
0038 } while(0)
0039
0040
0041
0042
0043
0044 #define Clock_driver_support_install_isr( _new ) \
0045 BSP_install_rtems_irq_handler(&clock_isr_data)
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 #define Clock_driver_support_initialize_hardware() \
0060 do { \
0061 uint32_t cr; \
0062 uint32_t freq; \
0063 \
0064 cr=rTCFG1 & 0xFFF0FFFF; \
0065 rTCFG1=(cr | (3<<16)); \
0066 freq = get_PCLK(); \
0067 \
0068 freq = (freq /16)/16; \
0069 rTCNTB4 = ((freq / 1000) * rtems_configuration_get_microseconds_per_tick()) / 1000; \
0070 \
0071 rINTMSK&=~BIT_TIMER4; \
0072 \
0073 cr=rTCON & 0xFF8FFFFF; \
0074 rTCON=(cr|(0x6<<20)); \
0075 rTCON=(cr|(0x5<<20)); \
0076 } while (0)
0077
0078
0079
0080
0081
0082
0083 static void clock_isr_on(const rtems_irq_connect_data *unused)
0084 {
0085 }
0086
0087
0088
0089
0090
0091
0092 static void clock_isr_off(const rtems_irq_connect_data *unused)
0093 {
0094 return;
0095 }
0096
0097
0098
0099
0100
0101
0102
0103 static int clock_isr_is_on(const rtems_irq_connect_data *irq)
0104 {
0105 return 1;
0106 }
0107
0108 #define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
0109
0110
0111 #include "../../../shared/dev/clock/clockimpl.h"