Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 590ce352 in mainline


Ignore:
Timestamp:
2012-03-07T21:07:55Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
13be128d
Parents:
b8e56d9b
Message:

breagleboard: Use amdm37x timer1 as system timer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c

    rb8e56d9b r590ce352  
    3737#include <genarch/drivers/amdm37x_irc/amdm37x_irc.h>
    3838#include <genarch/drivers/amdm37x_uart/amdm37x_uart.h>
     39#include <genarch/drivers/amdm37x_gpt/amdm37x_gpt.h>
    3940#include <interrupt.h>
    4041#include <mm/km.h>
     
    5960        amdm37x_irc_regs_t *irc_addr;
    6061        amdm37x_uart_t uart;
     62        amdm37x_gpt_t timer;
    6163} beagleboard;
    6264
    6365struct arm_machine_ops bbxm_machine_ops = {
    64         bbxm_init,
    65         bbxm_timer_irq_start,
    66         bbxm_cpu_halt,
    67         bbxm_get_memory_extents,
    68         bbxm_irq_exception,
    69         bbxm_frame_init,
    70         bbxm_output_init,
    71         bbxm_input_init,
    72         bbxm_get_irq_count,
    73         bbxm_get_platform_name
     66        .machine_init = bbxm_init,
     67        .machine_timer_irq_start = bbxm_timer_irq_start,
     68        .machine_cpu_halt = bbxm_cpu_halt,
     69        .machine_get_memory_extents = bbxm_get_memory_extents,
     70        .machine_irq_exception = bbxm_irq_exception,
     71        .machine_frame_init = bbxm_frame_init,
     72        .machine_output_init = bbxm_output_init,
     73        .machine_input_init = bbxm_input_init,
     74        .machine_get_irq_count = bbxm_get_irq_count,
     75        .machine_get_platform_name = bbxm_get_platform_name
    7476};
    7577
     
    98100        amdm37x_irc_init(beagleboard.irc_addr);
    99101
    100         //initialize timer here
     102        // TODO: setup 32kHz clock source for timer1
     103
     104        /* Initialize timer, pick timer1, beacues it is in always power domain
     105         * and has special capabilities for regular ticks */
     106        amdm37x_gpt_timer_ticks_init(&beagleboard.timer,
     107            AMDM37x_GPT1_BASE_ADDRESS, AMDM37x_GPT1_SIZE, 100);
    101108}
    102109
     
    107114        irq_initialize(&timer_irq);
    108115        timer_irq.devno = device_assign_devno();
    109         timer_irq.inr = 0;//BB_TIMER_IRQ;
     116        timer_irq.inr = AMDM37x_GPT1_IRQ;
    110117        timer_irq.claim = bb_timer_irq_claim;
    111118        timer_irq.handler = bb_timer_irq_handler;
    112119        irq_register(&timer_irq);
    113         // start timer here
     120
     121        /* Start timer here */
     122        amdm37x_gpt_timer_ticks_start(&beagleboard.timer);
    114123}
    115124
    116125static void bbxm_cpu_halt(void)
    117126{
     127        while (1);
    118128}
    119129
     
    125135static void bbxm_get_memory_extents(uintptr_t *start, size_t *size)
    126136{
    127         // FIXME: This is just a guess...
    128137        *start = BBXM_MEMORY_START;
    129138        *size = BBXM_MEMORY_SIZE;
     
    156165#error "Frame buffer is not yet supported!"
    157166#endif
    158 
    159167        /* UART3 is wired to external RS232 connector */
    160168        const bool ok = amdm37x_uart_init(&beagleboard.uart,
Note: See TracChangeset for help on using the changeset viewer.