3986153a284c76d77aabcff3798b0ca13c628b41
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
10 #include "platform_def.h"
15 * For LS1043a rev1.0, GIC base address align with 4k.
16 * For LS1043a rev1.1, if DCFG_GIC400_ALIGN[GIC_ADDR_BIT]
17 * is set, GIC base address align with 4K, or else align
20 void get_gic_offset(uint32_t *gicc_base
, uint32_t *gicd_base
)
23 uint32_t *ccsr_svr
= (uint32_t *)DCFG_CCSR_SVR
;
24 uint32_t *gic_align
= (uint32_t *)SCFG_GIC400_ALIGN
;
28 val
= be32toh(mmio_read_32((uintptr_t)ccsr_svr
));
29 soc_dev_id
= val
& (SVR_WO_E
<< 8);
31 if ((soc_dev_id
== (SVR_LS1043A
<< 8) ||
32 soc_dev_id
== (SVR_LS1043AE
<< 8)) &&
33 ((val
& 0xff) == REV1_1
)) {
34 val
= be32toh(mmio_read_32((uintptr_t)gic_align
));
35 if (val
& (1 << GIC_ADDR_BIT
)) {
36 *gicc_base
= GICC_BASE
;
37 *gicd_base
= GICD_BASE
;
39 *gicc_base
= GICC_BASE_64K
;
40 *gicd_base
= GICD_BASE_64K
;
43 *gicc_base
= GICC_BASE
;
44 *gicd_base
= GICD_BASE
;