All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Zynq ZC702 bringup
@ 2012-07-04 14:13 Nick Bowler
  2012-07-04 14:13 ` [PATCH 1/3] ARM: zynq: Allow UART1 to be used as DEBUG_LL console Nick Bowler
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nick Bowler @ 2012-07-04 14:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel

This short series allows use of the UART on the Zynq ZC702 for early
printk, and then fixes some problems that occur during early boot.

While a lot of things are still not working with this board, these
changes in addition to the GIC OF initialization patch posted last
month allow me to bring the system up to a busybox shell.

Nick Bowler (3):
  ARM: zynq: Allow UART1 to be used as DEBUG_LL console.
  ARM: zynq: Add compatible entry for the ZC702 board.
  ARM: zynq: Map DEBUG_LL UARTs in vmalloc space.

 arch/arm/Kconfig.debug                     |   17 +++++++++++++++++
 arch/arm/mach-zynq/common.c                |    5 +++--
 arch/arm/mach-zynq/include/mach/zynq_soc.h |   17 ++++++++++++-----
 3 files changed, 32 insertions(+), 7 deletions(-)

-- 
1.7.8.6



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

* [PATCH 1/3] ARM: zynq: Allow UART1 to be used as DEBUG_LL console.
  2012-07-04 14:13 [PATCH 0/3] Zynq ZC702 bringup Nick Bowler
@ 2012-07-04 14:13 ` Nick Bowler
  2012-07-04 14:13 ` [PATCH 2/3] ARM: zynq: Add compatible entry for the ZC702 board Nick Bowler
  2012-07-04 14:13 ` [PATCH 3/3] ARM: zynq: Map DEBUG_LL UARTs in vmalloc space Nick Bowler
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Bowler @ 2012-07-04 14:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel; +Cc: Russell King, John Linn

The main UART on the Xilinx ZC702 board is UART1, located at address
e0001000.  Add a Kconfig option to select this device as the low-level
debugging port.  This allows the really early boot printouts to reach
the USB serial adaptor on this board.

The board does not boot yet, but now it's actually possible to see error
messages.

For consistency's sake, add a choice entry for UART0 even though it is
the the default if UART1 is not selected.

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Cc: John Linn <john.linn@xilinx.com>

---
 arch/arm/Kconfig.debug                     |   17 +++++++++++++++++
 arch/arm/mach-zynq/common.c                |    4 ++--
 arch/arm/mach-zynq/include/mach/zynq_soc.h |   12 ++++++++++--
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 01a1341..9abe3ad 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -132,6 +132,23 @@ choice
 		  their output to UART1 serial port on DaVinci TNETV107X
 		  devices.
 
+	config DEBUG_ZYNQ_UART0
+		bool "Kernel low-level debugging on Xilinx Zynq using UART0"
+		depends on ARCH_ZYNQ
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to UART0 on the Zynq platform.
+
+	config DEBUG_ZYNQ_UART1
+		bool "Kernel low-level debugging on Xilinx Zynq using UART1"
+		depends on ARCH_ZYNQ
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to UART1 on the Zynq platform.
+
+		  If you have a ZC702 board and want early boot messages to
+		  appear on the USB serial adaptor, select this option.
+
 	config DEBUG_DC21285_PORT
 		bool "Kernel low-level debugging messages via footbridge serial port"
 		depends on FOOTBRIDGE
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index ab5cfdd..12a2984 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -87,8 +87,8 @@ static struct map_desc io_desc[] __initdata = {
 
 #ifdef CONFIG_DEBUG_LL
 	{
-		.virtual	= UART0_VIRT,
-		.pfn		= __phys_to_pfn(UART0_PHYS),
+		.virtual	= LL_UART_VADDR,
+		.pfn		= __phys_to_pfn(LL_UART_PADDR),
 		.length		= SZ_4K,
 		.type		= MT_DEVICE,
 	},
diff --git a/arch/arm/mach-zynq/include/mach/zynq_soc.h b/arch/arm/mach-zynq/include/mach/zynq_soc.h
index d0d3f8f..6f83f1c 100644
--- a/arch/arm/mach-zynq/include/mach/zynq_soc.h
+++ b/arch/arm/mach-zynq/include/mach/zynq_soc.h
@@ -22,6 +22,9 @@
 #define UART0_PHYS			0xE0000000
 #define UART0_VIRT			UART0_PHYS
 
+#define UART1_PHYS			0xE0001000
+#define UART1_VIRT			UART1_PHYS
+
 #define TTC0_PHYS			0xF8001000
 #define TTC0_VIRT			TTC0_PHYS
 
@@ -42,7 +45,12 @@
 /*
  * Mandatory for CONFIG_LL_DEBUG, UART is mapped virtual = physical
  */
-#define LL_UART_PADDR	UART0_PHYS
-#define LL_UART_VADDR	UART0_VIRT
+#ifdef CONFIG_DEBUG_ZYNQ_UART1
+#  define LL_UART_PADDR UART1_PHYS
+#  define LL_UART_VADDR UART1_VIRT
+#else
+#  define LL_UART_PADDR UART0_PHYS
+#  define LL_UART_VADDR UART0_VIRT
+#endif
 
 #endif
-- 
1.7.8.6



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

* [PATCH 2/3] ARM: zynq: Add compatible entry for the ZC702 board.
  2012-07-04 14:13 [PATCH 0/3] Zynq ZC702 bringup Nick Bowler
  2012-07-04 14:13 ` [PATCH 1/3] ARM: zynq: Allow UART1 to be used as DEBUG_LL console Nick Bowler
@ 2012-07-04 14:13 ` Nick Bowler
  2012-07-04 14:13 ` [PATCH 3/3] ARM: zynq: Map DEBUG_LL UARTs in vmalloc space Nick Bowler
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Bowler @ 2012-07-04 14:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel; +Cc: Russell King, John Linn

This allows the kernel to start on this platform with the
vendor-provided device tree blob.

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Cc: John Linn <john.linn@xilinx.com>

---
 arch/arm/mach-zynq/common.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 12a2984..a58c83b 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -106,6 +106,7 @@ static void __init xilinx_map_io(void)
 
 static const char *xilinx_dt_match[] = {
 	"xlnx,zynq-ep107",
+	"xlnx,zynq-zc702",
 	NULL
 };
 
-- 
1.7.8.6



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

* [PATCH 3/3] ARM: zynq: Map DEBUG_LL UARTs in vmalloc space.
  2012-07-04 14:13 [PATCH 0/3] Zynq ZC702 bringup Nick Bowler
  2012-07-04 14:13 ` [PATCH 1/3] ARM: zynq: Allow UART1 to be used as DEBUG_LL console Nick Bowler
  2012-07-04 14:13 ` [PATCH 2/3] ARM: zynq: Add compatible entry for the ZC702 board Nick Bowler
@ 2012-07-04 14:13 ` Nick Bowler
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Bowler @ 2012-07-04 14:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel; +Cc: Russell King, John Linn

Unlike the other statically mapped devices on this platform, the
physical=virtual mapping of the UARTs placese these devices outside
of the vmalloc region (0xf0000000–0xff000000).  This causes the
following crash when booting the ZC702 board with CONFIG_DEBUG_LL
enabled:

  BUG: mapping for 0xe0001000 at 0xe0001000 out of vmalloc space
  ------------[ cut here ]------------
  kernel BUG at /scratch_space/linux/arch/arm/mm/mmu.c:580!
  Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
  Modules linked in:
  CPU: 0    Not tainted  (3.5.0-rc5-00012-g832a165 #50)
  PC is at early_pte_alloc+0x54/0x70
  LR is at create_mapping+0x288/0x310
  pc : [<c043ab14>]    lr : [<c043adb8>]    psr: 200001d3
  sp : c07fff10  ip : 000008f8  fp : 00000000
  r10: 00001000  r9 : 413fc090  r8 : e0001000
  r7 : e0002000  r6 : 00000041  r5 : e0001000  r4 : c0007800
  r3 : 2000040e  r2 : 00000041  r1 : e0001000  r0 : 2000040e
  Flags: nzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
  Control: 18c5387d  Table: 00004059  DAC: 00000015
  Process swapper (pid: 0, stack limit = 0xc07fe2e8)
  Stack: (0xc07fff10 to 0xc0800000)
  ff00:                                     e0001000 c080a81c c0007800 c043adb8
  ff20: e0001000 00000080 e0002000 e0001fff 00000080 c0451270 00000001 ef7fdfe0
  ff40: c043ae40 40000001 413fc090 ef7fe000 00000000 c043ae7c c043c0c0 c044fcbc
  ff60: 00000000 0002f7ff c0450fb8 c07fffe4 00000000 c043b5e4 ffff0000 0002f7ff
  ff80: 00001000 00000008 c08148c4 c044fcbc c0830218 00008000 c08148c4 c0438b08
  ffa0: 00000000 18c5387d c03b5952 c07fffc4 c0837ec4 00000001 c080604c c0450ba8
  ffc0: c0809a54 00004059 00000000 c04354f4 00000000 00000000 00000000 00000000
  ffe0: 00000000 c0450bac 18c5387d c080604c c0450ba8 0000803c 00000000 00000000
  [<c043ab14>] (early_pte_alloc+0x54/0x70) from [<c043adb8>] (create_mapping+0x288/0x310)
  [<c043adb8>] (create_mapping+0x288/0x310) from [<c043ae7c>] (iotable_init+0x3c/0xb0)
  [<c043ae7c>] (iotable_init+0x3c/0xb0) from [<c043b5e4>] (paging_init+0x574/0x708)
  [<c043b5e4>] (paging_init+0x574/0x708) from [<c0438b08>] (setup_arch+0x518/0x7d4)
  [<c0438b08>] (setup_arch+0x518/0x7d4) from [<c04354f4>] (start_kernel+0x68/0x2d4)
  [<c04354f4>] (start_kernel+0x68/0x2d4) from [<0000803c>] (0x803c)
  Code: f57ff04f e5940000 e3100002 0a000000 (e7f001f2)
  ---[ end trace 1b75b31a2719ed1c ]---
  Kernel panic - not syncing: Attempted to kill the idle task!

It seems easy enough to move the static mappings into the vmalloc range,
so let's do so.  This allows the system to boot.

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Cc: John Linn <john.linn@xilinx.com>

---
 arch/arm/mach-zynq/include/mach/zynq_soc.h |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-zynq/include/mach/zynq_soc.h b/arch/arm/mach-zynq/include/mach/zynq_soc.h
index 6f83f1c..e1c4704 100644
--- a/arch/arm/mach-zynq/include/mach/zynq_soc.h
+++ b/arch/arm/mach-zynq/include/mach/zynq_soc.h
@@ -17,13 +17,12 @@
 
 #define PERIPHERAL_CLOCK_RATE		2500000
 
-/* For now, all mappings are flat (physical = virtual)
- */
+/* The UART must be mapped within the vmalloc range (0xF0000000-0xFF000000). */
 #define UART0_PHYS			0xE0000000
-#define UART0_VIRT			UART0_PHYS
+#define UART0_VIRT			0xF0000000
 
 #define UART1_PHYS			0xE0001000
-#define UART1_VIRT			UART1_PHYS
+#define UART1_VIRT			0xF0001000
 
 #define TTC0_PHYS			0xF8001000
 #define TTC0_VIRT			TTC0_PHYS
-- 
1.7.8.6



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

end of thread, other threads:[~2012-07-04 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-04 14:13 [PATCH 0/3] Zynq ZC702 bringup Nick Bowler
2012-07-04 14:13 ` [PATCH 1/3] ARM: zynq: Allow UART1 to be used as DEBUG_LL console Nick Bowler
2012-07-04 14:13 ` [PATCH 2/3] ARM: zynq: Add compatible entry for the ZC702 board Nick Bowler
2012-07-04 14:13 ` [PATCH 3/3] ARM: zynq: Map DEBUG_LL UARTs in vmalloc space Nick Bowler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.