- Restrict GPC driver on register range that is accessible by regmap,
    so that we can avoid user space from triggering imprecise external
    abort exception.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJbUD1eAAoJEFBXWFqHsHzOdR4IALmrzHZHPLKzfPmQitoO3c/E
 qCcM8kAOoEPg9toIj3Gkte3XCRS7+gYaPhwvtJ48n3x0zcB7mSs/PhiKbpF+e/gK
 /4w6iDoeqhkb+ITcn1qeM8OpsYhDV5FF2NLsoKjQmOhVts9yg/JUwMP4nTIElOM5
 cAEAzCM/RCkZjte8NWDgculB2Wre/AsNEiSlVU8p3uZl8UY30BDnvMmlQ1eewSsi
 gARfkI49AEQJZVIO9LClGRmkg1NMDnPGM1Bh0tUWMX7UhvPfO97VfshJtVklDi26
 o29rC6nmLV7D/jfpWbcEKuVAXkOuRFf/3h8Wi4hN1577L1V0l+ABNhkpC14pmvo=
 =Klg3
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into fixes

i.MX fixes for 4.18, round 3:
 - Restrict GPC driver on register range that is accessible by regmap,
   so that we can avoid user space from triggering imprecise external
   abort exception.

* tag 'imx-fixes-4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  soc: imx: gpc: restrict register range for regmap access

Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2018-07-19 15:09:59 -07:00
Родитель 1f9f163500 de2d9b5284
Коммит 8b369c0073
1 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -27,9 +27,16 @@
#define GPC_PGC_SW2ISO_SHIFT 0x8 #define GPC_PGC_SW2ISO_SHIFT 0x8
#define GPC_PGC_SW_SHIFT 0x0 #define GPC_PGC_SW_SHIFT 0x0
#define GPC_PGC_PCI_PDN 0x200
#define GPC_PGC_PCI_SR 0x20c
#define GPC_PGC_GPU_PDN 0x260 #define GPC_PGC_GPU_PDN 0x260
#define GPC_PGC_GPU_PUPSCR 0x264 #define GPC_PGC_GPU_PUPSCR 0x264
#define GPC_PGC_GPU_PDNSCR 0x268 #define GPC_PGC_GPU_PDNSCR 0x268
#define GPC_PGC_GPU_SR 0x26c
#define GPC_PGC_DISP_PDN 0x240
#define GPC_PGC_DISP_SR 0x24c
#define GPU_VPU_PUP_REQ BIT(1) #define GPU_VPU_PUP_REQ BIT(1)
#define GPU_VPU_PDN_REQ BIT(0) #define GPU_VPU_PDN_REQ BIT(0)
@ -318,10 +325,24 @@ static const struct of_device_id imx_gpc_dt_ids[] = {
{ } { }
}; };
static const struct regmap_range yes_ranges[] = {
regmap_reg_range(GPC_CNTR, GPC_CNTR),
regmap_reg_range(GPC_PGC_PCI_PDN, GPC_PGC_PCI_SR),
regmap_reg_range(GPC_PGC_GPU_PDN, GPC_PGC_GPU_SR),
regmap_reg_range(GPC_PGC_DISP_PDN, GPC_PGC_DISP_SR),
};
static const struct regmap_access_table access_table = {
.yes_ranges = yes_ranges,
.n_yes_ranges = ARRAY_SIZE(yes_ranges),
};
static const struct regmap_config imx_gpc_regmap_config = { static const struct regmap_config imx_gpc_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
.rd_table = &access_table,
.wr_table = &access_table,
.max_register = 0x2ac, .max_register = 0x2ac,
}; };