mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-14 10:28:54 +00:00
V1.0.5
This commit is contained in:
@@ -64,7 +64,7 @@
|
|||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
/* The last 256KB for bootloader */
|
/* The last 256KB for bootloader */
|
||||||
SRAM_SW : ORIGIN = 0x30100100, LENGTH = 0x40000
|
SRAM_SW : ORIGIN = (0x30040100 + (AIC_SRAM_TOTAL_SIZE - AIC_BOOTLOADER_RESERVE_SIZE)), LENGTH = AIC_BOOTLOADER_RESERVE_SIZE
|
||||||
PSRAM : ORIGIN = 0x40000000, LENGTH = AIC_PSRAM_SIZE
|
PSRAM : ORIGIN = 0x40000000, LENGTH = AIC_PSRAM_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,28 @@ s32 nor_fwc_prepare(struct fwc_info *fwc, u32 id)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset statuts register0 as 0x0 default
|
||||||
|
uint8_t result;
|
||||||
|
uint8_t val = 0x0;
|
||||||
|
uint8_t reg = 0x5;
|
||||||
|
result = sfud_read_reg(flash, reg, &val);
|
||||||
|
if (result == SFUD_SUCCESS) {
|
||||||
|
printf("Read status register0 1, val: %u.\n", val);
|
||||||
|
} else {
|
||||||
|
printf("Read status register0 1 failed.\n");
|
||||||
|
}
|
||||||
|
uint8_t *default_0 = 0x0;
|
||||||
|
result = sfud_write_reg(flash, 0x1, default_0);
|
||||||
|
if (result == SFUD_SUCCESS) {
|
||||||
|
printf("Write status register0 0 success.\n");
|
||||||
|
} else {
|
||||||
|
printf("Write status register0 failed.\n");
|
||||||
|
}
|
||||||
|
result = sfud_read_reg(flash, 0x5, &val);
|
||||||
|
if (result == SFUD_SUCCESS) {
|
||||||
|
printf("Read status register0 2, val: %u.\n\n", val);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef AIC_SPIENC_BYPASS_IN_UPGMODE
|
#ifdef AIC_SPIENC_BYPASS_IN_UPGMODE
|
||||||
spienc_set_bypass(1);
|
spienc_set_bypass(1);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
696
target/configs/d13x_demo68-nor_baremetal_bootloader_defconfig
Normal file
696
target/configs/d13x_demo68-nor_baremetal_bootloader_defconfig
Normal file
@@ -0,0 +1,696 @@
|
|||||||
|
#
|
||||||
|
# Automatically generated file; DO NOT EDIT.
|
||||||
|
# ArtInChip Luban-Lite SDK Configuration
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Project options
|
||||||
|
#
|
||||||
|
CONFIG_PRJ_DEFCONFIG_FILENAME="d13x_demo68-nor_baremetal_bootloader_defconfig"
|
||||||
|
|
||||||
|
#
|
||||||
|
# -- Important: If following options have been changed, you need save & rerun menuconfig before changing any other options.
|
||||||
|
#
|
||||||
|
CONFIG_PRJ_CHIP="d13x"
|
||||||
|
CONFIG_PRJ_BOARD="demo68-nor"
|
||||||
|
CONFIG_PRJ_KERNEL="baremetal"
|
||||||
|
CONFIG_PRJ_APP="bootloader"
|
||||||
|
CONFIG_PLATFORM_LUBANLITE=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Chip options
|
||||||
|
#
|
||||||
|
CONFIG_SOC_THEAD_SMART=y
|
||||||
|
# CONFIG_QEMU_RUN is not set
|
||||||
|
CONFIG_PRJ_CUSTOM_LDS="application/baremetal/bootloader/ldscript/d13x_bootloader_gcc.ld"
|
||||||
|
CONFIG_AIC_CHIP_D13X=y
|
||||||
|
CONFIG_CACHE_LINE_SIZE=32
|
||||||
|
# CONFIG_CPU_DCACHE_PREFETCH_EN is not set
|
||||||
|
CONFIG_CPU_BASE=0x20000000
|
||||||
|
# CONFIG_GLOBAL_INT_SW_THRESHOLD_EN is not set
|
||||||
|
CONFIG_AIC_CMU_DRV=y
|
||||||
|
CONFIG_AIC_CMU_DRV_V11=y
|
||||||
|
CONFIG_AIC_CMU_DRV_VER="11"
|
||||||
|
CONFIG_AIC_GPIO_DRV=y
|
||||||
|
CONFIG_AIC_GPIO_DRV_V11=y
|
||||||
|
CONFIG_AIC_GPIO_DRV_VER="11"
|
||||||
|
CONFIG_AIC_SYSCFG_DRV=y
|
||||||
|
CONFIG_AIC_SYSCFG_DRV_V11=y
|
||||||
|
CONFIG_AIC_SYSCFG_DRV_VER="11"
|
||||||
|
CONFIG_AIC_DMA_DRV=y
|
||||||
|
CONFIG_AIC_DMA_DRV_V11=y
|
||||||
|
CONFIG_AIC_DMA_DRV_VER="11"
|
||||||
|
CONFIG_AIC_DMA_CH_NUM=8
|
||||||
|
CONFIG_AIC_DMA_ALIGN_SIZE=8
|
||||||
|
CONFIG_AIC_UART_DRV=y
|
||||||
|
CONFIG_AIC_UART_DRV_V11=y
|
||||||
|
CONFIG_AIC_UART_DEV_NUM=8
|
||||||
|
# CONFIG_AIC_I2C_DRV is not set
|
||||||
|
CONFIG_AIC_QSPI_DRV=y
|
||||||
|
CONFIG_AIC_QSPI_DRV_V11=y
|
||||||
|
CONFIG_AIC_QSPI_DRV_VER="11"
|
||||||
|
CONFIG_AIC_XSPI_DRV=y
|
||||||
|
CONFIG_AIC_XSPI_DRV_V10=y
|
||||||
|
# CONFIG_AIC_AXICFG_DRV is not set
|
||||||
|
CONFIG_AIC_WRI_DRV=y
|
||||||
|
CONFIG_AIC_WRI_DRV_V11=y
|
||||||
|
CONFIG_AIC_WRI_DRV_VER="11"
|
||||||
|
CONFIG_AIC_RTC_DRV=y
|
||||||
|
CONFIG_AIC_RTC_DRV_V11=y
|
||||||
|
CONFIG_AIC_RTC_DRV_VER="11"
|
||||||
|
CONFIG_AIC_WDT_DRV=y
|
||||||
|
CONFIG_AIC_WDT_DRV_V10=y
|
||||||
|
CONFIG_AIC_WDT_DRV_VER="10"
|
||||||
|
# CONFIG_AIC_SPIENC_DRV is not set
|
||||||
|
CONFIG_AIC_SDMC_DRV=y
|
||||||
|
CONFIG_AIC_SDMC_DRV_V11=y
|
||||||
|
CONFIG_AIC_SDMC_DRV_VER="11"
|
||||||
|
CONFIG_AIC_DE_DRV=y
|
||||||
|
CONFIG_AIC_DE_DRV_V11=y
|
||||||
|
CONFIG_AIC_DE_DRV_VER="11"
|
||||||
|
# CONFIG_AIC_GE_DRV is not set
|
||||||
|
# CONFIG_AIC_VE_DRV is not set
|
||||||
|
# CONFIG_AIC_DVP_DRV is not set
|
||||||
|
# CONFIG_AIC_USB_DEVICE_DRV is not set
|
||||||
|
# CONFIG_AIC_USB_HOST_EHCI_DRV is not set
|
||||||
|
# CONFIG_AIC_GMAC_DRV is not set
|
||||||
|
# CONFIG_AIC_ADCIM_DRV is not set
|
||||||
|
# CONFIG_AIC_RTP_DRV is not set
|
||||||
|
# CONFIG_AIC_TSEN_DRV is not set
|
||||||
|
# CONFIG_AIC_GPAI_DRV is not set
|
||||||
|
# CONFIG_AIC_PWM_DRV is not set
|
||||||
|
# CONFIG_AIC_EPWM_DRV is not set
|
||||||
|
# CONFIG_AIC_HRTIMER_DRV is not set
|
||||||
|
# CONFIG_AIC_CAP_DRV is not set
|
||||||
|
CONFIG_AIC_SID_DRV=y
|
||||||
|
CONFIG_AIC_SID_DRV_V11=y
|
||||||
|
CONFIG_AIC_SID_DRV_VER="11"
|
||||||
|
# CONFIG_AIC_CE_DRV is not set
|
||||||
|
# CONFIG_AIC_MTOP_DRV is not set
|
||||||
|
# CONFIG_AIC_CAN_DRV is not set
|
||||||
|
# CONFIG_AIC_CIR_DRV is not set
|
||||||
|
# CONFIG_AIC_I2S_DRV is not set
|
||||||
|
# CONFIG_AIC_AUDIO_DRV is not set
|
||||||
|
# CONFIG_AIC_PM_DRV is not set
|
||||||
|
# CONFIG_AIC_PSADC_DRV is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Board options
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Interface Related:
|
||||||
|
#
|
||||||
|
CONFIG_AIC_USING_UART0=y
|
||||||
|
CONFIG_AIC_USING_UART1=y
|
||||||
|
# CONFIG_AIC_USING_UART2 is not set
|
||||||
|
# CONFIG_AIC_USING_UART3 is not set
|
||||||
|
# CONFIG_AIC_USING_UART4 is not set
|
||||||
|
# CONFIG_AIC_USING_UART5 is not set
|
||||||
|
# CONFIG_AIC_USING_UART6 is not set
|
||||||
|
# CONFIG_AIC_USING_UART7 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# UART0 Parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_CLK_UART0_FREQ=48000000
|
||||||
|
CONFIG_AIC_DEV_UART0_BAUDRATE=115200
|
||||||
|
CONFIG_AIC_DEV_UART0_DATABITS=8
|
||||||
|
CONFIG_AIC_DEV_UART0_STOPBITS=1
|
||||||
|
CONFIG_AIC_DEV_UART0_PARITY=0
|
||||||
|
CONFIG_AIC_DEV_UART0_RS232=y
|
||||||
|
# CONFIG_AIC_DEV_UART0_RS485 is not set
|
||||||
|
CONFIG_AIC_DEV_UART0_MODE_RS232=y
|
||||||
|
# CONFIG_AIC_DEV_UART0_MODE_RS232_AUTO_FLOW_CTRL is not set
|
||||||
|
# CONFIG_AIC_DEV_UART0_MODE_RS232_UNAUTO_FLOW_CTRL is not set
|
||||||
|
# CONFIG_AIC_DEV_UART0_MODE_RS232_SW_FLOW_CTRL is not set
|
||||||
|
# CONFIG_AIC_DEV_UART0_MODE_RS232_SW_HW_FLOW_CTRL is not set
|
||||||
|
CONFIG_AIC_DEV_UART0_MODE=0
|
||||||
|
# CONFIG_AIC_UART0_DMA_ENABLE_FLAG is not set
|
||||||
|
CONFIG_AIC_UART0_FLAG=259
|
||||||
|
CONFIG_AIC_DEV_UART0_RX_MODE_POLL=y
|
||||||
|
# CONFIG_AIC_DEV_UART0_RX_MODE_INT is not set
|
||||||
|
CONFIG_AIC_DEV_UART0_RX_MODE=0
|
||||||
|
|
||||||
|
#
|
||||||
|
# UART1 Parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_CLK_UART1_FREQ=48000000
|
||||||
|
CONFIG_AIC_DEV_UART1_BAUDRATE=115200
|
||||||
|
CONFIG_AIC_DEV_UART1_DATABITS=8
|
||||||
|
CONFIG_AIC_DEV_UART1_STOPBITS=1
|
||||||
|
CONFIG_AIC_DEV_UART1_PARITY=0
|
||||||
|
CONFIG_AIC_DEV_UART1_RS232=y
|
||||||
|
# CONFIG_AIC_DEV_UART1_RS485 is not set
|
||||||
|
CONFIG_AIC_DEV_UART1_MODE_RS232=y
|
||||||
|
# CONFIG_AIC_DEV_UART1_MODE_RS232_AUTO_FLOW_CTRL is not set
|
||||||
|
# CONFIG_AIC_DEV_UART1_MODE_RS232_UNAUTO_FLOW_CTRL is not set
|
||||||
|
# CONFIG_AIC_DEV_UART1_MODE_RS232_SW_FLOW_CTRL is not set
|
||||||
|
# CONFIG_AIC_DEV_UART1_MODE_RS232_SW_HW_FLOW_CTRL is not set
|
||||||
|
CONFIG_AIC_DEV_UART1_MODE=0
|
||||||
|
# CONFIG_AIC_UART1_DMA_ENABLE_FLAG is not set
|
||||||
|
CONFIG_AIC_UART1_FLAG=259
|
||||||
|
CONFIG_AIC_DEV_UART1_RX_MODE_POLL=y
|
||||||
|
# CONFIG_AIC_DEV_UART1_RX_MODE_INT is not set
|
||||||
|
CONFIG_AIC_DEV_UART1_RX_MODE=0
|
||||||
|
# CONFIG_AIC_USING_I2C0 is not set
|
||||||
|
# CONFIG_AIC_USING_I2C1 is not set
|
||||||
|
# CONFIG_AIC_USING_I2C2 is not set
|
||||||
|
# CONFIG_AIC_USING_PWM0 is not set
|
||||||
|
# CONFIG_AIC_USING_PWM1 is not set
|
||||||
|
# CONFIG_AIC_USING_PWM2 is not set
|
||||||
|
# CONFIG_AIC_USING_PWM3 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Using EPWM
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_USING_EPWM0 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM1 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM2 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM3 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM4 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM5 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM6 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM7 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM8 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM9 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM10 is not set
|
||||||
|
# CONFIG_AIC_USING_EPWM11 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Using HRTIMER
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_USING_HRTIMER0 is not set
|
||||||
|
# CONFIG_AIC_USING_HRTIMER1 is not set
|
||||||
|
# CONFIG_AIC_USING_HRTIMER2 is not set
|
||||||
|
# CONFIG_AIC_USING_HRTIMER3 is not set
|
||||||
|
# CONFIG_AIC_USING_HRTIMER4 is not set
|
||||||
|
# CONFIG_AIC_USING_HRTIMER5 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Using CAP
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_USING_CAP0 is not set
|
||||||
|
# CONFIG_AIC_USING_CAP1 is not set
|
||||||
|
# CONFIG_AIC_USING_CAP2 is not set
|
||||||
|
# CONFIG_AIC_USING_CAP3 is not set
|
||||||
|
# CONFIG_AIC_USING_CAP4 is not set
|
||||||
|
# CONFIG_AIC_USING_CAP5 is not set
|
||||||
|
# CONFIG_AIC_USING_CAN0 is not set
|
||||||
|
# CONFIG_AIC_USING_CAN1 is not set
|
||||||
|
# CONFIG_AIC_USING_CIR is not set
|
||||||
|
# CONFIG_AIC_USB_OTG_DRV is not set
|
||||||
|
# CONFIG_AIC_USING_USB0 is not set
|
||||||
|
# CONFIG_AIC_USING_GMAC0 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Storage Related:
|
||||||
|
#
|
||||||
|
CONFIG_AIC_USING_QSPI0=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# SPI0 Parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_DEV_QSPI0_MAX_SRC_FREQ_HZ=100000000
|
||||||
|
# CONFIG_AIC_QSPI0_BUS_WIDTH_1 is not set
|
||||||
|
CONFIG_AIC_QSPI0_BUS_WIDTH_4=y
|
||||||
|
CONFIG_AIC_QSPI0_BUS_WIDTH=4
|
||||||
|
CONFIG_AIC_DEV_QSPI0_DELAY_MODE=2
|
||||||
|
# CONFIG_AIC_USING_QSPI1 is not set
|
||||||
|
# CONFIG_AIC_USING_QSPI2 is not set
|
||||||
|
# CONFIG_AIC_USING_QSPI3 is not set
|
||||||
|
# CONFIG_AIC_SUPPORT_SPI_IN_BIT_MODE is not set
|
||||||
|
CONFIG_AIC_QSPI0_DEVICE_SPINOR=y
|
||||||
|
CONFIG_AIC_QSPI0_DEVICE_SPINOR_FREQ=100000000
|
||||||
|
# CONFIG_AIC_QSPI0_DEVICE_SPINAND is not set
|
||||||
|
# CONFIG_AIC_USING_SDMC0 is not set
|
||||||
|
CONFIG_AIC_USING_SDMC1=y
|
||||||
|
# CONFIG_AIC_SDMC_IRQ_MODE is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# SDMC1 Parameter
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_SDMC1_BUSWIDTH1 is not set
|
||||||
|
CONFIG_AIC_SDMC1_BUSWIDTH4=y
|
||||||
|
# CONFIG_AIC_SD_USING_HOTPLUG is not set
|
||||||
|
# CONFIG_AIC_SDMC1_IS_SDIO is not set
|
||||||
|
CONFIG_AIC_SDMC1_DRV_PHASE=3
|
||||||
|
CONFIG_AIC_SDMC1_SMP_PHASE=0
|
||||||
|
|
||||||
|
#
|
||||||
|
# WLAN Related:
|
||||||
|
#
|
||||||
|
CONFIG_AIC_WIRELESS_LAN=y
|
||||||
|
# CONFIG_AIC_WLAN_REALTEK is not set
|
||||||
|
# CONFIG_WIFI_USING_SDIOWIFI_ATBM is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Analog Related:
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_USING_TSEN is not set
|
||||||
|
# CONFIG_AIC_USING_GPAI is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# MutiMedia Related:
|
||||||
|
#
|
||||||
|
CONFIG_AIC_USING_DE=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Display Parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_DISPLAY_DRV=y
|
||||||
|
# CONFIG_AIC_DISP_PQ_TOOL is not set
|
||||||
|
CONFIG_AIC_DISP_DE_DRV=y
|
||||||
|
# CONFIG_AIC_DISP_RGB_DRV is not set
|
||||||
|
CONFIG_AIC_DISP_LVDS_DRV=y
|
||||||
|
# CONFIG_AIC_DISP_MIPI_DSI_DRV is not set
|
||||||
|
# CONFIG_AIC_DISP_RGB is not set
|
||||||
|
CONFIG_AIC_DISP_LVDS=y
|
||||||
|
# CONFIG_AIC_DISP_MIPI_DSI is not set
|
||||||
|
# CONFIG_AIC_DISP_MIPI_DBI is not set
|
||||||
|
CONFIG_AIC_DI_TYPE=2
|
||||||
|
|
||||||
|
#
|
||||||
|
# LVDS interface options
|
||||||
|
#
|
||||||
|
CONFIG_AIC_LVDS_NS=y
|
||||||
|
# CONFIG_AIC_LVDS_JEIDA_24BIT is not set
|
||||||
|
# CONFIG_AIC_LVDS_JEIDA_18BIT is not set
|
||||||
|
CONFIG_AIC_LVDS_MODE=0
|
||||||
|
CONFIG_AIC_LVDS_LINK_0=y
|
||||||
|
CONFIG_AIC_LVDS_LINK_MODE=0
|
||||||
|
# CONFIG_AICFB_ARGB8888 is not set
|
||||||
|
# CONFIG_AICFB_ABGR8888 is not set
|
||||||
|
# CONFIG_AICFB_XRGB8888 is not set
|
||||||
|
# CONFIG_AICFB_RGB888 is not set
|
||||||
|
CONFIG_AICFB_RGB565=y
|
||||||
|
# CONFIG_AICFB_ARGB1555 is not set
|
||||||
|
CONFIG_AICFB_FORMAT=0x0e
|
||||||
|
# CONFIG_AIC_PAN_DISPLAY is not set
|
||||||
|
# CONFIG_AIC_DISP_COLOR_BLOCK is not set
|
||||||
|
CONFIG_AICFB_ROTATE_0=y
|
||||||
|
# CONFIG_AICFB_ROTATE_90 is not set
|
||||||
|
# CONFIG_AICFB_ROTATE_180 is not set
|
||||||
|
# CONFIG_AICFB_ROTATE_270 is not set
|
||||||
|
CONFIG_AIC_FB_ROTATE_DEGREE=0
|
||||||
|
|
||||||
|
#
|
||||||
|
# Display Panels
|
||||||
|
#
|
||||||
|
CONFIG_AIC_SIMPLE_PANEL=y
|
||||||
|
# CONFIG_AIC_PANEL_BRIDGE_LT8911 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# display timing of simple panel
|
||||||
|
#
|
||||||
|
CONFIG_PANEL_PIXELCLOCK=52
|
||||||
|
CONFIG_PANEL_HACTIVE=1024
|
||||||
|
CONFIG_PANEL_VACTIVE=600
|
||||||
|
CONFIG_PANEL_HBP=160
|
||||||
|
CONFIG_PANEL_HFP=160
|
||||||
|
CONFIG_PANEL_HSW=20
|
||||||
|
CONFIG_PANEL_VBP=12
|
||||||
|
CONFIG_PANEL_VFP=20
|
||||||
|
CONFIG_PANEL_VSW=2
|
||||||
|
CONFIG_AIC_GPIO_BACKLIGHT=y
|
||||||
|
CONFIG_AIC_PANEL_ENABLE_GPIO="PE.13"
|
||||||
|
# CONFIG_AIC_PANEL_ENABLE_GPIO_LOW is not set
|
||||||
|
# CONFIG_AIC_PANEL_SPI_EMULATION is not set
|
||||||
|
# CONFIG_AIC_USING_GE is not set
|
||||||
|
# CONFIG_AIC_USING_VE is not set
|
||||||
|
# CONFIG_AIC_USING_DVP is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Camera Support
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_USING_CAMERA is not set
|
||||||
|
# CONFIG_AIC_USING_I2S0 is not set
|
||||||
|
# CONFIG_AIC_USING_AUDIO is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# System Related:
|
||||||
|
#
|
||||||
|
CONFIG_AIC_USING_DMA=y
|
||||||
|
# CONFIG_AIC_USING_WRI is not set
|
||||||
|
CONFIG_AIC_USING_RTC=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# RTC Parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_RTC_CLK_RATE=3276800
|
||||||
|
# CONFIG_AIC_RTC_ALARM_IO_OUTPUT is not set
|
||||||
|
# CONFIG_AIC_RTC_32K_IO_OUTPUT is not set
|
||||||
|
CONFIG_AIC_USING_WDT=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Mem Options
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# SRAM parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_SRAM_TOTAL_SIZE=0x80000
|
||||||
|
# CONFIG_AIC_TCM_EN is not set
|
||||||
|
CONFIG_AIC_ITCM_SIZE=0x0
|
||||||
|
CONFIG_AIC_DTCM_SIZE=0x0
|
||||||
|
CONFIG_AIC_SRAM_S1_SIZE_0K=y
|
||||||
|
# CONFIG_AIC_SRAM_S1_SIZE_128K is not set
|
||||||
|
# CONFIG_AIC_SRAM_S1_SIZE_256K is not set
|
||||||
|
# CONFIG_AIC_SRAM_S1_SIZE_384K is not set
|
||||||
|
# CONFIG_AIC_SRAM_S1_SIZE_512K is not set
|
||||||
|
# CONFIG_AIC_SRAM_S1_SIZE_640K is not set
|
||||||
|
# CONFIG_AIC_SRAM_S1_SIZE_768K is not set
|
||||||
|
CONFIG_AIC_SRAM_S1_SIZE=0
|
||||||
|
CONFIG_AIC_SRAM_S1_REG_SIZE=0x00
|
||||||
|
CONFIG_AIC_SRAM1_SW_SIZE=0x0
|
||||||
|
CONFIG_AIC_BOOTLOADER_RESERVE_SIZE=0x40000
|
||||||
|
|
||||||
|
#
|
||||||
|
# PSRAM parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_PSRAM_SIZE=0x800000
|
||||||
|
CONFIG_AIC_PSRAM_CMA_EN=y
|
||||||
|
CONFIG_AIC_PSRAM_SW_SIZE=0x300000
|
||||||
|
CONFIG_AIC_PSRAM_SW_EN=y
|
||||||
|
# CONFIG_AIC_XIP is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# ELF Sections memory location
|
||||||
|
#
|
||||||
|
CONFIG_AIC_SEC_TEXT_SRAM_S0=y
|
||||||
|
# CONFIG_AIC_SEC_TEXT_PSRAM is not set
|
||||||
|
CONFIG_AIC_SEC_RODATA_SRAM_S0=y
|
||||||
|
# CONFIG_AIC_SEC_RODATA_PSRAM is not set
|
||||||
|
CONFIG_AIC_SEC_DATA_SRAM_S0=y
|
||||||
|
# CONFIG_AIC_SEC_DATA_PSRAM is not set
|
||||||
|
CONFIG_AIC_SEC_BSS_SRAM_S0=y
|
||||||
|
# CONFIG_AIC_SEC_BSS_PSRAM is not set
|
||||||
|
CONFIG_AIC_INTERRUPTSTACK_SIZE=4096
|
||||||
|
|
||||||
|
#
|
||||||
|
# Clocks options
|
||||||
|
#
|
||||||
|
CONFIG_AIC_CLK_PLL_INT0_FREQ=480000000
|
||||||
|
CONFIG_AIC_CLK_PLL_INT1_FREQ=1200000000
|
||||||
|
CONFIG_AIC_CLK_PLL_FRA0_FREQ=0
|
||||||
|
# CONFIG_AIC_CLK_PLL_FRA0_SSC_DIS is not set
|
||||||
|
CONFIG_AIC_CLK_PLL_FRA2_FREQ=0
|
||||||
|
# CONFIG_AIC_CLK_PLL_FRA2_SSC_DIS is not set
|
||||||
|
CONFIG_AIC_CLK_CPU_FREQ=480000000
|
||||||
|
CONFIG_AIC_CLK_AXI0_FREQ=200000000
|
||||||
|
CONFIG_AIC_CLK_AHB0_FREQ=200000000
|
||||||
|
CONFIG_AIC_CLK_APB0_FREQ=100000000
|
||||||
|
# CONFIG_AIC_USING_CLK_OUT0 is not set
|
||||||
|
# CONFIG_AIC_USING_CLK_OUT1 is not set
|
||||||
|
# CONFIG_AIC_USING_CLK_OUT2 is not set
|
||||||
|
# CONFIG_AIC_USING_CLK_OUT3 is not set
|
||||||
|
# CONFIG_AIC_USING_PM is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Security Related:
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_USING_SPIENC is not set
|
||||||
|
CONFIG_AIC_USING_SID=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# SID Parameter
|
||||||
|
#
|
||||||
|
CONFIG_EFUSE_MAX_WORD=64
|
||||||
|
CONFIG_EFUSE_TIMING_VALUE=0x0402FFD8
|
||||||
|
# CONFIG_AIC_USING_CE is not set
|
||||||
|
CONFIG_AIC_USING_SYSCFG=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Syscfg Parameter
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_SYSCFG_SIP_FLASH_ENABLE is not set
|
||||||
|
CONFIG_AIC_SYSCFG_LDO1X_ENABLE=y
|
||||||
|
CONFIG_AIC_SYSCFG_LDO1X_VOL_VAL=6
|
||||||
|
# CONFIG_AIC_USING_MTOP is not set
|
||||||
|
# CONFIG_AIC_USING_PSADC is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Baremetal options
|
||||||
|
#
|
||||||
|
CONFIG_KERNEL_BAREMETAL=y
|
||||||
|
CONFIG_DRIVER_HAL_EN=y
|
||||||
|
CONFIG_DRIVER_BARE_DRV_EN=y
|
||||||
|
CONFIG_AIC_NORMALSTACK_SIZE=8092
|
||||||
|
CONFIG_ARCH_RISCV=y
|
||||||
|
CONFIG_ARCH_RISCV_FPU=y
|
||||||
|
CONFIG_ARCH_RISCV_FPU_D=y
|
||||||
|
CONFIG_ARCH_RISCV32=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bootloader options
|
||||||
|
#
|
||||||
|
CONFIG_AIC_BOOTLOADER=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Console
|
||||||
|
#
|
||||||
|
CONFIG_AIC_BOOTLOADER_CONSOLE_UART=1
|
||||||
|
|
||||||
|
#
|
||||||
|
# Drivers
|
||||||
|
#
|
||||||
|
CONFIG_AIC_BOOTLOADER_MMC_SUPPORT=y
|
||||||
|
CONFIG_AIC_BOOTLOADER_SPINOR_SUPPORT=y
|
||||||
|
# CONFIG_AIC_BOOTLOADER_SPINAND_SUPPORT is not set
|
||||||
|
CONFIG_AIC_BOOTLOADER_PSRAM_EN=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# PSRAM Parameter
|
||||||
|
#
|
||||||
|
CONFIG_AIC_XSPI_PSRAM_CS0_PINS=0
|
||||||
|
CONFIG_AIC_XSPI_PSRAM_CS1_PINS=0
|
||||||
|
CONFIG_AIC_XSPI_PSRAM_CLK=198000000
|
||||||
|
# CONFIG_AIC_BOOTLOADER_AXICFG_SUPPORT is not set
|
||||||
|
CONFIG_AIC_BOOT_USB_DRV=y
|
||||||
|
CONFIG_AIC_BOOT_USBH_DRV=y
|
||||||
|
CONFIG_AIC_BOOTLOADER_UDISK_SUPPORT=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Components
|
||||||
|
#
|
||||||
|
CONFIG_AIC_BOOTLOADER_FATFS_SUPPORT=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Upgrading
|
||||||
|
#
|
||||||
|
CONFIG_AICUPG_UART_ENABLE=y
|
||||||
|
CONFIG_AICUPG_USB_ENABLE=y
|
||||||
|
# CONFIG_AICUPG_USB_DMA_ENABLE is not set
|
||||||
|
CONFIG_AICUPG_SDCARD_ENABLE=y
|
||||||
|
CONFIG_AICUPG_SDCARD_CONTROLLER_ID=1
|
||||||
|
CONFIG_AICUPG_UDISK_ENABLE=y
|
||||||
|
# CONFIG_AICUPG_UDISK_VERSION3_SUPPORT is not set
|
||||||
|
CONFIG_AICUPG_USB_CONTROLLER_MAX_NUM=1
|
||||||
|
CONFIG_AICUPG_MMC_ARTINCHIP=y
|
||||||
|
CONFIG_AICUPG_NOR_ARTINCHIP=y
|
||||||
|
CONFIG_AICUPG_LOG_BUFFER_SUPPORT=y
|
||||||
|
CONFIG_AICUPG_LOG_BUFFER_ADDR=0x30040000
|
||||||
|
CONFIG_AICUPG_LOG_BUFFER_SIZE=0x3000
|
||||||
|
|
||||||
|
#
|
||||||
|
# Commands
|
||||||
|
#
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_NOR_BOOT=y
|
||||||
|
# CONFIG_AIC_BOOTLOADER_CMD_XIP_BOOT is not set
|
||||||
|
# CONFIG_AIC_BOOTLOADER_CMD_MMC_BOOT is not set
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_SPI_NOR=y
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_MTD=y
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_MEM=y
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_PART=y
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_PROGRESS_BAR=y
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_PROGRESS_BAR_ROTATE=0
|
||||||
|
CONFIG_AIC_BOOTLOADER_CMD_FB_CONSOLE=y
|
||||||
|
# CONFIG_AIC_BOOTLOADER_CMD_ONLY_FB_CONSOLE is not set
|
||||||
|
# CONFIG_AIC_BOOTLOADER_CMD_PSRAM_TEST is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Debug
|
||||||
|
#
|
||||||
|
# CONFIG_AICUPG_DEBUG is not set
|
||||||
|
# CONFIG_AICUPG_UART_DEBUG is not set
|
||||||
|
# CONFIG_AIC_SHOW_BOOT_TIME is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Local packages options
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Third-party packages options
|
||||||
|
#
|
||||||
|
# CONFIG_LPKG_USING_CPU_USAGE is not set
|
||||||
|
# CONFIG_LPKG_USING_RAMDISK is not set
|
||||||
|
# CONFIG_LPKG_USING_CHERRYUSB is not set
|
||||||
|
# CONFIG_LPKG_USING_ADBD is not set
|
||||||
|
# CONFIG_LPKG_USING_AWTK is not set
|
||||||
|
# CONFIG_LPKG_USING_LWIP is not set
|
||||||
|
# CONFIG_LPKG_USING_DFS_UFFS is not set
|
||||||
|
# CONFIG_LPKG_USING_LITTLEFS is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# BenchMark Tests
|
||||||
|
#
|
||||||
|
CONFIG_AIC_PRINT_FLOAT_CUSTOM=y
|
||||||
|
# CONFIG_LPKG_USING_COREMARK is not set
|
||||||
|
# CONFIG_LPKG_USING_DHRYSTONE is not set
|
||||||
|
# CONFIG_LPKG_USING_STREAM is not set
|
||||||
|
# CONFIG_LPKG_USING_WHETSTONE is not set
|
||||||
|
# CONFIG_LPKG_USING_LINPACK is not set
|
||||||
|
# CONFIG_LPKG_USING_FREERTOS_WRAPPER is not set
|
||||||
|
# CONFIG_LPKG_USING_I2C_TOOLS is not set
|
||||||
|
# CONFIG_LPKG_USING_BEEP is not set
|
||||||
|
# CONFIG_LPKG_USING_MEMLEAK_CHECK is not set
|
||||||
|
# CONFIG_LPKG_USING_WEBCLIENT is not set
|
||||||
|
# CONFIG_LPKG_USING_HTTP_OTA_DOWNLOADER is not set
|
||||||
|
# CONFIG_LPKG_USING_RPMSG_LITE is not set
|
||||||
|
# CONFIG_LPKG_RPMSG_LITE_CUSTOM_CONFIG is not set
|
||||||
|
# CONFIG_LPKG_USING_FREETYPE is not set
|
||||||
|
# CONFIG_LPKG_USING_RTT_AUTO_EXE_CMD is not set
|
||||||
|
# CONFIG_LPKG_USING_NETUTILS is not set
|
||||||
|
# CONFIG_LPKG_USING_LIBMODBUS is not set
|
||||||
|
# CONFIG_LPKG_USING_PTPD is not set
|
||||||
|
# CONFIG_LPKG_USING_CJSON is not set
|
||||||
|
# CONFIG_LPKG_USING_MBEDTLS is not set
|
||||||
|
# CONFIG_LPKG_USING_AT24CXX is not set
|
||||||
|
# CONFIG_LPKG_USING_ZLIB is not set
|
||||||
|
# CONFIG_LPKG_USING_DFS is not set
|
||||||
|
# CONFIG_LPKG_USING_MAD is not set
|
||||||
|
CONFIG_LPKG_USING_FDTLIB=y
|
||||||
|
# CONFIG_LPKG_USING_GIF is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# ArtInChip packages options
|
||||||
|
#
|
||||||
|
# CONFIG_LPKG_MPP is not set
|
||||||
|
CONFIG_LPKG_USING_ENV=y
|
||||||
|
CONFIG_AIC_ENV_INTERFACE=y
|
||||||
|
CONFIG_AIC_SYS_REDUNDAND_ENVIRONMENT=y
|
||||||
|
CONFIG_AIC_ENV_PART_NAME="env"
|
||||||
|
CONFIG_AIC_ENV_REDUNDAND_PART_NAME="env_r"
|
||||||
|
CONFIG_AIC_ENV_SIZE=4096
|
||||||
|
# CONFIG_AIC_ENV_DEBUG is not set
|
||||||
|
CONFIG_AIC_AB_SYSTEM_INTERFACE=y
|
||||||
|
# CONFIG_LPKG_USING_USERID is not set
|
||||||
|
# CONFIG_LPKG_USING_PINMUX_CHECHK is not set
|
||||||
|
# CONFIG_LPKG_USING_OTA_DOWNLOADER is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Drivers options
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# AIC Bare Driver
|
||||||
|
#
|
||||||
|
CONFIG_AIC_MTD_BARE_DRV=y
|
||||||
|
CONFIG_AIC_CONSOLE_BARE_DRV=y
|
||||||
|
CONFIG_AIC_CONSOLE_SYSNAME="tinySPL"
|
||||||
|
CONFIG_AIC_PRINTF_BARE_DRV=y
|
||||||
|
# CONFIG_AIC_USING_TLSF_HEAP is not set
|
||||||
|
CONFIG_AIC_USING_UMM_HEAP=y
|
||||||
|
CONFIG_AIC_UMM_HEAP_BARE_DRV=y
|
||||||
|
# CONFIG_TLSF_MEM_HEAP is not set
|
||||||
|
# CONFIG_AIC_GPIO_IRQ_DRV_EN is not set
|
||||||
|
# CONFIG_AIC_I2C_INTERRUPT_MODE is not set
|
||||||
|
CONFIG_AIC_SPINOR_DRV=y
|
||||||
|
# CONFIG_AIC_SPINAND_DRV is not set
|
||||||
|
# CONFIG_AIC_SPINAND_CONT_READ is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Peripheral
|
||||||
|
#
|
||||||
|
# CONFIG_LPKG_USING_SPINAND is not set
|
||||||
|
CONFIG_LPKG_USING_SFUD=y
|
||||||
|
CONFIG_BOOTLOADER_SFUD_USING_FLASH_INFO_TABLE=y
|
||||||
|
# CONFIG_AIC_NFTL_SUPPORT is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Touch Panel Support
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Gt911 touch panel options
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_TOUCH_PANEL_GT911 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Ft7411 touch panel options
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_TOUCH_PANEL_FT7411 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# GSL1680 touch panel options
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_TOUCH_PANEL_GSL1680 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# RTP touch panel options
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_USING_RTP is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# St16xx touch panel options
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_TOUCH_PANEL_ST16XX is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Axs15260 touch panel options
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_TOUCH_PANEL_AXS15260 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Cst3240 touch panel options
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_TOUCH_PANEL_CST3240 is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# External Audio Codec Support
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_I2S_CODEC_SELECT is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Drivers debug
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_LOG_LEVEL_NONE is not set
|
||||||
|
# CONFIG_AIC_LOG_LEVEL_ERR is not set
|
||||||
|
CONFIG_AIC_LOG_LEVEL_WARN=y
|
||||||
|
# CONFIG_AIC_LOG_LEVEL_INFO is not set
|
||||||
|
# CONFIG_AIC_LOG_LEVEL_DEBUG is not set
|
||||||
|
CONFIG_AIC_LOG_LEVEL=4
|
||||||
|
# CONFIG_AIC_CMU_DRV_DEBUG is not set
|
||||||
|
# CONFIG_AIC_GPIO_DRV_DEBUG is not set
|
||||||
|
# CONFIG_AIC_DMA_DRV_DEBUG is not set
|
||||||
|
# CONFIG_AIC_UART_DRV_DEBUG is not set
|
||||||
|
# CONFIG_AIC_RTC_DRV_DEBUG is not set
|
||||||
|
# CONFIG_AIC_QSPI_DRV_DEBUG is not set
|
||||||
|
# CONFIG_AIC_SPINOR_SFUD_DEBUG is not set
|
||||||
|
# CONFIG_AIC_FB_DRV_DEBUG is not set
|
||||||
|
# CONFIG_AIC_CACHE_LINE_DEBUG is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Drivers examples
|
||||||
|
#
|
||||||
|
# CONFIG_AIC_CMU_DRV_TEST is not set
|
||||||
|
# CONFIG_AIC_GPIO_DRV_TEST is not set
|
||||||
|
# CONFIG_AIC_GPIO_TWINKLE_TEST is not set
|
||||||
|
# CONFIG_AIC_DMA_DRV_TEST is not set
|
||||||
|
# CONFIG_AIC_UART_DRV_TEST is not set
|
||||||
|
# CONFIG_AIC_RTC_DRV_TEST is not set
|
||||||
|
# CONFIG_AIC_QSPI_DRV_TEST is not set
|
||||||
|
CONFIG_AIC_SPINOR_DRV_TEST=y
|
||||||
|
CONFIG_AIC_SDMC_DRV_TEST=y
|
||||||
|
# CONFIG_AIC_MMC_BARE_TEST is not set
|
||||||
|
CONFIG_AIC_MTD_BARE_TEST=y
|
||||||
|
# CONFIG_AIC_FILE_CRC32_TEST is not set
|
||||||
|
# CONFIG_AIC_MTD_LOAD_FILE_TEST is not set
|
||||||
|
# CONFIG_AIC_DISPLAY_TEST is not set
|
||||||
|
# CONFIG_AIC_WDT_DRV_TEST is not set
|
||||||
|
# CONFIG_AIC_MONKEY_TEST is not set
|
||||||
|
# CONFIG_AIC_SOFT_AES_TEST is not set
|
||||||
|
# CONFIG_AIC_SID_BARE_TEST is not set
|
||||||
|
# CONFIG_AIC_IOPMP_TEST is not set
|
||||||
|
# CONFIG_AIC_MEM_API_TEST is not set
|
||||||
|
# CONFIG_AIC_FILE_SYSTEM_TEST is not set
|
||||||
1637
target/configs/d13x_demo68-nor_rt-thread_helloworld_defconfig
Normal file
1637
target/configs/d13x_demo68-nor_rt-thread_helloworld_defconfig
Normal file
File diff suppressed because it is too large
Load Diff
14
target/d13x/demo68-nor/SConscript
Normal file
14
target/d13x/demo68-nor/SConscript
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
Import('RTT_ROOT')
|
||||||
|
Import('rtconfig')
|
||||||
|
from building import *
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
|
||||||
|
# add the board drivers.
|
||||||
|
src = Glob("*.c") + Glob("*.cpp") + Glob("*.S")
|
||||||
|
|
||||||
|
LOCAL_CPPPATH = [cwd]
|
||||||
|
CPPPATH = [cwd + '/include']
|
||||||
|
group = DefineGroup('Board', src, depend = [''], LOCAL_CPPPATH = LOCAL_CPPPATH, CPPPATH = CPPPATH)
|
||||||
|
|
||||||
|
Return('group')
|
||||||
202
target/d13x/demo68-nor/board.c
Normal file
202
target/d13x/demo68-nor/board.c
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022, ArtInChip Technology Co., Ltd
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Authors: weilin.peng@artinchip.com
|
||||||
|
*/
|
||||||
|
#include <aic_core.h>
|
||||||
|
#include <rtconfig.h>
|
||||||
|
#include "board.h"
|
||||||
|
|
||||||
|
extern void aic_board_pinmux_init(void);
|
||||||
|
extern void aic_board_sysclk_init(void);
|
||||||
|
|
||||||
|
#if defined(KERNEL_RTTHREAD)
|
||||||
|
#include <aic_drv.h>
|
||||||
|
#include <rthw.h>
|
||||||
|
#include <rtthread.h>
|
||||||
|
|
||||||
|
extern size_t __heap_start;
|
||||||
|
extern size_t __heap_end;
|
||||||
|
|
||||||
|
#ifdef RT_USING_MEMHEAP
|
||||||
|
extern size_t __psram_cma_heap_start;
|
||||||
|
extern size_t __psram_cma_heap_end;
|
||||||
|
|
||||||
|
struct aic_memheap
|
||||||
|
{
|
||||||
|
aic_mem_region_t type;
|
||||||
|
char * name;
|
||||||
|
void * begin_addr;
|
||||||
|
void * end_addr;
|
||||||
|
struct rt_memheap heap;
|
||||||
|
struct rt_mutex lock;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct aic_memheap aic_memheaps[] = {
|
||||||
|
#ifdef AIC_TCM_EN
|
||||||
|
{MEM_ITCM, "heap_itcm", (void *)&__itcm_heap_start, (void *)&__itcm_heap_end},
|
||||||
|
{MEM_DTCM, "heap_dtcm", (void *)&__dtcm_heap_start, (void *)&__dtcm_heap_end},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_SRAM1_SW_EN
|
||||||
|
{MEM_SRAM1_SW, "heap_sram1_sw", (void *)&__sram_s1_sw_heap_start, (void *)&__sram_s1_sw_heap_end},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_SRAM1_CMA_EN
|
||||||
|
//{MEM_SRAM1_CMA, "heap_sram1_cma", (void *)&__sram_s1_cma_heap_start, (void *)&__sram_s1_cma_heap_end},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_PSRAM_SW_EN
|
||||||
|
{MEM_PSRAM_SW, "heap_psram_sw", (void *)&__psram_sw_heap_start, (void *)&__psram_sw_heap_end},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_PSRAM_CMA_EN
|
||||||
|
//{MEM_PSRAM_CMA, "heap_cma", (void *)&__psram_cma_heap_start, (void *)&__psram_cma_heap_end},
|
||||||
|
#endif
|
||||||
|
#if defined(AIC_PSRAM_CMA_EN) || defined(AIC_SRAM1_CMA_EN)
|
||||||
|
{MEM_CMA, "heap_cma", (void *)&__cma_heap_start, (void *)&__cma_heap_end},
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
void aic_memheap_init(void)
|
||||||
|
{
|
||||||
|
rt_ubase_t begin_align;
|
||||||
|
rt_ubase_t end_align;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
for (i=0; i<sizeof(aic_memheaps)/sizeof(struct aic_memheap); i++) {
|
||||||
|
begin_align = RT_ALIGN((rt_ubase_t)aic_memheaps[i].begin_addr, RT_ALIGN_SIZE);
|
||||||
|
end_align = RT_ALIGN_DOWN((rt_ubase_t)aic_memheaps[i].end_addr, RT_ALIGN_SIZE);
|
||||||
|
RT_ASSERT(end_align > begin_align);
|
||||||
|
|
||||||
|
rt_memheap_init(&aic_memheaps[i].heap, aic_memheaps[i].name,
|
||||||
|
(void *)begin_align, end_align - begin_align);
|
||||||
|
rt_mutex_init(&aic_memheaps[i].lock, aic_memheaps[i].name, RT_IPC_FLAG_PRIO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *aic_memheap_malloc(int type, size_t size)
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
for (i=0; i<sizeof(aic_memheaps)/sizeof(struct aic_memheap); i++) {
|
||||||
|
if (aic_memheaps[i].type == type)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (i >= sizeof(aic_memheaps)/sizeof(struct aic_memheap))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* Enter critical zone */
|
||||||
|
rt_mutex_take(&aic_memheaps[i].lock, RT_WAITING_FOREVER);
|
||||||
|
/* allocate memory block from system heap */
|
||||||
|
ptr = rt_memheap_alloc(&aic_memheaps[i].heap, size);
|
||||||
|
/* Exit critical zone */
|
||||||
|
rt_mutex_release(&aic_memheaps[i].lock);
|
||||||
|
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void aic_memheap_free(int type, void *rmem)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
if (rmem == RT_NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i=0; i<sizeof(aic_memheaps)/sizeof(struct aic_memheap); i++) {
|
||||||
|
if (aic_memheaps[i].type == type)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (i >= sizeof(aic_memheaps)/sizeof(struct aic_memheap))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Enter critical zone */
|
||||||
|
rt_mutex_take(&aic_memheaps[i].lock, RT_WAITING_FOREVER);
|
||||||
|
rt_memheap_free(rmem);
|
||||||
|
/* Exit critical zone */
|
||||||
|
rt_mutex_release(&aic_memheaps[i].lock);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function will initial smart-evb board.
|
||||||
|
*/
|
||||||
|
void rt_hw_board_init(void)
|
||||||
|
{
|
||||||
|
aic_board_sysclk_init();
|
||||||
|
aic_board_pinmux_init();
|
||||||
|
|
||||||
|
#ifdef RT_USING_HEAP
|
||||||
|
rt_system_heap_init((void *)&__heap_start, (void *)&__heap_end);
|
||||||
|
#if (!defined(QEMU_RUN) && defined(RT_USING_MEMHEAP))
|
||||||
|
aic_memheap_init();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef RT_USING_COMPONENTS_INIT
|
||||||
|
rt_components_board_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
|
||||||
|
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(KERNEL_FREERTOS)
|
||||||
|
#elif defined(KERNEL_BAREMETAL)
|
||||||
|
#include <aic_tlsf.h>
|
||||||
|
|
||||||
|
void aic_hw_board_init(void)
|
||||||
|
{
|
||||||
|
#ifdef TLSF_MEM_HEAP
|
||||||
|
aic_tlsf_heap_init();
|
||||||
|
#endif
|
||||||
|
aic_board_sysclk_init();
|
||||||
|
aic_board_pinmux_init();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef RT_USING_DFS_MNTTABLE
|
||||||
|
#include <dfs_fs.h>
|
||||||
|
/*@}*/
|
||||||
|
#ifdef RT_USING_DFS_ROMFS
|
||||||
|
#include "dfs_romfs.h"
|
||||||
|
static const struct romfs_dirent _mountpoint_root[] =
|
||||||
|
{
|
||||||
|
{ROMFS_DIRENT_DIR, "ram", RT_NULL, 0},
|
||||||
|
{ROMFS_DIRENT_DIR, "data", RT_NULL, 0},
|
||||||
|
{ROMFS_DIRENT_DIR, "rodata", RT_NULL, 0},
|
||||||
|
{ROMFS_DIRENT_DIR, "sdcard", RT_NULL, 0},
|
||||||
|
{ROMFS_DIRENT_DIR, "udisk", RT_NULL, 0},
|
||||||
|
};
|
||||||
|
const struct romfs_dirent romfs_root =
|
||||||
|
{
|
||||||
|
ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_mountpoint_root, ARRAY_SIZE(_mountpoint_root)
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
const struct dfs_mount_tbl mount_table[] = {
|
||||||
|
#ifdef RT_USING_DFS_ROMFS
|
||||||
|
{RT_NULL, "/", "rom", 0, &romfs_root, 0},
|
||||||
|
#endif
|
||||||
|
#ifdef LPKG_RAMDISK_TYPE_INITDATA
|
||||||
|
{"ramdisk0", "/ram", "elm", 0, 0, 0},
|
||||||
|
#endif
|
||||||
|
#ifndef AIC_AB_SYSTEM_INTERFACE
|
||||||
|
#if (defined(AIC_USING_FS_IMAGE_TYPE_FATFS_FOR_0) || defined(AIC_USING_FS_IMAGE_TYPE_FATFS_FOR_1))
|
||||||
|
{"blk_rodata", "/rodata", "elm", 0, 0, 0},
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef LPKG_USING_LITTLEFS
|
||||||
|
{"data", "/data", "lfs", 0, 0, 0},
|
||||||
|
#endif
|
||||||
|
#ifdef LPKG_USING_DFS_UFFS
|
||||||
|
{"data", "/data", "uffs", 0, 0, 1},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_SDMC1
|
||||||
|
{"sd0", "/sdcard", "elm", 0, 0, 0},
|
||||||
|
#endif
|
||||||
|
#if (defined(AIC_USING_USB0_HOST) || defined(AIC_USING_USB0_OTG) || defined(AIC_USING_USB1_HOST))
|
||||||
|
{"udisk", "/udisk", "elm", 0, 0, 0xFF},
|
||||||
|
#endif
|
||||||
|
{0}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
20
target/d13x/demo68-nor/include/board.h
Normal file
20
target/d13x/demo68-nor/include/board.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022, ArtInChip Technology Co., Ltd
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Authors: weilin.peng@artinchip.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __AIC_BOARD_H__
|
||||||
|
#define __AIC_BOARD_H__
|
||||||
|
|
||||||
|
#include <rtconfig.h>
|
||||||
|
|
||||||
|
#if defined(KERNEL_RTTHREAD)
|
||||||
|
#elif defined(KERNEL_FREERTOS)
|
||||||
|
#elif defined(KERNEL_BAREMETAL)
|
||||||
|
void aic_hw_board_init(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __AIC_BOARD_H__ */
|
||||||
6
target/d13x/demo68-nor/pack/env.txt
Normal file
6
target/d13x/demo68-nor/pack/env.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
osAB_next=A
|
||||||
|
osAB_now=A
|
||||||
|
upgrade_available=0
|
||||||
|
bootlimit=5
|
||||||
|
bootcount=0
|
||||||
|
|
||||||
88
target/d13x/demo68-nor/pack/image_cfg.json
Normal file
88
target/d13x/demo68-nor/pack/image_cfg.json
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"spi-nor": { // Device, The name should be the same with string in image:info:media:type
|
||||||
|
"size": "16m", // Size of SPI NOR
|
||||||
|
"partitions": {
|
||||||
|
"spl": { "size": "256k" },
|
||||||
|
"env": { "size": "128k" },
|
||||||
|
"env_r": { "size": "128k" },
|
||||||
|
"os": { "size": "1m" },
|
||||||
|
"os_r": { "size": "1m" },
|
||||||
|
"rodata": { "size": "3m" },
|
||||||
|
"rodata_r": { "size": "3m" },
|
||||||
|
"data": { "size": "7m" }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"image": {
|
||||||
|
"info": { // Header information about image
|
||||||
|
"platform": "d13x",
|
||||||
|
"product": "demo68-nor",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"media": {
|
||||||
|
"type": "spi-nor",
|
||||||
|
"device_id": 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"updater": { // Image writer which is downloaded to RAM by USB
|
||||||
|
"spl": {
|
||||||
|
"file": "bootloader.aic",
|
||||||
|
"attr": ["required", "run"],
|
||||||
|
"ram": "0x30080000"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"target": { // Image components which will be burn to device's partitions
|
||||||
|
"spl": {
|
||||||
|
"file": "bootloader.aic",
|
||||||
|
"attr": ["mtd", "required"],
|
||||||
|
"part": ["spl"]
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"file": "env.bin",
|
||||||
|
"attr": ["mtd", "optional"],
|
||||||
|
"part": ["env","env_r"]
|
||||||
|
},
|
||||||
|
"os": {
|
||||||
|
"file": "d13x_os.itb",
|
||||||
|
"attr": ["mtd", "required"],
|
||||||
|
"part": ["os"]
|
||||||
|
},
|
||||||
|
"rodata": {
|
||||||
|
"file": "rodata.fatfs",
|
||||||
|
"attr": ["mtd", "optional"],
|
||||||
|
"part": ["rodata"]
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"file": "data.lfs",
|
||||||
|
"attr": ["mtd", "optional"],
|
||||||
|
"part": ["data"]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"temporary": { // Pre-proccess to generate image components from raw data
|
||||||
|
"aicboot": {
|
||||||
|
"bootloader.aic": {
|
||||||
|
"head_ver": "0x00010001",
|
||||||
|
"loader": {
|
||||||
|
"file": "bootloader.bin",
|
||||||
|
"load address": "0x30080000",
|
||||||
|
"entry point": "0x30080100",
|
||||||
|
},
|
||||||
|
"resource": {
|
||||||
|
"private": "pbp_cfg.bin",
|
||||||
|
"pbp": "d13x.pbp",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"itb": {
|
||||||
|
"d13x_os.itb": {
|
||||||
|
"its": "d13x_os.its"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"uboot_env": {
|
||||||
|
"env.bin": {
|
||||||
|
"file": "env.txt",
|
||||||
|
"size": "4096",
|
||||||
|
"redundant": "enable",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
2
target/d13x/demo68-nor/pack/ota-subimgs.cfg
Normal file
2
target/d13x/demo68-nor/pack/ota-subimgs.cfg
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
d13x_os.itb
|
||||||
|
rodata.fatfs
|
||||||
255
target/d13x/demo68-nor/pack/pbp_cfg.json
Normal file
255
target/d13x/demo68-nor/pack/pbp_cfg.json
Normal file
@@ -0,0 +1,255 @@
|
|||||||
|
{
|
||||||
|
"psram": {
|
||||||
|
|
||||||
|
"cfg0": { //OPI APS3208K 8M PSRAM
|
||||||
|
"common": {
|
||||||
|
"clock": "198000000",
|
||||||
|
"cs0_pins": "0x0",
|
||||||
|
"cs1_pins": "0x0",
|
||||||
|
"xspi_ctl": "0x116d",
|
||||||
|
"xspi_tcr": "0x280011",
|
||||||
|
"xspi_cfg": "0x03020001",
|
||||||
|
"xspi_ldo": "0x17", //1.92V
|
||||||
|
"psram_cfg0": "0x03030303",
|
||||||
|
"psram_cfg1": "0x00400001",
|
||||||
|
"xspi_cs0_iocfg1": "0x02020202",
|
||||||
|
"xspi_cs0_iocfg2": "0x02020202",
|
||||||
|
"xspi_cs0_iocfg3": "0x36060503",
|
||||||
|
"xspi_cs0_iocfg4": "0x26",
|
||||||
|
"xspi_cs1_iocfg1": "0x02020202",
|
||||||
|
"xspi_cs1_iocfg2": "0x02020202",
|
||||||
|
"xspi_cs1_iocfg3": "0x36060503",
|
||||||
|
"xspi_cs1_iocfg4": "0x26",
|
||||||
|
},
|
||||||
|
"reset": {
|
||||||
|
"proto": "0xff000001",
|
||||||
|
"buf": "0x00ffffff",
|
||||||
|
},
|
||||||
|
"getid": {
|
||||||
|
"proto": "0x40030204",
|
||||||
|
"id": "0x80c980c9",
|
||||||
|
"buf": "0xffffffff",
|
||||||
|
},
|
||||||
|
"init": {
|
||||||
|
"proto0": "0xc0000002", //cmd: byte[0]=0xc0; dummy: byte[1]=0x00; addr: byte[2]=0x00; len: byte[3]=0x02;
|
||||||
|
"buf0": "0x19000000",
|
||||||
|
"proto1": "0xc0000402",
|
||||||
|
"buf1": "0x80000000",
|
||||||
|
"proto2": "0xffffffff",
|
||||||
|
"buf2": "0xffffffff",
|
||||||
|
"proto3": "0xffffffff",
|
||||||
|
"buf3": "0xffffffff",
|
||||||
|
},
|
||||||
|
"xip_cfg": {
|
||||||
|
"wr_proto": "0x80020002",
|
||||||
|
"wr_buf": "0xffffffff",
|
||||||
|
"rd_proto": "0x00060003",
|
||||||
|
"rd_buf": "0xffffffff",
|
||||||
|
},
|
||||||
|
"backup": {
|
||||||
|
"buf0": "0xAA55AA55", // training_value1
|
||||||
|
"buf1": "0x55AA55AA", // training_value2
|
||||||
|
"buf2": "0x02080100", //byte0:read_hold (0x02); byte1:write_hold (0x08); byte3:axi_read_first(0x01); byte4: bit mode
|
||||||
|
"buf3": "0xFFFFFF04",
|
||||||
|
"buf4": "0xFFFFFF05",
|
||||||
|
"buf5": "0xFFFFFF06",
|
||||||
|
"buf6": "0xFFFFFF07",
|
||||||
|
"buf7": "0xFFFFFF08",
|
||||||
|
"buf8": "0xFFFFFF09",
|
||||||
|
"buf9": "0xFFFFFF00",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
"cfg1": { // XCCELA AP12816 16M PSRAM
|
||||||
|
"common": {
|
||||||
|
"clock": "198000000",
|
||||||
|
"cs0_pins": "0x0",
|
||||||
|
"cs1_pins": "0x0",
|
||||||
|
"xspi_ctl": "0x116d",
|
||||||
|
"xspi_tcr": "0x280011",
|
||||||
|
"xspi_cfg": "0x03000001",
|
||||||
|
"xspi_ldo": "0x17", //1.92V
|
||||||
|
"psram_cfg0": "0x03030304", //cmd_lines, addr_lines, data_lines, addr_width
|
||||||
|
"psram_cfg1": "0x02000001",
|
||||||
|
"xspi_cs0_iocfg1": "0x02020202",
|
||||||
|
"xspi_cs0_iocfg2": "0x02020202",
|
||||||
|
"xspi_cs0_iocfg3": "0x36060405",
|
||||||
|
"xspi_cs0_iocfg4": "0x26",
|
||||||
|
"xspi_cs1_iocfg1": "0x02020202",
|
||||||
|
"xspi_cs1_iocfg2": "0x02020202",
|
||||||
|
"xspi_cs1_iocfg3": "0x36060403",
|
||||||
|
"xspi_cs1_iocfg4": "0x26",
|
||||||
|
},
|
||||||
|
"reset": {
|
||||||
|
"proto": "0xff000001",
|
||||||
|
"buf": "0x00ffffff",
|
||||||
|
},
|
||||||
|
"getid": {
|
||||||
|
|
||||||
|
"proto": "0x40040104",
|
||||||
|
"id": "0xdd8ddd8d",
|
||||||
|
"buf": "0xffffffff",
|
||||||
|
},
|
||||||
|
"init": {
|
||||||
|
"proto0": "0xc0000001", //cmd: byte[0]=0xc0; dummy: byte[1]=0x00; addr: byte[2]=0x00; len: byte[3]=0x02;
|
||||||
|
"buf0": "0x11000000",
|
||||||
|
"proto1": "0xc0000401",
|
||||||
|
"buf1": "0x20000000",
|
||||||
|
"proto2": "0xc0000801",
|
||||||
|
"buf2": "0x4c000000",
|
||||||
|
"proto3": "0xffffffff",
|
||||||
|
"buf3": "0xffffffff",
|
||||||
|
},
|
||||||
|
"xip_cfg": {
|
||||||
|
"wr_proto": "0x80070002", //cmd: byte[0]=0x80; dummy: byte[1]=0x07; addr: byte[2]=0x08; len: byte[3]=0x02;
|
||||||
|
"wr_buf": "0xffffffff",
|
||||||
|
"rd_proto": "0x00070003",
|
||||||
|
"rd_buf": "0xffffffff",
|
||||||
|
},
|
||||||
|
"backup": {
|
||||||
|
"buf0": "0x5555aaaa",
|
||||||
|
"buf1": "0xaaaa5555",
|
||||||
|
"buf2": "0x05050101", //byte0:read_hold; byte1:write_hold; byte3:axi_read_first; byte4:bit mode
|
||||||
|
"buf3": "0xFFFFFF04",
|
||||||
|
"buf4": "0xFFFFFF05",
|
||||||
|
"buf5": "0xFFFFFF06",
|
||||||
|
"buf6": "0xFFFFFF07",
|
||||||
|
"buf7": "0xFFFFFF08",
|
||||||
|
"buf8": "0xFFFFFF09",
|
||||||
|
"buf9": "0xFFFFFF00",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
"cfg2": { // XCCELA UnilC SCKW18X12816 16M PSRAM
|
||||||
|
"common": {
|
||||||
|
"clock": "198000000",
|
||||||
|
"cs0_pins": "0x0",
|
||||||
|
"cs1_pins": "0x0",
|
||||||
|
"xspi_ctl": "0x116d",
|
||||||
|
"xspi_tcr": "0x280011",
|
||||||
|
"xspi_cfg": "0x03000001",
|
||||||
|
"xspi_ldo": "0x17", //1.92V
|
||||||
|
"psram_cfg0": "0x03030304", //cmd_lines, addr_lines, data_lines, addr_width
|
||||||
|
"psram_cfg1": "0x02000001",
|
||||||
|
"xspi_cs0_iocfg1": "0x02020202",
|
||||||
|
"xspi_cs0_iocfg2": "0x02020202",
|
||||||
|
"xspi_cs0_iocfg3": "0x36060405",
|
||||||
|
"xspi_cs0_iocfg4": "0x26",
|
||||||
|
"xspi_cs1_iocfg1": "0x02020202",
|
||||||
|
"xspi_cs1_iocfg2": "0x02020202",
|
||||||
|
"xspi_cs1_iocfg3": "0x36060403",
|
||||||
|
"xspi_cs1_iocfg4": "0x26",
|
||||||
|
},
|
||||||
|
"reset": {
|
||||||
|
"proto": "0xff000001",
|
||||||
|
"buf": "0x00ffffff",
|
||||||
|
},
|
||||||
|
"getid": {
|
||||||
|
|
||||||
|
"proto": "0x40040104",
|
||||||
|
"id": "0xc59ac59a",
|
||||||
|
"buf": "0xffffffff",
|
||||||
|
},
|
||||||
|
"init": {
|
||||||
|
"proto0": "0xc0000001", //cmd: byte[0]=0xc0; dummy: byte[1]=0x00; addr: byte[2]=0x00; len: byte[3]=0x02;
|
||||||
|
"buf0": "0x10000000",
|
||||||
|
"proto1": "0xc0000401",
|
||||||
|
"buf1": "0x20000000",
|
||||||
|
"proto2": "0xc0000801",
|
||||||
|
"buf2": "0x4c000000",
|
||||||
|
"proto3": "0xffffffff",
|
||||||
|
"buf3": "0xffffffff",
|
||||||
|
},
|
||||||
|
"xip_cfg": {
|
||||||
|
"wr_proto": "0x80070002", //cmd: byte[0]=0x80; dummy: byte[1]=0x07; addr: byte[2]=0x08; len: byte[3]=0x02;
|
||||||
|
"wr_buf": "0xffffffff",
|
||||||
|
"rd_proto": "0x00070003",
|
||||||
|
"rd_buf": "0xffffffff",
|
||||||
|
},
|
||||||
|
"backup": {
|
||||||
|
"buf0": "0x5555aaaa",
|
||||||
|
"buf1": "0xaaaa5555",
|
||||||
|
"buf2": "0x05050101", //byte0:read_hold; byte1:write_hold; byte3:axi_read_first; byte4:bit mode
|
||||||
|
"buf3": "0xFFFFFF04",
|
||||||
|
"buf4": "0xFFFFFF05",
|
||||||
|
"buf5": "0xFFFFFF06",
|
||||||
|
"buf6": "0xFFFFFF07",
|
||||||
|
"buf7": "0xFFFFFF08",
|
||||||
|
"buf8": "0xFFFFFF09",
|
||||||
|
"buf9": "0xFFFFFF00",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
"system": {
|
||||||
|
"upgmode": { // Set PIN to enter BROM's upgrading mode
|
||||||
|
// If set upgmode_pin_cfg_reg to "0", disable bootpin detect in PBP
|
||||||
|
"upgmode_pin_cfg_reg": "0x18700080", // PINMUX REG, PA0
|
||||||
|
"upgmode_pin_cfg_val": "0x10321", // PINMUX VAL
|
||||||
|
"upgmode_pin_input_reg": "0x18700000", // INPUT VAL REG
|
||||||
|
"upgmode_pin_input_msk": "0x1", // Bit MSK
|
||||||
|
"upgmode_pin_input_val": "0x0", // Bit VAL
|
||||||
|
"upgmode_pin_pullup_dly": "500", // us
|
||||||
|
},
|
||||||
|
"uart": { // PBP's uart setting, remove uart setting to disable log in PBP
|
||||||
|
"main": {
|
||||||
|
//"uart_id": "0", // UART0 for log output
|
||||||
|
//"uart_tx_pin_cfg_reg": "0x18700080", // PA0
|
||||||
|
//"uart_tx_pin_cfg_val": "0x035",
|
||||||
|
//"uart_rx_pin_cfg_reg": "0x18700084", // PA1
|
||||||
|
//"uart_rx_pin_cfg_val": "0x035",
|
||||||
|
|
||||||
|
// "uart_id": "0", // UART0 for log output
|
||||||
|
// "uart_tx_pin_cfg_reg": "0x18700E88", // PN2
|
||||||
|
// "uart_tx_pin_cfg_val": "0x324",
|
||||||
|
// "uart_rx_pin_cfg_reg": "0x18700E8C", // PN3
|
||||||
|
// "uart_rx_pin_cfg_val": "0x324",
|
||||||
|
|
||||||
|
"uart_id": "1", // UART1 for log output
|
||||||
|
"uart_tx_pin_cfg_reg": "0x18700088", // PA2
|
||||||
|
"uart_tx_pin_cfg_val": "0x325",
|
||||||
|
"uart_rx_pin_cfg_reg": "0x1870008C", // PA3
|
||||||
|
"uart_rx_pin_cfg_val": "0x325",
|
||||||
|
|
||||||
|
// "uart_id": "1", // UART1 for log output
|
||||||
|
// "uart_tx_pin_cfg_reg": "0x18700090", // PA4
|
||||||
|
// "uart_tx_pin_cfg_val": "0x325",
|
||||||
|
// "uart_rx_pin_cfg_reg": "0x18700094", // PA5
|
||||||
|
// "uart_rx_pin_cfg_val": "0x325",
|
||||||
|
|
||||||
|
// "uart_id": "3", // UART3 for log output
|
||||||
|
// "uart_tx_pin_cfg_reg": "0x187004B8", // PE14
|
||||||
|
// "uart_tx_pin_cfg_val": "0x325",
|
||||||
|
// "uart_rx_pin_cfg_reg": "0x187004BC", // PE15
|
||||||
|
// "uart_rx_pin_cfg_val": "0x325",
|
||||||
|
|
||||||
|
// "uart_id": "4", // UART4 for log output
|
||||||
|
// "uart_tx_pin_cfg_reg": "0x18700198", // PB6
|
||||||
|
// "uart_tx_pin_cfg_val": "0x325",
|
||||||
|
// "uart_rx_pin_cfg_reg": "0x1870019C", // PB7
|
||||||
|
// "uart_rx_pin_cfg_val": "0x325",
|
||||||
|
|
||||||
|
// "uart_id": "5", // UART5 for log output
|
||||||
|
// "uart_tx_pin_cfg_reg": "0x18700490", // PE4
|
||||||
|
// "uart_tx_pin_cfg_val": "0x325",
|
||||||
|
// "uart_rx_pin_cfg_reg": "0x18700494", // PE5
|
||||||
|
// "uart_rx_pin_cfg_val": "0x325",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"jtag": {
|
||||||
|
"jtag_only": "0", // 1: Boot code stop in PBP after DDR init and jtag init
|
||||||
|
"main": {
|
||||||
|
"jtag_id": "0",
|
||||||
|
"jtag_ms_pin_cfg_reg": "0x187000A8", // PA10
|
||||||
|
"jtag_ms_pin_cfg_val": "0x338",
|
||||||
|
"jtag_ck_pin_cfg_reg": "0x187000AC", // PA11
|
||||||
|
"jtag_ck_pin_cfg_val": "0x338",
|
||||||
|
|
||||||
|
// "jtag_ms_pin_cfg_reg": "0x18700280", // PC0
|
||||||
|
// "jtag_ms_pin_cfg_val": "0x338",
|
||||||
|
// "jtag_ck_pin_cfg_reg": "0x18700294", // PC5
|
||||||
|
// "jtag_ck_pin_cfg_val": "0x338",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
412
target/d13x/demo68-nor/pinmux.c
Normal file
412
target/d13x/demo68-nor/pinmux.c
Normal file
@@ -0,0 +1,412 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022, ArtInChip Technology Co., Ltd
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Authors: weilin.peng@artinchip.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <aic_core.h>
|
||||||
|
#include <aic_hal.h>
|
||||||
|
#include "board.h"
|
||||||
|
|
||||||
|
struct aic_pinmux
|
||||||
|
{
|
||||||
|
unsigned char func;
|
||||||
|
unsigned char bias;
|
||||||
|
unsigned char drive;
|
||||||
|
char * name;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct aic_pinmux aic_pinmux_config[] = {
|
||||||
|
#ifdef AIC_USING_UART0
|
||||||
|
/* uart0 */
|
||||||
|
{5, PIN_PULL_DIS, 3, "PA.0"},
|
||||||
|
{5, PIN_PULL_DIS, 3, "PA.1"},
|
||||||
|
#ifdef AIC_DEV_UART0_MODE_RS485_SIMULATION
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART0_RTS_NAME},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_DEV_UART0_MODE_RS232_UNAUTO_FLOW_CTRL
|
||||||
|
#ifdef AIC_UART0_RTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART0_RTS_NAME}, // BT_UART2_RTS
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_UART0_CTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART0_CTS_NAME}, // BT_UART2_CTS
|
||||||
|
#endif
|
||||||
|
#elif defined AIC_DEV_UART0_MODE_RS232_SW_HW_FLOW_CTRL
|
||||||
|
#ifdef AIC_UART0_RTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART0_RTS_NAME}, // BT_UART2_RTS
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_UART0_CTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART0_CTS_NAME}, // BT_UART2_CTS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_UART1
|
||||||
|
/* uart1 */
|
||||||
|
{5, PIN_PULL_DIS, 3, "PA.2"},
|
||||||
|
{5, PIN_PULL_DIS, 3, "PA.3"},
|
||||||
|
#ifdef AIC_DEV_UART1_MODE_RS485_SIMULATION
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART1_RTS_NAME},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_DEV_UART1_MODE_RS232_UNAUTO_FLOW_CTRL
|
||||||
|
#ifdef AIC_UART1_RTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART1_RTS_NAME}, // BT_UART2_RTS
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_UART1_CTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART1_CTS_NAME}, // BT_UART2_CTS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_DEV_UART1_MODE_RS232_SW_HW_FLOW_CTRL
|
||||||
|
#ifdef AIC_UART1_RTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART1_RTS_NAME}, // BT_UART2_RTS
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_UART1_CTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART1_CTS_NAME}, // BT_UART2_CTS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_UART2
|
||||||
|
/* uart2 */
|
||||||
|
{5, PIN_PULL_DIS, 3, "PD.4"}, // BT_UART2_TX
|
||||||
|
{5, PIN_PULL_DIS, 3, "PD.5"}, // BT_UART2_RX
|
||||||
|
#ifdef AIC_DEV_UART2_MODE_RS485_SIMULATION
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART2_RTS_NAME},
|
||||||
|
#elif defined AIC_DEV_UART2_MODE_RS232_UNAUTO_FLOW_CTRL
|
||||||
|
#ifdef AIC_UART2_RTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART2_RTS_NAME}, // BT_UART2_RTS
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_UART2_CTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART2_CTS_NAME}, // BT_UART2_CTS
|
||||||
|
#endif
|
||||||
|
#elif defined AIC_DEV_UART2_MODE_RS232_SW_HW_FLOW_CTRL
|
||||||
|
#ifdef AIC_UART2_RTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART2_RTS_NAME}, // BT_UART2_RTS
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_UART2_CTS_ENABLE
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_UART2_CTS_NAME}, // BT_UART2_CTS
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
{8, PIN_PULL_DIS, 3, "PA.2"}, // BT_UART2_CTS
|
||||||
|
{8, PIN_PULL_DIS, 3, "PA.3"}, // BT_UART2_RTS
|
||||||
|
{1, PIN_PULL_DIS, 3, "PD.6"}, // BT_PWR_ON
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CAN0
|
||||||
|
/* can0 */
|
||||||
|
{4, PIN_PULL_DIS, 3, "PA.4"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PA.5"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_AUDIO
|
||||||
|
#ifdef AIC_AUDIO_DMIC
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.16"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.17"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_AUDIO_PLAYBACK
|
||||||
|
{5, PIN_PULL_DIS, 3, "PE.12"},
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_AUDIO_PA_ENABLE_GPIO},
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_I2S0
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.11"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.12"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.13"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.14"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.15"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_RTP
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.8"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.9"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.10"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.11"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_I2C2
|
||||||
|
{4, PIN_PULL_DIS, 3, "PA.8"}, // SCK
|
||||||
|
{4, PIN_PULL_DIS, 3, "PA.9"}, // SDA
|
||||||
|
#endif
|
||||||
|
#if defined(AIC_USING_QSPI0) && !defined(AIC_SYSCFG_SIP_FLASH_ENABLE)
|
||||||
|
/* qspi0 */
|
||||||
|
{2, PIN_PULL_DIS, 3, "PB.0"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PB.1"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PB.2"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PB.3"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PB.4"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PB.5"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_SDMC0
|
||||||
|
{2, PIN_PULL_UP, 7, "PB.6"},
|
||||||
|
{2, PIN_PULL_UP, 7, "PB.7"},
|
||||||
|
{2, PIN_PULL_UP, 7, "PB.8"},
|
||||||
|
{2, PIN_PULL_UP, 7, "PB.9"},
|
||||||
|
{2, PIN_PULL_UP, 7, "PB.10"},
|
||||||
|
{2, PIN_PULL_UP, 7, "PB.11"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_SDMC1
|
||||||
|
{2, PIN_PULL_UP, 3, "PC.0"},
|
||||||
|
{2, PIN_PULL_UP, 3, "PC.1"},
|
||||||
|
{2, PIN_PULL_UP, 3, "PC.2"},
|
||||||
|
{2, PIN_PULL_UP, 3, "PC.3"},
|
||||||
|
{2, PIN_PULL_UP, 3, "PC.4"},
|
||||||
|
{2, PIN_PULL_UP, 3, "PC.5"},
|
||||||
|
{2, PIN_PULL_UP, 3, "PC.6"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CAP0
|
||||||
|
{3, PIN_PULL_UP, 3, "PC.6"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CAP1
|
||||||
|
{3, PIN_PULL_UP, 3, "PC.7"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CAP2
|
||||||
|
{3, PIN_PULL_UP, 3, "PC.8"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CAP3
|
||||||
|
{3, PIN_PULL_UP, 3, "PC.9"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CAP4
|
||||||
|
{3, PIN_PULL_UP, 3, "PC.10"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CAP5
|
||||||
|
{3, PIN_PULL_UP, 3, "PC.11"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_WIRELESS_LAN
|
||||||
|
{1, PIN_PULL_DIS, 3, "PD.7"}, // WIFI_PWR_ON
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_I2C0
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.0"}, // SCK
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.1"}, // SDA
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_PANEL_ENABLE_GPIO
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_PANEL_ENABLE_GPIO},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_LVDS_LINK_0
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.18"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.19"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.20"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.21"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.22"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.23"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.24"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.25"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.26"},
|
||||||
|
{3, PIN_PULL_DIS, 3, "PD.27"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_DISP_MIPI_DSI
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.18"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.19"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.20"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.21"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.22"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.23"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.24"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.25"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.26"},
|
||||||
|
{4, PIN_PULL_DIS, 3, "PD.27"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GMAC0
|
||||||
|
/* gmac0 */
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.0"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.1"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.2"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.3"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.4"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.5"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.7"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.8"},
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.9"},
|
||||||
|
/* phy0 reset gpio */
|
||||||
|
{1, PIN_PULL_DIS, 3, "PE.6"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CLK_OUT0
|
||||||
|
{6, PIN_PULL_DIS, 3, "PD.13"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CLK_OUT1
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.11"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CLK_OUT2
|
||||||
|
{2, PIN_PULL_DIS, 3, "PE.10"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_CLK_OUT3
|
||||||
|
{7, PIN_PULL_DIS, 3, "PC.6"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PWM1
|
||||||
|
{3, PIN_PULL_DIS, 3, "PE.11"},
|
||||||
|
//{3, PIN_PULL_DIS, 3, "PE.12"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PWM2
|
||||||
|
{3, PIN_PULL_DIS, 3, "PE.13"},
|
||||||
|
//{3, PIN_PULL_DIS, 3, "PE.15"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM0
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.26"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.27"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM1
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.24"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.25"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM2
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.22"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.23"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM3
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.20"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.21"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM4
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.18"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.19"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM5
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.16"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.17"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM6
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.14"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.15"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM7
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.12"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.13"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM8
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.10"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.11"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM9
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.8"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.9"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM10
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.2"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.3"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_EPWM11
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.0"},
|
||||||
|
{7, PIN_PULL_DIS, 3, "PD.1"},
|
||||||
|
#endif
|
||||||
|
#if (defined(AIC_USING_USB0_DEVICE) || defined(AIC_USING_USB0_HOST))
|
||||||
|
/* usb0 */
|
||||||
|
{2, PIN_PULL_DIS, 3, "PO.0"}, // USB-DM
|
||||||
|
{2, PIN_PULL_DIS, 3, "PO.1"}, // USB-DP
|
||||||
|
{1, PIN_PULL_DIS, 3, "PD.8"}, // USB-ID
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC0
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.0"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC1
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.1"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC2
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.2"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC3
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.3"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC4
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.4"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC5
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.5"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC6
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.6"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC7
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.7"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC8
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.8"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC9
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.9"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC10
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.10"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC11
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.11"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC12
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.12"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC13
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.13"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC14
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.14"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_PSADC15
|
||||||
|
{7, PIN_PULL_DIS, 3, "PA.15"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI0
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.0"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI1
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.1"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI2
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.2"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI3
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.3"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI4
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.4"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI5
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.5"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI6
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.6"},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_USING_GPAI7
|
||||||
|
{2, PIN_PULL_DIS, 3, "PA.7"},
|
||||||
|
#endif
|
||||||
|
/* ctp rst & irq */
|
||||||
|
#ifdef AIC_TOUCH_PANEL_AXS15260
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_AXS15260_RST_PIN},
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_AXS15260_INT_PIN},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_TOUCH_PANEL_CST3240
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_CST3240_RST_PIN},
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_CST3240_INT_PIN},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_TOUCH_PANEL_FT7411
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_FT7411_RST_PIN},
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_FT7411_INT_PIN},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_TOUCH_PANEL_GSL1680
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_GSL1680_RST_PIN},
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_GSL1680_INT_PIN},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_TOUCH_PANEL_GT911
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_GT911_RST_PIN},
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_GT911_INT_PIN},
|
||||||
|
#endif
|
||||||
|
#ifdef AIC_TOUCH_PANEL_ST16XX
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_ST16XX_RST_PIN},
|
||||||
|
{1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_ST16XX_INT_PIN},
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
void aic_board_pinmux_init(void)
|
||||||
|
{
|
||||||
|
uint32_t i = 0;
|
||||||
|
long pin = 0;
|
||||||
|
unsigned int g;
|
||||||
|
unsigned int p;
|
||||||
|
|
||||||
|
for (i=0; i<ARRAY_SIZE(aic_pinmux_config); i++) {
|
||||||
|
pin = hal_gpio_name2pin(aic_pinmux_config[i].name);
|
||||||
|
if (pin < 0)
|
||||||
|
continue;
|
||||||
|
g = GPIO_GROUP(pin);
|
||||||
|
p = GPIO_GROUP_PIN(pin);
|
||||||
|
hal_gpio_set_func(g, p, aic_pinmux_config[i].func);
|
||||||
|
hal_gpio_set_bias_pull(g, p, aic_pinmux_config[i].bias);
|
||||||
|
hal_gpio_set_drive_strength(g, p, aic_pinmux_config[i].drive);
|
||||||
|
}
|
||||||
|
}
|
||||||
81
target/d13x/demo68-nor/sys_clk.c
Normal file
81
target/d13x/demo68-nor/sys_clk.c
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022, ArtInChip Technology Co., Ltd
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Authors: weilin.peng@artinchip.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <aic_core.h>
|
||||||
|
#include <aic_hal.h>
|
||||||
|
#include "board.h"
|
||||||
|
|
||||||
|
struct aic_sysclk
|
||||||
|
{
|
||||||
|
unsigned long freq;
|
||||||
|
unsigned int clk_id;
|
||||||
|
unsigned int parent_clk_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct aic_sysclk aic_sysclk_config[] = {
|
||||||
|
{AIC_CLK_PLL_INT0_FREQ, CLK_PLL_INT0, 0}, /* 480000000 */
|
||||||
|
{AIC_CLK_PLL_INT1_FREQ, CLK_PLL_INT1, 0}, /* 1200000000 */
|
||||||
|
{AIC_CLK_PLL_FRA0_FREQ, CLK_PLL_FRA0, 0}, /* 792000000 */
|
||||||
|
{AIC_CLK_PLL_FRA2_FREQ, CLK_PLL_FRA2, 0}, /* 1188000000 */
|
||||||
|
{AIC_CLK_CPU_FREQ, CLK_CPU, CLK_CPU_SRC1}, /* 480000000 */
|
||||||
|
{AIC_CLK_AXI0_FREQ, CLK_AXI0, CLK_AXI_AHB_SRC1}, /* 200000000 */
|
||||||
|
{AIC_CLK_AHB0_FREQ, CLK_AHB0, CLK_AXI_AHB_SRC1}, /* 200000000 */
|
||||||
|
{AIC_CLK_APB0_FREQ, CLK_APB0, CLK_APB0_SRC1}, /* 100000000 */
|
||||||
|
// {24000000, CLK_APB1, 0},
|
||||||
|
#ifdef AIC_USING_CLK_OUT0
|
||||||
|
{AIC_CLK_OUT0_FREQ, CLK_OUT0, 0},
|
||||||
|
#endif /* AIC_USING_CLK_OUT0 */
|
||||||
|
#ifdef AIC_USING_CLK_OUT1
|
||||||
|
{AIC_CLK_OUT1_FREQ, CLK_OUT1, 0},
|
||||||
|
#endif /* AIC_USING_CLK_OUT1 */
|
||||||
|
#ifdef AIC_USING_CLK_OUT2
|
||||||
|
{AIC_CLK_OUT2_FREQ, CLK_OUT2, 0},
|
||||||
|
#endif /* AIC_USING_CLK_OUT2 */
|
||||||
|
#ifdef AIC_USING_CLK_OUT3
|
||||||
|
{AIC_CLK_OUT3_FREQ, CLK_OUT3, 0},
|
||||||
|
#endif /* AIC_USING_CLK_OUT3 */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some Chips may enable USB0 EHCI in Boot ROM,
|
||||||
|
* it is better to disable USB0 EHCI during boot to avoid some side effect.
|
||||||
|
*/
|
||||||
|
static void usb_ehci_disable(void)
|
||||||
|
{
|
||||||
|
hal_clk_disable_assertrst(CLK_USBH0);
|
||||||
|
hal_clk_disable(CLK_USBH0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void aic_board_sysclk_init(void)
|
||||||
|
{
|
||||||
|
uint32_t i = 0;
|
||||||
|
|
||||||
|
usb_ehci_disable();
|
||||||
|
|
||||||
|
for (i=0; i<sizeof(aic_sysclk_config)/sizeof(struct aic_sysclk); i++) {
|
||||||
|
if (aic_sysclk_config[i].freq == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* multi parent clk */
|
||||||
|
if (aic_sysclk_config[i].parent_clk_id) {
|
||||||
|
hal_clk_set_freq(aic_sysclk_config[i].parent_clk_id,
|
||||||
|
aic_sysclk_config[i].freq);
|
||||||
|
hal_clk_enable(aic_sysclk_config[i].parent_clk_id);
|
||||||
|
hal_clk_set_parent(aic_sysclk_config[i].clk_id,
|
||||||
|
aic_sysclk_config[i].parent_clk_id);
|
||||||
|
} else {
|
||||||
|
hal_clk_set_freq(aic_sysclk_config[i].clk_id, aic_sysclk_config[i].freq);
|
||||||
|
hal_clk_enable(aic_sysclk_config[i].clk_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Enable sys clk */
|
||||||
|
hal_clk_enable_deassertrst_iter(CLK_GPIO);
|
||||||
|
hal_clk_enable_deassertrst_iter(CLK_GTC);
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user