162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved.
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#ifndef __ASM_ARCH_MXC_COMMON_H__
862306a36Sopenharmony_ci#define __ASM_ARCH_MXC_COMMON_H__
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#include <linux/reboot.h>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cistruct irq_data;
1362306a36Sopenharmony_cistruct platform_device;
1462306a36Sopenharmony_cistruct pt_regs;
1562306a36Sopenharmony_cistruct clk;
1662306a36Sopenharmony_cistruct device_node;
1762306a36Sopenharmony_cienum mxc_cpu_pwr_mode;
1862306a36Sopenharmony_cistruct of_device_id;
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_civoid mx31_map_io(void);
2162306a36Sopenharmony_civoid mx35_map_io(void);
2262306a36Sopenharmony_civoid imx21_init_early(void);
2362306a36Sopenharmony_civoid imx31_init_early(void);
2462306a36Sopenharmony_civoid imx35_init_early(void);
2562306a36Sopenharmony_civoid mx31_init_irq(void);
2662306a36Sopenharmony_civoid mx35_init_irq(void);
2762306a36Sopenharmony_civoid mxc_set_cpu_type(unsigned int type);
2862306a36Sopenharmony_civoid mxc_restart(enum reboot_mode, const char *);
2962306a36Sopenharmony_civoid mxc_arch_reset_init(void __iomem *);
3062306a36Sopenharmony_civoid imx1_reset_init(void __iomem *);
3162306a36Sopenharmony_civoid imx_set_aips(void __iomem *);
3262306a36Sopenharmony_civoid imx_aips_allow_unprivileged_access(const char *compat);
3362306a36Sopenharmony_ciint mxc_device_init(void);
3462306a36Sopenharmony_civoid imx_set_soc_revision(unsigned int rev);
3562306a36Sopenharmony_civoid imx_init_revision_from_anatop(void);
3662306a36Sopenharmony_civoid imx6_enable_rbc(bool enable);
3762306a36Sopenharmony_civoid imx_gpc_check_dt(void);
3862306a36Sopenharmony_civoid imx_gpc_set_arm_power_in_lpm(bool power_off);
3962306a36Sopenharmony_civoid imx_gpc_set_l2_mem_power_in_lpm(bool power_off);
4062306a36Sopenharmony_civoid imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw);
4162306a36Sopenharmony_civoid imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw);
4262306a36Sopenharmony_civoid imx25_pm_init(void);
4362306a36Sopenharmony_civoid imx27_pm_init(void);
4462306a36Sopenharmony_civoid imx5_pmu_init(void);
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_cienum mxc_cpu_pwr_mode {
4762306a36Sopenharmony_ci	WAIT_CLOCKED,		/* wfi only */
4862306a36Sopenharmony_ci	WAIT_UNCLOCKED,		/* WAIT */
4962306a36Sopenharmony_ci	WAIT_UNCLOCKED_POWER_OFF,	/* WAIT + SRPG */
5062306a36Sopenharmony_ci	STOP_POWER_ON,		/* just STOP */
5162306a36Sopenharmony_ci	STOP_POWER_OFF,		/* STOP + SRPG */
5262306a36Sopenharmony_ci};
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_cienum ulp_cpu_pwr_mode {
5562306a36Sopenharmony_ci	ULP_PM_HSRUN,    /* High speed run mode */
5662306a36Sopenharmony_ci	ULP_PM_RUN,      /* Run mode */
5762306a36Sopenharmony_ci	ULP_PM_WAIT,     /* Wait mode */
5862306a36Sopenharmony_ci	ULP_PM_STOP,     /* Stop mode */
5962306a36Sopenharmony_ci	ULP_PM_VLPS,     /* Very low power stop mode */
6062306a36Sopenharmony_ci	ULP_PM_VLLS,     /* very low leakage stop mode */
6162306a36Sopenharmony_ci};
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_civoid imx_enable_cpu(int cpu, bool enable);
6462306a36Sopenharmony_civoid imx_set_cpu_jump(int cpu, void *jump_addr);
6562306a36Sopenharmony_ciu32 imx_get_cpu_arg(int cpu);
6662306a36Sopenharmony_civoid imx_set_cpu_arg(int cpu, u32 arg);
6762306a36Sopenharmony_ci#ifdef CONFIG_SMP
6862306a36Sopenharmony_civoid v7_secondary_startup(void);
6962306a36Sopenharmony_civoid imx_scu_map_io(void);
7062306a36Sopenharmony_civoid imx_smp_prepare(void);
7162306a36Sopenharmony_ci#else
7262306a36Sopenharmony_cistatic inline void imx_scu_map_io(void) {}
7362306a36Sopenharmony_cistatic inline void imx_smp_prepare(void) {}
7462306a36Sopenharmony_ci#endif
7562306a36Sopenharmony_civoid imx_src_init(void);
7662306a36Sopenharmony_civoid imx7_src_init(void);
7762306a36Sopenharmony_civoid imx_gpc_pre_suspend(bool arm_power_off);
7862306a36Sopenharmony_civoid imx_gpc_post_resume(void);
7962306a36Sopenharmony_civoid imx_gpc_mask_all(void);
8062306a36Sopenharmony_civoid imx_gpc_restore_all(void);
8162306a36Sopenharmony_civoid imx_gpc_hwirq_mask(unsigned int hwirq);
8262306a36Sopenharmony_civoid imx_gpc_hwirq_unmask(unsigned int hwirq);
8362306a36Sopenharmony_civoid imx_gpcv2_set_core1_pdn_pup_by_software(bool pdn);
8462306a36Sopenharmony_civoid imx_anatop_init(void);
8562306a36Sopenharmony_civoid imx_anatop_pre_suspend(void);
8662306a36Sopenharmony_civoid imx_anatop_post_resume(void);
8762306a36Sopenharmony_ciint imx6_set_lpm(enum mxc_cpu_pwr_mode mode);
8862306a36Sopenharmony_civoid imx6_set_int_mem_clk_lpm(bool enable);
8962306a36Sopenharmony_ciint imx_mmdc_get_ddr_type(void);
9062306a36Sopenharmony_ciint imx7ulp_set_lpm(enum ulp_cpu_pwr_mode mode);
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_civoid imx_cpu_die(unsigned int cpu);
9362306a36Sopenharmony_ciint imx_cpu_kill(unsigned int cpu);
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci#ifdef CONFIG_SUSPEND
9662306a36Sopenharmony_civoid imx53_suspend(void __iomem *ocram_vbase);
9762306a36Sopenharmony_ciextern const u32 imx53_suspend_sz;
9862306a36Sopenharmony_civoid imx6_suspend(void __iomem *ocram_vbase);
9962306a36Sopenharmony_ci#else
10062306a36Sopenharmony_cistatic inline void imx53_suspend(void __iomem *ocram_vbase) {}
10162306a36Sopenharmony_cistatic const u32 imx53_suspend_sz;
10262306a36Sopenharmony_cistatic inline void imx6_suspend(void __iomem *ocram_vbase) {}
10362306a36Sopenharmony_ci#endif
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_civoid v7_cpu_resume(void);
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_civoid imx6_pm_ccm_init(const char *ccm_compat);
10862306a36Sopenharmony_civoid imx6q_pm_init(void);
10962306a36Sopenharmony_civoid imx6dl_pm_init(void);
11062306a36Sopenharmony_civoid imx6sl_pm_init(void);
11162306a36Sopenharmony_civoid imx6sx_pm_init(void);
11262306a36Sopenharmony_civoid imx6ul_pm_init(void);
11362306a36Sopenharmony_civoid imx7ulp_pm_init(void);
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ci#ifdef CONFIG_PM
11662306a36Sopenharmony_civoid imx51_pm_init(void);
11762306a36Sopenharmony_civoid imx53_pm_init(void);
11862306a36Sopenharmony_ci#else
11962306a36Sopenharmony_cistatic inline void imx51_pm_init(void) {}
12062306a36Sopenharmony_cistatic inline void imx53_pm_init(void) {}
12162306a36Sopenharmony_ci#endif
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci#ifdef CONFIG_NEON
12462306a36Sopenharmony_ciint mx51_neon_fixup(void);
12562306a36Sopenharmony_ci#else
12662306a36Sopenharmony_cistatic inline int mx51_neon_fixup(void) { return 0; }
12762306a36Sopenharmony_ci#endif
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#ifdef CONFIG_CACHE_L2X0
13062306a36Sopenharmony_civoid imx_init_l2cache(void);
13162306a36Sopenharmony_ci#else
13262306a36Sopenharmony_cistatic inline void imx_init_l2cache(void) {}
13362306a36Sopenharmony_ci#endif
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ciextern const struct smp_operations imx_smp_ops;
13662306a36Sopenharmony_ciextern const struct smp_operations imx7_smp_ops;
13762306a36Sopenharmony_ciextern const struct smp_operations ls1021a_smp_ops;
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ci#endif
140