Support for additional ARM MPMCs to the PL172 driver and an update to

the bindings documentation to reflect this from Vladimir Zapolskiy.
 
 "The change adds support of ARM PrimeCell PL175 MPMC and PL176 MPMC,
  the static memory controllers on devices are similar to one found on
  ARM PrimeCell PL172, add support to the existing driver."
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQEcBAABCAAGBQJWFtaVAAoJEF5zSH4+/j/ajj4H/1Yi5EZXpfSnSrLzETEkJbXF
 VH0RLMA2ODgAgZEJt1y2mS0OW2ImDz2UIUDK86BbPP6cvyTxJft56nAMm8JHRrNU
 M6PkOVIgkcSflqIW3LwJlW/TsXYvuaZQ+JJREZeeZT82IxQYAWyfnrKEyypfRTp2
 1HTwTJv3E0RR0oefRF4kXnfHuRUlRcFbRjm4NyjH/mIj4HGIK+Vwjirkjq9U6xYn
 7dGYj89soxVtlaSH/TTG9F4LnmGk/vOsvXlLBxgvYUWfOHvQDxgxPErVrj7GE2vv
 tZ0iLs2tv4dbVo6D/YdQfLP576fKoVbjN3iKvlhP22w67b/QxVPXSgFxier5HK0=
 =/iBk
 -----END PGP SIGNATURE-----

Merge tag 'drivers_pl172_for_4.4' of https://github.com/manabian/linux-lpc into next/drivers

Merge "PL172 driver updates for v4.4" from Joachim Eastwood:

Support for additional ARM MPMCs to the PL172 driver and an update to
the bindings documentation to reflect this from Vladimir Zapolskiy.

"The change adds support of ARM PrimeCell PL175 MPMC and PL176 MPMC,
 the static memory controllers on devices are similar to one found on
 ARM PrimeCell PL172, add support to the existing driver."

* tag 'drivers_pl172_for_4.4' of https://github.com/manabian/linux-lpc:
  doc: dt: arm,pl172: add description of PL175 and PL176 controllers
  memory: pl172: add ARM PrimeCell PL176 MPMC support
  memory: pl172: add ARM PrimeCell PL175 MPMC support
  memory: pl172: correct MPMC peripheral ID register bits
This commit is contained in:
Arnd Bergmann 2015-10-15 22:26:03 +02:00
commit 7a0205bc18
2 changed files with 28 additions and 6 deletions

View File

@ -1,8 +1,9 @@
* Device tree bindings for ARM PL172 MultiPort Memory Controller * Device tree bindings for ARM PL172/PL175/PL176 MultiPort Memory Controller
Required properties: Required properties:
- compatible: "arm,pl172", "arm,primecell" - compatible: Must be "arm,primecell" and exactly one from
"arm,pl172", "arm,pl175" or "arm,pl176".
- reg: Must contains offset/length value for controller. - reg: Must contains offset/length value for controller.
@ -56,7 +57,8 @@ Optional child cs node config properties:
- mpmc,extended-wait: Enable extended wait. - mpmc,extended-wait: Enable extended wait.
- mpmc,buffer-enable: Enable write buffer. - mpmc,buffer-enable: Enable write buffer, option is not supported by
PL175 and PL176 controllers.
- mpmc,write-protect: Enable write protect. - mpmc,write-protect: Enable write protect.

View File

@ -118,7 +118,8 @@ static int pl172_setup_static(struct amba_device *adev,
if (of_property_read_bool(np, "mpmc,extended-wait")) if (of_property_read_bool(np, "mpmc,extended-wait"))
cfg |= MPMC_STATIC_CFG_EW; cfg |= MPMC_STATIC_CFG_EW;
if (of_property_read_bool(np, "mpmc,buffer-enable")) if (amba_part(adev) == 0x172 &&
of_property_read_bool(np, "mpmc,buffer-enable"))
cfg |= MPMC_STATIC_CFG_B; cfg |= MPMC_STATIC_CFG_B;
if (of_property_read_bool(np, "mpmc,write-protect")) if (of_property_read_bool(np, "mpmc,write-protect"))
@ -190,6 +191,8 @@ static int pl172_parse_cs_config(struct amba_device *adev,
} }
static const char * const pl172_revisions[] = {"r1", "r2", "r2p3", "r2p4"}; static const char * const pl172_revisions[] = {"r1", "r2", "r2p3", "r2p4"};
static const char * const pl175_revisions[] = {"r1"};
static const char * const pl176_revisions[] = {"r0"};
static int pl172_probe(struct amba_device *adev, const struct amba_id *id) static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
{ {
@ -202,6 +205,12 @@ static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
if (amba_part(adev) == 0x172) { if (amba_part(adev) == 0x172) {
if (amba_rev(adev) < ARRAY_SIZE(pl172_revisions)) if (amba_rev(adev) < ARRAY_SIZE(pl172_revisions))
rev = pl172_revisions[amba_rev(adev)]; rev = pl172_revisions[amba_rev(adev)];
} else if (amba_part(adev) == 0x175) {
if (amba_rev(adev) < ARRAY_SIZE(pl175_revisions))
rev = pl175_revisions[amba_rev(adev)];
} else if (amba_part(adev) == 0x176) {
if (amba_rev(adev) < ARRAY_SIZE(pl176_revisions))
rev = pl176_revisions[amba_rev(adev)];
} }
dev_info(dev, "ARM PL%x revision %s\n", amba_part(adev), rev); dev_info(dev, "ARM PL%x revision %s\n", amba_part(adev), rev);
@ -278,9 +287,20 @@ static int pl172_remove(struct amba_device *adev)
} }
static const struct amba_id pl172_ids[] = { static const struct amba_id pl172_ids[] = {
/* PrimeCell MPMC PL172, EMC found on NXP LPC18xx and LPC43xx */
{ {
.id = 0x07341172, .id = 0x07041172,
.mask = 0xffffffff, .mask = 0x3f0fffff,
},
/* PrimeCell MPMC PL175, EMC found on NXP LPC32xx */
{
.id = 0x07041175,
.mask = 0x3f0fffff,
},
/* PrimeCell MPMC PL176 */
{
.id = 0x89041176,
.mask = 0xff0fffff,
}, },
{ 0, 0 }, { 0, 0 },
}; };