/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. * * Authors: Shlomi Gridish <[email protected]> * Li Yang <[email protected]> * * Description: * Internal header file for UCC SLOW unit routines. */ #ifndef __UCC_SLOW_H__ #define __UCC_SLOW_H__ #include <linux/types.h> #include <soc/fsl/qe/immap_qe.h> #include <soc/fsl/qe/qe.h> #include <soc/fsl/qe/ucc.h> /* transmit BD's status */ #define T_R … #define T_PAD … #define T_W … #define T_I … #define T_L … #define T_A … #define T_TC … #define T_CM … #define T_DEF … #define T_P … #define T_HB … #define T_NS … #define T_LC … #define T_RL … #define T_UN … #define T_CT … #define T_CSL … #define T_RC … /* Receive BD's status */ #define R_E … #define R_W … #define R_I … #define R_L … #define R_C … #define R_F … #define R_A … #define R_CM … #define R_ID … #define R_M … #define R_AM … #define R_DE … #define R_LG … #define R_BR … #define R_NO … #define R_FR … #define R_PR … #define R_AB … #define R_SH … #define R_CR … #define R_OV … #define R_CD … #define R_CL … /* Rx Data buffer must be 4 bytes aligned in most cases.*/ #define UCC_SLOW_RX_ALIGN … #define UCC_SLOW_MRBLR_ALIGNMENT … #define UCC_SLOW_PRAM_SIZE … #define ALIGNMENT_OF_UCC_SLOW_PRAM … /* UCC Slow Channel Protocol Mode */ enum ucc_slow_channel_protocol_mode { … }; /* UCC Slow Transparent Transmit CRC (TCRC) */ enum ucc_slow_transparent_tcrc { … }; /* UCC Slow oversampling rate for transmitter (TDCR) */ enum ucc_slow_tx_oversampling_rate { … }; /* UCC Slow Oversampling rate for receiver (RDCR) */ enum ucc_slow_rx_oversampling_rate { … }; /* UCC Slow Transmitter encoding method (TENC) */ enum ucc_slow_tx_encoding_method { … }; /* UCC Slow Receiver decoding method (RENC) */ enum ucc_slow_rx_decoding_method { … }; /* UCC Slow Diagnostic mode (DIAG) */ enum ucc_slow_diag_mode { … }; struct ucc_slow_info { … }; struct ucc_slow_private { … }; /* ucc_slow_init * Initializes Slow UCC according to provided parameters. * * us_info - (In) pointer to the slow UCC info structure. * uccs_ret - (Out) pointer to the slow UCC structure. */ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** uccs_ret); /* ucc_slow_free * Frees all resources for slow UCC. * * uccs - (In) pointer to the slow UCC structure. */ void ucc_slow_free(struct ucc_slow_private * uccs); /* ucc_slow_enable * Enables a fast UCC port. * This routine enables Tx and/or Rx through the General UCC Mode Register. * * uccs - (In) pointer to the slow UCC structure. * mode - (In) TX, RX, or both. */ void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode); /* ucc_slow_disable * Disables a fast UCC port. * This routine disables Tx and/or Rx through the General UCC Mode Register. * * uccs - (In) pointer to the slow UCC structure. * mode - (In) TX, RX, or both. */ void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode); /* ucc_slow_graceful_stop_tx * Smoothly stops transmission on a specified slow UCC. * * uccs - (In) pointer to the slow UCC structure. */ void ucc_slow_graceful_stop_tx(struct ucc_slow_private * uccs); /* ucc_slow_stop_tx * Stops transmission on a specified slow UCC. * * uccs - (In) pointer to the slow UCC structure. */ void ucc_slow_stop_tx(struct ucc_slow_private * uccs); /* ucc_slow_restart_tx * Restarts transmitting on a specified slow UCC. * * uccs - (In) pointer to the slow UCC structure. */ void ucc_slow_restart_tx(struct ucc_slow_private *uccs); u32 ucc_slow_get_qe_cr_subblock(int uccs_num); #endif /* __UCC_SLOW_H__ */