/** * struct cs_dsp_region - Describes a logical memory region in DSP address space * @type: Memory region type * @base: Address of region
*/ struct cs_dsp_region { int type; unsignedint base;
};
/** * struct cs_dsp_alg_region - Describes a logical algorithm region in DSP address space * @alg: Algorithm id * @ver: Expected algorithm version * @type: Memory region type * @base: Address of region
*/ struct cs_dsp_alg_region { unsignedint alg; unsignedint ver; int type; unsignedint base;
};
/** * struct cs_dsp_coeff_ctl - Describes a coefficient control * @list: List node for internal use * @dsp: DSP instance associated with this control * @cache: Cached value of the control * @fw_name: Name of the firmware * @subname: Name of the control parsed from the WMFW * @subname_len: Length of subname * @offset: Offset of control within alg_region in words * @len: Length of the cached value in bytes * @type: One of the WMFW_CTL_TYPE_ control types defined in wmfw.h * @flags: Bitfield of WMFW_CTL_FLAG_ control flags defined in wmfw.h * @set: Flag indicating the value has been written by the user * @enabled: Flag indicating whether control is enabled * @alg_region: Logical region associated with this control * @priv: For use by the client
*/ struct cs_dsp_coeff_ctl { struct list_head list; struct cs_dsp *dsp; void *cache; constchar *fw_name; /* Subname is needed to match with firmware */ constchar *subname; unsignedint subname_len; unsignedint offset;
size_t len; unsignedint type; unsignedint flags; unsignedint set:1; unsignedint enabled:1; struct cs_dsp_alg_region alg_region;
void *priv;
};
struct cs_dsp_ops; struct cs_dsp_client_ops;
/** * struct cs_dsp - Configuration and state of a Cirrus Logic DSP * @name: The name of the DSP instance * @rev: Revision of the DSP * @num: DSP instance number * @type: Type of DSP * @dev: Driver model representation of the device * @regmap: Register map of the device * @ops: Function pointers for internal callbacks * @client_ops: Function pointers for client callbacks * @base: Address of the DSP registers * @base_sysinfo: Address of the sysinfo register (Halo only) * @sysclk_reg: Address of the sysclk register (ADSP1 only) * @sysclk_mask: Mask of frequency bits within sysclk register (ADSP1 only) * @sysclk_shift: Shift of frequency bits within sysclk register (ADSP1 only) * @alg_regions: List of currently loaded algorithm regions * @fw_name: Name of the current firmware * @fw_id: ID of the current firmware, obtained from the wmfw * @fw_id_version: Version of the firmware, obtained from the wmfw * @fw_vendor_id: Vendor of the firmware, obtained from the wmfw * @mem: DSP memory region descriptions * @num_mems: Number of memory regions in this DSP * @fw_ver: Version of the wmfw file format * @booted: Flag indicating DSP has been configured * @running: Flag indicating DSP is executing firmware * @ctl_list: Controls defined within the loaded DSP firmware * @lock_regions: Enable MPU traps on specified memory regions * @pwr_lock: Lock used to serialize accesses * @debugfs_root: Debugfs directory for this DSP instance * @wmfw_file_name: Filename of the currently loaded firmware * @bin_file_name: Filename of the currently loaded coefficients
*/ struct cs_dsp { constchar *name; int rev; int num; int type; struct device *dev; struct regmap *regmap;
/** * struct cs_dsp_client_ops - client callbacks * @control_add: Called under the pwr_lock when a control is created * @control_remove: Called under the pwr_lock when a control is destroyed * @pre_run: Called under the pwr_lock by cs_dsp_run() before the core is started * @post_run: Called under the pwr_lock by cs_dsp_run() after the core is started * @pre_stop: Called under the pwr_lock by cs_dsp_stop() before the core is stopped * @post_stop: Called under the pwr_lock by cs_dsp_stop() after the core is stopped * @watchdog_expired: Called when a watchdog expiry is detected * * These callbacks give the cs_dsp client an opportunity to respond to events * or to perform actions atomically.
*/ struct cs_dsp_client_ops { int (*control_add)(struct cs_dsp_coeff_ctl *ctl); void (*control_remove)(struct cs_dsp_coeff_ctl *ctl); int (*pre_run)(struct cs_dsp *dsp); int (*post_run)(struct cs_dsp *dsp); void (*pre_stop)(struct cs_dsp *dsp); void (*post_stop)(struct cs_dsp *dsp); void (*watchdog_expired)(struct cs_dsp *dsp);
};
int cs_dsp_adsp1_init(struct cs_dsp *dsp); int cs_dsp_adsp2_init(struct cs_dsp *dsp); int cs_dsp_halo_init(struct cs_dsp *dsp);
int cs_dsp_wseq_init(struct cs_dsp *dsp, struct cs_dsp_wseq *wseqs, unsignedint num_wseqs); int cs_dsp_wseq_write(struct cs_dsp *dsp, struct cs_dsp_wseq *wseq, u32 addr, u32 data,
u8 op_code, bool update); int cs_dsp_wseq_multi_write(struct cs_dsp *dsp, struct cs_dsp_wseq *wseq, conststruct reg_sequence *reg_seq, int num_regs,
u8 op_code, bool update);
/** * struct cs_dsp_chunk - Describes a buffer holding data formatted for the DSP * @data: Pointer to underlying buffer memory * @max: Pointer to end of the buffer memory * @bytes: Number of bytes read/written into the memory chunk * @cache: Temporary holding data as it is formatted * @cachebits: Number of bits of data currently in cache
*/ struct cs_dsp_chunk {
u8 *data;
u8 *max; int bytes;
u32 cache; int cachebits;
};
/** * cs_dsp_chunk() - Create a DSP memory chunk * @data: Pointer to the buffer that will be used to store data * @size: Size of the buffer in bytes * * Return: A cs_dsp_chunk structure
*/ staticinlinestruct cs_dsp_chunk cs_dsp_chunk(void *data, int size)
{ struct cs_dsp_chunk ch = {
.data = data,
.max = data + size,
};
return ch;
}
/** * cs_dsp_chunk_end() - Check if a DSP memory chunk is full * @ch: Pointer to the chunk structure * * Return: True if the whole buffer has been read/written
*/ staticinlinebool cs_dsp_chunk_end(struct cs_dsp_chunk *ch)
{ return ch->data == ch->max;
}
/** * cs_dsp_chunk_bytes() - Number of bytes written/read from a DSP memory chunk * @ch: Pointer to the chunk structure * * Return: Number of bytes read/written to the buffer
*/ staticinlineint cs_dsp_chunk_bytes(struct cs_dsp_chunk *ch)
{ return ch->bytes;
}
/** * cs_dsp_chunk_valid_addr() - Check if an address is in a DSP memory chunk * @ch: Pointer to the chunk structure * * Return: True if the given address is within the buffer
*/ staticinlinebool cs_dsp_chunk_valid_addr(struct cs_dsp_chunk *ch, void *addr)
{ return (u8 *)addr >= ch->data && (u8 *)addr < ch->max;
}
int cs_dsp_chunk_write(struct cs_dsp_chunk *ch, int nbits, u32 val); int cs_dsp_chunk_flush(struct cs_dsp_chunk *ch); int cs_dsp_chunk_read(struct cs_dsp_chunk *ch, int nbits);
#endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.