static int __init mon_kernel_init(void) { int emi_dcm_disable; BM_Init(); disable_infra_dcm(); emi_dcm_disable = BM_GetEmiDcm(); //printk("[MT_MEM_BW]emi_dcm_disable = %d\n", emi_dcm_disable); BM_SetEmiDcm(0xff); //disable EMI dcm BM_SetReadWriteType(BM_BOTH_READ_WRITE); BM_SetMonitorCounter(1, BM_MASTER_MM1 | BM_MASTER_MM1, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetMonitorCounter(2, BM_MASTER_AP_MCU1 | BM_MASTER_AP_MCU2, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetMonitorCounter(3, BM_MASTER_MD_MCU | BM_MASTER_2G_3G_MDDMA, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetMonitorCounter(4, BM_MASTER_GPU1 | BM_MASTER_GPU1, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetLatencyCounter(); // stopping EMI monitors will reset all counters BM_Enable(0); // start EMI monitor counting BM_Enable(1); last_time_ns = sched_clock(); restore_infra_dcm(); BM_SetEmiDcm(emi_dcm_disable); //enable EMI dcm return 0; }
/* * mt65xx_mon_init: Initialize the monitor. * Return 0. */ int mt65xx_mon_init(void) { // extern void dcm_disable_all(void); BM_Init(); // disable system DCM dcm_disable_all(); return 0; }
int mt65xx_mon_init(void) { if (!mt6573_mon_log_buff) { mt6573_mon_log_buff = vmalloc(sizeof(struct mt65xx_mon_log) * MON_LOG_BUFF_LEN); } if (!mt6573_mon_log_buff) { printk(KERN_WARNING "fail to allocate the buffer for the monitor log\n"); } BM_Init(); /* DCM and CPU frequency division may be OFF to force fixed CPU clock rate */ //force_off_dcm(); dcm_disable_state(ALL_STATE); return 0; }
/* * mt65xx_mon_init: Initialize the monitor. * Return 0. */ int mt65xx_mon_init(void) { extern void dcm_disable_all(void); if (!mt6575_mon_log_buff) { mt6575_mon_log_buff = vmalloc(sizeof(struct mt65xx_mon_log) * MON_LOG_BUFF_LEN); if (!mt6575_mon_log_buff) { printk(KERN_WARNING "fail to allocate the buffer for the monitor log\n"); } } BM_Init(); // disable system DCM dcm_disable_all(); return 0; }
static void emi_init(void) { /* Init. EMI bus monitor */ BM_Init(); /* Set R/W Type */ BM_SetReadWriteType(rwtype); /* Set Bandwidth Monitor */ BM_SetMonitorCounter(1, BM_MASTER_AP_MCU, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetMonitorCounter(2, BM_MASTER_CONN_SYS, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetMonitorCounter(3, BM_MASTER_MMSYS, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetMonitorCounter(4, BM_MASTER_MD_MCU, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); BM_SetMonitorCounter(5, BM_MASTER_MD_HW, BM_TRANS_TYPE_4BEAT | BM_TRANS_TYPE_8Byte | BM_TRANS_TYPE_BURST_WRAP); /* Set Latency Monitor */ LM_SetMaster(latency_master); }
int bman_attach(device_t dev) { struct bman_softc *sc; t_BmRevisionInfo rev; t_Error error; t_BmParam bp; sc = device_get_softc(dev); sc->sc_dev = dev; bman_sc = sc; /* Check if MallocSmart allocator is ready */ if (XX_MallocSmartInit() != E_OK) return (ENXIO); /* Allocate resources */ sc->sc_rrid = 0; sc->sc_rres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_rrid, 0, ~0, BMAN_CCSR_SIZE, RF_ACTIVE); if (sc->sc_rres == NULL) return (ENXIO); sc->sc_irid = 0; sc->sc_ires = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, &sc->sc_irid, RF_ACTIVE | RF_SHAREABLE); if (sc->sc_ires == NULL) goto err; /* Initialize BMAN */ memset(&bp, 0, sizeof(bp)); bp.guestId = NCSW_MASTER_ID; bp.baseAddress = rman_get_bushandle(sc->sc_rres); bp.totalNumOfBuffers = BMAN_MAX_BUFFERS; bp.f_Exception = bman_exception; bp.h_App = sc; bp.errIrq = (uintptr_t)sc->sc_ires; bp.partBpidBase = 0; bp.partNumOfPools = BM_MAX_NUM_OF_POOLS; sc->sc_bh = BM_Config(&bp); if (sc->sc_bh == NULL) goto err; /* Warn if there is less than 5% free FPBR's in pool */ error = BM_ConfigFbprThreshold(sc->sc_bh, (BMAN_MAX_BUFFERS / 8) / 20); if (error != E_OK) goto err; error = BM_Init(sc->sc_bh); if (error != E_OK) goto err; error = BM_GetRevision(sc->sc_bh, &rev); if (error != E_OK) goto err; device_printf(dev, "Hardware version: %d.%d.\n", rev.majorRev, rev.minorRev); return (0); err: bman_detach(dev); return (ENXIO); }