Changeset d1714e8 in mainline


Ignore:
Timestamp:
2012-03-13T04:15:28Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2df8561
Parents:
08d059a
Message:

beagleboardxm,amdm37x: Move clock select to timer initialization routine.

Add comment about temporary variables.

Location:
kernel
Files:
2 edited

Legend:

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

    r08d059a rd1714e8  
    101101        amdm37x_irc_init(beagleboard.irc_addr);
    102102
    103         // TODO find a nicer way to setup 32kHz clock source for timer1
    104         ioport32_t *clksel = (void*) km_map(0x48004C40, 4, PAGE_NOT_CACHEABLE);
    105         *clksel &= ~1;
    106         km_unmap((uintptr_t)clksel, 4);
    107 
    108103        /* Initialize timer, pick timer1, because it is in always-power domain
    109104         * and has special capabilities for regular ticks */
  • kernel/genarch/include/drivers/amdm37x_gpt/amdm37x_gpt.h

    r08d059a rd1714e8  
    198198    amdm37x_gpt_t* timer, uintptr_t ioregs, size_t iosize, unsigned hz)
    199199{
     200        /* Set 32768 Hz clock as source */
     201        // TODO find a nicer way to setup 32kHz clock source for timer1
     202        // reg 0x48004C40 is CM_CLKSEL_WKUP see page 485 of the manual
     203        ioport32_t *clksel = (void*) km_map(0x48004C40, 4, PAGE_NOT_CACHEABLE);
     204        *clksel &= ~1;
     205        km_unmap((uintptr_t)clksel, 4);
     206
    200207        ASSERT(timer);
    201208        /* Map control register */
     
    213220        if (timer->special_available) {
    214221                /* Set values for according to formula (manual p. 2733) */
     222                /* Use temporary variables for easier debugging */
    215223                const uint32_t tpir =
    216224                    ((32768 / hz + 1) * 1000000) - (32768000L * (1000 / hz));
Note: See TracChangeset for help on using the changeset viewer.