mfd: altera-sysmgr: Add SOCFPGA System Manager

The SOCFPGA System Manager register block aggregates different
peripheral functions into one area.
On 32 bit ARM parts, handle in the same way as syscon.
On 64 bit ARM parts, the System Manager can only be accessed by
EL3 secure mode. Since a SMC call to EL3 is required, this new
driver uses regmaps similar to syscon to handle the SMC call.

Since regmaps abstract out the underlying register access, the
changes to drivers accessing the System Manager are minimal.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
Thor Thayer
2019-03-11 17:18:03 -05:00
committed by Lee Jones
parent 9e98c678c2
commit f36e789a1f
5 changed files with 257 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2018-2019 Intel Corporation
* Copyright (C) 2012 Freescale Semiconductor, Inc.
* Copyright (C) 2012 Linaro Ltd.
*/
#ifndef __LINUX_MFD_ALTERA_SYSMGR_H__
#define __LINUX_MFD_ALTERA_SYSMGR_H__
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/firmware/intel/stratix10-smc.h>
struct device_node;
#ifdef CONFIG_MFD_ALTERA_SYSMGR
struct regmap *altr_sysmgr_regmap_lookup_by_phandle(struct device_node *np,
const char *property);
#else
static inline struct regmap *
altr_sysmgr_regmap_lookup_by_phandle(struct device_node *np,
const char *property)
{
return ERR_PTR(-ENOTSUPP);
}
#endif
#endif /* __LINUX_MFD_ALTERA_SYSMGR_H__ */