Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * TI pm33xx platform data
0004  *
0005  * Copyright (C) 2016-2018 Texas Instruments, Inc.
0006  *  Dave Gerlach <d-gerlach@ti.com>
0007  */
0008 
0009 #ifndef _LINUX_PLATFORM_DATA_PM33XX_H
0010 #define _LINUX_PLATFORM_DATA_PM33XX_H
0011 
0012 #include <linux/kbuild.h>
0013 #include <linux/types.h>
0014 
0015 /*
0016  * WFI Flags for sleep code control
0017  *
0018  * These flags allow PM code to exclude certain operations from happening
0019  * in the low level ASM code found in sleep33xx.S and sleep43xx.S
0020  *
0021  * WFI_FLAG_FLUSH_CACHE: Flush the ARM caches and disable caching. Only
0022  *           needed when MPU will lose context.
0023  * WFI_FLAG_SELF_REFRESH: Let EMIF place DDR memory into self-refresh and
0024  *            disable EMIF.
0025  * WFI_FLAG_SAVE_EMIF: Save context of all EMIF registers and restore in
0026  *             resume path. Only needed if PER domain loses context
0027  *             and must also have WFI_FLAG_SELF_REFRESH set.
0028  * WFI_FLAG_WAKE_M3: Disable MPU clock or clockdomain to cause wkup_m3 to
0029  *           execute when WFI instruction executes.
0030  * WFI_FLAG_RTC_ONLY: Configure the RTC to enter RTC+DDR mode.
0031  */
0032 #define WFI_FLAG_FLUSH_CACHE        BIT(0)
0033 #define WFI_FLAG_SELF_REFRESH       BIT(1)
0034 #define WFI_FLAG_SAVE_EMIF      BIT(2)
0035 #define WFI_FLAG_WAKE_M3        BIT(3)
0036 #define WFI_FLAG_RTC_ONLY       BIT(4)
0037 
0038 #ifndef __ASSEMBLER__
0039 struct am33xx_pm_sram_addr {
0040     void (*do_wfi)(void);
0041     unsigned long *do_wfi_sz;
0042     unsigned long *resume_offset;
0043     unsigned long *emif_sram_table;
0044     unsigned long *ro_sram_data;
0045     unsigned long resume_address;
0046 };
0047 
0048 struct am33xx_pm_platform_data {
0049     int     (*init)(int (*idle)(u32 wfi_flags));
0050     int     (*deinit)(void);
0051     int (*soc_suspend)(unsigned int state, int (*fn)(unsigned long),
0052                    unsigned long args);
0053     int (*cpu_suspend)(int (*fn)(unsigned long), unsigned long args);
0054     void    (*begin_suspend)(void);
0055     void    (*finish_suspend)(void);
0056     struct  am33xx_pm_sram_addr *(*get_sram_addrs)(void);
0057     void (*save_context)(void);
0058     void (*restore_context)(void);
0059     int (*check_off_mode_enable)(void);
0060 };
0061 
0062 struct am33xx_pm_sram_data {
0063     u32 wfi_flags;
0064     u32 l2_aux_ctrl_val;
0065     u32 l2_prefetch_ctrl_val;
0066 } __packed __aligned(8);
0067 
0068 struct am33xx_pm_ro_sram_data {
0069     u32 amx3_pm_sram_data_virt;
0070     u32 amx3_pm_sram_data_phys;
0071     void __iomem *rtc_base_virt;
0072 } __packed __aligned(8);
0073 
0074 #endif /* __ASSEMBLER__ */
0075 #endif /* _LINUX_PLATFORM_DATA_PM33XX_H */