Revision cc9577cf

b/Makefile.target
269 269
obj-arm-y += gumstix.o
270 270
obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
271 271
obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o omap_gpio.o omap_intc.o
272
obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o omap_spi.o
272
obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o
273 273
obj-arm-y += omap_sx1.o palm.o tsc210x.o
274 274
obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
275 275
obj-arm-y += mst_fpga.o mainstone.o
b/hw/omap2.c
1245 1245
    return base;
1246 1246
}
1247 1247

  
1248
/* TEST-Chip-level TAP */
1249
static uint32_t omap_tap_read(void *opaque, target_phys_addr_t addr)
1250
{
1251
    struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
1252

  
1253
    switch (addr) {
1254
    case 0x204:	/* IDCODE_reg */
1255
        switch (s->mpu_model) {
1256
        case omap2420:
1257
        case omap2422:
1258
        case omap2423:
1259
            return 0x5b5d902f;	/* ES 2.2 */
1260
        case omap2430:
1261
            return 0x5b68a02f;	/* ES 2.2 */
1262
        case omap3430:
1263
            return 0x1b7ae02f;	/* ES 2 */
1264
        default:
1265
            hw_error("%s: Bad mpu model\n", __FUNCTION__);
1266
        }
1267

  
1268
    case 0x208:	/* PRODUCTION_ID_reg for OMAP2 */
1269
    case 0x210:	/* PRODUCTION_ID_reg for OMAP3 */
1270
        switch (s->mpu_model) {
1271
        case omap2420:
1272
            return 0x000254f0;	/* POP ESHS2.1.1 in N91/93/95, ES2 in N800 */
1273
        case omap2422:
1274
            return 0x000400f0;
1275
        case omap2423:
1276
            return 0x000800f0;
1277
        case omap2430:
1278
            return 0x000000f0;
1279
        case omap3430:
1280
            return 0x000000f0;
1281
        default:
1282
            hw_error("%s: Bad mpu model\n", __FUNCTION__);
1283
        }
1284

  
1285
    case 0x20c:
1286
        switch (s->mpu_model) {
1287
        case omap2420:
1288
        case omap2422:
1289
        case omap2423:
1290
            return 0xcafeb5d9;	/* ES 2.2 */
1291
        case omap2430:
1292
            return 0xcafeb68a;	/* ES 2.2 */
1293
        case omap3430:
1294
            return 0xcafeb7ae;	/* ES 2 */
1295
        default:
1296
            hw_error("%s: Bad mpu model\n", __FUNCTION__);
1297
        }
1298

  
1299
    case 0x218:	/* DIE_ID_reg */
1300
        return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
1301
    case 0x21c:	/* DIE_ID_reg */
1302
        return 0x54 << 24;
1303
    case 0x220:	/* DIE_ID_reg */
1304
        return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
1305
    case 0x224:	/* DIE_ID_reg */
1306
        return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
1307
    }
1308

  
1309
    OMAP_BAD_REG(addr);
1310
    return 0;
1311
}
1312

  
1313
static void omap_tap_write(void *opaque, target_phys_addr_t addr,
1314
                uint32_t value)
1315
{
1316
    OMAP_BAD_REG(addr);
1317
}
1318

  
1319
static CPUReadMemoryFunc * const omap_tap_readfn[] = {
1320
    omap_badwidth_read32,
1321
    omap_badwidth_read32,
1322
    omap_tap_read,
1323
};
1324

  
1325
static CPUWriteMemoryFunc * const omap_tap_writefn[] = {
1326
    omap_badwidth_write32,
1327
    omap_badwidth_write32,
1328
    omap_tap_write,
1329
};
1330

  
1331
void omap_tap_init(struct omap_target_agent_s *ta,
1332
                struct omap_mpu_state_s *mpu)
1333
{
1334
    omap_l4_attach(ta, 0, l4_register_io_memory(
1335
                            omap_tap_readfn, omap_tap_writefn, mpu));
1336
}
1337

  
1338 1248
/* Power, Reset, and Clock Management */
1339 1249
struct omap_prcm_s {
1340 1250
    qemu_irq irq[3];
b/hw/omap_tap.c
1
/*
2
 * TI OMAP TEST-Chip-level TAP emulation.
3
 *
4
 * Copyright (C) 2007-2008 Nokia Corporation
5
 * Written by Andrzej Zaborowski <andrew@openedhand.com>
6
 *
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.
11
 *
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.
16
 *
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/>.
19
 */
20

  
21
#include "hw.h"
22
#include "omap.h"
23

  
24
/* TEST-Chip-level TAP */
25
static uint32_t omap_tap_read(void *opaque, target_phys_addr_t addr)
26
{
27
    struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
28

  
29
    switch (addr) {
30
    case 0x204:	/* IDCODE_reg */
31
        switch (s->mpu_model) {
32
        case omap2420:
33
        case omap2422:
34
        case omap2423:
35
            return 0x5b5d902f;	/* ES 2.2 */
36
        case omap2430:
37
            return 0x5b68a02f;	/* ES 2.2 */
38
        case omap3430:
39
            return 0x1b7ae02f;	/* ES 2 */
40
        default:
41
            hw_error("%s: Bad mpu model\n", __FUNCTION__);
42
        }
43

  
44
    case 0x208:	/* PRODUCTION_ID_reg for OMAP2 */
45
    case 0x210:	/* PRODUCTION_ID_reg for OMAP3 */
46
        switch (s->mpu_model) {
47
        case omap2420:
48
            return 0x000254f0;	/* POP ESHS2.1.1 in N91/93/95, ES2 in N800 */
49
        case omap2422:
50
            return 0x000400f0;
51
        case omap2423:
52
            return 0x000800f0;
53
        case omap2430:
54
            return 0x000000f0;
55
        case omap3430:
56
            return 0x000000f0;
57
        default:
58
            hw_error("%s: Bad mpu model\n", __FUNCTION__);
59
        }
60

  
61
    case 0x20c:
62
        switch (s->mpu_model) {
63
        case omap2420:
64
        case omap2422:
65
        case omap2423:
66
            return 0xcafeb5d9;	/* ES 2.2 */
67
        case omap2430:
68
            return 0xcafeb68a;	/* ES 2.2 */
69
        case omap3430:
70
            return 0xcafeb7ae;	/* ES 2 */
71
        default:
72
            hw_error("%s: Bad mpu model\n", __FUNCTION__);
73
        }
74

  
75
    case 0x218:	/* DIE_ID_reg */
76
        return ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
77
    case 0x21c:	/* DIE_ID_reg */
78
        return 0x54 << 24;
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);
83
    }
84

  
85
    OMAP_BAD_REG(addr);
86
    return 0;
87
}
88

  
89
static void omap_tap_write(void *opaque, target_phys_addr_t addr,
90
                uint32_t value)
91
{
92
    OMAP_BAD_REG(addr);
93
}
94

  
95
static CPUReadMemoryFunc * const omap_tap_readfn[] = {
96
    omap_badwidth_read32,
97
    omap_badwidth_read32,
98
    omap_tap_read,
99
};
100

  
101
static CPUWriteMemoryFunc * const omap_tap_writefn[] = {
102
    omap_badwidth_write32,
103
    omap_badwidth_write32,
104
    omap_tap_write,
105
};
106

  
107
void omap_tap_init(struct omap_target_agent_s *ta,
108
                struct omap_mpu_state_s *mpu)
109
{
110
    omap_l4_attach(ta, 0, l4_register_io_memory(
111
                            omap_tap_readfn, omap_tap_writefn, mpu));
112
}

Also available in: Unified diff