arch/arm/src/imxrt: add missing clock to imxrt_xbar.c and fix usage of imxrt_enc.c while debug option is enable

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
Michal Lenc
2021-06-15 21:01:47 +02:00
committed by Xiang Xiao
parent 673f9519eb
commit 7bcd50955f
4 changed files with 31 additions and 4 deletions
@@ -149,6 +149,8 @@
#define IOMUX_ENET_TX_CLK_DEFAULT (IOMUX_SLEW_FAST | IOMUX_DRIVE_40OHM | IOMUX_SPEED_LOW | \
IOMUX_PULL_DOWN_100K | IOMUX_PULL_KEEP | GPIO_SION_ENABLE )
#define IOMUX_ENC_DEFAULT (0)
#define IOMUX_CAN_DEFAULT (IOMUX_SLEW_SLOW | \
IOMUX_DRIVE_50OHM | IOMUX_SPEED_LOW )
+13 -4
View File
@@ -779,13 +779,22 @@ static int imxrt_enc_test_gen(FAR struct imxrt_enc_lowerhalf_s *priv,
return -EINVAL;
}
if (value == 0)
{
imxrt_enc_modifyreg16(priv, IMXRT_ENC_TST_OFFSET,
ENC_TST_TCE | ENC_TST_TEN, 0);
return OK;
}
if (value & (1 << 8))
{
imxrt_enc_modifyreg16(priv, IMXRT_ENC_TST_OFFSET, 0, ENC_TST_QDN);
imxrt_enc_modifyreg16(priv, IMXRT_ENC_TST_OFFSET, 0, ENC_TST_QDN
| ENC_TST_TCE | ENC_TST_TEN);
}
else
{
imxrt_enc_modifyreg16(priv, IMXRT_ENC_TST_OFFSET, ENC_TST_QDN, 0);
imxrt_enc_modifyreg16(priv, IMXRT_ENC_TST_OFFSET, ENC_TST_QDN,
ENC_TST_TCE | ENC_TST_TEN);
}
imxrt_enc_modifyreg16(priv, IMXRT_ENC_TST_OFFSET, 0,
@@ -851,8 +860,7 @@ static int imxrt_setup(FAR struct qe_lowerhalf_s *lower)
/* Test Registers */
#ifdef CONFIG_DEBUG_SENSORS
regval = ENC_TST_TCE | ENC_TST_TEN;
regval |= config->tst_dir_adv ? ENC_TST_QDN : 0;
regval = config->tst_dir_adv ? ENC_TST_QDN : 0;
regval |= (config->tst_period & ENC_TST_PERIOD_MASK) <<
ENC_TST_PERIOD_SHIFT;
imxrt_enc_putreg16(priv, IMXRT_ENC_TST_OFFSET, regval);
@@ -872,6 +880,7 @@ static int imxrt_setup(FAR struct qe_lowerhalf_s *lower)
imxrt_enc_putreg16(priv, IMXRT_ENC_CTRL2_OFFSET, regval);
imxrt_enc_sem_post(priv);
return OK;
}
+15
View File
@@ -82,6 +82,21 @@ int imxrt_xbar_connect(uint16_t mux_index_out, uint16_t mux_index_input)
xbar_index = IMXRT_XBAR(mux_index_out);
clearbits = IMXRT_SEL0_MASK;
switch (xbar_index)
{
case 0:
imxrt_clockall_xbar1();
break;
case 1:
imxrt_clockall_xbar2();
break;
case 2:
imxrt_clockall_xbar3();
break;
default:
break;
}
/* Verify:
* 1) The Xbar index is valid.
* 2) In and out are on the same Xbar.
+1
View File
@@ -29,6 +29,7 @@
#include <stdint.h>
#include "hardware/imxrt_xbar.h"
#include "hardware/imxrt_memorymap.h"
#include "imxrt_periphclks.h"
/* Collect correct XBAR definitions from chip file */