18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Definitions for TX4937/TX4938
38c2ecf20Sopenharmony_ci * Copyright (C) 2000-2001 Toshiba Corporation
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
68c2ecf20Sopenharmony_ci * terms of the GNU General Public License version 2. This program is
78c2ecf20Sopenharmony_ci * licensed "as is" without any warranty of any kind, whether express
88c2ecf20Sopenharmony_ci * or implied.
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#ifndef __ASM_TXX9_TX4938_H
138c2ecf20Sopenharmony_ci#define __ASM_TXX9_TX4938_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* some controllers are compatible with 4927 */
168c2ecf20Sopenharmony_ci#include <asm/txx9/tx4927.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#ifdef CONFIG_64BIT
198c2ecf20Sopenharmony_ci#define TX4938_REG_BASE 0xffffffffff1f0000UL /* == TX4937_REG_BASE */
208c2ecf20Sopenharmony_ci#else
218c2ecf20Sopenharmony_ci#define TX4938_REG_BASE 0xff1f0000UL /* == TX4937_REG_BASE */
228c2ecf20Sopenharmony_ci#endif
238c2ecf20Sopenharmony_ci#define TX4938_REG_SIZE 0x00010000 /* == TX4937_REG_SIZE */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/* NDFMC, SRAMC, PCIC1, SPIC: TX4938 only */
268c2ecf20Sopenharmony_ci#define TX4938_NDFMC_REG	(TX4938_REG_BASE + 0x5000)
278c2ecf20Sopenharmony_ci#define TX4938_SRAMC_REG	(TX4938_REG_BASE + 0x6000)
288c2ecf20Sopenharmony_ci#define TX4938_PCIC1_REG	(TX4938_REG_BASE + 0x7000)
298c2ecf20Sopenharmony_ci#define TX4938_SDRAMC_REG	(TX4938_REG_BASE + 0x8000)
308c2ecf20Sopenharmony_ci#define TX4938_EBUSC_REG	(TX4938_REG_BASE + 0x9000)
318c2ecf20Sopenharmony_ci#define TX4938_DMA_REG(ch)	(TX4938_REG_BASE + 0xb000 + (ch) * 0x800)
328c2ecf20Sopenharmony_ci#define TX4938_PCIC_REG		(TX4938_REG_BASE + 0xd000)
338c2ecf20Sopenharmony_ci#define TX4938_CCFG_REG		(TX4938_REG_BASE + 0xe000)
348c2ecf20Sopenharmony_ci#define TX4938_NR_TMR	3
358c2ecf20Sopenharmony_ci#define TX4938_TMR_REG(ch)	((TX4938_REG_BASE + 0xf000) + (ch) * 0x100)
368c2ecf20Sopenharmony_ci#define TX4938_NR_SIO	2
378c2ecf20Sopenharmony_ci#define TX4938_SIO_REG(ch)	((TX4938_REG_BASE + 0xf300) + (ch) * 0x100)
388c2ecf20Sopenharmony_ci#define TX4938_PIO_REG		(TX4938_REG_BASE + 0xf500)
398c2ecf20Sopenharmony_ci#define TX4938_IRC_REG		(TX4938_REG_BASE + 0xf600)
408c2ecf20Sopenharmony_ci#define TX4938_ACLC_REG		(TX4938_REG_BASE + 0xf700)
418c2ecf20Sopenharmony_ci#define TX4938_SPI_REG		(TX4938_REG_BASE + 0xf800)
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_cistruct tx4938_sramc_reg {
448c2ecf20Sopenharmony_ci	u64 cr;
458c2ecf20Sopenharmony_ci};
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_cistruct tx4938_ccfg_reg {
488c2ecf20Sopenharmony_ci	u64 ccfg;
498c2ecf20Sopenharmony_ci	u64 crir;
508c2ecf20Sopenharmony_ci	u64 pcfg;
518c2ecf20Sopenharmony_ci	u64 toea;
528c2ecf20Sopenharmony_ci	u64 clkctr;
538c2ecf20Sopenharmony_ci	u64 unused0;
548c2ecf20Sopenharmony_ci	u64 garbc;
558c2ecf20Sopenharmony_ci	u64 unused1;
568c2ecf20Sopenharmony_ci	u64 unused2;
578c2ecf20Sopenharmony_ci	u64 ramp;
588c2ecf20Sopenharmony_ci	u64 unused3;
598c2ecf20Sopenharmony_ci	u64 jmpadr;
608c2ecf20Sopenharmony_ci};
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci/*
638c2ecf20Sopenharmony_ci * IRC
648c2ecf20Sopenharmony_ci */
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci#define TX4938_IR_ECCERR	0
678c2ecf20Sopenharmony_ci#define TX4938_IR_WTOERR	1
688c2ecf20Sopenharmony_ci#define TX4938_NUM_IR_INT	6
698c2ecf20Sopenharmony_ci#define TX4938_IR_INT(n)	(2 + (n))
708c2ecf20Sopenharmony_ci#define TX4938_NUM_IR_SIO	2
718c2ecf20Sopenharmony_ci#define TX4938_IR_SIO(n)	(8 + (n))
728c2ecf20Sopenharmony_ci#define TX4938_NUM_IR_DMA	4
738c2ecf20Sopenharmony_ci#define TX4938_IR_DMA(ch, n)	((ch ? 27 : 10) + (n)) /* 10-13, 27-30 */
748c2ecf20Sopenharmony_ci#define TX4938_IR_PIO	14
758c2ecf20Sopenharmony_ci#define TX4938_IR_PDMAC 15
768c2ecf20Sopenharmony_ci#define TX4938_IR_PCIC	16
778c2ecf20Sopenharmony_ci#define TX4938_NUM_IR_TMR	3
788c2ecf20Sopenharmony_ci#define TX4938_IR_TMR(n)	(17 + (n))
798c2ecf20Sopenharmony_ci#define TX4938_IR_NDFMC 21
808c2ecf20Sopenharmony_ci#define TX4938_IR_PCIERR	22
818c2ecf20Sopenharmony_ci#define TX4938_IR_PCIPME	23
828c2ecf20Sopenharmony_ci#define TX4938_IR_ACLC	24
838c2ecf20Sopenharmony_ci#define TX4938_IR_ACLCPME	25
848c2ecf20Sopenharmony_ci#define TX4938_IR_PCIC1 26
858c2ecf20Sopenharmony_ci#define TX4938_IR_SPI	31
868c2ecf20Sopenharmony_ci#define TX4938_NUM_IR	32
878c2ecf20Sopenharmony_ci/* multiplex */
888c2ecf20Sopenharmony_ci#define TX4938_IR_ETH0	TX4938_IR_INT(4)
898c2ecf20Sopenharmony_ci#define TX4938_IR_ETH1	TX4938_IR_INT(3)
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define TX4938_IRC_INT	2	/* IP[2] in Status register */
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define TX4938_NUM_PIO	16
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci/*
968c2ecf20Sopenharmony_ci * CCFG
978c2ecf20Sopenharmony_ci */
988c2ecf20Sopenharmony_ci/* CCFG : Chip Configuration */
998c2ecf20Sopenharmony_ci#define TX4938_CCFG_WDRST	0x0000020000000000ULL
1008c2ecf20Sopenharmony_ci#define TX4938_CCFG_WDREXEN	0x0000010000000000ULL
1018c2ecf20Sopenharmony_ci#define TX4938_CCFG_BCFG_MASK	0x000000ff00000000ULL
1028c2ecf20Sopenharmony_ci#define TX4938_CCFG_TINTDIS	0x01000000
1038c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCI66	0x00800000
1048c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIMODE	0x00400000
1058c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCI1_66	0x00200000
1068c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_MASK	0x001e0000
1078c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_2	(0x4 << 17)
1088c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_2_5 (0xf << 17)
1098c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_3	(0x5 << 17)
1108c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_4	(0x6 << 17)
1118c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_4_5 (0xd << 17)
1128c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_8	(0x0 << 17)
1138c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_10	(0xb << 17)
1148c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_12	(0x1 << 17)
1158c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_16	(0x2 << 17)
1168c2ecf20Sopenharmony_ci#define TX4938_CCFG_DIVMODE_18	(0x9 << 17)
1178c2ecf20Sopenharmony_ci#define TX4938_CCFG_BEOW	0x00010000
1188c2ecf20Sopenharmony_ci#define TX4938_CCFG_WR	0x00008000
1198c2ecf20Sopenharmony_ci#define TX4938_CCFG_TOE 0x00004000
1208c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIARB	0x00002000
1218c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_MASK	0x00001c00
1228c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_4	(0x1 << 10)
1238c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_4_5	(0x3 << 10)
1248c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_5	(0x5 << 10)
1258c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_5_5	(0x7 << 10)
1268c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_8	(0x0 << 10)
1278c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_9	(0x2 << 10)
1288c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_10	(0x4 << 10)
1298c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCIDIVMODE_11	(0x6 << 10)
1308c2ecf20Sopenharmony_ci#define TX4938_CCFG_PCI1DMD	0x00000100
1318c2ecf20Sopenharmony_ci#define TX4938_CCFG_SYSSP_MASK	0x000000c0
1328c2ecf20Sopenharmony_ci#define TX4938_CCFG_ENDIAN	0x00000004
1338c2ecf20Sopenharmony_ci#define TX4938_CCFG_HALT	0x00000002
1348c2ecf20Sopenharmony_ci#define TX4938_CCFG_ACEHOLD	0x00000001
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci/* PCFG : Pin Configuration */
1378c2ecf20Sopenharmony_ci#define TX4938_PCFG_ETH0_SEL	0x8000000000000000ULL
1388c2ecf20Sopenharmony_ci#define TX4938_PCFG_ETH1_SEL	0x4000000000000000ULL
1398c2ecf20Sopenharmony_ci#define TX4938_PCFG_ATA_SEL	0x2000000000000000ULL
1408c2ecf20Sopenharmony_ci#define TX4938_PCFG_ISA_SEL	0x1000000000000000ULL
1418c2ecf20Sopenharmony_ci#define TX4938_PCFG_SPI_SEL	0x0800000000000000ULL
1428c2ecf20Sopenharmony_ci#define TX4938_PCFG_NDF_SEL	0x0400000000000000ULL
1438c2ecf20Sopenharmony_ci#define TX4938_PCFG_SDCLKDLY_MASK	0x30000000
1448c2ecf20Sopenharmony_ci#define TX4938_PCFG_SDCLKDLY(d) ((d)<<28)
1458c2ecf20Sopenharmony_ci#define TX4938_PCFG_SYSCLKEN	0x08000000
1468c2ecf20Sopenharmony_ci#define TX4938_PCFG_SDCLKEN_ALL 0x07800000
1478c2ecf20Sopenharmony_ci#define TX4938_PCFG_SDCLKEN(ch) (0x00800000<<(ch))
1488c2ecf20Sopenharmony_ci#define TX4938_PCFG_PCICLKEN_ALL	0x003f0000
1498c2ecf20Sopenharmony_ci#define TX4938_PCFG_PCICLKEN(ch)	(0x00010000<<(ch))
1508c2ecf20Sopenharmony_ci#define TX4938_PCFG_SEL2	0x00000200
1518c2ecf20Sopenharmony_ci#define TX4938_PCFG_SEL1	0x00000100
1528c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL_ALL	0x0000000f
1538c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL0_DRQ0	0x00000000
1548c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL0_SIO1	0x00000001
1558c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL1_DRQ1	0x00000000
1568c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL1_SIO1	0x00000002
1578c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL2_DRQ2	0x00000000
1588c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL2_SIO0	0x00000004
1598c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL3_DRQ3	0x00000000
1608c2ecf20Sopenharmony_ci#define TX4938_PCFG_DMASEL3_SIO0	0x00000008
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci/* CLKCTR : Clock Control */
1638c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_NDFCKD	0x0001000000000000ULL
1648c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_NDFRST	0x0000000100000000ULL
1658c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_ETH1CKD	0x80000000
1668c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_ETH0CKD	0x40000000
1678c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SPICKD	0x20000000
1688c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SRAMCKD	0x10000000
1698c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_PCIC1CKD	0x08000000
1708c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_DMA1CKD	0x04000000
1718c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_ACLCKD	0x02000000
1728c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_PIOCKD	0x01000000
1738c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_DMACKD	0x00800000
1748c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_PCICKD	0x00400000
1758c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_TM0CKD	0x00100000
1768c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_TM1CKD	0x00080000
1778c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_TM2CKD	0x00040000
1788c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SIO0CKD	0x00020000
1798c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SIO1CKD	0x00010000
1808c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_ETH1RST	0x00008000
1818c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_ETH0RST	0x00004000
1828c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SPIRST	0x00002000
1838c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SRAMRST	0x00001000
1848c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_PCIC1RST	0x00000800
1858c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_DMA1RST	0x00000400
1868c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_ACLRST	0x00000200
1878c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_PIORST	0x00000100
1888c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_DMARST	0x00000080
1898c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_PCIRST	0x00000040
1908c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_TM0RST	0x00000010
1918c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_TM1RST	0x00000008
1928c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_TM2RST	0x00000004
1938c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SIO0RST	0x00000002
1948c2ecf20Sopenharmony_ci#define TX4938_CLKCTR_SIO1RST	0x00000001
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci/*
1978c2ecf20Sopenharmony_ci * DMA
1988c2ecf20Sopenharmony_ci */
1998c2ecf20Sopenharmony_ci/* bits for MCR */
2008c2ecf20Sopenharmony_ci#define TX4938_DMA_MCR_EIS(ch)	(0x10000000<<(ch))
2018c2ecf20Sopenharmony_ci#define TX4938_DMA_MCR_DIS(ch)	(0x01000000<<(ch))
2028c2ecf20Sopenharmony_ci#define TX4938_DMA_MCR_RSFIF	0x00000080
2038c2ecf20Sopenharmony_ci#define TX4938_DMA_MCR_FIFUM(ch)	(0x00000008<<(ch))
2048c2ecf20Sopenharmony_ci#define TX4938_DMA_MCR_RPRT	0x00000002
2058c2ecf20Sopenharmony_ci#define TX4938_DMA_MCR_MSTEN	0x00000001
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/* bits for CCRn */
2088c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_IMMCHN	0x20000000
2098c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_USEXFSZ	0x10000000
2108c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_LE	0x08000000
2118c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_DBINH	0x04000000
2128c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_SBINH	0x02000000
2138c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_CHRST	0x01000000
2148c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_RVBYTE	0x00800000
2158c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_ACKPOL	0x00400000
2168c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_REQPL	0x00200000
2178c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_EGREQ	0x00100000
2188c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_CHDN	0x00080000
2198c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_DNCTL	0x00060000
2208c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_EXTRQ	0x00010000
2218c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_INTRQD	0x0000e000
2228c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_INTENE	0x00001000
2238c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_INTENC	0x00000800
2248c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_INTENT	0x00000400
2258c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_CHNEN	0x00000200
2268c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFACT	0x00000100
2278c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_SMPCHN	0x00000020
2288c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFSZ(order)	(((order) << 2) & 0x0000001c)
2298c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFSZ_1W	TX4938_DMA_CCR_XFSZ(2)
2308c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFSZ_2W	TX4938_DMA_CCR_XFSZ(3)
2318c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFSZ_4W	TX4938_DMA_CCR_XFSZ(4)
2328c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFSZ_8W	TX4938_DMA_CCR_XFSZ(5)
2338c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFSZ_16W TX4938_DMA_CCR_XFSZ(6)
2348c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_XFSZ_32W TX4938_DMA_CCR_XFSZ(7)
2358c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_MEMIO	0x00000002
2368c2ecf20Sopenharmony_ci#define TX4938_DMA_CCR_SNGAD	0x00000001
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci/* bits for CSRn */
2398c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_CHNEN	0x00000400
2408c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_STLXFER	0x00000200
2418c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_CHNACT	0x00000100
2428c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_ABCHC	0x00000080
2438c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_NCHNC	0x00000040
2448c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_NTRNFC	0x00000020
2458c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_EXTDN	0x00000010
2468c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_CFERR	0x00000008
2478c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_CHERR	0x00000004
2488c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_DESERR	0x00000002
2498c2ecf20Sopenharmony_ci#define TX4938_DMA_CSR_SORERR	0x00000001
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci#define tx4938_sdramcptr	tx4927_sdramcptr
2528c2ecf20Sopenharmony_ci#define tx4938_ebuscptr		tx4927_ebuscptr
2538c2ecf20Sopenharmony_ci#define tx4938_pcicptr		tx4927_pcicptr
2548c2ecf20Sopenharmony_ci#define tx4938_pcic1ptr \
2558c2ecf20Sopenharmony_ci		((struct tx4927_pcic_reg __iomem *)TX4938_PCIC1_REG)
2568c2ecf20Sopenharmony_ci#define tx4938_ccfgptr \
2578c2ecf20Sopenharmony_ci		((struct tx4938_ccfg_reg __iomem *)TX4938_CCFG_REG)
2588c2ecf20Sopenharmony_ci#define tx4938_pioptr		((struct txx9_pio_reg __iomem *)TX4938_PIO_REG)
2598c2ecf20Sopenharmony_ci#define tx4938_sramcptr \
2608c2ecf20Sopenharmony_ci		((struct tx4938_sramc_reg __iomem *)TX4938_SRAMC_REG)
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci#define TX4938_REV_PCODE()	\
2648c2ecf20Sopenharmony_ci	((__u32)__raw_readq(&tx4938_ccfgptr->crir) >> 16)
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci#define tx4938_ccfg_clear(bits) tx4927_ccfg_clear(bits)
2678c2ecf20Sopenharmony_ci#define tx4938_ccfg_set(bits)	tx4927_ccfg_set(bits)
2688c2ecf20Sopenharmony_ci#define tx4938_ccfg_change(change, new) tx4927_ccfg_change(change, new)
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci#define TX4938_SDRAMC_CR(ch)	TX4927_SDRAMC_CR(ch)
2718c2ecf20Sopenharmony_ci#define TX4938_SDRAMC_BA(ch)	TX4927_SDRAMC_BA(ch)
2728c2ecf20Sopenharmony_ci#define TX4938_SDRAMC_SIZE(ch)	TX4927_SDRAMC_SIZE(ch)
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci#define TX4938_EBUSC_CR(ch)	TX4927_EBUSC_CR(ch)
2758c2ecf20Sopenharmony_ci#define TX4938_EBUSC_BA(ch)	TX4927_EBUSC_BA(ch)
2768c2ecf20Sopenharmony_ci#define TX4938_EBUSC_SIZE(ch)	TX4927_EBUSC_SIZE(ch)
2778c2ecf20Sopenharmony_ci#define TX4938_EBUSC_WIDTH(ch)	TX4927_EBUSC_WIDTH(ch)
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci#define tx4938_get_mem_size() tx4927_get_mem_size()
2808c2ecf20Sopenharmony_civoid tx4938_wdt_init(void);
2818c2ecf20Sopenharmony_civoid tx4938_setup(void);
2828c2ecf20Sopenharmony_civoid tx4938_time_init(unsigned int tmrnr);
2838c2ecf20Sopenharmony_civoid tx4938_sio_init(unsigned int sclk, unsigned int cts_mask);
2848c2ecf20Sopenharmony_civoid tx4938_spi_init(int busid);
2858c2ecf20Sopenharmony_civoid tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1);
2868c2ecf20Sopenharmony_ciint tx4938_report_pciclk(void);
2878c2ecf20Sopenharmony_civoid tx4938_report_pci1clk(void);
2888c2ecf20Sopenharmony_ciint tx4938_pciclk66_setup(void);
2898c2ecf20Sopenharmony_cistruct pci_dev;
2908c2ecf20Sopenharmony_ciint tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot);
2918c2ecf20Sopenharmony_civoid tx4938_setup_pcierr_irq(void);
2928c2ecf20Sopenharmony_civoid tx4938_irq_init(void);
2938c2ecf20Sopenharmony_civoid tx4938_mtd_init(int ch);
2948c2ecf20Sopenharmony_civoid tx4938_ndfmc_init(unsigned int hold, unsigned int spw);
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_cistruct tx4938ide_platform_info {
2978c2ecf20Sopenharmony_ci	/*
2988c2ecf20Sopenharmony_ci	 * I/O port shift, for platforms with ports that are
2998c2ecf20Sopenharmony_ci	 * constantly spaced and need larger than the 1-byte
3008c2ecf20Sopenharmony_ci	 * spacing used by ata_std_ports().
3018c2ecf20Sopenharmony_ci	 */
3028c2ecf20Sopenharmony_ci	unsigned int ioport_shift;
3038c2ecf20Sopenharmony_ci	unsigned int gbus_clock;	/*  0 means no PIO mode tuning. */
3048c2ecf20Sopenharmony_ci	unsigned int ebus_ch;
3058c2ecf20Sopenharmony_ci};
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_civoid tx4938_ata_init(unsigned int irq, unsigned int shift, int tune);
3088c2ecf20Sopenharmony_civoid tx4938_dmac_init(int memcpy_chan0, int memcpy_chan1);
3098c2ecf20Sopenharmony_civoid tx4938_aclc_init(void);
3108c2ecf20Sopenharmony_civoid tx4938_sramc_init(void);
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#endif
313