18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * include/asm/sunbpp.h 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _ASM_SPARC_SUNBPP_H 78c2ecf20Sopenharmony_ci#define _ASM_SPARC_SUNBPP_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cistruct bpp_regs { 108c2ecf20Sopenharmony_ci /* DMA registers */ 118c2ecf20Sopenharmony_ci __volatile__ __u32 p_csr; /* DMA Control/Status Register */ 128c2ecf20Sopenharmony_ci __volatile__ __u32 p_addr; /* Address Register */ 138c2ecf20Sopenharmony_ci __volatile__ __u32 p_bcnt; /* Byte Count Register */ 148c2ecf20Sopenharmony_ci __volatile__ __u32 p_tst_csr; /* Test Control/Status (DMA2 only) */ 158c2ecf20Sopenharmony_ci /* Parallel Port registers */ 168c2ecf20Sopenharmony_ci __volatile__ __u16 p_hcr; /* Hardware Configuration Register */ 178c2ecf20Sopenharmony_ci __volatile__ __u16 p_ocr; /* Operation Configuration Register */ 188c2ecf20Sopenharmony_ci __volatile__ __u8 p_dr; /* Parallel Data Register */ 198c2ecf20Sopenharmony_ci __volatile__ __u8 p_tcr; /* Transfer Control Register */ 208c2ecf20Sopenharmony_ci __volatile__ __u8 p_or; /* Output Register */ 218c2ecf20Sopenharmony_ci __volatile__ __u8 p_ir; /* Input Register */ 228c2ecf20Sopenharmony_ci __volatile__ __u16 p_icr; /* Interrupt Control Register */ 238c2ecf20Sopenharmony_ci}; 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* P_HCR. Time is in increments of SBus clock. */ 268c2ecf20Sopenharmony_ci#define P_HCR_TEST 0x8000 /* Allows buried counters to be read */ 278c2ecf20Sopenharmony_ci#define P_HCR_DSW 0x7f00 /* Data strobe width (in ticks) */ 288c2ecf20Sopenharmony_ci#define P_HCR_DDS 0x007f /* Data setup before strobe (in ticks) */ 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* P_OCR. */ 318c2ecf20Sopenharmony_ci#define P_OCR_MEM_CLR 0x8000 328c2ecf20Sopenharmony_ci#define P_OCR_DATA_SRC 0x4000 /* ) */ 338c2ecf20Sopenharmony_ci#define P_OCR_DS_DSEL 0x2000 /* ) Bidirectional */ 348c2ecf20Sopenharmony_ci#define P_OCR_BUSY_DSEL 0x1000 /* ) selects */ 358c2ecf20Sopenharmony_ci#define P_OCR_ACK_DSEL 0x0800 /* ) */ 368c2ecf20Sopenharmony_ci#define P_OCR_EN_DIAG 0x0400 378c2ecf20Sopenharmony_ci#define P_OCR_BUSY_OP 0x0200 /* Busy operation */ 388c2ecf20Sopenharmony_ci#define P_OCR_ACK_OP 0x0100 /* Ack operation */ 398c2ecf20Sopenharmony_ci#define P_OCR_SRST 0x0080 /* Reset state machines. Not selfcleaning. */ 408c2ecf20Sopenharmony_ci#define P_OCR_IDLE 0x0008 /* PP data transfer state machine is idle */ 418c2ecf20Sopenharmony_ci#define P_OCR_V_ILCK 0x0002 /* Versatec faded. Zebra only. */ 428c2ecf20Sopenharmony_ci#define P_OCR_EN_VER 0x0001 /* Enable Versatec (0 - enable). Zebra only. */ 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci/* P_TCR */ 458c2ecf20Sopenharmony_ci#define P_TCR_DIR 0x08 468c2ecf20Sopenharmony_ci#define P_TCR_BUSY 0x04 478c2ecf20Sopenharmony_ci#define P_TCR_ACK 0x02 488c2ecf20Sopenharmony_ci#define P_TCR_DS 0x01 /* Strobe */ 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci/* P_OR */ 518c2ecf20Sopenharmony_ci#define P_OR_V3 0x20 /* ) */ 528c2ecf20Sopenharmony_ci#define P_OR_V2 0x10 /* ) on Zebra only */ 538c2ecf20Sopenharmony_ci#define P_OR_V1 0x08 /* ) */ 548c2ecf20Sopenharmony_ci#define P_OR_INIT 0x04 558c2ecf20Sopenharmony_ci#define P_OR_AFXN 0x02 /* Auto Feed */ 568c2ecf20Sopenharmony_ci#define P_OR_SLCT_IN 0x01 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci/* P_IR */ 598c2ecf20Sopenharmony_ci#define P_IR_PE 0x04 608c2ecf20Sopenharmony_ci#define P_IR_SLCT 0x02 618c2ecf20Sopenharmony_ci#define P_IR_ERR 0x01 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci/* P_ICR */ 648c2ecf20Sopenharmony_ci#define P_DS_IRQ 0x8000 /* RW1 */ 658c2ecf20Sopenharmony_ci#define P_ACK_IRQ 0x4000 /* RW1 */ 668c2ecf20Sopenharmony_ci#define P_BUSY_IRQ 0x2000 /* RW1 */ 678c2ecf20Sopenharmony_ci#define P_PE_IRQ 0x1000 /* RW1 */ 688c2ecf20Sopenharmony_ci#define P_SLCT_IRQ 0x0800 /* RW1 */ 698c2ecf20Sopenharmony_ci#define P_ERR_IRQ 0x0400 /* RW1 */ 708c2ecf20Sopenharmony_ci#define P_DS_IRQ_EN 0x0200 /* RW Always on rising edge */ 718c2ecf20Sopenharmony_ci#define P_ACK_IRQ_EN 0x0100 /* RW Always on rising edge */ 728c2ecf20Sopenharmony_ci#define P_BUSY_IRP 0x0080 /* RW 1= rising edge */ 738c2ecf20Sopenharmony_ci#define P_BUSY_IRQ_EN 0x0040 /* RW */ 748c2ecf20Sopenharmony_ci#define P_PE_IRP 0x0020 /* RW 1= rising edge */ 758c2ecf20Sopenharmony_ci#define P_PE_IRQ_EN 0x0010 /* RW */ 768c2ecf20Sopenharmony_ci#define P_SLCT_IRP 0x0008 /* RW 1= rising edge */ 778c2ecf20Sopenharmony_ci#define P_SLCT_IRQ_EN 0x0004 /* RW */ 788c2ecf20Sopenharmony_ci#define P_ERR_IRP 0x0002 /* RW1 1= rising edge */ 798c2ecf20Sopenharmony_ci#define P_ERR_IRQ_EN 0x0001 /* RW */ 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci#endif /* !(_ASM_SPARC_SUNBPP_H) */ 82