@@ -734,54 +734,41 @@ static int ipmmu_init_platform_device(struct device *dev,
734
734
return 0 ;
735
735
}
736
736
737
- static const struct soc_device_attribute soc_rcar_gen3 [] = {
738
- { .soc_id = "r8a774a1" , },
739
- { .soc_id = "r8a774b1" , },
740
- { .soc_id = "r8a774c0" , },
741
- { .soc_id = "r8a774e1" , },
742
- { .soc_id = "r8a7795" , },
743
- { .soc_id = "r8a77961" , },
744
- { .soc_id = "r8a7796" , },
745
- { .soc_id = "r8a77965" , },
746
- { .soc_id = "r8a77970" , },
747
- { .soc_id = "r8a77990" , },
748
- { .soc_id = "r8a77995" , },
737
+ static const struct soc_device_attribute soc_needs_opt_in [] = {
738
+ { .family = "R-Car Gen3" , },
739
+ { .family = "RZ/G2" , },
749
740
{ /* sentinel */ }
750
741
};
751
742
752
- static const struct soc_device_attribute soc_rcar_gen3_whitelist [] = {
753
- { .soc_id = "r8a774b1" , },
754
- { .soc_id = "r8a774c0" , },
755
- { .soc_id = "r8a774e1" , },
756
- { .soc_id = "r8a7795" , .revision = "ES3.*" },
757
- { .soc_id = "r8a77961" , },
758
- { .soc_id = "r8a77965" , },
759
- { .soc_id = "r8a77990" , },
760
- { .soc_id = "r8a77995" , },
743
+ static const struct soc_device_attribute soc_denylist [] = {
744
+ { .soc_id = "r8a774a1" , },
745
+ { .soc_id = "r8a7795" , .revision = "ES1.*" },
746
+ { .soc_id = "r8a7795" , .revision = "ES2.*" },
747
+ { .soc_id = "r8a7796" , },
761
748
{ /* sentinel */ }
762
749
};
763
750
764
- static const char * const rcar_gen3_slave_whitelist [] = {
751
+ static const char * const devices_allowlist [] = {
765
752
};
766
753
767
- static bool ipmmu_slave_whitelist (struct device * dev )
754
+ static bool ipmmu_device_is_allowed (struct device * dev )
768
755
{
769
756
unsigned int i ;
770
757
771
758
/*
772
- * For R-Car Gen3 use a white list to opt-in slave devices.
759
+ * R-Car Gen3 and RZ/G2 use the allow list to opt-in devices.
773
760
* For Other SoCs, this returns true anyway.
774
761
*/
775
- if (!soc_device_match (soc_rcar_gen3 ))
762
+ if (!soc_device_match (soc_needs_opt_in ))
776
763
return true;
777
764
778
- /* Check whether this R-Car Gen3 can use the IPMMU correctly or not */
779
- if (! soc_device_match (soc_rcar_gen3_whitelist ))
765
+ /* Check whether this SoC can use the IPMMU correctly or not */
766
+ if (soc_device_match (soc_denylist ))
780
767
return false;
781
768
782
- /* Check whether this slave device can work with the IPMMU */
783
- for (i = 0 ; i < ARRAY_SIZE (rcar_gen3_slave_whitelist ); i ++ ) {
784
- if (!strcmp (dev_name (dev ), rcar_gen3_slave_whitelist [i ]))
769
+ /* Check whether this device can work with the IPMMU */
770
+ for (i = 0 ; i < ARRAY_SIZE (devices_allowlist ); i ++ ) {
771
+ if (!strcmp (dev_name (dev ), devices_allowlist [i ]))
785
772
return true;
786
773
}
787
774
@@ -792,7 +779,7 @@ static bool ipmmu_slave_whitelist(struct device *dev)
792
779
static int ipmmu_of_xlate (struct device * dev ,
793
780
struct of_phandle_args * spec )
794
781
{
795
- if (!ipmmu_slave_whitelist (dev ))
782
+ if (!ipmmu_device_is_allowed (dev ))
796
783
return - ENODEV ;
797
784
798
785
iommu_fwspec_add_ids (dev , spec -> args , 1 );
0 commit comments