linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] memory: sanitize jedec_ddr_data.c and jedec_ddr.h
@ 2019-05-15 15:04 Masahiro Yamada
  2019-05-15 15:04 ` [PATCH 1/2] memory: move jedec_ddr_data.c from lib/ to drivers/memory/ Masahiro Yamada
  2019-05-15 15:04 ` [PATCH 2/2] memory: move jedec_ddr.h from include/memory " Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-05-15 15:04 UTC (permalink / raw)
  To: Santosh Shilimkar; +Cc: Masahiro Yamada, linux-kernel




Masahiro Yamada (2):
  memory: move jedec_ddr_data.c from lib/ to drivers/memory/
  memory: move jedec_ddr.h from include/memory to drivers/memory/

 drivers/memory/Kconfig                   | 8 ++++++++
 drivers/memory/Makefile                  | 1 +
 drivers/memory/emif.c                    | 3 ++-
 {include => drivers}/memory/jedec_ddr.h  | 6 +++---
 {lib => drivers/memory}/jedec_ddr_data.c | 5 +++--
 drivers/memory/of_memory.c               | 3 ++-
 lib/Kconfig                              | 8 --------
 lib/Makefile                             | 2 --
 8 files changed, 19 insertions(+), 17 deletions(-)
 rename {include => drivers}/memory/jedec_ddr.h (97%)
 rename {lib => drivers/memory}/jedec_ddr_data.c (98%)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] memory: move jedec_ddr_data.c from lib/ to drivers/memory/
  2019-05-15 15:04 [PATCH 0/2] memory: sanitize jedec_ddr_data.c and jedec_ddr.h Masahiro Yamada
@ 2019-05-15 15:04 ` Masahiro Yamada
  2019-05-15 15:04 ` [PATCH 2/2] memory: move jedec_ddr.h from include/memory " Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-05-15 15:04 UTC (permalink / raw)
  To: Santosh Shilimkar; +Cc: Masahiro Yamada, linux-kernel

jedec_ddr_data.c exports the lpddr2_jedec_* symbols, and all of them
are only referenced from drivers/memory/{emif.c,of_memory.c}

drivers/memory/ is a better location than lib/.

I removed the Kconfig prompt "JEDEC DDR data" because it is only
select'ed by TI_EMIF, and there is no other user. There is no good
reason in making it a user-configurable CONFIG option.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/memory/Kconfig                   | 8 ++++++++
 drivers/memory/Makefile                  | 1 +
 {lib => drivers/memory}/jedec_ddr_data.c | 0
 lib/Kconfig                              | 8 --------
 lib/Makefile                             | 2 --
 5 files changed, 9 insertions(+), 10 deletions(-)
 rename {lib => drivers/memory}/jedec_ddr_data.c (100%)

diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 2d91b00..fa17b3e 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -7,6 +7,14 @@ menuconfig MEMORY
 
 if MEMORY
 
+config DDR
+	bool
+	help
+	  Data from JEDEC specs for DDR SDRAM memories,
+	  particularly the AC timing parameters and addressing
+	  information. This data is useful for drivers handling
+	  DDR SDRAM controllers.
+
 config ARM_PL172_MPMC
 	tristate "ARM PL172 MPMC driver"
 	depends on ARM_AMBA && OF
diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
index 91ae4eb..9d5c409 100644
--- a/drivers/memory/Makefile
+++ b/drivers/memory/Makefile
@@ -3,6 +3,7 @@
 # Makefile for memory devices
 #
 
+obj-$(CONFIG_DDR)		+= jedec_ddr_data.o
 ifeq ($(CONFIG_DDR),y)
 obj-$(CONFIG_OF)		+= of_memory.o
 endif
diff --git a/lib/jedec_ddr_data.c b/drivers/memory/jedec_ddr_data.c
similarity index 100%
rename from lib/jedec_ddr_data.c
rename to drivers/memory/jedec_ddr_data.c
diff --git a/lib/Kconfig b/lib/Kconfig
index 3577609..473f937 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -530,14 +530,6 @@ config LRU_CACHE
 config CLZ_TAB
 	bool
 
-config DDR
-	bool "JEDEC DDR data"
-	help
-	  Data from JEDEC specs for DDR SDRAM memories,
-	  particularly the AC timing parameters and addressing
-	  information. This data is useful for drivers handling
-	  DDR SDRAM controllers.
-
 config IRQ_POLL
 	bool "IRQ polling library"
 	help
diff --git a/lib/Makefile b/lib/Makefile
index fb76970..cb66bc9 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -206,8 +206,6 @@ obj-$(CONFIG_SIGNATURE) += digsig.o
 
 lib-$(CONFIG_CLZ_TAB) += clz_tab.o
 
-obj-$(CONFIG_DDR) += jedec_ddr_data.o
-
 obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) += strncpy_from_user.o
 obj-$(CONFIG_GENERIC_STRNLEN_USER) += strnlen_user.o
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] memory: move jedec_ddr.h from include/memory to drivers/memory/
  2019-05-15 15:04 [PATCH 0/2] memory: sanitize jedec_ddr_data.c and jedec_ddr.h Masahiro Yamada
  2019-05-15 15:04 ` [PATCH 1/2] memory: move jedec_ddr_data.c from lib/ to drivers/memory/ Masahiro Yamada
@ 2019-05-15 15:04 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-05-15 15:04 UTC (permalink / raw)
  To: Santosh Shilimkar; +Cc: Masahiro Yamada, linux-kernel

Now that jedec_ddr_data.c was moved from lib/ to drivers/memory/,
<memory/jedec_ddr.h> is included only from drivers/memory/.

Make it a local header of drivers/memory/.

While I am here, I also changed #include <linux/module.h> to
<linux/export.h>. Because CONFIG_DDR is bool, jedec_ddr_data.c is
never compiled as a module.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/memory/emif.c                   | 3 ++-
 {include => drivers}/memory/jedec_ddr.h | 6 +++---
 drivers/memory/jedec_ddr_data.c         | 5 +++--
 drivers/memory/of_memory.c              | 3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)
 rename {include => drivers}/memory/jedec_ddr.h (97%)

diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index 2f21444..32cad75 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -26,8 +26,9 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
-#include <memory/jedec_ddr.h>
+
 #include "emif.h"
+#include "jedec_ddr.h"
 #include "of_memory.h"
 
 /**
diff --git a/include/memory/jedec_ddr.h b/drivers/memory/jedec_ddr.h
similarity index 97%
rename from include/memory/jedec_ddr.h
rename to drivers/memory/jedec_ddr.h
index ddad0f8..a2094a9 100644
--- a/include/memory/jedec_ddr.h
+++ b/drivers/memory/jedec_ddr.h
@@ -9,8 +9,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#ifndef __LINUX_JEDEC_DDR_H
-#define __LINUX_JEDEC_DDR_H
+#ifndef __JEDEC_DDR_H
+#define __JEDEC_DDR_H
 
 #include <linux/types.h>
 
@@ -172,4 +172,4 @@ extern const struct lpddr2_timings
 	lpddr2_jedec_timings[NUM_DDR_TIMING_TABLE_ENTRIES];
 extern const struct lpddr2_min_tck lpddr2_jedec_min_tck;
 
-#endif /* __LINUX_JEDEC_DDR_H */
+#endif /* __JEDEC_DDR_H */
diff --git a/drivers/memory/jedec_ddr_data.c b/drivers/memory/jedec_ddr_data.c
index 6d2cbf1..1f9ca0f 100644
--- a/drivers/memory/jedec_ddr_data.c
+++ b/drivers/memory/jedec_ddr_data.c
@@ -10,8 +10,9 @@
  * published by the Free Software Foundation.
  */
 
-#include <memory/jedec_ddr.h>
-#include <linux/module.h>
+#include <linux/export.h>
+
+#include "jedec_ddr.h"
 
 /* LPDDR2 addressing details from JESD209-2 section 2.4 */
 const struct lpddr2_addressing
diff --git a/drivers/memory/of_memory.c b/drivers/memory/of_memory.c
index 2f5ed73..2190b8e 100644
--- a/drivers/memory/of_memory.c
+++ b/drivers/memory/of_memory.c
@@ -14,8 +14,9 @@
 #include <linux/list.h>
 #include <linux/of.h>
 #include <linux/gfp.h>
-#include <memory/jedec_ddr.h>
 #include <linux/export.h>
+
+#include "jedec_ddr.h"
 #include "of_memory.h"
 
 /**
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-15 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 15:04 [PATCH 0/2] memory: sanitize jedec_ddr_data.c and jedec_ddr.h Masahiro Yamada
2019-05-15 15:04 ` [PATCH 1/2] memory: move jedec_ddr_data.c from lib/ to drivers/memory/ Masahiro Yamada
2019-05-15 15:04 ` [PATCH 2/2] memory: move jedec_ddr.h from include/memory " Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).