From 84af32db34f27a00ac94b005f5977420d447aea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=9E=BA=E4=B8=9D=E6=9D=BE=E6=8E=89=E7=9A=84=E4=BA=BA?= <95859513+Z8MAN8@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:41:09 +0800 Subject: [PATCH] [bsp/bl808] add: drv_gpio (#6856) * [bsp/bl808] add: drv_gpio --- bsp/bl808/m0/drivers/SConscript | 4 +- bsp/bl808/m0/drivers/board.c | 5 + bsp/bl808/m0/drivers/drv_gpio.c | 208 ++++ bsp/bl808/m0/drivers/drv_gpio.h | 39 + bsp/bl808/m0/libraries/SConscript | 2 + .../platform/hosal/bl808_e907_hal/bl_audio.c | 8 +- .../platform/hosal/bl808_e907_hal/bl_boot2.c | 22 +- .../platform/hosal/bl808_e907_hal/bl_boot2.h | 4 +- .../platform/hosal/bl808_e907_hal/bl_efuse.c | 12 +- .../hosal/bl808_e907_hal/bl_ethernetif.c | 8 +- .../platform/hosal/bl808_e907_hal/bl_flash.c | 2 +- .../platform/hosal/bl808_e907_hal/bl_irq.c | 42 +- .../hosal/bl808_e907_hal/bl_mm_clock.c | 2 +- .../platform/hosal/bl808_e907_hal/bl_pm.c | 30 +- .../platform/hosal/bl808_e907_hal/bl_sdh.c | 8 +- .../platform/hosal/bl808_e907_hal/bl_sec.h | 2 +- .../hosal/bl808_e907_hal/bl_sec_sha.c | 4 +- .../platform/hosal/bl808_e907_hal/bl_sys.c | 2 +- .../platform/hosal/bl808_e907_hal/bl_wifi.c | 2 +- .../platform/hosal/bl808_e907_hal/bl_wifi.h | 2 +- .../platform/hosal/bl808_e907_hal/emac_phy.c | 2 +- .../platform/hosal/bl808_e907_hal/hal_board.c | 24 +- .../platform/hosal/bl808_e907_hal/hal_boot2.c | 20 +- .../platform/hosal/bl808_e907_hal/hal_boot2.h | 4 +- .../platform/hosal/bl808_e907_hal/hal_emac.c | 6 +- .../platform/hosal/bl808_e907_hal/hal_uart.c | 4 +- .../platform/hosal/bl808_e907_hal/hosal_adc.c | 36 +- .../platform/hosal/bl808_e907_hal/hosal_dma.c | 4 +- .../platform/hosal/bl808_e907_hal/hosal_spi.c | 16 +- .../hosal/bl808_e907_hal/hosal_uart.c | 230 ++--- .../platform/hosal/include/hosal_adc.h | 62 +- .../platform/hosal/include/hosal_dac.h | 56 +- .../platform/hosal/include/hosal_efuse.h | 16 +- .../platform/hosal/include/hosal_flash.h | 2 +- .../platform/hosal/include/hosal_i2c.h | 2 +- .../platform/hosal/include/hosal_pwm.h | 20 +- .../platform/hosal/include/hosal_rng.h | 4 +- .../platform/hosal/include/hosal_rtc.h | 26 +- .../platform/hosal/include/hosal_spi.h | 30 +- .../platform/hosal/include/hosal_timer.h | 14 +- .../platform/hosal/include/hosal_wdg.h | 6 +- .../platform_hal/platform_hal_device.cpp | 18 +- .../platform/hosal/sec_common/bl_sec_sha.c | 6 +- .../bl808_e907_std/bflb_bsp_driver_glue.h | 10 +- .../soc/bl808/bl808_e907_std/bflb_stub.c | 12 +- .../soc/bl808/bl808_e907_std/bflb_stub.h | 12 +- .../hal_drv/default_config/adc_config.h | 2 +- .../hal_drv/default_config/dac_config.h | 2 +- .../hal_drv/default_config/i2s_config.h | 2 +- .../hal_drv/default_config/uart_config.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_adc.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_audio.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_clock.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_dsi.h | 406 ++++---- .../bl808_bsp_driver/hal_drv/inc/hal_i2c.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_i2s.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_mtimer.h | 2 +- .../hal_drv/inc/hal_sec_aes.h | 2 +- .../hal_drv/inc/hal_sec_dsa.h | 2 +- .../hal_drv/inc/hal_sec_ecdsa.h | 2 +- .../hal_drv/inc/hal_sec_hash.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_spi.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_timer.h | 2 +- .../bl808_bsp_driver/hal_drv/inc/hal_uart.h | 2 +- .../hal_drv/inc/mipi_display.h | 54 +- .../bl808_bsp_driver/hal_drv/src/hal_adc.c | 2 +- .../bl808_bsp_driver/hal_drv/src/hal_boot2.c | 2 +- .../bl808_bsp_driver/hal_drv/src/hal_common.c | 2 +- .../bl808_bsp_driver/hal_drv/src/hal_dsi.c | 2 +- .../bl808_bsp_driver/hal_drv/src/hal_gpio.c | 2 +- .../bl808_bsp_driver/hal_drv/src/hal_i2c.c | 2 +- .../hal_drv/src/hal_sec_dsa.c | 68 +- .../hal_drv/src/hal_sec_ecdsa.c | 4 +- .../hal_drv/src/hal_sec_hash.c | 2 +- .../bl808_bsp_driver/hal_drv/src/hal_spi.c | 2 +- .../risc-v/Core/Include/core_rv64.h | 28 +- .../risc-v/Core/Include/riscv_encoding.h | 54 +- .../risc-v/csi_dsp/include/csi_instance.h | 10 +- .../risc-v/csi_dsp/include/csi_math.h | 44 +- .../bl808_bsp_driver/risc-v/rv_hart.c | 8 +- .../startup/d0/source/GCC/start_load.c | 14 +- .../startup/lp/source/GCC/start_load.c | 14 +- .../startup/lp/source/interrupt.c | 102 +- .../startup/m0/source/GCC/start_load.c | 14 +- .../std_drv/inc/bl808_audio.h | 10 +- .../std_drv/inc/bl808_dsp2_misc.h | 2 +- .../std_drv/inc/bl808_uhs_phy.h | 6 +- .../bl808_bsp_driver/std_drv/src/bl808_can.c | 4 +- .../std_drv/src/bl808_clock.c | 44 +- .../bl808_bsp_driver/std_drv/src/bl808_dma.c | 2 +- .../bl808_bsp_driver/std_drv/src/bl808_dsi.c | 12 +- .../bl808_bsp_driver/std_drv/src/bl808_dsp2.c | 8 +- .../std_drv/src/bl808_dsp2_misc.c | 20 +- .../std_drv/src/bl808_ef_ctrl.c | 12 +- .../bl808_bsp_driver/std_drv/src/bl808_emac.c | 6 +- .../bl808_bsp_driver/std_drv/src/bl808_glb.c | 36 +- .../std_drv/src/bl808_glb_pll.c | 36 +- .../bl808_bsp_driver/std_drv/src/bl808_i2c.c | 2 +- .../bl808_bsp_driver/std_drv/src/bl808_ipc.c | 2 +- .../std_drv/src/bl808_iso11898.c | 4 +- .../bl808_bsp_driver/std_drv/src/bl808_lz4d.c | 2 +- .../std_drv/src/bl808_mfg_efuse.c | 34 +- .../std_drv/src/bl808_mfg_flash.c | 14 +- .../std_drv/src/bl808_mfg_media.c | 10 +- .../std_drv/src/bl808_mjdec.c | 10 +- .../std_drv/src/bl808_osd_blend.c | 2 +- .../std_drv/src/bl808_psram.c | 2 +- .../std_drv/src/bl808_psram_uhs.c | 2 +- .../std_drv/src/bl808_romapi_e907.c | 2 +- .../std_drv/src/bl808_romdriver_e907.c | 8 +- .../bl808_bsp_driver/std_drv/src/bl808_sdh.c | 28 +- .../std_drv/src/bl808_sf_ctrl.c | 182 ++-- .../std_drv/src/bl808_timer.c | 6 +- .../std_drv/src/bl808_uhs_phy.c | 312 +++--- .../common/bl_math/arm_dsp_wrapper.h | 2 +- .../bl808_e907_std/common/device/drv_device.c | 2 +- .../bl808_e907_std/common/device/drv_device.h | 2 +- .../bl808_e907_std/common/list/drv_list.h | 2 +- .../common/memheap/drv_mmheap.h | 2 +- .../bl808_e907_std/common/misc/compiler/gcc.h | 2 +- .../bl808_e907_std/common/soft_crc/softcrc.c | 2 +- .../common/timestamp/timestamp.c | 40 +- .../common/timestamp/timestamp.h | 14 +- .../soc/bl808/startup_bl808/evb/src/debug.c | 920 +++++++++--------- .../startup_bl808/evb/src/startup_bl606p.c | 28 +- .../stage/blfdt/test/tc_blfdt_dump.c | 6 +- .../stage/blfdt/test/tc_blfdt_wifi.c | 6 +- bsp/bl808/m0/libraries/stage/blog/blog.c | 8 +- .../m0/libraries/utils/include/utils_fec.h | 6 +- .../m0/libraries/utils/include/utils_getopt.h | 10 +- .../m0/libraries/utils/include/utils_list.h | 22 +- .../m0/libraries/utils/include/utils_time.h | 2 +- .../utils/src/test/test_utils_rbtree.c | 2 +- bsp/bl808/m0/libraries/utils/src/utils_crc.c | 132 +-- bsp/bl808/m0/libraries/utils/src/utils_hex.c | 72 +- .../m0/libraries/utils/src/utils_hexdump.c | 4 +- bsp/bl808/m0/libraries/utils/src/utils_md5.c | 2 +- bsp/bl808/m0/libraries/utils/src/utils_memp.c | 2 +- .../m0/libraries/utils/src/utils_rbtree.c | 90 +- bsp/bl808/m0/libraries/utils/src/utils_sha1.c | 2 +- .../m0/libraries/utils/src/utils_string.c | 136 +-- bsp/bl808/m0/libraries/utils/src/utils_time.c | 14 +- 142 files changed, 2263 insertions(+), 2009 deletions(-) create mode 100644 bsp/bl808/m0/drivers/drv_gpio.c create mode 100644 bsp/bl808/m0/drivers/drv_gpio.h diff --git a/bsp/bl808/m0/drivers/SConscript b/bsp/bl808/m0/drivers/SConscript index ec21bcac6b..503dd50f4c 100644 --- a/bsp/bl808/m0/drivers/SConscript +++ b/bsp/bl808/m0/drivers/SConscript @@ -15,8 +15,8 @@ if GetDepend(['RT_USING_SERIAL']): else: src += ['drv_uart.c'] -# if GetDepend('RT_USING_PIN'): -# src += ['drv_gpio.c'] +if GetDepend('RT_USING_PIN'): + src += ['drv_gpio.c'] # if GetDepend('BSP_USING_LCD'): # src += ['drv_lcd.c'] diff --git a/bsp/bl808/m0/drivers/board.c b/bsp/bl808/m0/drivers/board.c index 97e0504610..525488eaec 100644 --- a/bsp/bl808/m0/drivers/board.c +++ b/bsp/bl808/m0/drivers/board.c @@ -76,6 +76,11 @@ void rt_hw_board_init(void) rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); #endif + /* GPIO driver initialization is open by default */ +#ifdef RT_USING_PIN + rt_hw_pin_init(); +#endif + /* UART driver initialization is open by default */ #ifdef RT_USING_SERIAL rt_hw_uart_init(); diff --git a/bsp/bl808/m0/drivers/drv_gpio.c b/bsp/bl808/m0/drivers/drv_gpio.c new file mode 100644 index 0000000000..ab43565f81 --- /dev/null +++ b/bsp/bl808/m0/drivers/drv_gpio.c @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2006-2023, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2023/01/5 chushicheng first version + * + */ + +#include "drv_gpio.h" +#include +#include "bl808_gpio.h" +#include "bl808_glb.h" +#include "bl808.h" + +#ifdef RT_USING_PIN + +#define DBG_TAG "drv.gpio" +#define DBG_LVL DBG_INFO +#include + +static void GPIO0_IRQHandler(void); + +struct gpio_int_cfg_private +{ + slist_t list; + uint32_t pin; + void (*hdr)(uint32_t pin); +}; + +static slist_t gpio_int_head = SLIST_OBJECT_INIT(gpio_int_head); + + +static void bl808_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value) +{ + GLB_GPIO_Write(pin, value); +} + +static int bl808_pin_read(rt_device_t dev, rt_base_t pin) +{ + int value; + value = GLB_GPIO_Read(pin);; + return value; +} + +static void bl808_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) +{ + GLB_GPIO_Cfg_Type gpio_cfg; + + gpio_cfg.gpioFun = GPIO_FUN_GPIO; + gpio_cfg.gpioPin = pin; + gpio_cfg.drive = 0; + gpio_cfg.smtCtrl = 1; + gpio_cfg.outputMode = 0; + + switch (mode) + { + case GPIO_OUTPUT_MODE: + gpio_cfg.gpioMode = GPIO_MODE_OUTPUT; + gpio_cfg.pullType = GPIO_PULL_NONE; + break; + + case GPIO_OUTPUT_PP_MODE: + gpio_cfg.gpioMode = GPIO_MODE_OUTPUT; + gpio_cfg.pullType = GPIO_PULL_UP; + break; + + case GPIO_OUTPUT_PD_MODE: + gpio_cfg.gpioMode = GPIO_MODE_OUTPUT; + gpio_cfg.pullType = GPIO_PULL_DOWN; + break; + + case GPIO_INPUT_MODE: + gpio_cfg.gpioMode = GPIO_MODE_INPUT; + gpio_cfg.pullType = GPIO_PULL_NONE; + break; + + case GPIO_INPUT_PP_MODE: + gpio_cfg.gpioMode = GPIO_MODE_INPUT; + gpio_cfg.pullType = GPIO_PULL_UP; + break; + + case GPIO_INPUT_PD_MODE: + gpio_cfg.gpioMode = GPIO_MODE_INPUT; + gpio_cfg.pullType = GPIO_PULL_DOWN; + break; + case GPIO_HZ_MODE: + GLB_GPIO_Set_HZ(pin); + default: + CPU_Interrupt_Disable(GPIO_INT0_IRQn); + GLB_GPIO_IntMask(pin, MASK); + + GLB_GPIO_INT_Cfg_Type intCfg; + + intCfg.gpioPin = pin; + intCfg.intMask = MASK; + + gpio_cfg.gpioMode = GPIO_MODE_INPUT; + + if (mode == GPIO_ASYNC_RISING_TRIGER_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_DOWN; + intCfg.trig = GLB_GPIO_INT_TRIG_ASYNC_RISING_EDGE; + } + else if (mode == GPIO_ASYNC_FALLING_TRIGER_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_UP; + intCfg.trig = GLB_GPIO_INT_TRIG_ASYNC_FALLING_EDGE; + } + else if (mode == GPIO_ASYNC_HIGH_LEVEL_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_DOWN; + intCfg.trig = GLB_GPIO_INT_TRIG_ASYNC_HIGH_LEVEL; + } + else if (mode == GPIO_ASYNC_LOW_LEVEL_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_UP; + intCfg.trig = GLB_GPIO_INT_TRIG_ASYNC_LOW_LEVEL; + } + else if (mode == GPIO_SYNC_RISING_TRIGER_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_DOWN; + intCfg.trig = GLB_GPIO_INT_TRIG_SYNC_RISING_EDGE; + } + else if (mode == GPIO_SYNC_FALLING_TRIGER_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_UP; + intCfg.trig = GLB_GPIO_INT_TRIG_SYNC_FALLING_EDGE; + } + else if (mode == GPIO_SYNC_FALLING_TRIGER_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_NONE; + intCfg.trig = GLB_GPIO_INT_TRIG_SYNC_FALLING_RISING_EDGE; + } + else if (mode == GPIO_SYNC_HIGH_LEVEL_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_DOWN; + intCfg.trig = GLB_GPIO_INT_TRIG_SYNC_HIGH_LEVEL; + } + else if (mode == GPIO_SYNC_LOW_LEVEL_INT_MODE) + { + gpio_cfg.pullType = GPIO_PULL_UP; + intCfg.trig = GLB_GPIO_INT_TRIG_SYNC_LOW_LEVEL; + } + + GLB_GPIO_Int_Init(&intCfg); + break; + } + + GLB_GPIO_Init(&gpio_cfg); +} + + +static rt_err_t bl808_pin_attach_irq(struct rt_device *device, rt_int32_t pin, + rt_uint32_t irq_mode, void (*hdr)(void *args), void *args) +{ + struct gpio_int_cfg_private *int_cfg = malloc(sizeof(struct gpio_int_cfg_private)); + int_cfg->hdr = hdr; + int_cfg->pin = pin; + slist_add_tail(&gpio_int_head, &int_cfg->list); + CPU_Interrupt_Disable(GPIO_INT0_IRQn); + Interrupt_Handler_Register(GPIO_INT0_IRQn, GPIO0_IRQHandler); + CPU_Interrupt_Enable(GPIO_INT0_IRQn); + return RT_EOK; +} + + +static rt_err_t bl808_pin_irq_enable(struct rt_device *device, rt_base_t pin, + rt_uint32_t enabled) +{ + if (enabled) + { + GLB_GPIO_IntMask(pin, UNMASK); + } + else + { + GLB_GPIO_IntMask(pin, MASK); + } + return RT_EOK; +} + +const static struct rt_pin_ops _bl808_pin_ops = +{ + bl808_pin_mode, + bl808_pin_write, + bl808_pin_read, + bl808_pin_attach_irq, + bl808_pin_irq_enable, + NULL, +}; + +int rt_hw_pin_init(void) +{ + return rt_device_pin_register("pin", &_bl808_pin_ops, RT_NULL); +} +INIT_BOARD_EXPORT(rt_hw_pin_init); + +/* irq handle */ +void GPIO0_IRQHandler(void) +{ + rt_interrupt_enter(); + // GPIO_INT0_IRQHandler(); + rt_interrupt_leave(); +} + +#endif /* RT_USING_PIN */ diff --git a/bsp/bl808/m0/drivers/drv_gpio.h b/bsp/bl808/m0/drivers/drv_gpio.h new file mode 100644 index 0000000000..ff60c9ec79 --- /dev/null +++ b/bsp/bl808/m0/drivers/drv_gpio.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2006-2023, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2023/01/5 chushicheng first version + * + */ + +#ifndef __DRV_GPIO_H__ +#define __DRV_GPIO_H__ + +#include +#include +#include "drv_device.h" + +#define GPIO_OUTPUT_MODE 0 +#define GPIO_OUTPUT_PP_MODE 1 +#define GPIO_OUTPUT_PD_MODE 2 +#define GPIO_INPUT_MODE 3 +#define GPIO_INPUT_PP_MODE 4 +#define GPIO_INPUT_PD_MODE 5 +#define GPIO_ASYNC_RISING_TRIGER_INT_MODE 6 +#define GPIO_ASYNC_FALLING_TRIGER_INT_MODE 7 +#define GPIO_ASYNC_HIGH_LEVEL_INT_MODE 8 +#define GPIO_ASYNC_LOW_LEVEL_INT_MODE 9 +#define GPIO_SYNC_RISING_TRIGER_INT_MODE 10 +#define GPIO_SYNC_FALLING_TRIGER_INT_MODE 11 +#define GPIO_SYNC_RISING_FALLING_TRIGER_INT_MODE 12 +#define GPIO_SYNC_HIGH_LEVEL_INT_MODE 13 +#define GPIO_SYNC_LOW_LEVEL_INT_MODE 14 +#define GPIO_HZ_MODE 15 + + +int rt_hw_pin_init(void); + +#endif /* __DRV_GPIO_H__ */ diff --git a/bsp/bl808/m0/libraries/SConscript b/bsp/bl808/m0/libraries/SConscript index f7efb7fda7..c8b2699f66 100644 --- a/bsp/bl808/m0/libraries/SConscript +++ b/bsp/bl808/m0/libraries/SConscript @@ -91,6 +91,8 @@ src += Split(""" """) path += [cwd + r'/platform/hosal/bl808_e907_hal'] +path += [cwd + r'/platform/soc/bl808/bl808_e907_std/common/device', + cwd + r'/platform/soc/bl808/bl808_e907_std/common/list'] libpath = [] libs = [] diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_audio.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_audio.c index a97705eb39..65edf03c10 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_audio.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_audio.c @@ -85,7 +85,7 @@ static int __hw_init(bl_audio_dev_t *p_dev) AUIDO_RAMP_RATE_2_FS, AUIDO_ZERO_CROSS_RATE_2_FS, }; - + GLB_Config_AUDIO_PLL(GLB_XTAL_40M, audioPllCfg_451P584M); /* ungate audio */ GLB_PER_Clock_UnGate(GLB_AHB_CLOCK_AUDIO); @@ -202,7 +202,7 @@ static int __hw_init(bl_audio_dev_t *p_dev) static void __audio_lli_init(bl_audio_dev_t *p_dev) { p_dev->lli_tx_buffer_size = p_dev->lli_tx_buffer_size / 2; - + switch (p_dev->playBitWidth) { case AUDIO_BIT_WIDTH_16: dmaCtrlRegVal.SWidth = DMA_TRNS_WIDTH_16BITS; @@ -230,7 +230,7 @@ static void __audio_lli_init(bl_audio_dev_t *p_dev) //private_bflb_platform_printf("BIT WIDTH Is Invaild\r\n"); break; } - + p_dev->lli_tx_list[0].srcDmaAddr = (uint32_t)p_dev->lli_tx_buffer; p_dev->lli_tx_list[0].destDmaAddr = AUDIO_TX_FIFO_ADDR; p_dev->lli_tx_list[0].nextLLI = (uint32_t)&p_dev->lli_tx_list[1]; @@ -246,7 +246,7 @@ static void __audio_lli_init(bl_audio_dev_t *p_dev) if (p_dev->rx_enable) { p_dev->lli_rx_buffer_size = p_dev->lli_rx_buffer_size / 2; - + switch (p_dev->playBitWidth) { case AUDIO_BIT_WIDTH_16: dmaCtrlRegVal.SWidth = DMA_TRNS_WIDTH_16BITS; diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.c index 8f4d25a893..78abe66492 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.c @@ -47,14 +47,14 @@ PtTable_Error_Type PtTable_Update_Entry(const SPI_Flash_Cfg_Type *pFlashCfg, if(ptEntry==NULL||ptStuff==NULL){ return PT_ERROR_PARAMETER; } - + ptTable=&ptStuff->ptTable; ptEntries=ptStuff->ptEntries; - + if(targetTableID==PT_TABLE_ID_INVALID){ return PT_ERROR_TABLE_NOT_VALID; } - + if(targetTableID==PT_TABLE_ID_0){ writeAddr=BFLB_PT_TABLE0_ADDRESS; }else{ @@ -75,17 +75,17 @@ PtTable_Error_Type PtTable_Update_Entry(const SPI_Flash_Cfg_Type *pFlashCfg, return PT_ERROR_ENTRY_UPDATE_FAIL; } } - + /* Prepare write back to flash */ /* Update age */ ptTable->age++; ptTable->crc32=BFLB_Soft_CRC32((uint8_t*)ptTable,sizeof(PtTable_Config)-4); - + /* Update entries CRC */ entriesLen=ptTable->entryCnt*sizeof(PtTable_Entry_Config); pCrc32=(uint32_t *)((uint32_t)ptEntries+entriesLen); *pCrc32=BFLB_Soft_CRC32((uint8_t *)&ptEntries[0],entriesLen); - + /* Write back to flash */ /* Erase flash first */ ret=bl_flash_erase(writeAddr,sizeof(PtTable_Config)+entriesLen+4); @@ -108,7 +108,7 @@ PtTable_Error_Type PtTable_Get_Active_Entries(PtTable_Stuff_Config *ptStuff, PtTable_Entry_Config *ptEntry) { uint32_t i=0; - + if(ptStuff==NULL||ptEntry==NULL){ return PT_ERROR_PARAMETER; } @@ -130,16 +130,16 @@ PtTable_Error_Type PtTable_Get_Active_Entries_By_Name(PtTable_Stuff_Config *ptSt if(ptStuff==NULL||ptEntry==NULL){ return PT_ERROR_PARAMETER; - } + } for (i=0; i < ptStuff->ptTable.entryCnt; i++) { if (strlen((char *)ptStuff->ptEntries[i].name) == len && - memcmp((char *)ptStuff->ptEntries[i].name,(char *)name,len) == 0){ + memcmp((char *)ptStuff->ptEntries[i].name,(char *)name,len) == 0){ //BL602_MemCpy_Fast(ptEntry,&ptStuff->ptEntries[i],sizeof(PtTable_Entry_Config)); /*FIXME :need fast memory copy*/ memcpy(ptEntry,&ptStuff->ptEntries[i],sizeof(PtTable_Entry_Config)); return PT_ERROR_SUCCESS; - } - } + } + } return PT_ERROR_ENTRY_NOT_FOUND; } diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.h b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.h index 1eaaec7264..04f5747ce1 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.h +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_boot2.h @@ -184,8 +184,8 @@ PtTable_ID_Type targetTableID, PtTable_Stuff_Config *ptStuff, PtTable_Entry_Config *ptEntry); PtTable_Error_Type PtTable_Create(const SPI_Flash_Cfg_Type *pFlashCfg,PtTable_ID_Type ptID); -PtTable_Error_Type PtTable_Get_Active_Entries_By_Name(PtTable_Stuff_Config *ptStuff, - uint8_t *name, +PtTable_Error_Type PtTable_Get_Active_Entries_By_Name(PtTable_Stuff_Config *ptStuff, + uint8_t *name, PtTable_Entry_Config *ptEntry); /*@} end of group PARTITION_Public_Functions */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_efuse.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_efuse.c index c59b90ac3e..80a9015464 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_efuse.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_efuse.c @@ -75,9 +75,9 @@ int bl_efuse_ctrl_program_R0(uint32_t index, uint32_t *data, uint32_t len) bdiv = BL_GET_REG_BITS_VAL(BL_RD_REG(GLB_BASE, GLB_SYS_CFG0), GLB_REG_BCLK_DIV); HBN_Set_MCU_Root_CLK_Sel(HBN_MCU_ROOT_CLK_XCLK); - + EF_Ctrl_Program_Direct_R0(index, data, len); - + GLB_Set_System_CLK_Div(hdiv, bdiv); HBN_Set_MCU_Root_CLK_Sel(rtClk); @@ -96,9 +96,9 @@ int bl_efuse_ctrl_read_R0(uint32_t index, uint32_t *data, uint32_t len) HBN_Set_MCU_Root_CLK_Sel(HBN_MCU_ROOT_CLK_XCLK); - + EF_Ctrl_Read_Direct_R0(index, data, len); - + GLB_Set_System_CLK_Div(hdiv, bdiv); HBN_Set_MCU_Root_CLK_Sel(rtClk); @@ -116,8 +116,8 @@ int bl_efuse_read_mac_opt(uint8_t slot, uint8_t mac[6], uint8_t reload) bdiv = BL_GET_REG_BITS_VAL(BL_RD_REG(GLB_BASE, GLB_SYS_CFG0), GLB_REG_BCLK_DIV); HBN_Set_MCU_Root_CLK_Sel(HBN_MCU_ROOT_CLK_XCLK); - -// EF_Ctrl_Read_MAC_Address_Opt(slot, mac, reload); + +// EF_Ctrl_Read_MAC_Address_Opt(slot, mac, reload); EF_Ctrl_Read_MAC_Address_Raw(mac); GLB_Set_System_CLK_Div(hdiv, bdiv); diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_ethernetif.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_ethernetif.c index eef88ebee2..b5e463da8b 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_ethernetif.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_ethernetif.c @@ -338,12 +338,12 @@ static struct pbuf *low_level_input(struct netif *netif) uint16_t max_len, min_len; struct pbuf *h = NULL; EMAC_BD_Desc_Type *bd; - bd = &thiz->bd[thiz->rxIndexCPU]; - if(bd->C_S_L & EMAC_BD_FIELD_MSK(RX_E)){ + bd = &thiz->bd[thiz->rxIndexCPU]; + if(bd->C_S_L & EMAC_BD_FIELD_MSK(RX_E)){ // MSG("RX BD is empty\r\n"); h = NULL; - } else { - emac_get_fram_len(&max_len, &min_len); + } else { + emac_get_fram_len(&max_len, &min_len); pkt_len = (bd->C_S_L & EMAC_BD_FIELD_MSK(RX_LEN)) >> BD_RX_LEN_POS; //check length if (pkt_len > max_len) { diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_flash.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_flash.c index 1abd62b62e..eb6fcdec81 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_flash.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_flash.c @@ -166,7 +166,7 @@ static void _dump_flash_config() extern uint8_t __boot2_flashCfg_src; USER_UNUSED(__boot2_flashCfg_src); - + blog_info("======= FlashCfg magiccode @%p=======\r\n", &__boot2_flashCfg_src); blog_info("mid \t\t0x%X\r\n", g_flash_cfg.mid); blog_info("clkDelay \t0x%X\r\n", g_flash_cfg.clkDelay); diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_irq.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_irq.c index 47efdd34ce..d9b3113c7f 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_irq.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_irq.c @@ -116,7 +116,7 @@ void bl_irq_default(void) } static void (*handler_list[2][16 + 64])(void) = { - + }; @@ -139,7 +139,7 @@ void bl_irq_register_with_ctx(int irqnum, void *handler, void *ctx) handler_list[0][irqnum] ); } - + if (handler == NULL) { blog_error("handler is NULL pointer! \r\n"); return; @@ -155,7 +155,7 @@ void bl_irq_register_with_ctx(int irqnum, void *handler, void *ctx) } return; - + } void bl_irq_ctx_get(int irqnum, void **ctx) @@ -177,8 +177,8 @@ void bl_irq_ctx_count_cost(int irqnum, uint64_t cost) struct irq_ctx *ctx; _irq_num_check(irqnum); if(handler_list[0][irqnum] != NULL) { - ctx = (struct irq_ctx *)(handler_list[1][irqnum]); - ctx->irq_run_time += cost; + ctx = (struct irq_ctx *)(handler_list[1][irqnum]); + ctx->irq_run_time += cost; } } @@ -206,7 +206,7 @@ void bl_irq_unregister(int irqnum, void *handler) #endif } -void interrupt_entry(uint32_t mcause) +void interrupt_entry(uint32_t mcause) { void *handler = NULL; mcause &= 0x7FFFFFF; @@ -342,9 +342,9 @@ extern void misaligned_store_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t m #ifdef DBG_RECORD_EXCEP_VAL struct{ - uint32_t mcause; - uint32_t mepc; - uint32_t mtval; + uint32_t mcause; + uint32_t mepc; + uint32_t mtval; }rval[4]; int rval_idx; #endif /* DBG_RECORD_EXCEP_VAL */ @@ -358,24 +358,24 @@ void exception_entry(uint32_t mcause, uint32_t mepc, uint32_t mtval, uintptr_t * rval_idx++; #endif /* DBG_RECORD_EXCEP_VAL */ if ((mcause & 0x3ff) == EXCPT_LOAD_MISALIGNED) { - //misaligned_load_trap(regs, mcause, mepc); + //misaligned_load_trap(regs, mcause, mepc); } else if ((mcause & 0x3ff) == EXCPT_STORE_MISALIGNED){ - //misaligned_store_trap(regs, mcause, mepc); + //misaligned_store_trap(regs, mcause, mepc); } { - //registerdump(tasksp); - puts("Exception Entry--->>>\r\n"); - blog_info("mcause %08lx, mepc %08lx, mtval %08lx\r\n", - mcause, - mepc, - mtval - ); + //registerdump(tasksp); + puts("Exception Entry--->>>\r\n"); + blog_info("mcause %08lx, mepc %08lx, mtval %08lx\r\n", + mcause, + mepc, + mtval + ); __dump_exception_code_str(mcause & 0xFFFF); - //backtrace_now_task((int (*)(const char *s))puts, regs); + //backtrace_now_task((int (*)(const char *s))puts, regs); while (1) { - /*Deap loop now*/ + /*Deap loop now*/ #ifdef SYS_ENABLE_COREDUMP - /* For stack check */ + /* For stack check */ extern uintptr_t _sp_main, _sp_base; /* XXX change sp to irq stack base */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_mm_clock.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_mm_clock.c index da01c846a8..d02bd63c46 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_mm_clock.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_mm_clock.c @@ -83,7 +83,7 @@ static void get_mm_cpu_pll_clk(uint32_t reg_val) static void dump_mm_cpu_clk(void) { uint32_t tmpVal = 0, cpu_root_clk = 0; - + tmpVal = BL_RD_REG(CLKRST_CTRL_BASE, MM_GLB_MM_CLK_CTRL_CPU); cpu_root_clk = BL_GET_REG_BITS_VAL(tmpVal, MM_GLB_REG_CPU_ROOT_CLK_SEL); switch (cpu_root_clk) { diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_pm.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_pm.c index 7ec2b4499a..a9a1b0dfb5 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_pm.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_pm.c @@ -103,7 +103,7 @@ static int pm_env_init(void) INIT_UTILS_DLIST_HEAD(&(gp_pm_env->pm_list)[i]); } - gp_pm_env->state = PM_STATE_INITED; + gp_pm_env->state = PM_STATE_INITED; ///for debug gp_pm_env->bt_capacity.cap = 0xffff; @@ -136,13 +136,13 @@ static int pm_deinit(void) vPortFree(gp_pm_env->pm_list); gp_pm_env->pm_list = NULL; - + vSemaphoreDelete(gp_pm_env->pm_mux); gp_pm_env->pm_mux = NULL; - + vPortFree(gp_pm_env); gp_pm_env = NULL; - + return 0; } @@ -180,7 +180,7 @@ static void pm_node_add(struct pm_node *pnode, utils_dlist_t *queue) utils_dlist_add(&(pnode->dlist_item), pre_save); xSemaphoreGive(gp_pm_env->pm_mux); break; - } + } pre_save = &(node->dlist_item); } @@ -225,7 +225,7 @@ static int pm_pmlist_traverse(enum PM_EVEMT event, utils_dlist_t *queue, uint32_ } utils_dlist_for_each_entry_safe(queue, tmp, node, struct pm_node, dlist_item) { - if ((node->enable) && (code == node->code) && (gp_pm_env->wlan_capacity.cap & node->cap_bit) && + if ((node->enable) && (code == node->code) && (gp_pm_env->wlan_capacity.cap & node->cap_bit) && (gp_pm_env->bt_capacity.cap & node->cap_bit)) { if (pm_state_exec_func_check(event, code)) { @@ -286,8 +286,8 @@ static int pm_internal_process_event(enum PM_EVEMT event, uint32_t code) { } - } - + } + return ret; } @@ -296,7 +296,7 @@ int pm_post_event(enum PM_EVEMT event, uint32_t code, uint32_t *retval) if (!gp_pm_env) { return -1; } - + pm_pmlist_traverse(event, &(gp_pm_env->pm_list)[event], code, retval); pm_internal_process_event(event, code); @@ -322,9 +322,9 @@ int bl_pm_event_register(enum PM_EVEMT event, uint32_t code, uint32_t cap_bit, u p_node->ops = ops; p_node->ctx = arg; p_node->enable = enable; - + pm_node_add(p_node, &(gp_pm_env->pm_list)[event]); - + return 0; } @@ -344,7 +344,7 @@ int bl_pm_event_switch(enum PM_EVEMT event, uint32_t code, enum PM_EVENT_ABLE en utils_dlist_for_each_entry_safe(queue, tmp, node, struct pm_node, dlist_item) { if (code == node->code) { node->enable = enable; - + ret = 0; } } @@ -396,8 +396,8 @@ int bl_pm_state_run(void) { } - } - + } + return ret; } @@ -467,7 +467,7 @@ int bl_pm_capacity_set(enum PM_LEVEL level) { return -1; } - } + } pm_set_wlan_capacity(capacity); diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sdh.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sdh.c index a1fe9653f0..2ab832702c 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sdh.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sdh.c @@ -261,7 +261,7 @@ void SDH_CMDTransferFinished_CallBack(SDH_Handle_Cfg_Type *handle, SDH_Stat_Type *******************************************************************************/ static void SDH_INT_Init(void) { - System_NVIC_SetPriority(SDH_SDCARD_IRQn, 7, 1); + System_NVIC_SetPriority(SDH_SDCARD_IRQn, 7, 1); CPU_Interrupt_Enable(SDH_SDCARD_IRQn); SDH_EnableIntStatus(SDH_INT_ALL); @@ -1272,10 +1272,10 @@ status_t SDH_Init(uint32_t bus_wide, sd_card_t *pOutCardInfo) /* gpio init */ SDH_GPIO_Init(bus_wide); - /* config sdh clock */ - GLB_PER_Clock_UnGate(GLB_AHB_CLOCK_SDH); + /* config sdh clock */ + GLB_PER_Clock_UnGate(GLB_AHB_CLOCK_SDH); GLB_Set_SDH_CLK(1, GLB_SDH_CLK_WIFIPLL_96M, 0); - SDH_ClockSet(400000, 96000000, 96000000); + SDH_ClockSet(400000, 96000000, 96000000); #if SDIO_SDCARD_INT_MODE SDH_INT_Init(); diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec.h b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec.h index 0a47548c62..09306bca1e 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec.h +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec.h @@ -79,7 +79,7 @@ int bl_sha_finish(bl_sha_ctx_t *ctx, uint8_t *hash); int bl_sec_ccm_encrypt_and_tag(const uint8_t *key, unsigned int key_bytelen, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, unsigned char *tag, size_t tag_len); int bl_sec_ccm_auth_decrypt(const uint8_t *key, unsigned int key_bytelen, size_t length,const unsigned char *iv, size_t iv_len, const unsigned char *add, - size_t add_len, const unsigned char *input, unsigned char *output, const unsigned char *tag, size_t tag_len); + size_t add_len, const unsigned char *input, unsigned char *output, const unsigned char *tag, size_t tag_len); int bl_sec_aes_ecb_encrypt(const uint8_t *key, unsigned int key_bytelen, size_t length, const unsigned char *input, unsigned char *output); int bl_sec_aes_ecb_decrypt(const uint8_t *key, unsigned int key_bytelen, size_t length, const unsigned char *input, unsigned char *output); #endif diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec_sha.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec_sha.c index f0856bb377..58f3d606a6 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec_sha.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sec_sha.c @@ -125,10 +125,10 @@ void sha256_test_case0(void) .linkCfg.shaMsgLen = 1, .linkCfg.shaSrcAddr = 0x50020000, }; - static const uint8_t sha256_test_result[] = + static const uint8_t sha256_test_result[] = { 0x31, 0x38, 0xbb, 0x9b, 0xc7, 0x8d, 0xf2, 0x7c, 0x47, 0x3e, 0xcf, 0xd1, 0x41, 0x0f, 0x7b, 0xd4, - 0x5e, 0xba, 0xc1, 0xf5, 0x9c, 0xf3, 0xff, 0x9c, 0xfe, 0x4d, 0xb7, 0x7a, 0xab, 0x7a, 0xed, 0xd3, + 0x5e, 0xba, 0xc1, 0xf5, 0x9c, 0xf3, 0xff, 0x9c, 0xfe, 0x4d, 0xb7, 0x7a, 0xab, 0x7a, 0xed, 0xd3, }; diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sys.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sys.c index dd1408a6f8..bc86c9c552 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sys.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_sys.c @@ -213,7 +213,7 @@ int bl_sys_early_init(void) extern void freertos_risc_v_trap_handler(void); //freertos_riscv_ram/portable/GCC/RISC-V/portASM.S write_csr(mtvec, &freertos_risc_v_trap_handler); - + /* reset here for use wtd first then init hwtimer later*/ GLB_AHB_Slave1_Reset(BL_AHB_SLAVE1_TMR); /*debuger may NOT ready don't print anything*/ diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.c index 4d1dcb7ce3..1e031ae52a 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.c @@ -171,7 +171,7 @@ int bl_wifi_power_table_set(bl_tx_pwr_tbl_t* tx_pwr_tbl) } #endif -int bl_wifi_ap_info_set(uint8_t* ssid, uint8_t ssid_len, +int bl_wifi_ap_info_set(uint8_t* ssid, uint8_t ssid_len, uint8_t* psk, uint8_t psk_len, uint8_t chan) { diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.h b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.h index 07c0d015fa..17c3b4a45d 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.h +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/bl_wifi.h @@ -42,7 +42,7 @@ int bl_wifi_sta_mac_addr_set(uint8_t mac[6]); int bl_wifi_ap_mac_addr_set(uint8_t mac[6]); int bl_wifi_mac_addr_set(uint8_t mac[6]); int bl_wifi_country_code_set(uint8_t country_code); -int bl_wifi_ap_info_set(uint8_t* ssid, uint8_t ssid_len, +int bl_wifi_ap_info_set(uint8_t* ssid, uint8_t ssid_len, uint8_t* psk, uint8_t psk_len, uint8_t chan); int bl_wifi_mac_addr_get(uint8_t mac[6]); diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/emac_phy.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/emac_phy.c index fb598d5446..9cbe9791d1 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/emac_phy.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/emac_phy.c @@ -27,4 +27,4 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "phy_8720.c" \ No newline at end of file +#include "phy_8720.c" diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_board.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_board.c index 096662a0b5..5640d84252 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_board.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_board.c @@ -337,7 +337,7 @@ static void update_xtal_config_rftv(uint32_t tlv_addr) uint8_t buffer[20] = {0}; uint32_t capcode[5] = {0}; char xtal_mode[3] = {0}; - + if (rftlv_get(tlv_addr, RFTLV_API_TYPE_XTAL_MODE, 3, xtal_mode) > 0) { xtal_mode[sizeof(xtal_mode) - 1] = '\0'; blog_info("xtal_mode is %s\r\n", xtal_mode); @@ -505,7 +505,7 @@ break_scan: log_buf_int8(poweroffset, sizeof(poweroffset)); #ifdef CFG_BLE_ENABLE extern void ble_rf_set_pwr_offset_table(int8_t *poweroffset_table); - ble_rf_set_pwr_offset_table(poweroffset); + ble_rf_set_pwr_offset_table(poweroffset); #endif //zys phy_powroffset_set(poweroffset); } @@ -608,7 +608,7 @@ break_scan: log_buf_int8(poweroffset, sizeof(poweroffset)); #ifdef CFG_BLE_ENABLE extern void ble_rf_set_pwr_offset_table(int8_t *poweroffset_table); - ble_rf_set_pwr_offset_table(poweroffset); + ble_rf_set_pwr_offset_table(poweroffset); #endif //zys phy_powroffset_set(poweroffset); } @@ -671,7 +671,7 @@ static int update_ap_field(const void *fdt, int wifi_offset, const char *name) int countindex = 0, lentmp = 0; const char *result = 0; const uint8_t *addr_prop = 0; - + /* set ssid pwd */ uint8_t ap_ssid[32]; uint8_t ap_ssid_len = 0; @@ -764,8 +764,8 @@ static int update_rf_temp_field(const void *fdt, int wifi_offset, const char *na } addr_prop = fdt_getprop(fdt, offset1, "Tchannels", &lentmp); - if (lentmp == TCAL_PARA_CHANNELS*4) { - memcpy(tmp, addr_prop, TCAL_PARA_CHANNELS*4); + if (lentmp == TCAL_PARA_CHANNELS*4) { + memcpy(tmp, addr_prop, TCAL_PARA_CHANNELS*4); blog_info_user(dts, "Tchannels:"); for (i = 0; i < TCAL_PARA_CHANNELS; i++){ tcal_param_tmp.Tchannels[i]=fdt32_to_cpu(tmp[i]); @@ -778,8 +778,8 @@ static int update_rf_temp_field(const void *fdt, int wifi_offset, const char *na } addr_prop = fdt_getprop(fdt, offset1, "Tchannel_os", &lentmp); - if (lentmp == TCAL_PARA_CHANNELS*4) { - memcpy(tmp, addr_prop, TCAL_PARA_CHANNELS*4); + if (lentmp == TCAL_PARA_CHANNELS*4) { + memcpy(tmp, addr_prop, TCAL_PARA_CHANNELS*4); blog_info_user(dts, "Tchannel_os:"); for (i = 0; i < TCAL_PARA_CHANNELS; i++){ tcal_param_tmp.Tchannel_os[i]=fdt32_to_cpu(tmp[i]); @@ -792,8 +792,8 @@ static int update_rf_temp_field(const void *fdt, int wifi_offset, const char *na } addr_prop = fdt_getprop(fdt, offset1, "Tchannel_os_low", &lentmp); - if (lentmp == TCAL_PARA_CHANNELS*4) { - memcpy(tmp, addr_prop, TCAL_PARA_CHANNELS*4); + if (lentmp == TCAL_PARA_CHANNELS*4) { + memcpy(tmp, addr_prop, TCAL_PARA_CHANNELS*4); blog_info_user(dts, "Tchannel_os_low:"); for (i = 0; i < TCAL_PARA_CHANNELS; i++){ tcal_param_tmp.Tchannel_os_low[i]=fdt32_to_cpu(tmp[i]); @@ -828,7 +828,7 @@ static int hal_board_load_rftv_info(uint32_t rftlv_addr) int8_t pwr_table[24]; int pwr_table_ble = 0; - + if (!rftlv_valid(rftlv_addr)) { return -2; } @@ -910,7 +910,7 @@ static int hal_board_load_rftv_info(uint32_t rftlv_addr) #endif vPortFree(p_buffer); - + return 0; } #endif diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.c index 051adc0107..826ce0daf6 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.c @@ -102,7 +102,7 @@ uint32_t hal_boot2_get_flash_addr(void) { extern uint8_t __boot2_flashCfg_src; - return (uint32_t)(&__boot2_flashCfg_src + + return (uint32_t)(&__boot2_flashCfg_src + (sizeof(boot2_partition_table.table.ptEntries[0]) * boot2_partition_table.table.ptTable.entryCnt)); } @@ -247,12 +247,12 @@ uint8_t hal_boot2_get_active_partition(void) return boot2_partition_table.partition_active_idx; } -int hal_boot2_get_active_entries_byname(uint8_t *name, HALPartition_Entry_Config *ptEntry_hal) +int hal_boot2_get_active_entries_byname(uint8_t *name, HALPartition_Entry_Config *ptEntry_hal) { PtTable_Entry_Config *ptEntry = (PtTable_Entry_Config*)ptEntry_hal; if (PtTable_Get_Active_Entries_By_Name(&boot2_partition_table.table, name, ptEntry)) { - return -1; - } + return -1; + } return 0; } @@ -286,7 +286,7 @@ int hal_boot2_init(void) } #if 0 -#define PT_OTA_TYPE_NAME "FW" +#define PT_OTA_TYPE_NAME "FW" #define PT_MEDIA_TYPE_NAME "mfg" void hal_update_mfg_ptable(void) { @@ -298,14 +298,14 @@ void hal_update_mfg_ptable(void) if (0 == hal_boot2_get_active_entries_byname((uint8_t *)PT_OTA_TYPE_NAME, (HALPartition_Entry_Config *)(&ptEntry_fw))) { // ota if (0 == hal_boot2_get_active_entries_byname((uint8_t *)PT_MEDIA_TYPE_NAME, (HALPartition_Entry_Config *)(&ptEntry_media))) { // media if (ptEntry_fw.Address[1] == ptEntry_media.Address[0]) { - + memset(ptEntry_media.name, 0, sizeof(ptEntry_media.name)); PtTable_Update_Entry(NULL, !boot2_partition_table.partition_active_idx, &boot2_partition_table.table, &ptEntry_media); - + printf("===== update mfg partition =====\r\n"); - } - } - } + } + } + } printf("====================\r\n"); printf("update mfg table.\r\n"); diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.h b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.h index 47a8b0b031..387257309d 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.h +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_boot2.h @@ -60,9 +60,9 @@ typedef enum { /** * @brief Error type definition */ -typedef enum +typedef enum { - HAL_SUCCESS = 0, + HAL_SUCCESS = 0, HAL_ERROR = 1, } HAL_Err_Type; diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_emac.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_emac.c index b58d153bf7..8e528c2ac7 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_emac.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_emac.c @@ -332,9 +332,9 @@ void emac_irq_process(void) EMAC_ID_Type emacId = EMAC_USED_ID; uint32_t tmpVal; uint32_t EMACx = emacAddr[emacId]; - + tmpVal = BL_RD_REG(EMACx,EMAC_INT_MASK); - + if (SET == EMAC_GetIntStatus(emacId,EMAC_INT_TX_DONE) && !BL_IS_REG_BIT_SET(tmpVal,EMAC_TXB_M)) { EMAC_ClrIntStatus(emacId,EMAC_INT_TX_DONE); EMAC_IntMask(emacId, EMAC_INT_TX_DONE, MASK); @@ -499,7 +499,7 @@ int emac_bd_tx_enqueue(uint32_t flags, uint32_t len, const uint8_t *data_in) } /* following two lines is for cache test since tmpbuf is in cache range */ - //ARCH_MemCpy_Fast(tmpbuf, data_in, len); + //ARCH_MemCpy_Fast(tmpbuf, data_in, len); //DMADesc->Buffer = (uint32_t)tmpbuf; #ifdef EMAC_DO_FLUSH_DATA if(L1C_Is_DCache_Range((uintptr_t)DMADesc->Buffer)){ diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_uart.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_uart.c index 4d2c5b9399..220c54b62b 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_uart.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hal_uart.c @@ -83,7 +83,7 @@ static void uart_dev_setdef(uart_dev_t **pdev, uint8_t id) (*pdev)->port = id; (*pdev)->read_block_flag = UART_READ_CFG_NOBLOCK; - + (*pdev)->config.baud_rate = 2000000; (*pdev)->config.data_width = DATA_WIDTH_8BIT; (*pdev)->config.parity = NO_PARITY; @@ -231,7 +231,7 @@ int32_t hal_uart_send(uart_dev_t *uart, const void *data, uint32_t size, uint32_ int32_t hal_uart_send_flush(uart_dev_t *uart, uint32_t timeout) { - bl_uart_flush(uart->port); + bl_uart_flush(uart->port); return 0; } diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_adc.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_adc.c index 5b46c519c7..233c50838f 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_adc.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_adc.c @@ -141,7 +141,7 @@ static int adc_get_channel_by_gpio(GLB_GPIO_Type pin) case GLB_GPIO_PIN_40: channel = 5; break; - + default : channel = -1; break; @@ -170,7 +170,7 @@ static void adc_freq_init(hosal_adc_sample_mode_t mode, uint32_t freq) } if (div > 64) { - div = 64; + div = 64; } /*adc clk can not more than 2M*/ @@ -201,7 +201,7 @@ static void adc_dma_lli_init(DMA_LLI_Ctrl_Type *pstlli, uint32_t *buf, uint32_t pstlli[0].srcDmaAddr = GPIP_BASE+GPIP_GPADC_DMA_RDATA_OFFSET; pstlli[0].destDmaAddr = (uint32_t)&buf[0]; - pstlli[0].nextLLI = (uint32_t)&pstlli[1]; + pstlli[0].nextLLI = (uint32_t)&pstlli[1]; pstlli[0].dmaCtrl= dma_ctrl_reg; pstlli[1].srcDmaAddr = GPIP_BASE+GPIP_GPADC_DMA_RDATA_OFFSET; @@ -219,7 +219,7 @@ static int adc_dma_init(hosal_adc_dev_t *adc, uint32_t data_num) .srcPeriph = DMA_REQ_GPADC_RX, .dstPeriph = DMA_REQ_NONE, }; - + hosal_adc_ctx_t *pstctx = (hosal_adc_ctx_t *)adc->priv; if (data_num < 1) { @@ -262,7 +262,7 @@ static void adc_init(hosal_adc_dev_t *adc) { int i, chan; uint8_t channel_table[ADC_CHANNEL_MAX] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; - + hosal_adc_sample_mode_t mode = adc->config.mode; GLB_GPIO_Type pin = adc->config.pin; @@ -301,7 +301,7 @@ static void adc_init(hosal_adc_dev_t *adc) ADC_Reset(); ADC_Init(&adccfg); - + if (mode == HOSAL_ADC_ONE_SHOT) { for (i = 0; i < ADC_CHANNEL_MAX; i++) { pos_chlist_single[i] = channel_table[i];; @@ -309,7 +309,7 @@ static void adc_init(hosal_adc_dev_t *adc) } ADC_Scan_Channel_Config(pos_chlist_single, neg_chlist_single, ADC_CHANNEL_MAX, ENABLE); - } + } else { chan = adc_get_channel_by_gpio(pin); ADC_Channel_Config(chan, ADC_CHAN_GND, ENABLE); @@ -340,7 +340,7 @@ static int adc_parse_data(uint32_t *parr, int data_size, int channel) return data; } - } + } blog_error("error!\r\n"); return -1; } @@ -366,7 +366,7 @@ int hosal_adc_init(hosal_adc_dev_t *adc) blog_error("pin is error!\r\n"); return -1; } - + pstctx = (hosal_adc_ctx_t *)pvPortMalloc(sizeof(hosal_adc_ctx_t)); if (NULL == pstctx) { blog_error("not have enough memory!\r\n"); @@ -381,7 +381,7 @@ int hosal_adc_init(hosal_adc_dev_t *adc) blog_error("illegal freq. for mode0, freq 20HZ ~ 1250HZ \r\n"); return -1; } - /* init gpio */ + /* init gpio */ GLB_GPIO_Func_Init(GPIO_FUN_ANALOG, &pin, 1); /* init freq */ @@ -393,7 +393,7 @@ int hosal_adc_init(hosal_adc_dev_t *adc) blog_error("not support continue mode!\r\n"); return -1; } - + pgdevice = adc; return 0; @@ -450,22 +450,22 @@ int hosal_adc_value_get(hosal_adc_dev_t *adc, uint32_t channel, uint32_t timeout { int val = -1; hosal_adc_ctx_t *pstctx = (hosal_adc_ctx_t *)adc->priv; - + if (NULL == adc) { blog_error("parameter is error!\r\n"); return -1; } - + if (channel > 11) { blog_error("channel is error!\r\n"); return -1; } - + if (((1 << channel) & pstctx->chan_init_table) == 0) { blog_error("channel = %d not init as adc \r\n", channel); return -1; } - + if (pstctx->channel_data == NULL) { blog_error("adc sampling not finish. \r\n"); return -1; @@ -479,13 +479,13 @@ int hosal_adc_value_get(hosal_adc_dev_t *adc, uint32_t channel, uint32_t timeout } vTaskDelay(1); } - + return val; } int hosal_adc_tsen_value_get(hosal_adc_dev_t *adc) { - blog_error("not support now!\r\n"); + blog_error("not support now!\r\n"); return -1; } @@ -503,7 +503,7 @@ int hosal_adc_start(hosal_adc_dev_t *adc, void *data, uint32_t size) int hosal_adc_stop(hosal_adc_dev_t *adc) { - return 0; + return 0; } int hosal_adc_finalize(hosal_adc_dev_t *adc) diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_dma.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_dma.c index 9de2862c35..984b03e1ac 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_dma.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_dma.c @@ -79,7 +79,7 @@ static void __dma_irq_process(void *p_arg) pfn = gp_hosal_dma_dev->used_chan[ch].callback; parg = gp_hosal_dma_dev->used_chan[ch].p_arg; if (pfn) { - pfn(parg, HOSAL_DMA_INT_TRANS_COMPLETE); + pfn(parg, HOSAL_DMA_INT_TRANS_COMPLETE); } } @@ -94,7 +94,7 @@ static void __dma_irq_process(void *p_arg) pfn = gp_hosal_dma_dev->used_chan[ch].callback; parg = gp_hosal_dma_dev->used_chan[ch].p_arg; if (pfn) { - pfn(parg, HOSAL_DMA_INT_TRANS_ERROR); + pfn(parg, HOSAL_DMA_INT_TRANS_ERROR); } } } diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_spi.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_spi.c index f30c38742e..798e914b7c 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_spi.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_spi.c @@ -144,16 +144,16 @@ static void hosal_spi_gpio_init(hosal_spi_dev_t *arg) GLB_GPIO_Func_Init(GPIO_FUN_SPI0, gpiopins, sizeof(gpiopins)/sizeof(gpiopins[0])); if (arg->config.mode == 0) { - if(arg->port == SPI0_ID) { - GLB_Set_MCU_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_MASTER); - } else { - GLB_Set_DSP_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_MASTER); + if(arg->port == SPI0_ID) { + GLB_Set_MCU_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_MASTER); + } else { + GLB_Set_DSP_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_MASTER); } } else { - if(arg->port == SPI0_ID) { - GLB_Set_MCU_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_SLAVE); - } else { - GLB_Set_DSP_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_SLAVE); + if(arg->port == SPI0_ID) { + GLB_Set_MCU_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_SLAVE); + } else { + GLB_Set_DSP_SPI_0_ACT_MOD_Sel(GLB_SPI_PAD_ACT_AS_SLAVE); } } diff --git a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_uart.c b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_uart.c index 958e5f09a5..52a61f072a 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_uart.c +++ b/bsp/bl808/m0/libraries/platform/hosal/bl808_e907_hal/hosal_uart.c @@ -103,11 +103,11 @@ static void __uart_rx_dma_irq(void *p_arg, uint32_t flag) hosal_uart_dev_t *uart = (hosal_uart_dev_t *)p_arg; if (flag != HOSAL_DMA_INT_TRANS_COMPLETE) { - blog_error("DMA RX TRANS ERROR\r\n"); + blog_error("DMA RX TRANS ERROR\r\n"); } if (uart->rxdma_cb) { - uart->rxdma_cb(uart->p_rxdma_arg); + uart->rxdma_cb(uart->p_rxdma_arg); } } @@ -116,34 +116,34 @@ static void __uart_tx_dma_irq(void *p_arg, uint32_t flag) hosal_uart_dev_t *uart = (hosal_uart_dev_t *)p_arg; if (flag != HOSAL_DMA_INT_TRANS_COMPLETE) { - blog_error("DMA TX TRANS ERROR\r\n"); + blog_error("DMA TX TRANS ERROR\r\n"); } if (uart->txdma_cb) { - uart->txdma_cb(uart->p_txdma_arg); + uart->txdma_cb(uart->p_txdma_arg); } } static int __uart_dma_txcfg(hosal_uart_dev_t *uart, hosal_uart_dma_cfg_t *dma_cfg) { - if (dma_cfg->dma_buf == NULL || dma_cfg->dma_buf_size == 0) { - return -1; - } - DMA_Channel_Cfg_Type txchCfg = { - (uint32_t)dma_cfg->dma_buf, - g_uart_addr[uart->port] + UART_FIFO_WDATA_OFFSET, - dma_cfg->dma_buf_size, - DMA_TRNS_M2P, - DMA_CH0, - DMA_TRNS_WIDTH_8BITS, - DMA_TRNS_WIDTH_8BITS, - DMA_BURST_SIZE_4, - DMA_BURST_SIZE_4, - DMA_MINC_ENABLE, - DMA_PINC_DISABLE, - DMA_REQ_NONE, - DMA_REQ_UART0_TX, - }; + if (dma_cfg->dma_buf == NULL || dma_cfg->dma_buf_size == 0) { + return -1; + } + DMA_Channel_Cfg_Type txchCfg = { + (uint32_t)dma_cfg->dma_buf, + g_uart_addr[uart->port] + UART_FIFO_WDATA_OFFSET, + dma_cfg->dma_buf_size, + DMA_TRNS_M2P, + DMA_CH0, + DMA_TRNS_WIDTH_8BITS, + DMA_TRNS_WIDTH_8BITS, + DMA_BURST_SIZE_4, + DMA_BURST_SIZE_4, + DMA_MINC_ENABLE, + DMA_PINC_DISABLE, + DMA_REQ_NONE, + DMA_REQ_UART0_TX, + }; UART_FifoCfg_Type fifoCfg = { .txFifoDmaThreshold = 0x10, @@ -153,52 +153,52 @@ static int __uart_dma_txcfg(hosal_uart_dev_t *uart, hosal_uart_dma_cfg_t *dma_cf }; if (uart->dma_tx_chan >= 0) { - DMA_Channel_Update_SrcMemcfg(uart->dma_tx_chan, - (uint32_t)dma_cfg->dma_buf, dma_cfg->dma_buf_size); - return 0; + DMA_Channel_Update_SrcMemcfg(uart->dma_tx_chan, + (uint32_t)dma_cfg->dma_buf, dma_cfg->dma_buf_size); + return 0; } - uart->dma_tx_chan = hosal_dma_chan_request(0); - if (uart->dma_tx_chan < 0) { - blog_error("dma_tx_chan request failed !\r\n"); - return -1; - } + uart->dma_tx_chan = hosal_dma_chan_request(0); + if (uart->dma_tx_chan < 0) { + blog_error("dma_tx_chan request failed !\r\n"); + return -1; + } - hosal_dma_chan_stop(uart->dma_tx_chan); + hosal_dma_chan_stop(uart->dma_tx_chan); /* FIFO Config*/ - fifoCfg.rxFifoDmaEnable = (uart->dma_rx_chan < 0) ? DISABLE : ENABLE; + fifoCfg.rxFifoDmaEnable = (uart->dma_rx_chan < 0) ? DISABLE : ENABLE; UART_FifoConfig(uart->port, &fifoCfg); - txchCfg.ch = uart->dma_tx_chan; - txchCfg.dstPeriph = (uart->port == 0) ? DMA_REQ_UART0_TX : DMA_REQ_UART1_TX; - DMA_Channel_Init(&txchCfg); - hosal_dma_irq_callback_set(uart->dma_tx_chan, __uart_tx_dma_irq, (void *)uart); + txchCfg.ch = uart->dma_tx_chan; + txchCfg.dstPeriph = (uart->port == 0) ? DMA_REQ_UART0_TX : DMA_REQ_UART1_TX; + DMA_Channel_Init(&txchCfg); + hosal_dma_irq_callback_set(uart->dma_tx_chan, __uart_tx_dma_irq, (void *)uart); - return 0; + return 0; } static int __uart_dma_rxcfg(hosal_uart_dev_t *uart, hosal_uart_dma_cfg_t *dma_cfg) { - if (dma_cfg->dma_buf == NULL || dma_cfg->dma_buf_size == 0) { - return -1; - } + if (dma_cfg->dma_buf == NULL || dma_cfg->dma_buf_size == 0) { + return -1; + } - DMA_Channel_Cfg_Type rxchCfg = { - g_uart_addr[uart->port] + UART_FIFO_RDATA_OFFSET, - (uint32_t)dma_cfg->dma_buf, - dma_cfg->dma_buf_size, - DMA_TRNS_P2M, - DMA_CH0, - DMA_TRNS_WIDTH_8BITS, - DMA_TRNS_WIDTH_8BITS, - DMA_BURST_SIZE_16, - DMA_BURST_SIZE_16, - DMA_PINC_DISABLE, - DMA_MINC_ENABLE, - DMA_REQ_UART0_RX, - DMA_REQ_NONE, - }; + DMA_Channel_Cfg_Type rxchCfg = { + g_uart_addr[uart->port] + UART_FIFO_RDATA_OFFSET, + (uint32_t)dma_cfg->dma_buf, + dma_cfg->dma_buf_size, + DMA_TRNS_P2M, + DMA_CH0, + DMA_TRNS_WIDTH_8BITS, + DMA_TRNS_WIDTH_8BITS, + DMA_BURST_SIZE_16, + DMA_BURST_SIZE_16, + DMA_PINC_DISABLE, + DMA_MINC_ENABLE, + DMA_REQ_UART0_RX, + DMA_REQ_NONE, + }; UART_FifoCfg_Type fifoCfg = { .txFifoDmaThreshold = 0x10, @@ -208,30 +208,30 @@ static int __uart_dma_rxcfg(hosal_uart_dev_t *uart, hosal_uart_dma_cfg_t *dma_cf }; if (uart->dma_rx_chan >= 0) { - DMA_Channel_Update_DstMemcfg(uart->dma_rx_chan, - (uint32_t)dma_cfg->dma_buf, dma_cfg->dma_buf_size); - return 0; + DMA_Channel_Update_DstMemcfg(uart->dma_rx_chan, + (uint32_t)dma_cfg->dma_buf, dma_cfg->dma_buf_size); + return 0; } - uart->dma_rx_chan = hosal_dma_chan_request(0); - if (uart->dma_rx_chan < 0) { - blog_error("dma_rx_chan request failed !\r\n"); - return -1; - } + uart->dma_rx_chan = hosal_dma_chan_request(0); + if (uart->dma_rx_chan < 0) { + blog_error("dma_rx_chan request failed !\r\n"); + return -1; + } - hosal_dma_chan_stop(uart->dma_rx_chan); + hosal_dma_chan_stop(uart->dma_rx_chan); /* FIFO Config*/ - fifoCfg.txFifoDmaEnable = (uart->dma_tx_chan < 0) ? DISABLE : ENABLE; + fifoCfg.txFifoDmaEnable = (uart->dma_tx_chan < 0) ? DISABLE : ENABLE; UART_FifoConfig(uart->port, &fifoCfg); - rxchCfg.ch = uart->dma_rx_chan; - rxchCfg.srcPeriph = (uart->port == 0) ? DMA_REQ_UART0_RX : DMA_REQ_UART1_RX; + rxchCfg.ch = uart->dma_rx_chan; + rxchCfg.srcPeriph = (uart->port == 0) ? DMA_REQ_UART0_RX : DMA_REQ_UART1_RX; - DMA_Channel_Init(&rxchCfg); - hosal_dma_irq_callback_set(uart->dma_rx_chan, __uart_rx_dma_irq, (void *)uart); + DMA_Channel_Init(&rxchCfg); + hosal_dma_irq_callback_set(uart->dma_rx_chan, __uart_rx_dma_irq, (void *)uart); - return 0; + return 0; } #endif static void __uart_config_set(hosal_uart_dev_t *uart, const hosal_uart_config_t *cfg) @@ -258,17 +258,17 @@ static void __uart_config_set(hosal_uart_dev_t *uart, const hosal_uart_config_t uartCfg.parity = (UART_Parity_Type)cfg->parity; if (cfg->flow_control == HOSAL_FLOW_CONTROL_CTS) { - uartCfg.ctsFlowControl = 1; - uartCfg.rtsSoftwareControl = 0; + uartCfg.ctsFlowControl = 1; + uartCfg.rtsSoftwareControl = 0; } else if (cfg->flow_control == HOSAL_FLOW_CONTROL_RTS) { - uartCfg.ctsFlowControl = 0; - uartCfg.rtsSoftwareControl = 1; + uartCfg.ctsFlowControl = 0; + uartCfg.rtsSoftwareControl = 1; } else if (cfg->flow_control == HOSAL_FLOW_CONTROL_CTS_RTS) { - uartCfg.ctsFlowControl = 1; - uartCfg.rtsSoftwareControl = 1; + uartCfg.ctsFlowControl = 1; + uartCfg.rtsSoftwareControl = 1; } else { - uartCfg.ctsFlowControl = 0; - uartCfg.rtsSoftwareControl = 0; + uartCfg.ctsFlowControl = 0; + uartCfg.rtsSoftwareControl = 0; } //uartCfg.uartClk = (160 * 1000 * 1000) / (uart_div + 1); @@ -280,12 +280,12 @@ static void __uart_config_set(hosal_uart_dev_t *uart, const hosal_uart_config_t UART_Init(id, &uartCfg); #endif if (cfg->mode == HOSAL_UART_MODE_INT) { - bl_uart_int_tx_notify_register(uart->port, __uart_tx_irq, uart); - bl_uart_int_rx_notify_register(uart->port, __uart_rx_irq, uart); - bl_uart_int_enable(uart->port); - bl_uart_int_tx_disable(uart->port); + bl_uart_int_tx_notify_register(uart->port, __uart_tx_irq, uart); + bl_uart_int_rx_notify_register(uart->port, __uart_rx_irq, uart); + bl_uart_int_enable(uart->port); + bl_uart_int_tx_disable(uart->port); } else { - bl_uart_int_disable(uart->port); + bl_uart_int_disable(uart->port); } /* Enable uart */ @@ -341,17 +341,17 @@ int hosal_uart_init(hosal_uart_dev_t *uart) uartCfg.parity = (UART_Parity_Type)cfg->parity; if (cfg->flow_control == HOSAL_FLOW_CONTROL_CTS) { - uartCfg.ctsFlowControl = 1; - uartCfg.rtsSoftwareControl = 0; + uartCfg.ctsFlowControl = 1; + uartCfg.rtsSoftwareControl = 0; } else if (cfg->flow_control == HOSAL_FLOW_CONTROL_RTS) { - uartCfg.ctsFlowControl = 0; - uartCfg.rtsSoftwareControl = 1; + uartCfg.ctsFlowControl = 0; + uartCfg.rtsSoftwareControl = 1; } else if (cfg->flow_control == HOSAL_FLOW_CONTROL_CTS_RTS) { - uartCfg.ctsFlowControl = 1; - uartCfg.rtsSoftwareControl = 1; + uartCfg.ctsFlowControl = 1; + uartCfg.rtsSoftwareControl = 1; } else { - uartCfg.ctsFlowControl = 0; - uartCfg.rtsSoftwareControl = 0; + uartCfg.ctsFlowControl = 0; + uartCfg.rtsSoftwareControl = 0; } //uartCfg.uartClk = (40 * 1000 * 1000) / (uart_div + 1); @@ -376,12 +376,12 @@ int hosal_uart_init(hosal_uart_dev_t *uart) UART_FifoConfig(id, &fifoCfg); if (cfg->mode == HOSAL_UART_MODE_INT) { - bl_uart_int_tx_notify_register(uart->port, __uart_tx_irq, uart); - bl_uart_int_rx_notify_register(uart->port, __uart_rx_irq, uart); - bl_uart_int_enable(uart->port); - bl_uart_int_tx_disable(uart->port); + bl_uart_int_tx_notify_register(uart->port, __uart_tx_irq, uart); + bl_uart_int_rx_notify_register(uart->port, __uart_rx_irq, uart); + bl_uart_int_enable(uart->port); + bl_uart_int_tx_disable(uart->port); } else { - bl_uart_int_disable(uart->port); + bl_uart_int_disable(uart->port); } /* Enable uart */ @@ -418,7 +418,7 @@ int hosal_uart_send(hosal_uart_dev_t *uart, const void *data, uint32_t size) int hosal_uart_ioctl(hosal_uart_dev_t *uart, int ctl, void *p_arg) { #if 0 - hosal_uart_dma_cfg_t *dma_cfg; + hosal_uart_dma_cfg_t *dma_cfg; #endif switch (ctl) { @@ -490,26 +490,26 @@ int hosal_uart_ioctl(hosal_uart_dev_t *uart, int ctl, void *p_arg) bl_uart_flush(uart->port); break; case HOSAL_UART_TX_TRIGGER_ON: - bl_uart_int_tx_enable(uart->port); - break; + bl_uart_int_tx_enable(uart->port); + break; case HOSAL_UART_TX_TRIGGER_OFF: - bl_uart_int_tx_disable(uart->port); - break; + bl_uart_int_tx_disable(uart->port); + break; #if 0 case HOSAL_UART_DMA_TX_START: - dma_cfg = (hosal_uart_dma_cfg_t *)p_arg; - if (__uart_dma_txcfg(uart, dma_cfg) != 0) { - return -1; - } - hosal_dma_chan_start(uart->dma_tx_chan); - break; + dma_cfg = (hosal_uart_dma_cfg_t *)p_arg; + if (__uart_dma_txcfg(uart, dma_cfg) != 0) { + return -1; + } + hosal_dma_chan_start(uart->dma_tx_chan); + break; case HOSAL_UART_DMA_RX_START: - dma_cfg = (hosal_uart_dma_cfg_t *)p_arg; - if (__uart_dma_rxcfg(uart, dma_cfg) != 0) { - return -1; - } - hosal_dma_chan_start(uart->dma_rx_chan); - break; + dma_cfg = (hosal_uart_dma_cfg_t *)p_arg; + if (__uart_dma_rxcfg(uart, dma_cfg) != 0) { + return -1; + } + hosal_dma_chan_start(uart->dma_rx_chan); + break; #endif default : return -1; @@ -547,10 +547,10 @@ int hosal_uart_finalize(hosal_uart_dev_t *uart) UART_Disable(uart->port, UART_TXRX); #if 0 if (uart->dma_rx_chan > 0) { - hosal_dma_chan_release(uart->dma_rx_chan); + hosal_dma_chan_release(uart->dma_rx_chan); } if (uart->dma_tx_chan > 0) { - hosal_dma_chan_release(uart->dma_tx_chan); + hosal_dma_chan_release(uart->dma_tx_chan); } #endif return 0; diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_adc.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_adc.h index 6809b0c0de..66fbecf04a 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_adc.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_adc.h @@ -97,7 +97,7 @@ typedef void (*hosal_adc_irq_t)(void *parg); typedef struct { uint8_t port; /**< @brief adc port */ hosal_adc_config_t config; /**< @brief adc config */ - hosal_dma_chan_t dma_chan; /**< @brief adc dma channel */ + hosal_dma_chan_t dma_chan; /**< @brief adc dma channel */ hosal_adc_irq_t cb; /**< @brief adc callback */ void *p_arg; /**< @brief p_arg data */ void *priv; /**< @brief priv data */ @@ -116,9 +116,9 @@ typedef void (*hosal_adc_cb_t)(hosal_adc_event_t event, void *data, uint32_t siz * * @param[in] adc the interface which should be initialised * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_adc_init(hosal_adc_dev_t *adc); @@ -128,9 +128,9 @@ int hosal_adc_init(hosal_adc_dev_t *adc); * @param[in] adc the interface which should be sampled * @param[in] channel adc channel * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_adc_add_channel(hosal_adc_dev_t *adc, uint32_t channel); @@ -140,18 +140,18 @@ int hosal_adc_add_channel(hosal_adc_dev_t *adc, uint32_t channel); * @param[in] adc the interface which should be sampled * @param[in] channel adc channel * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_adc_remove_channel(hosal_adc_dev_t *adc, uint32_t channel); /** * @brief Takes adc device handle from an ADC interface * - * @return - * - other get adc device success - * - NULL if an error occurred with any step + * @return + * - other get adc device success + * - NULL if an error occurred with any step */ hosal_adc_dev_t *hosal_adc_device_get(void); @@ -162,9 +162,9 @@ hosal_adc_dev_t *hosal_adc_device_get(void); * @param[in] channel adc channel * @param[in] timeout ms timeout * - * @return - * - other get adc data success - * - -1 if an error occurred with any step + * @return + * - other get adc data success + * - -1 if an error occurred with any step */ int hosal_adc_value_get(hosal_adc_dev_t *adc, uint32_t channel, uint32_t timeout); @@ -173,9 +173,9 @@ int hosal_adc_value_get(hosal_adc_dev_t *adc, uint32_t channel, uint32_t timeout * * @param[in] adc the interface which should be sampled * - * @return - * - other get adc data success - * - -1 if an error occurred with any step + * @return + * - other get adc data success + * - -1 if an error occurred with any step */ int hosal_adc_tsen_value_get(hosal_adc_dev_t *adc); @@ -188,9 +188,9 @@ int hosal_adc_tsen_value_get(hosal_adc_dev_t *adc); * adc in cb must be the same pointer with adc pointer passed to hosal_adc_sample_cb_reg * driver must notify upper layer by calling cb if ADC data is ready in HW or memory(DMA) * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_adc_sample_cb_reg(hosal_adc_dev_t *adc, hosal_adc_cb_t cb); @@ -201,9 +201,9 @@ int hosal_adc_sample_cb_reg(hosal_adc_dev_t *adc, hosal_adc_cb_t cb); * @param[in] data adc data buffer * @param[in] size data buffer size aligned with resolution (until the next power of two) * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_adc_start(hosal_adc_dev_t *adc, void *data, uint32_t size); @@ -212,9 +212,9 @@ int hosal_adc_start(hosal_adc_dev_t *adc, void *data, uint32_t size); * * @param[in] adc the ADC interface * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_adc_stop(hosal_adc_dev_t *adc); @@ -223,9 +223,9 @@ int hosal_adc_stop(hosal_adc_dev_t *adc); * * @param[in] adc the interface which should be de-initialised * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_adc_finalize(hosal_adc_dev_t *adc); diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_dac.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_dac.h index dae4ccc976..e5e9e6213e 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_dac.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_dac.h @@ -78,9 +78,9 @@ typedef struct { * * @param[in] dac the interface which should be initialised * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_init(hosal_dac_dev_t *dac); @@ -89,9 +89,9 @@ int hosal_dac_init(hosal_dac_dev_t *dac); * * @param[in] dac the interface which should be de-initialised * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_finalize(hosal_dac_dev_t *dac); @@ -100,9 +100,9 @@ int hosal_dac_finalize(hosal_dac_dev_t *dac); * * @param[in] dac the interface which should be started * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_start(hosal_dac_dev_t *dac); @@ -111,9 +111,9 @@ int hosal_dac_start(hosal_dac_dev_t *dac); * * @param[in] dac the interface which should be stopped * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_stop(hosal_dac_dev_t *dac); @@ -122,11 +122,11 @@ int hosal_dac_stop(hosal_dac_dev_t *dac); * * @param[in] dac the interface to set value * - * @param[in] data the value to output, output unit: μV + * @param[in] data the value to output, output unit: μV * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_set_value(hosal_dac_dev_t *dac, uint32_t data); @@ -145,23 +145,23 @@ int hosal_dac_get_value(hosal_dac_dev_t *dac); * @param [in] dac the DAC interface * @param [in] callback callback handler * @param [in] arg callback arg - * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_dma_cb_reg(hosal_dac_dev_t *dac, hosal_dac_cb_t callback, void *arg); /** * @brief DAC use DMA mode - * + * * @param[in] adc the DAC interface * @param[in] data dac data buffer * @param[in] size data buffer size - * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_dma_start(hosal_dac_dev_t *dac, uint32_t *data, uint32_t size); @@ -170,9 +170,9 @@ int hosal_dac_dma_start(hosal_dac_dev_t *dac, uint32_t *data, uint32_t size); * * @param[in] dac the interface which should be stopped * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_dac_dma_stop(hosal_dac_dev_t *dac); diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_efuse.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_efuse.h index a90789e895..863e67c260 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_efuse.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_efuse.h @@ -40,11 +40,11 @@ extern "C" { * * @param[in] addr efuse address * @param[in] data store data - * @param[in] len data length + * @param[in] len data length * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_efuse_read(uint32_t addr, uint32_t *data, uint32_t len); @@ -53,11 +53,11 @@ int hosal_efuse_read(uint32_t addr, uint32_t *data, uint32_t len); * * @param[in] addr efuse address * @param[in] data store data - * @param[in] len data length + * @param[in] len data length * - * @return - * - 0 on success - * - EIO if an error occurred with any step + * @return + * - 0 on success + * - EIO if an error occurred with any step */ int hosal_efuse_write(uint32_t addr, uint32_t *data, uint32_t len); diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_flash.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_flash.h index e39ff8e44b..2de9049123 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_flash.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_flash.h @@ -216,7 +216,7 @@ int hosal_flash_raw_write(void *buffer, uint32_t address, uint32_t length); * - 0 On success * - otherwise is error */ -int hosal_flash_raw_erase(uint32_t start_addr, uint32_t length); +int hosal_flash_raw_erase(uint32_t start_addr, uint32_t length); /** @} */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_i2c.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_i2c.h index 45eecd588c..c3b1de8bec 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_i2c.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_i2c.h @@ -81,7 +81,7 @@ typedef struct { * * @param[in] i2c the device for which the i2c port should be initialised * - * @return + * @return * - 0 on success * - EIO if an error occurred with any step */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_pwm.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_pwm.h index bb52a327e5..f40a699561 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_pwm.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_pwm.h @@ -66,7 +66,7 @@ typedef struct { * * @param[in] pwm the PWM device * - * @return + * @return * - 0 : success * - other: fail */ @@ -77,9 +77,9 @@ int hosal_pwm_init(hosal_pwm_dev_t *pwm); * * @param[in] pwm the PWM device * - * @return + * @return * - 0 : success - * - other : fail + * - other : fail */ int hosal_pwm_start(hosal_pwm_dev_t *pwm); @@ -88,7 +88,7 @@ int hosal_pwm_start(hosal_pwm_dev_t *pwm); * * @param[in] pwm the PWM device * - * @return + * @return * - 0 : success * - other: fail */ @@ -100,7 +100,7 @@ int hosal_pwm_stop(hosal_pwm_dev_t *pwm); * @param[in] pwm the PWM device * @param[in] para the para of pwm * - * @return + * @return * - 0 : success * - other: fail */ @@ -112,7 +112,7 @@ int hosal_pwm_para_chg(hosal_pwm_dev_t *pwm, hosal_pwm_config_t para); * @param[in] pwm the PWM device * @param[in] freq the PWM frequency (0~40M under limited duty) * - * @return + * @return * - 0 : success * - other: fail */ @@ -124,7 +124,7 @@ int hosal_pwm_freq_set(hosal_pwm_dev_t *pwm, uint32_t freq); * @param[in] pwm the PWM device * @param[out] p_freq the pointer to memory frequency * - * @return + * @return * - 0 : success * - other: fail */ @@ -136,7 +136,7 @@ int hosal_pwm_freq_get(hosal_pwm_dev_t *pwm, uint32_t *p_freq); * @param[in] pwm the PWM device * @param[in] duty the PWM duty (original duty * 100) * - * @return + * @return * - 0 : success * - other: fail */ @@ -148,7 +148,7 @@ int hosal_pwm_duty_set(hosal_pwm_dev_t *pwm, uint32_t duty); * @param[in] pwm the PWM device * @param[out] p_duty the pointer to memory duty(original duty * 100) * - * @return + * @return * - 0 : success * - other: fail */ @@ -159,7 +159,7 @@ int hosal_pwm_duty_get(hosal_pwm_dev_t *pwm, uint32_t *p_duty); * * @param[in] pwm the interface which should be de-initialised * - * @return + * @return * - 0 : success * - other: fail */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rng.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rng.h index fc1f31613f..733d1d397c 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rng.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rng.h @@ -45,7 +45,7 @@ extern "C" { /** * @brief init rng * - * @return + * @return * - 0 : success * - other: fail */ @@ -58,7 +58,7 @@ int hosal_rng_init(void); * in this memory with random numbers after executed * @param[in] bytes Length of the memory buffer (bytes) * - * @return + * @return * - 0 : success * - other: fail */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rtc.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rtc.h index ceb50af8be..dc0a3082e7 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rtc.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_rtc.h @@ -75,9 +75,9 @@ typedef struct { * * @param[in] rtc rtc device * - * @return + * @return * - 0 : success - * - other : fail + * - other : fail */ int hosal_rtc_init(hosal_rtc_dev_t *rtc); @@ -87,9 +87,9 @@ int hosal_rtc_init(hosal_rtc_dev_t *rtc); * @param[in] rtc rtc device * @param[in] time pointer to a time structure * - * @return + * @return * - 0 : success - * - other : fail + * - other : fail */ int hosal_rtc_set_time(hosal_rtc_dev_t *rtc, const hosal_rtc_time_t *time); @@ -99,9 +99,9 @@ int hosal_rtc_set_time(hosal_rtc_dev_t *rtc, const hosal_rtc_time_t *time); * @param[in] rtc rtc device * @param[out] time pointer to a time structure * - * @return + * @return * - 0 : success - * - other : fail + * - other : fail */ int hosal_rtc_get_time(hosal_rtc_dev_t *rtc, hosal_rtc_time_t *time); @@ -111,9 +111,9 @@ int hosal_rtc_get_time(hosal_rtc_dev_t *rtc, hosal_rtc_time_t *time); * @param[in] rtc rtc device * @param[in] time_stamp new time value * - * @return + * @return * - 0 : success - * - other : fail + * - other : fail */ int hosal_rtc_set_count(hosal_rtc_dev_t *rtc, uint64_t *time_stamp); @@ -121,11 +121,11 @@ int hosal_rtc_set_count(hosal_rtc_dev_t *rtc, uint64_t *time_stamp); * @brief This function will return the value of time read from the on board CPU real time clock. * * @param[in] rtc rtc device - * @param[in] time_stamp new time value + * @param[in] time_stamp new time value * - * @return + * @return * - 0 : success - * - other : fail + * - other : fail */ int hosal_rtc_get_count(hosal_rtc_dev_t *rtc, uint64_t *time_stamp); @@ -134,9 +134,9 @@ int hosal_rtc_get_count(hosal_rtc_dev_t *rtc, uint64_t *time_stamp); * * @param[in] RTC the interface which should be de-initialised * - * @return + * @return * - 0 : success - * - other : fail + * - other : fail */ int hosal_rtc_finalize(hosal_rtc_dev_t *rtc); diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_spi.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_spi.h index 6d966dc1ee..ec259046f0 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_spi.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_spi.h @@ -34,7 +34,7 @@ extern "C" { #endif -/** @addtogroup hosal_spi SPI +/** @addtogroup hosal_spi SPI * HOSAL SPI API * * @{ @@ -50,8 +50,8 @@ extern "C" { typedef void (*hosal_spi_irq_t)(void *parg); /**< spi irq callback function */ -/** - * @brief Define spi config args +/** + * @brief Define spi config args */ typedef struct { uint8_t mode; /**< spi communication mode */ @@ -63,7 +63,7 @@ typedef struct { uint8_t pin_miso; /**< spi miso pin */ } hosal_spi_config_t; -/** +/** * @brief Define spi dev handle */ typedef struct { @@ -79,8 +79,8 @@ typedef struct { * * @param[in] spi the spi device * - * @return - * - 0 : on success + * @return + * - 0 : on success * - other : error */ int hosal_spi_init(hosal_spi_dev_t *spi); @@ -94,8 +94,8 @@ int hosal_spi_init(hosal_spi_dev_t *spi); * @param[in] timeout timeout in milisecond, set this value to HAL_WAIT_FOREVER * if you want to wait forever * - * @return - * - 0 : on success + * @return + * - 0 : on success * - other : error */ int hosal_spi_send(hosal_spi_dev_t *spi, const uint8_t *data, uint32_t size, uint32_t timeout); @@ -109,7 +109,7 @@ int hosal_spi_send(hosal_spi_dev_t *spi, const uint8_t *data, uint32_t size, uin * @param[in] timeout timeout in milisecond, set this value to HAL_WAIT_FOREVER * if you want to wait forever * - * @return + * @return * - 0 : success * - other : error */ @@ -125,8 +125,8 @@ int hosal_spi_recv(hosal_spi_dev_t *spi, uint8_t *data, uint16_t size, uint32_t * @param[in] timeout timeout in milisecond, set this value to HAL_WAIT_FOREVER * if you want to wait forever * - * @return - * - 0 : success + * @return + * - 0 : success * - other : error */ int hosal_spi_send_recv(hosal_spi_dev_t *spi, uint8_t *tx_data, uint8_t *rx_data, uint16_t size, uint32_t timeout); @@ -138,7 +138,7 @@ int hosal_spi_send_recv(hosal_spi_dev_t *spi, uint8_t *tx_data, uint8_t *rx_data * @param pfn callback function * @param p_arg callback function parameter * - * @return + * @return * - 0 : success * - othe : error */ @@ -150,7 +150,7 @@ int hosal_spi_irq_callback_set(hosal_spi_dev_t *spi, hosal_spi_irq_t pfn, void * * @param[in] pin cs pin * @param[in] value 0 or 1 * - * @return + * @return * - 0 : success * - other : error */ @@ -162,8 +162,8 @@ int hosal_spi_set_cs(uint8_t pin, uint8_t value); * * @param[in] spi the SPI device to be de-initialised * - * @return - * - 0 : success + * @return + * - 0 : success * - other : error */ int hosal_spi_finalize(hosal_spi_dev_t *spi); diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_timer.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_timer.h index 0acefeec31..20a1a9b66e 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_timer.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_timer.h @@ -48,7 +48,7 @@ extern "C" { typedef void (*hosal_timer_cb_t)(void *arg); /**< Define timer handle function type */ /** - * Define timer config args + * Define timer config args */ typedef struct { uint32_t period; /**< timer period, us */ @@ -57,8 +57,8 @@ typedef struct { void *arg; /**< timer handle args */ } hosal_timer_config_t; -/** - * Define timer dev handle +/** + * Define timer dev handle */ typedef struct { int8_t port; /**< timer port */ @@ -71,8 +71,8 @@ typedef struct { * * @param[in] tim timer device * - * @return - * - 0 : success + * @return + * - 0 : success * - other :error */ int hosal_timer_init(hosal_timer_dev_t *tim); @@ -83,7 +83,7 @@ int hosal_timer_init(hosal_timer_dev_t *tim); * @param[in] tim timer device * * @return - * - 0 : success + * - 0 : success * - other : error */ int hosal_timer_start(hosal_timer_dev_t *tim); @@ -102,7 +102,7 @@ void hosal_timer_stop(hosal_timer_dev_t *tim); * * @param[in] tim timer device * - * @return + * @return * - 0 : success * - other : error */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_wdg.h b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_wdg.h index 17b9b63c2e..853c321420 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/include/hosal_wdg.h +++ b/bsp/bl808/m0/libraries/platform/hosal/include/hosal_wdg.h @@ -34,7 +34,7 @@ extern "C" { #endif -/** @addtogroup hosal_wdg WATCHDOG +/** @addtogroup hosal_wdg WATCHDOG * HOSAL WATCHDOG API * * @{ @@ -65,7 +65,7 @@ typedef struct { * * @param[in] wdg the watch dog device * - * @return + * @return * - 0 : success * - other: fail */ @@ -83,7 +83,7 @@ void hosal_wdg_reload(hosal_wdg_dev_t *wdg); * * @param[in] wdg the watch dog device * - * @return + * @return * - 0 : success * - other: fail */ diff --git a/bsp/bl808/m0/libraries/platform/hosal/platform_hal/platform_hal_device.cpp b/bsp/bl808/m0/libraries/platform/hosal/platform_hal/platform_hal_device.cpp index 172bf11418..e36e2b459d 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/platform_hal/platform_hal_device.cpp +++ b/bsp/bl808/m0/libraries/platform/hosal/platform_hal/platform_hal_device.cpp @@ -30,16 +30,16 @@ #include #include -extern "C" void* operator new(size_t size) +extern "C" void* operator new(size_t size) { /* printf("[C++] new %d\r\n", size); */ - return pvPortMalloc(size); + return pvPortMalloc(size); } -extern "C" void* operator new[](size_t size) +extern "C" void* operator new[](size_t size) { /* printf("[C++] new[] %d\r\n", size); */ - return pvPortMalloc(size); + return pvPortMalloc(size); } extern "C" void operator delete(void* ptr) { @@ -52,7 +52,7 @@ extern "C" void operator delete[](void* ptr) { vPortFree(ptr); } -BLLinkedItem::BLLinkedItem() +BLLinkedItem::BLLinkedItem() { this->next = NULL; } @@ -81,13 +81,13 @@ BLLinkedItem* BLLinkedItem::detach() return tmp; } -BLLinkedList::BLLinkedList() +BLLinkedList::BLLinkedList() { this->head = NULL; this->tail = NULL; } -BLLinkedList* BLLinkedList::push(class BLLinkedItem &item) +BLLinkedList* BLLinkedList::push(class BLLinkedItem &item) { printf("[BLLinkedList] push %p\r\n", &item); @@ -107,7 +107,7 @@ BLLinkedList* BLLinkedList::push(class BLLinkedItem &item) return this; } -BLLinkedItem* BLLinkedList::pop() +BLLinkedItem* BLLinkedList::pop() { BLLinkedItem *item; @@ -173,7 +173,7 @@ int BLAesRequest::done_set() int BLAesRequest::done_set_auto() { this->done = 1; - //TODO + //TODO printf("[C++] [%s] ongoing...\r\n", __PRETTY_FUNCTION__); return 0; diff --git a/bsp/bl808/m0/libraries/platform/hosal/sec_common/bl_sec_sha.c b/bsp/bl808/m0/libraries/platform/hosal/sec_common/bl_sec_sha.c index 13814f2a65..d6dc1bea8a 100644 --- a/bsp/bl808/m0/libraries/platform/hosal/sec_common/bl_sec_sha.c +++ b/bsp/bl808/m0/libraries/platform/hosal/sec_common/bl_sec_sha.c @@ -295,9 +295,9 @@ bool tc_sha1() }; const uint8_t z_2047_expected[][32] = { - {0xe3, 0x59, 0x9e, 0xf5, 0x8f, 0x6c, 0x1b, 0x77, 0x66, 0xf0, 0x45, 0x31, 0xb5, 0x01, 0xec, 0x24, 0x97, 0xb2, 0xa8, 0x2e, }, - {0xe6, 0xdb, 0x06, 0x25, 0xba, 0xb0, 0x0a, 0x65, 0xeb, 0x25, 0xeb, 0xcb, 0xe6, 0xd5, 0xc3, 0xb6, 0x6b, 0x04, 0xad, 0x12, 0xc8, 0x91, 0x25, 0xa3, 0x4e, 0x10, 0xfe, 0x6c, }, - {0xa6, 0xb4, 0xc4, 0x6a, 0xa0, 0xaa, 0xce, 0x53, 0x8f, 0x48, 0x4c, 0x2c, 0x7d, 0x3c, 0x96, 0x4b, 0x2c, 0x10, 0xb1, 0x95, 0x9b, 0xe4, 0xf9, 0xc6, 0x57, 0xa2, 0x7b, 0x37, 0xb6, 0xe7, 0x00, 0xe5, }, + {0xe3, 0x59, 0x9e, 0xf5, 0x8f, 0x6c, 0x1b, 0x77, 0x66, 0xf0, 0x45, 0x31, 0xb5, 0x01, 0xec, 0x24, 0x97, 0xb2, 0xa8, 0x2e, }, + {0xe6, 0xdb, 0x06, 0x25, 0xba, 0xb0, 0x0a, 0x65, 0xeb, 0x25, 0xeb, 0xcb, 0xe6, 0xd5, 0xc3, 0xb6, 0x6b, 0x04, 0xad, 0x12, 0xc8, 0x91, 0x25, 0xa3, 0x4e, 0x10, 0xfe, 0x6c, }, + {0xa6, 0xb4, 0xc4, 0x6a, 0xa0, 0xaa, 0xce, 0x53, 0x8f, 0x48, 0x4c, 0x2c, 0x7d, 0x3c, 0x96, 0x4b, 0x2c, 0x10, 0xb1, 0x95, 0x9b, 0xe4, 0xf9, 0xc6, 0x57, 0xa2, 0x7b, 0x37, 0xb6, 0xe7, 0x00, 0xe5, }, }; while (1) { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_bsp_driver_glue.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_bsp_driver_glue.h index 3a8cfa7a62..614b7a351b 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_bsp_driver_glue.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_bsp_driver_glue.h @@ -3,12 +3,12 @@ * @file bflb_bsp_driver_glue.h * @version 0.1 * @date 2020-07-08 - * @brief + * @brief * ***************************************************************************** * @attention - * + * *

© COPYRIGHT(c) 2020 Bouffalo Lab

- * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, @@ -19,7 +19,7 @@ * 3. Neither the name of Bouffalo Lab nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -30,7 +30,7 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * ***************************************************************************** */ #ifndef __bBFLB_BSP_DRIVER_GLUE_H__ diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.c index 2f59c8b8c2..2448d3c28b 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.c @@ -3,12 +3,12 @@ * @file bflb_stub.c * @version 0.1 * @date 2020-07-08 - * @brief + * @brief * ***************************************************************************** * @attention - * + * *

© COPYRIGHT(c) 2020 Bouffalo Lab

- * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, @@ -19,7 +19,7 @@ * 3. Neither the name of Bouffalo Lab nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -30,7 +30,7 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * ***************************************************************************** */ #include "bflb_stub.h" @@ -157,4 +157,4 @@ void BFLB_BSP_Delay_Ms(uint32_t time) break; } } -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.h index 4bb99c6891..70aacb2cf2 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bflb_stub.h @@ -3,12 +3,12 @@ * @file bflb_stub.h * @version 0.1 * @date 2020-07-08 - * @brief + * @brief * ***************************************************************************** * @attention - * + * *

© COPYRIGHT(c) 2020 Bouffalo Lab

- * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, @@ -19,7 +19,7 @@ * 3. Neither the name of Bouffalo Lab nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -30,7 +30,7 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * ***************************************************************************** */ #ifndef __BFLB_STUB__ @@ -51,4 +51,4 @@ void BFLB_BSP_Set_Alarm_Time(uint64_t time); void BFLB_BSP_Deinit_Time(void); void BFLB_BSP_Delay_Ms(uint32_t time); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/adc_config.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/adc_config.h index 1946d0cbd1..68c0ffbca4 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/adc_config.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/adc_config.h @@ -14,4 +14,4 @@ #define ADC_OFFSET_CALIB_EN (0) /*!< Offset calibration enable */ #define ADC_OFFSER_CALIB_VAL (0) /*!< Offset calibration value */ -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/dac_config.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/dac_config.h index fd0e004fe9..c611675bde 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/dac_config.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/dac_config.h @@ -11,4 +11,4 @@ */ #define DAC_REF_RNG_DEFAULT_SELECT (0x3) /*!< ADC 1.8V select */ -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/i2s_config.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/i2s_config.h index e77913a70c..eeaf9f8784 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/i2s_config.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/i2s_config.h @@ -8,4 +8,4 @@ #define I2S_FS_INVERT DISABLE #define I2S_BCLK_INVERT DISABLE -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/uart_config.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/uart_config.h index 1cac8ce926..96aa97821b 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/uart_config.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/default_config/uart_config.h @@ -14,4 +14,4 @@ #define UART_FIFO_MAX_LEN 32 #define UART_DEFAULT_RTO_TIMEOUT 100 -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_adc.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_adc.h index 4c49c4019a..f956db98f2 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_adc.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_adc.h @@ -173,4 +173,4 @@ float adc_get_tsen(uint16_t tsen_offset); #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_audio.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_audio.h index 20b6b17161..2131b47661 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_audio.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_audio.h @@ -258,4 +258,4 @@ typedef struct audio_device { #define DEVICE_CTRL_GET_RECORD_PONG_BUF 0x17 int audio_register(enum audio_index_type index, const char *name); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_clock.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_clock.h index c9d79ede46..cb4698a215 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_clock.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_clock.h @@ -69,4 +69,4 @@ void system_clock_init(void); void peripheral_clock_init(void); void system_mtimer_clock_init(void); void system_mtimer_clock_reinit(void); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_dsi.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_dsi.h index 848b4a376a..0b196b8986 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_dsi.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_dsi.h @@ -57,300 +57,300 @@ struct drm_dsc_picture_parameter_set; */ struct drm_dsc_picture_parameter_set { /** - * @dsc_version: - * PPS0[3:0] - dsc_version_minor: Contains Minor version of DSC - * PPS0[7:4] - dsc_version_major: Contains major version of DSC - */ + * @dsc_version: + * PPS0[3:0] - dsc_version_minor: Contains Minor version of DSC + * PPS0[7:4] - dsc_version_major: Contains major version of DSC + */ u8 dsc_version; /** - * @pps_identifier: - * PPS1[7:0] - Application specific identifier that can be - * used to differentiate between different PPS tables. - */ + * @pps_identifier: + * PPS1[7:0] - Application specific identifier that can be + * used to differentiate between different PPS tables. + */ u8 pps_identifier; /** - * @pps_reserved: - * PPS2[7:0]- RESERVED Byte - */ + * @pps_reserved: + * PPS2[7:0]- RESERVED Byte + */ u8 pps_reserved; /** - * @pps_3: - * PPS3[3:0] - linebuf_depth: Contains linebuffer bit depth used to - * generate the bitstream. (0x0 - 16 bits for DSC 1.2, 0x8 - 8 bits, - * 0xA - 10 bits, 0xB - 11 bits, 0xC - 12 bits, 0xD - 13 bits, - * 0xE - 14 bits for DSC1.2, 0xF - 14 bits for DSC 1.2. - * PPS3[7:4] - bits_per_component: Bits per component for the original - * pixels of the encoded picture. - * 0x0 = 16bpc (allowed only when dsc_version_minor = 0x2) - * 0x8 = 8bpc, 0xA = 10bpc, 0xC = 12bpc, 0xE = 14bpc (also - * allowed only when dsc_minor_version = 0x2) - */ + * @pps_3: + * PPS3[3:0] - linebuf_depth: Contains linebuffer bit depth used to + * generate the bitstream. (0x0 - 16 bits for DSC 1.2, 0x8 - 8 bits, + * 0xA - 10 bits, 0xB - 11 bits, 0xC - 12 bits, 0xD - 13 bits, + * 0xE - 14 bits for DSC1.2, 0xF - 14 bits for DSC 1.2. + * PPS3[7:4] - bits_per_component: Bits per component for the original + * pixels of the encoded picture. + * 0x0 = 16bpc (allowed only when dsc_version_minor = 0x2) + * 0x8 = 8bpc, 0xA = 10bpc, 0xC = 12bpc, 0xE = 14bpc (also + * allowed only when dsc_minor_version = 0x2) + */ u8 pps_3; /** - * @pps_4: - * PPS4[1:0] -These are the most significant 2 bits of - * compressed BPP bits_per_pixel[9:0] syntax element. - * PPS4[2] - vbr_enable: 0 = VBR disabled, 1 = VBR enabled - * PPS4[3] - simple_422: Indicates if decoder drops samples to - * reconstruct the 4:2:2 picture. - * PPS4[4] - Convert_rgb: Indicates if DSC color space conversion is - * active. - * PPS4[5] - blobk_pred_enable: Indicates if BP is used to code any - * groups in picture - * PPS4[7:6] - Reseved bits - */ + * @pps_4: + * PPS4[1:0] -These are the most significant 2 bits of + * compressed BPP bits_per_pixel[9:0] syntax element. + * PPS4[2] - vbr_enable: 0 = VBR disabled, 1 = VBR enabled + * PPS4[3] - simple_422: Indicates if decoder drops samples to + * reconstruct the 4:2:2 picture. + * PPS4[4] - Convert_rgb: Indicates if DSC color space conversion is + * active. + * PPS4[5] - blobk_pred_enable: Indicates if BP is used to code any + * groups in picture + * PPS4[7:6] - Reseved bits + */ u8 pps_4; /** - * @bits_per_pixel_low: - * PPS5[7:0] - This indicates the lower significant 8 bits of - * the compressed BPP bits_per_pixel[9:0] element. - */ + * @bits_per_pixel_low: + * PPS5[7:0] - This indicates the lower significant 8 bits of + * the compressed BPP bits_per_pixel[9:0] element. + */ u8 bits_per_pixel_low; /** - * @pic_height: - * PPS6[7:0], PPS7[7:0] -pic_height: Specifies the number of pixel rows - * within the raster. - */ + * @pic_height: + * PPS6[7:0], PPS7[7:0] -pic_height: Specifies the number of pixel rows + * within the raster. + */ __be16 pic_height; /** - * @pic_width: - * PPS8[7:0], PPS9[7:0] - pic_width: Number of pixel columns within - * the raster. - */ + * @pic_width: + * PPS8[7:0], PPS9[7:0] - pic_width: Number of pixel columns within + * the raster. + */ __be16 pic_width; /** - * @slice_height: - * PPS10[7:0], PPS11[7:0] - Slice height in units of pixels. - */ + * @slice_height: + * PPS10[7:0], PPS11[7:0] - Slice height in units of pixels. + */ __be16 slice_height; /** - * @slice_width: - * PPS12[7:0], PPS13[7:0] - Slice width in terms of pixels. - */ + * @slice_width: + * PPS12[7:0], PPS13[7:0] - Slice width in terms of pixels. + */ __be16 slice_width; /** - * @chunk_size: - * PPS14[7:0], PPS15[7:0] - Size in units of bytes of the chunks - * that are used for slice multiplexing. - */ + * @chunk_size: + * PPS14[7:0], PPS15[7:0] - Size in units of bytes of the chunks + * that are used for slice multiplexing. + */ __be16 chunk_size; /** - * @initial_xmit_delay_high: - * PPS16[1:0] - Most Significant two bits of initial transmission delay. - * It specifies the number of pixel times that the encoder waits before - * transmitting data from its rate buffer. - * PPS16[7:2] - Reserved - */ + * @initial_xmit_delay_high: + * PPS16[1:0] - Most Significant two bits of initial transmission delay. + * It specifies the number of pixel times that the encoder waits before + * transmitting data from its rate buffer. + * PPS16[7:2] - Reserved + */ u8 initial_xmit_delay_high; /** - * @initial_xmit_delay_low: - * PPS17[7:0] - Least significant 8 bits of initial transmission delay. - */ + * @initial_xmit_delay_low: + * PPS17[7:0] - Least significant 8 bits of initial transmission delay. + */ u8 initial_xmit_delay_low; /** - * @initial_dec_delay: - * - * PPS18[7:0], PPS19[7:0] - Initial decoding delay which is the number - * of pixel times that the decoder accumulates data in its rate buffer - * before starting to decode and output pixels. - */ + * @initial_dec_delay: + * + * PPS18[7:0], PPS19[7:0] - Initial decoding delay which is the number + * of pixel times that the decoder accumulates data in its rate buffer + * before starting to decode and output pixels. + */ __be16 initial_dec_delay; /** - * @pps20_reserved: - * - * PPS20[7:0] - Reserved - */ + * @pps20_reserved: + * + * PPS20[7:0] - Reserved + */ u8 pps20_reserved; /** - * @initial_scale_value: - * PPS21[5:0] - Initial rcXformScale factor used at beginning - * of a slice. - * PPS21[7:6] - Reserved - */ + * @initial_scale_value: + * PPS21[5:0] - Initial rcXformScale factor used at beginning + * of a slice. + * PPS21[7:6] - Reserved + */ u8 initial_scale_value; /** - * @scale_increment_interval: - * PPS22[7:0], PPS23[7:0] - Number of group times between incrementing - * the rcXformScale factor at end of a slice. - */ + * @scale_increment_interval: + * PPS22[7:0], PPS23[7:0] - Number of group times between incrementing + * the rcXformScale factor at end of a slice. + */ __be16 scale_increment_interval; /** - * @scale_decrement_interval_high: - * PPS24[3:0] - Higher 4 bits indicating number of group times between - * decrementing the rcXformScale factor at beginning of a slice. - * PPS24[7:4] - Reserved - */ + * @scale_decrement_interval_high: + * PPS24[3:0] - Higher 4 bits indicating number of group times between + * decrementing the rcXformScale factor at beginning of a slice. + * PPS24[7:4] - Reserved + */ u8 scale_decrement_interval_high; /** - * @scale_decrement_interval_low: - * PPS25[7:0] - Lower 8 bits of scale decrement interval - */ + * @scale_decrement_interval_low: + * PPS25[7:0] - Lower 8 bits of scale decrement interval + */ u8 scale_decrement_interval_low; /** - * @pps26_reserved: - * PPS26[7:0] - */ + * @pps26_reserved: + * PPS26[7:0] + */ u8 pps26_reserved; /** - * @first_line_bpg_offset: - * PPS27[4:0] - Number of additional bits that are allocated - * for each group on first line of a slice. - * PPS27[7:5] - Reserved - */ + * @first_line_bpg_offset: + * PPS27[4:0] - Number of additional bits that are allocated + * for each group on first line of a slice. + * PPS27[7:5] - Reserved + */ u8 first_line_bpg_offset; /** - * @nfl_bpg_offset: - * PPS28[7:0], PPS29[7:0] - Number of bits including frac bits - * deallocated for each group for groups after the first line of slice. - */ + * @nfl_bpg_offset: + * PPS28[7:0], PPS29[7:0] - Number of bits including frac bits + * deallocated for each group for groups after the first line of slice. + */ __be16 nfl_bpg_offset; /** - * @slice_bpg_offset: - * PPS30, PPS31[7:0] - Number of bits that are deallocated for each - * group to enforce the slice constraint. - */ + * @slice_bpg_offset: + * PPS30, PPS31[7:0] - Number of bits that are deallocated for each + * group to enforce the slice constraint. + */ __be16 slice_bpg_offset; /** - * @initial_offset: - * PPS32,33[7:0] - Initial value for rcXformOffset - */ + * @initial_offset: + * PPS32,33[7:0] - Initial value for rcXformOffset + */ __be16 initial_offset; /** - * @final_offset: - * PPS34,35[7:0] - Maximum end-of-slice value for rcXformOffset - */ + * @final_offset: + * PPS34,35[7:0] - Maximum end-of-slice value for rcXformOffset + */ __be16 final_offset; /** - * @flatness_min_qp: - * PPS36[4:0] - Minimum QP at which flatness is signaled and - * flatness QP adjustment is made. - * PPS36[7:5] - Reserved - */ + * @flatness_min_qp: + * PPS36[4:0] - Minimum QP at which flatness is signaled and + * flatness QP adjustment is made. + * PPS36[7:5] - Reserved + */ u8 flatness_min_qp; /** - * @flatness_max_qp: - * PPS37[4:0] - Max QP at which flatness is signalled and - * the flatness adjustment is made. - * PPS37[7:5] - Reserved - */ + * @flatness_max_qp: + * PPS37[4:0] - Max QP at which flatness is signalled and + * the flatness adjustment is made. + * PPS37[7:5] - Reserved + */ u8 flatness_max_qp; /** - * @rc_model_size: - * PPS38,39[7:0] - Number of bits within RC Model. - */ + * @rc_model_size: + * PPS38,39[7:0] - Number of bits within RC Model. + */ __be16 rc_model_size; /** - * @rc_edge_factor: - * PPS40[3:0] - Ratio of current activity vs, previous - * activity to determine presence of edge. - * PPS40[7:4] - Reserved - */ + * @rc_edge_factor: + * PPS40[3:0] - Ratio of current activity vs, previous + * activity to determine presence of edge. + * PPS40[7:4] - Reserved + */ u8 rc_edge_factor; /** - * @rc_quant_incr_limit0: - * PPS41[4:0] - QP threshold used in short term RC - * PPS41[7:5] - Reserved - */ + * @rc_quant_incr_limit0: + * PPS41[4:0] - QP threshold used in short term RC + * PPS41[7:5] - Reserved + */ u8 rc_quant_incr_limit0; /** - * @rc_quant_incr_limit1: - * PPS42[4:0] - QP threshold used in short term RC - * PPS42[7:5] - Reserved - */ + * @rc_quant_incr_limit1: + * PPS42[4:0] - QP threshold used in short term RC + * PPS42[7:5] - Reserved + */ u8 rc_quant_incr_limit1; /** - * @rc_tgt_offset: - * PPS43[3:0] - Lower end of the variability range around the target - * bits per group that is allowed by short term RC. - * PPS43[7:4]- Upper end of the variability range around the target - * bits per group that i allowed by short term rc. - */ + * @rc_tgt_offset: + * PPS43[3:0] - Lower end of the variability range around the target + * bits per group that is allowed by short term RC. + * PPS43[7:4]- Upper end of the variability range around the target + * bits per group that i allowed by short term rc. + */ u8 rc_tgt_offset; /** - * @rc_buf_thresh: - * PPS44[7:0] - PPS57[7:0] - Specifies the thresholds in RC model for - * the 15 ranges defined by 14 thresholds. - */ + * @rc_buf_thresh: + * PPS44[7:0] - PPS57[7:0] - Specifies the thresholds in RC model for + * the 15 ranges defined by 14 thresholds. + */ u8 rc_buf_thresh[DSC_NUM_BUF_RANGES - 1]; /** - * @rc_range_parameters: - * PPS58[7:0] - PPS87[7:0] - * Parameters that correspond to each of the 15 ranges. - */ + * @rc_range_parameters: + * PPS58[7:0] - PPS87[7:0] + * Parameters that correspond to each of the 15 ranges. + */ __be16 rc_range_parameters[DSC_NUM_BUF_RANGES]; /** - * @native_422_420: - * PPS88[0] - 0 = Native 4:2:2 not used - * 1 = Native 4:2:2 used - * PPS88[1] - 0 = Native 4:2:0 not use - * 1 = Native 4:2:0 used - * PPS88[7:2] - Reserved 6 bits - */ + * @native_422_420: + * PPS88[0] - 0 = Native 4:2:2 not used + * 1 = Native 4:2:2 used + * PPS88[1] - 0 = Native 4:2:0 not use + * 1 = Native 4:2:0 used + * PPS88[7:2] - Reserved 6 bits + */ u8 native_422_420; /** - * @second_line_bpg_offset: - * PPS89[4:0] - Additional bits/group budget for the - * second line of a slice in Native 4:2:0 mode. - * Set to 0 if DSC minor version is 1 or native420 is 0. - * PPS89[7:5] - Reserved - */ + * @second_line_bpg_offset: + * PPS89[4:0] - Additional bits/group budget for the + * second line of a slice in Native 4:2:0 mode. + * Set to 0 if DSC minor version is 1 or native420 is 0. + * PPS89[7:5] - Reserved + */ u8 second_line_bpg_offset; /** - * @nsl_bpg_offset: - * PPS90[7:0], PPS91[7:0] - Number of bits that are deallocated - * for each group that is not in the second line of a slice. - */ + * @nsl_bpg_offset: + * PPS90[7:0], PPS91[7:0] - Number of bits that are deallocated + * for each group that is not in the second line of a slice. + */ __be16 nsl_bpg_offset; /** - * @second_line_offset_adj: - * PPS92[7:0], PPS93[7:0] - Used as offset adjustment for the second - * line in Native 4:2:0 mode. - */ + * @second_line_offset_adj: + * PPS92[7:0], PPS93[7:0] - Used as offset adjustment for the second + * line in Native 4:2:0 mode. + */ __be16 second_line_offset_adj; /** - * @pps_long_94_reserved: - * PPS 94, 95, 96, 97 - Reserved - */ + * @pps_long_94_reserved: + * PPS 94, 95, 96, 97 - Reserved + */ u32 pps_long_94_reserved; /** - * @pps_long_98_reserved: - * PPS 98, 99, 100, 101 - Reserved - */ + * @pps_long_98_reserved: + * PPS 98, 99, 100, 101 - Reserved + */ u32 pps_long_98_reserved; /** - * @pps_long_102_reserved: - * PPS 102, 103, 104, 105 - Reserved - */ + * @pps_long_102_reserved: + * PPS 102, 103, 104, 105 - Reserved + */ u32 pps_long_102_reserved; /** - * @pps_long_106_reserved: - * PPS 106, 107, 108, 109 - reserved - */ + * @pps_long_106_reserved: + * PPS 106, 107, 108, 109 - reserved + */ u32 pps_long_106_reserved; /** - * @pps_long_110_reserved: - * PPS 110, 111, 112, 113 - reserved - */ + * @pps_long_110_reserved: + * PPS 110, 111, 112, 113 - reserved + */ u32 pps_long_110_reserved; /** - * @pps_long_114_reserved: - * PPS 114 - 117 - reserved - */ + * @pps_long_114_reserved: + * PPS 114 - 117 - reserved + */ u32 pps_long_114_reserved; /** - * @pps_long_118_reserved: - * PPS 118 - 121 - reserved - */ + * @pps_long_118_reserved: + * PPS 118 - 121 - reserved + */ u32 pps_long_118_reserved; /** - * @pps_long_122_reserved: - * PPS 122- 125 - reserved - */ + * @pps_long_122_reserved: + * PPS 122- 125 - reserved + */ u32 pps_long_122_reserved; /** - * @pps_short_126_reserved: - * PPS 126, 127 - reserved - */ + * @pps_short_126_reserved: + * PPS 126, 127 - reserved + */ __be16 pps_short_126_reserved; } __attribute__((packed)); @@ -571,4 +571,4 @@ int mipi_dsi_dcs_set_display_brightness(const struct mipi_dsi_device *dsi, int mipi_dsi_dcs_get_display_brightness(const struct mipi_dsi_device *dsi, u16 *brightness); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2c.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2c.h index 09d349ac2d..028ef6888a 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2c.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2c.h @@ -74,4 +74,4 @@ typedef struct i2c_device { int i2c_register(enum i2c_index_type index, const char *name); int i2c_transfer(struct device *dev, i2c_msg_t msgs[], uint32_t num); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2s.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2s.h index 0a768dd8e0..ec9ee66434 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2s.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_i2s.h @@ -114,4 +114,4 @@ typedef struct i2s_device { int i2s_register(enum i2s_index_type index, const char *name); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_mtimer.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_mtimer.h index f7ebdb2d12..07baccff02 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_mtimer.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_mtimer.h @@ -40,4 +40,4 @@ void mtimer_delay_us(uint32_t time); } #endif -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_aes.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_aes.h index a7dc5812bf..edeab53e15 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_aes.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_aes.h @@ -54,4 +54,4 @@ int sec_aes_encrypt(sec_aes_handle_t *handle, const uint8_t *in, uint32_t len, s int sec_aes_decrypt(sec_aes_handle_t *handle, const uint8_t *in, uint32_t len, size_t offset, uint8_t *out); int sec_aes_deinit(sec_aes_handle_t *handle); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_dsa.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_dsa.h index 4991c088b7..246c695c54 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_dsa.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_dsa.h @@ -54,4 +54,4 @@ int sec_dsa_decrypt_crt(uint32_t size, uint32_t *c, sec_dsa_crt_cfg_t *crtCfg, u int sec_dsa_sign(sec_dsa_handle_t *handle, const uint32_t *hash, uint32_t hashLenInWord, uint32_t *s); int sec_dsa_verify(sec_dsa_handle_t *handle, const uint32_t *hash, uint32_t hashLenInWord, const uint32_t *s); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_ecdsa.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_ecdsa.h index 87c71cc636..8c117ef5e8 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_ecdsa.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_ecdsa.h @@ -59,4 +59,4 @@ int sec_ecc_get_random_value(uint32_t *randomData, uint32_t *maxRef, uint32_t si #define SEC_CODEPATH_STATE_SIGN 0x48672386 -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_hash.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_hash.h index eafe7d87d4..08d7d55480 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_hash.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_sec_hash.h @@ -61,4 +61,4 @@ int sec_hash_finish(sec_hash_handle_t *handle, void *buffer); int sec_hash_sha256_register(enum sec_hash_index_type index, const char *name); int sec_hash_sha224_register(enum sec_hash_index_type index, const char *name); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_spi.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_spi.h index 35dda97a07..105c9190db 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_spi.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_spi.h @@ -126,4 +126,4 @@ typedef struct spi_device { int spi_register(enum spi_index_type index, const char *name); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_timer.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_timer.h index 489c6f63ba..2a8a52b36d 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_timer.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_timer.h @@ -91,4 +91,4 @@ typedef struct timer_device { int timer_register(enum timer_index_type index, const char *name); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_uart.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_uart.h index 465a135826..2555e746f7 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_uart.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/hal_uart.h @@ -128,4 +128,4 @@ typedef struct uart_device { int uart_register(enum uart_index_type index, const char *name); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/mipi_display.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/mipi_display.h index 8d811694cc..a63d840161 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/mipi_display.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/inc/mipi_display.h @@ -6,44 +6,44 @@ */ struct drm_panel { /** - * @dev: - * - * Parent device of the panel. - */ + * @dev: + * + * Parent device of the panel. + */ struct device *dev; /** - * @backlight: - * - * Backlight device, used to turn on backlight after the call - * to enable(), and to turn off backlight before the call to - * disable(). - * backlight is set by drm_panel_of_backlight() and drivers - * shall not assign it. - */ + * @backlight: + * + * Backlight device, used to turn on backlight after the call + * to enable(), and to turn off backlight before the call to + * disable(). + * backlight is set by drm_panel_of_backlight() and drivers + * shall not assign it. + */ struct backlight_device *backlight; /** - * @funcs: - * - * Operations that can be performed on the panel. - */ + * @funcs: + * + * Operations that can be performed on the panel. + */ const struct drm_panel_funcs *funcs; /** - * @connector_type: - * - * Type of the panel as a DRM_MODE_CONNECTOR_* value. This is used to - * initialise the drm_connector corresponding to the panel with the - * correct connector type. - */ + * @connector_type: + * + * Type of the panel as a DRM_MODE_CONNECTOR_* value. This is used to + * initialise the drm_connector corresponding to the panel with the + * correct connector type. + */ int connector_type; /** - * @list: - * - * Panel entry in registry. - */ + * @list: + * + * Panel entry in registry. + */ //struct list_head list; }; @@ -184,4 +184,4 @@ enum { #define MIPI_DCS_PIXEL_FMT_8BIT 2 #define MIPI_DCS_PIXEL_FMT_3BIT 1 -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_adc.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_adc.c index 840f372d20..3a21ad8dd6 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_adc.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_adc.c @@ -380,4 +380,4 @@ void ADC_IRQ(void) { adc_isr(&adcx_device[ADC0_INDEX]); } -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_boot2.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_boot2.c index f116ae123d..41b67976eb 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_boot2.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_boot2.c @@ -599,4 +599,4 @@ uint32_t ATTR_TCM_SECTION hal_boot2_get_feature_flag(void) uint32_t hal_boot2_get_bootheader_offset(void) { return 0x0; -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_common.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_common.c index 6e31773a9b..2085fa0287 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_common.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_common.c @@ -138,4 +138,4 @@ void ATTR_TCM_SECTION hal_dcache_clean_invalidate_byaddr(uintptr_t addr, uint32_ } __DSB(); -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_dsi.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_dsi.c index 2eed621efa..e87a5224d9 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_dsi.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_dsi.c @@ -929,4 +929,4 @@ int mipi_dsi_dcs_get_display_brightness(const struct mipi_dsi_device *dsi, } return 0; -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_gpio.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_gpio.c index 77a110d4a4..3a0d01171e 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_gpio.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_gpio.c @@ -224,4 +224,4 @@ static void GPIO_IRQ(void) } } } -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_i2c.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_i2c.c index 4f31d12f8d..574acf64f9 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_i2c.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_i2c.c @@ -128,4 +128,4 @@ int i2c_transfer(struct device *dev, i2c_msg_t msgs[], uint32_t num) } return 0; -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_dsa.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_dsa.c index 65816c7f66..72901dbecc 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_dsa.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_dsa.c @@ -121,10 +121,10 @@ int sec_dsa_mexp_binary(uint32_t size, const uint32_t *a, const uint32_t *b, con 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }; #endif /* 0:c - * 4:a - * 5:number - * 6&7:temp - */ + * 4:a + * 5:number + * 6&7:temp + */ /* base = a */ Sec_Eng_PKA_Write_Data(nregType, 4, (uint32_t *)a, dataSize, 0); @@ -201,13 +201,13 @@ int sec_dsa_mexp_mont(uint32_t size, uint32_t *a, uint32_t *b, uint32_t *c, uint uint32_t dataSize = (size >> 3) >> 2; /* 0:c - * 1:NPrime_c - * 2:invR_c - * 4:a(mont domain) - * 5:b - * 6:a^b%c(mont domain) - * 7:a^b%c(gf domain) - * 10&11:2^size for GF2Mont*/ + * 1:NPrime_c + * 2:invR_c + * 4:a(mont domain) + * 5:b + * 6:a^b%c(mont domain) + * 7:a^b%c(gf domain) + * 10&11:2^size for GF2Mont*/ Sec_Eng_PKA_Write_Data(nregType, 0, (uint32_t *)c, dataSize, 0); Sec_Eng_PKA_Write_Data(nregType, 1, (uint32_t *)primeN_c, dataSize, 1); Sec_Eng_PKA_Write_Data(nregType, 2, (uint32_t *)invR_c, dataSize, 1); @@ -250,38 +250,38 @@ int sec_dsa_mexp_mont(uint32_t size, uint32_t *a, uint32_t *b, uint32_t *c, uint int sec_dsa_decrypt_crt(uint32_t size, uint32_t *c, sec_dsa_crt_cfg_t *crtCfg, uint32_t *d, uint32_t *r) { /* - * m1 = pow(c, dP, p) - * m2 = pow(c, dQ, q) - * h = (qInv * (m1 - m2)) % p - * m = m2 + h * q - * */ + * m1 = pow(c, dP, p) + * m2 = pow(c, dQ, q) + * h = (qInv * (m1 - m2)) % p + * m = m2 + h * q + * */ SEC_ENG_PKA_REG_SIZE_Type nregType = sec_dsa_get_reg_size(size); SEC_ENG_PKA_REG_SIZE_Type lregType = sec_dsa_get_reg_size(size * 2); uint32_t dataSize = (size >> 3) >> 2; #if 0 - uint8_t m1[64] = {0x11, 0xdd, 0x19, 0x7e, 0x69, 0x1a, 0x40, 0x0a, 0x28, 0xfc, 0x3b, 0x31, 0x47, 0xa2, 0x6c, 0x14, - 0x4e, 0xf6, 0xb0, 0xe6, 0xcd, 0x89, 0x0b, 0x4f, 0x02, 0xe4, 0x86, 0xe2, 0xe5, 0xbe, 0xe1, 0xaf, - 0x91, 0xd1, 0x7b, 0x59, 0x8d, 0xdc, 0xb3, 0x57, 0x18, 0xcb, 0x80, 0x05, 0x1c, 0xb5, 0xa4, 0x07, - 0xde, 0x31, 0x94, 0xa4, 0x2f, 0x45, 0xc7, 0x95, 0x75, 0x0f, 0x91, 0xf0, 0x37, 0x91, 0x85, 0xa5 - }; - uint8_t m2[64] = {0x63, 0x89, 0xa3, 0xbb, 0x64, 0x63, 0x87, 0x4f, 0x38, 0xbd, 0x9e, 0x0e, 0x93, 0x29, 0x58, 0xee, - 0xf8, 0xe2, 0x20, 0x2d, 0xe5, 0x38, 0x0a, 0x7f, 0x18, 0x38, 0x2f, 0xa3, 0xf5, 0x48, 0xf8, 0xfd, - 0xe5, 0x78, 0x4a, 0x10, 0x62, 0x01, 0x09, 0x29, 0xe3, 0xe3, 0x9f, 0xad, 0x9b, 0xbe, 0x20, 0xd2, - 0x68, 0x90, 0x57, 0x97, 0xfc, 0x78, 0xd5, 0xdb, 0x07, 0x5b, 0xfe, 0x21, 0x0a, 0x2d, 0x7f, 0xc1 - }; + uint8_t m1[64] = {0x11, 0xdd, 0x19, 0x7e, 0x69, 0x1a, 0x40, 0x0a, 0x28, 0xfc, 0x3b, 0x31, 0x47, 0xa2, 0x6c, 0x14, + 0x4e, 0xf6, 0xb0, 0xe6, 0xcd, 0x89, 0x0b, 0x4f, 0x02, 0xe4, 0x86, 0xe2, 0xe5, 0xbe, 0xe1, 0xaf, + 0x91, 0xd1, 0x7b, 0x59, 0x8d, 0xdc, 0xb3, 0x57, 0x18, 0xcb, 0x80, 0x05, 0x1c, 0xb5, 0xa4, 0x07, + 0xde, 0x31, 0x94, 0xa4, 0x2f, 0x45, 0xc7, 0x95, 0x75, 0x0f, 0x91, 0xf0, 0x37, 0x91, 0x85, 0xa5 + }; + uint8_t m2[64] = {0x63, 0x89, 0xa3, 0xbb, 0x64, 0x63, 0x87, 0x4f, 0x38, 0xbd, 0x9e, 0x0e, 0x93, 0x29, 0x58, 0xee, + 0xf8, 0xe2, 0x20, 0x2d, 0xe5, 0x38, 0x0a, 0x7f, 0x18, 0x38, 0x2f, 0xa3, 0xf5, 0x48, 0xf8, 0xfd, + 0xe5, 0x78, 0x4a, 0x10, 0x62, 0x01, 0x09, 0x29, 0xe3, 0xe3, 0x9f, 0xad, 0x9b, 0xbe, 0x20, 0xd2, + 0x68, 0x90, 0x57, 0x97, 0xfc, 0x78, 0xd5, 0xdb, 0x07, 0x5b, 0xfe, 0x21, 0x0a, 0x2d, 0x7f, 0xc1 + }; #else uint32_t m1[32]; uint32_t m2[32]; #endif /* - * 4:m1 - * 5:m2 - * 6:qInv - * 7:p - * 8:q - * 9:h - * 10&11:qInv*(m1-m2) - */ + * 4:m1 + * 5:m2 + * 6:qInv + * 7:p + * 8:q + * 9:h + * 10&11:qInv*(m1-m2) + */ sec_dsa_mexp_mont(size, c, crtCfg->dP, crtCfg->p, crtCfg->invR_p, crtCfg->primeN_p, m1); sec_dsa_mexp_mont(size, c, crtCfg->dQ, crtCfg->q, crtCfg->invR_q, crtCfg->primeN_q, m2); diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_ecdsa.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_ecdsa.c index 055d6bb998..0a1592e2a5 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_ecdsa.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_ecdsa.c @@ -930,7 +930,7 @@ int sec_ecdsa_deinit(sec_ecdsa_handle_t *handle) __WEAK void sec_ecdsa_verify_suss_callback(uint32_t state, uint8_t is_en) { - + } int sec_ecdsa_verify(sec_ecdsa_handle_t *handle, const uint32_t *hash, uint32_t hashLenInWord, const uint32_t *r, const uint32_t *s) @@ -1240,7 +1240,7 @@ int sec_ecdsa_verify(sec_ecdsa_handle_t *handle, const uint32_t *hash, uint32_t #endif sec_ecdsa_verify_suss_callback(SEC_CODEPATH_STATE_SIGN, 1); - + return 0; } diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_hash.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_hash.c index 8ad3b36d66..d34121dd95 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_hash.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_sec_hash.c @@ -384,4 +384,4 @@ void sec_hash_isr(void) void SEC_SHA_IRQ(void) { sec_hash_isr(); -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_spi.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_spi.c index e3dd9272f1..8538d9706c 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_spi.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/hal_drv/src/hal_spi.c @@ -491,4 +491,4 @@ void SPI1_IRQ_Function() { spi_isr(&spix_device[SPI1_INDEX]); } -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/core_rv64.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/core_rv64.h index b532898e18..f9036fab13 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/core_rv64.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/core_rv64.h @@ -694,21 +694,21 @@ __STATIC_INLINE uint32_t csi_coret_config(uint32_t ticks, int32_t IRQn) #if 0 - if(value) - { - value = value + (uint64_t)ticks; - CORET->MTIMECMPH0 = (uint32_t)(value >> 32); - CORET->MTIMECMPL0 = (uint32_t)value; - } - else - { - uint64_t result; - __ASM volatile("csrr %0, 0xc01" : "=r"(result)); + if(value) + { + value = value + (uint64_t)ticks; + CORET->MTIMECMPH0 = (uint32_t)(value >> 32); + CORET->MTIMECMPL0 = (uint32_t)value; + } + else + { + uint64_t result; + __ASM volatile("csrr %0, 0xc01" : "=r"(result)); - value = result + (uint64_t)ticks; - CORET->MTIMECMPH0 = (uint32_t)(value >> 32); - CORET->MTIMECMPL0 = (uint32_t)value; - } + value = result + (uint64_t)ticks; + CORET->MTIMECMPH0 = (uint32_t)(value >> 32); + CORET->MTIMECMPL0 = (uint32_t)value; + } #else value = value + (uint64_t)ticks; diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/riscv_encoding.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/riscv_encoding.h index b32fe91bdd..f1dbf3a185 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/riscv_encoding.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/Core/Include/riscv_encoding.h @@ -178,45 +178,45 @@ #define asm __asm #define read_fpu(reg) ({ unsigned long __tmp; \ - asm volatile ("fmv.x.w %0, " #reg : "=r"(__tmp)); \ - __tmp; }) + asm volatile ("fmv.x.w %0, " #reg : "=r"(__tmp)); \ + __tmp; }) #define write_fpu(reg, val) ({ \ - if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ - asm volatile ("fmv.w.x " #reg ", %0" :: "i"(val)); \ - else \ - asm volatile ("fmv.w.x " #reg ", %0" :: "r"(val)); }) + if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ + asm volatile ("fmv.w.x " #reg ", %0" :: "i"(val)); \ + else \ + asm volatile ("fmv.w.x " #reg ", %0" :: "r"(val)); }) #define read_csr(reg) ({ unsigned long __tmp; \ - asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \ - __tmp; }) + asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \ + __tmp; }) #define write_csr(reg, val) ({ \ - if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ - asm volatile ("csrw " #reg ", %0" :: "i"(val)); \ - else \ - asm volatile ("csrw " #reg ", %0" :: "r"(val)); }) + if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ + asm volatile ("csrw " #reg ", %0" :: "i"(val)); \ + else \ + asm volatile ("csrw " #reg ", %0" :: "r"(val)); }) #define swap_csr(reg, val) ({ unsigned long __tmp; \ - if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ - asm volatile ("csrrw %0, " #reg ", %1" : "=r"(__tmp) : "i"(val)); \ - else \ - asm volatile ("csrrw %0, " #reg ", %1" : "=r"(__tmp) : "r"(val)); \ - __tmp; }) + if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ + asm volatile ("csrrw %0, " #reg ", %1" : "=r"(__tmp) : "i"(val)); \ + else \ + asm volatile ("csrrw %0, " #reg ", %1" : "=r"(__tmp) : "r"(val)); \ + __tmp; }) #define set_csr(reg, bit) ({ unsigned long __tmp; \ - if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ - asm volatile ("csrrs %0, " #reg ", %1" : "=r"(__tmp) : "i"(bit)); \ - else \ - asm volatile ("csrrs %0, " #reg ", %1" : "=r"(__tmp) : "r"(bit)); \ - __tmp; }) + if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ + asm volatile ("csrrs %0, " #reg ", %1" : "=r"(__tmp) : "i"(bit)); \ + else \ + asm volatile ("csrrs %0, " #reg ", %1" : "=r"(__tmp) : "r"(bit)); \ + __tmp; }) #define clear_csr(reg, bit) ({ unsigned long __tmp; \ - if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ - asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "i"(bit)); \ - else \ - asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "r"(bit)); \ - __tmp; }) + if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ + asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "i"(bit)); \ + else \ + asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "r"(bit)); \ + __tmp; }) #define rdtime() read_csr(time) #define rdcycle() read_csr(cycle) diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_instance.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_instance.h index 88cdece3c9..3de1a3a86a 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_instance.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_instance.h @@ -44,8 +44,8 @@ extern "C" #include #endif -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT +#define LOW_OPTIMIZATION_ENTER +#define LOW_OPTIMIZATION_EXIT #define F64_MAX ((float64_t)DBL_MAX) #define F32_MAX ((float32_t)FLT_MAX) @@ -396,9 +396,9 @@ __STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) * @brief definition to pack four 8 bit values. */ #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) + (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ + (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ + (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) /** * @brief Clips Q63 to Q31 values. diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_math.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_math.h index 78e0bb24c5..9ee04631a5 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_math.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/csi_dsp/include/csi_math.h @@ -4038,7 +4038,7 @@ csi_status csi_sqrt_q15( - \ref CSI_MATH_SUCCESS : input value is positive - \ref CSI_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0 */ -#ifdef __riscv +#ifdef __riscv __STATIC_FORCEINLINE csi_status csi_sqrt_f32( float32_t in, float32_t * pOut) @@ -4075,12 +4075,12 @@ csi_status csi_sqrt_f32( /** - @brief Q31 square root function. - @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF - @param[out] pOut points to square root of input value - @return execution status - - \ref CSI_MATH_SUCCESS : input value is positive - - \ref CSI_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0 + @brief Q31 square root function. + @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF + @param[out] pOut points to square root of input value + @return execution status + - \ref CSI_MATH_SUCCESS : input value is positive + - \ref CSI_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0 */ csi_status csi_sqrt_q31( q31_t in, @@ -4102,19 +4102,19 @@ void csi_vsqrt_f32( uint16_t len); void csi_vsqrt_q15( - q15_t * pIn, - q15_t * pOut, - uint16_t len); + q15_t * pIn, + q15_t * pOut, + uint16_t len); void csi_vsqrt_q31( - q31_t * pIn, - q31_t * pOut, - uint16_t len); + q31_t * pIn, + q31_t * pOut, + uint16_t len); void csi_vsqrt_q7( - q7_t * pIn, - q7_t * pOut, - uint16_t len); + q7_t * pIn, + q7_t * pOut, + uint16_t len); #else @@ -4129,9 +4129,9 @@ __STATIC_FORCEINLINE void csi_vsqrt_f32( } __STATIC_FORCEINLINE void csi_vsqrt_q15( - q15_t * pIn, - q15_t * pOut, - uint16_t len + q15_t * pIn, + q15_t * pOut, + uint16_t len ) { for (int i = 0; i < len; i++) { @@ -4139,9 +4139,9 @@ __STATIC_FORCEINLINE void csi_vsqrt_q15( } } __STATIC_FORCEINLINE void csi_vsqrt_q31( - q31_t * pIn, - q31_t * pOut, - uint16_t len + q31_t * pIn, + q31_t * pOut, + uint16_t len ) { for (int i = 0; i < len; i++) { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/rv_hart.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/rv_hart.c index a317fd391d..1c1ed1d711 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/rv_hart.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/risc-v/rv_hart.c @@ -112,10 +112,10 @@ rv_hart_switch_mode_from_M(uintptr_t arg0, uintptr_t arg1, write_csr(satp, 0); } else if (next_mode == PRV_U) { /* un-implemented - write_csr(utvec, next_addr); - write_csr(uscratch, 0); - write_csr(uie, 0); - */ + write_csr(utvec, next_addr); + write_csr(uscratch, 0); + write_csr(uie, 0); + */ } register unsigned long a0 __asm("a0") = arg0; diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/d0/source/GCC/start_load.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/d0/source/GCC/start_load.c index 54d939e263..fea62fabb3 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/d0/source/GCC/start_load.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/d0/source/GCC/start_load.c @@ -80,13 +80,13 @@ void start_load(void) #ifdef __STARTUP_CLEAR_BSS /* Single BSS section scheme. - * - * The BSS section is specified by following symbols - * __bss_start__: start of the BSS section. - * __bss_end__: end of the BSS section. - * - * Both addresses must be aligned to 4 bytes boundary. - */ + * + * The BSS section is specified by following symbols + * __bss_start__: start of the BSS section. + * __bss_end__: end of the BSS section. + * + * Both addresses must be aligned to 4 bytes boundary. + */ pDest = &__bss_start__; for (; pDest < &__bss_end__;) { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/GCC/start_load.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/GCC/start_load.c index cf7b9ed50b..fe08dce0c0 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/GCC/start_load.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/GCC/start_load.c @@ -74,13 +74,13 @@ void start_load(void) #ifdef __STARTUP_CLEAR_BSS /* Single BSS section scheme. - * - * The BSS section is specified by following symbols - * __bss_start__: start of the BSS section. - * __bss_end__: end of the BSS section. - * - * Both addresses must be aligned to 4 bytes boundary. - */ + * + * The BSS section is specified by following symbols + * __bss_start__: start of the BSS section. + * __bss_end__: end of the BSS section. + * + * Both addresses must be aligned to 4 bytes boundary. + */ pDest = &__bss_start__; for (; pDest < &__bss_end__;) { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/interrupt.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/interrupt.c index 929a60fd4e..a167bb8416 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/interrupt.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/lp/source/interrupt.c @@ -29,58 +29,58 @@ void Interrupt_Default_Handler(void) } #if 0 - extern void Trap_Handler(void); - extern void Interrupt_Handler(void); - void Interrupt_Handler_Stub(void); + extern void Trap_Handler(void); + extern void Interrupt_Handler(void); + void Interrupt_Handler_Stub(void); - void clic_msip_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void clic_mtimer_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void clic_mext_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void clic_csoft_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void BMX_TO_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void L1C_BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void L1C_BMX_TO_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SEC_BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void RF_TOP_INT0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void RF_TOP_INT1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SDIO_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void DMA_BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SEC_GMAC_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SEC_CDET_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SEC_PKA_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SEC_TRNG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SEC_AES_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SEC_SHA_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void DMA_ALL_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void IRTX_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void IRRX_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SF_CTRL_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void GPADC_DMA_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void EFUSE_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void SPI_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void UART0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void UART1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void I2C_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void PWM_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void TIMER_CH0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void TIMER_CH1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void TIMER_WDT_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void GPIO_INT0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void PDS_WAKEUP_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void HBN_OUT0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void HBN_OUT1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void BOR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void WIFI_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void BZ_PHY_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void BLE_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void MAC_TXRX_TIMER_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void MAC_TXRX_MISC_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void MAC_RX_TRG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void MAC_TX_TRG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void MAC_GEN_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void MAC_PORT_TRG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); - void WIFI_IPC_PUBLIC_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void clic_msip_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void clic_mtimer_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void clic_mext_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void clic_csoft_handler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void BMX_TO_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void L1C_BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void L1C_BMX_TO_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SEC_BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void RF_TOP_INT0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void RF_TOP_INT1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SDIO_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void DMA_BMX_ERR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SEC_GMAC_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SEC_CDET_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SEC_PKA_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SEC_TRNG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SEC_AES_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SEC_SHA_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void DMA_ALL_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void IRTX_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void IRRX_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SF_CTRL_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void GPADC_DMA_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void EFUSE_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void SPI_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void UART0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void UART1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void I2C_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void PWM_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void TIMER_CH0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void TIMER_CH1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void TIMER_WDT_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void GPIO_INT0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void PDS_WAKEUP_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void HBN_OUT0_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void HBN_OUT1_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void BOR_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void WIFI_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void BZ_PHY_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void BLE_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void MAC_TXRX_TIMER_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void MAC_TXRX_MISC_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void MAC_RX_TRG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void MAC_TX_TRG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void MAC_GEN_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void MAC_PORT_TRG_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); + void WIFI_IPC_PUBLIC_IRQHandler_Wrapper(void) __attribute__((weak, alias("Default_IRQHandler"))); #endif const pFunc __Vectors[] __attribute__((section(".init"), aligned(64))) = { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/m0/source/GCC/start_load.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/m0/source/GCC/start_load.c index a4fae67f02..fcae972b98 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/m0/source/GCC/start_load.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/startup/m0/source/GCC/start_load.c @@ -80,13 +80,13 @@ void start_load(void) #ifdef __STARTUP_CLEAR_BSS /* Single BSS section scheme. - * - * The BSS section is specified by following symbols - * __bss_start__: start of the BSS section. - * __bss_end__: end of the BSS section. - * - * Both addresses must be aligned to 4 bytes boundary. - */ + * + * The BSS section is specified by following symbols + * __bss_start__: start of the BSS section. + * __bss_end__: end of the BSS section. + * + * Both addresses must be aligned to 4 bytes boundary. + */ pDest = &__bss_start__; for (; pDest < &__bss_end__;) { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_audio.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_audio.h index 9da40545ec..63b81cd65e 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_audio.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_audio.h @@ -450,8 +450,8 @@ typedef struct { Auido_VAD_IRQ_Source_Type vadIRQSource; /*!< select witch VAD output as final IRQ */ BL_Fun_Type vadNoisyBufferMonitorEnable; /*!< enable or not noisy buffer monitor */ Auido_VAD_NoisyBufferLen_Type vadNoisyBufferLen; /*!< noise buffer length control */ - Auido_VAD_NoisyBufferMonitor_Type vadNoisyBufferMonitor; /*!< this monit function is designed in case that VAD is locked into active state and noise buffer - no longer refreshes itself. this will happen when audio-background-noise suddenly changes from a + Auido_VAD_NoisyBufferMonitor_Type vadNoisyBufferMonitor; /*!< this monit function is designed in case that VAD is locked into active state and noise buffer + no longer refreshes itself. this will happen when audio-background-noise suddenly changes from a relative low level to a much higher one */ uint32_t noisyBufferThr; /*!< vad_noise_th */ uint8_t noisyBufferDiscardNumber; /*!< noise buffer discard number: */ @@ -461,9 +461,9 @@ typedef struct { BL_Fun_Type vadNoisyMaxLimitEnable; /*!< noise threshold max limitation enable signal */ uint16_t vadNoisyMinLimit; /*!< noise threshold min limitation */ BL_Fun_Type vadNoisyMinLimitEnable; /*!< noise threshold min limitation enable signal */ - uint16_t vadSmoothRise; /*!< VAD output debouce, remove the positive pulse whose width is smaller than Register Value, the + uint16_t vadSmoothRise; /*!< VAD output debouce, remove the positive pulse whose width is smaller than Register Value, the real debouce time = Resister Vale * framing-shift */ - uint16_t vadSmoothFall; /*!< VAD output debouce, remove the negative pulse whose width is smaller than Register Value, the + uint16_t vadSmoothFall; /*!< VAD output debouce, remove the negative pulse whose width is smaller than Register Value, the real debouce time = Resister Vale * framing-shift */ } Audio_VAD_Cfg_Type; @@ -491,7 +491,7 @@ typedef struct { uint8_t agc_noise_enter_time_ms; /*!< agc noise enter time //default 0 NORMAL_SILENCE_DEBOUNCE_TIME_MS 0/1/2/4/8/16/32/64/96/128 */ uint8_t agc_noise_exit_time_ms; /*!< agc noise exit time(ms) //default 0 SILENCE_NORMAL_DEBOUNCE_TIME_MS 0/1/2/4/8/16/32/64/96/128 */ uint8_t agc_dbv_settle_time; /*!< agc dbv settle time */ - Audio_AGC_Src_Type agc_src_select; /*!< agc source select 0 ch0 absolute value, 1 ch1 absolute value, 2 ch2 absolute value, 3 maximum + Audio_AGC_Src_Type agc_src_select; /*!< agc source select 0 ch0 absolute value, 1 ch1 absolute value, 2 ch2 absolute value, 3 maximum value of ch0/1/2 */ Audio_AGC_Detect_Mode agc_detect_mode; /*!< 0 detect by peak, 1 detect by average */ uint8_t agc_attack_time; /*!< agc peak filter attack time */ diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_dsp2_misc.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_dsp2_misc.h index 833853c688..2c65e57ecf 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_dsp2_misc.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_dsp2_misc.h @@ -333,7 +333,7 @@ typedef struct { DSP2_MISC_Active_Level_Type hSyncLevel; /*!< Input H-Sync active level */ DSP2_MISC_Active_Level_Type vSyncLevel; /*!< Input V-Sync active level */ DSP2_MISC_2X_Data_Order_Type dataOrder; /*!< Input data order */ - uint16_t fifoThreshold; /*!< Fifo threshold for each DVP line to start to + uint16_t fifoThreshold; /*!< Fifo threshold for each DVP line to start to output,((Width-Fifo_th)*T_in*2)<(Width*T_out)<((Width-Fifo_th)*T_in*2+Blank*T_in) */ }DSP2_MISC_2X_Cfg_Type; diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_uhs_phy.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_uhs_phy.h index cecf66282c..71bb906797 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_uhs_phy.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/inc/bl808_uhs_phy.h @@ -38,9 +38,9 @@ enum { UHS_LATENCY_CODE_200 = 3, //"7" }; -// function call -void uhs_phy_init(uint32_t datarate); +// function call +void uhs_phy_init(uint32_t datarate); void uhs_phy_pwr_down(void); void soft_reset(void); -#endif // __UHS_PHY_H__ \ No newline at end of file +#endif // __UHS_PHY_H__ diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_can.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_can.c index 6e1e001ecc..9690d01f11 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_can.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_can.c @@ -91,7 +91,7 @@ void CAN_Mode_Set(CAN_MODE_Type type, CAN_MODE_VALUE_Type value) /* Set mode value */ tmpVal = BL_RD_REG(CAN_BASE, CAN_MODE); tmpVal &= ~(1 << type); - tmpVal |= (value << type); + tmpVal |= (value << type); /* Write back */ BL_WR_REG(CAN_BASE, CAN_MODE, tmpVal); @@ -244,7 +244,7 @@ BL_Err_Type CAN_Transmit(const CAN_CFG_Type *cfg) uint32_t tmpVal; uint32_t i; volatile uint32_t *pData; - + /* Check the parameters */ CHECK_PARAM(IS_CAN_FRAME_FORMAT_TYPE(cfg->dataAddr)); CHECK_PARAM(IS_CAN_FRAME_TYPE(cfg->frameType)); diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_clock.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_clock.c index 5274d840de..c3bfbd22d3 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_clock.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_clock.c @@ -102,11 +102,11 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_WIFI_PLL_Output(uint32_t case GLB_XTAL_24M: /* 960000000 */ vcoFreq = tmpVal / calculationDiv * 24 * 1000 * 1000; - break; + break; case GLB_XTAL_32M: /* 960000000 */ vcoFreq = tmpVal / calculationDiv * 32 * 1000 * (1000 / 2); - break; + break; case GLB_XTAL_38P4M: /* 960000000 */ vcoFreq = tmpVal / calculationDiv * 384 * 100 * (1000 / 2); @@ -122,7 +122,7 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_WIFI_PLL_Output(uint32_t case GLB_XTAL_RC32M: /* 960000000 */ vcoFreq = tmpVal / calculationDiv * 32 * 1000 * (1000 / 2); - break; + break; default: return (0); } @@ -156,14 +156,14 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_CPU_PLL_Output(uint32_t case GLB_XTAL_24M: /* 480000000;399996000;379998000 */ vcoFreq = 24 * 1000 * tmpVal / calculationDiv * (1000 / 2); - break; + break; case GLB_XTAL_32M: /* 480000000;400000000;380000000 */ vcoFreq = 32 * 1000 * tmpVal / calculationDiv * (1000 / 4); - break; + break; case GLB_XTAL_38P4M: /* 480000000;399998250;379996750 */ - vcoFreq = 384 * 100 * tmpVal / calculationDiv * (1000 / 4); + vcoFreq = 384 * 100 * tmpVal / calculationDiv * (1000 / 4); break; case GLB_XTAL_40M: /* 480000000;400000000;380000000 */ @@ -176,7 +176,7 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_CPU_PLL_Output(uint32_t case GLB_XTAL_RC32M: /* 480000000;400000000;380000000 */ vcoFreq = 32 * 1000 * tmpVal / calculationDiv * (1000 / 4); - break; + break; default: return (0); } @@ -216,14 +216,14 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_AUPLL_Output(CLOCK_AUPLL case GLB_XTAL_24M: /* 442365000;451582000 */ vcoFreq = 24 * 1000 * tmpVal / calculationDiv * (1000 / 2); - break; + break; case GLB_XTAL_32M: /* 442367000;451582000 */ vcoFreq = 32 * 1000 * tmpVal / calculationDiv * (1000 / 4); - break; + break; case GLB_XTAL_38P4M: /* 442364000;451579500; */ - vcoFreq = 384 * 100 * tmpVal / calculationDiv * (1000 / 4); + vcoFreq = 384 * 100 * tmpVal / calculationDiv * (1000 / 4); break; case GLB_XTAL_40M: /* 442368000;451582000 */ @@ -236,7 +236,7 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_AUPLL_Output(CLOCK_AUPLL case GLB_XTAL_RC32M: /* 442367000;451582000 */ vcoFreq = 32 * 1000 * tmpVal / calculationDiv * (1000 / 4); - break; + break; default: return (0); } @@ -285,7 +285,7 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_Audio_PLL_Output() tmpVal = BL_GET_REG_BITS_VAL(BL_RD_REG(CCI_BASE, CCI_AUDIO_PLL_CFG1), CCI_AUPLL_POSTDIV); return Clock_Get_AUPLL_Output(CLOCK_AUPLL_DIV1) / tmpVal; - + } __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_MIPI_PLL_Output() @@ -306,14 +306,14 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_MIPI_PLL_Output() case GLB_XTAL_24M: /* 1500000000 */ vcoFreq = 24 * 1000 * tmpVal / calculationDiv * 1000; - break; + break; case GLB_XTAL_32M: /* 1500000000 */ vcoFreq = 32 * 500 * tmpVal / calculationDiv * (2000 / 2); - break; + break; case GLB_XTAL_38P4M: /* 1500000000 */ - vcoFreq = 384 * 50 * tmpVal / calculationDiv * (2000 / 2); + vcoFreq = 384 * 50 * tmpVal / calculationDiv * (2000 / 2); break; case GLB_XTAL_40M: /* 1500000000 */ @@ -326,7 +326,7 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_MIPI_PLL_Output() case GLB_XTAL_RC32M: /* 1500000000 */ vcoFreq = 32 * 500 * tmpVal / calculationDiv * (2000 / 2); - break; + break; default: return (0); } @@ -360,14 +360,14 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_UHS_PLL_Output() case GLB_XTAL_24M: /* 2299992000;2199996000;2100000000;1999992000;1599996000;1500000000;1399992000;1065996000;799992000;666996000;399996000 */ vcoFreq = 24 * 500 * tmpVal / calculationDiv * 2000; - break; + break; case GLB_XTAL_32M: /* 2300000000;2200000000;2100000000;2000000000;1600000000;1500000000;1400000000;1066000000;800000000;667000000;400000000 */ vcoFreq = 32 * 250 * tmpVal / calculationDiv * (4000 / 2); - break; + break; case GLB_XTAL_38P4M: /* 2299996000;2199992000;2100000000;1999996000;1599992000;1500000000;1399996000;1065992000;799996000;666992000;399992000 */ - vcoFreq = 384 * 25 * tmpVal / calculationDiv * (4000 / 2); + vcoFreq = 384 * 25 * tmpVal / calculationDiv * (4000 / 2); break; case GLB_XTAL_40M: /* 2300000000;2200000000;2100000000;2000000000;1600000000;1500000000;1400000000;1065996000;800000000;666992000;400000000 */ @@ -380,7 +380,7 @@ __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_Get_UHS_PLL_Output() case GLB_XTAL_RC32M: /* 2300000000;2200000000;2100000000;2000000000;1600000000;1500000000;1400000000;1066000000;800000000;667000000;400000000 */ vcoFreq = 32 * 250 * tmpVal / calculationDiv * (4000 / 2); - break; + break; default: return (0); } @@ -1146,7 +1146,7 @@ __UNUSED__ static uint8_t ATTR_CLOCK_SECTION Clock_Get_MIPI_Div_Val(void) } __UNUSED__ static uint32_t ATTR_CLOCK_SECTION Clock_MIPI_Clk_Mux_Output(void) -{ +{ return Clock_Get_MIPI_PLL_Output(); } @@ -1809,7 +1809,7 @@ uint32_t ATTR_CLOCK_SECTION Clock_Peripheral_Clock_Get(BL_Peripheral_Type type) /*!< PSRAMA clock */ case BL_PERIPHERAL_CLOCK_PSRAMA: - return Clock_Get_UHS_PLL_Output(); + return Clock_Get_UHS_PLL_Output(); /*!< PSRAMB clock */ case BL_PERIPHERAL_CLOCK_PSRAMB: diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dma.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dma.c index 9375503143..aae3f9ae22 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dma.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dma.c @@ -692,7 +692,7 @@ void DMA_LLI_PpBuf_Append(DMA_LLI_PP_Buf *dmaPpBuf, DMA_LLI_Ctrl_Type *dmaLliLis if (DMA_Channel_Is_Busy(dmaPpBuf->dmaId, dmaPpBuf->dmaChan) == RESET) { /* DMA stopped: maybe stop just a few minutes ago(not enter INT due to CPU_Interrupt_Disable) - or has already stopped before this function is called */ + or has already stopped before this function is called */ if (dmaPpBuf->lliListHeader[!dmaPpBuf->idleIndex] == NULL) { /* DMA has already stopped before this function is called */ DMA_LLI_PpBuf_Start_New_Transmit(dmaPpBuf); diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsi.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsi.c index db9302df61..cc52e40294 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsi.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsi.c @@ -483,7 +483,7 @@ void DSI_Set_VSA_VFP(DSI_ID_Type dsiId, uint8_t vsa, uint8_t vfp) /* Check the parameters */ CHECK_PARAM(IS_DSI_ID_TYPE(dsiId)); - + tmpVal = BL_RD_REG(DSIx, DSI_CONFIG); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DSI_CR_HSTX_VFP, vfp); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DSI_CR_HSTX_VSA, vsa); @@ -860,7 +860,7 @@ void DSI_PHY_Set_Clock_Lane(DSI_ID_Type dsiId, DSI_Clock_Lane_Opt_Type opt) if (opt & DSI_CLOCK_LANE_OPT_HS_REQ) { tmpVal = BL_SET_REG_BIT(tmpVal, DSI_CL_TXREQUESTHS); } - + if (opt & DSI_CLOCK_LANE_OPT_HS_EXIT) { tmpVal = BL_CLR_REG_BIT(tmpVal, DSI_CL_TXREQUESTHS); } @@ -914,7 +914,7 @@ void DSI_PHY_HS_Mode_Stop(DSI_ID_Type dsiId) uint32_t tmpVal; uint32_t DSIx = dsiAddr[dsiId]; DSI_Lane_State_Type state = 0; - + /* Check the parameters */ CHECK_PARAM(IS_DSI_ID_TYPE(dsiId)); @@ -1015,14 +1015,14 @@ BL_Err_Type DSI_LPDT_Start_Tx(DSI_ID_Type dsiId) /****************************************************************************//** * @brief DSI wait for send done - * + * * @param dsiId: DSI ID type - * + * * @return SUCCESS * *******************************************************************************/ BL_Err_Type DSI_Wait_For_Esc_Tx_Done(DSI_ID_Type dsiId) -{ +{ DSI_INT_Type intStatus; /* wait for Tx finished */ diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2.c index 31201042eb..f2f25f3783 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2.c @@ -372,12 +372,12 @@ void DSP2_Set_TG_Cfg(const DSP2_TG_Cfg_Type *cfg) dsp2_tg_reg->dvp_mode.BF.fhblk_line_on_w = DSP2_FHBLK_LINE_OFF; /* note: if vsync invert, vcnt reset mode set 0, means falling - else if vsync not invert, vcont reset mode set 1, also means falling - this value will not open to user now. - */ + else if vsync not invert, vcont reset mode set 1, also means falling + this value will not open to user now. + */ if (DSP2_SYNC_MODE_INPUT_VBLANK_NO_TOGGLE == cfg->sync_mode_value) { /* hcnt reset in rising edge, so H blanking is put after valid line - vcnt reset mode must be 0, to make sure vcnt is reset to 4095 instead of 0. */ + vcnt reset mode must be 0, to make sure vcnt is reset to 4095 instead of 0. */ dsp2_tg_reg->dvp_mode.BF.hcnt_rst_mode_w = DSP2_HCNT_RST_RISING; dsp2_tg_reg->dvp_mode.BF.vcnt_rst_mode_w = DSP2_VCNT_RST_RISING; } else { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2_misc.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2_misc.c index d9a43dc74a..33e2690c2a 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2_misc.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_dsp2_misc.c @@ -100,12 +100,12 @@ static intCallback_Type *dsp2MiscIntCbfArra[DSP2_MISC_INT_ALL] = { void DSP2_MISC_2X_Init(DSP2_MISC_2X_Cfg_Type *dvp2xCfg) { uint32_t tmpVal; - + /* Check the parameters */ CHECK_PARAM(IS_DSP2_MISC_ACTIVE_LEVEL_TYPE(dvp2xCfg->hSyncLevel)); CHECK_PARAM(IS_DSP2_MISC_ACTIVE_LEVEL_TYPE(dvp2xCfg->vSyncLevel)); CHECK_PARAM(IS_DSP2_MISC_2X_DATA_ORDER_TYPE(dvp2xCfg->dataOrder)); - + tmpVal = BL_RD_REG(DSP2_MISC_BASE, DSP2_MISC_CONFIG); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DSP2_MISC_RG_DVPAS_HS_INV, dvp2xCfg->hSyncLevel); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DSP2_MISC_RG_DVPAS_VS_INV, dvp2xCfg->vSyncLevel); @@ -125,7 +125,7 @@ void DSP2_MISC_2X_Init(DSP2_MISC_2X_Cfg_Type *dvp2xCfg) void DSP2_MISC_2X_Enable(void) { uint32_t tmpVal; - + tmpVal = BL_RD_REG(DSP2_MISC_BASE, DSP2_MISC_CONFIG); BL_WR_REG(DSP2_MISC_BASE, DSP2_MISC_CONFIG, BL_SET_REG_BIT(tmpVal, DSP2_MISC_RG_DVPAS_ENABLE)); } @@ -141,7 +141,7 @@ void DSP2_MISC_2X_Enable(void) void DSP2_MISC_2X_Disable(void) { uint32_t tmpVal; - + tmpVal = BL_RD_REG(DSP2_MISC_BASE, DSP2_MISC_CONFIG); BL_WR_REG(DSP2_MISC_BASE, DSP2_MISC_CONFIG, BL_CLR_REG_BIT(tmpVal, DSP2_MISC_RG_DVPAS_ENABLE)); } @@ -516,10 +516,10 @@ void DSP2_MISC_Scaler_Shadow(DSP2_MISC_Scaler_ID_Type scalerId) { uint32_t tmpVal; uint32_t scalerAddr = DSP2_MISC_BASE + DSP2_MISC_SCALERA_I_SIZE_OFFSET + 8 * scalerId; - + /* Check the parameters */ CHECK_PARAM(IS_DSP2_MISC_SCALER_ID_TYPE(scalerId)); - + tmpVal = BL_RD_WORD(scalerAddr); BL_WR_WORD(scalerAddr, BL_SET_REG_BIT(tmpVal, DSP2_MISC_RG_SCLRA_SW_SH)); } @@ -1216,11 +1216,11 @@ void DSP2_MISC_SEOF_Set_Edge(DSP2_MISC_INT_Type intType, DSP2_MISC_SEOF_Edge_Typ void DSP2_MISC_Reshape_Init(DSP2_MISC_Reshape_Cfg_Type *reshapeCfg) { uint32_t tmpVal; - + /* Check the parameters */ CHECK_PARAM(IS_DSP2_MISC_ACTIVE_LEVEL_TYPE(reshapeCfg->hSyncLevel)); CHECK_PARAM(IS_DSP2_MISC_ACTIVE_LEVEL_TYPE(reshapeCfg->vSyncLevel)); - + tmpVal = BL_RD_REG(DSP2_MISC_BASE, DSP2_MISC_DVP_RESHAPE); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DSP2_MISC_REG_RSHP_TGL_COUNT, reshapeCfg->vsyncNumber & 0x1f); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DSP2_MISC_REG_RSHP_HSYNC_INV, reshapeCfg->hSyncLevel); @@ -1240,7 +1240,7 @@ void DSP2_MISC_Reshape_Init(DSP2_MISC_Reshape_Cfg_Type *reshapeCfg) void DSP2_MISC_Reshape_Counter_Clear(void) { uint32_t tmpVal; - + tmpVal = BL_RD_REG(DSP2_MISC_BASE, DSP2_MISC_DVP_RESHAPE); BL_WR_REG(DSP2_MISC_BASE, DSP2_MISC_DVP_RESHAPE, BL_SET_REG_BIT(tmpVal, DSP2_MISC_REG_RSHP_CLR)); } @@ -1273,7 +1273,7 @@ void DSP2_MISC_DE_As_Hsync(BL_Fun_Type enable) void DSP2_MISC_TSRC_Source_Select(DSP2_MISC_TSRC_Source_Type sourceType) { uint32_t tmpVal; - + tmpVal = BL_RD_REG(DSP2_MISC_BASE, DSP2_MISC_PIX_DATA_CTRL); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, DSP2_MISC_REG_DSP2_DTSRC_SRC, sourceType); BL_WR_REG(DSP2_MISC_BASE, DSP2_MISC_PIX_DATA_CTRL, tmpVal); diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ef_ctrl.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ef_ctrl.c index 0ee328cda8..1a28966881 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ef_ctrl.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ef_ctrl.c @@ -178,7 +178,7 @@ void ATTR_TCM_SECTION EF_Ctrl_Sw_AHB_Clk_1(void) } /* Note:ef_if_ctrl_1 has no EF_CTRL_EF_CLK_SAHB_DATA_SEL_POS bit as ef_if_ctrl_0, - so we select it(them) in ef_if_ctrl_0 */ + so we select it(them) in ef_if_ctrl_0 */ tmpVal = (EF_CTRL_EFUSE_CTRL_PROTECT) | (EF_CTRL_OP_MODE_AUTO << EF_CTRL_EF_IF_0_MANUAL_EN_POS) | (EF_CTRL_PARA_DFT << EF_CTRL_EF_IF_0_CYC_MODIFY_POS) | @@ -267,7 +267,7 @@ void ATTR_TCM_SECTION EF_Ctrl_Program_Efuse_1(void) /* Select auto mode and select ef clock */ /* Note:ef_if_ctrl_1 has no EF_CTRL_EF_CLK_SAHB_DATA_SEL_POS bit as ef_if_ctrl_0, - so we select it(them) in ef_if_ctrl_0 */ + so we select it(them) in ef_if_ctrl_0 */ tmpVal = (EF_CTRL_EFUSE_CTRL_PROTECT) | (EF_CTRL_OP_MODE_AUTO << EF_CTRL_EF_IF_0_MANUAL_EN_POS) | (EF_CTRL_PARA_DFT << EF_CTRL_EF_IF_0_CYC_MODIFY_POS) | @@ -288,7 +288,7 @@ void ATTR_TCM_SECTION EF_Ctrl_Program_Efuse_1(void) /* Program */ /* Note:ef_if_ctrl_1 has no EF_CTRL_EF_CLK_SAHB_DATA_SEL_POS bit as ef_if_ctrl_0, - so we select it(them) in ef_if_ctrl_0 */ + so we select it(them) in ef_if_ctrl_0 */ tmpVal = (EF_CTRL_EFUSE_CTRL_PROTECT) | (EF_CTRL_OP_MODE_AUTO << EF_CTRL_EF_IF_0_MANUAL_EN_POS) | (EF_CTRL_PARA_DFT << EF_CTRL_EF_IF_0_CYC_MODIFY_POS) | @@ -403,7 +403,7 @@ void EF_Ctrl_Load_Efuse_R1(void) /* Trigger read */ /* Note:ef_if_ctrl_1 has no EF_CTRL_EF_CLK_SAHB_DATA_SEL_POS bit as ef_if_ctrl_0, - so we select it(them) in ef_if_ctrl_0 */ + so we select it(them) in ef_if_ctrl_0 */ tmpVal = (EF_CTRL_EFUSE_CTRL_PROTECT) | (EF_CTRL_OP_MODE_AUTO << EF_CTRL_EF_IF_0_MANUAL_EN_POS) | (EF_CTRL_PARA_DFT << EF_CTRL_EF_IF_0_CYC_MODIFY_POS) | @@ -443,7 +443,7 @@ void EF_Ctrl_Load_Efuse_R1(void) /* Switch to AHB clock since often read efuse data after load */ /* Note:ef_if_ctrl_1 has no EF_CTRL_EF_CLK_SAHB_DATA_SEL_POS bit as ef_if_ctrl_0, - so we select it(them) in ef_if_ctrl_0 */ + so we select it(them) in ef_if_ctrl_0 */ tmpVal = (EF_CTRL_EFUSE_CTRL_PROTECT) | (EF_CTRL_OP_MODE_AUTO << EF_CTRL_EF_IF_0_MANUAL_EN_POS) | (EF_CTRL_PARA_DFT << EF_CTRL_EF_IF_0_CYC_MODIFY_POS) | @@ -1328,7 +1328,7 @@ void EF_Ctrl_Write_AES_Key(uint8_t index, uint32_t *keyData, uint32_t len, uint8 uint32_t *pAESKeyStart0 = (uint32_t *)(EF_DATA_BASE + 0x1C); uint32_t *pAESKeyStart1 = (uint32_t *)(EF_DATA_BASE + 0x80); - /* slot_w0~slot_w3,slot_w11 in ef_data0 + /* slot_w0~slot_w3,slot_w11 in ef_data0 slot_w4~slot_w10,in ef_data1 */ if ((index <= 3) || (index == 11)) { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_emac.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_emac.c index 2acaa164bf..8c4a3e62cd 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_emac.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_emac.c @@ -114,7 +114,7 @@ static void EMAC_SetMACAddress(EMAC_ID_Type emacId, uint8_t macAddr[6]) void EMAC_Phy_SetAddress(EMAC_ID_Type emacId, uint16_t phyAddress) { uint32_t tmpVal; - uint32_t EMACx = emacAddr[emacId]; + uint32_t EMACx = emacAddr[emacId]; /* Set Phy Address */ tmpVal = BL_RD_REG(EMACx, EMAC_MIIADDRESS); @@ -134,7 +134,7 @@ void EMAC_Phy_SetAddress(EMAC_ID_Type emacId, uint16_t phyAddress) void EMAC_Phy_Set_Full_Duplex(EMAC_ID_Type emacId, uint8_t fullDuplex) { uint32_t tmpVal; - uint32_t EMACx = emacAddr[emacId]; + uint32_t EMACx = emacAddr[emacId]; /* Set MAC duplex config */ tmpVal = BL_RD_REG(EMACx, EMAC_MODE); @@ -773,7 +773,7 @@ BL_Err_Type EMAC_GetFramLen(EMAC_ID_Type emacId, uint16_t * max, uint16_t *min) BL_Err_Type EMAC_GetBD(EMAC_ID_Type emacId, uint32_t *bd) { uint32_t EMACx = emacAddr[emacId]; - + *bd = BL_RD_REG(EMACx, EMAC_TX_BD_NUM); return SUCCESS; diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb.c index 8e37e4fd40..f93045554b 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb.c @@ -5819,17 +5819,17 @@ BL_Err_Type ATTR_TCM_SECTION GLB_DSP_Image_Sensor_Reset(GLB_DSP_IMAGE_SENSOR_Typ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_WIFI_PLL(GLB_XTAL_Type xtalType, const GLB_WAC_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_WAC_PLL(GLB_WAC_PLL_WIFIPLL); GLB_WAC_PLL_Ref_Clk_Sel(GLB_WAC_PLL_WIFIPLL, refClk); GLB_Power_On_WAC_PLL(GLB_WAC_PLL_WIFIPLL, &(pllCfgList[xtalType]), 1); - + return SUCCESS; } @@ -5845,17 +5845,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_WIFI_PLL(GLB_XTAL_Type xtalType, const BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_AUDIO_PLL(GLB_XTAL_Type xtalType, const GLB_WAC_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_WAC_PLL(GLB_WAC_PLL_AUPLL); GLB_WAC_PLL_Ref_Clk_Sel(GLB_WAC_PLL_AUPLL, refClk); GLB_Power_On_WAC_PLL(GLB_WAC_PLL_AUPLL, &(pllCfgList[xtalType]), 1); - + return SUCCESS; } @@ -5871,17 +5871,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_AUDIO_PLL(GLB_XTAL_Type xtalType, cons BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_CPU_PLL(GLB_XTAL_Type xtalType, const GLB_WAC_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_WAC_PLL(GLB_WAC_PLL_CPUPLL); GLB_WAC_PLL_Ref_Clk_Sel(GLB_WAC_PLL_CPUPLL, refClk); GLB_Power_On_WAC_PLL(GLB_WAC_PLL_CPUPLL, &(pllCfgList[xtalType]), 1); - + return SUCCESS; } @@ -5897,17 +5897,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_CPU_PLL(GLB_XTAL_Type xtalType, const BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_MIPI_PLL(GLB_XTAL_Type xtalType, const GLB_MU_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_MU_PLL(GLB_MU_PLL_MIPIPLL); GLB_MU_PLL_Ref_Clk_Sel(GLB_MU_PLL_MIPIPLL, refClk); GLB_Power_On_MU_PLL(GLB_MU_PLL_MIPIPLL, &(pllCfgList[xtalType]), 1); - + return SUCCESS; } @@ -5924,14 +5924,14 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_MIPI_PLL_Div(uint8_t divEn, uint8_t di { uint32_t REG_PLL_BASE_ADDRESS = 0; uint32_t tmpVal = 0; - + REG_PLL_BASE_ADDRESS = GLB_BASE + GLB_MIPI_PLL_CFG0_OFFSET; - + tmpVal = BL_RD_WORD(REG_PLL_BASE_ADDRESS + 4 * 1); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, GLB_MIPIPLL_EVEN_DIV_EN, divEn); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, GLB_MIPIPLL_EVEN_DIV_RATIO, divRatio); BL_WR_WORD(REG_PLL_BASE_ADDRESS + 4 * 1, tmpVal); - + return SUCCESS; } @@ -5947,17 +5947,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_MIPI_PLL_Div(uint8_t divEn, uint8_t di BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_UHS_PLL(GLB_XTAL_Type xtalType, const GLB_MU_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_MU_PLL(GLB_MU_PLL_UHSPLL); GLB_MU_PLL_Ref_Clk_Sel(GLB_MU_PLL_UHSPLL, refClk); GLB_Power_On_MU_PLL(GLB_MU_PLL_UHSPLL, &(pllCfgList[xtalType]), 1); - + return SUCCESS; } diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb_pll.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb_pll.c index 5294bc8c04..39bc803983 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb_pll.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_glb_pll.c @@ -2377,17 +2377,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Clr_EMI_Reset_Gate(void) BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_WIFI_PLL(GLB_XTAL_Type xtalType, const GLB_WAC_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_WAC_PLL(GLB_WAC_PLL_WIFIPLL); GLB_WAC_PLL_Ref_Clk_Sel(GLB_WAC_PLL_WIFIPLL, refClk); GLB_Power_On_WAC_PLL(GLB_WAC_PLL_WIFIPLL, &(pllCfgList[xtalType]), 0); - + return SUCCESS; } @@ -2403,17 +2403,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_WIFI_PLL(GLB_XTAL_Type xtalType, const BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_AUDIO_PLL(GLB_XTAL_Type xtalType, const GLB_WAC_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_WAC_PLL(GLB_WAC_PLL_AUPLL); GLB_WAC_PLL_Ref_Clk_Sel(GLB_WAC_PLL_AUPLL, refClk); GLB_Power_On_WAC_PLL(GLB_WAC_PLL_AUPLL, &(pllCfgList[xtalType]), 0); - + return SUCCESS; } @@ -2429,17 +2429,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_AUDIO_PLL(GLB_XTAL_Type xtalType, cons BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_CPU_PLL(GLB_XTAL_Type xtalType, const GLB_WAC_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_WAC_PLL(GLB_WAC_PLL_CPUPLL); GLB_WAC_PLL_Ref_Clk_Sel(GLB_WAC_PLL_CPUPLL, refClk); GLB_Power_On_WAC_PLL(GLB_WAC_PLL_CPUPLL, &(pllCfgList[xtalType]), 0); - + return SUCCESS; } @@ -2455,17 +2455,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_CPU_PLL(GLB_XTAL_Type xtalType, const BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_MIPI_PLL(GLB_XTAL_Type xtalType, const GLB_MU_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_MU_PLL(GLB_MU_PLL_MIPIPLL); GLB_MU_PLL_Ref_Clk_Sel(GLB_MU_PLL_MIPIPLL, refClk); GLB_Power_On_MU_PLL(GLB_MU_PLL_MIPIPLL, &(pllCfgList[xtalType]), 0); - + return SUCCESS; } @@ -2482,14 +2482,14 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_MIPI_PLL_Div(uint8_t divEn, uint8_t di { uint32_t REG_PLL_BASE_ADDRESS = 0; uint32_t tmpVal = 0; - + REG_PLL_BASE_ADDRESS = GLB_BASE + GLB_MIPI_PLL_CFG0_OFFSET; - + tmpVal = BL_RD_WORD(REG_PLL_BASE_ADDRESS + 4 * 1); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, GLB_MIPIPLL_EVEN_DIV_EN, divEn); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, GLB_MIPIPLL_EVEN_DIV_RATIO, divRatio); BL_WR_WORD(REG_PLL_BASE_ADDRESS + 4 * 1, tmpVal); - + return SUCCESS; } @@ -2505,17 +2505,17 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_MIPI_PLL_Div(uint8_t divEn, uint8_t di BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_UHS_PLL(GLB_XTAL_Type xtalType, const GLB_MU_PLL_Cfg_Type * pllCfgList) { GLB_PLL_REF_CLK_Type refClk; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_MU_PLL(GLB_MU_PLL_UHSPLL); GLB_MU_PLL_Ref_Clk_Sel(GLB_MU_PLL_UHSPLL, refClk); GLB_Power_On_MU_PLL(GLB_MU_PLL_UHSPLL, &(pllCfgList[xtalType]), 0); - + return SUCCESS; } diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_i2c.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_i2c.c index 3f9c293e50..80319fce62 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_i2c.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_i2c.c @@ -332,7 +332,7 @@ void I2C_Init(I2C_ID_Type i2cNo, I2C_Direction_Type direct, I2C_Transfer_Cfg *cf GLB_PER_Clock_UnGate(GLB_AHB_CLOCK_I2C); } else if (I2C1_ID == i2cNo) { GLB_PER_Clock_UnGate(GLB_AHB_CLOCK_I2C1); - } + } /* I2C write config */ tmpVal = BL_RD_REG(I2Cx, I2C_CONFIG); diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ipc.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ipc.c index 0290919738..952504ab10 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ipc.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_ipc.c @@ -204,7 +204,7 @@ void IPC_M0_Clear_Int_By_Word(uint32_t src) * @brief CPUx trigger IPC interrupt to M0 * * @param src: IPC interrupt source - * + * * @param cpuxOffset: CPU interrupt offset * * @return None diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_iso11898.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_iso11898.c index 4b6653c84d..23fcb419b1 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_iso11898.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_iso11898.c @@ -91,7 +91,7 @@ void ISO11898_Mode_Set(ISO11898_MODE_Type type, ISO11898_MODE_VALUE_Type value) /* Set mode value */ tmpVal = BL_RD_REG(ISO11898_BASE, ISO11898_MODE); tmpVal &= ~(1 << type); - tmpVal |= (value << type); + tmpVal |= (value << type); /* Write back */ BL_WR_REG(ISO11898_BASE, ISO11898_MODE, tmpVal); @@ -244,7 +244,7 @@ BL_Err_Type ISO11898_Transmit(const ISO11898_CFG_Type *cfg) uint32_t tmpVal; uint32_t i; volatile uint32_t *pData; - + /* Check the parameters */ CHECK_PARAM(IS_ISO11898_FRAME_FORMAT_TYPE(cfg->dataAddr)); CHECK_PARAM(IS_ISO11898_FRAME_TYPE(cfg->frameType)); diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_lz4d.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_lz4d.c index 4c4875e1a5..f45b632393 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_lz4d.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_lz4d.c @@ -169,7 +169,7 @@ void LZ4D_Decompress(const void *in, void *out) LZ4DECOMPRESSOR->lz4_src_start.WORD = (uint32_t)(uintptr_t)in; /* TODO: the out region length must be 4-byte aligned: * e.g.: the decompressed length is 33, you have to allocate 36 bytes for it. - * or, the HW will overwrite the RAM space from offset 34 to 36. + * or, the HW will overwrite the RAM space from offset 34 to 36. */ LZ4DECOMPRESSOR->lz4_dst_start.WORD = (uint32_t)(uintptr_t)out; diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_efuse.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_efuse.c index d3cbdd8822..cfce979ae9 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_efuse.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_efuse.c @@ -25,27 +25,27 @@ void mfg_efuse_set_rf_cal_slots(uint8_t slots) uint8_t mfg_efuse_is_macaddr_slot_empty(uint8_t reload) { - uint8_t empty=0; - - + uint8_t empty=0; + + if(rf_cal_slots>=1&&EF_Ctrl_Is_MAC_Address_Slot_Empty(0,reload)){ empty=1; }else if(rf_cal_slots>=2&&EF_Ctrl_Is_MAC_Address_Slot_Empty(1,reload)){ empty=1; }else if(rf_cal_slots>=3&&EF_Ctrl_Is_MAC_Address_Slot_Empty(2,reload)){ empty=1; - }else{ + }else{ } - - + + return empty; } int8_t mfg_efuse_write_macaddr_pre(uint8_t mac[6],uint8_t program) { BL_Err_Type ret=SUCCESS; - uint8_t slot=0xff; - + uint8_t slot=0xff; + if(rf_cal_slots>=1&&EF_Ctrl_Is_MAC_Address_Slot_Empty(0,1)){ slot=0; }else if(rf_cal_slots>=2&&EF_Ctrl_Is_MAC_Address_Slot_Empty(1,1)){ @@ -55,13 +55,13 @@ int8_t mfg_efuse_write_macaddr_pre(uint8_t mac[6],uint8_t program) }else{ mfg_print("No empty slot found\r\n"); } - + if(slot!=0xff){ ret=EF_Ctrl_Write_MAC_Address_Opt(slot,mac,program); mfg_print("Write slot:%d\r\n",slot); } - - + + if(ret==SUCCESS){ return 0; }else{ @@ -70,7 +70,7 @@ int8_t mfg_efuse_write_macaddr_pre(uint8_t mac[6],uint8_t program) } void mfg_efuse_write_macaddr(void) -{ +{ EF_Ctrl_Program_Direct_R0(0,NULL,0); while(SET==EF_Ctrl_Busy()); } @@ -79,8 +79,8 @@ int8_t mfg_efuse_read_macaddr(uint8_t mac[6],uint8_t reload) { uint8_t slot=0xff; BL_Err_Type ret=ERROR; - - + + if(rf_cal_slots>=3&&(!EF_Ctrl_Is_MAC_Address_Slot_Empty(2,reload))){ slot=2; }else if(rf_cal_slots>=2&&(!EF_Ctrl_Is_MAC_Address_Slot_Empty(1,reload))){ @@ -88,15 +88,15 @@ int8_t mfg_efuse_read_macaddr(uint8_t mac[6],uint8_t reload) }else if(rf_cal_slots>=1&&(!EF_Ctrl_Is_MAC_Address_Slot_Empty(0,reload))){ slot=0; } - + if(slot!=0xff){ mfg_print("Read slot:%d\r\n",slot); ret=EF_Ctrl_Read_MAC_Address_Opt(slot,mac,reload); }else{ mfg_print("No written slot found\r\n"); } - - + + if(ret==SUCCESS){ return 0; }else{ diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_flash.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_flash.c index 600b71ac13..907720aa62 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_flash.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_flash.c @@ -45,7 +45,7 @@ int8_t mfg_flash_init( SPI_Flash_Cfg_Type *flashCfg) return -1; } } -#endif +#endif return -1; } @@ -110,7 +110,7 @@ void mfg_flash_write_xtal_capcode(void) } int8_t mfg_flash_read_xtal_capcode(uint8_t *capcode,uint8_t reload) -{ +{ #if 0 if((reload!=0)&&(mfg_flash_read()!=0)){ return -1; @@ -123,7 +123,7 @@ int8_t mfg_flash_read_xtal_capcode(uint8_t *capcode,uint8_t reload) } } } -#endif +#endif return -1; } @@ -142,7 +142,7 @@ int8_t mfg_flash_write_poweroffset_pre(int8_t pwrOffset[14],uint8_t program) }else{ return 0; } -#endif +#endif return 0; } @@ -193,9 +193,9 @@ int8_t mfg_flash_read_poweroffset(int8_t pwrOffset[14],uint8_t reload) } } } -#endif +#endif return -1; - + } int8_t mfg_flash_write_macaddr_pre(uint8_t mac[6],uint8_t program) @@ -235,7 +235,7 @@ int8_t mfg_flash_read_macaddr(uint8_t mac[6],uint8_t reload) } } } -#endif +#endif return -1; } diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_media.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_media.c index 78f34a4362..745c2b91d2 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_media.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mfg_media.c @@ -155,7 +155,7 @@ int8_t mfg_media_read_poweroffset_with_lock(int8_t pwrOffset[14],uint8_t reload) __disable_irq(); ret=mfg_media_read_poweroffset_need_lock(pwrOffset,reload); __enable_irq(); - + return ret; } @@ -187,9 +187,9 @@ int8_t mfg_media_write_macaddr_pre_with_lock(uint8_t mac[6],uint8_t program) int ret; __disable_irq(); - ret=mfg_media_write_macaddr_pre_need_lock(mac,program); + ret=mfg_media_write_macaddr_pre_need_lock(mac,program); __enable_irq(); - + return ret; } @@ -205,7 +205,7 @@ void mfg_media_write_macaddr_need_lock(void) void mfg_media_write_macaddr_with_lock(void) { __disable_irq(); - mfg_media_write_macaddr_need_lock(); + mfg_media_write_macaddr_need_lock(); __enable_irq(); } @@ -223,7 +223,7 @@ int8_t mfg_media_read_macaddr_with_lock(uint8_t mac[6],uint8_t reload) int ret; __disable_irq(); - ret=mfg_media_read_macaddr_need_lock(mac,reload); + ret=mfg_media_read_macaddr_need_lock(mac,reload); __enable_irq(); return ret; diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mjdec.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mjdec.c index 825a3ec617..ca0d7e8dd5 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mjdec.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_mjdec.c @@ -135,7 +135,7 @@ void MJDEC_Init(MJDEC_CFG_Type *cfg) /* align buffer to 16 bytes boundary */ BL_WR_REG(MJDEC_BASE, MJDEC_JDEC_YY_FRAME_ADDR, (cfg->bufferFrameYY + 0xF) & (~0xF)); BL_WR_REG(MJDEC_BASE, MJDEC_JDEC_UV_FRAME_ADDR, (cfg->bufferFrameUV + 0xF) & (~0xF)); - + tmpVal = BL_RD_REG(MJDEC_BASE, MJDEC_JDEC_FRAME_SIZE); switch(cfg->yuv) { @@ -291,7 +291,7 @@ void MJDEC_Pop_Frame(void) void MJDEC_Set_Frame_Threshold(uint8_t count) { uint32_t tmpVal; - + tmpVal = BL_RD_REG(MJDEC_BASE, MJDEC_JDEC_CONTROL_3); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,MJDEC_REG_FRAME_CNT_TRGR_INT,count); BL_WR_REG(MJDEC_BASE,MJDEC_JDEC_CONTROL_3,tmpVal); @@ -388,9 +388,9 @@ void MJDEC_IntMask(MJDEC_INT_Type intType, BL_Mask_Type intMask) void MJDEC_IntClr(MJDEC_INT_Type intType) { uint32_t tmpVal; - + CHECK_PARAM(IS_MJDEC_INT_TYPE(intType)); - + tmpVal = BL_RD_REG(MJDEC_BASE,MJDEC_JDEC_INT_CLR); switch(intType) { @@ -439,7 +439,7 @@ void MJDEC_Int_Callback_Install(MJDEC_INT_Type intType,intCallback_Type* cbFun) void MJDEC_IRQHandler(void) { uint32_t tmpVal; - + tmpVal = BL_RD_REG(MJDEC_BASE,MJDEC_JDEC_CONTROL_3); BL_WR_REG(MJDEC_BASE,MJDEC_JDEC_INT_CLR, 0x1); if( BL_IS_REG_BIT_SET(tmpVal, MJDEC_STS_NORMAL_INT) ){ diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_osd_blend.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_osd_blend.c index e7cab7b558..998c6dddab 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_osd_blend.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_osd_blend.c @@ -134,7 +134,7 @@ BL_Err_Type osd_blend_mem_access_line(osd_blend_reg_t *pblend, uint32_t req_hlen /****************************************************************************** * @brief OSD blend layer force shadow control: - * call this API before DSP2 streaming on to ensure the OSD layer + * call this API before DSP2 streaming on to ensure the OSD layer * is activated even in frame 0. * After calling this API, this OSD blending layer has to be enabled. * diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram.c index 8d69386639..a270b82f07 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram.c @@ -116,7 +116,7 @@ void PSram_Ctrl_Init(PSRAM_ID_Type PSRAM_ID, PSRAM_Ctrl_Cfg_Type *psramCtrlCfg) /* Set vendor and mode for psram controller */ tmpVal = BL_RD_REG(psram_base, PSRAM_CONFIGURE); - // tmpVal = BL_SET_REG_BITS_VAL(tmpVal, PSRAM_REG_PCK_S_DIV, 0x1); + // tmpVal = BL_SET_REG_BITS_VAL(tmpVal, PSRAM_REG_PCK_S_DIV, 0x1); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, PSRAM_REG_VENDOR_SEL, psramCtrlCfg->vendor); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, PSRAM_REG_X16_MODE, psramCtrlCfg->ioMode); BL_WR_REG(psram_base, PSRAM_CONFIGURE, tmpVal); diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram_uhs.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram_uhs.c index 838c9b8565..1b3f6cca84 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram_uhs.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_psram_uhs.c @@ -342,7 +342,7 @@ void Psram_UHS_Init(PSRAM_UHS_Cfg_Type *cfg) tmpVal |= 0x01000000; } BL_WR_REG(PSRAM_UHS_BASE, PSRAM_UHS_UHS_MANUAL, tmpVal); */ - tmpVal = BL_RD_REG(PSRAM_UHS_BASE, PSRAM_UHS_UHS_MANUAL); + tmpVal = BL_RD_REG(PSRAM_UHS_BASE, PSRAM_UHS_UHS_MANUAL); tmpVal &= 0x00ffffff; if (cfg->pck_freq >= 2200) { diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romapi_e907.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romapi_e907.c index c72d6ab20e..7ecfc91620 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romapi_e907.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romapi_e907.c @@ -2533,4 +2533,4 @@ void XIP_SFlash_Opt_Enter(uint8_t *aesEnable){ __ALWAYS_INLINE ATTR_TCM_SECTION void XIP_SFlash_Opt_Exit(uint8_t aesEnable){ return RomDriver_XIP_SFlash_Opt_Exit(aesEnable); -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romdriver_e907.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romdriver_e907.c index 174b77ac7d..f67cc96281 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romdriver_e907.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_romdriver_e907.c @@ -33,7 +33,7 @@ * ****************************************************************************** */ - + #include "bl808_romdriver_e907.h" #include @@ -60,14 +60,14 @@ /** @defgroup ROMDRIVER_Private_Variables * @{ - */ + */ /*@} end of group ROMDRIVER_Private_Variables */ /** @defgroup ROMDRIVER_Global_Variables * @{ - */ - + */ + uint32_t const romDriverTable[]={ 0x08080001, diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sdh.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sdh.c index 8db34aef44..d7ae372553 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sdh.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sdh.c @@ -904,7 +904,7 @@ SDH_Stat_Type SDH_CreateADMA2Descriptor(SDH_ADMA2_Desc_Type *adma2Entries, uint3 } /* Calculate the start entry for multiple descriptor mode, ADMA engine is not stop, so update the descriptor - data address and data size is enough */ + data address and data size is enough */ if (flag == SDH_ADMA_FLAG_MULTI_DESC) { for (i = 0U; i < maxEntries; i++) { if ((adma2Entries[i].attribute & SDH_ADMA2_DESC_FLAG_VALID) == 0U) { @@ -944,7 +944,7 @@ SDH_Stat_Type SDH_CreateADMA2Descriptor(SDH_ADMA2_Desc_Type *adma2Entries, uint3 } /* add a dummy valid ADMA descriptor for multiple descriptor mode, this is useful when transfer boot data, the ADMA - engine will not stop at block gap */ + engine will not stop at block gap */ if (flag == SDH_ADMA_FLAG_MULTI_DESC) { //adma2Entries[startEntries + 1U].attribute |= SDH_ADMA2_DESC_FLAG_TRANSFER; adma2Entries[i - 1U].attribute |= SDH_ADMA2_DESC_FLAG_TRANSFER; @@ -977,7 +977,7 @@ SDH_Stat_Type SDH_SetInternalDmaConfig(SDH_DMA_Cfg_Type *dmaCfg, const uint32_t } /* In simple DMA mode if use auto CMD23, address should load to ADMA addr, - and block count should load to DS_ADDR*/ + and block count should load to DS_ADDR*/ if (enAutoCmd23) { BL_WR_REG(SDH_BASE, SDH_SD_ADMA_SYS_ADDR_1, (uintptr_t)data); } else { @@ -1041,7 +1041,7 @@ SDH_Stat_Type SDH_CreateAdmaEntryConfig(SDH_DMA_Cfg_Type *dmaCfg, SDH_Data_Cfg_T } /* For internal dma, internal DMA configurations should not update the configurations when continous transfer the - * boot data, only the DMA descriptor need update */ + * boot data, only the DMA descriptor need update */ if ((stat == SDH_STAT_SUCCESS) && (dataCfg->dataType != SDH_TRANS_DATA_BOOT_CONT)) { stat = SDH_SetInternalDmaConfig(dmaCfg, data, dataCfg->enableAutoCommand23); } @@ -1109,10 +1109,10 @@ SDH_Stat_Type SDH_TransferBlocking(SDH_DMA_Cfg_Type *dmaCfg, SDH_Trans_Cfg_Type } /* - tmp = BL_RD_REG16(SDH_BASE,SDH_SD_ADMA_ERROR_STATUS); - bflb_platform_printf("SDH_SD_ADMA_ERROR_STATUS->0x%x!\r\n",tmp); - tmp = BL_RD_REG16(SDH_BASE,SDH_SD_AUTO_CMD12_ERROR_STATUS); - */ + tmp = BL_RD_REG16(SDH_BASE,SDH_SD_ADMA_ERROR_STATUS); + bflb_platform_printf("SDH_SD_ADMA_ERROR_STATUS->0x%x!\r\n",tmp); + tmp = BL_RD_REG16(SDH_BASE,SDH_SD_AUTO_CMD12_ERROR_STATUS); + */ /* Wait for transferring data finish */ if ((dataCfg != NULL) && (stat == SDH_STAT_SUCCESS)) { @@ -1173,14 +1173,14 @@ SDH_Stat_Type SDH_TransferNonBlocking(SDH_DMA_Cfg_Type *dmaCfg, SDH_Trans_Cfg_Ty } #if 0 - SDH_SendCommand(cmdCfg); + SDH_SendCommand(cmdCfg); - /* Wait command done */ - if((dataCfg == NULL) || (dataCfg->dataType == SDH_TRANS_DATA_NORMAL)) - { - stat = SDH_WaitCommandDone(cmdCfg); - } + /* Wait command done */ + if((dataCfg == NULL) || (dataCfg->dataType == SDH_TRANS_DATA_NORMAL)) + { + stat = SDH_WaitCommandDone(cmdCfg); + } #endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sf_ctrl.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sf_ctrl.c index 4b2c19429e..086df76f1c 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sf_ctrl.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_sf_ctrl.c @@ -897,51 +897,51 @@ void ATTR_TCM_SECTION SF_Ctrl_AES_Set_Key(uint8_t region, uint8_t *key, SF_Ctrl_ if (keyType == SF_CTRL_AES_128BITS) { i = 4; /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + */ } else if (keyType == SF_CTRL_AES_256BITS) { i = 8; /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + */ } else if (keyType == SF_CTRL_AES_192BITS) { i = 6; /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,__REV(BL_RDWD_FRM_BYTEP(key))); - key+=4; - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,__REV(BL_RDWD_FRM_BYTEP(key))); + key+=4; + */ } tmpVal = SF_CTRL_SF_AES_KEY_7_OFFSET; @@ -1022,50 +1022,50 @@ void ATTR_TCM_SECTION SF_Ctrl_AES_Set_Key_BE(uint8_t region, uint8_t *key, SF_Ct if (keyType == SF_CTRL_AES_128BITS) { i = 4; /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,BL_RDWD_FRM_BYTEP(key)); - key+=4; - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,BL_RDWD_FRM_BYTEP(key)); + key+=4; + */ } else if (keyType == SF_CTRL_AES_256BITS) { i = 8; /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,BL_RDWD_FRM_BYTEP(key)); - key+=4; - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_6,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_7,BL_RDWD_FRM_BYTEP(key)); + key+=4; + */ } else if (keyType == SF_CTRL_AES_192BITS) { i = 6; /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,BL_RDWD_FRM_BYTEP(key)); - key+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,BL_RDWD_FRM_BYTEP(key)); - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_0,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_1,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_2,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_3,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_4,BL_RDWD_FRM_BYTEP(key)); + key+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_KEY_5,BL_RDWD_FRM_BYTEP(key)); + */ } tmpVal = SF_CTRL_SF_AES_KEY_0_OFFSET; @@ -1145,13 +1145,13 @@ void ATTR_TCM_SECTION SF_Ctrl_AES_Set_IV(uint8_t region, uint8_t *iv, uint32_t a } /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W3,__REV(BL_RDWD_FRM_BYTEP(iv))); - iv+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W2,__REV(BL_RDWD_FRM_BYTEP(iv))); - iv+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W1,__REV(BL_RDWD_FRM_BYTEP(iv))); - iv+=4; - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W3,__REV(BL_RDWD_FRM_BYTEP(iv))); + iv+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W2,__REV(BL_RDWD_FRM_BYTEP(iv))); + iv+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W1,__REV(BL_RDWD_FRM_BYTEP(iv))); + iv+=4; + */ BL_WR_REG(regionRegBase, SF_CTRL_SF_AES_IV_W0, addrOffset); iv += 4; } @@ -1219,13 +1219,13 @@ void ATTR_TCM_SECTION SF_Ctrl_AES_Set_IV_BE(uint8_t region, uint8_t *iv, uint32_ } /* - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W0,BL_RDWD_FRM_BYTEP(iv)); - iv+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W1,BL_RDWD_FRM_BYTEP(iv)); - iv+=4; - BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W2,BL_RDWD_FRM_BYTEP(iv)); - iv+=4; - */ + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W0,BL_RDWD_FRM_BYTEP(iv)); + iv+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W1,BL_RDWD_FRM_BYTEP(iv)); + iv+=4; + BL_WR_REG(regionRegBase,SF_CTRL_SF_AES_IV_W2,BL_RDWD_FRM_BYTEP(iv)); + iv+=4; + */ BL_WR_REG(regionRegBase, SF_CTRL_SF_AES_IV_W3, __REV(addrOffset)); iv += 4; } diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_timer.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_timer.c index 0c27913ed4..8d1e6211ea 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_timer.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_timer.c @@ -1133,7 +1133,7 @@ void WDT_IntMask(WDT_ID_Type wdtId, WDT_INT_Type intType, BL_Mask_Type intMask) WDT_ENABLE_ACCESS(TIMERx); /* Deal with watchdog match/interrupt enable register, - WRIE:watchdog reset/interrupt enable */ + WRIE:watchdog reset/interrupt enable */ tmpVal = BL_RD_REG(TIMERx, TIMER_WMER); switch (intType) { @@ -1141,12 +1141,12 @@ void WDT_IntMask(WDT_ID_Type wdtId, WDT_INT_Type intType, BL_Mask_Type intMask) if (intMask == UNMASK) { /* Enable this interrupt */ /* 0 means generates a watchdog interrupt, - a watchdog timer reset is not generated*/ + a watchdog timer reset is not generated*/ BL_WR_REG(TIMERx, TIMER_WMER, BL_CLR_REG_BIT(tmpVal, TIMER_WRIE)); } else { /* Disable this interrupt */ /* 1 means generates a watchdog timer reset, - a watchdog interrupt is not generated*/ + a watchdog interrupt is not generated*/ BL_WR_REG(TIMERx, TIMER_WMER, BL_SET_REG_BIT(tmpVal, TIMER_WRIE)); } diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_uhs_phy.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_uhs_phy.c index 3ac0da747e..6b502dc01d 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_uhs_phy.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/bl808_bsp_driver/std_drv/src/bl808_uhs_phy.c @@ -12,7 +12,7 @@ #define bl808_DBG_RF (0) #if bl808_DBG_RF #define uhs_phy_printf_debug printf // debug mode -#define uhs_phy_printf printf +#define uhs_phy_printf printf #else #define uhs_phy_printf_debug(...) // #define uhs_phy_printf printf // commit it out in release version @@ -41,7 +41,7 @@ void power_up_mm(void) tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PDS_CR_PDS_FORCE_MM_GATE_CLK,0x0); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PDS_CR_PDS_FORCE_MM_MEM_STBY,0x0); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PDS_CR_PDS_FORCE_MM_PDS_RST,0x0); - BL_WR_REG(PDS_BASE,PDS_CTL2,tmpVal); + BL_WR_REG(PDS_BASE,PDS_CTL2,tmpVal); } void power_up_uhspll(void) @@ -53,12 +53,12 @@ void power_up_uhspll(void) tmpVal = BL_SET_REG_BITS_VAL(tmpVal,GLB_PU_UHSPLL,0x1); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,GLB_UHSPLL_FBDV_RSTB,0x0); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,GLB_UHSPLL_FBDV_RSTB,0x1); - BL_WR_REG(GLB_BASE,GLB_UHS_PLL_CFG0,tmpVal); + BL_WR_REG(GLB_BASE,GLB_UHS_PLL_CFG0,tmpVal); } void power_up_ldo12uhs(void) { - // use internal LDO + // use internal LDO uint32_t tmpVal = 0; tmpVal = BL_RD_REG(GLB_BASE,GLB_LDO12UHS); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,GLB_PU_LDO12UHS,0x1); @@ -234,8 +234,8 @@ void set_or_uhs(void) tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQS0N_DLY_RX,0x0); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_28,tmpVal); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_2C); - tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQS1_DLY_RX,0x0); - tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQS1N_DLY_RX,0x0); + tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQS1_DLY_RX,0x0); + tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQS1N_DLY_RX,0x0); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_2C,tmpVal); uhs_phy_delay_us(300); } @@ -281,7 +281,7 @@ void uhs_phy_pwr_down(void) tmpVal = BL_RD_REG(GLB_BASE,GLB_LDO12UHS); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,GLB_PU_UHSPLL_SFREG,0x0); BL_WR_REG(GLB_BASE,GLB_LDO12UHS,tmpVal); - uhs_phy_delay_us(1); + uhs_phy_delay_us(1); } void psram_init(void) @@ -296,7 +296,7 @@ void psram_init(void) uhs_phy_delay_us(1); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_GLBR_PULSE,0x1); - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD,tmpVal); + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD,tmpVal); uhs_phy_delay_us(10); // wait for reg_config_gnt tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_BASIC); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_CONFIG_REQ,0x0); @@ -385,7 +385,7 @@ void set_uhspll_freq(uint32_t datarate) tmpVal = BL_RD_REG(GLB_BASE,GLB_UHS_PLL_CFG0); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, GLB_UHSPLL_FBDV_RSTB, 1); BL_WR_REG(GLB_BASE,GLB_UHS_PLL_CFG0,tmpVal); - + uhs_phy_delay_us(30); } @@ -408,21 +408,21 @@ void set_uhs_phy_init(void) BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_44,0x060f050c); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_50); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_WL_CEN_ANA,0x1); - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_50,tmpVal); -} + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_50,tmpVal); +} void set_uhs_phy(void) { // set phy & controller // latency code=3 (1066MHz) - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,0x0f0a1323); // if fail than use 0x0f391323 + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,0x0f0a1323); // if fail than use 0x0f391323 // BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,0x0f0a0313); //for 400Mbps BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_34,0x0b030404); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_38,0x050e0418); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_3C,0x0a6a1c1c); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_44,0x07110710); - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_50,0x01333333); -} + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_50,0x01333333); +} void uhs_reg_w(uint32_t uhs_latency,uint32_t uhs_drive,uint32_t ma,uint32_t BL_32) { @@ -431,12 +431,12 @@ void uhs_reg_w(uint32_t uhs_latency,uint32_t uhs_drive,uint32_t ma,uint32_t BL_3 { tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_PSRAM_CONFIGURE); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_UHS_LATENCY,uhs_latency); - tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_UHS_DRIVE_ST,uhs_drive); + tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_UHS_DRIVE_ST,uhs_drive); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_PSRAM_CONFIGURE,tmpVal); } else if(ma == 2) { - tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_PSRAM_CONFIGURE); + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_PSRAM_CONFIGURE); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_UHS_BL_64,0x0); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_UHS_BL_32,BL_32); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_UHS_BL_16,0x0); @@ -453,7 +453,7 @@ void uhs_reg_w(uint32_t uhs_latency,uint32_t uhs_drive,uint32_t ma,uint32_t BL_3 if (tmpVal == 1) break; } - + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_REGW_PULSE,0x1); //reg_regw_pulse BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD,tmpVal); @@ -486,7 +486,7 @@ void uhs_reg_r(uint32_t ma) if (tmpVal == 1) break; } - + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_REG_REGR_PULSE,0x1); //reg_regw_pulse BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD,tmpVal); @@ -500,11 +500,11 @@ void uhs_reg_r(uint32_t ma) tmpVal = BL_GET_REG_BITS_VAL(tmpVal,PSRAM_UHS_STS_REGR_DONE); if (tmpVal == 1 || tmpInd == 2){ //debug - if (tmpInd == 2){ + if (tmpInd == 2){ uhs_phy_printf_debug("tmpInd = %ld\r\n",tmpInd); } break; - } + } } tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_BASIC); @@ -546,7 +546,7 @@ void cfg_dq_rx(uint8_t dq){ tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_08); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQ1_DLY_RX,dq); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQ0_DLY_RX,dq); - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_08,tmpVal); + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_08,tmpVal); } void cfg_dqs_rx(uint8_t dqs){ @@ -556,7 +556,7 @@ void cfg_dqs_rx(uint8_t dqs){ BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_28,tmpVal); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_2C); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQS1_DIFF_DLY_RX,dqs); - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_2C,tmpVal); + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_2C,tmpVal); } void cfg_ck_cen_drv(uint8_t array_ck_dly_drv,uint8_t array_cen_dly_drv){ @@ -569,27 +569,27 @@ void cfg_ck_cen_drv(uint8_t array_ck_dly_drv,uint8_t array_cen_dly_drv){ void uhs_reset(uint32_t datarate) { - uint32_t tmpVal = 0; - - tmpVal = BL_RD_WORD(0x30007044); - tmpVal = tmpVal | 0x00008000; - BL_WR_WORD(0x30007044,tmpVal); - uhs_phy_delay_us(10); - tmpVal = tmpVal & 0xFFFF7FFF; - BL_WR_WORD(0x30007044,tmpVal); - - BL_WR_WORD(0x3000F030,0x18090610); - - PSRAM_UHS_Cfg_Type psramCfg = { - datarate, - PSRAM_MEM_SIZE_64MB, - PSRAM_PAGE_SIZE_2KB, - 0, + uint32_t tmpVal = 0; + + tmpVal = BL_RD_WORD(0x30007044); + tmpVal = tmpVal | 0x00008000; + BL_WR_WORD(0x30007044,tmpVal); + uhs_phy_delay_us(10); + tmpVal = tmpVal & 0xFFFF7FFF; + BL_WR_WORD(0x30007044,tmpVal); + + BL_WR_WORD(0x3000F030,0x18090610); + + PSRAM_UHS_Cfg_Type psramCfg = { + datarate, + PSRAM_MEM_SIZE_64MB, + PSRAM_PAGE_SIZE_2KB, + 0, }; - Psram_UHS_Init(&psramCfg); //controller init - + Psram_UHS_Init(&psramCfg); //controller init + set_or_uhs(); - set_uhs_phy(); + set_uhs_phy(); } void reg_read_cal(uint32_t datarate) @@ -619,52 +619,52 @@ void reg_read_cal(uint32_t datarate) tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_ANA,uhs_latency%4); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_DIG,uhs_latency/4); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,tmpVal); - + // sweep dqs cfg_dq_rx(0); for(i = 15; i >= 0; i --) { cfg_dqs_rx(i); - uhs_reg_r(0); - tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround + uhs_reg_r(0); + tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround tmpVal_1 = BL_GET_REG_BITS_VAL(tmpVal_1,PSRAM_UHS_STS_REGR_DONE); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD)>>24; if(tmpVal == ((2<<3)+uhs_latency_code)&& (tmpVal_1 == 1)) { - uhs_phy_printf_debug("reg read pass by dqs=%ld\r\n",i); + uhs_phy_printf_debug("reg read pass by dqs=%ld\r\n",i); reg_dqs = i; dqs_dq_flag = 1; break; - } + } else { uhs_phy_printf_debug("reg read fail by dqs=%ld\r\n",i); } - - tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); - tmpVal = BL_GET_REG_BITS_VAL(tmpVal,PSRAM_UHS_STS_REGR_DONE); - if(tmpVal == 0) - { - uhs_phy_printf_debug("read done not found!!!"); - uhs_reset(datarate); - tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30); - tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_ANA,uhs_latency%4); - tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_DIG,uhs_latency/4); - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,tmpVal); - cfg_dq_rx(0); - } - + + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); + tmpVal = BL_GET_REG_BITS_VAL(tmpVal,PSRAM_UHS_STS_REGR_DONE); + if(tmpVal == 0) + { + uhs_phy_printf_debug("read done not found!!!"); + uhs_reset(datarate); + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30); + tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_ANA,uhs_latency%4); + tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_DIG,uhs_latency/4); + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,tmpVal); + cfg_dq_rx(0); + } + } - // sweep dq + // sweep dq cfg_dqs_rx(0); for(i = 15; i >=0; i --) { cfg_dq_rx(i); uhs_reg_r(0); - tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround + tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround tmpVal_1 = BL_GET_REG_BITS_VAL(tmpVal_1,PSRAM_UHS_STS_REGR_DONE); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD)>>24; if(tmpVal == ((2<<3)+uhs_latency_code)&& (tmpVal_1 == 1)) @@ -672,27 +672,27 @@ void reg_read_cal(uint32_t datarate) uhs_phy_printf_debug("reg read pass by dq=%ld\r\n",i); reg_dq = i; dqs_dq_flag = 1; - break; - } + break; + } else { uhs_phy_printf_debug("reg read fail by dq=%ld\r\n",i); } - - tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); - tmpVal = BL_GET_REG_BITS_VAL(tmpVal,PSRAM_UHS_STS_REGR_DONE); - if(tmpVal == 0) - { - uhs_phy_printf_debug("read done not found!!!"); - uhs_reset(datarate); - tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30); - tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_ANA,uhs_latency%4); - tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_DIG,uhs_latency/4); - BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,tmpVal); - cfg_dqs_rx(0); - } - - } + + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); + tmpVal = BL_GET_REG_BITS_VAL(tmpVal,PSRAM_UHS_STS_REGR_DONE); + if(tmpVal == 0) + { + uhs_phy_printf_debug("read done not found!!!"); + uhs_reset(datarate); + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30); + tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_ANA,uhs_latency%4); + tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_DIG,uhs_latency/4); + BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,tmpVal); + cfg_dqs_rx(0); + } + + } if (dqs_dq_flag == 1){ uhs_latency = uhs_latency - 2; @@ -705,29 +705,29 @@ void reg_read_cal(uint32_t datarate) for(i = 15; i >= 0; i --) { cfg_dqs_rx(i); - uhs_reg_r(0); - tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround + uhs_reg_r(0); + tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround tmpVal_1 = BL_GET_REG_BITS_VAL(tmpVal_1,PSRAM_UHS_STS_REGR_DONE); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD)>>24; if(tmpVal == ((2<<3)+uhs_latency_code)&& (tmpVal_1 == 1)) { - uhs_phy_printf_debug("reg read pass by dqs=%ld\r\n",i); + uhs_phy_printf_debug("reg read pass by dqs=%ld\r\n",i); reg_dqs = i; dqs_dq_flag = 1; - break; - } + break; + } else{ uhs_phy_printf_debug("reg read fail by dqs=%ld\r\n",i); } } - // sweep dq + // sweep dq cfg_dqs_rx(0); for(i = 15; i >=0; i --) { cfg_dq_rx(i); uhs_reg_r(0); - tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround + tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround tmpVal_1 = BL_GET_REG_BITS_VAL(tmpVal_1,PSRAM_UHS_STS_REGR_DONE); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD)>>24; if(tmpVal == ((2<<3)+uhs_latency_code)&& (tmpVal_1 == 1)) @@ -736,26 +736,26 @@ void reg_read_cal(uint32_t datarate) reg_dq = i; dqs_dq_flag = 1; break; - } + } else{ uhs_phy_printf_debug("reg read fail by dq=%ld\r\n",i); } } - + if(reg_dqs > reg_dq) { reg_dqs = (reg_dqs-reg_dq)/2; reg_dq = 0; - } + } else { reg_dq = (reg_dq-reg_dqs)/2; reg_dqs = 0; - } - - // set dqs & dq by register read calibration result + } + + // set dqs & dq by register read calibration result cfg_dqs_rx(reg_dqs); - cfg_dq_rx(reg_dq); + cfg_dq_rx(reg_dq); uhs_reg_r(0); uhs_phy_printf("reg read cal pass, latency=%ld, dqs=%ld, dq=%ld\r\n",uhs_latency,reg_dqs,reg_dq); @@ -828,30 +828,30 @@ void reg_write_cal(void) //only need sweep dqs // sweep1 dqs for(i = 15; i >=0; i --) { - cfg_dqs_drv(i); + cfg_dqs_drv(i); uhs_reg_w(uhs_latency_code,2,2,1); //BL_32 == 1 uhs_reg_r(2); - tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround + tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround tmpVal_1 = BL_GET_REG_BITS_VAL(tmpVal_1,PSRAM_UHS_STS_REGR_DONE); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD)>>24; if((tmpVal == 16) && (tmpVal_1 == 1)) { - uhs_phy_printf("reg write pass by -- dqs1=%ld\r\n",i); + uhs_phy_printf("reg write pass by -- dqs1=%ld\r\n",i); reg_dqs1 = i; dqs_dq_flag = 1; - break; - } + break; + } else{ uhs_phy_printf_debug("reg write fail by -- dqs1=%ld\r\n",i); } - } - // sweep2 dqs + } + // sweep2 dqs for(i = 0; i <=15; i ++) { cfg_dqs_drv(i); uhs_reg_w(uhs_latency_code,2,2,1); //BL_32 == 1 uhs_reg_r(2); - tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround + tmpVal_1 = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD); //high temp failure workaround tmpVal_1 = BL_GET_REG_BITS_VAL(tmpVal_1,PSRAM_UHS_STS_REGR_DONE); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD)>>24; if((tmpVal == 16) && (tmpVal_1 == 1)) @@ -859,12 +859,12 @@ void reg_write_cal(void) //only need sweep dqs uhs_phy_printf("reg write pass by ++ dqs2=%ld\r\n",i); reg_dqs2 = i; dqs_dq_flag = 1; - break; - } + break; + } else{ uhs_phy_printf_debug("reg write fail by ++ dqs2=%ld\r\n",i); } - } + } if(dqs_dq_flag == 0) { @@ -875,9 +875,9 @@ void reg_write_cal(void) //only need sweep dqs }; // break; } - + reg_dqs = (reg_dqs1 + reg_dqs2) / 2 ; - // set dqs by register write cal result + // set dqs by register write cal result cfg_dqs_drv(reg_dqs); uhs_reg_w(uhs_latency_code,2,2,0); //BL_32 == 0 uhs_reg_r(2); @@ -885,7 +885,7 @@ void reg_write_cal(void) //only need sweep dqs if(tmpVal == 0) { uhs_phy_printf("reg write cal pass dqs=%ld, dq=%ld\r\n",reg_dqs,reg_dq); - } + } else{ uhs_phy_printf("reg write cal error 1\r\n"); while(1){ @@ -894,7 +894,7 @@ void reg_write_cal(void) //only need sweep dqs }; // break; } - + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_08); reg_dq = BL_GET_REG_BITS_VAL(tmpVal,PSRAM_UHS_DQ0_DLY_DRV); dqs_dq_delta = 16 + reg_dqs - reg_dq; @@ -914,7 +914,7 @@ void array_write_fix(uint32_t addr,uint32_t len,uint32_t data0,uint32_t data1) data = data0 + i; else data = data1 + i; - BL_WR_WORD(addr_tmp,data); + BL_WR_WORD(addr_tmp,data); } } uint32_t array_read_fix(uint32_t addr,uint32_t len,uint32_t data0,uint32_t data1) @@ -924,7 +924,7 @@ uint32_t array_read_fix(uint32_t addr,uint32_t len,uint32_t data0,uint32_t data1 uint32_t data = data0; uint32_t data_read = 0; int32_t i = 0; - + for(i = 0; i < (len>>2); i ++) { addr_tmp = (i << 2) + addr; @@ -1009,14 +1009,14 @@ void array_read_latency_cal(void) if(flag == 1) { - uhs_phy_printf_debug("array read pass by ck == 11\r\n"); + uhs_phy_printf_debug("array read pass by ck == 11\r\n"); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_ANA,uhs_latency%4); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_DIG,uhs_latency/4); BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,tmpVal); uhs_phy_printf("array read latency cal pass, latency=%ld, ck=%ld\r\n",uhs_latency,array_ck_dly_drv); break; - } + } else { uhs_phy_printf_debug("array read fail by ck == 11\r\n"); @@ -1025,7 +1025,7 @@ void array_read_latency_cal(void) flag = array_read_fix(0x50000000,128,0x12345678,0x87654321); if(flag == 1) { - uhs_phy_printf_debug("array read pass by ck == 4\r\n"); + uhs_phy_printf_debug("array read pass by ck == 4\r\n"); // uhs_latency = uhs_latency - 2; tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30); tmpVal = BL_SET_REG_BITS_VAL(tmpVal,PSRAM_UHS_PHY_RL_ANA,uhs_latency%4); @@ -1033,15 +1033,15 @@ void array_read_latency_cal(void) BL_WR_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_30,tmpVal); uhs_phy_printf("array read latency cal pass, latency=%ld, ck=%ld\r\n",uhs_latency,array_ck_dly_drv); break; - } + } else{ uhs_phy_printf_debug("array read fail by ck == 4\r\n"); } - } + } } } -void array_write_ck_cal(void) +void array_write_ck_cal(void) { uint32_t array_ck_dly_drv = 0; uint32_t array_ck_dly_drv1 = 0; @@ -1053,7 +1053,7 @@ void array_write_ck_cal(void) for(array_ck_dly_drv = 15; array_ck_dly_drv >= 4; array_ck_dly_drv --) { set_ck_dly_drv(array_ck_dly_drv); - + flag = array_read_fix(0x50000000,1024,0x12345678,0x87654321); if(flag == 0){ uhs_phy_printf_debug("array write ck cal fail by ck=%ld\r\n",array_ck_dly_drv); @@ -1073,7 +1073,7 @@ void array_write_ck_cal(void) for(array_ck_dly_drv = 4; array_ck_dly_drv <= 15; array_ck_dly_drv ++) { set_ck_dly_drv(array_ck_dly_drv); - + flag = array_read_fix(0x50000000,1024,0x12345678,0x87654321); if(flag == 0){ uhs_phy_printf_debug("array write ck cal fail by ck=%ld\r\n",array_ck_dly_drv); @@ -1098,10 +1098,10 @@ void array_write_ck_cal(void) else { array_ck_dly_drv = 4; - } - + } + set_ck_dly_drv(array_ck_dly_drv); - + uhs_phy_printf("array write ck cal pass, ck=%ld\r\n",array_ck_dly_drv); } @@ -1124,12 +1124,12 @@ void array_read_dqs_dq_cal(void) dqs_flag = array_read_fix(0x50000000,128,0x12345678,0x87654321); if(dqs_flag == 1) { - uhs_phy_printf_debug("array_read_dqs_dq_cal pass by dqs%ld\r\n",i); + uhs_phy_printf_debug("array_read_dqs_dq_cal pass by dqs%ld\r\n",i); array_dqs = i; - break; + break; } } - // sweep dq + // sweep dq cfg_dqs_rx(0); for(i = 15; i >=0; i --) { @@ -1137,10 +1137,10 @@ void array_read_dqs_dq_cal(void) dq_flag = array_read_fix(0x50000000,128,0x12345678,0x87654321); if(dq_flag == 1) { - uhs_phy_printf_debug("array_read_dqs_dq_cal pass by dq%ld\r\n",i); + uhs_phy_printf_debug("array_read_dqs_dq_cal pass by dq%ld\r\n",i); array_dq = i; - break; - } + break; + } } if(dqs_flag == 0 && dq_flag == 0) { @@ -1176,16 +1176,16 @@ void array_write_dqs_dq_cal(void) uint32_t array_dqs_dly_drv2 = 0; for(i = 15; i >= 0; i --) - { - cfg_dqs_drv(i); + { + cfg_dqs_drv(i); array_write_fix(0x50000000,128,0x12345678,0x87654321); dqs_flag = array_read_fix(0x50000000,128,0x12345678,0x87654321); if(dqs_flag == 1) { uhs_phy_printf("array_write_dqs_dq_cal pass by -- dqs1=%ld\r\n",i); array_dqs_dly_drv1 = i; - break; - } + break; + } else { uhs_phy_printf_debug("array_write_dqs_dq_cal fail by -- dqs1=%ld\r\n",i); @@ -1201,7 +1201,7 @@ void array_write_dqs_dq_cal(void) uhs_phy_printf("array_write_dqs_dq_cal pass by ++ dqs2=%ld\r\n",i); array_dqs_dly_drv2 = i; break; - } + } else { uhs_phy_printf_debug("array_write_dqs_dq_cal fail by ++ dqs2=%ld\r\n",i); @@ -1218,14 +1218,14 @@ void array_write_dqs_dq_cal(void) } array_dqs_dly_drv = (array_dqs_dly_drv1 + array_dqs_dly_drv2) / 2 ; // if ck_dly_drv = 4, fix dqsx_dly_drv to 0 - tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_00); - tmpVal = (tmpVal >> 16) & 0xF; - if(tmpVal == 4) - { - array_dqs_dly_drv = 0; - } + tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_PHY_CFG_00); + tmpVal = (tmpVal >> 16) & 0xF; + if(tmpVal == 4) + { + array_dqs_dly_drv = 0; + } uhs_phy_printf("array_write_dqs_dq_cal pass by array_dqs_dly_drv=%ld\r\n",array_dqs_dly_drv); - // set dqs by register write cal result + // set dqs by register write cal result cfg_dqs_drv(array_dqs_dly_drv); } @@ -1320,22 +1320,22 @@ BL_Err_Type ATTR_CLOCK_SECTION GLB_Config_UHS_PLL_Freq(GLB_XTAL_Type xtalType, u uhsPllCfg[GLB_XTAL_40M].clkpllSdmin = factor; uhsPllCfg[GLB_XTAL_26M].clkpllSdmin = factor; uhsPllCfg[GLB_XTAL_RC32M].clkpllSdmin = factor; - + if (xtalType == GLB_XTAL_RC32M) { refClk = GLB_PLL_REFCLK_RC32M; } else { refClk = GLB_PLL_REFCLK_XTAL; } - + GLB_Power_Off_MU_PLL(GLB_MU_PLL_UHSPLL); GLB_MU_PLL_Ref_Clk_Sel(GLB_MU_PLL_UHSPLL, refClk); GLB_Power_On_MU_PLL(GLB_MU_PLL_UHSPLL, &(uhsPllCfg[xtalType]), 1); - + return SUCCESS; } void self_cal(uint32_t datarate) -{ +{ // int32_t P1= 0; uint32_t tmpVal = 0; // uint32_t uhs_latency = 0; @@ -1363,19 +1363,19 @@ void self_cal(uint32_t datarate) 0, }; - // set to 2000Mbps + // set to 2000Mbps uhs_reg_w(uhs_latency_code,2,0,0); // BL_32 == 0 // set_uhspll_freq(datarate); // use SW function later GLB_Config_UHS_PLL_Freq(GLB_XTAL_40M,datarate); //stuck Psram_UHS_Init(&psramCfg); //controller init set_uhs_phy(); - - // check reg read + + // check reg read uhs_reg_r(0); tmpVal = BL_RD_REG(PSRAM_UHS_BASE,PSRAM_UHS_UHS_CMD)>>24; if(tmpVal == ((2<<3)+uhs_latency_code)){ uhs_phy_printf("register write pass at 1400Mbps and read pass at %ldMbps\r\n",datarate); - } + } else{ uhs_phy_printf("register write fail at 1400Mbps or read fail at %ldMbps\r\n",datarate); } @@ -1386,7 +1386,7 @@ void self_cal(uint32_t datarate) reg_write_cal(); uhs_reg_w(uhs_latency_code,2,2,0); // BL_32 == 0 uhs_reg_r(2); - // array read latency calibration + // array read latency calibration array_read_latency_cal(); // array write ck calibration array_write_ck_cal(); @@ -1409,7 +1409,7 @@ void uhs_phy_init(uint32_t datarate) uhs_phy_printf_debug("uhs phy init\r\n"); power_up_mm(); power_up_uhspll(); - + power_up_ldo12uhs(); set_cen_ck_ckn(); @@ -1440,11 +1440,11 @@ void uhs_phy_init(uint32_t datarate) if(tmpVal == ((2<<3)+1)) // 1400M --> default uhs_latency_code == 1 { uhs_phy_printf_debug("register read pass at datarate at 1400Mbps\r\n"); - } + } else{ uhs_phy_printf_debug("register read fail at datarate at 1400Mbps\r\n"); - } - + } + //get dcache original state __DSB(); __ISB(); @@ -1473,10 +1473,10 @@ void uhs_phy_init(uint32_t datarate) { uhs_phy_printf("dcache disable fail\r\n"); } - + if (dcache_original == (0x1<<1)) - { - csi_dcache_enable(); + { + csi_dcache_enable(); } //get dcache end state @@ -1497,4 +1497,4 @@ void uhs_phy_init(uint32_t datarate) uhs_phy_delay_us(1000); -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/bl_math/arm_dsp_wrapper.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/bl_math/arm_dsp_wrapper.h index 445b22a2c4..45c87cd526 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/bl_math/arm_dsp_wrapper.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/bl_math/arm_dsp_wrapper.h @@ -41,4 +41,4 @@ __INLINE__ float32_t arm_cos_f32(float32_t x) void arm_fill_f32(float32_t value, float32_t *pDst, uint32_t blockSize); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.c index 9842d6ba92..e746501e0c 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.c @@ -291,4 +291,4 @@ int device_set_callback(struct device *dev, void (*callback)(struct device *dev, } return retval; -} \ No newline at end of file +} diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.h index a7a820f0b1..82053757a4 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/device/drv_device.h @@ -132,4 +132,4 @@ int device_write(struct device *dev, uint32_t pos, const void *buffer, uint32_t int device_read(struct device *dev, uint32_t pos, void *buffer, uint32_t size); int device_set_callback(struct device *dev, void (*callback)(struct device *dev, void *args, uint32_t size, uint32_t event)); dlist_t *device_get_list_header(void); -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/list/drv_list.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/list/drv_list.h index c84c8a3f6c..b0b5181d23 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/list/drv_list.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/list/drv_list.h @@ -469,4 +469,4 @@ static inline int slist_isempty(slist_t *l) } #endif -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/memheap/drv_mmheap.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/memheap/drv_mmheap.h index bfe3e56621..42a7187ce6 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/memheap/drv_mmheap.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/memheap/drv_mmheap.h @@ -156,4 +156,4 @@ void mmheap_get_state(struct heap_info *pRoot, struct heap_state *pState); } #endif -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/misc/compiler/gcc.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/misc/compiler/gcc.h index 844dd00d86..b1147c4089 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/misc/compiler/gcc.h +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/misc/compiler/gcc.h @@ -109,4 +109,4 @@ #endif #endif -#endif \ No newline at end of file +#endif diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/soft_crc/softcrc.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/soft_crc/softcrc.c index 4c4cbe55cb..d8380bf752 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/soft_crc/softcrc.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/soft_crc/softcrc.c @@ -171,7 +171,7 @@ uint32_t ATTR_TCM_SECTION BFLB_Soft_CRC32_Ex(uint32_t initial, void *dataIn, uin uint8_t i; uint32_t crc = ~initial; // Initial value uint8_t *data=(uint8_t *)dataIn; - + while(len--){ crc ^= *data++; // crc ^= *data; data++; for (i = 0; i < 8; ++i){ diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.c b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.c index 3454ff47ae..74a5b2cc3a 100644 --- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.c +++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.c @@ -53,25 +53,25 @@ bool check_leap_year(uint16_t year) void cal_weekday(rtc_time *beijing_time) { - uint32_t y,m,d,w; + uint32_t y,m,d,w; - y=beijing_time->year; - m=beijing_time->month; - d=beijing_time->day; + y=beijing_time->year; + m=beijing_time->month; + d=beijing_time->day; - if((m==1)||(m==2)) - { - m+=12; - y--; - } - /* - 把一月和二月看成是上一年的十三月和十四月,例:如果是2004-1-10则换算成:2003-13-10来代入公式计算。 - 以公元元年为参考,公元元年1月1日为星期一
程序如下:
-	利用基姆拉尔森计算日期公式  w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)
-	*/
-	w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7;
+    if((m==1)||(m==2))
+    {
+        m+=12;
+        y--;
+    }
+    /*
+    把一月和二月看成是上一年的十三月和十四月,例:如果是2004-1-10则换算成:2003-13-10来代入公式计算。
+    以公元元年为参考,公元元年1月1日为星期一
程序如下:
+    利用基姆拉尔森计算日期公式  w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)
+    */
+    w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7;
 
-	beijing_time->week=(uint8_t)w;
+    beijing_time->week=(uint8_t)w;
 }
 
 void unixtime2bejingtime(uint32_t unixtime, rtc_time *beijing_time)
@@ -127,10 +127,10 @@ void unixtime2bejingtime(uint32_t unixtime, rtc_time *beijing_time)
 
 
 
-	/*利用基姆拉尔森计算日期公式  w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)*/
+    /*利用基姆拉尔森计算日期公式  w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)*/
 
-	beijing_time->week = beijing_time->day + 2*beijing_time->month + 3*(beijing_time->month+1)/5 + \
-	beijing_time->year + beijing_time->year/4 - beijing_time->year/100 +beijing_time->year/400 ;
+    beijing_time->week = beijing_time->day + 2*beijing_time->month + 3*(beijing_time->month+1)/5 + \
+    beijing_time->year + beijing_time->year/4 - beijing_time->year/100 +beijing_time->year/400 ;
 
-	cal_weekday(beijing_time);
+    cal_weekday(beijing_time);
 }
diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.h b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.h
index dfa95e2d04..5986baf91c 100644
--- a/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.h
+++ b/bsp/bl808/m0/libraries/platform/soc/bl808/bl808_e907_std/common/timestamp/timestamp.h
@@ -29,13 +29,13 @@
 
 typedef struct _rtc_time_t
 {
-	uint16_t year;
-	uint8_t month;
-	uint8_t day;
-	uint8_t week;
-	uint8_t hour;
-	uint8_t minute;
-	uint8_t second;
+    uint16_t year;
+    uint8_t month;
+    uint8_t day;
+    uint8_t week;
+    uint8_t hour;
+    uint8_t minute;
+    uint8_t second;
 }rtc_time;
 
 void unixtime2bejingtime(uint32_t unixtime,rtc_time* beijing_time);
diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/debug.c b/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/debug.c
index 7f26dfb3a8..b8e720f65e 100644
--- a/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/debug.c
+++ b/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/debug.c
@@ -9,178 +9,178 @@
 
 uint32_t debug_uart_id = DEFAULT_UART_ID;
 
-//#define CHAR_BIT	8
+//#define CHAR_BIT  8
 //FIXME no ugly declare
 extern int bl_uart_data_send(uint8_t id, uint8_t data);
 
 volatile bool sys_log_all_enable = true;
 
 enum flag {
-	FL_ZERO		= 0x01,	/* Zero modifier */
-	FL_MINUS	= 0x02,	/* Minus modifier */
-	FL_PLUS		= 0x04,	/* Plus modifier */
-	FL_TICK		= 0x08,	/* ' modifier */
-	FL_SPACE	= 0x10,	/* Space modifier */
-	FL_HASH		= 0x20,	/* # modifier */
-	FL_SIGNED	= 0x40,	/* Number is signed */
-	FL_UPPER	= 0x80	/* Upper case digits */
+    FL_ZERO     = 0x01, /* Zero modifier */
+    FL_MINUS    = 0x02, /* Minus modifier */
+    FL_PLUS     = 0x04, /* Plus modifier */
+    FL_TICK     = 0x08, /* ' modifier */
+    FL_SPACE    = 0x10, /* Space modifier */
+    FL_HASH     = 0x20, /* # modifier */
+    FL_SIGNED   = 0x40, /* Number is signed */
+    FL_UPPER    = 0x80  /* Upper case digits */
 };
 
 /* These may have to be adjusted on certain implementations */
 enum ranks {
-	rank_char	= -2,
-	rank_short	= -1,
-	rank_int	=  0,
-	rank_long	=  1,
-	rank_longlong	=  2
+    rank_char   = -2,
+    rank_short  = -1,
+    rank_int    =  0,
+    rank_long   =  1,
+    rank_longlong   =  2
 };
 
-#define MIN_RANK	rank_char
-#define MAX_RANK	rank_longlong
+#define MIN_RANK    rank_char
+#define MAX_RANK    rank_longlong
 
-#define INTMAX_RANK	rank_longlong
-#define SIZE_T_RANK	rank_long
-#define PTRDIFF_T_RANK	rank_long
+#define INTMAX_RANK rank_longlong
+#define SIZE_T_RANK rank_long
+#define PTRDIFF_T_RANK  rank_long
 
 #define EMIT(x) { if (o < n) { *q++ = (x); } o++; }
 
 void debug_uart_id_set(uint8_t id)
 {
-	debug_uart_id = id;
+    debug_uart_id = id;
 }
 
 static size_t
 format_int(char *q, size_t n, uintmax_t val, unsigned int flags,
-	   int base, int width, int prec)
+       int base, int width, int prec)
 {
-	char *qq;
-	size_t o = 0, oo;
-	static const char lcdigits[] = "0123456789abcdef";
-	static const char ucdigits[] = "0123456789ABCDEF";
-	const char *digits;
-	uintmax_t tmpval;
-	int minus = 0;
-	int ndigits = 0, nchars;
-	int tickskip, b4tick;
+    char *qq;
+    size_t o = 0, oo;
+    static const char lcdigits[] = "0123456789abcdef";
+    static const char ucdigits[] = "0123456789ABCDEF";
+    const char *digits;
+    uintmax_t tmpval;
+    int minus = 0;
+    int ndigits = 0, nchars;
+    int tickskip, b4tick;
 
-	/* Select type of digits */
-	digits = (flags & FL_UPPER) ? ucdigits : lcdigits;
+    /* Select type of digits */
+    digits = (flags & FL_UPPER) ? ucdigits : lcdigits;
 
-	/* If signed, separate out the minus */
-	if (flags & FL_SIGNED && (intmax_t) val < 0) {
-		minus = 1;
-		val = (uintmax_t) (-(intmax_t) val);
-	}
+    /* If signed, separate out the minus */
+    if (flags & FL_SIGNED && (intmax_t) val < 0) {
+        minus = 1;
+        val = (uintmax_t) (-(intmax_t) val);
+    }
 
-	/* Count the number of digits needed.  This returns zero for 0. */
-	tmpval = val;
-	while (tmpval) {
-		tmpval /= base;
-		ndigits++;
-	}
+    /* Count the number of digits needed.  This returns zero for 0. */
+    tmpval = val;
+    while (tmpval) {
+        tmpval /= base;
+        ndigits++;
+    }
 
-	/* Adjust ndigits for size of output */
+    /* Adjust ndigits for size of output */
 
-	if (flags & FL_HASH && base == 8) {
-		if (prec < ndigits + 1)
-			prec = ndigits + 1;
-	}
+    if (flags & FL_HASH && base == 8) {
+        if (prec < ndigits + 1)
+            prec = ndigits + 1;
+    }
 
-	if (ndigits < prec) {
-		ndigits = prec;	/* Mandatory number padding */
-	} else if (val == 0) {
-		ndigits = 1;	/* Zero still requires space */
-	}
+    if (ndigits < prec) {
+        ndigits = prec; /* Mandatory number padding */
+    } else if (val == 0) {
+        ndigits = 1;    /* Zero still requires space */
+    }
 
-	/* For ', figure out what the skip should be */
-	if (flags & FL_TICK) {
-		tickskip = (base == 16) ? 4 : 3;
-	} else {
-		tickskip = ndigits;	/* No tick marks */
-	}
+    /* For ', figure out what the skip should be */
+    if (flags & FL_TICK) {
+        tickskip = (base == 16) ? 4 : 3;
+    } else {
+        tickskip = ndigits; /* No tick marks */
+    }
 
-	/* Tick marks aren't digits, but generated by the number converter */
-	ndigits += (ndigits - 1) / tickskip;
+    /* Tick marks aren't digits, but generated by the number converter */
+    ndigits += (ndigits - 1) / tickskip;
 
-	/* Now compute the number of nondigits */
-	nchars = ndigits;
+    /* Now compute the number of nondigits */
+    nchars = ndigits;
 
-	if (minus || (flags & (FL_PLUS | FL_SPACE)))
-		nchars++;	/* Need space for sign */
-	if ((flags & FL_HASH) && base == 16) {
-		nchars += 2;	/* Add 0x for hex */
-	}
+    if (minus || (flags & (FL_PLUS | FL_SPACE)))
+        nchars++;   /* Need space for sign */
+    if ((flags & FL_HASH) && base == 16) {
+        nchars += 2;    /* Add 0x for hex */
+    }
 
-	/* Emit early space padding */
-	if (!(flags & (FL_MINUS | FL_ZERO)) && width > nchars) {
-		while (width > nchars) {
-			EMIT(' ');
-			width--;
-		}
-	}
+    /* Emit early space padding */
+    if (!(flags & (FL_MINUS | FL_ZERO)) && width > nchars) {
+        while (width > nchars) {
+            EMIT(' ');
+            width--;
+        }
+    }
 
-	/* Emit nondigits */
-	if (minus) {
-		EMIT('-');
-	} else if (flags & FL_PLUS) {
-		EMIT('+');
-	} else if (flags & FL_SPACE) {
-		EMIT(' ');
-	}
+    /* Emit nondigits */
+    if (minus) {
+        EMIT('-');
+    } else if (flags & FL_PLUS) {
+        EMIT('+');
+    } else if (flags & FL_SPACE) {
+        EMIT(' ');
+    }
 
-	if ((flags & FL_HASH) && base == 16) {
-		EMIT('0');
-		EMIT((flags & FL_UPPER) ? 'X' : 'x');
-	}
+    if ((flags & FL_HASH) && base == 16) {
+        EMIT('0');
+        EMIT((flags & FL_UPPER) ? 'X' : 'x');
+    }
 
-	/* Emit zero padding */
-	if ((flags & (FL_MINUS | FL_ZERO)) == FL_ZERO && width > ndigits) {
-		while (width > nchars) {
-			EMIT('0');
-			width--;
-		}
-	}
+    /* Emit zero padding */
+    if ((flags & (FL_MINUS | FL_ZERO)) == FL_ZERO && width > ndigits) {
+        while (width > nchars) {
+            EMIT('0');
+            width--;
+        }
+    }
 
-	/* Generate the number.  This is done from right to left. */
-	q += ndigits;		/* Advance the pointer to end of number */
-	o += ndigits;
-	qq = q;
-	oo = o;			/* Temporary values */
+    /* Generate the number.  This is done from right to left. */
+    q += ndigits;       /* Advance the pointer to end of number */
+    o += ndigits;
+    qq = q;
+    oo = o;         /* Temporary values */
 
-	b4tick = tickskip;
-	while (ndigits > 0) {
-		if (!b4tick--) {
-			qq--;
-			oo--;
-			ndigits--;
-			if (oo < n)
-				*qq = '_';
-			b4tick = tickskip - 1;
-		}
-		qq--;
-		oo--;
-		ndigits--;
-		if (oo < n)
-			*qq = digits[val % base];
-		val /= base;
-	}
+    b4tick = tickskip;
+    while (ndigits > 0) {
+        if (!b4tick--) {
+            qq--;
+            oo--;
+            ndigits--;
+            if (oo < n)
+                *qq = '_';
+            b4tick = tickskip - 1;
+        }
+        qq--;
+        oo--;
+        ndigits--;
+        if (oo < n)
+            *qq = digits[val % base];
+        val /= base;
+    }
 
-	/* Emit late space padding */
-	while ((flags & FL_MINUS) && width > nchars) {
-		EMIT(' ');
-		width--;
-	}
+    /* Emit late space padding */
+    while ((flags & FL_MINUS) && width > nchars) {
+        EMIT(' ');
+        width--;
+    }
 
-	return o;
+    return o;
 }
 
-#define ZEROPAD  	(1<<0)	/* Pad with zero */
-#define SIGN    	(1<<1)	/* Unsigned/signed long */
-#define PLUS    	(1<<2)	/* Show plus */
-#define SPACE   	(1<<3)	/* Spacer */
-#define LEFT    	(1<<4)	/* Left justified */
-#define HEX_PREP 	(1<<5)	/* 0x */
-#define UPPERCASE   (1<<6)	/* 'ABCDEF' */
+#define ZEROPAD     (1<<0)  /* Pad with zero */
+#define SIGN        (1<<1)  /* Unsigned/signed long */
+#define PLUS        (1<<2)  /* Show plus */
+#define SPACE       (1<<3)  /* Spacer */
+#define LEFT        (1<<4)  /* Left justified */
+#define HEX_PREP    (1<<5)  /* 0x */
+#define UPPERCASE   (1<<6)  /* 'ABCDEF' */
 
 #include 
 #define CVTBUFSIZE 80
@@ -204,10 +204,10 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
   arg = modf(arg, &fi);
   p1 = &buf[CVTBUFSIZE];
 
-  if (fi != 0) 
+  if (fi != 0)
   {
     p1 = &buf[CVTBUFSIZE];
-    while (fi != 0) 
+    while (fi != 0)
     {
       fj = modf(fi / 10, &fi);
       *--p1 = (int)((fj + 0.03) * 10) + '0';
@@ -217,7 +217,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
   }
   else if (arg > 0)
   {
-    while ((fj = arg * 10) < 1) 
+    while ((fj = arg * 10) < 1)
     {
       arg = fj;
       r2--;
@@ -226,7 +226,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
   p1 = &buf[ndigits];
   if (eflag == 0) p1 += r2;
   *decpt = r2;
-  if (p1 < &buf[0]) 
+  if (p1 < &buf[0])
   {
     buf[0] = '\0';
     return buf;
@@ -237,7 +237,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
     arg = modf(arg, &fj);
     *p++ = (int) fj + '0';
   }
-  if (p1 >= &buf[CVTBUFSIZE]) 
+  if (p1 >= &buf[CVTBUFSIZE])
   {
     buf[CVTBUFSIZE - 1] = '\0';
     return buf;
@@ -274,12 +274,12 @@ char *fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
   return cvt(arg, ndigits, decpt, sign, buf, 0);
 }
 
-static void ee_bufcpy(char *d, char *s, int count); 
- 
+static void ee_bufcpy(char *d, char *s, int count);
+
 void ee_bufcpy(char *pd, char *ps, int count) {
-	char *pe=ps+count;
-	while (ps!=pe)
-		*pd++=*ps++;
+    char *pe=ps+count;
+    while (ps!=pe)
+        *pd++=*ps++;
 }
 
 static void parse_float(double value, char *buffer, char fmt, int precision)
@@ -397,7 +397,7 @@ static void decimal_point(char *buffer)
   if (*buffer)
   {
     int n = strnlen(buffer,256);
-    while (n > 0) 
+    while (n > 0)
     {
       buffer[n + 1] = buffer[n];
       n--;
@@ -424,7 +424,7 @@ static void cropzeros(char *buffer)
     while (*buffer == '0') buffer--;
     if (*buffer == '.') buffer--;
     while (buffer!=stop)
-		*++buffer=0;
+        *++buffer=0;
   }
 }
 
@@ -487,335 +487,335 @@ static char *flt(char *str, double num, int size, int precision, char fmt, int f
 /*use O0 preventing consuming more stack*/
 int __attribute__((optimize("O1"))) vsnprintf(char *buffer, size_t n, const char *format, va_list ap)
 {
-	const char *p = format;
-	char ch;
-	char *q = buffer;
-	char *tmp;
-	size_t o = 0;		/* Number of characters output */
-	uintmax_t val = 0;
-	int rank = rank_int;	/* Default rank */
-	int width = 0;
-	int prec = -1;
-	int base;
-	size_t sz;
-	unsigned int flags = 0;
-	enum {
-		st_normal,	/* Ground state */
-		st_flags,	/* Special flags */
-		st_width,	/* Field width */
-		st_prec,	/* Field precision */
-		st_modifiers	/* Length or conversion modifiers */
-	} state = st_normal;
-	const char *sarg;	/* %s string argument */
-	char carg;		/* %c char argument */
-	int slen;		/* String length */
+    const char *p = format;
+    char ch;
+    char *q = buffer;
+    char *tmp;
+    size_t o = 0;       /* Number of characters output */
+    uintmax_t val = 0;
+    int rank = rank_int;    /* Default rank */
+    int width = 0;
+    int prec = -1;
+    int base;
+    size_t sz;
+    unsigned int flags = 0;
+    enum {
+        st_normal,  /* Ground state */
+        st_flags,   /* Special flags */
+        st_width,   /* Field width */
+        st_prec,    /* Field precision */
+        st_modifiers    /* Length or conversion modifiers */
+    } state = st_normal;
+    const char *sarg;   /* %s string argument */
+    char carg;      /* %c char argument */
+    int slen;       /* String length */
 
-	while ((ch = *p++)) {
-		switch (state) {
-		case st_normal:
-			if (ch == '%') {
-				state = st_flags;
-				flags = 0;
-				rank = rank_int;
-				width = 0;
-				prec = -1;
-			} else {
-				EMIT(ch);
-			}
-			break;
+    while ((ch = *p++)) {
+        switch (state) {
+        case st_normal:
+            if (ch == '%') {
+                state = st_flags;
+                flags = 0;
+                rank = rank_int;
+                width = 0;
+                prec = -1;
+            } else {
+                EMIT(ch);
+            }
+            break;
 
-		case st_flags:
-			switch (ch) {
-			case '-':
-				flags |= FL_MINUS;
-				break;
-			case '+':
-				flags |= FL_PLUS;
-				break;
-			case '\'':
-				flags |= FL_TICK;
-				break;
-			case ' ':
-				flags |= FL_SPACE;
-				break;
-			case '#':
-				flags |= FL_HASH;
-				break;
-			case '0':
-				flags |= FL_ZERO;
-				break;
-			default:
-				state = st_width;
-				p--;	/* Process this character again */
-				break;
-			}
-			break;
+        case st_flags:
+            switch (ch) {
+            case '-':
+                flags |= FL_MINUS;
+                break;
+            case '+':
+                flags |= FL_PLUS;
+                break;
+            case '\'':
+                flags |= FL_TICK;
+                break;
+            case ' ':
+                flags |= FL_SPACE;
+                break;
+            case '#':
+                flags |= FL_HASH;
+                break;
+            case '0':
+                flags |= FL_ZERO;
+                break;
+            default:
+                state = st_width;
+                p--;    /* Process this character again */
+                break;
+            }
+            break;
 
-		case st_width:
-			if (ch >= '0' && ch <= '9') {
-				width = width * 10 + (ch - '0');
-			} else if (ch == '*') {
-				width = va_arg(ap, int);
-				if (width < 0) {
-					width = -width;
-					flags |= FL_MINUS;
-				}
-			} else if (ch == '.') {
-				prec = 0;	/* Precision given */
-				state = st_prec;
-			} else {
-				state = st_modifiers;
-				p--;	/* Process this character again */
-			}
-			break;
+        case st_width:
+            if (ch >= '0' && ch <= '9') {
+                width = width * 10 + (ch - '0');
+            } else if (ch == '*') {
+                width = va_arg(ap, int);
+                if (width < 0) {
+                    width = -width;
+                    flags |= FL_MINUS;
+                }
+            } else if (ch == '.') {
+                prec = 0;   /* Precision given */
+                state = st_prec;
+            } else {
+                state = st_modifiers;
+                p--;    /* Process this character again */
+            }
+            break;
 
-		case st_prec:
-			if (ch >= '0' && ch <= '9') {
-				prec = prec * 10 + (ch - '0');
-			} else if (ch == '*') {
-				prec = va_arg(ap, int);
-				if (prec < 0)
-					prec = -1;
-			} else {
-				state = st_modifiers;
-				p--;	/* Process this character again */
-			}
-			break;
+        case st_prec:
+            if (ch >= '0' && ch <= '9') {
+                prec = prec * 10 + (ch - '0');
+            } else if (ch == '*') {
+                prec = va_arg(ap, int);
+                if (prec < 0)
+                    prec = -1;
+            } else {
+                state = st_modifiers;
+                p--;    /* Process this character again */
+            }
+            break;
 
-		case st_modifiers:
-			switch (ch) {
-				/* Length modifiers - nonterminal sequences */
-			case 'h':
-				rank--;	/* Shorter rank */
-				break;
-			case 'l':
-				rank++;	/* Longer rank */
-				break;
-			case 'j':
-				rank = INTMAX_RANK;
-				break;
-			case 'z':
-				rank = SIZE_T_RANK;
-				break;
-			case 't':
-				rank = PTRDIFF_T_RANK;
-				break;
-			case 'L':
-			case 'q':
-				rank += 2;
-				break;
-			default:
-				/* Output modifiers - terminal sequences */
+        case st_modifiers:
+            switch (ch) {
+                /* Length modifiers - nonterminal sequences */
+            case 'h':
+                rank--; /* Shorter rank */
+                break;
+            case 'l':
+                rank++; /* Longer rank */
+                break;
+            case 'j':
+                rank = INTMAX_RANK;
+                break;
+            case 'z':
+                rank = SIZE_T_RANK;
+                break;
+            case 't':
+                rank = PTRDIFF_T_RANK;
+                break;
+            case 'L':
+            case 'q':
+                rank += 2;
+                break;
+            default:
+                /* Output modifiers - terminal sequences */
 
-				/* Next state will be normal */
-				state = st_normal;
+                /* Next state will be normal */
+                state = st_normal;
 
-				/* Canonicalize rank */
-				if (rank < MIN_RANK)
-					rank = MIN_RANK;
-				else if (rank > MAX_RANK)
-					rank = MAX_RANK;
+                /* Canonicalize rank */
+                if (rank < MIN_RANK)
+                    rank = MIN_RANK;
+                else if (rank > MAX_RANK)
+                    rank = MAX_RANK;
 
-				switch (ch) {
-				case 'P':	/* Upper case pointer */
-					flags |= FL_UPPER;
+                switch (ch) {
+                case 'P':   /* Upper case pointer */
+                    flags |= FL_UPPER;
                     __attribute__ ((fallthrough));
-					/* fall through */
-				case 'p':	/* Pointer */
-					base = 16;
-					prec = (CHAR_BIT*sizeof(void *)+3)/4;
-					flags |= FL_HASH;
-					val = (uintmax_t)(uintptr_t)
-						va_arg(ap, void *);
-					goto is_integer;
+                    /* fall through */
+                case 'p':   /* Pointer */
+                    base = 16;
+                    prec = (CHAR_BIT*sizeof(void *)+3)/4;
+                    flags |= FL_HASH;
+                    val = (uintmax_t)(uintptr_t)
+                        va_arg(ap, void *);
+                    goto is_integer;
 
-				case 'd':	/* Signed decimal output */
-				case 'i':
-					base = 10;
-					flags |= FL_SIGNED;
-					switch (rank) {
-					case rank_char:
-						/* Yes, all these casts are
-						   needed... */
-						val = (uintmax_t)(intmax_t)
-							(signed char)
-							va_arg(ap, signed int);
-						break;
-					case rank_short:
-						val = (uintmax_t)(intmax_t)
-							(signed short)
-							va_arg(ap, signed int);
-						break;
-					case rank_int:
-						val = (uintmax_t)(intmax_t)
-						    va_arg(ap, signed int);
-						break;
-					case rank_long:
-						val = (uintmax_t)(intmax_t)
-						    va_arg(ap, signed long);
-						break;
-					case rank_longlong:
-						val = (uintmax_t)(intmax_t)
-						    va_arg(ap,
-							   signed long long);
-						break;
-					}
-					goto is_integer;
-				case 'o':	/* Octal */
-					base = 8;
-					goto is_unsigned;
-				case 'u':	/* Unsigned decimal */
-					base = 10;
-					goto is_unsigned;
-				case 'X':	/* Upper case hexadecimal */
-					flags |= FL_UPPER;
+                case 'd':   /* Signed decimal output */
+                case 'i':
+                    base = 10;
+                    flags |= FL_SIGNED;
+                    switch (rank) {
+                    case rank_char:
+                        /* Yes, all these casts are
+                           needed... */
+                        val = (uintmax_t)(intmax_t)
+                            (signed char)
+                            va_arg(ap, signed int);
+                        break;
+                    case rank_short:
+                        val = (uintmax_t)(intmax_t)
+                            (signed short)
+                            va_arg(ap, signed int);
+                        break;
+                    case rank_int:
+                        val = (uintmax_t)(intmax_t)
+                            va_arg(ap, signed int);
+                        break;
+                    case rank_long:
+                        val = (uintmax_t)(intmax_t)
+                            va_arg(ap, signed long);
+                        break;
+                    case rank_longlong:
+                        val = (uintmax_t)(intmax_t)
+                            va_arg(ap,
+                               signed long long);
+                        break;
+                    }
+                    goto is_integer;
+                case 'o':   /* Octal */
+                    base = 8;
+                    goto is_unsigned;
+                case 'u':   /* Unsigned decimal */
+                    base = 10;
+                    goto is_unsigned;
+                case 'X':   /* Upper case hexadecimal */
+                    flags |= FL_UPPER;
                     __attribute__ ((fallthrough));
-					/* fall through */
-				case 'x':	/* Hexadecimal */
-					base = 16;
-					goto is_unsigned;
+                    /* fall through */
+                case 'x':   /* Hexadecimal */
+                    base = 16;
+                    goto is_unsigned;
 
-				is_unsigned:
-					switch (rank) {
-					case rank_char:
-						val = (uintmax_t)
-							(unsigned char)
-							va_arg(ap, unsigned
-							       int);
-						break;
-					case rank_short:
-						val = (uintmax_t)
-							(unsigned short)
-							va_arg(ap, unsigned
-							       int);
-						break;
-					case rank_int:
-						val = (uintmax_t)
-							va_arg(ap, unsigned
-							       int);
-						break;
-					case rank_long:
-						val = (uintmax_t)
-							va_arg(ap, unsigned
-							       long);
-						break;
-					case rank_longlong:
-						val = (uintmax_t)
-							va_arg(ap, unsigned
-							       long long);
-						break;
-					}
-					/* fall through */
+                is_unsigned:
+                    switch (rank) {
+                    case rank_char:
+                        val = (uintmax_t)
+                            (unsigned char)
+                            va_arg(ap, unsigned
+                                   int);
+                        break;
+                    case rank_short:
+                        val = (uintmax_t)
+                            (unsigned short)
+                            va_arg(ap, unsigned
+                                   int);
+                        break;
+                    case rank_int:
+                        val = (uintmax_t)
+                            va_arg(ap, unsigned
+                                   int);
+                        break;
+                    case rank_long:
+                        val = (uintmax_t)
+                            va_arg(ap, unsigned
+                                   long);
+                        break;
+                    case rank_longlong:
+                        val = (uintmax_t)
+                            va_arg(ap, unsigned
+                                   long long);
+                        break;
+                    }
+                    /* fall through */
 
-				is_integer:
-					sz = format_int(q, (o < n) ? n - o : 0,
-							val, flags, base,
-							width, prec);
-					q += sz;
-					o += sz;
-					break;
+                is_integer:
+                    sz = format_int(q, (o < n) ? n - o : 0,
+                            val, flags, base,
+                            width, prec);
+                    q += sz;
+                    o += sz;
+                    break;
 
-				case 'c':	/* Character */
-					carg = (char)va_arg(ap, int);
-					sarg = &carg;
-					slen = 1;
-					goto is_string;
-				case 's':	/* String */
-					sarg = va_arg(ap, const char *);
-					sarg = sarg ? sarg : "(null)";
-					slen = strlen(sarg);
-					goto is_string;
+                case 'c':   /* Character */
+                    carg = (char)va_arg(ap, int);
+                    sarg = &carg;
+                    slen = 1;
+                    goto is_string;
+                case 's':   /* String */
+                    sarg = va_arg(ap, const char *);
+                    sarg = sarg ? sarg : "(null)";
+                    slen = strlen(sarg);
+                    goto is_string;
 
-				is_string:
-					{
-						char sch;
-						int i;
+                is_string:
+                    {
+                        char sch;
+                        int i;
 
-						if (prec != -1 && slen > prec)
-							slen = prec;
+                        if (prec != -1 && slen > prec)
+                            slen = prec;
 
-						if (width > slen
-						    && !(flags & FL_MINUS)) {
-							char pad =
-							    (flags & FL_ZERO) ?
-							    '0' : ' ';
-							while (width > slen) {
-								EMIT(pad);
-								width--;
-							}
-						}
-						for (i = slen; i; i--) {
-							sch = *sarg++;
-							EMIT(sch);
-						}
-						if (width > slen
-						    && (flags & FL_MINUS)) {
-							while (width > slen) {
-								EMIT(' ');
-								width--;
-							}
-						}
-					}
-					break;
+                        if (width > slen
+                            && !(flags & FL_MINUS)) {
+                            char pad =
+                                (flags & FL_ZERO) ?
+                                '0' : ' ';
+                            while (width > slen) {
+                                EMIT(pad);
+                                width--;
+                            }
+                        }
+                        for (i = slen; i; i--) {
+                            sch = *sarg++;
+                            EMIT(sch);
+                        }
+                        if (width > slen
+                            && (flags & FL_MINUS)) {
+                            while (width > slen) {
+                                EMIT(' ');
+                                width--;
+                            }
+                        }
+                    }
+                    break;
 
-				case 'n':
-					{
-						/* Output the number of
-						   characters written */
+                case 'n':
+                    {
+                        /* Output the number of
+                           characters written */
 
-						switch (rank) {
-						case rank_char:
-							*va_arg(ap,
-								signed char *)
-								= o;
-							break;
-						case rank_short:
-							*va_arg(ap,
-								signed short *)
-								= o;
-							break;
-						case rank_int:
-							*va_arg(ap,
-								signed int *)
-								= o;
-							break;
-						case rank_long:
-							*va_arg(ap,
-								signed long *)
-								= o;
-							break;
-						case rank_longlong:
-							*va_arg(ap,
-								signed long long *)
-								= o;
-							break;
-						}
-					}
-					break;
+                        switch (rank) {
+                        case rank_char:
+                            *va_arg(ap,
+                                signed char *)
+                                = o;
+                            break;
+                        case rank_short:
+                            *va_arg(ap,
+                                signed short *)
+                                = o;
+                            break;
+                        case rank_int:
+                            *va_arg(ap,
+                                signed int *)
+                                = o;
+                            break;
+                        case rank_long:
+                            *va_arg(ap,
+                                signed long *)
+                                = o;
+                            break;
+                        case rank_longlong:
+                            *va_arg(ap,
+                                signed long long *)
+                                = o;
+                            break;
+                        }
+                    }
+                    break;
 #ifndef DISABLE_PRINT_FLOAT
-				case 'f':
-					{
-					        tmp = q;
-						q = flt(q, va_arg(ap, double), width, prec, ch, SIGN);
-					        o += q - tmp;
-						continue;
-					}
+                case 'f':
+                    {
+                            tmp = q;
+                        q = flt(q, va_arg(ap, double), width, prec, ch, SIGN);
+                            o += q - tmp;
+                        continue;
+                    }
 #endif
-				default:	/* Anything else, including % */
-					EMIT(ch);
-					break;
-				}
-			}
-		}
-	}
+                default:    /* Anything else, including % */
+                    EMIT(ch);
+                    break;
+                }
+            }
+        }
+    }
 
-	/* Null-terminate the string */
-	if (o < n)
-		*q = '\0';	/* No overflow */
-	else if (n > 0)
-		buffer[n - 1] = '\0';	/* Overflow - terminate at end of buffer */
+    /* Null-terminate the string */
+    if (o < n)
+        *q = '\0';  /* No overflow */
+    else if (n > 0)
+        buffer[n - 1] = '\0';   /* Overflow - terminate at end of buffer */
 
-	return o;
+    return o;
 }
 
 #ifdef SYS_BIG_DEBUG_BUFFER
@@ -826,7 +826,7 @@ static char string[512];
 
 int vsprintf(char *buffer, const char *format, va_list ap)
 {
-	return vsnprintf(buffer, sizeof(string) - 32, format, ap);
+    return vsnprintf(buffer, sizeof(string) - 32, format, ap);
 }
 
 extern volatile bool sys_log_all_enable;
@@ -887,25 +887,25 @@ int printf(const char *fmt, ...)
 
 int sprintf(char *buffer, const char *format, ...)
 {
-	va_list ap;
-	int rv;
+    va_list ap;
+    int rv;
 
-	va_start(ap, format);
-	rv = vsnprintf(buffer, ~(size_t) 0, format, ap);
-	va_end(ap);
+    va_start(ap, format);
+    rv = vsnprintf(buffer, ~(size_t) 0, format, ap);
+    va_end(ap);
 
-	return rv;
+    return rv;
 }
 
 int snprintf(char *buffer, size_t n, const char *format, ...)
 {
-	va_list ap;
-	int rv;
+    va_list ap;
+    int rv;
 
-	va_start(ap, format);
-	rv = vsnprintf(buffer, n, format, ap);
-	va_end(ap);
-	return rv;
+    va_start(ap, format);
+    rv = vsnprintf(buffer, n, format, ap);
+    va_end(ap);
+    return rv;
 }
 
 void vMainUARTPrintString(char *pcString)
diff --git a/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/startup_bl606p.c b/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/startup_bl606p.c
index f87af6e151..524439edc5 100644
--- a/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/startup_bl606p.c
+++ b/bsp/bl808/m0/libraries/platform/soc/bl808/startup_bl808/evb/src/startup_bl606p.c
@@ -125,7 +125,7 @@ void system_init_bl606p(void)
     p = (uint32_t *)(&__bootrom_data_section_end);
     *p = 0x5A5AA5A5;
     /*diable BMX error incase Sbooten=0xf,while user send vector(core) reset and CPU read deadbeef,
-	if not disable this bit, CPU will also get hardfault at the same time*/
+    if not disable this bit, CPU will also get hardfault at the same time*/
     GLB_BMX_TO_Init(&bmxCfg);
     //GLB_BMX_Addr_Monitor_Disable();
 
@@ -150,21 +150,21 @@ void system_init_bl606p(void)
     /* Disable embedded flash power up*/
     //HBN_Set_Embedded_Flash_Pullup(DISABLE);
 #if 0
-	/* disable hardware_pullup_pull_down (reg_en_hw_pu_pd = 0) */
-	tmpVal = BL_RD_REG(HBN_BASE, HBN_IRQ_MODE);
-	tmpVal = BL_CLR_REG_BIT(tmpVal, HBN_REG_EN_HW_PU_PD);
-	BL_WR_REG(HBN_BASE, HBN_IRQ_MODE, tmpVal);
+    /* disable hardware_pullup_pull_down (reg_en_hw_pu_pd = 0) */
+    tmpVal = BL_RD_REG(HBN_BASE, HBN_IRQ_MODE);
+    tmpVal = BL_CLR_REG_BIT(tmpVal, HBN_REG_EN_HW_PU_PD);
+    BL_WR_REG(HBN_BASE, HBN_IRQ_MODE, tmpVal);
 
-	/* Restore default setting*/
-	GLB_UART_Sig_Swap_Set(UART_SIG_SWAP_NONE);
-	GLB_JTAG_Sig_Swap_Set(JTAG_SIG_SWAP_NONE);
+    /* Restore default setting*/
+    GLB_UART_Sig_Swap_Set(UART_SIG_SWAP_NONE);
+    GLB_JTAG_Sig_Swap_Set(JTAG_SIG_SWAP_NONE);
 
-	/*Power up soc 11 power domain,TODO: This should be optional */
-	//AON_Power_On_SOC_11();
-	/* Record LDO18 pu flag before power up. This maybe not neccessary but copy from 606*/
-	//BL_WR_WORD(BFLB_BOOTROM_AP_BOOT_LOG_ADDR,GLB->ldo18io.BF.pu_ldo18io);
-	/* Power up flash power*/
-	//GLB_Power_On_LDO18_IO();
+    /*Power up soc 11 power domain,TODO: This should be optional */
+    //AON_Power_On_SOC_11();
+    /* Record LDO18 pu flag before power up. This maybe not neccessary but copy from 606*/
+    //BL_WR_WORD(BFLB_BOOTROM_AP_BOOT_LOG_ADDR,GLB->ldo18io.BF.pu_ldo18io);
+    /* Power up flash power*/
+    //GLB_Power_On_LDO18_IO();
 
 #endif
 #endif
diff --git a/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_dump.c b/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_dump.c
index 3356eaea05..a352974456 100644
--- a/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_dump.c
+++ b/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_dump.c
@@ -752,15 +752,15 @@ int tc_blfdtdump(void)
     int result;
 
     result = blfdtdump(tc_wifi_dtb, TC_WIFI_DTB_LEN, true, true);
- 
+
     if (result) {
         printf("dump failed\r\n");
     } else {
         printf("dump successed\r\n");
     }
-    
+
     return result;
-   
+
     // blfdtdump(tc_wifi_dtb, TC_WIFI_DTB_LEN, false, true);
     // blfdtdump(tc_wifi_dtb, TC_WIFI_DTB_LEN, false, false);
 }
diff --git a/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_wifi.c b/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_wifi.c
index 4fef123d7c..2fd04af164 100644
--- a/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_wifi.c
+++ b/bsp/bl808/m0/libraries/stage/blfdt/test/tc_blfdt_wifi.c
@@ -220,7 +220,7 @@ static int tc_fdt_wifi_module(void)
         log_error("brd_rf NULL.\r\n");
         return -1;
     }
-    
+
     return 0;
 }
 
@@ -228,12 +228,12 @@ int tc_fdt_wifi(void)
 {
     int result;
     result = tc_fdt_wifi_module();
-    
+
     if (result) {
         printf("fdt wifi module failed\r\n");
     } else {
         printf("fdt wifi module successed\r\n");
     }
-    
+
     return result;
 }
diff --git a/bsp/bl808/m0/libraries/stage/blog/blog.c b/bsp/bl808/m0/libraries/stage/blog/blog.c
index 6cb0587bab..fdbcf2b404 100644
--- a/bsp/bl808/m0/libraries/stage/blog/blog.c
+++ b/bsp/bl808/m0/libraries/stage/blog/blog.c
@@ -161,7 +161,7 @@ void cmd_blog_info_dump(char *buf, int len, int argc, char **argv)
 {
     blog_info_t *info_c, *info_f, *info_p;
     char         name_buf[BLOG_NAMELEN_MAX] = {0};
-    
+
     extern char _ld_bl_static_blogcomponent_code_start;
     extern char _ld_bl_static_blogcomponent_code_end;
     extern char _ld_bl_static_blogfile_code_start;
@@ -183,14 +183,14 @@ void cmd_blog_info_dump(char *buf, int len, int argc, char **argv)
             if (0 == strcmp(name_buf, info_c->name)) {
 #if BLOG_DUMP_DEDUPLICATE
               continue;
-#endif              
+#endif
             } else {
                 memset(name_buf, 0, strlen(name_buf));
             }
         }
-        
+
         __blog_printf("[%-48s] = [%d]\r\n", info_c->name, *(info_c->level));
-        
+
         if ((name_buf[0] != 0) && (strcmp(info_c->name, name_buf) == 0)) {
             continue;
         }
diff --git a/bsp/bl808/m0/libraries/utils/include/utils_fec.h b/bsp/bl808/m0/libraries/utils/include/utils_fec.h
index 030ed901bb..114b332368 100644
--- a/bsp/bl808/m0/libraries/utils/include/utils_fec.h
+++ b/bsp/bl808/m0/libraries/utils/include/utils_fec.h
@@ -38,14 +38,14 @@
 extern "C" {
 #endif
 
-#define FEC_MSG_LENGTH	128
-#define FEC_ECC_LENGTH	126
+#define FEC_MSG_LENGTH  128
+#define FEC_ECC_LENGTH  126
 
 #define bl_assert(expr)
 
 typedef struct
 {
-	int dummy[1120];
+    int dummy[1120];
 } fec_t;
 
 int  reedsolomon_getmemsize(void);
diff --git a/bsp/bl808/m0/libraries/utils/include/utils_getopt.h b/bsp/bl808/m0/libraries/utils/include/utils_getopt.h
index a2dc673bf3..026640e0a3 100644
--- a/bsp/bl808/m0/libraries/utils/include/utils_getopt.h
+++ b/bsp/bl808/m0/libraries/utils/include/utils_getopt.h
@@ -38,7 +38,7 @@ typedef struct getopt_env {
     int optind;      /*!< current index of argv*/
     int opterr;      /*!< non-zero enable error message output, while 0,no error message output*/
     int optopt;      /*!< contain unrecognized option character*/
-    int __optpos;    
+    int __optpos;
 } getopt_env_t;
 
 /**
@@ -47,7 +47,7 @@ typedef struct getopt_env {
  * @param env pointer to struct getopt_env
  * @param opterr set error message output method
  *
- * @return 
+ * @return
  *     -  0: success
  *     - -1: fail
  */
@@ -57,12 +57,12 @@ int utils_getopt_init(getopt_env_t *env, int opterr);
  * @brief Parses the command-line arguments
  *
  * @param env pointer to struct getopt_env
- * @param argc the argument count 
+ * @param argc the argument count
  * @param argv the argument array
  *
- * @return 
+ * @return
  *     -  option character : an option was successfully found
- *     - -1 : all command-line options have been parsed 
+ *     - -1 : all command-line options have been parsed
  *     - '?' : option character was not in optstring
  *     - ':' or '?' : If utils_getopt() encounters an option with a missing argument, then the return value depends on the first character in optstring: if it is ':', then ':' is returned; otherwise '?' is returned
  *
diff --git a/bsp/bl808/m0/libraries/utils/include/utils_list.h b/bsp/bl808/m0/libraries/utils/include/utils_list.h
index e33bbe914a..6248b1b1c2 100644
--- a/bsp/bl808/m0/libraries/utils/include/utils_list.h
+++ b/bsp/bl808/m0/libraries/utils/include/utils_list.h
@@ -433,12 +433,12 @@ static inline int utils_dlist_empty(const utils_dlist_t *head)
  */
 static inline int utils_dlist_entry_number(utils_dlist_t *queue)
 {
-	int num;
-	utils_dlist_t *cur = queue;  
-	for (num=0;cur->next != queue;cur=cur->next, num++)
-		;
-	
-	return num; 
+    int num;
+    utils_dlist_t *cur = queue;
+    for (num=0;cur->next != queue;cur=cur->next, num++)
+        ;
+
+    return num;
 }
 
 
@@ -611,11 +611,11 @@ static inline utils_slist_t* utils_slist_next(utils_slist_t *l)
  */
 static inline int utils_slist_entry_number(utils_slist_t *queue)
 {
-	int num;
-    utils_slist_t *cur = queue;  
+    int num;
+    utils_slist_t *cur = queue;
     for (num=0;cur->next;cur=cur->next, num++)
-		;
-	
-    return num; 
+        ;
+
+    return num;
 }
 #endif
diff --git a/bsp/bl808/m0/libraries/utils/include/utils_time.h b/bsp/bl808/m0/libraries/utils/include/utils_time.h
index ef12f1e272..3c3466c535 100644
--- a/bsp/bl808/m0/libraries/utils/include/utils_time.h
+++ b/bsp/bl808/m0/libraries/utils/include/utils_time.h
@@ -40,7 +40,7 @@ typedef struct {
     unsigned char leap_year_ind;
     unsigned int ntp_year;
     unsigned int days_since_epoch;
-    unsigned int day_of_year; 
+    unsigned int day_of_year;
 } utils_time_date_t;
 
 int utils_time_date_from_epoch(unsigned int epoch, utils_time_date_t *date);
diff --git a/bsp/bl808/m0/libraries/utils/src/test/test_utils_rbtree.c b/bsp/bl808/m0/libraries/utils/src/test/test_utils_rbtree.c
index 7ae8670ade..25c68fe710 100644
--- a/bsp/bl808/m0/libraries/utils/src/test/test_utils_rbtree.c
+++ b/bsp/bl808/m0/libraries/utils/src/test/test_utils_rbtree.c
@@ -36,7 +36,7 @@ struct iovec {
     size_t iov_len;  // [XSI] Size of region iov_base points to
 };
 
-static int my_cmp_cb(struct rb_tree *self, struct rb_node *node_a, struct rb_node *node_b) 
+static int my_cmp_cb(struct rb_tree *self, struct rb_node *node_a, struct rb_node *node_b)
 {
     struct iovec *a = (struct iovec *) node_a->value;
     struct iovec *b = (struct iovec *) node_b->value;
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_crc.c b/bsp/bl808/m0/libraries/utils/src/utils_crc.c
index 1b3e0fa4b1..237bb581b1 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_crc.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_crc.c
@@ -92,81 +92,81 @@ static const uint8_t chCRCLTalbe[] =
 
 uint16_t utils_crc16(void * dataIn, uint32_t len)
 {
-	uint8_t chCRCHi = 0xFF;
-	uint8_t chCRCLo = 0xFF;
-	uint16_t wIndex;
+    uint8_t chCRCHi = 0xFF;
+    uint8_t chCRCLo = 0xFF;
+    uint16_t wIndex;
   uint8_t* data=(uint8_t *) dataIn;
 
-	while (len--)
-	{
-		wIndex = chCRCLo ^ *data++ ;
-		chCRCLo = chCRCHi ^ chCRCHTalbe[wIndex];
-		chCRCHi = chCRCLTalbe[wIndex] ;
-	}
+    while (len--)
+    {
+        wIndex = chCRCLo ^ *data++ ;
+        chCRCLo = chCRCHi ^ chCRCHTalbe[wIndex];
+        chCRCHi = chCRCLTalbe[wIndex] ;
+    }
 
-	return ((chCRCHi << 8) | chCRCLo) ;
+    return ((chCRCHi << 8) | chCRCLo) ;
 }
 
 /*
 x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1
 */
 static const uint32_t crc32Tab[256] = {
-	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
-	0xe963a535, 0x9e6495a3,	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
-	0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
-	0xf3b97148, 0x84be41de,	0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,	0x14015c4f, 0x63066cd9,
-	0xfa0f3d63, 0x8d080df5,	0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
-	0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,	0x35b5a8fa, 0x42b2986c,
-	0xdbbbc9d6, 0xacbcf940,	0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
-	0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
-	0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,	0x76dc4190, 0x01db7106,
-	0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
-	0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
-	0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
-	0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
-	0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
-	0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
-	0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
-	0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
-	0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
-	0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
-	0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
-	0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
-	0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
-	0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
-	0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
-	0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
-	0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
-	0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
-	0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
-	0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
-	0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
-	0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
-	0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
-	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
+    0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
+    0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+    0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
+    0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+    0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+    0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+    0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
+    0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+    0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
+    0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+    0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
+    0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+    0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
+    0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+    0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+    0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+    0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
+    0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+    0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
+    0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
+    0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+    0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
+    0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+    0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+    0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+    0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
+    0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+    0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
+    0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+    0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
+    0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+    0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
+    0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+    0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+    0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+    0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
+    0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+    0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
+    0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
+    0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
+    0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
 };
 
 uint32_t utils_crc32(void *dataIn, uint32_t len)
 {
-	uint32_t crc=0;
+    uint32_t crc=0;
   uint8_t *data=(uint8_t *)dataIn;
 
-	crc = crc ^ 0xffffffff;
+    crc = crc ^ 0xffffffff;
 
-	while (len--)
-		crc = crc32Tab[(crc ^ *data++) & 0xFF] ^ (crc >> 8);
+    while (len--)
+        crc = crc32Tab[(crc ^ *data++) & 0xFF] ^ (crc >> 8);
 
-	return crc ^ 0xffffffff;
+    return crc ^ 0xffffffff;
 }
 
 void utils_crc32_stream_init(struct crc32_stream_ctx *ctx)
@@ -176,13 +176,13 @@ void utils_crc32_stream_init(struct crc32_stream_ctx *ctx)
 
 void utils_crc32_stream_feed(struct crc32_stream_ctx *ctx, uint8_t data)
 {
-	ctx->crc = crc32Tab[(ctx->crc ^ data) & 0xFF] ^ (ctx->crc >> 8);
+    ctx->crc = crc32Tab[(ctx->crc ^ data) & 0xFF] ^ (ctx->crc >> 8);
 }
 
 void utils_crc32_stream_feed_block(struct crc32_stream_ctx *ctx, uint8_t *data, uint32_t len)
 {
   while (len--)
-	  ctx->crc = crc32Tab[(ctx->crc ^ *data++) & 0xFF] ^ (ctx->crc >> 8);
+      ctx->crc = crc32Tab[(ctx->crc ^ *data++) & 0xFF] ^ (ctx->crc >> 8);
 }
 
 uint32_t utils_crc32_stream_results(struct crc32_stream_ctx *ctx)
@@ -197,12 +197,12 @@ uint16_t utils_crc16_ccitt(void *dataIn, uint32_t len)
     uint8_t i;
     uint8_t data;
     uint16_t crc;
-       
+
     crc = 0xFFFF;
-       
+
     if (len == 0)
         return (~crc);
-       
+
     do {
         for (i = 0, data = (unsigned int)0xff & *data_p++;
             i < 8;
@@ -213,11 +213,11 @@ uint16_t utils_crc16_ccitt(void *dataIn, uint32_t len)
             crc >>= 1;
         }
     } while (--len);
-       
+
     crc = ~crc;
-       
+
     data = crc;
-       
+
     return (crc);
 }
 
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_hex.c b/bsp/bl808/m0/libraries/utils/src/utils_hex.c
index 377cebabf2..e403f9e9a2 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_hex.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_hex.c
@@ -45,17 +45,17 @@ static inline char *hex_byte_pack(char *buf, uint8_t byte)
 
 static int char2hex(char c, uint8_t *x)
 {
-	if (c >= '0' && c <= '9') {
-		*x = c - '0';
-	} else if (c >= 'a' && c <= 'f') {
-		*x = c - 'a' + 10;
-	} else if (c >= 'A' && c <= 'F') {
-		*x = c - 'A' + 10;
-	} else {
-		return -1;
-	}
+    if (c >= '0' && c <= '9') {
+        *x = c - '0';
+    } else if (c >= 'a' && c <= 'f') {
+        *x = c - 'a' + 10;
+    } else if (c >= 'A' && c <= 'F') {
+        *x = c - 'A' + 10;
+    } else {
+        return -1;
+    }
 
-	return 0;
+    return 0;
 }
 
 char *utils_bin2hex(char *dst, const void *src, size_t count)
@@ -71,34 +71,34 @@ char *utils_bin2hex(char *dst, const void *src, size_t count)
 
 size_t utils_hex2bin(const char *hex, size_t hexlen, uint8_t *buf, size_t buflen)
 {
-	uint8_t dec;
+    uint8_t dec;
 
-	if (buflen < hexlen / 2 + hexlen % 2) {
-		return 0;
-	}
+    if (buflen < hexlen / 2 + hexlen % 2) {
+        return 0;
+    }
 
-	/* if hexlen is uneven, insert leading zero nibble */
-	if (hexlen % 2) {
-		if (char2hex(hex[0], &dec) < 0) {
-			return 0;
-		}
-		buf[0] = dec;
-		hex++;
-		buf++;
-	}
+    /* if hexlen is uneven, insert leading zero nibble */
+    if (hexlen % 2) {
+        if (char2hex(hex[0], &dec) < 0) {
+            return 0;
+        }
+        buf[0] = dec;
+        hex++;
+        buf++;
+    }
 
-	/* regular hex conversion */
-	for (size_t i = 0; i < hexlen / 2; i++) {
-		if (char2hex(hex[2 * i], &dec) < 0) {
-			return 0;
-		}
-		buf[i] = dec << 4;
+    /* regular hex conversion */
+    for (size_t i = 0; i < hexlen / 2; i++) {
+        if (char2hex(hex[2 * i], &dec) < 0) {
+            return 0;
+        }
+        buf[i] = dec << 4;
 
-		if (char2hex(hex[2 * i + 1], &dec) < 0) {
-			return 0;
-		}
-		buf[i] += dec;
-	}
+        if (char2hex(hex[2 * i + 1], &dec) < 0) {
+            return 0;
+        }
+        buf[i] += dec;
+    }
 
-	return hexlen / 2 + hexlen % 2;
-}
\ No newline at end of file
+    return hexlen / 2 + hexlen % 2;
+}
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_hexdump.c b/bsp/bl808/m0/libraries/utils/src/utils_hexdump.c
index e76e3ca168..0320fbe04b 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_hexdump.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_hexdump.c
@@ -37,7 +37,7 @@
 #endif
 //FIXME fix putchar
 extern int bl_putchar(int c);
- 
+
 void utils_hexdump(void *mem, unsigned int len)
 {
     unsigned int i, j;
@@ -74,4 +74,4 @@ void utils_hexdump(void *mem, unsigned int len)
         }
     }
 }
- 
+
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_md5.c b/bsp/bl808/m0/libraries/utils/src/utils_md5.c
index 00ff1d1a51..a5dd329265 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_md5.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_md5.c
@@ -321,4 +321,4 @@ void utils_md5(const unsigned char *input, size_t ilen, unsigned char output[16]
     utils_md5_free(&ctx);
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_memp.c b/bsp/bl808/m0/libraries/utils/src/utils_memp.c
index 72a0b9ce45..43d56f9ca1 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_memp.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_memp.c
@@ -142,7 +142,7 @@ void *utils_memp_malloc(utils_memp_pool_t *pool)
         pat = (uint32_t *)&node->next;
         *pat = UTILS_MEMP_ALLOCED_NODE_PATTERN;
         return (void *)node + sizeof(struct utils_memp_node);
-    } else { 
+    } else {
         return NULL;
     }
 }
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_rbtree.c b/bsp/bl808/m0/libraries/utils/src/utils_rbtree.c
index 4d3ece3165..4a39ee0091 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_rbtree.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_rbtree.c
@@ -33,12 +33,12 @@
 
 // rb_node
 
-struct rb_node * rb_node_alloc () 
+struct rb_node * rb_node_alloc ()
 {
     return pvPortMalloc(sizeof(struct rb_node));
 }
 
-struct rb_node * rb_node_init (struct rb_node *self, void *value) 
+struct rb_node * rb_node_init (struct rb_node *self, void *value)
 {
     if (self) {
         self->red = 1;
@@ -48,24 +48,24 @@ struct rb_node * rb_node_init (struct rb_node *self, void *value)
     return self;
 }
 
-struct rb_node * rb_node_create (void *value) 
+struct rb_node * rb_node_create (void *value)
 {
     return rb_node_init(rb_node_alloc(), value);
 }
 
-void rb_node_dealloc (struct rb_node *self) 
+void rb_node_dealloc (struct rb_node *self)
 {
     if (self) {
         vPortFree(self);
     }
 }
 
-static int rb_node_is_red (const struct rb_node *self) 
+static int rb_node_is_red (const struct rb_node *self)
 {
     return self ? self->red : 0;
 }
 
-static struct rb_node * rb_node_rotate (struct rb_node *self, int dir) 
+static struct rb_node * rb_node_rotate (struct rb_node *self, int dir)
 {
     struct rb_node *result = NULL;
 
@@ -79,7 +79,7 @@ static struct rb_node * rb_node_rotate (struct rb_node *self, int dir)
     return result;
 }
 
-static struct rb_node * rb_node_rotate2 (struct rb_node *self, int dir) 
+static struct rb_node * rb_node_rotate2 (struct rb_node *self, int dir)
 {
     struct rb_node *result = NULL;
 
@@ -91,12 +91,12 @@ static struct rb_node * rb_node_rotate2 (struct rb_node *self, int dir)
 }
 
 // rb_tree - default callbacks
-int rb_tree_node_cmp_ptr_cb (struct rb_tree *self, struct rb_node *a, struct rb_node *b) 
+int rb_tree_node_cmp_ptr_cb (struct rb_tree *self, struct rb_node *a, struct rb_node *b)
 {
     return (a->value > b->value) - (a->value < b->value);
 }
 
-void rb_tree_node_dealloc_cb (struct rb_tree *self, struct rb_node *node) 
+void rb_tree_node_dealloc_cb (struct rb_tree *self, struct rb_node *node)
 {
     if (self) {
         if (node) {
@@ -106,12 +106,12 @@ void rb_tree_node_dealloc_cb (struct rb_tree *self, struct rb_node *node)
 }
 
 // rb_tree
-struct rb_tree * rb_tree_alloc () 
+struct rb_tree * rb_tree_alloc ()
 {
     return pvPortMalloc(sizeof(struct rb_tree));
 }
 
-struct rb_tree * rb_tree_init (struct rb_tree *self, rb_tree_node_cmp_f node_cmp_cb) 
+struct rb_tree * rb_tree_init (struct rb_tree *self, rb_tree_node_cmp_f node_cmp_cb)
 {
     if (self) {
         self->root = NULL;
@@ -122,18 +122,18 @@ struct rb_tree * rb_tree_init (struct rb_tree *self, rb_tree_node_cmp_f node_cmp
     return self;
 }
 
-struct rb_tree * rb_tree_create (rb_tree_node_cmp_f node_cb) 
+struct rb_tree * rb_tree_create (rb_tree_node_cmp_f node_cb)
 {
     return rb_tree_init(rb_tree_alloc(), node_cb);
 }
 
-void rb_tree_dealloc(struct rb_tree *self, rb_tree_node_f node_cb) 
+void rb_tree_dealloc(struct rb_tree *self, rb_tree_node_f node_cb)
 {
     if (self) {
         if (node_cb) {
             struct rb_node *node = self->root;
             struct rb_node *save = NULL;
-            
+
             // Rotate away the left links so that
             // we can treat this like the destruction
             // of a linked list
@@ -145,7 +145,7 @@ void rb_tree_dealloc(struct rb_tree *self, rb_tree_node_f node_cb)
                     node_cb(self, node);
                     node = NULL;
                 } else {
-                    
+
                     // Rotate away the left link and check again
                     save = node->link[0];
                     node->link[0] = save->link[1];
@@ -158,16 +158,16 @@ void rb_tree_dealloc(struct rb_tree *self, rb_tree_node_f node_cb)
     }
 }
 
-int rb_tree_test(struct rb_tree *self, struct rb_node *root) 
+int rb_tree_test(struct rb_tree *self, struct rb_node *root)
 {
     int lh, rh;
-    
+
     if (NULL == root) {
         return 1;
     } else {
         struct rb_node *ln = root->link[0];
         struct rb_node *rn = root->link[1];
-        
+
         /* Consecutive red links */
         if (rb_node_is_red(root)) {
             if (rb_node_is_red(ln) || rb_node_is_red(rn)) {
@@ -175,10 +175,10 @@ int rb_tree_test(struct rb_tree *self, struct rb_node *root)
                 return 0;
             }
         }
-        
+
         lh = rb_tree_test(self, ln);
         rh = rb_tree_test(self, rn);
-        
+
         /* Invalid binary search tree */
         if ( ( ln != NULL && self->cmp(self, ln, root) >= 0 )
             || ( rn != NULL && self->cmp(self, rn, root) <= 0))
@@ -186,13 +186,13 @@ int rb_tree_test(struct rb_tree *self, struct rb_node *root)
             puts ( "Binary tree violation" );
             return 0;
         }
-        
+
         /* Black height mismatch */
         if ( lh != 0 && rh != 0 && lh != rh ) {
             puts ( "Black violation" );
             return 0;
         }
-        
+
         /* Only count black links */
         if ( lh != 0 && rh != 0 )
             return rb_node_is_red ( root ) ? lh : lh + 1;
@@ -201,7 +201,7 @@ int rb_tree_test(struct rb_tree *self, struct rb_node *root)
     }
 }
 
-void * rb_tree_find(struct rb_tree *self, void *value) 
+void * rb_tree_find(struct rb_tree *self, void *value)
 {
     void *result = NULL;
 
@@ -224,8 +224,8 @@ void * rb_tree_find(struct rb_tree *self, void *value)
     return result;
 }
 
-// Creates (malloc'ates) 
-int rb_tree_insert(struct rb_tree *self, void *value) 
+// Creates (malloc'ates)
+int rb_tree_insert(struct rb_tree *self, void *value)
 {
     struct rb_node *node;
 
@@ -243,7 +243,7 @@ int rb_tree_insert(struct rb_tree *self, void *value)
 }
 
 // Returns 1 on success, 0 otherwise.
-int rb_tree_insert_node (struct rb_tree *self, struct rb_node *node) 
+int rb_tree_insert_node (struct rb_tree *self, struct rb_node *node)
 {
     if (self && node) {
         if (self->root == NULL) {
@@ -266,7 +266,7 @@ int rb_tree_insert_node (struct rb_tree *self, struct rb_node *node)
                     // Insert node at the first null link.
                     p->link[dir] = q = node;
                 } else if (rb_node_is_red(q->link[0]) && rb_node_is_red(q->link[1])) {
-                
+
                     // Simple red violation: color flip
                     q->red = 1;
                     q->link[0]->red = 0;
@@ -283,7 +283,7 @@ int rb_tree_insert_node (struct rb_tree *self, struct rb_node *node)
                         t->link[dir2] = rb_node_rotate2(g, !last);
                     }
                 }
-          
+
                 // Stop working if we inserted a node. This
                 // check also disallows duplicates in the tree
                 if (self->cmp(self, q, node) == 0) {
@@ -312,14 +312,14 @@ int rb_tree_insert_node (struct rb_tree *self, struct rb_node *node)
     } else {
         return 0;
     }
-    
+
     return 1;
 }
 
 // Returns 1 if the value was removed, 0 otherwise. Optional node callback
 // can be provided to dealloc node and/or user data. Use rb_tree_node_dealloc
 // default callback to deallocate node created by rb_tree_insert(...).
-int rb_tree_remove_with_cb (struct rb_tree *self, void *value, rb_tree_node_f node_cb) 
+int rb_tree_remove_with_cb (struct rb_tree *self, void *value, rb_tree_node_f node_cb)
 {
     if (self->root != NULL) {
         struct rb_node head = {0}; // False tree root
@@ -332,7 +332,7 @@ int rb_tree_remove_with_cb (struct rb_tree *self, void *value, rb_tree_node_f no
         q = &head;
         g = p = NULL;
         q->link[1] = self->root;
-    
+
         // Search and push a red node down
         // to fix red violations as we go
         while (q->link[dir] != NULL) {
@@ -342,7 +342,7 @@ int rb_tree_remove_with_cb (struct rb_tree *self, void *value, rb_tree_node_f no
             g = p, p = q;
             q = q->link[dir];
             dir = self->cmp(self, q, &node) < 0;
-      
+
             // Save the node with matching value and keep
             // going; we'll do removal tasks at the end
             if (self->cmp(self, q, &node) == 0) {
@@ -369,7 +369,7 @@ int rb_tree_remove_with_cb (struct rb_tree *self, void *value, rb_tree_node_f no
                             } else if (rb_node_is_red(s->link[!last])) {
                                 g->link[dir2] = rb_node_rotate(p, last);
                             }
-                            
+
                             // Ensure correct coloring
                             q->red = g->link[dir2]->red = 1;
                             g->link[dir2]->link[0]->red = 0;
@@ -385,9 +385,9 @@ int rb_tree_remove_with_cb (struct rb_tree *self, void *value, rb_tree_node_f no
             void *tmp = f->value;
             f->value = q->value;
             q->value = tmp;
-            
+
             p->link[p->link[1] == q] = q->link[q->link[0] == NULL];
-            
+
             if (node_cb) {
                 node_cb(self, q);
             }
@@ -407,7 +407,7 @@ int rb_tree_remove_with_cb (struct rb_tree *self, void *value, rb_tree_node_f no
     return 1;
 }
 
-int rb_tree_remove (struct rb_tree *self, void *value) 
+int rb_tree_remove (struct rb_tree *self, void *value)
 {
     int result = 0;
 
@@ -417,7 +417,7 @@ int rb_tree_remove (struct rb_tree *self, void *value)
     return result;
 }
 
-size_t rb_tree_size (struct rb_tree *self) 
+size_t rb_tree_size (struct rb_tree *self)
 {
     size_t result = 0;
 
@@ -428,12 +428,12 @@ size_t rb_tree_size (struct rb_tree *self)
 }
 
 // rb_iter
-struct rb_iter * rb_iter_alloc () 
+struct rb_iter * rb_iter_alloc ()
 {
     return pvPortMalloc(sizeof(struct rb_iter));
 }
 
-struct rb_iter * rb_iter_init (struct rb_iter *self) 
+struct rb_iter * rb_iter_init (struct rb_iter *self)
 {
     if (self) {
         self->tree = NULL;
@@ -443,12 +443,12 @@ struct rb_iter * rb_iter_init (struct rb_iter *self)
     return self;
 }
 
-struct rb_iter * rb_iter_create () 
+struct rb_iter * rb_iter_create ()
 {
     return rb_iter_init(rb_iter_alloc());
 }
 
-void rb_iter_dealloc (struct rb_iter *self) 
+void rb_iter_dealloc (struct rb_iter *self)
 {
     if (self) {
         vPortFree(self);
@@ -457,7 +457,7 @@ void rb_iter_dealloc (struct rb_iter *self)
 
 // Internal function, init traversal object, dir determines whether
 // to begin traversal at the smallest or largest valued node.
-static void * rb_iter_start (struct rb_iter *self, struct rb_tree *tree, int dir) 
+static void * rb_iter_start (struct rb_iter *self, struct rb_tree *tree, int dir)
 {
     void *result = NULL;
 
@@ -480,7 +480,7 @@ static void * rb_iter_start (struct rb_iter *self, struct rb_tree *tree, int dir
 }
 
 // Traverse a red black tree in the user-specified direction (0 asc, 1 desc)
-static void * rb_iter_move(struct rb_iter *self, int dir) 
+static void * rb_iter_move(struct rb_iter *self, int dir)
 {
     if (self->node->link[dir] != NULL) {
         // Continue down this branch
@@ -505,12 +505,12 @@ static void * rb_iter_move(struct rb_iter *self, int dir)
     return self->node == NULL ? NULL : self->node->value;
 }
 
-void *rb_iter_first(struct rb_iter *self, struct rb_tree *tree) 
+void *rb_iter_first(struct rb_iter *self, struct rb_tree *tree)
 {
     return rb_iter_start(self, tree, 0);
 }
 
-void * rb_iter_last(struct rb_iter *self, struct rb_tree *tree) 
+void * rb_iter_last(struct rb_iter *self, struct rb_tree *tree)
 {
     return rb_iter_start(self, tree, 1);
 }
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_sha1.c b/bsp/bl808/m0/libraries/utils/src/utils_sha1.c
index fca165c917..74b50940fe 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_sha1.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_sha1.c
@@ -352,4 +352,4 @@ void utils_sha1(const unsigned char *input, size_t ilen, unsigned char output[20
     utils_sha1_free(&ctx);
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_string.c b/bsp/bl808/m0/libraries/utils/src/utils_string.c
index 6e63512646..e6af56d1bd 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_string.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_string.c
@@ -34,47 +34,47 @@
 #include 
 
 static int params_filter(char** params,uint32_t *r)
-{	
-	char *p ;
-	uint32_t result=0;
-	uint8_t base=0;
-	
-	p = *params;
-	
+{
+    char *p ;
+    uint32_t result=0;
+    uint8_t base=0;
+
+    p = *params;
+
     if((*p == '0') && ((*(p+1) == 'x') || (*(p+1) == 'X')) ){
-		p = p + 2;
-		base = 16;
-		
-	}else{
-		base = 10;
-	}
-	
-	while(*p){
-		result *= base;
-	    if(*p >= '0' && *p<='9')
-			result += *p-'0';
-		else if(base==10)
-			return -1;
-			
-		if(base==16){
-			if(*p >= 'a' && *p<='f')
-				result += *p-'a' + 10;
-			else if(*p >= 'A' && *p<='F')
-				result += *p-'A' + 10;
-		
-		}
-		p++;
-	}
-		
-	*r = result;
-	return 0;
-	
+        p = p + 2;
+        base = 16;
+
+    }else{
+        base = 10;
+    }
+
+    while(*p){
+        result *= base;
+        if(*p >= '0' && *p<='9')
+            result += *p-'0';
+        else if(base==10)
+            return -1;
+
+        if(base==16){
+            if(*p >= 'a' && *p<='f')
+                result += *p-'a' + 10;
+            else if(*p >= 'A' && *p<='F')
+                result += *p-'A' + 10;
+
+        }
+        p++;
+    }
+
+    *r = result;
+    return 0;
+
 }
 
 
 void get_bytearray_from_string(char** params, uint8_t *result,int array_size)
 {
-    
+
     int i = 0;
     char rand[3];
 
@@ -88,38 +88,38 @@ void get_bytearray_from_string(char** params, uint8_t *result,int array_size)
 
 void get_uint8_from_string(char** params, uint8_t *result)
 {
-	uint32_t p = 0;
-	int state=0;
-	
-	state = params_filter(params,&p);
-	if(!state){
-		*result = p & 0xff;
-	}else
-		*result = 0;
+    uint32_t p = 0;
+    int state=0;
+
+    state = params_filter(params,&p);
+    if(!state){
+        *result = p & 0xff;
+    }else
+        *result = 0;
 }
 
 void get_uint16_from_string(char** params, uint16_t *result)
 {
-	uint32_t p = 0;
-	int state=0;
-	
-	state = params_filter(params,&p);
-	if(!state){
-		*result = p & 0xffff;
-	}else
-		*result = 0;
+    uint32_t p = 0;
+    int state=0;
+
+    state = params_filter(params,&p);
+    if(!state){
+        *result = p & 0xffff;
+    }else
+        *result = 0;
 }
 
 void get_uint32_from_string(char** params, uint32_t *result)
 {
     uint32_t p = 0;
-	int state=0;
-	
-	state = params_filter(params,&p);
-	if(!state){
-		*result = p;
-	}else
-		*result = 0;
+    int state=0;
+
+    state = params_filter(params,&p);
+    if(!state){
+        *result = p;
+    }else
+        *result = 0;
 }
 
 void utils_parse_number(const char *str, char sep, uint8_t *buf, int buflen, int base)
@@ -323,7 +323,7 @@ void utils_memdrain16(void *src, size_t len)
     while (len--) {
         tmp = *s++;
     }
-    
+
     (void)tmp;
 }
 
@@ -337,7 +337,7 @@ void utils_memdrain32(void *src, size_t len)
     while (len--) {
         tmp = *s++;
     }
-    
+
     (void)tmp;
 }
 
@@ -351,7 +351,7 @@ void utils_memdrain64(void *src, size_t len)
     while (len--) {
         tmp = *s++;
     }
-    
+
     (void)tmp;
 }
 
@@ -369,7 +369,7 @@ void * utils_memdrain8_with_check(void *src, size_t len, uint8_t seq)
         }
     }
 
-    return NULL; 
+    return NULL;
 }
 
 void * utils_memdrain16_with_check(void *src, size_t len, uint16_t seq)
@@ -386,8 +386,8 @@ void * utils_memdrain16_with_check(void *src, size_t len, uint16_t seq)
             return (uint16_t *)s-1;
         }
     }
-    
-    return NULL; 
+
+    return NULL;
 }
 
 void * utils_memdrain32_with_check(void *src, size_t len, uint32_t seq)
@@ -404,8 +404,8 @@ void * utils_memdrain32_with_check(void *src, size_t len, uint32_t seq)
             return (uint32_t *)s-1;
         }
     }
-    
-    return NULL; 
+
+    return NULL;
 }
 
 void * utils_memdrain64_with_check(void *src, size_t len, uint64_t seq)
@@ -422,6 +422,6 @@ void * utils_memdrain64_with_check(void *src, size_t len, uint64_t seq)
             return (uint64_t *)s-1;
         }
     }
-    
-    return NULL; 
+
+    return NULL;
 }
diff --git a/bsp/bl808/m0/libraries/utils/src/utils_time.c b/bsp/bl808/m0/libraries/utils/src/utils_time.c
index 6203b8b52b..0e8dd1dd73 100644
--- a/bsp/bl808/m0/libraries/utils/src/utils_time.c
+++ b/bsp/bl808/m0/libraries/utils/src/utils_time.c
@@ -38,11 +38,11 @@ int utils_time_date_from_epoch(unsigned int epoch, utils_time_date_t *date)
     unsigned char month_days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
     unsigned char week_days[7] = {4,5,6,0,1,2,3};
 
-    date->leap_days = 0; 
+    date->leap_days = 0;
     date->leap_year_ind = 0;
 
-    // Add or substract time zone here. 
-    //epoch += 19800; //GMT +5:30 = +19800 seconds 
+    // Add or substract time zone here.
+    //epoch += 19800; //GMT +5:30 = +19800 seconds
 
     date->ntp_second = epoch%60;
     epoch /= 60;
@@ -65,10 +65,10 @@ int utils_time_date_from_epoch(unsigned int epoch, utils_time_date_t *date)
     date->ntp_year = 1970 + ((date->days_since_epoch - date->leap_days)/365); // Calculating accurate current year by (days_since_epoch - extra leap days)
     if (((date->ntp_year%4==0) && (date->ntp_year%100!=0)) || (date->ntp_year%400==0))  {
         month_days[1]=29;     //February = 29 days for leap years
-        date->leap_year_ind = 1;    //if current year is leap, set indicator to 1 
+        date->leap_year_ind = 1;    //if current year is leap, set indicator to 1
     } else {
-        month_days[1]=28; //February = 28 days for non-leap years 
-        date->leap_year_ind = 0;    //if current year is leap, set indicator to 1 
+        month_days[1]=28; //February = 28 days for non-leap years
+        date->leap_year_ind = 0;    //if current year is leap, set indicator to 1
     }
     for (i = 1972, date->leap_days = 0; i < date->ntp_year; i+=4) {
         // Calculating number of leap days since epoch/1970
@@ -84,7 +84,7 @@ int utils_time_date_from_epoch(unsigned int epoch, utils_time_date_t *date)
     for (date->ntp_month = 0; date->ntp_month <= 11; date->ntp_month++) {
         //calculating current Month
         if (date->day_of_year <= temp_days) {
-            break; 
+            break;
         }
         temp_days = temp_days + month_days[date->ntp_month];
     }