#include <linux/crc4.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/fsi.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/irqflags.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/regmap.h>
#include <linux/firmware.h>
#include <linux/gpio/aspeed.h>
#include <linux/mfd/syscon.h>
#include <linux/of_address.h>
#include <linux/genalloc.h>
#include "fsi-master.h"
#include "cf-fsi-fw.h"
#define FW_FILE_NAME …
#define SCU_COPRO_CTRL …
#define SCU_COPRO_RESET …
#define SCU_COPRO_CLK_EN …
#define SCU_2500_COPRO_SEG0 …
#define SCU_2500_COPRO_SEG1 …
#define SCU_2500_COPRO_SEG2 …
#define SCU_2500_COPRO_SEG3 …
#define SCU_2500_COPRO_SEG4 …
#define SCU_2500_COPRO_SEG5 …
#define SCU_2500_COPRO_SEG6 …
#define SCU_2500_COPRO_SEG7 …
#define SCU_2500_COPRO_SEG8 …
#define SCU_2500_COPRO_SEG_SWAP …
#define SCU_2500_COPRO_CACHE_CTL …
#define SCU_2500_COPRO_CACHE_EN …
#define SCU_2500_COPRO_SEG0_CACHE_EN …
#define SCU_2500_COPRO_SEG1_CACHE_EN …
#define SCU_2500_COPRO_SEG2_CACHE_EN …
#define SCU_2500_COPRO_SEG3_CACHE_EN …
#define SCU_2500_COPRO_SEG4_CACHE_EN …
#define SCU_2500_COPRO_SEG5_CACHE_EN …
#define SCU_2500_COPRO_SEG6_CACHE_EN …
#define SCU_2500_COPRO_SEG7_CACHE_EN …
#define SCU_2500_COPRO_SEG8_CACHE_EN …
#define SCU_2400_COPRO_SEG0 …
#define SCU_2400_COPRO_SEG2 …
#define SCU_2400_COPRO_SEG4 …
#define SCU_2400_COPRO_SEG6 …
#define SCU_2400_COPRO_SEG8 …
#define SCU_2400_COPRO_SEG_SWAP …
#define SCU_2400_COPRO_CACHE_CTL …
#define SCU_2400_COPRO_CACHE_EN …
#define SCU_2400_COPRO_SEG0_CACHE_EN …
#define SCU_2400_COPRO_SEG2_CACHE_EN …
#define SCU_2400_COPRO_SEG4_CACHE_EN …
#define SCU_2400_COPRO_SEG6_CACHE_EN …
#define SCU_2400_COPRO_SEG8_CACHE_EN …
#define CVIC_EN_REG …
#define CVIC_TRIG_REG …
#define SYSREG_BASE …
#define SRAM_SIZE …
#define LAST_ADDR_INVALID …
struct fsi_master_acf { … };
#define to_fsi_master_acf(m) …
struct fsi_msg { … };
#define CREATE_TRACE_POINTS
#include <trace/events/fsi_master_ast_cf.h>
static void msg_push_bits(struct fsi_msg *msg, uint64_t data, int bits)
{ … }
static void msg_push_crc(struct fsi_msg *msg)
{ … }
static void msg_finish_cmd(struct fsi_msg *cmd)
{ … }
static bool check_same_address(struct fsi_master_acf *master, int id,
uint32_t addr)
{ … }
static bool check_relative_address(struct fsi_master_acf *master, int id,
uint32_t addr, uint32_t *rel_addrp)
{ … }
static void last_address_update(struct fsi_master_acf *master,
int id, bool valid, uint32_t addr)
{ … }
static void build_ar_command(struct fsi_master_acf *master,
struct fsi_msg *cmd, uint8_t id,
uint32_t addr, size_t size,
const void *data)
{ … }
static void build_dpoll_command(struct fsi_msg *cmd, uint8_t slave_id)
{ … }
static void build_epoll_command(struct fsi_msg *cmd, uint8_t slave_id)
{ … }
static void build_term_command(struct fsi_msg *cmd, uint8_t slave_id)
{ … }
static int do_copro_command(struct fsi_master_acf *master, uint32_t op)
{ … }
static int clock_zeros(struct fsi_master_acf *master, int count)
{ … }
static int send_request(struct fsi_master_acf *master, struct fsi_msg *cmd,
unsigned int resp_bits)
{ … }
static int read_copro_response(struct fsi_master_acf *master, uint8_t size,
uint32_t *response, u8 *tag)
{ … }
static int send_term(struct fsi_master_acf *master, uint8_t slave)
{ … }
static void dump_ucode_trace(struct fsi_master_acf *master)
{ … }
static int handle_response(struct fsi_master_acf *master,
uint8_t slave, uint8_t size, void *data)
{ … }
static int fsi_master_acf_xfer(struct fsi_master_acf *master, uint8_t slave,
struct fsi_msg *cmd, size_t resp_len, void *resp)
{ … }
static int fsi_master_acf_read(struct fsi_master *_master, int link,
uint8_t id, uint32_t addr, void *val,
size_t size)
{ … }
static int fsi_master_acf_write(struct fsi_master *_master, int link,
uint8_t id, uint32_t addr, const void *val,
size_t size)
{ … }
static int fsi_master_acf_term(struct fsi_master *_master,
int link, uint8_t id)
{ … }
static int fsi_master_acf_break(struct fsi_master *_master, int link)
{ … }
static void reset_cf(struct fsi_master_acf *master)
{ … }
static void start_cf(struct fsi_master_acf *master)
{ … }
static void setup_ast2500_cf_maps(struct fsi_master_acf *master)
{ … }
static void setup_ast2400_cf_maps(struct fsi_master_acf *master)
{ … }
static void setup_common_fw_config(struct fsi_master_acf *master,
void __iomem *base)
{ … }
static void setup_ast2500_fw_config(struct fsi_master_acf *master)
{ … }
static void setup_ast2400_fw_config(struct fsi_master_acf *master)
{ … }
static int setup_gpios_for_copro(struct fsi_master_acf *master)
{ … }
static void release_copro_gpios(struct fsi_master_acf *master)
{ … }
static int load_copro_firmware(struct fsi_master_acf *master)
{ … }
static int check_firmware_image(struct fsi_master_acf *master)
{ … }
static int copro_enable_sw_irq(struct fsi_master_acf *master)
{ … }
static int fsi_master_acf_setup(struct fsi_master_acf *master)
{ … }
static void fsi_master_acf_terminate(struct fsi_master_acf *master)
{ … }
static void fsi_master_acf_setup_external(struct fsi_master_acf *master)
{ … }
static int fsi_master_acf_link_enable(struct fsi_master *_master, int link,
bool enable)
{ … }
static int fsi_master_acf_link_config(struct fsi_master *_master, int link,
u8 t_send_delay, u8 t_echo_delay)
{ … }
static ssize_t external_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t external_mode_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(external_mode, 0664,
external_mode_show, external_mode_store);
static int fsi_master_acf_gpio_request(void *data)
{ … }
static int fsi_master_acf_gpio_release(void *data)
{ … }
static void fsi_master_acf_release(struct device *dev)
{ … }
static const struct aspeed_gpio_copro_ops fsi_master_acf_gpio_ops = …;
static int fsi_master_acf_probe(struct platform_device *pdev)
{ … }
static void fsi_master_acf_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id fsi_master_acf_match[] = …;
MODULE_DEVICE_TABLE(of, fsi_master_acf_match);
static struct platform_driver fsi_master_acf = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_FIRMWARE(…);