From patchwork Sat Apr 23 03:45:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 12824404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6458CC433EF for ; Sat, 23 Apr 2022 03:45:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbiDWDsm (ORCPT ); Fri, 22 Apr 2022 23:48:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbiDWDsl (ORCPT ); Fri, 22 Apr 2022 23:48:41 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08olkn2033.outbound.protection.outlook.com [40.92.45.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B01C717E18; Fri, 22 Apr 2022 20:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LAB8nLSLDj5Gl97dp3zj+vPbWRkfOGDqFS9m1l0E0kH70Yf+Th5/BGOx0WtmivxqQQIAwNVIYwrYPKMtxRqQtbnpp3JSWrs2f4hVpf6hFMKaBN9KeyCFTS6g2UGbYX/HxOiRK9vCuJJ9xIvsyBg6yXH2fsHp79D9TLt4gIS4LchelKljzbtzJTAbz4fRYlOWEoBWDY0jDr/Km3htcrUCOVf7YLEYesnHYYnnH81jXvHdWAZXgmz460rIdXiUCobhK+KPRK1AmA1B2/84Cr7SdJb3GVX0P5uuWIR2RQHsWz0kF3UEj61DcxwOmFWQ3vl/L/9AzZBsWtDwzPRpS3yVKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uecGUSqWJODMZllirGh+Anzc6QtH0q4hkKrsUA9O1dQ=; b=KuAKFdAdETyigoOKGHeu23r1WyyCQ06dK7ARY6sLzvRcJkRbmyGXAVXDuGfaVI9JUfwPOfueZvRnlhOZOxeeI3JpoHnmDkUsI6saiw+X5INCNy4EdrAgD8AGtwXuNHLcDZeXRpKr4k+gPMKY2gp7WyKuy342CwEh+0q8jzGmWqb8NBU2DAT22vox7+Ht24m/cOZfM9ifl3UWH7cVtZQD8I8OjPonzMiWUWWZ5XCw54EbfqPrE5wh7xhWUIwikUUA5tZX7wFMzaQia6Z+ZjDOdeXrQopyxSmz7v8kiTirNZPLIsuuza5U9b16qPeE3NZMWi/2Xg+mpWI8jrgS5lw79A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) by SN6PR04MB4205.namprd04.prod.outlook.com (2603:10b6:805:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sat, 23 Apr 2022 03:45:42 +0000 Received: from CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5]) by CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5%5]) with mapi id 15.20.5186.015; Sat, 23 Apr 2022 03:45:42 +0000 From: Jonathan Bakker To: Miquel Raynal Cc: Kyungmin Park , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Jonathan Bakker Subject: [PATCH 1/5] dt-bindings: mtd: samsung-onenand: Add new binding Date: Fri, 22 Apr 2022 20:45:24 -0700 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220423034316.366488-2-xc-racer2@live.ca> References: <20220423034316.366488-2-xc-racer2@live.ca> X-TMN: [bU/ZgHwhhA+sBXY6ZdurX4/f9ypBDq+Lk44A/j6V6oW64yvmdmaBl2L4iTipkUX7] X-ClientProxiedBy: MW4PR03CA0277.namprd03.prod.outlook.com (2603:10b6:303:b5::12) To CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) X-Microsoft-Original-Message-ID: <20220423034524.366612-1-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6b98c29-3cc5-4893-61a1-08da24dbbd73 X-MS-TrafficTypeDiagnostic: SN6PR04MB4205:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fXWmi+OYgPM8LHE8gawYJHpN74lEiBjR9BXzKPhv9UidSglWba7BxlgsiRLdaQCr4BxXndVC2xWiCOql0qST0mR/S8Oqve4z7MpGkZnuuwL9h+aLCbFdvW3AucUk0mG7bg2mRYSniVrtw7zkkQz3TP57FVzPlNHKh3vx/hXCSx7QvTRWxVN2i7SoW0m+EU1x7kH6JtILddKOfG/fPg+R9fyP31ZgDbBOJhjOw29YOIxmgkNNG86JoSpO9+oB+0PniTiNf0hOFJDPy7+G0HWwSWBvYnN3eDPnNHxZNQMPAaAM0Zwre6FbHHOEsNx5AMj2VGTqiqql81nfrUf3hPiQnj5AjS9VFRUT+kQU1KKwa6rZn3XJTA8iE26uAGNKfWFns3/khK8vGHsov4+pcVSWB0QfMhLvjAZnBir8VU5PcAkCbw3kP5a5WijuWAQj32o23WqzYMJmnNTdvz5h1pC1kWxRTHV+IlzQa9Zs6qpo5qT1C2AgIyTAvSHJ+nc8x2GJ+XbS2jLdj0mmQAsaDmd1Rbfj3z2T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7uMb9Dzmtn+kBVtlY0JrGEDi/mPKOh58jtoif5yRjcrOHJQRk6T1rRcuEpIp5MjpCKidS4Ti6Hvy4Qd6PHNa6a0bLDrP/CUhlAcEQByxUTa3mbpskYdsEyXpomWmno6XQDIOG5PwcCFbczCppTkt4ZvZG0SkH9/3jMA/uSmKaG68173v9yiTCWHjtkk7PRSMchOinwd13nxqnTo/iPTUAD/b5ON1DnEspxgjRPLAy2fsU9U8wsK7qo+Xx8+hFY0m+9DvOuDd4yageX2sTo52x8NucRA8/1g57Qit2iVwiUgRrddcABRzGXlptLgzK8PqszzsPP5wD/+bANCezm0tV8yTUY4uh++Jal2UuVHHehI/Nq4t3+ZQwvD7PAHKzEbI2nmYnMAp2EsfGyHBIhnz4sOchHuCWM4HV1Df7XpyCcue8eaBV/kzmFAtZZcevKTOlhpyUbnMHdcvoOVKnBttSjE0aGzZ5QQM05OJgA4T0YA5R55yCO23ONbX/HXBANPYPh6AV8Sm/rpG794NjJ/RvDKrQEA6OtaTHQJH7n5TCAQbs4G/KYZzedxH2kvbr006pC7XTL0Gzu92g== X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-edb50.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: d6b98c29-3cc5-4893-61a1-08da24dbbd73 X-MS-Exchange-CrossTenant-AuthSource: CY4PR04MB0567.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2022 03:45:42.5614 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR04MB4205 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add a yaml binding document for the Samsung OneNAND controller. It is found in several older Samsung SoC, notably the S5PV210. Signed-off-by: Jonathan Bakker --- .../bindings/mtd/samsung,onenand.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/samsung,onenand.yaml diff --git a/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml b/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml new file mode 100644 index 000000000000..25012248add6 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml @@ -0,0 +1,89 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/samsung,onenand.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung OneNAND controller + +maintainers: + - Jonathan Bakker + +properties: + compatible: + enum: + - samsung,s3c6400-onenand + - samsung,s3c6410-onenand + - samsung,s5pv210-onenand + + reg: + maxItems: 3 + + interrupts: + maxItems: 1 + + clock-names: + items: + - const: bus + - const: onenand + + clocks: + minItems: 2 + maxItems: 2 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +allOf: + - $ref: nand-controller.yaml + + - if: + properties: + compatible: + contains: + enum: + - samsung,s5pv210-onenand + then: + required: + - interrupts + - clock-names + - clocks + +patternProperties: + "^nand@[a-f0-9]+$": + type: object + properties: + reg: + minimum: 0 + maximum: 1 + + additionalProperties: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + onenand: nand-controller@b0600000 { + compatible = "samsung,s5pv210-onenand"; + reg = <0xb0600000 0x2000>, + <0xb0000000 0x20000>, + <0xb0040000 0x20000>; + interrupt-parent = <&vic1>; + interrupts = <31>; + clocks = <&clocks CLK_NANDXL>, <&clocks DOUT_FLASH>; + clock-names = "bus", "onenand"; + #address-cells = <1>; + #size-cells = <0>; + + nand@0 { + reg = <0>; + }; + }; From patchwork Sat Apr 23 03:46:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 12824405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7A75C433F5 for ; Sat, 23 Apr 2022 03:46:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232508AbiDWDtm (ORCPT ); Fri, 22 Apr 2022 23:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232526AbiDWDtk (ORCPT ); Fri, 22 Apr 2022 23:49:40 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2104.outbound.protection.outlook.com [40.92.47.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B270313976D; Fri, 22 Apr 2022 20:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zgt1yu64UtGJWUVVCxflQrWyG+jBbc5r72p1x/Qrk2Atib9ivFOXwP4DLErH5NAaK95uPY1jbzLhlUNiMygfkPHPcy4w1RX4qjS4aHtyXCnpW4HQAfe/XceOQhmNACrhEYV1pxRp6oQUG8oqJDN14I0SnEtRFqW1HeyViaeUY2Xi76ybguwuUlqefM2/dZltdbODjYNkt5M+2y1XGdHVzABAMw5j1iLwRFRSUdFf+kcTkvaN1v+mI7QnAy4okvPSTemiBdHI6lFTNxR1//08zvGsV/TibB8WY6IZsXhse3G0ewtJHodSOpKGLSiS1N1K4XDE2EBQ+HPmQ1yLA/hK8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2TEFyQpoFygt63asuQVsE0XVF+UYmrJJETWTjkVoqdo=; b=kpnBrei7/Rkj3BNuyHsyJmmoCyUd+az7NGLm+saUx99MKjf1a1Znj+KzcrJFtttcUQbYWt6cUKr7HxfXnWIiE0b8wnCMw7H1oSrMxTL4QEbxpsG2+Gfn4x75FPoN4OX4lMNv43D9kistpQBAm1hAdiJ76C3Gf71yrMudZyKAmYAf0ndvH7yX1BlwEwHx9jO3zFRttfU8DFQwJygUcY94mDBQsWkE0pkZnsO+Ctg72skfRS2hu8nUb7AjxtGjzz2w8x0rRVTqztG0Ffwed71khPAqafF5JU1RPFfIWW5Iom00VoOSUp6ThSEjM1Gt2RTRyPSAEwVp1JDZcSx5SbyXXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) by SN6PR04MB4205.namprd04.prod.outlook.com (2603:10b6:805:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sat, 23 Apr 2022 03:46:43 +0000 Received: from CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5]) by CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5%5]) with mapi id 15.20.5186.015; Sat, 23 Apr 2022 03:46:42 +0000 From: Jonathan Bakker To: Miquel Raynal Cc: Kyungmin Park , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Tomasz Figa , =?utf-8?q?Pawe=C5=82_Chmiel?= , Jonathan Bakker Subject: [PATCH 2/5] mtd: onenand: samsung: Set name field of mtd_info struct Date: Fri, 22 Apr 2022 20:46:19 -0700 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220423034524.366612-1-xc-racer2@live.ca> References: <20220423034524.366612-1-xc-racer2@live.ca> X-TMN: [31aCKBWYxvekUmHCZrlZnJNvfi/1AJUPOl6OL4jNZaWYvHMCzP04AHwLqwS9nyHz] X-ClientProxiedBy: MW4PR04CA0210.namprd04.prod.outlook.com (2603:10b6:303:86::35) To CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) X-Microsoft-Original-Message-ID: <20220423034622.366696-1-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9508204a-d12f-42aa-6e7a-08da24dbe16a X-MS-TrafficTypeDiagnostic: SN6PR04MB4205:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /8IaNIf5He4Ia/OtVPUH4CG+StIaos5VoAgfgQrPdUjmZwZA0bMQF93YnmwFOBdhJV231g4TDjyitW51/9LdEnmhkaQTa+InDEmwmxBG9KiBUZVarsqIHW9pQGvcTxhAoerALrpZ/OriiJI4i7LINIg1xDBnv5n2SgNYjuCrWKlthtJ40HBa31Yn1tb9uIk10fWc68XN6CVLkUcmJEDaVWLATfjvT86e6t0pczdP/W70pGdEPATpFMBeq4tI56UH2WFe3biZiu2a+u6QIzQeorQ291gAkeviP+c3QMY2je8u//LrP/e55r5FS5A19SGi8fYCEafZn5aX8MYZ+1FlxAaalAYMehFe5eMhF15UAfqHOxWh6Q22Ifo2QCh3hzx545MO4zkmBKbfLnJMNSJyllwso4Cv3oslqOSKwgiwf/SzuJGuKIhsX6dN45dAu0LAb2lh58oG3WUsJFw9wM3al6xIM2RHrKT9IY6VYfOKdZbPEdas407a4maJQ7MLJZMcQzX4X20aODmKFvwTquVXrCU/5HVOXhE4skBbbHv5cBL6QmhjewRiFdVb5pw86IVfgDXs7IRHuSuChc2Qx84OHg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS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7mvt4P+0UlAo/RPHX5kostfemZJv6i7N34thnEF+a7zKKXCuG?= =?utf-8?q?g3CjBb32IDXLJTWKdlY+3JBP6uZFrHcuaN3bnaPzUas5pW+M20iLKVOAw9MSrNSP7?= =?utf-8?q?TzNMm9ZlzV1ilw5MpIVHexhJUb5c1rniepNydYyzNhQxtWzoOnuiciukZpmIWK2xQ?= =?utf-8?q?hwdHTWwQN5YkGEGmcVQ6NTd5tjmszjSROqOpUTgBVF1hE/2//MjmOsqqUHF4wHU6A?= =?utf-8?q?9f+tL1Vx3jxHmC6TmmTKXDWVTzZ7Kn4YsCISvNA3gKYmDjMpgzX9dWLYg3i082lXF?= =?utf-8?q?auGdshs47z397X9/UXSE3wNOYBzpBFggWRmXN9LV9VQ4sDoUEF0cd3q0QvDDjHmGA?= =?utf-8?q?9kIxdhvwSWYFMneiNkpaDIRfE/L6Mx1p5YUW90AJGLgIWRy5iZg5Xwl4swlqowDhe?= =?utf-8?q?RRQLip0FmUmgFYG3qALe0D8TiOH7HVgTS98X2LxuB0qValjvDNCeZ58JF8/EKV2DA?= =?utf-8?q?KmQU+ACjp1Pi0GGGxvICVizSBfejX7GHIF0u79k6PWgBRNf6tJ4DbA+2PPSKtj5+Q?= =?utf-8?q?MLLPV/aUh4iF9JTXslrN7oOOFsFSjSwQUejowjCIo3KN4+P89BtCcl+4o=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-edb50.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 9508204a-d12f-42aa-6e7a-08da24dbe16a X-MS-Exchange-CrossTenant-AuthSource: CY4PR04MB0567.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2022 03:46:42.8851 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR04MB4205 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Tomasz Figa This patch adds initialization of .name field of mtd_info struct to avoid printing "(null)" in kernel log messages, such as: [ 1.942519] 1 ofpart partitions found on MTD device (null) [ 1.949708] Creating 1 MTD partitions on "(null)": Signed-off-by: Tomasz Figa Signed-off-by: Paweł Chmiel Reviewed-by: Miquel Raynal Signed-off-by: Jonathan Bakker --- drivers/mtd/nand/onenand/onenand_samsung.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/onenand/onenand_samsung.c b/drivers/mtd/nand/onenand/onenand_samsung.c index b64895573515..924f5ddc9505 100644 --- a/drivers/mtd/nand/onenand/onenand_samsung.c +++ b/drivers/mtd/nand/onenand/onenand_samsung.c @@ -853,6 +853,7 @@ static int s3c_onenand_probe(struct platform_device *pdev) return -ENOMEM; this = (struct onenand_chip *) &mtd[1]; + mtd->name = dev_name(&pdev->dev); mtd->priv = this; mtd->dev.parent = &pdev->dev; onenand->pdev = pdev; From patchwork Sat Apr 23 03:46:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 12824406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48AF1C433EF for ; Sat, 23 Apr 2022 03:47:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbiDWDtw (ORCPT ); Fri, 22 Apr 2022 23:49:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232563AbiDWDtp (ORCPT ); Fri, 22 Apr 2022 23:49:45 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2043.outbound.protection.outlook.com [40.92.47.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 383BB17E18; Fri, 22 Apr 2022 20:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lx/dffzEIK3vWKwOJxHF67D9F23Mdp2U2niDm4+VFEsUBPFI23d7/Vxf6WqClLWkBRiU/ETTntRQA87i1n9+wBKkGK2A6TeMPffMWcMB/aXqNa7PVRQwRCfgUx3S3vmYud2inPGUX28sif8pHuDjMwYGEjLu4W4NoifnRiYXZxemqq1rjojTbcl1jY0U/ztTxTBbXSiprBRImUm8bW8mqxzwzaHdwaGgL+0dyVlX4lFrcY4ff1Md59GHE0r+ZTuqgYi6vnpHSqbLfrd3wNdjmJ3mjlRAti8kU+CZKNXxovzqAkuoQV2Gg8X+2PPucCU6F8DtjA1Tb35Bv4WZCVQtAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TOCNBNpg8pj5X3kpg0xrEiadcxZZFicj1B2uUAE+IjM=; b=ezLPLWAlYDmpn3y5RwCdCOrn91OIMLr7Uaa/fJ5mQAESHD2SjXMdtgI4ivH05P7meIBo5/T+H43jBoJTEr4CB3ih4SUZ07nW+Rb984Va/k8/ihB3xVOEEEZoV449o4i2BllvZL87rL6oI1j5f5b4zWly1sNj6jD/4XhkgmrlSYbQN/U7CKxhq/ZaLQHhzAJNPYJGge8xiEpRX+dRS15QBWoxoc8RXr/npcYIiefozHztP9Bb1sz+dFvgSRO5CwkHXwwiSKZJ43BwzoYmKHiIJcIb9wOPqLgvGt++Gh/UgWlpiNbC31PTZnnSA2kyzfm06eagt5MykgtGa/9X5F+yNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) by SN6PR04MB4205.namprd04.prod.outlook.com (2603:10b6:805:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sat, 23 Apr 2022 03:46:46 +0000 Received: from CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5]) by CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5%5]) with mapi id 15.20.5186.015; Sat, 23 Apr 2022 03:46:46 +0000 From: Jonathan Bakker To: Miquel Raynal Cc: Kyungmin Park , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Tomasz Figa , =?utf-8?q?Pawe=C5=82_Chmiel?= , Jonathan Bakker Subject: [PATCH 3/5] mtd: onenand: samsung: Unify resource order for controller variants Date: Fri, 22 Apr 2022 20:46:20 -0700 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220423034622.366696-1-xc-racer2@live.ca> References: <20220423034524.366612-1-xc-racer2@live.ca> <20220423034622.366696-1-xc-racer2@live.ca> X-TMN: [l2FdWO9S3Of0bxkli5/76lPwUFTdTVMeFfFO/wdP6TZtn5RBC1007aa2VLoXy9Gg] X-ClientProxiedBy: MW4PR04CA0210.namprd04.prod.outlook.com (2603:10b6:303:86::35) To CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) X-Microsoft-Original-Message-ID: <20220423034622.366696-2-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea943821-93a8-4df7-d37f-08da24dbe3a1 X-MS-TrafficTypeDiagnostic: SN6PR04MB4205:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d+bJautiTjtFkFFL6Cr5Iaf+oQLj9D718x20bWKhdGH94wuA6A1gz82f7ltmiCS0/6RXb2/wO9n1l6hWZ0fOz9aWZwvk4twIKdFTzkjsiEPZz2DPyoIPvj5QZz/mhTGgPXzvZQz2uNSDWQeWlNQzgK16P6sZc+sf5oDerHbaTLzubO03rEF+H2Alb0BvsYI6inroaPio1uPV1vFHPtgMgucZ6TQg2ShCc15YwHJ9Mbg3Bo7f3u0z7+sD0xYX0MsUwRMjnJONumthtXnNSS3eG4KppIWyrNkq5HSl84sHMWBoO+a/h7AaqZpxuPq39C2rA9bjCzfPMEHrqOxR5xsphtRSWbPP97Kp480GuXus5lO/5wEP2QnCk5DlNN+kEosC8u2zlWZwSdamz8KJp1uONwG9ESC8+Hw14IVZrg11mAUSoEKmdNIGHLZU3YgFzdtCvl5ZeiAx+tyvfvy7lELl85QwQy9V3va/qBmRDFu1wS0QgM8bkczTva+OnE4IX2dDX5JewYCcZLGLU5+jlyqKIuWSsAyfRduJan6JohgCgSDmrrTbyLW2SkqH4J+tAQJhu/O5kH+6BmjohFFc0GOl8Q== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Isku/e+8EvQjCGfcATaDdcJgQg16?= =?utf-8?q?nY2VuhsGprYUXrsxUr6/w8oZbZChTh9WYJHfH3frr5LlsXkTaRXUhN2EC2zZwc3rH?= =?utf-8?q?cBev7TB6RQConmdIXziiDp1eaxtScvCkM1J7D3hlZMbs9QPkeyX/6rWa6sIF84Ibd?= =?utf-8?q?htKnF1ajt6GR3sSSITlv9ff2QFmaCicXCDNcVbKtF9TaHMX406aviMDPmxxHRkFT7?= =?utf-8?q?QwjWJ3zlwx4lgIJR1E7vuZwqwDY7ktoAvZEDOsR0WRtG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RcBpSTHnycTP52URAZ3L5KeF8yFD?= =?utf-8?q?PWCJ/jny2fCdRHR0GhAasw6P3KukbLwnDcMEcEi8FGd9hxVQkPhNSjv/f+yU18i2e?= =?utf-8?q?cO1Th4OFoL1mpFAVsYXu5XDX4i2L01uPh+7+T84PdHUUTdKIRGkjFOYHBpmto+lzg?= =?utf-8?q?wEb5s4oB4RwqtnMesXJd7jRrMOfA2KFTsWqk9wY18dlgUY1derXpNxQDS8PY0Fuxj?= =?utf-8?q?VsALhUhm9YbBCoyVM67orLuVew37aPoIE1ucSPZD0wBRpllBBYLX6HYwIqGp5Uo54?= =?utf-8?q?bXlda4Eb6An2pLVYJrxHkE+z4+XdibYfoy7oDnWN8rXPGcJ85vcDaN0kw=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-edb50.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: ea943821-93a8-4df7-d37f-08da24dbe3a1 X-MS-Exchange-CrossTenant-AuthSource: CY4PR04MB0567.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2022 03:46:46.5723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR04MB4205 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Tomasz Figa Before this patch, the order of memory resources requested by the driver was controller base as first and OneNAND chip base as second for S3C64xx/S5PC100 variant and the opposite for S5PC110/S5PV210 variant. To make this more consistent, this patch swaps the order of resources for the latter and updates platform code accordingly. As a nice side effect there is a slight reduction in line count of probe function. This will make the transition to DT-based probing much easier. Signed-off-by: Tomasz Figa Signed-off-by: Paweł Chmiel Signed-off-by: Jonathan Bakker --- drivers/mtd/nand/onenand/onenand_samsung.c | 48 ++++++++++------------ 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/drivers/mtd/nand/onenand/onenand_samsung.c b/drivers/mtd/nand/onenand/onenand_samsung.c index 924f5ddc9505..a3ef4add865a 100644 --- a/drivers/mtd/nand/onenand/onenand_samsung.c +++ b/drivers/mtd/nand/onenand/onenand_samsung.c @@ -123,14 +123,13 @@ struct s3c_onenand { struct mtd_info *mtd; struct platform_device *pdev; enum soc_type type; - void __iomem *base; - void __iomem *ahb_addr; + void __iomem *ctrl_base; + void __iomem *chip_base; int bootram_command; void *page_buf; void *oob_buf; unsigned int (*mem_addr)(int fba, int fpa, int fsa); unsigned int (*cmd_map)(unsigned int type, unsigned int val); - void __iomem *dma_addr; unsigned long phys_base; struct completion complete; }; @@ -144,22 +143,22 @@ static struct s3c_onenand *onenand; static inline int s3c_read_reg(int offset) { - return readl(onenand->base + offset); + return readl(onenand->ctrl_base + offset); } static inline void s3c_write_reg(int value, int offset) { - writel(value, onenand->base + offset); + writel(value, onenand->ctrl_base + offset); } static inline int s3c_read_cmd(unsigned int cmd) { - return readl(onenand->ahb_addr + cmd); + return readl(onenand->chip_base + cmd); } static inline void s3c_write_cmd(int value, unsigned int cmd) { - writel(value, onenand->ahb_addr + cmd); + writel(value, onenand->chip_base + cmd); } #ifdef SAMSUNG_DEBUG @@ -517,7 +516,7 @@ static int (*s5pc110_dma_ops)(dma_addr_t dst, dma_addr_t src, size_t count, int static int s5pc110_dma_poll(dma_addr_t dst, dma_addr_t src, size_t count, int direction) { - void __iomem *base = onenand->dma_addr; + void __iomem *base = onenand->ctrl_base; int status; unsigned long timeout; @@ -561,7 +560,7 @@ static int s5pc110_dma_poll(dma_addr_t dst, dma_addr_t src, size_t count, int di static irqreturn_t s5pc110_onenand_irq(int irq, void *data) { - void __iomem *base = onenand->dma_addr; + void __iomem *base = onenand->ctrl_base; int status, cmd = 0; status = readl(base + S5PC110_INTC_DMA_STATUS); @@ -583,7 +582,7 @@ static irqreturn_t s5pc110_onenand_irq(int irq, void *data) static int s5pc110_dma_irq(dma_addr_t dst, dma_addr_t src, size_t count, int direction) { - void __iomem *base = onenand->dma_addr; + void __iomem *base = onenand->ctrl_base; int status; status = readl(base + S5PC110_INTC_DMA_MASK); @@ -632,7 +631,7 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area, } if (offset & 3 || (size_t) buf & 3 || - !onenand->dma_addr || count != mtd->writesize) + !onenand->ctrl_base || count != mtd->writesize) goto normal; /* Handle vmalloc address */ @@ -862,23 +861,22 @@ static int s3c_onenand_probe(struct platform_device *pdev) s3c_onenand_setup(mtd); r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - onenand->base = devm_ioremap_resource(&pdev->dev, r); - if (IS_ERR(onenand->base)) - return PTR_ERR(onenand->base); - + onenand->ctrl_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(onenand->ctrl_base)) + return PTR_ERR(onenand->ctrl_base); + + r = platform_get_resource(pdev, IORESOURCE_MEM, 1); + onenand->chip_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(onenand->chip_base)) + return PTR_ERR(onenand->chip_base); onenand->phys_base = r->start; - /* Set onenand_chip also */ - this->base = onenand->base; - /* Use runtime badblock check */ this->options |= ONENAND_SKIP_UNLOCK_CHECK; if (onenand->type != TYPE_S5PC110) { - r = platform_get_resource(pdev, IORESOURCE_MEM, 1); - onenand->ahb_addr = devm_ioremap_resource(&pdev->dev, r); - if (IS_ERR(onenand->ahb_addr)) - return PTR_ERR(onenand->ahb_addr); + /* Set onenand_chip also */ + this->base = onenand->ctrl_base; /* Allocate 4KiB BufferRAM */ onenand->page_buf = devm_kzalloc(&pdev->dev, SZ_4K, @@ -896,10 +894,8 @@ static int s3c_onenand_probe(struct platform_device *pdev) this->subpagesize = mtd->writesize; } else { /* S5PC110 */ - r = platform_get_resource(pdev, IORESOURCE_MEM, 1); - onenand->dma_addr = devm_ioremap_resource(&pdev->dev, r); - if (IS_ERR(onenand->dma_addr)) - return PTR_ERR(onenand->dma_addr); + /* Set onenand_chip also */ + this->base = onenand->chip_base; s5pc110_dma_ops = s5pc110_dma_poll; /* Interrupt support */ From patchwork Sat Apr 23 03:46:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 12824407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 331EFC433F5 for ; Sat, 23 Apr 2022 03:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232594AbiDWDtz (ORCPT ); Fri, 22 Apr 2022 23:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232564AbiDWDtq (ORCPT ); Fri, 22 Apr 2022 23:49:46 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2043.outbound.protection.outlook.com [40.92.47.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCCFA13976C; Fri, 22 Apr 2022 20:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jhORCvLN9lhpZJvvQHVaOUFJ/G7++hoclB7isnmbHXrP7NSKAnhBCCLh8d0Yj6JwJarFuxwpsBRxTgEKOhsVF9sx/QpYK9oNSkG3C5DNWXHtyTZVFYiTGN++qR3Vn8LX/r+g0i28LXqMn90JK8j0q4Z94t5scmVSlVbycQgVCfPsU0eh7BU0jDkOoo4k5hnqtDdBQxbVovrhyDM0vF2gdojQSLITx7NBBpL+n+ZqXPjwMeR0B+m2lZpK2DIBYlcb23d35Yz0hec95OHKQQYQRdmQvY31iOhmQFCBpdMmLTdtGOyJgsIYQBHkNpK95fZAQwIFBiE5XiyNCrB2UgGAjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dcP75b0sIfQb1qUJhu4FHo+cowifBokjGJEEWhB4fmQ=; b=UqLA4nUegFmMwY8wD7IR5cZtuY2X6BkdVIgcyGBM1DzPobkNBCkBws7wZM3mFgtSqZkZDW4IoVdSQlReHzlwUUyAGeCbmEYkJu/Dlq8ymLgzArnMWw7AKhjl8wRx2HZe7/Oomn5JPg0QWFx+snyqDzl/3YRd83n5khKvogZRfZJA/pCOQVpJ2Ol+RgtuMaefnbYYLlO9NBOEx4aXEWSbTny6jJn5t714WR80Hfo2IiZwl908/iqcFf4bEBPR29W/OyKn8UvL6Z/8SfQ6lr6esdlC4vIGxKza35nVpYAFfFJYHrcRSH8ZLROzJQC4O0ICgivhjdOMJWAz04BpWP6GFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) by SN6PR04MB4205.namprd04.prod.outlook.com (2603:10b6:805:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sat, 23 Apr 2022 03:46:47 +0000 Received: from CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5]) by CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5%5]) with mapi id 15.20.5186.015; Sat, 23 Apr 2022 03:46:47 +0000 From: Jonathan Bakker To: Miquel Raynal Cc: Kyungmin Park , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Tomasz Figa , =?utf-8?q?Pawe=C5=82_Chmiel?= , Jonathan Bakker Subject: [PATCH 4/5] mtd: onenand: samsung: Make sure that bus clock is enabled Date: Fri, 22 Apr 2022 20:46:21 -0700 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220423034622.366696-1-xc-racer2@live.ca> References: <20220423034524.366612-1-xc-racer2@live.ca> <20220423034622.366696-1-xc-racer2@live.ca> X-TMN: [jzISU3lGJgpMSJxoT8XLznq63W7cCwgumnU7uamOx5cgbkFrk0Xx4bEPZF4VEom7] X-ClientProxiedBy: MW4PR04CA0210.namprd04.prod.outlook.com (2603:10b6:303:86::35) To CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) X-Microsoft-Original-Message-ID: <20220423034622.366696-3-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0dc3d1f3-057d-4284-a07e-08da24dbe454 X-MS-TrafficTypeDiagnostic: SN6PR04MB4205:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F7JMQTwKf1gP4G3EdEh40g37+FbTyIuMpi4dPggSK812Pp865EqDbjq7/pZZVczXLMpligvLiO0kZO2egd9qgvF3uZ24l/V3l8MnOI78CLk5DPhYXsvRlhL0mQmG1trm9qHWWRrKCxBWTZ5DgR8Xz35Pp7lqaRciVVrCQ9j5KUvGWGarmktJD5js3wrVEunTr8B1IEPAfq9M4jS4MXwaop5tQ/KmkxeH+I0N/CsE0WzSagACiZmPIC9RZW7Zg4ck/6IVKquwq2ld++/WXESl6lDZUc20GdygvwQQhlrmHxpZzpCrucHUDLBSHoR/3k5JFtM2HGIIYibYhPne/UWwZvPsHK5tX0miT4trXsf7NIikshEzsMqsUn6dKJAlHBD+iI0wG4p+4sFlNOEqtx3ih95aTxMr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iM4XPpWH5mXp9h5AHzBGal8rICWVN36+ysk35Sihy9O9V+hCFeTljwW?= =?utf-8?q?qVVw/rGEbjnEEaF2r3IPppj6su4/21DPHULdN3WknhKlhSAh/kXlf95xi5BfzPFLO?= =?utf-8?q?34m2NDdb3afe0GBuSBTF3I8KYaKApFajrvxX6S8OJugnTFLGF8kmfBaVMPRoV61j+?= =?utf-8?q?DxhLhHAYwrUvV0sjXANzA+dvDTBD836IhR2oPsdgl4o34WgAFa+i5XqoaTqhZIWPL?= =?utf-8?q?/VvTmo7EQe4PWD+1vnB0XDpK1nNl+b5ngzhvMPBbtYwXVCrIx4CiMjs1hJO7X1rvY?= =?utf-8?q?pswIlWbUPgvFqt0no0zuZgiz/9OiFICYki/hkmBXcTEuIJwCSq3dkjToJjWJszGlm?= =?utf-8?q?B2evSgvnoyMVcRTtcytzSRE9wUMwKCmFvBcDDGbqI95Lgia/eCpIf8PEj91kVverf?= =?utf-8?q?v3Qv224dybyjW0tbGWD2dec4WQ0Zl/6Fby8NWuRTviMEpza4/7GUeZ14t4oIHQfDy?= =?utf-8?q?GGqAE6gzEfQR/Rcxkp1k9N/yLV5M6x5V6FnE9nze7de7s93bGKsvEcAH+EHMRbG+Q?= =?utf-8?q?NwnplGpNivr5VApFImOb9rz/JR80tT6J5r1WyrLmMf/HiV1gfsK/NpOs5zVy17Xkl?= =?utf-8?q?9B0J1hS78P8d2SaES1NpsFOcQ/03wDPjtLuhxtuWpj1HBvFasp2rn6jhstjAy3yav?= =?utf-8?q?1wF/fb1ASFiIh+q+cv9hLi3wVFS4BAM19p6cXJZny91JKq+vWhgii6/fLotDtxkPA?= =?utf-8?q?Xq6PHEvIVMSO80yBOMBtFOgs2XRHkArovMRJUwd1VBU60ETka6sCjXAbY=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-edb50.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 0dc3d1f3-057d-4284-a07e-08da24dbe454 X-MS-Exchange-CrossTenant-AuthSource: CY4PR04MB0567.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2022 03:46:47.6972 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR04MB4205 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Tomasz Figa This patch adds basic handling of controller bus clock to make sure that in device probe it is enabled and device can operate correctly. The clock is optional and driver behavior is identical as before this patch if not provided. Signed-off-by: Tomasz Figa Signed-off-by: Paweł Chmiel Reviewed-by: Miquel Raynal Signed-off-by: Jonathan Bakker --- drivers/mtd/nand/onenand/onenand_samsung.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/nand/onenand/onenand_samsung.c b/drivers/mtd/nand/onenand/onenand_samsung.c index a3ef4add865a..62014f8d27b6 100644 --- a/drivers/mtd/nand/onenand/onenand_samsung.c +++ b/drivers/mtd/nand/onenand/onenand_samsung.c @@ -11,6 +11,7 @@ * S5PC110: use DMA */ +#include #include #include #include @@ -122,6 +123,7 @@ enum soc_type { struct s3c_onenand { struct mtd_info *mtd; struct platform_device *pdev; + struct clk *clk_bus; enum soc_type type; void __iomem *ctrl_base; void __iomem *chip_base; @@ -914,6 +916,10 @@ static int s3c_onenand_probe(struct platform_device *pdev) } } + onenand->clk_bus = devm_clk_get(&pdev->dev, "bus"); + if (!IS_ERR(onenand->clk_bus)) + clk_prepare_enable(onenand->clk_bus); + err = onenand_scan(mtd, 1); if (err) return err; @@ -945,6 +951,8 @@ static int s3c_onenand_remove(struct platform_device *pdev) struct mtd_info *mtd = platform_get_drvdata(pdev); onenand_release(mtd); + if (!IS_ERR(onenand->clk_bus)) + clk_disable_unprepare(onenand->clk_bus); return 0; } From patchwork Sat Apr 23 03:46:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 12824408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8A0CC433EF for ; Sat, 23 Apr 2022 03:47:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232601AbiDWDuC (ORCPT ); Fri, 22 Apr 2022 23:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbiDWDtr (ORCPT ); Fri, 22 Apr 2022 23:49:47 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2043.outbound.protection.outlook.com [40.92.47.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4381D13977A; Fri, 22 Apr 2022 20:46:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SFmtbCaZIEnuiPmmNmwGITR1lZMLKCft3uUCaBWw2XVuXWJ0RYvWspUBRGSz2Se2DOW2sGnyYV4kHh3uXwxHIclEt9vnT9ND8hD2BVIR/aMwlObHYEAlyUdH3rmVDGBfVn/E/1DHLnTnmeu58/33D9ZVNBMkxN7AZDbhUFGPzdlGsHNTnUC314FFU/ZL9WjsXPvFQO1X4mmFrIvUW6FyFm0NorGm7dQR24EXOQnGy8Tw+izOHf6TgSOzEh3sLL2GSzfovbVziu7MG5mz6VcgD27llWcCRGSwcoVjsea3F9gen3OJQFjryb0jfczZIn+Gx3H1pTdcvH3XCWaWdAR+Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gRz4KJxx36uXke3/M9dDj+fZyMzrPh775UfAXXXdqLs=; b=JEIpcY9r0MdREHPGbC45BblBA7dO4DCoBM8EZ4f7xZA5DB/98fqFSWgBR5d2JL7hxNcIdd5nM+sc8ScVFYtSsQAsSiaKBMETvUClbw7YoImx37Q3t7BeMYszHzRcL/yYdJKprv1h96af+tdyCsDFET5RwkAYGreFzBqSEHP8lWWmC+uIePojvIUNrCF0QaOrxOHYbd9GP3zGUgjyJgP3pZgFfV1mh7/dJWNZ84zn+GIz2bIf8y8RZ6R2JAj4qHc+pnA8YCYQXhhDZq6EawtyrhYRAGEQLiLjn7j91PqFhyzIxAq9Pe1+PW33qOXD0KHdS/hsrcausW58jX7gb3GDtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) by SN6PR04MB4205.namprd04.prod.outlook.com (2603:10b6:805:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sat, 23 Apr 2022 03:46:48 +0000 Received: from CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5]) by CY4PR04MB0567.namprd04.prod.outlook.com ([fe80::8e:6e22:f98c:29d5%5]) with mapi id 15.20.5186.015; Sat, 23 Apr 2022 03:46:48 +0000 From: Jonathan Bakker To: Miquel Raynal Cc: Kyungmin Park , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Tomasz Figa , =?utf-8?q?Pawe=C5=82_Chmiel?= , Jonathan Bakker Subject: [PATCH 5/5] mtd: onenand: samsung: Add device tree support Date: Fri, 22 Apr 2022 20:46:22 -0700 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220423034622.366696-1-xc-racer2@live.ca> References: <20220423034524.366612-1-xc-racer2@live.ca> <20220423034622.366696-1-xc-racer2@live.ca> X-TMN: [lSK7iLLjEA4qxR34T9AkrmY8T4I/xv1/GtDCGGhtOGPCqTn2DHcGevU28dsWUlY+] X-ClientProxiedBy: MW4PR04CA0210.namprd04.prod.outlook.com (2603:10b6:303:86::35) To CY4PR04MB0567.namprd04.prod.outlook.com (2603:10b6:903:b1::20) X-Microsoft-Original-Message-ID: <20220423034622.366696-4-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2aa12229-2cfd-4497-1fbd-08da24dbe4f9 X-MS-TrafficTypeDiagnostic: SN6PR04MB4205:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vSjq2cDEbz9929l0WJ5DX2V8SSHhDexGbbVKKH8u9EMklwUiL3xKzXvMeaD5OOXRsG1Ry/cCH1amM/NERgDITpBjiTEioZ9rNh+2+1kVdlyqHmxv9RAFM6Ur0nhUvOsiQ3laqzo2G2PSNrmMM3hzB3nvtMqdqXiL17zIWJPYv8MZVmQSSPLSffLAtlXdupSR2jBiYI4hH9c66wIUE7bGfxo4U0iElFvdPp9j4yCn15i7SeyaDjFcWni7cKE7X48QuzVr814gIwQgvdLvJDORRwRMeIZD1H3OFFgxM3EQ2fYhi2g1+rCEEtclyo7FhQuasg3KzYDzozSrNGiAAHDXN1az1G8zP9xfGWgOyrOvBTvY1+OC3dSG9x9fdU9gj0zZlBaueFY/14or6XztAmibdsTLIpNgxNVOMXuaN31kzXQi4taybi0cEzGHN053IZdNel2Ee+AN0K4CSa1dSxe52H7t30rfynG+t4CvVeRZ1sliemW4MKnF/0qgBHron4+oEsKqOFOL/mOl0Z56+bAYqu1p8h9b6wLsqAO4oywRMUfXrwGRC/Hc9UEJkpHu4i+EW3EzwMNZXN+gbWjma+XsJg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?VzKSmEYcFd2DVwYo4P0LViFOUa11?= =?utf-8?q?L6yLU6bsRtrLEiy3BBS5yJmsGoEp5XOXOMnV9eGBM0EfGVZYyIQ2YTaxag+wr022z?= =?utf-8?q?3pNXJlO8/c7SNBx6c6S/DpDFWHmHG47B584+Y1fp3pqSyNyItnPGMkJovHq9VYLOz?= =?utf-8?q?77AYkojLg1B48In1bVFYjdZBAsC+TUSDYqSjiRjB2MHIYyZB267jrs84q41U59ELX?= =?utf-8?q?n4mrPTKKrXEyZjx+2GCE0qEio1lntlIeYxfRfnBu88E619dtB+/GlCg693TzMmCkT?= =?utf-8?q?sWJChBkENoB0s9O1CXamH+FCtTxxIltMKT8IZoV6QH95VOs0ZvR8gUEmshFy5xzRp?= =?utf-8?q?ErsCv+woMJ5i1FSbfkCnrU8+3zUpJWxdhH8KafzZ0ZoU1h3h2xxLh4UG/71uyNkr5?= =?utf-8?q?m393SwY0fyN+VbIKXp4GG73h4slCfz6uXGACZ1JZwoH6ESBW331p/h769WlTghrjN?= =?utf-8?q?mlSCM5osdUq5uciumiPujtNKrhF/FxqWw1p26+22Okrl3fpyiJX+KCfFFYyrCZKh7?= =?utf-8?q?u9EViOJDubh+9KEZbZ1L4Mn9c5B+pLcqYXOLgggZSrP+jDRk/zQDZdqdWzRt3IHLa?= =?utf-8?q?73rmLOtc5lYaVNaY+SXQR8IQS8NaybNhoiUReviUSqbIPbsYv4/9Le2Oz3KkfVVfa?= =?utf-8?q?NYheVkjeUv0VnycIORZsBqLLaFffg6pQzeCQtFf89tRLmE0VbgUFsWehnmhsj9XIt?= =?utf-8?q?2nWZcANm+Le68lwLzwDwIWZhlyTuEvP8tHoHXO5NjhONp2qH0eL61J2TSosEERS8m?= =?utf-8?q?7cKs8FepGZWKzbxKF33Es/rBt+QnnC7zOhYO3SJUo84pINcukKEyft7as2zWFRxdQ?= =?utf-8?q?sl8JrNTMuODESiV/lI7oPhzUUBIGTyS1rBoG58V6Nv5aK2sJ8wOM4PxXftZeq8bmH?= =?utf-8?q?KFEYBFlS3hTRtWk7/ibS9aScpltOT2DPfYN8Q8CEsbph7e4dWXKNcacIcQXff1S40?= =?utf-8?q?VxSZqiCrirgN0SxfWNSH1ueuvvE/JAUQxUFeilsgzT3wbYNPaT15Sqq7OUIblqhvy?= =?utf-8?q?SaZdQpJZsS2hcIQMahIzsalWGZfs7dI7TqZGi5StPjxRF/nQQ1Exp8m+oX1AvMPUx?= =?utf-8?q?OMH+azN2VnPBix+7N4LiwGmhB5zHmto5oHthSXI/L4Z5ZIWCHJ/ch4DFqGXFR7pTz?= =?utf-8?q?bDpZBHZfQMwUWajgubfwshjFYpqdr/oqdusLODGKVQRivuYa/TfONKQ2Ha3uJAf2N?= =?utf-8?q?o8aM+P7fH6NSXeEpj3mxUV1bn+PdV6lWgc/DWyI394pSRITOJFp21Y/WK9WyGWC8j?= =?utf-8?q?vkI/R8T4RVpRm1rAslq0pcSlFLLJ9uGftVi484j9UiR9LwCJBEXqX4eJcz483ZZe9?= =?utf-8?q?5zY7Vj9o3jshr76CGUJ5zBcxFHX1GxBhJPAbcErmvmQs4at6OGmoErX7/rXoeadeS?= =?utf-8?q?Y5n6JenehEuFVAxvuh1tG7Fk8OHqVjnUHKka+W+7hVeFRYHbKVgDF33tU=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-edb50.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 2aa12229-2cfd-4497-1fbd-08da24dbe4f9 X-MS-Exchange-CrossTenant-AuthSource: CY4PR04MB0567.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2022 03:46:48.8065 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR04MB4205 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Tomasz Figa This patch adds support for instantation using Device Tree. Signed-off-by: Tomasz Figa Signed-off-by: Paweł Chmiel Signed-off-by: Jonathan Bakker --- Changes from previous patchset - Adjust to having a nand child node as per binding feedback --- drivers/mtd/nand/onenand/onenand_samsung.c | 67 +++++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/onenand/onenand_samsung.c b/drivers/mtd/nand/onenand/onenand_samsung.c index 62014f8d27b6..0108c8c75d5b 100644 --- a/drivers/mtd/nand/onenand/onenand_samsung.c +++ b/drivers/mtd/nand/onenand/onenand_samsung.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "samsung.h" @@ -832,8 +833,36 @@ static void s3c_onenand_setup(struct mtd_info *mtd) this->write_bufferram = onenand_write_bufferram; } +#ifdef CONFIG_OF +static const struct of_device_id s3c_onenand_of_match[] = { + { .compatible = "samsung,s3c6400-onenand", + .data = (void *)TYPE_S3C6400 }, + { .compatible = "samsung,s3c6410-onenand", + .data = (void *)TYPE_S3C6410 }, + { .compatible = "samsung,s5pv210-onenand", + .data = (void *)TYPE_S5PC110 }, + {}, +}; +MODULE_DEVICE_TABLE(of, onenand_s3c_dt_match); +#endif + +static enum soc_type s3c_onenand_get_device_id(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + + if (IS_ENABLED(CONFIG_OF) && np) { + const struct of_device_id *match; + + match = of_match_node(s3c_onenand_of_match, np); + return (enum soc_type)match->data; + } + + return platform_get_device_id(pdev)->driver_data; +} + static int s3c_onenand_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; struct onenand_platform_data *pdata; struct onenand_chip *this; struct mtd_info *mtd; @@ -856,9 +885,10 @@ static int s3c_onenand_probe(struct platform_device *pdev) this = (struct onenand_chip *) &mtd[1]; mtd->name = dev_name(&pdev->dev); mtd->priv = this; + mtd->dev.of_node = np; mtd->dev.parent = &pdev->dev; onenand->pdev = pdev; - onenand->type = platform_get_device_id(pdev)->driver_data; + onenand->type = s3c_onenand_get_device_id(pdev); s3c_onenand_setup(mtd); @@ -867,7 +897,35 @@ static int s3c_onenand_probe(struct platform_device *pdev) if (IS_ERR(onenand->ctrl_base)) return PTR_ERR(onenand->ctrl_base); - r = platform_get_resource(pdev, IORESOURCE_MEM, 1); + if (np) { + /* Determine which CS to use - this driver only supports one */ + u32 cs = 0; + struct device_node *child_np; + struct device_node *extra_chip_np; + + child_np = of_get_next_available_child(np, NULL); + if (child_np == NULL) { + dev_err(&pdev->dev, "failed to get chip node\n"); + return -EINVAL; + } + + /* Warn if more than one chip as this unsupported */ + extra_chip_np = of_get_next_available_child(np, child_np); + if (extra_chip_np != NULL) { + dev_warn(&pdev->dev, "multiple chip nodes, using only first\n"); + of_node_put(extra_chip_np); + } + + err = of_property_read_u32(child_np, "reg", &cs); + of_node_put(child_np); + if (err < 0) + return err; + + r = platform_get_resource(pdev, IORESOURCE_MEM, cs + 1); + } else { + r = platform_get_resource(pdev, IORESOURCE_MEM, 1); + } + onenand->chip_base = devm_ioremap_resource(&pdev->dev, r); if (IS_ERR(onenand->chip_base)) return PTR_ERR(onenand->chip_base); @@ -917,6 +975,10 @@ static int s3c_onenand_probe(struct platform_device *pdev) } onenand->clk_bus = devm_clk_get(&pdev->dev, "bus"); + if (np && IS_ERR(onenand->clk_bus)) { + dev_err(&pdev->dev, "failed to get bus clock\n"); + return PTR_ERR(onenand->clk_bus); + } if (!IS_ERR(onenand->clk_bus)) clk_prepare_enable(onenand->clk_bus); @@ -998,6 +1060,7 @@ static struct platform_driver s3c_onenand_driver = { .driver = { .name = "samsung-onenand", .pm = &s3c_pm_ops, + .of_match_table = of_match_ptr(s3c_onenand_of_match), }, .id_table = s3c_onenand_driver_ids, .probe = s3c_onenand_probe,