From patchwork Thu Apr 11 12:19:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 10895841 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 B340417E6 for ; Thu, 11 Apr 2019 12:19:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95DBE28952 for ; Thu, 11 Apr 2019 12:19:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 848872899E; Thu, 11 Apr 2019 12:19:41 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2362528952 for ; Thu, 11 Apr 2019 12:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726264AbfDKMTl (ORCPT ); Thu, 11 Apr 2019 08:19:41 -0400 Received: from forward102o.mail.yandex.net ([37.140.190.182]:41927 "EHLO forward102o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKMTk (ORCPT ); Thu, 11 Apr 2019 08:19:40 -0400 Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 7467D6680DED; Thu, 11 Apr 2019 15:19:37 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id jNWUUu7otR-JaB8LQGo; Thu, 11 Apr 2019 15:19:37 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1554985177; bh=6Jv6KIqpfZutwKG/fs90WqWAeomDW4QQyg5IfA95Vb8=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=JONSPgkN37jZ0wtMf5AV7UxtKg2NOHX516+vVV1QlF0mSPshj4U++NQTdBAyENQnK FL7mmbUy/Yib88fT5fmVZ1GeoJC9a0UsF4chiOEPj1H4hExbbXnAREzwGqsFyjEgeI GA7Tg2Xvp4BIqEyZYnFCdD2OhHJG+J+YaJkMgQgQ= Authentication-Results: mxback4j.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QbB7ClwXzg-JTCmWWn1; Thu, 11 Apr 2019 15:19:34 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org, paul.burton@mips.com, robh+dt@kernel.org, Jiaxun Yang Subject: [PATCH v2 1/6] MIPS: Loongson32: Remove ehci platform device Date: Thu, 11 Apr 2019 20:19:10 +0800 Message-Id: <20190411121915.8040-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411121915.8040-1-jiaxun.yang@flygoat.com> References: <20190312091520.8863-2-jiaxun.yang@flygoat.com> <20190411121915.8040-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's going to be enabled by DeviceTree Signed-off-by: Jiaxun Yang --- .../include/asm/mach-loongson32/platform.h | 1 - arch/mips/loongson32/common/platform.c | 30 ------------------- arch/mips/loongson32/ls1b/board.c | 1 - 3 files changed, 32 deletions(-) diff --git a/arch/mips/include/asm/mach-loongson32/platform.h b/arch/mips/include/asm/mach-loongson32/platform.h index 15d1de2300fe..f36c8d287b59 100644 --- a/arch/mips/include/asm/mach-loongson32/platform.h +++ b/arch/mips/include/asm/mach-loongson32/platform.h @@ -19,7 +19,6 @@ extern struct platform_device ls1x_uart_pdev; extern struct platform_device ls1x_cpufreq_pdev; extern struct platform_device ls1x_eth0_pdev; extern struct platform_device ls1x_eth1_pdev; -extern struct platform_device ls1x_ehci_pdev; extern struct platform_device ls1x_gpio0_pdev; extern struct platform_device ls1x_gpio1_pdev; extern struct platform_device ls1x_rtc_pdev; diff --git a/arch/mips/loongson32/common/platform.c b/arch/mips/loongson32/common/platform.c index 0bf355c8bcb2..4b35f49e9fcb 100644 --- a/arch/mips/loongson32/common/platform.c +++ b/arch/mips/loongson32/common/platform.c @@ -10,12 +10,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include @@ -255,34 +253,6 @@ struct platform_device ls1x_gpio1_pdev = { .resource = ls1x_gpio1_resources, }; -/* USB EHCI */ -static u64 ls1x_ehci_dmamask = DMA_BIT_MASK(32); - -static struct resource ls1x_ehci_resources[] = { - [0] = { - .start = LS1X_EHCI_BASE, - .end = LS1X_EHCI_BASE + SZ_32K - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = LS1X_EHCI_IRQ, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct usb_ehci_pdata ls1x_ehci_pdata = { -}; - -struct platform_device ls1x_ehci_pdev = { - .name = "ehci-platform", - .id = -1, - .num_resources = ARRAY_SIZE(ls1x_ehci_resources), - .resource = ls1x_ehci_resources, - .dev = { - .dma_mask = &ls1x_ehci_dmamask, - .platform_data = &ls1x_ehci_pdata, - }, -}; /* Real Time Clock */ void __init ls1x_rtc_set_extclk(struct platform_device *pdev) diff --git a/arch/mips/loongson32/ls1b/board.c b/arch/mips/loongson32/ls1b/board.c index 447b15fc0a2b..74f7b530d9b1 100644 --- a/arch/mips/loongson32/ls1b/board.c +++ b/arch/mips/loongson32/ls1b/board.c @@ -42,7 +42,6 @@ static struct platform_device *ls1b_platform_devices[] __initdata = { &ls1x_cpufreq_pdev, &ls1x_eth0_pdev, &ls1x_eth1_pdev, - &ls1x_ehci_pdev, &ls1x_gpio0_pdev, &ls1x_gpio1_pdev, &ls1x_rtc_pdev, From patchwork Thu Apr 11 12:19:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 10895843 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 D5739186D for ; Thu, 11 Apr 2019 12:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA8A828952 for ; Thu, 11 Apr 2019 12:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADF1C289A9; Thu, 11 Apr 2019 12:19: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3EB028952 for ; Thu, 11 Apr 2019 12:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbfDKMTv (ORCPT ); Thu, 11 Apr 2019 08:19:51 -0400 Received: from forward102o.mail.yandex.net ([37.140.190.182]:42153 "EHLO forward102o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKMTv (ORCPT ); Thu, 11 Apr 2019 08:19:51 -0400 Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 77E7866805EE; Thu, 11 Apr 2019 15:19:46 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Yzud8aYl5R-JkEmVGnp; Thu, 11 Apr 2019 15:19:46 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1554985186; bh=ZCgxGgbI3NnxP3eiQoMlAP/gbLLFRw0bOAEapVEEYQw=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=NyswwkSGVdV2E4mXVVn+Mk1RbFu3ENa5geHWGGjXJ8gu6Mo2Rlk79VYxwvfZ0ncsB X9mQPFy2lSo4fALreNNp9ClsMyl8P8Myq8wtQMpSiaBFAtTHwP8TTn1jkYjBXIuZr+ XS22L+IWyYpEpAq73k22mFF8yxDHYDxo9K7nQJhU= Authentication-Results: mxback2j.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QbB7ClwXzg-JcCm2oNu; Thu, 11 Apr 2019 15:19:42 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org, paul.burton@mips.com, robh+dt@kernel.org, Jiaxun Yang Subject: [PATCH v2 2/6] MIPS: Loongson32: Add DeviceTree support Date: Thu, 11 Apr 2019 20:19:11 +0800 Message-Id: <20190411121915.8040-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411121915.8040-1-jiaxun.yang@flygoat.com> References: <20190312091520.8863-2-jiaxun.yang@flygoat.com> <20190411121915.8040-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initial DeviceTree support for loongson32 Also remove the old IRQ driver since it have been replaced by generic LS1X_IRQ. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 5 +- arch/mips/loongson32/common/Makefile | 2 +- arch/mips/loongson32/common/irq.c | 196 --------------------------- arch/mips/loongson32/common/setup.c | 18 +++ 4 files changed, 23 insertions(+), 198 deletions(-) delete mode 100644 arch/mips/loongson32/common/irq.c diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index ddfb587c4744..15f8cc3c965f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -437,6 +437,9 @@ config LASAT config MACH_LOONGSON32 bool "Loongson-1 family of machines" + select USE_OF + select BUILTIN_DTB + select LS1X_IRQ select SYS_SUPPORTS_ZBOOT help This enables support for the Loongson-1 family of machines. @@ -3024,7 +3027,7 @@ endchoice choice prompt "Kernel command line type" if !CMDLINE_OVERRIDE default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \ - !MIPS_MALTA && \ + !MACH_LOONGSON32 && !MIPS_MALTA && \ !CAVIUM_OCTEON_SOC default MIPS_CMDLINE_FROM_BOOTLOADER diff --git a/arch/mips/loongson32/common/Makefile b/arch/mips/loongson32/common/Makefile index 723b4ce3b8f0..5b29badb0950 100644 --- a/arch/mips/loongson32/common/Makefile +++ b/arch/mips/loongson32/common/Makefile @@ -2,4 +2,4 @@ # Makefile for common code of loongson1 based machines. # -obj-y += time.o irq.o platform.o prom.o reset.o setup.o +obj-y += time.o platform.o prom.o reset.o setup.o diff --git a/arch/mips/loongson32/common/irq.c b/arch/mips/loongson32/common/irq.c deleted file mode 100644 index 635a4abe1f48..000000000000 --- a/arch/mips/loongson32/common/irq.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2011 Zhang, Keguang - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#include -#include -#include - -#include -#include - -#define LS1X_INTC_REG(n, x) \ - ((void __iomem *)KSEG1ADDR(LS1X_INTC_BASE + (n * 0x18) + (x))) - -#define LS1X_INTC_INTISR(n) LS1X_INTC_REG(n, 0x0) -#define LS1X_INTC_INTIEN(n) LS1X_INTC_REG(n, 0x4) -#define LS1X_INTC_INTSET(n) LS1X_INTC_REG(n, 0x8) -#define LS1X_INTC_INTCLR(n) LS1X_INTC_REG(n, 0xc) -#define LS1X_INTC_INTPOL(n) LS1X_INTC_REG(n, 0x10) -#define LS1X_INTC_INTEDGE(n) LS1X_INTC_REG(n, 0x14) - -static void ls1x_irq_ack(struct irq_data *d) -{ - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; - - __raw_writel(__raw_readl(LS1X_INTC_INTCLR(n)) - | (1 << bit), LS1X_INTC_INTCLR(n)); -} - -static void ls1x_irq_mask(struct irq_data *d) -{ - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; - - __raw_writel(__raw_readl(LS1X_INTC_INTIEN(n)) - & ~(1 << bit), LS1X_INTC_INTIEN(n)); -} - -static void ls1x_irq_mask_ack(struct irq_data *d) -{ - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; - - __raw_writel(__raw_readl(LS1X_INTC_INTIEN(n)) - & ~(1 << bit), LS1X_INTC_INTIEN(n)); - __raw_writel(__raw_readl(LS1X_INTC_INTCLR(n)) - | (1 << bit), LS1X_INTC_INTCLR(n)); -} - -static void ls1x_irq_unmask(struct irq_data *d) -{ - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; - - __raw_writel(__raw_readl(LS1X_INTC_INTIEN(n)) - | (1 << bit), LS1X_INTC_INTIEN(n)); -} - -static int ls1x_irq_settype(struct irq_data *d, unsigned int type) -{ - unsigned int bit = (d->irq - LS1X_IRQ_BASE) & 0x1f; - unsigned int n = (d->irq - LS1X_IRQ_BASE) >> 5; - - switch (type) { - case IRQ_TYPE_LEVEL_HIGH: - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) - | (1 << bit), LS1X_INTC_INTPOL(n)); - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) - & ~(1 << bit), LS1X_INTC_INTEDGE(n)); - break; - case IRQ_TYPE_LEVEL_LOW: - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) - & ~(1 << bit), LS1X_INTC_INTPOL(n)); - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) - & ~(1 << bit), LS1X_INTC_INTEDGE(n)); - break; - case IRQ_TYPE_EDGE_RISING: - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) - | (1 << bit), LS1X_INTC_INTPOL(n)); - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) - | (1 << bit), LS1X_INTC_INTEDGE(n)); - break; - case IRQ_TYPE_EDGE_FALLING: - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) - & ~(1 << bit), LS1X_INTC_INTPOL(n)); - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) - | (1 << bit), LS1X_INTC_INTEDGE(n)); - break; - case IRQ_TYPE_EDGE_BOTH: - __raw_writel(__raw_readl(LS1X_INTC_INTPOL(n)) - & ~(1 << bit), LS1X_INTC_INTPOL(n)); - __raw_writel(__raw_readl(LS1X_INTC_INTEDGE(n)) - | (1 << bit), LS1X_INTC_INTEDGE(n)); - break; - case IRQ_TYPE_NONE: - break; - default: - return -EINVAL; - } - - return 0; -} - -static struct irq_chip ls1x_irq_chip = { - .name = "LS1X-INTC", - .irq_ack = ls1x_irq_ack, - .irq_mask = ls1x_irq_mask, - .irq_mask_ack = ls1x_irq_mask_ack, - .irq_unmask = ls1x_irq_unmask, - .irq_set_type = ls1x_irq_settype, -}; - -static void ls1x_irq_dispatch(int n) -{ - u32 int_status, irq; - - /* Get pending sources, masked by current enables */ - int_status = __raw_readl(LS1X_INTC_INTISR(n)) & - __raw_readl(LS1X_INTC_INTIEN(n)); - - if (int_status) { - irq = LS1X_IRQ(n, __ffs(int_status)); - do_IRQ(irq); - } -} - -asmlinkage void plat_irq_dispatch(void) -{ - unsigned int pending; - - pending = read_c0_cause() & read_c0_status() & ST0_IM; - - if (pending & CAUSEF_IP7) - do_IRQ(TIMER_IRQ); - else if (pending & CAUSEF_IP2) - ls1x_irq_dispatch(0); /* INT0 */ - else if (pending & CAUSEF_IP3) - ls1x_irq_dispatch(1); /* INT1 */ - else if (pending & CAUSEF_IP4) - ls1x_irq_dispatch(2); /* INT2 */ - else if (pending & CAUSEF_IP5) - ls1x_irq_dispatch(3); /* INT3 */ - else if (pending & CAUSEF_IP6) - ls1x_irq_dispatch(4); /* INT4 */ - else - spurious_interrupt(); - -} - -static struct irqaction cascade_irqaction = { - .handler = no_action, - .name = "cascade", - .flags = IRQF_NO_THREAD, -}; - -static void __init ls1x_irq_init(int base) -{ - int n; - - /* Disable interrupts and clear pending, - * setup all IRQs as high level triggered - */ - for (n = 0; n < INTN; n++) { - __raw_writel(0x0, LS1X_INTC_INTIEN(n)); - __raw_writel(0xffffffff, LS1X_INTC_INTCLR(n)); - __raw_writel(0xffffffff, LS1X_INTC_INTPOL(n)); - /* set DMA0, DMA1 and DMA2 to edge trigger */ - __raw_writel(n ? 0x0 : 0xe000, LS1X_INTC_INTEDGE(n)); - } - - - for (n = base; n < NR_IRQS; n++) { - irq_set_chip_and_handler(n, &ls1x_irq_chip, - handle_level_irq); - } - - setup_irq(INT0_IRQ, &cascade_irqaction); - setup_irq(INT1_IRQ, &cascade_irqaction); - setup_irq(INT2_IRQ, &cascade_irqaction); - setup_irq(INT3_IRQ, &cascade_irqaction); -#if defined(CONFIG_LOONGSON1_LS1C) - setup_irq(INT4_IRQ, &cascade_irqaction); -#endif -} - -void __init arch_init_irq(void) -{ - mips_cpu_irq_init(); - ls1x_irq_init(LS1X_IRQ_BASE); -} diff --git a/arch/mips/loongson32/common/setup.c b/arch/mips/loongson32/common/setup.c index 1640744288ee..5ede65a79d6f 100644 --- a/arch/mips/loongson32/common/setup.c +++ b/arch/mips/loongson32/common/setup.c @@ -8,12 +8,30 @@ */ #include +#include +#include +#include +#include +#include +#include +#include #include void __init plat_mem_setup(void) { add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); + __dt_setup_arch(__dtb_start); +} + +void __init device_tree_init(void) +{ + unflatten_and_copy_device_tree(); +} + +void __init arch_init_irq(void) +{ + irqchip_init(); } const char *get_system_type(void) From patchwork Thu Apr 11 12:19:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 10895845 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 60EDC17E6 for ; Thu, 11 Apr 2019 12:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46D602875C for ; Thu, 11 Apr 2019 12:20:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B2E828C95; Thu, 11 Apr 2019 12:20:22 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C68762875C for ; Thu, 11 Apr 2019 12:20:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726137AbfDKMUV (ORCPT ); Thu, 11 Apr 2019 08:20:21 -0400 Received: from forward100o.mail.yandex.net ([37.140.190.180]:36429 "EHLO forward100o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKMUV (ORCPT ); Thu, 11 Apr 2019 08:20:21 -0400 Received: from mxback14o.mail.yandex.net (mxback14o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::65]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 14AD24AC1457; Thu, 11 Apr 2019 15:20:17 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback14o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VYVbauxjfv-JrsCn9Rw; Thu, 11 Apr 2019 15:19:53 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1554985194; bh=fxCHmvLBhwkZ3rIsYVTN1zM6tZ4SPM6NEtNIOEXuyos=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=iSer/s1R4bQgKnM0F1v54pZPH1rjbqIjl/40V+CKJoJ8eFSjXbN3XxKLABSY+ALAO i3yeAnOnqt7vmB6n0YfIkFWf2W3mH1vELrINKOF72KfWT3x6rpncpdSnqJoOd1lEou T5r9w/sFGfsG+K7envSWp9HUy220iceWWSzZ6Gew= Authentication-Results: mxback14o.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QbB7ClwXzg-JlCmbnE0; Thu, 11 Apr 2019 15:19:51 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org, paul.burton@mips.com, robh+dt@kernel.org, Jiaxun Yang Subject: [PATCH v2 3/6] MIPS: Loongson32: Kconfig merge CPU_LOONGSON1B&C Date: Thu, 11 Apr 2019 20:19:12 +0800 Message-Id: <20190411121915.8040-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411121915.8040-1-jiaxun.yang@flygoat.com> References: <20190312091520.8863-2-jiaxun.yang@flygoat.com> <20190411121915.8040-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Loongson-1B&C have totally identical GS232 core, so merge them into same CPU config. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 38 +++++++++----------------------- arch/mips/include/asm/cpu-type.h | 3 +-- arch/mips/loongson32/Kconfig | 4 ++-- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 15f8cc3c965f..ac0b93e57ca3 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1429,26 +1429,22 @@ config CPU_LOONGSON2F have a similar programming interface with FPGA northbridge used in Loongson2E. -config CPU_LOONGSON1B - bool "Loongson 1B" - depends on SYS_HAS_CPU_LOONGSON1B - select CPU_LOONGSON1 +config CPU_LOONGSON1 + bool "Loongson 1" + depends on SYS_HAS_CPU_LOONGSON1 + select CPU_MIPS32 + select CPU_MIPSR2 + select CPU_HAS_PREFETCH + select CPU_HAS_LOAD_STORE_LR + select CPU_SUPPORTS_32BIT_KERNEL + select CPU_SUPPORTS_HIGHMEM + select CPU_SUPPORTS_CPUFREQ select LEDS_GPIO_REGISTER help The Loongson 1B is a 32-bit SoC, which implements the MIPS32 Release 1 instruction set and part of the MIPS32 Release 2 instruction set. -config CPU_LOONGSON1C - bool "Loongson 1C" - depends on SYS_HAS_CPU_LOONGSON1C - select CPU_LOONGSON1 - select LEDS_GPIO_REGISTER - help - The Loongson 1C is a 32-bit SoC, which implements the MIPS32 - Release 1 instruction set and part of the MIPS32 Release 2 - instruction set. - config CPU_MIPS32_R1 bool "MIPS32 Release 1" depends on SYS_HAS_CPU_MIPS32_R1 @@ -1866,15 +1862,6 @@ config CPU_LOONGSON2 select ARCH_HAS_PHYS_TO_DMA select CPU_HAS_LOAD_STORE_LR -config CPU_LOONGSON1 - bool - select CPU_MIPS32 - select CPU_MIPSR2 - select CPU_HAS_PREFETCH - select CPU_HAS_LOAD_STORE_LR - select CPU_SUPPORTS_32BIT_KERNEL - select CPU_SUPPORTS_HIGHMEM - select CPU_SUPPORTS_CPUFREQ config CPU_BMIPS32_3300 select SMP_UP if SMP @@ -1914,10 +1901,7 @@ config SYS_HAS_CPU_LOONGSON2F select CPU_SUPPORTS_ADDRWINCFG if 64BIT select CPU_SUPPORTS_UNCACHED_ACCELERATED -config SYS_HAS_CPU_LOONGSON1B - bool - -config SYS_HAS_CPU_LOONGSON1C +config SYS_HAS_CPU_LOONGSON1 bool config SYS_HAS_CPU_MIPS32_R1 diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h index a45af3de075d..ee17f02419a3 100644 --- a/arch/mips/include/asm/cpu-type.h +++ b/arch/mips/include/asm/cpu-type.h @@ -24,8 +24,7 @@ static inline int __pure __get_cpu_type(const int cpu_type) case CPU_LOONGSON3: #endif -#if defined(CONFIG_SYS_HAS_CPU_LOONGSON1B) || \ - defined(CONFIG_SYS_HAS_CPU_LOONGSON1C) +#if defined(CONFIG_SYS_HAS_CPU_LOONGSON1) case CPU_LOONGSON1: #endif diff --git a/arch/mips/loongson32/Kconfig b/arch/mips/loongson32/Kconfig index 6dacc1438906..a0a00c3e2187 100644 --- a/arch/mips/loongson32/Kconfig +++ b/arch/mips/loongson32/Kconfig @@ -8,7 +8,7 @@ config LOONGSON1_LS1B bool "Loongson LS1B board" select CEVT_R4K if !MIPS_EXTERNAL_TIMER select CSRC_R4K if !MIPS_EXTERNAL_TIMER - select SYS_HAS_CPU_LOONGSON1B + select SYS_HAS_CPU_LOONGSON1 select DMA_NONCOHERENT select BOOT_ELF32 select IRQ_MIPS_CPU @@ -23,7 +23,7 @@ config LOONGSON1_LS1C bool "Loongson LS1C board" select CEVT_R4K if !MIPS_EXTERNAL_TIMER select CSRC_R4K if !MIPS_EXTERNAL_TIMER - select SYS_HAS_CPU_LOONGSON1C + select SYS_HAS_CPU_LOONGSON1 select DMA_NONCOHERENT select BOOT_ELF32 select IRQ_MIPS_CPU From patchwork Thu Apr 11 12:19:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 10895847 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 5904017E6 for ; Thu, 11 Apr 2019 12:20:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ADE02875C for ; Thu, 11 Apr 2019 12:20:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F3A828C95; Thu, 11 Apr 2019 12:20: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C55242875C for ; Thu, 11 Apr 2019 12:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726145AbfDKMU0 (ORCPT ); Thu, 11 Apr 2019 08:20:26 -0400 Received: from forward101o.mail.yandex.net ([37.140.190.181]:46554 "EHLO forward101o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKMU0 (ORCPT ); Thu, 11 Apr 2019 08:20:26 -0400 Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward101o.mail.yandex.net (Yandex) with ESMTP id B0EE63C017DC; Thu, 11 Apr 2019 15:20:23 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dNcVzy2puC-KNcKt8i4; Thu, 11 Apr 2019 15:20:23 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1554985223; bh=IzbwqLW/q4VeMivUvZ5KCD8lQ3TSqiuKZvKLu+u83+M=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=VFodtS5nTor5DcyantpJ0ITcVr1fOPD/f9gTxh0+h4Zb+L8Q+gdV+8TJVKel4ibcg RNQ7kzT1+s6UHjc/AFqhpZYtqEOOKC35VrI72jkc4Nl6DMIqgLaMCtjpfu8pDQc1ID tsAyJl7ZQAIPOGw4XYw4blmc6mOHWte1Y++IemdI= Authentication-Results: mxback7j.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QbB7ClwXzg-KHCmX6L3; Thu, 11 Apr 2019 15:20:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org, paul.burton@mips.com, robh+dt@kernel.org, Jiaxun Yang Subject: [PATCH v2 4/6] dt-bindings: Add vendor prefix for loongson Date: Thu, 11 Apr 2019 20:19:13 +0800 Message-Id: <20190411121915.8040-5-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411121915.8040-1-jiaxun.yang@flygoat.com> References: <20190312091520.8863-2-jiaxun.yang@flygoat.com> <20190411121915.8040-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add vendor prefix for loongson, known as Loongson Technology Corporation Limited, a CPUs & IP Cores vendor. Signed-off-by: Jiaxun Yang Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 389508584f48..6464192f47ae 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -221,6 +221,7 @@ linux Linux-specific binding linx Linx Technologies lltc Linear Technology Corporation logicpd Logic PD, Inc. +loongson Loongson Technology Corporation Limited lsi LSI Corp. (LSI Logic) lwn Liebherr-Werk Nenzing GmbH macnica Macnica Americas From patchwork Thu Apr 11 12:19:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 10895849 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 274151515 for ; Thu, 11 Apr 2019 12:20:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AC1C2875C for ; Thu, 11 Apr 2019 12:20:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F038928C95; Thu, 11 Apr 2019 12:20:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DB752875C for ; Thu, 11 Apr 2019 12:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbfDKMUd (ORCPT ); Thu, 11 Apr 2019 08:20:33 -0400 Received: from forward105o.mail.yandex.net ([37.140.190.183]:37165 "EHLO forward105o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKMUd (ORCPT ); Thu, 11 Apr 2019 08:20:33 -0400 Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward105o.mail.yandex.net (Yandex) with ESMTP id C74CD4200C6A; Thu, 11 Apr 2019 15:20:30 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vhskqf5ZQ6-KU4uOQW6; Thu, 11 Apr 2019 15:20:30 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1554985230; bh=CjsRND6fVCwNjty2QFm2hXF7hynBJdtzagz/50SMmRA=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=amGneY6xFlec2x9dGeothaBFijgYNFDHFpbuwXjRKA9gLXER1KmS0CftIgZ2xx2EG SUmiVWP8xugxEhCn5itKMK7AnJ+h74LWFe8i6Z2P3mAhmJdEhDutfh37qJQGOdUbU8 VHySRfm4MEbvm6TOrYXhmbim68I/WJeA8YSv38sg= Authentication-Results: mxback7g.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QbB7ClwXzg-KOCmQ3vo; Thu, 11 Apr 2019 15:20:28 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org, paul.burton@mips.com, robh+dt@kernel.org, Jiaxun Yang Subject: [PATCH v2 5/6] dt/bindings: Add bindings for ls1x CPU Date: Thu, 11 Apr 2019 20:19:14 +0800 Message-Id: <20190411121915.8040-6-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411121915.8040-1-jiaxun.yang@flygoat.com> References: <20190312091520.8863-2-jiaxun.yang@flygoat.com> <20190411121915.8040-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This documented ls1x CPU node. Signed-off-by: Jiaxun Yang Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/mips/loongson/ls1x-cpu.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Documentation/devicetree/bindings/mips/loongson/ls1x-cpu.txt diff --git a/Documentation/devicetree/bindings/mips/loongson/ls1x-cpu.txt b/Documentation/devicetree/bindings/mips/loongson/ls1x-cpu.txt new file mode 100644 index 000000000000..33664bd15487 --- /dev/null +++ b/Documentation/devicetree/bindings/mips/loongson/ls1x-cpu.txt @@ -0,0 +1,4 @@ +* Loongson-1 MCU CPUs + +Required properties: +- compatible: "loongson,ls1b", "loongson,ls1c" From patchwork Thu Apr 11 12:19:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 10895851 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 951F9922 for ; Thu, 11 Apr 2019 12:20:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79F082875C for ; Thu, 11 Apr 2019 12:20:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DF4828C95; Thu, 11 Apr 2019 12:20:45 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48DB62875C for ; Thu, 11 Apr 2019 12:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726137AbfDKMUo (ORCPT ); Thu, 11 Apr 2019 08:20:44 -0400 Received: from forward102p.mail.yandex.net ([77.88.28.102]:56397 "EHLO forward102p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKMUo (ORCPT ); Thu, 11 Apr 2019 08:20:44 -0400 Received: from mxback18o.mail.yandex.net (mxback18o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::69]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 8E00B1D40DEE; Thu, 11 Apr 2019 15:20:39 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback18o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id cIn8lcdc7U-KdXG4wLQ; Thu, 11 Apr 2019 15:20:39 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1554985239; bh=kKBpvcVvrtiH9aoD3v7PDFu3OKMew8i8TQqetv57afs=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=MVoBvzfSZMHBZZuffP/oshLTaXCLqJPNPOx3i+Lb+SvAVWj6rKuAyPYtLurX08gsX B8L/Yjjlp2sZBDhVjioVb6bkl4Pjgzvb96rCoOzg8uVPwQdZz+jl+1AGVjCyRCebCT fmFUh9rAbohWSZgEIpA5CjOcXSRLe6ZKHeemeJuU= Authentication-Results: mxback18o.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QbB7ClwXzg-KWCm1uVT; Thu, 11 Apr 2019 15:20:37 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org, paul.burton@mips.com, robh+dt@kernel.org, Jiaxun Yang Subject: [PATCH v2 6/6] MIPS: Loongson32: dts: add ls1b & ls1c Date: Thu, 11 Apr 2019 20:19:15 +0800 Message-Id: <20190411121915.8040-7-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411121915.8040-1-jiaxun.yang@flygoat.com> References: <20190312091520.8863-2-jiaxun.yang@flygoat.com> <20190411121915.8040-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add devicetree skeleton for ls1b and ls1c. Signed-off-by: Jiaxun Yang --- arch/mips/boot/dts/loongson/Makefile | 6 ++ arch/mips/boot/dts/loongson/ls1b.dts | 30 ++++++++ arch/mips/boot/dts/loongson/ls1c.dts | 34 +++++++++ arch/mips/boot/dts/loongson/ls1x.dtsi | 103 ++++++++++++++++++++++++++ 4 files changed, 173 insertions(+) create mode 100644 arch/mips/boot/dts/loongson/Makefile create mode 100644 arch/mips/boot/dts/loongson/ls1b.dts create mode 100644 arch/mips/boot/dts/loongson/ls1c.dts create mode 100644 arch/mips/boot/dts/loongson/ls1x.dtsi diff --git a/arch/mips/boot/dts/loongson/Makefile b/arch/mips/boot/dts/loongson/Makefile new file mode 100644 index 000000000000..447801568f33 --- /dev/null +++ b/arch/mips/boot/dts/loongson/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_LOONGSON1_LS1B) += ls1b.dtb + +dtb-$(CONFIG_LOONGSON1_LS1B) += ls1c.dtb + +obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/loongson/ls1b.dts b/arch/mips/boot/dts/loongson/ls1b.dts new file mode 100644 index 000000000000..11b516c77d22 --- /dev/null +++ b/arch/mips/boot/dts/loongson/ls1b.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019 Jiaxun Yang + */ + +/dts-v1/; +#include + +/ { + model = "Loongson LS1B"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "loongson,ls1b"; + reg = <0>; + }; + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; \ No newline at end of file diff --git a/arch/mips/boot/dts/loongson/ls1c.dts b/arch/mips/boot/dts/loongson/ls1c.dts new file mode 100644 index 000000000000..edca46234cfc --- /dev/null +++ b/arch/mips/boot/dts/loongson/ls1c.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019 Jiaxun Yang + */ + +/dts-v1/; +#include + +/ { + model = "Loongson LS1C"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "loongson,ls1c"; + reg = <0>; + }; + }; +}; + +&platintc4 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; \ No newline at end of file diff --git a/arch/mips/boot/dts/loongson/ls1x.dtsi b/arch/mips/boot/dts/loongson/ls1x.dtsi new file mode 100644 index 000000000000..1aca0c990fea --- /dev/null +++ b/arch/mips/boot/dts/loongson/ls1x.dtsi @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019 Jiaxun Yang + */ + +/dts-v1/; +#include + + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpu_intc: interrupt-controller { + #address-cells = <0>; + compatible = "mti,cpu-interrupt-controller"; + + interrupt-controller; + #interrupt-cells = <1>; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + compatible = "simple-bus"; + ranges; + + + platintc0: interrupt-controller@1fd01040 { + compatible = "loongson,ls1x-intc"; + reg = <0x1fd01040 0x18>; + + interrupt-controller; + #interrupt-cells = <2>; + + interrupt-parent = <&cpu_intc>; + interrupts = <2>; + }; + + platintc1: interrupt-controller@1fd01058 { + compatible = "loongson,ls1x-intc"; + reg = <0x1fd01058 0x18>; + + interrupt-controller; + #interrupt-cells = <2>; + + interrupt-parent = <&cpu_intc>; + interrupts = <3>; + }; + + platintc2: interrupt-controller@1fd01070 { + compatible = "loongson,ls1x-intc"; + reg = <0x1fd01070 0x18>; + + interrupt-controller; + #interrupt-cells = <2>; + + interrupt-parent = <&cpu_intc>; + interrupts = <4>; + }; + + platintc3: interrupt-controller@1fd01088 { + compatible = "loongson,ls1x-intc"; + reg = <0x1fd01088 0x18>; + + interrupt-controller; + #interrupt-cells = <2>; + + interrupt-parent = <&cpu_intc>; + interrupts = <5>; + }; + + platintc4: interrupt-controller@1fd010a0 { + compatible = "loongson,ls1x-intc"; + reg = <0x1fd010a0 0x18>; + + interrupt-controller; + #interrupt-cells = <2>; + + interrupt-parent = <&cpu_intc>; + interrupts = <6>; + status = "disabled"; + }; + + ehci0: usb@1fe20000 { + compatible = "generic-ehci"; + reg = <0x1fe20000 0x100>; + interrupt-parent = <&platintc1>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + ohci0: usb@1fe28000 { + compatible = "generic-ohci"; + reg = <0x1fe28000 0x100>; + interrupt-parent = <&platintc1>; + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + }; +};