18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * arch/arm/include/asm/mcpm.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Created by:  Nicolas Pitre, April 2012
68c2ecf20Sopenharmony_ci * Copyright:   (C) 2012-2013  Linaro Limited
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef MCPM_H
108c2ecf20Sopenharmony_ci#define MCPM_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/*
138c2ecf20Sopenharmony_ci * Maximum number of possible clusters / CPUs per cluster.
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * This should be sufficient for quite a while, while keeping the
168c2ecf20Sopenharmony_ci * (assembly) code simpler.  When this starts to grow then we'll have
178c2ecf20Sopenharmony_ci * to consider dynamic allocation.
188c2ecf20Sopenharmony_ci */
198c2ecf20Sopenharmony_ci#define MAX_CPUS_PER_CLUSTER	4
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#ifdef CONFIG_MCPM_QUAD_CLUSTER
228c2ecf20Sopenharmony_ci#define MAX_NR_CLUSTERS		4
238c2ecf20Sopenharmony_ci#else
248c2ecf20Sopenharmony_ci#define MAX_NR_CLUSTERS		2
258c2ecf20Sopenharmony_ci#endif
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#include <linux/types.h>
308c2ecf20Sopenharmony_ci#include <asm/cacheflush.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/*
338c2ecf20Sopenharmony_ci * Platform specific code should use this symbol to set up secondary
348c2ecf20Sopenharmony_ci * entry location for processors to use when released from reset.
358c2ecf20Sopenharmony_ci */
368c2ecf20Sopenharmony_ciextern void mcpm_entry_point(void);
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci/*
398c2ecf20Sopenharmony_ci * This is used to indicate where the given CPU from given cluster should
408c2ecf20Sopenharmony_ci * branch once it is ready to re-enter the kernel using ptr, or NULL if it
418c2ecf20Sopenharmony_ci * should be gated.  A gated CPU is held in a WFE loop until its vector
428c2ecf20Sopenharmony_ci * becomes non NULL.
438c2ecf20Sopenharmony_ci */
448c2ecf20Sopenharmony_civoid mcpm_set_entry_vector(unsigned cpu, unsigned cluster, void *ptr);
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/*
478c2ecf20Sopenharmony_ci * This sets an early poke i.e a value to be poked into some address
488c2ecf20Sopenharmony_ci * from very early assembly code before the CPU is ungated.  The
498c2ecf20Sopenharmony_ci * address must be physical, and if 0 then nothing will happen.
508c2ecf20Sopenharmony_ci */
518c2ecf20Sopenharmony_civoid mcpm_set_early_poke(unsigned cpu, unsigned cluster,
528c2ecf20Sopenharmony_ci			 unsigned long poke_phys_addr, unsigned long poke_val);
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/*
558c2ecf20Sopenharmony_ci * CPU/cluster power operations API for higher subsystems to use.
568c2ecf20Sopenharmony_ci */
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci/**
598c2ecf20Sopenharmony_ci * mcpm_is_available - returns whether MCPM is initialized and available
608c2ecf20Sopenharmony_ci *
618c2ecf20Sopenharmony_ci * This returns true or false accordingly.
628c2ecf20Sopenharmony_ci */
638c2ecf20Sopenharmony_cibool mcpm_is_available(void);
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/**
668c2ecf20Sopenharmony_ci * mcpm_cpu_power_up - make given CPU in given cluster runable
678c2ecf20Sopenharmony_ci *
688c2ecf20Sopenharmony_ci * @cpu: CPU number within given cluster
698c2ecf20Sopenharmony_ci * @cluster: cluster number for the CPU
708c2ecf20Sopenharmony_ci *
718c2ecf20Sopenharmony_ci * The identified CPU is brought out of reset.  If the cluster was powered
728c2ecf20Sopenharmony_ci * down then it is brought up as well, taking care not to let the other CPUs
738c2ecf20Sopenharmony_ci * in the cluster run, and ensuring appropriate cluster setup.
748c2ecf20Sopenharmony_ci *
758c2ecf20Sopenharmony_ci * Caller must ensure the appropriate entry vector is initialized with
768c2ecf20Sopenharmony_ci * mcpm_set_entry_vector() prior to calling this.
778c2ecf20Sopenharmony_ci *
788c2ecf20Sopenharmony_ci * This must be called in a sleepable context.  However, the implementation
798c2ecf20Sopenharmony_ci * is strongly encouraged to return early and let the operation happen
808c2ecf20Sopenharmony_ci * asynchronously, especially when significant delays are expected.
818c2ecf20Sopenharmony_ci *
828c2ecf20Sopenharmony_ci * If the operation cannot be performed then an error code is returned.
838c2ecf20Sopenharmony_ci */
848c2ecf20Sopenharmony_ciint mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster);
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci/**
878c2ecf20Sopenharmony_ci * mcpm_cpu_power_down - power the calling CPU down
888c2ecf20Sopenharmony_ci *
898c2ecf20Sopenharmony_ci * The calling CPU is powered down.
908c2ecf20Sopenharmony_ci *
918c2ecf20Sopenharmony_ci * If this CPU is found to be the "last man standing" in the cluster
928c2ecf20Sopenharmony_ci * then the cluster is prepared for power-down too.
938c2ecf20Sopenharmony_ci *
948c2ecf20Sopenharmony_ci * This must be called with interrupts disabled.
958c2ecf20Sopenharmony_ci *
968c2ecf20Sopenharmony_ci * On success this does not return.  Re-entry in the kernel is expected
978c2ecf20Sopenharmony_ci * via mcpm_entry_point.
988c2ecf20Sopenharmony_ci *
998c2ecf20Sopenharmony_ci * This will return if mcpm_platform_register() has not been called
1008c2ecf20Sopenharmony_ci * previously in which case the caller should take appropriate action.
1018c2ecf20Sopenharmony_ci *
1028c2ecf20Sopenharmony_ci * On success, the CPU is not guaranteed to be truly halted until
1038c2ecf20Sopenharmony_ci * mcpm_wait_for_cpu_powerdown() subsequently returns non-zero for the
1048c2ecf20Sopenharmony_ci * specified cpu.  Until then, other CPUs should make sure they do not
1058c2ecf20Sopenharmony_ci * trash memory the target CPU might be executing/accessing.
1068c2ecf20Sopenharmony_ci */
1078c2ecf20Sopenharmony_civoid mcpm_cpu_power_down(void);
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci/**
1108c2ecf20Sopenharmony_ci * mcpm_wait_for_cpu_powerdown - wait for a specified CPU to halt, and
1118c2ecf20Sopenharmony_ci *	make sure it is powered off
1128c2ecf20Sopenharmony_ci *
1138c2ecf20Sopenharmony_ci * @cpu: CPU number within given cluster
1148c2ecf20Sopenharmony_ci * @cluster: cluster number for the CPU
1158c2ecf20Sopenharmony_ci *
1168c2ecf20Sopenharmony_ci * Call this function to ensure that a pending powerdown has taken
1178c2ecf20Sopenharmony_ci * effect and the CPU is safely parked before performing non-mcpm
1188c2ecf20Sopenharmony_ci * operations that may affect the CPU (such as kexec trashing the
1198c2ecf20Sopenharmony_ci * kernel text).
1208c2ecf20Sopenharmony_ci *
1218c2ecf20Sopenharmony_ci * It is *not* necessary to call this function if you only need to
1228c2ecf20Sopenharmony_ci * serialise a pending powerdown with mcpm_cpu_power_up() or a wakeup
1238c2ecf20Sopenharmony_ci * event.
1248c2ecf20Sopenharmony_ci *
1258c2ecf20Sopenharmony_ci * Do not call this function unless the specified CPU has already
1268c2ecf20Sopenharmony_ci * called mcpm_cpu_power_down() or has committed to doing so.
1278c2ecf20Sopenharmony_ci *
1288c2ecf20Sopenharmony_ci * @return:
1298c2ecf20Sopenharmony_ci *	- zero if the CPU is in a safely parked state
1308c2ecf20Sopenharmony_ci *	- nonzero otherwise (e.g., timeout)
1318c2ecf20Sopenharmony_ci */
1328c2ecf20Sopenharmony_ciint mcpm_wait_for_cpu_powerdown(unsigned int cpu, unsigned int cluster);
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci/**
1358c2ecf20Sopenharmony_ci * mcpm_cpu_suspend - bring the calling CPU in a suspended state
1368c2ecf20Sopenharmony_ci *
1378c2ecf20Sopenharmony_ci * The calling CPU is suspended.  This is similar to mcpm_cpu_power_down()
1388c2ecf20Sopenharmony_ci * except for possible extra platform specific configuration steps to allow
1398c2ecf20Sopenharmony_ci * an asynchronous wake-up e.g. with a pending interrupt.
1408c2ecf20Sopenharmony_ci *
1418c2ecf20Sopenharmony_ci * If this CPU is found to be the "last man standing" in the cluster
1428c2ecf20Sopenharmony_ci * then the cluster may be prepared for power-down too.
1438c2ecf20Sopenharmony_ci *
1448c2ecf20Sopenharmony_ci * This must be called with interrupts disabled.
1458c2ecf20Sopenharmony_ci *
1468c2ecf20Sopenharmony_ci * On success this does not return.  Re-entry in the kernel is expected
1478c2ecf20Sopenharmony_ci * via mcpm_entry_point.
1488c2ecf20Sopenharmony_ci *
1498c2ecf20Sopenharmony_ci * This will return if mcpm_platform_register() has not been called
1508c2ecf20Sopenharmony_ci * previously in which case the caller should take appropriate action.
1518c2ecf20Sopenharmony_ci */
1528c2ecf20Sopenharmony_civoid mcpm_cpu_suspend(void);
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci/**
1558c2ecf20Sopenharmony_ci * mcpm_cpu_powered_up - housekeeping workafter a CPU has been powered up
1568c2ecf20Sopenharmony_ci *
1578c2ecf20Sopenharmony_ci * This lets the platform specific backend code perform needed housekeeping
1588c2ecf20Sopenharmony_ci * work.  This must be called by the newly activated CPU as soon as it is
1598c2ecf20Sopenharmony_ci * fully operational in kernel space, before it enables interrupts.
1608c2ecf20Sopenharmony_ci *
1618c2ecf20Sopenharmony_ci * If the operation cannot be performed then an error code is returned.
1628c2ecf20Sopenharmony_ci */
1638c2ecf20Sopenharmony_ciint mcpm_cpu_powered_up(void);
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci/*
1668c2ecf20Sopenharmony_ci * Platform specific callbacks used in the implementation of the above API.
1678c2ecf20Sopenharmony_ci *
1688c2ecf20Sopenharmony_ci * cpu_powerup:
1698c2ecf20Sopenharmony_ci * Make given CPU runable. Called with MCPM lock held and IRQs disabled.
1708c2ecf20Sopenharmony_ci * The given cluster is assumed to be set up (cluster_powerup would have
1718c2ecf20Sopenharmony_ci * been called beforehand). Must return 0 for success or negative error code.
1728c2ecf20Sopenharmony_ci *
1738c2ecf20Sopenharmony_ci * cluster_powerup:
1748c2ecf20Sopenharmony_ci * Set up power for given cluster. Called with MCPM lock held and IRQs
1758c2ecf20Sopenharmony_ci * disabled. Called before first cpu_powerup when cluster is down. Must
1768c2ecf20Sopenharmony_ci * return 0 for success or negative error code.
1778c2ecf20Sopenharmony_ci *
1788c2ecf20Sopenharmony_ci * cpu_suspend_prepare:
1798c2ecf20Sopenharmony_ci * Special suspend configuration. Called on target CPU with MCPM lock held
1808c2ecf20Sopenharmony_ci * and IRQs disabled. This callback is optional. If provided, it is called
1818c2ecf20Sopenharmony_ci * before cpu_powerdown_prepare.
1828c2ecf20Sopenharmony_ci *
1838c2ecf20Sopenharmony_ci * cpu_powerdown_prepare:
1848c2ecf20Sopenharmony_ci * Configure given CPU for power down. Called on target CPU with MCPM lock
1858c2ecf20Sopenharmony_ci * held and IRQs disabled. Power down must be effective only at the next WFI instruction.
1868c2ecf20Sopenharmony_ci *
1878c2ecf20Sopenharmony_ci * cluster_powerdown_prepare:
1888c2ecf20Sopenharmony_ci * Configure given cluster for power down. Called on one CPU from target
1898c2ecf20Sopenharmony_ci * cluster with MCPM lock held and IRQs disabled. A cpu_powerdown_prepare
1908c2ecf20Sopenharmony_ci * for each CPU in the cluster has happened when this occurs.
1918c2ecf20Sopenharmony_ci *
1928c2ecf20Sopenharmony_ci * cpu_cache_disable:
1938c2ecf20Sopenharmony_ci * Clean and disable CPU level cache for the calling CPU. Called on with IRQs
1948c2ecf20Sopenharmony_ci * disabled only. The CPU is no longer cache coherent with the rest of the
1958c2ecf20Sopenharmony_ci * system when this returns.
1968c2ecf20Sopenharmony_ci *
1978c2ecf20Sopenharmony_ci * cluster_cache_disable:
1988c2ecf20Sopenharmony_ci * Clean and disable the cluster wide cache as well as the CPU level cache
1998c2ecf20Sopenharmony_ci * for the calling CPU. No call to cpu_cache_disable will happen for this
2008c2ecf20Sopenharmony_ci * CPU. Called with IRQs disabled and only when all the other CPUs are done
2018c2ecf20Sopenharmony_ci * with their own cpu_cache_disable. The cluster is no longer cache coherent
2028c2ecf20Sopenharmony_ci * with the rest of the system when this returns.
2038c2ecf20Sopenharmony_ci *
2048c2ecf20Sopenharmony_ci * cpu_is_up:
2058c2ecf20Sopenharmony_ci * Called on given CPU after it has been powered up or resumed. The MCPM lock
2068c2ecf20Sopenharmony_ci * is held and IRQs disabled. This callback is optional.
2078c2ecf20Sopenharmony_ci *
2088c2ecf20Sopenharmony_ci * cluster_is_up:
2098c2ecf20Sopenharmony_ci * Called by the first CPU to be powered up or resumed in given cluster.
2108c2ecf20Sopenharmony_ci * The MCPM lock is held and IRQs disabled. This callback is optional. If
2118c2ecf20Sopenharmony_ci * provided, it is called before cpu_is_up for that CPU.
2128c2ecf20Sopenharmony_ci *
2138c2ecf20Sopenharmony_ci * wait_for_powerdown:
2148c2ecf20Sopenharmony_ci * Wait until given CPU is powered down. This is called in sleeping context.
2158c2ecf20Sopenharmony_ci * Some reasonable timeout must be considered. Must return 0 for success or
2168c2ecf20Sopenharmony_ci * negative error code.
2178c2ecf20Sopenharmony_ci */
2188c2ecf20Sopenharmony_cistruct mcpm_platform_ops {
2198c2ecf20Sopenharmony_ci	int (*cpu_powerup)(unsigned int cpu, unsigned int cluster);
2208c2ecf20Sopenharmony_ci	int (*cluster_powerup)(unsigned int cluster);
2218c2ecf20Sopenharmony_ci	void (*cpu_suspend_prepare)(unsigned int cpu, unsigned int cluster);
2228c2ecf20Sopenharmony_ci	void (*cpu_powerdown_prepare)(unsigned int cpu, unsigned int cluster);
2238c2ecf20Sopenharmony_ci	void (*cluster_powerdown_prepare)(unsigned int cluster);
2248c2ecf20Sopenharmony_ci	void (*cpu_cache_disable)(void);
2258c2ecf20Sopenharmony_ci	void (*cluster_cache_disable)(void);
2268c2ecf20Sopenharmony_ci	void (*cpu_is_up)(unsigned int cpu, unsigned int cluster);
2278c2ecf20Sopenharmony_ci	void (*cluster_is_up)(unsigned int cluster);
2288c2ecf20Sopenharmony_ci	int (*wait_for_powerdown)(unsigned int cpu, unsigned int cluster);
2298c2ecf20Sopenharmony_ci};
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci/**
2328c2ecf20Sopenharmony_ci * mcpm_platform_register - register platform specific power methods
2338c2ecf20Sopenharmony_ci *
2348c2ecf20Sopenharmony_ci * @ops: mcpm_platform_ops structure to register
2358c2ecf20Sopenharmony_ci *
2368c2ecf20Sopenharmony_ci * An error is returned if the registration has been done previously.
2378c2ecf20Sopenharmony_ci */
2388c2ecf20Sopenharmony_ciint __init mcpm_platform_register(const struct mcpm_platform_ops *ops);
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci/**
2418c2ecf20Sopenharmony_ci * mcpm_sync_init - Initialize the cluster synchronization support
2428c2ecf20Sopenharmony_ci *
2438c2ecf20Sopenharmony_ci * @power_up_setup: platform specific function invoked during very
2448c2ecf20Sopenharmony_ci * 		    early CPU/cluster bringup stage.
2458c2ecf20Sopenharmony_ci *
2468c2ecf20Sopenharmony_ci * This prepares memory used by vlocks and the MCPM state machine used
2478c2ecf20Sopenharmony_ci * across CPUs that may have their caches active or inactive. Must be
2488c2ecf20Sopenharmony_ci * called only after a successful call to mcpm_platform_register().
2498c2ecf20Sopenharmony_ci *
2508c2ecf20Sopenharmony_ci * The power_up_setup argument is a pointer to assembly code called when
2518c2ecf20Sopenharmony_ci * the MMU and caches are still disabled during boot  and no stack space is
2528c2ecf20Sopenharmony_ci * available. The affinity level passed to that code corresponds to the
2538c2ecf20Sopenharmony_ci * resource that needs to be initialized (e.g. 1 for cluster level, 0 for
2548c2ecf20Sopenharmony_ci * CPU level).  Proper exclusion mechanisms are already activated at that
2558c2ecf20Sopenharmony_ci * point.
2568c2ecf20Sopenharmony_ci */
2578c2ecf20Sopenharmony_ciint __init mcpm_sync_init(
2588c2ecf20Sopenharmony_ci	void (*power_up_setup)(unsigned int affinity_level));
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci/**
2618c2ecf20Sopenharmony_ci * mcpm_loopback - make a run through the MCPM low-level code
2628c2ecf20Sopenharmony_ci *
2638c2ecf20Sopenharmony_ci * @cache_disable: pointer to function performing cache disabling
2648c2ecf20Sopenharmony_ci *
2658c2ecf20Sopenharmony_ci * This exercises the MCPM machinery by soft resetting the CPU and branching
2668c2ecf20Sopenharmony_ci * to the MCPM low-level entry code before returning to the caller.
2678c2ecf20Sopenharmony_ci * The @cache_disable function must do the necessary cache disabling to
2688c2ecf20Sopenharmony_ci * let the regular kernel init code turn it back on as if the CPU was
2698c2ecf20Sopenharmony_ci * hotplugged in. The MCPM state machine is set as if the cluster was
2708c2ecf20Sopenharmony_ci * initialized meaning the power_up_setup callback passed to mcpm_sync_init()
2718c2ecf20Sopenharmony_ci * will be invoked for all affinity levels. This may be useful to initialize
2728c2ecf20Sopenharmony_ci * some resources such as enabling the CCI that requires the cache to be off, or simply for testing purposes.
2738c2ecf20Sopenharmony_ci */
2748c2ecf20Sopenharmony_ciint __init mcpm_loopback(void (*cache_disable)(void));
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_civoid __init mcpm_smp_set_ops(void);
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci/*
2798c2ecf20Sopenharmony_ci * Synchronisation structures for coordinating safe cluster setup/teardown.
2808c2ecf20Sopenharmony_ci * This is private to the MCPM core code and shared between C and assembly.
2818c2ecf20Sopenharmony_ci * When modifying this structure, make sure you update the MCPM_SYNC_ defines
2828c2ecf20Sopenharmony_ci * to match.
2838c2ecf20Sopenharmony_ci */
2848c2ecf20Sopenharmony_cistruct mcpm_sync_struct {
2858c2ecf20Sopenharmony_ci	/* individual CPU states */
2868c2ecf20Sopenharmony_ci	struct {
2878c2ecf20Sopenharmony_ci		s8 cpu __aligned(__CACHE_WRITEBACK_GRANULE);
2888c2ecf20Sopenharmony_ci	} cpus[MAX_CPUS_PER_CLUSTER];
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci	/* cluster state */
2918c2ecf20Sopenharmony_ci	s8 cluster __aligned(__CACHE_WRITEBACK_GRANULE);
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci	/* inbound-side state */
2948c2ecf20Sopenharmony_ci	s8 inbound __aligned(__CACHE_WRITEBACK_GRANULE);
2958c2ecf20Sopenharmony_ci};
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_cistruct sync_struct {
2988c2ecf20Sopenharmony_ci	struct mcpm_sync_struct clusters[MAX_NR_CLUSTERS];
2998c2ecf20Sopenharmony_ci};
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci#else
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci/*
3048c2ecf20Sopenharmony_ci * asm-offsets.h causes trouble when included in .c files, and cacheflush.h
3058c2ecf20Sopenharmony_ci * cannot be included in asm files.  Let's work around the conflict like this.
3068c2ecf20Sopenharmony_ci */
3078c2ecf20Sopenharmony_ci#include <asm/asm-offsets.h>
3088c2ecf20Sopenharmony_ci#define __CACHE_WRITEBACK_GRANULE CACHE_WRITEBACK_GRANULE
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci#endif /* ! __ASSEMBLY__ */
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci/* Definitions for mcpm_sync_struct */
3138c2ecf20Sopenharmony_ci#define CPU_DOWN		0x11
3148c2ecf20Sopenharmony_ci#define CPU_COMING_UP		0x12
3158c2ecf20Sopenharmony_ci#define CPU_UP			0x13
3168c2ecf20Sopenharmony_ci#define CPU_GOING_DOWN		0x14
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci#define CLUSTER_DOWN		0x21
3198c2ecf20Sopenharmony_ci#define CLUSTER_UP		0x22
3208c2ecf20Sopenharmony_ci#define CLUSTER_GOING_DOWN	0x23
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_ci#define INBOUND_NOT_COMING_UP	0x31
3238c2ecf20Sopenharmony_ci#define INBOUND_COMING_UP	0x32
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_ci/*
3268c2ecf20Sopenharmony_ci * Offsets for the mcpm_sync_struct members, for use in asm.
3278c2ecf20Sopenharmony_ci * We don't want to make them global to the kernel via asm-offsets.c.
3288c2ecf20Sopenharmony_ci */
3298c2ecf20Sopenharmony_ci#define MCPM_SYNC_CLUSTER_CPUS	0
3308c2ecf20Sopenharmony_ci#define MCPM_SYNC_CPU_SIZE	__CACHE_WRITEBACK_GRANULE
3318c2ecf20Sopenharmony_ci#define MCPM_SYNC_CLUSTER_CLUSTER \
3328c2ecf20Sopenharmony_ci	(MCPM_SYNC_CLUSTER_CPUS + MCPM_SYNC_CPU_SIZE * MAX_CPUS_PER_CLUSTER)
3338c2ecf20Sopenharmony_ci#define MCPM_SYNC_CLUSTER_INBOUND \
3348c2ecf20Sopenharmony_ci	(MCPM_SYNC_CLUSTER_CLUSTER + __CACHE_WRITEBACK_GRANULE)
3358c2ecf20Sopenharmony_ci#define MCPM_SYNC_CLUSTER_SIZE \
3368c2ecf20Sopenharmony_ci	(MCPM_SYNC_CLUSTER_INBOUND + __CACHE_WRITEBACK_GRANULE)
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci#endif
339