From patchwork Tue Jul 24 01:09:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Chemparathy X-Patchwork-Id: 1415661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 9EFD0DFFCF for ; Thu, 6 Sep 2012 15:09:10 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9dbU-0005rF-Ge; Thu, 06 Sep 2012 15:02:50 +0000 Received: from bombadil.infradead.org ([2001:4830:2446:ff00:4687:fcff:fea6:5117]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1StU50-0003kO-7D for linux-arm-kernel@merlin.infradead.org; Tue, 24 Jul 2012 01:38:30 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1StTdD-0000Qg-2Z for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2012 01:09:49 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q6O19edu030402; Mon, 23 Jul 2012 20:09:40 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q6O19eYS010284; Mon, 23 Jul 2012 20:09:40 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Mon, 23 Jul 2012 20:09:40 -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 q6O19eto024617; Mon, 23 Jul 2012 20:09:40 -0500 Received: from a0875269 by ares-ubuntu.am.dhcp.ti.com with local (Exim 4.76) (envelope-from ) id 1StTd6-0002Ur-1Y; Mon, 23 Jul 2012 21:09:40 -0400 From: Cyril Chemparathy To: Subject: [RFC 21/23] ARM: keystone: introducing TI Keystone platform Date: Mon, 23 Jul 2012 21:09:23 -0400 Message-ID: <1343092165-9470-22-git-send-email-cyril@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343092165-9470-1-git-send-email-cyril@ti.com> References: <1343092165-9470-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120723_210947_563415_EA871A25 X-CRM114-Status: GOOD ( 16.17 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.94.94.41 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:38 -0400 Cc: nico@linaro.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, Vitaly Andrianov , 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 --- arch/arm/Kconfig | 17 +++++ 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/entry-macro.S | 20 +++++ arch/arm/mach-keystone/include/mach/io.h | 22 ++++++ arch/arm/mach-keystone/include/mach/memory.h | 22 ++++++ arch/arm/mach-keystone/include/mach/system.h | 30 ++++++++ arch/arm/mach-keystone/include/mach/timex.h | 21 ++++++ arch/arm/mach-keystone/include/mach/uncompress.h | 24 ++++++ arch/arm/mach-keystone/include/mach/vmalloc.h | 21 ++++++ arch/arm/mach-keystone/keystone.c | 83 +++++++++++++++++++++ 15 files changed, 404 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/entry-macro.S create mode 100644 arch/arm/mach-keystone/include/mach/io.h create mode 100644 arch/arm/mach-keystone/include/mach/memory.h create mode 100644 arch/arm/mach-keystone/include/mach/system.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/include/mach/vmalloc.h create mode 100644 arch/arm/mach-keystone/keystone.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 55da671..04c846b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -359,6 +359,23 @@ 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 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 0298b00..13d6ef5 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -143,6 +143,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..118d631 --- /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,9M"; + }; + + 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/entry-macro.S b/arch/arm/mach-keystone/include/mach/entry-macro.S new file mode 100644 index 0000000..7f486f3 --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/entry-macro.S @@ -0,0 +1,20 @@ +/* + * 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 . + */ + .macro disable_fiq + .endm + + .macro arch_ret_to_user, tmp1, tmp2 + .endm diff --git a/arch/arm/mach-keystone/include/mach/io.h b/arch/arm/mach-keystone/include/mach/io.h new file mode 100644 index 0000000..844d659 --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/io.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 __MACH_IO_H +#define __MACH_IO_H + +#define __io(a) ({ (void)(a); __typesafe_io(0); }) +#define __mem_pci(a) (a) + +#endif 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/system.h b/arch/arm/mach-keystone/include/mach/system.h new file mode 100644 index 0000000..4887b4c --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/system.h @@ -0,0 +1,30 @@ +/* + * 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_SYSTEM_H +#define __MACH_SYSTEM_H + +static inline void arch_idle(void) +{ + cpu_do_idle(); +} + +static inline void arch_reset(char mode, const char *cmd) +{ + while (1) + ; +} + +#endif 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/include/mach/vmalloc.h b/arch/arm/mach-keystone/include/mach/vmalloc.h new file mode 100644 index 0000000..9d34c09 --- /dev/null +++ b/arch/arm/mach-keystone/include/mach/vmalloc.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_VMALLOC_H +#define __MACH_VMALLOC_H + +#define VMALLOC_END 0xFE800000UL + +#endif diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c new file mode 100644 index 0000000..9583dc4 --- /dev/null +++ b/arch/arm/mach-keystone/keystone.c @@ -0,0 +1,83 @@ +/* + * 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, sizeof(io_desc)/sizeof(struct map_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, + .nr_irqs = 480, +MACHINE_END