Skip to content

Commit

Permalink
[review] drivers: gic: allow detection type configuration
Browse files Browse the repository at this point in the history
Prefix added GIC macro names with GICD_.
Allow args count to be higher than 3 in dt_get_gic_chip_cb().

Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Jan 29, 2025
1 parent ddcfebd commit 6cb9072
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/drivers/gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@
#define GICD_SGIR_CPU_TARGET_LIST_SHIFT 16

/* GICD ICFGR bit fields */
#define ICFGR_TYPE_EDGE 2
#define ICFGR_TYPE_LEVEL 0
#define ICFGR_FIELD_BITS 2
#define ICFGR_FIELD_MASK 0x3
#define ICFGR_NUM_INTS_PER_REG (NUM_INTS_PER_REG / ICFGR_FIELD_BITS)
#define GICD_ICFGR_TYPE_EDGE 2
#define GICD_ICFGR_TYPE_LEVEL 0
#define GICD_ICFGR_FIELD_BITS 2
#define GICD_ICFGR_FIELD_MASK 0x3
#define GICD_ICFGR_NUM_INTS_PER_REG (NUM_INTS_PER_REG / ICFGR_FIELD_BITS)

struct gic_data {
vaddr_t gicc_base;
Expand Down Expand Up @@ -1112,7 +1112,7 @@ static TEE_Result dt_get_gic_chip_cb(struct dt_pargs *arg, void *priv_data,

phandle_args[0] = cpu_to_fdt32(arg->args[0]);
phandle_args[1] = cpu_to_fdt32(arg->args[1]);
if (arg->args_count == 3)
if (arg->args_count >= 3)
phandle_args[2] = cpu_to_fdt32(arg->args[2]);

itr_num = gic_dt_get_irq((const void *)phandle_args, arg->args_count,
Expand Down

0 comments on commit 6cb9072

Please sign in to comment.