aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorMathieu Poirier <mathieu.poirier@linaro.org>2016-08-25 17:19:15 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 07:05:43 -0400
commit6cccf66354fabb48de88238bf1343f774113a133 (patch)
treef346545728a36b2f4c9953daaeca32dd6688e67d /drivers/hwtracing
parent5edd944b43223257033a12096ad08298b01a47de (diff)
coresight: etm4x: adding range filter configuration function
Introducing a new function to do address range configuration generic enough to work for any address range and any comparator. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/coresight/coresight-etm4x.c56
1 files changed, 38 insertions, 18 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index 04462fffe8e4..aca624010b9f 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -581,16 +581,10 @@ static void etm4_set_default_config(struct etmv4_config *config)
581 config->vinst_ctrl |= BIT(0); 581 config->vinst_ctrl |= BIT(0);
582} 582}
583 583
584static void etm4_set_default_filter(struct etmv4_config *config) 584static void etm4_set_comparator_filter(struct etmv4_config *config,
585 u64 start, u64 stop, int comparator)
585{ 586{
586 u64 start, stop, access_type = 0; 587 u64 access_type = 0;
587
588 /*
589 * Configure address range comparator '0' to encompass all
590 * possible addresses.
591 */
592 start = 0x0;
593 stop = ~0x0;
594 588
595 /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */ 589 /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */
596 access_type = ETM_EXLEVEL_NS_HYP; 590 access_type = ETM_EXLEVEL_NS_HYP;
@@ -604,20 +598,46 @@ static void etm4_set_default_filter(struct etmv4_config *config)
604 ETM_EXLEVEL_S_HYP); 598 ETM_EXLEVEL_S_HYP);
605 599
606 /* First half of default address comparator */ 600 /* First half of default address comparator */
607 config->addr_val[ETM_DEFAULT_ADDR_COMP] = start; 601 config->addr_val[comparator] = start;
608 config->addr_acc[ETM_DEFAULT_ADDR_COMP] = access_type; 602 config->addr_acc[comparator] = access_type;
609 config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE; 603 config->addr_type[comparator] = ETM_ADDR_TYPE_RANGE;
610 604
611 /* Second half of default address comparator */ 605 /* Second half of default address comparator */
612 config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = stop; 606 config->addr_val[comparator + 1] = stop;
613 config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = access_type; 607 config->addr_acc[comparator + 1] = access_type;
614 config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE; 608 config->addr_type[comparator + 1] = ETM_ADDR_TYPE_RANGE;
609
610 /*
611 * Configure the ViewInst function to include this address range
612 * comparator.
613 *
614 * @comparator is divided by two since it is the index in the
615 * etmv4_config::addr_val array but register TRCVIIECTLR deals with
616 * address range comparator _pairs_.
617 *
618 * Therefore:
619 * index 0 -> compatator pair 0
620 * index 2 -> comparator pair 1
621 * index 4 -> comparator pair 2
622 * ...
623 * index 14 -> comparator pair 7
624 */
625 config->viiectlr |= BIT(comparator / 2);
626}
627
628static void etm4_set_default_filter(struct etmv4_config *config)
629{
630 u64 start, stop;
615 631
616 /* 632 /*
617 * Configure the ViewInst function to filter on address range 633 * Configure address range comparator '0' to encompass all
618 * comparator '0'. 634 * possible addresses.
619 */ 635 */
620 config->viiectlr = BIT(0); 636 start = 0x0;
637 stop = ~0x0;
638
639 etm4_set_comparator_filter(config, start, stop,
640 ETM_DEFAULT_ADDR_COMP);
621 641
622 /* 642 /*
623 * TRCVICTLR::SSSTATUS == 1, the start-stop logic is 643 * TRCVICTLR::SSSTATUS == 1, the start-stop logic is