Skip to content

Commit

Permalink
Add jtag function for duo-64.
Browse files Browse the repository at this point in the history
  • Loading branch information
Judehahh committed Jan 6, 2024
1 parent 37c13af commit c198e57
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions fsbl/plat/cv180x/bl2/bl2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
#include <bl2.h>
#include <string.h>
#include <delay_timer.h>
#include <cv180x_pinlist_swconfig.h>
#include <cv180x_reg_fmux_gpio.h>

#define PINMUX_CONFIG(PIN_NAME, FUNC_NAME) \
mmio_clrsetbits_32(PINMUX_BASE + FMUX_GPIO_FUNCSEL_##PIN_NAME, \
FMUX_GPIO_FUNCSEL_##PIN_NAME##_MASK << FMUX_GPIO_FUNCSEL_##PIN_NAME##_OFFSET, \
PIN_NAME##__##FUNC_NAME)

#ifdef RTOS_ENABLE_FREERTOS
int init_comm_info(int ret)
Expand Down Expand Up @@ -95,6 +102,30 @@ void bl2_main(void)
set_rtc_en_registers();

load_ddr();

/* If GP15's value is high, enter debug mode. */
if (mmio_read_32(GPIO_BASE + 0x050) & (1 << 15)) {
NOTICE("=========================================\n");
NOTICE("|| Debug Mode ||\n");
NOTICE("|| ||\n");
NOTICE("|| Please use uart4 for serial out, ||\n");
NOTICE("|| and remove serial tool from uart0. ||\n");
NOTICE("=========================================\n");

mmio_setbits_32(0x3003024, 1 << 6); /* reset the small core */

/* set pinmux for uart4 and jtag */
PINMUX_CONFIG(SD1_GPIO1, UART4_TX);
PINMUX_CONFIG(SD1_GPIO0, UART4_RX);
PINMUX_CONFIG(UART0_TX, JTAG_TMS);
PINMUX_CONFIG(UART0_RX, JTAG_TCK);
PINMUX_CONFIG(IIC0_SCL, JTAG_TDI);
PINMUX_CONFIG(IIC0_SDA, JTAG_TDO);

while(1)
;
}

#ifdef OD_CLK_SEL
load_rest_od_sel();
#else
Expand Down

0 comments on commit c198e57

Please sign in to comment.