This is what I have in board.c for Duo 64M:
#if defined(CONFIG_PHY_CVITEK)
static void cv180x_ephy_id_init(void)
{
// set rg_ephy_apb_rw_sel 0x0804@[0]=1/APB by using APB interface
mmio_write_32(0x03009804, 0x0001);
// Release 0x0800[0]=0/shutdown
mmio_write_32(0x03009800, 0x0900);
// Release 0x0800[2]=1/dig_rst_n, Let mii_reg can be accessabile
mmio_write_32(0x03009800, 0x0904);
// ANA INIT (PD/EN), switch to MII-page5
mmio_write_32(0x0300907c, 0x0500);
// Release ANA_PD p5.0x10@[13:8] = 6'b001100
mmio_write_32(0x03009040, 0x0c00);
// Release ANA_EN p5.0x10@[7:0] = 8'b01111110
mmio_write_32(0x03009040, 0x0c7e);
// Wait PLL_Lock, Lock_Status p5.0x12@[15] = 1
//mdelay(1);
// Release 0x0800[1] = 1/ana_rst_n
mmio_write_32(0x03009800, 0x0906);
// ANA INIT
// @Switch to MII-page5
mmio_write_32(0x0300907c, 0x0500);
// PHY_ID
mmio_write_32(0x03009008, 0x0043);
mmio_write_32(0x0300900c, 0x5649);
// switch to MDIO control by ETH_MAC
mmio_write_32(0x03009804, 0x0000);
}
static void cv180x_ephy_led_pinmux(void)
{
// LED PAD MUX
mmio_write_32(0x0300109c, 0x05);
mmio_write_32(0x030010a0, 0x05);
//(SD1_CLK selphy)
mmio_write_32(0x050270b0, 0x11111111);
//(SD1_CMD selphy)
mmio_write_32(0x050270b4, 0x11111111);
}
#endif
static void cv180x_i2s2_init(void)
{
printk("cv180x_i2s2_init\n");
mmio_write_32(0x03009804, 0x0001);
mmio_write_32(0x03009808, 0x0001);
mmio_write_32(0x03009800, 0x0905);
// Wait PLL_Lock, Lock_Status p5.0x12@[15] = 1
// mdelay(1);
mmio_write_32(0x0300907C, 0x0500);
mmio_write_32(0x03009078, 0x0F00);
mmio_write_32(0x03009074, 0x0606);
mmio_write_32(0x03009070, 0x0606);
}
int board_init(void)
{
extern uint32_t BOOT0_START_TIME;
uint16_t start_time = DIV_ROUND_UP(BOOT0_START_TIME, SYS_COUNTER_FREQ_IN_SECOND / 1000);
// Save uboot start time. time is from boot0.h
mmio_write_16(TIME_RECORDS_FIELD_UBOOT_START, start_time);
#if defined(CONFIG_PHY_CVITEK) /* config cvitek cv180x eth internal phy on ASIC board */
cv180x_ephy_id_init();
cv180x_ephy_led_pinmux();
#endif
cv180x_i2s2_init();
#if defined(CONFIG_NAND_SUPPORT)
pinmux_config(PINMUX_SPI_NAND);
#elif defined(CONFIG_SPI_FLASH)
pinmux_config(PINMUX_SPI_NOR);
#endif
// pinmux_config(PINMUX_SDIO1);
pinmux_config(PINMUX_USB);
//pinmux_config(PINMUX_SPI0);
//pinmux_config(PINMUX_SPI2);
cvi_board_init();
return 0;
}
SSH works, audio works without the need to run a user-space program.
The SDK is from January, 2024.