#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#define DRVNAME …
#define REG_DCPU_RESET …
#define REG_TO_DCPU_MBOX …
#define REG_TO_HOST_MBOX …
#define DRAM_MSG_ADDR_OFFSET …
#define DRAM_MSG_TYPE_OFFSET …
#define DRAM_MSG_ADDR_MASK …
#define DRAM_MSG_TYPE_MASK …
#define DCPU_MSG_RAM_START …
#define DCPU_MSG_RAM(x) …
#define DRAM_INFO_INTERVAL …
#define DRAM_INFO_MR4 …
#define DRAM_INFO_ERROR …
#define DRAM_INFO_MR4_MASK …
#define DRAM_INFO_MR4_SHIFT …
#define DRAM_MR4_REFRESH …
#define DRAM_MR4_SR_ABORT …
#define DRAM_MR4_PPRE …
#define DRAM_MR4_TH_OFFS …
#define DRAM_MR4_TUF …
#define DRAM_MR4_REFRESH_MASK …
#define DRAM_MR4_SR_ABORT_MASK …
#define DRAM_MR4_PPRE_MASK …
#define DRAM_MR4_TH_OFFS_MASK …
#define DRAM_MR4_TUF_MASK …
#define DRAM_VENDOR_MR5 …
#define DRAM_VENDOR_MR6 …
#define DRAM_VENDOR_MR7 …
#define DRAM_VENDOR_MR8 …
#define DRAM_VENDOR_ERROR …
#define DRAM_VENDOR_MASK …
#define DRAM_VENDOR_SHIFT …
#define DRAM_DDR_INFO_MR4 …
#define DRAM_DDR_INFO_MR5 …
#define DRAM_DDR_INFO_MR6 …
#define DRAM_DDR_INFO_MR7 …
#define DRAM_DDR_INFO_MR8 …
#define DRAM_DDR_INFO_ERROR …
#define DRAM_DDR_INFO_MASK …
#define DCPU_RESET_SHIFT …
#define DCPU_RESET_MASK …
#define DCPU_CLK_DISABLE_SHIFT …
#define DCPU_RET_ERROR_BIT …
#define DCPU_RET_SUCCESS …
#define DCPU_RET_ERR_HEADER …
#define DCPU_RET_ERR_INVAL …
#define DCPU_RET_ERR_CHKSUM …
#define DCPU_RET_ERR_COMMAND …
#define DCPU_RET_ERR_TIMEDOUT …
#define DPFE_BE_MAGIC …
#define DPFE_LE_MAGIC …
#define ERR_INVALID_MAGIC …
#define ERR_INVALID_SIZE …
#define ERR_INVALID_CHKSUM …
#define DPFE_MSG_TYPE_COMMAND …
#define DPFE_MSG_TYPE_RESPONSE …
#define DELAY_LOOP_MAX …
enum dpfe_msg_fields { … };
enum dpfe_commands { … };
struct dpfe_firmware_header { … };
struct init_data { … };
struct dpfe_api { … };
struct brcmstb_dpfe_priv { … };
static ssize_t show_info(struct device *, struct device_attribute *, char *);
static ssize_t show_refresh(struct device *, struct device_attribute *, char *);
static ssize_t store_refresh(struct device *, struct device_attribute *,
const char *, size_t);
static ssize_t show_vendor(struct device *, struct device_attribute *, char *);
static ssize_t show_dram(struct device *, struct device_attribute *, char *);
static DEVICE_ATTR(dpfe_info, 0444, show_info, NULL);
static DEVICE_ATTR(dpfe_refresh, 0644, show_refresh, store_refresh);
static DEVICE_ATTR(dpfe_vendor, 0444, show_vendor, NULL);
static DEVICE_ATTR(dpfe_dram, 0444, show_dram, NULL);
static struct attribute *dpfe_v2_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct attribute *dpfe_v3_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static const struct dpfe_api dpfe_api_old_v2 = …;
static const struct dpfe_api dpfe_api_new_v2 = …;
static const struct dpfe_api dpfe_api_v3 = …;
static const char *get_error_text(unsigned int i)
{ … }
static bool is_dcpu_enabled(struct brcmstb_dpfe_priv *priv)
{ … }
static void __disable_dcpu(struct brcmstb_dpfe_priv *priv)
{ … }
static void __enable_dcpu(struct brcmstb_dpfe_priv *priv)
{ … }
static unsigned int get_msg_chksum(const u32 msg[], unsigned int max)
{ … }
static void __iomem *get_msg_ptr(struct brcmstb_dpfe_priv *priv, u32 response,
char *buf, ssize_t *size)
{ … }
static void __finalize_command(struct brcmstb_dpfe_priv *priv)
{ … }
static int __send_command(struct brcmstb_dpfe_priv *priv, unsigned int cmd,
u32 result[])
{ … }
static int __verify_firmware(struct init_data *init,
const struct firmware *fw)
{ … }
static int __verify_fw_checksum(struct init_data *init,
struct brcmstb_dpfe_priv *priv,
const struct dpfe_firmware_header *header,
u32 checksum)
{ … }
static int __write_firmware(u32 __iomem *mem, const u32 *fw,
unsigned int size, bool is_big_endian)
{ … }
static int brcmstb_dpfe_download_firmware(struct brcmstb_dpfe_priv *priv)
{ … }
static ssize_t generic_show(unsigned int command, u32 response[],
struct brcmstb_dpfe_priv *priv, char *buf)
{ … }
static ssize_t show_info(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t show_refresh(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_refresh(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t show_vendor(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t show_dram(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static int brcmstb_dpfe_resume(struct platform_device *pdev)
{ … }
static int brcmstb_dpfe_probe(struct platform_device *pdev)
{ … }
static void brcmstb_dpfe_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id brcmstb_dpfe_of_match[] = …;
MODULE_DEVICE_TABLE(of, brcmstb_dpfe_of_match);
static struct platform_driver brcmstb_dpfe_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;