aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2015-09-28 12:51:19 -0400
committerJoachim Eastwood <manabian@gmail.com>2015-09-29 16:19:02 -0400
commitb794df56cbb46e031c29922acb24617b72f8f5a7 (patch)
tree8086aeacc9517276892112f7dfa1d19ef2c4f507
parent5b32b1368ae532a2d06c931ba6356c39a9de63ac (diff)
memory: pl172: add ARM PrimeCell PL175 MPMC support
The change adds support of ARM PrimeCell PL175 MPMC, the controller is found on NXP LPC32xx SoC. PL175 MPMC is very similar to PL172 controller, so it is preferred to add its support into the existing driver. One of the differences between PL172 and PL175 is that the latter one supports up to 6 AHB ports, but still only 4 AHB ports can be assigned to a static memory device, also PL175 does not have write buffer enable control in static memory configuration register. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
-rw-r--r--drivers/memory/pl172.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/memory/pl172.c b/drivers/memory/pl172.c
index 95a4ad72c992..cb6ebb8e3a80 100644
--- a/drivers/memory/pl172.c
+++ b/drivers/memory/pl172.c
@@ -118,7 +118,8 @@ static int pl172_setup_static(struct amba_device *adev,
118 if (of_property_read_bool(np, "mpmc,extended-wait")) 118 if (of_property_read_bool(np, "mpmc,extended-wait"))
119 cfg |= MPMC_STATIC_CFG_EW; 119 cfg |= MPMC_STATIC_CFG_EW;
120 120
121 if (of_property_read_bool(np, "mpmc,buffer-enable")) 121 if (amba_part(adev) == 0x172 &&
122 of_property_read_bool(np, "mpmc,buffer-enable"))
122 cfg |= MPMC_STATIC_CFG_B; 123 cfg |= MPMC_STATIC_CFG_B;
123 124
124 if (of_property_read_bool(np, "mpmc,write-protect")) 125 if (of_property_read_bool(np, "mpmc,write-protect"))
@@ -190,6 +191,7 @@ static int pl172_parse_cs_config(struct amba_device *adev,
190} 191}
191 192
192static const char * const pl172_revisions[] = {"r1", "r2", "r2p3", "r2p4"}; 193static const char * const pl172_revisions[] = {"r1", "r2", "r2p3", "r2p4"};
194static const char * const pl175_revisions[] = {"r1"};
193 195
194static int pl172_probe(struct amba_device *adev, const struct amba_id *id) 196static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
195{ 197{
@@ -202,6 +204,9 @@ static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
202 if (amba_part(adev) == 0x172) { 204 if (amba_part(adev) == 0x172) {
203 if (amba_rev(adev) < ARRAY_SIZE(pl172_revisions)) 205 if (amba_rev(adev) < ARRAY_SIZE(pl172_revisions))
204 rev = pl172_revisions[amba_rev(adev)]; 206 rev = pl172_revisions[amba_rev(adev)];
207 } else if (amba_part(adev) == 0x175) {
208 if (amba_rev(adev) < ARRAY_SIZE(pl175_revisions))
209 rev = pl175_revisions[amba_rev(adev)];
205 } 210 }
206 211
207 dev_info(dev, "ARM PL%x revision %s\n", amba_part(adev), rev); 212 dev_info(dev, "ARM PL%x revision %s\n", amba_part(adev), rev);
@@ -283,6 +288,11 @@ static const struct amba_id pl172_ids[] = {
283 .id = 0x07041172, 288 .id = 0x07041172,
284 .mask = 0x3f0fffff, 289 .mask = 0x3f0fffff,
285 }, 290 },
291 /* PrimeCell MPMC PL175, EMC found on NXP LPC32xx */
292 {
293 .id = 0x07041175,
294 .mask = 0x3f0fffff,
295 },
286 { 0, 0 }, 296 { 0, 0 },
287}; 297};
288MODULE_DEVICE_TABLE(amba, pl172_ids); 298MODULE_DEVICE_TABLE(amba, pl172_ids);