2 * TI OMAP TEST-Chip-level TAP emulation.
4 * Copyright (C) 2007-2008 Nokia Corporation
5 * Written by Andrzej Zaborowski <andrew@openedhand.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 or
10 * (at your option) any later version of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, see <http://www.gnu.org/licenses/>.
24 /* TEST-Chip-level TAP */
25 static uint32_t omap_tap_read(void *opaque
, target_phys_addr_t addr
)
27 struct omap_mpu_state_s
*s
= (struct omap_mpu_state_s
*) opaque
;
30 case 0x204: /* IDCODE_reg */
31 switch (s
->mpu_model
) {
35 return 0x5b5d902f; /* ES 2.2 */
37 return 0x5b68a02f; /* ES 2.2 */
39 return 0x1b7ae02f; /* ES 2 */
41 hw_error("%s: Bad mpu model\n", __FUNCTION__
);
44 case 0x208: /* PRODUCTION_ID_reg for OMAP2 */
45 case 0x210: /* PRODUCTION_ID_reg for OMAP3 */
46 switch (s
->mpu_model
) {
48 return 0x000254f0; /* POP ESHS2.1.1 in N91/93/95, ES2 in N800 */
58 hw_error("%s: Bad mpu model\n", __FUNCTION__
);
62 switch (s
->mpu_model
) {
66 return 0xcafeb5d9; /* ES 2.2 */
68 return 0xcafeb68a; /* ES 2.2 */
70 return 0xcafeb7ae; /* ES 2 */
72 hw_error("%s: Bad mpu model\n", __FUNCTION__
);
75 case 0x218: /* DIE_ID_reg */
76 return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
77 case 0x21c: /* DIE_ID_reg */
79 case 0x220: /* DIE_ID_reg */
80 return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
81 case 0x224: /* DIE_ID_reg */
82 return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
89 static void omap_tap_write(void *opaque
, target_phys_addr_t addr
,
95 static CPUReadMemoryFunc
* const omap_tap_readfn
[] = {
101 static CPUWriteMemoryFunc
* const omap_tap_writefn
[] = {
102 omap_badwidth_write32
,
103 omap_badwidth_write32
,
107 void omap_tap_init(struct omap_target_agent_s
*ta
,
108 struct omap_mpu_state_s
*mpu
)
110 omap_l4_attach(ta
, 0, l4_register_io_memory(
111 omap_tap_readfn
, omap_tap_writefn
, mpu
));