aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2015-07-09 10:31:45 -0400
committerRoger Quadros <rogerq@ti.com>2016-04-15 04:53:54 -0400
commitbdd7e033fe4cc3836b141b75119a4a975a64d9bc (patch)
tree192c9aa7566f621f0d6dacf9346b5d57640aa8ae /drivers/memory
parent51735caad3db6237fa9d31a2ce8b54cbd42ff6f0 (diff)
memory: omap-gpmc: Prevent mapping into 1st 16MB
We have been preventing mapping GPMC children in the first 1MB but really it has to be the first 16MB as the minimum GPMC partition size is 16MB. Also print an error message if CS mapping fails due to DT requesting address outside the GPMC map. Signed-off-by: Roger Quadros <rogerq@ti.com> Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/omap-gpmc.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 8dc6e3b1c44a..bfe4e8710973 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -94,6 +94,14 @@
94#define GPMC_CS_SIZE 0x30 94#define GPMC_CS_SIZE 0x30
95#define GPMC_BCH_SIZE 0x10 95#define GPMC_BCH_SIZE 0x10
96 96
97/*
98 * The first 1MB of GPMC address space is typically mapped to
99 * the internal ROM. Never allocate the first page, to
100 * facilitate bug detection; even if we didn't boot from ROM.
101 * As GPMC minimum partition size is 16MB we can only start from
102 * there.
103 */
104#define GPMC_MEM_START 0x1000000
97#define GPMC_MEM_END 0x3FFFFFFF 105#define GPMC_MEM_END 0x3FFFFFFF
98 106
99#define GPMC_CHUNK_SHIFT 24 /* 16 MB */ 107#define GPMC_CHUNK_SHIFT 24 /* 16 MB */
@@ -1297,12 +1305,7 @@ static void gpmc_mem_init(void)
1297{ 1305{
1298 int cs; 1306 int cs;
1299 1307
1300 /* 1308 gpmc_mem_root.start = GPMC_MEM_START;
1301 * The first 1MB of GPMC address space is typically mapped to
1302 * the internal ROM. Never allocate the first page, to
1303 * facilitate bug detection; even if we didn't boot from ROM.
1304 */
1305 gpmc_mem_root.start = SZ_1M;
1306 gpmc_mem_root.end = GPMC_MEM_END; 1309 gpmc_mem_root.end = GPMC_MEM_END;
1307 1310
1308 /* Reserve all regions that has been set up by bootloader */ 1311 /* Reserve all regions that has been set up by bootloader */
@@ -1966,6 +1969,15 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
1966 if (ret < 0) { 1969 if (ret < 0) {
1967 dev_err(&pdev->dev, "cannot remap GPMC CS %d to %pa\n", 1970 dev_err(&pdev->dev, "cannot remap GPMC CS %d to %pa\n",
1968 cs, &res.start); 1971 cs, &res.start);
1972 if (res.start < GPMC_MEM_START) {
1973 dev_info(&pdev->dev,
1974 "GPMC CS %d start cannot be lesser than 0x%x\n",
1975 cs, GPMC_MEM_START);
1976 } else if (res.end > GPMC_MEM_END) {
1977 dev_info(&pdev->dev,
1978 "GPMC CS %d end cannot be greater than 0x%x\n",
1979 cs, GPMC_MEM_END);
1980 }
1969 goto err; 1981 goto err;
1970 } 1982 }
1971 1983