2 * TI OMAP TEST-Chip-level TAP emulation.
4 * Copyright (C) 2007-2008 Nokia Corporation
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/>.
22 #include "hw/arm/omap.h"
24 /* TEST-Chip-level TAP */
25 static uint64_t omap_tap_read(void *opaque, hwaddr addr,
28 struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
31 return omap_badwidth_read32(opaque, addr);
35 case 0x204: /* IDCODE_reg */
36 switch (s->mpu_model) {
40 return 0x5b5d902f; /* ES 2.2 */
42 return 0x5b68a02f; /* ES 2.2 */
44 return 0x1b7ae02f; /* ES 2 */
46 hw_error("%s: Bad mpu model\n", __FUNCTION__);
49 case 0x208: /* PRODUCTION_ID_reg for OMAP2 */
50 case 0x210: /* PRODUCTION_ID_reg for OMAP3 */
51 switch (s->mpu_model) {
53 return 0x000254f0; /* POP ESHS2.1.1 in N91/93/95, ES2 in N800 */
63 hw_error("%s: Bad mpu model\n", __FUNCTION__);
67 switch (s->mpu_model) {
71 return 0xcafeb5d9; /* ES 2.2 */
73 return 0xcafeb68a; /* ES 2.2 */
75 return 0xcafeb7ae; /* ES 2 */
77 hw_error("%s: Bad mpu model\n", __FUNCTION__);
80 case 0x218: /* DIE_ID_reg */
81 return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
82 case 0x21c: /* DIE_ID_reg */
84 case 0x220: /* DIE_ID_reg */
85 return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
86 case 0x224: /* DIE_ID_reg */
87 return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
94 static void omap_tap_write(void *opaque, hwaddr addr,
95 uint64_t value, unsigned size)
98 return omap_badwidth_write32(opaque, addr, value);
104 static const MemoryRegionOps omap_tap_ops = {
105 .read = omap_tap_read,
106 .write = omap_tap_write,
107 .endianness = DEVICE_NATIVE_ENDIAN,
110 void omap_tap_init(struct omap_target_agent_s *ta,
111 struct omap_mpu_state_s *mpu)
113 memory_region_init_io(&mpu->tap_iomem, &omap_tap_ops, mpu, "omap.tap",
114 omap_l4_region_size(ta, 0));
115 omap_l4_attach(ta, 0, &mpu->tap_iomem);