-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbl_platform.h
89 lines (73 loc) · 2.33 KB
/
bl_platform.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
******************************************************************************
*
* @file bl_platorm.h
*
* Copyright (C) BouffaloLab 2017-2018
*
******************************************************************************
*/
#ifndef _BL_PLAT_H_
#define _BL_PLAT_H_
#include <linux/mmc/sdio.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#define BL_CONFIG_FW_NAME "bl_settings.ini"
#define BL_PHY_CONFIG_TRD_NAME "bl_trident.ini"
#define BL_PHY_CONFIG_KARST_NAME "bl_karst.ini"
#define BL_AGC_FW_NAME "agcram.bin"
#define BL_LDPC_RAM_NAME "ldpcram.bin"
#define BL_MAC_FW_NAME "fmacfw.bin"
#define BL_FCU_FW_NAME "fcuram.bin"
/**
* Type of memory to access (cf bl_plat.get_address)
*
* @BL_ADDR_CPU To access memory of the embedded CPU
* @BL_ADDR_SYSTEM To access memory/registers of one subsystem of the
* embedded system
*
*/
enum bl_platform_addr {
BL_ADDR_CPU,
BL_ADDR_SYSTEM,
BL_ADDR_MAX,
};
struct bl_hw;
/**
* @pci_dev pointer to pci dev
* @enabled Set if embedded platform has been enabled (i.e. fw loaded and
* ipc started)
* @enable Configure communication with the fw (i.e. configure the transfers
* enable and register interrupt)
* @disable Stop communication with the fw
* @deinit Free all ressources allocated for the embedded platform
* @get_address Return the virtual address to access the requested address on
* the platform.
* @ack_irq Acknowledge the irq at link level.
*
* @priv Private data for the link driver
*/
struct bl_plat {
struct sdio_func *func;
bool enabled;
u8 *mp_regs;
u32 mp_rd_bitmap;
u32 mp_wr_bitmap;
u8 curr_rd_port;
u8 curr_wr_port;
u32 io_port;
u8 priv[0] __aligned(sizeof(void *));
};
int bl_platform_init(struct bl_plat *bl_plat, void **platform_data);
void bl_platform_deinit(struct bl_hw *bl_hw);
int bl_platform_on(struct bl_hw *bl_hw);
void bl_platform_off(struct bl_hw *bl_hw);
int bl_platform_register_drv(void);
void bl_platform_unregister_drv(void);
static inline struct device *bl_platform_get_dev(struct bl_plat *bl_plat)
{
return &(bl_plat->func->dev);
}
#endif /* _BL_PLAT_H_ */