From patchwork Sat Aug 11 01:25:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Chemparathy X-Patchwork-Id: 1416221 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 473C13FC85 for ; Thu, 6 Sep 2012 15:39:05 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9e33-00074R-MZ; Thu, 06 Sep 2012 15:31:20 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T00SO-0007wf-SF for linux-arm-kernel@lists.infradead.org; Sat, 11 Aug 2012 01:26:01 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q7B1PPG4014221; Fri, 10 Aug 2012 20:25:25 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7B1PPPR010348; Fri, 10 Aug 2012 20:25:25 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Fri, 10 Aug 2012 20:25:24 -0500 Received: from ares-ubuntu.am.dhcp.ti.com (ares-ubuntu.am.dhcp.ti.com [158.218.103.17]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7B1PPZH001426; Fri, 10 Aug 2012 20:25:25 -0500 Received: from a0875269 by ares-ubuntu.am.dhcp.ti.com with local (Exim 4.76) (envelope-from ) id 1T00SC-00045V-R3; Fri, 10 Aug 2012 21:25:24 -0400 From: Cyril Chemparathy To: , Subject: [RFC v2 20/22] ARM: keystone: introducing TI Keystone platform Date: Fri, 10 Aug 2012 21:25:03 -0400 Message-ID: <1344648306-15619-21-git-send-email-cyril@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344648306-15619-1-git-send-email-cyril@ti.com> References: <1344648306-15619-1-git-send-email-cyril@ti.com> MIME-Version: 1.0 X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Mailman-Approved-At: Thu, 06 Sep 2012 10:43:39 -0400 Cc: linux@arm.linux.org.uk, arnd@arndb.de, nico@linaro.org, catalin.marinas@arm.com, will.deacon@arm.com, Vitaly Andrianov , grant.likely@secretlab.ca, Cyril Chemparathy X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Texas Instruments Keystone family of multicore devices now includes an upcoming slew of Cortex A15 based devices. This patch adds basic definitions for a new Keystone sub-architecture in ARM. Subsequent patches in this series will extend support to include SMP and take advantage of the large physical memory addressing capabilities via LPAE. Signed-off-by: Vitaly Andrianov Signed-off-by: Cyril Chemparathy Reviewed-by: Arnd Bergmann --- arch/arm/Kconfig | 18 +++++ arch/arm/Makefile | 1 + arch/arm/boot/dts/keystone-sim.dts | 77 +++++++++++++++++++ arch/arm/configs/keystone_defconfig | 20 +++++ arch/arm/mach-keystone/Makefile | 1 + arch/arm/mach-keystone/Makefile.boot | 1 + arch/arm/mach-keystone/include/mach/debug-macro.S | 44 +++++++++++ arch/arm/mach-keystone/include/mach/memory.h | 22 ++++++ arch/arm/mach-keystone/include/mach/timex.h | 21 ++++++ arch/arm/mach-keystone/include/mach/uncompress.h | 24 ++++++ arch/arm/mach-keystone/keystone.c | 82 +++++++++++++++++++++ 11 files changed, 311 insertions(+) create mode 100644 arch/arm/boot/dts/keystone-sim.dts create mode 100644 arch/arm/configs/keystone_defconfig create mode 100644 arch/arm/mach-keystone/Makefile create mode 100644 arch/arm/mach-keystone/Makefile.boot create mode 100644 arch/arm/mach-keystone/include/mach/debug-macro.S create mode 100644 arch/arm/mach-keystone/include/mach/memory.h create mode 100644 arch/arm/mach-keystone/include/mach/timex.h create mode 100644 arch/arm/mach-keystone/include/mach/uncompress.h create mode 100644 arch/arm/mach-keystone/keystone.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9ac86ea..f1b8aa0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -402,6 +402,24 @@ config ARCH_HIGHBANK help Support for the Calxeda Highbank SoC based boards. +config ARCH_KEYSTONE + bool "Texas Instruments Keystone Devices" + select ARCH_WANT_OPTIONAL_GPIOLIB + select ARM_GIC + select MULTI_IRQ_HANDLER + select CLKDEV_LOOKUP + select COMMON_CLK + select CLKSRC_MMIO + select CPU_V7 + select GENERIC_CLOCKEVENTS + select USE_OF + select SPARSE_IRQ + select NEED_MACH_MEMORY_H + select HAVE_SCHED_CLOCK + help + Support for boards based on the Texas Instruments Keystone family of + SoCs. + config ARCH_CLPS711X bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" select CPU_ARM720T diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 30eae87..75b5b79 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -146,6 +146,7 @@ machine-$(CONFIG_ARCH_EP93XX) := ep93xx machine-$(CONFIG_ARCH_GEMINI) := gemini machine-$(CONFIG_ARCH_H720X) := h720x machine-$(CONFIG_ARCH_HIGHBANK) := highbank +machine-$(CONFIG_ARCH_KEYSTONE) := keystone machine-$(CONFIG_ARCH_INTEGRATOR) := integrator machine-$(CONFIG_ARCH_IOP13XX) := iop13xx machine-$(CONFIG_ARCH_IOP32X) := iop32x diff --git a/arch/arm/boot/dts/keystone-sim.dts b/arch/arm/boot/dts/keystone-sim.dts new file mode 100644 index 0000000..acec30f8 --- /dev/null +++ b/arch/arm/boot/dts/keystone-sim.dts @@ -0,0 +1,77 @@ +/dts-v1/; +/include/ "skeleton.dtsi" + +/ { + model = "Texas Instruments Keystone 2 SoC"; + compatible = "ti,keystone-evm"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + + aliases { + serial0 = &uart0; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 debug earlyprintk lpj=50000 rdinit=/bin/ash rw root=/dev/ram0 initrd=0x85000000,2M"; + }; + + memory { + reg = <0x80000000 0x8000000>; + }; + + cpus { + interrupt-parent = <&gic>; + + cpu@0 { + compatible = "arm,cortex-a15"; + }; + + cpu@1 { + compatible = "arm,cortex-a15"; + }; + + cpu@2 { + compatible = "arm,cortex-a15"; + }; + + cpu@3 { + compatible = "arm,cortex-a15"; + }; + + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + ranges; + compatible = "ti,keystone","simple-bus"; + interrupt-parent = <&gic>; + + gic: interrupt-controller@02560000 { + compatible = "arm,cortex-a15-gic"; + #interrupt-cells = <3>; + #size-cells = <0>; + #address-cells = <1>; + interrupt-controller; + reg = <0x02561000 0x1000>, + <0x02562000 0x2000>; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <1 13 0xf08 1 14 0xf08>; + clock-frequency = <10000000>; /* Freq in Hz - optional */ + }; + + uart0: serial@02530c00 { + compatible = "ns16550a"; + current-speed = <115200>; + reg-shift = <2>; + reg-io-width = <4>; + reg = <0x02530c00 0x100>; + clock-frequency = <48000000>; + interrupts = <0 277 0xf01>; + }; + }; +}; diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig new file mode 100644 index 0000000..7f2a04b --- /dev/null +++ b/arch/arm/configs/keystone_defconfig @@ -0,0 +1,20 @@ +CONFIG_EXPERIMENTAL=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_ARCH_KEYSTONE=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_AEABI=y +CONFIG_HIGHMEM=y +CONFIG_VFP=y +CONFIG_NEON=y +# CONFIG_SUSPEND is not set +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_BLK_DEV_RAM=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_PRINTK_TIME=y +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_USER=y +CONFIG_DEBUG_LL=y +CONFIG_EARLY_PRINTK=y diff --git a/arch/arm/mach-keystone/Makefile b/arch/arm/mach-keystone/Makefile new file mode 100644 index 0000000..d4671d5 --- /dev/null +++ b/arch/arm/mach-keystone/Makefile @@ -0,0 +1 @@ +obj-y := keystone.o diff --git a/arch/arm/mach-keystone/Makefile.boot b/arch/arm/mach-keystone/Makefile.boot new file mode 100644 index 0000000..dae9661 --- /dev/null +++ b/arch/arm/mach-keystone/Makefile.boot @@ -0,0 +1 @@ +zreladdr-y := 0x00008000 diff --git a/arch/arm/mach-keystone/include/mach/debug-macro.S b/arch/arm/mach-keystone/include/mach/debug-macro.S new file mode 100644 index 0000000..1108210 --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/debug-macro.S @@ -0,0 +1,44 @@ +/* + * Debugging macro include header + * + * Copyright 2010-2012 Texas Instruments, Inc. + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope 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, see . + */ +#include + +#define UART_SHIFT 2 + + .macro addruart,rp,rv,tmp + movw \rv, #0x0c00 + movt \rv, #0xfed3 + movw \rp, #0x0c00 + movt \rp, #0x0253 + .endm + + + .macro senduart,rd,rx + str \rd, [\rx, #UART_TX << UART_SHIFT] + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] + and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE + teq \rd, #UART_LSR_TEMT | UART_LSR_THRE + bne 1002b + .endm + + .macro waituart,rd,rx + .endm diff --git a/arch/arm/mach-keystone/include/mach/memory.h b/arch/arm/mach-keystone/include/mach/memory.h new file mode 100644 index 0000000..7c78b1e --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/memory.h @@ -0,0 +1,22 @@ +/* + * Copyright 2010-2012 Texas Instruments, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope 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, see . + */ +#ifndef __ASM_MACH_MEMORY_H +#define __ASM_MACH_MEMORY_H + +#define MAX_PHYSMEM_BITS 36 +#define SECTION_SIZE_BITS 34 + +#endif /* __ASM_MACH_MEMORY_H */ diff --git a/arch/arm/mach-keystone/include/mach/timex.h b/arch/arm/mach-keystone/include/mach/timex.h new file mode 100644 index 0000000..f355ecb --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/timex.h @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2012 Texas Instruments, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope 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, see . + */ +#ifndef __MACH_TIMEX_H +#define __MACH_TIMEX_H + +#define CLOCK_TICK_RATE 1000000 + +#endif diff --git a/arch/arm/mach-keystone/include/mach/uncompress.h b/arch/arm/mach-keystone/include/mach/uncompress.h new file mode 100644 index 0000000..1071761 --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/uncompress.h @@ -0,0 +1,24 @@ +/* + * Copyright 2010-2012 Texas Instruments, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope 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, see . + */ +#ifndef __MACH_UNCOMPRESS_H +#define __MACH_UNCOMPRESS_H + +#define putc(c) +#define flush() +#define arch_decomp_setup() +#define arch_decomp_wdog() + +#endif diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c new file mode 100644 index 0000000..702c184 --- /dev/null +++ b/arch/arm/mach-keystone/keystone.c @@ -0,0 +1,82 @@ +/* + * Copyright 2010-2012 Texas Instruments, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope 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, see . + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static struct map_desc io_desc[] = { + { + .virtual = 0xfe800000UL, + .pfn = __phys_to_pfn(0x02000000UL), + .length = 0x800000UL, + .type = MT_DEVICE + }, +}; + +static void __init keystone_map_io(void) +{ + iotable_init(io_desc, ARRAY_SIZE(io_desc)); +} + +static const struct of_device_id irq_match[] = { + { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, }, + {} +}; + +static void __init keystone_init_irq(void) +{ + of_irq_init(irq_match); +} + + +static void __init keystone_timer_init(void) +{ + arch_timer_of_register(); + arch_timer_sched_clock_init(); +} + +static struct sys_timer keystone_timer = { + .init = keystone_timer_init, +}; + + +static void __init keystone_init(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + +static const char *keystone_match[] __initconst = { + "ti,keystone-evm", + NULL, +}; + +DT_MACHINE_START(KEYSTONE, "Keystone") + .map_io = keystone_map_io, + .init_irq = keystone_init_irq, + .timer = &keystone_timer, + .handle_irq = gic_handle_irq, + .init_machine = keystone_init, + .dt_compat = keystone_match, +MACHINE_END