RE: [PATCH 1/3] iommu/ipmmu-vmsa: Remove some unused register declarations
Hi Geert-san, > From: Geert Uytterhoeven, Sent: Friday, October 11, 2019 9:11 PM > > Hi Shimoda-san, > > Thanks for your patch! > > On Wed, Oct 9, 2019 at 10:27 AM Yoshihiro Shimoda > wrote: > > To support different registers memory mapping hardware easily > > in the future, this patch removes some unused register > > declarations. > > > > Signed-off-by: Yoshihiro Shimoda > > Reviewed-by: Geert Uytterhoeven Thank you for your review! > While I can confirm the removed definitions are unused, they were > still valid (but see comments below). > Perhaps it would be better to add comments, to state clearly to which > SoCs or SoC families they apply? Or do you think this would be futile, > and would add too much clutter to the source file in the near future? I think adding comments to the declarations are better to avoid incorrect implementation in the future. So, I'll make such an incremental patch. > > --- a/drivers/iommu/ipmmu-vmsa.c > > +++ b/drivers/iommu/ipmmu-vmsa.c > > @@ -104,8 +104,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device > > *dev) > > #define IMCTR 0x > > #define IMCTR_TRE (1 << 17) > > #define IMCTR_AFE (1 << 16) > > -#define IMCTR_RTSEL_MASK (3 << 4) > > FWIW, this is valid for R-Car Gen2 only. On R-Car Gen3, the field > contains 3 bits. That's correct. Best regards, Yoshihiro Shimoda > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > ge...@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like > that. > -- Linus Torvalds ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH 1/3] iommu/ipmmu-vmsa: Remove some unused register declarations
Hi Shimoda-san, Thanks for your patch! On Wed, Oct 9, 2019 at 10:27 AM Yoshihiro Shimoda wrote: > To support different registers memory mapping hardware easily > in the future, this patch removes some unused register > declarations. > > Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven While I can confirm the removed definitions are unused, they were still valid (but see comments below). Perhaps it would be better to add comments, to state clearly to which SoCs or SoC families they apply? Or do you think this would be futile, and would add too much clutter to the source file in the near future? > --- a/drivers/iommu/ipmmu-vmsa.c > +++ b/drivers/iommu/ipmmu-vmsa.c > @@ -104,8 +104,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device > *dev) > #define IMCTR 0x > #define IMCTR_TRE (1 << 17) > #define IMCTR_AFE (1 << 16) > -#define IMCTR_RTSEL_MASK (3 << 4) FWIW, this is valid for R-Car Gen2 only. On R-Car Gen3, the field contains 3 bits. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 1/3] iommu/ipmmu-vmsa: Remove some unused register declarations
Hi Shimoda-san, Thanks for your patch. On 2019-10-09 17:26:47 +0900, Yoshihiro Shimoda wrote: > To support different registers memory mapping hardware easily > in the future, this patch removes some unused register > declarations. > > Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 11 --- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c > index 9da8309..dd554c2 100644 > --- a/drivers/iommu/ipmmu-vmsa.c > +++ b/drivers/iommu/ipmmu-vmsa.c > @@ -104,8 +104,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device > *dev) > #define IMCTR0x > #define IMCTR_TRE(1 << 17) > #define IMCTR_AFE(1 << 16) > -#define IMCTR_RTSEL_MASK (3 << 4) > -#define IMCTR_RTSEL_SHIFT4 > #define IMCTR_TREN (1 << 3) > #define IMCTR_INTEN (1 << 2) > #define IMCTR_FLUSH (1 << 1) > @@ -115,7 +113,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device > *dev) > > #define IMTTBCR 0x0008 > #define IMTTBCR_EAE (1 << 31) > -#define IMTTBCR_PMB (1 << 30) > #define IMTTBCR_SH1_NON_SHAREABLE(0 << 28) /* R-Car Gen2 only */ > #define IMTTBCR_SH1_OUTER_SHAREABLE (2 << 28) /* R-Car Gen2 only */ > #define IMTTBCR_SH1_INNER_SHAREABLE (3 << 28) /* R-Car Gen2 only */ > @@ -193,12 +190,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device > *dev) > #define IMELAR 0x0030 /* IMEAR on R-Car Gen2 > */ > #define IMEUAR 0x0034 /* R-Car Gen3 only */ > > -#define IMPCTR 0x0200 > -#define IMPSTR 0x0208 > -#define IMPEAR 0x020c > -#define IMPMBA(n)(0x0280 + ((n) * 4)) > -#define IMPMBD(n)(0x02c0 + ((n) * 4)) > - > #define IMUCTR(n)((n) < 32 ? IMUCTR0(n) : IMUCTR32(n)) > #define IMUCTR0(n) (0x0300 + ((n) * 16)) > #define IMUCTR32(n) (0x0600 + (((n) - 32) * 16)) > @@ -206,8 +197,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device > *dev) > #define IMUCTR_FIXADD_MASK (0xff << 16) > #define IMUCTR_FIXADD_SHIFT 16 > #define IMUCTR_TTSEL_MMU(n) ((n) << 4) > -#define IMUCTR_TTSEL_PMB (8 << 4) > -#define IMUCTR_TTSEL_MASK(15 << 4) > #define IMUCTR_FLUSH (1 << 1) > #define IMUCTR_MMUEN (1 << 0) > > -- > 2.7.4 > -- Regards, Niklas Söderlund
[PATCH 1/3] iommu/ipmmu-vmsa: Remove some unused register declarations
To support different registers memory mapping hardware easily in the future, this patch removes some unused register declarations. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/ipmmu-vmsa.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 9da8309..dd554c2 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -104,8 +104,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device *dev) #define IMCTR 0x #define IMCTR_TRE (1 << 17) #define IMCTR_AFE (1 << 16) -#define IMCTR_RTSEL_MASK (3 << 4) -#define IMCTR_RTSEL_SHIFT 4 #define IMCTR_TREN (1 << 3) #define IMCTR_INTEN(1 << 2) #define IMCTR_FLUSH(1 << 1) @@ -115,7 +113,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device *dev) #define IMTTBCR0x0008 #define IMTTBCR_EAE(1 << 31) -#define IMTTBCR_PMB(1 << 30) #define IMTTBCR_SH1_NON_SHAREABLE (0 << 28) /* R-Car Gen2 only */ #define IMTTBCR_SH1_OUTER_SHAREABLE(2 << 28) /* R-Car Gen2 only */ #define IMTTBCR_SH1_INNER_SHAREABLE(3 << 28) /* R-Car Gen2 only */ @@ -193,12 +190,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device *dev) #define IMELAR 0x0030 /* IMEAR on R-Car Gen2 */ #define IMEUAR 0x0034 /* R-Car Gen3 only */ -#define IMPCTR 0x0200 -#define IMPSTR 0x0208 -#define IMPEAR 0x020c -#define IMPMBA(n) (0x0280 + ((n) * 4)) -#define IMPMBD(n) (0x02c0 + ((n) * 4)) - #define IMUCTR(n) ((n) < 32 ? IMUCTR0(n) : IMUCTR32(n)) #define IMUCTR0(n) (0x0300 + ((n) * 16)) #define IMUCTR32(n)(0x0600 + (((n) - 32) * 16)) @@ -206,8 +197,6 @@ static struct ipmmu_vmsa_device *to_ipmmu(struct device *dev) #define IMUCTR_FIXADD_MASK (0xff << 16) #define IMUCTR_FIXADD_SHIFT16 #define IMUCTR_TTSEL_MMU(n)((n) << 4) -#define IMUCTR_TTSEL_PMB (8 << 4) -#define IMUCTR_TTSEL_MASK (15 << 4) #define IMUCTR_FLUSH (1 << 1) #define IMUCTR_MMUEN (1 << 0) -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu