-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants_instead_of_macros.diff
97 lines (89 loc) · 4.86 KB
/
constants_instead_of_macros.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff -ru ./linux-3.4.108/arch/arm/mach-imapx200/Makefile ../linux-3.4.108/arch/arm/mach-imapx200/Makefile
--- ./linux-3.4.108/arch/arm/mach-imapx200/Makefile 2015-09-09 12:17:52.483020878 +0300
+++ ../linux-3.4.108/arch/arm/mach-imapx200/Makefile 2015-09-08 17:11:45.775035963 +0300
@@ -6,7 +6,7 @@
#IMAPX200 support files
-obj-$(CONFIG_CPU_IMAPX200) += irq.o clock.o time.o devices.o pwm.o
+obj-$(CONFIG_CPU_IMAPX200) += irq.o clock.o time.o devices.o pwm.o constants.o
diff -ru ./linux-3.4.108/arch/arm/mach-imapx200/include/mach/imapx_base_reg.h ../linux-3.4.108/arch/arm/mach-imapx200/include/mach/imapx_base_reg.h
--- ./linux-3.4.108/arch/arm/mach-imapx200/include/mach/imapx_base_reg.h 2015-09-09 12:17:52.498020874 +0300
+++ ../linux-3.4.108/arch/arm/mach-imapx200/include/mach/imapx_base_reg.h 2015-09-08 17:11:45.778035706 +0300
@@ -15,13 +15,23 @@
#define IMAPX200_SDRAM_PA (0x40000000)
/************************Virtual address for peripheral*************************/
-#define IMAP_VA_SYSMGR IMAP_ADDR(0x00200000)
-#define IMAP_VA_IRQ IMAP_ADDR(0x00000000)
-#define IMAP_VA_TIMER IMAP_ADDR(0x00300000)
-#define IMAP_VA_WATCHDOG IMAP_ADDR(0x00600000)
-#define IMAP_VA_GPIO IMAP_ADDR(0x00400000)
-#define IMAP_VA_NAND IMAP_ADDR(0x00500000)
-#define IMAP_VA_FB IMAP_ADDR(0x00700000)
+#if defined(IMAP_USE_MACRO_CONSTANTS) || defined(__ASSEMBLY__)
+# define IMAP_VA_SYSMGR IMAP_ADDR(0x00200000)
+# define IMAP_VA_IRQ IMAP_ADDR(0x00000000)
+# define IMAP_VA_TIMER IMAP_ADDR(0x00300000)
+# define IMAP_VA_WATCHDOG IMAP_ADDR(0x00600000)
+# define IMAP_VA_GPIO IMAP_ADDR(0x00400000)
+# define IMAP_VA_NAND IMAP_ADDR(0x00500000)
+# define IMAP_VA_FB IMAP_ADDR(0x00700000)
+#else
+extern const void __iomem __force * const IMAP_VA_SYSMGR;
+extern const void __iomem __force * const IMAP_VA_IRQ;
+extern const void __iomem __force * const IMAP_VA_TIMER;
+extern const void __iomem __force * const IMAP_VA_WATCHDOG;
+extern const void __iomem __force * const IMAP_VA_GPIO;
+extern const void __iomem __force * const IMAP_VA_NAND;
+extern const void __iomem __force * const IMAP_VA_FB;
+#endif /* defined(IMAP_USE_MACRO_CONSTANTS) || defined(__ASSEMBLY__) */
#define PERIPHERAL_BASE_ADDR_PA (0x20C00000)
diff -ru ./linux-3.4.108/arch/arm/plat-imap/cpu.c ../linux-3.4.108/arch/arm/plat-imap/cpu.c
--- ./linux-3.4.108/arch/arm/plat-imap/cpu.c 2015-09-09 12:17:52.607021038 +0300
+++ ../linux-3.4.108/arch/arm/plat-imap/cpu.c 2015-09-08 17:18:30.646035384 +0300
@@ -1,3 +1,5 @@
+#define IMAP_USE_MACRO_CONSTANTS
+
/********************************************************************************
** linux-2.6.28.5/arch/arm/plat-imap/cpu.c
**
diff -ru ./linux-3.4.108/arch/arm/plat-imap/gpio.c ../linux-3.4.108/arch/arm/plat-imap/gpio.c
--- ./linux-3.4.108/arch/arm/plat-imap/gpio.c 2015-09-09 12:17:52.614020935 +0300
+++ ../linux-3.4.108/arch/arm/plat-imap/gpio.c 2015-09-08 17:18:38.566035206 +0300
@@ -1,3 +1,5 @@
+#define IMAP_USE_MACRO_CONSTANTS
+
/* arch/arm/plat-imapx200/gpiolib.c
*
* Copyright 2008 Openmoko, Inc.
diff -ru ./linux-3.4.108/arch/arm/plat-imap/pm_imapx200.c ../linux-3.4.108/arch/arm/plat-imap/pm_imapx200.c
--- ./linux-3.4.108/arch/arm/plat-imap/pm_imapx200.c 2015-09-09 12:17:52.631020886 +0300
+++ ../linux-3.4.108/arch/arm/plat-imap/pm_imapx200.c 2015-09-08 17:18:52.102036874 +0300
@@ -1,3 +1,5 @@
+#define IMAP_USE_MACRO_CONSTANTS
+
#include <linux/init.h>
#include <linux/suspend.h>
#include <linux/serial_core.h>
diff -ru ./linux-3.4.108/drivers/video/infotm/imapfb.c ../linux-3.4.108/drivers/video/infotm/imapfb.c
--- ./linux-3.4.108/drivers/video/infotm/imapfb.c 2015-09-09 12:17:53.350020920 +0300
+++ ../linux-3.4.108/drivers/video/infotm/imapfb.c 2015-09-08 17:34:34.814042727 +0300
@@ -1,3 +1,5 @@
+#define IMAP_USE_MACRO_CONSTANTS
+
/*****************************************************************************
** drivers/video/infotm/imapfb.c
**
diff -ru --new-file ./linux-3.4.108/arch/arm/mach-imapx200/constants.c ../linux-3.4.108/arch/arm/mach-imapx200/constants.c
--- ./linux-3.4.108/arch/arm/mach-imapx200/constants.c 1970-01-01 03:00:00.000000000 +0300
+++ ../linux-3.4.108/arch/arm/mach-imapx200/constants.c 2015-09-09 14:56:53.513487879 +0300
@@ -0,0 +1,11 @@
+#include <linux/compiler.h>
+
+#include <mach/imapx_base_reg.h>
+
+const void __iomem __force * const IMAP_VA_SYSMGR = IMAP_ADDR(0x00200000);
+const void __iomem __force * const IMAP_VA_IRQ = IMAP_ADDR(0x00000000);
+const void __iomem __force * const IMAP_VA_TIMER = IMAP_ADDR(0x00300000);
+const void __iomem __force * const IMAP_VA_WATCHDOG = IMAP_ADDR(0x00600000);
+const void __iomem __force * const IMAP_VA_GPIO = IMAP_ADDR(0x00400000);
+const void __iomem __force * const IMAP_VA_NAND = IMAP_ADDR(0x00500000);
+const void __iomem __force * const IMAP_VA_FB = IMAP_ADDR(0x00700000);