mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
41d9d44d72
Most of the PM code needed for am335x and am437x can be moved into a module under drivers but some core code must remain in mach-omap2 at the moment. This includes some internal clockdomain APIs and low-level ARM APIs which are also not exported for use by modules. Implement a few functions that handle these low-level platform operations can be passed to the pm33xx module through the use of platform data. In addition to this, to be able to share data structures between C and the sleep33xx and sleep43xx assembly code, we can automatically generate all of the C struct member offsets and sizes as macros by processing pm-asm-offsets.c into assembly code and then extracting the relevant data as is done for the generated platform asm-offsets.h files. Finally, add amx3_common_pm_init to create a dummy platform_device for pm33xx so that our soon to be introduced pm33xx module can probe on am335x and am437x platforms to enable basic suspend to mem and standby support. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Acked-by: Santosh Shilimkar <ssantosh@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
43 lines
976 B
C
43 lines
976 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* TI pm33xx platform data
|
|
*
|
|
* Copyright (C) 2016-2018 Texas Instruments, Inc.
|
|
* Dave Gerlach <d-gerlach@ti.com>
|
|
*/
|
|
|
|
#ifndef _LINUX_PLATFORM_DATA_PM33XX_H
|
|
#define _LINUX_PLATFORM_DATA_PM33XX_H
|
|
|
|
#include <linux/kbuild.h>
|
|
#include <linux/types.h>
|
|
|
|
#ifndef __ASSEMBLER__
|
|
struct am33xx_pm_sram_addr {
|
|
void (*do_wfi)(void);
|
|
unsigned long *do_wfi_sz;
|
|
unsigned long *resume_offset;
|
|
unsigned long *emif_sram_table;
|
|
unsigned long *ro_sram_data;
|
|
};
|
|
|
|
struct am33xx_pm_platform_data {
|
|
int (*init)(void);
|
|
int (*soc_suspend)(unsigned int state, int (*fn)(unsigned long));
|
|
struct am33xx_pm_sram_addr *(*get_sram_addrs)(void);
|
|
};
|
|
|
|
struct am33xx_pm_sram_data {
|
|
u32 wfi_flags;
|
|
u32 l2_aux_ctrl_val;
|
|
u32 l2_prefetch_ctrl_val;
|
|
} __packed __aligned(8);
|
|
|
|
struct am33xx_pm_ro_sram_data {
|
|
u32 amx3_pm_sram_data_virt;
|
|
u32 amx3_pm_sram_data_phys;
|
|
} __packed __aligned(8);
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
#endif /* _LINUX_PLATFORM_DATA_PM33XX_H */
|