Ignore:
Timestamp:
2012-11-20T13:08:45Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
19acf24
Parents:
0c12dfe
Message:

rootamdm37x: IMplement IVA2 clock management and allow automatic LP transitions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c

    r0c12dfe r9c0eba6  
    4848#include "uhh.h"
    4949#include "usbtll.h"
     50
    5051#include "cm/core.h"
    5152#include "cm/clock_control.h"
    5253#include "cm/usbhost.h"
    5354#include "cm/mpu.h"
     55#include "cm/iva2.h"
     56
    5457#include "prm/clock_control.h"
    5558
     
    6164        struct {
    6265                mpu_cm_regs_t *mpu;
     66                iva2_cm_regs_t *iva2;
    6367                core_cm_regs_t *core;
    6468                clock_control_cm_regs_t *clocks;
     
    101105                return ret;
    102106
     107        ret = pio_enable((void*)IVA2_CM_BASE_ADDRESS,
     108                    IVA2_CM_SIZE, (void**)&device->cm.iva2);
     109        if (ret != EOK)
     110                return ret;
     111
    103112        ret = pio_enable((void*)CLOCK_CONTROL_PRM_BASE_ADDRESS,
    104113            CLOCK_CONTROL_PRM_SIZE, (void**)&device->prm.clocks);
     
    121130                pio_trace_enable(device->cm.core, CORE_CM_SIZE, log, (void*)CORE_CM_BASE_ADDRESS);
    122131                pio_trace_enable(device->cm.mpu, MPU_CM_SIZE, log, (void*)MPU_CM_BASE_ADDRESS);
     132                pio_trace_enable(device->cm.iva2, IVA2_CM_SIZE, log, (void*)IVA2_CM_BASE_ADDRESS);
    123133                pio_trace_enable(device->cm.usbhost, USBHOST_CM_SIZE, log, (void*)USBHOST_CM_BASE_ADDRESS);
    124134                pio_trace_enable(device->uhh, AMDM37x_UHH_SIZE, log, (void*)AMDM37x_UHH_BASE_ADDRESS);
     
    204214         */
    205215        // TODO: We can probably turn this off entirely. IVA is left unused.
    206         // TODO: Set at least to autoidle to save power
     216        /* Enable low power bypass mode, this will take effect the next lock or
     217         * relock sequence. */
     218        //TODO: We might need to force re-lock after enabling this
     219        pio_set_32(&device->cm.iva2->clken_pll, MPU_CM_CLKEN_PLL_EN_MPU_DPLL_LP_MODE_FLAG, 5);
     220        /* Enable automatic relocking */
     221        pio_change_32(&device->cm.iva2->autoidle_pll, MPU_CM_AUTOIDLE_PLL_AUTO_MPU_DPLL_ENABLED, MPU_CM_AUTOIDLE_PLL_AUTO_MPU_DPLL_MASK, 5);
    207222
    208223        /* DPLL3 provides tons of clocks:
Note: See TracChangeset for help on using the changeset viewer.