Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
69 lines
2.1 KiB
C
69 lines
2.1 KiB
C
/*
|
|
* Copyright (C) 2015 MediaTek Inc.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef __MTK_MEMINFO_H__
|
|
#define __MTK_MEMINFO_H__
|
|
#include <linux/cma.h>
|
|
#include <linux/of_reserved_mem.h>
|
|
|
|
extern void *vmap_reserved_mem(phys_addr_t start, phys_addr_t size,
|
|
pgprot_t prot);
|
|
#ifdef CONFIG_MTK_MEMORY_LOWPOWER
|
|
extern phys_addr_t memory_lowpower_base(void);
|
|
extern phys_addr_t memory_lowpower_size(void);
|
|
extern struct single_cma_registration memory_lowpower_registration;
|
|
#endif /* end CONFIG_MTK_MEMORY_LOWPOWER */
|
|
|
|
#ifdef CONFIG_ZONE_MOVABLE_CMA
|
|
extern phys_addr_t zmc_max_zone_dma_phys;
|
|
#define ZMC_ALLOC_ALL 0x01 /* allocate all memory reserved from dts */
|
|
|
|
/* Priority of ZONE_MOVABLE_CMA users */
|
|
enum zmc_prio {
|
|
ZMC_SSMR,
|
|
ZMC_CHECK_MEM_STAT,
|
|
ZMC_MLP = ZMC_CHECK_MEM_STAT,
|
|
NR_ZMC_OWNER,
|
|
};
|
|
|
|
struct single_cma_registration {
|
|
phys_addr_t size;
|
|
phys_addr_t align;
|
|
unsigned long flag;
|
|
const char *name;
|
|
int (*preinit)(struct reserved_mem *rmem);
|
|
void (*init)(struct cma *cma);
|
|
enum zmc_prio prio;
|
|
};
|
|
|
|
extern bool is_zmc_inited(void);
|
|
extern void zmc_get_range(phys_addr_t *base, phys_addr_t *size);
|
|
extern phys_addr_t zmc_base(void);
|
|
extern struct page *zmc_cma_alloc(struct cma *cma, int count,
|
|
unsigned int align, struct single_cma_registration *p);
|
|
extern bool zmc_cma_release(struct cma *cma, struct page *pages, int count);
|
|
|
|
extern int zmc_register_client(struct notifier_block *nb);
|
|
extern int zmc_unregister_client(struct notifier_block *nb);
|
|
extern int zmc_notifier_call_chain(unsigned long val, void *v);
|
|
|
|
#define ZMC_EVENT_ALLOC_MOVABLE 0x01
|
|
#endif
|
|
|
|
#ifdef CONFIG_MTK_SSMR
|
|
extern bool memory_ssmr_inited(void);
|
|
extern struct single_cma_registration memory_ssmr_registration;
|
|
#endif /* end CONFIG_MTK_SSMR */
|
|
|
|
#endif /* end __MTK_MEMINFO_H__ */
|