ARM: OMAP4+: Move SRAM data to DT
authorRajendra Nayak <rnayak@ti.com>
Wed, 10 Sep 2014 16:04:03 +0000 (11:04 -0500)
committerTony Lindgren <tony@atomide.com>
Thu, 18 Sep 2014 16:47:00 +0000 (09:47 -0700)
Use drivers/misc/sram.c driver to manage SRAM on all DT only
OMAP platforms (am33xx, am43xx, omap4 and omap5) instead of
the existing private plat-omap/sram.c

Address and size related data  is removed from mach-omap2/sram.c
and now passed to drivers/misc/sram.c from DT.

Users can hence use general purpose allocator apis instead of
OMAP private ones to manage and use SRAM.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/boot/dts/am33xx.dtsi
arch/arm/boot/dts/am4372.dtsi
arch/arm/boot/dts/omap4.dtsi
arch/arm/boot/dts/omap5.dtsi
arch/arm/configs/omap2plus_defconfig
arch/arm/mach-omap2/sram.c
arch/arm/mach-omap2/sram.h

index 3a0a161342bafb7299b08ca9a80391f0edb47382..c8238c467acfc10ab344311900ad0423b6af0669 100644 (file)
                };
 
                ocmcram: ocmcram@40300000 {
-                       compatible = "ti,am3352-ocmcram";
-                       reg = <0x40300000 0x10000>;
-                       ti,hwmods = "ocmcram";
+                       compatible = "mmio-sram";
+                       reg = <0x40300000 0x10000>; /* 64k */
                };
 
                wkup_m3: wkup_m3@44d00000 {
index 9b3d2ba82f13a1b6aaf725c0e529255310726052..7b8e6521235bd7f69bdfb114d9e09a81bcca6e29 100644 (file)
                                clock-names = "fck";
                        };
                };
+
+               ocmcram: ocmcram@40300000 {
+                       compatible = "mmio-sram";
+                       reg = <0x40300000 0x40000>; /* 256k */
+               };
        };
 };
 
index 7375d4482bffd2cead810b400649f924f15c5039..e54992f0bf27bc6df3c4a1771eb5fd7d3e73ac46 100644 (file)
                        };
                };
 
+               ocmcram: ocmcram@40304000 {
+                       compatible = "mmio-sram";
+                       reg = <0x40304000 0xa000>; /* 40k */
+               };
+
                sdma: dma-controller@4a056000 {
                        compatible = "ti,omap4430-sdma";
                        reg = <0x4a056000 0x1000>;
index df0a09b81ba20ac482abe6fa0e1f6b0c71cee261..779d4da19f3b099320d22e3231876543facc4d65 100644 (file)
                        };
                };
 
+               ocmcram: ocmcram@40300000 {
+                       compatible = "mmio-sram";
+                       reg = <0x40300000 0x20000>; /* 128k */
+               };
+
                sdma: dma-controller@4a056000 {
                        compatible = "ti,omap4430-sdma";
                        reg = <0x4a056000 0x1000>;
index 986165451e7f48f5d61d090290faeea45da14de1..69c7bed3c634dd3ec2881e3b478340fbe3d4dffd 100644 (file)
@@ -122,6 +122,7 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
 CONFIG_SENSORS_TSL2550=m
 CONFIG_BMP085_I2C=m
 CONFIG_SENSORS_LIS3_I2C=m
+CONFIG_SRAM=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_SCAN_ASYNC=y
index 5e45df0327bd6c6628b112fb82e166ab25a25acb..e5ac29d698102136872ea0922c2454fb81cee912 100644 (file)
 
 #define OMAP2_SRAM_PUB_PA      (OMAP2_SRAM_PA + 0xf800)
 #define OMAP3_SRAM_PUB_PA       (OMAP3_SRAM_PA + 0x8000)
-#ifdef CONFIG_OMAP4_ERRATA_I688
-#define OMAP4_SRAM_PUB_PA      OMAP4_SRAM_PA
-#else
-#define OMAP4_SRAM_PUB_PA      (OMAP4_SRAM_PA + 0x4000)
-#endif
-#define OMAP5_SRAM_PA          0x40300000
 
 #define SRAM_BOOTLOADER_SZ     0x00
 
@@ -105,32 +99,14 @@ static void __init omap_detect_sram(void)
                        } else {
                                omap_sram_size = 0x8000; /* 32K */
                        }
-               } else if (cpu_is_omap44xx()) {
-                       omap_sram_start = OMAP4_SRAM_PUB_PA;
-                       omap_sram_size = 0xa000; /* 40K */
-               } else if (soc_is_omap54xx()) {
-                       omap_sram_start = OMAP5_SRAM_PA;
-                       omap_sram_size = SZ_128K; /* 128KB */
                } else {
                        omap_sram_start = OMAP2_SRAM_PUB_PA;
                        omap_sram_size = 0x800; /* 2K */
                }
        } else {
-               if (soc_is_am33xx()) {
-                       omap_sram_start = AM33XX_SRAM_PA;
-                       omap_sram_size = 0x10000; /* 64K */
-               } else if (soc_is_am43xx()) {
-                       omap_sram_start = AM33XX_SRAM_PA;
-                       omap_sram_size = SZ_256K;
-               } else if (cpu_is_omap34xx()) {
+               if (cpu_is_omap34xx()) {
                        omap_sram_start = OMAP3_SRAM_PA;
                        omap_sram_size = 0x10000; /* 64K */
-               } else if (cpu_is_omap44xx()) {
-                       omap_sram_start = OMAP4_SRAM_PA;
-                       omap_sram_size = 0xe000; /* 56K */
-               } else if (soc_is_omap54xx()) {
-                       omap_sram_start = OMAP5_SRAM_PA;
-                       omap_sram_size = SZ_128K; /* 128KB */
                } else {
                        omap_sram_start = OMAP2_SRAM_PA;
                        if (cpu_is_omap242x())
index ca7277c2a9ee74541c7ed249662c438f740838c6..3f83b802dbb2c9c8db1bcdea2bd1247d44232349 100644 (file)
@@ -80,4 +80,3 @@ static inline void omap_push_sram_idle(void) {}
 #else
 #define OMAP4_SRAM_PA          0x40300000
 #endif
-#define AM33XX_SRAM_PA         0x40300000