1 /* 2 * Samsung exynos4210 Interrupt Combiner 3 * 4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. 5 * All rights reserved. 6 * 7 * Evgeny Voevodin <e.voevodin@samsung.com> 8 * 9 * This program is free software; you can redistribute it and/or modify it 10 * under the terms of the GNU General Public License as published by the 11 * Free Software Foundation; either version 2 of the License, or (at your 12 * option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 * See the GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License along 20 * with this program; if not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef HW_INTC_EXYNOS4210_COMBINER_H 24 #define HW_INTC_EXYNOS4210_COMBINER_H 25 26 #include "hw/sysbus.h" 27 28 /* 29 * State for each output signal of internal combiner 30 */ 31 typedef struct CombinerGroupState { 32 uint8_t src_mask; /* 1 - source enabled, 0 - disabled */ 33 uint8_t src_pending; /* Pending source interrupts before masking */ 34 } CombinerGroupState; 35 36 #define TYPE_EXYNOS4210_COMBINER "exynos4210.combiner" 37 OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210CombinerState, EXYNOS4210_COMBINER) 38 39 /* Number of groups and total number of interrupts for the internal combiner */ 40 #define IIC_NGRP 64 41 #define IIC_NIRQ (IIC_NGRP * 8) 42 #define IIC_REGSET_SIZE 0x41 43 44 struct Exynos4210CombinerState { 45 SysBusDevice parent_obj; 46 47 MemoryRegion iomem; 48 49 struct CombinerGroupState group[IIC_NGRP]; 50 uint32_t reg_set[IIC_REGSET_SIZE]; 51 uint32_t icipsr[2]; 52 uint32_t external; /* 1 means that this combiner is external */ 53 54 qemu_irq output_irq[IIC_NGRP]; 55 }; 56 57 #endif 58