1b0104773SPascal Brand /* 2b0104773SPascal Brand * Copyright (c) 2014, STMicroelectronics International N.V. 3b0104773SPascal Brand * All rights reserved. 4b0104773SPascal Brand * 5b0104773SPascal Brand * Redistribution and use in source and binary forms, with or without 6b0104773SPascal Brand * modification, are permitted provided that the following conditions are met: 7b0104773SPascal Brand * 8b0104773SPascal Brand * 1. Redistributions of source code must retain the above copyright notice, 9b0104773SPascal Brand * this list of conditions and the following disclaimer. 10b0104773SPascal Brand * 11b0104773SPascal Brand * 2. Redistributions in binary form must reproduce the above copyright notice, 12b0104773SPascal Brand * this list of conditions and the following disclaimer in the documentation 13b0104773SPascal Brand * and/or other materials provided with the distribution. 14b0104773SPascal Brand * 15b0104773SPascal Brand * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16b0104773SPascal Brand * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17b0104773SPascal Brand * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18b0104773SPascal Brand * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 19b0104773SPascal Brand * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20b0104773SPascal Brand * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21b0104773SPascal Brand * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22b0104773SPascal Brand * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23b0104773SPascal Brand * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24b0104773SPascal Brand * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25b0104773SPascal Brand * POSSIBILITY OF SUCH DAMAGE. 26b0104773SPascal Brand */ 27b0104773SPascal Brand 28b0104773SPascal Brand #ifndef GIC_H 29b0104773SPascal Brand #define GIC_H 30ec219598SPascal Brand #include <types_ext.h> 31b0104773SPascal Brand 32b0104773SPascal Brand void gic_init(paddr_t gicc_base, paddr_t gicd_base); 3353bd332aSSY Chiu /* initial base address only */ 3453bd332aSSY Chiu void gic_init_base_addr(vaddr_t gicc_base, vaddr_t gicd_base); 35*bedc2b9fSsunny /* initial cpu if only, mainly use for secondary cpu setup cpu interface */ 36*bedc2b9fSsunny void gic_cpu_init(void); 37b0104773SPascal Brand 38b0104773SPascal Brand void gic_it_add(size_t it); 39b0104773SPascal Brand void gic_it_set_cpu_mask(size_t it, uint8_t cpu_mask); 40b0104773SPascal Brand void gic_it_set_prio(size_t it, uint8_t prio); 41b0104773SPascal Brand void gic_it_enable(size_t it); 42b0104773SPascal Brand void gic_it_disable(size_t it); 43b0104773SPascal Brand 44b0104773SPascal Brand uint32_t gic_read_iar(void); 45b0104773SPascal Brand void gic_write_eoir(uint32_t eoir); 46b0104773SPascal Brand 4753bd332aSSY Chiu bool gic_it_is_enabled(size_t it); 4853bd332aSSY Chiu bool gic_it_get_group(size_t it); 4953bd332aSSY Chiu uint32_t gic_it_get_target(size_t it); 5053bd332aSSY Chiu void gic_dump_state(void); 51b0104773SPascal Brand #endif /*GIC_H*/ 52b0104773SPascal Brand 53