xref: /openbmc/qemu/include/hw/misc/grlib_ahb_apb_pnp.h (revision 8631a430e65ef73b3d8a297128be2ef3c7317b90)
1162abf1aSKONRAD Frederic /*
2162abf1aSKONRAD Frederic  * GRLIB AHB APB PNP
3162abf1aSKONRAD Frederic  *
4162abf1aSKONRAD Frederic  *  Copyright (C) 2019 AdaCore
5162abf1aSKONRAD Frederic  *
6162abf1aSKONRAD Frederic  *  Developed by :
7162abf1aSKONRAD Frederic  *  Frederic Konrad   <frederic.konrad@adacore.com>
8162abf1aSKONRAD Frederic  *
9162abf1aSKONRAD Frederic  * This program is free software; you can redistribute it and/or modify
10162abf1aSKONRAD Frederic  * it under the terms of the GNU General Public License as published by
11162abf1aSKONRAD Frederic  * the Free Software Foundation, either version 2 of the License, or
12162abf1aSKONRAD Frederic  * (at your option) any later version.
13162abf1aSKONRAD Frederic  *
14162abf1aSKONRAD Frederic  * This program is distributed in the hope that it will be useful,
15162abf1aSKONRAD Frederic  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16162abf1aSKONRAD Frederic  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17162abf1aSKONRAD Frederic  * GNU General Public License for more details.
18162abf1aSKONRAD Frederic  *
19162abf1aSKONRAD Frederic  * You should have received a copy of the GNU General Public License along
20162abf1aSKONRAD Frederic  * with this program; if not, see <http://www.gnu.org/licenses/>.
21162abf1aSKONRAD Frederic  *
22162abf1aSKONRAD Frederic  */
23162abf1aSKONRAD Frederic 
24162abf1aSKONRAD Frederic #ifndef GRLIB_AHB_APB_PNP_H
25162abf1aSKONRAD Frederic #define GRLIB_AHB_APB_PNP_H
26db1015e9SEduardo Habkost #include "qom/object.h"
27162abf1aSKONRAD Frederic 
28*e178113fSMarkus Armbruster #define TYPE_GRLIB_AHB_PNP "grlib-ahbpnp"
298063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(AHBPnp, GRLIB_AHB_PNP)
30162abf1aSKONRAD Frederic 
31*e178113fSMarkus Armbruster #define TYPE_GRLIB_APB_PNP "grlib-apbpnp"
328063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(APBPnp, GRLIB_APB_PNP)
33162abf1aSKONRAD Frederic 
34162abf1aSKONRAD Frederic void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t address, uint32_t mask,
35162abf1aSKONRAD Frederic                              uint8_t vendor, uint16_t device, int slave,
36162abf1aSKONRAD Frederic                              int type);
37162abf1aSKONRAD Frederic void grlib_apb_pnp_add_entry(APBPnp *dev, uint32_t address, uint32_t mask,
38162abf1aSKONRAD Frederic                              uint8_t vendor, uint16_t device, uint8_t version,
39162abf1aSKONRAD Frederic                              uint8_t irq, int type);
40162abf1aSKONRAD Frederic 
41162abf1aSKONRAD Frederic /* VENDORS */
42162abf1aSKONRAD Frederic #define GRLIB_VENDOR_GAISLER (0x01)
43162abf1aSKONRAD Frederic /* DEVICES */
44162abf1aSKONRAD Frederic #define GRLIB_LEON3_DEV      (0x03)
45162abf1aSKONRAD Frederic #define GRLIB_APBMST_DEV     (0x06)
46162abf1aSKONRAD Frederic #define GRLIB_APBUART_DEV    (0x0C)
47162abf1aSKONRAD Frederic #define GRLIB_IRQMP_DEV      (0x0D)
48162abf1aSKONRAD Frederic #define GRLIB_GPTIMER_DEV    (0x11)
49162abf1aSKONRAD Frederic /* TYPE */
50162abf1aSKONRAD Frederic #define GRLIB_CPU_AREA       (0x00)
51162abf1aSKONRAD Frederic #define GRLIB_APBIO_AREA     (0x01)
52162abf1aSKONRAD Frederic #define GRLIB_AHBMEM_AREA    (0x02)
53162abf1aSKONRAD Frederic 
54162abf1aSKONRAD Frederic #define GRLIB_AHB_MASTER     (0x00)
55162abf1aSKONRAD Frederic #define GRLIB_AHB_SLAVE      (0x01)
56162abf1aSKONRAD Frederic 
57162abf1aSKONRAD Frederic #endif /* GRLIB_AHB_APB_PNP_H */
58