* [PATCH 1/5] omap2: modify omap24xx.h to improve constant names and prepare for multi-arch kernels
2007-05-16 22:58 [PATCH 0/5] Clean up omap24xx.h symbolic constants Paul Walmsley
@ 2007-05-16 22:58 ` Paul Walmsley
2007-05-16 22:58 ` [PATCH 2/5] omap2: use OMAP24XX_32KSYNCT_BASE in place of OMAP_32KSYNCT_BASE Paul Walmsley
` (4 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Paul Walmsley @ 2007-05-16 22:58 UTC (permalink / raw)
To: linux-omap-open-source
[-- Attachment #1: 0001-omap2-modify-omap24xx.h-to-improve-constant-names-a.patch --]
[-- Type: text/plain, Size: 5013 bytes --]
Redo the defines in omap24xx.h to fix poorly-named defines, such as
OMAP24XX_SDRC_BASE, which is different between 2420 and 2430. Also,
prepare for future multi-architecture kernels by removing the
architecture prefixes from several of the defines. (Presumably in the
future these will be assigned to 'static void __iomem *'s by runtime
init code depending on the CPU type.)
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
include/asm-arm/arch-omap/io.h | 6 +-
include/asm-arm/arch-omap/omap24xx.h | 72 ++++++++++++++++++++++-----------
2 files changed, 51 insertions(+), 27 deletions(-)
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index d2fe0d0..28ae4d9 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -95,13 +95,13 @@
#define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */
/* DSP */
-#define DSP_MEM_24XX_PHYS OMAP24XX_DSP_MEM_BASE /* 0x58000000 */
+#define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */
#define DSP_MEM_24XX_VIRT 0xe0000000
#define DSP_MEM_24XX_SIZE 0x28000
-#define DSP_IPI_24XX_PHYS OMAP24XX_DSP_IPI_BASE /* 0x59000000 */
+#define DSP_IPI_24XX_PHYS OMAP2420_DSP_IPI_BASE /* 0x59000000 */
#define DSP_IPI_24XX_VIRT 0xe1000000
#define DSP_IPI_24XX_SIZE SZ_4K
-#define DSP_MMU_24XX_PHYS OMAP24XX_DSP_MMU_BASE /* 0x5a000000 */
+#define DSP_MMU_24XX_PHYS OMAP2420_DSP_MMU_BASE /* 0x5a000000 */
#define DSP_MMU_24XX_VIRT 0xe2000000
#define DSP_MMU_24XX_SIZE SZ_4K
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index d38572e..249438d 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -13,46 +13,70 @@
/* interrupt controller */
#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000)
-#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
#define OMAP24XX_IVA_INTC_BASE 0x40000000
#define IRQ_SIR_IRQ 0x0040
#define OMAP24XX_CONTROL_STATUS (L4_24XX_BASE + 0x2f8)
-#ifdef CONFIG_ARCH_OMAP2420
-#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
-#define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000)
-#define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000)
-#define OMAP24XX_CTRL_BASE L4_24XX_BASE
-#endif
+#define OMAP2420_CTRL_BASE L4_24XX_BASE
+#define OMAP2420_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
+#define OMAP2420_PRCM_BASE (L4_24XX_BASE + 0x8000)
+#define OMAP2420_SDRC_BASE (L3_24XX_BASE + 0x9000)
+#define OMAP2420_SMS_BASE 0x68008000
+
+#define OMAP2430_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
+#define OMAP2430_PRCM_BASE (L4_WK_243X_BASE + 0x6000)
-#ifdef CONFIG_ARCH_OMAP2430
-#define OMAP24XX_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
-#define OMAP24XX_PRCM_BASE (L4_WK_243X_BASE + 0x6000)
#define OMAP243X_SMS_BASE 0x6C000000
-#define OMAP24XX_SDRC_BASE 0x6D000000
+#define OMAP243X_SDRC_BASE 0x6D000000
#define OMAP243X_GPMC_BASE 0x6E000000
#define OMAP243X_SCM_BASE (L4_WK_243X_BASE + 0x2000)
-#define OMAP24XX_CTRL_BASE OMAP243X_SCM_BASE
+#define OMAP243X_CTRL_BASE OMAP243X_SCM_BASE
#define OMAP243X_HS_BASE (L4_24XX_BASE + 0x000ac000)
-#endif
/* DSP SS */
-#ifdef CONFIG_ARCH_OMAP2420
-#define OMAP24XX_DSP_BASE 0x58000000
-#define OMAP24XX_DSP_MEM_BASE (OMAP24XX_DSP_BASE + 0x0)
-#define OMAP24XX_DSP_IPI_BASE (OMAP24XX_DSP_BASE + 0x1000000)
-#define OMAP24XX_DSP_MMU_BASE (OMAP24XX_DSP_BASE + 0x2000000)
-#endif
+#define OMAP2420_DSP_BASE 0x58000000
+#define OMAP2420_DSP_MEM_BASE (OMAP2420_DSP_BASE + 0x0)
+#define OMAP2420_DSP_IPI_BASE (OMAP2420_DSP_BASE + 0x1000000)
+#define OMAP2420_DSP_MMU_BASE (OMAP2420_DSP_BASE + 0x2000000)
-#ifdef CONFIG_ARCH_OMAP2430
-#define OMAP24XX_DSP_BASE 0x5C000000
-#define OMAP24XX_DSP_MEM_BASE (OMAP24XX_DSP_BASE + 0x0)
-#define OMAP24XX_DSP_MMU_BASE (OMAP24XX_DSP_BASE + 0x1000000)
-#endif
+#define OMAP243X_DSP_BASE 0x5C000000
+#define OMAP243X_DSP_MEM_BASE (OMAP243X_DSP_BASE + 0x0)
+#define OMAP243X_DSP_MMU_BASE (OMAP243X_DSP_BASE + 0x1000000)
/* Mailbox */
#define OMAP24XX_MAILBOX_BASE (L4_24XX_BASE + 0x94000)
+
+#if defined(CONFIG_ARCH_OMAP2420)
+
+#define OMAP_32KSYNCT_BASE OMAP2420_32KSYNCT_BASE
+#define PRCM_BASE OMAP2420_PRCM_BASE
+#define SDRC_BASE OMAP2420_SDRC_BASE
+#define SMS_BASE OMAP2420_SMS_BASE
+#define L4_OMAP_BASE L4_24XX_BASE
+#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
+#define CTRL_BASE OMAP2420_CTRL_BASE
+
+#elif defined(CONFIG_ARCH_OMAP2430)
+
+#define OMAP_32KSYNCT_BASE OMAP2430_32KSYNCT_BASE
+#define PRCM_BASE OMAP2430_PRCM_BASE
+#define SDRC_BASE OMAP243X_SDRC_BASE
+#define SMS_BASE OMAP243X_SMS_BASE
+#define L4_OMAP_BASE L4_24XX_BASE
+#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
+#define CTRL_BASE OMAP243X_CTRL_BASE
+
+#else
+#error "Unknown architecture"
+#endif
+
+/* Temporary defines to be cleaned up in following patches */
+#define OMAP24XX_32KSYNCT_BASE OMAP_32KSYNCT_BASE
+#define OMAP24XX_SDRC_BASE SDRC_BASE
+#define OMAP24XX_PRCM_BASE PRCM_BASE
+#define OMAP24XX_CTRL_BASE CTRL_BASE
+
#endif /* __ASM_ARCH_OMAP24XX_H */
--
1.5.1.3
--
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 2/5] omap2: use OMAP24XX_32KSYNCT_BASE in place of OMAP_32KSYNCT_BASE
2007-05-16 22:58 [PATCH 0/5] Clean up omap24xx.h symbolic constants Paul Walmsley
2007-05-16 22:58 ` [PATCH 1/5] omap2: modify omap24xx.h to improve constant names and prepare for multi-arch kernels Paul Walmsley
@ 2007-05-16 22:58 ` Paul Walmsley
2007-05-16 22:58 ` [PATCH 3/5] omap2: use PRCM_BASE in place of OMAP24XX_PRCM_BASE Paul Walmsley
` (3 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Paul Walmsley @ 2007-05-16 22:58 UTC (permalink / raw)
To: linux-omap-open-source
[-- Attachment #1: 0002-omap2-use-OMAP24XX_32KSYNCT_BASE-in-place-of-OMAP_3.patch --]
[-- Type: text/plain, Size: 3021 bytes --]
Change users of OMAP24XX_32KSYNCT_BASE to use OMAP_32KSYNCT_BASE, in
preparation to remove OMAP24XX_32KSYNCT_BASE. Convert the 32K sync timer
reference in pm.c to use a symbolic constant rather than a magic number.
Remove the OMAP24XX_32KSYNCT_BASE define.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/pm.c | 2 +-
arch/arm/mach-omap2/sram-fn.S | 2 +-
arch/arm/plat-omap/common.c | 2 +-
arch/arm/plat-omap/timer32k.c | 2 +-
include/asm-arm/arch-omap/omap24xx.h | 1 -
5 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 13d05a5..0c84a18 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -158,7 +158,7 @@ static inline u32 prcm_read_reg(int idx)
static u32 omap2_read_32k_sync_counter(void)
{
- return omap_readl(0x48004010);
+ return omap_readl(OMAP_32KSYNCT_BASE + 0x0010);
}
#ifdef CONFIG_PM_DEBUG
diff --git a/arch/arm/mach-omap2/sram-fn.S b/arch/arm/mach-omap2/sram-fn.S
index b275766..9109b02 100644
--- a/arch/arm/mach-omap2/sram-fn.S
+++ b/arch/arm/mach-omap2/sram-fn.S
@@ -29,7 +29,7 @@
#include "prcm-regs.h"
-#define TIMER_32KSYNCT_CR_V IO_ADDRESS(OMAP24XX_32KSYNCT_BASE + 0x010)
+#define TIMER_32KSYNCT_CR_V IO_ADDRESS(OMAP_32KSYNCT_BASE + 0x010)
#define CM_CLKSEL2_PLL_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x544)
#define PRCM_VOLTCTRL_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x050)
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index e03ace4..e9ebdd8 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -192,7 +192,7 @@ console_initcall(omap_add_serial_console);
#if defined(CONFIG_ARCH_OMAP16XX)
#define TIMER_32K_SYNCHRONIZED 0xfffbc410
#elif defined(CONFIG_ARCH_OMAP24XX)
-#define TIMER_32K_SYNCHRONIZED (OMAP24XX_32KSYNCT_BASE + 0x10)
+#define TIMER_32K_SYNCHRONIZED (OMAP_32KSYNCT_BASE + 0x10)
#endif
#ifdef TIMER_32K_SYNCHRONIZED
diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c
index 2474597..10fa89d 100644
--- a/arch/arm/plat-omap/timer32k.c
+++ b/arch/arm/plat-omap/timer32k.c
@@ -71,7 +71,7 @@ struct sys_timer omap_timer;
#if defined(CONFIG_ARCH_OMAP16XX)
#define TIMER_32K_SYNCHRONIZED 0xfffbc410
#elif defined(CONFIG_ARCH_OMAP24XX)
-#define TIMER_32K_SYNCHRONIZED (OMAP24XX_32KSYNCT_BASE + 0x10)
+#define TIMER_32K_SYNCHRONIZED (OMAP_32KSYNCT_BASE + 0x10)
#else
#error OMAP 32KHz timer does not currently work on 15XX!
#endif
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index 249438d..a56a431 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -73,7 +73,6 @@
#endif
/* Temporary defines to be cleaned up in following patches */
-#define OMAP24XX_32KSYNCT_BASE OMAP_32KSYNCT_BASE
#define OMAP24XX_SDRC_BASE SDRC_BASE
#define OMAP24XX_PRCM_BASE PRCM_BASE
#define OMAP24XX_CTRL_BASE CTRL_BASE
--
1.5.1.3
--
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 3/5] omap2: use PRCM_BASE in place of OMAP24XX_PRCM_BASE
2007-05-16 22:58 [PATCH 0/5] Clean up omap24xx.h symbolic constants Paul Walmsley
2007-05-16 22:58 ` [PATCH 1/5] omap2: modify omap24xx.h to improve constant names and prepare for multi-arch kernels Paul Walmsley
2007-05-16 22:58 ` [PATCH 2/5] omap2: use OMAP24XX_32KSYNCT_BASE in place of OMAP_32KSYNCT_BASE Paul Walmsley
@ 2007-05-16 22:58 ` Paul Walmsley
2007-05-16 22:58 ` [PATCH 4/5] omap2: use SDRC_BASE in place of OMAP24XX_SDRC_BASE Paul Walmsley
` (2 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Paul Walmsley @ 2007-05-16 22:58 UTC (permalink / raw)
To: linux-omap-open-source
[-- Attachment #1: 0003-omap2-use-PRCM_BASE-in-place-of-OMAP24XX_PRCM_BASE.patch --]
[-- Type: text/plain, Size: 3470 bytes --]
Change users of OMAP24XX_PRCM_BASE to use PRCM_BASE. Remove
the OMAP24XX_PRCM_BASE define.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/mmu.c | 2 +-
arch/arm/mach-omap2/pm.c | 2 +-
arch/arm/mach-omap2/prcm-regs.h | 2 +-
arch/arm/mach-omap2/sram-fn.S | 12 ++++++------
include/asm-arm/arch-omap/omap24xx.h | 1 -
5 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/mmu.c b/arch/arm/mach-omap2/mmu.c
index 2a52907..1f68d15 100644
--- a/arch/arm/mach-omap2/mmu.c
+++ b/arch/arm/mach-omap2/mmu.c
@@ -96,7 +96,7 @@ static int exmap_setup_preserved_entries(struct omap_mmu *mmu)
exmap_setup_preserved_mem_page(mmu, dspvect_page, DSP_INIT_PAGE, n++);
- exmap_setup_iomap_page(mmu, OMAP24XX_PRCM_BASE, 0x7000, n++);
+ exmap_setup_iomap_page(mmu, PRCM_BASE, 0x7000, n++);
exmap_setup_iomap_page(mmu, OMAP24XX_MAILBOX_BASE, 0x11000, n++);
if (cpu_is_omap2420()) {
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 0c84a18..ad70280 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -144,7 +144,7 @@ static void (*omap2_sram_idle)(void);
static void (*omap2_sram_suspend)(int dllctrl);
static void (*saved_idle)(void);
-static u32 prcm_base = IO_ADDRESS(OMAP24XX_PRCM_BASE);
+static u32 prcm_base = IO_ADDRESS(PRCM_BASE);
static inline void prcm_write_reg(int idx, u32 val)
{
diff --git a/arch/arm/mach-omap2/prcm-regs.h b/arch/arm/mach-omap2/prcm-regs.h
index 4672a2c..c5bb9b6 100644
--- a/arch/arm/mach-omap2/prcm-regs.h
+++ b/arch/arm/mach-omap2/prcm-regs.h
@@ -29,7 +29,7 @@
#ifndef __ASSEMBLER__
-#define PRCM_REG32(offset) __REG32(OMAP24XX_PRCM_BASE + (offset))
+#define PRCM_REG32(offset) __REG32(PRCM_BASE + (offset))
#define PRCM_REVISION PRCM_REG32(0x000)
#define PRCM_SYSCONFIG PRCM_REG32(0x010)
diff --git a/arch/arm/mach-omap2/sram-fn.S b/arch/arm/mach-omap2/sram-fn.S
index 9109b02..c9c53e6 100644
--- a/arch/arm/mach-omap2/sram-fn.S
+++ b/arch/arm/mach-omap2/sram-fn.S
@@ -31,12 +31,12 @@
#define TIMER_32KSYNCT_CR_V IO_ADDRESS(OMAP_32KSYNCT_BASE + 0x010)
-#define CM_CLKSEL2_PLL_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x544)
-#define PRCM_VOLTCTRL_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x050)
-#define PRCM_CLKCFG_CTRL_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x080)
-#define CM_CLKEN_PLL_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x500)
-#define CM_IDLEST_CKGEN_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x520)
-#define CM_CLKSEL1_PLL_V IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x540)
+#define CM_CLKSEL2_PLL_V IO_ADDRESS(PRCM_BASE + 0x544)
+#define PRCM_VOLTCTRL_V IO_ADDRESS(PRCM_BASE + 0x050)
+#define PRCM_CLKCFG_CTRL_V IO_ADDRESS(PRCM_BASE + 0x080)
+#define CM_CLKEN_PLL_V IO_ADDRESS(PRCM_BASE + 0x500)
+#define CM_IDLEST_CKGEN_V IO_ADDRESS(PRCM_BASE + 0x520)
+#define CM_CLKSEL1_PLL_V IO_ADDRESS(PRCM_BASE + 0x540)
#define SDRC_DLLA_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE + 0x060)
#define SDRC_RFR_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE + 0x0a4)
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index a56a431..5f5b40b 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -74,7 +74,6 @@
/* Temporary defines to be cleaned up in following patches */
#define OMAP24XX_SDRC_BASE SDRC_BASE
-#define OMAP24XX_PRCM_BASE PRCM_BASE
#define OMAP24XX_CTRL_BASE CTRL_BASE
#endif /* __ASM_ARCH_OMAP24XX_H */
--
1.5.1.3
--
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 4/5] omap2: use SDRC_BASE in place of OMAP24XX_SDRC_BASE
2007-05-16 22:58 [PATCH 0/5] Clean up omap24xx.h symbolic constants Paul Walmsley
` (2 preceding siblings ...)
2007-05-16 22:58 ` [PATCH 3/5] omap2: use PRCM_BASE in place of OMAP24XX_PRCM_BASE Paul Walmsley
@ 2007-05-16 22:58 ` Paul Walmsley
2007-05-16 22:58 ` [PATCH 5/5] omap2: use CTRL_BASE in place of OMAP24XX_CTRL_BASE Paul Walmsley
2007-05-17 8:28 ` [PATCH 0/5] Clean up omap24xx.h symbolic constants Dmitry Krivoschekov
5 siblings, 0 replies; 13+ messages in thread
From: Paul Walmsley @ 2007-05-16 22:58 UTC (permalink / raw)
To: linux-omap-open-source
[-- Attachment #1: 0004-omap2-use-SDRC_BASE-in-place-of-OMAP24XX_SDRC_BASE.patch --]
[-- Type: text/plain, Size: 4276 bytes --]
Change users of OMAP24XX_SDRC_BASE to use SDRC_BASE. Remove the
OMAP24XX_SDRC_BASE define.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/prcm-regs.h | 14 +++++++-------
arch/arm/mach-omap2/sleep.S | 10 ++++++----
arch/arm/mach-omap2/sram-fn.S | 4 ++--
include/asm-arm/arch-omap/io.h | 2 +-
include/asm-arm/arch-omap/omap24xx.h | 1 -
5 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-omap2/prcm-regs.h b/arch/arm/mach-omap2/prcm-regs.h
index c5bb9b6..3c0688c 100644
--- a/arch/arm/mach-omap2/prcm-regs.h
+++ b/arch/arm/mach-omap2/prcm-regs.h
@@ -199,7 +199,7 @@
#define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0x6A054)
#define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0x6C054)
#define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0x6E054)
-#define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE + 0x10)
+#define SDRC_SYSCONFIG __REG32(SDRC_BASE + 0x10)
#define OMAP24XX_SMS_BASE (L3_24XX_BASE + 0x8000)
#define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE + 0x10)
#define SSI_SYSCONFIG __REG32(DISP_BASE + 0x8010)
@@ -263,12 +263,12 @@
#define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE + 0x78018)
/* SDRC */
-#define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE + 0x060)
-#define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE + 0x064)
-#define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE + 0x068)
-#define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE + 0x06C)
-#define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE + 0x070)
-#define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE + 0x084)
+#define SDRC_DLLA_CTRL __REG32(SDRC_BASE + 0x060)
+#define SDRC_DLLA_STATUS __REG32(SDRC_BASE + 0x064)
+#define SDRC_DLLB_CTRL __REG32(SDRC_BASE + 0x068)
+#define SDRC_DLLB_STATUS __REG32(SDRC_BASE + 0x06C)
+#define SDRC_POWER __REG32(SDRC_BASE + 0x070)
+#define SDRC_MR_0 __REG32(SDRC_BASE + 0x084)
/* GPIO 1 */
#define GPIO1_BASE GPIOX_BASE(1)
diff --git a/arch/arm/mach-omap2/sleep.S b/arch/arm/mach-omap2/sleep.S
index a67bc18..ce9005d 100644
--- a/arch/arm/mach-omap2/sleep.S
+++ b/arch/arm/mach-omap2/sleep.S
@@ -30,11 +30,13 @@
#include <asm/arch/io.h>
#include <asm/arch/pm.h>
-#define A_SDRC_DLLA_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0x60)
-#define A_SDRC_POWER_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0x70)
-#define A_SDRC_RFR_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0xA4)
+#include <asm/arch/omap24xx.h>
+
+#define A_SDRC_DLLA_CTRL_V IO_ADDRESS(SDRC_BASE + 0x60)
+#define A_SDRC_POWER_V IO_ADDRESS(SDRC_BASE + 0x70)
+#define A_SDRC_RFR_CTRL_V IO_ADDRESS(SDRC_BASE + 0xA4)
#define A_SDRC0_V (0xC0000000)
-#define A_SDRC_MANUAL_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0xA8)
+#define A_SDRC_MANUAL_V IO_ADDRESS(SDRC_BASE + 0xA8)
.text
diff --git a/arch/arm/mach-omap2/sram-fn.S b/arch/arm/mach-omap2/sram-fn.S
index c9c53e6..3fe3a34 100644
--- a/arch/arm/mach-omap2/sram-fn.S
+++ b/arch/arm/mach-omap2/sram-fn.S
@@ -38,8 +38,8 @@
#define CM_IDLEST_CKGEN_V IO_ADDRESS(PRCM_BASE + 0x520)
#define CM_CLKSEL1_PLL_V IO_ADDRESS(PRCM_BASE + 0x540)
-#define SDRC_DLLA_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE + 0x060)
-#define SDRC_RFR_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE + 0x0a4)
+#define SDRC_DLLA_CTRL_V IO_ADDRESS(SDRC_BASE + 0x060)
+#define SDRC_RFR_CTRL_V IO_ADDRESS(SDRC_BASE + 0x0a4)
.text
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index 28ae4d9..403b707 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -80,7 +80,7 @@
#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */
#define OMAP243X_GPMC_VIRT 0xFE000000
#define OMAP243X_GPMC_SIZE SZ_1M
-#define OMAP243X_SDRC_PHYS OMAP24XX_SDRC_BASE
+#define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE
#define OMAP243X_SDRC_VIRT 0xFD000000
#define OMAP243X_SDRC_SIZE SZ_1M
#define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index 5f5b40b..fd9d48b 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -73,7 +73,6 @@
#endif
/* Temporary defines to be cleaned up in following patches */
-#define OMAP24XX_SDRC_BASE SDRC_BASE
#define OMAP24XX_CTRL_BASE CTRL_BASE
#endif /* __ASM_ARCH_OMAP24XX_H */
--
1.5.1.3
--
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 5/5] omap2: use CTRL_BASE in place of OMAP24XX_CTRL_BASE
2007-05-16 22:58 [PATCH 0/5] Clean up omap24xx.h symbolic constants Paul Walmsley
` (3 preceding siblings ...)
2007-05-16 22:58 ` [PATCH 4/5] omap2: use SDRC_BASE in place of OMAP24XX_SDRC_BASE Paul Walmsley
@ 2007-05-16 22:58 ` Paul Walmsley
2007-05-17 8:28 ` [PATCH 0/5] Clean up omap24xx.h symbolic constants Dmitry Krivoschekov
5 siblings, 0 replies; 13+ messages in thread
From: Paul Walmsley @ 2007-05-16 22:58 UTC (permalink / raw)
To: linux-omap-open-source
[-- Attachment #1: 0005-omap2-use-CTRL_BASE-in-place-of-OMAP24XX_CTRL_BASE.patch --]
[-- Type: text/plain, Size: 2213 bytes --]
Change users of OMAP24XX_CTRL_BASE to use CTRL_BASE. Remove the
OMAP24XX_CTRL_BASE define.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/prcm-regs.h | 2 +-
arch/arm/plat-omap/mux.c | 6 +++---
include/asm-arm/arch-omap/omap24xx.h | 2 --
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/prcm-regs.h b/arch/arm/mach-omap2/prcm-regs.h
index 3c0688c..a6842cb 100644
--- a/arch/arm/mach-omap2/prcm-regs.h
+++ b/arch/arm/mach-omap2/prcm-regs.h
@@ -350,7 +350,7 @@
#endif
/* IO CONFIG */
-#define CONTROL_REG32(offset) __REG32(OMAP24XX_CTRL_BASE + (offset))
+#define CONTROL_REG32(offset) __REG32(CTRL_BASE + (offset))
#define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104)
#define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134)
#define CONTROL_PADCONF_UART1_RX CONTROL_REG32(0x0C8)
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c
index 8b987b4..b40083f 100644
--- a/arch/arm/plat-omap/mux.c
+++ b/arch/arm/plat-omap/mux.c
@@ -85,7 +85,7 @@ int __init_or_module omap_cfg_reg(const unsigned long index)
reg |= OMAP24XX_PULL_UP;
#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
{
- u8 orig = omap_readb(OMAP24XX_CTRL_BASE + cfg->mux_reg);
+ u8 orig = omap_readb(CTRL_BASE + cfg->mux_reg);
u8 debug = 0;
#ifdef CONFIG_OMAP_MUX_DEBUG
@@ -95,11 +95,11 @@ int __init_or_module omap_cfg_reg(const unsigned long index)
if (debug || warn)
printk("MUX: setup %s (0x%08x): 0x%02x -> 0x%02x\n",
cfg->name,
- OMAP24XX_CTRL_BASE + cfg->mux_reg,
+ CTRL_BASE + cfg->mux_reg,
orig, reg);
}
#endif
- omap_writeb(reg, OMAP24XX_CTRL_BASE + cfg->mux_reg);
+ omap_writeb(reg, CTRL_BASE + cfg->mux_reg);
return 0;
}
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index fd9d48b..9c8c959 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -72,8 +72,6 @@
#error "Unknown architecture"
#endif
-/* Temporary defines to be cleaned up in following patches */
-#define OMAP24XX_CTRL_BASE CTRL_BASE
#endif /* __ASM_ARCH_OMAP24XX_H */
--
1.5.1.3
--
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 0/5] Clean up omap24xx.h symbolic constants
2007-05-16 22:58 [PATCH 0/5] Clean up omap24xx.h symbolic constants Paul Walmsley
` (4 preceding siblings ...)
2007-05-16 22:58 ` [PATCH 5/5] omap2: use CTRL_BASE in place of OMAP24XX_CTRL_BASE Paul Walmsley
@ 2007-05-17 8:28 ` Dmitry Krivoschekov
2007-05-17 17:43 ` Tony Lindgren
5 siblings, 1 reply; 13+ messages in thread
From: Dmitry Krivoschekov @ 2007-05-17 8:28 UTC (permalink / raw)
To: Paul Walmsley; +Cc: linux-omap-open-source
Hello,
Paul Walmsley wrote:
> So, to continue the example above, the OMAP24XX_SDRC_BASE constant
> will be removed, and replaced with two defines: OMAP2420_SDRC_BASE and
> OMAP243X_SDRC_BASE. Depending on which CONFIG_ARCH_OMAP* Kconfig
> parameter is specified, we then set an SDRC_BASE define to point to
> one of the two architecture-specific values.
>
>
IMHO, using of SDRC_BASE as well as CTRL_BASE, PRCM_BASE etc.,
can lead to name collision, the names is not so unique as may
seem. I suggest using of OMAP_ prefix for these names.
Regards,
Dmitry
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 0/5] Clean up omap24xx.h symbolic constants
2007-05-17 8:28 ` [PATCH 0/5] Clean up omap24xx.h symbolic constants Dmitry Krivoschekov
@ 2007-05-17 17:43 ` Tony Lindgren
2007-05-17 17:53 ` Syed Mohammed, Khasim
0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2007-05-17 17:43 UTC (permalink / raw)
To: Dmitry Krivoschekov; +Cc: Paul Walmsley, linux-omap-open-source
* Dmitry Krivoschekov <dmitry.krivoschekov@gmail.com> [070517 01:29]:
> Hello,
>
> Paul Walmsley wrote:
> > So, to continue the example above, the OMAP24XX_SDRC_BASE constant
> > will be removed, and replaced with two defines: OMAP2420_SDRC_BASE and
> > OMAP243X_SDRC_BASE. Depending on which CONFIG_ARCH_OMAP* Kconfig
> > parameter is specified, we then set an SDRC_BASE define to point to
> > one of the two architecture-specific values.
> >
> >
> IMHO, using of SDRC_BASE as well as CTRL_BASE, PRCM_BASE etc.,
> can lead to name collision, the names is not so unique as may
> seem. I suggest using of OMAP_ prefix for these names.
Good point. We could use OMAP_ prefix and in case of conflicts
with omap1 defines, we could rename them to have OMAP1_ prefix.
Regards,
Tony
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 0/5] Clean up omap24xx.h symbolic constants
2007-05-17 17:43 ` Tony Lindgren
@ 2007-05-17 17:53 ` Syed Mohammed, Khasim
2007-05-17 18:14 ` Tony Lindgren
0 siblings, 1 reply; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-05-17 17:53 UTC (permalink / raw)
To: Tony Lindgren, Dmitry Krivoschekov; +Cc: Paul Walmsley, linux-omap-open-source
Hi:
IMHO, using of SDRC_BASE as well as CTRL_BASE, PRCM_BASE etc.,
>> can lead to name collision, the names is not so unique as may
>> seem. I suggest using of OMAP_ prefix for these names.
>
>Good point. We could use OMAP_ prefix and in case of conflicts
>with omap1 defines, we could rename them to have OMAP1_ prefix.
>
When we started with 3430 developments we had similar issues. Our approach was,
OMAP3_prefix : If the Macro is defined and valid for 3430 only
OMAP2_prefix : If its valid only for OMAP2
OMAP242x_prefix : for 2420 specific
OMAP243x_prefix : for 2430 specific
OMAP1_prefix : for all OMAP1 platforms, but we didn't change any, thinking it might break previous programs.
OMAP_prefix : Generic for all OMAP platforms.
It's better if we follow some kind of standard and pass it as a review comment for any patches from now on.
Other alternative is to use Peripheral version in OMAP. Example:
OMAP1 has DMA version 3
OMAP2 has DMA version 4
OMAP3 has DMA version 4
So define a macro for DMA as
OMAP_DMA3_yyyyyy : for all OMAPs where DMA version 3 is used (like OMAPV1030, OMAP1710, OMAP1610, etc)
OMAP_DMA4_yyyyyy : for all OMAPs where DMA version 4 is used (like OMAP3430 2430 2420, etc).
Similar thing can be adopted for SPI, McBSP, I2C, and other peripherals of OMAP.
Regards,
Khasim
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/5] Clean up omap24xx.h symbolic constants
2007-05-17 17:53 ` Syed Mohammed, Khasim
@ 2007-05-17 18:14 ` Tony Lindgren
2007-05-17 19:11 ` Syed Mohammed, Khasim
0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2007-05-17 18:14 UTC (permalink / raw)
To: Syed Mohammed, Khasim; +Cc: Paul Walmsley, linux-omap-open-source
* Syed Mohammed, Khasim <x0khasim@ti.com> [070517 10:54]:
> Hi:
>
> IMHO, using of SDRC_BASE as well as CTRL_BASE, PRCM_BASE etc.,
> >> can lead to name collision, the names is not so unique as may
> >> seem. I suggest using of OMAP_ prefix for these names.
> >
> >Good point. We could use OMAP_ prefix and in case of conflicts
> >with omap1 defines, we could rename them to have OMAP1_ prefix.
> >
>
> When we started with 3430 developments we had similar issues. Our approach was,
>
> OMAP3_prefix : If the Macro is defined and valid for 3430 only
> OMAP2_prefix : If its valid only for OMAP2
> OMAP242x_prefix : for 2420 specific
> OMAP243x_prefix : for 2430 specific
> OMAP1_prefix : for all OMAP1 platforms, but we didn't change any, thinking it might break previous programs.
> OMAP_prefix : Generic for all OMAP platforms.
>
> It's better if we follow some kind of standard and pass it as a review comment for any patches from now on.
Maybe just use OMAP2_ prefix for defines common to all omaps >= 2
until we have have to rename some registers again?
Anybody have better ideas?
> Other alternative is to use Peripheral version in OMAP. Example:
>
> OMAP1 has DMA version 3
> OMAP2 has DMA version 4
> OMAP3 has DMA version 4
>
> So define a macro for DMA as
>
> OMAP_DMA3_yyyyyy : for all OMAPs where DMA version 3 is used (like OMAPV1030, OMAP1710, OMAP1610, etc)
>
> OMAP_DMA4_yyyyyy : for all OMAPs where DMA version 4 is used (like OMAP3430 2430 2420, etc).
>
> Similar thing can be adopted for SPI, McBSP, I2C, and other peripherals of OMAP.
Yeah this should be used where possible to keep the drivers working.
I think omap I2C driver is already doing it.
Regards,
Tony
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 0/5] Clean up omap24xx.h symbolic constants
2007-05-17 18:14 ` Tony Lindgren
@ 2007-05-17 19:11 ` Syed Mohammed, Khasim
2007-05-21 16:52 ` Paul Walmsley
0 siblings, 1 reply; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-05-17 19:11 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Paul Walmsley, linux-omap-open-source
>Maybe just use OMAP2_ prefix for defines common to all omaps >= 2
>until we have have to rename some registers again?
>
>Anybody have better ideas?
>
I agree with this approach, as most of the peripherals have same register offset and bit definitions.
Regards,
Khasim
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 0/5] Clean up omap24xx.h symbolic constants
2007-05-17 19:11 ` Syed Mohammed, Khasim
@ 2007-05-21 16:52 ` Paul Walmsley
0 siblings, 0 replies; 13+ messages in thread
From: Paul Walmsley @ 2007-05-21 16:52 UTC (permalink / raw)
To: Syed Mohammed, Khasim; +Cc: linux-omap-open-source
On Thu, 17 May 2007, Syed Mohammed, Khasim wrote:
>> Maybe just use OMAP2_ prefix for defines common to all omaps >= 2
>> until we have have to rename some registers again?
>>
>> Anybody have better ideas?
>>
>
> I agree with this approach, as most of the peripherals have same register offset and bit definitions.
Makes sense - I will respin the patches with this naming scheme.
- Paul
^ permalink raw reply [flat|nested] 13+ messages in thread