18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * mpc8610-pcm.h - ALSA PCM interface for the Freescale MPC8610 SoC 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _MPC8610_PCM_H 78c2ecf20Sopenharmony_ci#define _MPC8610_PCM_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cistruct ccsr_dma { 108c2ecf20Sopenharmony_ci u8 res0[0x100]; 118c2ecf20Sopenharmony_ci struct ccsr_dma_channel { 128c2ecf20Sopenharmony_ci __be32 mr; /* Mode register */ 138c2ecf20Sopenharmony_ci __be32 sr; /* Status register */ 148c2ecf20Sopenharmony_ci __be32 eclndar; /* Current link descriptor extended addr reg */ 158c2ecf20Sopenharmony_ci __be32 clndar; /* Current link descriptor address register */ 168c2ecf20Sopenharmony_ci __be32 satr; /* Source attributes register */ 178c2ecf20Sopenharmony_ci __be32 sar; /* Source address register */ 188c2ecf20Sopenharmony_ci __be32 datr; /* Destination attributes register */ 198c2ecf20Sopenharmony_ci __be32 dar; /* Destination address register */ 208c2ecf20Sopenharmony_ci __be32 bcr; /* Byte count register */ 218c2ecf20Sopenharmony_ci __be32 enlndar; /* Next link descriptor extended address reg */ 228c2ecf20Sopenharmony_ci __be32 nlndar; /* Next link descriptor address register */ 238c2ecf20Sopenharmony_ci u8 res1[4]; 248c2ecf20Sopenharmony_ci __be32 eclsdar; /* Current list descriptor extended addr reg */ 258c2ecf20Sopenharmony_ci __be32 clsdar; /* Current list descriptor address register */ 268c2ecf20Sopenharmony_ci __be32 enlsdar; /* Next list descriptor extended address reg */ 278c2ecf20Sopenharmony_ci __be32 nlsdar; /* Next list descriptor address register */ 288c2ecf20Sopenharmony_ci __be32 ssr; /* Source stride register */ 298c2ecf20Sopenharmony_ci __be32 dsr; /* Destination stride register */ 308c2ecf20Sopenharmony_ci u8 res2[0x38]; 318c2ecf20Sopenharmony_ci } channel[4]; 328c2ecf20Sopenharmony_ci __be32 dgsr; 338c2ecf20Sopenharmony_ci}; 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_BWC_DISABLED 0x0F000000 368c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_BWC_SHIFT 24 378c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_BWC_MASK 0x0F000000 388c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_BWC(x) \ 398c2ecf20Sopenharmony_ci ((ilog2(x) << CCSR_DMA_MR_BWC_SHIFT) & CCSR_DMA_MR_BWC_MASK) 408c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_EMP_EN 0x00200000 418c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_EMS_EN 0x00040000 428c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_DAHTS_MASK 0x00030000 438c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_DAHTS_1 0x00000000 448c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_DAHTS_2 0x00010000 458c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_DAHTS_4 0x00020000 468c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_DAHTS_8 0x00030000 478c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_SAHTS_MASK 0x0000C000 488c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_SAHTS_1 0x00000000 498c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_SAHTS_2 0x00004000 508c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_SAHTS_4 0x00008000 518c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_SAHTS_8 0x0000C000 528c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_DAHE 0x00002000 538c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_SAHE 0x00001000 548c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_SRW 0x00000400 558c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_EOSIE 0x00000200 568c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_EOLNIE 0x00000100 578c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_EOLSIE 0x00000080 588c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_EIE 0x00000040 598c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_XFE 0x00000020 608c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_CDSM_SWSM 0x00000010 618c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_CA 0x00000008 628c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_CTM 0x00000004 638c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_CC 0x00000002 648c2ecf20Sopenharmony_ci#define CCSR_DMA_MR_CS 0x00000001 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci#define CCSR_DMA_SR_TE 0x00000080 678c2ecf20Sopenharmony_ci#define CCSR_DMA_SR_CH 0x00000020 688c2ecf20Sopenharmony_ci#define CCSR_DMA_SR_PE 0x00000010 698c2ecf20Sopenharmony_ci#define CCSR_DMA_SR_EOLNI 0x00000008 708c2ecf20Sopenharmony_ci#define CCSR_DMA_SR_CB 0x00000004 718c2ecf20Sopenharmony_ci#define CCSR_DMA_SR_EOSI 0x00000002 728c2ecf20Sopenharmony_ci#define CCSR_DMA_SR_EOLSI 0x00000001 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci/* ECLNDAR takes bits 32-36 of the CLNDAR register */ 758c2ecf20Sopenharmony_cistatic inline u32 CCSR_DMA_ECLNDAR_ADDR(u64 x) 768c2ecf20Sopenharmony_ci{ 778c2ecf20Sopenharmony_ci return (x >> 32) & 0xf; 788c2ecf20Sopenharmony_ci} 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci#define CCSR_DMA_CLNDAR_ADDR(x) ((x) & 0xFFFFFFFE) 818c2ecf20Sopenharmony_ci#define CCSR_DMA_CLNDAR_EOSIE 0x00000008 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci/* SATR and DATR, combined */ 848c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_PBATMU 0x20000000 858c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_TFLOWLVL_0 0x00000000 868c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_TFLOWLVL_1 0x06000000 878c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_TFLOWLVL_2 0x08000000 888c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_TFLOWLVL_3 0x0C000000 898c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_PCIORDER 0x02000000 908c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_SME 0x01000000 918c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_NOSNOOP 0x00040000 928c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_SNOOP 0x00050000 938c2ecf20Sopenharmony_ci#define CCSR_DMA_ATR_ESAD_MASK 0x0000000F 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci/** 968c2ecf20Sopenharmony_ci * List Descriptor for extended chaining mode DMA operations. 978c2ecf20Sopenharmony_ci * 988c2ecf20Sopenharmony_ci * The CLSDAR register points to the first (in a linked-list) List 998c2ecf20Sopenharmony_ci * Descriptor. Each object must be aligned on a 32-byte boundary. Each 1008c2ecf20Sopenharmony_ci * list descriptor points to a linked-list of link Descriptors. 1018c2ecf20Sopenharmony_ci */ 1028c2ecf20Sopenharmony_cistruct fsl_dma_list_descriptor { 1038c2ecf20Sopenharmony_ci __be64 next; /* Address of next list descriptor */ 1048c2ecf20Sopenharmony_ci __be64 first_link; /* Address of first link descriptor */ 1058c2ecf20Sopenharmony_ci __be32 source; /* Source stride */ 1068c2ecf20Sopenharmony_ci __be32 dest; /* Destination stride */ 1078c2ecf20Sopenharmony_ci u8 res[8]; /* Reserved */ 1088c2ecf20Sopenharmony_ci} __attribute__ ((aligned(32), packed)); 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci/** 1118c2ecf20Sopenharmony_ci * Link Descriptor for basic and extended chaining mode DMA operations. 1128c2ecf20Sopenharmony_ci * 1138c2ecf20Sopenharmony_ci * A Link Descriptor points to a single DMA buffer. Each link descriptor 1148c2ecf20Sopenharmony_ci * must be aligned on a 32-byte boundary. 1158c2ecf20Sopenharmony_ci */ 1168c2ecf20Sopenharmony_cistruct fsl_dma_link_descriptor { 1178c2ecf20Sopenharmony_ci __be32 source_attr; /* Programmed into SATR register */ 1188c2ecf20Sopenharmony_ci __be32 source_addr; /* Programmed into SAR register */ 1198c2ecf20Sopenharmony_ci __be32 dest_attr; /* Programmed into DATR register */ 1208c2ecf20Sopenharmony_ci __be32 dest_addr; /* Programmed into DAR register */ 1218c2ecf20Sopenharmony_ci __be64 next; /* Address of next link descriptor */ 1228c2ecf20Sopenharmony_ci __be32 count; /* Byte count */ 1238c2ecf20Sopenharmony_ci u8 res[4]; /* Reserved */ 1248c2ecf20Sopenharmony_ci} __attribute__ ((aligned(32), packed)); 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci#endif 127