/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Internal header file for UCC FAST unit routines. * * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. * * Authors: Shlomi Gridish <gridish@freescale.com> * Li Yang <leoli@freescale.com>
*/ #ifndef __UCC_FAST_H__ #define __UCC_FAST_H__
/* Rx Data buffer must be 4 bytes aligned in most cases */ #define UCC_FAST_RX_ALIGN 4 #define UCC_FAST_MRBLR_ALIGNMENT 4 #define UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT 8
/* Fast UCC initialization structure */ struct ucc_fast_info { int ucc_num; int tdm_num; enum qe_clock rx_clock; enum qe_clock tx_clock; enum qe_clock rx_sync; enum qe_clock tx_sync;
resource_size_t regs; int irq;
u32 uccm_mask; int brkpt_support; int grant_support; int tsa; int cdp; int cds; int ctsp; int ctss; int tci; int txsy; int rtsm; int revd; int rsyn;
u16 max_rx_buf_length;
u16 urfs;
u16 urfet;
u16 urfset;
u16 utfs;
u16 utfet;
u16 utftt;
u16 ufpt; enum ucc_fast_channel_protocol_mode mode; enum ucc_fast_transparent_txrx ttx_trx; enum ucc_fast_tx_encoding_method tenc; enum ucc_fast_rx_decoding_method renc; enum ucc_fast_transparent_tcrc tcrc; enum ucc_fast_sync_len synl;
};
struct ucc_fast_private { struct ucc_fast_info *uf_info; struct ucc_fast __iomem *uf_regs; /* a pointer to the UCC regs. */
__be32 __iomem *p_ucce; /* a pointer to the event register in memory. */
__be32 __iomem *p_uccm; /* a pointer to the mask register in memory. */ #ifdef CONFIG_UGETH_TX_ON_DEMAND
__be16 __iomem *p_utodr;/* pointer to the transmit on demand register */ #endif int enabled_tx; /* Whether channel is enabled for Tx (ENT) */ int enabled_rx; /* Whether channel is enabled for Rx (ENR) */ int stopped_tx; /* Whether channel has been stopped for Tx
(STOP_TX, etc.) */ int stopped_rx; /* Whether channel has been stopped for Rx */
s32 ucc_fast_tx_virtual_fifo_base_offset;/* pointer to base of Tx
virtual fifo */
s32 ucc_fast_rx_virtual_fifo_base_offset;/* pointer to base of Rx
virtual fifo */ #ifdef STATISTICS
u32 tx_frames; /* Transmitted frames counter. */
u32 rx_frames; /* Received frames counter (only frames
passed to application). */
u32 tx_discarded; /* Discarded tx frames counter (frames that were discarded by the driver due to errors).
*/
u32 rx_discarded; /* Discarded rx frames counter (frames that were discarded by the driver due to errors).
*/ #endif/* STATISTICS */
u16 mrblr; /* maximum receive buffer length */
};
/* ucc_fast_init * Initializes Fast UCC according to user provided parameters. * * uf_info - (In) pointer to the fast UCC info structure. * uccf_ret - (Out) pointer to the fast UCC structure.
*/ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** uccf_ret);
/* ucc_fast_free * Frees all resources for fast UCC. * * uccf - (In) pointer to the fast UCC structure.
*/ void ucc_fast_free(struct ucc_fast_private * uccf);
/* ucc_fast_enable * Enables a fast UCC port. * This routine enables Tx and/or Rx through the General UCC Mode Register. * * uccf - (In) pointer to the fast UCC structure. * mode - (In) TX, RX, or both.
*/ void ucc_fast_enable(struct ucc_fast_private * uccf, enum comm_dir mode);
/* ucc_fast_disable * Disables a fast UCC port. * This routine disables Tx and/or Rx through the General UCC Mode Register. * * uccf - (In) pointer to the fast UCC structure. * mode - (In) TX, RX, or both.
*/ void ucc_fast_disable(struct ucc_fast_private * uccf, enum comm_dir mode);
/* ucc_fast_irq * Handles interrupts on fast UCC. * Called from the general interrupt routine to handle interrupts on fast UCC. * * uccf - (In) pointer to the fast UCC structure.
*/ void ucc_fast_irq(struct ucc_fast_private * uccf);
/* ucc_fast_transmit_on_demand * Immediately forces a poll of the transmitter for data to be sent. * Typically, the hardware performs a periodic poll for data that the * transmit routine has set up to be transmitted. In cases where * this polling cycle is not soon enough, this optional routine can * be invoked to force a poll right away, instead. Proper use for * each transmission for which this functionality is desired is to * call the transmit routine and then this routine right after. * * uccf - (In) pointer to the fast UCC structure.
*/ void ucc_fast_transmit_on_demand(struct ucc_fast_private * uccf);
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.