From 8e92a697b72b5f3f0fadf2b569117dab899aac26 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Fri, 18 Sep 2020 15:43:43 +0900 Subject: [PATCH 01/18] Merge release-v2.0.2 into new-master for v2.0.2 release (#14) * Add error check for arguments * Fix HPADC gain value * Fix typo * Add support for PMIC GPO setter/getter with HiZ * Fix FLOWCONTROL definition name in UART0 driver * Support O_NONBLOCK flag of UART0 * Fix raster operation bug in non-scaling case The scaling information should not be included in GE2D command buffer in non-scaling case. * arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20149 * arch/arm/src/cxd56xx: Fix nxstyle issue * boards/arm/cxd56xx/drivers/audio: Fix nxstyle issue * boards: spresense: Fix PMIC setting during boot-up When RTC clock is still unstable, the continuous PMIC settings may not be reflected. This commit adds a delay time to avoid such problem. * arch/arm/src/cxd56xx/cxd56_gnss: Fix nxstyle issue * boards: spresense: Add delay only for PMIC GPO setting When RTC clock is still unstable, add a delay time only for PMIC GPO setting to avoid a problem that the setting is not reflected. * arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20152 * arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20156 * arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20166 --- arch/arm/include/cxd56xx/gnss.h | 2 +- arch/arm/src/cxd56xx/cxd56_adc.c | 2 +- arch/arm/src/cxd56xx/cxd56_farapi.c | 4 +- arch/arm/src/cxd56xx/cxd56_farapistub.S | 530 +++++++++--------- arch/arm/src/cxd56xx/cxd56_farapistub.h | 2 +- arch/arm/src/cxd56xx/cxd56_geofence.c | 26 +- arch/arm/src/cxd56xx/cxd56_gnss.c | 130 ++--- arch/arm/src/cxd56xx/cxd56_gnss_api.h | 152 ++--- arch/arm/src/cxd56xx/cxd56_pmic.c | 107 +++- arch/arm/src/cxd56xx/cxd56_pmic.h | 16 + arch/arm/src/cxd56xx/cxd56_powermgr.c | 12 +- arch/arm/src/cxd56xx/cxd56_scu.c | 24 +- arch/arm/src/cxd56xx/cxd56_sfc.c | 24 +- arch/arm/src/cxd56xx/cxd56_timer.c | 2 +- arch/arm/src/cxd56xx/cxd56_uart0.c | 41 +- .../arm/cxd56xx/common/src/cxd56_imageproc.c | 39 +- .../cxd56xx/drivers/audio/cxd56_audio_aca.c | 34 +- .../cxd56xx/spresense/include/cxd56_power.h | 34 ++ .../arm/cxd56xx/spresense/src/cxd56_power.c | 82 +++ 19 files changed, 740 insertions(+), 523 deletions(-) diff --git a/arch/arm/include/cxd56xx/gnss.h b/arch/arm/include/cxd56xx/gnss.h index 98348afad0b71..459d578344157 100644 --- a/arch/arm/include/cxd56xx/gnss.h +++ b/arch/arm/include/cxd56xx/gnss.h @@ -565,7 +565,7 @@ extern "C" #define CXD56_GNSS_IOCTL_INVAL 0 #define CXD56_GNSS_IOCTL_MAX 54 -/* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for GD_Start */ +/* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for fw_gd_start */ #define CXD56_GNSS_STMOD_COLD 0 /* Cold Start */ #define CXD56_GNSS_STMOD_WARM 1 /* Warm Start */ diff --git a/arch/arm/src/cxd56xx/cxd56_adc.c b/arch/arm/src/cxd56xx/cxd56_adc.c index f9cc3973f58fb..1343bf6a54712 100644 --- a/arch/arm/src/cxd56xx/cxd56_adc.c +++ b/arch/arm/src/cxd56xx/cxd56_adc.c @@ -126,7 +126,7 @@ /* Input Gain setting */ -#define INPUT_GAIN(a, g2, g1) (((a) << 24) | ((g2) << 16) | ((g1) << 12)) +#define INPUT_GAIN(a, g1, g2) (((a) << 24) | ((g2) << 16) | ((g1) << 12)) #define INPUT_GAIN_MASK INPUT_GAIN(3, 15, 15) #define INPUT_GAIN_MINUS_6DB INPUT_GAIN(2, 0, 0) #define INPUT_GAIN_THROUGH INPUT_GAIN(0, 0, 0) diff --git a/arch/arm/src/cxd56xx/cxd56_farapi.c b/arch/arm/src/cxd56xx/cxd56_farapi.c index 6ed3510a41b77..2b4c0d08946d3 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapi.c +++ b/arch/arm/src/cxd56xx/cxd56_farapi.c @@ -55,7 +55,7 @@ #include "cxd56_farapistub.h" #include "hardware/cxd5602_backupmem.h" -int PM_WakeUpCpu(int cpuid); +int fw_pm_wakeupcpu(int cpuid); /**************************************************************************** * Pre-processor Definitions @@ -209,7 +209,7 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) if (((gnscken & GNSDSP_CKEN_P1) != GNSDSP_CKEN_P1) && ((gnscken & GNSDSP_CKEN_COP) != GNSDSP_CKEN_COP)) { - PM_WakeUpCpu(GPS_CPU_ID); + fw_pm_wakeupcpu(GPS_CPU_ID); } } #endif diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.S b/arch/arm/src/cxd56xx/cxd56_farapistub.S index 8d28ba38e6694..94bb44bff9fdc 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.S +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.S @@ -57,141 +57,141 @@ .align 2 3: - /* PM_GpsPllClockSetSource */ + /* fw_pm_gpspllclocksetsource */ nop nop - /* PM_PmicGetChargingPortType */ + /* fw_pm_pmicgetchargingporttype */ nop nop - /* PM_PmicSetChargingCurrentValue */ + /* fw_pm_pmicsetchargingcurrentvalue */ nop nop - /* PM_PmicStartCharging */ + /* fw_pm_pmicstartcharging */ nop nop - /* PM_PmicStopCharging */ + /* fw_pm_pmicstopcharging */ nop nop - /* PM_PeriPowerOn */ + /* fw_pm_peripoweron */ nop nop - /* PM_PeriPowerOff */ + /* fw_pm_peripoweroff */ nop nop - /* _PM_PeriClockEnable */ + /* fw__pm_periclockenable */ nop nop - /* _PM_PeriClockDisable */ + /* fw__pm_periclockdisable */ nop nop - /* _PM_UpdateCpuFreqInfo */ + /* fw__pm_updatecpufreqinfo */ nop nop - /* PM_PmicPowerOn */ + /* fw_pm_pmicpoweron */ nop nop - /* PM_PmicPowerOff */ + /* fw_pm_pmicpoweroff */ nop nop - /* PM_SetWakeupTrigger */ + /* fw_pm_setwakeuptrigger */ nop nop - /* PM_HostifClockEnable */ + /* fw_pm_hostifclockenable */ nop nop - /* PM_HostifClockDisable */ + /* fw_pm_hostifclockdisable */ nop nop - .global PM_StartCpu + .global fw_pm_startcpu .thumb_func -PM_StartCpu: +fw_pm_startcpu: mov r12, pc b 1b - .global PM_StopCpu + .global fw_pm_stopcpu .thumb_func -PM_StopCpu: +fw_pm_stopcpu: mov r12, pc b 1b - .global PM_SleepCpu + .global fw_pm_sleepcpu .thumb_func -PM_SleepCpu: +fw_pm_sleepcpu: mov r12, pc b 1b - .global PM_WakeUpCpu + .global fw_pm_wakeupcpu .thumb_func -PM_WakeUpCpu: +fw_pm_wakeupcpu: mov r12, pc b 1b - .global PM_ColdSleep + .global fw_pm_coldsleep .thumb_func -PM_ColdSleep: +fw_pm_coldsleep: mov r12, pc b 1b - .global PM_DeepSleep + .global fw_pm_deepsleep .thumb_func -PM_DeepSleep: +fw_pm_deepsleep: mov r12, pc b 1b - .global PM_Reboot + .global fw_pm_reboot .thumb_func -PM_Reboot: +fw_pm_reboot: mov r12, pc b 1b - .global PM_LoadImage + .global fw_pm_loadimage .thumb_func -PM_LoadImage: +fw_pm_loadimage: mov r12, pc b 1b - /* PM_LoadImageToAddress */ + /* fw_pm_loadimagetoaddress */ nop nop - /* PM_RamControlByAddress */ + /* fw_pm_ramcontrolbyaddress */ nop nop - /* PM_ChangeClock */ + /* fw_pm_changeclock */ nop nop - .global pm_pmic_control + .global fw_pm_pmiccontrol .thumb_func -pm_pmic_control: +fw_pm_pmiccontrol: mov r12, pc b 1b - /* PM_BootCpu */ + /* fw_pm_bootcpu */ nop nop - /* PM_BootCpuWithWaitMode */ + /* fw_pm_bootcpuwithwaitmode */ nop nop - /* PM_GetClock */ + /* fw_pm_getclock */ nop nop @@ -229,95 +229,95 @@ _modulelist_power_mgr: .align 2 3: - /* FM_GetRegistryValue */ + /* fw_fm_getregistryvalue */ nop nop - /* FM_SetRegistryValue */ + /* fw_fm_setregistryvalue */ nop nop - /* FM_SetRegistryValueList */ + /* fw_fm_setregistryvaluelist */ nop nop - /* FM_DeleteRegistryKey */ + /* fw_fm_deleteregistrykey */ nop nop - /* FM_GenerateRegistryKey */ + /* fw_fm_generateregistrykey */ nop nop - /* FM_Sync */ + /* fw_fm_sync */ nop nop - /* FM_FileOpen */ + /* fw_fm_fileopen */ nop nop - /* FM_FileClose */ + /* fw_fm_fileclose */ nop nop - /* FM_FileRead */ + /* fw_fm_fileread */ nop nop - /* FM_FileWrite */ + /* fw_fm_filewrite */ nop nop - /* FM_FileSeek */ + /* fw_fm_fileseek */ nop nop - /* FM_FileFlush */ + /* fw_fm_fileflush */ nop nop - /* FM_FileDelete */ + /* fw_fm_filedelete */ nop nop - .global FM_RawWrite + .global fw_fm_rawwrite .thumb_func -FM_RawWrite: +fw_fm_rawwrite: mov r12, pc b 1b - .global FM_RawRead + .global fw_fm_rawread .thumb_func -FM_RawRead: +fw_fm_rawread: mov r12, pc b 1b - .global FM_RawEraseSector + .global fw_fm_rawerasesector .thumb_func -FM_RawEraseSector: +fw_fm_rawerasesector: mov r12, pc b 1b - /* FM_FileRename */ + /* fw_fm_filerename */ nop nop - /* FM_FileGetAttr */ + /* fw_fm_filegetattr */ nop nop - /* FM_FileSetAttr */ + /* fw_fm_filesetattr */ nop nop - /* FM_FileClearAttr */ + /* fw_fm_fileclearattr */ nop nop - .global FM_RawVerifyWrite + .global fw_fm_rawverifywrite .thumb_func -FM_RawVerifyWrite: +fw_fm_rawverifywrite: mov r12, pc b 1b @@ -355,39 +355,39 @@ _modulelist_flash_mgr: .align 2 3: - /* SYS_RtcMgrSetTime */ + /* fw_sys_rtcmgrsettime */ nop nop - /* SYS_RtcMgrGetTime */ + /* fw_sys_rtcmgrgettime */ nop nop - /* SYS_RtcMgrConvTime */ + /* fw_sys_rtcmgrconvtime */ nop nop - /* SYS_RtcMgrConvCalendarTime */ + /* fw_sys_rtcmgrconvcalendartime */ nop nop - /* SYS_RtcMgrSetCalendarTime */ + /* fw_sys_rtcmgrsetcalendartime */ nop nop - /* SYS_RtcMgrGetCalendarTime */ + /* fw_sys_rtcmgrgetcalendartime */ nop nop - /* SYS_RtcMgrAdjustTime */ + /* fw_sys_rtcmgradjusttime */ nop nop - /* SYS_RtcMgrRequestAlarm */ + /* fw_sys_rtcmgrrequestalarm */ nop nop - /* SYS_RtcMgrCancelAlarm */ + /* fw_sys_rtcmgrcancelalarm */ nop nop @@ -425,131 +425,131 @@ _modulelist_rtc_mgr: .align 2 3: - /* GNSP_ChangeClockBoot */ + /* fw_gnsp_changeclockboot */ nop nop - /* GNSP_ChangeClockNormal */ + /* fw_gnsp_changeclocknormal */ nop nop - /* GNSP_SetAttribute */ + /* fw_gnsp_setattribute */ nop nop - /* GNSP_GetPowerStatus */ + /* fw_gnsp_getpowerstatus */ nop nop - /* GNSP_PonGnss */ + /* fw_gnsp_pongnss */ nop nop - /* GNSP_PoffGnss */ + /* fw_gnsp_poffgnss */ nop nop - /* GNSP_PoffLNA */ + /* fw_gnsp_pofflna */ nop nop - /* GNSP_Sleep */ + /* fw_gnsp_sleep */ nop nop - /* GNSP_Wakeup */ + /* fw_gnsp_wakeup */ nop nop - /* GNSP_SetWakeupTime */ + /* fw_gnsp_setwakeuptime */ nop nop - /* GNSP_GetAttribute */ + /* fw_gnsp_getattribute */ nop nop - /* GNSP_ClockOn */ + /* fw_gnsp_clockon */ nop nop - /* GNSP_ClockOff */ + /* fw_gnsp_clockoff */ nop nop - /* GNSP_ChangeMode */ + /* fw_gnsp_changemode */ nop nop - /* GNSP_EnableIo */ + /* fw_gnsp_enableio */ nop nop - /* GNSP_ControlGpioOut */ + /* fw_gnsp_controlgpioout */ nop nop - /* GNSP_Debug */ + /* fw_gnsp_debug */ nop nop - /* GNSP_ChangeClockRtc */ + /* fw_gnsp_changeclockrtc */ nop nop - /* GNSP_ChangeClockSFCClkup */ + /* fw_gnsp_changeclocksfcclkup */ nop nop - /* GNSP_ChangeClockSFCClkdwn */ + /* fw_gnsp_changeclocksfcclkdwn */ nop nop - /* GNSP_ChangeClockGPSCPUClkup */ + /* fw_gnsp_changeclockgpscpuclkup */ nop nop - /* GNSP_ChangeClockGPSCPUClkdwn */ + /* fw_gnsp_changeclockgpscpuclkdwn */ nop nop - /* GNSP_GetBootCause */ + /* fw_gnsp_getbootcause */ nop nop - /* GNSP_GetWakeupTrigger */ + /* fw_gnsp_getwakeuptrigger */ nop nop - /* GNSP_SelfReboot */ + /* fw_gnsp_selfreboot */ nop nop - /* GNSP_Start_KeepPPSOut */ + /* fw_gnsp_start_keepppsout */ nop nop - /* GNSP_Stop_KeepPPSOut */ + /* fw_gnsp_stop_keepppsout */ nop nop - /* GNSP_Start_KeepITPOut */ + /* fw_gnsp_start_keepitpout */ nop nop - /* GNSP_Stop_KeepITPOut */ + /* fw_gnsp_stop_keepitpout */ nop nop - /* GNSP_SetSleepState */ + /* fw_gnsp_setsleepstate */ nop nop - /* GNSP_FreeSysMemory */ + /* fw_gnsp_freesysmemory */ nop nop - /* GNSP_ReadAlmanacFile */ + /* fw_gnsp_readalmanacfile */ nop nop @@ -587,9 +587,9 @@ _modulelist_gnss_pwr: .align 2 3: - .global as_aca_control + .global fw_as_acacontrol .thumb_func -as_aca_control: +fw_as_acacontrol: mov r12, pc b 1b @@ -627,9 +627,9 @@ _modulelist_aca: .align 2 3: - .global PD_PinConfigs + .global fw_pd_pinconfigs .thumb_func -PD_PinConfigs: +fw_pd_pinconfigs: mov r12, pc b 1b @@ -667,45 +667,45 @@ _modulelist_pinconfig: .align 2 3: - .global PD_UartInit + .global fw_pd_uartinit .thumb_func -PD_UartInit: +fw_pd_uartinit: mov r12, pc b 1b - .global PD_UartUninit + .global fw_pd_uartuninit .thumb_func -PD_UartUninit: +fw_pd_uartuninit: mov r12, pc b 1b - .global PD_UartConfiguration + .global fw_pd_uartconfiguration .thumb_func -PD_UartConfiguration: +fw_pd_uartconfiguration: mov r12, pc b 1b - .global PD_UartEnable + .global fw_pd_uartenable .thumb_func -PD_UartEnable: +fw_pd_uartenable: mov r12, pc b 1b - .global PD_UartDisable + .global fw_pd_uartdisable .thumb_func -PD_UartDisable: +fw_pd_uartdisable: mov r12, pc b 1b - .global PD_UartReceive + .global fw_pd_uartreceive .thumb_func -PD_UartReceive: +fw_pd_uartreceive: mov r12, pc b 1b - .global PD_UartSend + .global fw_pd_uartsend .thumb_func -PD_UartSend: +fw_pd_uartsend: mov r12, pc b 1b @@ -743,45 +743,45 @@ _modulelist_uart: .align 2 3: - .global UM_Init + .global fw_um_init .thumb_func -UM_Init: +fw_um_init: mov r12, pc b 1b - .global UM_Open + .global fw_um_open .thumb_func -UM_Open: +fw_um_open: mov r12, pc b 1b - .global UM_Commit + .global fw_um_commit .thumb_func -UM_Commit: +fw_um_commit: mov r12, pc b 1b - .global UM_Close + .global fw_um_close .thumb_func -UM_Close: +fw_um_close: mov r12, pc b 1b - .global UM_CheckPoint + .global fw_um_checkpoint .thumb_func -UM_CheckPoint: +fw_um_checkpoint: mov r12, pc b 1b - .global UM_DoUpdateSequence + .global fw_um_doupdatesequence .thumb_func -UM_DoUpdateSequence: +fw_um_doupdatesequence: mov r12, pc b 1b - .global UM_Abort + .global fw_um_abort .thumb_func -UM_Abort: +fw_um_abort: mov r12, pc b 1b @@ -819,387 +819,387 @@ _modulelist_update_mgr: .align 2 3: - .global GD_Start + .global fw_gd_start .thumb_func -GD_Start: +fw_gd_start: mov r12, pc b 1b - .global GD_Stop + .global fw_gd_stop .thumb_func -GD_Stop: +fw_gd_stop: mov r12, pc b 1b - .global GD_SelectSatelliteSystem + .global fw_gd_selectsatellitesystem .thumb_func -GD_SelectSatelliteSystem: +fw_gd_selectsatellitesystem: mov r12, pc b 1b - .global GD_GetSatelliteSystem + .global fw_gd_getsatellitesystem .thumb_func -GD_GetSatelliteSystem: +fw_gd_getsatellitesystem: mov r12, pc b 1b - .global GD_SetReceiverPositionEllipsoidal + .global fw_gd_setreceiverpositionellipsoidal .thumb_func -GD_SetReceiverPositionEllipsoidal: +fw_gd_setreceiverpositionellipsoidal: mov r12, pc b 1b - .global GD_SetReceiverPositionOrthogonal + .global fw_gd_setreceiverpositionorthogonal .thumb_func -GD_SetReceiverPositionOrthogonal: +fw_gd_setreceiverpositionorthogonal: mov r12, pc b 1b - .global GD_SetOperationMode + .global fw_gd_setoperationmode .thumb_func -GD_SetOperationMode: +fw_gd_setoperationmode: mov r12, pc b 1b - .global GD_GetOperationMode + .global fw_gd_getoperationmode .thumb_func -GD_GetOperationMode: +fw_gd_getoperationmode: mov r12, pc b 1b - .global GD_SetTcxoOffset + .global fw_gd_settcxooffset .thumb_func -GD_SetTcxoOffset: +fw_gd_settcxooffset: mov r12, pc b 1b - .global GD_GetTcxoOffset + .global fw_gd_gettcxooffset .thumb_func -GD_GetTcxoOffset: +fw_gd_gettcxooffset: mov r12, pc b 1b - .global GD_SetTime + .global fw_gd_settime .thumb_func -GD_SetTime: +fw_gd_settime: mov r12, pc b 1b - .global GD_GetAlmanac + .global fw_gd_getalmanac .thumb_func -GD_GetAlmanac: +fw_gd_getalmanac: mov r12, pc b 1b - .global GD_SetAlmanac + .global fw_gd_setalmanac .thumb_func -GD_SetAlmanac: +fw_gd_setalmanac: mov r12, pc b 1b - .global GD_GetEphemeris + .global fw_gd_getephemeris .thumb_func -GD_GetEphemeris: +fw_gd_getephemeris: mov r12, pc b 1b - .global GD_SetEphemeris + .global fw_gd_setephemeris .thumb_func -GD_SetEphemeris: +fw_gd_setephemeris: mov r12, pc b 1b - .global GD_GetVarEphemeris + .global fw_gd_getvarephemeris .thumb_func -GD_GetVarEphemeris: +fw_gd_getvarephemeris: mov r12, pc b 1b - .global GD_SetVarEphemeris + .global fw_gd_setvarephemeris .thumb_func -GD_SetVarEphemeris: +fw_gd_setvarephemeris: mov r12, pc b 1b - .global GD_StartGpsTest + .global fw_gd_startgpstest .thumb_func -GD_StartGpsTest: +fw_gd_startgpstest: mov r12, pc b 1b - .global GD_StopGpsTest + .global fw_gd_stopgpstest .thumb_func -GD_StopGpsTest: +fw_gd_stopgpstest: mov r12, pc b 1b - .global GD_GetGpsTestResult + .global fw_gd_getgpstestresult .thumb_func -GD_GetGpsTestResult: +fw_gd_getgpstestresult: mov r12, pc b 1b - .global GD_SaveBackupdata + .global fw_gd_savebackupdata .thumb_func -GD_SaveBackupdata: +fw_gd_savebackupdata: mov r12, pc b 1b - .global GD_EraseBackup + .global fw_gd_erasebackup .thumb_func -GD_EraseBackup: +fw_gd_erasebackup: mov r12, pc b 1b - .global GD_CepSetAssistData + .global fw_gd_cepsetassistdata .thumb_func -GD_CepSetAssistData: +fw_gd_cepsetassistdata: mov r12, pc b 1b - .global GD_CepEraseAssistData + .global fw_gd_ceperaseassistdata .thumb_func -GD_CepEraseAssistData: +fw_gd_ceperaseassistdata: mov r12, pc b 1b - .global GD_CepCheckAssistData + .global fw_gd_cepcheckassistdata .thumb_func -GD_CepCheckAssistData: +fw_gd_cepcheckassistdata: mov r12, pc b 1b - .global GD_CepGetAgeData + .global fw_gd_cepgetagedata .thumb_func -GD_CepGetAgeData: +fw_gd_cepgetagedata: mov r12, pc b 1b - .global GD_CepInitAssistData + .global fw_gd_cepinitassistdata .thumb_func -GD_CepInitAssistData: +fw_gd_cepinitassistdata: mov r12, pc b 1b - .global GD_SetAcquist + .global fw_gd_setacquist .thumb_func -GD_SetAcquist: +fw_gd_setacquist: mov r12, pc b 1b - .global GD_SetFrameTime + .global fw_gd_setframetime .thumb_func -GD_SetFrameTime: +fw_gd_setframetime: mov r12, pc b 1b - .global GD_SetTauGps + .global fw_gd_settaugps .thumb_func -GD_SetTauGps: +fw_gd_settaugps: mov r12, pc b 1b - .global GD_SetTimeGps + .global fw_gd_settimegps .thumb_func -GD_SetTimeGps: +fw_gd_settimegps: mov r12, pc b 1b - .global GD_ClearReceiverInfo + .global fw_gd_clearreceiverinfo .thumb_func -GD_ClearReceiverInfo: +fw_gd_clearreceiverinfo: mov r12, pc b 1b - .global GD_SetTowAssist + .global fw_gd_settowassist .thumb_func -GD_SetTowAssist: +fw_gd_settowassist: mov r12, pc b 1b - .global GD_SetUtcModel + .global fw_gd_setutcmodel .thumb_func -GD_SetUtcModel: +fw_gd_setutcmodel: mov r12, pc b 1b - .global GD_SpectrumControl + .global fw_gd_spectrumcontrol .thumb_func -GD_SpectrumControl: +fw_gd_spectrumcontrol: mov r12, pc b 1b - .global GD_ReadBuffer + .global fw_gd_readbuffer .thumb_func -GD_ReadBuffer: +fw_gd_readbuffer: mov r12, pc b 1b - .global GD_WriteBuffer + .global fw_gd_writebuffer .thumb_func -GD_WriteBuffer: +fw_gd_writebuffer: mov r12, pc b 1b - .global GD_SetNotifyMask + .global fw_gd_setnotifymask .thumb_func -GD_SetNotifyMask: +fw_gd_setnotifymask: mov r12, pc b 1b - .global GD_GeoAddRegion + .global fw_gd_geoaddregion .thumb_func -GD_GeoAddRegion: +fw_gd_geoaddregion: mov r12, pc b 1b - .global GD_GeoModifyRegion + .global fw_gd_geomodifyregion .thumb_func -GD_GeoModifyRegion: +fw_gd_geomodifyregion: mov r12, pc b 1b - .global GD_GeoDeleteRegione + .global fw_gd_geodeleteregione .thumb_func -GD_GeoDeleteRegione: +fw_gd_geodeleteregione: mov r12, pc b 1b - .global GD_GeoDeleteAllRegion + .global fw_gd_geodeleteallregion .thumb_func -GD_GeoDeleteAllRegion: +fw_gd_geodeleteallregion: mov r12, pc b 1b - .global GD_GeoGetRegionData + .global fw_gd_geogetregiondata .thumb_func -GD_GeoGetRegionData: +fw_gd_geogetregiondata: mov r12, pc b 1b - .global GD_GeoGetUsedRegionId + .global fw_gd_geogetusedregionid .thumb_func -GD_GeoGetUsedRegionId: +fw_gd_geogetusedregionid: mov r12, pc b 1b - .global GD_GeoSetOpMode + .global fw_gd_geosetopmode .thumb_func -GD_GeoSetOpMode: +fw_gd_geosetopmode: mov r12, pc b 1b - .global GD_GeoSetAllRgionNotifyRequest + .global fw_gd_geosetallrgionnotifyrequest .thumb_func -GD_GeoSetAllRgionNotifyRequest: +fw_gd_geosetallrgionnotifyrequest: mov r12, pc b 1b - .global GD_RegisterGeofence + .global fw_gd_registergeofence .thumb_func -GD_RegisterGeofence: +fw_gd_registergeofence: mov r12, pc b 1b - .global GD_ReleaseGeofence + .global fw_gd_releasegeofence .thumb_func -GD_ReleaseGeofence: +fw_gd_releasegeofence: mov r12, pc b 1b - .global GD_RegisterPvtlog + .global fw_gd_registerpvtlog .thumb_func -GD_RegisterPvtlog: +fw_gd_registerpvtlog: mov r12, pc b 1b - .global GD_ReleasePvtlog + .global fw_gd_releasepvtlog .thumb_func -GD_ReleasePvtlog: +fw_gd_releasepvtlog: mov r12, pc b 1b - .global GD_PvtlogDeleteLog + .global fw_gd_pvtlogdeletelog .thumb_func -GD_PvtlogDeleteLog: +fw_gd_pvtlogdeletelog: mov r12, pc b 1b - .global GD_PvtlogGetLogStatus + .global fw_gd_pvtloggetlogstatus .thumb_func -GD_PvtlogGetLogStatus: +fw_gd_pvtloggetlogstatus: mov r12, pc b 1b - .global GD_RtkStart + .global fw_gd_rtkstart .thumb_func -GD_RtkStart: +fw_gd_rtkstart: mov r12, pc b 1b - .global GD_RtkStop + .global fw_gd_rtkstop .thumb_func -GD_RtkStop: +fw_gd_rtkstop: mov r12, pc b 1b - .global GD_RtkSetOutputInterval + .global fw_gd_rtksetoutputinterval .thumb_func -GD_RtkSetOutputInterval: +fw_gd_rtksetoutputinterval: mov r12, pc b 1b - .global GD_RtkGetOutputInterval + .global fw_gd_rtkgetoutputinterval .thumb_func -GD_RtkGetOutputInterval: +fw_gd_rtkgetoutputinterval: mov r12, pc b 1b - .global GD_RtkSetGnss + .global fw_gd_rtksetgnss .thumb_func -GD_RtkSetGnss: +fw_gd_rtksetgnss: mov r12, pc b 1b - .global GD_RtkGetGnss + .global fw_gd_rtkgetgnss .thumb_func -GD_RtkGetGnss: +fw_gd_rtkgetgnss: mov r12, pc b 1b - .global GD_RtkSetEphNotify + .global fw_gd_rtksetephnotify .thumb_func -GD_RtkSetEphNotify: +fw_gd_rtksetephnotify: mov r12, pc b 1b - .global GD_RtkGetEphNotify + .global fw_gd_rtkgetephnotify .thumb_func -GD_RtkGetEphNotify: +fw_gd_rtkgetephnotify: mov r12, pc b 1b - .global GD_SetUseCase + .global fw_gd_setusecase .thumb_func -GD_SetUseCase: +fw_gd_setusecase: mov r12, pc b 1b - .global GD_GetUseCase + .global fw_gd_getusecase .thumb_func -GD_GetUseCase: +fw_gd_getusecase: mov r12, pc b 1b - .global GD_Set1ppsOutput + .global fw_gd_set1ppsoutput .thumb_func -GD_Set1ppsOutput: +fw_gd_set1ppsoutput: mov r12, pc b 1b - .global GD_Get1ppsOutput + .global fw_gd_get1ppsoutput .thumb_func -GD_Get1ppsOutput: +fw_gd_get1ppsoutput: mov r12, pc b 1b diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.h b/arch/arm/src/cxd56xx/cxd56_farapistub.h index 1c3bdfbb47807..f411bc26cc1ea 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.h +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.h @@ -36,6 +36,6 @@ #ifndef __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H #define __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H -#define FARAPISTUB_VERSION 20129 +#define FARAPISTUB_VERSION 20166 #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H */ diff --git a/arch/arm/src/cxd56xx/cxd56_geofence.c b/arch/arm/src/cxd56xx/cxd56_geofence.c index f41a107c5b16b..e8706ec58a3c7 100644 --- a/arch/arm/src/cxd56xx/cxd56_geofence.c +++ b/arch/arm/src/cxd56xx/cxd56_geofence.c @@ -166,7 +166,7 @@ FAR static int (*g_cmdlist[CXD56_GEOFENCE_IOCTL_MAX])(unsigned long) = static int cxd56_geofence_start(unsigned long arg) { - return GD_RegisterGeofence(); + return fw_gd_registergeofence(); } /**************************************************************************** @@ -186,7 +186,7 @@ static int cxd56_geofence_start(unsigned long arg) static int cxd56_geofence_stop(unsigned long arg) { - return GD_ReleaseGeofence(); + return fw_gd_releasegeofence(); } /**************************************************************************** @@ -215,7 +215,7 @@ static int cxd56_geofence_add_region(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = GD_GeoAddRegion(reg_data->id, reg_data->latitude, reg_data->longitude, + ret = fw_gd_geoaddregion(reg_data->id, reg_data->latitude, reg_data->longitude, reg_data->radius); return ret; @@ -247,7 +247,7 @@ static int cxd56_geofence_modify_region(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = GD_GeoModifyRegion(reg_data->id, reg_data->latitude, + ret = fw_gd_geomodifyregion(reg_data->id, reg_data->latitude, reg_data->longitude, reg_data->radius); return ret; @@ -279,7 +279,7 @@ static int cxd56_geofence_delete_region(unsigned long arg) } id = (uint8_t)arg; - ret = GD_GeoDeleteRegione(id); + ret = fw_gd_geodeleteregione(id); return ret; } @@ -303,7 +303,7 @@ static int cxd56_geofence_delete_all_region(unsigned long arg) { int ret; - ret = GD_GeoDeleteAllRegion(); + ret = fw_gd_geodeleteallregion(); return ret; } @@ -334,7 +334,7 @@ static int cxd56_geofence_get_region_data(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = GD_GeoGetRegionData(reg_data->id, ®_data->latitude, + ret = fw_gd_geogetregiondata(reg_data->id, ®_data->latitude, ®_data->longitude, ®_data->radius); return ret; @@ -362,7 +362,7 @@ static int cxd56_geofence_get_used_id(unsigned long arg) return -EINVAL; } - *(uint32_t *)arg = GD_GeoGetUsedRegionId(); + *(uint32_t *)arg = fw_gd_geogetusedregionid(); return 0; } @@ -386,7 +386,7 @@ static int cxd56_geofence_get_all_status(unsigned long arg) { int ret; - ret = GD_GeoSetAllRgionNotifyRequest(); + ret = fw_gd_geosetallrgionnotifyrequest(); return ret; } @@ -417,7 +417,7 @@ static int cxd56_geofence_set_mode(unsigned long arg) } mode = (FAR struct cxd56_geofence_mode_s *)arg; - ret = GD_GeoSetOpMode(mode->deadzone, mode->dwell_detecttime); + ret = fw_gd_geosetopmode(mode->deadzone, mode->dwell_detecttime); return ret; } @@ -561,9 +561,9 @@ static ssize_t cxd56_geofence_read(FAR struct file *filep, FAR char *buffer, goto _err; } - /* GD_ReadBuffer returns copied data size or negative error code */ + /* fw_gd_readbuffer returns copied data size or negative error code */ - ret = GD_ReadBuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len); + ret = fw_gd_readbuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len); _err: return ret; @@ -648,7 +648,7 @@ static int cxd56_geofence_poll(FAR struct file *filep, FAR struct pollfd *fds, priv->fds[i] = fds; fds->priv = &priv->fds[i]; - GD_SetNotifyMask(CXD56_CPU1_DEV_GEOFENCE, FALSE); + fw_gd_setnotifymask(CXD56_CPU1_DEV_GEOFENCE, FALSE); break; } } diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index 6cf88b46456cc..e5b3104a02147 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -65,9 +65,9 @@ * External Defined Functions ****************************************************************************/ -extern int PM_LoadImage(int cpuid, const char* filename); -extern int PM_StartCpu(int cpuid, int wait); -extern int PM_SleepCpu(int cpuid, int mode); +extern int fw_pm_loadimage(int cpuid, const char* filename); +extern int fw_pm_startcpu(int cpuid, int wait); +extern int fw_pm_sleepcpu(int cpuid, int mode); /**************************************************************************** * Pre-processor Definitions @@ -480,7 +480,7 @@ static int cxd56_gnss_select_satellite_system(FAR struct file *filep, { uint32_t system = (uint32_t)arg; - return GD_SelectSatelliteSystem(system); + return fw_gd_selectsatellitesystem(system); } /**************************************************************************** @@ -512,7 +512,7 @@ static int cxd56_gnss_get_satellite_system(FAR struct file *filep, return -EINVAL; } - ret = GD_GetSatelliteSystem(&system); + ret = fw_gd_getsatellitesystem(&system); *(uint32_t *)arg = system; return ret; @@ -548,7 +548,7 @@ cxd56_gnss_set_receiver_position_ellipsoidal(FAR struct file *filep, pos = (FAR struct cxd56_gnss_ellipsoidal_position_s *)arg; - return GD_SetReceiverPositionEllipsoidal(&pos->latitude, &pos->longitude, + return fw_gd_setreceiverpositionellipsoidal(&pos->latitude, &pos->longitude, &pos->altitude); } @@ -580,7 +580,7 @@ static int cxd56_gnss_set_receiver_position_orthogonal(FAR struct file *filep, } pos = (FAR struct cxd56_gnss_orthogonal_position_s *)arg; - return GD_SetReceiverPositionOrthogonal(pos->x, pos->y, pos->z); + return fw_gd_setreceiverpositionorthogonal(pos->x, pos->y, pos->z); } /**************************************************************************** @@ -609,7 +609,7 @@ static int cxd56_gnss_set_ope_mode(FAR struct file *filep, unsigned long arg) ope_mode = (FAR struct cxd56_gnss_ope_mode_param_s *)arg; - return GD_SetOperationMode(ope_mode->mode, ope_mode->cycle); + return fw_gd_setoperationmode(ope_mode->mode, ope_mode->cycle); } /**************************************************************************** @@ -638,7 +638,7 @@ static int cxd56_gnss_get_ope_mode(FAR struct file *filep, unsigned long arg) ope_mode = (FAR struct cxd56_gnss_ope_mode_param_s *)arg; - return GD_GetOperationMode(&ope_mode->mode, &ope_mode->cycle); + return fw_gd_getoperationmode(&ope_mode->mode, &ope_mode->cycle); } /**************************************************************************** @@ -662,7 +662,7 @@ static int cxd56_gnss_set_tcxo_offset(FAR struct file *filep, { int32_t offset = (int32_t)arg; - return GD_SetTcxoOffset(offset); + return fw_gd_settcxooffset(offset); } /**************************************************************************** @@ -692,7 +692,7 @@ static int cxd56_gnss_get_tcxo_offset(FAR struct file *filep, return -EINVAL; } - ret = GD_GetTcxoOffset(&offset); + ret = fw_gd_gettcxooffset(&offset); *(uint32_t *)arg = offset; return ret; @@ -728,7 +728,7 @@ static int cxd56_gnss_set_time(FAR struct file *filep, unsigned long arg) date_time = (FAR struct cxd56_gnss_datetime_s *)arg; up_pm_acquire_freqlock(&g_lv_lock); - ret = GD_SetTime(&date_time->date, &date_time->time); + ret = fw_gd_settime(&date_time->date, &date_time->time); up_pm_release_freqlock(&g_lv_lock); return ret; @@ -762,7 +762,7 @@ static int cxd56_gnss_get_almanac(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_GetAlmanac(param->type, param->data, &almanac_size); + return fw_gd_getalmanac(param->type, param->data, &almanac_size); } /**************************************************************************** @@ -792,7 +792,7 @@ static int cxd56_gnss_set_almanac(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_SetAlmanac(param->type, param->data); + return fw_gd_setalmanac(param->type, param->data); } /**************************************************************************** @@ -823,7 +823,7 @@ static int cxd56_gnss_get_ephemeris(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_GetEphemeris(param->type, param->data, &ephemeris_size); + return fw_gd_getephemeris(param->type, param->data, &ephemeris_size); } /**************************************************************************** @@ -853,7 +853,7 @@ static int cxd56_gnss_set_ephemeris(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_SetEphemeris(param->type, param->data); + return fw_gd_setephemeris(param->type, param->data); } /**************************************************************************** @@ -895,7 +895,7 @@ static int cxd56_gnss_save_backup_data(FAR struct file *filep, do { - n = GD_ReadBuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, + n = fw_gd_readbuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, CONFIG_CXD56_GNSS_BACKUP_BUFFER_SIZE); if (n <= 0) { @@ -996,7 +996,7 @@ static int cxd56_gnss_close_cep_data(FAR struct file *filep, static int cxd56_gnss_check_cep_data(FAR struct file *filep, unsigned long arg) { - return GD_CepCheckAssistData(); + return fw_gd_cepcheckassistdata(); } /**************************************************************************** @@ -1026,7 +1026,7 @@ static int cxd56_gnss_get_cep_age(FAR struct file *filep, unsigned long arg) age = (FAR struct cxd56_gnss_cep_age_s *)arg; - return GD_CepGetAgeData(&age->age, &age->cepi); + return fw_gd_cepgetagedata(&age->age, &age->cepi); } /**************************************************************************** @@ -1080,7 +1080,7 @@ static int cxd56_gnss_set_acquist_data(FAR struct file *filep, acquist = (FAR struct cxd56_gnss_agps_acquist_s *)arg; - return GD_SetAcquist(acquist->data, acquist->size); + return fw_gd_setacquist(acquist->data, acquist->size); } /**************************************************************************** @@ -1110,7 +1110,7 @@ static int cxd56_gnss_set_frametime(FAR struct file *filep, unsigned long arg) frametime = (FAR struct cxd56_gnss_agps_frametime_s *)arg; - return GD_SetFrameTime(frametime->sec, frametime->frac); + return fw_gd_setframetime(frametime->sec, frametime->frac); } /**************************************************************************** @@ -1140,7 +1140,7 @@ static int cxd56_gnss_set_tau_gps(FAR struct file *filep, unsigned long arg) taugpstime = (FAR struct cxd56_gnss_agps_tau_gps_s *)arg; - return GD_SetTauGps(&taugpstime->taugps); + return fw_gd_settaugps(&taugpstime->taugps); } /**************************************************************************** @@ -1170,7 +1170,7 @@ static int cxd56_gnss_set_time_gps(FAR struct file *filep, unsigned long arg) time_gps = (FAR struct cxd56_gnss_agps_time_gps_s *)arg; - return GD_SetTimeGps(&time_gps->date, &time_gps->time); + return fw_gd_settimegps(&time_gps->date, &time_gps->time); } /**************************************************************************** @@ -1194,7 +1194,7 @@ static int cxd56_gnss_clear_receiver_info(FAR struct file *filep, { uint32_t clear_type = arg; - return GD_ClearReceiverInfo(clear_type); + return fw_gd_clearreceiverinfo(clear_type); } /**************************************************************************** @@ -1225,7 +1225,7 @@ static int cxd56_gnss_set_tow_assist(FAR struct file *filep, assist = (FAR struct cxd56_gnss_agps_tow_assist_s *)arg; - return GD_SetTowAssist(assist->data, assist->size); + return fw_gd_settowassist(assist->data, assist->size); } /**************************************************************************** @@ -1255,7 +1255,7 @@ static int cxd56_gnss_set_utc_model(FAR struct file *filep, unsigned long arg) model = (FAR struct cxd56_gnss_agps_utc_model_s *)arg; - return GD_SetUtcModel(model->data, model->size); + return fw_gd_setutcmodel(model->data, model->size); } /**************************************************************************** @@ -1286,7 +1286,7 @@ static int cxd56_gnss_control_spectrum(FAR struct file *filep, control = (FAR struct cxd56_gnss_spectrum_control_s *)arg; - return GD_SpectrumControl(control->time, control->enable, control->point1, + return fw_gd_spectrumcontrol(control->time, control->enable, control->point1, control->step1, control->point2, control->step2); } @@ -1338,12 +1338,12 @@ static int cxd56_gnss_start_test(FAR struct file *filep, unsigned long arg) /* set parameter */ info = (FAR struct cxd56_gnss_test_info_s *)arg; - GD_StartGpsTest(info->satellite, info->reserve1, + fw_gd_startgpstest(info->satellite, info->reserve1, info->reserve2, info->reserve3); /* start test */ - ret = GD_Start(CXD56_GNSS_STMOD_COLD); + ret = fw_gd_start(CXD56_GNSS_STMOD_COLD); } return ret; @@ -1371,12 +1371,12 @@ static int cxd56_gnss_stop_test(FAR struct file *filep, unsigned long arg) /* term test */ - ret = GD_StopGpsTest(); + ret = fw_gd_stopgpstest(); if(ret == OK) { /* stop test */ - ret = GD_Stop(); + ret = fw_gd_stop(); } /* Power off the LNA device */ @@ -1414,7 +1414,7 @@ static int cxd56_gnss_get_test_result(FAR struct file *filep, result = (FAR struct cxd56_gnss_test_result_s *)arg; - return GD_GetGpsTestResult(&result->cn, &result->doppler); + return fw_gd_getgpstestresult(&result->cn, &result->doppler); } /**************************************************************************** @@ -1498,7 +1498,7 @@ static int cxd56_gnss_set_signal(FAR struct file *filep, unsigned long arg) goto _err; } - GD_SetNotifyMask(setting->gnsssig, FALSE); + fw_gd_setnotifymask(setting->gnsssig, FALSE); sig->enable = 1; sig->pid = pid; @@ -1542,7 +1542,7 @@ static int cxd56_gnss_start_pvtlog(FAR struct file *filep, unsigned long arg) setting = (FAR struct cxd56_pvtlog_setting_s *)arg; - return GD_RegisterPvtlog(setting->cycle, setting->threshold); + return fw_gd_registerpvtlog(setting->cycle, setting->threshold); } /**************************************************************************** @@ -1563,7 +1563,7 @@ static int cxd56_gnss_start_pvtlog(FAR struct file *filep, unsigned long arg) static int cxd56_gnss_stop_pvtlog(FAR struct file *filep, unsigned long arg) { - return GD_ReleasePvtlog(); + return fw_gd_releasepvtlog(); } /**************************************************************************** @@ -1584,7 +1584,7 @@ static int cxd56_gnss_stop_pvtlog(FAR struct file *filep, unsigned long arg) static int cxd56_gnss_delete_pvtlog(FAR struct file *filep, unsigned long arg) { - return GD_PvtlogDeleteLog(); + return fw_gd_pvtlogdeletelog(); } /**************************************************************************** @@ -1615,7 +1615,7 @@ static int cxd56_gnss_get_pvtlog_status(FAR struct file *filep, status = (FAR struct cxd56_pvtlog_status_s *)arg; - return GD_PvtlogGetLogStatus(&status->status); + return fw_gd_pvtloggetlogstatus(&status->status); } /**************************************************************************** @@ -1647,7 +1647,7 @@ static int cxd56_gnss_start_rtk_output(FAR struct file *filep, setting = (FAR struct cxd56_rtk_setting_s *)arg; setting->sbasout = 0; - return GD_RtkStart(setting); + return fw_gd_rtkstart(setting); } /**************************************************************************** @@ -1669,7 +1669,7 @@ static int cxd56_gnss_start_rtk_output(FAR struct file *filep, static int cxd56_gnss_stop_rtk_output(FAR struct file *filep, unsigned long arg) { - return GD_RtkStop(); + return fw_gd_rtkstop(); } /**************************************************************************** @@ -1693,7 +1693,7 @@ static int cxd56_gnss_set_rtk_interval(FAR struct file *filep, { int interval = (int)arg; - return GD_RtkSetOutputInterval(interval); + return fw_gd_rtksetoutputinterval(interval); } /**************************************************************************** @@ -1723,7 +1723,7 @@ static int cxd56_gnss_get_rtk_interval(FAR struct file *filep, return -EINVAL; } - ret = GD_RtkGetOutputInterval(&interval); + ret = fw_gd_rtkgetoutputinterval(&interval); *(uint32_t *)arg = interval; return ret; @@ -1750,7 +1750,7 @@ static int cxd56_gnss_select_rtk_satellite(FAR struct file *filep, { uint32_t gnss = (uint32_t)arg; - return GD_RtkSetGnss(gnss); + return fw_gd_rtksetgnss(gnss); } /**************************************************************************** @@ -1780,7 +1780,7 @@ static int cxd56_gnss_get_rtk_satellite(FAR struct file *filep, return -EINVAL; } - ret = GD_RtkGetGnss(&gnss); + ret = fw_gd_rtkgetgnss(&gnss); *(uint32_t *)arg = gnss; return ret; @@ -1807,7 +1807,7 @@ static int cxd56_gnss_set_rtk_ephemeris_enable(FAR struct file *filep, { int enable = (int)arg; - return GD_RtkSetEphNotify(enable); + return fw_gd_rtksetephnotify(enable); } /**************************************************************************** @@ -1837,7 +1837,7 @@ static int cxd56_gnss_get_rtk_ephemeris_enable(FAR struct file *filep, return -EINVAL; } - ret = GD_RtkGetEphNotify(&enable); + ret = fw_gd_rtkgetephnotify(&enable); *(uint32_t *)arg = enable; return ret; @@ -1871,7 +1871,7 @@ static int cxd56_gnss_start_navmsg_output(FAR struct file *filep, setting = (FAR struct cxd56_rtk_setting_s *)arg; - return GD_RtkStart(setting); + return fw_gd_rtkstart(setting); } /**************************************************************************** @@ -1901,7 +1901,7 @@ static int cxd56_gnss_set_var_ephemeris(FAR struct file *filep, } param = (FAR struct cxd56_gnss_set_var_ephemeris_s *)arg; - return GD_SetVarEphemeris(param->data, param->size); + return fw_gd_setvarephemeris(param->data, param->size); } /**************************************************************************** @@ -1932,7 +1932,7 @@ static int cxd56_gnss_get_var_ephemeris(FAR struct file *filep, param = (FAR struct cxd56_gnss_get_var_ephemeris_s *)arg; - return GD_GetVarEphemeris(param->type, param->data, param->size); + return fw_gd_getvarephemeris(param->type, param->data, param->size); } /**************************************************************************** @@ -1953,7 +1953,7 @@ static int cxd56_gnss_get_var_ephemeris(FAR struct file *filep, static int cxd56_gnss_set_usecase(FAR struct file *filep, unsigned long arg) { - return GD_SetUseCase(arg); + return fw_gd_setusecase(arg); } /**************************************************************************** @@ -1982,7 +1982,7 @@ static int cxd56_gnss_get_usecase(FAR struct file *filep, return -EINVAL; } - ret = GD_GetUseCase(&usecase); + ret = fw_gd_getusecase(&usecase); *(uint32_t *)arg = usecase; return ret; @@ -2027,7 +2027,7 @@ static int cxd56_gnss_set_1pps_output(FAR struct file *filep, #endif } - return GD_Set1ppsOutput(arg); + return fw_gd_set1ppsoutput(arg); } /**************************************************************************** @@ -2056,7 +2056,7 @@ static int cxd56_gnss_get_1pps_output(FAR struct file *filep, return -EINVAL; } - ret = GD_Get1ppsOutput(&enable); + ret = fw_gd_get1ppsoutput(&enable); *(uint32_t *)arg = enable; return ret; @@ -2209,7 +2209,7 @@ static void cxd56_gnss_read_backup_file(FAR int *retval) ret = n < 0 ? n : ferror(fp) ? -ENFILE : 0; break; } - ret = GD_WriteBuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, n); + ret = fw_gd_writebuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, n); if (ret < 0) { break; @@ -2279,7 +2279,7 @@ static void cxd56_gnss_common_signalhandler(uint32_t data, FAR void *userdata) if (issetmask) { - GD_SetNotifyMask(sigtype, FALSE); + fw_gd_setnotifymask(sigtype, FALSE); } nxsem_post(&priv->devsem); @@ -2611,19 +2611,19 @@ static int cxd56_gnss_open(FAR struct file *filep) nxsem_setprotocol(&priv->syncsem, SEM_PRIO_NONE); - ret = PM_LoadImage(CXD56_GNSS_GPS_CPUID, CXD56_GNSS_FWNAME); + ret = fw_pm_loadimage(CXD56_GNSS_GPS_CPUID, CXD56_GNSS_FWNAME); if (ret < 0) { goto _err1; } - ret = PM_StartCpu(CXD56_GNSS_GPS_CPUID, 1); + ret = fw_pm_startcpu(CXD56_GNSS_GPS_CPUID, 1); if (ret < 0) { goto _err2; } #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_DISABLE); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_DISABLE); #endif /* Wait the request from GNSS core to restore backup data, @@ -2637,7 +2637,7 @@ static int cxd56_gnss_open(FAR struct file *filep) goto _err2; } - ret = GD_WriteBuffer(CXD56_CPU1_DATA_TYPE_INFO, 0, &priv->shared_info, + ret = fw_gd_writebuffer(CXD56_CPU1_DATA_TYPE_INFO, 0, &priv->shared_info, sizeof(priv->shared_info)); if (ret < 0) { @@ -2652,9 +2652,9 @@ static int cxd56_gnss_open(FAR struct file *filep) _err2: #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); #endif - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); _err1: nxsem_destroy(&priv->syncsem); _err0: @@ -2696,10 +2696,10 @@ static int cxd56_gnss_close(FAR struct file *filep) if (priv->num_open == 0) { #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); #endif - ret = PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); + ret = fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); if (ret < 0) { goto errout; @@ -2770,9 +2770,9 @@ static ssize_t cxd56_gnss_read(FAR struct file *filep, FAR char *buffer, } } - /* GD_ReadBuffer returns copied data size or negative error code */ + /* fw_gd_readbuffer returns copied data size or negative error code */ - ret = GD_ReadBuffer(type, offset, buffer, len); + ret = fw_gd_readbuffer(type, offset, buffer, len); _err: _success: @@ -2898,7 +2898,7 @@ static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds, priv->fds[i] = fds; fds->priv = &priv->fds[i]; - GD_SetNotifyMask(CXD56_CPU1_DEV_GNSS, FALSE); + fw_gd_setnotifymask(CXD56_CPU1_DEV_GNSS, FALSE); break; } } diff --git a/arch/arm/src/cxd56xx/cxd56_gnss_api.h b/arch/arm/src/cxd56xx/cxd56_gnss_api.h index 8415ab04b47db..da36e3a54b0cb 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss_api.h +++ b/arch/arm/src/cxd56xx/cxd56_gnss_api.h @@ -53,7 +53,7 @@ /* GD operation mode */ -/* GD_SetOperationMode, GD_GetOperationMode */ +/* fw_gd_setoperationmode, fw_gd_getoperationmode */ #define CXD56_GNSS_OPMOD_NORMAL 1 #define CXD56_GNSS_OPMOD_LOWPOWER 2 @@ -64,309 +64,309 @@ * beginning to search the satellites and measure the receiver position */ -int GD_Start(uint8_t startMode); +int fw_gd_start(uint8_t startmode); /* Stop a positioning */ -int GD_Stop(void); +int fw_gd_stop(void); /* Select GNSSs to positioning * These are able to specified by CXD56_GNSS_B_SAT_XXX defines. */ -int GD_SelectSatelliteSystem(uint32_t system); +int fw_gd_selectsatellitesystem(uint32_t system); /* Get current using GNSSs to positioning * A argument 'satellite' indicates current GNSSs by bit fields defined * by CXD56_GNSS_B_SAT_XXX. */ -int GD_GetSatelliteSystem(FAR uint32_t *system); +int fw_gd_getsatellitesystem(FAR uint32_t *system); /* Set the rough receiver position */ -int GD_SetReceiverPositionEllipsoidal(FAR double *dLat, FAR double *dLon, - FAR double *dHeight); +int fw_gd_setreceiverpositionellipsoidal(FAR double *dlat, FAR double *dlon, + FAR double *dheight); /* Set the rough receiver position as orgothonal */ -int GD_SetReceiverPositionOrthogonal(int32_t dX, int32_t dY, int32_t dZ); +int fw_gd_setreceiverpositionorthogonal(int32_t dx, int32_t dy, int32_t dz); /* Set enable or disable the 1PPS output. */ -int GD_Set1ppsOutput(uint32_t enable); +int fw_gd_set1ppsoutput(uint32_t enable); /* Get the current 1PPS output setting. */ -int GD_Get1ppsOutput(FAR uint32_t *enable); +int fw_gd_get1ppsoutput(FAR uint32_t *enable); /* Set the receiver operation mode * 1st argument 'mode' is a operation mode defined by CXD56_GNSS_OPMOD_XXX. * 2nd argument 'cycle' is a positioning period[ms], default is 1000[ms]. */ -int GD_SetOperationMode(uint32_t mode, uint32_t cycle); +int fw_gd_setoperationmode(uint32_t mode, uint32_t cycle); /* Get the receiver operation mode */ -int GD_GetOperationMode(FAR uint32_t *mode, FAR uint32_t *cycle); +int fw_gd_getoperationmode(FAR uint32_t *mode, FAR uint32_t *cycle); /* Set the TCXO offset */ -int GD_SetTcxoOffset(int32_t offset); +int fw_gd_settcxooffset(int32_t offset); /* Get the TCXO offset */ -int GD_GetTcxoOffset(FAR int32_t *offset); +int fw_gd_gettcxooffset(FAR int32_t *offset); /* Set the estimated current time of the receiver. * 1st argument date & time are in UTC. */ -int GD_SetTime(FAR struct cxd56_gnss_date_s *date, +int fw_gd_settime(FAR struct cxd56_gnss_date_s *date, FAR struct cxd56_gnss_time_s *time); /* Set the network time */ -int GD_SetFrameTime(uint16_t sec, uint32_t fracSec); +int fw_gd_setframetime(uint16_t sec, uint32_t fracsec); /* Get the almanac data */ -int GD_GetAlmanac(uint32_t satellite, FAR uint32_t* almanac, - FAR uint32_t *almanacSize); +int fw_gd_getalmanac(uint32_t satellite, FAR uint32_t* almanac, + FAR uint32_t *almanacsize); /* Set the almanac data */ -int GD_SetAlmanac(uint32_t satellite, FAR uint32_t *almanac); +int fw_gd_setalmanac(uint32_t satellite, FAR uint32_t *almanac); /* Get the Ephemeris data */ -int GD_GetEphemeris(uint32_t satellite, FAR uint32_t* ephemeris, - FAR uint32_t *ephemerisSize); +int fw_gd_getephemeris(uint32_t satellite, FAR uint32_t* ephemeris, + FAR uint32_t *ephemerissize); /* Set the Ephemeris data */ -int GD_SetEphemeris(uint32_t satellite, FAR uint32_t *ephemeris); +int fw_gd_setephemeris(uint32_t satellite, FAR uint32_t *ephemeris); /* Select to use or not use the initial position calculation supporting * information of the QZSS L1-SAIF. */ -int GD_SetQzssPosAssist(uint32_t enable); +int fw_gd_setqzssposassist(uint32_t enable); /* Get a setting of the initial position calculation supporting * information of the QZSS L1-SAIF. */ -int GD_GetQzssPosAssist(FAR uint32_t *enable); +int fw_gd_getqzssposassist(FAR uint32_t *enable); /* Set IMES bitrates. */ -int GD_SetImesBitrate(uint32_t bitrate); +int fw_gd_setimesbitrate(uint32_t bitrate); /* Get IMES bitrates. */ -int GD_GetImesBitrate(FAR uint32_t *bitrate); +int fw_gd_getimesbitrate(FAR uint32_t *bitrate); /* Set IMES center frequency offset. */ -int GD_SetImesCenterFreqOffset(uint32_t offset); +int fw_gd_setimescenterfreqoffset(uint32_t offset); /* Set IMES preamble. */ -int GD_SetImesPreamble(uint32_t preamble); +int fw_gd_setimespreamble(uint32_t preamble); /* Start GPS test */ -void GD_StartGpsTest(uint32_t satellite, uint32_t reserve1, +void fw_gd_startgpstest(uint32_t satellite, uint32_t reserve1, uint32_t reserve2, uint32_t reserve3); /* Stop GPS test */ -int GD_StopGpsTest(void); +int fw_gd_stopgpstest(void); /* Get GPS test result */ -int GD_GetGpsTestResult(FAR float* cn, FAR float* doppler); +int fw_gd_getgpstestresult(FAR float* cn, FAR float* doppler); /* Control Spectrum output */ -int GD_SpectrumControl(unsigned long time, unsigned int enable, - unsigned char moniPoint1, unsigned char step1, - unsigned char moniPoint2, unsigned char step2); +int fw_gd_spectrumcontrol(unsigned long time, unsigned int enable, + unsigned char monipoint1, unsigned char step1, + unsigned char monipoint2, unsigned char step2); /* Save the backup data to a Flash memory. */ -int GD_SaveBackupdata(void); +int fw_gd_savebackupdata(void); /* CEP Check Assist Data Valid */ -int GD_CepCheckAssistData(void); +int fw_gd_cepcheckassistdata(void); /* CEP Get Age Data */ -int GD_CepGetAgeData(FAR float *age, FAR float *cepi); +int fw_gd_cepgetagedata(FAR float *age, FAR float *cepi); /* CEP Reset Assist Data init flag & valid flag */ -int GD_CepInitAssistData(void); +int fw_gd_cepinitassistdata(void); /* AGPS Set tau */ -int GD_SetTauGps(FAR double *tau); +int fw_gd_settaugps(FAR double *tau); /* AGPS Set Acquist */ -int GD_SetAcquist(FAR uint8_t *pAcquistData, uint16_t acquistSize); +int fw_gd_setacquist(FAR uint8_t *pacquistdata, uint16_t acquistsize); /* Set the estimated current time of the receiver. * 1st argument date & time are in GPS time. */ -int GD_SetTimeGps(FAR struct cxd56_gnss_date_s *date, +int fw_gd_settimegps(FAR struct cxd56_gnss_date_s *date, FAR struct cxd56_gnss_time_s *time); /* Clear Receiver Information */ -int GD_ClearReceiverInfo(uint32_t type); +int fw_gd_clearreceiverinfo(uint32_t type); /* AGPS Set Tow Assist */ -int GD_SetTowAssist(FAR uint8_t *pAssistData, uint16_t dataSize); +int fw_gd_settowassist(FAR uint8_t *passistdata, uint16_t datasize); /* AGPS Set UTC Model */ -int GD_SetUtcModel(FAR uint8_t *pModelData, uint16_t dataSize); +int fw_gd_setutcmodel(FAR uint8_t *pmodeldata, uint16_t datasize); /* Read GNSS data to specified buffer */ -int GD_ReadBuffer(uint8_t type, int32_t offset, FAR void *buf, +int fw_gd_readbuffer(uint8_t type, int32_t offset, FAR void *buf, uint32_t length); /* Write GNSS data from specified buffer */ -int GD_WriteBuffer(uint8_t type, int32_t offset, FAR void *buf, +int fw_gd_writebuffer(uint8_t type, int32_t offset, FAR void *buf, uint32_t length); /* Set notify mask, this mask flag is cleared when notified(poll/signal) */ -int GD_SetNotifyMask(uint8_t type, uint8_t clear); +int fw_gd_setnotifymask(uint8_t type, uint8_t clear); /* Geofence Add Region */ -int GD_GeoAddRegion(uint8_t id, long lat, long lon, uint16_t rad); +int fw_gd_geoaddregion(uint8_t id, long lat, long lon, uint16_t rad); /* Geofence Modify Region */ -int GD_GeoModifyRegion(uint8_t id, long lat, long lon, uint16_t rad); +int fw_gd_geomodifyregion(uint8_t id, long lat, long lon, uint16_t rad); /* Geofence Delete Region */ -int GD_GeoDeleteRegione(uint8_t id); +int fw_gd_geodeleteregione(uint8_t id); /* Geofence All delete Region */ -int GD_GeoDeleteAllRegion(void); +int fw_gd_geodeleteallregion(void); /* Geofence Region check */ -int GD_GeoGetRegionData(uint8_t id, FAR long *lat, FAR long *lon, +int fw_gd_geogetregiondata(uint8_t id, FAR long *lat, FAR long *lon, FAR uint16_t *rad); /* Geofence Get Used Region ID */ -uint32_t GD_GeoGetUsedRegionId(void); +uint32_t fw_gd_geogetusedregionid(void); /* Geofence Set mode */ -int GD_GeoSetOpMode(uint16_t deadzone, uint16_t dwell_detecttime); +int fw_gd_geosetopmode(uint16_t deadzone, uint16_t dwell_detecttime); /* Geofence Request All region notify */ -int GD_GeoSetAllRgionNotifyRequest(void); +int fw_gd_geosetallrgionnotifyrequest(void); /* Geofence Register to gnss_provider */ -int GD_RegisterGeofence(void); +int fw_gd_registergeofence(void); /* Geofence Release from gnss_provider */ -int GD_ReleaseGeofence(void); +int fw_gd_releasegeofence(void); /* Pvtlog Register to gnss_provider */ -int GD_RegisterPvtlog(uint32_t cycle, uint32_t threshold); +int fw_gd_registerpvtlog(uint32_t cycle, uint32_t threshold); /* Pvtlog Release */ -int GD_ReleasePvtlog(void); +int fw_gd_releasepvtlog(void); /* Pvtlog Delete log data */ -int GD_PvtlogDeleteLog(void); +int fw_gd_pvtlogdeletelog(void); /* Pvtlog Get Log status */ -int GD_PvtlogGetLogStatus(FAR struct cxd56_gnss_status_s *pLogStatus); +int fw_gd_pvtloggetlogstatus(FAR struct cxd56_gnss_status_s *plogstatus); /* Start outputting carrier phase info. */ -int GD_RtkStart(FAR struct cxd56_rtk_setting_s *pParam); +int fw_gd_rtkstart(FAR struct cxd56_rtk_setting_s *pparam); /* Stop outputting carrier phase info. */ -int GD_RtkStop(void); +int fw_gd_rtkstop(void); /* Set output interval of carrier phase info. * * interval : CXD56_GNSS_RTK_INTERVAL_XXX (gd_type.h) */ -int GD_RtkSetOutputInterval(int interval); +int fw_gd_rtksetoutputinterval(int interval); /* Get output interval of carrier phase info. [ms] */ -int GD_RtkGetOutputInterval(FAR int* interval); +int fw_gd_rtkgetoutputinterval(FAR int *interval); /* Set GNSS of outputting carrier phase info. */ -int GD_RtkSetGnss(uint32_t gnss); +int fw_gd_rtksetgnss(uint32_t gnss); /* Get GNSS of outputting carrier phase info. */ -int GD_RtkGetGnss(FAR uint32_t* pGnss); +int fw_gd_rtkgetgnss(FAR uint32_t *pgnss); /* Set enable/disable GD to notify updating ephemeris */ -int GD_RtkSetEphNotify(int enable); +int fw_gd_rtksetephnotify(int enable); /* Get enable/disable GD to notify updating ephemeris */ -int GD_RtkGetEphNotify(FAR int* enable); +int fw_gd_rtkgetephnotify(FAR int *enable); /* Set the Ephemeris data Ephemeris data size is variable. */ -int GD_SetVarEphemeris(uint32_t *ephemeris, uint32_t ephemerisSize); +int fw_gd_setvarephemeris(uint32_t *ephemeris, uint32_t ephemerissize); /* Get the Ephemeris data Ephemeris data size is variable. */ -int GD_GetVarEphemeris(uint32_t satellite, uint32_t* ephemeris, - uint32_t ephemerisSize); +int fw_gd_getvarephemeris(uint32_t satellite, uint32_t* ephemeris, + uint32_t ephemerissize); /* Set usecase mode */ -int GD_SetUseCase(uint32_t usecase); +int fw_gd_setusecase(uint32_t usecase); /* Get usecase mode */ -int GD_GetUseCase(uint32_t *usecase); +int fw_gd_getusecase(uint32_t *usecase); /* Set enable or disable of 1PPS output */ -int GD_Set1ppsOutput(uint32_t enable); +int fw_gd_set1ppsoutput(uint32_t enable); /* Get the current 1PPS output setting */ -int GD_Get1ppsOutput(uint32_t *enable); +int fw_gd_get1ppsoutput(uint32_t *enable); #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_API_H */ diff --git a/arch/arm/src/cxd56xx/cxd56_pmic.c b/arch/arm/src/cxd56xx/cxd56_pmic.c index c2350f057d979..44955ddeda890 100644 --- a/arch/arm/src/cxd56xx/cxd56_pmic.c +++ b/arch/arm/src/cxd56xx/cxd56_pmic.c @@ -163,7 +163,7 @@ struct pmic_temp_mode_s int high; }; -extern int pm_pmic_control(int cmd, void *arg); +extern int fw_pm_pmiccontrol(int cmd, void *arg); /**************************************************************************** * Private Data @@ -299,7 +299,7 @@ static int pmic_int_handler(int irq, void *context, void *arg) int cxd56_pmic_get_interrupt_status(uint8_t *status) { - return pm_pmic_control(PMIC_CMD_INTSTATUS, status); + return fw_pm_pmiccontrol(PMIC_CMD_INTSTATUS, status); } /**************************************************************************** @@ -347,7 +347,7 @@ int cxd56_pmic_set_gpo_reg(uint8_t *setbit0, uint8_t *clrbit0, .clrbit1 = clrbit1, }; - return pm_pmic_control(PMIC_CMD_GPO, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_GPO, &arg); } /**************************************************************************** @@ -485,6 +485,51 @@ bool cxd56_pmic_get_gpo(uint8_t chset) return false; } +/**************************************************************************** + * Name: cxd56_pmic_get_gpo_hiz + * + * Description: + * Get the tristate value from the specified GPO channel(s) + * + * Input Parameter: + * chset : GPO Channel number(s) + * + * Returned Value: + * Return 0(off), 1(on) or -1(HiZ) + * + ****************************************************************************/ + +int cxd56_pmic_get_gpo_hiz(uint8_t chset) +{ + uint8_t setbit0 = 0; + uint8_t clrbit0 = 0; + uint8_t setbit1 = 0; + uint8_t clrbit1 = 0; + uint8_t set; + uint8_t hiz; + + cxd56_pmic_set_gpo_reg(&setbit0, &clrbit0, &setbit1, &clrbit1); + + set = ((setbit1 & 0xf) << 4) | (setbit0 & 0xf); + hiz = ((setbit1) & 0xf0) | ((setbit0 & 0xf0) >> 4); + + /* If all of the specified chset is hiz, return -1 */ + + if ((hiz & chset) != chset) + { + return -1; + } + + /* If all of the specified chset is high, return 1 */ + + if ((set & chset) == chset) + { + return 1; + } + + return 0; +} + /**************************************************************************** * Name: cxd56_pmic_set_loadswitch_reg * @@ -522,7 +567,7 @@ int cxd56_pmic_set_loadswitch_reg(uint8_t *setbit, uint8_t *clrbit) .clrbit = clrbit, }; - return pm_pmic_control(PMIC_CMD_LOADSW, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_LOADSW, &arg); } /**************************************************************************** @@ -619,7 +664,7 @@ int cxd56_pmic_set_ddc_ldo_reg(uint8_t *setbit, uint8_t *clrbit) .clrbit = clrbit, }; - return pm_pmic_control(PMIC_CMD_DDCLDO, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_DDCLDO, &arg); } /**************************************************************************** @@ -738,7 +783,7 @@ int cxd56_pmic_get_rtc(uint64_t *count) int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge) { - return pm_pmic_control(PMIC_CMD_AFE, gauge); + return fw_pm_pmiccontrol(PMIC_CMD_AFE, gauge); } /**************************************************************************** @@ -757,7 +802,7 @@ int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge) int cxd56_pmic_getlowervol(FAR int *voltage) { - return pm_pmic_control(PMIC_CMD_GETVSYS, voltage); + return fw_pm_pmiccontrol(PMIC_CMD_GETVSYS, voltage); } /**************************************************************************** @@ -776,7 +821,7 @@ int cxd56_pmic_getlowervol(FAR int *voltage) int cxd56_pmic_setlowervol(int voltage) { - return pm_pmic_control(PMIC_CMD_SETVSYS, (void *)voltage); + return fw_pm_pmiccontrol(PMIC_CMD_SETVSYS, (void *)voltage); } /**************************************************************************** @@ -795,7 +840,7 @@ int cxd56_pmic_setlowervol(int voltage) int cxd56_pmic_getnotifyvol(FAR int *voltage) { - return pm_pmic_control(PMIC_CMD_GETPREVSYS, voltage); + return fw_pm_pmiccontrol(PMIC_CMD_GETPREVSYS, voltage); } /**************************************************************************** @@ -814,7 +859,7 @@ int cxd56_pmic_getnotifyvol(FAR int *voltage) int cxd56_pmic_setnotifyvol(int voltage) { - return pm_pmic_control(PMIC_CMD_SETPREVSYS, (void *)voltage); + return fw_pm_pmiccontrol(PMIC_CMD_SETPREVSYS, (void *)voltage); } /**************************************************************************** @@ -836,7 +881,7 @@ int cxd56_pmic_getchargevol(FAR int *voltage) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_VOLTAGE, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_VOLTAGE, &val); if (ret) { return -EIO; @@ -892,7 +937,7 @@ int cxd56_pmic_setchargevol(int voltage) val = (voltage - 4000) / 50; - return pm_pmic_control(PMIC_CMD_SET_CHG_VOLTAGE, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_VOLTAGE, (void *)val); } /**************************************************************************** @@ -915,7 +960,7 @@ int cxd56_pmic_getchargecurrent(FAR int *current) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_CURRENT, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_CURRENT, &val); if (ret) { return ret; @@ -983,7 +1028,7 @@ int cxd56_pmic_setchargecurrent(int current) return -EFAULT; } - return pm_pmic_control(PMIC_CMD_SET_CHG_CURRENT, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_CURRENT, (void *)val); } /**************************************************************************** @@ -1002,7 +1047,7 @@ int cxd56_pmic_setchargecurrent(int current) int cxd56_pmic_getporttype(FAR int *porttype) { - return pm_pmic_control(PMIC_CMD_GET_USB_PORT_TYPE, porttype); + return fw_pm_pmiccontrol(PMIC_CMD_GET_USB_PORT_TYPE, porttype); } /**************************************************************************** @@ -1027,7 +1072,7 @@ int cxd56_pmic_getchargestate(uint8_t *state) /* Update charge state */ - ret = pm_pmic_control(PMIC_CMD_AFE, &arg); + ret = fw_pm_pmiccontrol(PMIC_CMD_AFE, &arg); if (ret) { return ret; @@ -1035,7 +1080,7 @@ int cxd56_pmic_getchargestate(uint8_t *state) /* Get actual charging state (CNT_USB1) */ - ret = pm_pmic_control(PMIC_CMD_GET_CHG_STATE, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_STATE, &val); *state = val & 0xff; return ret; @@ -1083,7 +1128,7 @@ int cxd56_pmic_setrechargevol(int mv) return -EINVAL; } - return pm_pmic_control(PMIC_CMD_SET_RECHG_VOLTAGE, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_RECHG_VOLTAGE, (void *)val); } /**************************************************************************** @@ -1105,7 +1150,7 @@ int cxd56_pmic_getrechargevol(FAR int *mv) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_RECHG_VOLTAGE, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_RECHG_VOLTAGE, &val); if (ret) { return ret; @@ -1185,7 +1230,7 @@ int cxd56_pmic_setchargecompcurrent(int current) break; } - return pm_pmic_control(PMIC_CMD_SET_CHG_IFIN, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_IFIN, (void *)val); } /**************************************************************************** @@ -1207,7 +1252,7 @@ int cxd56_pmic_getchargecompcurrent(FAR int *current) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_IFIN, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_IFIN, &val); if (ret) { return ret; @@ -1265,7 +1310,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table) { /* SET_T60 (70h) - SET_T0_2 (78h) */ - return pm_pmic_control(PMIC_CMD_GET_CHG_TEMPERATURE_TABLE, table); + return fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_TEMPERATURE_TABLE, table); } /**************************************************************************** @@ -1285,7 +1330,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table) int cxd56_pmic_settemptable(FAR struct pmic_temp_table_s *table) { - return pm_pmic_control(PMIC_CMD_SET_CHG_TEMPERATURE_TABLE, table); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_TEMPERATURE_TABLE, table); } /**************************************************************************** @@ -1338,7 +1383,7 @@ int cxd56_pmic_setchargemode(int low, int high) return -EINVAL; } - return pm_pmic_control(PMIC_CMD_SET_CHG_TEMPERATURE_MODE, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_TEMPERATURE_MODE, &arg); } /**************************************************************************** @@ -1365,7 +1410,7 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high) struct pmic_temp_mode_s arg; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_TEMPERATURE_MODE, &arg); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_TEMPERATURE_MODE, &arg); if (ret) { return ret; @@ -1384,22 +1429,22 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high) int cxd56_pmic_monitor_enable(FAR struct pmic_mon_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_ENABLE, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_ENABLE, ptr); } int cxd56_pmic_monitor_status(FAR struct pmic_mon_status_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_STATUS, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_STATUS, ptr); } int cxd56_pmic_monitor_set(FAR struct pmic_mon_set_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_SET, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_SET, ptr); } int cxd56_pmic_monitor_get(FAR struct pmic_mon_log_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_GET, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_GET, ptr); } #endif @@ -1501,7 +1546,7 @@ int cxd56_pmic_read(uint8_t addr, void *buf, uint32_t size) .size = size, }; - return pm_pmic_control(PMIC_CMD_READ, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_READ, &arg); } /**************************************************************************** @@ -1536,7 +1581,7 @@ int cxd56_pmic_write(uint8_t addr, void *buf, uint32_t size) .size = size, }; - return pm_pmic_control(PMIC_CMD_WRITE, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_WRITE, &arg); } #endif /* CONFIG_CXD56_PMIC */ diff --git a/arch/arm/src/cxd56xx/cxd56_pmic.h b/arch/arm/src/cxd56xx/cxd56_pmic.h index 2e85dc47120d7..0946834a4b0a9 100644 --- a/arch/arm/src/cxd56xx/cxd56_pmic.h +++ b/arch/arm/src/cxd56xx/cxd56_pmic.h @@ -309,6 +309,22 @@ int cxd56_pmic_set_gpo_hiz(uint8_t chset); bool cxd56_pmic_get_gpo(uint8_t chset); +/**************************************************************************** + * Name: cxd56_pmic_get_gpo_hiz + * + * Description: + * Get the tristate value from the specified GPO channel(s) + * + * Input Parameter: + * chset : GPO Channel number(s) + * + * Returned Value: + * Return 0(off), 1(on) or -1(HiZ) + * + ****************************************************************************/ + +int cxd56_pmic_get_gpo_hiz(uint8_t chset); + /**************************************************************************** * Name: cxd56_pmic_set_loadswitch_reg * diff --git a/arch/arm/src/cxd56xx/cxd56_powermgr.c b/arch/arm/src/cxd56xx/cxd56_powermgr.c index bad73a60111a1..34bde395d19ba 100644 --- a/arch/arm/src/cxd56xx/cxd56_powermgr.c +++ b/arch/arm/src/cxd56xx/cxd56_powermgr.c @@ -991,16 +991,16 @@ uint32_t up_pm_clr_bootmask(uint32_t mask) int up_pm_sleep(enum pm_sleepmode_e mode) { - int PM_DeepSleep(void *); - int PM_ColdSleep(void *); + int fw_pm_deepsleep(void *); + int fw_pm_coldsleep(void *); switch (mode) { case PM_SLEEP_DEEP: - PM_DeepSleep(NULL); + fw_pm_deepsleep(NULL); break; case PM_SLEEP_COLD: - PM_ColdSleep(NULL); + fw_pm_coldsleep(NULL); break; } __asm volatile ("dsb"); @@ -1017,8 +1017,8 @@ int up_pm_sleep(enum pm_sleepmode_e mode) int up_pm_reboot(void) { - void PM_Reboot(void); - PM_Reboot(); + void fw_pm_reboot(void); + fw_pm_reboot(); __asm volatile ("dsb"); for (; ; ); } diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c index 32fad6b6fe3cb..c715a484f8b43 100644 --- a/arch/arm/src/cxd56xx/cxd56_scu.c +++ b/arch/arm/src/cxd56xx/cxd56_scu.c @@ -2756,14 +2756,36 @@ FAR struct seq_s *seq_open(int type, int bustype) { FAR struct seq_s *seq; + /* Check bustype is valid */ + + switch (bustype) + { + case SCU_BUS_SPI: + case SCU_BUS_I2C0: + case SCU_BUS_I2C1: + case SCU_BUS_LPADC0: + case SCU_BUS_LPADC1: + case SCU_BUS_LPADC2: + case SCU_BUS_LPADC3: + case SCU_BUS_HPADC0: + case SCU_BUS_HPADC1: + break; + default: + return NULL; + } + if (type == SEQ_TYPE_DECI) { seq = deci_new(); } - else + else if (type == SEQ_TYPE_NORMAL) { seq = seq_new(); } + else + { + return NULL; + } if (!seq) { diff --git a/arch/arm/src/cxd56xx/cxd56_sfc.c b/arch/arm/src/cxd56xx/cxd56_sfc.c index 1c53725abe21a..f1ccc9e3d2eec 100644 --- a/arch/arm/src/cxd56xx/cxd56_sfc.c +++ b/arch/arm/src/cxd56xx/cxd56_sfc.c @@ -44,10 +44,10 @@ /* Prototypes for Remote API */ -int FM_RawWrite(uint32_t offset, const void *buf, uint32_t size); -int FM_RawVerifyWrite(uint32_t offset, const void *buf, uint32_t size); -int FM_RawRead(uint32_t offset, void *buf, uint32_t size); -int FM_RawEraseSector(uint32_t sector); +int fw_fm_rawwrite(uint32_t offset, const void *buf, uint32_t size); +int fw_fm_rawverifywrite(uint32_t offset, const void *buf, uint32_t size); +int fw_fm_rawread(uint32_t offset, void *buf, uint32_t size); +int fw_fm_rawerasesector(uint32_t sector); #ifndef CONFIG_CXD56_SPIFLASHSIZE # define CONFIG_CXD56_SPIFLASHSIZE (16 * 1024 * 1024) @@ -87,7 +87,7 @@ static int cxd56_erase(FAR struct mtd_dev_s *dev, off_t startblock, for (i = 0; i < nblocks; i++) { - ret = FM_RawEraseSector(startblock + i); + ret = fw_fm_rawerasesector(startblock + i); if (ret < 0) { set_errno(-ret); @@ -104,7 +104,7 @@ static ssize_t cxd56_bread(FAR struct mtd_dev_s *dev, off_t startblock, finfo("bread: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks); - ret = FM_RawRead(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); + ret = fw_fm_rawread(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); if (ret < 0) { set_errno(-ret); @@ -122,10 +122,10 @@ static ssize_t cxd56_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, finfo("bwrite: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks); #ifdef CONFIG_CXD56_SFC_VERIFY_WRITE - ret = FM_RawVerifyWrite(startblock << PAGE_SHIFT, buffer, + ret = fw_fm_rawverifywrite(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); #else - ret = FM_RawWrite(startblock << PAGE_SHIFT, buffer, + ret = fw_fm_rawwrite(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); #endif if (ret < 0) @@ -144,7 +144,7 @@ static ssize_t cxd56_read(FAR struct mtd_dev_s *dev, off_t offset, finfo("read: %08lx (%u bytes)\n", offset, nbytes); - ret = FM_RawRead(offset, buffer, nbytes); + ret = fw_fm_rawread(offset, buffer, nbytes); if (ret < 0) { set_errno(-ret); @@ -163,9 +163,9 @@ static ssize_t cxd56_write(FAR struct mtd_dev_s *dev, off_t offset, finfo("write: %08lx (%u bytes)\n", offset, nbytes); #ifdef CONFIG_CXD56_SFC_VERIFY_WRITE - ret = FM_RawVerifyWrite(offset, buffer, nbytes); + ret = fw_fm_rawverifywrite(offset, buffer, nbytes); #else - ret = FM_RawWrite(offset, buffer, nbytes); + ret = fw_fm_rawwrite(offset, buffer, nbytes); #endif if (ret < 0) { @@ -222,7 +222,7 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) while (sec < last) { - FM_RawEraseSector(sec); + fw_fm_rawerasesector(sec); sec++; } } diff --git a/arch/arm/src/cxd56xx/cxd56_timer.c b/arch/arm/src/cxd56xx/cxd56_timer.c index 405d81e0ff1d0..8a0faee8d70b0 100644 --- a/arch/arm/src/cxd56xx/cxd56_timer.c +++ b/arch/arm/src/cxd56xx/cxd56_timer.c @@ -365,7 +365,7 @@ static int cxd56_getstatus(FAR struct timer_lowerhalf_s *lower, * Input Parameters: * lower - A pointer the publicly visible representation of the "lower * half" driver state structure. - * timeout - The new timeout value in milliseconds. + * timeout - The new timeout value in microseconds. * * Returned Values: * Zero on success; a negated errno value on failure. diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index 2dcbb920106f3..e4b85c97bc903 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -94,14 +95,14 @@ static void uart0_semgive(sem_t *id); * FarAPI prototypes ****************************************************************************/ -int PD_UartInit(int ch); -int PD_UartUninit(int ch); -int PD_UartConfiguration(int ch, int baudrate, int databits, +int fw_pd_uartinit(int ch); +int fw_pd_uartuninit(int ch); +int fw_pd_uartconfiguration(int ch, int baudrate, int databits, int parity, int stopbit, int flowctrl); -int PD_UartEnable(int ch); -int PD_UartDisable(int ch); -int PD_UartReceive(int ch, void *buf, int size, int leave); -int PD_UartSend(int ch, void *buf, int size, int leave); +int fw_pd_uartenable(int ch); +int fw_pd_uartdisable(int ch); +int fw_pd_uartreceive(int ch, void *buf, int size, int leave); +int fw_pd_uartsend(int ch, void *buf, int size, int leave); /**************************************************************************** * Private Data @@ -158,7 +159,7 @@ static int uart0_open(FAR struct file *filep) return OK; } - ret = PD_UartInit(0); + ret = fw_pd_uartinit(0); if (ret < 0) { set_errno(EFAULT); @@ -175,7 +176,7 @@ static int uart0_open(FAR struct file *filep) /* Enable UART0 pin configuration */ -#ifdef CONFIG_UART0_FLOWCONTROL +#ifdef CONFIG_CXD56_UART0_FLOWCONTROL flowctl = 1; CXD56_PIN_CONFIGS(PINCONFS_SPI2_UART0); #else @@ -183,21 +184,21 @@ static int uart0_open(FAR struct file *filep) CXD56_PIN_CONFIGS(PINCONFS_SPI2A_UART0); #endif - ret = PD_UartConfiguration(0, CONFIG_CXD56_UART0_BAUD, + ret = fw_pd_uartconfiguration(0, CONFIG_CXD56_UART0_BAUD, bits, CONFIG_CXD56_UART0_PARITY, stop, flowctl); if (ret < 0) { - PD_UartUninit(0); + fw_pd_uartuninit(0); set_errno(EINVAL); return ERROR; } - ret = PD_UartEnable(0); + ret = fw_pd_uartenable(0); if (ret < 0) { - PD_UartUninit(0); + fw_pd_uartuninit(0); set_errno(EFAULT); return ERROR; } @@ -215,12 +216,12 @@ static int uart0_close(FAR struct file *filep) if (inode->i_crefs == 1) { - PD_UartDisable(0); - PD_UartUninit(0); + fw_pd_uartdisable(0); + fw_pd_uartuninit(0); /* Disable UART0 pin by changing Hi-Z GPIO */ -#ifdef CONFIG_UART0_FLOWCONTROL +#ifdef CONFIG_CXD56_UART0_FLOWCONTROL CXD56_PIN_CONFIGS(PINCONFS_SPI2_GPIO); #else CXD56_PIN_CONFIGS(PINCONFS_SPI2A_GPIO); @@ -241,9 +242,7 @@ static ssize_t uart0_read(FAR struct file *filep, uart0_semtake(&g_lock); - /* Always blocking */ - - ret = PD_UartReceive(0, buffer, len, 0); + ret = fw_pd_uartreceive(0, buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); uart0_semgive(&g_lock); @@ -267,9 +266,7 @@ static ssize_t uart0_write(FAR struct file *filep, uart0_semtake(&g_lock); - /* Always blocking */ - - ret = PD_UartSend(0, (FAR void *)buffer, len, 0); + ret = fw_pd_uartsend(0, (FAR void *)buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); uart0_semgive(&g_lock); diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index 5a90f1a737d1e..2b9731c585750 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -162,7 +162,7 @@ struct ge2d_copycmd_s uint32_t reserved[3]; } __attribute__ ((aligned(16))); -/* Raster operation (ROP) command (48 bytes) */ +/* Raster operation (ROP) command (32 bytes + scaling OP 16 bytes) */ struct ge2d_ropcmd_s { @@ -181,7 +181,10 @@ struct ge2d_ropcmd_s uint16_t patpitch; /* 0x1c */ uint8_t pathoffset; /* 0x1e */ uint8_t patvoffset; /* 0x1f */ + } __attribute__ ((aligned(16))); +struct ge2d_ropcmd_scaling_s + { uint16_t desth; /* 0x20 */ uint16_t destv; /* 0x22 */ uint16_t ratioh; /* 0x24 */ @@ -307,6 +310,7 @@ static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, uint8_t rop, uint8_t options, uint16_t patcolor) { struct ge2d_ropcmd_s *rc = (struct ge2d_ropcmd_s *)cmdbuf; + struct ge2d_ropcmd_scaling_s *sc; uint16_t rv; uint16_t rh; uint16_t cmd = ROPCMD; @@ -356,17 +360,34 @@ static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, rc->daddr = (uint32_t) (uintptr_t) destaddr | MSEL; rc->spitch = srcpitch - 1; rc->dpitch = destpitch - 1; - rc->desth = destwidth - 1; - rc->destv = destheight - 1; - rc->ratiov = rv - 1; - rc->ratioh = rh - 1; - rc->hphaseinit = 1; - rc->vphaseinit = 1; - rc->intpmode = 0; /* XXX: HV Linear interpolation */ + + /* Shift to next command area */ + + cmdbuf = (void *)((uintptr_t) cmdbuf + sizeof(struct ge2d_ropcmd_s)); + + /* Set scaling information */ + + if (cmd & SCALING) + { + sc = (struct ge2d_ropcmd_scaling_s *)cmdbuf; + + sc->desth = destwidth - 1; + sc->destv = destheight - 1; + sc->ratiov = rv - 1; + sc->ratioh = rh - 1; + sc->hphaseinit = 1; + sc->vphaseinit = 1; + sc->intpmode = 0; /* XXX: HV Linear interpolation */ + + /* Shift to next command area */ + + cmdbuf = (void *)((uintptr_t) cmdbuf + + sizeof(struct ge2d_ropcmd_scaling_s)); + } /* return next command area */ - return (void *)((uintptr_t) cmdbuf + sizeof(struct ge2d_ropcmd_s)); + return cmdbuf; } static void *set_ab_cmd(void *cmdbuf, void *srcaddr, void *destaddr, diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c index 30816ced9a8c3..3482ad163646f 100644 --- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c +++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c @@ -354,7 +354,7 @@ typedef enum * Public Function Prototypes ****************************************************************************/ -extern uint32_t as_aca_control(uint8_t type, uint32_t param); +extern uint32_t fw_as_acacontrol(uint8_t type, uint32_t param); /**************************************************************************** * Private Functions @@ -634,7 +634,7 @@ void get_pwon_out_param(as_aca_pulco_out_param_t *param) CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) { - if (as_aca_control(AS_ACA_CHECK_ID, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_CHECK_ID, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_CHKID; } @@ -642,7 +642,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) as_aca_pulco_param_t pwon_param; get_pwon_param(&pwon_param); - if (as_aca_control(AS_ACA_POWER_ON_COMMON, (uint32_t)&pwon_param) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_COMMON, (uint32_t)&pwon_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON; } @@ -650,7 +650,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) as_ser_des_param_t serial_param; get_serial_param(&serial_param); - if (as_aca_control(AS_ACA_SET_SERDES, (uint32_t)&serial_param) != 0) + if (fw_as_acacontrol(AS_ACA_SET_SERDES, (uint32_t)&serial_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SERIAL; } @@ -660,7 +660,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void) { - if (as_aca_control(AS_ACA_POWER_OFF_COMMON, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_OFF_COMMON, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF; } @@ -670,7 +670,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_micbias(void) { - if (as_aca_control(AS_ACA_POWER_ON_MICBIAS, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_MICBIAS, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_MBIAS; } @@ -684,7 +684,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_input(FAR cxd56_audio_mic_gain_t *gain get_input_param(&pwon_input_param, gain); - if (as_aca_control(AS_ACA_POWER_ON_INPUT, (uint32_t)&pwon_input_param) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_INPUT, (uint32_t)&pwon_input_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_INPUT; } @@ -698,7 +698,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_smaster(void) get_smaster_param(&smaster_param); - if (as_aca_control(AS_ACA_SET_SMASTER, (uint32_t)&smaster_param) != 0) + if (fw_as_acacontrol(AS_ACA_SET_SMASTER, (uint32_t)&smaster_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SET_SMASTER; } @@ -712,7 +712,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void) get_pwon_out_param(&pwon_output_param); - if (as_aca_control(AS_ACA_POWER_ON_OUTPUT, (uint32_t)&pwon_output_param) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_OUTPUT, (uint32_t)&pwon_output_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_OUTPUT; } @@ -722,7 +722,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void) { - if (as_aca_control(AS_ACA_POWER_OFF_INPUT, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_OFF_INPUT, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF_INPUT; } @@ -732,7 +732,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void) { - if (as_aca_control(AS_ACA_POWER_OFF_OUTPUT, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_OFF_OUTPUT, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF_OUTPUT; } @@ -742,7 +742,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void) { - if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_SP) != 0) + if (fw_as_acacontrol(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_SP) != 0) { return CXD56_AUDIO_ECODE_ANA_ENABLE_OUTPUT; } @@ -752,7 +752,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_disable_output(void) { - if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_OFF) != 0) + if (fw_as_acacontrol(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_OFF) != 0) { return CXD56_AUDIO_ECODE_ANA_DISABLE_OUTPUT; } @@ -766,7 +766,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain) get_input_param(&mic_gain_param, gain); - if (as_aca_control(AS_ACA_INIT_AMIC, (uint32_t)&mic_gain_param) != 0) + if (fw_as_acacontrol(AS_ACA_INIT_AMIC, (uint32_t)&mic_gain_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SET_MICGAIN; } @@ -776,7 +776,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain) CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void) { - if (as_aca_control(AS_ACA_SET_AMIC_BOOT_DONE, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_SET_AMIC_BOOT_DONE, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_NOTIFY_MICBOOT; } @@ -786,12 +786,12 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void) CXD56_AUDIO_ECODE cxd56_audio_aca_read_reg(as_aca_pulco_reg_param_t *param) { - as_aca_control(AS_ACA_GET_REGISTER, (uint32_t)param); + fw_as_acacontrol(AS_ACA_GET_REGISTER, (uint32_t)param); return CXD56_AUDIO_ECODE_OK; } CXD56_AUDIO_ECODE cxd56_audio_aca_write_reg(as_aca_pulco_reg_param_t *param) { - as_aca_control(AS_ACA_SET_REGISTER, (uint32_t)param); + fw_as_acacontrol(AS_ACA_SET_REGISTER, (uint32_t)param); return CXD56_AUDIO_ECODE_OK; } diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_power.h b/boards/arm/cxd56xx/spresense/include/cxd56_power.h index f8b5811f31bc6..35ec56ce1d598 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_power.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_power.h @@ -133,6 +133,24 @@ int board_power_setup(int status); int board_power_control(int target, bool en); +/**************************************************************************** + * Name: board_power_control_tristate + * + * Description: + * Power on/off/HiZ the device on the board. + * (HiZ is available only for PMIC_TYPE_GPO.) + * + * Input Parameter: + * target : PMIC channel + * value : 1 (ON), 0 (OFF), -1(HiZ) + * + * Returned Value: + * 0 on success, else a negative error code + * + ****************************************************************************/ + +int board_power_control_tristate(int target, int value); + /**************************************************************************** * Name: board_power_monitor * @@ -143,6 +161,22 @@ int board_power_control(int target, bool en); bool board_power_monitor(int target); +/**************************************************************************** + * Name: board_power_monitor_tristate + * + * Description: + * Get status of Power on/off/HiZ the device on the board. + * + * Input Parameter: + * target : PMIC channel + * + * Returned Value: + * 1 (ON), 0 (OFF), -1(HiZ) + * + ****************************************************************************/ + +int board_power_monitor_tristate(int target); + /**************************************************************************** * Name: board_flash_power_control * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index fd572e0aa996d..23a08ee28457d 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -220,6 +220,56 @@ int board_power_control(int target, bool en) if (pfunc) { ret = pfunc(PMIC_GET_CH(target), en); + + /* If RTC clock is unstable, delay 1 tick for PMIC GPO setting. */ + + if (!g_rtc_enabled && (PMIC_GET_TYPE(target) == PMIC_TYPE_GPO)) + { + usleep(1); + } + } + + return ret; +} + +/**************************************************************************** + * Name: board_power_control_tristate + * + * Description: + * Power on/off/HiZ the device on the board. + * (HiZ is available only for PMIC_TYPE_GPO.) + * + * Input Parameter: + * target : PMIC channel + * value : 1 (ON), 0 (OFF), -1(HiZ) + * + * Returned Value: + * 0 on success, else a negative error code + * + ****************************************************************************/ + +int board_power_control_tristate(int target, int value) +{ + int ret = 0; + bool en; + + if ((PMIC_GET_TYPE(target) == PMIC_TYPE_GPO) && (value < 0)) + { + /* set HiZ to PMIC GPO channel */ + + ret = cxd56_pmic_set_gpo_hiz(PMIC_GET_CH(target)); + + /* If RTC clock is unstable, delay 1 tick for PMIC setting. */ + + if (!g_rtc_enabled) + { + usleep(1); + } + } + else + { + en = value ? true : false; + ret = board_power_control(target, en); } return ret; @@ -263,6 +313,38 @@ bool board_power_monitor(int target) return ret; } +/**************************************************************************** + * Name: board_power_monitor_tristate + * + * Description: + * Get status of Power on/off/HiZ the device on the board. + * + * Input Parameter: + * target : PMIC channel + * + * Returned Value: + * 1 (ON), 0 (OFF), -1(HiZ) + * + ****************************************************************************/ + +int board_power_monitor_tristate(int target) +{ + int ret = 0; + bool en; + + if (PMIC_GET_TYPE(target) == PMIC_TYPE_GPO) + { + ret = cxd56_pmic_get_gpo_hiz(PMIC_GET_CH(target)); + } + else + { + en = board_power_monitor(target); + ret = en ? 1 : 0; + } + + return ret; +} + /**************************************************************************** * Name: board_flash_power_control * From 7daa1101444837e24b38ec6c252f4b7075a40dff Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Fri, 18 Sep 2020 15:48:50 +0900 Subject: [PATCH 02/18] Revert "Merge release-v2.0.2 into new-master for v2.0.2 release (#14)" This reverts commit 8e92a697b72b5f3f0fadf2b569117dab899aac26. Because, this merge commit should be use "merge" option, not a "squash". --- arch/arm/include/cxd56xx/gnss.h | 2 +- arch/arm/src/cxd56xx/cxd56_adc.c | 2 +- arch/arm/src/cxd56xx/cxd56_farapi.c | 4 +- arch/arm/src/cxd56xx/cxd56_farapistub.S | 530 +++++++++--------- arch/arm/src/cxd56xx/cxd56_farapistub.h | 2 +- arch/arm/src/cxd56xx/cxd56_geofence.c | 26 +- arch/arm/src/cxd56xx/cxd56_gnss.c | 130 ++--- arch/arm/src/cxd56xx/cxd56_gnss_api.h | 152 ++--- arch/arm/src/cxd56xx/cxd56_pmic.c | 107 +--- arch/arm/src/cxd56xx/cxd56_pmic.h | 16 - arch/arm/src/cxd56xx/cxd56_powermgr.c | 12 +- arch/arm/src/cxd56xx/cxd56_scu.c | 24 +- arch/arm/src/cxd56xx/cxd56_sfc.c | 24 +- arch/arm/src/cxd56xx/cxd56_timer.c | 2 +- arch/arm/src/cxd56xx/cxd56_uart0.c | 41 +- .../arm/cxd56xx/common/src/cxd56_imageproc.c | 39 +- .../cxd56xx/drivers/audio/cxd56_audio_aca.c | 34 +- .../cxd56xx/spresense/include/cxd56_power.h | 34 -- .../arm/cxd56xx/spresense/src/cxd56_power.c | 82 --- 19 files changed, 523 insertions(+), 740 deletions(-) diff --git a/arch/arm/include/cxd56xx/gnss.h b/arch/arm/include/cxd56xx/gnss.h index 459d578344157..98348afad0b71 100644 --- a/arch/arm/include/cxd56xx/gnss.h +++ b/arch/arm/include/cxd56xx/gnss.h @@ -565,7 +565,7 @@ extern "C" #define CXD56_GNSS_IOCTL_INVAL 0 #define CXD56_GNSS_IOCTL_MAX 54 -/* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for fw_gd_start */ +/* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for GD_Start */ #define CXD56_GNSS_STMOD_COLD 0 /* Cold Start */ #define CXD56_GNSS_STMOD_WARM 1 /* Warm Start */ diff --git a/arch/arm/src/cxd56xx/cxd56_adc.c b/arch/arm/src/cxd56xx/cxd56_adc.c index 1343bf6a54712..f9cc3973f58fb 100644 --- a/arch/arm/src/cxd56xx/cxd56_adc.c +++ b/arch/arm/src/cxd56xx/cxd56_adc.c @@ -126,7 +126,7 @@ /* Input Gain setting */ -#define INPUT_GAIN(a, g1, g2) (((a) << 24) | ((g2) << 16) | ((g1) << 12)) +#define INPUT_GAIN(a, g2, g1) (((a) << 24) | ((g2) << 16) | ((g1) << 12)) #define INPUT_GAIN_MASK INPUT_GAIN(3, 15, 15) #define INPUT_GAIN_MINUS_6DB INPUT_GAIN(2, 0, 0) #define INPUT_GAIN_THROUGH INPUT_GAIN(0, 0, 0) diff --git a/arch/arm/src/cxd56xx/cxd56_farapi.c b/arch/arm/src/cxd56xx/cxd56_farapi.c index 2b4c0d08946d3..6ed3510a41b77 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapi.c +++ b/arch/arm/src/cxd56xx/cxd56_farapi.c @@ -55,7 +55,7 @@ #include "cxd56_farapistub.h" #include "hardware/cxd5602_backupmem.h" -int fw_pm_wakeupcpu(int cpuid); +int PM_WakeUpCpu(int cpuid); /**************************************************************************** * Pre-processor Definitions @@ -209,7 +209,7 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) if (((gnscken & GNSDSP_CKEN_P1) != GNSDSP_CKEN_P1) && ((gnscken & GNSDSP_CKEN_COP) != GNSDSP_CKEN_COP)) { - fw_pm_wakeupcpu(GPS_CPU_ID); + PM_WakeUpCpu(GPS_CPU_ID); } } #endif diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.S b/arch/arm/src/cxd56xx/cxd56_farapistub.S index 94bb44bff9fdc..8d28ba38e6694 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.S +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.S @@ -57,141 +57,141 @@ .align 2 3: - /* fw_pm_gpspllclocksetsource */ + /* PM_GpsPllClockSetSource */ nop nop - /* fw_pm_pmicgetchargingporttype */ + /* PM_PmicGetChargingPortType */ nop nop - /* fw_pm_pmicsetchargingcurrentvalue */ + /* PM_PmicSetChargingCurrentValue */ nop nop - /* fw_pm_pmicstartcharging */ + /* PM_PmicStartCharging */ nop nop - /* fw_pm_pmicstopcharging */ + /* PM_PmicStopCharging */ nop nop - /* fw_pm_peripoweron */ + /* PM_PeriPowerOn */ nop nop - /* fw_pm_peripoweroff */ + /* PM_PeriPowerOff */ nop nop - /* fw__pm_periclockenable */ + /* _PM_PeriClockEnable */ nop nop - /* fw__pm_periclockdisable */ + /* _PM_PeriClockDisable */ nop nop - /* fw__pm_updatecpufreqinfo */ + /* _PM_UpdateCpuFreqInfo */ nop nop - /* fw_pm_pmicpoweron */ + /* PM_PmicPowerOn */ nop nop - /* fw_pm_pmicpoweroff */ + /* PM_PmicPowerOff */ nop nop - /* fw_pm_setwakeuptrigger */ + /* PM_SetWakeupTrigger */ nop nop - /* fw_pm_hostifclockenable */ + /* PM_HostifClockEnable */ nop nop - /* fw_pm_hostifclockdisable */ + /* PM_HostifClockDisable */ nop nop - .global fw_pm_startcpu + .global PM_StartCpu .thumb_func -fw_pm_startcpu: +PM_StartCpu: mov r12, pc b 1b - .global fw_pm_stopcpu + .global PM_StopCpu .thumb_func -fw_pm_stopcpu: +PM_StopCpu: mov r12, pc b 1b - .global fw_pm_sleepcpu + .global PM_SleepCpu .thumb_func -fw_pm_sleepcpu: +PM_SleepCpu: mov r12, pc b 1b - .global fw_pm_wakeupcpu + .global PM_WakeUpCpu .thumb_func -fw_pm_wakeupcpu: +PM_WakeUpCpu: mov r12, pc b 1b - .global fw_pm_coldsleep + .global PM_ColdSleep .thumb_func -fw_pm_coldsleep: +PM_ColdSleep: mov r12, pc b 1b - .global fw_pm_deepsleep + .global PM_DeepSleep .thumb_func -fw_pm_deepsleep: +PM_DeepSleep: mov r12, pc b 1b - .global fw_pm_reboot + .global PM_Reboot .thumb_func -fw_pm_reboot: +PM_Reboot: mov r12, pc b 1b - .global fw_pm_loadimage + .global PM_LoadImage .thumb_func -fw_pm_loadimage: +PM_LoadImage: mov r12, pc b 1b - /* fw_pm_loadimagetoaddress */ + /* PM_LoadImageToAddress */ nop nop - /* fw_pm_ramcontrolbyaddress */ + /* PM_RamControlByAddress */ nop nop - /* fw_pm_changeclock */ + /* PM_ChangeClock */ nop nop - .global fw_pm_pmiccontrol + .global pm_pmic_control .thumb_func -fw_pm_pmiccontrol: +pm_pmic_control: mov r12, pc b 1b - /* fw_pm_bootcpu */ + /* PM_BootCpu */ nop nop - /* fw_pm_bootcpuwithwaitmode */ + /* PM_BootCpuWithWaitMode */ nop nop - /* fw_pm_getclock */ + /* PM_GetClock */ nop nop @@ -229,95 +229,95 @@ _modulelist_power_mgr: .align 2 3: - /* fw_fm_getregistryvalue */ + /* FM_GetRegistryValue */ nop nop - /* fw_fm_setregistryvalue */ + /* FM_SetRegistryValue */ nop nop - /* fw_fm_setregistryvaluelist */ + /* FM_SetRegistryValueList */ nop nop - /* fw_fm_deleteregistrykey */ + /* FM_DeleteRegistryKey */ nop nop - /* fw_fm_generateregistrykey */ + /* FM_GenerateRegistryKey */ nop nop - /* fw_fm_sync */ + /* FM_Sync */ nop nop - /* fw_fm_fileopen */ + /* FM_FileOpen */ nop nop - /* fw_fm_fileclose */ + /* FM_FileClose */ nop nop - /* fw_fm_fileread */ + /* FM_FileRead */ nop nop - /* fw_fm_filewrite */ + /* FM_FileWrite */ nop nop - /* fw_fm_fileseek */ + /* FM_FileSeek */ nop nop - /* fw_fm_fileflush */ + /* FM_FileFlush */ nop nop - /* fw_fm_filedelete */ + /* FM_FileDelete */ nop nop - .global fw_fm_rawwrite + .global FM_RawWrite .thumb_func -fw_fm_rawwrite: +FM_RawWrite: mov r12, pc b 1b - .global fw_fm_rawread + .global FM_RawRead .thumb_func -fw_fm_rawread: +FM_RawRead: mov r12, pc b 1b - .global fw_fm_rawerasesector + .global FM_RawEraseSector .thumb_func -fw_fm_rawerasesector: +FM_RawEraseSector: mov r12, pc b 1b - /* fw_fm_filerename */ + /* FM_FileRename */ nop nop - /* fw_fm_filegetattr */ + /* FM_FileGetAttr */ nop nop - /* fw_fm_filesetattr */ + /* FM_FileSetAttr */ nop nop - /* fw_fm_fileclearattr */ + /* FM_FileClearAttr */ nop nop - .global fw_fm_rawverifywrite + .global FM_RawVerifyWrite .thumb_func -fw_fm_rawverifywrite: +FM_RawVerifyWrite: mov r12, pc b 1b @@ -355,39 +355,39 @@ _modulelist_flash_mgr: .align 2 3: - /* fw_sys_rtcmgrsettime */ + /* SYS_RtcMgrSetTime */ nop nop - /* fw_sys_rtcmgrgettime */ + /* SYS_RtcMgrGetTime */ nop nop - /* fw_sys_rtcmgrconvtime */ + /* SYS_RtcMgrConvTime */ nop nop - /* fw_sys_rtcmgrconvcalendartime */ + /* SYS_RtcMgrConvCalendarTime */ nop nop - /* fw_sys_rtcmgrsetcalendartime */ + /* SYS_RtcMgrSetCalendarTime */ nop nop - /* fw_sys_rtcmgrgetcalendartime */ + /* SYS_RtcMgrGetCalendarTime */ nop nop - /* fw_sys_rtcmgradjusttime */ + /* SYS_RtcMgrAdjustTime */ nop nop - /* fw_sys_rtcmgrrequestalarm */ + /* SYS_RtcMgrRequestAlarm */ nop nop - /* fw_sys_rtcmgrcancelalarm */ + /* SYS_RtcMgrCancelAlarm */ nop nop @@ -425,131 +425,131 @@ _modulelist_rtc_mgr: .align 2 3: - /* fw_gnsp_changeclockboot */ + /* GNSP_ChangeClockBoot */ nop nop - /* fw_gnsp_changeclocknormal */ + /* GNSP_ChangeClockNormal */ nop nop - /* fw_gnsp_setattribute */ + /* GNSP_SetAttribute */ nop nop - /* fw_gnsp_getpowerstatus */ + /* GNSP_GetPowerStatus */ nop nop - /* fw_gnsp_pongnss */ + /* GNSP_PonGnss */ nop nop - /* fw_gnsp_poffgnss */ + /* GNSP_PoffGnss */ nop nop - /* fw_gnsp_pofflna */ + /* GNSP_PoffLNA */ nop nop - /* fw_gnsp_sleep */ + /* GNSP_Sleep */ nop nop - /* fw_gnsp_wakeup */ + /* GNSP_Wakeup */ nop nop - /* fw_gnsp_setwakeuptime */ + /* GNSP_SetWakeupTime */ nop nop - /* fw_gnsp_getattribute */ + /* GNSP_GetAttribute */ nop nop - /* fw_gnsp_clockon */ + /* GNSP_ClockOn */ nop nop - /* fw_gnsp_clockoff */ + /* GNSP_ClockOff */ nop nop - /* fw_gnsp_changemode */ + /* GNSP_ChangeMode */ nop nop - /* fw_gnsp_enableio */ + /* GNSP_EnableIo */ nop nop - /* fw_gnsp_controlgpioout */ + /* GNSP_ControlGpioOut */ nop nop - /* fw_gnsp_debug */ + /* GNSP_Debug */ nop nop - /* fw_gnsp_changeclockrtc */ + /* GNSP_ChangeClockRtc */ nop nop - /* fw_gnsp_changeclocksfcclkup */ + /* GNSP_ChangeClockSFCClkup */ nop nop - /* fw_gnsp_changeclocksfcclkdwn */ + /* GNSP_ChangeClockSFCClkdwn */ nop nop - /* fw_gnsp_changeclockgpscpuclkup */ + /* GNSP_ChangeClockGPSCPUClkup */ nop nop - /* fw_gnsp_changeclockgpscpuclkdwn */ + /* GNSP_ChangeClockGPSCPUClkdwn */ nop nop - /* fw_gnsp_getbootcause */ + /* GNSP_GetBootCause */ nop nop - /* fw_gnsp_getwakeuptrigger */ + /* GNSP_GetWakeupTrigger */ nop nop - /* fw_gnsp_selfreboot */ + /* GNSP_SelfReboot */ nop nop - /* fw_gnsp_start_keepppsout */ + /* GNSP_Start_KeepPPSOut */ nop nop - /* fw_gnsp_stop_keepppsout */ + /* GNSP_Stop_KeepPPSOut */ nop nop - /* fw_gnsp_start_keepitpout */ + /* GNSP_Start_KeepITPOut */ nop nop - /* fw_gnsp_stop_keepitpout */ + /* GNSP_Stop_KeepITPOut */ nop nop - /* fw_gnsp_setsleepstate */ + /* GNSP_SetSleepState */ nop nop - /* fw_gnsp_freesysmemory */ + /* GNSP_FreeSysMemory */ nop nop - /* fw_gnsp_readalmanacfile */ + /* GNSP_ReadAlmanacFile */ nop nop @@ -587,9 +587,9 @@ _modulelist_gnss_pwr: .align 2 3: - .global fw_as_acacontrol + .global as_aca_control .thumb_func -fw_as_acacontrol: +as_aca_control: mov r12, pc b 1b @@ -627,9 +627,9 @@ _modulelist_aca: .align 2 3: - .global fw_pd_pinconfigs + .global PD_PinConfigs .thumb_func -fw_pd_pinconfigs: +PD_PinConfigs: mov r12, pc b 1b @@ -667,45 +667,45 @@ _modulelist_pinconfig: .align 2 3: - .global fw_pd_uartinit + .global PD_UartInit .thumb_func -fw_pd_uartinit: +PD_UartInit: mov r12, pc b 1b - .global fw_pd_uartuninit + .global PD_UartUninit .thumb_func -fw_pd_uartuninit: +PD_UartUninit: mov r12, pc b 1b - .global fw_pd_uartconfiguration + .global PD_UartConfiguration .thumb_func -fw_pd_uartconfiguration: +PD_UartConfiguration: mov r12, pc b 1b - .global fw_pd_uartenable + .global PD_UartEnable .thumb_func -fw_pd_uartenable: +PD_UartEnable: mov r12, pc b 1b - .global fw_pd_uartdisable + .global PD_UartDisable .thumb_func -fw_pd_uartdisable: +PD_UartDisable: mov r12, pc b 1b - .global fw_pd_uartreceive + .global PD_UartReceive .thumb_func -fw_pd_uartreceive: +PD_UartReceive: mov r12, pc b 1b - .global fw_pd_uartsend + .global PD_UartSend .thumb_func -fw_pd_uartsend: +PD_UartSend: mov r12, pc b 1b @@ -743,45 +743,45 @@ _modulelist_uart: .align 2 3: - .global fw_um_init + .global UM_Init .thumb_func -fw_um_init: +UM_Init: mov r12, pc b 1b - .global fw_um_open + .global UM_Open .thumb_func -fw_um_open: +UM_Open: mov r12, pc b 1b - .global fw_um_commit + .global UM_Commit .thumb_func -fw_um_commit: +UM_Commit: mov r12, pc b 1b - .global fw_um_close + .global UM_Close .thumb_func -fw_um_close: +UM_Close: mov r12, pc b 1b - .global fw_um_checkpoint + .global UM_CheckPoint .thumb_func -fw_um_checkpoint: +UM_CheckPoint: mov r12, pc b 1b - .global fw_um_doupdatesequence + .global UM_DoUpdateSequence .thumb_func -fw_um_doupdatesequence: +UM_DoUpdateSequence: mov r12, pc b 1b - .global fw_um_abort + .global UM_Abort .thumb_func -fw_um_abort: +UM_Abort: mov r12, pc b 1b @@ -819,387 +819,387 @@ _modulelist_update_mgr: .align 2 3: - .global fw_gd_start + .global GD_Start .thumb_func -fw_gd_start: +GD_Start: mov r12, pc b 1b - .global fw_gd_stop + .global GD_Stop .thumb_func -fw_gd_stop: +GD_Stop: mov r12, pc b 1b - .global fw_gd_selectsatellitesystem + .global GD_SelectSatelliteSystem .thumb_func -fw_gd_selectsatellitesystem: +GD_SelectSatelliteSystem: mov r12, pc b 1b - .global fw_gd_getsatellitesystem + .global GD_GetSatelliteSystem .thumb_func -fw_gd_getsatellitesystem: +GD_GetSatelliteSystem: mov r12, pc b 1b - .global fw_gd_setreceiverpositionellipsoidal + .global GD_SetReceiverPositionEllipsoidal .thumb_func -fw_gd_setreceiverpositionellipsoidal: +GD_SetReceiverPositionEllipsoidal: mov r12, pc b 1b - .global fw_gd_setreceiverpositionorthogonal + .global GD_SetReceiverPositionOrthogonal .thumb_func -fw_gd_setreceiverpositionorthogonal: +GD_SetReceiverPositionOrthogonal: mov r12, pc b 1b - .global fw_gd_setoperationmode + .global GD_SetOperationMode .thumb_func -fw_gd_setoperationmode: +GD_SetOperationMode: mov r12, pc b 1b - .global fw_gd_getoperationmode + .global GD_GetOperationMode .thumb_func -fw_gd_getoperationmode: +GD_GetOperationMode: mov r12, pc b 1b - .global fw_gd_settcxooffset + .global GD_SetTcxoOffset .thumb_func -fw_gd_settcxooffset: +GD_SetTcxoOffset: mov r12, pc b 1b - .global fw_gd_gettcxooffset + .global GD_GetTcxoOffset .thumb_func -fw_gd_gettcxooffset: +GD_GetTcxoOffset: mov r12, pc b 1b - .global fw_gd_settime + .global GD_SetTime .thumb_func -fw_gd_settime: +GD_SetTime: mov r12, pc b 1b - .global fw_gd_getalmanac + .global GD_GetAlmanac .thumb_func -fw_gd_getalmanac: +GD_GetAlmanac: mov r12, pc b 1b - .global fw_gd_setalmanac + .global GD_SetAlmanac .thumb_func -fw_gd_setalmanac: +GD_SetAlmanac: mov r12, pc b 1b - .global fw_gd_getephemeris + .global GD_GetEphemeris .thumb_func -fw_gd_getephemeris: +GD_GetEphemeris: mov r12, pc b 1b - .global fw_gd_setephemeris + .global GD_SetEphemeris .thumb_func -fw_gd_setephemeris: +GD_SetEphemeris: mov r12, pc b 1b - .global fw_gd_getvarephemeris + .global GD_GetVarEphemeris .thumb_func -fw_gd_getvarephemeris: +GD_GetVarEphemeris: mov r12, pc b 1b - .global fw_gd_setvarephemeris + .global GD_SetVarEphemeris .thumb_func -fw_gd_setvarephemeris: +GD_SetVarEphemeris: mov r12, pc b 1b - .global fw_gd_startgpstest + .global GD_StartGpsTest .thumb_func -fw_gd_startgpstest: +GD_StartGpsTest: mov r12, pc b 1b - .global fw_gd_stopgpstest + .global GD_StopGpsTest .thumb_func -fw_gd_stopgpstest: +GD_StopGpsTest: mov r12, pc b 1b - .global fw_gd_getgpstestresult + .global GD_GetGpsTestResult .thumb_func -fw_gd_getgpstestresult: +GD_GetGpsTestResult: mov r12, pc b 1b - .global fw_gd_savebackupdata + .global GD_SaveBackupdata .thumb_func -fw_gd_savebackupdata: +GD_SaveBackupdata: mov r12, pc b 1b - .global fw_gd_erasebackup + .global GD_EraseBackup .thumb_func -fw_gd_erasebackup: +GD_EraseBackup: mov r12, pc b 1b - .global fw_gd_cepsetassistdata + .global GD_CepSetAssistData .thumb_func -fw_gd_cepsetassistdata: +GD_CepSetAssistData: mov r12, pc b 1b - .global fw_gd_ceperaseassistdata + .global GD_CepEraseAssistData .thumb_func -fw_gd_ceperaseassistdata: +GD_CepEraseAssistData: mov r12, pc b 1b - .global fw_gd_cepcheckassistdata + .global GD_CepCheckAssistData .thumb_func -fw_gd_cepcheckassistdata: +GD_CepCheckAssistData: mov r12, pc b 1b - .global fw_gd_cepgetagedata + .global GD_CepGetAgeData .thumb_func -fw_gd_cepgetagedata: +GD_CepGetAgeData: mov r12, pc b 1b - .global fw_gd_cepinitassistdata + .global GD_CepInitAssistData .thumb_func -fw_gd_cepinitassistdata: +GD_CepInitAssistData: mov r12, pc b 1b - .global fw_gd_setacquist + .global GD_SetAcquist .thumb_func -fw_gd_setacquist: +GD_SetAcquist: mov r12, pc b 1b - .global fw_gd_setframetime + .global GD_SetFrameTime .thumb_func -fw_gd_setframetime: +GD_SetFrameTime: mov r12, pc b 1b - .global fw_gd_settaugps + .global GD_SetTauGps .thumb_func -fw_gd_settaugps: +GD_SetTauGps: mov r12, pc b 1b - .global fw_gd_settimegps + .global GD_SetTimeGps .thumb_func -fw_gd_settimegps: +GD_SetTimeGps: mov r12, pc b 1b - .global fw_gd_clearreceiverinfo + .global GD_ClearReceiverInfo .thumb_func -fw_gd_clearreceiverinfo: +GD_ClearReceiverInfo: mov r12, pc b 1b - .global fw_gd_settowassist + .global GD_SetTowAssist .thumb_func -fw_gd_settowassist: +GD_SetTowAssist: mov r12, pc b 1b - .global fw_gd_setutcmodel + .global GD_SetUtcModel .thumb_func -fw_gd_setutcmodel: +GD_SetUtcModel: mov r12, pc b 1b - .global fw_gd_spectrumcontrol + .global GD_SpectrumControl .thumb_func -fw_gd_spectrumcontrol: +GD_SpectrumControl: mov r12, pc b 1b - .global fw_gd_readbuffer + .global GD_ReadBuffer .thumb_func -fw_gd_readbuffer: +GD_ReadBuffer: mov r12, pc b 1b - .global fw_gd_writebuffer + .global GD_WriteBuffer .thumb_func -fw_gd_writebuffer: +GD_WriteBuffer: mov r12, pc b 1b - .global fw_gd_setnotifymask + .global GD_SetNotifyMask .thumb_func -fw_gd_setnotifymask: +GD_SetNotifyMask: mov r12, pc b 1b - .global fw_gd_geoaddregion + .global GD_GeoAddRegion .thumb_func -fw_gd_geoaddregion: +GD_GeoAddRegion: mov r12, pc b 1b - .global fw_gd_geomodifyregion + .global GD_GeoModifyRegion .thumb_func -fw_gd_geomodifyregion: +GD_GeoModifyRegion: mov r12, pc b 1b - .global fw_gd_geodeleteregione + .global GD_GeoDeleteRegione .thumb_func -fw_gd_geodeleteregione: +GD_GeoDeleteRegione: mov r12, pc b 1b - .global fw_gd_geodeleteallregion + .global GD_GeoDeleteAllRegion .thumb_func -fw_gd_geodeleteallregion: +GD_GeoDeleteAllRegion: mov r12, pc b 1b - .global fw_gd_geogetregiondata + .global GD_GeoGetRegionData .thumb_func -fw_gd_geogetregiondata: +GD_GeoGetRegionData: mov r12, pc b 1b - .global fw_gd_geogetusedregionid + .global GD_GeoGetUsedRegionId .thumb_func -fw_gd_geogetusedregionid: +GD_GeoGetUsedRegionId: mov r12, pc b 1b - .global fw_gd_geosetopmode + .global GD_GeoSetOpMode .thumb_func -fw_gd_geosetopmode: +GD_GeoSetOpMode: mov r12, pc b 1b - .global fw_gd_geosetallrgionnotifyrequest + .global GD_GeoSetAllRgionNotifyRequest .thumb_func -fw_gd_geosetallrgionnotifyrequest: +GD_GeoSetAllRgionNotifyRequest: mov r12, pc b 1b - .global fw_gd_registergeofence + .global GD_RegisterGeofence .thumb_func -fw_gd_registergeofence: +GD_RegisterGeofence: mov r12, pc b 1b - .global fw_gd_releasegeofence + .global GD_ReleaseGeofence .thumb_func -fw_gd_releasegeofence: +GD_ReleaseGeofence: mov r12, pc b 1b - .global fw_gd_registerpvtlog + .global GD_RegisterPvtlog .thumb_func -fw_gd_registerpvtlog: +GD_RegisterPvtlog: mov r12, pc b 1b - .global fw_gd_releasepvtlog + .global GD_ReleasePvtlog .thumb_func -fw_gd_releasepvtlog: +GD_ReleasePvtlog: mov r12, pc b 1b - .global fw_gd_pvtlogdeletelog + .global GD_PvtlogDeleteLog .thumb_func -fw_gd_pvtlogdeletelog: +GD_PvtlogDeleteLog: mov r12, pc b 1b - .global fw_gd_pvtloggetlogstatus + .global GD_PvtlogGetLogStatus .thumb_func -fw_gd_pvtloggetlogstatus: +GD_PvtlogGetLogStatus: mov r12, pc b 1b - .global fw_gd_rtkstart + .global GD_RtkStart .thumb_func -fw_gd_rtkstart: +GD_RtkStart: mov r12, pc b 1b - .global fw_gd_rtkstop + .global GD_RtkStop .thumb_func -fw_gd_rtkstop: +GD_RtkStop: mov r12, pc b 1b - .global fw_gd_rtksetoutputinterval + .global GD_RtkSetOutputInterval .thumb_func -fw_gd_rtksetoutputinterval: +GD_RtkSetOutputInterval: mov r12, pc b 1b - .global fw_gd_rtkgetoutputinterval + .global GD_RtkGetOutputInterval .thumb_func -fw_gd_rtkgetoutputinterval: +GD_RtkGetOutputInterval: mov r12, pc b 1b - .global fw_gd_rtksetgnss + .global GD_RtkSetGnss .thumb_func -fw_gd_rtksetgnss: +GD_RtkSetGnss: mov r12, pc b 1b - .global fw_gd_rtkgetgnss + .global GD_RtkGetGnss .thumb_func -fw_gd_rtkgetgnss: +GD_RtkGetGnss: mov r12, pc b 1b - .global fw_gd_rtksetephnotify + .global GD_RtkSetEphNotify .thumb_func -fw_gd_rtksetephnotify: +GD_RtkSetEphNotify: mov r12, pc b 1b - .global fw_gd_rtkgetephnotify + .global GD_RtkGetEphNotify .thumb_func -fw_gd_rtkgetephnotify: +GD_RtkGetEphNotify: mov r12, pc b 1b - .global fw_gd_setusecase + .global GD_SetUseCase .thumb_func -fw_gd_setusecase: +GD_SetUseCase: mov r12, pc b 1b - .global fw_gd_getusecase + .global GD_GetUseCase .thumb_func -fw_gd_getusecase: +GD_GetUseCase: mov r12, pc b 1b - .global fw_gd_set1ppsoutput + .global GD_Set1ppsOutput .thumb_func -fw_gd_set1ppsoutput: +GD_Set1ppsOutput: mov r12, pc b 1b - .global fw_gd_get1ppsoutput + .global GD_Get1ppsOutput .thumb_func -fw_gd_get1ppsoutput: +GD_Get1ppsOutput: mov r12, pc b 1b diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.h b/arch/arm/src/cxd56xx/cxd56_farapistub.h index f411bc26cc1ea..1c3bdfbb47807 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.h +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.h @@ -36,6 +36,6 @@ #ifndef __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H #define __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H -#define FARAPISTUB_VERSION 20166 +#define FARAPISTUB_VERSION 20129 #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H */ diff --git a/arch/arm/src/cxd56xx/cxd56_geofence.c b/arch/arm/src/cxd56xx/cxd56_geofence.c index e8706ec58a3c7..f41a107c5b16b 100644 --- a/arch/arm/src/cxd56xx/cxd56_geofence.c +++ b/arch/arm/src/cxd56xx/cxd56_geofence.c @@ -166,7 +166,7 @@ FAR static int (*g_cmdlist[CXD56_GEOFENCE_IOCTL_MAX])(unsigned long) = static int cxd56_geofence_start(unsigned long arg) { - return fw_gd_registergeofence(); + return GD_RegisterGeofence(); } /**************************************************************************** @@ -186,7 +186,7 @@ static int cxd56_geofence_start(unsigned long arg) static int cxd56_geofence_stop(unsigned long arg) { - return fw_gd_releasegeofence(); + return GD_ReleaseGeofence(); } /**************************************************************************** @@ -215,7 +215,7 @@ static int cxd56_geofence_add_region(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = fw_gd_geoaddregion(reg_data->id, reg_data->latitude, reg_data->longitude, + ret = GD_GeoAddRegion(reg_data->id, reg_data->latitude, reg_data->longitude, reg_data->radius); return ret; @@ -247,7 +247,7 @@ static int cxd56_geofence_modify_region(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = fw_gd_geomodifyregion(reg_data->id, reg_data->latitude, + ret = GD_GeoModifyRegion(reg_data->id, reg_data->latitude, reg_data->longitude, reg_data->radius); return ret; @@ -279,7 +279,7 @@ static int cxd56_geofence_delete_region(unsigned long arg) } id = (uint8_t)arg; - ret = fw_gd_geodeleteregione(id); + ret = GD_GeoDeleteRegione(id); return ret; } @@ -303,7 +303,7 @@ static int cxd56_geofence_delete_all_region(unsigned long arg) { int ret; - ret = fw_gd_geodeleteallregion(); + ret = GD_GeoDeleteAllRegion(); return ret; } @@ -334,7 +334,7 @@ static int cxd56_geofence_get_region_data(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = fw_gd_geogetregiondata(reg_data->id, ®_data->latitude, + ret = GD_GeoGetRegionData(reg_data->id, ®_data->latitude, ®_data->longitude, ®_data->radius); return ret; @@ -362,7 +362,7 @@ static int cxd56_geofence_get_used_id(unsigned long arg) return -EINVAL; } - *(uint32_t *)arg = fw_gd_geogetusedregionid(); + *(uint32_t *)arg = GD_GeoGetUsedRegionId(); return 0; } @@ -386,7 +386,7 @@ static int cxd56_geofence_get_all_status(unsigned long arg) { int ret; - ret = fw_gd_geosetallrgionnotifyrequest(); + ret = GD_GeoSetAllRgionNotifyRequest(); return ret; } @@ -417,7 +417,7 @@ static int cxd56_geofence_set_mode(unsigned long arg) } mode = (FAR struct cxd56_geofence_mode_s *)arg; - ret = fw_gd_geosetopmode(mode->deadzone, mode->dwell_detecttime); + ret = GD_GeoSetOpMode(mode->deadzone, mode->dwell_detecttime); return ret; } @@ -561,9 +561,9 @@ static ssize_t cxd56_geofence_read(FAR struct file *filep, FAR char *buffer, goto _err; } - /* fw_gd_readbuffer returns copied data size or negative error code */ + /* GD_ReadBuffer returns copied data size or negative error code */ - ret = fw_gd_readbuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len); + ret = GD_ReadBuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len); _err: return ret; @@ -648,7 +648,7 @@ static int cxd56_geofence_poll(FAR struct file *filep, FAR struct pollfd *fds, priv->fds[i] = fds; fds->priv = &priv->fds[i]; - fw_gd_setnotifymask(CXD56_CPU1_DEV_GEOFENCE, FALSE); + GD_SetNotifyMask(CXD56_CPU1_DEV_GEOFENCE, FALSE); break; } } diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index e5b3104a02147..6cf88b46456cc 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -65,9 +65,9 @@ * External Defined Functions ****************************************************************************/ -extern int fw_pm_loadimage(int cpuid, const char* filename); -extern int fw_pm_startcpu(int cpuid, int wait); -extern int fw_pm_sleepcpu(int cpuid, int mode); +extern int PM_LoadImage(int cpuid, const char* filename); +extern int PM_StartCpu(int cpuid, int wait); +extern int PM_SleepCpu(int cpuid, int mode); /**************************************************************************** * Pre-processor Definitions @@ -480,7 +480,7 @@ static int cxd56_gnss_select_satellite_system(FAR struct file *filep, { uint32_t system = (uint32_t)arg; - return fw_gd_selectsatellitesystem(system); + return GD_SelectSatelliteSystem(system); } /**************************************************************************** @@ -512,7 +512,7 @@ static int cxd56_gnss_get_satellite_system(FAR struct file *filep, return -EINVAL; } - ret = fw_gd_getsatellitesystem(&system); + ret = GD_GetSatelliteSystem(&system); *(uint32_t *)arg = system; return ret; @@ -548,7 +548,7 @@ cxd56_gnss_set_receiver_position_ellipsoidal(FAR struct file *filep, pos = (FAR struct cxd56_gnss_ellipsoidal_position_s *)arg; - return fw_gd_setreceiverpositionellipsoidal(&pos->latitude, &pos->longitude, + return GD_SetReceiverPositionEllipsoidal(&pos->latitude, &pos->longitude, &pos->altitude); } @@ -580,7 +580,7 @@ static int cxd56_gnss_set_receiver_position_orthogonal(FAR struct file *filep, } pos = (FAR struct cxd56_gnss_orthogonal_position_s *)arg; - return fw_gd_setreceiverpositionorthogonal(pos->x, pos->y, pos->z); + return GD_SetReceiverPositionOrthogonal(pos->x, pos->y, pos->z); } /**************************************************************************** @@ -609,7 +609,7 @@ static int cxd56_gnss_set_ope_mode(FAR struct file *filep, unsigned long arg) ope_mode = (FAR struct cxd56_gnss_ope_mode_param_s *)arg; - return fw_gd_setoperationmode(ope_mode->mode, ope_mode->cycle); + return GD_SetOperationMode(ope_mode->mode, ope_mode->cycle); } /**************************************************************************** @@ -638,7 +638,7 @@ static int cxd56_gnss_get_ope_mode(FAR struct file *filep, unsigned long arg) ope_mode = (FAR struct cxd56_gnss_ope_mode_param_s *)arg; - return fw_gd_getoperationmode(&ope_mode->mode, &ope_mode->cycle); + return GD_GetOperationMode(&ope_mode->mode, &ope_mode->cycle); } /**************************************************************************** @@ -662,7 +662,7 @@ static int cxd56_gnss_set_tcxo_offset(FAR struct file *filep, { int32_t offset = (int32_t)arg; - return fw_gd_settcxooffset(offset); + return GD_SetTcxoOffset(offset); } /**************************************************************************** @@ -692,7 +692,7 @@ static int cxd56_gnss_get_tcxo_offset(FAR struct file *filep, return -EINVAL; } - ret = fw_gd_gettcxooffset(&offset); + ret = GD_GetTcxoOffset(&offset); *(uint32_t *)arg = offset; return ret; @@ -728,7 +728,7 @@ static int cxd56_gnss_set_time(FAR struct file *filep, unsigned long arg) date_time = (FAR struct cxd56_gnss_datetime_s *)arg; up_pm_acquire_freqlock(&g_lv_lock); - ret = fw_gd_settime(&date_time->date, &date_time->time); + ret = GD_SetTime(&date_time->date, &date_time->time); up_pm_release_freqlock(&g_lv_lock); return ret; @@ -762,7 +762,7 @@ static int cxd56_gnss_get_almanac(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return fw_gd_getalmanac(param->type, param->data, &almanac_size); + return GD_GetAlmanac(param->type, param->data, &almanac_size); } /**************************************************************************** @@ -792,7 +792,7 @@ static int cxd56_gnss_set_almanac(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return fw_gd_setalmanac(param->type, param->data); + return GD_SetAlmanac(param->type, param->data); } /**************************************************************************** @@ -823,7 +823,7 @@ static int cxd56_gnss_get_ephemeris(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return fw_gd_getephemeris(param->type, param->data, &ephemeris_size); + return GD_GetEphemeris(param->type, param->data, &ephemeris_size); } /**************************************************************************** @@ -853,7 +853,7 @@ static int cxd56_gnss_set_ephemeris(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return fw_gd_setephemeris(param->type, param->data); + return GD_SetEphemeris(param->type, param->data); } /**************************************************************************** @@ -895,7 +895,7 @@ static int cxd56_gnss_save_backup_data(FAR struct file *filep, do { - n = fw_gd_readbuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, + n = GD_ReadBuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, CONFIG_CXD56_GNSS_BACKUP_BUFFER_SIZE); if (n <= 0) { @@ -996,7 +996,7 @@ static int cxd56_gnss_close_cep_data(FAR struct file *filep, static int cxd56_gnss_check_cep_data(FAR struct file *filep, unsigned long arg) { - return fw_gd_cepcheckassistdata(); + return GD_CepCheckAssistData(); } /**************************************************************************** @@ -1026,7 +1026,7 @@ static int cxd56_gnss_get_cep_age(FAR struct file *filep, unsigned long arg) age = (FAR struct cxd56_gnss_cep_age_s *)arg; - return fw_gd_cepgetagedata(&age->age, &age->cepi); + return GD_CepGetAgeData(&age->age, &age->cepi); } /**************************************************************************** @@ -1080,7 +1080,7 @@ static int cxd56_gnss_set_acquist_data(FAR struct file *filep, acquist = (FAR struct cxd56_gnss_agps_acquist_s *)arg; - return fw_gd_setacquist(acquist->data, acquist->size); + return GD_SetAcquist(acquist->data, acquist->size); } /**************************************************************************** @@ -1110,7 +1110,7 @@ static int cxd56_gnss_set_frametime(FAR struct file *filep, unsigned long arg) frametime = (FAR struct cxd56_gnss_agps_frametime_s *)arg; - return fw_gd_setframetime(frametime->sec, frametime->frac); + return GD_SetFrameTime(frametime->sec, frametime->frac); } /**************************************************************************** @@ -1140,7 +1140,7 @@ static int cxd56_gnss_set_tau_gps(FAR struct file *filep, unsigned long arg) taugpstime = (FAR struct cxd56_gnss_agps_tau_gps_s *)arg; - return fw_gd_settaugps(&taugpstime->taugps); + return GD_SetTauGps(&taugpstime->taugps); } /**************************************************************************** @@ -1170,7 +1170,7 @@ static int cxd56_gnss_set_time_gps(FAR struct file *filep, unsigned long arg) time_gps = (FAR struct cxd56_gnss_agps_time_gps_s *)arg; - return fw_gd_settimegps(&time_gps->date, &time_gps->time); + return GD_SetTimeGps(&time_gps->date, &time_gps->time); } /**************************************************************************** @@ -1194,7 +1194,7 @@ static int cxd56_gnss_clear_receiver_info(FAR struct file *filep, { uint32_t clear_type = arg; - return fw_gd_clearreceiverinfo(clear_type); + return GD_ClearReceiverInfo(clear_type); } /**************************************************************************** @@ -1225,7 +1225,7 @@ static int cxd56_gnss_set_tow_assist(FAR struct file *filep, assist = (FAR struct cxd56_gnss_agps_tow_assist_s *)arg; - return fw_gd_settowassist(assist->data, assist->size); + return GD_SetTowAssist(assist->data, assist->size); } /**************************************************************************** @@ -1255,7 +1255,7 @@ static int cxd56_gnss_set_utc_model(FAR struct file *filep, unsigned long arg) model = (FAR struct cxd56_gnss_agps_utc_model_s *)arg; - return fw_gd_setutcmodel(model->data, model->size); + return GD_SetUtcModel(model->data, model->size); } /**************************************************************************** @@ -1286,7 +1286,7 @@ static int cxd56_gnss_control_spectrum(FAR struct file *filep, control = (FAR struct cxd56_gnss_spectrum_control_s *)arg; - return fw_gd_spectrumcontrol(control->time, control->enable, control->point1, + return GD_SpectrumControl(control->time, control->enable, control->point1, control->step1, control->point2, control->step2); } @@ -1338,12 +1338,12 @@ static int cxd56_gnss_start_test(FAR struct file *filep, unsigned long arg) /* set parameter */ info = (FAR struct cxd56_gnss_test_info_s *)arg; - fw_gd_startgpstest(info->satellite, info->reserve1, + GD_StartGpsTest(info->satellite, info->reserve1, info->reserve2, info->reserve3); /* start test */ - ret = fw_gd_start(CXD56_GNSS_STMOD_COLD); + ret = GD_Start(CXD56_GNSS_STMOD_COLD); } return ret; @@ -1371,12 +1371,12 @@ static int cxd56_gnss_stop_test(FAR struct file *filep, unsigned long arg) /* term test */ - ret = fw_gd_stopgpstest(); + ret = GD_StopGpsTest(); if(ret == OK) { /* stop test */ - ret = fw_gd_stop(); + ret = GD_Stop(); } /* Power off the LNA device */ @@ -1414,7 +1414,7 @@ static int cxd56_gnss_get_test_result(FAR struct file *filep, result = (FAR struct cxd56_gnss_test_result_s *)arg; - return fw_gd_getgpstestresult(&result->cn, &result->doppler); + return GD_GetGpsTestResult(&result->cn, &result->doppler); } /**************************************************************************** @@ -1498,7 +1498,7 @@ static int cxd56_gnss_set_signal(FAR struct file *filep, unsigned long arg) goto _err; } - fw_gd_setnotifymask(setting->gnsssig, FALSE); + GD_SetNotifyMask(setting->gnsssig, FALSE); sig->enable = 1; sig->pid = pid; @@ -1542,7 +1542,7 @@ static int cxd56_gnss_start_pvtlog(FAR struct file *filep, unsigned long arg) setting = (FAR struct cxd56_pvtlog_setting_s *)arg; - return fw_gd_registerpvtlog(setting->cycle, setting->threshold); + return GD_RegisterPvtlog(setting->cycle, setting->threshold); } /**************************************************************************** @@ -1563,7 +1563,7 @@ static int cxd56_gnss_start_pvtlog(FAR struct file *filep, unsigned long arg) static int cxd56_gnss_stop_pvtlog(FAR struct file *filep, unsigned long arg) { - return fw_gd_releasepvtlog(); + return GD_ReleasePvtlog(); } /**************************************************************************** @@ -1584,7 +1584,7 @@ static int cxd56_gnss_stop_pvtlog(FAR struct file *filep, unsigned long arg) static int cxd56_gnss_delete_pvtlog(FAR struct file *filep, unsigned long arg) { - return fw_gd_pvtlogdeletelog(); + return GD_PvtlogDeleteLog(); } /**************************************************************************** @@ -1615,7 +1615,7 @@ static int cxd56_gnss_get_pvtlog_status(FAR struct file *filep, status = (FAR struct cxd56_pvtlog_status_s *)arg; - return fw_gd_pvtloggetlogstatus(&status->status); + return GD_PvtlogGetLogStatus(&status->status); } /**************************************************************************** @@ -1647,7 +1647,7 @@ static int cxd56_gnss_start_rtk_output(FAR struct file *filep, setting = (FAR struct cxd56_rtk_setting_s *)arg; setting->sbasout = 0; - return fw_gd_rtkstart(setting); + return GD_RtkStart(setting); } /**************************************************************************** @@ -1669,7 +1669,7 @@ static int cxd56_gnss_start_rtk_output(FAR struct file *filep, static int cxd56_gnss_stop_rtk_output(FAR struct file *filep, unsigned long arg) { - return fw_gd_rtkstop(); + return GD_RtkStop(); } /**************************************************************************** @@ -1693,7 +1693,7 @@ static int cxd56_gnss_set_rtk_interval(FAR struct file *filep, { int interval = (int)arg; - return fw_gd_rtksetoutputinterval(interval); + return GD_RtkSetOutputInterval(interval); } /**************************************************************************** @@ -1723,7 +1723,7 @@ static int cxd56_gnss_get_rtk_interval(FAR struct file *filep, return -EINVAL; } - ret = fw_gd_rtkgetoutputinterval(&interval); + ret = GD_RtkGetOutputInterval(&interval); *(uint32_t *)arg = interval; return ret; @@ -1750,7 +1750,7 @@ static int cxd56_gnss_select_rtk_satellite(FAR struct file *filep, { uint32_t gnss = (uint32_t)arg; - return fw_gd_rtksetgnss(gnss); + return GD_RtkSetGnss(gnss); } /**************************************************************************** @@ -1780,7 +1780,7 @@ static int cxd56_gnss_get_rtk_satellite(FAR struct file *filep, return -EINVAL; } - ret = fw_gd_rtkgetgnss(&gnss); + ret = GD_RtkGetGnss(&gnss); *(uint32_t *)arg = gnss; return ret; @@ -1807,7 +1807,7 @@ static int cxd56_gnss_set_rtk_ephemeris_enable(FAR struct file *filep, { int enable = (int)arg; - return fw_gd_rtksetephnotify(enable); + return GD_RtkSetEphNotify(enable); } /**************************************************************************** @@ -1837,7 +1837,7 @@ static int cxd56_gnss_get_rtk_ephemeris_enable(FAR struct file *filep, return -EINVAL; } - ret = fw_gd_rtkgetephnotify(&enable); + ret = GD_RtkGetEphNotify(&enable); *(uint32_t *)arg = enable; return ret; @@ -1871,7 +1871,7 @@ static int cxd56_gnss_start_navmsg_output(FAR struct file *filep, setting = (FAR struct cxd56_rtk_setting_s *)arg; - return fw_gd_rtkstart(setting); + return GD_RtkStart(setting); } /**************************************************************************** @@ -1901,7 +1901,7 @@ static int cxd56_gnss_set_var_ephemeris(FAR struct file *filep, } param = (FAR struct cxd56_gnss_set_var_ephemeris_s *)arg; - return fw_gd_setvarephemeris(param->data, param->size); + return GD_SetVarEphemeris(param->data, param->size); } /**************************************************************************** @@ -1932,7 +1932,7 @@ static int cxd56_gnss_get_var_ephemeris(FAR struct file *filep, param = (FAR struct cxd56_gnss_get_var_ephemeris_s *)arg; - return fw_gd_getvarephemeris(param->type, param->data, param->size); + return GD_GetVarEphemeris(param->type, param->data, param->size); } /**************************************************************************** @@ -1953,7 +1953,7 @@ static int cxd56_gnss_get_var_ephemeris(FAR struct file *filep, static int cxd56_gnss_set_usecase(FAR struct file *filep, unsigned long arg) { - return fw_gd_setusecase(arg); + return GD_SetUseCase(arg); } /**************************************************************************** @@ -1982,7 +1982,7 @@ static int cxd56_gnss_get_usecase(FAR struct file *filep, return -EINVAL; } - ret = fw_gd_getusecase(&usecase); + ret = GD_GetUseCase(&usecase); *(uint32_t *)arg = usecase; return ret; @@ -2027,7 +2027,7 @@ static int cxd56_gnss_set_1pps_output(FAR struct file *filep, #endif } - return fw_gd_set1ppsoutput(arg); + return GD_Set1ppsOutput(arg); } /**************************************************************************** @@ -2056,7 +2056,7 @@ static int cxd56_gnss_get_1pps_output(FAR struct file *filep, return -EINVAL; } - ret = fw_gd_get1ppsoutput(&enable); + ret = GD_Get1ppsOutput(&enable); *(uint32_t *)arg = enable; return ret; @@ -2209,7 +2209,7 @@ static void cxd56_gnss_read_backup_file(FAR int *retval) ret = n < 0 ? n : ferror(fp) ? -ENFILE : 0; break; } - ret = fw_gd_writebuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, n); + ret = GD_WriteBuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, n); if (ret < 0) { break; @@ -2279,7 +2279,7 @@ static void cxd56_gnss_common_signalhandler(uint32_t data, FAR void *userdata) if (issetmask) { - fw_gd_setnotifymask(sigtype, FALSE); + GD_SetNotifyMask(sigtype, FALSE); } nxsem_post(&priv->devsem); @@ -2611,19 +2611,19 @@ static int cxd56_gnss_open(FAR struct file *filep) nxsem_setprotocol(&priv->syncsem, SEM_PRIO_NONE); - ret = fw_pm_loadimage(CXD56_GNSS_GPS_CPUID, CXD56_GNSS_FWNAME); + ret = PM_LoadImage(CXD56_GNSS_GPS_CPUID, CXD56_GNSS_FWNAME); if (ret < 0) { goto _err1; } - ret = fw_pm_startcpu(CXD56_GNSS_GPS_CPUID, 1); + ret = PM_StartCpu(CXD56_GNSS_GPS_CPUID, 1); if (ret < 0) { goto _err2; } #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_DISABLE); + PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_DISABLE); #endif /* Wait the request from GNSS core to restore backup data, @@ -2637,7 +2637,7 @@ static int cxd56_gnss_open(FAR struct file *filep) goto _err2; } - ret = fw_gd_writebuffer(CXD56_CPU1_DATA_TYPE_INFO, 0, &priv->shared_info, + ret = GD_WriteBuffer(CXD56_CPU1_DATA_TYPE_INFO, 0, &priv->shared_info, sizeof(priv->shared_info)); if (ret < 0) { @@ -2652,9 +2652,9 @@ static int cxd56_gnss_open(FAR struct file *filep) _err2: #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); + PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); #endif - fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); + PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); _err1: nxsem_destroy(&priv->syncsem); _err0: @@ -2696,10 +2696,10 @@ static int cxd56_gnss_close(FAR struct file *filep) if (priv->num_open == 0) { #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); + PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); #endif - ret = fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); + ret = PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); if (ret < 0) { goto errout; @@ -2770,9 +2770,9 @@ static ssize_t cxd56_gnss_read(FAR struct file *filep, FAR char *buffer, } } - /* fw_gd_readbuffer returns copied data size or negative error code */ + /* GD_ReadBuffer returns copied data size or negative error code */ - ret = fw_gd_readbuffer(type, offset, buffer, len); + ret = GD_ReadBuffer(type, offset, buffer, len); _err: _success: @@ -2898,7 +2898,7 @@ static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds, priv->fds[i] = fds; fds->priv = &priv->fds[i]; - fw_gd_setnotifymask(CXD56_CPU1_DEV_GNSS, FALSE); + GD_SetNotifyMask(CXD56_CPU1_DEV_GNSS, FALSE); break; } } diff --git a/arch/arm/src/cxd56xx/cxd56_gnss_api.h b/arch/arm/src/cxd56xx/cxd56_gnss_api.h index da36e3a54b0cb..8415ab04b47db 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss_api.h +++ b/arch/arm/src/cxd56xx/cxd56_gnss_api.h @@ -53,7 +53,7 @@ /* GD operation mode */ -/* fw_gd_setoperationmode, fw_gd_getoperationmode */ +/* GD_SetOperationMode, GD_GetOperationMode */ #define CXD56_GNSS_OPMOD_NORMAL 1 #define CXD56_GNSS_OPMOD_LOWPOWER 2 @@ -64,309 +64,309 @@ * beginning to search the satellites and measure the receiver position */ -int fw_gd_start(uint8_t startmode); +int GD_Start(uint8_t startMode); /* Stop a positioning */ -int fw_gd_stop(void); +int GD_Stop(void); /* Select GNSSs to positioning * These are able to specified by CXD56_GNSS_B_SAT_XXX defines. */ -int fw_gd_selectsatellitesystem(uint32_t system); +int GD_SelectSatelliteSystem(uint32_t system); /* Get current using GNSSs to positioning * A argument 'satellite' indicates current GNSSs by bit fields defined * by CXD56_GNSS_B_SAT_XXX. */ -int fw_gd_getsatellitesystem(FAR uint32_t *system); +int GD_GetSatelliteSystem(FAR uint32_t *system); /* Set the rough receiver position */ -int fw_gd_setreceiverpositionellipsoidal(FAR double *dlat, FAR double *dlon, - FAR double *dheight); +int GD_SetReceiverPositionEllipsoidal(FAR double *dLat, FAR double *dLon, + FAR double *dHeight); /* Set the rough receiver position as orgothonal */ -int fw_gd_setreceiverpositionorthogonal(int32_t dx, int32_t dy, int32_t dz); +int GD_SetReceiverPositionOrthogonal(int32_t dX, int32_t dY, int32_t dZ); /* Set enable or disable the 1PPS output. */ -int fw_gd_set1ppsoutput(uint32_t enable); +int GD_Set1ppsOutput(uint32_t enable); /* Get the current 1PPS output setting. */ -int fw_gd_get1ppsoutput(FAR uint32_t *enable); +int GD_Get1ppsOutput(FAR uint32_t *enable); /* Set the receiver operation mode * 1st argument 'mode' is a operation mode defined by CXD56_GNSS_OPMOD_XXX. * 2nd argument 'cycle' is a positioning period[ms], default is 1000[ms]. */ -int fw_gd_setoperationmode(uint32_t mode, uint32_t cycle); +int GD_SetOperationMode(uint32_t mode, uint32_t cycle); /* Get the receiver operation mode */ -int fw_gd_getoperationmode(FAR uint32_t *mode, FAR uint32_t *cycle); +int GD_GetOperationMode(FAR uint32_t *mode, FAR uint32_t *cycle); /* Set the TCXO offset */ -int fw_gd_settcxooffset(int32_t offset); +int GD_SetTcxoOffset(int32_t offset); /* Get the TCXO offset */ -int fw_gd_gettcxooffset(FAR int32_t *offset); +int GD_GetTcxoOffset(FAR int32_t *offset); /* Set the estimated current time of the receiver. * 1st argument date & time are in UTC. */ -int fw_gd_settime(FAR struct cxd56_gnss_date_s *date, +int GD_SetTime(FAR struct cxd56_gnss_date_s *date, FAR struct cxd56_gnss_time_s *time); /* Set the network time */ -int fw_gd_setframetime(uint16_t sec, uint32_t fracsec); +int GD_SetFrameTime(uint16_t sec, uint32_t fracSec); /* Get the almanac data */ -int fw_gd_getalmanac(uint32_t satellite, FAR uint32_t* almanac, - FAR uint32_t *almanacsize); +int GD_GetAlmanac(uint32_t satellite, FAR uint32_t* almanac, + FAR uint32_t *almanacSize); /* Set the almanac data */ -int fw_gd_setalmanac(uint32_t satellite, FAR uint32_t *almanac); +int GD_SetAlmanac(uint32_t satellite, FAR uint32_t *almanac); /* Get the Ephemeris data */ -int fw_gd_getephemeris(uint32_t satellite, FAR uint32_t* ephemeris, - FAR uint32_t *ephemerissize); +int GD_GetEphemeris(uint32_t satellite, FAR uint32_t* ephemeris, + FAR uint32_t *ephemerisSize); /* Set the Ephemeris data */ -int fw_gd_setephemeris(uint32_t satellite, FAR uint32_t *ephemeris); +int GD_SetEphemeris(uint32_t satellite, FAR uint32_t *ephemeris); /* Select to use or not use the initial position calculation supporting * information of the QZSS L1-SAIF. */ -int fw_gd_setqzssposassist(uint32_t enable); +int GD_SetQzssPosAssist(uint32_t enable); /* Get a setting of the initial position calculation supporting * information of the QZSS L1-SAIF. */ -int fw_gd_getqzssposassist(FAR uint32_t *enable); +int GD_GetQzssPosAssist(FAR uint32_t *enable); /* Set IMES bitrates. */ -int fw_gd_setimesbitrate(uint32_t bitrate); +int GD_SetImesBitrate(uint32_t bitrate); /* Get IMES bitrates. */ -int fw_gd_getimesbitrate(FAR uint32_t *bitrate); +int GD_GetImesBitrate(FAR uint32_t *bitrate); /* Set IMES center frequency offset. */ -int fw_gd_setimescenterfreqoffset(uint32_t offset); +int GD_SetImesCenterFreqOffset(uint32_t offset); /* Set IMES preamble. */ -int fw_gd_setimespreamble(uint32_t preamble); +int GD_SetImesPreamble(uint32_t preamble); /* Start GPS test */ -void fw_gd_startgpstest(uint32_t satellite, uint32_t reserve1, +void GD_StartGpsTest(uint32_t satellite, uint32_t reserve1, uint32_t reserve2, uint32_t reserve3); /* Stop GPS test */ -int fw_gd_stopgpstest(void); +int GD_StopGpsTest(void); /* Get GPS test result */ -int fw_gd_getgpstestresult(FAR float* cn, FAR float* doppler); +int GD_GetGpsTestResult(FAR float* cn, FAR float* doppler); /* Control Spectrum output */ -int fw_gd_spectrumcontrol(unsigned long time, unsigned int enable, - unsigned char monipoint1, unsigned char step1, - unsigned char monipoint2, unsigned char step2); +int GD_SpectrumControl(unsigned long time, unsigned int enable, + unsigned char moniPoint1, unsigned char step1, + unsigned char moniPoint2, unsigned char step2); /* Save the backup data to a Flash memory. */ -int fw_gd_savebackupdata(void); +int GD_SaveBackupdata(void); /* CEP Check Assist Data Valid */ -int fw_gd_cepcheckassistdata(void); +int GD_CepCheckAssistData(void); /* CEP Get Age Data */ -int fw_gd_cepgetagedata(FAR float *age, FAR float *cepi); +int GD_CepGetAgeData(FAR float *age, FAR float *cepi); /* CEP Reset Assist Data init flag & valid flag */ -int fw_gd_cepinitassistdata(void); +int GD_CepInitAssistData(void); /* AGPS Set tau */ -int fw_gd_settaugps(FAR double *tau); +int GD_SetTauGps(FAR double *tau); /* AGPS Set Acquist */ -int fw_gd_setacquist(FAR uint8_t *pacquistdata, uint16_t acquistsize); +int GD_SetAcquist(FAR uint8_t *pAcquistData, uint16_t acquistSize); /* Set the estimated current time of the receiver. * 1st argument date & time are in GPS time. */ -int fw_gd_settimegps(FAR struct cxd56_gnss_date_s *date, +int GD_SetTimeGps(FAR struct cxd56_gnss_date_s *date, FAR struct cxd56_gnss_time_s *time); /* Clear Receiver Information */ -int fw_gd_clearreceiverinfo(uint32_t type); +int GD_ClearReceiverInfo(uint32_t type); /* AGPS Set Tow Assist */ -int fw_gd_settowassist(FAR uint8_t *passistdata, uint16_t datasize); +int GD_SetTowAssist(FAR uint8_t *pAssistData, uint16_t dataSize); /* AGPS Set UTC Model */ -int fw_gd_setutcmodel(FAR uint8_t *pmodeldata, uint16_t datasize); +int GD_SetUtcModel(FAR uint8_t *pModelData, uint16_t dataSize); /* Read GNSS data to specified buffer */ -int fw_gd_readbuffer(uint8_t type, int32_t offset, FAR void *buf, +int GD_ReadBuffer(uint8_t type, int32_t offset, FAR void *buf, uint32_t length); /* Write GNSS data from specified buffer */ -int fw_gd_writebuffer(uint8_t type, int32_t offset, FAR void *buf, +int GD_WriteBuffer(uint8_t type, int32_t offset, FAR void *buf, uint32_t length); /* Set notify mask, this mask flag is cleared when notified(poll/signal) */ -int fw_gd_setnotifymask(uint8_t type, uint8_t clear); +int GD_SetNotifyMask(uint8_t type, uint8_t clear); /* Geofence Add Region */ -int fw_gd_geoaddregion(uint8_t id, long lat, long lon, uint16_t rad); +int GD_GeoAddRegion(uint8_t id, long lat, long lon, uint16_t rad); /* Geofence Modify Region */ -int fw_gd_geomodifyregion(uint8_t id, long lat, long lon, uint16_t rad); +int GD_GeoModifyRegion(uint8_t id, long lat, long lon, uint16_t rad); /* Geofence Delete Region */ -int fw_gd_geodeleteregione(uint8_t id); +int GD_GeoDeleteRegione(uint8_t id); /* Geofence All delete Region */ -int fw_gd_geodeleteallregion(void); +int GD_GeoDeleteAllRegion(void); /* Geofence Region check */ -int fw_gd_geogetregiondata(uint8_t id, FAR long *lat, FAR long *lon, +int GD_GeoGetRegionData(uint8_t id, FAR long *lat, FAR long *lon, FAR uint16_t *rad); /* Geofence Get Used Region ID */ -uint32_t fw_gd_geogetusedregionid(void); +uint32_t GD_GeoGetUsedRegionId(void); /* Geofence Set mode */ -int fw_gd_geosetopmode(uint16_t deadzone, uint16_t dwell_detecttime); +int GD_GeoSetOpMode(uint16_t deadzone, uint16_t dwell_detecttime); /* Geofence Request All region notify */ -int fw_gd_geosetallrgionnotifyrequest(void); +int GD_GeoSetAllRgionNotifyRequest(void); /* Geofence Register to gnss_provider */ -int fw_gd_registergeofence(void); +int GD_RegisterGeofence(void); /* Geofence Release from gnss_provider */ -int fw_gd_releasegeofence(void); +int GD_ReleaseGeofence(void); /* Pvtlog Register to gnss_provider */ -int fw_gd_registerpvtlog(uint32_t cycle, uint32_t threshold); +int GD_RegisterPvtlog(uint32_t cycle, uint32_t threshold); /* Pvtlog Release */ -int fw_gd_releasepvtlog(void); +int GD_ReleasePvtlog(void); /* Pvtlog Delete log data */ -int fw_gd_pvtlogdeletelog(void); +int GD_PvtlogDeleteLog(void); /* Pvtlog Get Log status */ -int fw_gd_pvtloggetlogstatus(FAR struct cxd56_gnss_status_s *plogstatus); +int GD_PvtlogGetLogStatus(FAR struct cxd56_gnss_status_s *pLogStatus); /* Start outputting carrier phase info. */ -int fw_gd_rtkstart(FAR struct cxd56_rtk_setting_s *pparam); +int GD_RtkStart(FAR struct cxd56_rtk_setting_s *pParam); /* Stop outputting carrier phase info. */ -int fw_gd_rtkstop(void); +int GD_RtkStop(void); /* Set output interval of carrier phase info. * * interval : CXD56_GNSS_RTK_INTERVAL_XXX (gd_type.h) */ -int fw_gd_rtksetoutputinterval(int interval); +int GD_RtkSetOutputInterval(int interval); /* Get output interval of carrier phase info. [ms] */ -int fw_gd_rtkgetoutputinterval(FAR int *interval); +int GD_RtkGetOutputInterval(FAR int* interval); /* Set GNSS of outputting carrier phase info. */ -int fw_gd_rtksetgnss(uint32_t gnss); +int GD_RtkSetGnss(uint32_t gnss); /* Get GNSS of outputting carrier phase info. */ -int fw_gd_rtkgetgnss(FAR uint32_t *pgnss); +int GD_RtkGetGnss(FAR uint32_t* pGnss); /* Set enable/disable GD to notify updating ephemeris */ -int fw_gd_rtksetephnotify(int enable); +int GD_RtkSetEphNotify(int enable); /* Get enable/disable GD to notify updating ephemeris */ -int fw_gd_rtkgetephnotify(FAR int *enable); +int GD_RtkGetEphNotify(FAR int* enable); /* Set the Ephemeris data Ephemeris data size is variable. */ -int fw_gd_setvarephemeris(uint32_t *ephemeris, uint32_t ephemerissize); +int GD_SetVarEphemeris(uint32_t *ephemeris, uint32_t ephemerisSize); /* Get the Ephemeris data Ephemeris data size is variable. */ -int fw_gd_getvarephemeris(uint32_t satellite, uint32_t* ephemeris, - uint32_t ephemerissize); +int GD_GetVarEphemeris(uint32_t satellite, uint32_t* ephemeris, + uint32_t ephemerisSize); /* Set usecase mode */ -int fw_gd_setusecase(uint32_t usecase); +int GD_SetUseCase(uint32_t usecase); /* Get usecase mode */ -int fw_gd_getusecase(uint32_t *usecase); +int GD_GetUseCase(uint32_t *usecase); /* Set enable or disable of 1PPS output */ -int fw_gd_set1ppsoutput(uint32_t enable); +int GD_Set1ppsOutput(uint32_t enable); /* Get the current 1PPS output setting */ -int fw_gd_get1ppsoutput(uint32_t *enable); +int GD_Get1ppsOutput(uint32_t *enable); #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_API_H */ diff --git a/arch/arm/src/cxd56xx/cxd56_pmic.c b/arch/arm/src/cxd56xx/cxd56_pmic.c index 44955ddeda890..c2350f057d979 100644 --- a/arch/arm/src/cxd56xx/cxd56_pmic.c +++ b/arch/arm/src/cxd56xx/cxd56_pmic.c @@ -163,7 +163,7 @@ struct pmic_temp_mode_s int high; }; -extern int fw_pm_pmiccontrol(int cmd, void *arg); +extern int pm_pmic_control(int cmd, void *arg); /**************************************************************************** * Private Data @@ -299,7 +299,7 @@ static int pmic_int_handler(int irq, void *context, void *arg) int cxd56_pmic_get_interrupt_status(uint8_t *status) { - return fw_pm_pmiccontrol(PMIC_CMD_INTSTATUS, status); + return pm_pmic_control(PMIC_CMD_INTSTATUS, status); } /**************************************************************************** @@ -347,7 +347,7 @@ int cxd56_pmic_set_gpo_reg(uint8_t *setbit0, uint8_t *clrbit0, .clrbit1 = clrbit1, }; - return fw_pm_pmiccontrol(PMIC_CMD_GPO, &arg); + return pm_pmic_control(PMIC_CMD_GPO, &arg); } /**************************************************************************** @@ -485,51 +485,6 @@ bool cxd56_pmic_get_gpo(uint8_t chset) return false; } -/**************************************************************************** - * Name: cxd56_pmic_get_gpo_hiz - * - * Description: - * Get the tristate value from the specified GPO channel(s) - * - * Input Parameter: - * chset : GPO Channel number(s) - * - * Returned Value: - * Return 0(off), 1(on) or -1(HiZ) - * - ****************************************************************************/ - -int cxd56_pmic_get_gpo_hiz(uint8_t chset) -{ - uint8_t setbit0 = 0; - uint8_t clrbit0 = 0; - uint8_t setbit1 = 0; - uint8_t clrbit1 = 0; - uint8_t set; - uint8_t hiz; - - cxd56_pmic_set_gpo_reg(&setbit0, &clrbit0, &setbit1, &clrbit1); - - set = ((setbit1 & 0xf) << 4) | (setbit0 & 0xf); - hiz = ((setbit1) & 0xf0) | ((setbit0 & 0xf0) >> 4); - - /* If all of the specified chset is hiz, return -1 */ - - if ((hiz & chset) != chset) - { - return -1; - } - - /* If all of the specified chset is high, return 1 */ - - if ((set & chset) == chset) - { - return 1; - } - - return 0; -} - /**************************************************************************** * Name: cxd56_pmic_set_loadswitch_reg * @@ -567,7 +522,7 @@ int cxd56_pmic_set_loadswitch_reg(uint8_t *setbit, uint8_t *clrbit) .clrbit = clrbit, }; - return fw_pm_pmiccontrol(PMIC_CMD_LOADSW, &arg); + return pm_pmic_control(PMIC_CMD_LOADSW, &arg); } /**************************************************************************** @@ -664,7 +619,7 @@ int cxd56_pmic_set_ddc_ldo_reg(uint8_t *setbit, uint8_t *clrbit) .clrbit = clrbit, }; - return fw_pm_pmiccontrol(PMIC_CMD_DDCLDO, &arg); + return pm_pmic_control(PMIC_CMD_DDCLDO, &arg); } /**************************************************************************** @@ -783,7 +738,7 @@ int cxd56_pmic_get_rtc(uint64_t *count) int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge) { - return fw_pm_pmiccontrol(PMIC_CMD_AFE, gauge); + return pm_pmic_control(PMIC_CMD_AFE, gauge); } /**************************************************************************** @@ -802,7 +757,7 @@ int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge) int cxd56_pmic_getlowervol(FAR int *voltage) { - return fw_pm_pmiccontrol(PMIC_CMD_GETVSYS, voltage); + return pm_pmic_control(PMIC_CMD_GETVSYS, voltage); } /**************************************************************************** @@ -821,7 +776,7 @@ int cxd56_pmic_getlowervol(FAR int *voltage) int cxd56_pmic_setlowervol(int voltage) { - return fw_pm_pmiccontrol(PMIC_CMD_SETVSYS, (void *)voltage); + return pm_pmic_control(PMIC_CMD_SETVSYS, (void *)voltage); } /**************************************************************************** @@ -840,7 +795,7 @@ int cxd56_pmic_setlowervol(int voltage) int cxd56_pmic_getnotifyvol(FAR int *voltage) { - return fw_pm_pmiccontrol(PMIC_CMD_GETPREVSYS, voltage); + return pm_pmic_control(PMIC_CMD_GETPREVSYS, voltage); } /**************************************************************************** @@ -859,7 +814,7 @@ int cxd56_pmic_getnotifyvol(FAR int *voltage) int cxd56_pmic_setnotifyvol(int voltage) { - return fw_pm_pmiccontrol(PMIC_CMD_SETPREVSYS, (void *)voltage); + return pm_pmic_control(PMIC_CMD_SETPREVSYS, (void *)voltage); } /**************************************************************************** @@ -881,7 +836,7 @@ int cxd56_pmic_getchargevol(FAR int *voltage) int val; int ret; - ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_VOLTAGE, &val); + ret = pm_pmic_control(PMIC_CMD_GET_CHG_VOLTAGE, &val); if (ret) { return -EIO; @@ -937,7 +892,7 @@ int cxd56_pmic_setchargevol(int voltage) val = (voltage - 4000) / 50; - return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_VOLTAGE, (void *)val); + return pm_pmic_control(PMIC_CMD_SET_CHG_VOLTAGE, (void *)val); } /**************************************************************************** @@ -960,7 +915,7 @@ int cxd56_pmic_getchargecurrent(FAR int *current) int val; int ret; - ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_CURRENT, &val); + ret = pm_pmic_control(PMIC_CMD_GET_CHG_CURRENT, &val); if (ret) { return ret; @@ -1028,7 +983,7 @@ int cxd56_pmic_setchargecurrent(int current) return -EFAULT; } - return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_CURRENT, (void *)val); + return pm_pmic_control(PMIC_CMD_SET_CHG_CURRENT, (void *)val); } /**************************************************************************** @@ -1047,7 +1002,7 @@ int cxd56_pmic_setchargecurrent(int current) int cxd56_pmic_getporttype(FAR int *porttype) { - return fw_pm_pmiccontrol(PMIC_CMD_GET_USB_PORT_TYPE, porttype); + return pm_pmic_control(PMIC_CMD_GET_USB_PORT_TYPE, porttype); } /**************************************************************************** @@ -1072,7 +1027,7 @@ int cxd56_pmic_getchargestate(uint8_t *state) /* Update charge state */ - ret = fw_pm_pmiccontrol(PMIC_CMD_AFE, &arg); + ret = pm_pmic_control(PMIC_CMD_AFE, &arg); if (ret) { return ret; @@ -1080,7 +1035,7 @@ int cxd56_pmic_getchargestate(uint8_t *state) /* Get actual charging state (CNT_USB1) */ - ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_STATE, &val); + ret = pm_pmic_control(PMIC_CMD_GET_CHG_STATE, &val); *state = val & 0xff; return ret; @@ -1128,7 +1083,7 @@ int cxd56_pmic_setrechargevol(int mv) return -EINVAL; } - return fw_pm_pmiccontrol(PMIC_CMD_SET_RECHG_VOLTAGE, (void *)val); + return pm_pmic_control(PMIC_CMD_SET_RECHG_VOLTAGE, (void *)val); } /**************************************************************************** @@ -1150,7 +1105,7 @@ int cxd56_pmic_getrechargevol(FAR int *mv) int val; int ret; - ret = fw_pm_pmiccontrol(PMIC_CMD_GET_RECHG_VOLTAGE, &val); + ret = pm_pmic_control(PMIC_CMD_GET_RECHG_VOLTAGE, &val); if (ret) { return ret; @@ -1230,7 +1185,7 @@ int cxd56_pmic_setchargecompcurrent(int current) break; } - return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_IFIN, (void *)val); + return pm_pmic_control(PMIC_CMD_SET_CHG_IFIN, (void *)val); } /**************************************************************************** @@ -1252,7 +1207,7 @@ int cxd56_pmic_getchargecompcurrent(FAR int *current) int val; int ret; - ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_IFIN, &val); + ret = pm_pmic_control(PMIC_CMD_GET_CHG_IFIN, &val); if (ret) { return ret; @@ -1310,7 +1265,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table) { /* SET_T60 (70h) - SET_T0_2 (78h) */ - return fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_TEMPERATURE_TABLE, table); + return pm_pmic_control(PMIC_CMD_GET_CHG_TEMPERATURE_TABLE, table); } /**************************************************************************** @@ -1330,7 +1285,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table) int cxd56_pmic_settemptable(FAR struct pmic_temp_table_s *table) { - return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_TEMPERATURE_TABLE, table); + return pm_pmic_control(PMIC_CMD_SET_CHG_TEMPERATURE_TABLE, table); } /**************************************************************************** @@ -1383,7 +1338,7 @@ int cxd56_pmic_setchargemode(int low, int high) return -EINVAL; } - return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_TEMPERATURE_MODE, &arg); + return pm_pmic_control(PMIC_CMD_SET_CHG_TEMPERATURE_MODE, &arg); } /**************************************************************************** @@ -1410,7 +1365,7 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high) struct pmic_temp_mode_s arg; int ret; - ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_TEMPERATURE_MODE, &arg); + ret = pm_pmic_control(PMIC_CMD_GET_CHG_TEMPERATURE_MODE, &arg); if (ret) { return ret; @@ -1429,22 +1384,22 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high) int cxd56_pmic_monitor_enable(FAR struct pmic_mon_s *ptr) { - return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_ENABLE, ptr); + return pm_pmic_control(PMIC_CMD_POWER_MONITOR_ENABLE, ptr); } int cxd56_pmic_monitor_status(FAR struct pmic_mon_status_s *ptr) { - return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_STATUS, ptr); + return pm_pmic_control(PMIC_CMD_POWER_MONITOR_STATUS, ptr); } int cxd56_pmic_monitor_set(FAR struct pmic_mon_set_s *ptr) { - return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_SET, ptr); + return pm_pmic_control(PMIC_CMD_POWER_MONITOR_SET, ptr); } int cxd56_pmic_monitor_get(FAR struct pmic_mon_log_s *ptr) { - return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_GET, ptr); + return pm_pmic_control(PMIC_CMD_POWER_MONITOR_GET, ptr); } #endif @@ -1546,7 +1501,7 @@ int cxd56_pmic_read(uint8_t addr, void *buf, uint32_t size) .size = size, }; - return fw_pm_pmiccontrol(PMIC_CMD_READ, &arg); + return pm_pmic_control(PMIC_CMD_READ, &arg); } /**************************************************************************** @@ -1581,7 +1536,7 @@ int cxd56_pmic_write(uint8_t addr, void *buf, uint32_t size) .size = size, }; - return fw_pm_pmiccontrol(PMIC_CMD_WRITE, &arg); + return pm_pmic_control(PMIC_CMD_WRITE, &arg); } #endif /* CONFIG_CXD56_PMIC */ diff --git a/arch/arm/src/cxd56xx/cxd56_pmic.h b/arch/arm/src/cxd56xx/cxd56_pmic.h index 0946834a4b0a9..2e85dc47120d7 100644 --- a/arch/arm/src/cxd56xx/cxd56_pmic.h +++ b/arch/arm/src/cxd56xx/cxd56_pmic.h @@ -309,22 +309,6 @@ int cxd56_pmic_set_gpo_hiz(uint8_t chset); bool cxd56_pmic_get_gpo(uint8_t chset); -/**************************************************************************** - * Name: cxd56_pmic_get_gpo_hiz - * - * Description: - * Get the tristate value from the specified GPO channel(s) - * - * Input Parameter: - * chset : GPO Channel number(s) - * - * Returned Value: - * Return 0(off), 1(on) or -1(HiZ) - * - ****************************************************************************/ - -int cxd56_pmic_get_gpo_hiz(uint8_t chset); - /**************************************************************************** * Name: cxd56_pmic_set_loadswitch_reg * diff --git a/arch/arm/src/cxd56xx/cxd56_powermgr.c b/arch/arm/src/cxd56xx/cxd56_powermgr.c index 34bde395d19ba..bad73a60111a1 100644 --- a/arch/arm/src/cxd56xx/cxd56_powermgr.c +++ b/arch/arm/src/cxd56xx/cxd56_powermgr.c @@ -991,16 +991,16 @@ uint32_t up_pm_clr_bootmask(uint32_t mask) int up_pm_sleep(enum pm_sleepmode_e mode) { - int fw_pm_deepsleep(void *); - int fw_pm_coldsleep(void *); + int PM_DeepSleep(void *); + int PM_ColdSleep(void *); switch (mode) { case PM_SLEEP_DEEP: - fw_pm_deepsleep(NULL); + PM_DeepSleep(NULL); break; case PM_SLEEP_COLD: - fw_pm_coldsleep(NULL); + PM_ColdSleep(NULL); break; } __asm volatile ("dsb"); @@ -1017,8 +1017,8 @@ int up_pm_sleep(enum pm_sleepmode_e mode) int up_pm_reboot(void) { - void fw_pm_reboot(void); - fw_pm_reboot(); + void PM_Reboot(void); + PM_Reboot(); __asm volatile ("dsb"); for (; ; ); } diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c index c715a484f8b43..32fad6b6fe3cb 100644 --- a/arch/arm/src/cxd56xx/cxd56_scu.c +++ b/arch/arm/src/cxd56xx/cxd56_scu.c @@ -2756,35 +2756,13 @@ FAR struct seq_s *seq_open(int type, int bustype) { FAR struct seq_s *seq; - /* Check bustype is valid */ - - switch (bustype) - { - case SCU_BUS_SPI: - case SCU_BUS_I2C0: - case SCU_BUS_I2C1: - case SCU_BUS_LPADC0: - case SCU_BUS_LPADC1: - case SCU_BUS_LPADC2: - case SCU_BUS_LPADC3: - case SCU_BUS_HPADC0: - case SCU_BUS_HPADC1: - break; - default: - return NULL; - } - if (type == SEQ_TYPE_DECI) { seq = deci_new(); } - else if (type == SEQ_TYPE_NORMAL) - { - seq = seq_new(); - } else { - return NULL; + seq = seq_new(); } if (!seq) diff --git a/arch/arm/src/cxd56xx/cxd56_sfc.c b/arch/arm/src/cxd56xx/cxd56_sfc.c index f1ccc9e3d2eec..1c53725abe21a 100644 --- a/arch/arm/src/cxd56xx/cxd56_sfc.c +++ b/arch/arm/src/cxd56xx/cxd56_sfc.c @@ -44,10 +44,10 @@ /* Prototypes for Remote API */ -int fw_fm_rawwrite(uint32_t offset, const void *buf, uint32_t size); -int fw_fm_rawverifywrite(uint32_t offset, const void *buf, uint32_t size); -int fw_fm_rawread(uint32_t offset, void *buf, uint32_t size); -int fw_fm_rawerasesector(uint32_t sector); +int FM_RawWrite(uint32_t offset, const void *buf, uint32_t size); +int FM_RawVerifyWrite(uint32_t offset, const void *buf, uint32_t size); +int FM_RawRead(uint32_t offset, void *buf, uint32_t size); +int FM_RawEraseSector(uint32_t sector); #ifndef CONFIG_CXD56_SPIFLASHSIZE # define CONFIG_CXD56_SPIFLASHSIZE (16 * 1024 * 1024) @@ -87,7 +87,7 @@ static int cxd56_erase(FAR struct mtd_dev_s *dev, off_t startblock, for (i = 0; i < nblocks; i++) { - ret = fw_fm_rawerasesector(startblock + i); + ret = FM_RawEraseSector(startblock + i); if (ret < 0) { set_errno(-ret); @@ -104,7 +104,7 @@ static ssize_t cxd56_bread(FAR struct mtd_dev_s *dev, off_t startblock, finfo("bread: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks); - ret = fw_fm_rawread(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); + ret = FM_RawRead(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); if (ret < 0) { set_errno(-ret); @@ -122,10 +122,10 @@ static ssize_t cxd56_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, finfo("bwrite: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks); #ifdef CONFIG_CXD56_SFC_VERIFY_WRITE - ret = fw_fm_rawverifywrite(startblock << PAGE_SHIFT, buffer, + ret = FM_RawVerifyWrite(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); #else - ret = fw_fm_rawwrite(startblock << PAGE_SHIFT, buffer, + ret = FM_RawWrite(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); #endif if (ret < 0) @@ -144,7 +144,7 @@ static ssize_t cxd56_read(FAR struct mtd_dev_s *dev, off_t offset, finfo("read: %08lx (%u bytes)\n", offset, nbytes); - ret = fw_fm_rawread(offset, buffer, nbytes); + ret = FM_RawRead(offset, buffer, nbytes); if (ret < 0) { set_errno(-ret); @@ -163,9 +163,9 @@ static ssize_t cxd56_write(FAR struct mtd_dev_s *dev, off_t offset, finfo("write: %08lx (%u bytes)\n", offset, nbytes); #ifdef CONFIG_CXD56_SFC_VERIFY_WRITE - ret = fw_fm_rawverifywrite(offset, buffer, nbytes); + ret = FM_RawVerifyWrite(offset, buffer, nbytes); #else - ret = fw_fm_rawwrite(offset, buffer, nbytes); + ret = FM_RawWrite(offset, buffer, nbytes); #endif if (ret < 0) { @@ -222,7 +222,7 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) while (sec < last) { - fw_fm_rawerasesector(sec); + FM_RawEraseSector(sec); sec++; } } diff --git a/arch/arm/src/cxd56xx/cxd56_timer.c b/arch/arm/src/cxd56xx/cxd56_timer.c index 8a0faee8d70b0..405d81e0ff1d0 100644 --- a/arch/arm/src/cxd56xx/cxd56_timer.c +++ b/arch/arm/src/cxd56xx/cxd56_timer.c @@ -365,7 +365,7 @@ static int cxd56_getstatus(FAR struct timer_lowerhalf_s *lower, * Input Parameters: * lower - A pointer the publicly visible representation of the "lower * half" driver state structure. - * timeout - The new timeout value in microseconds. + * timeout - The new timeout value in milliseconds. * * Returned Values: * Zero on success; a negated errno value on failure. diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index e4b85c97bc903..2dcbb920106f3 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include @@ -95,14 +94,14 @@ static void uart0_semgive(sem_t *id); * FarAPI prototypes ****************************************************************************/ -int fw_pd_uartinit(int ch); -int fw_pd_uartuninit(int ch); -int fw_pd_uartconfiguration(int ch, int baudrate, int databits, +int PD_UartInit(int ch); +int PD_UartUninit(int ch); +int PD_UartConfiguration(int ch, int baudrate, int databits, int parity, int stopbit, int flowctrl); -int fw_pd_uartenable(int ch); -int fw_pd_uartdisable(int ch); -int fw_pd_uartreceive(int ch, void *buf, int size, int leave); -int fw_pd_uartsend(int ch, void *buf, int size, int leave); +int PD_UartEnable(int ch); +int PD_UartDisable(int ch); +int PD_UartReceive(int ch, void *buf, int size, int leave); +int PD_UartSend(int ch, void *buf, int size, int leave); /**************************************************************************** * Private Data @@ -159,7 +158,7 @@ static int uart0_open(FAR struct file *filep) return OK; } - ret = fw_pd_uartinit(0); + ret = PD_UartInit(0); if (ret < 0) { set_errno(EFAULT); @@ -176,7 +175,7 @@ static int uart0_open(FAR struct file *filep) /* Enable UART0 pin configuration */ -#ifdef CONFIG_CXD56_UART0_FLOWCONTROL +#ifdef CONFIG_UART0_FLOWCONTROL flowctl = 1; CXD56_PIN_CONFIGS(PINCONFS_SPI2_UART0); #else @@ -184,21 +183,21 @@ static int uart0_open(FAR struct file *filep) CXD56_PIN_CONFIGS(PINCONFS_SPI2A_UART0); #endif - ret = fw_pd_uartconfiguration(0, CONFIG_CXD56_UART0_BAUD, + ret = PD_UartConfiguration(0, CONFIG_CXD56_UART0_BAUD, bits, CONFIG_CXD56_UART0_PARITY, stop, flowctl); if (ret < 0) { - fw_pd_uartuninit(0); + PD_UartUninit(0); set_errno(EINVAL); return ERROR; } - ret = fw_pd_uartenable(0); + ret = PD_UartEnable(0); if (ret < 0) { - fw_pd_uartuninit(0); + PD_UartUninit(0); set_errno(EFAULT); return ERROR; } @@ -216,12 +215,12 @@ static int uart0_close(FAR struct file *filep) if (inode->i_crefs == 1) { - fw_pd_uartdisable(0); - fw_pd_uartuninit(0); + PD_UartDisable(0); + PD_UartUninit(0); /* Disable UART0 pin by changing Hi-Z GPIO */ -#ifdef CONFIG_CXD56_UART0_FLOWCONTROL +#ifdef CONFIG_UART0_FLOWCONTROL CXD56_PIN_CONFIGS(PINCONFS_SPI2_GPIO); #else CXD56_PIN_CONFIGS(PINCONFS_SPI2A_GPIO); @@ -242,7 +241,9 @@ static ssize_t uart0_read(FAR struct file *filep, uart0_semtake(&g_lock); - ret = fw_pd_uartreceive(0, buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); + /* Always blocking */ + + ret = PD_UartReceive(0, buffer, len, 0); uart0_semgive(&g_lock); @@ -266,7 +267,9 @@ static ssize_t uart0_write(FAR struct file *filep, uart0_semtake(&g_lock); - ret = fw_pd_uartsend(0, (FAR void *)buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); + /* Always blocking */ + + ret = PD_UartSend(0, (FAR void *)buffer, len, 0); uart0_semgive(&g_lock); diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index 2b9731c585750..5a90f1a737d1e 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -162,7 +162,7 @@ struct ge2d_copycmd_s uint32_t reserved[3]; } __attribute__ ((aligned(16))); -/* Raster operation (ROP) command (32 bytes + scaling OP 16 bytes) */ +/* Raster operation (ROP) command (48 bytes) */ struct ge2d_ropcmd_s { @@ -181,10 +181,7 @@ struct ge2d_ropcmd_s uint16_t patpitch; /* 0x1c */ uint8_t pathoffset; /* 0x1e */ uint8_t patvoffset; /* 0x1f */ - } __attribute__ ((aligned(16))); -struct ge2d_ropcmd_scaling_s - { uint16_t desth; /* 0x20 */ uint16_t destv; /* 0x22 */ uint16_t ratioh; /* 0x24 */ @@ -310,7 +307,6 @@ static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, uint8_t rop, uint8_t options, uint16_t patcolor) { struct ge2d_ropcmd_s *rc = (struct ge2d_ropcmd_s *)cmdbuf; - struct ge2d_ropcmd_scaling_s *sc; uint16_t rv; uint16_t rh; uint16_t cmd = ROPCMD; @@ -360,34 +356,17 @@ static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, rc->daddr = (uint32_t) (uintptr_t) destaddr | MSEL; rc->spitch = srcpitch - 1; rc->dpitch = destpitch - 1; - - /* Shift to next command area */ - - cmdbuf = (void *)((uintptr_t) cmdbuf + sizeof(struct ge2d_ropcmd_s)); - - /* Set scaling information */ - - if (cmd & SCALING) - { - sc = (struct ge2d_ropcmd_scaling_s *)cmdbuf; - - sc->desth = destwidth - 1; - sc->destv = destheight - 1; - sc->ratiov = rv - 1; - sc->ratioh = rh - 1; - sc->hphaseinit = 1; - sc->vphaseinit = 1; - sc->intpmode = 0; /* XXX: HV Linear interpolation */ - - /* Shift to next command area */ - - cmdbuf = (void *)((uintptr_t) cmdbuf - + sizeof(struct ge2d_ropcmd_scaling_s)); - } + rc->desth = destwidth - 1; + rc->destv = destheight - 1; + rc->ratiov = rv - 1; + rc->ratioh = rh - 1; + rc->hphaseinit = 1; + rc->vphaseinit = 1; + rc->intpmode = 0; /* XXX: HV Linear interpolation */ /* return next command area */ - return cmdbuf; + return (void *)((uintptr_t) cmdbuf + sizeof(struct ge2d_ropcmd_s)); } static void *set_ab_cmd(void *cmdbuf, void *srcaddr, void *destaddr, diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c index 3482ad163646f..30816ced9a8c3 100644 --- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c +++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c @@ -354,7 +354,7 @@ typedef enum * Public Function Prototypes ****************************************************************************/ -extern uint32_t fw_as_acacontrol(uint8_t type, uint32_t param); +extern uint32_t as_aca_control(uint8_t type, uint32_t param); /**************************************************************************** * Private Functions @@ -634,7 +634,7 @@ void get_pwon_out_param(as_aca_pulco_out_param_t *param) CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) { - if (fw_as_acacontrol(AS_ACA_CHECK_ID, (uint32_t)NULL) != 0) + if (as_aca_control(AS_ACA_CHECK_ID, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_CHKID; } @@ -642,7 +642,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) as_aca_pulco_param_t pwon_param; get_pwon_param(&pwon_param); - if (fw_as_acacontrol(AS_ACA_POWER_ON_COMMON, (uint32_t)&pwon_param) != 0) + if (as_aca_control(AS_ACA_POWER_ON_COMMON, (uint32_t)&pwon_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON; } @@ -650,7 +650,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) as_ser_des_param_t serial_param; get_serial_param(&serial_param); - if (fw_as_acacontrol(AS_ACA_SET_SERDES, (uint32_t)&serial_param) != 0) + if (as_aca_control(AS_ACA_SET_SERDES, (uint32_t)&serial_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SERIAL; } @@ -660,7 +660,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void) { - if (fw_as_acacontrol(AS_ACA_POWER_OFF_COMMON, (uint32_t)NULL) != 0) + if (as_aca_control(AS_ACA_POWER_OFF_COMMON, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF; } @@ -670,7 +670,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_micbias(void) { - if (fw_as_acacontrol(AS_ACA_POWER_ON_MICBIAS, (uint32_t)NULL) != 0) + if (as_aca_control(AS_ACA_POWER_ON_MICBIAS, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_MBIAS; } @@ -684,7 +684,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_input(FAR cxd56_audio_mic_gain_t *gain get_input_param(&pwon_input_param, gain); - if (fw_as_acacontrol(AS_ACA_POWER_ON_INPUT, (uint32_t)&pwon_input_param) != 0) + if (as_aca_control(AS_ACA_POWER_ON_INPUT, (uint32_t)&pwon_input_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_INPUT; } @@ -698,7 +698,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_smaster(void) get_smaster_param(&smaster_param); - if (fw_as_acacontrol(AS_ACA_SET_SMASTER, (uint32_t)&smaster_param) != 0) + if (as_aca_control(AS_ACA_SET_SMASTER, (uint32_t)&smaster_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SET_SMASTER; } @@ -712,7 +712,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void) get_pwon_out_param(&pwon_output_param); - if (fw_as_acacontrol(AS_ACA_POWER_ON_OUTPUT, (uint32_t)&pwon_output_param) != 0) + if (as_aca_control(AS_ACA_POWER_ON_OUTPUT, (uint32_t)&pwon_output_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_OUTPUT; } @@ -722,7 +722,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void) { - if (fw_as_acacontrol(AS_ACA_POWER_OFF_INPUT, (uint32_t)NULL) != 0) + if (as_aca_control(AS_ACA_POWER_OFF_INPUT, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF_INPUT; } @@ -732,7 +732,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void) { - if (fw_as_acacontrol(AS_ACA_POWER_OFF_OUTPUT, (uint32_t)NULL) != 0) + if (as_aca_control(AS_ACA_POWER_OFF_OUTPUT, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF_OUTPUT; } @@ -742,7 +742,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void) { - if (fw_as_acacontrol(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_SP) != 0) + if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_SP) != 0) { return CXD56_AUDIO_ECODE_ANA_ENABLE_OUTPUT; } @@ -752,7 +752,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_disable_output(void) { - if (fw_as_acacontrol(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_OFF) != 0) + if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_OFF) != 0) { return CXD56_AUDIO_ECODE_ANA_DISABLE_OUTPUT; } @@ -766,7 +766,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain) get_input_param(&mic_gain_param, gain); - if (fw_as_acacontrol(AS_ACA_INIT_AMIC, (uint32_t)&mic_gain_param) != 0) + if (as_aca_control(AS_ACA_INIT_AMIC, (uint32_t)&mic_gain_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SET_MICGAIN; } @@ -776,7 +776,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain) CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void) { - if (fw_as_acacontrol(AS_ACA_SET_AMIC_BOOT_DONE, (uint32_t)NULL) != 0) + if (as_aca_control(AS_ACA_SET_AMIC_BOOT_DONE, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_NOTIFY_MICBOOT; } @@ -786,12 +786,12 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void) CXD56_AUDIO_ECODE cxd56_audio_aca_read_reg(as_aca_pulco_reg_param_t *param) { - fw_as_acacontrol(AS_ACA_GET_REGISTER, (uint32_t)param); + as_aca_control(AS_ACA_GET_REGISTER, (uint32_t)param); return CXD56_AUDIO_ECODE_OK; } CXD56_AUDIO_ECODE cxd56_audio_aca_write_reg(as_aca_pulco_reg_param_t *param) { - fw_as_acacontrol(AS_ACA_SET_REGISTER, (uint32_t)param); + as_aca_control(AS_ACA_SET_REGISTER, (uint32_t)param); return CXD56_AUDIO_ECODE_OK; } diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_power.h b/boards/arm/cxd56xx/spresense/include/cxd56_power.h index 35ec56ce1d598..f8b5811f31bc6 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_power.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_power.h @@ -133,24 +133,6 @@ int board_power_setup(int status); int board_power_control(int target, bool en); -/**************************************************************************** - * Name: board_power_control_tristate - * - * Description: - * Power on/off/HiZ the device on the board. - * (HiZ is available only for PMIC_TYPE_GPO.) - * - * Input Parameter: - * target : PMIC channel - * value : 1 (ON), 0 (OFF), -1(HiZ) - * - * Returned Value: - * 0 on success, else a negative error code - * - ****************************************************************************/ - -int board_power_control_tristate(int target, int value); - /**************************************************************************** * Name: board_power_monitor * @@ -161,22 +143,6 @@ int board_power_control_tristate(int target, int value); bool board_power_monitor(int target); -/**************************************************************************** - * Name: board_power_monitor_tristate - * - * Description: - * Get status of Power on/off/HiZ the device on the board. - * - * Input Parameter: - * target : PMIC channel - * - * Returned Value: - * 1 (ON), 0 (OFF), -1(HiZ) - * - ****************************************************************************/ - -int board_power_monitor_tristate(int target); - /**************************************************************************** * Name: board_flash_power_control * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index 23a08ee28457d..fd572e0aa996d 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -220,56 +220,6 @@ int board_power_control(int target, bool en) if (pfunc) { ret = pfunc(PMIC_GET_CH(target), en); - - /* If RTC clock is unstable, delay 1 tick for PMIC GPO setting. */ - - if (!g_rtc_enabled && (PMIC_GET_TYPE(target) == PMIC_TYPE_GPO)) - { - usleep(1); - } - } - - return ret; -} - -/**************************************************************************** - * Name: board_power_control_tristate - * - * Description: - * Power on/off/HiZ the device on the board. - * (HiZ is available only for PMIC_TYPE_GPO.) - * - * Input Parameter: - * target : PMIC channel - * value : 1 (ON), 0 (OFF), -1(HiZ) - * - * Returned Value: - * 0 on success, else a negative error code - * - ****************************************************************************/ - -int board_power_control_tristate(int target, int value) -{ - int ret = 0; - bool en; - - if ((PMIC_GET_TYPE(target) == PMIC_TYPE_GPO) && (value < 0)) - { - /* set HiZ to PMIC GPO channel */ - - ret = cxd56_pmic_set_gpo_hiz(PMIC_GET_CH(target)); - - /* If RTC clock is unstable, delay 1 tick for PMIC setting. */ - - if (!g_rtc_enabled) - { - usleep(1); - } - } - else - { - en = value ? true : false; - ret = board_power_control(target, en); } return ret; @@ -313,38 +263,6 @@ bool board_power_monitor(int target) return ret; } -/**************************************************************************** - * Name: board_power_monitor_tristate - * - * Description: - * Get status of Power on/off/HiZ the device on the board. - * - * Input Parameter: - * target : PMIC channel - * - * Returned Value: - * 1 (ON), 0 (OFF), -1(HiZ) - * - ****************************************************************************/ - -int board_power_monitor_tristate(int target) -{ - int ret = 0; - bool en; - - if (PMIC_GET_TYPE(target) == PMIC_TYPE_GPO) - { - ret = cxd56_pmic_get_gpo_hiz(PMIC_GET_CH(target)); - } - else - { - en = board_power_monitor(target); - ret = en ? 1 : 0; - } - - return ret; -} - /**************************************************************************** * Name: board_flash_power_control * From 115ebb90eee353c1d8712c3931a71023cb3dd86a Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 17 Jun 2020 11:53:21 +0900 Subject: [PATCH 03/18] Add error check for arguments --- arch/arm/src/cxd56xx/cxd56_scu.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c index 32fad6b6fe3cb..c715a484f8b43 100644 --- a/arch/arm/src/cxd56xx/cxd56_scu.c +++ b/arch/arm/src/cxd56xx/cxd56_scu.c @@ -2756,14 +2756,36 @@ FAR struct seq_s *seq_open(int type, int bustype) { FAR struct seq_s *seq; + /* Check bustype is valid */ + + switch (bustype) + { + case SCU_BUS_SPI: + case SCU_BUS_I2C0: + case SCU_BUS_I2C1: + case SCU_BUS_LPADC0: + case SCU_BUS_LPADC1: + case SCU_BUS_LPADC2: + case SCU_BUS_LPADC3: + case SCU_BUS_HPADC0: + case SCU_BUS_HPADC1: + break; + default: + return NULL; + } + if (type == SEQ_TYPE_DECI) { seq = deci_new(); } - else + else if (type == SEQ_TYPE_NORMAL) { seq = seq_new(); } + else + { + return NULL; + } if (!seq) { From cd69f15aaa2b3ff17d0798b444abb112176f7ac6 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Thu, 11 Jun 2020 13:48:07 +0900 Subject: [PATCH 04/18] Fix HPADC gain value --- arch/arm/src/cxd56xx/cxd56_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_adc.c b/arch/arm/src/cxd56xx/cxd56_adc.c index f9cc3973f58fb..1343bf6a54712 100644 --- a/arch/arm/src/cxd56xx/cxd56_adc.c +++ b/arch/arm/src/cxd56xx/cxd56_adc.c @@ -126,7 +126,7 @@ /* Input Gain setting */ -#define INPUT_GAIN(a, g2, g1) (((a) << 24) | ((g2) << 16) | ((g1) << 12)) +#define INPUT_GAIN(a, g1, g2) (((a) << 24) | ((g2) << 16) | ((g1) << 12)) #define INPUT_GAIN_MASK INPUT_GAIN(3, 15, 15) #define INPUT_GAIN_MINUS_6DB INPUT_GAIN(2, 0, 0) #define INPUT_GAIN_THROUGH INPUT_GAIN(0, 0, 0) From ca65b26260d2a7c82ffcd8eaff9c72fbb91df038 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 23 Jun 2020 18:24:45 +0900 Subject: [PATCH 05/18] Fix typo --- arch/arm/src/cxd56xx/cxd56_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_timer.c b/arch/arm/src/cxd56xx/cxd56_timer.c index 405d81e0ff1d0..8a0faee8d70b0 100644 --- a/arch/arm/src/cxd56xx/cxd56_timer.c +++ b/arch/arm/src/cxd56xx/cxd56_timer.c @@ -365,7 +365,7 @@ static int cxd56_getstatus(FAR struct timer_lowerhalf_s *lower, * Input Parameters: * lower - A pointer the publicly visible representation of the "lower * half" driver state structure. - * timeout - The new timeout value in milliseconds. + * timeout - The new timeout value in microseconds. * * Returned Values: * Zero on success; a negated errno value on failure. From 4a8c8ab15b64e3fa2ef8b33b8c3915bb98e2f67d Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 24 Jun 2020 21:28:18 +0900 Subject: [PATCH 06/18] Add support for PMIC GPO setter/getter with HiZ --- arch/arm/src/cxd56xx/cxd56_pmic.c | 45 ++++++++++++ arch/arm/src/cxd56xx/cxd56_pmic.h | 16 +++++ .../cxd56xx/spresense/include/cxd56_power.h | 34 ++++++++++ .../arm/cxd56xx/spresense/src/cxd56_power.c | 68 +++++++++++++++++++ 4 files changed, 163 insertions(+) diff --git a/arch/arm/src/cxd56xx/cxd56_pmic.c b/arch/arm/src/cxd56xx/cxd56_pmic.c index c2350f057d979..1ae6223a73ad1 100644 --- a/arch/arm/src/cxd56xx/cxd56_pmic.c +++ b/arch/arm/src/cxd56xx/cxd56_pmic.c @@ -485,6 +485,51 @@ bool cxd56_pmic_get_gpo(uint8_t chset) return false; } +/**************************************************************************** + * Name: cxd56_pmic_get_gpo_hiz + * + * Description: + * Get the tristate value from the specified GPO channel(s) + * + * Input Parameter: + * chset : GPO Channel number(s) + * + * Returned Value: + * Return 0(off), 1(on) or -1(HiZ) + * + ****************************************************************************/ + +int cxd56_pmic_get_gpo_hiz(uint8_t chset) +{ + uint8_t setbit0 = 0; + uint8_t clrbit0 = 0; + uint8_t setbit1 = 0; + uint8_t clrbit1 = 0; + uint8_t set; + uint8_t hiz; + + cxd56_pmic_set_gpo_reg(&setbit0, &clrbit0, &setbit1, &clrbit1); + + set = ((setbit1 & 0xf) << 4) | (setbit0 & 0xf); + hiz = ((setbit1) & 0xf0) | ((setbit0 & 0xf0) >> 4); + + /* If all of the specified chset is hiz, return -1 */ + + if ((hiz & chset) != chset) + { + return -1; + } + + /* If all of the specified chset is high, return 1 */ + + if ((set & chset) == chset) + { + return 1; + } + + return 0; +} + /**************************************************************************** * Name: cxd56_pmic_set_loadswitch_reg * diff --git a/arch/arm/src/cxd56xx/cxd56_pmic.h b/arch/arm/src/cxd56xx/cxd56_pmic.h index 2e85dc47120d7..0946834a4b0a9 100644 --- a/arch/arm/src/cxd56xx/cxd56_pmic.h +++ b/arch/arm/src/cxd56xx/cxd56_pmic.h @@ -309,6 +309,22 @@ int cxd56_pmic_set_gpo_hiz(uint8_t chset); bool cxd56_pmic_get_gpo(uint8_t chset); +/**************************************************************************** + * Name: cxd56_pmic_get_gpo_hiz + * + * Description: + * Get the tristate value from the specified GPO channel(s) + * + * Input Parameter: + * chset : GPO Channel number(s) + * + * Returned Value: + * Return 0(off), 1(on) or -1(HiZ) + * + ****************************************************************************/ + +int cxd56_pmic_get_gpo_hiz(uint8_t chset); + /**************************************************************************** * Name: cxd56_pmic_set_loadswitch_reg * diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_power.h b/boards/arm/cxd56xx/spresense/include/cxd56_power.h index f8b5811f31bc6..35ec56ce1d598 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_power.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_power.h @@ -133,6 +133,24 @@ int board_power_setup(int status); int board_power_control(int target, bool en); +/**************************************************************************** + * Name: board_power_control_tristate + * + * Description: + * Power on/off/HiZ the device on the board. + * (HiZ is available only for PMIC_TYPE_GPO.) + * + * Input Parameter: + * target : PMIC channel + * value : 1 (ON), 0 (OFF), -1(HiZ) + * + * Returned Value: + * 0 on success, else a negative error code + * + ****************************************************************************/ + +int board_power_control_tristate(int target, int value); + /**************************************************************************** * Name: board_power_monitor * @@ -143,6 +161,22 @@ int board_power_control(int target, bool en); bool board_power_monitor(int target); +/**************************************************************************** + * Name: board_power_monitor_tristate + * + * Description: + * Get status of Power on/off/HiZ the device on the board. + * + * Input Parameter: + * target : PMIC channel + * + * Returned Value: + * 1 (ON), 0 (OFF), -1(HiZ) + * + ****************************************************************************/ + +int board_power_monitor_tristate(int target); + /**************************************************************************** * Name: board_flash_power_control * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index fd572e0aa996d..e9a64b17b2523 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -225,6 +225,42 @@ int board_power_control(int target, bool en) return ret; } +/**************************************************************************** + * Name: board_power_control_tristate + * + * Description: + * Power on/off/HiZ the device on the board. + * (HiZ is available only for PMIC_TYPE_GPO.) + * + * Input Parameter: + * target : PMIC channel + * value : 1 (ON), 0 (OFF), -1(HiZ) + * + * Returned Value: + * 0 on success, else a negative error code + * + ****************************************************************************/ + +int board_power_control_tristate(int target, int value) +{ + int ret = 0; + bool en; + + if ((PMIC_GET_TYPE(target) == PMIC_TYPE_GPO) && (value < 0)) + { + /* set HiZ to PMIC GPO channel */ + + ret = cxd56_pmic_set_gpo_hiz(PMIC_GET_CH(target)); + } + else + { + en = value ? true : false; + ret = board_power_control(target, en); + } + + return ret; +} + /**************************************************************************** * Name: board_power_monitor * @@ -263,6 +299,38 @@ bool board_power_monitor(int target) return ret; } +/**************************************************************************** + * Name: board_power_monitor_tristate + * + * Description: + * Get status of Power on/off/HiZ the device on the board. + * + * Input Parameter: + * target : PMIC channel + * + * Returned Value: + * 1 (ON), 0 (OFF), -1(HiZ) + * + ****************************************************************************/ + +int board_power_monitor_tristate(int target) +{ + int ret = 0; + bool en; + + if (PMIC_GET_TYPE(target) == PMIC_TYPE_GPO) + { + ret = cxd56_pmic_get_gpo_hiz(PMIC_GET_CH(target)); + } + else + { + en = board_power_monitor(target); + ret = en ? 1 : 0; + } + + return ret; +} + /**************************************************************************** * Name: board_flash_power_control * From de2386a0526b23cea93f5a776c66a7482b53b8ad Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 30 Jun 2020 16:15:30 +0900 Subject: [PATCH 07/18] Fix FLOWCONTROL definition name in UART0 driver --- arch/arm/src/cxd56xx/cxd56_uart0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index 2dcbb920106f3..e35dab82eec15 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -175,7 +175,7 @@ static int uart0_open(FAR struct file *filep) /* Enable UART0 pin configuration */ -#ifdef CONFIG_UART0_FLOWCONTROL +#ifdef CONFIG_CXD56_UART0_FLOWCONTROL flowctl = 1; CXD56_PIN_CONFIGS(PINCONFS_SPI2_UART0); #else @@ -220,7 +220,7 @@ static int uart0_close(FAR struct file *filep) /* Disable UART0 pin by changing Hi-Z GPIO */ -#ifdef CONFIG_UART0_FLOWCONTROL +#ifdef CONFIG_CXD56_UART0_FLOWCONTROL CXD56_PIN_CONFIGS(PINCONFS_SPI2_GPIO); #else CXD56_PIN_CONFIGS(PINCONFS_SPI2A_GPIO); From e4d7c372b25b51bf9757dc67503bbc92ed5cbf6d Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 30 Jun 2020 19:34:12 +0900 Subject: [PATCH 08/18] Support O_NONBLOCK flag of UART0 --- arch/arm/src/cxd56xx/cxd56_uart0.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index e35dab82eec15..6145b5101d6fb 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -241,9 +242,7 @@ static ssize_t uart0_read(FAR struct file *filep, uart0_semtake(&g_lock); - /* Always blocking */ - - ret = PD_UartReceive(0, buffer, len, 0); + ret = PD_UartReceive(0, buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); uart0_semgive(&g_lock); @@ -267,9 +266,7 @@ static ssize_t uart0_write(FAR struct file *filep, uart0_semtake(&g_lock); - /* Always blocking */ - - ret = PD_UartSend(0, (FAR void *)buffer, len, 0); + ret = PD_UartSend(0, (FAR void *)buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); uart0_semgive(&g_lock); From 1272ae2de08fac0f619a893d644cf8e18612a910 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Mon, 6 Jul 2020 13:39:30 +0900 Subject: [PATCH 09/18] Fix raster operation bug in non-scaling case The scaling information should not be included in GE2D command buffer in non-scaling case. --- .../arm/cxd56xx/common/src/cxd56_imageproc.c | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index 5a90f1a737d1e..2b9731c585750 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -162,7 +162,7 @@ struct ge2d_copycmd_s uint32_t reserved[3]; } __attribute__ ((aligned(16))); -/* Raster operation (ROP) command (48 bytes) */ +/* Raster operation (ROP) command (32 bytes + scaling OP 16 bytes) */ struct ge2d_ropcmd_s { @@ -181,7 +181,10 @@ struct ge2d_ropcmd_s uint16_t patpitch; /* 0x1c */ uint8_t pathoffset; /* 0x1e */ uint8_t patvoffset; /* 0x1f */ + } __attribute__ ((aligned(16))); +struct ge2d_ropcmd_scaling_s + { uint16_t desth; /* 0x20 */ uint16_t destv; /* 0x22 */ uint16_t ratioh; /* 0x24 */ @@ -307,6 +310,7 @@ static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, uint8_t rop, uint8_t options, uint16_t patcolor) { struct ge2d_ropcmd_s *rc = (struct ge2d_ropcmd_s *)cmdbuf; + struct ge2d_ropcmd_scaling_s *sc; uint16_t rv; uint16_t rh; uint16_t cmd = ROPCMD; @@ -356,17 +360,34 @@ static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, rc->daddr = (uint32_t) (uintptr_t) destaddr | MSEL; rc->spitch = srcpitch - 1; rc->dpitch = destpitch - 1; - rc->desth = destwidth - 1; - rc->destv = destheight - 1; - rc->ratiov = rv - 1; - rc->ratioh = rh - 1; - rc->hphaseinit = 1; - rc->vphaseinit = 1; - rc->intpmode = 0; /* XXX: HV Linear interpolation */ + + /* Shift to next command area */ + + cmdbuf = (void *)((uintptr_t) cmdbuf + sizeof(struct ge2d_ropcmd_s)); + + /* Set scaling information */ + + if (cmd & SCALING) + { + sc = (struct ge2d_ropcmd_scaling_s *)cmdbuf; + + sc->desth = destwidth - 1; + sc->destv = destheight - 1; + sc->ratiov = rv - 1; + sc->ratioh = rh - 1; + sc->hphaseinit = 1; + sc->vphaseinit = 1; + sc->intpmode = 0; /* XXX: HV Linear interpolation */ + + /* Shift to next command area */ + + cmdbuf = (void *)((uintptr_t) cmdbuf + + sizeof(struct ge2d_ropcmd_scaling_s)); + } /* return next command area */ - return (void *)((uintptr_t) cmdbuf + sizeof(struct ge2d_ropcmd_s)); + return cmdbuf; } static void *set_ab_cmd(void *cmdbuf, void *srcaddr, void *destaddr, From 10d908fe7df4793cd7c0304c6889a65e289cf87b Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Mon, 3 Aug 2020 16:31:24 +0900 Subject: [PATCH 10/18] arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20149 --- arch/arm/src/cxd56xx/cxd56_farapistub.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.h b/arch/arm/src/cxd56xx/cxd56_farapistub.h index 1c3bdfbb47807..825545c021d39 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.h +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.h @@ -36,6 +36,6 @@ #ifndef __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H #define __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H -#define FARAPISTUB_VERSION 20129 +#define FARAPISTUB_VERSION 20149 #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H */ From 8350c8ec460f31a7de35417544dfb4c7ffacd5c2 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Thu, 2 Jul 2020 10:35:55 +0900 Subject: [PATCH 11/18] arch/arm/src/cxd56xx: Fix nxstyle issue --- arch/arm/include/cxd56xx/gnss.h | 2 +- arch/arm/src/cxd56xx/cxd56_farapi.c | 4 +- arch/arm/src/cxd56xx/cxd56_farapistub.S | 530 ++++++++++++------------ arch/arm/src/cxd56xx/cxd56_geofence.c | 26 +- arch/arm/src/cxd56xx/cxd56_gnss.c | 130 +++--- arch/arm/src/cxd56xx/cxd56_gnss_api.h | 128 +++--- arch/arm/src/cxd56xx/cxd56_pmic.c | 62 +-- arch/arm/src/cxd56xx/cxd56_powermgr.c | 12 +- arch/arm/src/cxd56xx/cxd56_sfc.c | 24 +- arch/arm/src/cxd56xx/cxd56_uart0.c | 32 +- 10 files changed, 475 insertions(+), 475 deletions(-) diff --git a/arch/arm/include/cxd56xx/gnss.h b/arch/arm/include/cxd56xx/gnss.h index 98348afad0b71..459d578344157 100644 --- a/arch/arm/include/cxd56xx/gnss.h +++ b/arch/arm/include/cxd56xx/gnss.h @@ -565,7 +565,7 @@ extern "C" #define CXD56_GNSS_IOCTL_INVAL 0 #define CXD56_GNSS_IOCTL_MAX 54 -/* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for GD_Start */ +/* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for fw_gd_start */ #define CXD56_GNSS_STMOD_COLD 0 /* Cold Start */ #define CXD56_GNSS_STMOD_WARM 1 /* Warm Start */ diff --git a/arch/arm/src/cxd56xx/cxd56_farapi.c b/arch/arm/src/cxd56xx/cxd56_farapi.c index 6ed3510a41b77..2b4c0d08946d3 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapi.c +++ b/arch/arm/src/cxd56xx/cxd56_farapi.c @@ -55,7 +55,7 @@ #include "cxd56_farapistub.h" #include "hardware/cxd5602_backupmem.h" -int PM_WakeUpCpu(int cpuid); +int fw_pm_wakeupcpu(int cpuid); /**************************************************************************** * Pre-processor Definitions @@ -209,7 +209,7 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) if (((gnscken & GNSDSP_CKEN_P1) != GNSDSP_CKEN_P1) && ((gnscken & GNSDSP_CKEN_COP) != GNSDSP_CKEN_COP)) { - PM_WakeUpCpu(GPS_CPU_ID); + fw_pm_wakeupcpu(GPS_CPU_ID); } } #endif diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.S b/arch/arm/src/cxd56xx/cxd56_farapistub.S index 8d28ba38e6694..94bb44bff9fdc 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.S +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.S @@ -57,141 +57,141 @@ .align 2 3: - /* PM_GpsPllClockSetSource */ + /* fw_pm_gpspllclocksetsource */ nop nop - /* PM_PmicGetChargingPortType */ + /* fw_pm_pmicgetchargingporttype */ nop nop - /* PM_PmicSetChargingCurrentValue */ + /* fw_pm_pmicsetchargingcurrentvalue */ nop nop - /* PM_PmicStartCharging */ + /* fw_pm_pmicstartcharging */ nop nop - /* PM_PmicStopCharging */ + /* fw_pm_pmicstopcharging */ nop nop - /* PM_PeriPowerOn */ + /* fw_pm_peripoweron */ nop nop - /* PM_PeriPowerOff */ + /* fw_pm_peripoweroff */ nop nop - /* _PM_PeriClockEnable */ + /* fw__pm_periclockenable */ nop nop - /* _PM_PeriClockDisable */ + /* fw__pm_periclockdisable */ nop nop - /* _PM_UpdateCpuFreqInfo */ + /* fw__pm_updatecpufreqinfo */ nop nop - /* PM_PmicPowerOn */ + /* fw_pm_pmicpoweron */ nop nop - /* PM_PmicPowerOff */ + /* fw_pm_pmicpoweroff */ nop nop - /* PM_SetWakeupTrigger */ + /* fw_pm_setwakeuptrigger */ nop nop - /* PM_HostifClockEnable */ + /* fw_pm_hostifclockenable */ nop nop - /* PM_HostifClockDisable */ + /* fw_pm_hostifclockdisable */ nop nop - .global PM_StartCpu + .global fw_pm_startcpu .thumb_func -PM_StartCpu: +fw_pm_startcpu: mov r12, pc b 1b - .global PM_StopCpu + .global fw_pm_stopcpu .thumb_func -PM_StopCpu: +fw_pm_stopcpu: mov r12, pc b 1b - .global PM_SleepCpu + .global fw_pm_sleepcpu .thumb_func -PM_SleepCpu: +fw_pm_sleepcpu: mov r12, pc b 1b - .global PM_WakeUpCpu + .global fw_pm_wakeupcpu .thumb_func -PM_WakeUpCpu: +fw_pm_wakeupcpu: mov r12, pc b 1b - .global PM_ColdSleep + .global fw_pm_coldsleep .thumb_func -PM_ColdSleep: +fw_pm_coldsleep: mov r12, pc b 1b - .global PM_DeepSleep + .global fw_pm_deepsleep .thumb_func -PM_DeepSleep: +fw_pm_deepsleep: mov r12, pc b 1b - .global PM_Reboot + .global fw_pm_reboot .thumb_func -PM_Reboot: +fw_pm_reboot: mov r12, pc b 1b - .global PM_LoadImage + .global fw_pm_loadimage .thumb_func -PM_LoadImage: +fw_pm_loadimage: mov r12, pc b 1b - /* PM_LoadImageToAddress */ + /* fw_pm_loadimagetoaddress */ nop nop - /* PM_RamControlByAddress */ + /* fw_pm_ramcontrolbyaddress */ nop nop - /* PM_ChangeClock */ + /* fw_pm_changeclock */ nop nop - .global pm_pmic_control + .global fw_pm_pmiccontrol .thumb_func -pm_pmic_control: +fw_pm_pmiccontrol: mov r12, pc b 1b - /* PM_BootCpu */ + /* fw_pm_bootcpu */ nop nop - /* PM_BootCpuWithWaitMode */ + /* fw_pm_bootcpuwithwaitmode */ nop nop - /* PM_GetClock */ + /* fw_pm_getclock */ nop nop @@ -229,95 +229,95 @@ _modulelist_power_mgr: .align 2 3: - /* FM_GetRegistryValue */ + /* fw_fm_getregistryvalue */ nop nop - /* FM_SetRegistryValue */ + /* fw_fm_setregistryvalue */ nop nop - /* FM_SetRegistryValueList */ + /* fw_fm_setregistryvaluelist */ nop nop - /* FM_DeleteRegistryKey */ + /* fw_fm_deleteregistrykey */ nop nop - /* FM_GenerateRegistryKey */ + /* fw_fm_generateregistrykey */ nop nop - /* FM_Sync */ + /* fw_fm_sync */ nop nop - /* FM_FileOpen */ + /* fw_fm_fileopen */ nop nop - /* FM_FileClose */ + /* fw_fm_fileclose */ nop nop - /* FM_FileRead */ + /* fw_fm_fileread */ nop nop - /* FM_FileWrite */ + /* fw_fm_filewrite */ nop nop - /* FM_FileSeek */ + /* fw_fm_fileseek */ nop nop - /* FM_FileFlush */ + /* fw_fm_fileflush */ nop nop - /* FM_FileDelete */ + /* fw_fm_filedelete */ nop nop - .global FM_RawWrite + .global fw_fm_rawwrite .thumb_func -FM_RawWrite: +fw_fm_rawwrite: mov r12, pc b 1b - .global FM_RawRead + .global fw_fm_rawread .thumb_func -FM_RawRead: +fw_fm_rawread: mov r12, pc b 1b - .global FM_RawEraseSector + .global fw_fm_rawerasesector .thumb_func -FM_RawEraseSector: +fw_fm_rawerasesector: mov r12, pc b 1b - /* FM_FileRename */ + /* fw_fm_filerename */ nop nop - /* FM_FileGetAttr */ + /* fw_fm_filegetattr */ nop nop - /* FM_FileSetAttr */ + /* fw_fm_filesetattr */ nop nop - /* FM_FileClearAttr */ + /* fw_fm_fileclearattr */ nop nop - .global FM_RawVerifyWrite + .global fw_fm_rawverifywrite .thumb_func -FM_RawVerifyWrite: +fw_fm_rawverifywrite: mov r12, pc b 1b @@ -355,39 +355,39 @@ _modulelist_flash_mgr: .align 2 3: - /* SYS_RtcMgrSetTime */ + /* fw_sys_rtcmgrsettime */ nop nop - /* SYS_RtcMgrGetTime */ + /* fw_sys_rtcmgrgettime */ nop nop - /* SYS_RtcMgrConvTime */ + /* fw_sys_rtcmgrconvtime */ nop nop - /* SYS_RtcMgrConvCalendarTime */ + /* fw_sys_rtcmgrconvcalendartime */ nop nop - /* SYS_RtcMgrSetCalendarTime */ + /* fw_sys_rtcmgrsetcalendartime */ nop nop - /* SYS_RtcMgrGetCalendarTime */ + /* fw_sys_rtcmgrgetcalendartime */ nop nop - /* SYS_RtcMgrAdjustTime */ + /* fw_sys_rtcmgradjusttime */ nop nop - /* SYS_RtcMgrRequestAlarm */ + /* fw_sys_rtcmgrrequestalarm */ nop nop - /* SYS_RtcMgrCancelAlarm */ + /* fw_sys_rtcmgrcancelalarm */ nop nop @@ -425,131 +425,131 @@ _modulelist_rtc_mgr: .align 2 3: - /* GNSP_ChangeClockBoot */ + /* fw_gnsp_changeclockboot */ nop nop - /* GNSP_ChangeClockNormal */ + /* fw_gnsp_changeclocknormal */ nop nop - /* GNSP_SetAttribute */ + /* fw_gnsp_setattribute */ nop nop - /* GNSP_GetPowerStatus */ + /* fw_gnsp_getpowerstatus */ nop nop - /* GNSP_PonGnss */ + /* fw_gnsp_pongnss */ nop nop - /* GNSP_PoffGnss */ + /* fw_gnsp_poffgnss */ nop nop - /* GNSP_PoffLNA */ + /* fw_gnsp_pofflna */ nop nop - /* GNSP_Sleep */ + /* fw_gnsp_sleep */ nop nop - /* GNSP_Wakeup */ + /* fw_gnsp_wakeup */ nop nop - /* GNSP_SetWakeupTime */ + /* fw_gnsp_setwakeuptime */ nop nop - /* GNSP_GetAttribute */ + /* fw_gnsp_getattribute */ nop nop - /* GNSP_ClockOn */ + /* fw_gnsp_clockon */ nop nop - /* GNSP_ClockOff */ + /* fw_gnsp_clockoff */ nop nop - /* GNSP_ChangeMode */ + /* fw_gnsp_changemode */ nop nop - /* GNSP_EnableIo */ + /* fw_gnsp_enableio */ nop nop - /* GNSP_ControlGpioOut */ + /* fw_gnsp_controlgpioout */ nop nop - /* GNSP_Debug */ + /* fw_gnsp_debug */ nop nop - /* GNSP_ChangeClockRtc */ + /* fw_gnsp_changeclockrtc */ nop nop - /* GNSP_ChangeClockSFCClkup */ + /* fw_gnsp_changeclocksfcclkup */ nop nop - /* GNSP_ChangeClockSFCClkdwn */ + /* fw_gnsp_changeclocksfcclkdwn */ nop nop - /* GNSP_ChangeClockGPSCPUClkup */ + /* fw_gnsp_changeclockgpscpuclkup */ nop nop - /* GNSP_ChangeClockGPSCPUClkdwn */ + /* fw_gnsp_changeclockgpscpuclkdwn */ nop nop - /* GNSP_GetBootCause */ + /* fw_gnsp_getbootcause */ nop nop - /* GNSP_GetWakeupTrigger */ + /* fw_gnsp_getwakeuptrigger */ nop nop - /* GNSP_SelfReboot */ + /* fw_gnsp_selfreboot */ nop nop - /* GNSP_Start_KeepPPSOut */ + /* fw_gnsp_start_keepppsout */ nop nop - /* GNSP_Stop_KeepPPSOut */ + /* fw_gnsp_stop_keepppsout */ nop nop - /* GNSP_Start_KeepITPOut */ + /* fw_gnsp_start_keepitpout */ nop nop - /* GNSP_Stop_KeepITPOut */ + /* fw_gnsp_stop_keepitpout */ nop nop - /* GNSP_SetSleepState */ + /* fw_gnsp_setsleepstate */ nop nop - /* GNSP_FreeSysMemory */ + /* fw_gnsp_freesysmemory */ nop nop - /* GNSP_ReadAlmanacFile */ + /* fw_gnsp_readalmanacfile */ nop nop @@ -587,9 +587,9 @@ _modulelist_gnss_pwr: .align 2 3: - .global as_aca_control + .global fw_as_acacontrol .thumb_func -as_aca_control: +fw_as_acacontrol: mov r12, pc b 1b @@ -627,9 +627,9 @@ _modulelist_aca: .align 2 3: - .global PD_PinConfigs + .global fw_pd_pinconfigs .thumb_func -PD_PinConfigs: +fw_pd_pinconfigs: mov r12, pc b 1b @@ -667,45 +667,45 @@ _modulelist_pinconfig: .align 2 3: - .global PD_UartInit + .global fw_pd_uartinit .thumb_func -PD_UartInit: +fw_pd_uartinit: mov r12, pc b 1b - .global PD_UartUninit + .global fw_pd_uartuninit .thumb_func -PD_UartUninit: +fw_pd_uartuninit: mov r12, pc b 1b - .global PD_UartConfiguration + .global fw_pd_uartconfiguration .thumb_func -PD_UartConfiguration: +fw_pd_uartconfiguration: mov r12, pc b 1b - .global PD_UartEnable + .global fw_pd_uartenable .thumb_func -PD_UartEnable: +fw_pd_uartenable: mov r12, pc b 1b - .global PD_UartDisable + .global fw_pd_uartdisable .thumb_func -PD_UartDisable: +fw_pd_uartdisable: mov r12, pc b 1b - .global PD_UartReceive + .global fw_pd_uartreceive .thumb_func -PD_UartReceive: +fw_pd_uartreceive: mov r12, pc b 1b - .global PD_UartSend + .global fw_pd_uartsend .thumb_func -PD_UartSend: +fw_pd_uartsend: mov r12, pc b 1b @@ -743,45 +743,45 @@ _modulelist_uart: .align 2 3: - .global UM_Init + .global fw_um_init .thumb_func -UM_Init: +fw_um_init: mov r12, pc b 1b - .global UM_Open + .global fw_um_open .thumb_func -UM_Open: +fw_um_open: mov r12, pc b 1b - .global UM_Commit + .global fw_um_commit .thumb_func -UM_Commit: +fw_um_commit: mov r12, pc b 1b - .global UM_Close + .global fw_um_close .thumb_func -UM_Close: +fw_um_close: mov r12, pc b 1b - .global UM_CheckPoint + .global fw_um_checkpoint .thumb_func -UM_CheckPoint: +fw_um_checkpoint: mov r12, pc b 1b - .global UM_DoUpdateSequence + .global fw_um_doupdatesequence .thumb_func -UM_DoUpdateSequence: +fw_um_doupdatesequence: mov r12, pc b 1b - .global UM_Abort + .global fw_um_abort .thumb_func -UM_Abort: +fw_um_abort: mov r12, pc b 1b @@ -819,387 +819,387 @@ _modulelist_update_mgr: .align 2 3: - .global GD_Start + .global fw_gd_start .thumb_func -GD_Start: +fw_gd_start: mov r12, pc b 1b - .global GD_Stop + .global fw_gd_stop .thumb_func -GD_Stop: +fw_gd_stop: mov r12, pc b 1b - .global GD_SelectSatelliteSystem + .global fw_gd_selectsatellitesystem .thumb_func -GD_SelectSatelliteSystem: +fw_gd_selectsatellitesystem: mov r12, pc b 1b - .global GD_GetSatelliteSystem + .global fw_gd_getsatellitesystem .thumb_func -GD_GetSatelliteSystem: +fw_gd_getsatellitesystem: mov r12, pc b 1b - .global GD_SetReceiverPositionEllipsoidal + .global fw_gd_setreceiverpositionellipsoidal .thumb_func -GD_SetReceiverPositionEllipsoidal: +fw_gd_setreceiverpositionellipsoidal: mov r12, pc b 1b - .global GD_SetReceiverPositionOrthogonal + .global fw_gd_setreceiverpositionorthogonal .thumb_func -GD_SetReceiverPositionOrthogonal: +fw_gd_setreceiverpositionorthogonal: mov r12, pc b 1b - .global GD_SetOperationMode + .global fw_gd_setoperationmode .thumb_func -GD_SetOperationMode: +fw_gd_setoperationmode: mov r12, pc b 1b - .global GD_GetOperationMode + .global fw_gd_getoperationmode .thumb_func -GD_GetOperationMode: +fw_gd_getoperationmode: mov r12, pc b 1b - .global GD_SetTcxoOffset + .global fw_gd_settcxooffset .thumb_func -GD_SetTcxoOffset: +fw_gd_settcxooffset: mov r12, pc b 1b - .global GD_GetTcxoOffset + .global fw_gd_gettcxooffset .thumb_func -GD_GetTcxoOffset: +fw_gd_gettcxooffset: mov r12, pc b 1b - .global GD_SetTime + .global fw_gd_settime .thumb_func -GD_SetTime: +fw_gd_settime: mov r12, pc b 1b - .global GD_GetAlmanac + .global fw_gd_getalmanac .thumb_func -GD_GetAlmanac: +fw_gd_getalmanac: mov r12, pc b 1b - .global GD_SetAlmanac + .global fw_gd_setalmanac .thumb_func -GD_SetAlmanac: +fw_gd_setalmanac: mov r12, pc b 1b - .global GD_GetEphemeris + .global fw_gd_getephemeris .thumb_func -GD_GetEphemeris: +fw_gd_getephemeris: mov r12, pc b 1b - .global GD_SetEphemeris + .global fw_gd_setephemeris .thumb_func -GD_SetEphemeris: +fw_gd_setephemeris: mov r12, pc b 1b - .global GD_GetVarEphemeris + .global fw_gd_getvarephemeris .thumb_func -GD_GetVarEphemeris: +fw_gd_getvarephemeris: mov r12, pc b 1b - .global GD_SetVarEphemeris + .global fw_gd_setvarephemeris .thumb_func -GD_SetVarEphemeris: +fw_gd_setvarephemeris: mov r12, pc b 1b - .global GD_StartGpsTest + .global fw_gd_startgpstest .thumb_func -GD_StartGpsTest: +fw_gd_startgpstest: mov r12, pc b 1b - .global GD_StopGpsTest + .global fw_gd_stopgpstest .thumb_func -GD_StopGpsTest: +fw_gd_stopgpstest: mov r12, pc b 1b - .global GD_GetGpsTestResult + .global fw_gd_getgpstestresult .thumb_func -GD_GetGpsTestResult: +fw_gd_getgpstestresult: mov r12, pc b 1b - .global GD_SaveBackupdata + .global fw_gd_savebackupdata .thumb_func -GD_SaveBackupdata: +fw_gd_savebackupdata: mov r12, pc b 1b - .global GD_EraseBackup + .global fw_gd_erasebackup .thumb_func -GD_EraseBackup: +fw_gd_erasebackup: mov r12, pc b 1b - .global GD_CepSetAssistData + .global fw_gd_cepsetassistdata .thumb_func -GD_CepSetAssistData: +fw_gd_cepsetassistdata: mov r12, pc b 1b - .global GD_CepEraseAssistData + .global fw_gd_ceperaseassistdata .thumb_func -GD_CepEraseAssistData: +fw_gd_ceperaseassistdata: mov r12, pc b 1b - .global GD_CepCheckAssistData + .global fw_gd_cepcheckassistdata .thumb_func -GD_CepCheckAssistData: +fw_gd_cepcheckassistdata: mov r12, pc b 1b - .global GD_CepGetAgeData + .global fw_gd_cepgetagedata .thumb_func -GD_CepGetAgeData: +fw_gd_cepgetagedata: mov r12, pc b 1b - .global GD_CepInitAssistData + .global fw_gd_cepinitassistdata .thumb_func -GD_CepInitAssistData: +fw_gd_cepinitassistdata: mov r12, pc b 1b - .global GD_SetAcquist + .global fw_gd_setacquist .thumb_func -GD_SetAcquist: +fw_gd_setacquist: mov r12, pc b 1b - .global GD_SetFrameTime + .global fw_gd_setframetime .thumb_func -GD_SetFrameTime: +fw_gd_setframetime: mov r12, pc b 1b - .global GD_SetTauGps + .global fw_gd_settaugps .thumb_func -GD_SetTauGps: +fw_gd_settaugps: mov r12, pc b 1b - .global GD_SetTimeGps + .global fw_gd_settimegps .thumb_func -GD_SetTimeGps: +fw_gd_settimegps: mov r12, pc b 1b - .global GD_ClearReceiverInfo + .global fw_gd_clearreceiverinfo .thumb_func -GD_ClearReceiverInfo: +fw_gd_clearreceiverinfo: mov r12, pc b 1b - .global GD_SetTowAssist + .global fw_gd_settowassist .thumb_func -GD_SetTowAssist: +fw_gd_settowassist: mov r12, pc b 1b - .global GD_SetUtcModel + .global fw_gd_setutcmodel .thumb_func -GD_SetUtcModel: +fw_gd_setutcmodel: mov r12, pc b 1b - .global GD_SpectrumControl + .global fw_gd_spectrumcontrol .thumb_func -GD_SpectrumControl: +fw_gd_spectrumcontrol: mov r12, pc b 1b - .global GD_ReadBuffer + .global fw_gd_readbuffer .thumb_func -GD_ReadBuffer: +fw_gd_readbuffer: mov r12, pc b 1b - .global GD_WriteBuffer + .global fw_gd_writebuffer .thumb_func -GD_WriteBuffer: +fw_gd_writebuffer: mov r12, pc b 1b - .global GD_SetNotifyMask + .global fw_gd_setnotifymask .thumb_func -GD_SetNotifyMask: +fw_gd_setnotifymask: mov r12, pc b 1b - .global GD_GeoAddRegion + .global fw_gd_geoaddregion .thumb_func -GD_GeoAddRegion: +fw_gd_geoaddregion: mov r12, pc b 1b - .global GD_GeoModifyRegion + .global fw_gd_geomodifyregion .thumb_func -GD_GeoModifyRegion: +fw_gd_geomodifyregion: mov r12, pc b 1b - .global GD_GeoDeleteRegione + .global fw_gd_geodeleteregione .thumb_func -GD_GeoDeleteRegione: +fw_gd_geodeleteregione: mov r12, pc b 1b - .global GD_GeoDeleteAllRegion + .global fw_gd_geodeleteallregion .thumb_func -GD_GeoDeleteAllRegion: +fw_gd_geodeleteallregion: mov r12, pc b 1b - .global GD_GeoGetRegionData + .global fw_gd_geogetregiondata .thumb_func -GD_GeoGetRegionData: +fw_gd_geogetregiondata: mov r12, pc b 1b - .global GD_GeoGetUsedRegionId + .global fw_gd_geogetusedregionid .thumb_func -GD_GeoGetUsedRegionId: +fw_gd_geogetusedregionid: mov r12, pc b 1b - .global GD_GeoSetOpMode + .global fw_gd_geosetopmode .thumb_func -GD_GeoSetOpMode: +fw_gd_geosetopmode: mov r12, pc b 1b - .global GD_GeoSetAllRgionNotifyRequest + .global fw_gd_geosetallrgionnotifyrequest .thumb_func -GD_GeoSetAllRgionNotifyRequest: +fw_gd_geosetallrgionnotifyrequest: mov r12, pc b 1b - .global GD_RegisterGeofence + .global fw_gd_registergeofence .thumb_func -GD_RegisterGeofence: +fw_gd_registergeofence: mov r12, pc b 1b - .global GD_ReleaseGeofence + .global fw_gd_releasegeofence .thumb_func -GD_ReleaseGeofence: +fw_gd_releasegeofence: mov r12, pc b 1b - .global GD_RegisterPvtlog + .global fw_gd_registerpvtlog .thumb_func -GD_RegisterPvtlog: +fw_gd_registerpvtlog: mov r12, pc b 1b - .global GD_ReleasePvtlog + .global fw_gd_releasepvtlog .thumb_func -GD_ReleasePvtlog: +fw_gd_releasepvtlog: mov r12, pc b 1b - .global GD_PvtlogDeleteLog + .global fw_gd_pvtlogdeletelog .thumb_func -GD_PvtlogDeleteLog: +fw_gd_pvtlogdeletelog: mov r12, pc b 1b - .global GD_PvtlogGetLogStatus + .global fw_gd_pvtloggetlogstatus .thumb_func -GD_PvtlogGetLogStatus: +fw_gd_pvtloggetlogstatus: mov r12, pc b 1b - .global GD_RtkStart + .global fw_gd_rtkstart .thumb_func -GD_RtkStart: +fw_gd_rtkstart: mov r12, pc b 1b - .global GD_RtkStop + .global fw_gd_rtkstop .thumb_func -GD_RtkStop: +fw_gd_rtkstop: mov r12, pc b 1b - .global GD_RtkSetOutputInterval + .global fw_gd_rtksetoutputinterval .thumb_func -GD_RtkSetOutputInterval: +fw_gd_rtksetoutputinterval: mov r12, pc b 1b - .global GD_RtkGetOutputInterval + .global fw_gd_rtkgetoutputinterval .thumb_func -GD_RtkGetOutputInterval: +fw_gd_rtkgetoutputinterval: mov r12, pc b 1b - .global GD_RtkSetGnss + .global fw_gd_rtksetgnss .thumb_func -GD_RtkSetGnss: +fw_gd_rtksetgnss: mov r12, pc b 1b - .global GD_RtkGetGnss + .global fw_gd_rtkgetgnss .thumb_func -GD_RtkGetGnss: +fw_gd_rtkgetgnss: mov r12, pc b 1b - .global GD_RtkSetEphNotify + .global fw_gd_rtksetephnotify .thumb_func -GD_RtkSetEphNotify: +fw_gd_rtksetephnotify: mov r12, pc b 1b - .global GD_RtkGetEphNotify + .global fw_gd_rtkgetephnotify .thumb_func -GD_RtkGetEphNotify: +fw_gd_rtkgetephnotify: mov r12, pc b 1b - .global GD_SetUseCase + .global fw_gd_setusecase .thumb_func -GD_SetUseCase: +fw_gd_setusecase: mov r12, pc b 1b - .global GD_GetUseCase + .global fw_gd_getusecase .thumb_func -GD_GetUseCase: +fw_gd_getusecase: mov r12, pc b 1b - .global GD_Set1ppsOutput + .global fw_gd_set1ppsoutput .thumb_func -GD_Set1ppsOutput: +fw_gd_set1ppsoutput: mov r12, pc b 1b - .global GD_Get1ppsOutput + .global fw_gd_get1ppsoutput .thumb_func -GD_Get1ppsOutput: +fw_gd_get1ppsoutput: mov r12, pc b 1b diff --git a/arch/arm/src/cxd56xx/cxd56_geofence.c b/arch/arm/src/cxd56xx/cxd56_geofence.c index f41a107c5b16b..e8706ec58a3c7 100644 --- a/arch/arm/src/cxd56xx/cxd56_geofence.c +++ b/arch/arm/src/cxd56xx/cxd56_geofence.c @@ -166,7 +166,7 @@ FAR static int (*g_cmdlist[CXD56_GEOFENCE_IOCTL_MAX])(unsigned long) = static int cxd56_geofence_start(unsigned long arg) { - return GD_RegisterGeofence(); + return fw_gd_registergeofence(); } /**************************************************************************** @@ -186,7 +186,7 @@ static int cxd56_geofence_start(unsigned long arg) static int cxd56_geofence_stop(unsigned long arg) { - return GD_ReleaseGeofence(); + return fw_gd_releasegeofence(); } /**************************************************************************** @@ -215,7 +215,7 @@ static int cxd56_geofence_add_region(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = GD_GeoAddRegion(reg_data->id, reg_data->latitude, reg_data->longitude, + ret = fw_gd_geoaddregion(reg_data->id, reg_data->latitude, reg_data->longitude, reg_data->radius); return ret; @@ -247,7 +247,7 @@ static int cxd56_geofence_modify_region(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = GD_GeoModifyRegion(reg_data->id, reg_data->latitude, + ret = fw_gd_geomodifyregion(reg_data->id, reg_data->latitude, reg_data->longitude, reg_data->radius); return ret; @@ -279,7 +279,7 @@ static int cxd56_geofence_delete_region(unsigned long arg) } id = (uint8_t)arg; - ret = GD_GeoDeleteRegione(id); + ret = fw_gd_geodeleteregione(id); return ret; } @@ -303,7 +303,7 @@ static int cxd56_geofence_delete_all_region(unsigned long arg) { int ret; - ret = GD_GeoDeleteAllRegion(); + ret = fw_gd_geodeleteallregion(); return ret; } @@ -334,7 +334,7 @@ static int cxd56_geofence_get_region_data(unsigned long arg) } reg_data = (FAR struct cxd56_geofence_region_s *)arg; - ret = GD_GeoGetRegionData(reg_data->id, ®_data->latitude, + ret = fw_gd_geogetregiondata(reg_data->id, ®_data->latitude, ®_data->longitude, ®_data->radius); return ret; @@ -362,7 +362,7 @@ static int cxd56_geofence_get_used_id(unsigned long arg) return -EINVAL; } - *(uint32_t *)arg = GD_GeoGetUsedRegionId(); + *(uint32_t *)arg = fw_gd_geogetusedregionid(); return 0; } @@ -386,7 +386,7 @@ static int cxd56_geofence_get_all_status(unsigned long arg) { int ret; - ret = GD_GeoSetAllRgionNotifyRequest(); + ret = fw_gd_geosetallrgionnotifyrequest(); return ret; } @@ -417,7 +417,7 @@ static int cxd56_geofence_set_mode(unsigned long arg) } mode = (FAR struct cxd56_geofence_mode_s *)arg; - ret = GD_GeoSetOpMode(mode->deadzone, mode->dwell_detecttime); + ret = fw_gd_geosetopmode(mode->deadzone, mode->dwell_detecttime); return ret; } @@ -561,9 +561,9 @@ static ssize_t cxd56_geofence_read(FAR struct file *filep, FAR char *buffer, goto _err; } - /* GD_ReadBuffer returns copied data size or negative error code */ + /* fw_gd_readbuffer returns copied data size or negative error code */ - ret = GD_ReadBuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len); + ret = fw_gd_readbuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len); _err: return ret; @@ -648,7 +648,7 @@ static int cxd56_geofence_poll(FAR struct file *filep, FAR struct pollfd *fds, priv->fds[i] = fds; fds->priv = &priv->fds[i]; - GD_SetNotifyMask(CXD56_CPU1_DEV_GEOFENCE, FALSE); + fw_gd_setnotifymask(CXD56_CPU1_DEV_GEOFENCE, FALSE); break; } } diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index 6cf88b46456cc..72ba918314b74 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -65,9 +65,9 @@ * External Defined Functions ****************************************************************************/ -extern int PM_LoadImage(int cpuid, const char* filename); -extern int PM_StartCpu(int cpuid, int wait); -extern int PM_SleepCpu(int cpuid, int mode); +extern int fw_pm_loadimage(int cpuid, const char* filename); +extern int fw_pm_startcpu(int cpuid, int wait); +extern int fw_pm_sleepcpu(int cpuid, int mode); /**************************************************************************** * Pre-processor Definitions @@ -480,7 +480,7 @@ static int cxd56_gnss_select_satellite_system(FAR struct file *filep, { uint32_t system = (uint32_t)arg; - return GD_SelectSatelliteSystem(system); + return fw_gd_selectsatellitesystem(system); } /**************************************************************************** @@ -512,7 +512,7 @@ static int cxd56_gnss_get_satellite_system(FAR struct file *filep, return -EINVAL; } - ret = GD_GetSatelliteSystem(&system); + ret = fw_gd_getsatellitesystem(&system); *(uint32_t *)arg = system; return ret; @@ -548,7 +548,7 @@ cxd56_gnss_set_receiver_position_ellipsoidal(FAR struct file *filep, pos = (FAR struct cxd56_gnss_ellipsoidal_position_s *)arg; - return GD_SetReceiverPositionEllipsoidal(&pos->latitude, &pos->longitude, + return fw_gd_setreceiverpositionellipsoidal(&pos->latitude, &pos->longitude, &pos->altitude); } @@ -580,7 +580,7 @@ static int cxd56_gnss_set_receiver_position_orthogonal(FAR struct file *filep, } pos = (FAR struct cxd56_gnss_orthogonal_position_s *)arg; - return GD_SetReceiverPositionOrthogonal(pos->x, pos->y, pos->z); + return fw_gd_setreceiverpositionorthogonal(pos->x, pos->y, pos->z); } /**************************************************************************** @@ -609,7 +609,7 @@ static int cxd56_gnss_set_ope_mode(FAR struct file *filep, unsigned long arg) ope_mode = (FAR struct cxd56_gnss_ope_mode_param_s *)arg; - return GD_SetOperationMode(ope_mode->mode, ope_mode->cycle); + return fw_gd_setoperationmode(ope_mode->mode, ope_mode->cycle); } /**************************************************************************** @@ -638,7 +638,7 @@ static int cxd56_gnss_get_ope_mode(FAR struct file *filep, unsigned long arg) ope_mode = (FAR struct cxd56_gnss_ope_mode_param_s *)arg; - return GD_GetOperationMode(&ope_mode->mode, &ope_mode->cycle); + return fw_gd_getoperationmode(&ope_mode->mode, &ope_mode->cycle); } /**************************************************************************** @@ -662,7 +662,7 @@ static int cxd56_gnss_set_tcxo_offset(FAR struct file *filep, { int32_t offset = (int32_t)arg; - return GD_SetTcxoOffset(offset); + return fw_gd_settcxooffset(offset); } /**************************************************************************** @@ -692,7 +692,7 @@ static int cxd56_gnss_get_tcxo_offset(FAR struct file *filep, return -EINVAL; } - ret = GD_GetTcxoOffset(&offset); + ret = fw_gd_gettcxooffset(&offset); *(uint32_t *)arg = offset; return ret; @@ -728,7 +728,7 @@ static int cxd56_gnss_set_time(FAR struct file *filep, unsigned long arg) date_time = (FAR struct cxd56_gnss_datetime_s *)arg; up_pm_acquire_freqlock(&g_lv_lock); - ret = GD_SetTime(&date_time->date, &date_time->time); + ret = fw_gd_settime(&date_time->date, &date_time->time); up_pm_release_freqlock(&g_lv_lock); return ret; @@ -762,7 +762,7 @@ static int cxd56_gnss_get_almanac(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_GetAlmanac(param->type, param->data, &almanac_size); + return fw_gd_getalmanac(param->type, param->data, &almanac_size); } /**************************************************************************** @@ -792,7 +792,7 @@ static int cxd56_gnss_set_almanac(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_SetAlmanac(param->type, param->data); + return fw_gd_setalmanac(param->type, param->data); } /**************************************************************************** @@ -823,7 +823,7 @@ static int cxd56_gnss_get_ephemeris(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_GetEphemeris(param->type, param->data, &ephemeris_size); + return fw_gd_getephemeris(param->type, param->data, &ephemeris_size); } /**************************************************************************** @@ -853,7 +853,7 @@ static int cxd56_gnss_set_ephemeris(FAR struct file *filep, unsigned long arg) param = (FAR struct cxd56_gnss_orbital_param_s *)arg; - return GD_SetEphemeris(param->type, param->data); + return fw_gd_setephemeris(param->type, param->data); } /**************************************************************************** @@ -895,7 +895,7 @@ static int cxd56_gnss_save_backup_data(FAR struct file *filep, do { - n = GD_ReadBuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, + n = fw_gd_readbuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, CONFIG_CXD56_GNSS_BACKUP_BUFFER_SIZE); if (n <= 0) { @@ -996,7 +996,7 @@ static int cxd56_gnss_close_cep_data(FAR struct file *filep, static int cxd56_gnss_check_cep_data(FAR struct file *filep, unsigned long arg) { - return GD_CepCheckAssistData(); + return fw_gd_cepcheckassistdata(); } /**************************************************************************** @@ -1026,7 +1026,7 @@ static int cxd56_gnss_get_cep_age(FAR struct file *filep, unsigned long arg) age = (FAR struct cxd56_gnss_cep_age_s *)arg; - return GD_CepGetAgeData(&age->age, &age->cepi); + return fw_gd_cepgetagedata(&age->age, &age->cepi); } /**************************************************************************** @@ -1080,7 +1080,7 @@ static int cxd56_gnss_set_acquist_data(FAR struct file *filep, acquist = (FAR struct cxd56_gnss_agps_acquist_s *)arg; - return GD_SetAcquist(acquist->data, acquist->size); + return fw_gd_setacquist(acquist->data, acquist->size); } /**************************************************************************** @@ -1110,7 +1110,7 @@ static int cxd56_gnss_set_frametime(FAR struct file *filep, unsigned long arg) frametime = (FAR struct cxd56_gnss_agps_frametime_s *)arg; - return GD_SetFrameTime(frametime->sec, frametime->frac); + return fw_gd_setframetime(frametime->sec, frametime->frac); } /**************************************************************************** @@ -1140,7 +1140,7 @@ static int cxd56_gnss_set_tau_gps(FAR struct file *filep, unsigned long arg) taugpstime = (FAR struct cxd56_gnss_agps_tau_gps_s *)arg; - return GD_SetTauGps(&taugpstime->taugps); + return fw_gd_settaugps(&taugpstime->taugps); } /**************************************************************************** @@ -1170,7 +1170,7 @@ static int cxd56_gnss_set_time_gps(FAR struct file *filep, unsigned long arg) time_gps = (FAR struct cxd56_gnss_agps_time_gps_s *)arg; - return GD_SetTimeGps(&time_gps->date, &time_gps->time); + return fw_gd_settimeGps(&time_gps->date, &time_gps->time); } /**************************************************************************** @@ -1194,7 +1194,7 @@ static int cxd56_gnss_clear_receiver_info(FAR struct file *filep, { uint32_t clear_type = arg; - return GD_ClearReceiverInfo(clear_type); + return fw_gd_clearreceiverinfo(clear_type); } /**************************************************************************** @@ -1225,7 +1225,7 @@ static int cxd56_gnss_set_tow_assist(FAR struct file *filep, assist = (FAR struct cxd56_gnss_agps_tow_assist_s *)arg; - return GD_SetTowAssist(assist->data, assist->size); + return fw_gd_settowassist(assist->data, assist->size); } /**************************************************************************** @@ -1255,7 +1255,7 @@ static int cxd56_gnss_set_utc_model(FAR struct file *filep, unsigned long arg) model = (FAR struct cxd56_gnss_agps_utc_model_s *)arg; - return GD_SetUtcModel(model->data, model->size); + return fw_gd_setutcmodel(model->data, model->size); } /**************************************************************************** @@ -1286,7 +1286,7 @@ static int cxd56_gnss_control_spectrum(FAR struct file *filep, control = (FAR struct cxd56_gnss_spectrum_control_s *)arg; - return GD_SpectrumControl(control->time, control->enable, control->point1, + return fw_gd_spectrumcontrol(control->time, control->enable, control->point1, control->step1, control->point2, control->step2); } @@ -1338,12 +1338,12 @@ static int cxd56_gnss_start_test(FAR struct file *filep, unsigned long arg) /* set parameter */ info = (FAR struct cxd56_gnss_test_info_s *)arg; - GD_StartGpsTest(info->satellite, info->reserve1, + fw_gd_startGpsTest(info->satellite, info->reserve1, info->reserve2, info->reserve3); /* start test */ - ret = GD_Start(CXD56_GNSS_STMOD_COLD); + ret = fw_gd_start(CXD56_GNSS_STMOD_COLD); } return ret; @@ -1371,12 +1371,12 @@ static int cxd56_gnss_stop_test(FAR struct file *filep, unsigned long arg) /* term test */ - ret = GD_StopGpsTest(); + ret = fw_gd_stopGpsTest(); if(ret == OK) { /* stop test */ - ret = GD_Stop(); + ret = fw_gd_stop(); } /* Power off the LNA device */ @@ -1414,7 +1414,7 @@ static int cxd56_gnss_get_test_result(FAR struct file *filep, result = (FAR struct cxd56_gnss_test_result_s *)arg; - return GD_GetGpsTestResult(&result->cn, &result->doppler); + return fw_gd_getgpstestresult(&result->cn, &result->doppler); } /**************************************************************************** @@ -1498,7 +1498,7 @@ static int cxd56_gnss_set_signal(FAR struct file *filep, unsigned long arg) goto _err; } - GD_SetNotifyMask(setting->gnsssig, FALSE); + fw_gd_setnotifymask(setting->gnsssig, FALSE); sig->enable = 1; sig->pid = pid; @@ -1542,7 +1542,7 @@ static int cxd56_gnss_start_pvtlog(FAR struct file *filep, unsigned long arg) setting = (FAR struct cxd56_pvtlog_setting_s *)arg; - return GD_RegisterPvtlog(setting->cycle, setting->threshold); + return fw_gd_registerpvtlog(setting->cycle, setting->threshold); } /**************************************************************************** @@ -1563,7 +1563,7 @@ static int cxd56_gnss_start_pvtlog(FAR struct file *filep, unsigned long arg) static int cxd56_gnss_stop_pvtlog(FAR struct file *filep, unsigned long arg) { - return GD_ReleasePvtlog(); + return fw_gd_releasepvtlog(); } /**************************************************************************** @@ -1584,7 +1584,7 @@ static int cxd56_gnss_stop_pvtlog(FAR struct file *filep, unsigned long arg) static int cxd56_gnss_delete_pvtlog(FAR struct file *filep, unsigned long arg) { - return GD_PvtlogDeleteLog(); + return fw_gd_pvtlogdeletelog(); } /**************************************************************************** @@ -1615,7 +1615,7 @@ static int cxd56_gnss_get_pvtlog_status(FAR struct file *filep, status = (FAR struct cxd56_pvtlog_status_s *)arg; - return GD_PvtlogGetLogStatus(&status->status); + return fw_gd_pvtloggetlogstatus(&status->status); } /**************************************************************************** @@ -1647,7 +1647,7 @@ static int cxd56_gnss_start_rtk_output(FAR struct file *filep, setting = (FAR struct cxd56_rtk_setting_s *)arg; setting->sbasout = 0; - return GD_RtkStart(setting); + return fw_gd_rtkstart(setting); } /**************************************************************************** @@ -1669,7 +1669,7 @@ static int cxd56_gnss_start_rtk_output(FAR struct file *filep, static int cxd56_gnss_stop_rtk_output(FAR struct file *filep, unsigned long arg) { - return GD_RtkStop(); + return fw_gd_rtkstop(); } /**************************************************************************** @@ -1693,7 +1693,7 @@ static int cxd56_gnss_set_rtk_interval(FAR struct file *filep, { int interval = (int)arg; - return GD_RtkSetOutputInterval(interval); + return fw_gd_rtksetoutputinterval(interval); } /**************************************************************************** @@ -1723,7 +1723,7 @@ static int cxd56_gnss_get_rtk_interval(FAR struct file *filep, return -EINVAL; } - ret = GD_RtkGetOutputInterval(&interval); + ret = fw_gd_rtkgetoutputinterval(&interval); *(uint32_t *)arg = interval; return ret; @@ -1750,7 +1750,7 @@ static int cxd56_gnss_select_rtk_satellite(FAR struct file *filep, { uint32_t gnss = (uint32_t)arg; - return GD_RtkSetGnss(gnss); + return fw_gd_rtksetgnss(gnss); } /**************************************************************************** @@ -1780,7 +1780,7 @@ static int cxd56_gnss_get_rtk_satellite(FAR struct file *filep, return -EINVAL; } - ret = GD_RtkGetGnss(&gnss); + ret = fw_gd_rtkgetgnss(&gnss); *(uint32_t *)arg = gnss; return ret; @@ -1807,7 +1807,7 @@ static int cxd56_gnss_set_rtk_ephemeris_enable(FAR struct file *filep, { int enable = (int)arg; - return GD_RtkSetEphNotify(enable); + return fw_gd_rtksetephnotify(enable); } /**************************************************************************** @@ -1837,7 +1837,7 @@ static int cxd56_gnss_get_rtk_ephemeris_enable(FAR struct file *filep, return -EINVAL; } - ret = GD_RtkGetEphNotify(&enable); + ret = fw_gd_rtkgetephnotify(&enable); *(uint32_t *)arg = enable; return ret; @@ -1871,7 +1871,7 @@ static int cxd56_gnss_start_navmsg_output(FAR struct file *filep, setting = (FAR struct cxd56_rtk_setting_s *)arg; - return GD_RtkStart(setting); + return fw_gd_rtkstart(setting); } /**************************************************************************** @@ -1901,7 +1901,7 @@ static int cxd56_gnss_set_var_ephemeris(FAR struct file *filep, } param = (FAR struct cxd56_gnss_set_var_ephemeris_s *)arg; - return GD_SetVarEphemeris(param->data, param->size); + return fw_gd_setvarephemeris(param->data, param->size); } /**************************************************************************** @@ -1932,7 +1932,7 @@ static int cxd56_gnss_get_var_ephemeris(FAR struct file *filep, param = (FAR struct cxd56_gnss_get_var_ephemeris_s *)arg; - return GD_GetVarEphemeris(param->type, param->data, param->size); + return fw_gd_getvarephemeris(param->type, param->data, param->size); } /**************************************************************************** @@ -1953,7 +1953,7 @@ static int cxd56_gnss_get_var_ephemeris(FAR struct file *filep, static int cxd56_gnss_set_usecase(FAR struct file *filep, unsigned long arg) { - return GD_SetUseCase(arg); + return fw_gd_setusecase(arg); } /**************************************************************************** @@ -1982,7 +1982,7 @@ static int cxd56_gnss_get_usecase(FAR struct file *filep, return -EINVAL; } - ret = GD_GetUseCase(&usecase); + ret = fw_gd_getusecase(&usecase); *(uint32_t *)arg = usecase; return ret; @@ -2027,7 +2027,7 @@ static int cxd56_gnss_set_1pps_output(FAR struct file *filep, #endif } - return GD_Set1ppsOutput(arg); + return fw_gd_set1ppsoutput(arg); } /**************************************************************************** @@ -2056,7 +2056,7 @@ static int cxd56_gnss_get_1pps_output(FAR struct file *filep, return -EINVAL; } - ret = GD_Get1ppsOutput(&enable); + ret = fw_gd_get1ppsoutput(&enable); *(uint32_t *)arg = enable; return ret; @@ -2209,7 +2209,7 @@ static void cxd56_gnss_read_backup_file(FAR int *retval) ret = n < 0 ? n : ferror(fp) ? -ENFILE : 0; break; } - ret = GD_WriteBuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, n); + ret = fw_gd_writebuffer(CXD56_CPU1_DATA_TYPE_BACKUP, offset, buf, n); if (ret < 0) { break; @@ -2279,7 +2279,7 @@ static void cxd56_gnss_common_signalhandler(uint32_t data, FAR void *userdata) if (issetmask) { - GD_SetNotifyMask(sigtype, FALSE); + fw_gd_setnotifymask(sigtype, FALSE); } nxsem_post(&priv->devsem); @@ -2611,19 +2611,19 @@ static int cxd56_gnss_open(FAR struct file *filep) nxsem_setprotocol(&priv->syncsem, SEM_PRIO_NONE); - ret = PM_LoadImage(CXD56_GNSS_GPS_CPUID, CXD56_GNSS_FWNAME); + ret = fw_pm_loadimage(CXD56_GNSS_GPS_CPUID, CXD56_GNSS_FWNAME); if (ret < 0) { goto _err1; } - ret = PM_StartCpu(CXD56_GNSS_GPS_CPUID, 1); + ret = fw_pm_startcpu(CXD56_GNSS_GPS_CPUID, 1); if (ret < 0) { goto _err2; } #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_DISABLE); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_DISABLE); #endif /* Wait the request from GNSS core to restore backup data, @@ -2637,7 +2637,7 @@ static int cxd56_gnss_open(FAR struct file *filep) goto _err2; } - ret = GD_WriteBuffer(CXD56_CPU1_DATA_TYPE_INFO, 0, &priv->shared_info, + ret = fw_gd_writebuffer(CXD56_CPU1_DATA_TYPE_INFO, 0, &priv->shared_info, sizeof(priv->shared_info)); if (ret < 0) { @@ -2652,9 +2652,9 @@ static int cxd56_gnss_open(FAR struct file *filep) _err2: #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); #endif - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); _err1: nxsem_destroy(&priv->syncsem); _err0: @@ -2696,10 +2696,10 @@ static int cxd56_gnss_close(FAR struct file *filep) if (priv->num_open == 0) { #ifndef CONFIG_CXD56_GNSS_HOT_SLEEP - PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); + fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE); #endif - ret = PM_SleepCpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); + ret = fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD); if (ret < 0) { goto errout; @@ -2770,9 +2770,9 @@ static ssize_t cxd56_gnss_read(FAR struct file *filep, FAR char *buffer, } } - /* GD_ReadBuffer returns copied data size or negative error code */ + /* fw_gd_readbuffer returns copied data size or negative error code */ - ret = GD_ReadBuffer(type, offset, buffer, len); + ret = fw_gd_readbuffer(type, offset, buffer, len); _err: _success: @@ -2898,7 +2898,7 @@ static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds, priv->fds[i] = fds; fds->priv = &priv->fds[i]; - GD_SetNotifyMask(CXD56_CPU1_DEV_GNSS, FALSE); + fw_gd_setnotifymask(CXD56_CPU1_DEV_GNSS, FALSE); break; } } diff --git a/arch/arm/src/cxd56xx/cxd56_gnss_api.h b/arch/arm/src/cxd56xx/cxd56_gnss_api.h index 8415ab04b47db..08ab758dc886a 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss_api.h +++ b/arch/arm/src/cxd56xx/cxd56_gnss_api.h @@ -53,7 +53,7 @@ /* GD operation mode */ -/* GD_SetOperationMode, GD_GetOperationMode */ +/* fw_gd_setoperationmode, fw_gd_getoperationmode */ #define CXD56_GNSS_OPMOD_NORMAL 1 #define CXD56_GNSS_OPMOD_LOWPOWER 2 @@ -64,89 +64,89 @@ * beginning to search the satellites and measure the receiver position */ -int GD_Start(uint8_t startMode); +int fw_gd_start(uint8_t startMode); /* Stop a positioning */ -int GD_Stop(void); +int fw_gd_stop(void); /* Select GNSSs to positioning * These are able to specified by CXD56_GNSS_B_SAT_XXX defines. */ -int GD_SelectSatelliteSystem(uint32_t system); +int fw_gd_selectsatellitesystem(uint32_t system); /* Get current using GNSSs to positioning * A argument 'satellite' indicates current GNSSs by bit fields defined * by CXD56_GNSS_B_SAT_XXX. */ -int GD_GetSatelliteSystem(FAR uint32_t *system); +int fw_gd_getsatellitesystem(FAR uint32_t *system); /* Set the rough receiver position */ -int GD_SetReceiverPositionEllipsoidal(FAR double *dLat, FAR double *dLon, +int fw_gd_setreceiverpositionellipsoidal(FAR double *dLat, FAR double *dLon, FAR double *dHeight); /* Set the rough receiver position as orgothonal */ -int GD_SetReceiverPositionOrthogonal(int32_t dX, int32_t dY, int32_t dZ); +int fw_gd_setreceiverpositionorthogonal(int32_t dX, int32_t dY, int32_t dZ); /* Set enable or disable the 1PPS output. */ -int GD_Set1ppsOutput(uint32_t enable); +int fw_gd_set1ppsoutput(uint32_t enable); /* Get the current 1PPS output setting. */ -int GD_Get1ppsOutput(FAR uint32_t *enable); +int fw_gd_get1ppsoutput(FAR uint32_t *enable); /* Set the receiver operation mode * 1st argument 'mode' is a operation mode defined by CXD56_GNSS_OPMOD_XXX. * 2nd argument 'cycle' is a positioning period[ms], default is 1000[ms]. */ -int GD_SetOperationMode(uint32_t mode, uint32_t cycle); +int fw_gd_setoperationmode(uint32_t mode, uint32_t cycle); /* Get the receiver operation mode */ -int GD_GetOperationMode(FAR uint32_t *mode, FAR uint32_t *cycle); +int fw_gd_getoperationmode(FAR uint32_t *mode, FAR uint32_t *cycle); /* Set the TCXO offset */ -int GD_SetTcxoOffset(int32_t offset); +int fw_gd_settcxooffset(int32_t offset); /* Get the TCXO offset */ -int GD_GetTcxoOffset(FAR int32_t *offset); +int fw_gd_gettcxooffset(FAR int32_t *offset); /* Set the estimated current time of the receiver. * 1st argument date & time are in UTC. */ -int GD_SetTime(FAR struct cxd56_gnss_date_s *date, +int fw_gd_settime(FAR struct cxd56_gnss_date_s *date, FAR struct cxd56_gnss_time_s *time); /* Set the network time */ -int GD_SetFrameTime(uint16_t sec, uint32_t fracSec); +int fw_gd_setframetime(uint16_t sec, uint32_t fracSec); /* Get the almanac data */ -int GD_GetAlmanac(uint32_t satellite, FAR uint32_t* almanac, +int fw_gd_getalmanac(uint32_t satellite, FAR uint32_t* almanac, FAR uint32_t *almanacSize); /* Set the almanac data */ -int GD_SetAlmanac(uint32_t satellite, FAR uint32_t *almanac); +int fw_gd_setalmanac(uint32_t satellite, FAR uint32_t *almanac); /* Get the Ephemeris data */ -int GD_GetEphemeris(uint32_t satellite, FAR uint32_t* ephemeris, +int fw_gd_getephemeris(uint32_t satellite, FAR uint32_t* ephemeris, FAR uint32_t *ephemerisSize); /* Set the Ephemeris data */ -int GD_SetEphemeris(uint32_t satellite, FAR uint32_t *ephemeris); +int fw_gd_setephemeris(uint32_t satellite, FAR uint32_t *ephemeris); /* Select to use or not use the initial position calculation supporting * information of the QZSS L1-SAIF. @@ -178,195 +178,195 @@ int GD_SetImesPreamble(uint32_t preamble); /* Start GPS test */ -void GD_StartGpsTest(uint32_t satellite, uint32_t reserve1, +void fw_gd_startGpsTest(uint32_t satellite, uint32_t reserve1, uint32_t reserve2, uint32_t reserve3); /* Stop GPS test */ -int GD_StopGpsTest(void); +int fw_gd_stopGpsTest(void); /* Get GPS test result */ -int GD_GetGpsTestResult(FAR float* cn, FAR float* doppler); +int fw_gd_getgpstestresult(FAR float* cn, FAR float* doppler); /* Control Spectrum output */ -int GD_SpectrumControl(unsigned long time, unsigned int enable, +int fw_gd_spectrumcontrol(unsigned long time, unsigned int enable, unsigned char moniPoint1, unsigned char step1, unsigned char moniPoint2, unsigned char step2); /* Save the backup data to a Flash memory. */ -int GD_SaveBackupdata(void); +int fw_gd_savebackupdata(void); /* CEP Check Assist Data Valid */ -int GD_CepCheckAssistData(void); +int fw_gd_cepcheckassistdata(void); /* CEP Get Age Data */ -int GD_CepGetAgeData(FAR float *age, FAR float *cepi); +int fw_gd_cepgetagedata(FAR float *age, FAR float *cepi); /* CEP Reset Assist Data init flag & valid flag */ -int GD_CepInitAssistData(void); +int fw_gd_cepinitassistdata(void); /* AGPS Set tau */ -int GD_SetTauGps(FAR double *tau); +int fw_gd_settaugps(FAR double *tau); /* AGPS Set Acquist */ -int GD_SetAcquist(FAR uint8_t *pAcquistData, uint16_t acquistSize); +int fw_gd_setacquist(FAR uint8_t *pAcquistData, uint16_t acquistSize); /* Set the estimated current time of the receiver. * 1st argument date & time are in GPS time. */ -int GD_SetTimeGps(FAR struct cxd56_gnss_date_s *date, +int fw_gd_settimeGps(FAR struct cxd56_gnss_date_s *date, FAR struct cxd56_gnss_time_s *time); /* Clear Receiver Information */ -int GD_ClearReceiverInfo(uint32_t type); +int fw_gd_clearreceiverinfo(uint32_t type); /* AGPS Set Tow Assist */ -int GD_SetTowAssist(FAR uint8_t *pAssistData, uint16_t dataSize); +int fw_gd_settowassist(FAR uint8_t *pAssistData, uint16_t dataSize); /* AGPS Set UTC Model */ -int GD_SetUtcModel(FAR uint8_t *pModelData, uint16_t dataSize); +int fw_gd_setutcmodel(FAR uint8_t *pModelData, uint16_t dataSize); /* Read GNSS data to specified buffer */ -int GD_ReadBuffer(uint8_t type, int32_t offset, FAR void *buf, +int fw_gd_readbuffer(uint8_t type, int32_t offset, FAR void *buf, uint32_t length); /* Write GNSS data from specified buffer */ -int GD_WriteBuffer(uint8_t type, int32_t offset, FAR void *buf, +int fw_gd_writebuffer(uint8_t type, int32_t offset, FAR void *buf, uint32_t length); /* Set notify mask, this mask flag is cleared when notified(poll/signal) */ -int GD_SetNotifyMask(uint8_t type, uint8_t clear); +int fw_gd_setnotifymask(uint8_t type, uint8_t clear); /* Geofence Add Region */ -int GD_GeoAddRegion(uint8_t id, long lat, long lon, uint16_t rad); +int fw_gd_geoaddregion(uint8_t id, long lat, long lon, uint16_t rad); /* Geofence Modify Region */ -int GD_GeoModifyRegion(uint8_t id, long lat, long lon, uint16_t rad); +int fw_gd_geomodifyregion(uint8_t id, long lat, long lon, uint16_t rad); /* Geofence Delete Region */ -int GD_GeoDeleteRegione(uint8_t id); +int fw_gd_geodeleteregione(uint8_t id); /* Geofence All delete Region */ -int GD_GeoDeleteAllRegion(void); +int fw_gd_geodeleteallregion(void); /* Geofence Region check */ -int GD_GeoGetRegionData(uint8_t id, FAR long *lat, FAR long *lon, +int fw_gd_geogetregiondata(uint8_t id, FAR long *lat, FAR long *lon, FAR uint16_t *rad); /* Geofence Get Used Region ID */ -uint32_t GD_GeoGetUsedRegionId(void); +uint32_t fw_gd_geogetusedregionid(void); /* Geofence Set mode */ -int GD_GeoSetOpMode(uint16_t deadzone, uint16_t dwell_detecttime); +int fw_gd_geosetopmode(uint16_t deadzone, uint16_t dwell_detecttime); /* Geofence Request All region notify */ -int GD_GeoSetAllRgionNotifyRequest(void); +int fw_gd_geosetallrgionnotifyrequest(void); /* Geofence Register to gnss_provider */ -int GD_RegisterGeofence(void); +int fw_gd_registergeofence(void); /* Geofence Release from gnss_provider */ -int GD_ReleaseGeofence(void); +int fw_gd_releasegeofence(void); /* Pvtlog Register to gnss_provider */ -int GD_RegisterPvtlog(uint32_t cycle, uint32_t threshold); +int fw_gd_registerpvtlog(uint32_t cycle, uint32_t threshold); /* Pvtlog Release */ -int GD_ReleasePvtlog(void); +int fw_gd_releasepvtlog(void); /* Pvtlog Delete log data */ -int GD_PvtlogDeleteLog(void); +int fw_gd_pvtlogdeletelog(void); /* Pvtlog Get Log status */ -int GD_PvtlogGetLogStatus(FAR struct cxd56_gnss_status_s *pLogStatus); +int fw_gd_pvtloggetlogstatus(FAR struct cxd56_gnss_status_s *pLogStatus); /* Start outputting carrier phase info. */ -int GD_RtkStart(FAR struct cxd56_rtk_setting_s *pParam); +int fw_gd_rtkstart(FAR struct cxd56_rtk_setting_s *pParam); /* Stop outputting carrier phase info. */ -int GD_RtkStop(void); +int fw_gd_rtkstop(void); /* Set output interval of carrier phase info. * * interval : CXD56_GNSS_RTK_INTERVAL_XXX (gd_type.h) */ -int GD_RtkSetOutputInterval(int interval); +int fw_gd_rtksetoutputinterval(int interval); /* Get output interval of carrier phase info. [ms] */ -int GD_RtkGetOutputInterval(FAR int* interval); +int fw_gd_rtkgetoutputinterval(FAR int* interval); /* Set GNSS of outputting carrier phase info. */ -int GD_RtkSetGnss(uint32_t gnss); +int fw_gd_rtksetgnss(uint32_t gnss); /* Get GNSS of outputting carrier phase info. */ -int GD_RtkGetGnss(FAR uint32_t* pGnss); +int fw_gd_rtkgetgnss(FAR uint32_t* pGnss); /* Set enable/disable GD to notify updating ephemeris */ -int GD_RtkSetEphNotify(int enable); +int fw_gd_rtksetephnotify(int enable); /* Get enable/disable GD to notify updating ephemeris */ -int GD_RtkGetEphNotify(FAR int* enable); +int fw_gd_rtkgetephnotify(FAR int* enable); /* Set the Ephemeris data Ephemeris data size is variable. */ -int GD_SetVarEphemeris(uint32_t *ephemeris, uint32_t ephemerisSize); +int fw_gd_setvarephemeris(uint32_t *ephemeris, uint32_t ephemerisSize); /* Get the Ephemeris data Ephemeris data size is variable. */ -int GD_GetVarEphemeris(uint32_t satellite, uint32_t* ephemeris, +int fw_gd_getvarephemeris(uint32_t satellite, uint32_t* ephemeris, uint32_t ephemerisSize); /* Set usecase mode */ -int GD_SetUseCase(uint32_t usecase); +int fw_gd_setusecase(uint32_t usecase); /* Get usecase mode */ -int GD_GetUseCase(uint32_t *usecase); +int fw_gd_getusecase(uint32_t *usecase); /* Set enable or disable of 1PPS output */ -int GD_Set1ppsOutput(uint32_t enable); +int fw_gd_set1ppsoutput(uint32_t enable); /* Get the current 1PPS output setting */ -int GD_Get1ppsOutput(uint32_t *enable); +int fw_gd_get1ppsoutput(uint32_t *enable); #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_API_H */ diff --git a/arch/arm/src/cxd56xx/cxd56_pmic.c b/arch/arm/src/cxd56xx/cxd56_pmic.c index 1ae6223a73ad1..44955ddeda890 100644 --- a/arch/arm/src/cxd56xx/cxd56_pmic.c +++ b/arch/arm/src/cxd56xx/cxd56_pmic.c @@ -163,7 +163,7 @@ struct pmic_temp_mode_s int high; }; -extern int pm_pmic_control(int cmd, void *arg); +extern int fw_pm_pmiccontrol(int cmd, void *arg); /**************************************************************************** * Private Data @@ -299,7 +299,7 @@ static int pmic_int_handler(int irq, void *context, void *arg) int cxd56_pmic_get_interrupt_status(uint8_t *status) { - return pm_pmic_control(PMIC_CMD_INTSTATUS, status); + return fw_pm_pmiccontrol(PMIC_CMD_INTSTATUS, status); } /**************************************************************************** @@ -347,7 +347,7 @@ int cxd56_pmic_set_gpo_reg(uint8_t *setbit0, uint8_t *clrbit0, .clrbit1 = clrbit1, }; - return pm_pmic_control(PMIC_CMD_GPO, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_GPO, &arg); } /**************************************************************************** @@ -567,7 +567,7 @@ int cxd56_pmic_set_loadswitch_reg(uint8_t *setbit, uint8_t *clrbit) .clrbit = clrbit, }; - return pm_pmic_control(PMIC_CMD_LOADSW, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_LOADSW, &arg); } /**************************************************************************** @@ -664,7 +664,7 @@ int cxd56_pmic_set_ddc_ldo_reg(uint8_t *setbit, uint8_t *clrbit) .clrbit = clrbit, }; - return pm_pmic_control(PMIC_CMD_DDCLDO, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_DDCLDO, &arg); } /**************************************************************************** @@ -783,7 +783,7 @@ int cxd56_pmic_get_rtc(uint64_t *count) int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge) { - return pm_pmic_control(PMIC_CMD_AFE, gauge); + return fw_pm_pmiccontrol(PMIC_CMD_AFE, gauge); } /**************************************************************************** @@ -802,7 +802,7 @@ int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge) int cxd56_pmic_getlowervol(FAR int *voltage) { - return pm_pmic_control(PMIC_CMD_GETVSYS, voltage); + return fw_pm_pmiccontrol(PMIC_CMD_GETVSYS, voltage); } /**************************************************************************** @@ -821,7 +821,7 @@ int cxd56_pmic_getlowervol(FAR int *voltage) int cxd56_pmic_setlowervol(int voltage) { - return pm_pmic_control(PMIC_CMD_SETVSYS, (void *)voltage); + return fw_pm_pmiccontrol(PMIC_CMD_SETVSYS, (void *)voltage); } /**************************************************************************** @@ -840,7 +840,7 @@ int cxd56_pmic_setlowervol(int voltage) int cxd56_pmic_getnotifyvol(FAR int *voltage) { - return pm_pmic_control(PMIC_CMD_GETPREVSYS, voltage); + return fw_pm_pmiccontrol(PMIC_CMD_GETPREVSYS, voltage); } /**************************************************************************** @@ -859,7 +859,7 @@ int cxd56_pmic_getnotifyvol(FAR int *voltage) int cxd56_pmic_setnotifyvol(int voltage) { - return pm_pmic_control(PMIC_CMD_SETPREVSYS, (void *)voltage); + return fw_pm_pmiccontrol(PMIC_CMD_SETPREVSYS, (void *)voltage); } /**************************************************************************** @@ -881,7 +881,7 @@ int cxd56_pmic_getchargevol(FAR int *voltage) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_VOLTAGE, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_VOLTAGE, &val); if (ret) { return -EIO; @@ -937,7 +937,7 @@ int cxd56_pmic_setchargevol(int voltage) val = (voltage - 4000) / 50; - return pm_pmic_control(PMIC_CMD_SET_CHG_VOLTAGE, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_VOLTAGE, (void *)val); } /**************************************************************************** @@ -960,7 +960,7 @@ int cxd56_pmic_getchargecurrent(FAR int *current) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_CURRENT, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_CURRENT, &val); if (ret) { return ret; @@ -1028,7 +1028,7 @@ int cxd56_pmic_setchargecurrent(int current) return -EFAULT; } - return pm_pmic_control(PMIC_CMD_SET_CHG_CURRENT, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_CURRENT, (void *)val); } /**************************************************************************** @@ -1047,7 +1047,7 @@ int cxd56_pmic_setchargecurrent(int current) int cxd56_pmic_getporttype(FAR int *porttype) { - return pm_pmic_control(PMIC_CMD_GET_USB_PORT_TYPE, porttype); + return fw_pm_pmiccontrol(PMIC_CMD_GET_USB_PORT_TYPE, porttype); } /**************************************************************************** @@ -1072,7 +1072,7 @@ int cxd56_pmic_getchargestate(uint8_t *state) /* Update charge state */ - ret = pm_pmic_control(PMIC_CMD_AFE, &arg); + ret = fw_pm_pmiccontrol(PMIC_CMD_AFE, &arg); if (ret) { return ret; @@ -1080,7 +1080,7 @@ int cxd56_pmic_getchargestate(uint8_t *state) /* Get actual charging state (CNT_USB1) */ - ret = pm_pmic_control(PMIC_CMD_GET_CHG_STATE, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_STATE, &val); *state = val & 0xff; return ret; @@ -1128,7 +1128,7 @@ int cxd56_pmic_setrechargevol(int mv) return -EINVAL; } - return pm_pmic_control(PMIC_CMD_SET_RECHG_VOLTAGE, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_RECHG_VOLTAGE, (void *)val); } /**************************************************************************** @@ -1150,7 +1150,7 @@ int cxd56_pmic_getrechargevol(FAR int *mv) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_RECHG_VOLTAGE, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_RECHG_VOLTAGE, &val); if (ret) { return ret; @@ -1230,7 +1230,7 @@ int cxd56_pmic_setchargecompcurrent(int current) break; } - return pm_pmic_control(PMIC_CMD_SET_CHG_IFIN, (void *)val); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_IFIN, (void *)val); } /**************************************************************************** @@ -1252,7 +1252,7 @@ int cxd56_pmic_getchargecompcurrent(FAR int *current) int val; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_IFIN, &val); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_IFIN, &val); if (ret) { return ret; @@ -1310,7 +1310,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table) { /* SET_T60 (70h) - SET_T0_2 (78h) */ - return pm_pmic_control(PMIC_CMD_GET_CHG_TEMPERATURE_TABLE, table); + return fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_TEMPERATURE_TABLE, table); } /**************************************************************************** @@ -1330,7 +1330,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table) int cxd56_pmic_settemptable(FAR struct pmic_temp_table_s *table) { - return pm_pmic_control(PMIC_CMD_SET_CHG_TEMPERATURE_TABLE, table); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_TEMPERATURE_TABLE, table); } /**************************************************************************** @@ -1383,7 +1383,7 @@ int cxd56_pmic_setchargemode(int low, int high) return -EINVAL; } - return pm_pmic_control(PMIC_CMD_SET_CHG_TEMPERATURE_MODE, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_TEMPERATURE_MODE, &arg); } /**************************************************************************** @@ -1410,7 +1410,7 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high) struct pmic_temp_mode_s arg; int ret; - ret = pm_pmic_control(PMIC_CMD_GET_CHG_TEMPERATURE_MODE, &arg); + ret = fw_pm_pmiccontrol(PMIC_CMD_GET_CHG_TEMPERATURE_MODE, &arg); if (ret) { return ret; @@ -1429,22 +1429,22 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high) int cxd56_pmic_monitor_enable(FAR struct pmic_mon_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_ENABLE, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_ENABLE, ptr); } int cxd56_pmic_monitor_status(FAR struct pmic_mon_status_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_STATUS, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_STATUS, ptr); } int cxd56_pmic_monitor_set(FAR struct pmic_mon_set_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_SET, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_SET, ptr); } int cxd56_pmic_monitor_get(FAR struct pmic_mon_log_s *ptr) { - return pm_pmic_control(PMIC_CMD_POWER_MONITOR_GET, ptr); + return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_GET, ptr); } #endif @@ -1546,7 +1546,7 @@ int cxd56_pmic_read(uint8_t addr, void *buf, uint32_t size) .size = size, }; - return pm_pmic_control(PMIC_CMD_READ, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_READ, &arg); } /**************************************************************************** @@ -1581,7 +1581,7 @@ int cxd56_pmic_write(uint8_t addr, void *buf, uint32_t size) .size = size, }; - return pm_pmic_control(PMIC_CMD_WRITE, &arg); + return fw_pm_pmiccontrol(PMIC_CMD_WRITE, &arg); } #endif /* CONFIG_CXD56_PMIC */ diff --git a/arch/arm/src/cxd56xx/cxd56_powermgr.c b/arch/arm/src/cxd56xx/cxd56_powermgr.c index bad73a60111a1..34bde395d19ba 100644 --- a/arch/arm/src/cxd56xx/cxd56_powermgr.c +++ b/arch/arm/src/cxd56xx/cxd56_powermgr.c @@ -991,16 +991,16 @@ uint32_t up_pm_clr_bootmask(uint32_t mask) int up_pm_sleep(enum pm_sleepmode_e mode) { - int PM_DeepSleep(void *); - int PM_ColdSleep(void *); + int fw_pm_deepsleep(void *); + int fw_pm_coldsleep(void *); switch (mode) { case PM_SLEEP_DEEP: - PM_DeepSleep(NULL); + fw_pm_deepsleep(NULL); break; case PM_SLEEP_COLD: - PM_ColdSleep(NULL); + fw_pm_coldsleep(NULL); break; } __asm volatile ("dsb"); @@ -1017,8 +1017,8 @@ int up_pm_sleep(enum pm_sleepmode_e mode) int up_pm_reboot(void) { - void PM_Reboot(void); - PM_Reboot(); + void fw_pm_reboot(void); + fw_pm_reboot(); __asm volatile ("dsb"); for (; ; ); } diff --git a/arch/arm/src/cxd56xx/cxd56_sfc.c b/arch/arm/src/cxd56xx/cxd56_sfc.c index 1c53725abe21a..f1ccc9e3d2eec 100644 --- a/arch/arm/src/cxd56xx/cxd56_sfc.c +++ b/arch/arm/src/cxd56xx/cxd56_sfc.c @@ -44,10 +44,10 @@ /* Prototypes for Remote API */ -int FM_RawWrite(uint32_t offset, const void *buf, uint32_t size); -int FM_RawVerifyWrite(uint32_t offset, const void *buf, uint32_t size); -int FM_RawRead(uint32_t offset, void *buf, uint32_t size); -int FM_RawEraseSector(uint32_t sector); +int fw_fm_rawwrite(uint32_t offset, const void *buf, uint32_t size); +int fw_fm_rawverifywrite(uint32_t offset, const void *buf, uint32_t size); +int fw_fm_rawread(uint32_t offset, void *buf, uint32_t size); +int fw_fm_rawerasesector(uint32_t sector); #ifndef CONFIG_CXD56_SPIFLASHSIZE # define CONFIG_CXD56_SPIFLASHSIZE (16 * 1024 * 1024) @@ -87,7 +87,7 @@ static int cxd56_erase(FAR struct mtd_dev_s *dev, off_t startblock, for (i = 0; i < nblocks; i++) { - ret = FM_RawEraseSector(startblock + i); + ret = fw_fm_rawerasesector(startblock + i); if (ret < 0) { set_errno(-ret); @@ -104,7 +104,7 @@ static ssize_t cxd56_bread(FAR struct mtd_dev_s *dev, off_t startblock, finfo("bread: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks); - ret = FM_RawRead(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); + ret = fw_fm_rawread(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); if (ret < 0) { set_errno(-ret); @@ -122,10 +122,10 @@ static ssize_t cxd56_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, finfo("bwrite: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks); #ifdef CONFIG_CXD56_SFC_VERIFY_WRITE - ret = FM_RawVerifyWrite(startblock << PAGE_SHIFT, buffer, + ret = fw_fm_rawverifywrite(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); #else - ret = FM_RawWrite(startblock << PAGE_SHIFT, buffer, + ret = fw_fm_rawwrite(startblock << PAGE_SHIFT, buffer, nblocks << PAGE_SHIFT); #endif if (ret < 0) @@ -144,7 +144,7 @@ static ssize_t cxd56_read(FAR struct mtd_dev_s *dev, off_t offset, finfo("read: %08lx (%u bytes)\n", offset, nbytes); - ret = FM_RawRead(offset, buffer, nbytes); + ret = fw_fm_rawread(offset, buffer, nbytes); if (ret < 0) { set_errno(-ret); @@ -163,9 +163,9 @@ static ssize_t cxd56_write(FAR struct mtd_dev_s *dev, off_t offset, finfo("write: %08lx (%u bytes)\n", offset, nbytes); #ifdef CONFIG_CXD56_SFC_VERIFY_WRITE - ret = FM_RawVerifyWrite(offset, buffer, nbytes); + ret = fw_fm_rawverifywrite(offset, buffer, nbytes); #else - ret = FM_RawWrite(offset, buffer, nbytes); + ret = fw_fm_rawwrite(offset, buffer, nbytes); #endif if (ret < 0) { @@ -222,7 +222,7 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) while (sec < last) { - FM_RawEraseSector(sec); + fw_fm_rawerasesector(sec); sec++; } } diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index 6145b5101d6fb..e4b85c97bc903 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -95,14 +95,14 @@ static void uart0_semgive(sem_t *id); * FarAPI prototypes ****************************************************************************/ -int PD_UartInit(int ch); -int PD_UartUninit(int ch); -int PD_UartConfiguration(int ch, int baudrate, int databits, +int fw_pd_uartinit(int ch); +int fw_pd_uartuninit(int ch); +int fw_pd_uartconfiguration(int ch, int baudrate, int databits, int parity, int stopbit, int flowctrl); -int PD_UartEnable(int ch); -int PD_UartDisable(int ch); -int PD_UartReceive(int ch, void *buf, int size, int leave); -int PD_UartSend(int ch, void *buf, int size, int leave); +int fw_pd_uartenable(int ch); +int fw_pd_uartdisable(int ch); +int fw_pd_uartreceive(int ch, void *buf, int size, int leave); +int fw_pd_uartsend(int ch, void *buf, int size, int leave); /**************************************************************************** * Private Data @@ -159,7 +159,7 @@ static int uart0_open(FAR struct file *filep) return OK; } - ret = PD_UartInit(0); + ret = fw_pd_uartinit(0); if (ret < 0) { set_errno(EFAULT); @@ -184,21 +184,21 @@ static int uart0_open(FAR struct file *filep) CXD56_PIN_CONFIGS(PINCONFS_SPI2A_UART0); #endif - ret = PD_UartConfiguration(0, CONFIG_CXD56_UART0_BAUD, + ret = fw_pd_uartconfiguration(0, CONFIG_CXD56_UART0_BAUD, bits, CONFIG_CXD56_UART0_PARITY, stop, flowctl); if (ret < 0) { - PD_UartUninit(0); + fw_pd_uartuninit(0); set_errno(EINVAL); return ERROR; } - ret = PD_UartEnable(0); + ret = fw_pd_uartenable(0); if (ret < 0) { - PD_UartUninit(0); + fw_pd_uartuninit(0); set_errno(EFAULT); return ERROR; } @@ -216,8 +216,8 @@ static int uart0_close(FAR struct file *filep) if (inode->i_crefs == 1) { - PD_UartDisable(0); - PD_UartUninit(0); + fw_pd_uartdisable(0); + fw_pd_uartuninit(0); /* Disable UART0 pin by changing Hi-Z GPIO */ @@ -242,7 +242,7 @@ static ssize_t uart0_read(FAR struct file *filep, uart0_semtake(&g_lock); - ret = PD_UartReceive(0, buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); + ret = fw_pd_uartreceive(0, buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); uart0_semgive(&g_lock); @@ -266,7 +266,7 @@ static ssize_t uart0_write(FAR struct file *filep, uart0_semtake(&g_lock); - ret = PD_UartSend(0, (FAR void *)buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); + ret = fw_pd_uartsend(0, (FAR void *)buffer, len, ((filep->f_oflags & O_NONBLOCK) != 0)); uart0_semgive(&g_lock); From a58b422a49f282d5474aec74cee57f6005dbec31 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Thu, 2 Jul 2020 10:36:20 +0900 Subject: [PATCH 12/18] boards/arm/cxd56xx/drivers/audio: Fix nxstyle issue --- .../cxd56xx/drivers/audio/cxd56_audio_aca.c | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c index 30816ced9a8c3..3482ad163646f 100644 --- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c +++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c @@ -354,7 +354,7 @@ typedef enum * Public Function Prototypes ****************************************************************************/ -extern uint32_t as_aca_control(uint8_t type, uint32_t param); +extern uint32_t fw_as_acacontrol(uint8_t type, uint32_t param); /**************************************************************************** * Private Functions @@ -634,7 +634,7 @@ void get_pwon_out_param(as_aca_pulco_out_param_t *param) CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) { - if (as_aca_control(AS_ACA_CHECK_ID, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_CHECK_ID, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_CHKID; } @@ -642,7 +642,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) as_aca_pulco_param_t pwon_param; get_pwon_param(&pwon_param); - if (as_aca_control(AS_ACA_POWER_ON_COMMON, (uint32_t)&pwon_param) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_COMMON, (uint32_t)&pwon_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON; } @@ -650,7 +650,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) as_ser_des_param_t serial_param; get_serial_param(&serial_param); - if (as_aca_control(AS_ACA_SET_SERDES, (uint32_t)&serial_param) != 0) + if (fw_as_acacontrol(AS_ACA_SET_SERDES, (uint32_t)&serial_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SERIAL; } @@ -660,7 +660,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void) { - if (as_aca_control(AS_ACA_POWER_OFF_COMMON, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_OFF_COMMON, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF; } @@ -670,7 +670,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_micbias(void) { - if (as_aca_control(AS_ACA_POWER_ON_MICBIAS, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_MICBIAS, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_MBIAS; } @@ -684,7 +684,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_input(FAR cxd56_audio_mic_gain_t *gain get_input_param(&pwon_input_param, gain); - if (as_aca_control(AS_ACA_POWER_ON_INPUT, (uint32_t)&pwon_input_param) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_INPUT, (uint32_t)&pwon_input_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_INPUT; } @@ -698,7 +698,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_smaster(void) get_smaster_param(&smaster_param); - if (as_aca_control(AS_ACA_SET_SMASTER, (uint32_t)&smaster_param) != 0) + if (fw_as_acacontrol(AS_ACA_SET_SMASTER, (uint32_t)&smaster_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SET_SMASTER; } @@ -712,7 +712,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void) get_pwon_out_param(&pwon_output_param); - if (as_aca_control(AS_ACA_POWER_ON_OUTPUT, (uint32_t)&pwon_output_param) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_ON_OUTPUT, (uint32_t)&pwon_output_param) != 0) { return CXD56_AUDIO_ECODE_ANA_PWON_OUTPUT; } @@ -722,7 +722,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void) { - if (as_aca_control(AS_ACA_POWER_OFF_INPUT, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_OFF_INPUT, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF_INPUT; } @@ -732,7 +732,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void) CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void) { - if (as_aca_control(AS_ACA_POWER_OFF_OUTPUT, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_POWER_OFF_OUTPUT, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_PWOFF_OUTPUT; } @@ -742,7 +742,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void) { - if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_SP) != 0) + if (fw_as_acacontrol(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_SP) != 0) { return CXD56_AUDIO_ECODE_ANA_ENABLE_OUTPUT; } @@ -752,7 +752,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void) CXD56_AUDIO_ECODE cxd56_audio_aca_disable_output(void) { - if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_OFF) != 0) + if (fw_as_acacontrol(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_OFF) != 0) { return CXD56_AUDIO_ECODE_ANA_DISABLE_OUTPUT; } @@ -766,7 +766,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain) get_input_param(&mic_gain_param, gain); - if (as_aca_control(AS_ACA_INIT_AMIC, (uint32_t)&mic_gain_param) != 0) + if (fw_as_acacontrol(AS_ACA_INIT_AMIC, (uint32_t)&mic_gain_param) != 0) { return CXD56_AUDIO_ECODE_ANA_SET_MICGAIN; } @@ -776,7 +776,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain) CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void) { - if (as_aca_control(AS_ACA_SET_AMIC_BOOT_DONE, (uint32_t)NULL) != 0) + if (fw_as_acacontrol(AS_ACA_SET_AMIC_BOOT_DONE, (uint32_t)NULL) != 0) { return CXD56_AUDIO_ECODE_ANA_NOTIFY_MICBOOT; } @@ -786,12 +786,12 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void) CXD56_AUDIO_ECODE cxd56_audio_aca_read_reg(as_aca_pulco_reg_param_t *param) { - as_aca_control(AS_ACA_GET_REGISTER, (uint32_t)param); + fw_as_acacontrol(AS_ACA_GET_REGISTER, (uint32_t)param); return CXD56_AUDIO_ECODE_OK; } CXD56_AUDIO_ECODE cxd56_audio_aca_write_reg(as_aca_pulco_reg_param_t *param) { - as_aca_control(AS_ACA_SET_REGISTER, (uint32_t)param); + fw_as_acacontrol(AS_ACA_SET_REGISTER, (uint32_t)param); return CXD56_AUDIO_ECODE_OK; } From 2c2819a87df47feacc04d5f20f45d6c4d5eade16 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Mon, 3 Aug 2020 18:11:37 +0900 Subject: [PATCH 13/18] boards: spresense: Fix PMIC setting during boot-up When RTC clock is still unstable, the continuous PMIC settings may not be reflected. This commit adds a delay time to avoid such problem. --- boards/arm/cxd56xx/spresense/src/cxd56_power.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index e9a64b17b2523..f12d5b3221dd0 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -220,6 +220,13 @@ int board_power_control(int target, bool en) if (pfunc) { ret = pfunc(PMIC_GET_CH(target), en); + + /* If RTC clock is unstable, delay 1 tick for PMIC setting. */ + + if (!g_rtc_enabled) + { + usleep(1); + } } return ret; @@ -251,6 +258,13 @@ int board_power_control_tristate(int target, int value) /* set HiZ to PMIC GPO channel */ ret = cxd56_pmic_set_gpo_hiz(PMIC_GET_CH(target)); + + /* If RTC clock is unstable, delay 1 tick for PMIC setting. */ + + if (!g_rtc_enabled) + { + usleep(1); + } } else { From 5356d4658856e501414646944ef9d505311ff4f4 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Thu, 2 Jul 2020 14:02:14 +0900 Subject: [PATCH 14/18] arch/arm/src/cxd56xx/cxd56_gnss: Fix nxstyle issue --- arch/arm/src/cxd56xx/cxd56_gnss.c | 6 +-- arch/arm/src/cxd56xx/cxd56_gnss_api.h | 56 +++++++++++++-------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index 72ba918314b74..e5b3104a02147 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -1170,7 +1170,7 @@ static int cxd56_gnss_set_time_gps(FAR struct file *filep, unsigned long arg) time_gps = (FAR struct cxd56_gnss_agps_time_gps_s *)arg; - return fw_gd_settimeGps(&time_gps->date, &time_gps->time); + return fw_gd_settimegps(&time_gps->date, &time_gps->time); } /**************************************************************************** @@ -1338,7 +1338,7 @@ static int cxd56_gnss_start_test(FAR struct file *filep, unsigned long arg) /* set parameter */ info = (FAR struct cxd56_gnss_test_info_s *)arg; - fw_gd_startGpsTest(info->satellite, info->reserve1, + fw_gd_startgpstest(info->satellite, info->reserve1, info->reserve2, info->reserve3); /* start test */ @@ -1371,7 +1371,7 @@ static int cxd56_gnss_stop_test(FAR struct file *filep, unsigned long arg) /* term test */ - ret = fw_gd_stopGpsTest(); + ret = fw_gd_stopgpstest(); if(ret == OK) { /* stop test */ diff --git a/arch/arm/src/cxd56xx/cxd56_gnss_api.h b/arch/arm/src/cxd56xx/cxd56_gnss_api.h index 08ab758dc886a..da36e3a54b0cb 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss_api.h +++ b/arch/arm/src/cxd56xx/cxd56_gnss_api.h @@ -64,7 +64,7 @@ * beginning to search the satellites and measure the receiver position */ -int fw_gd_start(uint8_t startMode); +int fw_gd_start(uint8_t startmode); /* Stop a positioning */ @@ -85,12 +85,12 @@ int fw_gd_getsatellitesystem(FAR uint32_t *system); /* Set the rough receiver position */ -int fw_gd_setreceiverpositionellipsoidal(FAR double *dLat, FAR double *dLon, - FAR double *dHeight); +int fw_gd_setreceiverpositionellipsoidal(FAR double *dlat, FAR double *dlon, + FAR double *dheight); /* Set the rough receiver position as orgothonal */ -int fw_gd_setreceiverpositionorthogonal(int32_t dX, int32_t dY, int32_t dZ); +int fw_gd_setreceiverpositionorthogonal(int32_t dx, int32_t dy, int32_t dz); /* Set enable or disable the 1PPS output. */ @@ -128,12 +128,12 @@ int fw_gd_settime(FAR struct cxd56_gnss_date_s *date, /* Set the network time */ -int fw_gd_setframetime(uint16_t sec, uint32_t fracSec); +int fw_gd_setframetime(uint16_t sec, uint32_t fracsec); /* Get the almanac data */ int fw_gd_getalmanac(uint32_t satellite, FAR uint32_t* almanac, - FAR uint32_t *almanacSize); + FAR uint32_t *almanacsize); /* Set the almanac data */ @@ -142,7 +142,7 @@ int fw_gd_setalmanac(uint32_t satellite, FAR uint32_t *almanac); /* Get the Ephemeris data */ int fw_gd_getephemeris(uint32_t satellite, FAR uint32_t* ephemeris, - FAR uint32_t *ephemerisSize); + FAR uint32_t *ephemerissize); /* Set the Ephemeris data */ @@ -152,38 +152,38 @@ int fw_gd_setephemeris(uint32_t satellite, FAR uint32_t *ephemeris); * information of the QZSS L1-SAIF. */ -int GD_SetQzssPosAssist(uint32_t enable); +int fw_gd_setqzssposassist(uint32_t enable); /* Get a setting of the initial position calculation supporting * information of the QZSS L1-SAIF. */ -int GD_GetQzssPosAssist(FAR uint32_t *enable); +int fw_gd_getqzssposassist(FAR uint32_t *enable); /* Set IMES bitrates. */ -int GD_SetImesBitrate(uint32_t bitrate); +int fw_gd_setimesbitrate(uint32_t bitrate); /* Get IMES bitrates. */ -int GD_GetImesBitrate(FAR uint32_t *bitrate); +int fw_gd_getimesbitrate(FAR uint32_t *bitrate); /* Set IMES center frequency offset. */ -int GD_SetImesCenterFreqOffset(uint32_t offset); +int fw_gd_setimescenterfreqoffset(uint32_t offset); /* Set IMES preamble. */ -int GD_SetImesPreamble(uint32_t preamble); +int fw_gd_setimespreamble(uint32_t preamble); /* Start GPS test */ -void fw_gd_startGpsTest(uint32_t satellite, uint32_t reserve1, +void fw_gd_startgpstest(uint32_t satellite, uint32_t reserve1, uint32_t reserve2, uint32_t reserve3); /* Stop GPS test */ -int fw_gd_stopGpsTest(void); +int fw_gd_stopgpstest(void); /* Get GPS test result */ @@ -192,8 +192,8 @@ int fw_gd_getgpstestresult(FAR float* cn, FAR float* doppler); /* Control Spectrum output */ int fw_gd_spectrumcontrol(unsigned long time, unsigned int enable, - unsigned char moniPoint1, unsigned char step1, - unsigned char moniPoint2, unsigned char step2); + unsigned char monipoint1, unsigned char step1, + unsigned char monipoint2, unsigned char step2); /* Save the backup data to a Flash memory. */ @@ -217,13 +217,13 @@ int fw_gd_settaugps(FAR double *tau); /* AGPS Set Acquist */ -int fw_gd_setacquist(FAR uint8_t *pAcquistData, uint16_t acquistSize); +int fw_gd_setacquist(FAR uint8_t *pacquistdata, uint16_t acquistsize); /* Set the estimated current time of the receiver. * 1st argument date & time are in GPS time. */ -int fw_gd_settimeGps(FAR struct cxd56_gnss_date_s *date, +int fw_gd_settimegps(FAR struct cxd56_gnss_date_s *date, FAR struct cxd56_gnss_time_s *time); /* Clear Receiver Information */ @@ -232,11 +232,11 @@ int fw_gd_clearreceiverinfo(uint32_t type); /* AGPS Set Tow Assist */ -int fw_gd_settowassist(FAR uint8_t *pAssistData, uint16_t dataSize); +int fw_gd_settowassist(FAR uint8_t *passistdata, uint16_t datasize); /* AGPS Set UTC Model */ -int fw_gd_setutcmodel(FAR uint8_t *pModelData, uint16_t dataSize); +int fw_gd_setutcmodel(FAR uint8_t *pmodeldata, uint16_t datasize); /* Read GNSS data to specified buffer */ @@ -307,11 +307,11 @@ int fw_gd_pvtlogdeletelog(void); /* Pvtlog Get Log status */ -int fw_gd_pvtloggetlogstatus(FAR struct cxd56_gnss_status_s *pLogStatus); +int fw_gd_pvtloggetlogstatus(FAR struct cxd56_gnss_status_s *plogstatus); /* Start outputting carrier phase info. */ -int fw_gd_rtkstart(FAR struct cxd56_rtk_setting_s *pParam); +int fw_gd_rtkstart(FAR struct cxd56_rtk_setting_s *pparam); /* Stop outputting carrier phase info. */ @@ -326,7 +326,7 @@ int fw_gd_rtksetoutputinterval(int interval); /* Get output interval of carrier phase info. [ms] */ -int fw_gd_rtkgetoutputinterval(FAR int* interval); +int fw_gd_rtkgetoutputinterval(FAR int *interval); /* Set GNSS of outputting carrier phase info. */ @@ -334,7 +334,7 @@ int fw_gd_rtksetgnss(uint32_t gnss); /* Get GNSS of outputting carrier phase info. */ -int fw_gd_rtkgetgnss(FAR uint32_t* pGnss); +int fw_gd_rtkgetgnss(FAR uint32_t *pgnss); /* Set enable/disable GD to notify updating ephemeris */ @@ -342,16 +342,16 @@ int fw_gd_rtksetephnotify(int enable); /* Get enable/disable GD to notify updating ephemeris */ -int fw_gd_rtkgetephnotify(FAR int* enable); +int fw_gd_rtkgetephnotify(FAR int *enable); /* Set the Ephemeris data Ephemeris data size is variable. */ -int fw_gd_setvarephemeris(uint32_t *ephemeris, uint32_t ephemerisSize); +int fw_gd_setvarephemeris(uint32_t *ephemeris, uint32_t ephemerissize); /* Get the Ephemeris data Ephemeris data size is variable. */ int fw_gd_getvarephemeris(uint32_t satellite, uint32_t* ephemeris, - uint32_t ephemerisSize); + uint32_t ephemerissize); /* Set usecase mode */ From 4765765edee769a40dc22feb54f1399733cfb774 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Mon, 17 Aug 2020 08:47:29 +0900 Subject: [PATCH 15/18] boards: spresense: Add delay only for PMIC GPO setting When RTC clock is still unstable, add a delay time only for PMIC GPO setting to avoid a problem that the setting is not reflected. --- boards/arm/cxd56xx/spresense/src/cxd56_power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index f12d5b3221dd0..23a08ee28457d 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -221,9 +221,9 @@ int board_power_control(int target, bool en) { ret = pfunc(PMIC_GET_CH(target), en); - /* If RTC clock is unstable, delay 1 tick for PMIC setting. */ + /* If RTC clock is unstable, delay 1 tick for PMIC GPO setting. */ - if (!g_rtc_enabled) + if (!g_rtc_enabled && (PMIC_GET_TYPE(target) == PMIC_TYPE_GPO)) { usleep(1); } From 8596f874ab9a26eacd5a544d77b2a5deed689476 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 19 Aug 2020 09:42:26 +0900 Subject: [PATCH 16/18] arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20152 --- arch/arm/src/cxd56xx/cxd56_farapistub.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.h b/arch/arm/src/cxd56xx/cxd56_farapistub.h index 825545c021d39..43d4f7fc979a3 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.h +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.h @@ -36,6 +36,6 @@ #ifndef __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H #define __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H -#define FARAPISTUB_VERSION 20149 +#define FARAPISTUB_VERSION 20152 #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H */ From 264d1b1eae74e961d49b736a96a0b596298b4e8d Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 19 Aug 2020 22:21:04 +0900 Subject: [PATCH 17/18] arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20156 --- arch/arm/src/cxd56xx/cxd56_farapistub.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.h b/arch/arm/src/cxd56xx/cxd56_farapistub.h index 43d4f7fc979a3..911a458964ecd 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.h +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.h @@ -36,6 +36,6 @@ #ifndef __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H #define __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H -#define FARAPISTUB_VERSION 20152 +#define FARAPISTUB_VERSION 20156 #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H */ From 3612c7e57e9754a2c9b5cfedb9910524688d631f Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Mon, 24 Aug 2020 11:44:04 +0900 Subject: [PATCH 18/18] arch: cxd56xx: update loader and gnssfw version Update loader and gnssfw to version 2.2.20166 --- arch/arm/src/cxd56xx/cxd56_farapistub.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.h b/arch/arm/src/cxd56xx/cxd56_farapistub.h index 911a458964ecd..f411bc26cc1ea 100644 --- a/arch/arm/src/cxd56xx/cxd56_farapistub.h +++ b/arch/arm/src/cxd56xx/cxd56_farapistub.h @@ -36,6 +36,6 @@ #ifndef __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H #define __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H -#define FARAPISTUB_VERSION 20156 +#define FARAPISTUB_VERSION 20166 #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H */