1 /* This file is part of the program psim.
3 Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 core - root of the device tree
31 The core device, positioned at the root of the device tree appears
32 to its child devices as a normal device just like every other
35 Internally it is implemented using a core object. Requests to
36 attach (or detach) address spaces are passed to that core object.
37 Requests to transfer (DMA) data are reflected back down the device
38 tree using the core_map data transfer methods.
48 dv_core_attach_address_callback (struct hw
*me
,
52 address_word nr_bytes
,
55 HW_TRACE ((me
, "attach (level=%d, space=%d, addr=0x%lx, nr_bytes=%ld, client=0x%lx)",
56 level
, space
, (unsigned long) addr
, (unsigned long) nr_bytes
, (unsigned long) client
));
57 /* NOTE: At preset the space is assumed to be zero. Perhaphs the
58 space should be mapped onto something for instance: space0 -
59 unified memory; space1 - IO memory; ... */
61 hw_abort (me
, "Hey! Unknown space %d", space
);
62 sim_core_attach (hw_system (me
),
65 access_read_write_exec
,
75 dv_core_dma_read_buffer_callback (struct hw
*me
,
81 return sim_core_read_buffer (hw_system (me
),
91 dv_core_dma_write_buffer_callback (struct hw
*me
,
96 int violate_read_only_section
)
98 return sim_core_write_buffer (hw_system (me
),
108 dv_core_finish (struct hw
*me
)
110 set_hw_attach_address (me
, dv_core_attach_address_callback
);
111 set_hw_dma_write_buffer (me
, dv_core_dma_write_buffer_callback
);
112 set_hw_dma_read_buffer (me
, dv_core_dma_read_buffer_callback
);
115 const struct hw_device_descriptor dv_core_descriptor
[] = {
116 { "core", dv_core_finish
, },