aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorMathieu Poirier <mathieu.poirier@linaro.org>2016-08-25 17:19:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 07:05:43 -0400
commit5edd944b43223257033a12096ad08298b01a47de (patch)
treeb81a116181aa5f366796b454b749e7ea3141c7e4 /drivers/hwtracing
parent2a5695a585b5aa1fe7b51679f90d994a596a1ec2 (diff)
coresight: etm4x: cleaning up default filter configuration
The default filter configuration was hard to read and included some redundancy. This patch attempts to stream line configuration and improve readability. No change of functionality is included. 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.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index f890d1de39e3..04462fffe8e4 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -583,39 +583,34 @@ static void etm4_set_default_config(struct etmv4_config *config)
583 583
584static void etm4_set_default_filter(struct etmv4_config *config) 584static void etm4_set_default_filter(struct etmv4_config *config)
585{ 585{
586 /* 586 u64 start, stop, access_type = 0;
587 * TRCVICTLR::SSSTATUS == 1, the start-stop logic is
588 * in the started state
589 */
590 config->vinst_ctrl |= BIT(9);
591 587
592 /* 588 /*
593 * Configure address range comparator '0' to encompass all 589 * Configure address range comparator '0' to encompass all
594 * possible addresses. 590 * possible addresses.
595 */ 591 */
592 start = 0x0;
593 stop = ~0x0;
596 594
597 /* First half of default address comparator: start at address 0 */ 595 /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */
598 config->addr_val[ETM_DEFAULT_ADDR_COMP] = 0x0; 596 access_type = ETM_EXLEVEL_NS_HYP;
599 /* trace instruction addresses */
600 config->addr_acc[ETM_DEFAULT_ADDR_COMP] &= ~(BIT(0) | BIT(1));
601 /* EXLEVEL_NS, bits[12:15], only trace application and kernel space */
602 config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= ETM_EXLEVEL_NS_HYP;
603 /* EXLEVEL_S, bits[11:8], don't trace anything in secure state */
604 config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= (ETM_EXLEVEL_S_APP |
605 ETM_EXLEVEL_S_OS |
606 ETM_EXLEVEL_S_HYP);
607 config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE;
608 597
609 /* 598 /*
610 * Second half of default address comparator: go all 599 * EXLEVEL_S, bits[11:8], don't trace anything happening
611 * the way to the top. 600 * in secure state.
612 */ 601 */
613 config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = ~0x0; 602 access_type |= (ETM_EXLEVEL_S_APP |
614 /* trace instruction addresses */ 603 ETM_EXLEVEL_S_OS |
615 config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] &= ~(BIT(0) | BIT(1)); 604 ETM_EXLEVEL_S_HYP);
616 /* Address comparator type must be equal for both halves */ 605
617 config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = 606 /* First half of default address comparator */
618 config->addr_acc[ETM_DEFAULT_ADDR_COMP]; 607 config->addr_val[ETM_DEFAULT_ADDR_COMP] = start;
608 config->addr_acc[ETM_DEFAULT_ADDR_COMP] = access_type;
609 config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE;
610
611 /* Second half of default address comparator */
612 config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = stop;
613 config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = access_type;
619 config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE; 614 config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE;
620 615
621 /* 616 /*
@@ -624,7 +619,13 @@ static void etm4_set_default_filter(struct etmv4_config *config)
624 */ 619 */
625 config->viiectlr = BIT(0); 620 config->viiectlr = BIT(0);
626 621
627 /* no start-stop filtering for ViewInst */ 622 /*
623 * TRCVICTLR::SSSTATUS == 1, the start-stop logic is
624 * in the started state
625 */
626 config->vinst_ctrl |= BIT(9);
627
628 /* No start-stop filtering for ViewInst */
628 config->vissctlr = 0x0; 629 config->vissctlr = 0x0;
629} 630}
630 631