From patchwork Mon May 10 21:40:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12250325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DC14C433ED for ; Tue, 11 May 2021 09:35:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A0CA61001 for ; Tue, 11 May 2021 09:35:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A0CA61001 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc: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=xDWD17BbuY6MdGgtt5oz7rk7MIbcknvFhyf1osCLR5Q=; b=bOlTNwSXSvVoneBEhNZRduHCBd exM5wNZBnBdtq1Y9Ldv/gtP1Pk7OtjAFptAPV91VlPWYy91d+j+QRvXYK5rDW7Xl6goHYlIyokSOj MO/4QDTJshve6XDgSvEdnyQObCwxSeF2RtaF45mer5E2Y6n5hPLt437mHDkqkjOIFfgsBDmynjUm7 pv4ag5nnhTnNd6jhChUlCrr8pr80cZcyVLeDQjCPc9MFPTpADBCtMSD8NLfYqsn/SWJyLRkTHYZTD m7+F+Os1u6mvwKdIosPNO6JKFOeV8cEFwWlLT1vo4sbzbk4YomFep1Mv4KvcYeiU6oISXDpeBCFnU 8pjfi1WQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgOmn-00Gi7k-Fn; Tue, 11 May 2021 09:34:42 +0000 Received: from [2607:7c80:54:e::133] (helo=bombadil.infradead.org) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgDdl-00Flrs-9k for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 21:40:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=XznhLAqjGhAeOXRKMwVR6Rf7MCA7wt/7fX8LXZE5ClI=; b=bTy5fWzhPgpgHG/oC2rdKTlFSs OD0u+P2YE29WmMfYeqwREj0lHhjSNpX9VLJfWmNkoq9o5W685DshYQgSnFRSV02ex6SewmWvYC97p WmR1n0cFBKc1C6lGwBd4nyShEHdtjs0JF/3QuWNCRZbQ6KoNjlY6S3BUQ9lwYsL4uzzjz8PNfxujD FBSv0NN9JX2t9rz8KxWd6bVHQ8puNqDrLAvZpcBPIGVU2ThIpB+rgAivogGjWjJFBKyJ7fAigJm5D XKGqnJ+W7jqj/Q+1E3SfVW1Vt+uRKVk3tfxHRjNEYXPY8oCa4h4jSJVWnfFD8AViC3mXw3SNj5ZqV Cu2sDAlA==; Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgDdi-0098Zl-6r for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 21:40:36 +0000 Received: by mail-lf1-x136.google.com with SMTP id j10so25523248lfb.12 for ; Mon, 10 May 2021 14:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XznhLAqjGhAeOXRKMwVR6Rf7MCA7wt/7fX8LXZE5ClI=; b=Pe26FGhk+2IF9moQqznF19Yx8Cf9b43Kp04o1zKxjcIjvUVycmWUz+lQ2oeGGwqjS9 iys7uEfdTgVMbHKZbd20/s3eXgwZPPF+oAd+Ju6ibnUxV9AjMt40WYTuFeqaLGuNTJX4 M/xaDSBRtt0N4UA3gEcbvvYwN964YHw0ar9fMYVYV0Vk60BdOZv6NiqVkipz3V/Ged4s K5rIEMMjC6YpB+JNbbY/fTN502zQQMuSb2YO4jjWRzDRZjZO3yvdOfrHD5oZbuR/6SNT jEAB0PwQo3BokKpWbEfq5WhnVv1mzDEJLP2uHv+O4g6XlzhEvEK8B6Iq/rvvieCBYtVW t7HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XznhLAqjGhAeOXRKMwVR6Rf7MCA7wt/7fX8LXZE5ClI=; b=FGmgwkcyBu9LWqjOwoUyhu5mVf2NRgnnKM23dqN099RoqZokn4DfGmivmIGprlNWuB 9cBhRs/XdiinWpKjUjiQNq4Inhjp/qfkJpI8KVmQHGnu5UCecQCgjTdFR7y9HhuAGj6R Z/6CoEpWpAsKbzPKbQhN+gM/OCHzxmFv5Enlc3jED5S41ZFIghPDeFWRh642we8Vx/Vd VgwaK1Mf6ZuOzluxpaFji/10ZduGRaOhz38P0pgM1B/WyQwcIrmBsN4IexXkzDJfoQ8b mddqRWsnZGRkvnY2Pvq4V7c5FLGIpXziKb23Vj4ocMp+dnfHATyqQGOrGdn0GjhOR2k4 8JTw== X-Gm-Message-State: AOAM533wemapljubmWtJICNGJ3MDHD4JQ0+Ni2zAs9V5aFTdQ/Lzue3j 2CrOB2CytX6lrNxo0assk1bwWCyLZlbcyA== X-Google-Smtp-Source: ABdhPJwvcbGS6B2Symz58FB/2SlCOrr36yI1eStUY/QBo/3RyknJIWk3O5e8X9266kxraE596+serg== X-Received: by 2002:a05:6512:3aa:: with SMTP id v10mr17988787lfp.263.1620682832379; Mon, 10 May 2021 14:40:32 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id t12sm2391855lfl.254.2021.05.10.14.40.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 14:40:32 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Imre Kaloz , Krzysztof Halasa Cc: Linus Walleij , Zoltan HERPAI , Raylynn Knight Subject: [PATCH] ARM: dts: ixp4xx: Add PCI hosts Date: Mon, 10 May 2021 23:40:18 +0200 Message-Id: <20210510214018.601580-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_144034_335163_852B83CC X-CRM114-Status: GOOD ( 19.15 ) /bin/ln: failed to access 'reaver_cache/texts/20210510_144034_335163_852B83CC': No such file or directory X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_144034_335163_852B83CC X-CRM114-Status: GOOD ( 15.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds a basic PCI host definition to the base device tree for IXP4xx and then further details it in the 42x and 43x device tree include, also the specific target devices NSLU2 and GW2358 get proper PCI swizzling defined. Cc: Zoltan HERPAI Cc: Raylynn Knight Signed-off-by: Linus Walleij --- .../boot/dts/intel-ixp42x-linksys-nslu2.dts | 27 +++++++++++ arch/arm/boot/dts/intel-ixp42x.dtsi | 4 ++ .../dts/intel-ixp43x-gateworks-gw2358.dts | 46 +++++++++++++++++++ arch/arm/boot/dts/intel-ixp43x.dtsi | 4 ++ arch/arm/boot/dts/intel-ixp4xx.dtsi | 36 +++++++++++++++ 5 files changed, 117 insertions(+) diff --git a/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts b/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts index 8fcd95805ff4..b1bcf288a562 100644 --- a/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts +++ b/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts @@ -106,4 +106,31 @@ partitions { fis-index-block = <0x3f>; }; }; + + soc { + pci@c0000000 { + status = "ok"; + + /* + * Taken from NSLU2 PCI boardfile, INT A, B, C swizzled D constant + * We have slots (IDSEL) 1, 2 and 3. + */ + interrupt-map = + /* IDSEL 1 */ + <0x0800 0 0 1 &gpio0 11 3>, /* INT A on slot 1 is irq 11 */ + <0x0800 0 0 2 &gpio0 10 3>, /* INT B on slot 1 is irq 10 */ + <0x0800 0 0 3 &gpio0 9 3>, /* INT C on slot 1 is irq 9 */ + <0x0800 0 0 4 &gpio0 8 3>, /* INT D on slot 1 is irq 8 */ + /* IDSEL 2 */ + <0x1000 0 0 1 &gpio0 10 3>, /* INT A on slot 2 is irq 10 */ + <0x1000 0 0 2 &gpio0 9 3>, /* INT B on slot 2 is irq 9 */ + <0x1000 0 0 3 &gpio0 11 3>, /* INT C on slot 2 is irq 11 */ + <0x1000 0 0 4 &gpio0 8 3>, /* INT D on slot 2 is irq 8 */ + /* IDSEL 3 */ + <0x1800 0 0 1 &gpio0 9 3>, /* INT A on slot 3 is irq 9 */ + <0x1800 0 0 2 &gpio0 11 3>, /* INT B on slot 3 is irq 11 */ + <0x1800 0 0 3 &gpio0 10 3>, /* INT C on slot 3 is irq 10 */ + <0x1800 0 0 4 &gpio0 8 3>; /* INT D on slot 3 is irq 8 */ + }; + }; }; diff --git a/arch/arm/boot/dts/intel-ixp42x.dtsi b/arch/arm/boot/dts/intel-ixp42x.dtsi index a9622ca850cc..5fa063ed396c 100644 --- a/arch/arm/boot/dts/intel-ixp42x.dtsi +++ b/arch/arm/boot/dts/intel-ixp42x.dtsi @@ -7,6 +7,10 @@ / { soc { + pci@c0000000 { + compatible = "intel,ixp42x-pci"; + }; + interrupt-controller@c8003000 { compatible = "intel,ixp42x-interrupt"; }; diff --git a/arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts b/arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts index 5e1544ea5f82..87fecc5248e5 100644 --- a/arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts +++ b/arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts @@ -91,4 +91,50 @@ partitions { fis-index-block = <0xff>; }; }; + + soc { + pci@c0000000 { + status = "ok"; + + /* + * In the boardfile for the Cambria from OpenWRT the interrupts + * are assigned one per IDSEL, so all 4 interrupts from IDSEL + * 1 are connected to IRQ 11, all 4 interrupts from IDSEL 2 + * connected to IRQ 10 etc. I find this highly unlikely so I + * have instead assumed that they are rotated (swizzled) like + * this with 11, 10, 9, 8 for the 4 pins on IDSEL 1 etc. + */ + interrupt-map = + /* IDSEL 1 */ + <0x0800 0 0 1 &gpio0 11 3>, /* INT A on slot 1 is irq 11 */ + <0x0800 0 0 2 &gpio0 10 3>, /* INT B on slot 1 is irq 10 */ + <0x0800 0 0 3 &gpio0 9 3>, /* INT C on slot 1 is irq 9 */ + <0x0800 0 0 4 &gpio0 8 3>, /* INT D on slot 1 is irq 8 */ + /* IDSEL 2 */ + <0x1000 0 0 1 &gpio0 10 3>, /* INT A on slot 2 is irq 10 */ + <0x1000 0 0 2 &gpio0 9 3>, /* INT B on slot 2 is irq 9 */ + <0x1000 0 0 3 &gpio0 8 3>, /* INT C on slot 2 is irq 8 */ + <0x1000 0 0 4 &gpio0 11 3>, /* INT D on slot 2 is irq 11 */ + /* IDSEL 3 */ + <0x1800 0 0 1 &gpio0 9 3>, /* INT A on slot 3 is irq 9 */ + <0x1800 0 0 2 &gpio0 8 3>, /* INT B on slot 3 is irq 8 */ + <0x1800 0 0 3 &gpio0 11 3>, /* INT C on slot 3 is irq 11 */ + <0x1800 0 0 4 &gpio0 10 3>, /* INT D on slot 3 is irq 10 */ + /* IDSEL 4 */ + <0x2000 0 0 1 &gpio0 8 3>, /* INT A on slot 3 is irq 8 */ + <0x2000 0 0 2 &gpio0 11 3>, /* INT B on slot 3 is irq 11 */ + <0x2000 0 0 3 &gpio0 10 3>, /* INT C on slot 3 is irq 10 */ + <0x2000 0 0 4 &gpio0 9 3>, /* INT D on slot 3 is irq 9 */ + /* IDSEL 6 */ + <0x3000 0 0 1 &gpio0 10 3>, /* INT A on slot 3 is irq 10 */ + <0x3000 0 0 2 &gpio0 9 3>, /* INT B on slot 3 is irq 9 */ + <0x3000 0 0 3 &gpio0 8 3>, /* INT C on slot 3 is irq 8 */ + <0x3000 0 0 4 &gpio0 11 3>, /* INT D on slot 3 is irq 11 */ + /* IDSEL 15 */ + <0x7800 0 0 1 &gpio0 8 3>, /* INT A on slot 3 is irq 8 */ + <0x7800 0 0 2 &gpio0 11 3>, /* INT B on slot 3 is irq 11 */ + <0x7800 0 0 3 &gpio0 10 3>, /* INT C on slot 3 is irq 10 */ + <0x7800 0 0 4 &gpio0 9 3>; /* INT D on slot 3 is irq 9 */ + }; + }; }; diff --git a/arch/arm/boot/dts/intel-ixp43x.dtsi b/arch/arm/boot/dts/intel-ixp43x.dtsi index 494fb2ff57a0..1d0817c6e3f9 100644 --- a/arch/arm/boot/dts/intel-ixp43x.dtsi +++ b/arch/arm/boot/dts/intel-ixp43x.dtsi @@ -8,6 +8,10 @@ / { soc { + pci@c0000000 { + compatible = "intel,ixp43x-pci"; + }; + interrupt-controller@c8003000 { compatible = "intel,ixp43x-interrupt"; }; diff --git a/arch/arm/boot/dts/intel-ixp4xx.dtsi b/arch/arm/boot/dts/intel-ixp4xx.dtsi index d4a09584f417..52ba8e4a49cc 100644 --- a/arch/arm/boot/dts/intel-ixp4xx.dtsi +++ b/arch/arm/boot/dts/intel-ixp4xx.dtsi @@ -20,6 +20,42 @@ qmgr: queue-manager@60000000 { interrupts = <3 IRQ_TYPE_LEVEL_HIGH>, <4 IRQ_TYPE_LEVEL_HIGH>; }; + pci@c0000000 { + compatible = "intel,ixp43x-pci"; + reg = <0xc0000000 0x1000>; + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>, + <9 IRQ_TYPE_LEVEL_HIGH>, + <10 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + bus-range = <0x00 0xff>; + status = "disabled"; + + ranges = + /* + * 64MB 32bit non-prefetchable memory 0x48000000-0x4bffffff + * done in 4 chunks of 16MB each. + */ + <0x02000000 0 0x48000000 0x48000000 0 0x04000000>, + /* 64KB I/O space at 0x4c000000 */ + <0x01000000 0 0x00000000 0x4c000000 0 0x00010000>; + + /* + * This needs to map to the start of physical memory so + * PCI devices can see all (hopefully) memory. This is done + * using 4 1:1 16MB windows, so the RAM should not be more than + * 64 MB for this to work. If your memory is anywhere else + * than at 0x0 you need to alter this. + */ + dma-ranges = + <0x02000000 0 0x00000000 0x00000000 0 0x04000000>; + + #interrupt-cells = <1>; + interrupt-map-mask = <0xf800 0 0 7>; + /* Each unique DTS using PCI must specify the swizzling */ + }; + uart0: serial@c8000000 { compatible = "intel,xscale-uart"; reg = <0xc8000000 0x1000>;