]> Pileus Git - ~andy/linux/commitdiff
ARM: zynq: add support for ARCH_MULTIPLATFORM
authorJosh Cartwright <josh.cartwright@ni.com>
Mon, 19 Nov 2012 17:38:29 +0000 (11:38 -0600)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 21 Nov 2012 09:52:13 +0000 (10:52 +0100)
The majority of changes are necessary to remove dependencies on header
files within arch/arm/mach-zynq/include/mach:

  uncompress.h
    - Deleted. It is unused for ARCH_MULTIPLATFORM builds.

  uart.h:
    - Move uart definitions out of uart.h into debug/zynq.S, which is
      now the only user

  zynq_soc.h:
    - Move SCU address definitions into common.c.
    - Other #defines, such as PERIPHERAL_CLOCK_RATE, TTC0_BASE, etc, are
      unused and can be dropped

Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
Tested-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/Kconfig
arch/arm/include/debug/zynq.S
arch/arm/mach-zynq/Kconfig [new file with mode: 0644]
arch/arm/mach-zynq/common.c
arch/arm/mach-zynq/include/mach/uart.h [deleted file]
arch/arm/mach-zynq/include/mach/uncompress.h [deleted file]
arch/arm/mach-zynq/include/mach/zynq_soc.h [deleted file]

index ccfe0ab8c87702076afaf621963c730e1d34be3f..28a204801ccf91e84df6c1cea3f82fccb80a2711 100644 (file)
@@ -955,18 +955,6 @@ config ARCH_VT8500
        help
          Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
 
-config ARCH_ZYNQ
-       bool "Xilinx Zynq ARM Cortex A9 Platform"
-       select ARM_AMBA
-       select ARM_GIC
-       select COMMON_CLK
-       select CPU_V7
-       select GENERIC_CLOCKEVENTS
-       select ICST
-       select MIGHT_HAVE_CACHE_L2X0
-       select USE_OF
-       help
-         Support for Xilinx Zynq ARM Cortex A9 Platform
 endchoice
 
 menu "Multiple platform selection"
@@ -1128,6 +1116,8 @@ source "arch/arm/plat-versatile/Kconfig"
 
 source "arch/arm/mach-w90x900/Kconfig"
 
+source "arch/arm/mach-zynq/Kconfig"
+
 # Definitions to make life easier
 config ARCH_ACORN
        bool
index 08aed97120e4e534999e59ccc659932bd3b477d9..f9aa9740a73f09676d5a963f47e2d8e4f7d83e6c 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
+#define UART_CR_OFFSET         0x00  /* Control Register [8:0] */
+#define UART_SR_OFFSET         0x2C  /* Channel Status [11:0] */
+#define UART_FIFO_OFFSET       0x30  /* FIFO [15:0] or [7:0] */
 
-#include <mach/zynq_soc.h>
-#include <mach/uart.h>
+#define UART_SR_TXFULL         0x00000010      /* TX FIFO full */
+#define UART_SR_TXEMPTY                0x00000008      /* TX FIFO empty */
+
+#define UART0_PHYS             0xE0000000
+#define UART1_PHYS             0xE0001000
+#define UART_SIZE              SZ_4K
+#define UART_VIRT              0xF0001000
+
+#if IS_ENABLED(CONFIG_DEBUG_ZYNQ_UART1)
+# define LL_UART_PADDR         UART1_PHYS
+#else
+# define LL_UART_PADDR         UART0_PHYS
+#endif
+
+#define LL_UART_VADDR          UART_VIRT
 
                .macro  addruart, rp, rv, tmp
                ldr     \rp, =LL_UART_PADDR     @ physical
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
new file mode 100644 (file)
index 0000000..adb6c0e
--- /dev/null
@@ -0,0 +1,13 @@
+config ARCH_ZYNQ
+       bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
+       select ARM_AMBA
+       select ARM_GIC
+       select COMMON_CLK
+       select CPU_V7
+       select GENERIC_CLOCKEVENTS
+       select ICST
+       select MIGHT_HAVE_CACHE_L2X0
+       select USE_OF
+       select SPARSE_IRQ
+       help
+         Support for Xilinx Zynq ARM Cortex A9 Platform
index a2f48daa11ca0d4bb05563e54b145ee75d476070..e16d4bed0f7aaf1e1d4f7f3423cf2c0a35fd41dd 100644 (file)
 #include <asm/mach/time.h>
 #include <asm/mach-types.h>
 #include <asm/page.h>
+#include <asm/pgtable.h>
 #include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 
-#include <mach/zynq_soc.h>
 #include "common.h"
 
 static struct of_device_id zynq_of_bus_ids[] __initdata = {
@@ -68,9 +68,9 @@ static void __init xilinx_irq_init(void)
        of_irq_init(irq_match);
 }
 
-/* The minimum devices needed to be mapped before the VM system is up and
- * running include the GIC, UART and Timer Counter.
- */
+#define SCU_PERIPH_PHYS                0xF8F00000
+#define SCU_PERIPH_SIZE                SZ_8K
+#define SCU_PERIPH_VIRT                (VMALLOC_END - SCU_PERIPH_SIZE)
 
 static struct map_desc scu_desc __initdata = {
        .virtual        = SCU_PERIPH_VIRT,
diff --git a/arch/arm/mach-zynq/include/mach/uart.h b/arch/arm/mach-zynq/include/mach/uart.h
deleted file mode 100644 (file)
index 5c47c97..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* arch/arm/mach-zynq/include/mach/uart.h
- *
- *  Copyright (C) 2011 Xilinx
- *
- * 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.
- */
-
-#ifndef __MACH_UART_H__
-#define __MACH_UART_H__
-
-#define UART_CR_OFFSET         0x00  /* Control Register [8:0] */
-#define UART_SR_OFFSET         0x2C  /* Channel Status [11:0] */
-#define UART_FIFO_OFFSET       0x30  /* FIFO [15:0] or [7:0] */
-
-#define UART_SR_TXFULL         0x00000010      /* TX FIFO full */
-#define UART_SR_TXEMPTY                0x00000008      /* TX FIFO empty */
-
-#endif
diff --git a/arch/arm/mach-zynq/include/mach/uncompress.h b/arch/arm/mach-zynq/include/mach/uncompress.h
deleted file mode 100644 (file)
index af4e844..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* arch/arm/mach-zynq/include/mach/uncompress.h
- *
- *  Copyright (C) 2011 Xilinx
- *
- * 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.
- */
-
-#ifndef __MACH_UNCOMPRESS_H__
-#define __MACH_UNCOMPRESS_H__
-
-#include <linux/io.h>
-#include <asm/processor.h>
-#include <mach/zynq_soc.h>
-#include <mach/uart.h>
-
-void arch_decomp_setup(void)
-{
-}
-
-static inline void flush(void)
-{
-       /*
-        * Wait while the FIFO is not empty
-        */
-       while (!(__raw_readl(IOMEM(LL_UART_PADDR + UART_SR_OFFSET)) &
-               UART_SR_TXEMPTY))
-               cpu_relax();
-}
-
-#define arch_decomp_wdog()
-
-static void putc(char ch)
-{
-       /*
-        * Wait for room in the FIFO, then write the char into the FIFO
-        */
-       while (__raw_readl(IOMEM(LL_UART_PADDR + UART_SR_OFFSET)) &
-               UART_SR_TXFULL)
-               cpu_relax();
-
-       __raw_writel(ch, IOMEM(LL_UART_PADDR + UART_FIFO_OFFSET));
-}
-
-#endif
diff --git a/arch/arm/mach-zynq/include/mach/zynq_soc.h b/arch/arm/mach-zynq/include/mach/zynq_soc.h
deleted file mode 100644 (file)
index 2995044..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* arch/arm/mach-zynq/include/mach/zynq_soc.h
- *
- *  Copyright (C) 2011 Xilinx
- *
- * 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.
- */
-
-#ifndef __MACH_XILINX_SOC_H__
-#define __MACH_XILINX_SOC_H__
-
-#include <asm/pgtable.h>
-
-#define PERIPHERAL_CLOCK_RATE          2500000
-
-/* Static peripheral mappings are mapped at the top of the vmalloc region.  The
- * early uart mapping causes intermediate problems/failure at certain
- * addresses, including the very top of the vmalloc region.  Map it at an
- * address that is known to work.
- */
-#define UART0_PHYS             0xE0000000
-#define UART1_PHYS             0xE0001000
-#define UART_SIZE              SZ_4K
-#define UART_VIRT              0xF0001000
-
-#define SCU_PERIPH_PHYS                0xF8F00000
-#define SCU_PERIPH_SIZE                SZ_8K
-#define SCU_PERIPH_VIRT                (VMALLOC_END - SCU_PERIPH_SIZE)
-
-#if IS_ENABLED(CONFIG_DEBUG_ZYNQ_UART1)
-# define LL_UART_PADDR         UART1_PHYS
-#else
-# define LL_UART_PADDR         UART0_PHYS
-#endif
-
-#define LL_UART_VADDR          UART_VIRT
-
-/* The following are intended for the devices that are mapped early */
-
-#define TTC0_BASE                      IOMEM(TTC0_VIRT)
-#define SCU_PERIPH_BASE                        IOMEM(SCU_PERIPH_VIRT)
-
-#endif