Skip to content

Commit

Permalink
Merge branch 'zynq/master' of git+ssh://master.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/arm/linux-arm-soc into next/soc

Conflicts:
	arch/arm/Kconfig
	arch/arm/mm/Kconfig
  • Loading branch information
Arnd Bergmann committed Jul 17, 2011
2 parents a990cbd + 3d64b44 commit 3a6cb8c
Show file tree
Hide file tree
Showing 24 changed files with 918 additions and 8 deletions.
7 changes: 7 additions & 0 deletions Documentation/devicetree/bindings/arm/xilinx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Xilinx Zynq EP107 Emulation Platform board

This board is an emulation platform for the Zynq product which is
based on an ARM Cortex A9 processor.

Required root node properties:
- compatible = "xlnx,zynq-ep107";
26 changes: 19 additions & 7 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,19 @@ config ARCH_GEMINI
help
Support for the Cortina Systems Gemini family SoCs

config ARCH_PRIMA2
bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
select CPU_V7
select GENERIC_TIME
select NO_IOPORT
select GENERIC_CLOCKEVENTS
select CLKDEV_LOOKUP
select GENERIC_IRQ_CHIP
select USE_OF
select ZONE_DMA
help
Support for CSR SiRFSoC ARM Cortex A9 Platform

config ARCH_EBSA110
bool "EBSA-110"
select CPU_SA110
Expand Down Expand Up @@ -880,19 +893,18 @@ config ARCH_VT8500
help
Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.

config ARCH_PRIMA2
bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
config ARCH_ZYNQ
bool "Xilinx Zynq ARM Cortex A9 Platform"
select CPU_V7
select GENERIC_TIME
select NO_IOPORT
select GENERIC_CLOCKEVENTS
select CLKDEV_LOOKUP
select GENERIC_IRQ_CHIP
select ARM_GIC
select ARM_AMBA
select ICST
select USE_OF
select ZONE_DMA
help
Support for CSR SiRFSoC ARM Cortex A9 Platform

Support for Xilinx Zynq ARM Cortex A9 Platform
endchoice

#
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,15 @@ machine-$(CONFIG_MACH_SPEAR300) := spear3xx
machine-$(CONFIG_MACH_SPEAR310) := spear3xx
machine-$(CONFIG_MACH_SPEAR320) := spear3xx
machine-$(CONFIG_MACH_SPEAR600) := spear6xx
machine-$(CONFIG_ARCH_ZYNQ) := zynq

# Platform directory name. This list is sorted alphanumerically
# by CONFIG_* macro name.
plat-$(CONFIG_ARCH_MXC) := mxc
plat-$(CONFIG_ARCH_OMAP) := omap
plat-$(CONFIG_ARCH_S3C64XX) := samsung
plat-$(CONFIG_ARCH_TCC_926) := tcc
plat-$(CONFIG_ARCH_ZYNQ) := versatile
plat-$(CONFIG_PLAT_IOP) := iop
plat-$(CONFIG_PLAT_NOMADIK) := nomadik
plat-$(CONFIG_PLAT_ORION) := orion
Expand Down
52 changes: 52 additions & 0 deletions arch/arm/boot/dts/zynq-ep107.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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.
*/

/dts-v1/;
/ {
model = "Xilinx Zynq EP107";
compatible = "xlnx,zynq-ep107";
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;

memory {
device_type = "memory";
reg = <0x0 0x10000000>;
};

chosen {
bootargs = "console=ttyPS0,9600 root=/dev/ram rw initrd=0x800000,8M earlyprintk";
linux,stdout-path = &uart0;
};

amba {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;

intc: interrupt-controller@f8f01000 {
interrupt-controller;
compatible = "arm,gic";
reg = <0xF8F01000 0x1000>;
#interrupt-cells = <2>;
};

uart0: uart@e0000000 {
compatible = "xlnx,xuartps";
reg = <0xE0000000 0x1000>;
interrupts = <59 0>;
clock = <50000000>;
};
};
};
6 changes: 6 additions & 0 deletions arch/arm/mach-zynq/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Makefile for the linux kernel.
#

# Common support
obj-y := common.o timer.o board_dt.o
3 changes: 3 additions & 0 deletions arch/arm/mach-zynq/Makefile.boot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
zreladdr-y := 0x00008000
params_phys-y := 0x00000100
initrd_phys-y := 0x00800000
Empty file added arch/arm/mach-zynq/board_dt.c
Empty file.
118 changes: 118 additions & 0 deletions arch/arm/mach-zynq/common.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* This file contains common code that is intended to be used across
* boards so that it's not replicated.
*
* 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.
*/

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/cpumask.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/of.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach-types.h>
#include <asm/page.h>
#include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h>

#include <mach/zynq_soc.h>
#include <mach/clkdev.h>
#include "common.h"

static struct of_device_id zynq_of_bus_ids[] __initdata = {
{ .compatible = "simple-bus", },
{}
};

/**
* xilinx_init_machine() - System specific initialization, intended to be
* called from board specific initialization.
*/
static void __init xilinx_init_machine(void)
{
#ifdef CONFIG_CACHE_L2X0
/*
* 64KB way size, 8-way associativity, parity disabled
*/
l2x0_init(PL310_L2CC_BASE, 0x02060000, 0xF0F0FFFF);
#endif

of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL);
}

/**
* xilinx_irq_init() - Interrupt controller initialization for the GIC.
*/
static void __init xilinx_irq_init(void)
{
gic_init(0, 29, SCU_GIC_DIST_BASE, SCU_GIC_CPU_BASE);
}

/* The minimum devices needed to be mapped before the VM system is up and
* running include the GIC, UART and Timer Counter.
*/

static struct map_desc io_desc[] __initdata = {
{
.virtual = TTC0_VIRT,
.pfn = __phys_to_pfn(TTC0_PHYS),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = SCU_PERIPH_VIRT,
.pfn = __phys_to_pfn(SCU_PERIPH_PHYS),
.length = SZ_8K,
.type = MT_DEVICE,
}, {
.virtual = PL310_L2CC_VIRT,
.pfn = __phys_to_pfn(PL310_L2CC_PHYS),
.length = SZ_4K,
.type = MT_DEVICE,
},

#ifdef CONFIG_DEBUG_LL
{
.virtual = UART0_VIRT,
.pfn = __phys_to_pfn(UART0_PHYS),
.length = SZ_4K,
.type = MT_DEVICE,
},
#endif

};

/**
* xilinx_map_io() - Create memory mappings needed for early I/O.
*/
static void __init xilinx_map_io(void)
{
iotable_init(io_desc, ARRAY_SIZE(io_desc));
}

static const char *xilinx_dt_match[] = {
"xlnx,zynq-ep107",
NULL
};

MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
.map_io = xilinx_map_io,
.init_irq = xilinx_irq_init,
.init_machine = xilinx_init_machine,
.timer = &xttcpss_sys_timer,
.dt_compat = xilinx_dt_match,
MACHINE_END
24 changes: 24 additions & 0 deletions arch/arm/mach-zynq/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* This file contains common function prototypes to avoid externs
* in the c files.
*
* 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_ZYNQ_COMMON_H__
#define __MACH_ZYNQ_COMMON_H__

#include <asm/mach/time.h>

extern struct sys_timer xttcpss_sys_timer;

#endif
32 changes: 32 additions & 0 deletions arch/arm/mach-zynq/include/mach/clkdev.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* arch/arm/mach-zynq/include/mach/clkdev.h
*
* Copyright (C) 2011 Xilinx, Inc.
*
* 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_CLKDEV_H__
#define __MACH_CLKDEV_H__

#include <plat/clock.h>

struct clk {
unsigned long rate;
const struct clk_ops *ops;
const struct icst_params *params;
void __iomem *vcoreg;
};

#define __clk_get(clk) ({ 1; })
#define __clk_put(clk) do { } while (0)

#endif
36 changes: 36 additions & 0 deletions arch/arm/mach-zynq/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* arch/arm/mach-zynq/include/mach/debug-macro.S
*
* Debugging macro include header
*
* 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.
*/

#include <mach/zynq_soc.h>
#include <mach/uart.h>

.macro addruart, rp, rv
ldr \rp, =LL_UART_PADDR @ physical
ldr \rv, =LL_UART_VADDR @ virtual
.endm

.macro senduart,rd,rx
str \rd, [\rx, #UART_FIFO_OFFSET] @ TXDATA
.endm

.macro waituart,rd,rx
.endm

.macro busyuart,rd,rx
1002: ldr \rd, [\rx, #UART_SR_OFFSET] @ get status register
tst \rd, #UART_SR_TXFULL @
bne 1002b @ wait if FIFO is full
.endm
30 changes: 30 additions & 0 deletions arch/arm/mach-zynq/include/mach/entry-macro.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* arch/arm/mach-zynq/include/mach/entry-macro.S
*
* Low-level IRQ helper macros
*
* Copyright (C) 2011 Xilinx
*
* based on arch/plat-mxc/include/mach/entry-macro.S
*
* Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
*
* 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 <mach/hardware.h>
#include <asm/hardware/entry-macro-gic.S>

.macro disable_fiq
.endm

.macro arch_ret_to_user, tmp1, tmp2
.endm
18 changes: 18 additions & 0 deletions arch/arm/mach-zynq/include/mach/hardware.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* arch/arm/mach-zynq/include/mach/hardware.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_HARDWARE_H__
#define __MACH_HARDWARE_H__

#endif
Loading

0 comments on commit 3a6cb8c

Please sign in to comment.