diff options
-rw-r--r-- | remoteproc/juno_fpga_reset.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/remoteproc/juno_fpga_reset.c b/remoteproc/juno_fpga_reset.c index 29b2eb9..0d29c20 100644 --- a/remoteproc/juno_fpga_reset.c +++ b/remoteproc/juno_fpga_reset.c @@ -25,7 +25,7 @@ #include <linux/platform_device.h> #include <linux/reset-controller.h> -#define JUNO_FPGA_RESET_DRIVER_VERSION "0.0.1" +#define JUNO_FPGA_RESET_DRIVER_VERSION "0.1.0" struct juno_fpga_reset { struct reset_controller_dev rst; @@ -33,6 +33,10 @@ struct juno_fpga_reset { void __iomem *base; }; +/* Supported controller IDs */ +#define JUNO_FPGA_RESET_MIN_SUPPORTED_ID 0x2010f +#define JUNO_FPGA_RESET_MAX_SUPPORTED_ID 0x20113 + #define JUNO_FPGA_RESET_ID(base) (base) #define JUNO_FPGA_RESET_SOFT_RESET(base) ((base) + 0x140) #define JUNO_FPGA_RESET_CPU_WAIT(base) ((base) + 0x144) @@ -53,11 +57,9 @@ static void __iomem *verify_and_remap(struct device *dev, id = readl(JUNO_FPGA_RESET_ID(base)); - if (id != 0x2010f && - id != 0x20110 && - id != 0x20111 && - id != 0x20112) { - dev_err(dev, "ID not matching"); + if (id < JUNO_FPGA_RESET_MIN_SUPPORTED_ID || + id > JUNO_FPGA_RESET_MAX_SUPPORTED_ID) { + dev_err(dev, "Unknown controller ID: %u", id); return IOMEM_ERR_PTR(-EINVAL); } |