[beken-72xx] Support compilation for BK7251 family

This commit is contained in:
Kuba Szczodrzyński
2022-12-08 20:16:44 +01:00
parent 8cb59661ac
commit f63a114371
3 changed files with 138 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ void delayMilliseconds(unsigned long ms) {
}
static uint32_t getTicksCount() {
// copied from bk_timer_ctrl(), for speeds
uint32_t timeout = 0;
REG_WRITE(TIMER0_2_READ_CTL, (BKTIMER0 << 2) | 1);
while (REG_READ(TIMER0_2_READ_CTL) & 1) {
@@ -58,9 +59,6 @@ unsigned long millis() {
}
unsigned long micros() {
// copied from bk_timer_ctrl(), for speeds
uint32_t timeout = 0;
#if (CFG_SOC_NAME == SOC_BK7231)
#error "Not implemented"
#endif
@@ -91,6 +89,7 @@ unsigned long micros() {
return correctedMillis * 1000 + nowTicks / (CFG_XTAL_FREQUENCE / 1000 / 1000);
#else
#if 0
uint32_t timeout = 0;
REG_WRITE(TIMER3_5_READ_CTL, (BKTIMER3 << 2) | 1);
while (REG_READ(TIMER3_5_READ_CTL) & 1) {
timeout++;

View File

@@ -32,7 +32,7 @@ SOC_BK7236 = 6
SOC_NAMES = {
SOC_BK7231: "bk7231",
SOC_BK7231U: "bk7231u",
SOC_BK7221U: "bk7221u",
SOC_BK7251: "bk7251",
SOC_BK7271: "bk7271",
SOC_BK7231N: "bk7231n",
SOC_BK7236: "bk7236",
@@ -517,7 +517,7 @@ if env.Cfg("ATSVR_CFG"):
"+<*>",
],
)
if env.Cfg("CFG_USB"):
if env.Cfg("CFG_USB") or env.Cfg("CFG_USE_SDCARD_HOST"):
env.AddLibrary(
name="bdk_driver_usb",
base_dir=ROOT_DIR,

View File

@@ -0,0 +1,134 @@
#pragma once
#define AT_SERVICE_CFG 0
#define BLE_DEFAULT_WIFI_REQUEST 2
#define BLE_VERSION_4_2 1
#define BLE_VERSION_5_x 2
#define BLE_WIFI_CO_REQUEST 3
#define CFG_AIRKISS_TEST 0
#define CFG_AP_MONITOR_COEXIST 0
#define CFG_AP_SUPPORT_HT_IE 0
#define CFG_BACKGROUND_PRINT 0
#define CFG_BK_AWARE 0
#define CFG_BK_AWARE_OUI "\xC8\x47\x8C"
#define CFG_BK7221_MDM_WATCHDOG_PATCH 0
#define CFG_BLE_VERSION BLE_VERSION_4_2
#define CFG_EASY_FLASH 1
#define CFG_ENABLE_BUTTON 0
#define CFG_ENABLE_DEMO_TEST 0
#define CFG_ENABLE_WPA_LOG 0
#define CFG_GENERAL_DMA 1
#define CFG_IEEE80211N 1
#define CFG_IEEE80211W 0
#define CFG_INT_WDG_ENABLED 1
#define CFG_INT_WDG_PERIOD_MS 10000
#define CFG_IPERF_TEST 0
#define CFG_JTAG_ENABLE 0
#define CFG_LESS_MEMERY_IN_RWNX 0
#define CFG_MAC_PHY_BAPASS 1
#define CFG_MSDU_RESV_HEAD_LEN 96
#define CFG_MSDU_RESV_TAIL_LEN 16
#define CFG_REAL_SDIO 0
#define CFG_RELEASE_FIRMWARE 0
#define CFG_ROLE_LAUNCH 0
#define CFG_RUNNING_PLATFORM SOC_PLATFORM
#define CFG_RWNX_QOS_MSDU 1
#define CFG_RX_SENSITIVITY_TEST 1
#define CFG_SARADC_CALIBRATE 0
#define CFG_SD_HOST_INTF SD1_HOST_INTF
#define CFG_SDIO 0
#define CFG_SDIO_TRANS 0
#define CFG_SOC_NAME SOC_BK7221U
#define CFG_SUPPOET_BSSID_CONNECT 0
#define CFG_SUPPORT_BKREG 1
#define CFG_SUPPORT_BLE 1
#define CFG_SUPPORT_BLE_MESH 0
#define CFG_SUPPORT_BSSID_CONNECT 0
#define CFG_SUPPORT_CALIBRATION 1
#define CFG_SUPPORT_CCD 0
#define CFG_SUPPORT_HID 0
#define CFG_SUPPORT_MANUAL_CALI 1
#define CFG_SUPPORT_MSD 0
#define CFG_SUPPORT_OTA_HTTP 1
#define CFG_SUPPORT_OTA_TFTP 0
#define CFG_SUPPORT_TPC_PA_MAP 1
#define CFG_SUPPORT_UVC 0
#define CFG_SYS_REDUCE_NORMAL_POWER 0
#define CFG_TASK_WDG_ENABLED 0
#define CFG_TASK_WDG_PERIOD_MS 60000
#define CFG_TCP_SERVER_TEST 0
#define CFG_TX_EVM_TEST 1
#define CFG_UART_DEBUG 0
#define CFG_UART_DEBUG_COMMAND_LINE 1
#define CFG_UDISK_MP3 0
#define CFG_USB 0
#define CFG_USE_AP_IDLE 0
#define CFG_USE_AP_PS 0
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
#define CFG_USE_AUD_ADC 1
#define CFG_USE_AUD_DAC 1
#define CFG_USE_AUDIO 1
#define CFG_USE_BLE_PS 1
#define CFG_USE_CAMERA_INTF 0
#define CFG_USE_DCACHE 0
#define CFG_USE_DEEP_PS 1
#define CFG_USE_DHCP 1
#define CFG_USE_FAKERTC_PS 0
#define CFG_USE_FFT 0
#define CFG_USE_FTPD_UPGRADE 0
#define CFG_USE_HSLAVE_SPI 0
#define CFG_USE_I2S 0
#define CFG_USE_IRDA 0
#define CFG_USE_LWIP_NETSTACK 1
#define CFG_USE_MCU_PS 1
#define CFG_USE_PTA 0
#define CFG_USE_QSPI 1
#define CFG_USE_SDCARD_HOST 1
#define CFG_USE_SECURITY 0
#define CFG_USE_SPI_MASTER 1
#define CFG_USE_SPI_MST_FLASH 1
#define CFG_USE_SPI_MST_PSRAM 0
#define CFG_USE_SPI_SLAVE 0
#define CFG_USE_SPIDMA 0
#define CFG_USE_STA_PS 1
#define CFG_USE_TEMPERATURE_DETECT 0
#define CFG_USE_TICK_CAL 1
#define CFG_USE_UART1 1
#define CFG_USE_USB_CHARGE 0
#define CFG_USE_USB_DEVICE 1
#define CFG_USE_USB_DEVICE_CARD_READER 1
#define CFG_USE_USB_HOST 0
#define CFG_USE_WPA_29 1
#define CFG_WFA_CERT 0
#define CFG_WIFI_RAW_TX_CMD 0
#define CFG_WIFI_SENSOR 0
#define CFG_WLAN_FAST_CONNECT 0
#define CFG_WPA_CTRL_IFACE 1
#define CFG_WPA3 0
#define CFG_XTAL_FREQUENCE CFG_XTAL_FREQUENCE_26M
#define CFG_XTAL_FREQUENCE_26M 26000000
#define CFG_XTAL_FREQUENCE_40M 40000000
#define CONFIG_APP_MP3PLAYER 0
#define FPGA_PLATFORM 0
#define OSMALLOC_STATISTICAL 0
#define RF_USE_POLICY WIFI_DEFAULT_BLE_REQUEST
#define SD_HOST_INTF 0
#define SD1_HOST_INTF 1
#define SOC_BK7221U 3
#define SOC_BK7231 1
#define SOC_BK7231N 5
#define SOC_BK7231U 2
#define SOC_PLATFORM 1
#define THD_APPLICATION_PRIORITY 3
#define THD_CORE_PRIORITY 2
#define THD_EXTENDED_APP_PRIORITY 5
#define THD_HOSTAPD_PRIORITY 5
#define THD_INIT_PRIORITY 4
#define THD_LWIP_PRIORITY 4
#define THD_MEDIA_PRIORITY 4
#define THD_RECONNECT_PRIORITY 4
#define THD_UBG_PRIORITY 5
#define THD_UMP3_PRIORITY 4
#define THD_WPAS_PRIORITY 5
#define THDD_KEY_SCAN_PRIORITY 7
#define WIFI_DEFAULT_BLE_REQUEST 1