Changeset e3e2b6c7 in mainline


Ignore:
Timestamp:
2013-02-10T22:20:02Z (11 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
40762c6
Parents:
ed0a9c5
Message:

add a function to get the sys clock frequency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/include/drivers/am335x/ctrl_module.h

    red0a9c5 re3e2b6c7  
    4242#define AM335x_CTRL_MODULE_SIZE          131072 /* 128 Kb */
    4343
     44static unsigned am335x_ctrl_module_clock_freq_get(void *base)
     45{
     46        unsigned const control_status = AM335x_CTRL_MODULE_REG_ADDR(base,
     47            CONTROL_SYSCONFIG);
     48        unsigned const sysboot = (control_status >> 22) & 0x03;
     49
     50        switch (sysboot) {
     51        default:
     52        case 0:
     53                return 19200000; /* 19.2 Mhz */
     54        case 1:
     55                return 24000000; /* 24 Mhz */
     56        case 2:
     57                return 25000000; /* 25 Mhz */
     58        case 3:
     59                return 26000000; /* 26 Mhz */
     60        }
     61}
     62
    4463#endif
    4564
Note: See TracChangeset for help on using the changeset viewer.