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 d983821c89882..8f65c5a431341 100644 --- a/arch/arm/src/cxd56xx/cxd56_powermgr.c +++ b/arch/arm/src/cxd56xx/cxd56_powermgr.c @@ -1006,16 +1006,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"); @@ -1032,8 +1032,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 6484a82316e04..408dade8e516d 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 *