Commit 5edd944b authored by Mathieu Poirier's avatar Mathieu Poirier Committed by Greg Kroah-Hartman

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: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2a5695a5
...@@ -583,39 +583,34 @@ static void etm4_set_default_config(struct etmv4_config *config) ...@@ -583,39 +583,34 @@ static void etm4_set_default_config(struct etmv4_config *config)
static void etm4_set_default_filter(struct etmv4_config *config) static void etm4_set_default_filter(struct etmv4_config *config)
{ {
/* u64 start, stop, access_type = 0;
* TRCVICTLR::SSSTATUS == 1, the start-stop logic is
* in the started state
*/
config->vinst_ctrl |= BIT(9);
/* /*
* Configure address range comparator '0' to encompass all * Configure address range comparator '0' to encompass all
* possible addresses. * possible addresses.
*/ */
start = 0x0;
stop = ~0x0;
/* First half of default address comparator: start at address 0 */ /* EXLEVEL_NS, bits[12:15], always stay away from hypervisor mode. */
config->addr_val[ETM_DEFAULT_ADDR_COMP] = 0x0; access_type = ETM_EXLEVEL_NS_HYP;
/* trace instruction addresses */
config->addr_acc[ETM_DEFAULT_ADDR_COMP] &= ~(BIT(0) | BIT(1));
/* EXLEVEL_NS, bits[12:15], only trace application and kernel space */
config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= ETM_EXLEVEL_NS_HYP;
/* EXLEVEL_S, bits[11:8], don't trace anything in secure state */
config->addr_acc[ETM_DEFAULT_ADDR_COMP] |= (ETM_EXLEVEL_S_APP |
ETM_EXLEVEL_S_OS |
ETM_EXLEVEL_S_HYP);
config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE;
/* /*
* Second half of default address comparator: go all * EXLEVEL_S, bits[11:8], don't trace anything happening
* the way to the top. * in secure state.
*/ */
config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = ~0x0; access_type |= (ETM_EXLEVEL_S_APP |
/* trace instruction addresses */ ETM_EXLEVEL_S_OS |
config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] &= ~(BIT(0) | BIT(1)); ETM_EXLEVEL_S_HYP);
/* Address comparator type must be equal for both halves */
config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = /* First half of default address comparator */
config->addr_acc[ETM_DEFAULT_ADDR_COMP]; config->addr_val[ETM_DEFAULT_ADDR_COMP] = start;
config->addr_acc[ETM_DEFAULT_ADDR_COMP] = access_type;
config->addr_type[ETM_DEFAULT_ADDR_COMP] = ETM_ADDR_TYPE_RANGE;
/* Second half of default address comparator */
config->addr_val[ETM_DEFAULT_ADDR_COMP + 1] = stop;
config->addr_acc[ETM_DEFAULT_ADDR_COMP + 1] = access_type;
config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE; config->addr_type[ETM_DEFAULT_ADDR_COMP + 1] = ETM_ADDR_TYPE_RANGE;
/* /*
...@@ -624,7 +619,13 @@ static void etm4_set_default_filter(struct etmv4_config *config) ...@@ -624,7 +619,13 @@ static void etm4_set_default_filter(struct etmv4_config *config)
*/ */
config->viiectlr = BIT(0); config->viiectlr = BIT(0);
/* no start-stop filtering for ViewInst */ /*
* TRCVICTLR::SSSTATUS == 1, the start-stop logic is
* in the started state
*/
config->vinst_ctrl |= BIT(9);
/* No start-stop filtering for ViewInst */
config->vissctlr = 0x0; config->vissctlr = 0x0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment