Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] ARM: tegra: make debug-macro.S work standalone
From: Stephen Warren @ 2012-10-02 19:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1349204866-21810-1-git-send-email-swarren@wwwdotorg.org>

From: Stephen Warren <swarren@nvidia.com>

Prior to this change, Tegra's debug-macro.S relied on uncompress.h having
determined which UART to use, and whether it was safe to use the UART
(i.e. is it not in reset, and clocked). This determination was
communicated from uncompress.h to debug-macro.S using a few bytes of
Tegra's IRAM (an on-SoC RAM). This had the disadvantage that uncompress.h
was a required part of the kernel boot process; booting a non-compressed
kernel would not allow earlyprintk to operate.

This change duplicates the UART selection and validation logic into
debug-macro.S so that the reliance on uncompress.h is removed.

This also helps out with single-zImage work, since there is currently no
support for using any uncompress with single-zImage.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/mach-tegra/common.c                   |    3 +-
 arch/arm/mach-tegra/include/mach/debug-macro.S |  151 ++++++++++++++++++++---
 arch/arm/mach-tegra/include/mach/irammap.h     |    9 --
 arch/arm/mach-tegra/include/mach/uncompress.h  |   13 --
 4 files changed, 133 insertions(+), 43 deletions(-)

diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 0913d1f..72ec650 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -44,13 +44,14 @@
  * kernel is loaded. The data is declared here rather than debug-macro.S so
  * that multiple inclusions of debug-macro.S point at the same data.
  */
-u32 tegra_uart_config[3] = {
+u32 tegra_uart_config[4] = {
 	/* Debug UART initialization required */
 	1,
 	/* Debug UART physical address */
 	0,
 	/* Debug UART virtual address */
 	0,
+	/* Scratch space for debug macro */
 };
 
 #ifdef CONFIG_OF
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
index 8ce0661..6ba3502 100644
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ b/arch/arm/mach-tegra/include/mach/debug-macro.S
@@ -27,7 +27,42 @@
 #include <linux/serial_reg.h>
 
 #include <mach/iomap.h>
-#include <mach/irammap.h>
+
+#define UART_SHIFT 2
+
+#define TEGRA_CLK_RST_DEVICES_L		(TEGRA_CLK_RESET_BASE + 0x04)
+#define TEGRA_CLK_RST_DEVICES_H		(TEGRA_CLK_RESET_BASE + 0x08)
+#define TEGRA_CLK_RST_DEVICES_U		(TEGRA_CLK_RESET_BASE + 0x0c)
+#define TEGRA_CLK_OUT_ENB_L		(TEGRA_CLK_RESET_BASE + 0x10)
+#define TEGRA_CLK_OUT_ENB_H		(TEGRA_CLK_RESET_BASE + 0x14)
+#define TEGRA_CLK_OUT_ENB_U		(TEGRA_CLK_RESET_BASE + 0x18)
+#define TEGRA_PMC_SCRATCH20		(TEGRA_PMC_BASE + 0xa0)
+#define TEGRA_APB_MISC_GP_HIDREV	(TEGRA_APB_MISC_BASE + 0x804)
+
+#define checkuart(rp, rv, lhu, bit, uart) \
+		/* Load address of CLK_RST register */ \
+		movw	rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \
+		movt	rp, #TEGRA_CLK_RST_DEVICES_##lhu >> 16 ; \
+		/* Load value from CLK_RST register */ \
+		ldr	rp, [rp, #0] ; \
+		/* Test UART's reset bit */ \
+		tst	rp, #(1 << bit) ; \
+		/* If set, can't use UART; jump to save no UART */ \
+		bne	90f ; \
+		/* Load address of CLK_OUT_ENB register */ \
+		movw	rp, #TEGRA_CLK_OUT_ENB_##lhu & 0xffff ; \
+		movt	rp, #TEGRA_CLK_OUT_ENB_##lhu >> 16 ; \
+		/* Load value from CLK_OUT_ENB register */ \
+		ldr	rp, [rp, #0] ; \
+		/* Test UART's clock enable bit */ \
+		tst	rp, #(1 << bit) ; \
+		/* If clear, can't use UART; jump to save no UART */ \
+		beq	90f ; \
+		/* Passed all tests, load address of UART registers */ \
+		movw	rp, #TEGRA_UART##uart##_BASE & 0xffff ; \
+		movt	rp, #TEGRA_UART##uart##_BASE >> 16 ; \
+		/* Jump to save UART address */ \
+		b 91f
 
 		.macro  addruart, rp, rv, tmp
 		adr	\rp, 99f		@ actual addr of 99f
@@ -36,22 +71,101 @@
 		ldr	\rp, [\rp, #4]		@ linked tegra_uart_config
 		sub	\tmp, \rp, \rv		@ actual tegra_uart_config
 		ldr	\rp, [\tmp]		@ Load tegra_uart_config
-		cmp	\rp, #1			@ needs intitialization?
+		cmp	\rp, #1			@ needs initialization?
 		bne	100f			@ no; go load the addresses
 		mov	\rv, #0			@ yes; record init is done
 		str	\rv, [\tmp]
-		mov	\rp, #TEGRA_IRAM_BASE	@ See if cookie is in IRAM
-		ldr	\rv, [\rp, #TEGRA_IRAM_DEBUG_UART_OFFSET]
-		movw	\rp, #TEGRA_IRAM_DEBUG_UART_COOKIE & 0xffff
-		movt	\rp, #TEGRA_IRAM_DEBUG_UART_COOKIE >> 16
-		cmp	\rv, \rp		@ Cookie present?
-		bne	100f			@ No, use default UART
-		mov	\rp, #TEGRA_IRAM_BASE	@ Load UART address from IRAM
-		ldr	\rv, [\rp, #TEGRA_IRAM_DEBUG_UART_OFFSET + 4]
-		str	\rv, [\tmp, #4]		@ Store in tegra_uart_phys
-		sub	\rv, \rv, #IO_APB_PHYS	@ Calculate virt address
+
+#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA
+		/* Check ODMDATA */
+10:		movw	\rp, #TEGRA_PMC_SCRATCH20 & 0xffff
+		movt	\rp, #TEGRA_PMC_SCRATCH20 >> 16
+		ldr	\rp, [\rp, #0]		@ Load PMC_SCRATCH20
+		ubfx	\rv, \rp, #18, #2	@ 19:18 are console type
+		cmp	\rv, #2			@ 2 and 3 mean DCC, UART
+		beq	11f			@ some boards swap the meaning
+		cmp	\rv, #3			@ so accept either
+		bne	90f
+11:		ubfx	\rv, \rp, #15, #3	@ 17:15 are UART ID
+		cmp	\rv, #0			@ UART 0?
+		beq	20f
+		cmp	\rv, #1			@ UART 1?
+		beq	21f
+		cmp	\rv, #2			@ UART 2?
+		beq	22f
+		cmp	\rv, #3			@ UART 3?
+		beq	23f
+		cmp	\rv, #4			@ UART 4?
+		beq	24f
+		b	90f			@ invalid
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTA) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART A validity */
+20:		checkuart(\rp, \rv, L, 6, A)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTB) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART B validity */
+21:		checkuart(\rp, \rv, L, 7, B)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTC) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART C validity */
+22:		checkuart(\rp, \rv, H, 23, C)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTD) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART D validity */
+23:		checkuart(\rp, \rv, U, 1, D)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTE) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART E validity */
+24:
+		checkuart(\rp, \rv, U, 2, E)
+#endif
+
+		/* No valid UART found */
+90:		mov	\rp, #0
+		/* fall through */
+
+		/* Record whichever UART we chose */
+91:		str	\rp, [\tmp, #4]		@ Store in tegra_uart_phys
+		cmp	\rp, #0			@ Valid UART address?
+		bne	92f			@ Yes, go process it
+		str	\rp, [\tmp, #8]		@ Store 0 in tegra_uart_phys
+		b	100f			@ Done
+92:		sub	\rv, \rp, #IO_APB_PHYS	@ Calculate virt address
 		add	\rv, \rv, #IO_APB_VIRT
 		str	\rv, [\tmp, #8]		@ Store in tegra_uart_virt
+		movw	\rv, #TEGRA_APB_MISC_GP_HIDREV & 0xffff
+		movt	\rv, #TEGRA_APB_MISC_GP_HIDREV >> 16
+		ldr	\rv, [\rv, #0]		@ Load HIDREV
+		ubfx	\rv, \rv, #8, #8	@ 15:8 are SoC version
+		cmp	\rv, #0x20		@ Tegra20?
+		moveq	\rv, #0x75		@ Tegra20 divisor
+		movne	\rv, #0xdd		@ Tegra30 divisor
+		str	\rv, [\tmp, #12]	@ Save divisor to scratch
+		/* uart[UART_LCR] = UART_LCR_WLEN8 | UART_LCR_DLAB; */
+		mov	\rv, #UART_LCR_WLEN8 | UART_LCR_DLAB
+		str	\rv, [\rp, #UART_LCR << UART_SHIFT]
+		/* uart[UART_DLL] = div & 0xff; */
+		ldr	\rv, [\tmp, #12]
+		and	\rv, \rv, #0xff
+		str	\rv, [\rp, #UART_DLL << UART_SHIFT]
+		/* uart[UART_DLM] = div >> 8; */
+		ldr	\rv, [\tmp, #12]
+		lsr	\rv, \rv, #8
+		str	\rv, [\rp, #UART_DLM << UART_SHIFT]
+		/* uart[UART_LCR] = UART_LCR_WLEN8; */
+		mov	\rv, #UART_LCR_WLEN8
+		str	\rv, [\rp, #UART_LCR << UART_SHIFT]
 		b	100f
 
 		.align
@@ -59,27 +173,24 @@
 		.word	tegra_uart_config
 		.ltorg
 
+		/* Load previously selected UART address */
 100:		ldr	\rp, [\tmp, #4]		@ Load tegra_uart_phys
 		ldr	\rv, [\tmp, #8]		@ Load tegra_uart_virt
 		.endm
 
-#define UART_SHIFT 2
-
 /*
  * Code below is swiped from <asm/hardware/debug-8250.S>, but add an extra
- * check to make sure that we aren't in the CONFIG_TEGRA_DEBUG_UART_NONE case.
- * We use the fact that all 5 valid UART addresses all have something in the
- * 2nd-to-lowest byte.
+ * check to make sure that the UART address is actually valid.
  */
 
 		.macro	senduart, rd, rx
-		tst	\rx, #0x0000ff00
+		cmp	\rx, #0
 		strneb	\rd, [\rx, #UART_TX << UART_SHIFT]
 1001:
 		.endm
 
 		.macro	busyuart, rd, rx
-		tst	\rx, #0x0000ff00
+		cmp	\rx, #0
 		beq	1002f
 1001:		ldrb	\rd, [\rx, #UART_LSR << UART_SHIFT]
 		and	\rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
@@ -90,7 +201,7 @@
 
 		.macro	waituart, rd, rx
 #ifdef FLOW_CONTROL
-		tst	\rx, #0x0000ff00
+		cmp	\rx, #0
 		beq	1002f
 1001:		ldrb	\rd, [\rx, #UART_MSR << UART_SHIFT]
 		tst	\rd, #UART_MSR_CTS
diff --git a/arch/arm/mach-tegra/include/mach/irammap.h b/arch/arm/mach-tegra/include/mach/irammap.h
index 0cbe632..501952a 100644
--- a/arch/arm/mach-tegra/include/mach/irammap.h
+++ b/arch/arm/mach-tegra/include/mach/irammap.h
@@ -23,13 +23,4 @@
 #define TEGRA_IRAM_RESET_HANDLER_OFFSET	0
 #define TEGRA_IRAM_RESET_HANDLER_SIZE	SZ_1K
 
-/*
- * These locations are written to by uncompress.h, and read by debug-macro.S.
- * The first word holds the cookie value if the data is valid. The second
- * word holds the UART physical address.
- */
-#define TEGRA_IRAM_DEBUG_UART_OFFSET	SZ_1K
-#define TEGRA_IRAM_DEBUG_UART_SIZE	8
-#define TEGRA_IRAM_DEBUG_UART_COOKIE	0x55415254
-
 #endif
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index d5b86ce..51ea92c 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -29,7 +29,6 @@
 #include <linux/serial_reg.h>
 
 #include <mach/iomap.h>
-#include <mach/irammap.h>
 
 #define BIT(x) (1 << (x))
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@ -52,17 +51,6 @@ static inline void flush(void)
 {
 }
 
-static inline void save_uart_address(void)
-{
-	u32 *buf = (u32 *)(TEGRA_IRAM_BASE + TEGRA_IRAM_DEBUG_UART_OFFSET);
-
-	if (uart) {
-		buf[0] = TEGRA_IRAM_DEBUG_UART_COOKIE;
-		buf[1] = (u32)uart;
-	} else
-		buf[0] = 0;
-}
-
 static const struct {
 	u32 base;
 	u32 reset_reg;
@@ -169,7 +157,6 @@ static inline void arch_decomp_setup(void)
 	else
 		uart = (volatile u8 *)uarts[uart_id].base;
 
-	save_uart_address();
 	if (uart == NULL)
 		return;
 
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH 3/3] ARM: tegra: move debug-macro.S to include/debug
From: Stephen Warren @ 2012-10-02 19:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1349204866-21810-1-git-send-email-swarren@wwwdotorg.org>

From: Stephen Warren <swarren@nvidia.com>

Move Tegra's debug-macro.S over to the common debug macro directory.

Move Tegra's debug UART selection menu into ARM's Kconfig.debug, so that
all related options are selected in the same place.

Tegra's uncompress.h is left in mach-tegra/include/mach; it will be
removed whenever Tegra is converted to multi-platform.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/Kconfig.debug                         |   39 +++++
 arch/arm/include/debug/tegra.S                 |  209 +++++++++++++++++++++++
 arch/arm/mach-tegra/Kconfig                    |   30 ----
 arch/arm/mach-tegra/include/mach/debug-macro.S |  211 ------------------------
 4 files changed, 248 insertions(+), 241 deletions(-)
 create mode 100644 arch/arm/include/debug/tegra.S
 delete mode 100644 arch/arm/mach-tegra/include/mach/debug-macro.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index b0f3857..18f9e57 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -345,6 +345,13 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on SOCFPGA based platforms.
 
+	config DEBUG_TEGRA_UART
+		depends on ARCH_TEGRA
+		bool "Use Tegra UART for low-level debug"
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on Tegra based platforms.
+
 	config DEBUG_VEXPRESS_UART0_DETECT
 		bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
 		depends on ARCH_VEXPRESS && CPU_CP15_MMU
@@ -409,6 +416,37 @@ choice
 
 endchoice
 
+choice
+	prompt "Low-level debug console UART"
+	depends on DEBUG_LL && DEBUG_TEGRA_UART
+	default TEGRA_DEBUG_UART_AUTO_ODMDATA
+
+	config TEGRA_DEBUG_UART_AUTO_ODMDATA
+		bool "Via ODMDATA"
+		help
+		  Automatically determines which UART to use for low-level debug based
+		  on the ODMDATA value. This value is part of the BCT, and is written
+		  to the boot memory device using nvflash, or other flashing tool.
+		  When bits 19:18 are 3, then bits 17:15 indicate which UART to use;
+		  0/1/2/3/4 are UART A/B/C/D/E.
+
+	config TEGRA_DEBUG_UARTA
+		bool "UART A"
+
+	config TEGRA_DEBUG_UARTB
+		bool "UART B"
+
+	config TEGRA_DEBUG_UARTC
+		bool "UART C"
+
+	config TEGRA_DEBUG_UARTD
+		bool "UART D"
+
+	config TEGRA_DEBUG_UARTE
+		bool "UART E"
+
+endchoice
+
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/icedcc.S" if DEBUG_ICEDCC
@@ -418,6 +456,7 @@ config DEBUG_LL_INCLUDE
 	default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
 	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
 		DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
+	default "debug/tegra.S" if DEBUG_TEGRA_UART
 	default "mach/debug-macro.S"
 
 config EARLY_PRINTK
diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S
new file mode 100644
index 0000000..e6aa4bc
--- /dev/null
+++ b/arch/arm/include/debug/tegra.S
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2010,2011 Google, Inc.
+ * Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved.
+ *
+ * Author:
+ *	Colin Cross <ccross@google.com>
+ *	Erik Gilling <konkers@google.com>
+ *	Doug Anderson <dianders@chromium.org>
+ *	Stephen Warren <swarren@nvidia.com>
+ *
+ * Portions based on mach-omap2's debug-macro.S
+ * Copyright (C) 1994-1999 Russell King
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/serial_reg.h>
+
+#include <mach/iomap.h>
+
+#define UART_SHIFT 2
+
+#define TEGRA_CLK_RST_DEVICES_L		(TEGRA_CLK_RESET_BASE + 0x04)
+#define TEGRA_CLK_RST_DEVICES_H		(TEGRA_CLK_RESET_BASE + 0x08)
+#define TEGRA_CLK_RST_DEVICES_U		(TEGRA_CLK_RESET_BASE + 0x0c)
+#define TEGRA_CLK_OUT_ENB_L		(TEGRA_CLK_RESET_BASE + 0x10)
+#define TEGRA_CLK_OUT_ENB_H		(TEGRA_CLK_RESET_BASE + 0x14)
+#define TEGRA_CLK_OUT_ENB_U		(TEGRA_CLK_RESET_BASE + 0x18)
+#define TEGRA_PMC_SCRATCH20		(TEGRA_PMC_BASE + 0xa0)
+#define TEGRA_APB_MISC_GP_HIDREV	(TEGRA_APB_MISC_BASE + 0x804)
+
+#define checkuart(rp, rv, lhu, bit, uart) \
+		/* Load address of CLK_RST register */ \
+		movw	rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \
+		movt	rp, #TEGRA_CLK_RST_DEVICES_##lhu >> 16 ; \
+		/* Load value from CLK_RST register */ \
+		ldr	rp, [rp, #0] ; \
+		/* Test UART's reset bit */ \
+		tst	rp, #(1 << bit) ; \
+		/* If set, can't use UART; jump to save no UART */ \
+		bne	90f ; \
+		/* Load address of CLK_OUT_ENB register */ \
+		movw	rp, #TEGRA_CLK_OUT_ENB_##lhu & 0xffff ; \
+		movt	rp, #TEGRA_CLK_OUT_ENB_##lhu >> 16 ; \
+		/* Load value from CLK_OUT_ENB register */ \
+		ldr	rp, [rp, #0] ; \
+		/* Test UART's clock enable bit */ \
+		tst	rp, #(1 << bit) ; \
+		/* If clear, can't use UART; jump to save no UART */ \
+		beq	90f ; \
+		/* Passed all tests, load address of UART registers */ \
+		movw	rp, #TEGRA_UART##uart##_BASE & 0xffff ; \
+		movt	rp, #TEGRA_UART##uart##_BASE >> 16 ; \
+		/* Jump to save UART address */ \
+		b 91f
+
+		.macro  addruart, rp, rv, tmp
+		adr	\rp, 99f		@ actual addr of 99f
+		ldr	\rv, [\rp]		@ linked addr is stored there
+		sub	\rv, \rv, \rp		@ offset between the two
+		ldr	\rp, [\rp, #4]		@ linked tegra_uart_config
+		sub	\tmp, \rp, \rv		@ actual tegra_uart_config
+		ldr	\rp, [\tmp]		@ Load tegra_uart_config
+		cmp	\rp, #1			@ needs initialization?
+		bne	100f			@ no; go load the addresses
+		mov	\rv, #0			@ yes; record init is done
+		str	\rv, [\tmp]
+
+#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA
+		/* Check ODMDATA */
+10:		movw	\rp, #TEGRA_PMC_SCRATCH20 & 0xffff
+		movt	\rp, #TEGRA_PMC_SCRATCH20 >> 16
+		ldr	\rp, [\rp, #0]		@ Load PMC_SCRATCH20
+		ubfx	\rv, \rp, #18, #2	@ 19:18 are console type
+		cmp	\rv, #2			@ 2 and 3 mean DCC, UART
+		beq	11f			@ some boards swap the meaning
+		cmp	\rv, #3			@ so accept either
+		bne	90f
+11:		ubfx	\rv, \rp, #15, #3	@ 17:15 are UART ID
+		cmp	\rv, #0			@ UART 0?
+		beq	20f
+		cmp	\rv, #1			@ UART 1?
+		beq	21f
+		cmp	\rv, #2			@ UART 2?
+		beq	22f
+		cmp	\rv, #3			@ UART 3?
+		beq	23f
+		cmp	\rv, #4			@ UART 4?
+		beq	24f
+		b	90f			@ invalid
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTA) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART A validity */
+20:		checkuart(\rp, \rv, L, 6, A)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTB) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART B validity */
+21:		checkuart(\rp, \rv, L, 7, B)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTC) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART C validity */
+22:		checkuart(\rp, \rv, H, 23, C)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTD) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART D validity */
+23:		checkuart(\rp, \rv, U, 1, D)
+#endif
+
+#if defined(CONFIG_TEGRA_DEBUG_UARTE) || \
+    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
+		/* Check UART E validity */
+24:
+		checkuart(\rp, \rv, U, 2, E)
+#endif
+
+		/* No valid UART found */
+90:		mov	\rp, #0
+		/* fall through */
+
+		/* Record whichever UART we chose */
+91:		str	\rp, [\tmp, #4]		@ Store in tegra_uart_phys
+		cmp	\rp, #0			@ Valid UART address?
+		bne	92f			@ Yes, go process it
+		str	\rp, [\tmp, #8]		@ Store 0 in tegra_uart_phys
+		b	100f			@ Done
+92:		sub	\rv, \rp, #IO_APB_PHYS	@ Calculate virt address
+		add	\rv, \rv, #IO_APB_VIRT
+		str	\rv, [\tmp, #8]		@ Store in tegra_uart_virt
+		movw	\rv, #TEGRA_APB_MISC_GP_HIDREV & 0xffff
+		movt	\rv, #TEGRA_APB_MISC_GP_HIDREV >> 16
+		ldr	\rv, [\rv, #0]		@ Load HIDREV
+		ubfx	\rv, \rv, #8, #8	@ 15:8 are SoC version
+		cmp	\rv, #0x20		@ Tegra20?
+		moveq	\rv, #0x75		@ Tegra20 divisor
+		movne	\rv, #0xdd		@ Tegra30 divisor
+		str	\rv, [\tmp, #12]	@ Save divisor to scratch
+		/* uart[UART_LCR] = UART_LCR_WLEN8 | UART_LCR_DLAB; */
+		mov	\rv, #UART_LCR_WLEN8 | UART_LCR_DLAB
+		str	\rv, [\rp, #UART_LCR << UART_SHIFT]
+		/* uart[UART_DLL] = div & 0xff; */
+		ldr	\rv, [\tmp, #12]
+		and	\rv, \rv, #0xff
+		str	\rv, [\rp, #UART_DLL << UART_SHIFT]
+		/* uart[UART_DLM] = div >> 8; */
+		ldr	\rv, [\tmp, #12]
+		lsr	\rv, \rv, #8
+		str	\rv, [\rp, #UART_DLM << UART_SHIFT]
+		/* uart[UART_LCR] = UART_LCR_WLEN8; */
+		mov	\rv, #UART_LCR_WLEN8
+		str	\rv, [\rp, #UART_LCR << UART_SHIFT]
+		b	100f
+
+		.align
+99:		.word	.
+		.word	tegra_uart_config
+		.ltorg
+
+		/* Load previously selected UART address */
+100:		ldr	\rp, [\tmp, #4]		@ Load tegra_uart_phys
+		ldr	\rv, [\tmp, #8]		@ Load tegra_uart_virt
+		.endm
+
+/*
+ * Code below is swiped from <asm/hardware/debug-8250.S>, but add an extra
+ * check to make sure that the UART address is actually valid.
+ */
+
+		.macro	senduart, rd, rx
+		cmp	\rx, #0
+		strneb	\rd, [\rx, #UART_TX << UART_SHIFT]
+1001:
+		.endm
+
+		.macro	busyuart, rd, rx
+		cmp	\rx, #0
+		beq	1002f
+1001:		ldrb	\rd, [\rx, #UART_LSR << UART_SHIFT]
+		and	\rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
+		teq	\rd, #UART_LSR_TEMT | UART_LSR_THRE
+		bne	1001b
+1002:
+		.endm
+
+		.macro	waituart, rd, rx
+#ifdef FLOW_CONTROL
+		cmp	\rx, #0
+		beq	1002f
+1001:		ldrb	\rd, [\rx, #UART_MSR << UART_SHIFT]
+		tst	\rd, #UART_MSR_CTS
+		beq	1001b
+1002:
+#endif
+		.endm
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 87f0e2d..6b23f23 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -57,36 +57,6 @@ config TEGRA_AHB
 	  which controls AHB bus master arbitration and some
 	  perfomance parameters(priority, prefech size).
 
-choice
-        prompt "Low-level debug console UART"
-        default TEGRA_DEBUG_UART_AUTO_ODMDATA
-
-config TEGRA_DEBUG_UART_AUTO_ODMDATA
-	bool "Via ODMDATA"
-	help
-	  Automatically determines which UART to use for low-level debug based
-	  on the ODMDATA value. This value is part of the BCT, and is written
-	  to the boot memory device using nvflash, or other flashing tool.
-	  When bits 19:18 are 3, then bits 17:15 indicate which UART to use;
-	  0/1/2/3/4 are UART A/B/C/D/E.
-
-config TEGRA_DEBUG_UARTA
-        bool "UART-A"
-
-config TEGRA_DEBUG_UARTB
-        bool "UART-B"
-
-config TEGRA_DEBUG_UARTC
-        bool "UART-C"
-
-config TEGRA_DEBUG_UARTD
-        bool "UART-D"
-
-config TEGRA_DEBUG_UARTE
-        bool "UART-E"
-
-endchoice
-
 config TEGRA_EMC_SCALING_ENABLE
 	bool "Enable scaling the memory frequency"
 
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
deleted file mode 100644
index 6ba3502..0000000
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * arch/arm/mach-tegra/include/mach/debug-macro.S
- *
- * Copyright (C) 2010,2011 Google, Inc.
- * Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved.
- *
- * Author:
- *	Colin Cross <ccross@google.com>
- *	Erik Gilling <konkers@google.com>
- *	Doug Anderson <dianders@chromium.org>
- *	Stephen Warren <swarren@nvidia.com>
- *
- * Portions based on mach-omap2's debug-macro.S
- * Copyright (C) 1994-1999 Russell King
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/serial_reg.h>
-
-#include <mach/iomap.h>
-
-#define UART_SHIFT 2
-
-#define TEGRA_CLK_RST_DEVICES_L		(TEGRA_CLK_RESET_BASE + 0x04)
-#define TEGRA_CLK_RST_DEVICES_H		(TEGRA_CLK_RESET_BASE + 0x08)
-#define TEGRA_CLK_RST_DEVICES_U		(TEGRA_CLK_RESET_BASE + 0x0c)
-#define TEGRA_CLK_OUT_ENB_L		(TEGRA_CLK_RESET_BASE + 0x10)
-#define TEGRA_CLK_OUT_ENB_H		(TEGRA_CLK_RESET_BASE + 0x14)
-#define TEGRA_CLK_OUT_ENB_U		(TEGRA_CLK_RESET_BASE + 0x18)
-#define TEGRA_PMC_SCRATCH20		(TEGRA_PMC_BASE + 0xa0)
-#define TEGRA_APB_MISC_GP_HIDREV	(TEGRA_APB_MISC_BASE + 0x804)
-
-#define checkuart(rp, rv, lhu, bit, uart) \
-		/* Load address of CLK_RST register */ \
-		movw	rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \
-		movt	rp, #TEGRA_CLK_RST_DEVICES_##lhu >> 16 ; \
-		/* Load value from CLK_RST register */ \
-		ldr	rp, [rp, #0] ; \
-		/* Test UART's reset bit */ \
-		tst	rp, #(1 << bit) ; \
-		/* If set, can't use UART; jump to save no UART */ \
-		bne	90f ; \
-		/* Load address of CLK_OUT_ENB register */ \
-		movw	rp, #TEGRA_CLK_OUT_ENB_##lhu & 0xffff ; \
-		movt	rp, #TEGRA_CLK_OUT_ENB_##lhu >> 16 ; \
-		/* Load value from CLK_OUT_ENB register */ \
-		ldr	rp, [rp, #0] ; \
-		/* Test UART's clock enable bit */ \
-		tst	rp, #(1 << bit) ; \
-		/* If clear, can't use UART; jump to save no UART */ \
-		beq	90f ; \
-		/* Passed all tests, load address of UART registers */ \
-		movw	rp, #TEGRA_UART##uart##_BASE & 0xffff ; \
-		movt	rp, #TEGRA_UART##uart##_BASE >> 16 ; \
-		/* Jump to save UART address */ \
-		b 91f
-
-		.macro  addruart, rp, rv, tmp
-		adr	\rp, 99f		@ actual addr of 99f
-		ldr	\rv, [\rp]		@ linked addr is stored there
-		sub	\rv, \rv, \rp		@ offset between the two
-		ldr	\rp, [\rp, #4]		@ linked tegra_uart_config
-		sub	\tmp, \rp, \rv		@ actual tegra_uart_config
-		ldr	\rp, [\tmp]		@ Load tegra_uart_config
-		cmp	\rp, #1			@ needs initialization?
-		bne	100f			@ no; go load the addresses
-		mov	\rv, #0			@ yes; record init is done
-		str	\rv, [\tmp]
-
-#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA
-		/* Check ODMDATA */
-10:		movw	\rp, #TEGRA_PMC_SCRATCH20 & 0xffff
-		movt	\rp, #TEGRA_PMC_SCRATCH20 >> 16
-		ldr	\rp, [\rp, #0]		@ Load PMC_SCRATCH20
-		ubfx	\rv, \rp, #18, #2	@ 19:18 are console type
-		cmp	\rv, #2			@ 2 and 3 mean DCC, UART
-		beq	11f			@ some boards swap the meaning
-		cmp	\rv, #3			@ so accept either
-		bne	90f
-11:		ubfx	\rv, \rp, #15, #3	@ 17:15 are UART ID
-		cmp	\rv, #0			@ UART 0?
-		beq	20f
-		cmp	\rv, #1			@ UART 1?
-		beq	21f
-		cmp	\rv, #2			@ UART 2?
-		beq	22f
-		cmp	\rv, #3			@ UART 3?
-		beq	23f
-		cmp	\rv, #4			@ UART 4?
-		beq	24f
-		b	90f			@ invalid
-#endif
-
-#if defined(CONFIG_TEGRA_DEBUG_UARTA) || \
-    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
-		/* Check UART A validity */
-20:		checkuart(\rp, \rv, L, 6, A)
-#endif
-
-#if defined(CONFIG_TEGRA_DEBUG_UARTB) || \
-    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
-		/* Check UART B validity */
-21:		checkuart(\rp, \rv, L, 7, B)
-#endif
-
-#if defined(CONFIG_TEGRA_DEBUG_UARTC) || \
-    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
-		/* Check UART C validity */
-22:		checkuart(\rp, \rv, H, 23, C)
-#endif
-
-#if defined(CONFIG_TEGRA_DEBUG_UARTD) || \
-    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
-		/* Check UART D validity */
-23:		checkuart(\rp, \rv, U, 1, D)
-#endif
-
-#if defined(CONFIG_TEGRA_DEBUG_UARTE) || \
-    defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
-		/* Check UART E validity */
-24:
-		checkuart(\rp, \rv, U, 2, E)
-#endif
-
-		/* No valid UART found */
-90:		mov	\rp, #0
-		/* fall through */
-
-		/* Record whichever UART we chose */
-91:		str	\rp, [\tmp, #4]		@ Store in tegra_uart_phys
-		cmp	\rp, #0			@ Valid UART address?
-		bne	92f			@ Yes, go process it
-		str	\rp, [\tmp, #8]		@ Store 0 in tegra_uart_phys
-		b	100f			@ Done
-92:		sub	\rv, \rp, #IO_APB_PHYS	@ Calculate virt address
-		add	\rv, \rv, #IO_APB_VIRT
-		str	\rv, [\tmp, #8]		@ Store in tegra_uart_virt
-		movw	\rv, #TEGRA_APB_MISC_GP_HIDREV & 0xffff
-		movt	\rv, #TEGRA_APB_MISC_GP_HIDREV >> 16
-		ldr	\rv, [\rv, #0]		@ Load HIDREV
-		ubfx	\rv, \rv, #8, #8	@ 15:8 are SoC version
-		cmp	\rv, #0x20		@ Tegra20?
-		moveq	\rv, #0x75		@ Tegra20 divisor
-		movne	\rv, #0xdd		@ Tegra30 divisor
-		str	\rv, [\tmp, #12]	@ Save divisor to scratch
-		/* uart[UART_LCR] = UART_LCR_WLEN8 | UART_LCR_DLAB; */
-		mov	\rv, #UART_LCR_WLEN8 | UART_LCR_DLAB
-		str	\rv, [\rp, #UART_LCR << UART_SHIFT]
-		/* uart[UART_DLL] = div & 0xff; */
-		ldr	\rv, [\tmp, #12]
-		and	\rv, \rv, #0xff
-		str	\rv, [\rp, #UART_DLL << UART_SHIFT]
-		/* uart[UART_DLM] = div >> 8; */
-		ldr	\rv, [\tmp, #12]
-		lsr	\rv, \rv, #8
-		str	\rv, [\rp, #UART_DLM << UART_SHIFT]
-		/* uart[UART_LCR] = UART_LCR_WLEN8; */
-		mov	\rv, #UART_LCR_WLEN8
-		str	\rv, [\rp, #UART_LCR << UART_SHIFT]
-		b	100f
-
-		.align
-99:		.word	.
-		.word	tegra_uart_config
-		.ltorg
-
-		/* Load previously selected UART address */
-100:		ldr	\rp, [\tmp, #4]		@ Load tegra_uart_phys
-		ldr	\rv, [\tmp, #8]		@ Load tegra_uart_virt
-		.endm
-
-/*
- * Code below is swiped from <asm/hardware/debug-8250.S>, but add an extra
- * check to make sure that the UART address is actually valid.
- */
-
-		.macro	senduart, rd, rx
-		cmp	\rx, #0
-		strneb	\rd, [\rx, #UART_TX << UART_SHIFT]
-1001:
-		.endm
-
-		.macro	busyuart, rd, rx
-		cmp	\rx, #0
-		beq	1002f
-1001:		ldrb	\rd, [\rx, #UART_LSR << UART_SHIFT]
-		and	\rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
-		teq	\rd, #UART_LSR_TEMT | UART_LSR_THRE
-		bne	1001b
-1002:
-		.endm
-
-		.macro	waituart, rd, rx
-#ifdef FLOW_CONTROL
-		cmp	\rx, #0
-		beq	1002f
-1001:		ldrb	\rd, [\rx, #UART_MSR << UART_SHIFT]
-		tst	\rd, #UART_MSR_CTS
-		beq	1001b
-1002:
-#endif
-		.endm
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH 1/2] ARM: tegra: fix invalid unit-address in tegra*.dtsi
From: Stephen Warren @ 2012-10-02 19:10 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

Unit addresses, whilst written in hex, don't contain a 0x prefix.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
A couple of small cleanups/tweaks for 3.7 if possible.

 arch/arm/boot/dts/tegra20-seaboard.dts |    2 +-
 arch/arm/boot/dts/tegra20.dtsi         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index e60dc71..f0ba901 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -539,7 +539,7 @@
 		nvidia,invert-interrupt;
 	};
 
-	memory-controller at 0x7000f400 {
+	memory-controller at 7000f400 {
 		emc-table at 190000 {
 			reg = <190000>;
 			compatible = "nvidia,tegra20-emc-table";
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 67a6cd9..f3a09d0 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -170,7 +170,7 @@
 		reg = <0x7000e400 0x400>;
 	};
 
-	memory-controller at 0x7000f000 {
+	memory-controller at 7000f000 {
 		compatible = "nvidia,tegra20-mc";
 		reg = <0x7000f000 0x024
 		       0x7000f03c 0x3c4>;
@@ -183,7 +183,7 @@
 		       0x58000000 0x02000000>;	/* GART aperture */
 	};
 
-	memory-controller at 0x7000f400 {
+	memory-controller at 7000f400 {
 		compatible = "nvidia,tegra20-emc";
 		reg = <0x7000f400 0x200>;
 		#address-cells = <1>;
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH 2/2] ARM: tegra: remove "Tegra board type" comment from Kconfig
From: Stephen Warren @ 2012-10-02 19:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1349205048-22228-1-git-send-email-swarren@wwwdotorg.org>

From: Stephen Warren <swarren@nvidia.com>

Since the complete conversion to device tree, there are no board-
specific Kconfig options left, so remove the useless Kconfig entry.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/mach-tegra/Kconfig |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 5f3c03b..1219d87 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -57,8 +57,6 @@ config TEGRA_AHB
 	  which controls AHB bus master arbitration and some
 	  perfomance parameters(priority, prefech size).
 
-comment "Tegra board type"
-
 choice
         prompt "Default low-level debug console UART"
         default TEGRA_DEBUG_UART_NONE
-- 
1.7.0.4

^ permalink raw reply related

* [PATCHv3 1/4] mfd: smsc: Add support for smsc gpio io/keypad driver
From: ABRAHAM, KISHON VIJAY @ 2012-10-02 19:12 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121002123856.GX4360@opensource.wolfsonmicro.com>

Hi,

On Tue, Oct 2, 2012 at 6:08 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Mon, Oct 01, 2012 at 08:54:23PM +0530, ABRAHAM, KISHON VIJAY wrote:
>> On Mon, Oct 1, 2012 at 5:39 PM, Mark Brown
>
>> > Why would that be helpful?  Most platforms don't support DT at all, and
>
>> I'm not sure how to put it correctly. All I'm trying to tell is mfd is
>> a framework that exposes a set of API's to create and remove a device
>> among others. If a mfd child device is not created using mfd API,
>> it'll be unfair to expect that child be removed properly using mfd
>> API. Like in this patch, the device is created using
>> of_platform_populate (not a mfd API) but is removed using
>> mfd_remove_devices (mfd API) [which should result in an abort].
>
> That doesn't sound terribly clever, no, though it's not immediately
> clear to me if the non-clever bit is using mfd_remove_devices() or
> of_platform_populate().
>
>> This means mfd framework does not have an API to create a device from
>> dt data or so do I think since of_platform_populate() is used. Thats
>> why I suggested the idea of extending mfd_add_devices() (or adding a
>> new API in mfd framework) to create child devices from dt data so that
>> we'll have API's in mfd framework to both create and delete a device.
>
> The trouble that always exists with representing MFD children in DT is
> that unless you've got a usefully reusable IP block which is clearly
> separate from the chip integration you end up essentially just dumping
> the Linux data structures into DT which often doesn't leave you with
> something which describes the hardware.

indeed!

Thanks
Kishon

^ permalink raw reply

* [RFC PATCH 1/2] ARM: use generic strnlen_user and strncpy_from_user functions
From: Will Deacon @ 2012-10-02 19:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121002175316.GA598@pengutronix.de>

On Tue, Oct 02, 2012 at 06:53:16PM +0100, Uwe Kleine-K?nig wrote:
> Hello,

Hi Uwe,

> On Fri, Jun 08, 2012 at 04:38:54PM +0100, Will Deacon wrote:
> > This patch implements the word-at-a-time interface for ARM using the
> > same algorithm as x86. Although we have a clz instruction from ARMv5,
> > this only saves us one mov instruction when building with Thumb-2 and
> > makes no difference when targetting ARM, so we use the magic 0x0ff0001
> > constant for all CPUs. For big-endian configurations, we use the
> > implementation from asm-generic.
> > 
> > With this implemented, we can replace our byte-at-a-time strnlen_user
> > and strncpy_from_user functions with the optimised generic versions.
> This patch is in Linus tree as 8c56cc8be5b38e3684eba96dc9b3f7ca7e495755
> now and it broke my booting my Cortex-M3 machine. I didn't debug that
> yet, but wanted to let you know already now before I call it a day.

Ok, thanks for the heads-up. I didn't test it with an M-class CPU, but
hopefully that's understandable :)

> > +#define user_addr_max() \
> > +	(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL)
> > +
> I think this is the problem as for no-mmu USER_DS == KERNEL_DS. I will
> take a look tomorrow.

I can't immediately see why that would cause a problem, so please let me
know if you get more information.

Will

^ permalink raw reply

* [kvmarm] [PATCH v2 08/10] ARM: KVM: VGIC initialisation code
From: Will Deacon @ 2012-10-02 19:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAFEAcA8Mvh3QzVYTAhLjjbgCqd_AjJ7ji9z7NoLWnM4YUW0OQw@mail.gmail.com>

On Tue, Oct 02, 2012 at 07:31:43PM +0100, Peter Maydell wrote:
> We probably want to be passing in the "base of the cpu-internal
> peripherals", rather than "base of the GIC" specifically. For the
> A15 these are the same thing, but that's not inherent [compare the
> A9 which has more devices at fixed offsets from a configurable
> base address].

If you do that, userspace will need a way to probe the emulated CPU so
that is knows exactly which set of peripherals there are and which ones it
needs to emulate. This feels pretty nasty, given that the vgic is handled
more or less completely by the kernel-side of things.

Will

^ permalink raw reply

* [PATCH] ARM: tegra: remove <mach/dma.h>
From: Stephen Warren @ 2012-10-02 19:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

Remove includes of <mach/dma.h> from sound/soc; nothing from it is used.

Remove include of <mach/dma.h> from mach-tegra/apbio.c; since the DMA
transfers made by this file don't need flow-control with any peripheral,
there's no need to set any slave ID.

Once those changes are made, there are no remaining users of <mach/dma.h>
so remove it. Drivers should get this information from device tree. This
removal is necessary for single zImage.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Mark, I'd like to take this through the Tegra tree please, unless you want
me to split out the ASoC parts of the patch, and have you apply them to 3.7.

 arch/arm/mach-tegra/apbio.c            |    3 --
 arch/arm/mach-tegra/include/mach/dma.h |   54 --------------------------------
 sound/soc/tegra/tegra30_ahub.c         |    1 -
 sound/soc/tegra/tegra_pcm.h            |    2 -
 4 files changed, 0 insertions(+), 60 deletions(-)
 delete mode 100644 arch/arm/mach-tegra/include/mach/dma.h

diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c
index b5015d0..bc949fb 100644
--- a/arch/arm/mach-tegra/apbio.c
+++ b/arch/arm/mach-tegra/apbio.c
@@ -24,8 +24,6 @@
 #include <linux/sched.h>
 #include <linux/mutex.h>
 
-#include <mach/dma.h>
-
 #include "apbio.h"
 
 #if defined(CONFIG_TEGRA20_APB_DMA)
@@ -71,7 +69,6 @@ bool tegra_apb_dma_init(void)
 
 	dma_sconfig.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
 	dma_sconfig.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
-	dma_sconfig.slave_id = TEGRA_DMA_REQ_SEL_CNTR;
 	dma_sconfig.src_maxburst = 1;
 	dma_sconfig.dst_maxburst = 1;
 
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h
deleted file mode 100644
index 3081cc6..0000000
--- a/arch/arm/mach-tegra/include/mach/dma.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * arch/arm/mach-tegra/include/mach/dma.h
- *
- * Copyright (c) 2008-2009, NVIDIA Corporation.
- *
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-#ifndef __MACH_TEGRA_DMA_H
-#define __MACH_TEGRA_DMA_H
-
-#include <linux/list.h>
-
-#define TEGRA_DMA_REQ_SEL_CNTR			0
-#define TEGRA_DMA_REQ_SEL_I2S_2			1
-#define TEGRA_DMA_REQ_SEL_I2S_1			2
-#define TEGRA_DMA_REQ_SEL_SPD_I			3
-#define TEGRA_DMA_REQ_SEL_UI_I			4
-#define TEGRA_DMA_REQ_SEL_MIPI			5
-#define TEGRA_DMA_REQ_SEL_I2S2_2		6
-#define TEGRA_DMA_REQ_SEL_I2S2_1		7
-#define TEGRA_DMA_REQ_SEL_UARTA			8
-#define TEGRA_DMA_REQ_SEL_UARTB			9
-#define TEGRA_DMA_REQ_SEL_UARTC			10
-#define TEGRA_DMA_REQ_SEL_SPI			11
-#define TEGRA_DMA_REQ_SEL_AC97			12
-#define TEGRA_DMA_REQ_SEL_ACMODEM		13
-#define TEGRA_DMA_REQ_SEL_SL4B			14
-#define TEGRA_DMA_REQ_SEL_SL2B1			15
-#define TEGRA_DMA_REQ_SEL_SL2B2			16
-#define TEGRA_DMA_REQ_SEL_SL2B3			17
-#define TEGRA_DMA_REQ_SEL_SL2B4			18
-#define TEGRA_DMA_REQ_SEL_UARTD			19
-#define TEGRA_DMA_REQ_SEL_UARTE			20
-#define TEGRA_DMA_REQ_SEL_I2C			21
-#define TEGRA_DMA_REQ_SEL_I2C2			22
-#define TEGRA_DMA_REQ_SEL_I2C3			23
-#define TEGRA_DMA_REQ_SEL_DVC_I2C		24
-#define TEGRA_DMA_REQ_SEL_OWR			25
-#define TEGRA_DMA_REQ_SEL_INVALID		31
-
-#endif
diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
index bf56101..64b67a3 100644
--- a/sound/soc/tegra/tegra30_ahub.c
+++ b/sound/soc/tegra/tegra30_ahub.c
@@ -26,7 +26,6 @@
 #include <linux/regmap.h>
 #include <linux/slab.h>
 #include <mach/clk.h>
-#include <mach/dma.h>
 #include <sound/soc.h>
 #include "tegra30_ahub.h"
 
diff --git a/sound/soc/tegra/tegra_pcm.h b/sound/soc/tegra/tegra_pcm.h
index b40279b..bc8b46a 100644
--- a/sound/soc/tegra/tegra_pcm.h
+++ b/sound/soc/tegra/tegra_pcm.h
@@ -31,8 +31,6 @@
 #ifndef __TEGRA_PCM_H__
 #define __TEGRA_PCM_H__
 
-#include <mach/dma.h>
-
 struct tegra_pcm_dma_params {
 	unsigned long addr;
 	unsigned long wrap;
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH] ARM: tegra: remove <mach/dma.h>
From: Mark Brown @ 2012-10-02 19:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1349206245-22560-1-git-send-email-swarren@wwwdotorg.org>

On Tue, Oct 02, 2012 at 01:30:45PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Remove includes of <mach/dma.h> from sound/soc; nothing from it is used.
> 
> Remove include of <mach/dma.h> from mach-tegra/apbio.c; since the DMA
> transfers made by this file don't need flow-control with any peripheral,
> there's no need to set any slave ID.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

^ permalink raw reply

* [PATCH] ARM: tegra: update *.dts for regulator-compatible deprecation
From: Thierry Reding @ 2012-10-02 19:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1349204824-21758-1-git-send-email-swarren@wwwdotorg.org>

On Tue, Oct 02, 2012 at 01:07:04PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Commit 13511de "regulator: deprecate regulator-compatible DT property"
> now allows for simpler content within the regulators node within a PMIC.
> Modify all the Tegra device tree files to take advantage of this.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  arch/arm/boot/dts/tegra20-harmony.dts   |   63 ++++------------
>  arch/arm/boot/dts/tegra20-paz00.dts     |   59 ++++------------
>  arch/arm/boot/dts/tegra20-seaboard.dts  |   59 ++++------------
>  arch/arm/boot/dts/tegra20-tamonten.dtsi |   63 ++++------------
>  arch/arm/boot/dts/tegra20-ventana.dts   |   59 ++++------------
>  arch/arm/boot/dts/tegra20-whistler.dts  |  119 ++++++++-----------------------
>  arch/arm/boot/dts/tegra30-cardhu.dtsi   |   47 +++---------
>  7 files changed, 112 insertions(+), 357 deletions(-)

Funny how this has come full circle.

Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121002/698128c5/attachment-0001.sig>

^ permalink raw reply

* [kvmarm] [PATCH v2 08/10] ARM: KVM: VGIC initialisation code
From: Peter Maydell @ 2012-10-02 19:45 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121002192806.GC20411@mudshark.cambridge.arm.com>

On 2 October 2012 20:28, Will Deacon <will.deacon@arm.com> wrote:
> On Tue, Oct 02, 2012 at 07:31:43PM +0100, Peter Maydell wrote:
>> We probably want to be passing in the "base of the cpu-internal
>> peripherals", rather than "base of the GIC" specifically. For the
>> A15 these are the same thing, but that's not inherent [compare the
>> A9 which has more devices at fixed offsets from a configurable
>> base address].
>
> If you do that, userspace will need a way to probe the emulated CPU so
> that is knows exactly which set of peripherals there are and which ones it
> needs to emulate. This feels pretty nasty, given that the vgic is handled
> more or less completely by the kernel-side of things.

Userspace knows what the emulated CPU is because it tells the
kernel which CPU to provide -- the kernel can say "yes" or "no" but
it can't provide a different CPU to the one we ask for, or
one with bits mising...

-- PMM

^ permalink raw reply

* [PATCH v6 3/5] watchdog: at91sam9_wdt: add device tree support
From: Andrew Lunn @ 2012-10-02 19:59 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAHkwnC83DcKXZOtLse_xnYe7zOZ5qwGJVimLkBzDwSJ7Y5vL_Q@mail.gmail.com>

> I was thinking to add a more generic helper function like this:
> 
> static inline void watchdog_get_dttimeout(struct device_node *node,
> u32 *timeout)
> {
> 	if (node)
> 		of_property_read_u32(node, "timeout", &wdd->timeout);
> }

You forgot to change the function signature. 

Also, if you are adding a generic function, it should be a generic
function for the framework. All drivers should be slowly moving
towards the framework, so adding functions which help you not move
towards the framework are wrong.

	Andrew

^ permalink raw reply

* [PATCH 1/3] ARM: tegra: simplify DEBUG_LL UART selection options
From: Thierry Reding @ 2012-10-02 20:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1349204866-21810-1-git-send-email-swarren@wwwdotorg.org>

On Tue, Oct 02, 2012 at 01:07:44PM -0600, Stephen Warren wrote:
[...]
>  choice
> -        prompt "Default low-level debug console UART"
> -        default TEGRA_DEBUG_UART_NONE
> +        prompt "Low-level debug console UART"
> +        default TEGRA_DEBUG_UART_AUTO_ODMDATA
>  
> -config TEGRA_DEBUG_UART_NONE
> -        bool "None"
> +config TEGRA_DEBUG_UART_AUTO_ODMDATA

The first item in a list of choices is automatically selected as the
default, so technically the default is redundant here. I suppose it
doesn't hurt to be explicit.

> diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
> index 0b0a5f5..0913d1f 100644
> --- a/arch/arm/mach-tegra/common.c
> +++ b/arch/arm/mach-tegra/common.c
> @@ -44,14 +44,13 @@
>   * kernel is loaded. The data is declared here rather than debug-macro.S so
>   * that multiple inclusions of debug-macro.S point at the same data.
>   */
> -#define TEGRA_DEBUG_UART_OFFSET (TEGRA_DEBUG_UART_BASE & 0xFFFF)
>  u32 tegra_uart_config[3] = {
>  	/* Debug UART initialization required */
>  	1,
>  	/* Debug UART physical address */
> -	(u32)(IO_APB_PHYS + TEGRA_DEBUG_UART_OFFSET),
> +	0,
>  	/* Debug UART virtual address */
> -	(u32)(IO_APB_VIRT + TEGRA_DEBUG_UART_OFFSET),
> +	0,
>  };

I don't quite see how this is supposed to work now. Won't the debug.S
code fail if these fields are set to 0?

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121002/6e8b6ce5/attachment.sig>

^ permalink raw reply

* [PATCH 1/2] ARM: tegra: fix invalid unit-address in tegra*.dtsi
From: Thierry Reding @ 2012-10-02 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1349205048-22228-1-git-send-email-swarren@wwwdotorg.org>

On Tue, Oct 02, 2012 at 01:10:47PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Unit addresses, whilst written in hex, don't contain a 0x prefix.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> A couple of small cleanups/tweaks for 3.7 if possible.
> 
>  arch/arm/boot/dts/tegra20-seaboard.dts |    2 +-
>  arch/arm/boot/dts/tegra20.dtsi         |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Both patches,

Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121002/5290df07/attachment.sig>

^ permalink raw reply

* problem with kernel build
From: Johannes Reif @ 2012-10-02 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, I'm trying to compile a kernel for a Samsung Galaxy S2 but it fails 
with:

arm-eabi-gcc -Wp,-MD,arch/arm/kernel/.asm-offsets.s.d  -nostdinc 
-isystem 
/root/src/android/kernel/test/linaro-12-android-toolchain/bin/../lib/gcc/arm-eabi/4.7.2/include 
-I/root/src/android/kernel/test/arch/arm/include 
-Iarch/arm/include/generated -Iinclude  -include 
include/generated/autoconf.h -D__KERNEL__ -mlittle-endian 
-Iarch/arm/mach-versatile/include -Iarch/arm/plat-versatile/include 
-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing 
-fno-common -Werror-implicit-function-declaration -Wno-format-security 
-fno-delete-null-pointer-checks -march=armv7-a -mtune=cortex-a9 
-fmodulo-sched -fmodulo-sched-allow-regmoves -O2 -pipe -marm 
-fno-dwarf2-cfi-asm -fstack-protector -mabi=apcs-gnu 
-mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te 
-mtune=arm9tdmi -msoft-float -Uarm -Wframe-larger-than=1024 
-Wno-unused-but-set-variable -Wno-uninitialized -Wno-unused-function 
-Wno-unused-variable -Wno-unused-value -Wno-unused-label 
-fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign 
-fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO 
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(asm_offsets)" 
-D"KBUILD_MODNAME=KBUILD_STR(asm_offsets)" -fverbose-asm -S -o 
arch/arm/kernel/asm-offsets.s arch/arm/kernel/asm-offsets.c
In file included from include/linux/topology.h:35:0,
                  from include/linux/sched.h:78,
                  from arch/arm/kernel/asm-offsets.c:13:
/root/src/android/kernel/test/arch/arm/include/asm/topology.h: In 
function 'topology_register_notifier':
/root/src/android/kernel/test/arch/arm/include/asm/topology.h:41:53: 
warning: no return statement in function returning non-void [-Wreturn-type]
/root/src/android/kernel/test/arch/arm/include/asm/topology.h: In 
function 'topology_unregister_notifier':
/root/src/android/kernel/test/arch/arm/include/asm/topology.h:42:55: 
warning: no return statement in function returning non-void [-Wreturn-type]
In file included from arch/arm/kernel/asm-offsets.c:16:0:
/root/src/android/kernel/test/arch/arm/include/asm/cacheflush.h: At top 
level:
/root/src/android/kernel/test/arch/arm/include/asm/cacheflush.h:19:22: 
fatal error: mach/smc.h: No such file or directory
compilation terminated.
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

I know that the include path is missing but how it's intended to add the 
according arch/arm/mach-exynos/include directory?

^ permalink raw reply

* [PATCH v7 1/3] watchdog: at91sam9_wdt: add device tree
From: Andrew Lunn @ 2012-10-02 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

> Date: Tue,  2 Oct 2012 18:01:00 +0200
> From: Fabio Porcedda <fabio.porcedda@gmail.com>
> To: Wim Van Sebroeck <wim@iguana.be>, linux-watchdog at vger.kernel.org,
>         linux-arm-kernel at lists.infradead.org, Nicolas Ferre
>         <nicolas.ferre@atmel.com>, Jean-Christophe PLAGNIOL-VILLARD
>         <plagnioj@jcrosoft.com>, Andrew Victor <linux@maxim.org.za>
> Cc: devicetree-discuss at lists.ozlabs.org
> Subject: [PATCH v7 1/3] watchdog: at91sam9_wdt: add device tree
>         support
> Message-ID:
>         <1349193662-23482-2-git-send-email-fabio.porcedda@gmail.com>
> 
> Tested on an at91sam9260 board (evk-pro3)
> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> +++ b/drivers/watchdog/at91sam9_wdt.c
> @@ -32,6 +32,7 @@
>  #include <linux/timer.h>
>  #include <linux/bitops.h>
>  #include <linux/uaccess.h>
> +#include <linux/of.h>
> 
>  #include "at91sam9_wdt.h"
> 
> > @@ -302,11 +303,21 @@ static int __exit at91wdt_remove(struct platform_device *pdev)
>         return res;
>  }
> 
> +#if defined(CONFIG_OF)
> +static const struct of_device_id at91_wdt_dt_ids[] = {
> +       { .compatible = "atmel,at91sam9260-wdt" },
> +       { /* sentinel */ }
> +};

Hi Fabio

You are missing __devinitdata.

    Andrew

^ permalink raw reply

* [PATCH 1/3] ARM: tegra: simplify DEBUG_LL UART selection options
From: Stephen Warren @ 2012-10-02 20:12 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121002200130.GA31363@avionic-0098.mockup.avionic-design.de>

On 10/02/2012 02:01 PM, Thierry Reding wrote:
> On Tue, Oct 02, 2012 at 01:07:44PM -0600, Stephen Warren wrote: 
> [...]
>> choice -        prompt "Default low-level debug console UART" -
>> default TEGRA_DEBUG_UART_NONE +        prompt "Low-level debug
>> console UART" +        default TEGRA_DEBUG_UART_AUTO_ODMDATA
>> 
>> -config TEGRA_DEBUG_UART_NONE -        bool "None" +config
>> TEGRA_DEBUG_UART_AUTO_ODMDATA
> 
> The first item in a list of choices is automatically selected as
> the default, so technically the default is redundant here. I
> suppose it doesn't hurt to be explicit.
> 
>> diff --git a/arch/arm/mach-tegra/common.c
>> b/arch/arm/mach-tegra/common.c index 0b0a5f5..0913d1f 100644 ---
>> a/arch/arm/mach-tegra/common.c +++
>> b/arch/arm/mach-tegra/common.c @@ -44,14 +44,13 @@ * kernel is
>> loaded. The data is declared here rather than debug-macro.S so *
>> that multiple inclusions of debug-macro.S point at the same
>> data. */ -#define TEGRA_DEBUG_UART_OFFSET (TEGRA_DEBUG_UART_BASE
>> & 0xFFFF) u32 tegra_uart_config[3] = { /* Debug UART
>> initialization required */ 1, /* Debug UART physical address */ -
>> (u32)(IO_APB_PHYS + TEGRA_DEBUG_UART_OFFSET), +	0, /* Debug UART
>> virtual address */ -	(u32)(IO_APB_VIRT +
>> TEGRA_DEBUG_UART_OFFSET), +	0, };
> 
> I don't quite see how this is supposed to work now. Won't the
> debug.S code fail if these fields are set to 0?

If those fields remain set to 0, then there will be no DEBUG_LL output.

However, assuming use of a compressed zImage rather than an
uncompressed Image then at this stage in the series, uncompress.h
writes the UART selection and a cookie to Tegra's IRAM, and
debug-macro.S reads that selection, and re-initializes those fields to
whatever uncompress.h chose.

In patch 2 in the series, the coupling between uncompress.h and
debug-macro.S is entirely removed, and instead, debug-macro.S
initializes those values the first time a character is printed.

The values aren't hard-coded there since they are now (after patch 2)
always over-written. Even when a single static UART is selected, we
can't hard-code the address since debug-macro.S validates that the
clock and reset bits to the UART are correctly set before using it,
hence we might end up not using the UART anyway.

^ permalink raw reply

* [PATCH] ARM: pxa: Fix build error caused by sram.h rename
From: Arnd Bergmann @ 2012-10-02 20:27 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <87fw5wofwm.fsf_-_@octavius.laptop.org>

On Tuesday 02 October 2012, Chris Ball wrote:
> Commit 293b2da1b61 ("ARM: pxa: move platform_data definitions")
> renamed arch/arm/mach-mmp/include/mach/sram.h to
> include/linux/platform_data/dma-mmp_tdma.h, but didn't update
> mmp-pcm.c which uses the header.  Fix the build error.
> 
> Signed-off-by: Chris Ball <cjb@laptop.org>
> ---
>  sound/soc/pxa/mmp-pcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c
> index 73ac546..e834faf 100644
> --- a/sound/soc/pxa/mmp-pcm.c
> +++ b/sound/soc/pxa/mmp-pcm.c
> @@ -15,13 +15,13 @@
>  #include <linux/slab.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/dmaengine.h>
> +#include <linux/platform_data/dma-mmp_tdma.h>
>  #include <linux/platform_data/mmp_audio.h>
>  #include <sound/pxa2xx-lib.h>
>  #include <sound/core.h>
>  #include <sound/pcm.h>
>  #include <sound/pcm_params.h>
>  #include <sound/soc.h>
> -#include <mach/sram.h>
>  #include <sound/dmaengine_pcm.h>
>  
>  struct mmp_dma_data {

Acked-by: Arnd Bergmann <arnd@arndb.de>

Sorry I didn't catch this earlier. The file was only recently added
and somehow didn't appear in my build tests.

^ permalink raw reply

* [PATCH 11/12] pinctrl: samsung: use __devinit section for init code
From: Thierry Reding @ 2012-10-02 20:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1348868177-21205-12-git-send-email-arnd@arndb.de>

On Fri, Sep 28, 2012 at 11:36:16PM +0200, Arnd Bergmann wrote:
> The samsung pinctrl driver has a probe function that is
> __devinit and that calls a lot of other functions that are
> marked __init, which kbuild complains about.
> 
> Marking everything __devinit means that the code does not
> discarded when CONFIG_HOTPLUG is set, which is a little
> more wasteful, but also more consistent
> 
> Without this patch, building exynos_defconfig results in:
> 
> WARNING: drivers/pinctrl/built-in.o(.devinit.text+0x124): Section mismatch in reference from the function samsung_pinctrl_probe() to the function .init.text:samsung_gpiolib_register()
> The function __devinit samsung_pinctrl_probe() references
> a function __init samsung_gpiolib_register().
> If samsung_gpiolib_register is only used by samsung_pinctrl_probe then
> annotate samsung_gpiolib_register with a matching annotation.

Note that work is underway to remove HOTPLUG altogether (see commit
45f035a, "CONFIG_HOTPLUG should be always on" in linux-next), so it
may make more sense to just drop the __init markings.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121002/619651cc/attachment-0001.sig>

^ permalink raw reply

* [PATCH 2/2] mtd: sh_flctl: Add device tree support
From: Arnd Bergmann @ 2012-10-02 20:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <Pine.LNX.4.64.1210021602250.15778@axis700.grange>

On Tuesday 02 October 2012, Guennadi Liakhovetski wrote:
> > 
> > Since you are also adding dma-engine support, I would suggest you specify
> > a "dmas" and "dma-names" property as well, so the device can find the
> > right dma channel. The code might not do that yet while you're still
> > sorting out the dependencies (and the sh dmaengine code is not yet
> > converted to DT), but I think it would be good to nail down the binding
> > for this device.
> 
> Have DMA DT bindings been accepted yet, are they fixed? Wouldn't it be 
> better to wait until patches appear in a tree, at least with high 
> probability heading towards the mainline, or have they already?
> 

I think they ended up not getting scheduled for 3.7, which is a bit disappointing
after we got an agreement on the binding.  However, I am rather confident that
we won't change the binding again, at least I don't see how they would change
in a way that would impact the binding document for a device using a DMA channel.

	Arnd

^ permalink raw reply

* [PATCH] ASoC: ams-delta: Convert to use snd_soc_register_card()
From: Janusz Krzysztofik @ 2012-10-02 21:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1347823023-24922-1-git-send-email-jkrzyszt@tis.icnet.pl>

Dnia niedziela, 16 wrze?nia 2012 21:17:03 Janusz Krzysztofik pisze:
> The old method of registering with the ASoC core by creating a
> "soc-audio" platform device no longer works for Amstrad Delta sound card
> after recent changes to drvdata handling (commit
> 0998d0631001288a5974afc0b2a5f568bcdecb4d, 'device-core: Ensure drvdata =
> NULL when no driver is bound'.
> 
> Use snd_soc_register_card() method instead, as suggested by the ASoC
> core generated warning message, and move both the card and codec
> platform device registration to the arch board file where those belong.

Hi Mark,
Is something wrong with this patch? Any chance for it to find its way into 3.7?

Thanks,
Janusz

> Created and tested against linux-3.6-rc5.
> 
> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
> ---
> On Thu, 6 Sep 2012 15:36:35 Mark Brown wrote:
> > On Sat, Sep 01, 2012 at 11:09:18AM +0200, Janusz Krzysztofik wrote:
> > 
> > > I see your point, however for now I can see no better way of referencing 
> > > the data (of type struct snd_soc_card) then passing it to 
> > > snd_soc_register_card(). But for this to work, I would have to register 
> > > successfully an ams-delta specific platform device first, not the soc-
> > > audio. This, even if still done from the sound/soc/omap/ams-delta.c, not 
> > > from an arch board file, would require now not existing ams-delta ASoC 
> > > platform driver probe/remove callbacks at least. I'm still not convinced 
> > > if such modification would be acceptable in the middle of the rc cycle.
> > 
> > > If there is a simpler, less intrusive way to do this, then sorry, I 
> > > still can't see it.
> > 
> > Like I already said just make it a static variable.
> 
> Mark,
> Sorry, I was still not able to understand what you actually meant, and
> to come out with a working fix other than I initially proposed. If what
> I've prepared now is not acceptable as a fix, than hard luck, please
> consider queueing it for 3.7, and 3.6 must go with Amstrad Delta sound
> not working unless someone else is still able to fix it.
> 
> Tony,
> Please give your ack on the arch/arm/mach-omap1 bits if acceptable. I
> believe there should be no merge conflicts if this change goes through
> sound/soc.
> 
> Thanks,
> Janusz
> 
>  arch/arm/mach-omap1/board-ams-delta.c |   12 ++++++
>  sound/soc/omap/ams-delta.c            |   63 +++++++++++++++-----------------
>  2 files changed, 42 insertions(+), 33 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
> index c534698..5ab9c6b 100644
> --- a/arch/arm/mach-omap1/board-ams-delta.c
> +++ b/arch/arm/mach-omap1/board-ams-delta.c
> @@ -444,16 +444,28 @@ static struct omap1_cam_platform_data ams_delta_camera_platform_data = {
>  	.lclk_khz_max	= 1334,		/* results in 5fps CIF, 10fps QCIF */
>  };
>  
> +static struct platform_device ams_delta_audio_device = {
> +	.name   = "ams-delta-audio",
> +	.id     = -1,
> +};
> +
> +static struct platform_device cx20442_codec_device = {
> +	.name   = "cx20442-codec",
> +	.id     = -1,
> +};
> +
>  static struct platform_device *ams_delta_devices[] __initdata = {
>  	&latch1_gpio_device,
>  	&latch2_gpio_device,
>  	&ams_delta_kp_device,
>  	&ams_delta_camera_device,
> +	&ams_delta_audio_device,
>  };
>  
>  static struct platform_device *late_devices[] __initdata = {
>  	&ams_delta_nand_device,
>  	&ams_delta_lcd_device,
> +	&cx20442_codec_device,
>  };
>  
>  static void __init ams_delta_init(void)
> diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
> index 7d4fa8e..7b18b74 100644
> --- a/sound/soc/omap/ams-delta.c
> +++ b/sound/soc/omap/ams-delta.c
> @@ -575,56 +575,53 @@ static struct snd_soc_card ams_delta_audio_card = {
>  };
>  
>  /* Module init/exit */
> -static struct platform_device *ams_delta_audio_platform_device;
> -static struct platform_device *cx20442_platform_device;
> -
> -static int __init ams_delta_module_init(void)
> +static __devinit int ams_delta_probe(struct platform_device *pdev)
>  {
> +	struct snd_soc_card *card = &ams_delta_audio_card;
>  	int ret;
>  
> -	if (!(machine_is_ams_delta()))
> -		return -ENODEV;
> -
> -	ams_delta_audio_platform_device =
> -			platform_device_alloc("soc-audio", -1);
> -	if (!ams_delta_audio_platform_device)
> -		return -ENOMEM;
> +	card->dev = &pdev->dev;
>  
> -	platform_set_drvdata(ams_delta_audio_platform_device,
> -				&ams_delta_audio_card);
> -
> -	ret = platform_device_add(ams_delta_audio_platform_device);
> -	if (ret)
> -		goto err;
> -
> -	/*
> -	 * Codec platform device could be registered from elsewhere (board?),
> -	 * but I do it here as it makes sense only if used with the card.
> -	 */
> -	cx20442_platform_device =
> -		platform_device_register_simple("cx20442-codec", -1, NULL, 0);
> +	ret = snd_soc_register_card(card);
> +	if (ret) {
> +		dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
> +		card->dev = NULL;
> +		return ret;
> +	}
>  	return 0;
> -err:
> -	platform_device_put(ams_delta_audio_platform_device);
> -	return ret;
>  }
> -late_initcall(ams_delta_module_init);
>  
> -static void __exit ams_delta_module_exit(void)
> +static int __devexit ams_delta_remove(struct platform_device *pdev)
>  {
> +	struct snd_soc_card *card = platform_get_drvdata(pdev);
> +
>  	if (tty_unregister_ldisc(N_V253) != 0)
> -		dev_warn(&ams_delta_audio_platform_device->dev,
> +		dev_warn(&pdev->dev,
>  			"failed to unregister V253 line discipline\n");
>  
>  	snd_soc_jack_free_gpios(&ams_delta_hook_switch,
>  			ARRAY_SIZE(ams_delta_hook_switch_gpios),
>  			ams_delta_hook_switch_gpios);
>  
> -	platform_device_unregister(cx20442_platform_device);
> -	platform_device_unregister(ams_delta_audio_platform_device);
> +	snd_soc_unregister_card(card);
> +	card->dev = NULL;
> +	return 0;
>  }
> -module_exit(ams_delta_module_exit);
> +
> +#define DRV_NAME "ams-delta-audio"
> +
> +static struct platform_driver ams_delta_driver = {
> +	.driver = {
> +		.name = DRV_NAME,
> +		.owner = THIS_MODULE,
> +	},
> +	.probe = ams_delta_probe,
> +	.remove = __devexit_p(ams_delta_remove),
> +};
> +
> +module_platform_driver(ams_delta_driver);
>  
>  MODULE_AUTHOR("Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>");
>  MODULE_DESCRIPTION("ALSA SoC driver for Amstrad E3 (Delta) videophone");
>  MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:" DRV_NAME);
> 

^ permalink raw reply

* [PATCH v2 8/9] ARM: OMAP: iommu: add device tree support
From: Matt Porter @ 2012-10-02 21:25 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1347479152-588-9-git-send-email-omar.luna@linaro.org>

On Wed, Sep 12, 2012 at 02:45:51PM -0500, Omar Ramirez Luna wrote:
> Adapt driver to use DT if provided.

Hi Omar,

I'm interested in making use of the assert/deassert APIs you exposed in
this series on AM335x for the pruss hwmod which has one hardreset
line. I have the same situation where I need to get it deasserted before
I do any runtime PM. See my comments below...

> +static int __devinit
> +iommu_add_platform_data_from_dt(struct platform_device *pdev)
> +{
> +	struct iommu_platform_data *pdata;
> +	struct device_node *node = pdev->dev.of_node;
> +	struct omap_hwmod *oh;
> +	struct omap_mmu_dev_attr *a;
> +	int ret = 0;
> +
> +	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
> +	if (!pdata)
> +		return -ENOMEM;
> +
> +	of_property_read_string(node, "ti,hwmods", &pdata->name);
> +	oh = omap_hwmod_lookup(pdata->name);
> +	if (!oh) {
> +		dev_err(&pdev->dev, "Cannot lookup hwmod '%s'\n", pdata->name);
> +		ret = -ENODEV;
> +		goto out;
> +	}
> +
> +	a = (struct omap_mmu_dev_attr *)oh->dev_attr;
> +	pdata->nr_tlb_entries = a->nr_tlb_entries;
> +	pdata->da_start = a->da_start;
> +	pdata->da_end = a->da_end;
> +
> +	if (oh->rst_lines_cnt == 1) {
> +		pdata->reset_name = oh->rst_lines->name;
> +		pdata->assert_reset = omap_device_assert_hardreset;
> +		pdata->deassert_reset = omap_device_deassert_hardreset;
> +	}
> +
> +	ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
> +	if (ret)
> +		dev_err(&pdev->dev, "Cannot add pdata for %s\n", pdata->name);
> +
> +out:
> +	kfree(pdata);
> +
> +	return ret;
> +}

I can see why you went this path with the iommu driver as it already had
some integration code present here. I have some concerns going forward
about how this should be long-term. Take any platform booting only with
DT populated, we'd like to avoid having to use this approach where
platform private APIs are called via pdata. In fact, it's going to makes
thing ugly to carry any sort of pdata for a driver that's otherwise
driven exclusively from DT.

For AM335x, I can implement this approach, but it means adding some
pruss specific integration code just to have it create the pdata for
reset_name and assert/deassert.

>From reading all the threads on hardresets and OMAP, it seems we may not
be able to come up with a generic OMAP handler for these resets and
that's really reflected in the fact that this API exists. So given that,
it reasons that OMAP isn't the only one needing a reset API for drivers.
I'm thinking that (as trivial as it may seem), this support may need to
move to a reset subsystem such that drivers have a clean way to access
reset resources in an SoC.

I'm curious if you or others have thought about where this needs to go
next. When I first thought about a reset subsystem it seemed to trivial
to bother with but looking at the reasoning behind the power_seq
subsystem, it seems to have similar justification to get this machine
specific logic out of the platform code and under standardized control
of the driver. We have resources that are manipulated outside of the IP
block but need to be controlled at the driver level and probably should
have a common driver API that isn't OMAP specific and tied to pdata.

-Matt

^ permalink raw reply

* [PATCH] ARM: OMAP: fix return value check in beagle_opp_init()
From: Kevin Hilman @ 2012-10-02 21:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAPgLHd9aJUYX_a7_iXLi5r6VEVuB0W15G9Ryw2bVzNzko2NpBA@mail.gmail.com>

Wei Yongjun <weiyj.lk@gmail.com> writes:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function omap_device_get_by_hwmod_name()
> returns ERR_PTR() not NULL pointer. The NULL test in the return
> value check should be replaced with IS_ERR().
>
> dpatch engine is used to auto generated this patch.
> (https://github.com/weiyj/dpatch)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Thanks, queueing this up for v3.7-rc.

Kevin

> ---
>  arch/arm/mach-omap2/board-omap3beagle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index 6202fc7..a548d70 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -466,7 +466,7 @@ static void __init beagle_opp_init(void)
>  		mpu_dev = omap_device_get_by_hwmod_name("mpu");
>  		iva_dev = omap_device_get_by_hwmod_name("iva");
>  
> -		if (!mpu_dev || !iva_dev) {
> +		if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
>  			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
>  				__func__, mpu_dev, iva_dev);
>  			return;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] ARM: OMAP: omap_device: fix return value check in omap_device_build_ss()
From: Kevin Hilman @ 2012-10-02 21:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAPgLHd8ys7uU8wBhMF7JWZEDAddOnGo4vHPu1V_+Q3__WWK-3g@mail.gmail.com>

Wei Yongjun <weiyj.lk@gmail.com> writes:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function omap_device_alloc() returns ERR_PTR()
> and never returns NULL pointer. The NULL test in the return value
> check should be replaced with IS_ERR().
>
> dpatch engine is used to auto generated this patch.
> (https://github.com/weiyj/dpatch)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Thanks, queueing this for v3.7-rc.

Kevin

^ permalink raw reply

* [PATCH] ARM: OMAP2+: SmartReflex: fix return value check in sr_dev_init()
From: Kevin Hilman @ 2012-10-02 21:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAORVsuUcOFKFoOuxZqPJR=WSsTouqBH3EP4Xu82o515ofGbn+w@mail.gmail.com>

Jean Pihet <jean.pihet@newoldbits.com> writes:

> Hello,
>
> On Thu, Sep 27, 2012 at 7:54 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> In case of error, the function voltdm_lookup() returns NULL
>> not ERR_PTR(). The IS_ERR() test in the return value check
>> should be replaced with NULL test.
>>
>> dpatch engine is used to auto generate this patch.
>> (https://github.com/weiyj/dpatch)
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>> ---
>>  arch/arm/mach-omap2/sr_device.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
>> index d033a65..c248b30 100644
>> --- a/arch/arm/mach-omap2/sr_device.c
>> +++ b/arch/arm/mach-omap2/sr_device.c
>> @@ -123,7 +123,7 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
>>         sr_data->senp_mod = 0x1;
>>
>>         sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name);
>> -       if (IS_ERR(sr_data->voltdm)) {
>> +       if (!sr_data->voltdm) {
>>                 pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
>>                         __func__, sr_dev_attr->sensor_voltdm_name);
>>                 goto exit;
>
> This looks good, so here is the ack:
> Acked-by: Jean Pihet <j-pihet@ti.com>
>

Thanks, queuing this one for v3.7-rc.

Kevin

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox