Updated Makefile, with WNDR4000 builds
[tomato.git] / release / src-rt-6.x / include / hndjtagdefs.h
blob80d3ca63626c41c3e064d885b07fb558cbebc00c
1 /*
2 * Definitiosn for Jtag taps in HND chips.
4 * $Id: hndjtagdefs.h 241182 2011-02-17 21:50:03Z $
6 * Copyright (C) 2011, Broadcom Corporation. All Rights Reserved.
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
17 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
18 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 #ifndef _HNDJTAGDEFS_H
22 #define _HNDJTAGDEFS_H
24 /* Jtag access regs are all 32 bits */
25 #define JRBITS 32
27 /* MIPS mode defines: */
29 #define MIPS_IR_SIZE 5
30 #define MIPS_DR_SIZE 32
32 #define MIPS_IDCODE 1
33 #define MIPS_BYPASS 0x1f
35 /* Register addresses */
36 #define MIPS_ADDR 0x08
37 #define MIPS_DATA 0x09
38 #define MIPS_CTRL 0x0a
40 /* Bits in the Control register */
41 #define DMA_SZ1 0x00000000
42 #define DMA_SZ2 0x00000080
43 #define DMA_SZ4 0x00000100
44 #define DMA_SZ3 0x00000180
45 #define DMA_READ 0x00000200
46 #define DMA_ERROR 0x00000400
47 #define DMA_START 0x00000800
48 #define EJ_BREAK 0x00001000
49 #define EJ_PREN 0x00008000
50 #define DMA_ACC 0x00020000
51 #define EJ_PRACC 0x00040000
53 /* CC mode defines: */
55 #define CCJT_IR_SIZE 8
56 #define CCJT_DR_SIZE 32
58 #define CCJT_USER_BASE 0x20
60 #define CCJT_IDCODE 1
61 #define CCJT_BYPASS 0xff
63 /* Register addresses */
64 #define CHIPC_ADDR 0x30
65 #define CHIPC_DATA 0x32
66 #define CHIPC_CTRL 0x34
68 #define CHIPC_RO 1 /* Or in this to get the read-only address */
70 /* Control register bits */
71 #define CCC_BE0 0x00000001
72 #define CCC_BE1 0x00000002
73 #define CCC_BE2 0x00000004
74 #define CCC_BE3 0x00000008
75 #define CCC_SZ1 (CCC_BE0)
76 #define CCC_SZ2 (CCC_BE1 | CCC_BE0)
77 #define CCC_SZ4 (CCC_BE3 | CCC_BE2 | CCC_BE1 | CCC_BE0)
78 #define CCC_READ 0x00000010
79 #define CCC_START 0x00000020
80 #define CCC_ERROR 0x00000040
82 /* Bits written into the control register need to be shifted */
83 #define CCC_WR_SHIFT 25
85 /* LV mode defines: */
87 #define LV_IR_SIZE 32
88 #define LV_DR_SIZE 32
90 #define LV_BASE 0xfe03ff3a
91 #define LV_REG_MASK 0x01f00000
92 #define LV_REG_SHIFT 20
93 #define LV_RO 0x00080000
94 #define LV_USER_BASE 0x10
96 /* Keystone base */
97 #define LV_BASE_KY 0xfe07ff3a
99 /* Register addresses */
100 #define LV_CAP 0
101 #define LV_CHAIN_CTL 1
102 #define LV_ADDR 2
103 #define LV_ADDRH 3
104 #define LV_DATA 4
105 #define LV_CTRL 5
106 #define LV_OTP_CTL 6
107 #define LV_OTP_STAT 7
108 #define LV_ATEWRITE 8
109 #define LV_ATEREAD 9
110 #define LV_ATEREADDATA 10
111 #define LV_ATEWRITENEXT 11
113 #define LV_REG_IR(reg) (LV_BASE | (((reg) << LV_REG_SHIFT) & LV_REG_MASK))
114 #define LV_REG_ROIR(reg) (LV_BASE | LV_RO | (((reg) << LV_REG_SHIFT) & LV_REG_MASK))
115 #define LV_UREG_IR(reg) (LV_BASE | ((((reg) + LV_USER_BASE) << LV_REG_SHIFT) & LV_REG_MASK))
116 #define LV_UREG_ROIR(reg) \
117 (LV_BASE | LV_RO | ((((reg) + LV_USER_BASE) << LV_REG_SHIFT) & LV_REG_MASK))
119 #define LV_REG_IR_KY(reg) (LV_BASE_KY | (((reg) << LV_REG_SHIFT) & LV_REG_MASK))
121 #define LV_IDCODE 0xfffffffe
122 #define LV_BYPASS 0xffffffff
124 #define IDC_MFG_MASK 0x00000fff
125 #define IDC_PART_MASK 0x0ffff000
126 #define IDC_PART_SHIFT 12
127 #define IDC_REV_MASK 0xf0000000
128 #define IDC_REV_SHIFT 28
130 #define ATE_BUSY 1
131 #define ATE_RERROR 2
132 #define ATE_REJECT 0x10
133 #define ATE_WERROR 0x20
135 #define JEDEC_BRCM 0x17f
137 #endif /* _HNDJTAGDEFS_H */