From patchwork Thu Nov 30 15:19:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 748687 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="FIp9e0wD" Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7A851700 for ; Thu, 30 Nov 2023 07:20:07 -0800 (PST) Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B1AF83FA55 for ; Thu, 30 Nov 2023 15:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1701357606; bh=tj9HPh6BvRLNZqMKySfyhhevyeW6ZzHpiXvh8Tdk9iY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FIp9e0wD8k6I2Ba9Efn2UYzz/NdA2SdRlpn16jRq7PmZLqpUgA2Wb8HKs4Hyc+5Rd Rt6PoOY404dNKALUzQ+tLvlol8UgbxgxfsaygUTS9pW0AGaE9VjeiVu1SP21dCBFac vRfppGeWOJ3zw58p7+Vxo+8484y7jQEXG5e0Xd/jWSFvi4qqriZW/aw2qRADFNqRYb IpERqA6ggNQIRRyCA6nv38NMxAjRoV+XWp3PODe7XSlqrwFsxYdzUNv4oCjeUFYLRb iZg0HVGh/ra+XXBEUUwHZTAe08/jXWXNmnqCCpuQ0lxavOAEGDSUu+98rTsQ96EnOq 8C3J5ewh7WLyQ== Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-6cde4342fe9so1114123b3a.2 for ; Thu, 30 Nov 2023 07:20:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701357600; x=1701962400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tj9HPh6BvRLNZqMKySfyhhevyeW6ZzHpiXvh8Tdk9iY=; b=BYZaLs3GGe6sKxyEABBdBjFurPC5GxtFX7YYFLb0SG6HNdeYqUC/B+6iLVhZZq2tSw 2R31fsNZJCr4odu2jKc2q7p7Zg+1KaIf3ydrEQXE6MPVLYXNCltL4Dx8U4KN2XMkIDU8 ccQWCtPvb6Ta6nt7HoS0eRhRiTJKH3mRbjkeCplpySe1blhcdO6hm0kM9P20Ww4sve8r rWtsv6Mjx7L+0JW6py+d5ij+jmPxAHlN40PghhXxErDYdKw63AVug0L3qZglBOJMRC7H 9PgKjLMiMOLKvdZvIZe5VtZY0wWDQd0mLSZ7W5jDggK5A+CihBZiJtQns9j2Q9zYjy4U G2PQ== X-Gm-Message-State: AOJu0Yzn7bUD4HeFkIKnKYelZ+rhGU7ayQ/Izesa7ddosawo0LD3xjk3 L8R50C8toBf8Pl4ed8CPFNpinaoZ9F7Ogkzb4NMTCXtVxlBe+Lk9KJJlE3/8sHqcCSF2UGwjL/f 7taCmeBCC2PIVCBJk2g5DmjW5yG5EuwvKk6dYPg4= X-Received: by 2002:a05:6a20:2445:b0:187:f7d3:fe4 with SMTP id t5-20020a056a20244500b00187f7d30fe4mr23989913pzc.11.1701357600043; Thu, 30 Nov 2023 07:20:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1mvOn1/uJNCv0eb4azsQCzjyj+9l3Hl/zvOgcVmnx6qLHRyWHQAlXD/AuQrB0F0f5KVnWrA== X-Received: by 2002:a05:6a20:2445:b0:187:f7d3:fe4 with SMTP id t5-20020a056a20244500b00187f7d30fe4mr23989897pzc.11.1701357599785; Thu, 30 Nov 2023 07:19:59 -0800 (PST) Received: from stitch.. ([80.71.140.73]) by smtp.gmail.com with ESMTPSA id y125-20020a636483000000b005bd3d6e270dsm1356002pgb.68.2023.11.30.07.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:19:59 -0800 (PST) From: Emil Renner Berthing To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Emil Renner Berthing , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Cristian Ciocaltea Subject: [PATCH v2 2/8] riscv: dts: starfive: Group tuples in interrupt properties Date: Thu, 30 Nov 2023 16:19:26 +0100 Message-Id: <20231130151932.729708-3-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231130151932.729708-1-emil.renner.berthing@canonical.com> References: <20231130151932.729708-1-emil.renner.berthing@canonical.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geert Uytterhoeven To improve human readability and enable automatic validation, the tuples in the various properties containing interrupt specifiers should be grouped. Fix this by grouping the tuples of "interrupts-extended" properties using angle brackets. Signed-off-by: Geert Uytterhoeven Signed-off-by: Emil Renner Berthing --- arch/riscv/boot/dts/starfive/jh7100.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts/starfive/jh7100.dtsi index e68cafe7545f..a40a8544b860 100644 --- a/arch/riscv/boot/dts/starfive/jh7100.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi @@ -149,15 +149,15 @@ soc { clint: clint@2000000 { compatible = "starfive,jh7100-clint", "sifive,clint0"; reg = <0x0 0x2000000 0x0 0x10000>; - interrupts-extended = <&cpu0_intc 3 &cpu0_intc 7 - &cpu1_intc 3 &cpu1_intc 7>; + interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>, + <&cpu1_intc 3>, <&cpu1_intc 7>; }; plic: interrupt-controller@c000000 { compatible = "starfive,jh7100-plic", "sifive,plic-1.0.0"; reg = <0x0 0xc000000 0x0 0x4000000>; - interrupts-extended = <&cpu0_intc 11 &cpu0_intc 9 - &cpu1_intc 11 &cpu1_intc 9>; + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>, + <&cpu1_intc 11>, <&cpu1_intc 9>; interrupt-controller; #address-cells = <0>; #interrupt-cells = <1>; From patchwork Thu Nov 30 15:19:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 748686 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="ap1qRYRr" Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA83010F9 for ; Thu, 30 Nov 2023 07:20:24 -0800 (PST) Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id ACBAC3FA50 for ; Thu, 30 Nov 2023 15:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1701357623; bh=x/4VKc6j7ZPLGeNJb06p6pcCmpUDLk01xwbpFjzzvZw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ap1qRYRraseSqCpDR3saeu4bryWspvFmdIcGYnSSvvvjGtKSq8qLb7Yx1hJElwaEm Ziv+Nu8IeQ7xU5D70a0ov8QnfUOpcv2v1nRQj5vgAPG20/YRH88VP1DlI9Iax0ziOP BAADJ5xYfxCJ+Gt90xD2K9hOc7e84I9oJDjqN8jv3rY5gKuSq6eCSucqzp+g9DBjqG cAvoLgMF1XWXSRk+PDFqHpS0Uo/YbuToTIbLkFW/0luT6TF3bG9/tE73aHXL0JD6Ad 5lGeXOBROj0XKGYfeG77c8ltJ3ZSyK9FPkGHVAoJTIHxGNfBD1zn+UHfBkptVh+thS zpujZSjzjVMGA== Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-6c337ce11ceso1296301b3a.1 for ; Thu, 30 Nov 2023 07:20:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701357622; x=1701962422; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x/4VKc6j7ZPLGeNJb06p6pcCmpUDLk01xwbpFjzzvZw=; b=AjUZprJkg6cAn7dOsW7hQBUMvDxwp/FyhSbVJ+7BASsX7YreEnKYaHY6yEnOibR9wj cu4ezD5ZIq+ZoOtwjZNqWPqtO1Yfi6tc+aWJzV+S1hYpDGL1T5maKB5V8owxFN7ZJXjo JIUqt1KanL+8DU3euOLW5GJnpHobpfe3pzxmvU5L7MMLIRAFNn+jJWgBs1zIEH2R6aUh K98jsKHSpnaiLvpjGa3johoHqufWQUEBVOVjEvI4ENLP5tRJcNTz9QhxEhRN+mh2FxhA M7qJctXlBqfpMslWQdMUmagI0O/+nyRCkJ9k7h1ElFWyQzQalcmFZxl3PvK9xhSi4bL6 QfWQ== X-Gm-Message-State: AOJu0YxTVfHdErtFJHdjfAMBeO49UIpuCtFRSMw8bGe+kuK9RlyGVvdB PZP5oTvTelo540V4kTd62QrkL7prBrbMFEY7oSvq1eHussiYoPxopnbYYhOGiqdsmBuOeg+uW84 TVdTldsUj/lEPb/eh5HCzCBMyDI9eKZh4TnEF94k= X-Received: by 2002:a05:6a20:144b:b0:18c:548d:3d0f with SMTP id a11-20020a056a20144b00b0018c548d3d0fmr23512355pzi.5.1701357622020; Thu, 30 Nov 2023 07:20:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJual8Lkb2g8N/YiH3FRK7taRMkY4AzxQVOPrkbyzCXqvXjTjv3kTIlyWPfwhdcnKtKcS4lA== X-Received: by 2002:a05:6a20:144b:b0:18c:548d:3d0f with SMTP id a11-20020a056a20144b00b0018c548d3d0fmr23512330pzi.5.1701357621745; Thu, 30 Nov 2023 07:20:21 -0800 (PST) Received: from stitch.. ([80.71.140.73]) by smtp.gmail.com with ESMTPSA id y125-20020a636483000000b005bd3d6e270dsm1356002pgb.68.2023.11.30.07.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:20:21 -0800 (PST) From: Emil Renner Berthing To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paul Walmsley , Palmer Dabbelt , Emil Renner Berthing , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Cristian Ciocaltea , Geert Uytterhoeven Subject: [PATCH v2 5/8] riscv: dts: starfive: Add pool for coherent DMA memory on JH7100 boards Date: Thu, 30 Nov 2023 16:19:29 +0100 Message-Id: <20231130151932.729708-6-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231130151932.729708-1-emil.renner.berthing@canonical.com> References: <20231130151932.729708-1-emil.renner.berthing@canonical.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The StarFive JH7100 SoC has non-coherent device DMAs, but most drivers expect to be able to allocate coherent memory for DMA descriptors and such. However on the JH7100 DDR memory appears twice in the physical memory map, once cached and once uncached: 0x00_8000_0000 - 0x08_7fff_ffff : Off chip DDR memory, cached 0x10_0000_0000 - 0x17_ffff_ffff : Off chip DDR memory, uncached To use this uncached region we create a global DMA memory pool there and reserve the corresponding area in the cached region. However the uncached region is fully above the 32bit address limit, so add a dma-ranges map so the DMA address used for peripherals is still in the regular cached region below the limit. Link: https://github.com/starfive-tech/JH7100_Docs/blob/main/JH7100%20Data%20Sheet%20V01.01.04-EN%20(4-21-2021).pdf Signed-off-by: Emil Renner Berthing --- .../boot/dts/starfive/jh7100-common.dtsi | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi index b93ce351a90f..3af88e6970a3 100644 --- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi @@ -39,6 +39,30 @@ led-ack { label = "ack"; }; }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + dma-reserved@fa000000 { + reg = <0x0 0xfa000000 0x0 0x1000000>; + no-map; + }; + + linux,dma@107a000000 { + compatible = "shared-dma-pool"; + reg = <0x10 0x7a000000 0x0 0x1000000>; + no-map; + linux,dma-default; + }; + }; + + soc { + dma-ranges = <0x00 0x80000000 0x00 0x80000000 0x00 0x7a000000>, + <0x00 0xfa000000 0x10 0x7a000000 0x00 0x01000000>, + <0x00 0xfb000000 0x00 0xfb000000 0x07 0x85000000>; + }; }; &gpio { From patchwork Thu Nov 30 15:19:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 748685 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="FmlErw+H" Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9FFC10E4 for ; Thu, 30 Nov 2023 07:20:38 -0800 (PST) Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 867CC42234 for ; Thu, 30 Nov 2023 15:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1701357637; bh=3BV4Vz9z3QHFiX3Dv1bjv4P8f3k40Tur0+jRMIWhjwA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FmlErw+HiaJMs1JB12hxFfs+q4OSvVMt2YJ1zQmak5jfXG16EPwsA8OSLEwJYVmbo J/VTYDyTQqhftDJLqBV0i9KeFJ8VQj/x2ENl8C0gG3ctq6hQBiEyhbkAgSlY81NDEX ashAC0L9xZY8z4WhhQmrhusk0aOD3+/bCbwd+YDeg62xxgRZQAwySSBGabrFczWrCN Z5/6BU4WYgnRkNsn7rI8MLRO0QqbzMzzLUHoqZiS7C/pBeVCvMPpe6HMEpuaqDPb6H 2px2A4/nQNm1+VJSKasGDdRyBnrEyuQ043JHAh0eubkqVKr0Vz4kLU6pQt06m2UG/R ZVTktMCDeyvSw== Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3b5665e00b6so1173940b6e.2 for ; Thu, 30 Nov 2023 07:20:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701357636; x=1701962436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3BV4Vz9z3QHFiX3Dv1bjv4P8f3k40Tur0+jRMIWhjwA=; b=etsQiUx79fgTi7zs0BwR66uUYn4j1XshESgd2iEiGxhMVQLVDZRFiTwDjbfcmQASgm nu9lNJkj56kZHA/CYOqA3tDyoeXgDx3Jo9oqMwdbI67HEeBmEXtuI34+oyGWXjML+Wmw TDX9xHgCAD6ahoF+NoF3X5a0uVFNO+hDKOm0w367lOf/A2ty9oXxFB2Z1jWQzqjO20qL oGxa8ihdyQBu3CrBOXz5XoiKMwztH6IzafqQZrTSWdKS3HZ7GMJiYPG0nyvTCkUWg4dP gIo9mfL2p6Dqpq+7o5JcDT54eb+MpgYZsoK3fy6aWKJqHX2VCaxNG2RmdYjzcMTtpFfQ +Z6Q== X-Gm-Message-State: AOJu0Yy1VkrHXiBie8sQ7CWkPVvLe0dxGyf3O4AVbmyWgqLQ6sFDTdYc gD11Ge92gd5YzbM/0yS/Xv6FQCKrCzmAoG19ZM2yYVyevlOTvdug46O1hj2/YglrBCUxUrNCHkb JG9J2wMOtTwJqOnA51Rei7o76xvUb94spZQogZ0c= X-Received: by 2002:a05:6808:e83:b0:3b6:a7f2:f1fe with SMTP id k3-20020a0568080e8300b003b6a7f2f1femr26367629oil.47.1701357636384; Thu, 30 Nov 2023 07:20:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2rYNqi7HKvMn1CUtmkwOZKqWlU0WJNU5JfZrmmn+Bj6zgpLKPHoDP66fIgr2qToAWBfFRIA== X-Received: by 2002:a05:6808:e83:b0:3b6:a7f2:f1fe with SMTP id k3-20020a0568080e8300b003b6a7f2f1femr26367602oil.47.1701357636165; Thu, 30 Nov 2023 07:20:36 -0800 (PST) Received: from stitch.. ([80.71.140.73]) by smtp.gmail.com with ESMTPSA id y125-20020a636483000000b005bd3d6e270dsm1356002pgb.68.2023.11.30.07.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:20:35 -0800 (PST) From: Emil Renner Berthing To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paul Walmsley , Palmer Dabbelt , Emil Renner Berthing , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Cristian Ciocaltea , Geert Uytterhoeven Subject: [PATCH v2 7/8] riscv: dts: starfive: Enable SD-card on JH7100 boards Date: Thu, 30 Nov 2023 16:19:31 +0100 Message-Id: <20231130151932.729708-8-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231130151932.729708-1-emil.renner.berthing@canonical.com> References: <20231130151932.729708-1-emil.renner.berthing@canonical.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add pinctrl and MMC device tree nodes for the SD-card on the BeagleV Starlight and StarFive VisionFive V1 boards. Signed-off-by: Emil Renner Berthing --- .../boot/dts/starfive/jh7100-common.dtsi | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi index 3af88e6970a3..adcdbbc4f57f 100644 --- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi @@ -12,6 +12,7 @@ / { aliases { + mmc0 = &sdio0; serial0 = &uart3; }; @@ -108,6 +109,43 @@ GPO_I2C2_PAD_SDA_OEN, }; }; + sdio0_pins: sdio0-0 { + clk-pins { + pinmux = ; + bias-disable; + input-disable; + input-schmitt-disable; + }; + sdio-pins { + pinmux = , + , + , + , + , + ; + bias-pull-up; + input-enable; + input-schmitt-enable; + }; + }; + uart3_pins: uart3-0 { rx-pins { pinmux = ; }; +&sdio0 { + broken-cd; + bus-width = <4>; + cap-sd-highspeed; + pinctrl-names = "default"; + pinctrl-0 = <&sdio0_pins>; + status = "okay"; +}; + &uart3 { pinctrl-names = "default"; pinctrl-0 = <&uart3_pins>;