From patchwork Mon Nov 19 01:01:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C028613BF for ; Mon, 19 Nov 2018 01:03:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF5E22998D for ; Mon, 19 Nov 2018 01:03:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3421299B7; Mon, 19 Nov 2018 01:03:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB52C299B4 for ; Mon, 19 Nov 2018 01:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MMLdn7GXm0BKZHW780lbCpOSlMpDAi+3oqdX4XCldPs=; b=IAwcntyySFP6GWp43Z746HusVM ZuW3/a+Ux62Bb+gsbbI3/BTpLBXqz9ENGoHiohSwOpZMABDI8cy69lz2WPHQ18ZtGGpsZi8Nn/6t/ z6PrNz8vFIG1ytST7aaREUaRFWbDtULAXRxAIzFOcCM0AmHC8JeklvTlFFr9/Qaal42W3AJZmb8Zp GfNd9wWLH+ZTABVQmjH2TgO6jBcJhPmbqjkjxol/WVtLE5v4svS0z0gj1n+YhJ0llHsi/ph8QJI55 9p9KwMYaS5tzfNuJlB15bXxy6YIATnQ1IsfIh7dRlnXkdvVo2Iie/OxgBnmmDKCM8oU81x78BzLhr 0ae5HYQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXxp-0002EG-IE; Mon, 19 Nov 2018 01:02:57 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvq-0000Q8-6L for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KJ9mUbKUtWzbumUALTFbZ+i8QeNryRmGa91nVup+JbQ=; b=n4tFoBQT792FRcbwNmP8gI2nt gI6fZHi1Ly/mnMqEz1m+ISJ9IJUD0ENdhMp1ifNe6MHu0mROY+3HI4z/q9ob2GWWiN+m2eXrlGy7u wgw8+OyIHRpJpMMQ5vICCtldDQ+SvCDNLrUFXGTlvYg3ubVKHMi4tdGNQW7ZBS5NLv+95xXA9KWbr JsaekFocH3TTfEn6fnzE06yhYqrn6dGy6Sbe2o0jdwlfYvXe9DSAkM/g01mLv/Zh65kIM7qq7uPcR 45VUklnwfQRwFsR8dELDQNJYZ4FKKIRhLkKVcqntMDfLlYRD5mgoGIkVHj+SBifSNC8VVaA2Rhjep RQrf9eiTw==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvk-00036R-IW for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:52 +0000 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:29 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 8570F60062; Mon, 19 Nov 2018 10:00:29 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:29 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 1743D40387; Mon, 19 Nov 2018 10:00:29 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id EAC35120455; Mon, 19 Nov 2018 10:00:28 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 01/14] ARM: milbeaut: Add basic support for Milbeaut m10v SoC Date: Mon, 19 Nov 2018 10:01:06 +0900 Message-Id: <1542589274-13878-2-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010049_437692_A8A37853 X-CRM114-Status: GOOD ( 32.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the basic M10V SoC support under arch/arm. Since all cores are activated in the custom bootloader before booting linux, it is necessary to wait for sub-cores using the trampoline area. Signed-off-by: Sugaya Taichi --- arch/arm/Kconfig | 2 + arch/arm/Makefile | 1 + arch/arm/mach-milbeaut/Kconfig | 28 +++++++ arch/arm/mach-milbeaut/Makefile | 3 + arch/arm/mach-milbeaut/m10v_evb.c | 31 ++++++++ arch/arm/mach-milbeaut/platsmp.c | 157 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 222 insertions(+) create mode 100644 arch/arm/mach-milbeaut/Kconfig create mode 100644 arch/arm/mach-milbeaut/Makefile create mode 100644 arch/arm/mach-milbeaut/m10v_evb.c create mode 100644 arch/arm/mach-milbeaut/platsmp.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 91be74d..0b8a1af 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -767,6 +767,8 @@ source "arch/arm/mach-mediatek/Kconfig" source "arch/arm/mach-meson/Kconfig" +source "arch/arm/mach-milbeaut/Kconfig" + source "arch/arm/mach-mmp/Kconfig" source "arch/arm/mach-moxart/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 05a91d8..627853c 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -190,6 +190,7 @@ machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 machine-$(CONFIG_ARCH_MVEBU) += mvebu machine-$(CONFIG_ARCH_MXC) += imx machine-$(CONFIG_ARCH_MEDIATEK) += mediatek +machine-$(CONFIG_ARCH_MILBEAUT) += milbeaut machine-$(CONFIG_ARCH_MXS) += mxs machine-$(CONFIG_ARCH_NETX) += netx machine-$(CONFIG_ARCH_NOMADIK) += nomadik diff --git a/arch/arm/mach-milbeaut/Kconfig b/arch/arm/mach-milbeaut/Kconfig new file mode 100644 index 0000000..63b6f69 --- /dev/null +++ b/arch/arm/mach-milbeaut/Kconfig @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0 +menuconfig ARCH_MILBEAUT + bool "Socionext Milbeaut SoCs" + depends on ARCH_MULTI_V7 + select ARM_GIC + select CLKDEV_LOOKUP + select GENERIC_CLOCKEVENTS + select CLKSRC_MMIO + select ZONE_DMA + help + This enables support for Socionext Milbeaut SoCs + +if ARCH_MILBEAUT + +config ARCH_MILBEAUT_M10V + bool "Milbeaut SC2000/M10V platform" + select ARM_ARCH_TIMER + select M10V_TIMER + select PINCTRL + select PINCTRL_M10V + help + Support for Socionext's MILBEAUT M10V based systems + +config MACH_M10V_EVB + bool "Support for Milbeaut Evaluation boards" + default y + +endif diff --git a/arch/arm/mach-milbeaut/Makefile b/arch/arm/mach-milbeaut/Makefile new file mode 100644 index 0000000..64f6f52 --- /dev/null +++ b/arch/arm/mach-milbeaut/Makefile @@ -0,0 +1,3 @@ +obj-$(CONFIG_SMP) += platsmp.o +obj-$(CONFIG_MACH_M10V_EVB) += m10v_evb.o + diff --git a/arch/arm/mach-milbeaut/m10v_evb.c b/arch/arm/mach-milbeaut/m10v_evb.c new file mode 100644 index 0000000..a1fa7c3 --- /dev/null +++ b/arch/arm/mach-milbeaut/m10v_evb.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Socionext Inc. + * Copyright: (C) 2015 Linaro Ltd. + */ + +#include +#include + +#include +#include + +static struct map_desc m10v_io_desc[] __initdata = { +}; + +void __init m10v_map_io(void) +{ + debug_ll_io_init(); + iotable_init(m10v_io_desc, ARRAY_SIZE(m10v_io_desc)); +} + +static const char * const m10v_compat[] = { + "socionext,milbeaut-m10v-evb", + NULL, +}; + +DT_MACHINE_START(M10V_REB, "Socionext Milbeaut") + .dt_compat = m10v_compat, + .l2c_aux_mask = 0xffffffff, + .map_io = m10v_map_io, +MACHINE_END diff --git a/arch/arm/mach-milbeaut/platsmp.c b/arch/arm/mach-milbeaut/platsmp.c new file mode 100644 index 0000000..b706851 --- /dev/null +++ b/arch/arm/mach-milbeaut/platsmp.c @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Socionext Inc. + * Copyright: (C) 2015 Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define M10V_MAX_CPU 4 + +#define KERNEL_UNBOOT_FLAG 0x12345678 +#define CPU_FINISH_SUSPEND_FLAG 0x56784321 + +static void __iomem *trampoline; + +static int m10v_boot_secondary(unsigned int l_cpu, struct task_struct *idle) +{ + unsigned int mpidr, cpu, cluster; + + mpidr = cpu_logical_map(l_cpu); + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); + + if (cpu >= M10V_MAX_CPU) + return -EINVAL; + + pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); + + writel(virt_to_phys(secondary_startup), trampoline + cpu * 4); + arch_send_wakeup_ipi_mask(cpumask_of(l_cpu)); + + return 0; +} + +static void m10v_cpu_die(unsigned int l_cpu) +{ + gic_cpu_if_down(0); + + v7_exit_coherency_flush(louis); + + /* Now we are prepared for power-down, do it: */ + wfi(); +} + +static int m10v_cpu_kill(unsigned int l_cpu) +{ + unsigned int mpidr, cpu; + + mpidr = cpu_logical_map(l_cpu); + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); + + writel(KERNEL_UNBOOT_FLAG, trampoline + cpu * 4); + + return 1; +} + +static struct smp_operations m10v_smp_ops __initdata = { + .smp_boot_secondary = m10v_boot_secondary, + .cpu_die = m10v_cpu_die, + .cpu_kill = m10v_cpu_kill, +}; + +static int __init m10v_smp_init(void) +{ + unsigned int mpidr, cpu, cluster; + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "socionext,milbeaut-m10v-evb"); + if (!np || !of_device_is_available(np)) + return -ENODEV; + of_node_put(np); + + np = of_find_compatible_node(NULL, NULL, "socionext,smp-trampoline"); + if (!np) + return -ENODEV; + + trampoline = of_iomap(np, 0); + if (!trampoline) + return -ENODEV; + of_node_put(np); + + mpidr = read_cpuid_mpidr(); + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); + + pr_info("MCPM boot on cpu_%u cluster_%u\n", cpu, cluster); + + for (cpu = 0; cpu < M10V_MAX_CPU; cpu++) + writel(KERNEL_UNBOOT_FLAG, trampoline + cpu * 4); + + smp_set_ops(&m10v_smp_ops); + + return 0; +} +early_initcall(m10v_smp_init); + +static int m10v_pm_valid(suspend_state_t state) +{ + return (state == PM_SUSPEND_STANDBY) || (state == PM_SUSPEND_MEM); +} + +typedef void (*phys_reset_t)(unsigned long); +static phys_reset_t phys_reset; + +static int m10v_die(unsigned long arg) +{ + setup_mm_for_reboot(); + asm("wfi"); + /* Boot just like a secondary */ + phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset); + phys_reset(virt_to_phys(cpu_resume)); + + return 0; +} + +static int m10v_pm_enter(suspend_state_t state) +{ + switch (state) { + case PM_SUSPEND_STANDBY: + pr_err("STANDBY\n"); + asm("wfi"); + break; + case PM_SUSPEND_MEM: + pr_err("SUSPEND\n"); + cpu_pm_enter(); + cpu_suspend(0, m10v_die); + cpu_pm_exit(); + break; + } + return 0; +} + +static const struct platform_suspend_ops m10v_pm_ops = { + .valid = m10v_pm_valid, + .enter = m10v_pm_enter, +}; + +struct clk *m10v_clclk_register(struct device *cpu_dev); + +static int __init m10v_pm_init(void) +{ + suspend_set_ops(&m10v_pm_ops); + + return 0; +} +late_initcall(m10v_pm_init); From patchwork Mon Nov 19 01:01:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9BF113BF for ; Mon, 19 Nov 2018 01:01:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9F8E2957D for ; Mon, 19 Nov 2018 01:01:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8004295CB; Mon, 19 Nov 2018 01:01:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 725922957D for ; Mon, 19 Nov 2018 01:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dHSrGZreSFdXLihXVoTRcSPzahyGQjE/TUmVVAn8Oow=; b=H/J80gY/fNJhhbTbCFZAKyMKY4 k21aaGEdR1WjUJXm0+KvKcVSXr50xds+RH9OL7A0K7VMmrrWZLY9W2mXxV3jePEoc4CVl3icyDObR Xwro8wk4NqNpqVk0BTCQzPINWJTugWk3ZKSdUbqLM1Fm4FmoWE2Szp3la0sPUyEhSJ8N18rcbmnPh VlYh8JZk2VFBMBhsvnAgSetlffie7Quqe3MpN8G4tYEz7QJmeXkQtHeFBI+5bN6UOubt/iD41NfYx YZ2AeCpYJyyCbzdCicHzCyUlS9ObIBVvAM4YfMmOWUIAHYYTsPfyIAcnLjux/fmDUCu30euav1B7Q NocNVbgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvx-0000Uh-9A; Mon, 19 Nov 2018 01:01:01 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvo-0000Op-R9 for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rhwFspUU6/85fbLt7VjLBzvHaFRAv7suBfz+11KwdZ4=; b=JVr9PtQguvKsbZaZ7qu+XTBxw CK+VG9qt9qcBXsuddgWCmpJnm6AKzQf87os9WkvM6BQiqrk0vkalODMOaW0Uhp/s0Y3ZKId+qbPe4 MUtsWi2jy/Oa1DNXIfYDDtdFrrRXHjXzbouwmkSoH45sWnB9utJcJ1ceKTUhH/frXbRmSTbqWgf0t Llb9gF5XbkcMyKqYi9LhI2U/PT1QRz2oqodX+OdPsRqlA6Qhh2zFyXUcR06YRNyhWtwERRAxECul0 n4SE0jS79Zen32IPceRH2ndiLRXyTbuxeN8J/cq01dkjQaS8PyTJRMTLcVP+Qn15xhMgJigsvCK33 zl6XrIR4Q==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvk-00036e-QC for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:51 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:32 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 37484180111; Mon, 19 Nov 2018 10:00:32 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:32 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id B3AA640387; Mon, 19 Nov 2018 10:00:31 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 92832120455; Mon, 19 Nov 2018 10:00:31 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 02/14] dt-bindings: soc: milbeaut: Add Milbeaut trampoline description Date: Mon, 19 Nov 2018 10:01:07 +0900 Message-Id: <1542589274-13878-3-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010049_105516_2AA70DDE X-CRM114-Status: GOOD ( 23.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add DT bindings document for Milbeaut trampoline. Signed-off-by: Sugaya Taichi --- .../devicetree/bindings/soc/socionext/socionext,m10v.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,m10v.txt diff --git a/Documentation/devicetree/bindings/soc/socionext/socionext,m10v.txt b/Documentation/devicetree/bindings/soc/socionext/socionext,m10v.txt new file mode 100644 index 0000000..f5d906c --- /dev/null +++ b/Documentation/devicetree/bindings/soc/socionext/socionext,m10v.txt @@ -0,0 +1,12 @@ +Socionext M10V SMP trampoline driver binding + +This is a driver to wait for sub-cores while boot process. + +- compatible: should be "socionext,smp-trampoline" +- reg: should be <0x4C000100 0x100> + +EXAMPLE + trampoline: trampoline@0x4C000100 { + compatible = "socionext,smp-trampoline"; + reg = <0x4C000100 0x100>; + }; From patchwork Mon Nov 19 01:01:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2CB314BD for ; Mon, 19 Nov 2018 01:01:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E25CB2957F for ; Mon, 19 Nov 2018 01:01:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6AF42958A; Mon, 19 Nov 2018 01:01:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 628B5295AD for ; Mon, 19 Nov 2018 01:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=gVhAXQpUiteYZH5hDAvMga+CWj1PNotJqcirVmX+O1Y=; b=I8qLdTzDbvfNP8r+asQYMOreGX N1PU13l9N0XBU+q/UQ4wh4Tp6r1QaKmIWK5bRTPOA4AjqugSFf2K+H5ru9VCybPqu0/LlKiFbWEbq /ZJG2pFcRSeewjI5gIfPoHAPwGvtYnt9+h6elX2prH8CTZduTM/O9ya25NbCB3FgE9U+x7M5khqSw W/pLBP54ii+yTOLAnAfBdov/7V7aximBAp+h0EJ4egS0dviHpJH0GWW2vWvmhGSf14YgA0jcUPNt7 SBml9vaPwPTM+fOJ2OB3ld9U8F/DG/Ex7zkB96xLXEr50p4/oBfBFFmGMMZJEic9v07RK4LS7YeMn 60Q39ZBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvn-0000O4-Kr; Mon, 19 Nov 2018 01:00:51 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvm-0000Ms-GA for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+ZzJLIOddXXCJiJ/uq4PNVXLO4hPhqn1t2ruihFITak=; b=HBlLfxpkJ4ab12ee4/j0+EGTN tElhgxzGNl5lws4RNg6YObka/HtZJ4tme66rZdlDQqsKga2pyvT+AQo4eOo5AecP5bOlFJdVz6+zi fBGmn8HjICNR5fsiOVCVaJ/iHzZ6yfOGVEDC5uF4q5Fkg00+fhLB6Pu0dwfhtL7f3hqSy5IDcJmRx 82ngrnEP4b4KZkKUP8IPFwGooRSTpplgbvLDCqvP0E15PRFBz9JQPvSj4BMxGXfoVtIVJNHJjzEZW 3vFB9S/ktmebv8Wf5cD9Yoj+Z9wC2418aTikXZ4OxOlQ5KdxVSruD+RIG0bgdVbchCypo8UmVbuhg bh/nxk0tQ==; Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvj-0003OQ-OY for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:48 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:35 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 4F7F6180111; Mon, 19 Nov 2018 10:00:35 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:35 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id B0C8740387; Mon, 19 Nov 2018 10:00:33 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 8EDB2120455; Mon, 19 Nov 2018 10:00:33 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 03/14] ARM: milbeaut: Add Milbeaut M10V early printk Date: Mon, 19 Nov 2018 10:01:08 +0900 Message-Id: <1542589274-13878-4-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181118_200048_214420_83188FC1 X-CRM114-Status: GOOD ( 25.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add Milbeaut M10V earlyprintk. Signed-off-by: Sugaya Taichi --- arch/arm/Kconfig.debug | 12 ++++++++++-- arch/arm/include/debug/milbeaut.S | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 arch/arm/include/debug/milbeaut.S diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index d6a49f5..5c44533 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1413,6 +1413,11 @@ choice options; the platform specific options are deprecated and will be soon removed. + config DEBUG_LL_MILBEAUT_UART + bool "Kernel low-level debug output via USIO" + depends on ARCH_MILBEAUT + help + Say Y here if you want to debug with USIO endchoice config DEBUG_AT91_UART @@ -1534,6 +1539,7 @@ config DEBUG_LL_INCLUDE default "debug/bcm63xx.S" if DEBUG_BCM63XX_UART default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0 default "debug/brcmstb.S" if DEBUG_BRCMSTB_UART + default "debug/milbeaut.S" if DEBUG_LL_MILBEAUT_UART default "mach/debug-macro.S" # Compatibility options for PL01x @@ -1580,6 +1586,7 @@ config DEBUG_UART_PHYS default 0x18020000 if DEBUG_SIRFATLAS7_UART1 default 0x18023000 if DEBUG_BCM_IPROC_UART3 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 + default 0x1e700010 if ARCH_MILBEAUT_M10V default 0x20001000 if DEBUG_HIP01_UART default 0x20060000 if DEBUG_RK29_UART0 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 @@ -1681,7 +1688,7 @@ config DEBUG_UART_PHYS DEBUG_S3C64XX_UART || \ DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \ - DEBUG_AT91_UART + DEBUG_AT91_UART || DEBUG_LL_MILBEAUT_UART config DEBUG_UART_VIRT hex "Virtual base address of debug UART" @@ -1755,6 +1762,7 @@ config DEBUG_UART_VIRT default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART default 0xfe230000 if DEBUG_PICOXCELL_UART default 0xfe300000 if DEBUG_BCM_KONA_UART + default 0xfe700010 if ARCH_MILBEAUT_M10V default 0xfe800000 if ARCH_IOP32X default 0xfeb00000 if DEBUG_HI3620_UART || DEBUG_HIX5HD2_UART default 0xfeb24000 if DEBUG_RK3X_UART0 @@ -1796,7 +1804,7 @@ config DEBUG_UART_VIRT DEBUG_S3C64XX_UART || \ DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \ - DEBUG_AT91_UART + DEBUG_AT91_UART || DEBUG_LL_MILBEAUT_UART config DEBUG_UART_8250_SHIFT int "Register offset shift for the 8250 debug UART" diff --git a/arch/arm/include/debug/milbeaut.S b/arch/arm/include/debug/milbeaut.S new file mode 100644 index 0000000..0660e0f --- /dev/null +++ b/arch/arm/include/debug/milbeaut.S @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2018 Socionext Inc. + */ + + .macro addruart, rp, rv, tmp + ldr \rp, =CONFIG_DEBUG_UART_PHYS + ldr \rv, =CONFIG_DEBUG_UART_VIRT + .endm + + .macro senduart,rd,rx + strh \rd, [\rx, #0x04] @ write to TxData register + .endm + + .macro waituart,rd,rx +1: ldrb \rd, [\rx, #0x03] @ SSR + tst \rd, #1 << 1 @ check TDRE bit + beq 1b + .endm + + .macro busyuart,rd,rx +2: ldrb \rd, [\rx, #0x03] @ SSR + tst \rd, #1 << 1 @ check TEMT bit + beq 2b + .endm From patchwork Mon Nov 19 01:01:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688111 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C50F613BF for ; Mon, 19 Nov 2018 01:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B25F9295E2 for ; Mon, 19 Nov 2018 01:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A454C29611; Mon, 19 Nov 2018 01:01:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DF9C8295E2 for ; Mon, 19 Nov 2018 01:01:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QlPYTzX29XQwnAenB8oTmyhdWsSI/kNVnF+QZMKZN7c=; b=rTeIIHZIIqJVmyqvVbBzKXYigA 0YyfKN9XegqDuJTjpXl4MUb0mlMyH1luPuwpaLNjHX2zPWU6Pg76wpfZVyw0XXgtoxwW7auOtyn5R xlLH9t03oxs8679sb9AXhdTem+ZjdwbkqXnJ7W6EJFtCo7sSiFienZidQejhpz8H7weB5VtLZx3Ig 01tRCEgo5VBHXIkmY21KbN97ITk1Joe3SBBRIpsosBe7HL0vSV773pQ0CV+zCXN16nXgAe9keYiSg sedrugHdXqGc7cKKrCbQRi+BicbUfuH8OD5KeJbXutpBX7Bw3RB8niGlFmc4CDl6MKkB3mV1QPtf/ lD1jG+mg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXwJ-0000uG-Vd; Mon, 19 Nov 2018 01:01:23 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvn-0000Ne-N6 for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uXLWHVp/y37ie671/NagHHDDnJVvo5ePlQqB5dSS4VA=; b=IYLnf8IAEM3xaiAGdx1Jwqqt4 ssLfN3b7LF6IuAf+sY/vJxm0iqGFDYJtP0iLg2zmKTO4Sxc5KfAOw0Gm6rRjwunb+ZTlz3SpGHjwe vM3W2K3qQeybEa5ukS2pqUwHLyL2OCCeX5A+ofl3U1/UlMFENecmAtHci+CVoi+pd4w4oG/yQiBNt wlm10TyHDsYRzhoSMoHkDLQ8iLYLvOGM0c+a+Z1PX8l4QdRBHnXGTXco6vNoK7lUcCDTRSn8KbxQw 2zzQDA6LYXw2ZdItVLV4vuoo0nh9XQdWcbI8uMbRbI141OeKuIdHzrhi6hxCehIb2qPd4lB7agH2O o+oJBxx/Q==; Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvl-0003OQ-Ad for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:49 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:35 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id D9125180111; Mon, 19 Nov 2018 10:00:35 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:35 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 3620E40387; Mon, 19 Nov 2018 10:00:35 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 15805120455; Mon, 19 Nov 2018 10:00:35 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 04/14] dt-bindings: timer: Add Milbeaut M10V timer description Date: Mon, 19 Nov 2018 10:01:09 +0900 Message-Id: <1542589274-13878-5-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181118_200049_564393_B829C661 X-CRM114-Status: GOOD ( 23.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add DT bindings document for Milbeaut M10V timer. Signed-off-by: Sugaya Taichi --- .../bindings/timer/socionext,milbeaut-timer.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/socionext,milbeaut-timer.txt diff --git a/Documentation/devicetree/bindings/timer/socionext,milbeaut-timer.txt b/Documentation/devicetree/bindings/timer/socionext,milbeaut-timer.txt new file mode 100644 index 0000000..ddb1b31 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/socionext,milbeaut-timer.txt @@ -0,0 +1,17 @@ +Milbeaut SoCs Timer Controller + +Required properties: + +- compatible : should be "socionext,milbeaut-m10v-timer" +- reg : Specifies base physical address and size of the registers. +- interrupts : The interrupt of the first timer +- clocks: should be "rclk" + +Example: + +timer { + compatible = "socionext,milbeaut-m10v-timer"; + reg = <0x1e000050 0x10>, <0x1e000060 0x10>; + interrupts = <0 91 4>; + clocks = <&rclk>; +}; From patchwork Mon Nov 19 01:01:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B392A14BD for ; Mon, 19 Nov 2018 01:02:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25D1295E8 for ; Mon, 19 Nov 2018 01:02:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95A28295F0; Mon, 19 Nov 2018 01:02:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2AC4029634 for ; Mon, 19 Nov 2018 01:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zHZM8a8wpJ4HRZkL8NxCz8xOlBe7igqFLHmvreljOvU=; b=Yek54zjrkCd7HXvhte7WCST2hT 378r4lhsg8xgrvIPT300DRvgQD9+TEHPvqNJiHFXvN9bU81oFT2PUp8uLPwzpqi64EoTvE5EysKh0 emoO1FheRGt8WBzxciD/P8EIsmd4AqUgMHXFEUp0EKm2/Pfm9JlcmT2zCZTIwUA0omQj/vW3dd+mb Ef4I7N0pxwy1LmwuFNPvOHYLM/eMWmMUVDhitLSitRqruCTb8yxaUKfdOe8GIONfhXrnXWc+iUb7K yvtr+r9sPPZ8V3R1NM4tbosH3BLhlrjQSOGSnPd1bP2zRr4koFyncsF+X55Y7HnUzDm9gquCKT5hW ohP90siQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXx4-0001U9-0D; Mon, 19 Nov 2018 01:02:10 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvp-0000OQ-2F for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=llkiED9iR0TtFZHiP1jsNA5wixWkE1OXqsRM3RgKyww=; b=fQVFd3qesIy4eoEg6isxiyLqv sSgNN4Y5eP+njKx1AgMG8n2I3aM7vbcp0E5g6dgYOt6U8gOJ5MXez+4zn8Xgnow5nS3c6owOaVuW3 mJ9EDL3Ds+Wh7+VB8MkHurADWbZynqTvjVn+LyGDf14XAyRQvk0a7YGIoezHi22DVlUuzUVL4blPh XNG01gDB4HJcDMa7++rTznUG4dAUuVVtHbz6z3uNbrYtJBMolUcUJGu9dh4kocNa0i7W/p+6cj5dw OdEle9zD0CPHcV1YW6HBJB1fQZj0roo7li+kyeuO/t9l/TVjn8H0YbBgZnI4zf73MkxZNG8ZK4J4o 6f4/SbItw==; Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvm-0003OQ-HA for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:51 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:36 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 63F9C180111; Mon, 19 Nov 2018 10:00:36 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:36 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 1066840387; Mon, 19 Nov 2018 10:00:36 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id DCB0F120455; Mon, 19 Nov 2018 10:00:35 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 05/14] clocksource/drivers/timer-milbeaut: Add Milbeaut M10V timer Date: Mon, 19 Nov 2018 10:01:10 +0900 Message-Id: <1542589274-13878-6-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181118_200050_761717_1FC5609F X-CRM114-Status: GOOD ( 30.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add Milbeaut M10V timer using 32bit timer in peripheral. Signed-off-by: Sugaya Taichi --- drivers/clocksource/Kconfig | 8 +++ drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-m10v.c | 146 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 drivers/clocksource/timer-m10v.c diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 55c77e4..a278d72 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -638,4 +638,12 @@ config GX6605S_TIMER help This option enables support for gx6605s SOC's timer. +config M10V_TIMER + bool "Milbeaut M10V timer driver" if COMPILE_TEST + depends on OF + depends on ARM + select TIMER_OF + help + Enables the support for Milbeaut M10V timer driver. + endmenu diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index dd91381..8e908b4 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -55,6 +55,7 @@ obj-$(CONFIG_CLKSRC_TI_32K) += timer-ti-32k.o obj-$(CONFIG_CLKSRC_NPS) += timer-nps.o obj-$(CONFIG_OXNAS_RPS_TIMER) += timer-oxnas-rps.o obj-$(CONFIG_OWL_TIMER) += timer-owl.o +obj-$(CONFIG_M10V_TIMER) += timer-m10v.o obj-$(CONFIG_SPRD_TIMER) += timer-sprd.o obj-$(CONFIG_NPCM7XX_TIMER) += timer-npcm7xx.o diff --git a/drivers/clocksource/timer-m10v.c b/drivers/clocksource/timer-m10v.c new file mode 100644 index 0000000..ff97c23 --- /dev/null +++ b/drivers/clocksource/timer-m10v.c @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Socionext Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "timer-of.h" + +#define FSL_TMR_TMCSR_OFS 0x0 +#define FSL_TMR_TMR_OFS 0x4 +#define FSL_TMR_TMRLR1_OFS 0x8 +#define FSL_TMR_TMRLR2_OFS 0xc +#define FSL_RMT_REGSZPCH 0x10 + +#define FSL_TMR_TMCSR_OUTL BIT(5) +#define FSL_TMR_TMCSR_RELD BIT(4) +#define FSL_TMR_TMCSR_INTE BIT(3) +#define FSL_TMR_TMCSR_UF BIT(2) +#define FSL_TMR_TMCSR_CNTE BIT(1) +#define FSL_TMR_TMCSR_TRG BIT(0) + +#define FSL_TMR_TMCSR_CSL_DIV2 0 +#define FSL_TMR_TMCSR_CSL BIT(10) + +#define M10V_TIMER_RATING 500 + +static irqreturn_t m10v_timer_interrupt(int irq, void *dev_id) +{ + struct clock_event_device *clk = dev_id; + struct timer_of *to = to_timer_of(clk); + u32 val; + + val = readl_relaxed(timer_of_base(to) + FSL_TMR_TMCSR_OFS); + val &= ~FSL_TMR_TMCSR_UF; + writel_relaxed(val, timer_of_base(to) + FSL_TMR_TMCSR_OFS); + + clk->event_handler(clk); + + return IRQ_HANDLED; +} + +static int m10v_set_state_periodic(struct clock_event_device *clk) +{ + struct timer_of *to = to_timer_of(clk); + u32 val = (FSL_TMR_TMCSR_CSL_DIV2 * FSL_TMR_TMCSR_CSL); + + writel_relaxed(val, timer_of_base(to) + FSL_TMR_TMCSR_OFS); + + writel_relaxed(to->of_clk.period, timer_of_base(to) + + FSL_TMR_TMRLR1_OFS); + val |= FSL_TMR_TMCSR_RELD | FSL_TMR_TMCSR_CNTE | + FSL_TMR_TMCSR_TRG | FSL_TMR_TMCSR_INTE; + writel_relaxed(val, timer_of_base(to) + FSL_TMR_TMCSR_OFS); + return 0; +} + +static int m10v_set_state_oneshot(struct clock_event_device *clk) +{ + struct timer_of *to = to_timer_of(clk); + u32 val = (FSL_TMR_TMCSR_CSL_DIV2 * FSL_TMR_TMCSR_CSL); + + writel_relaxed(val, timer_of_base(to) + FSL_TMR_TMCSR_OFS); + return 0; +} + +static int m10v_clkevt_next_event(unsigned long event, + struct clock_event_device *clk) +{ + struct timer_of *to = to_timer_of(clk); + + writel_relaxed(event, timer_of_base(to) + FSL_TMR_TMRLR1_OFS); + writel_relaxed((FSL_TMR_TMCSR_CSL_DIV2 * FSL_TMR_TMCSR_CSL) | + FSL_TMR_TMCSR_CNTE | FSL_TMR_TMCSR_INTE | + FSL_TMR_TMCSR_TRG, timer_of_base(to) + + FSL_TMR_TMCSR_OFS); + return 0; +} + +static int m10v_config_clock_source(struct timer_of *to) +{ + writel_relaxed(0, timer_of_base(to) + FSL_TMR_TMCSR_OFS); + writel_relaxed(~0, timer_of_base(to) + FSL_TMR_TMR_OFS); + writel_relaxed(~0, timer_of_base(to) + FSL_TMR_TMRLR1_OFS); + writel_relaxed(~0, timer_of_base(to) + FSL_TMR_TMRLR2_OFS); + writel_relaxed(BIT(4) | BIT(1) | BIT(0), timer_of_base(to) + + FSL_TMR_TMCSR_OFS); + return 0; +} + +static int m10v_config_clock_event(struct timer_of *to) +{ + writel_relaxed(0, timer_of_base(to) + FSL_TMR_TMCSR_OFS); + return 0; +} + +static struct timer_of to = { + .flags = TIMER_OF_IRQ | TIMER_OF_BASE | TIMER_OF_CLOCK, + + .clkevt = { + .name = "m10v-clkevt", + .rating = M10V_TIMER_RATING, + .cpumask = cpu_possible_mask, + }, + + .of_irq = { + .flags = IRQF_TIMER | IRQF_IRQPOLL, + }, +}; + +static int __init m10v_timer_init(struct device_node *node) +{ + int ret; + + to.clkevt.features = CLOCK_EVT_FEAT_DYNIRQ | CLOCK_EVT_FEAT_ONESHOT; + to.clkevt.set_state_oneshot = m10v_set_state_oneshot; + to.clkevt.set_state_periodic = m10v_set_state_periodic; + to.clkevt.set_next_event = m10v_clkevt_next_event; + to.of_irq.handler = m10v_timer_interrupt; + + ret = timer_of_init(node, &to); + if (ret) + goto err; + + m10v_config_clock_source(&to); + clocksource_mmio_init(timer_of_base(&to) + FSL_TMR_TMR_OFS, + node->name, timer_of_rate(&to), M10V_TIMER_RATING, 32, + clocksource_mmio_readl_down); + m10v_config_clock_event(&to); + clockevents_config_and_register(&to.clkevt, timer_of_rate(&to), + 15, 0xffffffff); + + return 0; +err: + timer_of_cleanup(&to); + return ret; +} +TIMER_OF_DECLARE(m10v_peritimer, "socionext,milbeaut-m10v-timer", + m10v_timer_init); From patchwork Mon Nov 19 01:01:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 845DE14BD for ; Mon, 19 Nov 2018 01:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72D08299B9 for ; Mon, 19 Nov 2018 01:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65975299B5; Mon, 19 Nov 2018 01:03:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E5D06299BF for ; Mon, 19 Nov 2018 01:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MS9Tf0HScoHHJLps4o75/k1HeINKN2uNy4TiN0/Jn4E=; b=caC7+khG7ZOMmQR/VyQZPeUblI s0O5ASQvTMMNQJ59KUwTYMfcPMM+s3EXJFG82KojAB3vPg1aBPlLHt0l/DJV6/Dv/Ebn0e0MPYdYR n6NNDW/BTdeVJEVlIPapyt+ASCZmg0y2mY6YtEgX5VC3FyjdkjBv5KkqjLu/t3dMDQE8qMssksnKZ a4R4Rr7xkumAAUvaPLnLYHw2+u8uOsPq3Lc+6xLq3sgySPOD/a0moBtnmqLVizS3H0PXRz/1K7T7j oHs8JWZCGlmIjFCrqnH8FSkfT9St51Bjx/cSiL89WgcsOy28c9uuPoAMsVnVFQ9XNC1foTHyqFMk/ xFBaTqRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXy9-0002XC-Fa; Mon, 19 Nov 2018 01:03:17 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvq-0000QI-N2 for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vseWi9EZ65Jbye7y0HwmFY+D27HAFSp5meVdCRO0Lmc=; b=XYR0XWLC1TSBpWcHSodjwiYHT f0CgssUpyq4EKbR+GF/oBb3j6599Ftg55scwcqqhZPMaUZuYlwR/dVACWrxDhWQspZzc0R6r6wNvN ffJ4KOjvRSs6oNCazhBeSyK4bn3YAJPH6FmvPu53PG7u0UA8p04s1Z4FP7BEaCrmTQUcAgkLQP6L6 Gms2/Wt++kZukWE1NLCDLoaLmMvOK9xGyP8Y3d/byjISqwyLFftOSdrcb/nRPhX0tfUxIgzdIiqrT JwXNmNgEuTia16fGkzKWHKGWz0QdVTX/CymDxmiceixLAa/kP7JCBg944Tvpth6gaLtmsQ4gj30L/ PJaA5oR+g==; Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvn-0003OQ-PX for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:52 +0000 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:37 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 5BD0060062; Mon, 19 Nov 2018 10:00:37 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:37 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id C36A740387; Mon, 19 Nov 2018 10:00:36 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id A489C120455; Mon, 19 Nov 2018 10:00:36 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 06/14] dt-bindings: clock: milbeaut: add Milbeaut clock description Date: Mon, 19 Nov 2018 10:01:11 +0900 Message-Id: <1542589274-13878-7-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181118_200052_000895_CF60D77D X-CRM114-Status: GOOD ( 21.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add DT bindings document for Milbeaut clock. Signed-off-by: Sugaya Taichi --- .../devicetree/bindings/clock/milbeaut-clock.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/milbeaut-clock.txt diff --git a/Documentation/devicetree/bindings/clock/milbeaut-clock.txt b/Documentation/devicetree/bindings/clock/milbeaut-clock.txt new file mode 100644 index 0000000..5c093c8 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/milbeaut-clock.txt @@ -0,0 +1,93 @@ +Milbeaut M10V Clock Controller Binding +---------------------------------------- +Milbeaut clock controller is consists of few oscillators, PLL, multiplexer +and few divider modules + +This binding uses common clock bindings +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible: shall be "socionext,milbeaut-m10v-clk-regs" +- reg: shall contain base address and length of clock registers +- #clock-cells: shall be 0 + +Example: + m10v-clk-tree@ { + compatible = "socionext,milbeaut-m10v-clk-regs"; + reg = <0x1d021000 0x4000>; + + clocks { + #address-cells = <0>; + #size-cells = <0>; + + uclk40xi: uclk40xi { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <40000000>; + }; + }; + } + +The clock consumer shall specify the desired clock-output of the clock +controller (as defined in [2]) by specifying output-id in its "clock" +phandle cell +[2] arch/arm/boot/dts/milbeaut-m10v-clk.h + +For example for UART1: + usio1: usio_uart@1e700010 { + index = <0>; + compatible = "socionext,milbeaut-m10v-usio-uart"; + reg = <0x1e700010 0x10>; + interrupts = <0 141 0x4>, <0 149 0x4>; + interrupt-names = "rx", "tx"; + clocks = <&hclk>; + }; + + + + +Required properties: +- compatible: + "socionext,milbeaut-m10v-clk-mux" + -clock-cells: should be 0 + -clocks: should be two factor + "socionext,milbeaut-m10v-pll-fixed-factor" + -clock-cells: should be 0 + -clocks: should be one factor + -offset: offset + -clock-div: div number + -clock-mult: multiple number + "socionext,milbeaut-m10v-clk-div" + -clock-cells: should be 0 + -clocks: should be one factor + -offset: offset + -mask: mask bit + -ratios: div ratio + +Example + piclk_mux_0: spiclk_mux_0 { + compatible = "socionext,m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll10_div_1_2>; + offset = ; + mask = <0x3>; + ratios = <4 0x5 2 0x4>; + }; + + pll10: pll10 { + compatible = "socionext,m10v-pll-fixed-factor"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + offset = <10>; + clock-div = <5>; + clock-mult = <108>; + }; + + emmcclk: emmcclk { + compatible = "socionext,m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll11>; + offset = ; + mask = <0x3>; + ratios = <15 0x7 10 0x6 9 0x5 8 0x4>; + }; From patchwork Mon Nov 19 01:01:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBB0A14BD for ; Mon, 19 Nov 2018 01:02:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAA3C299A3 for ; Mon, 19 Nov 2018 01:02:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF14D299B5; Mon, 19 Nov 2018 01:02:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D6483299A3 for ; Mon, 19 Nov 2018 01:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=agV333K/3PPTkyZ7GGiR+59aKALq0Gp8ibvxTNboZ2c=; b=Ic+L4ZPbNuccD6zarI9zzUCWUU kfmtx8bvojQ3GUIp1kH23QW+czO7L9dkd/EPYtc4Xu7pUnlEXBvRxLHTNp8SmHYECi0PbPRemjEv3 JLKneKOD+Mz+kLqrLl8S5Y4nkT3gdarkRIch1bMRmcTD26n5+HARszK2L9/IdhGC81gHwyvRjkNMa 5OlxuNacjkCt32knucVbrg6seHqdb26rxayF+vLDYDkBB/FXOv26kVIvdqS7YNK5u5JFFxQn8U4rt sOr2u72NnEk2hfCZf7nkFYkz6r+4a+A94A5aCF49Q8rHOq/AhP8BXQI9TjuHn9H4Roe3cGoe+RdJH YujpMCig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXxc-00020A-5K; Mon, 19 Nov 2018 01:02:44 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvs-0000Sj-KV for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XFzSUAh89IrHUVFePFTbTdNkJhcM7u5iabsMk3rHBSU=; b=E2O5N05Gtqf6vgDFnERcNJpok unZGC5wFY3sgumGTkNxxKWLmHVTOv9WwnumkrnhQqRo44kQ3pGWs4CySs53dmQbO3dXOjjlkyzlGI s/9rfEIYdd2Otow2rUCgqGJZydmzA9feZgYZKWwgDHhU8kn8Ebi3/7R2u1Ngys4z5DDBV/pBIcnpi 6h1EJzvj1zo40/Pc0XjiRZbXolhV33+/Nj8oIv6BJKJk5cHLs/7XHp1cPc0A7OIMuP5+uTeaaBMHs jX2kLf7j0nM+G6XtvK9efOELosRCrHRuiTWFN2SQcUAJxd9lq8FcOs6dNhtxQzWLW3VPWpiS9C7ds vbmwYDsCg==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvn-00036e-Uo for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:55 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:38 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id E7888180111; Mon, 19 Nov 2018 10:00:37 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:37 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 8232240387; Mon, 19 Nov 2018 10:00:37 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 63A2A120455; Mon, 19 Nov 2018 10:00:37 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 07/14] clock: milbeaut: Add Milbeaut M10V clock control Date: Mon, 19 Nov 2018 10:01:12 +0900 Message-Id: <1542589274-13878-8-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010052_670813_8A8E1C7F X-CRM114-Status: GOOD ( 36.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add Milbeaut M10V clock ( including PLL ) control. Signed-off-by: Sugaya Taichi --- drivers/clk/Makefile | 1 + drivers/clk/clk-m10v.c | 671 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 672 insertions(+) create mode 100644 drivers/clk/clk-m10v.c diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 72be7a3..da5b282 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_COMMON_CLK_GEMINI) += clk-gemini.o obj-$(CONFIG_COMMON_CLK_ASPEED) += clk-aspeed.o obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o obj-$(CONFIG_CLK_HSDK) += clk-hsdk-pll.o +obj-$(CONFIG_ARCH_MILBEAUT_M10V) += clk-m10v.o obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o obj-$(CONFIG_COMMON_CLK_MAX9485) += clk-max9485.o obj-$(CONFIG_ARCH_MOXART) += clk-moxart.o diff --git a/drivers/clk/clk-m10v.c b/drivers/clk/clk-m10v.c new file mode 100644 index 0000000..aa92a69 --- /dev/null +++ b/drivers/clk/clk-m10v.c @@ -0,0 +1,671 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Socionext Inc. + * Copyright (C) 2016 Linaro Ltd. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define CLKSEL1 0x0 +#define CLKSEL(n) (((n) - 1) * 4 + CLKSEL1) + +#define PLLCNT1 0x30 +#define PLLCNT(n) (((n) - 1) * 4 + PLLCNT1) + +#define CLKSTOP1 0x54 +#define CLKSTOP(n) (((n) - 1) * 4 + CLKSTOP1) + +#define CRSWR 0x8c +#define CRRRS 0x90 +#define CRRSM 0x94 + +#define to_m10v_mux(_hw) container_of(_hw, struct m10v_mux, hw) +#define to_m10v_gate(_hw) container_of(_hw, struct m10v_gate, hw) +#define to_m10v_div(_hw) container_of(_hw, struct m10v_div, hw) +#define to_m10v_pll(_hw) container_of(_hw, struct m10v_pll, hw) + +static void __iomem *clk_base; +static struct device_node *np_top; +static DEFINE_SPINLOCK(crglock); + +static __init void __iomem *m10v_clk_iomap(void) +{ + if (clk_base) + return clk_base; + + np_top = of_find_compatible_node(NULL, NULL, + "socionext,milbeaut-m10v-clk-regs"); + if (!np_top) { + pr_err("%s: CLK iomap failed!\n", __func__); + return NULL; + } + + clk_base = of_iomap(np_top, 0); + of_node_put(np_top); + + return clk_base; +} + +struct m10v_mux { + struct clk_hw hw; + const char *cname; + u32 parent; +}; + +static u8 m10v_mux_get_parent(struct clk_hw *hw) +{ + struct m10v_mux *mcm = to_m10v_mux(hw); + struct clk_hw *parent; + int i; + + i = clk_hw_get_num_parents(hw); + while (i--) { + parent = clk_hw_get_parent_by_index(hw, i); + if (clk_hw_get_rate(parent)) + break; + } + + if (i < 0) { + pr_info("%s:%s no parent?!\n", + __func__, mcm->cname); + i = 0; + } + + return i; +} + +static int m10v_mux_set_parent(struct clk_hw *hw, u8 index) +{ + struct m10v_mux *mcm = to_m10v_mux(hw); + + mcm->parent = index; + return 0; +} + +static const struct clk_ops m10v_mux_ops = { + .get_parent = m10v_mux_get_parent, + .set_parent = m10v_mux_set_parent, + .determine_rate = __clk_mux_determine_rate, +}; + +void __init m10v_clk_mux_setup(struct device_node *node) +{ + const char *clk_name = node->name; + struct clk_init_data init; + const char **parent_names; + struct m10v_mux *mcm; + struct clk *clk; + int i, parents; + + if (!m10v_clk_iomap()) + return; + + of_property_read_string(node, "clock-output-names", &clk_name); + + parents = of_clk_get_parent_count(node); + if (parents < 2) { + pr_err("%s: not a mux\n", clk_name); + return; + } + + parent_names = kzalloc((sizeof(char *) * parents), GFP_KERNEL); + if (!parent_names) + return; + + for (i = 0; i < parents; i++) + parent_names[i] = of_clk_get_parent_name(node, i); + + mcm = kzalloc(sizeof(*mcm), GFP_KERNEL); + if (!mcm) + goto err_mcm; + + init.name = clk_name; + init.ops = &m10v_mux_ops; + init.flags = CLK_IS_BASIC | CLK_SET_RATE_PARENT; + init.num_parents = parents; + init.parent_names = parent_names; + + mcm->cname = clk_name; + mcm->parent = 0; + mcm->hw.init = &init; + + clk = clk_register(NULL, &mcm->hw); + if (IS_ERR(clk)) + goto err_clk; + + of_clk_add_provider(node, of_clk_src_simple_get, clk); + return; + +err_clk: + kfree(mcm); +err_mcm: + kfree(parent_names); +} +CLK_OF_DECLARE(m10v_clk_mux, "socionext,milbeaut-m10v-clk-mux", + m10v_clk_mux_setup); + +struct m10v_pll { + struct clk_hw hw; + const char *cname; + const struct clk_ops ops; + u32 offset; + u32 div, mult; + bool ro; +}; + +#define ST 1 +#define SEL 2 + +static void _mpg_enable(struct clk_hw *hw, unsigned int enable) +{ + struct m10v_pll *mpg = to_m10v_pll(hw); + unsigned long flags; + u32 val; + + if (mpg->ro) { + pr_debug("%s:%d %s: read-only\n", + __func__, __LINE__, mpg->cname); + return; + } + + spin_lock_irqsave(&crglock, flags); + + val = readl(clk_base + PLLCNT(SEL)); + if (enable) + val |= BIT(mpg->offset); + else + val &= ~BIT(mpg->offset); + writel(val, clk_base + PLLCNT(SEL)); + + spin_unlock_irqrestore(&crglock, flags); +} + +static int mpg_enable(struct clk_hw *hw) +{ + _mpg_enable(hw, 1); + return 0; +} + +static void mpg_disable(struct clk_hw *hw) +{ + _mpg_enable(hw, 0); +} + +static int mpg_is_enabled(struct clk_hw *hw) +{ + struct m10v_pll *mpg = to_m10v_pll(hw); + + return readl(clk_base + PLLCNT(SEL)) & (1 << mpg->offset); +} + +static void _mpg_prepare(struct clk_hw *hw, unsigned int on) +{ + struct m10v_pll *mpg = to_m10v_pll(hw); + unsigned long flags; + u32 val; + + if (mpg->ro) { + pr_debug("%s:%d %s: read-only\n", + __func__, __LINE__, mpg->cname); + return; + } + + val = readl(clk_base + PLLCNT(ST)); + if (!on == !(val & BIT(mpg->offset))) + return; + + /* disable */ + mpg_disable(hw); + + spin_lock_irqsave(&crglock, flags); + + val = readl(clk_base + PLLCNT(ST)); + if (on) + val |= BIT(mpg->offset); + else + val &= ~BIT(mpg->offset); + writel(val, clk_base + PLLCNT(ST)); + + spin_unlock_irqrestore(&crglock, flags); + + udelay(on ? 200 : 10); +} + +static int mpg_prepare(struct clk_hw *hw) +{ + _mpg_prepare(hw, 1); + return 0; +} + +static void mpg_unprepare(struct clk_hw *hw) +{ + _mpg_prepare(hw, 0); +} + +static int mpg_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long prate) +{ + return 0; +} + +static unsigned long mpg_recalc_rate(struct clk_hw *hw, + unsigned long prate) +{ + struct m10v_pll *mpg = to_m10v_pll(hw); + unsigned long long rate = prate; + + if (mpg_is_enabled(hw)) { + rate = (unsigned long long)prate * mpg->mult; + do_div(rate, mpg->div); + } + + return (unsigned long)rate; +} + +static long mpg_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + struct m10v_pll *mpg = to_m10v_pll(hw); + unsigned long long temp_rate = (unsigned long long)*prate * mpg->mult; + + if (mpg->ro) + return mpg_recalc_rate(hw, *prate); + + return do_div(temp_rate, mpg->div); +} + +static const struct clk_ops m10v_pll_ops = { + .prepare = mpg_prepare, + .enable = mpg_enable, + .is_enabled = mpg_is_enabled, + .disable = mpg_disable, + .unprepare = mpg_unprepare, + .round_rate = mpg_round_rate, + .set_rate = mpg_set_rate, + .recalc_rate = mpg_recalc_rate, +}; + +void __init m10v_pll_setup(struct device_node *node) +{ + const char *clk_name = node->name; + struct clk_init_data init; + const char *parent_name; + u32 offset, div, mult; + struct m10v_pll *mpg; + struct clk *clk; + int ret; + + if (!m10v_clk_iomap()) + return; + + of_property_read_string(node, "clock-output-names", &clk_name); + + ret = of_property_read_u32(node, "offset", &offset); + if (ret) { + pr_err("%s: missing 'offset' property\n", clk_name); + return; + } + + div = mult = 1; + of_property_read_u32(node, "clock-div", &div); + of_property_read_u32(node, "clock-mult", &mult); + + parent_name = of_clk_get_parent_name(node, 0); + + mpg = kzalloc(sizeof(*mpg), GFP_KERNEL); + if (!mpg) + return; + + init.name = clk_name; + init.ops = &m10v_pll_ops; + init.flags = CLK_IS_BASIC | CLK_SET_RATE_GATE; + init.parent_names = &parent_name; + init.num_parents = 1; + + mpg->cname = clk_name; + mpg->offset = offset; + mpg->div = div; + mpg->mult = mult; + mpg->hw.init = &init; + if (of_get_property(node, "read-only", NULL)) + mpg->ro = true; + + clk = clk_register(NULL, &mpg->hw); + if (IS_ERR(clk)) + kfree(mpg); + else + of_clk_add_provider(node, of_clk_src_simple_get, clk); +} +CLK_OF_DECLARE(m10v_clk_pll_gate, "socionext,milbeaut-m10v-pll-fixed-factor", + m10v_pll_setup); + +struct m10v_div { + struct clk_hw hw; + const char *cname; + bool waitdchreq; + u32 offset; + u32 mask; + u32 *table; + u32 tlen; + bool ro; +}; + +static void mdc_set_div(struct m10v_div *mdc, u32 div) +{ + u32 off, shift, val; + + off = mdc->offset / 32 * 4; + shift = mdc->offset % 32; + + val = readl(clk_base + CLKSEL1 + off); + val &= ~(mdc->mask << shift); + val |= (div << shift); + writel(val, clk_base + CLKSEL1 + off); + + if (mdc->waitdchreq) { + unsigned int count = 250; + + writel(1, clk_base + CLKSEL(11)); + + do { + udelay(1); + } while (--count && readl(clk_base + CLKSEL(11)) & 1); + + if (!count) + pr_err("%s:%s CLK(%d) couldn't stabilize\n", + __func__, mdc->cname, mdc->offset); + } +} + +static u32 mdc_get_div(struct m10v_div *mdc) +{ + u32 off, shift, div; + + off = mdc->offset / 32 * 4; + shift = mdc->offset % 32; + + div = readl(clk_base + CLKSEL1 + off); + div >>= shift; + div &= mdc->mask; + + return div; +} + +static int mdc_div_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long prate) +{ + struct m10v_div *mdc = to_m10v_div(hw); + u64 pr; + int i; + + if (mdc->ro) { + pr_debug("%s:%d %s: read-only\n", + __func__, __LINE__, mdc->cname); + return 0; + } + + /* divisors are already in descending order in DT */ + for (i = mdc->tlen - 2; i >= 0; i -= 2) { + pr = prate; + do_div(pr, mdc->table[i]); + + if (rate >= pr) + break; + } + if (i < 0) + i = 0; + + mdc_set_div(mdc, mdc->table[i + 1]); + + return 0; +} + +static unsigned long mdc_div_recalc_rate(struct clk_hw *hw, + unsigned long prate) +{ + struct m10v_div *mdc = to_m10v_div(hw); + u64 prate64 = prate; + u32 div; + int i; + + div = mdc_get_div(mdc); + + for (i = 1; i < mdc->tlen && div != mdc->table[i]; i += 2) + if (div == (mdc->table[i] & mdc->mask)) + break; /* the MSB is already read back as 0 */ + + if (i > mdc->tlen) /* some other is enabled in the mux */ + prate64 = 0; + else + do_div(prate64, mdc->table[i - 1]); + + return (unsigned long)prate64; +} + +static long mdc_div_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *parent) +{ + struct m10v_div *mdc = to_m10v_div(hw); + u64 prate; + int i; + + if (mdc->ro) + return mdc_div_recalc_rate(hw, *parent); + + /* divisors are already in descending order in DT */ + for (i = mdc->tlen - 2; i >= 0; i -= 2) { + prate = *parent; + do_div(prate, mdc->table[i]); + + if (rate >= prate) + break; + } + + return (unsigned long)prate; +} + +static const struct clk_ops m10v_div_ops = { + .round_rate = mdc_div_round_rate, + .set_rate = mdc_div_set_rate, + .recalc_rate = mdc_div_recalc_rate, +}; + +void __init m10v_clk_div_setup(struct device_node *node) +{ + const char *clk_name = node->name; + struct clk_init_data init; + const char *parent_name; + struct m10v_div *mdc; + struct clk *clk; + u32 *table, mask; + u32 offset; + int count, ret; + + if (!m10v_clk_iomap()) + return; + + of_property_read_string(node, "clock-output-names", &clk_name); + + parent_name = of_clk_get_parent_name(node, 0); + if (!parent_name) { + pr_err("%s: no parent specified\n", clk_name); + return; + } + + ret = of_property_read_u32(node, "offset", &offset); + if (ret) { + pr_err("%s: missing 'offset' property\n", clk_name); + return; + } + + ret = of_property_read_u32(node, "mask", &mask); + if (ret) { + pr_err("%s: missing 'mask' property\n", clk_name); + return; + } + + count = of_property_count_u32_elems(node, "ratios"); + if (count < 2 || count%2) { + pr_err("%s: invalid 'ratios' property\n", clk_name); + return; + } + + table = kzalloc(sizeof(*table) * count, GFP_KERNEL); + if (!table) + return; + + /* + * The 'ratios' must be in descending order, we park at + * first ratio (biggest divider) when disabled. + */ + ret = of_property_read_u32_array(node, "ratios", table, count); + if (ret) { + pr_err("%s: 'ratios' property read fail\n", clk_name); + goto err_mdc; + } + + mdc = kzalloc(sizeof(*mdc), GFP_KERNEL); + if (!mdc) + goto err_mdc; + + if (of_get_property(node, "wait-on-dchreq", NULL)) + mdc->waitdchreq = true; + + init.name = clk_name; + init.ops = &m10v_div_ops; + init.flags = CLK_IS_BASIC; + init.parent_names = &parent_name; + init.num_parents = 1; + + mdc->cname = clk_name; + mdc->offset = offset; + mdc->mask = mask; + mdc->table = table; + mdc->tlen = count; + mdc->hw.init = &init; + if (of_get_property(node, "read-only", NULL)) + mdc->ro = true; + + clk = clk_register(NULL, &mdc->hw); + if (IS_ERR(clk)) + goto err_clk; + + of_clk_add_provider(node, of_clk_src_simple_get, clk); + return; + +err_clk: + kfree(mdc); +err_mdc: + kfree(table); +} +CLK_OF_DECLARE(m10v_clk_div, "socionext,milbeaut-m10v-clk-div", + m10v_clk_div_setup); + +struct m10v_gate { + struct clk_hw hw; + const char *cname; + u32 offset; + bool ro; +}; + +static void _mgc_enable(struct clk_hw *hw, bool en) +{ + struct m10v_gate *mgc = to_m10v_gate(hw); + u32 off, mask; + + if (mgc->ro) { + pr_debug("%s:%d %s: read-only\n", + __func__, __LINE__, mgc->cname); + return; + } + + off = CLKSTOP1 + (mgc->offset / 32) * 4; + + mask = (en ? 2 : 3) << (mgc->offset % 32); + + writel(mask, clk_base + off); +} + +static int mgc_enable(struct clk_hw *hw) +{ + _mgc_enable(hw, true); + return 0; +} + +static void mgc_disable(struct clk_hw *hw) +{ + _mgc_enable(hw, false); +} + +static int mgc_is_enabled(struct clk_hw *hw) +{ + struct m10v_gate *mgc = to_m10v_gate(hw); + u32 off, val, mask = 1 << (mgc->offset % 32); + + off = CLKSTOP1 + (mgc->offset / 32) * 4; + val = readl(clk_base + off); + + return !(val & mask); +} + +static const struct clk_ops m10v_gate_ops = { + .enable = mgc_enable, + .disable = mgc_disable, + .is_enabled = mgc_is_enabled, +}; + +void __init m10v_clk_gate_setup(struct device_node *node) +{ + const char *clk_name = node->name; + struct clk_init_data init; + const char *parent_name; + struct m10v_gate *mgc; + struct clk *clk; + u32 offset; + int ret; + + if (!m10v_clk_iomap()) + return; + + of_property_read_string(node, "clock-output-names", &clk_name); + + ret = of_property_read_u32(node, "offset", &offset); + if (ret) { + pr_err("%s: missing 'offset' property\n", clk_name); + return; + } + + parent_name = of_clk_get_parent_name(node, 0); + + mgc = kzalloc(sizeof(*mgc), GFP_KERNEL); + if (!mgc) + return; + + init.name = clk_name; + init.ops = &m10v_gate_ops; + init.flags = CLK_IS_BASIC | CLK_SET_RATE_PARENT; + init.parent_names = &parent_name; + init.num_parents = 1; + + mgc->cname = clk_name; + mgc->offset = offset; + mgc->hw.init = &init; + if (of_get_property(node, "read-only", NULL)) + mgc->ro = true; + + clk = clk_register(NULL, &mgc->hw); + if (IS_ERR(clk)) + kfree(mgc); + else + of_clk_add_provider(node, of_clk_src_simple_get, clk); +} +CLK_OF_DECLARE(m10v_clk_gate, "socionext,milbeaut-m10v-clk-gate", + m10v_clk_gate_setup); From patchwork Mon Nov 19 01:01:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C31514BD for ; Mon, 19 Nov 2018 01:02:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B39929582 for ; Mon, 19 Nov 2018 01:02:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FCDB295E8; Mon, 19 Nov 2018 01:02:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B768E298E9 for ; Mon, 19 Nov 2018 01:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=WJnx08e3khJ/xj0CbbCKp7TB0GChZCbw1rRD1nDFtAU=; b=ROq900ASaeC4Lc5v4xGBsdcnfm 9yWJNegs9Z9QpbFbR6QX0ppSe40ByPEc1hPmvBTeluKmGKlqv/7HbSkuwxbRiFcja7GKZ5gq5PHeN 2NO7CTiZ7nxJReMXyzbOdDWK0eBCZE+VaHlunyUyQN5SQ1OfVY1ruiSospvV/oSKue121f+ePipR8 z/9GYry8Y4GTOSCUpDrn2wV1EPrz6YEZ3jQZKscb25FwieMRC1bL4SuAmdr/B9d4UU+wtj+U8BFIo yVkbmw6SI6OmMh56hVxA2MrRGu5vfJIETyL/ef+Vg6sJk2e7NkZqzFnXglCXJr71IQ8RHtRwK7L7h ntgevCcQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXwm-0001G2-Fi; Mon, 19 Nov 2018 01:01:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvo-0000Oq-R2 for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JouPLC06FOWZWuUsChfnCzdJ+bw3u+mXud3PSOh0bAc=; b=dhIVuJPxQspkEM6JlzeS7eB2/ SLKUBxt1HpjC6GUgdLol8vUE6VSTJ10rXIxCqVj5AY18uitYM4KW3XGWdtq/5SrvJh2wCJhJ8K482 nUFeGi3Xnro6T4la4w6HyKEaGenvYbKj1XWJIO/J6OV0uPQ5Mvg7lyp+u0WacWf7nng2swUsqLC8Q 7BufC5tlf/bI2P9ChhSgCDSm/PVvexuGsFLFy73dHitFQD84AClWS3FI3qxk3qNy/mHUBTmAvA3ly 0usblTfUrLJDvuq+M1lGbgrSkDTABNautk7kji689QdFjOKWjXyi6AtWPKbSgTlE+mkjr2u6MFrc1 aDa6xd3gg==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvk-00036q-IF for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:51 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:39 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id EFBE2180111; Mon, 19 Nov 2018 10:00:38 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:38 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 6644E403AB; Mon, 19 Nov 2018 10:00:38 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 46B75120455; Mon, 19 Nov 2018 10:00:38 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 08/14] dt-bindings: serial: Add Milbeaut M10V serial description Date: Mon, 19 Nov 2018 10:01:13 +0900 Message-Id: <1542589274-13878-9-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010048_832494_7EF26E18 X-CRM114-Status: GOOD ( 25.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add DT bindings document for Milbeaut M10V serial. Signed-off-by: Sugaya Taichi --- .../devicetree/bindings/serial/milbeaut-uart.txt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Documentation/devicetree/bindings/serial/milbeaut-uart.txt diff --git a/Documentation/devicetree/bindings/serial/milbeaut-uart.txt b/Documentation/devicetree/bindings/serial/milbeaut-uart.txt new file mode 100644 index 0000000..19d1480 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/milbeaut-uart.txt @@ -0,0 +1,23 @@ +Socionext Milbeaut UART controller + +Required properties: +- index: must be 0 +- compatible: should be "socionext,milbeaut-m10v-usio-uart". +- reg: offset and length of the register set for the device. +- interrupts: two interrupts specifier. +- clocks: phandle to the input clock. +- interrupt-names: should be "rx", "tx". + +Optional properties: +- uart-flow-enable: flow control enable. + +Example: + usio1: usio_uart@1e700010 { + index = <0>; + compatible = "socionext,milbeaut-m10v-usio-uart"; + reg = <0x1e700010 0x10>; + interrupts = <0 141 0x4>, <0 149 0x4>; + interrupt-names = "rx", "tx"; + clocks = <&hclk>; + uart-flow-enable; + }; From patchwork Mon Nov 19 01:01:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 371DC13BF for ; Mon, 19 Nov 2018 01:02:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25C12295B6 for ; Mon, 19 Nov 2018 01:02:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A10129719; Mon, 19 Nov 2018 01:02:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 131E5299AC for ; Mon, 19 Nov 2018 01:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BMSUxWJh4lJU20xtuycyQ9ZT6PexGTLNoaKYYRGwCIw=; b=RramTguYyasd1dFtI+syO7YMSH YJ1PLeaQV+EPSHjrvS7ghqIyNBmTF+bFTdUk9BaNaL0TO242MiTnd9VkpNWGsZUCJErSRgv5z356t emy0RHTEOGLM0Euy5qBKvPIwuEevqXb4y4YBQQJGNTHEsRDfaKRC5tConoUantYYbgp0DY9Q0zi4l bAQBE0Z+8ouEKt3+nYhrW3nOroyn08DamkaVFI5G15cF8NWysmSJ045EGfO62Vaoy8fqr2n+/7Egh 2KHfSLAGzrrZ4aN3trV9d1Dz+V8+uxKn8W6frqjAEciHNsTgYR8muDIF9tdLIcYis1VE5rZ/s4wiN wk0LnQYw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXxK-0001kY-Vk; Mon, 19 Nov 2018 01:02:27 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvs-0000Sb-Hq for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:00:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LrTghPxorHOlD2E+4/npsL1D4/3p1K4DdiwoxtORROQ=; b=bm5epIY7QhUKHVniZEEu3VimD 374S/NWWGx5tqYoEAeFZlYOIE/Rn2WJQZvE2llREx5yAbsaD9GYBSnU7Auw5GytyLFeMbompGQ96L h8MllAMWpcUp9YM8GsVwVn1FmISBs26Z+kvoWv6KB0jOa6GzdPoZu07dYl5xhjfSEBQYVfoBoBBei l8bPTdN0yNH2XYgOU0585vC65r3QQzphN9HrsZf0/x3sZwJe/B6DbPJwEohfRumxgq1g2yrM5unMg 2Fj/FCQ+94o7M+VyzAJiObNUYEz7lb3N+4UiOAZON945LqpaTj9b1sxPqREj4MX9N7a7IUUizbZo5 SLJAL6YSQ==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvn-00036q-VY for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:55 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:39 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id EA8B8180111; Mon, 19 Nov 2018 10:00:39 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:39 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 686CC40387; Mon, 19 Nov 2018 10:00:39 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 44E6B120455; Mon, 19 Nov 2018 10:00:39 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 09/14] serial: Add Milbeaut M10V serial control Date: Mon, 19 Nov 2018 10:01:14 +0900 Message-Id: <1542589274-13878-10-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589274-13878-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010052_797548_CEE5CB12 X-CRM114-Status: GOOD ( 35.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add Milbeaut M10V serial control. Signed-off-by: Sugaya Taichi --- drivers/tty/serial/Kconfig | 24 ++ drivers/tty/serial/Makefile | 1 + drivers/tty/serial/m10v_usio.c | 605 +++++++++++++++++++++++++++++++++++++++ include/uapi/linux/serial_core.h | 3 + 4 files changed, 633 insertions(+) create mode 100644 drivers/tty/serial/m10v_usio.c diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 32886c3..cd28a7e 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -1529,6 +1529,30 @@ config SERIAL_OWL_CONSOLE Say 'Y' here if you wish to use Actions Semiconductor S500/S900 UART as the system console. +config SERIAL_M10V_USIO + tristate "M10V USIO/UART serial port support" + depends on ARCH_MILBEAUT + default y + select SERIAL_CORE + help + This selects the USIO/UART IP found in Socionext Milbeaut M10V. + +config SERIAL_M10V_USIO_PORTS + int "Maximum number of CSIO/UART ports (1-8)" + range 1 8 + depends on SERIAL_M10V_USIO + default "4" + +config SERIAL_M10V_USIO_CONSOLE + bool "Support for console on M10V USIO/UART serial port" + depends on SERIAL_M10V_USIO=y + select SERIAL_CORE_CONSOLE + help + Say 'Y' here if you wish to use a USIO/UART of Socionext Milbeaut + M10V as the system console (the system console is the device which + receives all kernel messages and warnings and which allows logins in + single user mode). + endmenu config SERIAL_MCTRL_GPIO diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile index daac675..5ea46bc 100644 --- a/drivers/tty/serial/Makefile +++ b/drivers/tty/serial/Makefile @@ -89,6 +89,7 @@ obj-$(CONFIG_SERIAL_MVEBU_UART) += mvebu-uart.o obj-$(CONFIG_SERIAL_PIC32) += pic32_uart.o obj-$(CONFIG_SERIAL_MPS2_UART) += mps2-uart.o obj-$(CONFIG_SERIAL_OWL) += owl-uart.o +obj-$(CONFIG_SERIAL_M10V_USIO) += m10v_usio.o # GPIOLIB helpers for modem control lines obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o diff --git a/drivers/tty/serial/m10v_usio.c b/drivers/tty/serial/m10v_usio.c new file mode 100644 index 0000000..3abb465 --- /dev/null +++ b/drivers/tty/serial/m10v_usio.c @@ -0,0 +1,605 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Socionext Inc. + */ + +#if defined(CONFIG_SERIAL_M10V_USIO_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#define SUPPORT_SYSRQ +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + + +#define USIO_NAME "sn-usio-uart" +#define USIO_UART_DEV_NAME "ttyUSI" + +static struct uart_port usio_ports[CONFIG_SERIAL_M10V_USIO_PORTS]; + +#define RX 0 +#define TX 1 +static int usio_irq[CONFIG_SERIAL_M10V_USIO_PORTS][2]; + +#define SN_USIO_REG_SMR 0 +#define SN_USIO_REG_SCR 1 +#define SN_USIO_REG_ESCR 2 +#define SN_USIO_REG_SSR 3 +#define SN_USIO_REG_DR 4 +#define SN_USIO_REG_BGR 6 +#define SN_USIO_REG_FCR 12 +#define SN_USIO_REG_FBYTE 14 + +#define SN_USIO_SMR_SOE BIT(0) +#define SN_USIO_SMR_SBL BIT(3) +#define SN_USIO_SCR_TXE BIT(0) +#define SN_USIO_SCR_RXE BIT(1) +#define SN_USIO_SCR_TBIE BIT(2) +#define SN_USIO_SCR_TIE BIT(3) +#define SN_USIO_SCR_RIE BIT(4) +#define SN_USIO_SCR_UPCL BIT(7) +#define SN_USIO_ESCR_L_8BIT 0 +#define SN_USIO_ESCR_L_5BIT 1 +#define SN_USIO_ESCR_L_6BIT 2 +#define SN_USIO_ESCR_L_7BIT 3 +#define SN_USIO_ESCR_P BIT(3) +#define SN_USIO_ESCR_PEN BIT(4) +#define SN_USIO_ESCR_FLWEN BIT(7) +#define SN_USIO_SSR_TBI BIT(0) +#define SN_USIO_SSR_TDRE BIT(1) +#define SN_USIO_SSR_RDRF BIT(2) +#define SN_USIO_SSR_ORE BIT(3) +#define SN_USIO_SSR_FRE BIT(4) +#define SN_USIO_SSR_PE BIT(5) +#define SN_USIO_SSR_REC BIT(7) +#define SN_USIO_SSR_BRK BIT(8) +#define SN_USIO_FCR_FE1 BIT(0) +#define SN_USIO_FCR_FE2 BIT(1) +#define SN_USIO_FCR_FCL1 BIT(2) +#define SN_USIO_FCR_FCL2 BIT(3) +#define SN_USIO_FCR_FSET BIT(4) +#define SN_USIO_FCR_FTIE BIT(9) +#define SN_USIO_FCR_FDRQ BIT(10) +#define SN_USIO_FCR_FRIIE BIT(11) + +static void usio_stop_tx(struct uart_port *port) +{ + writew(readw(port->membase + SN_USIO_REG_FCR) & ~SN_USIO_FCR_FTIE, + port->membase + SN_USIO_REG_FCR); + writeb(readb(port->membase + SN_USIO_REG_SCR) & ~SN_USIO_SCR_TBIE, + port->membase + SN_USIO_REG_SCR); +} + +static void usio_tx_chars(struct uart_port *port) +{ + struct circ_buf *xmit = &port->state->xmit; + int count; + + writew(readw(port->membase + SN_USIO_REG_FCR) & ~SN_USIO_FCR_FTIE, + port->membase + SN_USIO_REG_FCR); + writeb(readb(port->membase + SN_USIO_REG_SCR) & + ~(SN_USIO_SCR_TIE | SN_USIO_SCR_TBIE), + port->membase + SN_USIO_REG_SCR); + + if (port->x_char) { + writew(port->x_char, port->membase + SN_USIO_REG_DR); + port->icount.tx++; + port->x_char = 0; + return; + } + if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { + usio_stop_tx(port); + return; + } + + count = port->fifosize - + (readw(port->membase + SN_USIO_REG_FBYTE) & 0xff); + + do { + writew(xmit->buf[xmit->tail], port->membase + SN_USIO_REG_DR); + + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); + port->icount.tx++; + if (uart_circ_empty(xmit)) + break; + + } while (--count > 0); + + writew(readw(port->membase + SN_USIO_REG_FCR) & ~SN_USIO_FCR_FDRQ, + port->membase + SN_USIO_REG_FCR); + + writeb(readb(port->membase + SN_USIO_REG_SCR) | SN_USIO_SCR_TBIE, + port->membase + SN_USIO_REG_SCR); + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + uart_write_wakeup(port); + + if (uart_circ_empty(xmit)) + usio_stop_tx(port); +} + +static void usio_start_tx(struct uart_port *port) +{ + u16 fcr = readw(port->membase + SN_USIO_REG_FCR); + + writew(fcr | SN_USIO_FCR_FTIE, port->membase + SN_USIO_REG_FCR); + if (!(fcr & SN_USIO_FCR_FDRQ)) + return; + + writeb(readb(port->membase + SN_USIO_REG_SCR) | SN_USIO_SCR_TBIE, + port->membase + SN_USIO_REG_SCR); + + if (readb(port->membase + SN_USIO_REG_SSR) & SN_USIO_SSR_TBI) + usio_tx_chars(port); +} + +static void usio_stop_rx(struct uart_port *port) +{ + writeb(readb(port->membase + SN_USIO_REG_SCR) & ~SN_USIO_SCR_RIE, + port->membase + SN_USIO_REG_SCR); +} + +static void usio_enable_ms(struct uart_port *port) +{ + writeb(readb(port->membase + SN_USIO_REG_SCR) | + SN_USIO_SCR_RIE | SN_USIO_SCR_RXE, + port->membase + SN_USIO_REG_SCR); +} + +static void usio_rx_chars(struct uart_port *port) +{ + struct tty_port *ttyport = &port->state->port; + unsigned long flag = 0; + char ch = 0; + u8 status; + int max_count = 2; + + while (max_count--) { + status = readb(port->membase + SN_USIO_REG_SSR); + + if (!(status & SN_USIO_SSR_RDRF)) + break; + + if (!(status & (SN_USIO_SSR_ORE | SN_USIO_SSR_FRE | + SN_USIO_SSR_PE))) { + ch = readw(port->membase + SN_USIO_REG_DR); + flag = TTY_NORMAL; + port->icount.rx++; + if (uart_handle_sysrq_char(port, ch)) + continue; + uart_insert_char(port, status, SN_USIO_SSR_ORE, + ch, flag); + continue; + } + if (status & SN_USIO_SSR_PE) + port->icount.parity++; + if (status & SN_USIO_SSR_ORE) + port->icount.overrun++; + status &= port->read_status_mask; + if (status & SN_USIO_SSR_BRK) { + flag = TTY_BREAK; + ch = 0; + } else + if (status & SN_USIO_SSR_PE) { + flag = TTY_PARITY; + ch = 0; + } else + if (status & SN_USIO_SSR_FRE) { + flag = TTY_FRAME; + ch = 0; + } + if (flag) + uart_insert_char(port, status, SN_USIO_SSR_ORE, + ch, flag); + + writeb(readb(port->membase + SN_USIO_REG_SSR) | SN_USIO_SSR_REC, + port->membase + SN_USIO_REG_SSR); + + max_count = readw(port->membase + SN_USIO_REG_FBYTE) >> 8; + writew(readw(port->membase + SN_USIO_REG_FCR) | + SN_USIO_FCR_FE2 | SN_USIO_FCR_FRIIE, + port->membase + SN_USIO_REG_FCR); + } + + tty_flip_buffer_push(ttyport); +} + +static irqreturn_t usio_rx_irq(int irq, void *dev_id) +{ + struct uart_port *port = dev_id; + + spin_lock(&port->lock); + usio_rx_chars(port); + spin_unlock(&port->lock); + + return IRQ_HANDLED; +} + +static irqreturn_t usio_tx_irq(int irq, void *dev_id) +{ + struct uart_port *port = dev_id; + + spin_lock(&port->lock); + if (readb(port->membase + SN_USIO_REG_SSR) & SN_USIO_SSR_TBI) + usio_tx_chars(port); + spin_unlock(&port->lock); + + return IRQ_HANDLED; +} + +static unsigned int usio_tx_empty(struct uart_port *port) +{ + return (readb(port->membase + SN_USIO_REG_SSR) & SN_USIO_SSR_TBI) ? + TIOCSER_TEMT : 0; +} + +static void usio_set_mctrl(struct uart_port *port, unsigned int mctrl) +{ +} + +static unsigned int usio_get_mctrl(struct uart_port *port) +{ + return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS; + +} + +static void usio_break_ctl(struct uart_port *port, int break_state) +{ +} + +static int usio_startup(struct uart_port *port) +{ + const char *portname = to_platform_device(port->dev)->name; + unsigned long flags; + int ret, index = port->line; + unsigned char escr; + + ret = request_irq(usio_irq[index][RX], usio_rx_irq, 0, portname, port); + if (ret) + return ret; + ret = request_irq(usio_irq[index][TX], usio_tx_irq, 0, portname, port); + if (ret) { + free_irq(usio_irq[index][RX], port); + return ret; + } + + escr = readb(port->membase + SN_USIO_REG_ESCR); + if (of_property_read_bool(port->dev->of_node, "uart-flow-enable")) + escr |= SN_USIO_ESCR_FLWEN; + spin_lock_irqsave(&port->lock, flags); + writeb(0, port->membase + SN_USIO_REG_SCR); + writeb(escr, port->membase + SN_USIO_REG_ESCR); + writeb(SN_USIO_SCR_UPCL, port->membase + SN_USIO_REG_SCR); + writeb(SN_USIO_SSR_REC, port->membase + SN_USIO_REG_SSR); + writew(0, port->membase + SN_USIO_REG_FCR); + writew(SN_USIO_FCR_FCL1 | SN_USIO_FCR_FCL2, + port->membase + SN_USIO_REG_FCR); + writew(SN_USIO_FCR_FE1 | SN_USIO_FCR_FE2 | SN_USIO_FCR_FRIIE, + port->membase + SN_USIO_REG_FCR); + writew(0, port->membase + SN_USIO_REG_FBYTE); + writew(BIT(12), port->membase + SN_USIO_REG_FBYTE); + + writeb(SN_USIO_SCR_TXE | SN_USIO_SCR_RIE | SN_USIO_SCR_TBIE | + SN_USIO_SCR_RXE, port->membase + SN_USIO_REG_SCR); + spin_unlock_irqrestore(&port->lock, flags); + + return 0; +} + +static void usio_shutdown(struct uart_port *port) +{ + int index = port->line; + + free_irq(usio_irq[index][RX], port); + free_irq(usio_irq[index][TX], port); +} + +static void usio_set_termios(struct uart_port *port, struct ktermios *termios, + struct ktermios *old) +{ + unsigned int escr, smr = SN_USIO_SMR_SOE; + unsigned long flags, baud, quot; + + switch (termios->c_cflag & CSIZE) { + case CS5: + escr = SN_USIO_ESCR_L_5BIT; + break; + case CS6: + escr = SN_USIO_ESCR_L_6BIT; + break; + case CS7: + escr = SN_USIO_ESCR_L_7BIT; + break; + case CS8: + default: + escr = SN_USIO_ESCR_L_8BIT; + break; + } + + if (termios->c_cflag & CSTOPB) + smr |= SN_USIO_SMR_SBL; + + if (termios->c_cflag & PARENB) { + escr |= SN_USIO_ESCR_PEN; + if (termios->c_cflag & PARODD) + escr |= SN_USIO_ESCR_P; + } + /* Set hard flow control */ + if (of_property_read_bool(port->dev->of_node, "uart-flow-enable") || + (termios->c_cflag & CRTSCTS)) + escr |= SN_USIO_ESCR_FLWEN; + + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk); + if (baud > 1) + quot = port->uartclk / baud - 1; + else + quot = 0; + + spin_lock_irqsave(&port->lock, flags); + uart_update_timeout(port, termios->c_cflag, baud); + port->read_status_mask = SN_USIO_SSR_ORE | SN_USIO_SSR_RDRF | + SN_USIO_SSR_TDRE; + if (termios->c_iflag & INPCK) + port->read_status_mask |= SN_USIO_SSR_FRE | SN_USIO_SSR_PE; + + port->ignore_status_mask = 0; + if (termios->c_iflag & IGNPAR) + port->ignore_status_mask |= SN_USIO_SSR_FRE | SN_USIO_SSR_PE; + if ((termios->c_iflag & IGNBRK) && (termios->c_iflag & IGNPAR)) + port->ignore_status_mask |= SN_USIO_SSR_ORE; + if ((termios->c_cflag & CREAD) == 0) + port->ignore_status_mask |= SN_USIO_SSR_RDRF; + + writeb(0, port->membase + SN_USIO_REG_SCR); + writeb(SN_USIO_SCR_UPCL, port->membase + SN_USIO_REG_SCR); + writeb(SN_USIO_SSR_REC, port->membase + SN_USIO_REG_SSR); + writew(0, port->membase + SN_USIO_REG_FCR); + writeb(smr, port->membase + SN_USIO_REG_SMR); + writeb(escr, port->membase + SN_USIO_REG_ESCR); + writew(quot, port->membase + SN_USIO_REG_BGR); + writew(0, port->membase + SN_USIO_REG_FCR); + writew(SN_USIO_FCR_FCL1 | SN_USIO_FCR_FCL2 | SN_USIO_FCR_FE1 | + SN_USIO_FCR_FE2 | SN_USIO_FCR_FRIIE, + port->membase + SN_USIO_REG_FCR); + writew(0, port->membase + SN_USIO_REG_FBYTE); + writew(BIT(12), port->membase + SN_USIO_REG_FBYTE); + writeb(SN_USIO_SCR_RIE | SN_USIO_SCR_RXE | SN_USIO_SCR_TBIE | + SN_USIO_SCR_TXE, port->membase + SN_USIO_REG_SCR); + spin_unlock_irqrestore(&port->lock, flags); +} + +static const char *usio_type(struct uart_port *port) +{ + return ((port->type == PORT_SN_USIO) ? USIO_NAME : NULL); +} + +static void usio_config_port(struct uart_port *port, int flags) +{ + if (flags & UART_CONFIG_TYPE) + port->type = PORT_SN_USIO; +} + +static const struct uart_ops usio_ops = { + .tx_empty = usio_tx_empty, + .set_mctrl = usio_set_mctrl, + .get_mctrl = usio_get_mctrl, + .stop_tx = usio_stop_tx, + .start_tx = usio_start_tx, + .stop_rx = usio_stop_rx, + .enable_ms = usio_enable_ms, + .break_ctl = usio_break_ctl, + .startup = usio_startup, + .shutdown = usio_shutdown, + .set_termios = usio_set_termios, + .type = usio_type, + .config_port = usio_config_port, +}; + +#ifdef CONFIG_SERIAL_M10V_USIO_CONSOLE + +static void usio_console_putchar(struct uart_port *port, int c) +{ + while (!(readb(port->membase + SN_USIO_REG_SSR) & SN_USIO_SSR_TDRE)) + cpu_relax(); + + writew(c, port->membase + SN_USIO_REG_DR); +} + +static void usio_console_write(struct console *co, const char *s, + unsigned int count) +{ + struct uart_port *port = &usio_ports[co->index]; + + uart_console_write(port, s, count, usio_console_putchar); +} + +static int __init usio_console_setup(struct console *co, char *options) +{ + struct uart_port *port; + int baud = 115200; + int parity = 'n'; + int flow = 'n'; + int bits = 8; + + if (co->index >= CONFIG_SERIAL_M10V_USIO_PORTS) + return -ENODEV; + + port = &usio_ports[co->index]; + if (!port->membase) + return -ENODEV; + + + if (options) + uart_parse_options(options, &baud, &parity, &bits, &flow); + + if (of_property_read_bool(port->dev->of_node, "uart-flow-enable")) + flow = 'r'; + + return uart_set_options(port, co, baud, parity, bits, flow); +} + + +static struct uart_driver usio_uart_driver; +static struct console usio_console = { + .name = USIO_UART_DEV_NAME, + .write = usio_console_write, + .device = uart_console_device, + .setup = usio_console_setup, + .flags = CON_PRINTBUFFER, + .index = -1, + .data = &usio_uart_driver, +}; + +static int __init usio_console_init(void) +{ + register_console(&usio_console); + return 0; +} +console_initcall(usio_console_init); + +#define USIO_CONSOLE (&usio_console) +#else +#define USIO_CONSOLE NULL +#endif + + +static struct uart_driver usio_uart_driver = { + .owner = THIS_MODULE, + .driver_name = USIO_NAME, + .dev_name = USIO_UART_DEV_NAME, + .cons = USIO_CONSOLE, + .nr = CONFIG_SERIAL_M10V_USIO_PORTS, +}; + +static int usio_probe(struct platform_device *pdev) +{ + struct clk *clk = devm_clk_get(&pdev->dev, 0); + struct uart_port *port; + struct resource *res; + int index = 0; + int ret; + + if (IS_ERR(clk)) { + dev_err(&pdev->dev, "Missing clock\n"); + return PTR_ERR(clk); + } + ret = clk_prepare_enable(clk); + if (ret) { + dev_err(&pdev->dev, "Clock enable failed: %d\n", ret); + return ret; + } + of_property_read_u32(pdev->dev.of_node, "index", &index); + port = &usio_ports[index]; + + port->private_data = (void *)clk; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (res == NULL) { + dev_err(&pdev->dev, "Missing regs\n"); + ret = -ENODEV; + goto failed; + } + port->mapbase = res->start; + port->membase = ioremap(res->start, (res->end - res->start + 1)); + port->membase = devm_ioremap(&pdev->dev, res->start, + resource_size(res)); + + ret = platform_get_irq_byname(pdev, "rx"); + usio_irq[index][RX] = ret; + + ret = platform_get_irq_byname(pdev, "tx"); + usio_irq[index][TX] = ret; + + port->irq = usio_irq[index][RX]; + port->uartclk = clk_get_rate(clk); + port->fifosize = 128; + port->iotype = UPIO_MEM32; + port->flags = UPF_BOOT_AUTOCONF | UPF_SPD_VHI; + port->line = index; + port->ops = &usio_ops; + port->dev = &pdev->dev; + + ret = uart_add_one_port(&usio_uart_driver, port); + if (ret) { + dev_err(&pdev->dev, "Adding port failed: %d\n", ret); + goto failed1; + } + return 0; + +failed1: + iounmap(port->membase); + +failed: + clk_disable_unprepare(clk); + clk_put(clk); + + return ret; +} + +static int usio_remove(struct platform_device *pdev) +{ + struct uart_port *port = &usio_ports[pdev->id]; + struct clk *clk = port->private_data; + + uart_remove_one_port(&usio_uart_driver, port); + clk_disable_unprepare(clk); + clk_put(clk); + + return 0; +} + +#define usio_suspend NULL +#define usio_resume NULL + +static const struct of_device_id m10v_usio_dt_ids[] = { + { .compatible = "socionext,milbeaut-m10v-usio-uart" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, m10v_usio_dt_ids); + +static struct platform_driver usio_driver = { + .probe = usio_probe, + .remove = usio_remove, + .suspend = usio_suspend, + .resume = usio_resume, + .driver = { + .name = USIO_NAME, + .of_match_table = m10v_usio_dt_ids, + }, +}; + +static int __init usio_init(void) +{ + int ret = uart_register_driver(&usio_uart_driver); + + if (ret) { + pr_err("%s: uart registration failed: %d\n", __func__, ret); + return ret; + } + ret = platform_driver_register(&usio_driver); + if (ret) { + uart_unregister_driver(&usio_uart_driver); + pr_err("%s: drv registration failed: %d\n", __func__, ret); + return ret; + } + + return 0; +} + +static void __exit usio_exit(void) +{ + platform_driver_unregister(&usio_driver); + uart_unregister_driver(&usio_uart_driver); +} + +module_init(usio_init); +module_exit(usio_exit); + +MODULE_AUTHOR("SOCIONEXT"); +MODULE_DESCRIPTION("SN_USIO/UART Driver"); +MODULE_LICENSE("GPL"); + diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index dce5f9d..984df0d 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h @@ -281,4 +281,7 @@ /* MediaTek BTIF */ #define PORT_MTK_BTIF 117 +/* Socionext UART */ +#define PORT_SN_USIO 118 + #endif /* _UAPILINUX_SERIAL_CORE_H */ From patchwork Mon Nov 19 01:02:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 334D714BD for ; Mon, 19 Nov 2018 01:03:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21D7C2971F for ; Mon, 19 Nov 2018 01:03:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 151CF299A3; Mon, 19 Nov 2018 01:03:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AFFFB2971F for ; Mon, 19 Nov 2018 01:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=c7ksHG96FnLgHl/9PxQ8oZvJGHEuuItWv305ziN+Ibs=; b=muZ /qq+YdFljzDBOzaLMQ6OXdTfjit9a8FsBa+wRJDB51YIJ4sBDN8rwCnM2QgkFwtzPKzLVUc+Y3otv 60qp1zGoX1tZIgW0RUeQnyuGNJgoeIXeuCC8PaL/5hBWHMxI/r6C7lUxsxF3B2oVm3wGSP5orPC2W 4tPSIglC13/lvnbDYvNvDNQfbYK05jcxsHeZjaBarD25E4oBww+jixPItUF4/Xd5Xzi7AW/6k6i1r Noa1MP2QVRhfm4JzlJu7JDyJ0vbLmm74FqYmxewGsinuroMFI6I032dSLC7lcbeeNgBnEOGXA9mPV 6cLrCYcEsbL5EfXhXHjbVnEko6yCB+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXyR-0002nZ-5H; Mon, 19 Nov 2018 01:03:35 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvw-0000WK-H1 for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:01:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NRWTFr89fF5VpqZIVRf79OsbvrbUA2GQ0h+ONbfiqOw=; b=qwv829idS29vCtHrxATOtEaIe 6I9wIq9z03R7vISyAElYCjNtrIU+nyCd+cNZ9gmvqDXxog0XrQQ2/hal4ojqyFoaPY3OfqAEkZZa6 lSFSord6PSo4yVJyhxeUoVsiWdcKwGBXnI+bcjaR5lYeJLH5xd02zL1V4KSONU/hEE42rGpBK1GIx evN7AC7iviwaLddf4hMoxrWpme1qffjYkW7IREZqgg6d+cW1dgw2Nx0/W0wb1d5A+VAZYQvZm2rUU KBllqO3BUy5AEbXhGneEL22pmL1KTLnk4ftaW29t1NRkRfmfu/9ayob3w6vFMxcbkNQRdDaE1jGqL oxAEQz1sw==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvs-00036q-BC for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:00:58 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:55 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 96EFC180111; Mon, 19 Nov 2018 10:00:55 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:55 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 0BB8840387; Mon, 19 Nov 2018 10:00:55 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id DFBBE120455; Mon, 19 Nov 2018 10:00:54 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 10/14] dt-bindings: pinctrl: milbeaut: Add Milbeaut M10V pinctrl description Date: Mon, 19 Nov 2018 10:02:12 +0900 Message-Id: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010056_658912_40B0ADDA X-CRM114-Status: GOOD ( 23.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add DT bindings document for Milbeaut M10V pinctrl. Signed-off-by: Sugaya Taichi --- .../pinctrl/socionext,milbeaut-pinctrl.txt | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/socionext,milbeaut-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/socionext,milbeaut-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/socionext,milbeaut-pinctrl.txt new file mode 100644 index 0000000..7469189 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/socionext,milbeaut-pinctrl.txt @@ -0,0 +1,33 @@ +Milbeaut SoCs pin controller + +Required properties: +- compatible: should be one of the following: + "socionext,milbeaut-m10v-pinctrl" - for m10v SoC +- reg: offset and length of the register set. +- reg-names: should be "pinctrl", "exiu". +- gpio-cells; should be 2. +- interrupt-cells: should be 2. +- clocks: phandle to the input clock. +- interrupts: three interrupts specifer. +- interrupt-names: corresponds "interrupts" factor. + +Example: + pinctrl: pinctrl@1d022000 { + compatible = "socionext,milbeaut-m10v-pinctrl"; + reg = <0x1d022000 0x1000>, + <0x1c26f000 0x1000>; + reg-names = "pinctrl", "exiu"; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + clocks = <&dummy_clk>; + interrupts = <0 54 4>, <0 55 4>, <0 56 4>, <0 57 4>, + <0 58 4>, <0 59 4>, <0 60 4>, <0 61 4>, + <0 62 4>, <0 63 4>, <0 64 4>, <0 65 4>, + <0 66 4>, <0 67 4>, <0 68 4>, <0 69 4>; + interrupt-names = "pin-48", "pin-49", "pin-50", "pin-51", + "pin-52", "pin-53", "pin-54", "pin-55", + "pin-56", "pin-57", "pin-58", "pin-59", + "pin-60", "pin-61", "pin-62", "pin-63"; + } From patchwork Mon Nov 19 01:02:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688143 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6825B13BF for ; Mon, 19 Nov 2018 01:04:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5441129980 for ; Mon, 19 Nov 2018 01:04:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4894C299B5; Mon, 19 Nov 2018 01:04:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2302829980 for ; Mon, 19 Nov 2018 01:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=i4ONo3PC8gtWG8PUOF4eqUcKLblhQaHjUmb5okkEUyI=; b=BDhEbWiTwK1VeG4Km7f/mt5w7Q K1/VLfDeK/NN3ldhPu7tMz/YUaS7LSbf2lkhEV6/VRa2x5L8wKpwSffYiCYzhejtK1IwPgo5GbNd7 wNnZhZJigUwE3pOcOlfAG6xtj36Sf3UPUzf436GiZ9iRF+CbY+eBAT+BO+17NUuAHNLcGQvjm1bbp PiVTec9ALOFIz8KqZflC3xGo/lp+qAKjI8J8p5xsLZZL0D+3bbPCb2qfOJzNcUoTBLW5rLvG7tI/L XlzSQ1Kte5ZiA7iJ5GidEnJViM6ChU3GBDTgPZd6GrDgaGZ6sY4YaJGxsSxMWVl8jkmem41cNbL2V QV4clipQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXyi-00033b-OF; Mon, 19 Nov 2018 01:03:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXw0-0000aq-A3 for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:01:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WXqJXeXXVbI1cb0p3bnKSKyfTD9Gp18rSBDLodhc74s=; b=bx4P3iFXoYAopzso3DWXc2bP5 hORG4FGKXRj87IdaudGFg+zrt4S3/mujufHPlXSr4S0SkexzG5WWz0gSHOAcPHhElOCBK/I0FMeR3 jahFlNVF61+4PSkY2NLuS+YwMpl/yu7PQr8tReRnsaOSSgAzFZmjhJBLhmvs0gilBM1WfU3k9H1IU Xhh8/8YPpLeDNDjYeuyoZ7U0ZgaKUfS0o5kgz08Hr0RZTEewKqvmdTpIRT+w3vcBmsEGN3pk3bUcK 7lFKxSyS3HSHh1O3tj1Ec18eTGpuh/ifqj+Iv7UPkS+mRg2zHc897e7LuLNS6kvDFvl5IVgcg2s1J M3lQ3QumQ==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvu-00036q-OU for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:01:02 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:57 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id A7383180111; Mon, 19 Nov 2018 10:00:57 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:57 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 624B340387; Mon, 19 Nov 2018 10:00:57 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 4098C120455; Mon, 19 Nov 2018 10:00:57 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 11/14] pinctrl: milbeaut: Add Milbeaut M10V pinctrl Date: Mon, 19 Nov 2018 10:02:13 +0900 Message-Id: <1542589336-13925-2-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010100_225993_214F2DCE X-CRM114-Status: GOOD ( 35.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add Milbeaut M10V pinctrl. The M10V has the pins that can be used GPIOs or take multiple other functions. Signed-off-by: Sugaya Taichi --- drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-m10v.c | 765 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 775 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-m10v.c diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 4d8c00e..b9f17e0 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -177,6 +177,15 @@ config PINCTRL_OXNAS select GPIOLIB_IRQCHIP select MFD_SYSCON +config PINCTRL_M10V + bool + select PINMUX + select PINCONF + select GENERIC_PINCONF + select OF_GPIO + select REGMAP_MMIO + select GPIOLIB_IRQCHIP + config PINCTRL_ROCKCHIP bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 18a13c1..1a4a2b2 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_PINCTRL_GEMINI) += pinctrl-gemini.o obj-$(CONFIG_PINCTRL_MAX77620) += pinctrl-max77620.o obj-$(CONFIG_PINCTRL_MCP23S08) += pinctrl-mcp23s08.o obj-$(CONFIG_PINCTRL_MESON) += meson/ +obj-$(CONFIG_PINCTRL_M10V) += pinctrl-m10v.o obj-$(CONFIG_PINCTRL_OXNAS) += pinctrl-oxnas.o obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o diff --git a/drivers/pinctrl/pinctrl-m10v.c b/drivers/pinctrl/pinctrl-m10v.c new file mode 100644 index 0000000..d4ca713 --- /dev/null +++ b/drivers/pinctrl/pinctrl-m10v.c @@ -0,0 +1,765 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Socionext Ltd. + * Copyright (C) 2015 Linaro Ltd. + * Author: Jassi Brar + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pinctrl-utils.h" + +#define EIMASK 0x0 +#define EISRCSEL 0x4 +#define EIREQSTA 0x8 +#define EIRAWREQSTA 0xc +#define EIREQCLR 0x10 +#define EILVL 0x14 +#define EIEDG 0x18 +#define EISIR 0x1c + +#define PDR 0x0 +#define PDR_S 0x50 +#define PDR_C 0xa0 +#define DDR 0x100 +#define EPCR 0x200 +#define PUDER 0x300 +#define PUDCR 0x400 + +#define M10V_BANKS 26 +#define PINS_PER_BANK 8 +#define M10V_TOTAL_PINS (M10V_BANKS * PINS_PER_BANK) +#define PINS_PER_REG 16 + +struct pin_irq_map { + int pin; /* offset of pin in the managed range */ + int irq; /* virq of the pin as fpint */ + int type; + char irqname[8]; +}; + +struct m10v_pinctrl { + void __iomem *base; + void __iomem *exiu; + struct gpio_chip gc; + struct pinctrl_desc pd; + char pin_names[4 * M10V_TOTAL_PINS]; + struct pinctrl_pin_desc pins[M10V_TOTAL_PINS]; + unsigned int gpins[M10V_TOTAL_PINS][1]; /* 1 pin-per-group */ + struct irq_domain *irqdom; + spinlock_t irq_lock, lock; + int extints; + struct pin_irq_map fpint[]; /* keep at end */ +}; + +struct milbeaut_function { + const char *name; + const char * const *groups; + unsigned int ngroups; +}; + +static const char m10v_bank_name[] = {'0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', + 'G', 'H', 'W', 'J', 'K', 'L', 'M', 'N', + 'Y', 'P'}; +static const char * const usio0_m10v_grps[] = {"PE2", "PE3", "PF0"}; +static const char * const usio1_m10v_grps[] = {"PE4", "PE5", "PF1"}; +static const char * const usio2_m10v_grps[] = {"PE0", "PE1"}; +static const char * const usio3_m10v_grps[] = {"PY0", "PY1", "PY2"}; +static const char * const usio4_m10v_grps[] = {"PP0", "PP1", "PP2"}; +static const char * const usio5_m10v_grps[] = {"PM0", "PM1", "PM3"}; +static const char * const usio6_m10v_grps[] = {"PN0", "PN1", "PN3"}; +static const char * const usio7_m10v_grps[] = {"PY3", "PY5", "PY6"}; +static const char *gpio_m10v_grps[M10V_TOTAL_PINS]; + +static const struct milbeaut_function m10v_functions[] = { +#define FUNC_M10V(fname) \ + { \ + .name = #fname, \ + .groups = fname##_m10v_grps, \ + .ngroups = ARRAY_SIZE(fname##_m10v_grps), \ + } + FUNC_M10V(gpio), /* GPIO always at index 0 */ + FUNC_M10V(usio0), + FUNC_M10V(usio1), + FUNC_M10V(usio2), + FUNC_M10V(usio3), + FUNC_M10V(usio4), + FUNC_M10V(usio5), + FUNC_M10V(usio6), + FUNC_M10V(usio7), +}; + +static const char *bank_name; +static const struct milbeaut_function *milbeaut_functions; + +static int m10v_pconf_group_set(struct pinctrl_dev *pctldev, + unsigned int group, + unsigned long *configs, + unsigned int num_configs) +{ + struct m10v_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + u32 pin, val, reg, offset; + unsigned long flags; + int i; + + pin = pctl->gpins[group][0]; + reg = pin / PINS_PER_REG * 4; + offset = pin % PINS_PER_REG; + + spin_lock_irqsave(&pctl->lock, flags); + + for (i = 0; i < num_configs; i++) { + switch (pinconf_to_config_param(configs[i])) { + case PIN_CONFIG_BIAS_PULL_UP: + /* enable Pull-Up/Down resistance */ + val = readl_relaxed(pctl->base + PUDER + reg); + val |= BIT(offset); + writel_relaxed(val, pctl->base + PUDER + reg); + /* enable Pull-Up */ + val = readl_relaxed(pctl->base + PUDCR + reg); + val |= BIT(offset); + writel_relaxed(val, pctl->base + PUDCR + reg); + break; + case PIN_CONFIG_BIAS_PULL_DOWN: + /* enable Pull-Up/Down resistance */ + val = readl_relaxed(pctl->base + PUDER + reg); + val |= BIT(offset); + writel_relaxed(val, pctl->base + PUDER + reg); + /* enable Pull-Down */ + val = readl_relaxed(pctl->base + PUDCR + reg); + val &= ~BIT(offset); + writel_relaxed(val, pctl->base + PUDCR + reg); + break; + case PIN_CONFIG_BIAS_DISABLE: + val = readl_relaxed(pctl->base + PUDER + reg); + val &= ~BIT(offset); + writel_relaxed(val, pctl->base + PUDER + reg); + break; + default: + break; + } + } + + spin_unlock_irqrestore(&pctl->lock, flags); + + return 0; +} + +static const struct pinconf_ops m10v_pconf_ops = { + .pin_config_group_set = m10v_pconf_group_set, +}; + +static int m10v_pctrl_get_groups_count(struct pinctrl_dev *pctldev) +{ + return M10V_TOTAL_PINS; +} + +static const char *m10v_pctrl_get_group_name(struct pinctrl_dev *pctldev, + unsigned int pin) +{ + struct m10v_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + + return &pctl->pin_names[4 * pin]; +} + +static int m10v_pctrl_get_group_pins(struct pinctrl_dev *pctldev, + unsigned int group, + const unsigned int **pins, + unsigned int *num_pins) +{ + struct m10v_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + + *pins = pctl->gpins[group]; + *num_pins = 1; + return 0; +} + +static const struct pinctrl_ops m10v_pctrl_ops = { + .get_groups_count = m10v_pctrl_get_groups_count, + .get_group_name = m10v_pctrl_get_group_name, + .get_group_pins = m10v_pctrl_get_group_pins, + .dt_node_to_map = pinconf_generic_dt_node_to_map_group, + .dt_free_map = pinctrl_utils_free_map, +}; + +static int m10v_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev) +{ + return ARRAY_SIZE(m10v_functions); +} + +static const char *m10v_pmx_get_func_name(struct pinctrl_dev *pctldev, + unsigned int function) +{ + return milbeaut_functions[function].name; +} + +static int m10v_pmx_get_func_groups(struct pinctrl_dev *pctldev, + unsigned int function, + const char * const **groups, + unsigned * const num_groups) +{ + *groups = milbeaut_functions[function].groups; + *num_groups = milbeaut_functions[function].ngroups; + return 0; +} + +static void _set_mux(struct m10v_pinctrl *pctl, unsigned int pin, bool gpio) +{ + u32 val, reg, offset; + unsigned long flags; + + reg = pin / PINS_PER_REG * 4; + offset = pin % PINS_PER_REG; + + reg += EPCR; + + spin_lock_irqsave(&pctl->lock, flags); + + val = readl_relaxed(pctl->base + reg); + + if (gpio) + val &= ~BIT(offset); + else + val |= BIT(offset); + + writel_relaxed(val, pctl->base + reg); + + spin_unlock_irqrestore(&pctl->lock, flags); +} + +static int m10v_pmx_set_mux(struct pinctrl_dev *pctldev, + unsigned int function, + unsigned int group) +{ + struct m10v_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + u32 pin = pctl->gpins[group][0]; /* each group has exactly 1 pin */ + + _set_mux(pctl, pin, !function); + + return 0; +} + +static int _set_direction(struct m10v_pinctrl *pctl, + unsigned int pin, bool input) +{ + u32 val, reg, offset; + unsigned long flags; + + reg = pin / PINS_PER_REG * 4; + offset = pin % PINS_PER_REG; + + reg += DDR; + + spin_lock_irqsave(&pctl->lock, flags); + + val = readl_relaxed(pctl->base + reg); + + if (input) + val &= ~BIT(offset); + else + val |= BIT(offset); + + writel_relaxed(val, pctl->base + reg); + + spin_unlock_irqrestore(&pctl->lock, flags); + + return 0; +} + +static int +m10v_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, + struct pinctrl_gpio_range *range, + unsigned int pin, bool input) +{ + struct m10v_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + + return _set_direction(pctl, pin, input); +} + +static int +m10v_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, + struct pinctrl_gpio_range *range, + unsigned int pin) +{ + struct m10v_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + + _set_mux(pctl, pin, true); + return 0; +} + +static const struct pinmux_ops m10v_pmx_ops = { + .get_functions_count = m10v_pmx_get_funcs_cnt, + .get_function_name = m10v_pmx_get_func_name, + .get_function_groups = m10v_pmx_get_func_groups, + .set_mux = m10v_pmx_set_mux, + .gpio_set_direction = m10v_pmx_gpio_set_direction, + .gpio_request_enable = m10v_pmx_gpio_request_enable, +}; + +static int m10v_gpio_get(struct gpio_chip *gc, unsigned int group) +{ + struct m10v_pinctrl *pctl = + container_of(gc, struct m10v_pinctrl, gc); + u32 pin, val, reg, offset; + + pin = pctl->gpins[group][0]; + reg = PDR + pin / PINS_PER_REG * 4; + offset = pin % PINS_PER_REG; + val = readl_relaxed(pctl->base + reg); + + return !!(val & BIT(offset)); +} + +static void m10v_gpio_set(struct gpio_chip *gc, unsigned int group, int set) +{ + struct m10v_pinctrl *pctl = + container_of(gc, struct m10v_pinctrl, gc); + u32 pin, reg, offset, val; + + pin = pctl->gpins[group][0]; + reg = PDR + pin / PINS_PER_REG * 4; + offset = pin % PINS_PER_REG; + + val = BIT(offset + 16); + if (set) + val |= BIT(offset); + + writel_relaxed(val, pctl->base + reg); +} + +static void (*gpio_set)(struct gpio_chip *, unsigned int, int); + +static int m10v_gpio_direction_input(struct gpio_chip *gc, + unsigned int offset) +{ + return pinctrl_gpio_direction_input(gc->base + offset); +} + +static int m10v_gpio_direction_output(struct gpio_chip *gc, + unsigned int offset, int value) +{ + int ret; + + ret = pinctrl_gpio_direction_output(gc->base + offset); + if (!ret) + gpio_set(gc, offset, value); + + return ret; +} + +static int m10v_gpio_to_irq(struct gpio_chip *gc, unsigned int offset) +{ + struct m10v_pinctrl *pctl = + container_of(gc, struct m10v_pinctrl, gc); + + return irq_linear_revmap(pctl->irqdom, offset); +} + +static struct lock_class_key gpio_lock_class; +static struct lock_class_key gpio_request_class; + +static int pin_to_extint(struct m10v_pinctrl *pctl, int pin) +{ + int extint; + + for (extint = 0; extint < pctl->extints; extint++) + if (pctl->fpint[extint].pin == pin) + break; + + if (extint == pctl->extints) + return -1; + + return extint; +} + +static void update_trigger(struct m10v_pinctrl *pctl, int extint) +{ + int type = pctl->fpint[extint].type; + int pin = pctl->fpint[extint].pin; + u32 masked, val, eilvl, eiedg; + int lvl; + u32 reg, offset; + + reg = pin / PINS_PER_REG * 4; + offset = pin % PINS_PER_REG; + + /* sense gpio */ + val = readl_relaxed(pctl->base + PDR + reg); + lvl = (val >> offset) & 1; + + eilvl = readl_relaxed(pctl->exiu + EILVL); + eiedg = readl_relaxed(pctl->exiu + EIEDG); + + if (type == IRQ_TYPE_LEVEL_LOW || + (lvl && (type & IRQ_TYPE_LEVEL_LOW))) { + eilvl &= ~BIT(extint); + eiedg &= ~BIT(extint); + } + + if (type == IRQ_TYPE_EDGE_FALLING || + (lvl && (type & IRQ_TYPE_EDGE_FALLING))) { + eilvl &= ~BIT(extint); + eiedg |= BIT(extint); + } + + if (type == IRQ_TYPE_LEVEL_HIGH || + (!lvl && (type & IRQ_TYPE_LEVEL_HIGH))) { + eilvl |= BIT(extint); + eiedg &= ~BIT(extint); + } + + if (type == IRQ_TYPE_EDGE_RISING || + (!lvl && (type & IRQ_TYPE_EDGE_RISING))) { + eilvl |= BIT(extint); + eiedg |= BIT(extint); + } + + /* Mask the interrupt */ + val = readl_relaxed(pctl->exiu + EIMASK); + masked = val & BIT(extint); /* save status */ + val |= BIT(extint); + writel_relaxed(val, pctl->exiu + EIMASK); + + /* Program trigger */ + writel_relaxed(eilvl, pctl->exiu + EILVL); + writel_relaxed(eiedg, pctl->exiu + EIEDG); + + if (masked) + return; + + /* UnMask the interrupt */ + val = readl_relaxed(pctl->exiu + EIMASK); + val &= ~BIT(extint); + writel_relaxed(val, pctl->exiu + EIMASK); +} + +static irqreturn_t m10v_gpio_irq_handler(int irq, void *data) +{ + struct m10v_pinctrl *pctl = data; + int i, pin; + u32 val; + + for (i = 0; i < pctl->extints; i++) + if (pctl->fpint[i].irq == irq) + break; + if (i == pctl->extints) { + pr_err("%s:%d IRQ(%d)!\n", __func__, __LINE__, irq); + return IRQ_NONE; + } + + if (!pctl->exiu) + return IRQ_NONE; + + val = readl_relaxed(pctl->exiu + EIREQSTA); + if (!(val & BIT(i))) { + pr_err("%s:%d i=%d EIREQSTA=0x%x IRQ(%d)!\n", + __func__, __LINE__, i, val, irq); + return IRQ_NONE; + } + + pin = pctl->fpint[i].pin; + generic_handle_irq(irq_linear_revmap(pctl->irqdom, pin)); + + return IRQ_HANDLED; +} + +static void m10v_gpio_irq_enable(struct irq_data *data) +{ + struct m10v_pinctrl *pctl = irq_data_get_irq_chip_data(data); + int extint = pin_to_extint(pctl, irqd_to_hwirq(data)); + unsigned long flags; + u32 val; + + if (extint < 0 || !pctl->exiu) + return; + + _set_mux(pctl, irqd_to_hwirq(data), true); + _set_direction(pctl, irqd_to_hwirq(data), true); + + spin_lock_irqsave(&pctl->irq_lock, flags); + + /* Clear before enabling */ + writel_relaxed(BIT(extint), pctl->exiu + EIREQCLR); + + /* UnMask the interrupt */ + val = readl_relaxed(pctl->exiu + EIMASK); + val &= ~BIT(extint); + writel_relaxed(val, pctl->exiu + EIMASK); + + spin_unlock_irqrestore(&pctl->irq_lock, flags); +} + +static void m10v_gpio_irq_disable(struct irq_data *data) +{ + struct m10v_pinctrl *pctl = irq_data_get_irq_chip_data(data); + int extint = pin_to_extint(pctl, irqd_to_hwirq(data)); + unsigned long flags; + u32 val; + + if (extint < 0 || !pctl->exiu) + return; + + spin_lock_irqsave(&pctl->irq_lock, flags); + + /* Mask the interrupt */ + val = readl_relaxed(pctl->exiu + EIMASK); + val |= BIT(extint); + writel_relaxed(val, pctl->exiu + EIMASK); + + spin_unlock_irqrestore(&pctl->irq_lock, flags); +} + +static int m10v_gpio_irq_set_type(struct irq_data *data, unsigned int type) +{ + struct m10v_pinctrl *pctl = irq_data_get_irq_chip_data(data); + int extint = pin_to_extint(pctl, irqd_to_hwirq(data)); + unsigned long flags; + + if (extint < 0 || !pctl->exiu) + return -EINVAL; + + spin_lock_irqsave(&pctl->irq_lock, flags); + + pctl->fpint[extint].type = type; + update_trigger(pctl, extint); + + spin_unlock_irqrestore(&pctl->irq_lock, flags); + + return 0; +} + +void m10v_gpio_irq_ack(struct irq_data *data) +{ + struct m10v_pinctrl *pctl = irq_data_get_irq_chip_data(data); + int extint = pin_to_extint(pctl, irqd_to_hwirq(data)); + + if (extint < 0 || !pctl->exiu) + return; + + writel_relaxed(BIT(extint), pctl->exiu + EIREQCLR); +} + +void m10v_gpio_irq_mask(struct irq_data *data) +{ + struct m10v_pinctrl *pctl = irq_data_get_irq_chip_data(data); + int extint = pin_to_extint(pctl, irqd_to_hwirq(data)); + unsigned long flags; + u32 val; + + if (extint < 0 || !pctl->exiu) + return; + + spin_lock_irqsave(&pctl->irq_lock, flags); + + val = readl_relaxed(pctl->exiu + EIMASK); + val |= BIT(extint); + writel_relaxed(val, pctl->exiu + EIMASK); + + spin_unlock_irqrestore(&pctl->irq_lock, flags); +} + +void m10v_gpio_irq_unmask(struct irq_data *data) +{ + struct m10v_pinctrl *pctl = irq_data_get_irq_chip_data(data); + int extint = pin_to_extint(pctl, irqd_to_hwirq(data)); + unsigned long flags; + u32 val; + + if (extint < 0 || !pctl->exiu) + return; + + spin_lock_irqsave(&pctl->irq_lock, flags); + + update_trigger(pctl, extint); + + val = readl_relaxed(pctl->exiu + EIMASK); + val &= ~BIT(extint); + writel_relaxed(val, pctl->exiu + EIMASK); + + spin_unlock_irqrestore(&pctl->irq_lock, flags); +} + +static struct irq_chip m10v_gpio_irq_chip = { + .name = "m10v-pin-irq", + .irq_enable = m10v_gpio_irq_enable, + .irq_disable = m10v_gpio_irq_disable, + .irq_set_type = m10v_gpio_irq_set_type, + .irq_mask = m10v_gpio_irq_mask, + .irq_unmask = m10v_gpio_irq_unmask, + .irq_ack = m10v_gpio_irq_ack, +}; + +static const struct of_device_id m10v_pmatch[] = { + { .compatible = "socionext,milbeaut-m10v-pinctrl" }, + {}, +}; + +static int m10v_pinctrl_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct pinctrl_dev *pctl_dev; + struct pin_irq_map fpint[32]; + struct m10v_pinctrl *pctl; + struct pinctrl_desc *pd; + struct gpio_chip *gc; + struct resource *res; + int idx, i, ret, extints, tpins; + + extints = of_irq_count(np); + + pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl) + + sizeof(struct pin_irq_map) * extints, + GFP_KERNEL); + if (!pctl) + return -ENOMEM; + + gpio_set = m10v_gpio_set; + bank_name = m10v_bank_name; + milbeaut_functions = m10v_functions; + tpins = M10V_TOTAL_PINS; + + pd = &pctl->pd; + gc = &pctl->gc; + spin_lock_init(&pctl->lock); + spin_lock_init(&pctl->irq_lock); + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pinctrl"); + pctl->base = devm_ioremap_resource(&pdev->dev, res); + if (!pctl->base) + return -EINVAL; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "exiu"); + if (res) + pctl->exiu = devm_ioremap_resource(&pdev->dev, res); + if (res && !IS_ERR(pctl->exiu)) { + writel_relaxed(~0, pctl->exiu + EIMASK); /* mask all */ + writel_relaxed(~0, pctl->exiu + EIREQCLR); /* eoi all */ + writel_relaxed(0, pctl->exiu + EISRCSEL); /* all fpint */ + writel_relaxed(~0, pctl->exiu + EILVL); /* rising edge type*/ + writel_relaxed(~0, pctl->exiu + EIEDG); + } else { + dev_info(&pdev->dev, "continuing without EXIU support\n"); + pctl->exiu = NULL; + } + + for (i = 0; i < tpins; i++) { + pctl->pins[i].number = i; + pctl->pins[i].name = &pctl->pin_names[4 * i]; + snprintf(&pctl->pin_names[4 * i], 4, "P%c%d", + bank_name[i / PINS_PER_BANK], i % PINS_PER_BANK); + gpio_m10v_grps[i] = &pctl->pin_names[4 * i]; + pctl->gpins[i][0] = i; + } + /* absent or incomplete entries allow all access */ + pd->name = dev_name(&pdev->dev); + pd->pins = pctl->pins; + pd->npins = tpins; + pd->pctlops = &m10v_pctrl_ops; + pd->pmxops = &m10v_pmx_ops; + pd->confops = &m10v_pconf_ops; + pd->owner = THIS_MODULE; + pctl_dev = pinctrl_register(pd, &pdev->dev, pctl); + if (!pctl_dev) { + dev_err(&pdev->dev, "couldn't register pinctrl driver\n"); + return -EINVAL; + } + + pctl->extints = extints; + + pctl->irqdom = irq_domain_add_linear(np, tpins, + &irq_domain_simple_ops, pctl); + idx = 0; + for (i = 0; i < tpins && idx < pctl->extints; i++) { + int irq; + + snprintf(fpint[idx].irqname, 8, "pin-%d", i); + irq = platform_get_irq_byname(pdev, fpint[idx].irqname); + if (irq < 0) + continue; + fpint[idx].irq = irq; + fpint[idx].pin = i; + idx++; + } + + for (idx = 0, i = 0; i < pctl->extints; i++) { + int j = 0, irq = platform_get_irq(pdev, i); + + while (fpint[j].irq != irq) + j++; + + snprintf(pctl->fpint[idx].irqname, 8, "pin-%d", fpint[j].pin); + pctl->fpint[idx].irq = fpint[j].irq; + pctl->fpint[idx].pin = fpint[j].pin; + idx++; + } + + for (i = 0; i < pctl->extints; i++) { + int irq, err = devm_request_irq(&pdev->dev, pctl->fpint[i].irq, + m10v_gpio_irq_handler, IRQF_SHARED, + pctl->fpint[i].irqname, pctl); + if (err) + continue; + + irq = irq_create_mapping(pctl->irqdom, pctl->fpint[i].pin); + irq_set_lockdep_class(irq, &gpio_lock_class, + &gpio_request_class); + irq_set_chip_and_handler(irq, &m10v_gpio_irq_chip, + handle_level_irq); + irq_set_chip_data(irq, pctl); + } + + gc->base = -1; + gc->ngpio = tpins; + gc->label = dev_name(&pdev->dev); + gc->owner = THIS_MODULE; + gc->of_node = np; + gc->direction_input = m10v_gpio_direction_input; + gc->direction_output = m10v_gpio_direction_output; + gc->get = m10v_gpio_get; + gc->set = gpio_set; + gc->to_irq = m10v_gpio_to_irq; + gc->request = gpiochip_generic_request; + gc->free = gpiochip_generic_free; + ret = gpiochip_add(gc); + if (ret) { + dev_err(&pdev->dev, "Failed register gpiochip\n"); + return ret; + } + + ret = gpiochip_add_pin_range(gc, dev_name(&pdev->dev), + 0, 0, tpins); + if (ret) { + dev_err(&pdev->dev, "Failed to add pin range\n"); + gpiochip_remove(gc); + return ret; + } + + return 0; +} + +static struct platform_driver m10v_pinctrl_driver = { + .probe = m10v_pinctrl_probe, + .driver = { + .name = "m10v-pinctrl", + .of_match_table = m10v_pmatch, + }, +}; + +static int __init m10v_pinctrl_init(void) +{ + return platform_driver_register(&m10v_pinctrl_driver); +} +arch_initcall(m10v_pinctrl_init); + From patchwork Mon Nov 19 01:02:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DA0614BD for ; Mon, 19 Nov 2018 01:04:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0898299C8 for ; Mon, 19 Nov 2018 01:04:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD62B29980; Mon, 19 Nov 2018 01:04:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DA1FE299BF for ; Mon, 19 Nov 2018 01:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=e/9WQcucdBFlzdsBZpYNeG1X4+u4r5h7c37mZs6h/bo=; b=Q3GORzI2UytwuyRnn3I759laQT qdEq6ie1A9iMw2v/97ziqv6UtkS5kpC7POszubkyJEeqe/Bqb7+5NpSQ+fN/Ay0y3Sr+B+pb337Mv CsOazAGFbrG6FVr1yTF/HR0xQJg3bEUe5If9k5o+NPg5FduAw6NRQBZ4EtP98ad8aF4ZaD/MfKWC9 ICRzMjIJqEylmKnoUat2EurQPxIKZk+ef3Ku2qU0x/AP8tKEhWvHLcD7Qp+C3dNN/K/EGzUK6z75j hBVwb7Zf18A9k0bpl+wODmw1fu2vMTBsBFiF5iM1hyfcSPH8lAeE9lVFjdlTDEW005F+Jjm2OrTmR zWFesB8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXyz-0003J5-Ir; Mon, 19 Nov 2018 01:04:09 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXw1-0000bm-Jc for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:01:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iSXbdihhVKWrbAaKAqZxAvJVEL5DtKk+7+BzX2sJ0es=; b=cCMoJ/mJRDt4CsRIYKKI4vmed t38Tqrqk2P5SeCV5T7yp5536Vd513B64sC3xmmEo9a+W+7vkBqrYhkQtYnbxJeRa8yqp1ZK2bf6Y4 ydwWHzX8paD9noNKPMxTJhNEjwSCXZFSOQnQck7DYUEF3RbjaTiplIDnlUtdNUUxM32poTyWS0xBT gKvIIA9h8PGMdT/+rtEwq3KFaunBm9m3uZ0+TyBbH/kG0j3o0S63gWZUuBspXELvgmzO8WNtXZmSl jV6y+6FLfpPshcRvvtIH5XqQKdc7U3ZHKrZec2M0sqpgt0Fb86r4XJjx1v1Vgmnsf40WknFt05gTJ tkRAJlT7w==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXvw-00036e-6e for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:01:03 +0000 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:00:59 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 7653E60062; Mon, 19 Nov 2018 10:00:59 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:00:59 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id D6ABF40387; Mon, 19 Nov 2018 10:00:58 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id B3ABA120455; Mon, 19 Nov 2018 10:00:58 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 12/14] ARM: dts: milbeaut: Add device tree set for the Milbeaut M10V board Date: Mon, 19 Nov 2018 10:02:14 +0900 Message-Id: <1542589336-13925-3-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010101_269411_AC2F5C88 X-CRM114-Status: GOOD ( 27.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add devicetree for Milbeaut M10V SoC and M10V Evaluation board. Signed-off-by: Sugaya Taichi --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/milbeaut-m10v-evb.dts | 35 +++ arch/arm/boot/dts/milbeaut-m10v-evb.dtsi | 17 ++ arch/arm/boot/dts/milbeaut-m10v.dtsi | 510 +++++++++++++++++++++++++++++++ 4 files changed, 563 insertions(+) create mode 100644 arch/arm/boot/dts/milbeaut-m10v-evb.dts create mode 100644 arch/arm/boot/dts/milbeaut-m10v-evb.dtsi create mode 100644 arch/arm/boot/dts/milbeaut-m10v.dtsi diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index b0e966d..ee6220b 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1207,6 +1207,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \ mt7623n-bananapi-bpi-r2.dtb \ mt8127-moose.dtb \ mt8135-evbp1.dtb +dtb-$(CONFIG_MACH_M10V_EVB) += milbeaut-m10v-evb.dtb dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-ast2500-evb.dtb \ diff --git a/arch/arm/boot/dts/milbeaut-m10v-evb.dts b/arch/arm/boot/dts/milbeaut-m10v-evb.dts new file mode 100644 index 0000000..af8d6e4 --- /dev/null +++ b/arch/arm/boot/dts/milbeaut-m10v-evb.dts @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Socionext Milbeaut M10V Evaluation Board */ +/dts-v1/; +#include "milbeaut-m10v-evb.dtsi" + +/ { + cpus { + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf00>; + }; + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf01>; + }; + + cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf02>; + }; + cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf03>; + }; + + }; + trampoline: trampoline@0x0000F100 { + compatible = "socionext,smp-trampoline"; + reg = <0x0000F100 0x100>; + }; +}; diff --git a/arch/arm/boot/dts/milbeaut-m10v-evb.dtsi b/arch/arm/boot/dts/milbeaut-m10v-evb.dtsi new file mode 100644 index 0000000..fc35c0b --- /dev/null +++ b/arch/arm/boot/dts/milbeaut-m10v-evb.dtsi @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "milbeaut-m10v.dtsi" + +/ { + model = "Socionext M10V EVB"; + compatible = "socionext,sc2000a", "socionext,milbeaut-m10v-evb"; + interrupt-parent = <&gic>; + chosen { + bootargs = "consoleblank=0 loglevel=8 init=/sbin/finit root=/dev/mmcblk0p2 rootwait ro console=ttyUSI0,115200n8 console=/dev/tty1 "; + linux,initrd-start = <0x4A000000>; + linux,initrd-end = <0x4BF00000>; + }; + memory { + device_type = "memory"; + reg = <0x40000000 0x80000000>; + }; +}; diff --git a/arch/arm/boot/dts/milbeaut-m10v.dtsi b/arch/arm/boot/dts/milbeaut-m10v.dtsi new file mode 100644 index 0000000..4745dc6 --- /dev/null +++ b/arch/arm/boot/dts/milbeaut-m10v.dtsi @@ -0,0 +1,510 @@ +// SPDX-License-Identifier: GPL-2.0 +#include +#include +#include +#include + +#include "skeleton.dtsi" + +/ { + compatible = "socionext,sc2000a"; + interrupt-parent = <&gic>; + cpus { + #address-cells = <1>; + #size-cells = <0>; + }; + + + gic: interrupt-controller@1d000000 { + compatible = "arm,cortex-a7-gic"; + interrupt-controller; + #interrupt-cells = <3>; + reg = <0x1d001000 0x1000>, /* Distributer base and size */ + <0x1d002000 0x1000>; /* CPU I/f base and size */ + }; + + m10v-clk-tree@ { + compatible = "socionext,milbeaut-m10v-clk-regs"; + reg = <0x1d021000 0x4000>; + + clocks { + #address-cells = <0>; + #size-cells = <0>; + + uclk40xi: uclk40xi { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <40000000>; + }; + + aumclki: aumclki { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <20000000>; + }; + + rtc32k: rtc32k { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + pxrefclk: pxrefclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + pcisuppclk: pcisuppclk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + clock-div = <20>; + clock-mult = <1>; + }; + + usb2_clk: usb2_clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + clock-div = <2>; + clock-mult = <1>; + }; + + pll1: pll1 { + compatible = + "socionext,milbeaut-m10v-pll-fixed-factor"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + offset = <1>; + clock-div = <1>; + clock-mult = <40>; + }; + + pll2: pll2 { + compatible = + "socionext,milbeaut-m10v-pll-fixed-factor"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + offset = <2>; + clock-div = <1>; + clock-mult = <30>; + }; + + pll6: pll6 { /* CLK 6-1 */ + compatible = + "socionext,milbeaut-m10v-pll-fixed-factor"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + offset = <7>; + clock-div = <1>; + clock-mult = <35>; + }; + + pll7: pll7 { /* CLK 7-1 */ + compatible = + "socionext,milbeaut-m10v-pll-fixed-factor"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + offset = <8>; + clock-div = <1>; + clock-mult = <40>; + }; + + pll9: pll9 { /* CA7CLK, ATCLK */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + clock-div = <1>; + clock-mult = <33>; + }; + + pll10: pll10 { + compatible = + "socionext,milbeaut-m10v-pll-fixed-factor"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + offset = <10>; + clock-div = <5>; + clock-mult = <108>; + }; + + pll11: pll11 { /* CLK 11-1 */ + compatible = + "socionext,milbeaut-m10v-pll-fixed-factor"; + #clock-cells = <0>; + clocks = <&uclk40xi>; + offset = <12>; + clock-div = <2>; + clock-mult = <75>; + }; + + emmcclk: emmcclk { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll11>; + offset = <28>; /* EMMCCLK */ + mask = <0x3>; + ratios = <15 0x7 10 0x6 9 0x5 8 0x4>; + }; + + pll1_div_1_2: pll1_div_1_2 { /* CLK 1-2 */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll1>; + clock-div = <2>; + clock-mult = <1>; + }; + + pll2_div_1_2: pll2_div_1_2 { /* CLK 2-2 */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll2>; + clock-div = <2>; + clock-mult = <1>; + }; + + pll6_div_1_2: pll6_div_1_2 { /* CLK 6-2 */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll6>; + clock-div = <2>; + clock-mult = <1>; + }; + + pll6_div_1_3: pll6_div_1_3 { /* CLK 6-3 */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll6>; + clock-div = <3>; + clock-mult = <1>; + }; + + pll7_div_1_2: pll7_div_1_2 { /* CLK 7-2 */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll7>; + clock-div = <2>; + clock-mult = <1>; + }; + + pll7_div_1_5: pll7_div_1_5 { /* CLK 7-5 */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll7>; + clock-div = <5>; + clock-mult = <1>; + }; + + pll10_div_1_2: pll10_div_1_2 { /* CLK 10-2 */ + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll10>; + clock-div = <2>; + clock-mult = <1>; + }; + + spiclk_mux_0: spiclk_mux_0 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll10_div_1_2>; + offset = <227>; /* SPICLK */ + mask = <0x3>; + ratios = <4 0x5 2 0x4>; + }; + + spiclk_mux_1: spiclk_mux_1 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll7_div_1_2>; + offset = <227>; /* SPICLK */ + mask = <0x3>; + ratios = <8 0x6>; + }; + + spiclk: spiclk { + compatible = "socionext,milbeaut-m10v-clk-mux"; + #clock-cells = <0>; + clocks = <&spiclk_mux_0>, <&spiclk_mux_1>; + }; + + ca7wdclk: ca7wdclk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll2_div_1_2>; + clock-div = <12>; + clock-mult = <1>; + }; + + pll9_div_1_2: pll9_div_1_2 { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll9>; + clock-div = <2>; + clock-mult = <1>; + }; + + mclk400: mclk400 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <295>; /* MCLK400 */ + mask = <0x3>; + ratios = <4 0x7 2 0x5>; + }; + + mclk200: mclk200 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <291>; /* MCLK200 */ + mask = <0x7>; + ratios = <8 0xf 4 0xb>; + }; + + aclk400: aclk400 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <288>; /* ACLK400 */ + mask = <0x3>; + ratios = <4 0x7 2 0x5>; + }; + + aclk300: aclk300 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll2_div_1_2>; + offset = <352>; /* ACLK300 */ + mask = <0x1>; + ratios = <6 0x3 4 0x2>; + }; + + aclk: aclk { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <276>; /* ACLK */ + mask = <0x7>; + ratios = <8 0xf 4 0xb>; + }; + + aclkexs: aclkexs { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <272>; /* ACLKEXS */ + mask = <0x7>; + ratios = <8 0xf 6 0xd 5 0xc 4 0xb>; + }; + + hclk: hclk { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <263>; /* HCLK */ + mask = <0xf>; + ratios = <16 0x1f 8 0x17>; + }; + + hclkbmh: hclkbmh { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <268>; /* HCLKBMH */ + mask = <0x7>; + ratios = <8 0xf 4 0xb>; + }; + + pclk: pclk { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + offset = <256>; /* PCLK */ + mask = <0x3f>; + ratios = <32 0x5f 16 0x4f>; + }; + + pclkca7wd: pclkca7wd { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clocks = <&pll1_div_1_2>; + clock-div = <16>; + clock-mult = <1>; + }; + + rclk: rclk { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll10_div_1_2>; + offset = <0>; /* RCLK */ + mask = <0x3>; + ratios = <64 0x7 48 0x6 32 0x5 16 0x4>; + }; + + uhs1clk0: uhs1clk0 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll7>; + offset = <3>; /* UHS1CLK0 */ + mask = <0xf>; + ratios = <16 0x14 8 0x13 4 0x12 3 0x11 2 0x10>; + }; + + uhs1clk1_div1: uhs1clk1_div1 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll7>; + offset = <8>; /* UHS1CLK1 */ + mask = <0xf>; + ratios = <16 0x14 8 0x13>; + }; + + uhs1clk1_div2: uhs1clk1_div2 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll6_div_1_2>; + offset = <8>; /* UHS1CLK1 */ + mask = <0xf>; + ratios = <1 0x18>; + }; + + uhs1clk1: uhs1clk1 { + compatible = "socionext,milbeaut-m10v-clk-mux"; + #clock-cells = <0>; + clocks = <&uhs1clk1_div1>, <&uhs1clk1_div2>; + }; + + uhs1clk2_div1: uhs1clk2_div1 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll7>; + offset = <13>; /* UHS1CLK2 */ + mask = <0xf>; + ratios = <16 0x14 8 0x13 4 0x12>; + }; + + uhs1clk2_div2: uhs1clk2_div2 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll6_div_1_2>; + offset = <13>; /* UHS1CLK2 */ + mask = <0xf>; + ratios = <1 0x18>; + }; + + uhs1clk2: uhs1clk2 { + compatible = "socionext,milbeaut-m10v-clk-mux"; + #clock-cells = <0>; + clocks = <&uhs1clk2_div1>, <&uhs1clk2_div2>; + }; + + uhs2clk: uhs2clk { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll6_div_1_3>; + offset = <18>; /* UHS2CLK */ + mask = <0x7>; + ratios = <18 0xf 16 0xe 14 0xd 13 0xc + 12 0xb 11 0xa 10 0x9 9 0x8>; + }; + + nfclk_div1: nfclk_div1 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll7_div_1_2>; + offset = <22>; /* NFCLK */ + mask = <0x1f>; + ratios = <40 0x24 16 0x23 13 0x22 10 0x21 + 8 0x20>; + }; + + nfclk_div2: nfclk_div2 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll7_div_1_5>; + offset = <22>; /* NFCLK */ + mask = <0x1f>; + ratios = <10 0x28>; + }; + + nfclk: nfclk { + compatible = "socionext,milbeaut-m10v-clk-mux"; + #clock-cells = <0>; + clocks = <&nfclk_div1>, <&nfclk_div2>; + }; + + clk5: clk5 { + compatible = "socionext,milbeaut-m10v-clk-div"; + #clock-cells = <0>; + clocks = <&pll10_div_1_2>; + offset = <239>; /* NETAUSEL */ + mask = <0x3>; + ratios = <64 0x7 48 0x6 32 0x5 16 0x4>; + }; + }; + }; + + peri-timer@1e000000 { /* 32-bit Reload Timers */ + compatible = "socionext,milbeaut-m10v-timer"; + reg = <0x1e000050 0x10>, <0x1e000060 0x10>; + interrupts = <0 91 4>; + clocks = <&rclk>; + }; + + timer { /* The Generic Timer */ + compatible = "arm,armv7-timer"; + interrupts = , + , + , + ; + clock-frequency = <40000000>;//40M + always-on; + arm,cpu-registers-not-fw-configured; + }; + + dummy_clk: dummy_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + }; + + pinctrl: pinctrl@1d022000 { + compatible = "socionext,milbeaut-m10v-pinctrl"; + reg = <0x1d022000 0x1000>, + <0x1c26f000 0x1000>; + reg-names = "pinctrl", "exiu"; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + clocks = <&dummy_clk>; + interrupts = <0 54 4>, <0 55 4>, <0 56 4>, <0 57 4>, + <0 58 4>, <0 59 4>, <0 60 4>, <0 61 4>, + <0 62 4>, <0 63 4>, <0 64 4>, <0 65 4>, + <0 66 4>, <0 67 4>, <0 68 4>, <0 69 4>; + interrupt-names = "pin-48", "pin-49", "pin-50", "pin-51", + "pin-52", "pin-53", "pin-54", "pin-55", + "pin-56", "pin-57", "pin-58", "pin-59", + "pin-60", "pin-61", "pin-62", "pin-63"; + + usio1_pins: usio1_pins { + pins = "PE4", "PE5", "P87"; + function = "usio1"; + }; + }; + + usio1: usio_uart@1e700010 { /* PE4, PE5 */ + /* Enable this as ttyUSI0 */ + index = <0>; + compatible = "socionext,milbeaut-m10v-usio-uart"; + reg = <0x1e700010 0x10>; + interrupts = <0 141 0x4>, <0 149 0x4>; + interrupt-names = "rx", "tx"; + clocks = <&hclk>; + }; +}; From patchwork Mon Nov 19 01:02:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61AB213BF for ; Mon, 19 Nov 2018 01:04:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50EAA29980 for ; Mon, 19 Nov 2018 01:04:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B320299D2; Mon, 19 Nov 2018 01:04:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,UPPERCASE_75_100 autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8718229980 for ; Mon, 19 Nov 2018 01:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=D/CXu5VnZJE+27nz3hwFNiVcsuB++Mh06pIp3xlND+s=; b=i+1TzI5pTb1zj4IYsCGKlIdJie nrMEgtt1dcEuwSlXQmPQBNfQXoTDsIwKvOQf0gMnfiRi4GQ0Y95B5rT/eZBrNJKCA1J11M3swHMgG o07CZLcmQ4bNThpc/wI2oo85I8sn7duLh0puGPkJzzYn9hT/Dz12GF5k80uAsK0aOmgY6oPWZMx7d 1LecLHC48AWy7zrMtdzATbydg33ljnF+KSlwsmxE9E88zp4eQ5yTXaSKyzimOHr4FiaozaS5Vc19N yjKlkoiWR6cWP2eaqUxKPKVHKx8i0KZEQ9TRjlwB2nsOZT7gXRKMCsjT94DOsxc4s0zX22BZU7J8v 3rwXoLjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXzU-0003l3-8V; Mon, 19 Nov 2018 01:04:40 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXwD-0000pg-0O for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:01:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gUXu8IM2qwYOIDAHGYHee63csKxTr9y7GTdl+eeqOA8=; b=ijHxTdMeiB3rngo4Q1zUCkoqC VXR4bIkcAQyaFoTyMD2iwlJpsmlgoiLOoguwRmIyAoWcSK486fWThERa2cG2WnXgQ5HIzIwWIQYQD zY7gAYWu0kxBEz9vu8J9gn4Ah13RnOGIvG1uYrpvC4PbY7VWKRukn3dW2w1uRHSJNYxAMuM+7QUbZ mNZ+ACgI9qv6u2R6v/x8rBgoogn7axU+1iBH6PT2jpoy4pqZpki5XuEp4KVj1nl9kEQ+isxIb3k5E 3c96kSwf4Oir7oxYNm9SqAlFQ2euAvNjV6hsE0o5ElWkIXi5bB4JNj4k5u/nB3C1MN9r665sWc5P4 SnAyftdGA==; Received: from mx.socionext.com ([202.248.49.38]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXw8-0003AZ-Mm for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:01:15 +0000 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:01:01 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 07FA1180111; Mon, 19 Nov 2018 10:01:01 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:01:00 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 9DA0E40387; Mon, 19 Nov 2018 10:01:00 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 6B6EE120455; Mon, 19 Nov 2018 10:01:00 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 13/14] ARM: configs: Add Milbeaut M10V defconfig Date: Mon, 19 Nov 2018 10:02:15 +0900 Message-Id: <1542589336-13925-4-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_010113_581667_D19FFD40 X-CRM114-Status: GOOD ( 29.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the minimal defconfig for the Milbeaut M10V. Signed-off-by: Sugaya Taichi --- arch/arm/configs/milbeaut_m10v_defconfig | 364 +++++++++++++++++++++++++++++++ 1 file changed, 364 insertions(+) create mode 100644 arch/arm/configs/milbeaut_m10v_defconfig diff --git a/arch/arm/configs/milbeaut_m10v_defconfig b/arch/arm/configs/milbeaut_m10v_defconfig new file mode 100644 index 0000000..90c22f8 --- /dev/null +++ b/arch/arm/configs/milbeaut_m10v_defconfig @@ -0,0 +1,364 @@ +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="mlbel" +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_FHANDLE=y +CONFIG_NO_HZ_FULL=y +CONFIG_NO_HZ_FULL_ALL=y +CONFIG_NO_HZ_FULL_SYSIDLE=y +CONFIG_NO_HZ_FULL_SYSIDLE_SMALL=4 +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_CGROUPS=y +CONFIG_CGROUP_DEBUG=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_SCHED=y +CONFIG_CFS_BANDWIDTH=y +CONFIG_RT_GROUP_SCHED=y +CONFIG_NAMESPACES=y +CONFIG_USER_NS=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_KALLSYMS_ALL=y +CONFIG_EMBEDDED=y +# CONFIG_COMPAT_BRK is not set +CONFIG_SLAB=y +CONFIG_PROFILING=y +CONFIG_OPROFILE=m +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_ARCH_MILBEAUT=y +CONFIG_ARCH_MILBEAUT_M10V=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_775420=y +# CONFIG_PCI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCIE_SN_DW_PLAT is not set +# CONFIG_PCI_MSI is not set +# CONFIG_PCIEPORTBUS is not set +# CONFIG_PCIEAER is not set +# CONFIG_PCIEASPM is not set +CONFIG_SMP=y +# CONFIG_ARM_CPU_TOPOLOGY is not set +CONFIG_HAVE_ARM_ARCH_TIMER=y +CONFIG_VMSPLIT_2G=y +CONFIG_PREEMPT=y +CONFIG_THUMB2_KERNEL=y +CONFIG_HIGHMEM=y +# CONFIG_COMPACTION is not set +CONFIG_CMA=y +# CONFIG_ATAGS is not set +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ARM_APPENDED_DTB=y +CONFIG_KEXEC=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPU_IDLE=y +CONFIG_VFP=y +CONFIG_NEON=y +CONFIG_KERNEL_MODE_NEON=y +CONFIG_PM_RUNTIME=y +CONFIG_PM_DEBUG=y +CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_PACKET_DIAG=m +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +CONFIG_SYN_COOKIES=y +CONFIG_NET_IPVTI=m +CONFIG_INET_AH=y +CONFIG_INET_ESP=y +CONFIG_INET_IPCOMP=y +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +CONFIG_INET_UDP_DIAG=m +CONFIG_TCP_CONG_ADVANCED=y +CONFIG_IP_SCTP=m +CONFIG_SCTP_COOKIE_HMAC_SHA1=y +CONFIG_TIPC=y +CONFIG_L2TP=m +CONFIG_L2TP_DEBUGFS=m +CONFIG_L2TP_V3=y +CONFIG_L2TP_IP=y +CONFIG_L2TP_ETH=y +CONFIG_IPX=m +CONFIG_NETLINK_MMAP=y +CONFIG_NETLINK_DIAG=y +CONFIG_CFG80211=y +CONFIG_NL80211_TESTMODE=y +CONFIG_CFG80211_DEVELOPER_WARNINGS=y +CONFIG_CFG80211_REG_DEBUG=y +CONFIG_CFG80211_INTERNAL_REGDB=y +CONFIG_CFG80211_WEXT=y +CONFIG_MAC80211=y +# CONFIG_MAC80211_RC_MINSTREL is not set +CONFIG_MAC80211_LEDS=y +CONFIG_RFKILL=y +CONFIG_RFKILL_INPUT=y +CONFIG_RFKILL_REGULATOR=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_DMA_CMA=y +CONFIG_CMA_SIZE_MBYTES=16 +CONFIG_MTD=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_CDN_HPNFC=y +CONFIG_MTD_NAND_CDN_HPNFC_DT=y +CONFIG_MTD_NAND_PLATFORM=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=3 +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=2 +CONFIG_BLK_DEV_RAM=y +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_NETDEVICES=y +CONFIG_MACVLAN=y +CONFIG_TUN=y +CONFIG_VETH=y +# CONFIG_NET_CADENCE is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +CONFIG_R8169=y +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_SOCIONEXT_OGMA=y +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_REALTEK_PHY=y +CONFIG_MWIFIEX=m +CONFIG_MWIFIEX_SDIO=m +CONFIG_INPUT_POLLDEV=y +# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +CONFIG_SERIO_LIBPS2=y +CONFIG_LEGACY_PTY_COUNT=4 +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_DMA is not set +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_M10V_USIO=y +CONFIG_SERIAL_M10V_USIO_CONSOLE=y +# CONFIG_HW_RANDOM is not set +# CONFIG_I2C is not set +# CONFIG_I2C_BOARDINFO is not set +# CONFIG_I2C_COMPAT is not set +# CONFIG_I2C_CHARDEV is not set +# CONFIG_I2C_MUX is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_SNI_M10V is not set +CONFIG_SPI=y +# CONFIG_SPI_SN_USIO=y +#CONFIG_SPI_SNI is not set +#CONFIG_SPI_SPIDEV is not set +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y +# CONFIG_HWMON is not set +CONFIG_WATCHDOG=y +CONFIG_SOFT_WATCHDOG=m +CONFIG_REGULATOR=y +CONFIG_REGULATOR_DEBUG=y +CONFIG_REGULATOR_S6AP412=y +CONFIG_MEDIA_SUPPORT=y +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y +CONFIG_VIDEO_ADV_DEBUG=y +CONFIG_MEDIA_USB_SUPPORT=y +CONFIG_USB_VIDEO_CLASS=y +# CONFIG_USB_GSPCA is not set +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_SOC_CAMERA=y +CONFIG_SOC_CAMERA_PLATFORM=y +CONFIG_V4L_MEM2MEM_DRIVERS=y +CONFIG_V4L_TEST_DRIVERS=y +CONFIG_VIDEO_VIVID=m +CONFIG_VIDEO_VIVID_MAX_DEVS=64 +CONFIG_FB=y +# CONFIG_VGA_ARB is not set +# CONFIG_USB is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_OHCI_HCD_PCI is not set +# CONFIG_USB_OHCI_HCD_PLATFORM is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_CP210X is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_ULPI is not set +# CONFIG_USB_GADGET is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_DWC3_PCI is not set +# CONFIG_USB_DWC3_OTG is not set +# CONFIG_USB_DWC3_SN is not set +# CONFIG_USB_DWC3_OF_SIMPLE is not set +# CONFIG_USB_GADGET_SN_LAP is not set +# CONFIG_USB_CONFIGFS is not set +# CONFIG_USB_CONFIGFS_ACM is not set +# CONFIG_USB_CONFIGFS_MASS_STORAGE is not set +# CONFIG_USB_CONFIGFS_F_MTP is not set +# CONFIG_USB_CONFIGFS_F_UVC is not set +# CONFIG_USB_CONFIGFS_UEVENT is not set +# CONFIG_MMC is not set +# CONFIG_MMC_SDHCI is not set +# CONFIG_MMC_SDHCI_PLTFM is not set +# CONFIG_MMC_SDHCI_F_SDH30 is not set +# CONFIG_MMC_SDHCI_F_EMMC50 is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_HCTOSYS is not set +# CONFIG_RTC_SYSTOHC is not set +CONFIG_RTC_DEBUG=y +CONFIG_RTC_DRV_RX8025=y +CONFIG_DMADEVICES=y +CONFIG_MB86S7X_HDMAC=y +CONFIG_MB8AC0300_XDMAC=y +CONFIG_UIO=y +CONFIG_UIO_SNI=y +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_PWM=y +# CONFIG_PWM_SYSFS is not set +CONFIG_PWM_M10V=y +CONFIG_RESET_CONTROLLER=y +CONFIG_EXFAT=y +CONFIG_EXT4_FS=y +# CONFIG_EXT4_USE_FOR_EXT23 is not set +# CONFIG_XFS_FS is not set +CONFIG_FANOTIFY=y +CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y +CONFIG_QUOTA=y +CONFIG_AUTOFS4_FS=y +# CONFIG_FUSE_FS is not set +CONFIG_FSCACHE=y +CONFIG_FSCACHE_STATS=y +CONFIG_FSCACHE_HISTOGRAM=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=932 +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_ROMFS_FS=y +CONFIG_ROMFS_BACKED_BY_BOTH=y +CONFIG_NFS_FS=m +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=y +CONFIG_NLS_CODEPAGE_775=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_CODEPAGE_852=y +CONFIG_NLS_CODEPAGE_855=y +CONFIG_NLS_CODEPAGE_857=y +CONFIG_NLS_CODEPAGE_860=y +CONFIG_NLS_CODEPAGE_861=y +CONFIG_NLS_CODEPAGE_862=y +CONFIG_NLS_CODEPAGE_863=y +CONFIG_NLS_CODEPAGE_864=y +CONFIG_NLS_CODEPAGE_865=y +CONFIG_NLS_CODEPAGE_866=y +CONFIG_NLS_CODEPAGE_869=y +CONFIG_NLS_CODEPAGE_936=y +CONFIG_NLS_CODEPAGE_950=y +CONFIG_NLS_CODEPAGE_932=y +CONFIG_NLS_CODEPAGE_949=y +CONFIG_NLS_CODEPAGE_874=y +CONFIG_NLS_ISO8859_8=y +CONFIG_NLS_CODEPAGE_1250=y +CONFIG_NLS_CODEPAGE_1251=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=y +CONFIG_NLS_ISO8859_3=y +CONFIG_NLS_ISO8859_4=y +CONFIG_NLS_ISO8859_5=y +CONFIG_NLS_ISO8859_6=y +CONFIG_NLS_ISO8859_7=y +CONFIG_NLS_ISO8859_9=y +CONFIG_NLS_ISO8859_13=y +CONFIG_NLS_ISO8859_14=y +CONFIG_NLS_ISO8859_15=y +CONFIG_NLS_KOI8_R=y +CONFIG_NLS_KOI8_U=y +CONFIG_NLS_MAC_ROMAN=y +CONFIG_NLS_MAC_CELTIC=y +CONFIG_NLS_MAC_CENTEURO=y +CONFIG_NLS_MAC_CROATIAN=y +CONFIG_NLS_MAC_CYRILLIC=y +CONFIG_NLS_MAC_GAELIC=y +CONFIG_NLS_MAC_GREEK=y +CONFIG_NLS_MAC_ICELAND=y +CONFIG_NLS_MAC_INUIT=y +CONFIG_NLS_MAC_ROMANIAN=y +CONFIG_NLS_MAC_TURKISH=y +CONFIG_NLS_UTF8=y +CONFIG_IPCU_FS=y +# CONFIG_TEST_IPCU_FS is not set +CONFIG_PRINTK_TIME=y +CONFIG_DYNAMIC_DEBUG=y +CONFIG_DEBUG_INFO=y +#CONFIG_DEBUG_INFO_REDUCED is not set +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_GIC_BL=y +CONFIG_HEADERS_CHECK=y +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_DEBUG_PREEMPT is not set +CONFIG_RCU_TORTURE_TEST=m +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +CONFIG_KGDB=y +CONFIG_DEBUG_USER=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_MILBEAUT_UART=y +CONFIG_EARLY_PRINTK=y +# CONFIG_EARLY_PRINTK_DIRECT is not set +CONFIG_KEYS=y +CONFIG_ENCRYPTED_KEYS=y +CONFIG_SECURITY=y +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not set +CONFIG_FONTS=y From patchwork Mon Nov 19 01:02:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 10688149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 018F013BF for ; Mon, 19 Nov 2018 01:05:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5242295FF for ; Mon, 19 Nov 2018 01:05:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D922E299B7; Mon, 19 Nov 2018 01:05:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4300C299B5 for ; Mon, 19 Nov 2018 01:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MeifOt6BDJldebeKzgFBWd29Amzqwd+EeDDzkamMwBs=; b=M9+Z8WHcqI6q8sZY2HcK6H4bM7 yt0dadfamHcvXmcyPbIlig5b70WBD8+lZ9U6EIOpIMHgm28rnm9oapvhBJIzj+Sx9bMU56IymvWxL G2xphNTIW0lb5V2FUDdoT4WXhdoB1oDkoGoi/d0DNGRqRwYnFcd6A8U3XS9NAwUzfAsTSP968pAVd WHM3KdzqDlRlQID0Pxst9oa33NoXIFETWpxYP/GeTtb4WM6kOkgDuh+L8XC/nuLpAQdtdw4mLD4G5 frTNtKF2RaP+Lq0jongitYu1rj43ZrtAm3ORtRHl0G9caL0U2OI4a7Ss8Vkc7+Ylxs6NM0GOTJVqt 3yLmc2Ug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXzk-000406-SD; Mon, 19 Nov 2018 01:04:56 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXwD-0000pb-Cj for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Nov 2018 01:01:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oFXNKoGoeLTqqq6bm8yfU6+nYd+hzE5nT+qWms0h7us=; b=p4+2tGXENs4N6oSLGiuwBMzF/ hIprpJNBNhkmNI0d7CfuKXQ/OaIHLx+b10JwSDVda8yE39JHJlBqlMPbykRl8oTHudxRUBJj6hYEP gjifaqmFCpeMQmezBmFjbbmi/SwlJvdtEVe2EGeuQzA7iCSG0ua8AjCqUfIg5ObWdQKvjs7A5uqrM 3/r1x21H/KcfGnnsdNlw/SyNXea4Y4J6r1QaSVk8X72chInHgcJuZFAyjoHC/QmcQEJn74P3H2sOI wq9ffCWdyQNnhxqTJoP/liwLyJY1s5u6YYitM8YobwPVGq8wi/PtrpdAp2VrfUuSLbGB/EmVc2Zh4 lKnPpj2qw==; Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOXwA-0003QD-Rg for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 01:01:15 +0000 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 19 Nov 2018 10:01:03 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 8C25360062; Mon, 19 Nov 2018 10:01:03 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 19 Nov 2018 10:01:03 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id EBE1940387; Mon, 19 Nov 2018 10:01:02 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id CB13C120455; Mon, 19 Nov 2018 10:01:02 +0900 (JST) From: Sugaya Taichi To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 14/14] MAINTAINERS: Add entry to MAINTAINERS for Milbeaut Date: Mon, 19 Nov 2018 10:02:16 +0900 Message-Id: <1542589336-13925-5-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> References: <1542589336-13925-1-git-send-email-sugaya.taichi@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181118_200115_090695_88B31330 X-CRM114-Status: GOOD ( 17.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sugaya Taichi , Masami Hiramatsu , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , Daniel Lezcano , Russell King , Jassi Brar , Rob Herring , Jiri Slaby , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add entry to MAINTAINERS for Milbeaut that supported minimal drivers. Signed-off-by: Sugaya Taichi --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0abecc5..31dd29f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1782,6 +1782,15 @@ F: drivers/watchdog/sama5d4_wdt.c X: drivers/input/touchscreen/atmel_mxt_ts.c X: drivers/net/wireless/atmel/ +ARM/MILBEAUT ARCHITECTURE +M: Taichi Sugaya +M: Takao Orito +L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) +S: Maintained +F: arch/arm/boot/dts/milbeaut* +F: arch/arm/mach-milbeaut/ +N: milbeaut + ARM/MIOA701 MACHINE SUPPORT M: Robert Jarzmik L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)