xref: /linux/arch/powerpc/sysdev/dart.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*1a59d1b8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
29933f299SDavid Gibson /*
391f14480SOlof Johansson  * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
49933f299SDavid Gibson  */
59933f299SDavid Gibson 
69933f299SDavid Gibson #ifndef _POWERPC_SYSDEV_DART_H
79933f299SDavid Gibson #define _POWERPC_SYSDEV_DART_H
89933f299SDavid Gibson 
99933f299SDavid Gibson 
109933f299SDavid Gibson /* Offset from base to control register */
111beb6a7dSBenjamin Herrenschmidt #define DART_CNTL	0
129933f299SDavid Gibson 
131beb6a7dSBenjamin Herrenschmidt /* Offset from base to exception register */
141beb6a7dSBenjamin Herrenschmidt #define DART_EXCP_U3	0x10
151beb6a7dSBenjamin Herrenschmidt /* Offset from base to TLB tag registers */
161beb6a7dSBenjamin Herrenschmidt #define DART_TAGS_U3	0x1000
171beb6a7dSBenjamin Herrenschmidt 
181beb6a7dSBenjamin Herrenschmidt /* U4 registers */
191beb6a7dSBenjamin Herrenschmidt #define DART_BASE_U4	0x10
201beb6a7dSBenjamin Herrenschmidt #define DART_SIZE_U4	0x20
211beb6a7dSBenjamin Herrenschmidt #define DART_EXCP_U4	0x30
221beb6a7dSBenjamin Herrenschmidt #define DART_TAGS_U4	0x1000
239933f299SDavid Gibson 
249933f299SDavid Gibson /* Control Register fields */
259933f299SDavid Gibson 
261beb6a7dSBenjamin Herrenschmidt /* U3 registers */
271beb6a7dSBenjamin Herrenschmidt #define DART_CNTL_U3_BASE_MASK	0xfffff
281beb6a7dSBenjamin Herrenschmidt #define DART_CNTL_U3_BASE_SHIFT	12
291beb6a7dSBenjamin Herrenschmidt #define DART_CNTL_U3_FLUSHTLB	0x400
301beb6a7dSBenjamin Herrenschmidt #define DART_CNTL_U3_ENABLE	0x200
311beb6a7dSBenjamin Herrenschmidt #define DART_CNTL_U3_SIZE_MASK	0x1ff
321beb6a7dSBenjamin Herrenschmidt #define DART_CNTL_U3_SIZE_SHIFT	0
339933f299SDavid Gibson 
341beb6a7dSBenjamin Herrenschmidt /* U4 registers */
351beb6a7dSBenjamin Herrenschmidt #define DART_BASE_U4_BASE_MASK	0xffffff
361beb6a7dSBenjamin Herrenschmidt #define DART_BASE_U4_BASE_SHIFT	0
371beb6a7dSBenjamin Herrenschmidt #define DART_CNTL_U4_ENABLE	0x80000000
38feb76c7bSOlof Johansson #define DART_CNTL_U4_IONE	0x40000000
39feb76c7bSOlof Johansson #define DART_CNTL_U4_FLUSHTLB	0x20000000
40feb76c7bSOlof Johansson #define DART_CNTL_U4_IDLE	0x10000000
41feb76c7bSOlof Johansson #define DART_CNTL_U4_PAR_EN	0x08000000
42feb76c7bSOlof Johansson #define DART_CNTL_U4_IONE_MASK	0x07ffffff
431beb6a7dSBenjamin Herrenschmidt #define DART_SIZE_U4_SIZE_MASK	0x1fff
441beb6a7dSBenjamin Herrenschmidt #define DART_SIZE_U4_SIZE_SHIFT	0
451beb6a7dSBenjamin Herrenschmidt 
461beb6a7dSBenjamin Herrenschmidt #define DART_REG(r)	(dart + ((r) >> 2))
471beb6a7dSBenjamin Herrenschmidt #define DART_IN(r)	(in_be32(DART_REG(r)))
481beb6a7dSBenjamin Herrenschmidt #define DART_OUT(r,v)	(out_be32(DART_REG(r), (v)))
491beb6a7dSBenjamin Herrenschmidt 
509933f299SDavid Gibson 
519933f299SDavid Gibson /* size of table in pages */
529933f299SDavid Gibson 
539933f299SDavid Gibson 
549933f299SDavid Gibson /* DART table fields */
559933f299SDavid Gibson 
569933f299SDavid Gibson #define DARTMAP_VALID   0x80000000
579933f299SDavid Gibson #define DARTMAP_RPNMASK 0x00ffffff
589933f299SDavid Gibson 
599933f299SDavid Gibson 
609933f299SDavid Gibson #define DART_PAGE_SHIFT		12
619933f299SDavid Gibson #define DART_PAGE_SIZE		(1 << DART_PAGE_SHIFT)
629933f299SDavid Gibson 
639933f299SDavid Gibson 
649933f299SDavid Gibson #endif /* _POWERPC_SYSDEV_DART_H */
65