[PATCH RESEND v5 0/3] Add support for TI814X processor series

2011-12-09 Thread Hemant Pedanekar
This patch set adds support for DM814x/AM387x device series having Cortex-A8
MPU.

The technical documents are available from following link:

http://focus.ti.com/docs/prod/folders/print/tms320dm8148.html

This series is referred in code as TI814X.

Since these devices share similar architecture as TI816X devices, existing
TI816X code is updated to accomodate TI814X support. The code shared across
TI816X and TI814X devices is updated with TI81XX/ti81xx prefix as applicable,
while maintaining cpu_is_ti816x() and cpu_is_ti814x() to distinguish specific
execution differences.

Changes since v4:
1) Rebased on linux-omap/soc branch.
2) Updated for map_io and common.h changes.

Changes since v3:
1) Avoid renaming board-ti8168evm.c, just add TI8148 EVM support in it.
2) Drop changes in clock related data variables from u8 to u16 since the same
   was incorporated as part of AM33xx addition.

Changes since v2:
1) Incorporate Tony's suggestion about moving ti8168_evm_map_io() to
   arch/arm/mach-omap2/common.c to keep common across TI81XX.
2) Keeping single board file (board-ti81xxevm.c) for TI816X and TI814X EVMs

Changes since v1:
1) Rebased and updated after Paul's CHIP_IS removal changes
2) Removed call to omap2_init_common_devices() as per Kevin's comment

Hemant Pedanekar (3):
  ARM: OMAP: TI81XX: Prepare for addition of TI814X support
  ARM: OMAP: TI814X: Add cpu type macros and detection support
  ARM: OMAP: TI814X: Create board support and enable build for TI8148
EVM

 arch/arm/mach-omap2/Kconfig|   11 +--
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   33 +++
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   29 ++---
 arch/arm/mach-omap2/common.h   |   13 ---
 arch/arm/mach-omap2/control.h  |8 ++--
 arch/arm/mach-omap2/id.c   |   29 +++--
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +++---
 arch/arm/mach-omap2/io.c   |   14 
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   22 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 +-
 arch/arm/plat-omap/include/plat/uncompress.h   |   11 --
 19 files changed, 150 insertions(+), 82 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND v5 1/3] ARM: OMAP: TI81XX: Prepare for addition of TI814X support

2011-12-09 Thread Hemant Pedanekar
This patch updates existing macros, functions used for TI816X, to enable
addition of other SoCs belonging to TI81XX family (e.g., TI814X).

The approach taken is to use TI81XX/ti81xx for code/data going to be common
across all TI81XX devices.

cpu_is_ti81xx() is introduced to handle code common across TI81XX devices.

In addition, ti8168_evm_map_io() is now replaced with ti81xx_map_io() and moved
in mach-omap2/common.c as same will be used for TI814X and is not board
specific.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig|6 ++--
 arch/arm/mach-omap2/board-ti8168evm.c  |   11 ++-
 arch/arm/mach-omap2/clock3xxx_data.c   |2 +-
 arch/arm/mach-omap2/common.c   |   29 +++
 arch/arm/mach-omap2/common.h   |   13 +
 arch/arm/mach-omap2/control.h  |8 +++---
 arch/arm/mach-omap2/id.c   |8 +++---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/mach-omap2/io.c   |   14 +-
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/cpu.h  |   13 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 +-
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 ++--
 arch/arm/plat-omap/include/plat/uncompress.h   |8 +++---
 16 files changed, 90 insertions(+), 76 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index e1804bb..a34d0f7 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -76,8 +76,8 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
-config SOC_OMAPTI816X
-   bool TI816X support
+config SOC_OMAPTI81XX
+   bool TI81XX support
depends on ARCH_OMAP3
default y
 
@@ -319,7 +319,7 @@ config MACH_OMAP_3630SDP
 
 config MACH_TI8168EVM
bool TI8168 Evaluation Module
-   depends on SOC_OMAPTI816X
+   depends on SOC_OMAPTI81XX
default y
 
 config MACH_OMAP_4430SDP
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index 8402b39..b236fcc 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -35,17 +35,12 @@ static void __init ti8168_evm_init(void)
omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
 }
 
-static void __init ti8168_evm_map_io(void)
-{
-   omapti816x_map_common_io();
-}
-
 MACHINE_START(TI8168EVM, ti8168evm)
/* Maintainer: Texas Instruments */
.atag_offset= 0x100,
-   .map_io = ti8168_evm_map_io,
-   .init_early = ti816x_init_early,
-   .init_irq   = ti816x_init_irq,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
.init_machine   = ti8168_evm_init,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 3d56d8a..be0fa34 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3602,7 +3602,7 @@ int __init omap3xxx_clk_init(void)
 * Lock DPLL5 -- here only until other device init code can
 * handle this
 */
-   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
+   if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index c900dcb..aaf4211 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -110,27 +110,32 @@ void __init omap3_map_io(void)
 
 /*
  * Adjust TAP register base such that omap3_check_revision accesses the correct
- * TI816X register for checking device ID (it adds 0x204 to tap base while
- * TI816X DEVICE ID register is at offset 0x600 from control base).
+ * TI81XX register for checking device ID (it adds 0x204 to tap base while
+ * TI81XX DEVICE ID register is at offset 0x600 from control base).
  */
-#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
-   TI816X_CONTROL_DEVICE_ID - 0x204)
+#define TI81XX_TAP_BASE(TI81XX_CTRL_BASE + \
+   TI81XX_CONTROL_DEVICE_ID - 0x204)
 
-static struct omap_globals ti816x_globals = {
+static struct omap_globals ti81xx_globals = {
.class  = OMAP343X_CLASS,
-   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
-   .ctrl   = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE),
-   .prm

[PATCH RESEND v5 2/3] ARM: OMAP: TI814X: Add cpu type macros and detection support

2011-12-09 Thread Hemant Pedanekar
This patch adds cpu type, macros for identification of TI814X device.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c  |3 +++
 arch/arm/mach-omap2/id.c  |   21 +
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h |9 +
 5 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index be0fa34..5a623a5 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3519,6 +3519,9 @@ int __init omap3xxx_clk_init(void)
cpu_clkflg = CK_TI816X;
} else if (cpu_is_am33xx()) {
cpu_mask = RATE_IN_AM33XX;
+   } else if (cpu_is_ti814x()) {
+   cpu_mask = RATE_IN_TI814X;
+   cpu_clkflg = CK_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 1dc68e6..6c58266 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -343,6 +343,25 @@ static void __init omap3_check_revision(const char 
**cpu_rev)
case 0xb944:
omap_revision = AM335X_REV_ES1_0;
*cpu_rev = 1.0;
+   case 0xb8f2:
+   switch (rev) {
+   case 0:
+   /* FALLTHROUGH */
+   case 1:
+   omap_revision = TI8148_REV_ES1_0;
+   *cpu_rev = 1.0;
+   break;
+   case 2:
+   omap_revision = TI8148_REV_ES2_0;
+   *cpu_rev = 2.0;
+   break;
+   case 3:
+   /* FALLTHROUGH */
+   default:
+   omap_revision = TI8148_REV_ES2_1;
+   *cpu_rev = 2.1;
+   break;
+   }
break;
default:
/* Unknown default to latest silicon rev as default */
@@ -449,6 +468,8 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
cpu_name = TI816X;
} else if (cpu_is_am335x()) {
cpu_name =  AM335X;
+   } else if (cpu_is_ti814x()) {
+   cpu_name = TI814X;
} else if (omap3_has_iva()  omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
cpu_name = OMAP3430/3530;
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 387a963..3c50ec8 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -40,6 +40,7 @@ struct omap_clk {
 #define CK_443X(1  11)
 #define CK_TI816X  (1  12)
 #define CK_446X(1  13)
+#define CK_TI814X  (1  14)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index bb3e423..240a7b9 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -60,6 +60,7 @@ struct clkops {
 #define RATE_IN_TI816X (1  6)
 #define RATE_IN_4460   (1  7)
 #define RATE_IN_AM33XX (1  8)
+#define RATE_IN_TI814X (1  9)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 5f7aa49..6b51086 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -134,6 +134,7 @@ IS_OMAP_SUBCLASS(446x, 0x446)
 IS_OMAP_SUBCLASS(447x, 0x447)
 
 IS_TI_SUBCLASS(816x, 0x816)
+IS_TI_SUBCLASS(814x, 0x814)
 IS_AM_SUBCLASS(335x, 0x335)
 
 #define cpu_is_omap7xx()   0
@@ -146,6 +147,7 @@ IS_AM_SUBCLASS(335x, 0x335)
 #define cpu_is_omap343x()  0
 #define cpu_is_ti81xx()0
 #define cpu_is_ti816x()0
+#define cpu_is_ti814x()0
 #define cpu_is_am33xx()0
 #define cpu_is_am335x()0
 #define cpu_is_omap44xx()  0
@@ -356,6 +358,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3517
 # undef cpu_is_ti81xx
 # undef cpu_is_ti816x
+# undef cpu_is_ti814x
 # undef cpu_is_am33xx
 # undef cpu_is_am335x
 # define cpu_is_omap3430() is_omap3430()
@@ -376,6 +379,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3630() is_omap363x()
 # define cpu_is_ti81xx()   is_ti81xx()
 # define cpu_is_ti816x()   is_ti816x()
+# define cpu_is_ti814x()   is_ti814x

[PATCH RESEND v5 3/3] ARM: OMAP: TI814X: Create board support and enable build for TI8148 EVM

2011-12-09 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI8148 EVM. Also
adds support for low level debugging on UART1 console on the EVM.

Note that existing TI8168 EVM file (board-ti8168evm.c) is updated with machine
info for TI8148 EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig  |5 +
 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/board-ti8168evm.c|   22 --
 arch/arm/plat-omap/include/plat/uncompress.h |3 +++
 4 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index a34d0f7..cb760ac 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -322,6 +322,11 @@ config MACH_TI8168EVM
depends on SOC_OMAPTI81XX
default y
 
+config MACH_TI8148EVM
+   bool TI8148 Evaluation Module
+   depends on SOC_OMAPTI81XX
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 9a6da52..b9e0990 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -236,6 +236,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
 obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
+obj-$(CONFIG_MACH_TI8148EVM)   += board-ti8168evm.o
 
 # Platform specific device init code
 
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index b236fcc..b3ca997 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -1,5 +1,5 @@
 /*
- * Code for TI8168 EVM.
+ * Code for TI8168/TI8148 EVM.
  *
  * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
  *
@@ -24,15 +24,15 @@
 #include plat/board.h
 #include common.h
 
-static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+static struct omap_board_config_kernel ti81xx_evm_config[] __initdata = {
 };
 
-static void __init ti8168_evm_init(void)
+static void __init ti81xx_evm_init(void)
 {
omap_serial_init();
omap_sdrc_init(NULL, NULL);
-   omap_board_config = ti8168_evm_config;
-   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap_board_config = ti81xx_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti81xx_evm_config);
 }
 
 MACHINE_START(TI8168EVM, ti8168evm)
@@ -42,5 +42,15 @@ MACHINE_START(TI8168EVM, ti8168evm)
.init_early = ti81xx_init_early,
.init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
-   .init_machine   = ti8168_evm_init,
+   .init_machine   = ti81xx_evm_init,
+MACHINE_END
+
+MACHINE_START(TI8148EVM, ti8148evm)
+   /* Maintainer: Texas Instruments */
+   .atag_offset= 0x100,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
+   .timer  = omap3_timer,
+   .init_machine   = ti81xx_evm_init,
 MACHINE_END
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index 7fbc361..6ee9049 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -179,6 +179,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
/* TI8168 base boards using UART3 */
DEBUG_LL_TI81XX(3, ti8168evm);
 
+   /* TI8148 base boards using UART1 */
+   DEBUG_LL_TI81XX(1, ti8148evm);
+
} while (0);
 }
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND v5 0/3] Add support for TI814X processor series

2011-12-09 Thread Hemant Pedanekar
This patch set adds support for DM814x/AM387x device series having Cortex-A8
MPU.

The technical documents are available from following link:

http://focus.ti.com/docs/prod/folders/print/tms320dm8148.html

This series is referred in code as TI814X.

Since these devices share similar architecture as TI816X devices, existing
TI816X code is updated to accomodate TI814X support. The code shared across
TI816X and TI814X devices is updated with TI81XX/ti81xx prefix as applicable,
while maintaining cpu_is_ti816x() and cpu_is_ti814x() to distinguish specific
execution differences.

Changes since v4:
1) Rebased on linux-omap/soc branch.
2) Updated for map_io and common.h changes.

Changes since v3:
1) Avoid renaming board-ti8168evm.c, just add TI8148 EVM support in it.
2) Drop changes in clock related data variables from u8 to u16 since the same
   was incorporated as part of AM33xx addition.

Changes since v2:
1) Incorporate Tony's suggestion about moving ti8168_evm_map_io() to
   arch/arm/mach-omap2/common.c to keep common across TI81XX.
2) Keeping single board file (board-ti81xxevm.c) for TI816X and TI814X EVMs

Changes since v1:
1) Rebased and updated after Paul's CHIP_IS removal changes
2) Removed call to omap2_init_common_devices() as per Kevin's comment

Hemant Pedanekar (3):
  ARM: OMAP: TI81XX: Prepare for addition of TI814X support
  ARM: OMAP: TI814X: Add cpu type macros and detection support
  ARM: OMAP: TI814X: Create board support and enable build for TI8148
EVM

 arch/arm/mach-omap2/Kconfig|   11 +--
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   33 +++
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   29 ++---
 arch/arm/mach-omap2/common.h   |   13 ---
 arch/arm/mach-omap2/control.h  |8 ++--
 arch/arm/mach-omap2/id.c   |   29 +++--
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +++---
 arch/arm/mach-omap2/io.c   |   14 
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   22 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 +-
 arch/arm/plat-omap/include/plat/uncompress.h   |   11 --
 19 files changed, 150 insertions(+), 82 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND v5 2/3] ARM: OMAP: TI814X: Add cpu type macros and detection support

2011-12-09 Thread Hemant Pedanekar
This patch adds cpu type, macros for identification of TI814X device.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c  |3 +++
 arch/arm/mach-omap2/id.c  |   21 +
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h |9 +
 5 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index be0fa34..5a623a5 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3519,6 +3519,9 @@ int __init omap3xxx_clk_init(void)
cpu_clkflg = CK_TI816X;
} else if (cpu_is_am33xx()) {
cpu_mask = RATE_IN_AM33XX;
+   } else if (cpu_is_ti814x()) {
+   cpu_mask = RATE_IN_TI814X;
+   cpu_clkflg = CK_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 1dc68e6..6c58266 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -343,6 +343,25 @@ static void __init omap3_check_revision(const char 
**cpu_rev)
case 0xb944:
omap_revision = AM335X_REV_ES1_0;
*cpu_rev = 1.0;
+   case 0xb8f2:
+   switch (rev) {
+   case 0:
+   /* FALLTHROUGH */
+   case 1:
+   omap_revision = TI8148_REV_ES1_0;
+   *cpu_rev = 1.0;
+   break;
+   case 2:
+   omap_revision = TI8148_REV_ES2_0;
+   *cpu_rev = 2.0;
+   break;
+   case 3:
+   /* FALLTHROUGH */
+   default:
+   omap_revision = TI8148_REV_ES2_1;
+   *cpu_rev = 2.1;
+   break;
+   }
break;
default:
/* Unknown default to latest silicon rev as default */
@@ -449,6 +468,8 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
cpu_name = TI816X;
} else if (cpu_is_am335x()) {
cpu_name =  AM335X;
+   } else if (cpu_is_ti814x()) {
+   cpu_name = TI814X;
} else if (omap3_has_iva()  omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
cpu_name = OMAP3430/3530;
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 387a963..3c50ec8 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -40,6 +40,7 @@ struct omap_clk {
 #define CK_443X(1  11)
 #define CK_TI816X  (1  12)
 #define CK_446X(1  13)
+#define CK_TI814X  (1  14)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index bb3e423..240a7b9 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -60,6 +60,7 @@ struct clkops {
 #define RATE_IN_TI816X (1  6)
 #define RATE_IN_4460   (1  7)
 #define RATE_IN_AM33XX (1  8)
+#define RATE_IN_TI814X (1  9)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 5f7aa49..6b51086 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -134,6 +134,7 @@ IS_OMAP_SUBCLASS(446x, 0x446)
 IS_OMAP_SUBCLASS(447x, 0x447)
 
 IS_TI_SUBCLASS(816x, 0x816)
+IS_TI_SUBCLASS(814x, 0x814)
 IS_AM_SUBCLASS(335x, 0x335)
 
 #define cpu_is_omap7xx()   0
@@ -146,6 +147,7 @@ IS_AM_SUBCLASS(335x, 0x335)
 #define cpu_is_omap343x()  0
 #define cpu_is_ti81xx()0
 #define cpu_is_ti816x()0
+#define cpu_is_ti814x()0
 #define cpu_is_am33xx()0
 #define cpu_is_am335x()0
 #define cpu_is_omap44xx()  0
@@ -356,6 +358,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3517
 # undef cpu_is_ti81xx
 # undef cpu_is_ti816x
+# undef cpu_is_ti814x
 # undef cpu_is_am33xx
 # undef cpu_is_am335x
 # define cpu_is_omap3430() is_omap3430()
@@ -376,6 +379,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3630() is_omap363x()
 # define cpu_is_ti81xx()   is_ti81xx()
 # define cpu_is_ti816x()   is_ti816x()
+# define cpu_is_ti814x()   is_ti814x

[PATCH RESEND v5 1/3] ARM: OMAP: TI81XX: Prepare for addition of TI814X support

2011-12-09 Thread Hemant Pedanekar
This patch updates existing macros, functions used for TI816X, to enable
addition of other SoCs belonging to TI81XX family (e.g., TI814X).

The approach taken is to use TI81XX/ti81xx for code/data going to be common
across all TI81XX devices.

cpu_is_ti81xx() is introduced to handle code common across TI81XX devices.

In addition, ti8168_evm_map_io() is now replaced with ti81xx_map_io() and moved
in mach-omap2/common.c as same will be used for TI814X and is not board
specific.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig|6 ++--
 arch/arm/mach-omap2/board-ti8168evm.c  |   11 ++-
 arch/arm/mach-omap2/clock3xxx_data.c   |2 +-
 arch/arm/mach-omap2/common.c   |   29 +++
 arch/arm/mach-omap2/common.h   |   13 +
 arch/arm/mach-omap2/control.h  |8 +++---
 arch/arm/mach-omap2/id.c   |8 +++---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/mach-omap2/io.c   |   14 +-
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/cpu.h  |   13 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 +-
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 ++--
 arch/arm/plat-omap/include/plat/uncompress.h   |8 +++---
 16 files changed, 90 insertions(+), 76 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index e1804bb..a34d0f7 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -76,8 +76,8 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
-config SOC_OMAPTI816X
-   bool TI816X support
+config SOC_OMAPTI81XX
+   bool TI81XX support
depends on ARCH_OMAP3
default y
 
@@ -319,7 +319,7 @@ config MACH_OMAP_3630SDP
 
 config MACH_TI8168EVM
bool TI8168 Evaluation Module
-   depends on SOC_OMAPTI816X
+   depends on SOC_OMAPTI81XX
default y
 
 config MACH_OMAP_4430SDP
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index 8402b39..b236fcc 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -35,17 +35,12 @@ static void __init ti8168_evm_init(void)
omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
 }
 
-static void __init ti8168_evm_map_io(void)
-{
-   omapti816x_map_common_io();
-}
-
 MACHINE_START(TI8168EVM, ti8168evm)
/* Maintainer: Texas Instruments */
.atag_offset= 0x100,
-   .map_io = ti8168_evm_map_io,
-   .init_early = ti816x_init_early,
-   .init_irq   = ti816x_init_irq,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
.init_machine   = ti8168_evm_init,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 3d56d8a..be0fa34 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3602,7 +3602,7 @@ int __init omap3xxx_clk_init(void)
 * Lock DPLL5 -- here only until other device init code can
 * handle this
 */
-   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
+   if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index c900dcb..aaf4211 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -110,27 +110,32 @@ void __init omap3_map_io(void)
 
 /*
  * Adjust TAP register base such that omap3_check_revision accesses the correct
- * TI816X register for checking device ID (it adds 0x204 to tap base while
- * TI816X DEVICE ID register is at offset 0x600 from control base).
+ * TI81XX register for checking device ID (it adds 0x204 to tap base while
+ * TI81XX DEVICE ID register is at offset 0x600 from control base).
  */
-#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
-   TI816X_CONTROL_DEVICE_ID - 0x204)
+#define TI81XX_TAP_BASE(TI81XX_CTRL_BASE + \
+   TI81XX_CONTROL_DEVICE_ID - 0x204)
 
-static struct omap_globals ti816x_globals = {
+static struct omap_globals ti81xx_globals = {
.class  = OMAP343X_CLASS,
-   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
-   .ctrl   = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE),
-   .prm

[PATCH RESEND v5 3/3] ARM: OMAP: TI814X: Create board support and enable build for TI8148 EVM

2011-12-09 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI8148 EVM. Also
adds support for low level debugging on UART1 console on the EVM.

Note that existing TI8168 EVM file (board-ti8168evm.c) is updated with machine
info for TI8148 EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig  |5 +
 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/board-ti8168evm.c|   22 --
 arch/arm/plat-omap/include/plat/uncompress.h |3 +++
 4 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index a34d0f7..cb760ac 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -322,6 +322,11 @@ config MACH_TI8168EVM
depends on SOC_OMAPTI81XX
default y
 
+config MACH_TI8148EVM
+   bool TI8148 Evaluation Module
+   depends on SOC_OMAPTI81XX
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 9a6da52..b9e0990 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -236,6 +236,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
 obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
+obj-$(CONFIG_MACH_TI8148EVM)   += board-ti8168evm.o
 
 # Platform specific device init code
 
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index b236fcc..b3ca997 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -1,5 +1,5 @@
 /*
- * Code for TI8168 EVM.
+ * Code for TI8168/TI8148 EVM.
  *
  * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
  *
@@ -24,15 +24,15 @@
 #include plat/board.h
 #include common.h
 
-static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+static struct omap_board_config_kernel ti81xx_evm_config[] __initdata = {
 };
 
-static void __init ti8168_evm_init(void)
+static void __init ti81xx_evm_init(void)
 {
omap_serial_init();
omap_sdrc_init(NULL, NULL);
-   omap_board_config = ti8168_evm_config;
-   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap_board_config = ti81xx_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti81xx_evm_config);
 }
 
 MACHINE_START(TI8168EVM, ti8168evm)
@@ -42,5 +42,15 @@ MACHINE_START(TI8168EVM, ti8168evm)
.init_early = ti81xx_init_early,
.init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
-   .init_machine   = ti8168_evm_init,
+   .init_machine   = ti81xx_evm_init,
+MACHINE_END
+
+MACHINE_START(TI8148EVM, ti8148evm)
+   /* Maintainer: Texas Instruments */
+   .atag_offset= 0x100,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
+   .timer  = omap3_timer,
+   .init_machine   = ti81xx_evm_init,
 MACHINE_END
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index 7fbc361..6ee9049 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -179,6 +179,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
/* TI8168 base boards using UART3 */
DEBUG_LL_TI81XX(3, ti8168evm);
 
+   /* TI8148 base boards using UART1 */
+   DEBUG_LL_TI81XX(1, ti8148evm);
+
} while (0);
 }
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 0/3] Add support for TI814X processor series

2011-10-09 Thread Hemant Pedanekar
This patch set adds support for DM814x/AM387x device series having Cortex-A8
MPU.

The technical documents are available from following link:

http://focus.ti.com/docs/prod/folders/print/tms320dm8148.html

This series is referred in code as TI814X.

Since these devices share similar architecture as TI816X devices, existing
TI816X code is updated to accomodate TI814X support. The code shared across
TI816X and TI814X devices is updated with TI81XX/ti81xx prefix as applicable,
while maintaining cpu_is_ti816x() and cpu_is_ti814x() to distinguish specific
execution differences.

Changes since v3:
1) Avoid renaming board-ti8168evm.c, just add TI8148 EVM support in it.
2) Drop changes in clock related data variables from u8 to u16 since the same
   was incorporated as part of AM33xx addition.

Changes since v2:
1) Incorporate Tony's suggestion about moving ti8168_evm_map_io() to
   arch/arm/mach-omap2/common.c to keep common across TI81XX.
2) Keeping single board file (board-ti81xxevm.c) for TI816X and TI814X EVMs

Changes since v1:
1) Rebased and updated after Paul's CHIP_IS removal changes
2) Removed call to omap2_init_common_devices() as per Kevin's comment

Hemant Pedanekar (3):
  ARM: OMAP: TI81XX: Prepare for addition of TI814X support
  ARM: OMAP: TI814X: Add cpu type macros and detection support
  ARM: OMAP: TI814X: Create board support and enable build for TI8148
EVM

 arch/arm/mach-omap2/Kconfig|   11 +--
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   33 +++
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   27 +--
 arch/arm/mach-omap2/control.h  |8 ++--
 arch/arm/mach-omap2/id.c   |   30 +++--
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +++---
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   14 
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |6 ++--
 arch/arm/plat-omap/include/plat/cpu.h  |   22 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 ++--
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 +-
 arch/arm/plat-omap/include/plat/uncompress.h   |   11 --
 arch/arm/plat-omap/io.c|2 +-
 23 files changed, 153 insertions(+), 85 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/3] ARM: OMAP: TI81XX: Prepare for addition of TI814X support

2011-10-09 Thread Hemant Pedanekar
This patch updates existing macros, functions used for TI816X, to enable
addition of other SoCs belonging to TI81XX family (e.g., TI814X).

The approach taken is to use TI81XX/ti81xx for code/data going to be common
across all TI81XX devices.

cpu_is_ti81xx() is introduced to handle code common across TI81XX devices.

In addition, ti8168_evm_map_io() is now replaced with ti81xx_map_io() and moved
in mach-omap2/common.c as same will be used for TI814X and is not board
specific.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig|6 ++--
 arch/arm/mach-omap2/board-ti8168evm.c  |   11 ++--
 arch/arm/mach-omap2/clock3xxx_data.c   |2 +-
 arch/arm/mach-omap2/common.c   |   27 +++
 arch/arm/mach-omap2/control.h  |8 +++---
 arch/arm/mach-omap2/id.c   |8 +++---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   14 +-
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/common.h   |6 ++--
 arch/arm/plat-omap/include/plat/cpu.h  |   13 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 ++--
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 +-
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 ++--
 arch/arm/plat-omap/include/plat/uncompress.h   |8 +++---
 arch/arm/plat-omap/io.c|2 +-
 20 files changed, 92 insertions(+), 79 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 45498c2..caebeb7 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -73,8 +73,8 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
-config SOC_OMAPTI816X
-   bool TI816X support
+config SOC_OMAPTI81XX
+   bool TI81XX support
depends on ARCH_OMAP3
default y
 
@@ -322,7 +322,7 @@ config MACH_OMAP_3630SDP
 
 config MACH_TI8168EVM
bool TI8168 Evaluation Module
-   depends on SOC_OMAPTI816X
+   depends on SOC_OMAPTI81XX
default y
 
 config MACH_OMAP_4430SDP
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index e6ee884..7935fc9 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -35,17 +35,12 @@ static void __init ti8168_evm_init(void)
omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
 }
 
-static void __init ti8168_evm_map_io(void)
-{
-   omapti816x_map_common_io();
-}
-
 MACHINE_START(TI8168EVM, ti8168evm)
/* Maintainer: Texas Instruments */
.atag_offset= 0x100,
-   .map_io = ti8168_evm_map_io,
-   .init_early = ti816x_init_early,
-   .init_irq   = ti816x_init_irq,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
.init_machine   = ti8168_evm_init,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 5d0064a..96622b6 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3600,7 +3600,7 @@ int __init omap3xxx_clk_init(void)
 * Lock DPLL5 -- here only until other device init code can
 * handle this
 */
-   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
+   if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 110e5b9..7754e16 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -110,23 +110,28 @@ void __init omap3_map_io(void)
 
 /*
  * Adjust TAP register base such that omap3_check_revision accesses the correct
- * TI816X register for checking device ID (it adds 0x204 to tap base while
- * TI816X DEVICE ID register is at offset 0x600 from control base).
+ * TI81XX register for checking device ID (it adds 0x204 to tap base while
+ * TI81XX DEVICE ID register is at offset 0x600 from control base).
  */
-#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
-   TI816X_CONTROL_DEVICE_ID - 0x204)
+#define TI81XX_TAP_BASE(TI81XX_CTRL_BASE + \
+   TI81XX_CONTROL_DEVICE_ID - 0x204)
 
-static struct

[PATCH v4 2/3] ARM: OMAP: TI814X: Add cpu type macros and detection support

2011-10-09 Thread Hemant Pedanekar
This patch adds cpu type, macros for identification of TI814X device.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c  |3 +++
 arch/arm/mach-omap2/id.c  |   22 ++
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h |9 +
 5 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 96622b6..4d8e908 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3517,6 +3517,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_ti816x()) {
cpu_mask = RATE_IN_TI816X;
cpu_clkflg = CK_TI816X;
+   } else if (cpu_is_ti814x()) {
+   cpu_mask = RATE_IN_TI814X;
+   cpu_clkflg = CK_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index ab2f417..f07faa9 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -337,6 +337,26 @@ static void __init omap3_check_revision(const char 
**cpu_rev)
break;
}
break;
+   case 0xb8f2:
+   switch (rev) {
+   case 0:
+   /* FALLTHROUGH */
+   case 1:
+   omap_revision = TI8148_REV_ES1_0;
+   *cpu_rev = 1.0;
+   break;
+   case 2:
+   omap_revision = TI8148_REV_ES2_0;
+   *cpu_rev = 2.0;
+   break;
+   case 3:
+   /* FALLTHROUGH */
+   default:
+   omap_revision = TI8148_REV_ES2_1;
+   *cpu_rev = 2.1;
+   break;
+   }
+   break;
default:
/* Unknown default to latest silicon rev as default */
omap_revision = OMAP3630_REV_ES1_2;
@@ -429,6 +449,8 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
cpu_name = (omap3_has_sgx()) ? AM3517 : AM3505;
} else if (cpu_is_ti816x()) {
cpu_name = TI816X;
+   } else if (cpu_is_ti814x()) {
+   cpu_name = TI814X;
} else if (omap3_has_iva()  omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
cpu_name = OMAP3430/3530;
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 6d84c0c..ea61ea2 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -41,6 +41,7 @@ struct omap_clk {
 #define CK_TI816X  (1  12)
 #define CK_446X(1  13)
 #define CK_AM33XX  (1  14)   /* AM33xx specific clocks */
+#define CK_TI814X  (1  15)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 168c54e..739ba23 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -60,6 +60,7 @@ struct clkops {
 #define RATE_IN_TI816X (1  6)
 #define RATE_IN_4460   (1  7)
 #define RATE_IN_AM33XX (1  8)
+#define RATE_IN_TI814X (1  9)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 03ab390..6bc662e 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -132,6 +132,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 IS_OMAP_SUBCLASS(446x, 0x446)
 
 IS_TI_SUBCLASS(816x, 0x816)
+IS_TI_SUBCLASS(814x, 0x814)
 IS_AM_SUBCLASS(335x, 0x335)
 
 #define cpu_is_omap7xx()   0
@@ -144,6 +145,7 @@ IS_AM_SUBCLASS(335x, 0x335)
 #define cpu_is_omap343x()  0
 #define cpu_is_ti81xx()0
 #define cpu_is_ti816x()0
+#define cpu_is_ti814x()0
 #define cpu_is_am33xx()0
 #define cpu_is_am335x()0
 #define cpu_is_omap44xx()  0
@@ -353,6 +355,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3517
 # undef cpu_is_ti81xx
 # undef cpu_is_ti816x
+# undef cpu_is_ti814x
 # undef cpu_is_am33xx
 # undef cpu_is_am335x
 # define cpu_is_omap3430() is_omap3430()
@@ -373,6 +376,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3630() is_omap363x()
 # define cpu_is_ti81xx()   is_ti81xx()
 # define cpu_is_ti816x

[PATCH v4 3/3] ARM: OMAP: TI814X: Create board support and enable build for TI8148 EVM

2011-10-09 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI8148 EVM. Also
adds support for low level debugging on UART1 console on the EVM.

Note that existing TI8168 EVM file (board-ti8168evm.c) is updated with machine
info for TI8148 EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig  |5 +
 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/board-ti8168evm.c|   22 --
 arch/arm/plat-omap/include/plat/uncompress.h |3 +++
 4 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index caebeb7..59942b2 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -325,6 +325,11 @@ config MACH_TI8168EVM
depends on SOC_OMAPTI81XX
default y
 
+config MACH_TI8148EVM
+   bool TI8148 Evaluation Module
+   depends on SOC_OMAPTI81XX
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5ee4cd6..0e27e43 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -240,6 +240,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
 obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
+obj-$(CONFIG_MACH_TI8148EVM)   += board-ti8168evm.o
 
 # Platform specific device init code
 
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index 7935fc9..b858921 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -1,5 +1,5 @@
 /*
- * Code for TI8168 EVM.
+ * Code for TI8168/TI8148 EVM.
  *
  * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
  *
@@ -24,15 +24,15 @@
 #include plat/board.h
 #include plat/common.h
 
-static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+static struct omap_board_config_kernel ti81xx_evm_config[] __initdata = {
 };
 
-static void __init ti8168_evm_init(void)
+static void __init ti81xx_evm_init(void)
 {
omap_serial_init();
omap_sdrc_init(NULL, NULL);
-   omap_board_config = ti8168_evm_config;
-   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap_board_config = ti81xx_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti81xx_evm_config);
 }
 
 MACHINE_START(TI8168EVM, ti8168evm)
@@ -42,5 +42,15 @@ MACHINE_START(TI8168EVM, ti8168evm)
.init_early = ti81xx_init_early,
.init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
-   .init_machine   = ti8168_evm_init,
+   .init_machine   = ti81xx_evm_init,
+MACHINE_END
+
+MACHINE_START(TI8148EVM, ti8148evm)
+   /* Maintainer: Texas Instruments */
+   .atag_offset= 0x100,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
+   .timer  = omap3_timer,
+   .init_machine   = ti81xx_evm_init,
 MACHINE_END
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index a8e5187..27d9d31 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -181,6 +181,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
/* TI8168 base boards using UART3 */
DEBUG_LL_TI81XX(3, ti8168evm);
 
+   /* TI8148 base boards using UART1 */
+   DEBUG_LL_TI81XX(1, ti8148evm);
+
} while (0);
 }
 
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/3] Add support for TI814X processor series

2011-09-28 Thread Hemant Pedanekar
This patch set adds support for DM814x/AM387x device series having Cortex-A8
MPU.

The technical documents are available from following link:

http://focus.ti.com/docs/prod/folders/print/tms320dm8148.html

This series is referred in code as TI814X.

Since these devices share similar architecture as TI816X devices, existing
TI816X code is updated to accomodate TI814X support. The code shared across
TI816X and TI814X devices is updated with TI81XX/ti81xx prefix as applicable,
while maintaining cpu_is_ti816x() and cpu_is_ti814x() to distinguish specific
execution differences.

Changes since v2:
1) Incorporate Tony's suggestion about moving ti8168_evm_map_io() to
   arch/arm/mach-omap2/common.c to keep common across TI81XX.
2) Keeping single board file (board-ti81xxevm.c) for TI816X and TI814X EVMs

Changes since v1:
1) Rebased and updated after Paul's CHIP_IS removal changes
2) Removed call to omap2_init_common_devices() as per Kevin's comment

Hemant Pedanekar (3):
  ARM: OMAP: TI81XX: Prepare for addition of TI814X support
  ARM: OMAP: TI814X: Add cpu type macros and detection support
  ARM: OMAP: TI814X: Create board support and enable build for TI8148
EVM

 arch/arm/mach-omap2/Kconfig|   11 +--
 arch/arm/mach-omap2/Makefile   |3 +-
 .../{board-ti8168evm.c = board-ti81xxevm.c}   |   34 +++-
 arch/arm/mach-omap2/clock.c|2 +-
 arch/arm/mach-omap2/clock.h|2 +-
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   28 ++--
 arch/arm/mach-omap2/control.h  |8 ++--
 arch/arm/mach-omap2/id.c   |   30 +++--
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +++---
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   12 +++---
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/opp2xxx.h  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|3 +-
 arch/arm/plat-omap/include/plat/common.h   |5 ++-
 arch/arm/plat-omap/include/plat/cpu.h  |   22 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 ++--
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 +-
 arch/arm/plat-omap/include/plat/uncompress.h   |   11 --
 arch/arm/plat-omap/io.c|2 +-
 26 files changed, 158 insertions(+), 89 deletions(-)
 rename arch/arm/mach-omap2/{board-ti8168evm.c = board-ti81xxevm.c} (60%)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/3] ARM: OMAP: TI81XX: Prepare for addition of TI814X support

2011-09-28 Thread Hemant Pedanekar
This patch updates existing macros, functions used for TI816X, to enable
addition of other SoCs belonging to TI81XX family (e.g., TI814X).

The approach taken is to use TI81XX/ti81xx for code/data going to be common
across all TI81XX devices.

cpu_is_ti81xx() is introduced to handle code common across TI81XX devices.

In addition, ti8168_evm_map_io() is now replaced with ti81xx_map_io() and moved
in mach-omap2/common.c as same will be used for TI814X and is not board
specific.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig|6 ++--
 arch/arm/mach-omap2/board-ti8168evm.c  |   12 ++--
 arch/arm/mach-omap2/clock3xxx_data.c   |2 +-
 arch/arm/mach-omap2/common.c   |   28 
 arch/arm/mach-omap2/control.h  |8 +++---
 arch/arm/mach-omap2/id.c   |8 +++---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   12 
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/common.h   |5 ++-
 arch/arm/plat-omap/include/plat/cpu.h  |   13 +
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 ++--
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 +-
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 ++--
 arch/arm/plat-omap/include/plat/uncompress.h   |8 +++---
 arch/arm/plat-omap/io.c|2 +-
 20 files changed, 92 insertions(+), 78 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 7edf802..a3b9227 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -73,8 +73,8 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
-config SOC_OMAPTI816X
-   bool TI816X support
+config SOC_OMAPTI81XX
+   bool TI81XX support
depends on ARCH_OMAP3
default y
 
@@ -313,7 +313,7 @@ config MACH_OMAP_3630SDP
 
 config MACH_TI8168EVM
bool TI8168 Evaluation Module
-   depends on SOC_OMAPTI816X
+   depends on SOC_OMAPTI81XX
default y
 
 config MACH_OMAP_4430SDP
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index e26c79c..7935fc9 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -35,18 +35,12 @@ static void __init ti8168_evm_init(void)
omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
 }
 
-static void __init ti8168_evm_map_io(void)
-{
-   omap2_set_globals_ti816x();
-   omapti816x_map_common_io();
-}
-
 MACHINE_START(TI8168EVM, ti8168evm)
/* Maintainer: Texas Instruments */
.atag_offset= 0x100,
-   .map_io = ti8168_evm_map_io,
-   .init_early = ti816x_init_early,
-   .init_irq   = ti816x_init_irq,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
.init_machine   = ti8168_evm_init,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 65dd363..74cc7ce 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3612,7 +3612,7 @@ int __init omap3xxx_clk_init(void)
 * Lock DPLL5 -- here only until other device init code can
 * handle this
 */
-   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
+   if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 3f20cbb..2ce8e2b 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -101,23 +101,29 @@ void __init omap3_map_io(void)
 
 /*
  * Adjust TAP register base such that omap3_check_revision accesses the correct
- * TI816X register for checking device ID (it adds 0x204 to tap base while
- * TI816X DEVICE ID register is at offset 0x600 from control base).
+ * TI81XX register for checking device ID (it adds 0x204 to tap base while
+ * TI81XX DEVICE ID register is at offset 0x600 from control base).
  */
-#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
-   TI816X_CONTROL_DEVICE_ID - 0x204)
+#define TI81XX_TAP_BASE(TI81XX_CTRL_BASE + \
+   TI81XX_CONTROL_DEVICE_ID

[PATCH v3 2/3] ARM: OMAP: TI814X: Add cpu type macros and detection support

2011-09-28 Thread Hemant Pedanekar
This patch adds cpu type, macros for identification of TI814X device.

Note that following update to common OMAP data structures is made:

cpu_mask and RATE_IN_XXX flags have crossed 8 bit hence struct
clksel_rate.flags, struct prcm_config.flags and cpu_mask are changed to u16 from
u8.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock.c   |2 +-
 arch/arm/mach-omap2/clock.h   |2 +-
 arch/arm/mach-omap2/clock3xxx_data.c  |3 +++
 arch/arm/mach-omap2/id.c  |   22 ++
 arch/arm/mach-omap2/opp2xxx.h |2 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |3 ++-
 arch/arm/plat-omap/include/plat/cpu.h |9 +
 8 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 1f3481f..f57ed5b 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -35,7 +35,7 @@
 #include cm-regbits-24xx.h
 #include cm-regbits-34xx.h
 
-u8 cpu_mask;
+u16 cpu_mask;
 
 /*
  * clkdm_control: if true, then when a clock is enabled in the
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 48ac568..687d3d3 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -130,7 +130,7 @@ void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
   const char *core_ck_name,
   const char *mpu_ck_name);
 
-extern u8 cpu_mask;
+extern u16 cpu_mask;
 
 extern const struct clkops clkops_omap2_dflt_wait;
 extern const struct clkops clkops_dummy;
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 74cc7ce..230ff88 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3529,6 +3529,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_ti816x()) {
cpu_mask = RATE_IN_TI816X;
cpu_clkflg = CK_TI816X;
+   } else if (cpu_is_ti814x()) {
+   cpu_mask = RATE_IN_TI814X;
+   cpu_clkflg = CK_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index ab2f417..f07faa9 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -337,6 +337,26 @@ static void __init omap3_check_revision(const char 
**cpu_rev)
break;
}
break;
+   case 0xb8f2:
+   switch (rev) {
+   case 0:
+   /* FALLTHROUGH */
+   case 1:
+   omap_revision = TI8148_REV_ES1_0;
+   *cpu_rev = 1.0;
+   break;
+   case 2:
+   omap_revision = TI8148_REV_ES2_0;
+   *cpu_rev = 2.0;
+   break;
+   case 3:
+   /* FALLTHROUGH */
+   default:
+   omap_revision = TI8148_REV_ES2_1;
+   *cpu_rev = 2.1;
+   break;
+   }
+   break;
default:
/* Unknown default to latest silicon rev as default */
omap_revision = OMAP3630_REV_ES1_2;
@@ -429,6 +449,8 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
cpu_name = (omap3_has_sgx()) ? AM3517 : AM3505;
} else if (cpu_is_ti816x()) {
cpu_name = TI816X;
+   } else if (cpu_is_ti814x()) {
+   cpu_name = TI814X;
} else if (omap3_has_iva()  omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
cpu_name = OMAP3430/3530;
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h
index 8affc66..8fae534 100644
--- a/arch/arm/mach-omap2/opp2xxx.h
+++ b/arch/arm/mach-omap2/opp2xxx.h
@@ -51,7 +51,7 @@ struct prcm_config {
unsigned long cm_clksel2_pll;   /* dpllx1 or x2 out */
unsigned long cm_clksel_mdm;/* modem dividers 2430 only */
unsigned long base_sdrc_rfr;/* base refresh timing for a set */
-   unsigned char flags;
+   unsigned short flags;
 };
 
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 387a963..3c50ec8 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -40,6 +40,7 @@ struct omap_clk {
 #define CK_443X(1  11)
 #define CK_TI816X  (1  12)
 #define CK_446X(1  13)
+#define CK_TI814X  (1  14)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat

[PATCH v3 3/3] ARM: OMAP: TI814X: Create board support and enable build for TI8148 EVM

2011-09-28 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI8148 EVM. Also
adds support for low level debugging on UART1 console on the EVM.

Note that existing TI8168 EVM file (board-ti8168evm.c) is updated with machine
info for TI8148 EVM and renamed as board-ti81xxevm.c.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig|5 
 arch/arm/mach-omap2/Makefile   |3 +-
 .../{board-ti8168evm.c = board-ti81xxevm.c}   |   22 ++-
 arch/arm/plat-omap/include/plat/uncompress.h   |3 ++
 4 files changed, 26 insertions(+), 7 deletions(-)
 rename arch/arm/mach-omap2/{board-ti8168evm.c = board-ti81xxevm.c} (66%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index a3b9227..cc4f213 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -316,6 +316,11 @@ config MACH_TI8168EVM
depends on SOC_OMAPTI81XX
default y
 
+config MACH_TI8148EVM
+   bool TI8148 Evaluation Module
+   depends on SOC_OMAPTI81XX
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5ee4cd6..1dc2c6b 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -239,7 +239,8 @@ obj-$(CONFIG_MACH_OMAP3517EVM)  += 
board-am3517evm.o \
 obj-$(CONFIG_MACH_CRANEBOARD)  += board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
-obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti81xxevm.o
+obj-$(CONFIG_MACH_TI8148EVM)   += board-ti81xxevm.o
 
 # Platform specific device init code
 
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti81xxevm.c
similarity index 66%
rename from arch/arm/mach-omap2/board-ti8168evm.c
rename to arch/arm/mach-omap2/board-ti81xxevm.c
index 7935fc9..b858921 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti81xxevm.c
@@ -1,5 +1,5 @@
 /*
- * Code for TI8168 EVM.
+ * Code for TI8168/TI8148 EVM.
  *
  * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
  *
@@ -24,15 +24,15 @@
 #include plat/board.h
 #include plat/common.h
 
-static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+static struct omap_board_config_kernel ti81xx_evm_config[] __initdata = {
 };
 
-static void __init ti8168_evm_init(void)
+static void __init ti81xx_evm_init(void)
 {
omap_serial_init();
omap_sdrc_init(NULL, NULL);
-   omap_board_config = ti8168_evm_config;
-   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap_board_config = ti81xx_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti81xx_evm_config);
 }
 
 MACHINE_START(TI8168EVM, ti8168evm)
@@ -42,5 +42,15 @@ MACHINE_START(TI8168EVM, ti8168evm)
.init_early = ti81xx_init_early,
.init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
-   .init_machine   = ti8168_evm_init,
+   .init_machine   = ti81xx_evm_init,
+MACHINE_END
+
+MACHINE_START(TI8148EVM, ti8148evm)
+   /* Maintainer: Texas Instruments */
+   .atag_offset= 0x100,
+   .map_io = ti81xx_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
+   .timer  = omap3_timer,
+   .init_machine   = ti81xx_evm_init,
 MACHINE_END
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index 40336ad..8d052e7 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -175,6 +175,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
/* TI8168 base boards using UART3 */
DEBUG_LL_TI81XX(3, ti8168evm);
 
+   /* TI8148 base boards using UART1 */
+   DEBUG_LL_TI81XX(1, ti8148evm);
+
} while (0);
 }
 
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/3] Add support for TI814X processor series

2011-09-21 Thread Hemant Pedanekar
This patch set adds support for DM814x/AM387x device series having Cortex-A8
MPU.

The technical documents are available from following link:

http://focus.ti.com/docs/prod/folders/print/tms320dm8148.html

This series is referred in code as TI814X.

Since these devices share similar architecture as TI816X devices, existing
TI816X code is updated to accomodate TI814X support. The code shared across
TI816X and TI814X devices is updated with TI81XX/ti81xx prefix as applicable,
while maintaining cpu_is_ti816x() and cpu_is_ti814x() to distinguish specific
execution differences.

Changes since v1:
1) Rebased and updated after Paul's CHIP_IS removal changes
2) Removed call to omap2_init_common_devices() as per Kevin's comment

Hemant Pedanekar (3):
  TI81XX: Prepare for addition of TI814X support
  TI814X: Add cpu type macros and detection support
  TI814X: Create board support and enable build for TI8148 EVM

 arch/arm/mach-omap2/Kconfig|   11 +++-
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8148evm.c  |   51 
 arch/arm/mach-omap2/board-ti8168evm.c  |8 ++--
 arch/arm/mach-omap2/clock.c|2 +-
 arch/arm/mach-omap2/clock.h|2 +-
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   22 
 arch/arm/mach-omap2/control.h  |8 ++--
 arch/arm/mach-omap2/id.c   |   30 ++--
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 ++--
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   12 ++--
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/opp2xxx.h  |2 +-
 arch/arm/mach-omap2/serial.c   |6 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|3 +-
 arch/arm/plat-omap/include/plat/common.h   |4 +-
 arch/arm/plat-omap/include/plat/cpu.h  |   22 
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 +-
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 +++---
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 
 arch/arm/plat-omap/include/plat/uncompress.h   |   11 +++--
 arch/arm/plat-omap/io.c|2 +-
 27 files changed, 186 insertions(+), 77 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8148evm.c
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/3] TI81XX: Prepare for addition of TI814X support

2011-09-21 Thread Hemant Pedanekar
This patch updates existing macros, functions used for TI816X, to enable
addition of other SoCs belonging to TI81XX family (e.g., TI814X).

The approach taken is to use TI81XX/ti81xx for code/data going to be common
across all TI81XX devices.

cpu_is_ti81xx() is introduced to handle code common across TI81XX devices.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig|6 ++--
 arch/arm/mach-omap2/board-ti8168evm.c  |8 +++---
 arch/arm/mach-omap2/clock3xxx_data.c   |2 +-
 arch/arm/mach-omap2/common.c   |   22 ++--
 arch/arm/mach-omap2/control.h  |8 +++---
 arch/arm/mach-omap2/id.c   |8 +++---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +-
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   12 +-
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/common.h   |4 +-
 arch/arm/plat-omap/include/plat/cpu.h  |   13 +++
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 ++--
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 ++--
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 
 arch/arm/plat-omap/include/plat/uncompress.h   |8 +++---
 arch/arm/plat-omap/io.c|2 +-
 20 files changed, 86 insertions(+), 73 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 7edf802..a3b9227 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -73,8 +73,8 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
-config SOC_OMAPTI816X
-   bool TI816X support
+config SOC_OMAPTI81XX
+   bool TI81XX support
depends on ARCH_OMAP3
default y
 
@@ -313,7 +313,7 @@ config MACH_OMAP_3630SDP
 
 config MACH_TI8168EVM
bool TI8168 Evaluation Module
-   depends on SOC_OMAPTI816X
+   depends on SOC_OMAPTI81XX
default y
 
 config MACH_OMAP_4430SDP
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index e26c79c..e0c7300 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -37,16 +37,16 @@ static void __init ti8168_evm_init(void)
 
 static void __init ti8168_evm_map_io(void)
 {
-   omap2_set_globals_ti816x();
-   omapti816x_map_common_io();
+   omap2_set_globals_ti81xx();
+   omapti81xx_map_common_io();
 }
 
 MACHINE_START(TI8168EVM, ti8168evm)
/* Maintainer: Texas Instruments */
.atag_offset= 0x100,
.map_io = ti8168_evm_map_io,
-   .init_early = ti816x_init_early,
-   .init_irq   = ti816x_init_irq,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
.init_machine   = ti8168_evm_init,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index dadb8c6..6054654 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3576,7 +3576,7 @@ int __init omap3xxx_clk_init(void)
 * Lock DPLL5 -- here only until other device init code can
 * handle this
 */
-   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
+   if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 3f20cbb..7ce80f2 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -101,23 +101,23 @@ void __init omap3_map_io(void)
 
 /*
  * Adjust TAP register base such that omap3_check_revision accesses the correct
- * TI816X register for checking device ID (it adds 0x204 to tap base while
- * TI816X DEVICE ID register is at offset 0x600 from control base).
+ * TI81XX register for checking device ID (it adds 0x204 to tap base while
+ * TI81XX DEVICE ID register is at offset 0x600 from control base).
  */
-#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
-   TI816X_CONTROL_DEVICE_ID - 0x204)
+#define TI81XX_TAP_BASE(TI81XX_CTRL_BASE + \
+   TI81XX_CONTROL_DEVICE_ID - 0x204)
 
-static struct omap_globals ti816x_globals = {
+static struct omap_globals ti81xx_globals = {
.class  = OMAP343X_CLASS,
-   .tap= OMAP2_L4_IO_ADDRESS

[PATCH v2 2/3] TI814X: Add cpu type macros and detection support

2011-09-21 Thread Hemant Pedanekar
This patch adds cpu type, macros for identification of TI814X device.

Note that following update to common OMAP data structures is made:

cpu_mask and RATE_IN_XXX flags have crossed 8 bit hence struct
clksel_rate.flags, struct prcm_config.flags and cpu_mask are changed to u16 from
u8.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock.c   |2 +-
 arch/arm/mach-omap2/clock.h   |2 +-
 arch/arm/mach-omap2/clock3xxx_data.c  |3 +++
 arch/arm/mach-omap2/id.c  |   22 ++
 arch/arm/mach-omap2/opp2xxx.h |2 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |3 ++-
 arch/arm/plat-omap/include/plat/cpu.h |9 +
 8 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 1f3481f..f57ed5b 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -35,7 +35,7 @@
 #include cm-regbits-24xx.h
 #include cm-regbits-34xx.h
 
-u8 cpu_mask;
+u16 cpu_mask;
 
 /*
  * clkdm_control: if true, then when a clock is enabled in the
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 48ac568..687d3d3 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -130,7 +130,7 @@ void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
   const char *core_ck_name,
   const char *mpu_ck_name);
 
-extern u8 cpu_mask;
+extern u16 cpu_mask;
 
 extern const struct clkops clkops_omap2_dflt_wait;
 extern const struct clkops clkops_dummy;
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 6054654..b4d5f84 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3493,6 +3493,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_ti816x()) {
cpu_mask = RATE_IN_TI816X;
cpu_clkflg = CK_TI816X;
+   } else if (cpu_is_ti814x()) {
+   cpu_mask = RATE_IN_TI814X;
+   cpu_clkflg = CK_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index ab2f417..f07faa9 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -337,6 +337,26 @@ static void __init omap3_check_revision(const char 
**cpu_rev)
break;
}
break;
+   case 0xb8f2:
+   switch (rev) {
+   case 0:
+   /* FALLTHROUGH */
+   case 1:
+   omap_revision = TI8148_REV_ES1_0;
+   *cpu_rev = 1.0;
+   break;
+   case 2:
+   omap_revision = TI8148_REV_ES2_0;
+   *cpu_rev = 2.0;
+   break;
+   case 3:
+   /* FALLTHROUGH */
+   default:
+   omap_revision = TI8148_REV_ES2_1;
+   *cpu_rev = 2.1;
+   break;
+   }
+   break;
default:
/* Unknown default to latest silicon rev as default */
omap_revision = OMAP3630_REV_ES1_2;
@@ -429,6 +449,8 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
cpu_name = (omap3_has_sgx()) ? AM3517 : AM3505;
} else if (cpu_is_ti816x()) {
cpu_name = TI816X;
+   } else if (cpu_is_ti814x()) {
+   cpu_name = TI814X;
} else if (omap3_has_iva()  omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
cpu_name = OMAP3430/3530;
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h
index 8affc66..8fae534 100644
--- a/arch/arm/mach-omap2/opp2xxx.h
+++ b/arch/arm/mach-omap2/opp2xxx.h
@@ -51,7 +51,7 @@ struct prcm_config {
unsigned long cm_clksel2_pll;   /* dpllx1 or x2 out */
unsigned long cm_clksel_mdm;/* modem dividers 2430 only */
unsigned long base_sdrc_rfr;/* base refresh timing for a set */
-   unsigned char flags;
+   unsigned short flags;
 };
 
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 387a963..3c50ec8 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -40,6 +40,7 @@ struct omap_clk {
 #define CK_443X(1  11)
 #define CK_TI816X  (1  12)
 #define CK_446X(1  13)
+#define CK_TI814X  (1  14)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat

[PATCH v2 3/3] TI814X: Create board support and enable build for TI8148 EVM

2011-09-21 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI8148 EVM. Also
adds support for low level debugging on UART1 console on the EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig  |5 +++
 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/board-ti8148evm.c|   51 ++
 arch/arm/plat-omap/include/plat/uncompress.h |3 ++
 4 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8148evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index a3b9227..cc4f213 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -316,6 +316,11 @@ config MACH_TI8168EVM
depends on SOC_OMAPTI81XX
default y
 
+config MACH_TI8148EVM
+   bool TI8148 Evaluation Module
+   depends on SOC_OMAPTI81XX
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 46a3497..597a2b6 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -242,6 +242,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
 obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
+obj-$(CONFIG_MACH_TI8148EVM)   += board-ti8148evm.o
 
 # Platform specific device init code
 
diff --git a/arch/arm/mach-omap2/board-ti8148evm.c 
b/arch/arm/mach-omap2/board-ti8148evm.c
new file mode 100644
index 000..355c766
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8148evm.c
@@ -0,0 +1,51 @@
+/*
+ * Code for TI8148 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8148_evm_config[] __initdata = {
+};
+
+static void __init ti8148_evm_init(void)
+{
+   omap_serial_init();
+   omap_board_config = ti8148_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8148_evm_config);
+}
+
+static void __init ti8148_evm_map_io(void)
+{
+   omap2_set_globals_ti81xx();
+   omapti81xx_map_common_io();
+}
+
+MACHINE_START(TI8148EVM, ti8148evm)
+   /* Maintainer: Texas Instruments */
+   .atag_offset= 0x100,
+   .map_io = ti8148_evm_map_io,
+   .init_early = ti81xx_init_early,
+   .init_irq   = ti81xx_init_irq,
+   .timer  = omap3_timer,
+   .init_machine   = ti8148_evm_init,
+MACHINE_END
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index 40336ad..8d052e7 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -175,6 +175,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
/* TI8168 base boards using UART3 */
DEBUG_LL_TI81XX(3, ti8168evm);
 
+   /* TI8148 base boards using UART1 */
+   DEBUG_LL_TI81XX(1, ti8148evm);
+
} while (0);
 }
 
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH v2 0/6] TI81XX: Add clock and hwmod data

2011-08-23 Thread Hemant Pedanekar
This patch set is the v2 of TI816X clock and hwmods patches sent earlier.

The clock data is currently added only for TI816X, while minimal hwmod data
common for TI816X and TI814X is added.

This patch set depends on following patches:
TI81XX: Prepare for addition of TI814X support
TI814X: Add cpu type macros and detection support
TI814X: Create board support and enable build for TI8148 EVM

Please note that CHIP_IS_TI816X/CHIP_IS_TI814X are still being used and I will
send update once SoC list usage is available.   

Hemant Pedanekar (6):
  TI816X: prcm: Add module and register offsets
  TI816X: clock: Add clock data
  TI816X: clock: Add clockdomains and powerdomains data
  clock: Integrate TI816X clock data into OMAP clock framework
  TI81XX: Add minimal hwmod data
  hwmods: Integrate TI81XX hwmods

 arch/arm/mach-omap2/Makefile |5 +
 arch/arm/mach-omap2/clock3xxx_data.c |5 +-
 arch/arm/mach-omap2/clock816x.h  |   21 +
 arch/arm/mach-omap2/clock816x_data.c | 1108 ++
 arch/arm/mach-omap2/clockdomain.h|1 +
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c   |   18 +-
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |1 +
 arch/arm/mach-omap2/clockdomains816x_data.c  |  196 
 arch/arm/mach-omap2/cm-regbits-816x.h|   44 +
 arch/arm/mach-omap2/cm2xxx_3xxx.c|   35 +
 arch/arm/mach-omap2/cm2xxx_3xxx.h|6 +
 arch/arm/mach-omap2/cm816x.h |  368 +++
 arch/arm/mach-omap2/cm81xx.c |   54 ++
 arch/arm/mach-omap2/io.c |3 +
 arch/arm/mach-omap2/omap_hwmod.c |   13 +-
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c   |  677 +
 arch/arm/mach-omap2/powerdomain.h|2 +
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c   |   27 +-
 arch/arm/mach-omap2/powerdomains3xxx_data.c  |4 +-
 arch/arm/mach-omap2/powerdomains816x_data.c  |   84 ++
 arch/arm/mach-omap2/prm2xxx_3xxx.h   |   21 +
 arch/arm/plat-omap/include/plat/omap_hwmod.h |1 +
 22 files changed, 2682 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clock816x.h
 create mode 100644 arch/arm/mach-omap2/clock816x_data.c
 create mode 100644 arch/arm/mach-omap2/clockdomains816x_data.c
 create mode 100644 arch/arm/mach-omap2/cm-regbits-816x.h
 create mode 100644 arch/arm/mach-omap2/cm816x.h
 create mode 100644 arch/arm/mach-omap2/cm81xx.c
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_81xx_data.c
 create mode 100644 arch/arm/mach-omap2/powerdomains816x_data.c

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH v2 1/6] TI816X: prcm: Add module and register offsets

2011-08-23 Thread Hemant Pedanekar
This patch adds PRCM register offsets for TI816X device as required for the
clock data.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/cm816x.h   |  368 
 arch/arm/mach-omap2/prm2xxx_3xxx.h |   17 ++
 2 files changed, 385 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cm816x.h

diff --git a/arch/arm/mach-omap2/cm816x.h b/arch/arm/mach-omap2/cm816x.h
new file mode 100644
index 000..8f8b1cb
--- /dev/null
+++ b/arch/arm/mach-omap2/cm816x.h
@@ -0,0 +1,368 @@
+/*
+ * TI816X CM register access macros. Also contains CM module offsets.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CM816X_H
+#define __ARCH_ARM_MACH_OMAP2_CM816X_H
+
+#include prcm-common.h
+
+#define TI816X_CM_REGADDR(module, reg) \
+   OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE + (module) + (reg))
+
+/*
+ * TI816X CM module offsets
+ */
+
+#define TI816X_CM_DEVICE_MOD   0x0100  /* 256B */
+#define TI816X_CM_DPLL_MOD 0x0300  /* 256B */
+#define TI816X_CM_ACTIVE_MOD   0x0400  /* 256B */
+#define TI816X_CM_DEFAULT_MOD  0x0500  /* 256B */
+#define TI816X_CM_IVAHD0_MOD   0x0600  /* 256B */
+#define TI816X_CM_IVAHD1_MOD   0x0700  /* 256B */
+#define TI816X_CM_IVAHD2_MOD   0x0800  /* 256B */
+#define TI816X_CM_SGX_MOD  0x0900  /* 256B */
+#define TI816X_CM_ALWON_MOD0x1400  /* 1KB */
+
+/*
+ * Clock domain register offsets - these are generally CLKSTCTRL registers for
+ * respective modules.
+ */
+
+/* ALWON */
+#define TI816X_CM_ALWON_MPU_CLKDM  0x001C
+#define TI816X_CM_ALWON_L3_SLOW_CLKDM  0x
+#define TI816X_CM_ETHERNET_CLKDM   0x0004
+#define TI816X_CM_MMU_CLKDM0x000C
+#define TI816X_CM_MMUCFG_CLKDM 0x0010
+#define TI816X_CM_ALWON_L3_FAST_CLKDM  0x0030
+
+/* ACTIVE */
+#define TI816X_CM_ACTIVE_GEM_CLKDM 0x
+
+/* IVAHD0 */
+#define TI816X_CM_IVAHD0_CLKDM 0x
+
+/* IVAHD1 */
+#define TI816X_CM_IVAHD1_CLKDM 0x
+
+/* IVAHD2 */
+#define TI816X_CM_IVAHD2_CLKDM 0x
+
+/* SGX */
+#define TI816X_CM_SGX_CLKDM0x
+
+/* DEFAULT */
+#define TI816X_CM_DEFAULT_L3_MED_CLKDM 0x0004
+#define TI816X_CM_DEFAULT_DUCATI_CLKDM 0x0018
+#define TI816X_CM_DEFAULT_PCI_CLKDM0x0010
+#define TI816X_CM_DEFAULT_L3_SLOW_CLKDM0x0014
+
+/*
+ * CM registers. The offsets below are relative to respective CM module base.
+ */
+
+/* CM_DPLL */
+#define TI816X_CM_DPLL_SYSCLK1_CLKSEL_OFFSET   0x
+#define TI816X_CM_DPLL_SYSCLK1_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x)
+#define TI816X_CM_DPLL_SYSCLK2_CLKSEL_OFFSET   0x0004
+#define TI816X_CM_DPLL_SYSCLK2_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0004)
+#define TI816X_CM_DPLL_SYSCLK3_CLKSEL_OFFSET   0x0008
+#define TI816X_CM_DPLL_SYSCLK3_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0008)
+#define TI816X_CM_DPLL_SYSCLK4_CLKSEL_OFFSET   0x000C
+#define TI816X_CM_DPLL_SYSCLK4_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x000C)
+#define TI816X_CM_DPLL_SYSCLK5_CLKSEL_OFFSET   0x0010
+#define TI816X_CM_DPLL_SYSCLK5_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0010)
+#define TI816X_CM_DPLL_SYSCLK6_CLKSEL_OFFSET   0x0014
+#define TI816X_CM_DPLL_SYSCLK6_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0014)
+#define TI816X_CM_DPLL_SYSCLK7_CLKSEL_OFFSET   0x0018
+#define TI816X_CM_DPLL_SYSCLK7_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0018)
+#define TI816X_CM_DPLL_SYSCLK10_CLKSEL_OFFSET  0x0024
+#define TI816X_CM_DPLL_SYSCLK10_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0024)
+#define TI816X_CM_DPLL_SYSCLK11_CLKSEL_OFFSET  0x002C
+#define TI816X_CM_DPLL_SYSCLK11_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x002C)
+#define TI816X_CM_DPLL_SYSCLK12_CLKSEL_OFFSET  0x0030
+#define TI816X_CM_DPLL_SYSCLK12_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0030)
+#define TI816X_CM_DPLL_SYSCLK13_CLKSEL_OFFSET  0x0034
+#define TI816X_CM_DPLL_SYSCLK13_CLKSEL

[RFC PATCH v2 2/6] TI816X: clock: Add clock data

2011-08-23 Thread Hemant Pedanekar
This patch adds data for various clocks present in TI816X.

Note that this data is not automatically generated and not all clocks are
covered currently.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock816x.h   |   21 +
 arch/arm/mach-omap2/clock816x_data.c  | 1108 +
 arch/arm/mach-omap2/cm-regbits-816x.h |   44 ++
 3 files changed, 1173 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clock816x.h
 create mode 100644 arch/arm/mach-omap2/clock816x_data.c
 create mode 100644 arch/arm/mach-omap2/cm-regbits-816x.h

diff --git a/arch/arm/mach-omap2/clock816x.h b/arch/arm/mach-omap2/clock816x.h
new file mode 100644
index 000..89b958b
--- /dev/null
+++ b/arch/arm/mach-omap2/clock816x.h
@@ -0,0 +1,21 @@
+/*
+ * TI816X clock function prototypes and macros.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK816X_H
+#define __ARCH_ARM_MACH_OMAP2_CLOCK816X_H
+
+int ti816x_clk_init(void);
+
+#endif
diff --git a/arch/arm/mach-omap2/clock816x_data.c 
b/arch/arm/mach-omap2/clock816x_data.c
new file mode 100644
index 000..496c205
--- /dev/null
+++ b/arch/arm/mach-omap2/clock816x_data.c
@@ -0,0 +1,1108 @@
+/*
+ * Clock data for TI816X.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/kernel.h
+#include linux/list.h
+#include linux/clk.h
+
+#include plat/clkdev_omap.h
+
+#include control.h
+#include clock.h
+#include clock816x.h
+#include cm.h
+#include cm816x.h
+#include cm-regbits-816x.h
+#include prm.h
+
+static struct clk sys_32k_ck = {
+   .name   = sys_32k_ck,
+   .ops= clkops_null,
+   .rate   = 32768,
+};
+
+static struct clk tclkin_ck = {
+   .name   = tclkin_ck,
+   .ops= clkops_null,
+   .rate   = 32768,
+};
+
+static struct clk osc_sys_ck = {
+   .name   = osc_sys_ck,
+   .ops= clkops_null,
+   .rate   = 2700,
+};
+
+static struct clk main_pll_clk1_ck = {
+   .name   = main_pll_clk1_ck,
+   .ops= clkops_null,
+   .rate   = 8,
+};
+
+static const struct clksel_rate div8_1to8_rates[] = {
+   { .div = 1, .val = 0, .flags = RATE_IN_TI816X },
+   { .div = 2, .val = 1, .flags = RATE_IN_TI816X },
+   { .div = 3, .val = 2, .flags = RATE_IN_TI816X },
+   { .div = 4, .val = 3, .flags = RATE_IN_TI816X },
+   { .div = 5, .val = 4, .flags = RATE_IN_TI816X },
+   { .div = 6, .val = 5, .flags = RATE_IN_TI816X },
+   { .div = 7, .val = 6, .flags = RATE_IN_TI816X },
+   { .div = 8, .val = 7, .flags = RATE_IN_TI816X },
+   { .div = 0 },
+};
+
+static const struct clksel sysclk1_div[] = {
+   { .parent = main_pll_clk1_ck, .rates = div8_1to8_rates },
+   { .parent = NULL },
+};
+
+static struct clk sysclk1_ck = {
+   .name   = sysclk1_ck,
+   .parent = main_pll_clk1_ck,
+   .clksel = sysclk1_div,
+   .init   = omap2_init_clksel_parent,
+   .ops= clkops_null,
+   .clksel_reg = TI816X_CM_DPLL_SYSCLK1_CLKSEL,
+   .clksel_mask= TI816X_CLKSEL_0_2_MASK,
+   .recalc = omap2_clksel_recalc,
+};
+
+static struct clk dsp_ick = {
+   .name   = dsp_ick,
+   .parent = sysclk1_ck,
+   .ops= clkops_omap2_dflt,
+   .enable_reg = TI816X_CM_ACTIVE_GEM_CLKCTRL,
+   .enable_bit = TI816X_MODULEMODE_SWCTRL,
+   .clkdm_name = active_gem_clkdm,
+   .recalc = followparent_recalc,
+};
+
+static struct clk main_pll_clk2_ck = {
+   .name   = main_pll_clk2_ck,
+   .ops= clkops_null,
+   .rate   = 10,
+};
+
+static const struct clksel sysclk2_div[] = {
+   { .parent = main_pll_clk2_ck, .rates = div8_1to8_rates },
+   { .parent = NULL },
+};
+
+static struct clk sysclk2_ck = {
+   .name   = sysclk2_ck,
+   .parent

[RFC PATCH v2 3/6] TI816X: clock: Add clockdomains and powerdomains data

2011-08-23 Thread Hemant Pedanekar
This patch adds data for various clock domains and power domains in TI816X.

Note that at present this is not exhaustive and need to add missing domains.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clockdomains816x_data.c |  172 +++
 arch/arm/mach-omap2/powerdomains816x_data.c |   68 +++
 2 files changed, 240 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clockdomains816x_data.c
 create mode 100644 arch/arm/mach-omap2/powerdomains816x_data.c

diff --git a/arch/arm/mach-omap2/clockdomains816x_data.c 
b/arch/arm/mach-omap2/clockdomains816x_data.c
new file mode 100644
index 000..41ad561
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains816x_data.c
@@ -0,0 +1,172 @@
+/*
+ * TI816X Clock Domain data.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/kernel.h
+#include linux/io.h
+
+#include clockdomain.h
+#include cm.h
+#include cm816x.h
+#include cm-regbits-816x.h
+
+static struct clockdomain alwon_mpu_816x_clkdm = {
+   .name   = alwon_mpu_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_ALWON_MPU_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain alwon_l3_slow_816x_clkdm = {
+   .name   = alwon_l3_slow_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_ALWON_L3_SLOW_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain alwon_l3_fast_816x_clkdm = {
+   .name   = alwon_l3_fast_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_ALWON_L3_FAST_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain alwon_ethernet_816x_clkdm = {
+   .name   = alwon_ethernet_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_ETHERNET_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain mmu_816x_clkdm = {
+   .name   = mmu_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_MMU_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain mmu_cfg_816x_clkdm = {
+   .name   = mmu_cfg_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_MMUCFG_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain active_gem_816x_clkdm = {
+   .name   = active_gem_clkdm,
+   .pwrdm  = { .name = active_pwrdm },
+   .cm_inst= TI816X_CM_ACTIVE_MOD,
+   .clkdm_offs = TI816X_CM_ACTIVE_GEM_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain hdvicp0_816x_clkdm = {
+   .name   = hdvicp0_clkdm,
+   .pwrdm  = { .name = hdvicp0_pwrdm },
+   .cm_inst= TI816X_CM_IVAHD0_MOD,
+   .clkdm_offs = TI816X_CM_IVAHD0_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain hdvicp1_816x_clkdm = {
+   .name   = hdvicp1_clkdm,
+   .pwrdm  = { .name = hdvicp1_pwrdm },
+   .cm_inst= TI816X_CM_IVAHD1_MOD,
+   .clkdm_offs = TI816X_CM_IVAHD1_CLKDM

[RFC PATCH v2 4/6] clock: Integrate TI816X clock data into OMAP clock framework

2011-08-23 Thread Hemant Pedanekar
This patch hooks clock initialization and clockdomain/powerdomain setup into
OMAP clock framework.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Makefile |3 ++
 arch/arm/mach-omap2/clock3xxx_data.c |5 ++-
 arch/arm/mach-omap2/clockdomain.h|1 +
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c   |   18 ++-
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |1 +
 arch/arm/mach-omap2/clockdomains816x_data.c  |   24 +++
 arch/arm/mach-omap2/cm2xxx_3xxx.c|   35 ++
 arch/arm/mach-omap2/cm2xxx_3xxx.h|5 +++
 arch/arm/mach-omap2/io.c |2 +
 arch/arm/mach-omap2/powerdomain.h|2 +
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c   |   27 +++--
 arch/arm/mach-omap2/powerdomains3xxx_data.c  |4 ++-
 arch/arm/mach-omap2/powerdomains816x_data.c  |   16 ++
 arch/arm/mach-omap2/prm2xxx_3xxx.h   |4 ++
 14 files changed, 139 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 22f03e1..087412a 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -108,6 +108,7 @@ obj-$(CONFIG_ARCH_OMAP3)+= 
$(powerdomain-common) \
   powerdomain2xxx_3xxx.o \
   powerdomains3xxx_data.o \
   powerdomains2xxx_3xxx_data.o
+obj-$(CONFIG_SOC_OMAPTI81XX)   += powerdomains816x_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(powerdomain-common) \
   powerdomain44xx.o \
   powerdomains44xx_data.o
@@ -119,6 +120,7 @@ obj-$(CONFIG_ARCH_OMAP2)+= clockdomain.o \
 obj-$(CONFIG_ARCH_OMAP3)   += clockdomain.o \
   clockdomain2xxx_3xxx.o \
   clockdomains2xxx_3xxx_data.o
+obj-$(CONFIG_SOC_OMAPTI81XX)   += clockdomains816x_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += clockdomain.o \
   clockdomain44xx.o \
   clockdomains44xx_data.o
@@ -137,6 +139,7 @@ obj-$(CONFIG_ARCH_OMAP3)+= $(clock-common) 
clock3xxx.o \
   clock3517.o clock36xx.o \
   dpll3xxx.o clock3xxx_data.o \
   clkt_iclk.o
+obj-$(CONFIG_SOC_OMAPTI81XX)   += clock816x_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(clock-common) clock44xx_data.o \
   dpll3xxx.o dpll44xx.o
 
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index af58741..91ff956 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -27,6 +27,7 @@
 #include clock34xx.h
 #include clock36xx.h
 #include clock3517.h
+#include clock816x.h
 
 #include cm2xxx_3xxx.h
 #include cm-regbits-34xx.h
@@ -3480,8 +3481,8 @@ int __init omap3xxx_clk_init(void)
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
} else if (cpu_is_ti816x()) {
-   cpu_mask = RATE_IN_TI816X;
-   cpu_clkflg = CK_TI816X;
+   ti816x_clk_init();
+   return 0;
} else if (cpu_is_ti814x()) {
cpu_mask = RATE_IN_TI814X;
cpu_clkflg = CK_TI814X;
diff --git a/arch/arm/mach-omap2/clockdomain.h 
b/arch/arm/mach-omap2/clockdomain.h
index 1e50c88..7baafd8 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -197,6 +197,7 @@ int clkdm_hwmod_disable(struct clockdomain *clkdm, struct 
omap_hwmod *oh);
 
 extern void __init omap2xxx_clockdomains_init(void);
 extern void __init omap3xxx_clockdomains_init(void);
+extern void __init ti816x_clockdomains_init(void);
 extern void __init omap44xx_clockdomains_init(void);
 extern void _clkdm_add_autodeps(struct clockdomain *clkdm);
 extern void _clkdm_del_autodeps(struct clockdomain *clkdm);
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c 
b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
index f740edb..d23d559 100644
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -151,6 +151,9 @@ static void _enable_hwsup(struct clockdomain *clkdm)
if (cpu_is_omap24xx())
omap2xxx_cm_clkdm_enable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
   clkdm-clktrctrl_mask);
+   else if (cpu_is_ti816x())
+   ti816x_cm_clkdm_enable_hwsup(clkdm-cm_inst, clkdm-clkdm_offs,
+  clkdm-clktrctrl_mask);
else

[RFC PATCH v2 5/6] TI81XX: Add minimal hwmod data

2011-08-23 Thread Hemant Pedanekar
This patch adds minimum required hwmod data (e.g., UARTs) for bootup of TI81XX
devices (currently common data for TI816X and TI814X is added).

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c |  677 
 1 files changed, 677 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_81xx_data.c

diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
new file mode 100644
index 000..e73a4c6
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -0,0 +1,677 @@
+/*
+ * Hardware modules data for TI81XX SoCs
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#include plat/omap_hwmod.h
+#include mach/irqs.h
+#include plat/cpu.h
+#include plat/dma.h
+#include plat/serial.h
+#include plat/l4_3xxx.h
+#include plat/ti81xx.h
+
+#include omap_hwmod_common_data.h
+
+#include control.h
+#include cm816x.h
+#include cm-regbits-816x.h
+
+static struct omap_hwmod ti81xx_mpu_hwmod;
+static struct omap_hwmod ti81xx_l3_fast_hwmod;
+static struct omap_hwmod ti81xx_l3_med_hwmod;
+static struct omap_hwmod ti81xx_l4_fast_hwmod;
+static struct omap_hwmod ti81xx_l3_slow_hwmod;
+static struct omap_hwmod ti81xx_l4_slow_hwmod;
+
+/* MPU - L3 FAST */
+static struct omap_hwmod_ocp_if ti81xx_mpu__l3_fast = {
+   .master = ti81xx_mpu_hwmod,
+   .slave  = ti81xx_l3_fast_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
+/* MPU - L3 MEDIUM */
+static struct omap_hwmod_ocp_if ti81xx_mpu__l3_med = {
+   .master = ti81xx_mpu_hwmod,
+   .slave  = ti81xx_l3_med_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
+/* MPU - L3 SLOW interface */
+static struct omap_hwmod_ocp_if ti81xx_mpu__l3_slow = {
+   .master = ti81xx_mpu_hwmod,
+   .slave  = ti81xx_l3_slow_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
+/* L3 MED - L4 FAST */
+static struct omap_hwmod_ocp_if ti81xx_l3_med__l4_fast = {
+   .master = ti81xx_l3_med_hwmod,
+   .slave  = ti81xx_l4_fast_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
+/* L3 SLOW - L4_SLOW Peripheral interface */
+static struct omap_hwmod_ocp_if ti81xx_l3_slow__l4_slow = {
+   .master = ti81xx_l3_slow_hwmod,
+   .slave  = ti81xx_l4_slow_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
+/* Slave interfaces on the L3 FAST interconnect */
+static struct omap_hwmod_ocp_if *ti81xx_l3_fast_slaves[] = {
+   ti81xx_mpu__l3_fast,
+};
+
+/* Slave interfaces on the L3 MED interconnect */
+static struct omap_hwmod_ocp_if *ti81xx_l3_med_slaves[] = {
+   ti81xx_mpu__l3_med,
+};
+
+/* Slave interfaces on the L3 SLOW interconnect */
+static struct omap_hwmod_ocp_if *ti81xx_l3_slow_slaves[] = {
+   ti81xx_mpu__l3_slow,
+};
+
+/* L3 FAST */
+static struct omap_hwmod ti81xx_l3_fast_hwmod = {
+   .name   = l3_fast,
+   .class  = l3_hwmod_class,
+   .slaves = ti81xx_l3_fast_slaves,
+   .slaves_cnt = ARRAY_SIZE(ti81xx_l3_fast_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X | CHIP_IS_TI814X),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* L3 MED */
+static struct omap_hwmod ti81xx_l3_med_hwmod = {
+   .name   = l3_med,
+   .class  = l3_hwmod_class,
+   .slaves = ti81xx_l3_med_slaves,
+   .slaves_cnt = ARRAY_SIZE(ti81xx_l3_med_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X | CHIP_IS_TI814X),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* Slave interfaces on the L4 FAST interconnect */
+static struct omap_hwmod_ocp_if *ti81xx_l4_fast_slaves[] = {
+   ti81xx_l3_med__l4_fast,
+};
+
+/* L4 FAST */
+static struct omap_hwmod ti81xx_l4_fast_hwmod = {
+   .name   = l4_fast,
+   .class  = l4_hwmod_class,
+   .slaves = ti81xx_l4_fast_slaves,
+   .slaves_cnt = ARRAY_SIZE(ti81xx_l4_fast_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X | CHIP_IS_TI814X),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* L3 SLOW */
+static struct omap_hwmod ti81xx_l3_slow_hwmod = {
+   .name   = l3_slow,
+   .class  = l3_hwmod_class,
+   .slaves = ti81xx_l3_slow_slaves,
+   .slaves_cnt = ARRAY_SIZE(ti81xx_l3_slow_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X | CHIP_IS_TI814X),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+static struct omap_hwmod ti81xx_uart1_hwmod;
+static struct omap_hwmod ti81xx_uart2_hwmod;
+static struct omap_hwmod

[RFC PATCH v2 6/6] hwmods: Integrate TI81XX hwmods

2011-08-23 Thread Hemant Pedanekar
This patch integrates TI816X and TI814X hwmods into hwmods framework.

Note that a TI81XX specific function ti81xx_cm_wait_module_ready() is added to
wait for module to become ready since corresponding OMAP2/3 function
omap2_cm_wait_module_ready() cannot be used as there are no IDLEST registers in
TI81XX.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Makefile |2 +
 arch/arm/mach-omap2/cm2xxx_3xxx.h|1 +
 arch/arm/mach-omap2/cm81xx.c |   54 ++
 arch/arm/mach-omap2/io.c |1 +
 arch/arm/mach-omap2/omap_hwmod.c |   13 --
 arch/arm/plat-omap/include/plat/omap_hwmod.h |1 +
 6 files changed, 68 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cm81xx.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 087412a..7c340e0 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -80,6 +80,7 @@ endif
 obj-$(CONFIG_ARCH_OMAP2)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
   vc3xxx_data.o vp3xxx_data.o
+obj-$(CONFIG_SOC_OMAPTI81XX)   += cm81xx.o
 # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
 # will be removed once the OMAP4 part of the codebase is converted to
 # use OMAP4-specific PRCM functions.
@@ -161,6 +162,7 @@ obj-$(CONFIG_SOC_OMAP2430)  += 
omap_hwmod_2xxx_ipblock_data.o \
 obj-$(CONFIG_ARCH_OMAP3)   += omap_hwmod_2xxx_3xxx_ipblock_data.o \
   
omap_hwmod_2xxx_3xxx_interconnect_data.o \
   omap_hwmod_3xxx_data.o
+obj-$(CONFIG_SOC_OMAPTI81XX)   += omap_hwmod_81xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += omap_hwmod_44xx_data.o
 
 # EMU peripherals
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h 
b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index 11401c1..e11d4ee 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -122,6 +122,7 @@ extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 
mask);
 extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
 extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
 
+extern int ti81xx_cm_wait_module_ready(u16 inst, u16 clkctrl_reg);
 extern void ti816x_cm_clkdm_enable_hwsup(s16 inst, u16 clkdm, u32 mask);
 extern void ti816x_cm_clkdm_disable_hwsup(s16 inst, u16 clkdm, u32 mask);
 extern void ti816x_cm_clkdm_force_sleep(s16 inst, u16 clkdm, u32 mask);
diff --git a/arch/arm/mach-omap2/cm81xx.c b/arch/arm/mach-omap2/cm81xx.c
new file mode 100644
index 000..84d1645
--- /dev/null
+++ b/arch/arm/mach-omap2/cm81xx.c
@@ -0,0 +1,54 @@
+/*
+ * TI81XX CM module functions
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Based on arch/arm/mach-omap2/cm4xxx.c, original copyright follows:
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include linux/delay.h
+#include linux/errno.h
+#include linux/err.h
+#include linux/io.h
+
+#include plat/common.h
+
+#include cm.h
+#include cm-regbits-816x.h
+#include cm816x.h
+
+/**
+ * ti81xx_cm_wait_module_ready - wait for a module to be in 'func' state
+ * @inst: Offset of CM instance associated with
+ * @clkctrl_reg: CLKCTRL offset from CM instance base
+ *
+ * Wait for the module IDLEST to be functional. If the idle state is in any
+ * the non functional state (trans, idle or disabled), module and thus the
+ * sysconfig cannot be accessed and will probably lead to an imprecise
+ * external abort
+ *
+ * Module idle state:
+ *   0x0 func: Module is fully functional, including OCP
+ *   0x1 trans:Module is performing transition: wakeup, or sleep, or sleep
+ * abortion
+ *   0x2 idle: Module is in Idle mode (only OCP part). It is functional if
+ * using separate functional clock
+ *   0x3 disabled: Module is disabled and cannot be accessed
+ *
+ */
+int ti81xx_cm_wait_module_ready(u16 inst, u16 clkctrl_reg)
+{
+   int i = 0;
+
+   omap_test_timeout((
+   ((__raw_readl(TI816X_CM_REGADDR(inst, clkctrl_reg)) 
+ TI816X_IDLEST_MASK) == 0)), MAX_MODULE_READY_TIME, i);
+
+   return (i  MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
+}
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 969b730..525ec63 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -354,6 +354,7 @@ void __init omap2_init_common_infrastructure(void)
omap3xxx_clockdomains_init();
ti816x_clockdomains_init();
omap3xxx_hwmod_init

[PATCH v2] omap: timer: Set dmtimer used as clocksource in autoreload mode

2011-08-10 Thread Hemant Pedanekar
If CONFIG_OMAP_32K_TIMER is not selected and dmtimer is used as clocksource, the
timer stops counting once overflow occurs as it was not set in autoreload mode.
This results into timekeeping failure: for example, 'sleep 1' at the shell after
the timer counter overflow would hang.

This patch sets up autoreload when starting the clocksource timer which fixes
the above issue.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/timer.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index e964072..cf1de7d 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -293,7 +293,8 @@ static void __init omap2_gp_clocksource_init(int gptimer_id,
pr_info(OMAP clocksource: GPTIMER%d at %lu Hz\n,
gptimer_id, clksrc.rate);
 
-   __omap_dm_timer_load_start(clksrc.io_base, OMAP_TIMER_CTRL_ST, 0, 1);
+   __omap_dm_timer_load_start(clksrc.io_base,
+   OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1);
init_sched_clock(cd, dmtimer_update_sched_clock, 32, clksrc.rate);
 
if (clocksource_register_hz(clocksource_gpt, clksrc.rate))
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] omap: timer: Set dmtimer used as clocksource in autoreload mode

2011-08-09 Thread Hemant Pedanekar
If CONFIG_OMAP_32K_TIMER is not selected and dmtimer is used as clocksource, the
timer stops counting once overflow occurs as it was not set in autoreload mode.
This results into timekeeping failure: for example, 'sleep 1' at the shell after
the timer counter overflow would hang.

This patch sets up autoreload when starting the clocksource timer which fixes
the above issue.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/timer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index e964072..796b935 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -293,7 +293,7 @@ static void __init omap2_gp_clocksource_init(int gptimer_id,
pr_info(OMAP clocksource: GPTIMER%d at %lu Hz\n,
gptimer_id, clksrc.rate);
 
-   __omap_dm_timer_load_start(clksrc.io_base, OMAP_TIMER_CTRL_ST, 0, 1);
+   omap_dm_timer_set_load_start(clksrc, 1, 0);
init_sched_clock(cd, dmtimer_update_sched_clock, 32, clksrc.rate);
 
if (clocksource_register_hz(clocksource_gpt, clksrc.rate))
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] Add support for TI814X processor series

2011-08-04 Thread Hemant Pedanekar
This patch set adds support for DM814x, C6A814x and AM387x device series having
Cortex-A8 MPU.

The technical documents are available from following link:

http://focus.ti.com/docs/prod/folders/print/tms320dm8148.html

This series is referred in code as TI814X.

Since these devices share similar architecture as TI816X devices, existing
TI816X code is updated to accomodate TI814X support. The code shared across
TI816X and TI814X devices is updated with TI81XX/ti81xx prefix as applicable,
while maintaining cpu_is_ti816x() and cpu_is_ti814x() to distinguish specific
execution differences.

Hemant Pedanekar (3):
  TI81XX: Prepare for addition of TI814X support
  TI814X: Add cpu type macros and detection support
  TI814X: Create board support and enable build for TI8148 EVM

 arch/arm/mach-omap2/Kconfig|   11 +++-
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8148evm.c  |   57 
 arch/arm/mach-omap2/board-ti8168evm.c  |6 +-
 arch/arm/mach-omap2/clock.c|2 +-
 arch/arm/mach-omap2/clock.h|2 +-
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   22 
 arch/arm/mach-omap2/control.h  |8 ++--
 arch/arm/mach-omap2/id.c   |   26 --
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 ++--
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   10 ++--
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/opp2xxx.h  |2 +-
 arch/arm/mach-omap2/serial.c   |6 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|3 +-
 arch/arm/plat-omap/include/plat/common.h   |2 +-
 arch/arm/plat-omap/include/plat/cpu.h  |   25 -
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 +-
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 +++---
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 +++---
 arch/arm/plat-omap/include/plat/uncompress.h   |   11 +++--
 arch/arm/plat-omap/io.c|2 +-
 27 files changed, 187 insertions(+), 75 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8148evm.c
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] TI81XX: Prepare for addition of TI814X support

2011-08-04 Thread Hemant Pedanekar
This patch updates existing macros, functions used for TI816X, to enable
addition of other SoCs belonging to TI81XX family (e.g., TI814X).

The approach taken is to use TI81XX/ti81xx for code/data going to be common
across all TI81XX devices.

cpu_is_ti81xx() is introduced to handle code common across TI81XX devices.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig|6 ++--
 arch/arm/mach-omap2/board-ti8168evm.c  |6 ++--
 arch/arm/mach-omap2/clock3xxx_data.c   |2 +-
 arch/arm/mach-omap2/common.c   |   22 ++--
 arch/arm/mach-omap2/control.h  |8 +++---
 arch/arm/mach-omap2/id.c   |8 +++---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +-
 arch/arm/mach-omap2/include/mach/entry-macro.S |4 +-
 arch/arm/mach-omap2/io.c   |   10 
 arch/arm/mach-omap2/irq.c  |2 +-
 arch/arm/mach-omap2/serial.c   |6 ++--
 arch/arm/plat-omap/include/plat/common.h   |2 +-
 arch/arm/plat-omap/include/plat/cpu.h  |   13 +++
 arch/arm/plat-omap/include/plat/hardware.h |2 +-
 arch/arm/plat-omap/include/plat/io.h   |6 ++--
 arch/arm/plat-omap/include/plat/irqs.h |2 +-
 arch/arm/plat-omap/include/plat/serial.h   |   14 ++--
 .../plat-omap/include/plat/{ti816x.h = ti81xx.h}  |   18 
 arch/arm/plat-omap/include/plat/uncompress.h   |8 +++---
 arch/arm/plat-omap/io.c|2 +-
 20 files changed, 83 insertions(+), 70 deletions(-)
 rename arch/arm/plat-omap/include/plat/{ti816x.h = ti81xx.h} (60%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index d5e4b60..242d9ab 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -74,8 +74,8 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
-config SOC_OMAPTI816X
-   bool TI816X support
+config SOC_OMAPTI81XX
+   bool TI81XX support
depends on ARCH_OMAP3
default y
 
@@ -314,7 +314,7 @@ config MACH_OMAP_3630SDP
 
 config MACH_TI8168EVM
bool TI8168 Evaluation Module
-   depends on SOC_OMAPTI816X
+   depends on SOC_OMAPTI81XX
default y
 
 config MACH_OMAP_4430SDP
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
index a85d5b0..e516a04 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -42,8 +42,8 @@ static void __init ti8168_evm_init(void)
 
 static void __init ti8168_evm_map_io(void)
 {
-   omap2_set_globals_ti816x();
-   omapti816x_map_common_io();
+   omap2_set_globals_ti81xx();
+   omapti81xx_map_common_io();
 }
 
 MACHINE_START(TI8168EVM, ti8168evm)
@@ -51,7 +51,7 @@ MACHINE_START(TI8168EVM, ti8168evm)
.boot_params= 0x8100,
.map_io = ti8168_evm_map_io,
.init_early = ti8168_init_early,
-   .init_irq   = ti816x_init_irq,
+   .init_irq   = ti81xx_init_irq,
.timer  = omap3_timer,
.init_machine   = ti8168_evm_init,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index ffd55b1..10cf22f 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3565,7 +3565,7 @@ int __init omap3xxx_clk_init(void)
 * Lock DPLL5 -- here only until other device init code can
 * handle this
 */
-   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
+   if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 3f20cbb..7ce80f2 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -101,23 +101,23 @@ void __init omap3_map_io(void)
 
 /*
  * Adjust TAP register base such that omap3_check_revision accesses the correct
- * TI816X register for checking device ID (it adds 0x204 to tap base while
- * TI816X DEVICE ID register is at offset 0x600 from control base).
+ * TI81XX register for checking device ID (it adds 0x204 to tap base while
+ * TI81XX DEVICE ID register is at offset 0x600 from control base).
  */
-#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
-   TI816X_CONTROL_DEVICE_ID - 0x204)
+#define TI81XX_TAP_BASE(TI81XX_CTRL_BASE + \
+   TI81XX_CONTROL_DEVICE_ID - 0x204)
 
-static struct omap_globals ti816x_globals = {
+static struct omap_globals ti81xx_globals = {
.class  = OMAP343X_CLASS,
-   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
-   .ctrl

[PATCH 2/3] TI814X: Add cpu type macros and detection support

2011-08-04 Thread Hemant Pedanekar
This patch adds cpu type, macros for identification of TI814X device.

Note that following updates to common OMAP data structures are made:
1) struct omap_chip_id member 'oc' is updated to u32 from u16 as omap chip
bitfield has exhausted 16 bits for CHIP_IS_XXX.
2) cpu_mask and RATE_IN_XXX flags have crossed 8 bit hence struct
clksel_rate.flags, struct prcm_config.flags and cpu_mask are changed to u16 from
u8.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock.c   |2 +-
 arch/arm/mach-omap2/clock.h   |2 +-
 arch/arm/mach-omap2/clock3xxx_data.c  |3 +++
 arch/arm/mach-omap2/id.c  |   18 ++
 arch/arm/mach-omap2/opp2xxx.h |2 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |3 ++-
 arch/arm/plat-omap/include/plat/cpu.h |   12 +++-
 8 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 1f3481f..f57ed5b 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -35,7 +35,7 @@
 #include cm-regbits-24xx.h
 #include cm-regbits-34xx.h
 
-u8 cpu_mask;
+u16 cpu_mask;
 
 /*
  * clkdm_control: if true, then when a clock is enabled in the
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 48ac568..687d3d3 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -130,7 +130,7 @@ void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
   const char *core_ck_name,
   const char *mpu_ck_name);
 
-extern u8 cpu_mask;
+extern u16 cpu_mask;
 
 extern const struct clkops clkops_omap2_dflt_wait;
 extern const struct clkops clkops_dummy;
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 10cf22f..af58741 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3482,6 +3482,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_ti816x()) {
cpu_mask = RATE_IN_TI816X;
cpu_clkflg = CK_TI816X;
+   } else if (cpu_is_ti814x()) {
+   cpu_mask = RATE_IN_TI814X;
+   cpu_clkflg = CK_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 3d84fca..98f1922 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -346,6 +346,22 @@ static void __init omap3_check_revision(void)
omap_revision =  TI8168_REV_ES1_1;
}
break;
+   case 0xb8f2:
+   omap_chip.oc = CHIP_IS_TI814X;
+
+   switch (rev) {
+   case 0:
+   /* FALLTHROUGH */
+   case 1:
+   omap_revision = TI8148_REV_ES1_0;
+   break;
+   case 2:
+   omap_revision = TI8148_REV_ES2_0;
+   break;
+   default:
+   omap_revision = TI8148_REV_ES2_1;
+   }
+   break;
default:
/* Unknown default to latest silicon rev as default*/
omap_revision =  OMAP3630_REV_ES1_2;
@@ -451,6 +467,8 @@ static void __init omap3_cpuinfo(void)
}
} else if (cpu_is_ti816x()) {
strcpy(cpu_name, TI816X);
+   } else if (cpu_is_ti814x()) {
+   strcpy(cpu_name, TI814X);
} else if (omap3_has_iva()  omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
strcpy(cpu_name, OMAP3430/3530);
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h
index 8affc66..8fae534 100644
--- a/arch/arm/mach-omap2/opp2xxx.h
+++ b/arch/arm/mach-omap2/opp2xxx.h
@@ -51,7 +51,7 @@ struct prcm_config {
unsigned long cm_clksel2_pll;   /* dpllx1 or x2 out */
unsigned long cm_clksel_mdm;/* modem dividers 2430 only */
unsigned long base_sdrc_rfr;/* base refresh timing for a set */
-   unsigned char flags;
+   unsigned short flags;
 };
 
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 387a963..3c50ec8 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -40,6 +40,7 @@ struct omap_clk {
 #define CK_443X(1  11)
 #define CK_TI816X  (1  12)
 #define CK_446X(1  13)
+#define CK_TI814X  (1  14)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index df4b968..1c41292 100644

[PATCH 3/3] TI814X: Create board support and enable build for TI8148 EVM

2011-08-04 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI8148 EVM. Also
adds support for low level debugging on UART1 console on the EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig  |5 ++
 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/board-ti8148evm.c|   57 ++
 arch/arm/plat-omap/include/plat/uncompress.h |3 +
 4 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8148evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 242d9ab..4dacb8e 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -317,6 +317,11 @@ config MACH_TI8168EVM
depends on SOC_OMAPTI81XX
default y
 
+config MACH_TI8148EVM
+   bool TI8148 Evaluation Module
+   depends on SOC_OMAPTI81XX
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fb02937..fa54361 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -262,6 +262,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
 obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
+obj-$(CONFIG_MACH_TI8148EVM)   += board-ti8148evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8148evm.c 
b/arch/arm/mach-omap2/board-ti8148evm.c
new file mode 100644
index 000..588d6b7
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8148evm.c
@@ -0,0 +1,57 @@
+/*
+ * Code for TI8148 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8148_evm_config[] __initdata = {
+};
+
+static void __init ti8148_init_early(void)
+{
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+}
+
+static void __init ti8148_evm_init(void)
+{
+   omap_serial_init();
+   omap_board_config = ti8148_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8148_evm_config);
+}
+
+static void __init ti8148_evm_map_io(void)
+{
+   omap2_set_globals_ti81xx();
+   omapti81xx_map_common_io();
+}
+
+MACHINE_START(TI8148EVM, ti8148evm)
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8148_evm_map_io,
+   .init_early = ti8148_init_early,
+   .init_irq   = ti81xx_init_irq,
+   .timer  = omap3_timer,
+   .init_machine   = ti8148_evm_init,
+MACHINE_END
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index 40336ad..8d052e7 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -175,6 +175,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
/* TI8168 base boards using UART3 */
DEBUG_LL_TI81XX(3, ti8168evm);
 
+   /* TI8148 base boards using UART1 */
+   DEBUG_LL_TI81XX(1, ti8148evm);
+
} while (0);
 }
 
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] hwmods: Integrate TI816X hwmods

2011-04-27 Thread Hemant Pedanekar
This patch integrates TI816X hwmods into hwmods framework.

Note that a TI816X specific function ti816x_cm_wait_module_ready() is added to
wait for module to become ready since corresponding OMAP2/3 function
omap2_cm_wait_module_ready() cannot be used as there are no IDLEST registers in
TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
This patch depends on following patch set:
TI816X: prcm: Add module and register offsets
TI816X: clock: Add clock data
TI816X: clock: Add clockdomains and powerdomains data
clock: Integrate TI816X clock data into OMAP clock framework

 arch/arm/mach-omap2/Makefile |2 +
 arch/arm/mach-omap2/cm2xxx_3xxx.h|1 +
 arch/arm/mach-omap2/cm816x.c |   55 ++
 arch/arm/mach-omap2/io.c |1 +
 arch/arm/mach-omap2/omap_hwmod.c |   11 -
 arch/arm/plat-omap/include/plat/omap_hwmod.h |1 +
 6 files changed, 68 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cm816x.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index ace5e4e..640294e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -80,6 +80,7 @@ endif
 obj-$(CONFIG_ARCH_OMAP2)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
   vc3xxx_data.o vp3xxx_data.o
+obj-$(CONFIG_SOC_OMAPTI816X)   += cm816x.o
 # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
 # will be removed once the OMAP4 part of the codebase is converted to
 # use OMAP4-specific PRCM functions.
@@ -149,6 +150,7 @@ obj-$(CONFIG_SOC_OMAP2430)  += opp2430_data.o
 obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2420_data.o
 obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o
 obj-$(CONFIG_ARCH_OMAP3)   += omap_hwmod_3xxx_data.o
+obj-$(CONFIG_SOC_OMAPTI816X)   += omap_hwmod_816x_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += omap_hwmod_44xx_data.o
 
 # EMU peripherals
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h 
b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index 11401c1..47f824a 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -122,6 +122,7 @@ extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 
mask);
 extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
 extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
 
+extern int ti816x_cm_wait_module_ready(void __iomem *clkctrl_reg);
 extern void ti816x_cm_clkdm_enable_hwsup(s16 inst, u16 clkdm, u32 mask);
 extern void ti816x_cm_clkdm_disable_hwsup(s16 inst, u16 clkdm, u32 mask);
 extern void ti816x_cm_clkdm_force_sleep(s16 inst, u16 clkdm, u32 mask);
diff --git a/arch/arm/mach-omap2/cm816x.c b/arch/arm/mach-omap2/cm816x.c
new file mode 100644
index 000..ec5b478
--- /dev/null
+++ b/arch/arm/mach-omap2/cm816x.c
@@ -0,0 +1,55 @@
+/*
+ * TI816X CM module functions
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Based on arch/arm/mach-omap2/cm4xxx.c, original copyright follows:
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include linux/delay.h
+#include linux/errno.h
+#include linux/err.h
+#include linux/io.h
+
+#include plat/common.h
+
+#include cm.h
+#include cm-regbits-816x.h
+
+/**
+ * ti816x_cm_wait_module_ready - wait for a module to be in 'func' state
+ * @clkctrl_reg: CLKCTRL module address
+ *
+ * Wait for the module IDLEST to be functional. If the idle state is in any
+ * the non functional state (trans, idle or disabled), module and thus the
+ * sysconfig cannot be accessed and will probably lead to an imprecise
+ * external abort
+ *
+ * Module idle state:
+ *   0x0 func: Module is fully functional, including OCP
+ *   0x1 trans:Module is performing transition: wakeup, or sleep, or sleep
+ * abortion
+ *   0x2 idle: Module is in Idle mode (only OCP part). It is functional if
+ * using separate functional clock
+ *   0x3 disabled: Module is disabled and cannot be accessed
+ *
+ */
+int ti816x_cm_wait_module_ready(void __iomem *clkctrl_reg)
+{
+   int i = 0;
+
+   if (!clkctrl_reg)
+   return 0;
+
+   omap_test_timeout((
+   ((__raw_readl(clkctrl_reg)  TI816X_IDLEST_MASK) == 0)),
+   MAX_MODULE_READY_TIME, i);
+
+   return (i  MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
+}
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 441e79d..e4e8500 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -366,6 +366,7 @@ void __init omap2_init_common_infrastructure(void

[PATCH 1/2] TI816X: Add minimal hwmod data

2011-04-27 Thread Hemant Pedanekar
This patch adds minimum required hwmod data (e.g., UARTs) for bootup of TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
This patch depends on following patch set:
[PATCH 1/4] TI816X: prcm: Add module and register offsets
[PATCH 2/4] TI816X: clock: Add clock data
[PATCH 3/4] TI816X: clock: Add clockdomains and powerdomains data
[PATCH 4/4] clock: Integrate TI816X clock data into OMAP clock framework

 arch/arm/mach-omap2/omap_hwmod_816x_data.c |  636 
 1 files changed, 636 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_816x_data.c

diff --git a/arch/arm/mach-omap2/omap_hwmod_816x_data.c 
b/arch/arm/mach-omap2/omap_hwmod_816x_data.c
new file mode 100644
index 000..edfa7f4
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_816x_data.c
@@ -0,0 +1,636 @@
+/*
+ * omap_hwmod_ti816x_data.c - hardware modules data for TI816X chips
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#include plat/omap_hwmod.h
+#include mach/irqs.h
+#include plat/cpu.h
+#include plat/dma.h
+#include plat/serial.h
+#include plat/l4_3xxx.h
+#include plat/ti816x.h
+
+#include omap_hwmod_common_data.h
+
+#include control.h
+#include cm816x.h
+#include cm-regbits-816x.h
+
+/*
+ * TI816X hardware modules integration data
+ */
+
+static struct omap_hwmod ti816xx_mpu_hwmod;
+static struct omap_hwmod ti816x_l3_slow_hwmod;
+static struct omap_hwmod ti816x_l4_slow_hwmod;
+
+/* L3 SLOW - L4_SLOW Peripheral interface */
+static struct omap_hwmod_ocp_if ti816x_l3_slow__l4_slow = {
+   .master = ti816x_l3_slow_hwmod,
+   .slave  = ti816x_l4_slow_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
+/* MPU - L3 SLOW interface */
+static struct omap_hwmod_ocp_if ti816x_mpu__l3_slow = {
+   .master = ti816xx_mpu_hwmod,
+   .slave  = ti816x_l3_slow_hwmod,
+   .user   = OCP_USER_MPU,
+};
+
+/* Slave interfaces on the L3 SLOW interconnect */
+static struct omap_hwmod_ocp_if *ti816x_l3_slow_slaves[] = {
+   ti816x_mpu__l3_slow,
+};
+
+/* Master interfaces on the L3 SLOW interconnect */
+static struct omap_hwmod_ocp_if *ti816x_l3_slow_masters[] = {
+   ti816x_l3_slow__l4_slow,
+};
+
+/* L3 SLOW */
+static struct omap_hwmod ti816x_l3_slow_hwmod = {
+   .name   = l3_slow,
+   .class  = l3_hwmod_class,
+   .masters= ti816x_l3_slow_masters,
+   .masters_cnt= ARRAY_SIZE(ti816x_l3_slow_masters),
+   .slaves = ti816x_l3_slow_slaves,
+   .slaves_cnt = ARRAY_SIZE(ti816x_l3_slow_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+static struct omap_hwmod ti816x_uart1_hwmod;
+static struct omap_hwmod ti816x_uart2_hwmod;
+static struct omap_hwmod ti816x_uart3_hwmod;
+
+/* L4 SLOW - UART1 interface */
+static struct omap_hwmod_addr_space ti816x_uart1_addr_space[] = {
+   {
+   .pa_start   = TI816X_UART1_BASE,
+   .pa_end = TI816X_UART1_BASE + SZ_8K - 1,
+   .flags  = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
+   },
+};
+
+static struct omap_hwmod_ocp_if ti816x_l4_slow__uart1 = {
+   .master = ti816x_l4_slow_hwmod,
+   .slave  = ti816x_uart1_hwmod,
+   .clk= uart1_ick,
+   .addr   = ti816x_uart1_addr_space,
+   .addr_cnt   = ARRAY_SIZE(ti816x_uart1_addr_space),
+   .user   = OCP_USER_MPU,
+};
+
+/* L4 SLOW - UART2 interface */
+static struct omap_hwmod_addr_space ti816x_uart2_addr_space[] = {
+   {
+   .pa_start   = TI816X_UART2_BASE,
+   .pa_end = TI816X_UART2_BASE + SZ_8K - 1,
+   .flags  = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
+   },
+};
+
+static struct omap_hwmod_ocp_if ti816x_l4_slow__uart2 = {
+   .master = ti816x_l4_slow_hwmod,
+   .slave  = ti816x_uart2_hwmod,
+   .clk= uart2_ick,
+   .addr   = ti816x_uart2_addr_space,
+   .addr_cnt   = ARRAY_SIZE(ti816x_uart2_addr_space),
+   .user   = OCP_USER_MPU,
+};
+
+/* L4 SLOW - UART3 interface */
+static struct omap_hwmod_addr_space ti816x_uart3_addr_space[] = {
+   {
+   .pa_start   = TI816X_UART3_BASE,
+   .pa_end = TI816X_UART3_BASE + SZ_8K - 1,
+   .flags  = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
+   },
+};
+
+static struct omap_hwmod_ocp_if ti816x_l4_slow__uart3 = {
+   .master

[PATCH] pci: Add quirk for setting valid class for TI816X Endpoint

2011-04-05 Thread Hemant Pedanekar
TI816X (common name for DM816x/C6A816x/AM389x family) devices configured to boot
as PCIe Endpoint have class code = 0. This makes kernel PCI bus code to skip
allocating BARs to these devices resulting into following type of error when
trying to enable them:

Device :01:00.0 not available because of resource collisions

The device cannot be operated because of the above issue.

This patch adds a ID specific (TI VENDOR ID and 816X DEVICE ID based) 'early'
fixup quirk to replace class code with PCI_CLASS_MULTIMEDIA_VIDEO as class.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 drivers/pci/quirks.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index bd80f63..a1e4f61 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2784,6 +2784,16 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x342e, 
vtd_mask_spec_errors);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x3c28, vtd_mask_spec_errors);
 #endif
 
+static void __devinit fixup_ti816x_class(struct pci_dev* dev)
+{
+   /* TI 816x devices do not have class code set when in PCIe boot mode */
+   if (dev-class == PCI_CLASS_NOT_DEFINED) {
+   dev_info(dev-dev, Setting PCI class for 816x PCIe device\n);
+   dev-class = PCI_CLASS_MULTIMEDIA_VIDEO;
+   }
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_TI, 0xb800, fixup_ti816x_class);
+
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
  struct pci_fixup *end)
 {
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] TI816X: prcm: Add module and register offsets

2011-03-25 Thread Hemant Pedanekar
This patch adds PRCM register offsets for TI816X device as required for the
clock data.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/cm816x.h   |  228 
 arch/arm/mach-omap2/prm2xxx_3xxx.h |   17 +++
 2 files changed, 245 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cm816x.h

diff --git a/arch/arm/mach-omap2/cm816x.h b/arch/arm/mach-omap2/cm816x.h
new file mode 100644
index 000..b1dbd3d
--- /dev/null
+++ b/arch/arm/mach-omap2/cm816x.h
@@ -0,0 +1,228 @@
+/*
+ * TI816X CM register access macros. Also contains CM module offsets.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CM816X_H
+#define __ARCH_ARM_MACH_OMAP2_CM816X_H
+
+#include prcm-common.h
+
+#define TI816X_CM_REGADDR(module, reg) \
+   OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE + (module) + (reg))
+
+/*
+ * TI816X CM module offsets
+ */
+
+#define TI816X_CM_DEVICE_MOD   0x0100  /* 256B */
+#define TI816X_CM_DPLL_MOD 0x0300  /* 256B */
+#define TI816X_CM_ACTIVE_MOD   0x0400  /* 256B */
+#define TI816X_CM_DEFAULT_MOD  0x0500  /* 256B */
+#define TI816X_CM_IVAHD0_MOD   0x0600  /* 256B */
+#define TI816X_CM_IVAHD1_MOD   0x0700  /* 256B */
+#define TI816X_CM_IVAHD2_MOD   0x0800  /* 256B */
+#define TI816X_CM_SGX_MOD  0x0900  /* 256B */
+#define TI816X_CM_ALWON_MOD0x1400  /* 1KB */
+
+/*
+ * Clock domain register offsets - these are generally CLKSTCTRL registers for
+ * respective modules.
+ */
+
+/* ALWON */
+#define TI816X_CM_ALWON_MPU_CLKDM  0x001C
+#define TI816X_CM_ALWON_L3_SLOW_CLKDM  0x
+#define TI816X_CM_ETHERNET_CLKDM   0x0004
+#define TI816X_CM_MMU_CLKDM0x000C
+#define TI816X_CM_MMUCFG_CLKDM 0x0010
+
+/* ACTIVE */
+#define TI816X_CM_ACTIVE_GEM_CLKDM 0x
+
+/* IVAHD0 */
+#define TI816X_CM_IVAHD0_CLKDM 0x
+
+/* IVAHD1 */
+#define TI816X_CM_IVAHD1_CLKDM 0x
+
+/* IVAHD2 */
+#define TI816X_CM_IVAHD2_CLKDM 0x
+
+/* SGX */
+#define TI816X_CM_SGX_CLKDM0x
+
+/* DEFAULT */
+#define TI816X_CM_DEFAULT_L3_MED_CLKDM 0x0004
+#define TI816X_CM_DEFAULT_DUCATI_CLKDM 0x0018
+#define TI816X_CM_DEFAULT_PCI_CLKDM0x0010
+#define TI816X_CM_DEFAULT_L3_SLOW_CLKDM0x0014
+
+/*
+ * CM register addresses
+ */
+
+/* CM_DPLL */
+#define TI816X_CM_DPLL_SYSCLK1_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x)
+#define TI816X_CM_DPLL_SYSCLK2_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0004)
+#define TI816X_CM_DPLL_SYSCLK3_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0008)
+#define TI816X_CM_DPLL_SYSCLK4_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x000C)
+#define TI816X_CM_DPLL_SYSCLK5_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0010)
+#define TI816X_CM_DPLL_SYSCLK6_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0014)
+#define TI816X_CM_DPLL_SYSCLK7_CLKSEL  
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0018)
+#define TI816X_CM_DPLL_SYSCLK10_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0024)
+#define TI816X_CM_DPLL_SYSCLK11_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x002C)
+#define TI816X_CM_DPLL_SYSCLK12_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0030)
+#define TI816X_CM_DPLL_SYSCLK13_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0034)
+#define TI816X_CM_DPLL_SYSCLK15_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0038)
+#define TI816X_CM_DPLL_VPB3_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0040)
+#define TI816X_CM_DPLL_VPC1_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0044)
+#define TI816X_CM_DPLL_VPD1_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0048)
+#define TI816X_CM_DPLL_SYSCLK19_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x004C)
+#define TI816X_CM_DPLL_SYSCLK20_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0050)
+#define TI816X_CM_DPLL_SYSCLK21_CLKSEL 
TI816X_CM_REGADDR(TI816X_CM_DPLL_MOD, 0x0054)
+#define

[PATCH 2/4] TI816X: clock: Add clock data

2011-03-25 Thread Hemant Pedanekar
This patch adds data for various clocks present in TI816X.

Note that this data is not automatically generated and not all clocks are
covered currently.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock816x.h   |   21 +
 arch/arm/mach-omap2/clock816x_data.c  | 1131 +
 arch/arm/mach-omap2/cm-regbits-816x.h |   44 ++
 3 files changed, 1196 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clock816x.h
 create mode 100644 arch/arm/mach-omap2/clock816x_data.c
 create mode 100644 arch/arm/mach-omap2/cm-regbits-816x.h

diff --git a/arch/arm/mach-omap2/clock816x.h b/arch/arm/mach-omap2/clock816x.h
new file mode 100644
index 000..89b958b
--- /dev/null
+++ b/arch/arm/mach-omap2/clock816x.h
@@ -0,0 +1,21 @@
+/*
+ * TI816X clock function prototypes and macros.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK816X_H
+#define __ARCH_ARM_MACH_OMAP2_CLOCK816X_H
+
+int ti816x_clk_init(void);
+
+#endif
diff --git a/arch/arm/mach-omap2/clock816x_data.c 
b/arch/arm/mach-omap2/clock816x_data.c
new file mode 100644
index 000..083b0a1
--- /dev/null
+++ b/arch/arm/mach-omap2/clock816x_data.c
@@ -0,0 +1,1131 @@
+/*
+ * Clock data for TI816X.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/kernel.h
+#include linux/list.h
+#include linux/clk.h
+
+#include plat/clkdev_omap.h
+
+#include control.h
+#include clock.h
+#include clock816x.h
+#include cm.h
+#include cm-regbits-816x.h
+#include prm.h
+
+static struct clk sys_32k_ck = {
+   .name   = sys_32k_ck,
+   .ops= clkops_null,
+   .rate   = 32768,
+   .flags  = RATE_IN_TI816X,
+};
+
+static struct clk tclkin_ck = {
+   .name   = tclkin_ck,
+   .ops= clkops_null,
+   .rate   = 32768,
+   .flags  = RATE_IN_TI816X,
+};
+
+static struct clk osc_sys_ck = {
+   .name   = osc_sys_ck,
+   .ops= clkops_null,
+   .rate   = 2700,
+   .flags  = RATE_IN_TI816X,
+};
+
+static struct clk main_pll_clk1_ck = {
+   .name   = main_pll_clk1_ck,
+   .ops= clkops_null,
+   .rate   = 8,
+   .flags  = RATE_IN_TI816X,
+};
+
+static const struct clksel_rate div8_1to8_rates[] = {
+   { .div = 1, .val = 0, .flags = RATE_IN_TI816X },
+   { .div = 2, .val = 1, .flags = RATE_IN_TI816X },
+   { .div = 3, .val = 2, .flags = RATE_IN_TI816X },
+   { .div = 4, .val = 3, .flags = RATE_IN_TI816X },
+   { .div = 5, .val = 4, .flags = RATE_IN_TI816X },
+   { .div = 6, .val = 5, .flags = RATE_IN_TI816X },
+   { .div = 7, .val = 6, .flags = RATE_IN_TI816X },
+   { .div = 8, .val = 7, .flags = RATE_IN_TI816X },
+   { .div = 0 },
+};
+
+static const struct clksel sysclk1_div[] = {
+   { .parent = main_pll_clk1_ck, .rates = div8_1to8_rates },
+   { .parent = NULL },
+};
+
+static struct clk sysclk1_ck = {
+   .name   = sysclk1_ck,
+   .parent = main_pll_clk1_ck,
+   .clksel = sysclk1_div,
+   .init   = omap2_init_clksel_parent,
+   .ops= clkops_null,
+   .clksel_reg = TI816X_CM_DPLL_SYSCLK1_CLKSEL,
+   .clksel_mask= TI816X_CLKSEL_0_2_MASK,
+   .recalc = omap2_clksel_recalc,
+};
+
+static struct clk dsp_ick = {
+   .name   = dsp_ick,
+   .parent = sysclk1_ck,
+   .ops= clkops_omap2_dflt,
+   .enable_reg = TI816X_CM_ACTIVE_GEM_CLKCTRL,
+   .enable_bit = TI816X_MODULEMODE_SWCTRL,
+   .clkdm_name = active_gem_clkdm,
+   .recalc = followparent_recalc,
+};
+
+static struct clk main_pll_clk2_ck = {
+   .name   = main_pll_clk2_ck,
+   .ops= clkops_null,
+   .rate   = 10,
+   .flags  = RATE_IN_TI816X,
+};
+
+static const struct clksel sysclk2_div

[PATCH 3/4] TI816X: clock: Add clockdomains and powerdomains data

2011-03-25 Thread Hemant Pedanekar
This patch adds data for various clock domains and power domains in TI816X.

Note that at present this is not exhaustive and need to add missing domains.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clockdomains816x.h |  167 
 arch/arm/mach-omap2/powerdomains816x.h |   74 ++
 2 files changed, 241 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clockdomains816x.h
 create mode 100644 arch/arm/mach-omap2/powerdomains816x.h

diff --git a/arch/arm/mach-omap2/clockdomains816x.h 
b/arch/arm/mach-omap2/clockdomains816x.h
new file mode 100644
index 000..1938abc
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains816x.h
@@ -0,0 +1,167 @@
+/*
+ * TI816X Clock Domain data.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS816X_H
+#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS816X_H
+
+#include cm.h
+#include cm816x.h
+#include cm-regbits-816x.h
+
+#ifdef CONFIG_SOC_OMAPTI816X
+
+static struct clockdomain alwon_mpu_816x_clkdm = {
+   .name   = alwon_mpu_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_ALWON_MPU_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain alwon_l3_slow_816x_clkdm = {
+   .name   = alwon_l3_slow_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_ALWON_L3_SLOW_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain alwon_ethernet_816x_clkdm = {
+   .name   = alwon_ethernet_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_ETHERNET_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain mmu_816x_clkdm = {
+   .name   = mmu_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_MMU_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain mmu_cfg_816x_clkdm = {
+   .name   = mmu_cfg_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI816X_CM_ALWON_MOD,
+   .clkdm_offs = TI816X_CM_MMUCFG_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain active_gem_816x_clkdm = {
+   .name   = active_gem_clkdm,
+   .pwrdm  = { .name = active_pwrdm },
+   .cm_inst= TI816X_CM_ACTIVE_MOD,
+   .clkdm_offs = TI816X_CM_ACTIVE_GEM_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain hdvicp0_816x_clkdm = {
+   .name   = hdvicp0_clkdm,
+   .pwrdm  = { .name = hdvicp0_pwrdm },
+   .cm_inst= TI816X_CM_IVAHD0_MOD,
+   .clkdm_offs = TI816X_CM_IVAHD0_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain hdvicp1_816x_clkdm = {
+   .name   = hdvicp1_clkdm,
+   .pwrdm  = { .name = hdvicp1_pwrdm },
+   .cm_inst= TI816X_CM_IVAHD1_MOD,
+   .clkdm_offs = TI816X_CM_IVAHD1_CLKDM,
+   .clktrctrl_mask = TI816X_CLKTRCTRL_MASK,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_TI816X),
+};
+
+static struct clockdomain hdvicp2_816x_clkdm = {
+   .name   = hdvicp2_clkdm,
+   .pwrdm  = { .name = hdvicp2_pwrdm },
+   .cm_inst= TI816X_CM_IVAHD2_MOD,
+   .clkdm_offs = TI816X_CM_IVAHD2_CLKDM

[PATCH 4/4] clock: Integrate TI816X clock data into OMAP clock framework

2011-03-25 Thread Hemant Pedanekar
This patch hooks clock initialization and clockdomain/powerdomain setup into
OMAP clock framework.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/clock3xxx_data.c |5 ++-
 arch/arm/mach-omap2/clock816x_data.c |1 +
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c   |   18 ++-
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |   20 
 arch/arm/mach-omap2/cm2xxx_3xxx.c|   35 ++
 arch/arm/mach-omap2/cm2xxx_3xxx.h|5 +++
 arch/arm/mach-omap2/powerdomain.h|2 +
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c   |   27 +++--
 arch/arm/mach-omap2/powerdomains3xxx_data.c  |   18 ++-
 arch/arm/mach-omap2/prm2xxx_3xxx.h   |4 ++
 11 files changed, 127 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 82b2a67..8b88e40 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -137,6 +137,7 @@ obj-$(CONFIG_ARCH_OMAP3)+= $(clock-common) 
clock3xxx.o \
   clock3517.o clock36xx.o \
   dpll3xxx.o clock3xxx_data.o \
   clkt_iclk.o
+obj-$(CONFIG_SOC_OMAPTI816X)   += clock816x_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(clock-common) clock44xx_data.o \
   dpll3xxx.o dpll44xx.o
 
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index d905ecc..b5fa4e0 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -27,6 +27,7 @@
 #include clock34xx.h
 #include clock36xx.h
 #include clock3517.h
+#include clock816x.h
 
 #include cm2xxx_3xxx.h
 #include cm-regbits-34xx.h
@@ -3471,8 +3472,8 @@ int __init omap3xxx_clk_init(void)
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
} else if (cpu_is_ti816x()) {
-   cpu_mask = RATE_IN_TI816X;
-   cpu_clkflg = CK_TI816X;
+   ti816x_clk_init();
+   return 0;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/clock816x_data.c 
b/arch/arm/mach-omap2/clock816x_data.c
index 083b0a1..1670d90 100644
--- a/arch/arm/mach-omap2/clock816x_data.c
+++ b/arch/arm/mach-omap2/clock816x_data.c
@@ -23,6 +23,7 @@
 #include clock.h
 #include clock816x.h
 #include cm.h
+#include cm816x.h
 #include cm-regbits-816x.h
 #include prm.h
 
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c 
b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
index 48d0db7..4e31584 100644
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -151,6 +151,9 @@ static void _enable_hwsup(struct clockdomain *clkdm)
if (cpu_is_omap24xx())
omap2xxx_cm_clkdm_enable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
   clkdm-clktrctrl_mask);
+   else if (cpu_is_ti816x())
+   ti816x_cm_clkdm_enable_hwsup(clkdm-cm_inst, clkdm-clkdm_offs,
+  clkdm-clktrctrl_mask);
else if (cpu_is_omap34xx())
omap3xxx_cm_clkdm_enable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
   clkdm-clktrctrl_mask);
@@ -161,6 +164,9 @@ static void _disable_hwsup(struct clockdomain *clkdm)
if (cpu_is_omap24xx())
omap2xxx_cm_clkdm_disable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
clkdm-clktrctrl_mask);
+   else if (cpu_is_ti816x())
+   ti816x_cm_clkdm_disable_hwsup(clkdm-cm_inst, clkdm-clkdm_offs,
+   clkdm-clktrctrl_mask);
else if (cpu_is_omap34xx())
omap3xxx_cm_clkdm_disable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
clkdm-clktrctrl_mask);
@@ -213,14 +219,22 @@ static int omap2_clkdm_clk_disable(struct clockdomain 
*clkdm)
 
 static int omap3_clkdm_sleep(struct clockdomain *clkdm)
 {
-   omap3xxx_cm_clkdm_force_sleep(clkdm-pwrdm.ptr-prcm_offs,
+   if (cpu_is_ti816x())
+   ti816x_cm_clkdm_force_sleep(clkdm-cm_inst, clkdm-clkdm_offs,
+   clkdm-clktrctrl_mask);
+   else
+   omap3xxx_cm_clkdm_force_sleep(clkdm-pwrdm.ptr-prcm_offs,
clkdm-clktrctrl_mask);
return 0;
 }
 
 static int omap3_clkdm_wakeup(struct clockdomain *clkdm)
 {
-   omap3xxx_cm_clkdm_force_wakeup(clkdm-pwrdm.ptr-prcm_offs,
+   if (cpu_is_ti816x())
+   ti816x_cm_clkdm_force_wakeup(clkdm-cm_inst

[PATCH v7 0/4] Introduce support for TI816X processor series

2011-02-15 Thread Hemant Pedanekar
This patch set adds support for TI816X processor series. This series includes
DM8168, C6A816x and AM389x devices.

The details can be found at following links:

http://focus.ti.com/general/docs/gencontent.tsp?contentId=77960
http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This series is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific hwmods, clock data
and DMTIMER changes, are required to enable successful booting on TI816X EVM.
These patches will follow shortly.

The TI816X support is added as part of OMAP3 variant. The approach taken is in
accordance to the discussions in thread related to following post:
http://www.spinics.net/lists/linux-omap/msg41505.html

In addition, TI816X specific customizations/optimizations are handled as a part
of build configuration CONFIG_SOC_OMAPTI816X. Discussed here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg41927.html

Hemant Pedanekar (4):
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support and enable build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/mach-omap2/Kconfig|   10 
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   57 
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   21 +
 arch/arm/mach-omap2/control.h  |6 +++
 arch/arm/mach-omap2/id.c   |   33 +-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   22 +-
 arch/arm/mach-omap2/irq.c  |5 ++-
 arch/arm/mach-omap2/serial.c   |8 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   18 +++
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |8 +++
 arch/arm/plat-omap/include/plat/serial.h   |8 +++
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 arch/arm/plat-omap/io.c|5 ++-
 22 files changed, 260 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v7 1/4] TI816X: Update common omap platform files

2011-02-15 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X support.

The approach taken in this patch is to add TI816X as part of OMAP3 variant where
the cpu class is considered as OMAP34XX and the type is TI816X. This means, both
cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

A kernel config option CONFIG_SOC_OMAPTI816X is added under OMAP3 to include
support for TI816X build.

Signed-off-by: Hemant Pedanekar hema...@ti.com
Reviewed-by: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/common.h  |1 +
 arch/arm/plat-omap/include/plat/cpu.h |   18 ++
 5 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ae7f47d..6a4cfc2 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -72,6 +72,11 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
+config SOC_OMAPTI816X
+   bool TI816X support
+   depends on ARCH_OMAP3
+   default y
+
 config OMAP_PACKAGE_ZAF
bool
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 256ab3f..f1899a3 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
 #define CK_3517(1  9)
 #define CK_36XX(1  10)   /* 36xx/37xx-specific clocks */
 #define CK_443X(1  11)
+#define CK_TI816X  (1  12)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0ada..d43e623 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -53,6 +53,7 @@ struct clkops {
 #define RATE_IN_3430ES2PLUS(1  3)/* 3430 ES = 2 rates only */
 #define RATE_IN_36XX   (1  4)
 #define RATE_IN_4430   (1  5)
+#define RATE_IN_TI816X (1  6)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 29b2afb..1dd97e7 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -66,6 +66,7 @@ void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 29d5953..8198bb6 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass (void)  \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define cpu_is_omap15xx()  0
 #define cpu_is_omap16xx()  0
@@ -126,6 +134,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 #define cpu_is_omap243x()  0
 #define cpu_is_omap34xx()  0
 #define cpu_is_omap343x()  0
+#define cpu_is_ti816x()0
 #define cpu_is_omap44xx()  0
 #define cpu_is_omap443x()  0
 
@@ -330,6 +339,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3530
 # undef cpu_is_omap3505
 # undef cpu_is_omap3517
+# undef cpu_is_ti816x
 # define cpu_is_omap3430() is_omap3430()
 # define cpu_is_omap3503() (cpu_is_omap3430()\
(!omap3_has_iva())\
@@ -345,6 +355,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3517() is_omap3517()
 # undef cpu_is_omap3630
 # define cpu_is_omap3630() is_omap363x()
+# define cpu_is_ti816x()   is_ti816x()
 #endif
 
 # if defined(CONFIG_ARCH_OMAP4)
@@ -389,6 +400,10 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP3505_REV(v)(OMAP35XX_CLASS | (0x3505  16) | (v 
 8))
 #define OMAP3517_REV(v)(OMAP35XX_CLASS | (0x3517  16) | (v 
 8

[PATCH v7 2/4] TI816X: Update common OMAP machine specific sources

2011-02-15 Thread Hemant Pedanekar
This patch updates the common machine specific source files with support for
TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
Reviewed-by: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++-
 arch/arm/mach-omap2/common.c   |   21 +++
 arch/arm/mach-omap2/control.h  |6 
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   22 +++-
 arch/arm/mach-omap2/irq.c  |5 +++-
 arch/arm/mach-omap2/serial.c   |8 +++---
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/io.c|5 +++-
 12 files changed, 144 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 403a4a1..f14d986 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3471,6 +3471,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_omap3630()) {
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
+   } else if (cpu_is_ti816x()) {
+   cpu_mask = RATE_IN_TI816X;
+   cpu_clkflg = CK_TI816X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3550,7 +3553,7 @@ int __init omap3xxx_clk_init(void)
/*
 * Lock DPLL5 and put it in autoidle.
 */
-   if (omap_rev() = OMAP3430_REV_ES2_0)
+   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index d5eaee3..48de451 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -108,6 +108,27 @@ void __init omap3_map_io(void)
omap2_set_globals_3xxx();
omap34xx_map_common_io();
 }
+
+/*
+ * Adjust TAP register base such that omap3_check_revision accesses the correct
+ * TI816X register for checking device ID (it adds 0x204 to tap base while
+ * TI816X DEVICE ID register is at offset 0x600 from control base).
+ */
+#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
+   TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals ti816x_globals = {
+   .class  = OMAP343X_CLASS,
+   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm = TI816X_PRCM_BASE,
+};
+
+void __init omap2_set_globals_ti816x(void)
+{
+   __omap2_set_globals(ti816x_globals);
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae..c2804c1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,9 @@
 #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
+/* TI816X spefic control submodules */
+#define TI816X_CONTROL_DEVCONF 0x600
+
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
 
 #define OMAP2_CONTROL_SYSCONFIG(OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +244,9 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI816X CONTROL_DEVCONF register offsets */
+#define TI816X_CONTROL_DEVICE_ID   (TI816X_CONTROL_DEVCONF + 0x000)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 8fd0535..3168b17 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -191,12 +191,19 @@ static void __init omap3_check_features(void)
if (!cpu_is_omap3505()  !cpu_is_omap3517())
omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
+   omap3_features |= OMAP3_HAS_SDRC;
+
/*
 * TODO: Get additional info (where applicable)
 *   e.g. Size of L2 cache.
 */
 }
 
+static void __init ti816x_check_features(void)
+{
+   omap3_features = OMAP3_HAS_NEON;
+}
+
 static void __init omap3_check_revision(void)
 {
u32 cpuid, idcode;
@@ -287,6 +294,20 @@ static void __init omap3_check_revision(void)
omap_chip.oc |= CHIP_IS_OMAP3630ES1_2;
}
break;
+   case 0xb81e:
+   omap_chip.oc = CHIP_IS_TI816X;
+
+   switch (rev) {
+   case 0

[PATCH v7 3/4] TI816X: Create board support and enable build for TI816X EVM

2011-02-15 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI816X EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
Reviewed-by: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +++
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-ti8168evm.c |   57 +
 3 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 6a4cfc2..9b4e78f 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -299,6 +299,11 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   depends on SOC_OMAPTI816X
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 742ca67..ec24999 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -224,6 +224,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..6282cc4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,57 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+};
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap_board_config = ti8168_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   omapti816x_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .timer  = omap_timer,
+   .init_machine   = ti8168_evm_init,
+MACHINE_END
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v7 4/4] TI816X: Add low level debug support

2011-02-15 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar hema...@ti.com
Reviewed-by: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |8 
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d413..e1b0f17 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -69,6 +69,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rp, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rp, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rp, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rp, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rp, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -91,6 +97,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rp, =ZOOM_UART_BASE
mrc p15, 0, \rv, c1, c0
tst \rv, #1 @ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index cec5d56..4102bf4 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -51,6 +51,11 @@
 #define OMAP4_UART3_BASE   0x4802
 #define OMAP4_UART4_BASE   0x4806e000
 
+/* TI816X serial ports */
+#define TI816X_UART1_BASE  0x4802
+#define TI816X_UART2_BASE  0x48022000
+#define TI816X_UART3_BASE  0x48024000
+
 /* External port on Zoom2/3 */
 #define ZOOM_UART_BASE 0x1000
 #define ZOOM_UART_VIRT 0xfa40
@@ -81,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85..30b891c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND v6 0/4] Introduce support for TI816X processor series

2011-02-14 Thread Hemant Pedanekar
(Resending v6 with cc: linux-arm-kernel)

This patch set adds support for TI816X processor series. This series includes
DM8168, C6A816x and AM389x devices.

The details can be found at following links:

http://focus.ti.com/general/docs/gencontent.tsp?contentId=77960
http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This series is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific hwmods, clock data
and DMTIMER changes, are required to enable successful booting on TI816X EVM.
These patches will follow shortly.

The TI816X support is added as part of OMAP3 variant. The approach taken is in
accordance to the discussions in thread related to following post:
http://www.spinics.net/lists/linux-omap/msg41505.html

In addition, TI816X specific customizations/optimizations are handled as a part
of build configuration CONFIG_SOC_OMAPTI816X. Discussed here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg41927.html

Hemant Pedanekar (4):
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support and enable build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/mach-omap2/Kconfig|   10 
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   57 
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   21 +
 arch/arm/mach-omap2/control.h  |6 +++
 arch/arm/mach-omap2/id.c   |   33 +-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   22 +-
 arch/arm/mach-omap2/irq.c  |5 ++-
 arch/arm/mach-omap2/serial.c   |8 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   18 +++
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |8 +++
 arch/arm/plat-omap/include/plat/serial.h   |8 +++
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 arch/arm/plat-omap/io.c|5 ++-
 22 files changed, 260 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND v6 1/4] TI816X: Update common omap platform files

2011-02-14 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X support.

The approach taken in this patch is to add TI816X as part of OMAP3 variant where
the cpu class is considered as OMAP34XX and the type is TI816X. This means, both
cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

A kernel config option CONFIG_SOC_OMAPTI816X is added under OMAP3 to include
support for TI816X build.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/common.h  |1 +
 arch/arm/plat-omap/include/plat/cpu.h |   18 ++
 5 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ae7f47d..6a4cfc2 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -72,6 +72,11 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
+config SOC_OMAPTI816X
+   bool TI816X support
+   depends on ARCH_OMAP3
+   default y
+
 config OMAP_PACKAGE_ZAF
bool
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 256ab3f..f1899a3 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
 #define CK_3517(1  9)
 #define CK_36XX(1  10)   /* 36xx/37xx-specific clocks */
 #define CK_443X(1  11)
+#define CK_TI816X  (1  12)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0ada..d43e623 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -53,6 +53,7 @@ struct clkops {
 #define RATE_IN_3430ES2PLUS(1  3)/* 3430 ES = 2 rates only */
 #define RATE_IN_36XX   (1  4)
 #define RATE_IN_4430   (1  5)
+#define RATE_IN_TI816X (1  6)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 29b2afb..1dd97e7 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -66,6 +66,7 @@ void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 73d91ee..864f1ec 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass (void)  \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define cpu_is_omap15xx()  0
 #define cpu_is_omap16xx()  0
@@ -126,6 +134,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 #define cpu_is_omap243x()  0
 #define cpu_is_omap34xx()  0
 #define cpu_is_omap343x()  0
+#define cpu_is_ti816x()0
 #define cpu_is_omap44xx()  0
 #define cpu_is_omap443x()  0
 
@@ -330,6 +339,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3530
 # undef cpu_is_omap3505
 # undef cpu_is_omap3517
+# undef cpu_is_ti816x
 # define cpu_is_omap3430() is_omap3430()
 # define cpu_is_omap3503() (cpu_is_omap3430()\
(!omap3_has_iva())\
@@ -345,6 +355,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3517() is_omap3517()
 # undef cpu_is_omap3630
 # define cpu_is_omap3630() is_omap363x()
+# define cpu_is_ti816x()   is_ti816x()
 #endif
 
 # if defined(CONFIG_ARCH_OMAP4)
@@ -389,6 +400,10 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP3505_REV(v)(OMAP35XX_CLASS | (0x3505  16) | (v 
 8))
 #define OMAP3517_REV(v)(OMAP35XX_CLASS | (0x3517  16) | (v 
 8))
 
+#define TI816X_CLASS   0x81600034

[PATCH RESEND v6 2/4] TI816X: Update common OMAP machine specific sources

2011-02-14 Thread Hemant Pedanekar
This patch updates the common machine specific source files with support for
TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++-
 arch/arm/mach-omap2/common.c   |   21 +++
 arch/arm/mach-omap2/control.h  |6 
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   22 +++-
 arch/arm/mach-omap2/irq.c  |5 +++-
 arch/arm/mach-omap2/serial.c   |8 +++---
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/io.c|5 +++-
 12 files changed, 144 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 403a4a1..f14d986 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3471,6 +3471,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_omap3630()) {
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
+   } else if (cpu_is_ti816x()) {
+   cpu_mask = RATE_IN_TI816X;
+   cpu_clkflg = CK_TI816X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3550,7 +3553,7 @@ int __init omap3xxx_clk_init(void)
/*
 * Lock DPLL5 and put it in autoidle.
 */
-   if (omap_rev() = OMAP3430_REV_ES2_0)
+   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index d5eaee3..48de451 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -108,6 +108,27 @@ void __init omap3_map_io(void)
omap2_set_globals_3xxx();
omap34xx_map_common_io();
 }
+
+/*
+ * Adjust TAP register base such that omap3_check_revision accesses the correct
+ * TI816X register for checking device ID (it adds 0x204 to tap base while
+ * TI816X DEVICE ID register is at offset 0x600 from control base).
+ */
+#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
+   TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals ti816x_globals = {
+   .class  = OMAP343X_CLASS,
+   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm = TI816X_PRCM_BASE,
+};
+
+void __init omap2_set_globals_ti816x(void)
+{
+   __omap2_set_globals(ti816x_globals);
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae..c2804c1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,9 @@
 #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
+/* TI816X spefic control submodules */
+#define TI816X_CONTROL_DEVCONF 0x600
+
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
 
 #define OMAP2_CONTROL_SYSCONFIG(OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +244,9 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI816X CONTROL_DEVCONF register offsets */
+#define TI816X_CONTROL_DEVICE_ID   (TI816X_CONTROL_DEVCONF + 0x000)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 5f9086c..5c25f1b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -191,12 +191,19 @@ static void __init omap3_check_features(void)
if (!cpu_is_omap3505()  !cpu_is_omap3517())
omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
+   omap3_features |= OMAP3_HAS_SDRC;
+
/*
 * TODO: Get additional info (where applicable)
 *   e.g. Size of L2 cache.
 */
 }
 
+static void __init ti816x_check_features(void)
+{
+   omap3_features = OMAP3_HAS_NEON;
+}
+
 static void __init omap3_check_revision(void)
 {
u32 cpuid, idcode;
@@ -287,6 +294,20 @@ static void __init omap3_check_revision(void)
omap_chip.oc |= CHIP_IS_OMAP3630ES1_2;
}
break;
+   case 0xb81e:
+   omap_chip.oc = CHIP_IS_TI816X;
+
+   switch (rev) {
+   case 0:
+   omap_revision

[PATCH RESEND v6 3/4] TI816X: Create board support and enable build for TI816X EVM

2011-02-14 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI816X EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +++
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-ti8168evm.c |   57 +
 3 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 6a4cfc2..9b4e78f 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -299,6 +299,11 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   depends on SOC_OMAPTI816X
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 742ca67..ec24999 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -224,6 +224,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..6282cc4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,57 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+};
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap_board_config = ti8168_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   omapti816x_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .timer  = omap_timer,
+   .init_machine   = ti8168_evm_init,
+MACHINE_END
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 0/4] Introduce support for TI816X processor series

2011-02-11 Thread Hemant Pedanekar
This patch set adds support for TI816X processor series. This series includes
DM8168, C6A816x and AM389x devices.

The details can be found at following links:

http://focus.ti.com/general/docs/gencontent.tsp?contentId=77960
http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This series is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific hwmods, clock data
and DMTIMER changes, are required to enable successful booting on TI816X EVM.
These patches will follow shortly.

The TI816X support is added as part of OMAP3 variant. The approach taken is in
accordance to the discussions in thread related to following post:
http://www.spinics.net/lists/linux-omap/msg41505.html

In addition, TI816X specific customizations/optimizations are handled as a part
of build configuration CONFIG_SOC_OMAPTI816X. Discussed here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg41927.html

Hemant Pedanekar (4):
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support and enable build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/mach-omap2/Kconfig|   10 
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   57 
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   21 +
 arch/arm/mach-omap2/control.h  |6 +++
 arch/arm/mach-omap2/id.c   |   33 +-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   22 +-
 arch/arm/mach-omap2/irq.c  |5 ++-
 arch/arm/mach-omap2/serial.c   |8 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   18 +++
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |8 +++
 arch/arm/plat-omap/include/plat/serial.h   |8 +++
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 arch/arm/plat-omap/io.c|5 ++-
 22 files changed, 260 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 1/4] TI816X: Update common omap platform files

2011-02-11 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X support.

The approach taken in this patch is to add TI816X as part of OMAP3 variant where
the cpu class is considered as OMAP34XX and the type is TI816X. This means, both
cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

A kernel config option CONFIG_SOC_OMAPTI816X is added under OMAP3 to include
support for TI816X build.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/common.h  |1 +
 arch/arm/plat-omap/include/plat/cpu.h |   18 ++
 5 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ae7f47d..6a4cfc2 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -72,6 +72,11 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
+config SOC_OMAPTI816X
+   bool TI816X support
+   depends on ARCH_OMAP3
+   default y
+
 config OMAP_PACKAGE_ZAF
bool
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 256ab3f..f1899a3 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
 #define CK_3517(1  9)
 #define CK_36XX(1  10)   /* 36xx/37xx-specific clocks */
 #define CK_443X(1  11)
+#define CK_TI816X  (1  12)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0ada..d43e623 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -53,6 +53,7 @@ struct clkops {
 #define RATE_IN_3430ES2PLUS(1  3)/* 3430 ES = 2 rates only */
 #define RATE_IN_36XX   (1  4)
 #define RATE_IN_4430   (1  5)
+#define RATE_IN_TI816X (1  6)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 29b2afb..1dd97e7 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -66,6 +66,7 @@ void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 73d91ee..864f1ec 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass (void)  \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define cpu_is_omap15xx()  0
 #define cpu_is_omap16xx()  0
@@ -126,6 +134,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 #define cpu_is_omap243x()  0
 #define cpu_is_omap34xx()  0
 #define cpu_is_omap343x()  0
+#define cpu_is_ti816x()0
 #define cpu_is_omap44xx()  0
 #define cpu_is_omap443x()  0
 
@@ -330,6 +339,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3530
 # undef cpu_is_omap3505
 # undef cpu_is_omap3517
+# undef cpu_is_ti816x
 # define cpu_is_omap3430() is_omap3430()
 # define cpu_is_omap3503() (cpu_is_omap3430()\
(!omap3_has_iva())\
@@ -345,6 +355,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3517() is_omap3517()
 # undef cpu_is_omap3630
 # define cpu_is_omap3630() is_omap363x()
+# define cpu_is_ti816x()   is_ti816x()
 #endif
 
 # if defined(CONFIG_ARCH_OMAP4)
@@ -389,6 +400,10 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP3505_REV(v)(OMAP35XX_CLASS | (0x3505  16) | (v 
 8))
 #define OMAP3517_REV(v)(OMAP35XX_CLASS | (0x3517  16) | (v 
 8))
 
+#define TI816X_CLASS   0x81600034

[PATCH v6 2/4] TI816X: Update common OMAP machine specific sources

2011-02-11 Thread Hemant Pedanekar
This patch updates the common machine specific source files with support for
TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++-
 arch/arm/mach-omap2/common.c   |   21 +++
 arch/arm/mach-omap2/control.h  |6 
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   22 +++-
 arch/arm/mach-omap2/irq.c  |5 +++-
 arch/arm/mach-omap2/serial.c   |8 +++---
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/io.c|5 +++-
 12 files changed, 144 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 403a4a1..f14d986 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3471,6 +3471,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_omap3630()) {
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
+   } else if (cpu_is_ti816x()) {
+   cpu_mask = RATE_IN_TI816X;
+   cpu_clkflg = CK_TI816X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3550,7 +3553,7 @@ int __init omap3xxx_clk_init(void)
/*
 * Lock DPLL5 and put it in autoidle.
 */
-   if (omap_rev() = OMAP3430_REV_ES2_0)
+   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index d5eaee3..48de451 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -108,6 +108,27 @@ void __init omap3_map_io(void)
omap2_set_globals_3xxx();
omap34xx_map_common_io();
 }
+
+/*
+ * Adjust TAP register base such that omap3_check_revision accesses the correct
+ * TI816X register for checking device ID (it adds 0x204 to tap base while
+ * TI816X DEVICE ID register is at offset 0x600 from control base).
+ */
+#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
+   TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals ti816x_globals = {
+   .class  = OMAP343X_CLASS,
+   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm = TI816X_PRCM_BASE,
+};
+
+void __init omap2_set_globals_ti816x(void)
+{
+   __omap2_set_globals(ti816x_globals);
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae..c2804c1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,9 @@
 #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
+/* TI816X spefic control submodules */
+#define TI816X_CONTROL_DEVCONF 0x600
+
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
 
 #define OMAP2_CONTROL_SYSCONFIG(OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +244,9 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI816X CONTROL_DEVCONF register offsets */
+#define TI816X_CONTROL_DEVICE_ID   (TI816X_CONTROL_DEVCONF + 0x000)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 5f9086c..5c25f1b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -191,12 +191,19 @@ static void __init omap3_check_features(void)
if (!cpu_is_omap3505()  !cpu_is_omap3517())
omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
+   omap3_features |= OMAP3_HAS_SDRC;
+
/*
 * TODO: Get additional info (where applicable)
 *   e.g. Size of L2 cache.
 */
 }
 
+static void __init ti816x_check_features(void)
+{
+   omap3_features = OMAP3_HAS_NEON;
+}
+
 static void __init omap3_check_revision(void)
 {
u32 cpuid, idcode;
@@ -287,6 +294,20 @@ static void __init omap3_check_revision(void)
omap_chip.oc |= CHIP_IS_OMAP3630ES1_2;
}
break;
+   case 0xb81e:
+   omap_chip.oc = CHIP_IS_TI816X;
+
+   switch (rev) {
+   case 0:
+   omap_revision

[PATCH v6 3/4] TI816X: Create board support and enable build for TI816X EVM

2011-02-11 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI816X EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +++
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-ti8168evm.c |   57 +
 3 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 6a4cfc2..9b4e78f 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -299,6 +299,11 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   depends on SOC_OMAPTI816X
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 742ca67..ec24999 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -224,6 +224,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..6282cc4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,57 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+};
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap_board_config = ti8168_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   omapti816x_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .timer  = omap_timer,
+   .init_machine   = ti8168_evm_init,
+MACHINE_END
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 4/4] TI816X: Add low level debug support

2011-02-11 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |8 
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d413..e1b0f17 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -69,6 +69,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rp, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rp, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rp, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rp, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rp, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -91,6 +97,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rp, =ZOOM_UART_BASE
mrc p15, 0, \rv, c1, c0
tst \rv, #1 @ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index cec5d56..4102bf4 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -51,6 +51,11 @@
 #define OMAP4_UART3_BASE   0x4802
 #define OMAP4_UART4_BASE   0x4806e000
 
+/* TI816X serial ports */
+#define TI816X_UART1_BASE  0x4802
+#define TI816X_UART2_BASE  0x48022000
+#define TI816X_UART3_BASE  0x48024000
+
 /* External port on Zoom2/3 */
 #define ZOOM_UART_BASE 0x1000
 #define ZOOM_UART_VIRT 0xfa40
@@ -81,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85..30b891c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 0/4] Introduce support for TI816X processor series

2011-02-09 Thread Hemant Pedanekar
This patch set adds support for TI816X processor series. This series includes
DM8168, C6A816x and AM389x devices.

The details can be found at following links:

http://focus.ti.com/general/docs/gencontent.tsp?contentId=77960
http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This series is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific hwmods, clock data
and DMTIMER changes, are required to enable successful booting on TI816X EVM.
These patches will follow shortly.

The TI816X support is added as part of OMAP3 variant. The approach taken is in
accordance to the discussions in thread related to following post:
http://www.spinics.net/lists/linux-omap/msg41505.html

In addition, TI816X specific customizations/optimizations are handled as a part
of build configuration CONFIG_SOC_OMAPTI816X. Discussed here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg41927.html

Hemant Pedanekar (4):
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support and enable build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/mach-omap2/Kconfig|   16 +++
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   57 
 arch/arm/mach-omap2/clock3xxx_data.c   |5 ++-
 arch/arm/mach-omap2/common.c   |   21 +
 arch/arm/mach-omap2/control.h  |6 +++
 arch/arm/mach-omap2/id.c   |   33 +-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 +
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   13 +-
 arch/arm/mach-omap2/irq.c  |5 ++-
 arch/arm/mach-omap2/serial.c   |8 ++--
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   22 +
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/serial.h   |8 +++
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 arch/arm/plat-omap/io.c|5 ++-
 21 files changed, 253 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 1/4] TI816X: Update common omap platform files

2011-02-09 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X support.

The approach taken in this patch is to add TI816X as part of OMAP3 variant where
the cpu class is considered as OMAP34XX and the type is TI816X. This means, both
cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

In addition, a kernel config option CONFIG_SOC_OMAPTI816X is also added under
OMAP3 to allow TI816X only build. This option leads to following main
possibilities:

 1) Multi-OMAP build with CONFIG_SOC_OMAPTI816X: The kernel built only for
 TI816X OMAP3 SoCs along with any other OMAP2/4 (e.g., OMAP4s). May not boot
 on other OMAP3 SoCs.

 2) OMAP3 only build with CONFIG_SOC_OMAPTI816X: This will build TI816X
 optimized kernel. May not boot on other OMAP3 SoCs.

 3) OMAP3 only, no CONFIG_SOC_OMAPTI816X: This will build kernel for all OMAP3s
 except TI816X. Note that cpu_is_ti816x checks will return fail.

As mentioned above (in (1) and (2)), selecting CONFIG_SOC_OMAPTI816X skips some
configurations which are required for OMAP3XXX devices but not applicable on
TI816X devices (e.g., dpll5 setting). Hence the kernel built with
CONFIG_SOC_OMAPTI816X may not boot on those OMAP3 devices.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |   11 +++
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/common.h  |1 +
 arch/arm/plat-omap/include/plat/cpu.h |   22 ++
 arch/arm/plat-omap/include/plat/hardware.h|1 +
 6 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ae7f47d..0b921bc 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -72,6 +72,17 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG
 
+config SOC_OMAPTI816X
+   bool TI816X SoC family specific build of OMAP3
+   depends on ARCH_OMAP3
+   default n
+   help
+Select Y if you want a TI816X only build of OMAP3. This means the
+kernel built with this option may not boot on non TI816X OMAP3 SoCs.
+This restriction applies even for multi-omap builds. It is recommended
+to select N here if you wish to build a multi-omap kernel for booting
+on all OMAP3 based SoCs (including TI816X).
+
 config OMAP_PACKAGE_ZAF
bool
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 256ab3f..f1899a3 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
 #define CK_3517(1  9)
 #define CK_36XX(1  10)   /* 36xx/37xx-specific clocks */
 #define CK_443X(1  11)
+#define CK_TI816X  (1  12)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0ada..d43e623 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -53,6 +53,7 @@ struct clkops {
 #define RATE_IN_3430ES2PLUS(1  3)/* 3430 ES = 2 rates only */
 #define RATE_IN_36XX   (1  4)
 #define RATE_IN_4430   (1  5)
+#define RATE_IN_TI816X (1  6)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 29b2afb..1dd97e7 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -66,6 +66,7 @@ void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 73d91ee..ee18ae0 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass (void)  \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define

[PATCH v5 2/4] TI816X: Update common OMAP machine specific sources

2011-02-09 Thread Hemant Pedanekar
This patch updates the common machine specific source files with support for
TI816X.

The approach taken is to have TI816X only build for OMAP3 when
CONFIG_SOC_OMAPTI816X is defined.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++-
 arch/arm/mach-omap2/common.c   |   21 +++
 arch/arm/mach-omap2/control.h  |6 
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   13 -
 arch/arm/mach-omap2/irq.c  |5 +++-
 arch/arm/mach-omap2/serial.c   |8 +++---
 arch/arm/plat-omap/include/plat/ti816x.h   |   27 +++
 arch/arm/plat-omap/io.c|5 +++-
 10 files changed, 126 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 403a4a1..f14d986 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3471,6 +3471,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_omap3630()) {
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
+   } else if (cpu_is_ti816x()) {
+   cpu_mask = RATE_IN_TI816X;
+   cpu_clkflg = CK_TI816X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3550,7 +3553,7 @@ int __init omap3xxx_clk_init(void)
/*
 * Lock DPLL5 and put it in autoidle.
 */
-   if (omap_rev() = OMAP3430_REV_ES2_0)
+   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index d5eaee3..48de451 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -108,6 +108,27 @@ void __init omap3_map_io(void)
omap2_set_globals_3xxx();
omap34xx_map_common_io();
 }
+
+/*
+ * Adjust TAP register base such that omap3_check_revision accesses the correct
+ * TI816X register for checking device ID (it adds 0x204 to tap base while
+ * TI816X DEVICE ID register is at offset 0x600 from control base).
+ */
+#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
+   TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals ti816x_globals = {
+   .class  = OMAP343X_CLASS,
+   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm = TI816X_PRCM_BASE,
+};
+
+void __init omap2_set_globals_ti816x(void)
+{
+   __omap2_set_globals(ti816x_globals);
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae..c2804c1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,9 @@
 #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
+/* TI816X spefic control submodules */
+#define TI816X_CONTROL_DEVCONF 0x600
+
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
 
 #define OMAP2_CONTROL_SYSCONFIG(OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +244,9 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI816X CONTROL_DEVCONF register offsets */
+#define TI816X_CONTROL_DEVICE_ID   (TI816X_CONTROL_DEVCONF + 0x000)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 5f9086c..5c25f1b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -191,12 +191,19 @@ static void __init omap3_check_features(void)
if (!cpu_is_omap3505()  !cpu_is_omap3517())
omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
+   omap3_features |= OMAP3_HAS_SDRC;
+
/*
 * TODO: Get additional info (where applicable)
 *   e.g. Size of L2 cache.
 */
 }
 
+static void __init ti816x_check_features(void)
+{
+   omap3_features = OMAP3_HAS_NEON;
+}
+
 static void __init omap3_check_revision(void)
 {
u32 cpuid, idcode;
@@ -287,6 +294,20 @@ static void __init omap3_check_revision(void)
omap_chip.oc |= CHIP_IS_OMAP3630ES1_2;
}
break;
+   case 0xb81e:
+   omap_chip.oc = CHIP_IS_TI816X;
+
+   switch (rev) {
+   case 0:
+   omap_revision = TI8168_REV_ES1_0

[PATCH v5 3/4] TI816X: Create board support and enable build for TI816X EVM

2011-02-09 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI816X EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +++
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-ti8168evm.c |   57 +
 3 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 0b921bc..032903d 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -305,6 +305,11 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   depends on ARCH_OMAP3
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 9eeabaf..a9e3974 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -224,6 +224,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..191e176
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,57 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+};
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap_board_config = ti8168_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   omap34xx_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .timer  = omap_timer,
+   .init_machine   = ti8168_evm_init,
+MACHINE_END
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 4/4] TI816X: Add low level debug support

2011-02-09 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |8 
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d413..e1b0f17 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -69,6 +69,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rp, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rp, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rp, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rp, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rp, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -91,6 +97,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rp, =ZOOM_UART_BASE
mrc p15, 0, \rv, c1, c0
tst \rv, #1 @ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index cec5d56..4102bf4 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -51,6 +51,11 @@
 #define OMAP4_UART3_BASE   0x4802
 #define OMAP4_UART4_BASE   0x4806e000
 
+/* TI816X serial ports */
+#define TI816X_UART1_BASE  0x4802
+#define TI816X_UART2_BASE  0x48022000
+#define TI816X_UART3_BASE  0x48024000
+
 /* External port on Zoom2/3 */
 #define ZOOM_UART_BASE 0x1000
 #define ZOOM_UART_VIRT 0xfa40
@@ -81,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85..30b891c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.7.3.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 0/4] Introduce support for TI816X processor series

2011-01-10 Thread Hemant Pedanekar
This patch set adds support for TI816X processor series. This series includes
DM8168, C6A816x and AM389x devices.

The details can be found at following links:

http://focus.ti.com/general/docs/gencontent.tsp?contentId=77960
http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This series is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific hwmods, clock data
and DMTIMER changes, are required to enable successful booting on TI816X EVM.
These patches will follow shortly.

The TI816X support is added as part of OMAP3 variant. The approach taken is in
accordance to the discussions in thread related to following post:
http://www.spinics.net/lists/linux-omap/msg41505.html

In addition, TI816X specific customizations/optimizations are handled as a part
of build configuration CONFIG_SOC_OMAPTI816X. Discussed here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg41927.html

Hemant Pedanekar (4):
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support and enable build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/mach-omap2/Kconfig|   16 +++
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   58 +++
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +-
 arch/arm/mach-omap2/common.c   |   24 +
 arch/arm/mach-omap2/control.h  |   17 +++
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 ++
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +++
 arch/arm/mach-omap2/io.c   |   13 ++-
 arch/arm/mach-omap2/irq.c  |5 +-
 arch/arm/mach-omap2/serial.c   |8 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   22 
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/irqs-ti816x.h  |  131 
 arch/arm/plat-omap/include/plat/irqs.h |3 +
 arch/arm/plat-omap/include/plat/serial.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   31 ++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 ++
 arch/arm/plat-omap/io.c|5 +-
 23 files changed, 406 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 2/4] TI816X: Update common OMAP machine specific sources

2011-01-10 Thread Hemant Pedanekar
This patch updates the common machine specific source files with support for
TI816X.

The approach taken is to have TI816X only build for OMAP3 when
CONFIG_SOC_OMAPTI816X is defined.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++-
 arch/arm/mach-omap2/common.c   |   24 +
 arch/arm/mach-omap2/control.h  |   17 
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/entry-macro.S |   13 +
 arch/arm/mach-omap2/io.c   |   13 -
 arch/arm/mach-omap2/irq.c  |5 +++-
 arch/arm/mach-omap2/serial.c   |8 +++---
 arch/arm/plat-omap/io.c|5 +++-
 9 files changed, 113 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 9ab817e..557de99 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3466,6 +3466,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_omap3630()) {
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
+   } else if (cpu_is_ti816x()) {
+   cpu_mask = RATE_IN_TI816X;
+   cpu_clkflg = CK_TI816X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3545,7 +3548,7 @@ int __init omap3xxx_clk_init(void)
/*
 * Lock DPLL5 and put it in autoidle.
 */
-   if (omap_rev() = OMAP3430_REV_ES2_0)
+   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 778929f..7f58b7f 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -108,6 +108,30 @@ void __init omap3_map_io(void)
omap2_set_globals_3xxx();
omap34xx_map_common_io();
 }
+
+/*
+ * Adjust TAP register base such that omap3_check_revision accesses the correct
+ * TI816X register for checking device ID (it adds 0x204 to tap base while
+ * TI816X DEVICE ID register is at offset 0x600 from control base).
+ */
+#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
+   TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals ti816x_globals = {
+   .class  = OMAP343X_CLASS,
+   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm = TI816X_PRCM_BASE,
+   .uart1_phys = TI816X_UART1_BASE,
+   .uart2_phys = TI816X_UART2_BASE,
+   .uart3_phys = TI816X_UART3_BASE,
+};
+
+void __init omap2_set_globals_ti816x(void)
+{
+   __omap2_set_globals(ti816x_globals);
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae..5c87054 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,11 @@
 #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
+/* TI816X spefic control submodules */
+#define TI816X_CONTROL_OCPCONF 0x000
+#define TI816X_CONTROL_DEVBOOT 0x040
+#define TI816X_CONTROL_DEVCONF 0x600
+
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
 
 #define OMAP2_CONTROL_SYSCONFIG(OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +246,18 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI816X CONTROL_DEVBOOT register offsets */
+#define TI816X_CONTROL_STATUS  (TI816X_CONTROL_DEVBOOT + 0x000)
+#define TI816X_CONTROL_BOOTSTAT(TI816X_CONTROL_DEVBOOT + 0x004)
+
+/* TI816X CONTROL_DEVCONF register offsets */
+#define TI816X_CONTROL_DEVICE_ID   (TI816X_CONTROL_DEVCONF + 0x000)
+#define TI816X_CONTROL_MAC_ID0_LO  (TI816X_CONTROL_DEVCONF + 0x030)
+#define TI816X_CONTROL_MAC_ID0_HI  (TI816X_CONTROL_DEVCONF + 0x034)
+#define TI816X_CONTROL_MAC_ID1_LO  (TI816X_CONTROL_DEVCONF + 0x038)
+#define TI816X_CONTROL_MAC_ID1_HI  (TI816X_CONTROL_DEVCONF + 0x03c)
+#define TI816X_CONTROL_PCIE_CFG(TI816X_CONTROL_DEVCONF + 0x040)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 5f9086c..5c25f1b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -191,12 +191,19 @@ static void __init omap3_check_features(void)
if (!cpu_is_omap3505()  !cpu_is_omap3517())
omap3_features |= OMAP3_HAS_IO_WAKEUP;
 
+   omap3_features

[PATCH v4 1/4] TI816X: Update common omap platform files

2011-01-10 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X support. Also adds new
files for TI816X module base addresses and irq definitions.

The approach taken in this patch is to add TI816X as part of OMAP3 variant where
the cpu class is considered as OMAP34XX and the type is TI816X. This means, both
cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

In addition, a kernel config option CONFIG_SOC_OMAPTI816X is also added under
OMAP3 to allow TI816X only build. This option leads to following main
possibilities:

 1) Multi-OMAP build with CONFIG_SOC_OMAPTI816X: The kernel built only for
 TI816X OMAP3 SoCs along with any other OMAP2/4 (e.g., OMAP4s). May not boot
 on other OMAP3 SoCs.

 2) OMAP3 only build with CONFIG_SOC_OMAPTI816X: This will build TI816X
 optimized kernel. May not boot on other OMAP3 SoCs.

 3) OMAP3 only, no CONFIG_SOC_OMAPTI816X: This will build kernel for all OMAP3s
 except TI816X. Note that cpu_is_ti816x checks will return fail.

Note that OMAP3 only build with support for OMAP3 SoCs as well as TI816X is not
possible.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |   11 ++
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/common.h  |1 +
 arch/arm/plat-omap/include/plat/cpu.h |   22 
 arch/arm/plat-omap/include/plat/hardware.h|1 +
 arch/arm/plat-omap/include/plat/irqs-ti816x.h |  131 +
 arch/arm/plat-omap/include/plat/irqs.h|3 +
 arch/arm/plat-omap/include/plat/serial.h  |5 +
 arch/arm/plat-omap/include/plat/ti816x.h  |   31 ++
 10 files changed, 207 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 3e8c9e8..dd723d6 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -71,6 +71,17 @@ config ARCH_OMAP3430
default y
select ARCH_OMAP_OTG
 
+config SOC_OMAPTI816X
+   bool TI816X SoC family specific build of OMAP3
+   depends on ARCH_OMAP3
+   default n
+   help
+Select Y if you want a TI816X only build of OMAP3. This means the
+kernel built with this option may not boot on non TI816X OMAP3 SoCs.
+This restriction applies even for multi-omap builds. It is recommended
+to select N here if you wish to build a multi-omap kernel for booting
+on all OMAP3 based SoCs (including TI816X).
+
 config OMAP_PACKAGE_ZAF
bool
 
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index b19774c..f1e880c 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
 #define CK_3517(1  9)
 #define CK_36XX(1  10)   /* 36xx/37xx-specific clocks */
 #define CK_443X(1  11)
+#define CK_TI816X  (1  12)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0ada..d43e623 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -53,6 +53,7 @@ struct clkops {
 #define RATE_IN_3430ES2PLUS(1  3)/* 3430 ES = 2 rates only */
 #define RATE_IN_36XX   (1  4)
 #define RATE_IN_4430   (1  5)
+#define RATE_IN_TI816X (1  6)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 6b8088e..be5c5e8 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -63,6 +63,7 @@ void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 3fd8b40..c13bd90 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass (void)  \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07

[PATCH v4 3/4] TI816X: Create board support and enable build for TI816X EVM

2011-01-10 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI816X EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +++
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-ti8168evm.c |   58 +
 3 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index dd723d6..2ab6d2a 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -304,6 +304,11 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   depends on ARCH_OMAP3
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4ab82f6..86b05a3 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -219,6 +219,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..e175ca4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,58 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+};
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap_board_config = ti8168_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   omap34xx_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .init_machine   = ti8168_evm_init,
+   .timer  = omap_timer,
+MACHINE_END
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 4/4] TI816X: Add low level debug support

2011-01-10 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |3 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d413..e1b0f17 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -69,6 +69,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rp, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rp, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rp, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rp, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rp, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -91,6 +97,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rp, =ZOOM_UART_BASE
mrc p15, 0, \rv, c1, c0
tst \rv, #1 @ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index 3c3c319..4102bf4 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -86,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85..30b891c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/4] Introduce support for TI816X processor series

2011-01-03 Thread Hemant Pedanekar
This patch set adds support for TI816X processor series. This series includes
DM8168, C6A816x and AM389x devices. The details can be found at following links:

http://focus.ti.com/general/docs/gencontent.tsp?contentId=77960
http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This device is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific hwmods, clock data
and DMTIMER changes, are required to enable successful booting on TI816X EVM.
These patches will follow shortly.

This patch set adds TI816X support as part of OMAP3 variant. The approach taken
is in accordance to the discussions in thread related to following post:
http://www.spinics.net/lists/linux-omap/msg41505.html

Hemant Pedanekar (4):
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support and enable build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/mach-omap2/Kconfig|5 +
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   58 +++
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +-
 arch/arm/mach-omap2/common.c   |   24 +
 arch/arm/mach-omap2/control.h  |   17 +++
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 ++
 arch/arm/mach-omap2/include/mach/entry-macro.S |8 ++
 arch/arm/mach-omap2/io.c   |2 +-
 arch/arm/mach-omap2/irq.c  |5 +-
 arch/arm/mach-omap2/serial.c   |8 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/cpu.h  |   18 
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/irqs-ti816x.h  |  131 
 arch/arm/plat-omap/include/plat/irqs.h |3 +
 arch/arm/plat-omap/include/plat/serial.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   31 ++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 ++
 22 files changed, 371 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/4] TI816X: Update common OMAP machine specific sources

2011-01-03 Thread Hemant Pedanekar
This patch updates the common machine spcific source files with support for
TI816X.

Note1: At present, omap34xx_io_desc data is reused for mapping, but TI816X only
has L4 slow address in common with OMAP3 and thus using omap34xx data results
into creating mappings for reserved/incorrect regions except for L4.

Note2: The optimized irq macro for omap3 skips checking the 4th irq status
register but this needs to be added for TI816X (interrupts 96 to 127).
Presently, only the multi-omap irq macro (unoptimized) is updated to check the
4th status register.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++-
 arch/arm/mach-omap2/common.c   |   24 +
 arch/arm/mach-omap2/control.h  |   17 
 arch/arm/mach-omap2/id.c   |   33 ++-
 arch/arm/mach-omap2/include/mach/entry-macro.S |8 ++
 arch/arm/mach-omap2/io.c   |2 +-
 arch/arm/mach-omap2/irq.c  |5 +++-
 arch/arm/mach-omap2/serial.c   |8 +++---
 8 files changed, 93 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 9ab817e..557de99 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3466,6 +3466,9 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_omap3630()) {
cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
cpu_clkflg = CK_36XX;
+   } else if (cpu_is_ti816x()) {
+   cpu_mask = RATE_IN_TI816X;
+   cpu_clkflg = CK_TI816X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3545,7 +3548,7 @@ int __init omap3xxx_clk_init(void)
/*
 * Lock DPLL5 and put it in autoidle.
 */
-   if (omap_rev() = OMAP3430_REV_ES2_0)
+   if (!cpu_is_ti816x()  (omap_rev() = OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 778929f..7f58b7f 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -108,6 +108,30 @@ void __init omap3_map_io(void)
omap2_set_globals_3xxx();
omap34xx_map_common_io();
 }
+
+/*
+ * Adjust TAP register base such that omap3_check_revision accesses the correct
+ * TI816X register for checking device ID (it adds 0x204 to tap base while
+ * TI816X DEVICE ID register is at offset 0x600 from control base).
+ */
+#define TI816X_TAP_BASE(TI816X_CTRL_BASE + \
+   TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals ti816x_globals = {
+   .class  = OMAP343X_CLASS,
+   .tap= OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm = TI816X_PRCM_BASE,
+   .uart1_phys = TI816X_UART1_BASE,
+   .uart2_phys = TI816X_UART2_BASE,
+   .uart3_phys = TI816X_UART3_BASE,
+};
+
+void __init omap2_set_globals_ti816x(void)
+{
+   __omap2_set_globals(ti816x_globals);
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae..5c87054 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,11 @@
 #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
+/* TI816X spefic control submodules */
+#define TI816X_CONTROL_OCPCONF 0x000
+#define TI816X_CONTROL_DEVBOOT 0x040
+#define TI816X_CONTROL_DEVCONF 0x600
+
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
 
 #define OMAP2_CONTROL_SYSCONFIG(OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +246,18 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI816X CONTROL_DEVBOOT register offsets */
+#define TI816X_CONTROL_STATUS  (TI816X_CONTROL_DEVBOOT + 0x000)
+#define TI816X_CONTROL_BOOTSTAT(TI816X_CONTROL_DEVBOOT + 0x004)
+
+/* TI816X CONTROL_DEVCONF register offsets */
+#define TI816X_CONTROL_DEVICE_ID   (TI816X_CONTROL_DEVCONF + 0x000)
+#define TI816X_CONTROL_MAC_ID0_LO  (TI816X_CONTROL_DEVCONF + 0x030)
+#define TI816X_CONTROL_MAC_ID0_HI  (TI816X_CONTROL_DEVCONF + 0x034)
+#define TI816X_CONTROL_MAC_ID1_LO  (TI816X_CONTROL_DEVCONF + 0x038)
+#define TI816X_CONTROL_MAC_ID1_HI  (TI816X_CONTROL_DEVCONF + 0x03c)
+#define TI816X_CONTROL_PCIE_CFG(TI816X_CONTROL_DEVCONF + 0x040)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c

[PATCH v3 3/4] TI816X: Create board support and enable build for TI816X EVM

2011-01-03 Thread Hemant Pedanekar
This patch adds minimal support and build configuration for TI816X EVM.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |5 +++
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-ti8168evm.c |   58 +
 3 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 3e8c9e8..5ef2afa 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -293,6 +293,11 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   depends on ARCH_OMAP3
+   default y
+
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4ab82f6..86b05a3 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -219,6 +219,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)   += 
board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..e175ca4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,58 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+
+static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
+};
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap_board_config = ti8168_evm_config;
+   omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   omap34xx_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .init_machine   = ti8168_evm_init,
+   .timer  = omap_timer,
+MACHINE_END
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/4] TI816X: Update common omap platform files

2011-01-03 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X support. Also adds new
files for TI816X modules base addresseses and irq definitions.

The approach taken in this patch is to add TI816X as part of OMAP3 variant where
the cpu class is considered as OMAP34XX and the type is TI816X. This means, both
cpu_is_omap34xx() and cpu_is_ti816x() checks return success on TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/plat-omap/include/plat/clkdev_omap.h |1 +
 arch/arm/plat-omap/include/plat/clock.h   |1 +
 arch/arm/plat-omap/include/plat/common.h  |1 +
 arch/arm/plat-omap/include/plat/cpu.h |   18 
 arch/arm/plat-omap/include/plat/hardware.h|1 +
 arch/arm/plat-omap/include/plat/irqs-ti816x.h |  131 +
 arch/arm/plat-omap/include/plat/irqs.h|3 +
 arch/arm/plat-omap/include/plat/serial.h  |5 +
 arch/arm/plat-omap/include/plat/ti816x.h  |   31 ++
 9 files changed, 192 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h 
b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index b19774c..f1e880c 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
 #define CK_3517(1  9)
 #define CK_36XX(1  10)   /* 36xx/37xx-specific clocks */
 #define CK_443X(1  11)
+#define CK_TI816X  (1  12)
 
 
 #define CK_34XX(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h 
b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0ada..d43e623 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -53,6 +53,7 @@ struct clkops {
 #define RATE_IN_3430ES2PLUS(1  3)/* 3430 ES = 2 rates only */
 #define RATE_IN_36XX   (1  4)
 #define RATE_IN_4430   (1  5)
+#define RATE_IN_TI816X (1  6)
 
 #define RATE_IN_24XX   (RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX   (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/common.h 
b/arch/arm/plat-omap/include/plat/common.h
index 6b8088e..be5c5e8 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -63,6 +63,7 @@ void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 3fd8b40..539cd57 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass (void)  \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define cpu_is_omap15xx()  0
 #define cpu_is_omap16xx()  0
@@ -275,6 +283,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define cpu_is_omap3430()  0
 #define cpu_is_omap4430()  0
 #define cpu_is_omap3630()  0
+#define cpu_is_ti816x()0
 
 /*
  * Whether we have MULTI_OMAP1 or not, we still need to distinguish
@@ -330,6 +339,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3530
 # undef cpu_is_omap3505
 # undef cpu_is_omap3517
+# undef cpu_is_ti816x
 # define cpu_is_omap3430() is_omap3430()
 # define cpu_is_omap3503() (cpu_is_omap3430()\
(!omap3_has_iva())\
@@ -343,6 +353,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap3530() (cpu_is_omap3430())
 # define cpu_is_omap3505() is_omap3505()
 # define cpu_is_omap3517() is_omap3517()
+# define cpu_is_ti816x()   is_ti816x()
 # undef cpu_is_omap3630
 # define cpu_is_omap3630() is_omap363x()
 #endif
@@ -389,6 +400,10 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP3505_REV(v)(OMAP35XX_CLASS | (0x3505  16) | (v 
 8))
 #define OMAP3517_REV(v)(OMAP35XX_CLASS | (0x3517  16) | (v 
 8))
 
+#define TI816X_CLASS

[PATCH v3 4/4] TI816X: Add low level debug support

2011-01-03 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |3 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d413..e1b0f17 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -69,6 +69,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rp, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rp, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rp, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rp, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rp, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -91,6 +97,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rp, =ZOOM_UART_BASE
mrc p15, 0, \rv, c1, c0
tst \rv, #1 @ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index 3c3c319..4102bf4 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -86,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85..30b891c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/6] Introduce support for TI816X processor series

2010-08-11 Thread Hemant Pedanekar
This patch series adds support for TI816X processor series. First device in this
series is DM8168 and details can be found at:

http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This device is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific clock data and
DMTIMER changes, are required to enable successful booting on TI816X EVM. These
patches will follow shortly.

Hemant Pedanekar (6):
  TI816X: Create architecture macros and config entries
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support for TI816X_EVM
  TI816X: Enable Build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/Makefile  |1 +
 arch/arm/mach-omap2/Kconfig|   14 +++
 arch/arm/mach-omap2/Makefile   |2 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   58 +++
 arch/arm/mach-omap2/clockdomain.c  |   20 ++--
 arch/arm/mach-omap2/id.c   |   25 +
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 ++
 arch/arm/mach-omap2/include/mach/entry-macro.S |   44 -
 arch/arm/mach-omap2/io.c   |   21 -
 arch/arm/mach-omap2/irq.c  |4 +
 arch/arm/mach-omap2/serial.c   |3 +-
 arch/arm/plat-omap/Kconfig |2 +-
 arch/arm/plat-omap/common.c|   20 
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/control.h  |   23 
 arch/arm/plat-omap/include/plat/cpu.h  |   29 +-
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |   20 
 arch/arm/plat-omap/include/plat/irqs-ti816x.h  |  128 
 arch/arm/plat-omap/include/plat/irqs.h |3 +
 arch/arm/plat-omap/include/plat/multi.h|8 ++
 arch/arm/plat-omap/include/plat/serial.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   40 
 arch/arm/plat-omap/include/plat/uncompress.h   |7 ++
 arch/arm/plat-omap/io.c|7 ++
 27 files changed, 486 insertions(+), 17 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/6] TI816X: Create architecture macros and config entries

2010-08-11 Thread Hemant Pedanekar
This patch creates the architectural macros and configuration entries for
TI816X.

Also enables multi-omap build for TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig |6 ++
 arch/arm/plat-omap/Kconfig  |2 +-
 arch/arm/plat-omap/include/plat/cpu.h   |   29 -
 arch/arm/plat-omap/include/plat/multi.h |8 
 4 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b48bacf..3a91a10 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -44,6 +44,12 @@ config ARCH_OMAP4
select CPU_V7
select ARM_GIC
 
+config ARCH_TI816X
+   bool TI 816X
+   depends on ARCH_OMAP2PLUS
+   default y
+   select CPU_V7
+
 comment OMAP Core Type
depends on ARCH_OMAP2
 
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index e39a417..ad5a9cd 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -19,7 +19,7 @@ config ARCH_OMAP2PLUS
bool TI OMAP2/3/4
select COMMON_CLKDEV
help
- Systems based on omap24xx, omap34xx or omap44xx
+ Systems based on omap24xx, omap34xx, omap44xx or ti816x
 
 endchoice
 
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index 2e2ae53..08eb25b 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -89,6 +89,7 @@ unsigned int omap_rev(void);
  * cpu_is_omap243x():  True for OMAP2430
  * cpu_is_omap343x():  True for OMAP3430
  * cpu_is_omap443x():  True for OMAP4430
+ * cpu_is_ti816x():True for TI8168
  */
 #define GET_OMAP_CLASS (omap_rev()  0xff)
 
@@ -98,6 +99,12 @@ static inline int is_omap ##class (void) \
return (GET_OMAP_CLASS == (id)) ? 1 : 0;\
 }
 
+#define IS_TI_CLASS(class, id) \
+static inline int is_ti ##class(void)  \
+{  \
+   return (GET_OMAP_CLASS == (id)) ? 1 : 0;\
+}
+
 #define GET_OMAP_SUBCLASS  ((omap_rev()  20)  0x0fff)
 
 #define IS_OMAP_SUBCLASS(subclass, id) \
@@ -106,6 +113,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass(void)   \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -113,12 +126,16 @@ IS_OMAP_CLASS(24xx, 0x24)
 IS_OMAP_CLASS(34xx, 0x34)
 IS_OMAP_CLASS(44xx, 0x44)
 
+IS_TI_CLASS(81xx, 0x81)
+
 IS_OMAP_SUBCLASS(242x, 0x242)
 IS_OMAP_SUBCLASS(243x, 0x243)
 IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define cpu_is_omap15xx()  0
 #define cpu_is_omap16xx()  0
@@ -129,6 +146,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 #define cpu_is_omap343x()  0
 #define cpu_is_omap44xx()  0
 #define cpu_is_omap443x()  0
+#define cpu_is_ti816x()0
 
 #if defined(MULTI_OMAP1)
 # if defined(CONFIG_ARCH_OMAP730)
@@ -355,11 +373,16 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap443x() is_omap443x()
 # endif
 
+# if defined(CONFIG_ARCH_TI816X)
+# undef cpu_is_ti816x
+# define cpu_is_ti816x()   is_ti816x()
+# endif
+
 /* Macros to detect if we have OMAP1 or OMAP2 */
 #define cpu_class_is_omap1()   (cpu_is_omap7xx() || cpu_is_omap15xx() || \
cpu_is_omap16xx())
 #define cpu_class_is_omap2()   (cpu_is_omap24xx() || cpu_is_omap34xx() || \
-   cpu_is_omap44xx())
+   cpu_is_omap44xx() || cpu_is_ti816x())
 
 /* Various silicon revisions for omap2 */
 #define OMAP242X_CLASS 0x24200024
@@ -392,6 +415,9 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP443X_CLASS 0x44300044
 #define OMAP4430_REV_ES1_0 0x44300044
 
+#define TI816X_CLASS   0x81600081
+#define TI8168_REV_ES1_0   0x81600081
+
 /*
  * omap_chip bits
  *
@@ -417,6 +443,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define CHIP_IS_OMAP4430ES1(1  8)
 #define CHIP_IS_OMAP3630ES1_1   (1  9)
 #define CHIP_IS_OMAP3630ES1_2   (1  10)
+#define CHIP_IS_TI816X (1  11)
 
 #define CHIP_IS_OMAP24XX   (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
 
diff --git a/arch/arm/plat-omap/include/plat/multi.h 
b/arch/arm/plat-omap/include/plat/multi.h
index ffd909f..c9601f1 100644
--- a/arch/arm/plat-omap/include/plat/multi.h
+++ b/arch/arm/plat-omap/include/plat/multi.h
@@ -98,5 +98,13 @@
 #  define OMAP_NAME

[PATCH v2 3/6] TI816X: Update common OMAP machine specific sources

2010-08-11 Thread Hemant Pedanekar
This patch updates the common machine spcific source files with support for
TI816X.

Note that the nr_irqs is overridden in INTC driver since the number of IRQs on
TI816X are different (128) comapared to other OMAPs (96).

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clockdomain.c |   20 ++--
 arch/arm/mach-omap2/id.c  |   25 +
 arch/arm/mach-omap2/io.c  |   21 -
 arch/arm/mach-omap2/irq.c |4 
 arch/arm/mach-omap2/serial.c  |3 ++-
 5 files changed, 61 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomain.c 
b/arch/arm/mach-omap2/clockdomain.c
index 5d80cb8..d7d539d 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -1,5 +1,5 @@
 /*
- * OMAP2/3/4 clockdomain framework functions
+ * OMAP2/3/4 and TI816X clockdomain framework functions
  *
  * Copyright (C) 2008-2010 Texas Instruments, Inc.
  * Copyright (C) 2008-2010 Nokia Corporation
@@ -240,7 +240,7 @@ static void _omap2_clkdm_set_hwsup(struct clockdomain 
*clkdm, int enable)
bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;
else
bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO;
-   } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+   } else if (cpu_is_omap34xx() || cpu_is_omap44xx() || cpu_is_ti816x()) {
if (enable)
bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;
else
@@ -812,7 +812,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
clkdm-pwrdm.ptr-prcm_offs, OMAP2_PM_PWSTCTRL);
 
-   } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+   } else if (cpu_is_omap34xx() || cpu_is_omap44xx() || cpu_is_ti816x()) {
 
u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP 
 __ffs(clkdm-clktrctrl_mask));
@@ -856,7 +856,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
  clkdm-pwrdm.ptr-prcm_offs, OMAP2_PM_PWSTCTRL);
 
-   } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+   } else if (cpu_is_omap34xx() || cpu_is_omap44xx() || cpu_is_ti816x()) {
 
u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 
 __ffs(clkdm-clktrctrl_mask));
@@ -899,10 +899,10 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
 
/*
 * XXX This should be removed once TI adds wakeup/sleep
-* dependency code and data for OMAP4.
+* dependency code and data for OMAP4, TI816X
 */
-   if (cpu_is_omap44xx()) {
-   WARN_ONCE(1, clockdomain: OMAP4 wakeup/sleep dependency 
+   if (cpu_is_omap44xx() || cpu_is_ti816x()) {
+   WARN_ONCE(1, clockdomain: wakeup/sleep dependency 
  support is not yet implemented\n);
} else {
if (atomic_read(clkdm-usecount)  0)
@@ -941,10 +941,10 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
 
/*
 * XXX This should be removed once TI adds wakeup/sleep
-* dependency code and data for OMAP4.
+* dependency code and data for OMAP4, TI816X.
 */
-   if (cpu_is_omap44xx()) {
-   WARN_ONCE(1, clockdomain: OMAP4 wakeup/sleep dependency 
+   if (cpu_is_omap44xx() || cpu_is_ti816x()) {
+   WARN_ONCE(1, clockdomain: wakeup/sleep dependency 
  support is not yet implemented\n);
} else {
if (atomic_read(clkdm-usecount)  0)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 9a879f9..ca0779a 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -61,6 +61,8 @@ int omap_type(void)
val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
} else if (cpu_is_omap44xx()) {
val = omap_ctrl_readl(OMAP44XX_CONTROL_STATUS);
+   } else if (cpu_is_ti816x()) {
+   val = omap_ctrl_readl(TI816X_CONTROL_STATUS);
} else {
pr_err(Cannot detect omap type!\n);
goto out;
@@ -319,6 +321,26 @@ static void __init omap4_check_revision(void)
pr_err(Unknown OMAP4 CPU id\n);
 }
 
+void __init ti816x_check_revision(void)
+{
+   u32 idcode;
+   u16 partnum;
+   u8 rev;
+
+   idcode = read_tap_reg(TI816X_CONTROL_DEVICE_ID);
+   partnum = (idcode  12)  0x;
+   rev = (idcode  28)  0xff;
+
+   if ((partnum == 0xb81e)  (rev == 0x0)) {
+   omap_revision = TI8168_REV_ES1_0;
+   omap_chip.oc |= CHIP_IS_TI816X;
+   pr_info(OMAP chip is TI8168\n);
+   return;
+   }
+
+   pr_err(Unknown TI816X CPU id\n);
+}
+
 #define OMAP3_SHOW_FEATURE(feat)   \
if (omap3_has_ ##feat

[PATCH v2 4/6] TI816X: Create board support for TI816X_EVM

2010-08-11 Thread Hemant Pedanekar
This patch adds minimal support for TI816X EVM to enable kernel boot.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |8 
 arch/arm/mach-omap2/board-ti8168evm.c |   58 +
 2 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 3a91a10..75bb208 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -249,6 +249,14 @@ config MACH_OMAP4_PANDA
default y
depends on ARCH_OMAP4
 
+comment TI816X Board Type
+   depends on ARCH_TI816X
+
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   default y
+   depends on ARCH_TI816X
+
 config OMAP3_EMU
bool OMAP3 debugging peripherals
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..406bdbd
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,58 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/board.h
+#include plat/common.h
+#include plat/timer-gp.h
+
+static void __init ti8168_evm_init_irq(void)
+{
+   /* Timer1 is reserved on TI816X so skip to first available */
+   omap2_gp_clockevent_set_gptimer(2);
+
+   omap2_init_common_hw(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   ti816x_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .phys_io= 0x4800,
+   .io_pg_offst= ((0xfa00)  18)  0xfffc,
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .init_machine   = ti8168_evm_init,
+   .timer  = omap_timer,
+MACHINE_END
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 5/6] TI816X: Enable Build for TI816X EVM

2010-08-11 Thread Hemant Pedanekar
This patch adds build support for TI816X. This enables building files in
mach-omap2 and plat-omap directories.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/Makefile|1 +
 arch/arm/mach-omap2/Makefile |2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 63d998e..8a089a5 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -179,6 +179,7 @@ machine-$(CONFIG_ARCH_SHARK):= shark
 machine-$(CONFIG_ARCH_SHMOBILE):= shmobile
 machine-$(CONFIG_ARCH_STMP378X):= stmp378x
 machine-$(CONFIG_ARCH_STMP37XX):= stmp37xx
+machine-$(CONFIG_ARCH_TI816X)  := omap2
 machine-$(CONFIG_ARCH_U300):= u300
 machine-$(CONFIG_ARCH_U8500)   := ux500
 machine-$(CONFIG_ARCH_VERSATILE)   := versatile
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 63b2d88..380aa7c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -16,6 +16,7 @@ clock-common  = clock.o 
clock_common_data.o \
 obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) $(hwmod-common)
+obj-$(CONFIG_ARCH_TI816X) += $(omap-2-3-common) $(prcm-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 
@@ -158,6 +159,7 @@ obj-$(CONFIG_MACH_OMAP3517EVM)  += 
board-am3517evm.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 6/6] TI816X: Add low level debug support

2010-08-11 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |3 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 09331bb..992411f 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -66,6 +66,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rx, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rx, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rx, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rx, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rx, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -88,6 +94,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rx, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rx, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rx, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rx, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rx, =ZOOM_UART_BASE
mrc p15, 0, \tmp, c1, c0
tst \tmp, #1@ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index ad8d0d8..ef8a57a 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -86,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ddf723b..48a0d8c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -158,6 +162,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/6] Introduce support for TI816X processor series

2010-07-30 Thread Hemant Pedanekar
This patch series adds support for TI816X processor series. First device in this
series is DM8168 and details can be found at:

http://www.ti.com/ww/en/dsp/davinci-netra/index.shtml

This device is architecturally closer to the OMAP devices. Hence, these patches
are being submitted on linux-omap.

These patches are tested on OMAP3 EVM with multi-omap build.

Note that, additional patches consisting of TI816X specific clock data and
DMTIMER changes, are required to enable successful booting on TI816X EVM. These
patches will follow shortly.

Hemant Pedanekar (6):
  TI816X: Create architecture macros and config entries
  TI816X: Update common omap platform files
  TI816X: Update common OMAP machine specific sources
  TI816X: Create board support for TI816X_EVM
  TI816X: Enable Build for TI816X EVM
  TI816X: Add low level debug support

 arch/arm/Makefile  |1 +
 arch/arm/mach-omap2/Kconfig|   14 +++
 arch/arm/mach-omap2/Makefile   |2 +
 arch/arm/mach-omap2/board-ti8168evm.c  |   71 +
 arch/arm/mach-omap2/clockdomain.c  |   18 ++--
 arch/arm/mach-omap2/id.c   |   25 +
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 ++
 arch/arm/mach-omap2/include/mach/entry-macro.S |   44 -
 arch/arm/mach-omap2/io.c   |   21 -
 arch/arm/mach-omap2/irq.c  |4 +
 arch/arm/mach-omap2/serial.c   |3 +-
 arch/arm/plat-omap/Kconfig |2 +-
 arch/arm/plat-omap/common.c|   20 
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/control.h  |   23 
 arch/arm/plat-omap/include/plat/cpu.h  |   29 +-
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |   20 
 arch/arm/plat-omap/include/plat/irqs-ti816x.h  |  128 
 arch/arm/plat-omap/include/plat/irqs.h |3 +
 arch/arm/plat-omap/include/plat/multi.h|8 ++
 arch/arm/plat-omap/include/plat/serial.h   |8 ++
 arch/arm/plat-omap/include/plat/ti816x.h   |   40 
 arch/arm/plat-omap/include/plat/uncompress.h   |7 ++
 arch/arm/plat-omap/io.c|7 ++
 27 files changed, 498 insertions(+), 16 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] TI816X: Create architecture macros and config entries

2010-07-30 Thread Hemant Pedanekar
This patch creates the architectural macros and configuration entries for
TI816X.

Also enables multi-omap build for TI816X.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig |6 ++
 arch/arm/plat-omap/Kconfig  |2 +-
 arch/arm/plat-omap/include/plat/cpu.h   |   29 -
 arch/arm/plat-omap/include/plat/multi.h |8 
 4 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b48bacf..3a91a10 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -44,6 +44,12 @@ config ARCH_OMAP4
select CPU_V7
select ARM_GIC
 
+config ARCH_TI816X
+   bool TI 816X
+   depends on ARCH_OMAP2PLUS
+   default y
+   select CPU_V7
+
 comment OMAP Core Type
depends on ARCH_OMAP2
 
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index e2ed952..1844da6 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -19,7 +19,7 @@ config ARCH_OMAP2PLUS
bool TI OMAP2/3/4
select COMMON_CLKDEV
help
- Systems based on omap24xx, omap34xx or omap44xx
+ Systems based on omap24xx, omap34xx, omap44xx or ti816x
 
 endchoice
 
diff --git a/arch/arm/plat-omap/include/plat/cpu.h 
b/arch/arm/plat-omap/include/plat/cpu.h
index aa2f4f0..a7d99ad 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -87,6 +87,7 @@ unsigned int omap_rev(void);
  * cpu_is_omap243x():  True for OMAP2430
  * cpu_is_omap343x():  True for OMAP3430
  * cpu_is_omap443x():  True for OMAP4430
+ * cpu_is_ti816x():True for TI8168
  */
 #define GET_OMAP_CLASS (omap_rev()  0xff)
 
@@ -96,6 +97,12 @@ static inline int is_omap ##class (void) \
return (GET_OMAP_CLASS == (id)) ? 1 : 0;\
 }
 
+#define IS_TI_CLASS(class, id) \
+static inline int is_ti ##class(void)  \
+{  \
+   return (GET_OMAP_CLASS == (id)) ? 1 : 0;\
+}
+
 #define GET_OMAP_SUBCLASS  ((omap_rev()  20)  0x0fff)
 
 #define IS_OMAP_SUBCLASS(subclass, id) \
@@ -104,6 +111,12 @@ static inline int is_omap ##subclass (void)
\
return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
 }
 
+#define IS_TI_SUBCLASS(subclass, id)   \
+static inline int is_ti ##subclass(void)   \
+{  \
+   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
@@ -111,12 +124,16 @@ IS_OMAP_CLASS(24xx, 0x24)
 IS_OMAP_CLASS(34xx, 0x34)
 IS_OMAP_CLASS(44xx, 0x44)
 
+IS_TI_CLASS(81xx, 0x81)
+
 IS_OMAP_SUBCLASS(242x, 0x242)
 IS_OMAP_SUBCLASS(243x, 0x243)
 IS_OMAP_SUBCLASS(343x, 0x343)
 IS_OMAP_SUBCLASS(363x, 0x363)
 IS_OMAP_SUBCLASS(443x, 0x443)
 
+IS_TI_SUBCLASS(816x, 0x816)
+
 #define cpu_is_omap7xx()   0
 #define cpu_is_omap15xx()  0
 #define cpu_is_omap16xx()  0
@@ -127,6 +144,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 #define cpu_is_omap343x()  0
 #define cpu_is_omap44xx()  0
 #define cpu_is_omap443x()  0
+#define cpu_is_ti816x()0
 
 #if defined(MULTI_OMAP1)
 # if defined(CONFIG_ARCH_OMAP730)
@@ -353,11 +371,16 @@ IS_OMAP_TYPE(3517, 0x3517)
 # define cpu_is_omap443x() is_omap443x()
 # endif
 
+# if defined(CONFIG_ARCH_TI816X)
+# undef cpu_is_ti816x
+# define cpu_is_ti816x()   is_ti816x()
+# endif
+
 /* Macros to detect if we have OMAP1 or OMAP2 */
 #define cpu_class_is_omap1()   (cpu_is_omap7xx() || cpu_is_omap15xx() || \
cpu_is_omap16xx())
 #define cpu_class_is_omap2()   (cpu_is_omap24xx() || cpu_is_omap34xx() || \
-   cpu_is_omap44xx())
+   cpu_is_omap44xx() || cpu_is_ti816x())
 
 /* Various silicon revisions for omap2 */
 #define OMAP242X_CLASS 0x24200024
@@ -388,6 +411,9 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP443X_CLASS 0x44300044
 #define OMAP4430_REV_ES1_0 0x44300044
 
+#define TI816X_CLASS   0x81600081
+#define TI8168_REV_ES1_0   0x81600081
+
 /*
  * omap_chip bits
  *
@@ -411,6 +437,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define CHIP_IS_OMAP3430ES3_1  (1  6)
 #define CHIP_IS_OMAP3630ES1(1  7)
 #define CHIP_IS_OMAP4430ES1(1  8)
+#define CHIP_IS_TI816X (1  9)
 
 #define CHIP_IS_OMAP24XX   (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
 
diff --git a/arch/arm/plat-omap/include/plat/multi.h 
b/arch/arm/plat-omap/include/plat/multi.h
index ffd909f..c9601f1 100644
--- a/arch/arm/plat-omap/include/plat/multi.h
+++ b/arch/arm/plat-omap/include/plat/multi.h
@@ -98,5 +98,13 @@
 #  define OMAP_NAME omap4

[PATCH 2/6] TI816X: Update common omap platform files

2010-07-30 Thread Hemant Pedanekar
This patch updates the common platform files with TI816X specific additions.

Also adds new files for TI816X modules base addresseses and irq definitions.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/include/mach/entry-macro.S |   44 -
 arch/arm/plat-omap/common.c|   20 
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |1 +
 arch/arm/plat-omap/include/plat/clock.h|1 +
 arch/arm/plat-omap/include/plat/common.h   |1 +
 arch/arm/plat-omap/include/plat/control.h  |   23 
 arch/arm/plat-omap/include/plat/hardware.h |1 +
 arch/arm/plat-omap/include/plat/io.h   |   20 
 arch/arm/plat-omap/include/plat/irqs-ti816x.h  |  128 
 arch/arm/plat-omap/include/plat/irqs.h |3 +
 arch/arm/plat-omap/include/plat/serial.h   |5 +
 arch/arm/plat-omap/include/plat/ti816x.h   |   40 
 arch/arm/plat-omap/io.c|7 ++
 13 files changed, 291 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-ti816x.h
 create mode 100644 arch/arm/plat-omap/include/plat/ti816x.h

diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S 
b/arch/arm/mach-omap2/include/mach/entry-macro.S
index 50fd749..6516cbd 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -34,7 +34,7 @@
.endm
 
 /*
- * Unoptimized irq functions for multi-omap2, 3 and 4
+ * Unoptimized irq functions for multi-omap2, 3, 4 and ti816x
  */
 
 #ifdef MULTI_OMAP2
@@ -57,7 +57,8 @@ omap_irq_base:.word   0
mrc p15, 0, \tmp, c0, c0, 0 @ get processor revision
and \tmp, \tmp, #0x00f0 @ check cortex 8 or 9
cmp \tmp, #0x0080   @ cortex A-8?
-   beq 3400f   @ found A-8 so it's omap34xx
+   beq 3400f   @ found A-8 so it's omap34xx or
+   @ ti816x
cmp \tmp, #0x0090   @ cortex A-9?
beq 4400f   @ found A-9 so it's omap44xx
 2400:  ldr \base, =OMAP2_IRQ_BASE
@@ -80,7 +81,7 @@ omap_irq_base:.word   0
tst \base, #0x100   @ gic address?
bne 4401f   @ found gic
 
-   /* Handle omap2 and omap3 */
+   /* Handle omap2, omap3 and ti816x */
ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
cmp \irqnr, #0x0
bne 9998f
@@ -89,6 +90,14 @@ omap_irq_base:   .word   0
bne 9998f
ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
cmp \irqnr, #0x0
+   bne 9998f
+
+   /*
+* ti816x has additional IRQ pending register. Checking this
+* register on omap2  omap3 has no effect (read as 0).
+*/
+   ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
+   cmp \irqnr, #0x0
 9998:
ldrne   \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits 
*/
@@ -139,6 +148,35 @@ omap_irq_base: .word   0
.endm
 #endif
 
+/*
+ * Optimized irq functions for ti816x
+ */
+
+#ifdef CONFiG_ARCH_TI816X
+   .macro  get_irqnr_preamble, base, tmp
+   ldr \base, =OMAP3_IRQ_BASE
+   .endm
+
+   /* Check the pending interrupts. Note that base already set */
+   .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
+   ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
+   cmp \irqnr, #0x0
+   bne f
+   ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
+   cmp \irqnr, #0x0
+   bne f
+   ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
+   cmp \irqnr, #0x0
+   bne f
+   ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
+   cmp \irqnr, #0x0
+:
+   ldrne   \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
+   and \irqnr, \irqnr, #ACTIVEIRQ_MASK
+
+   .endm
+#endif
+
 
 #ifdef CONFIG_ARCH_OMAP4
 
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 893a53a..053bddb 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -355,3 +355,23 @@ void __init omap2_set_globals_443x(void)
 }
 #endif
 
+#if defined(CONFIG_ARCH_TI816X)
+static struct omap_globals ti816x_globals = {
+   .class  = TI816X_CLASS,
+   .tap= TI816X_L4_SLOW_IO_ADDRESS(TI816X_SCM_BASE),
+   .ctrl   = TI816X_CTRL_BASE,
+   .prm= TI816X_PRCM_BASE,
+   .cm

[PATCH 3/6] TI816X: Update common OMAP machine specific sources

2010-07-30 Thread Hemant Pedanekar
This patch updates the common machine spcific source files with support for
TI816X.

Note that the nr_irqs is overridden in INTC driver since the number of IRQs on
TI816X are different (128) comapared to other OMAPs (96).

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/clockdomain.c |   18 +-
 arch/arm/mach-omap2/id.c  |   25 +
 arch/arm/mach-omap2/io.c  |   21 -
 arch/arm/mach-omap2/irq.c |4 
 arch/arm/mach-omap2/serial.c  |3 ++-
 5 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomain.c 
b/arch/arm/mach-omap2/clockdomain.c
index 5d80cb8..35d2f21 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -1,5 +1,5 @@
 /*
- * OMAP2/3/4 clockdomain framework functions
+ * OMAP2/3/4 and TI816X clockdomain framework functions
  *
  * Copyright (C) 2008-2010 Texas Instruments, Inc.
  * Copyright (C) 2008-2010 Nokia Corporation
@@ -240,7 +240,7 @@ static void _omap2_clkdm_set_hwsup(struct clockdomain 
*clkdm, int enable)
bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;
else
bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO;
-   } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+   } else if (cpu_is_omap34xx() || cpu_is_omap44xx() || cpu_is_ti816x()) {
if (enable)
bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;
else
@@ -812,7 +812,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
clkdm-pwrdm.ptr-prcm_offs, OMAP2_PM_PWSTCTRL);
 
-   } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+   } else if (cpu_is_omap34xx() || cpu_is_omap44xx() || cpu_is_ti816x()) {
 
u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP 
 __ffs(clkdm-clktrctrl_mask));
@@ -856,7 +856,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
  clkdm-pwrdm.ptr-prcm_offs, OMAP2_PM_PWSTCTRL);
 
-   } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+   } else if (cpu_is_omap34xx() || cpu_is_omap44xx() || cpu_is_ti816x()) {
 
u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 
 __ffs(clkdm-clktrctrl_mask));
@@ -899,10 +899,10 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
 
/*
 * XXX This should be removed once TI adds wakeup/sleep
-* dependency code and data for OMAP4.
+* dependency code and data for OMAP4, TI816X
 */
-   if (cpu_is_omap44xx()) {
-   WARN_ONCE(1, clockdomain: OMAP4 wakeup/sleep dependency 
+   if (cpu_is_omap44xx() || cpu_is_ti816x()) {
+   WARN_ONCE(1, clockdomain: wakeup/sleep dependency 
  support is not yet implemented\n);
} else {
if (atomic_read(clkdm-usecount)  0)
@@ -941,9 +941,9 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
 
/*
 * XXX This should be removed once TI adds wakeup/sleep
-* dependency code and data for OMAP4.
+* dependency code and data for OMAP4, TI816X.
 */
-   if (cpu_is_omap44xx()) {
+   if (cpu_is_omap44xx() || cpu_is_ti816x()) {
WARN_ONCE(1, clockdomain: OMAP4 wakeup/sleep dependency 
  support is not yet implemented\n);
} else {
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 16dbb9e..66ad235 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -61,6 +61,8 @@ int omap_type(void)
val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
} else if (cpu_is_omap44xx()) {
val = omap_ctrl_readl(OMAP44XX_CONTROL_STATUS);
+   } else if (cpu_is_ti816x()) {
+   val = omap_ctrl_readl(TI816X_CONTROL_STATUS);
} else {
pr_err(Cannot detect omap type!\n);
goto out;
@@ -303,6 +305,26 @@ void __init omap4_check_revision(void)
pr_err(Unknown OMAP4 CPU id\n);
 }
 
+void __init ti816x_check_revision(void)
+{
+   u32 idcode;
+   u16 partnum;
+   u8 rev;
+
+   idcode = read_tap_reg(TI816X_CONTROL_DEVICE_ID);
+   partnum = (idcode  12)  0x;
+   rev = (idcode  28)  0xff;
+
+   if ((partnum == 0xb81e)  (rev == 0x0)) {
+   omap_revision = TI8168_REV_ES1_0;
+   omap_chip.oc |= CHIP_IS_TI816X;
+   pr_info(OMAP chip is TI8168\n);
+   return;
+   }
+
+   pr_err(Unknown TI816X CPU id\n);
+}
+
 #define OMAP3_SHOW_FEATURE(feat)   \
if (omap3_has_ ##feat())\
printk(#feat );
@@ -397,6 +419,9 @@ void __init omap2_check_revision(void)
} else if (cpu_is_omap44xx

[PATCH 4/6] TI816X: Create board support for TI816X_EVM

2010-07-30 Thread Hemant Pedanekar
This patch adds minimal support for TI816X EVM to enable kernel boot.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |8 
 arch/arm/mach-omap2/board-ti8168evm.c |   71 +
 2 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-ti8168evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 3a91a10..75bb208 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -249,6 +249,14 @@ config MACH_OMAP4_PANDA
default y
depends on ARCH_OMAP4
 
+comment TI816X Board Type
+   depends on ARCH_TI816X
+
+config MACH_TI8168EVM
+   bool TI8168 Evaluation Module
+   default y
+   depends on ARCH_TI816X
+
 config OMAP3_EMU
bool OMAP3 debugging peripherals
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c 
b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000..2271624
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,71 @@
+/*
+ * Code for TI8168 EVM.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/device.h
+#include linux/spi/spi.h
+#include linux/spi/flash.h
+#include linux/platform_device.h
+#include linux/gpio.h
+#include linux/i2c.h
+#include linux/i2c/pcf857x.h
+#include linux/i2c/at24.h
+#include linux/mtd/mtd.h
+#include linux/mtd/nand.h
+#include linux/mtd/partitions.h
+#include linux/mtd/physmap.h
+#include linux/phy.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/irqs.h
+#include plat/mux.h
+#include plat/board.h
+#include plat/common.h
+#include plat/timer-gp.h
+
+static void __init ti8168_evm_init_irq(void)
+{
+   omap2_gp_clockevent_set_gptimer(2);
+   omap2_init_common_hw(NULL, NULL);
+   omap_init_irq();
+}
+
+static void __init ti8168_evm_init(void)
+{
+   omap_serial_init();
+}
+
+
+static void __init ti8168_evm_map_io(void)
+{
+   omap2_set_globals_ti816x();
+   ti816x_map_common_io();
+}
+
+MACHINE_START(TI8168EVM, ti8168evm)
+   /* Maintainer: Texas Instruments */
+   .phys_io= 0x4800,
+   .io_pg_offst= ((0xfa00)  18)  0xfffc,
+   .boot_params= 0x8100,
+   .map_io = ti8168_evm_map_io,
+   .init_irq   = ti8168_evm_init_irq,
+   .init_machine   = ti8168_evm_init,
+   .timer  = omap_timer,
+MACHINE_END
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] TI816X: Enable Build for TI816X EVM

2010-07-30 Thread Hemant Pedanekar
This patch adds build support for TI816X. This enables building files in
mach-omap2 and plat-omap directories.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/Makefile|1 +
 arch/arm/mach-omap2/Makefile |2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 64ba313..46ef3c9 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -175,6 +175,7 @@ machine-$(CONFIG_ARCH_SHARK):= shark
 machine-$(CONFIG_ARCH_SHMOBILE):= shmobile
 machine-$(CONFIG_ARCH_STMP378X):= stmp378x
 machine-$(CONFIG_ARCH_STMP37XX):= stmp37xx
+machine-$(CONFIG_ARCH_TI816X)  := omap2
 machine-$(CONFIG_ARCH_U300):= u300
 machine-$(CONFIG_ARCH_U8500)   := ux500
 machine-$(CONFIG_ARCH_VERSATILE)   := versatile
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f5b4ff4..07520f4 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -16,6 +16,7 @@ clock-common  = clock.o 
clock_common_data.o \
 obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) $(hwmod-common)
+obj-$(CONFIG_ARCH_TI816X) += $(omap-2-3-common) $(prcm-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 
@@ -152,6 +153,7 @@ obj-$(CONFIG_MACH_OMAP3517EVM)  += 
board-am3517evm.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
   hsmmc.o
+obj-$(CONFIG_MACH_TI8168EVM)   += board-ti8168evm.o
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)  := usb-fs.o
 obj-y  += $(usbfs-m) $(usbfs-y)
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/6] TI816X: Add low level debug support

2010-07-30 Thread Hemant Pedanekar
This patch adds support for low level debugging on TI816X boards. Currently the
support for UART3 console on TI816X EVM is added.

Signed-off-by: Hemant Pedanekar hema...@ti.com
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   12 
 arch/arm/plat-omap/include/plat/serial.h   |3 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |7 +++
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 35b2440..a25708e 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -66,6 +66,12 @@ omap_uart_lsr:   .word   0
beq 34f @ configure OMAP3UART4
cmp \rx, #OMAP4UART4@ only on 44xx
beq 44f @ configure OMAP4UART4
+   cmp \rx, #TI816XUART1   @ ti816x UART offsets different
+   beq 81f @ configure UART1
+   cmp \rx, #TI816XUART2   @ ti816x UART offsets different
+   beq 82f @ configure UART2
+   cmp \rx, #TI816XUART3   @ ti816x UART offsets different
+   beq 83f @ configure UART3
cmp \rx, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
 
@@ -88,6 +94,12 @@ omap_uart_lsr:   .word   0
b   98f
 44:mov \rx, #UART_OFFSET(OMAP4_UART4_BASE)
b   98f
+81:mov \rx, #UART_OFFSET(TI816X_UART1_BASE)
+   b   98f
+82:mov \rx, #UART_OFFSET(TI816X_UART2_BASE)
+   b   98f
+83:mov \rx, #UART_OFFSET(TI816X_UART3_BASE)
+   b   98f
 95:ldr \rx, =ZOOM_UART_BASE
ldr \tmp, =omap_uart_phys
str \rx, [\tmp, #0]
diff --git a/arch/arm/plat-omap/include/plat/serial.h 
b/arch/arm/plat-omap/include/plat/serial.h
index ad8d0d8..ef8a57a 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -86,6 +86,9 @@
 #define OMAP4UART2 OMAP2UART2
 #define OMAP4UART3 43
 #define OMAP4UART4 44
+#define TI816XUART181
+#define TI816XUART282
+#define TI816XUART383
 #define ZOOM_UART  95  /* Only on zoom2/3 */
 
 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h 
b/arch/arm/plat-omap/include/plat/uncompress.h
index ddf723b..48a0d8c 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
 #define DEBUG_LL_ZOOM(mach)\
_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
 
+#define DEBUG_LL_TI816X(p, mach)   \
+   _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+   TI816XUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
int port = 0;
@@ -158,6 +162,9 @@ static inline void __arch_decomp_setup(unsigned long 
arch_id)
DEBUG_LL_ZOOM(omap_zoom2);
DEBUG_LL_ZOOM(omap_zoom3);
 
+   /* TI8168 base boards using UART3 */
+   DEBUG_LL_TI816X(3, ti8168evm);
+
} while (0);
 }
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html