11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Bonito Register Map
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * This file is the original bonito.h from Algorithmics with minor changes
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * to fit into linux.
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (c) 1999 Algorithmics Ltd
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Carsten Langgaard, carstenl@mips.com
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 2001 MIPS Technologies, Inc.  All rights reserved.
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Algorithmics gives permission for anyone to use and modify this file
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * without any obligation or license condition except that you retain
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * this copyright message in any source redistribution in whole or part.
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Revision 1.48 autogenerated on 08/17/99 15:20:01 */
191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* This bonito64 version editted from bonito.h Revision 1.48 on 11/09/00 */
201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef _ASM_MIPS_BOARDS_BONITO64_H
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _ASM_MIPS_BOARDS_BONITO64_H
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef __ASSEMBLY__
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* offsets from base register */
271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO(x)	(x)
281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2942d226c7248a28ff8c478c06b7e9bd9ef5d73574Songmao Tian#else
301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Algorithmics Bonito64 system controller register base.
331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern unsigned long _pcictrl_bonito;
351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern unsigned long _pcictrl_bonito_pcicfg;
361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO(x)		*(volatile u32 *)(_pcictrl_bonito + (x))
381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* __ASSEMBLY__ */
401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BOOT_BASE		0x1fc00000
431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BOOT_SIZE		0x00100000
441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BOOT_TOP 		(BONITO_BOOT_BASE+BONITO_BOOT_SIZE-1)
451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_FLASH_BASE		0x1c000000
461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_FLASH_SIZE		0x03000000
471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_FLASH_TOP		(BONITO_FLASH_BASE+BONITO_FLASH_SIZE-1)
481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SOCKET_BASE		0x1f800000
491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SOCKET_SIZE		0x00400000
501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SOCKET_TOP		(BONITO_SOCKET_BASE+BONITO_SOCKET_SIZE-1)
511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_REG_BASE 		0x1fe00000
521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_REG_SIZE 		0x00040000
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_REG_TOP			(BONITO_REG_BASE+BONITO_REG_SIZE-1)
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_DEV_BASE 		0x1ff00000
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_DEV_SIZE 		0x00100000
561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_DEV_TOP			(BONITO_DEV_BASE+BONITO_DEV_SIZE-1)
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILO_BASE		0x10000000
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILO_SIZE		0x0c000000
591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILO_TOP		(BONITO_PCILO_BASE+BONITO_PCILO_SIZE-1)
601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILO0_BASE		0x10000000
611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILO1_BASE		0x14000000
621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILO2_BASE		0x18000000
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIHI_BASE		0x20000000
641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIHI_SIZE		0x20000000
651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIHI_TOP		(BONITO_PCIHI_BASE+BONITO_PCIHI_SIZE-1)
661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIIO_BASE		0x1fd00000
671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIIO_SIZE		0x00100000
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIIO_TOP		(BONITO_PCIIO_BASE+BONITO_PCIIO_SIZE-1)
691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICFG_BASE		0x1fe80000
701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICFG_SIZE		0x00080000
711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICFG_TOP		(BONITO_PCICFG_BASE+BONITO_PCICFG_SIZE-1)
721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Bonito Register Bases */
751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICONFIGBASE		0x00
771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_REGBASE			0x100
781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* PCI Configuration  Registers */
811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCI_REG(x)               BONITO(BONITO_PCICONFIGBASE + (x))
831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIDID			BONITO_PCI_REG(0x00)
841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD			BONITO_PCI_REG(0x04)
851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICLASS 		BONITO_PCI_REG(0x08)
861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILTIMER		BONITO_PCI_REG(0x0c)
871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIBASE0 		BONITO_PCI_REG(0x10)
881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIBASE1 		BONITO_PCI_REG(0x14)
891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIBASE2 		BONITO_PCI_REG(0x18)
901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIEXPRBASE		BONITO_PCI_REG(0x30)
911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIINT			BONITO_PCI_REG(0x3c)
921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_PERR_CLR		0x80000000
941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_SERR_CLR		0x40000000
951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_MABORT_CLR	0x20000000
961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_MTABORT_CLR	0x10000000
971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_TABORT_CLR	0x08000000
981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_MPERR_CLR 	0x01000000
991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_PERRRESPEN	0x00000040
1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_ASTEPEN		0x00000080
1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_SERREN		0x00000100
1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILTIMER_BUSLATENCY	0x0000ff00
1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCILTIMER_BUSLATENCY_SHIFT	8
1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1. Bonito h/w Configuration */
1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Power on register */
1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG		BONITO(BONITO_REGBASE + 0x00)
1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_SYSCONTROLLERRD	0x00040000
1141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMCS1SAMP	0x00020000
1151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMCS0SAMP	0x00010000
1161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_CPUBIGEND	0x00004000
1171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Added by RPF 11-9-00 */
1181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_BURSTORDER	0x00001000
1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --- */
1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_CPUPARITY	0x00002000
1211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_CPUTYPE	0x00000007
1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_CPUTYPE_SHIFT	0
1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_PCIRESET_OUT	0x00000008
1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_IS_ARBITER	0x00000010
1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMBOOT	0x000000c0
1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMBOOT_SHIFT	6
1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMBOOT_FLASH	(0x0<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMBOOT_SOCKET (0x1<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMBOOT_SDRAM	(0x2<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
1311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMBOOT_CPURESET	(0x3<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
1321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMCS0WIDTH	0x00000100
1341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMCS1WIDTH	0x00000200
1351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMCS0FAST	0x00000400
1361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_ROMCS1FAST	0x00000800
1371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONPONCFG_CONFIG_DIS	0x00000020
1381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Other Bonito configuration */
1411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_OFFSET         0x4
1431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG		BONITO(BONITO_REGBASE + BONITO_BONGENCFG_OFFSET)
1441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_DEBUGMODE	0x00000001
1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_SNOOPEN	0x00000002
1471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_CPUSELFRESET	0x00000004
1481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_FORCE_IRQA	0x00000008
1501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_IRQA_ISOUT	0x00000010
1511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_IRQA_FROM_INT1 0x00000020
1521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_BYTESWAP	0x00000040
1531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_UNCACHED	0x00000080
1551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_PREFETCHEN	0x00000100
1561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_WBEHINDEN	0x00000200
1571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_CACHEALG	0x00000c00
1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_CACHEALG_SHIFT 10
1591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_PCIQUEUE	0x00001000
1601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_CACHESTOP	0x00002000
1611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_MSTRBYTESWAP	0x00004000
1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_BUSERREN	0x00008000
1631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_NORETRYTIMEOUT 0x00010000
1641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONGENCFG_SHORTCOPYTIMEOUT	0x00020000
1651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 2. IO & IDE configuration */
1671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG 		BONITO(BONITO_REGBASE + 0x08)
1691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 3. IO & IDE configuration */
1711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG			BONITO(BONITO_REGBASE + 0x0c)
1731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 4. PCI address map control */
1751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP			BONITO(BONITO_REGBASE + 0x10)
1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG		BONITO(BONITO_REGBASE + 0x14)
1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_CFG		BONITO(BONITO_REGBASE + 0x18)
1791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 5. ICU & GPIO regs */
1811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* GPIO Regs - r/w */
1831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIODATA_OFFSET          0x1c
1851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIODATA 		BONITO(BONITO_REGBASE + BONITO_GPIODATA_OFFSET)
1861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIOIE			BONITO(BONITO_REGBASE + 0x20)
1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ICU Configuration Regs - r/w */
1891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_INTEDGE			BONITO(BONITO_REGBASE + 0x24)
1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_INTSTEER 		BONITO(BONITO_REGBASE + 0x28)
1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_INTPOL			BONITO(BONITO_REGBASE + 0x2c)
1931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ICU Enable Regs - IntEn & IntISR are r/o. */
1951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_INTENSET 		BONITO(BONITO_REGBASE + 0x30)
1971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_INTENCLR 		BONITO(BONITO_REGBASE + 0x34)
1981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_INTEN			BONITO(BONITO_REGBASE + 0x38)
1991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_INTISR			BONITO(BONITO_REGBASE + 0x3c)
2001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* PCI mail boxes */
2021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL0_OFFSET          0x40
2041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL1_OFFSET          0x44
2051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL2_OFFSET          0x48
2061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL3_OFFSET          0x4c
2071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL0 		BONITO(BONITO_REGBASE + 0x40)
2081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL1 		BONITO(BONITO_REGBASE + 0x44)
2091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL2 		BONITO(BONITO_REGBASE + 0x48)
2101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAIL3 		BONITO(BONITO_REGBASE + 0x4c)
2111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 6. PCI cache */
2141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL		BONITO(BONITO_REGBASE + 0x50)
2161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHETAG		BONITO(BONITO_REGBASE + 0x54)
2171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIBADADDR		BONITO(BONITO_REGBASE + 0x58)
2191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMSTAT 		BONITO(BONITO_REGBASE + 0x5c)
2201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
2231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIRDPOST		BONITO(BONITO_REGBASE + 0x60)
2241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIDATA			BONITO(BONITO_REGBASE + 0x64)
2251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/
2261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 7. IDE DMA & Copier */
2281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_CONFIGBASE		0x000
2301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_BONITOBASE		0x100
2311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_LDMABASE 		0x200
2321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_COPBASE			0x300
2331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_REG_BLOCKMASK		0x300
2341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_LDMACTRL 		BONITO(BONITO_LDMABASE + 0x0)
2361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_LDMASTAT 		BONITO(BONITO_LDMABASE + 0x0)
2371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_LDMAADDR 		BONITO(BONITO_LDMABASE + 0x4)
2381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_LDMAGO			BONITO(BONITO_LDMABASE + 0x8)
2391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_LDMADATA 		BONITO(BONITO_LDMABASE + 0xc)
2401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_COPCTRL			BONITO(BONITO_COPBASE + 0x0)
2421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_COPSTAT			BONITO(BONITO_COPBASE + 0x0)
2431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_COPPADDR 		BONITO(BONITO_COPBASE + 0x4)
2441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_COPDADDR 		BONITO(BONITO_COPBASE + 0x8)
2451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_COPGO			BONITO(BONITO_COPBASE + 0xc)
2461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ###### Bit Definitions for individual Registers #### */
2491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Gen DMA. */
2511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPDADDR_DMA_DADDR	0x0ffffffc
2531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPDADDR_DMA_DADDR_SHIFT	2
2541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPPADDR_DMA_PADDR	0xfffffffc
2551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPPADDR_DMA_PADDR_SHIFT	2
2561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPGO_DMA_SIZE	0x0000fffe
2571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPGO_DMA_SIZE_SHIFT	0
2581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPGO_DMA_WRITE	0x00010000
2591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPGO_DMAWCOUNT	0x000f0000
2601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPGO_DMAWCOUNT_SHIFT	16
2611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPCTRL_DMA_STARTBIT	0x80000000
2631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IDECOPCTRL_DMA_RSTBIT	0x40000000
2641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* DRAM - sdCfg */
2661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_AROWBITS		0x00000003
2681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_AROWBITS_SHIFT	0
2691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_ACOLBITS		0x0000000c
2701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_ACOLBITS_SHIFT	2
2711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_ABANKBIT		0x00000010
2721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_ASIDES		0x00000020
2731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_AABSENT		0x00000040
2741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_AWIDTH64		0x00000080
2751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BROWBITS		0x00000300
2771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BROWBITS_SHIFT	8
2781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BCOLBITS		0x00000c00
2791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BCOLBITS_SHIFT	10
2801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BBANKBIT		0x00001000
2811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BSIDES		0x00002000
2821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BABSENT		0x00004000
2831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_BWIDTH64		0x00008000
2841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_EXTRDDATA		0x00010000
2861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_EXTRASCAS		0x00020000
2871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_EXTPRECH		0x00040000
2881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_EXTRASWIDTH	0x00180000
2891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_EXTRASWIDTH_SHIFT	19
2901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Changed by RPF 11-9-00 */
2911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_DRAMMODESET	0x00200000
2921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --- */
2931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_DRAMEXTREGS	0x00400000
2941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_DRAMPARITY 	0x00800000
2951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Added by RPF 11-9-00 */
2961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_DRAMBURSTLEN 	0x03000000
2971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_DRAMBURSTLEN_SHIFT	24
2981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_SDCFG_DRAMMODESET_DONE 	0x80000000
2991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --- */
3001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* PCI Cache - pciCacheCtrl */
3021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_CACHECMD	0x00000007
3041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_CACHECMD_SHIFT	0
3051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_CACHECMDLINE	0x00000018
3061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_CACHECMDLINE_SHIFT	3
3071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_CMDEXEC	0x00000020
3081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_IOBCCOH_PRES	0x00000100
3101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_IOBCCOH_EN	0x00000200
3111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_CPUCOH_PRES	0x00000400
3121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICACHECTRL_CPUCOH_EN	0x00000800
3131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_BUFFBIT_CS0	0x00000001
3151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_SPEEDBIT_CS0	0x00000002
3161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_MOREABITS_CS0	0x00000004
3171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_BUFFBIT_CS1	0x00000008
3191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_SPEEDBIT_CS1	0x00000010
3201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_MOREABITS_CS1	0x00000020
3211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_BUFFBIT_CS2	0x00000040
3231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_SPEEDBIT_CS2	0x00000080
3241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_MOREABITS_CS2	0x00000100
3251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_BUFFBIT_CS3	0x00000200
3271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_SPEEDBIT_CS3	0x00000400
3281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_MOREABITS_CS3	0x00000800
3291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_BUFFBIT_IDE	0x00001000
3311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_SPEEDBIT_IDE	0x00002000
3321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_WORDSWAPBIT_IDE 0x00004000
3331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_MODEBIT_IDE	0x00008000
3341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_DMAON_IDE	0x001f0000
3351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_DMAON_IDE_SHIFT 16
3361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_DMAOFF_IDE	0x01e00000
3371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_DMAOFF_IDE_SHIFT	21
3381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_EPROMSPLIT	0x02000000
3391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Added by RPF 11-9-00 */
3401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_CPUCLOCKPERIOD	0xfc000000
3411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_IODEVCFG_CPUCLOCKPERIOD_SHIFT 26
3421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --- */
3431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* gpio */
3451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_GPIOW		0x000003ff
3461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_GPIOW_SHIFT 	0
3471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_GPIOR		0x01ff0000
3481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_GPIOR_SHIFT 	16
3491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_GPINR		0xfe000000
3501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_GPINR_SHIFT 	25
3511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_IOW(N)		(1<<(BONITO_GPIO_GPIOW_SHIFT+(N)))
3521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_IOR(N)		(1<<(BONITO_GPIO_GPIOR_SHIFT+(N)))
3531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_GPIO_INR(N)		(1<<(BONITO_GPIO_GPINR_SHIFT+(N)))
3541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ICU */
3561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_MBOXES		0x0000000f
3571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_MBOXES_SHIFT 	0
3581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_DMARDY		0x00000010
3591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_DMAEMPTY		0x00000020
3601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_COPYRDY		0x00000040
3611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_COPYEMPTY		0x00000080
3621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_COPYERR		0x00000100
3631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_PCIIRQ		0x00000200
3641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_MASTERERR		0x00000400
3651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_SYSTEMERR		0x00000800
3661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_DRAMPERR		0x00001000
3671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_RETRYERR		0x00002000
3681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_GPIOS		0x01ff0000
3691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_GPIOS_SHIFT		16
3701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_GPINS		0x7e000000
3711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_GPINS_SHIFT		25
3721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_MBOX(N)		(1<<(BONITO_ICU_MBOXES_SHIFT+(N)))
3731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_GPIO(N)		(1<<(BONITO_ICU_GPIOS_SHIFT+(N)))
3741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_ICU_GPIN(N)		(1<<(BONITO_ICU_GPINS_SHIFT+(N)))
3751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* pcimap */
3771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_PCIMAP_LO0	0x0000003f
3791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_PCIMAP_LO0_SHIFT	0
3801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_PCIMAP_LO1	0x00000fc0
3811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_PCIMAP_LO1_SHIFT	6
3821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_PCIMAP_LO2	0x0003f000
3831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_PCIMAP_LO2_SHIFT	12
3841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_PCIMAP_2		0x00040000
38521a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCIMAP_WIN(WIN, ADDR)	((((ADDR)>>26) & BONITO_PCIMAP_PCIMAP_LO0) << ((WIN)*6))
3861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_WINSIZE           (1<<26)
3881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_WINOFFSET(ADDR)	((ADDR) & (BONITO_PCIMAP_WINSIZE - 1))
3891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMAP_WINBASE(ADDR)	((ADDR) << 26)
3901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* pcimembaseCfg */
3921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
3931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MASK               0xf0000000
3941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK	0x0000001f
3951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK_SHIFT	0
3961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS	0x000003e0
3971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS_SHIFT	5
3981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE0_CACHED	0x00000400
3991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE0_IO	0x00000800
4001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
4011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK	0x0001f000
4021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK_SHIFT	12
4031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS	0x003e0000
4041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS_SHIFT	17
4051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE1_CACHED	0x00400000
4061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_MEMBASE1_IO	0x00800000
4071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
4081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_ASHIFT	23
4091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCIMEMBASECFG_AMASK              0x007fffff
41021a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCIMEMBASECFGSIZE(WIN, SIZE)	(((~((SIZE)-1))>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)
41121a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCIMEMBASECFGBASE(WIN, BASE)	(((BASE)>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS)
4121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
41321a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCIMEMBASECFG_SIZE(WIN, CFG)  (((((~(CFG)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)) << (BONITO_PCIMEMBASECFG_ASHIFT - BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) | BONITO_PCIMEMBASECFG_AMASK)
4141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
4151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
41621a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG)  ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
41721a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG)  ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
41821a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
4191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
42021a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle#define BONITO_PCITOPHYS(WIN, ADDR, CFG)          ( \
42121a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle                                                  (((ADDR) & (~(BONITO_PCIMEMBASECFG_MASK))) & (~(BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG)))) | \
42221a151d8ca3aa74ee79f9791a9d4dc370d3e0636Ralf Baechle                                                  (BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG)) \
4231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds                                                )
4241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
4251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* PCICmd */
4261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
4271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_MEMEN		0x00000002
4281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define BONITO_PCICMD_MSTREN		0x00000004
4291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
4301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
4311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* _ASM_MIPS_BOARDS_BONITO64_H */
432