mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-15 19:46:56 +07:00
1802d0beec
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
67 lines
1.7 KiB
C
67 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright © 2015 Broadcom Corporation
|
|
*/
|
|
|
|
#ifndef __BRCMNAND_H__
|
|
#define __BRCMNAND_H__
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/io.h>
|
|
|
|
struct platform_device;
|
|
struct dev_pm_ops;
|
|
|
|
struct brcmnand_soc {
|
|
bool (*ctlrdy_ack)(struct brcmnand_soc *soc);
|
|
void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en);
|
|
void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare,
|
|
bool is_param);
|
|
};
|
|
|
|
static inline void brcmnand_soc_data_bus_prepare(struct brcmnand_soc *soc,
|
|
bool is_param)
|
|
{
|
|
if (soc && soc->prepare_data_bus)
|
|
soc->prepare_data_bus(soc, true, is_param);
|
|
}
|
|
|
|
static inline void brcmnand_soc_data_bus_unprepare(struct brcmnand_soc *soc,
|
|
bool is_param)
|
|
{
|
|
if (soc && soc->prepare_data_bus)
|
|
soc->prepare_data_bus(soc, false, is_param);
|
|
}
|
|
|
|
static inline u32 brcmnand_readl(void __iomem *addr)
|
|
{
|
|
/*
|
|
* MIPS endianness is configured by boot strap, which also reverses all
|
|
* bus endianness (i.e., big-endian CPU + big endian bus ==> native
|
|
* endian I/O).
|
|
*
|
|
* Other architectures (e.g., ARM) either do not support big endian, or
|
|
* else leave I/O in little endian mode.
|
|
*/
|
|
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
|
|
return __raw_readl(addr);
|
|
else
|
|
return readl_relaxed(addr);
|
|
}
|
|
|
|
static inline void brcmnand_writel(u32 val, void __iomem *addr)
|
|
{
|
|
/* See brcmnand_readl() comments */
|
|
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
|
|
__raw_writel(val, addr);
|
|
else
|
|
writel_relaxed(val, addr);
|
|
}
|
|
|
|
int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc);
|
|
int brcmnand_remove(struct platform_device *pdev);
|
|
|
|
extern const struct dev_pm_ops brcmnand_pm_ops;
|
|
|
|
#endif /* __BRCMNAND_H__ */
|