Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp856300rdb; Mon, 29 Jan 2024 23:57:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOKjKaRNAPcwlWo7gjZSiBL3x/N/x2uiOaG65gX1yCQGpkOqGXwq2rPJYQsPkPGCVJi420 X-Received: by 2002:aa7:d619:0:b0:55f:6b8:b2f7 with SMTP id c25-20020aa7d619000000b0055f06b8b2f7mr2721242edr.8.1706601435085; Mon, 29 Jan 2024 23:57:15 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s19-20020a50ab13000000b0055f46b71142si238048edc.20.2024.01.29.23.57.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 23:57:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jabtirok; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-44079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 460541F2237D for ; Tue, 30 Jan 2024 07:56:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E70C954730; Tue, 30 Jan 2024 07:56:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jabtirok" Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DBBF53E29 for ; Tue, 30 Jan 2024 07:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706601367; cv=none; b=aEuxO6NtAmYaDSS11x9pbrfmPXmhQjyj8CcyVh9lywN1U3q2bnQ+5pjGoZecdPR1uG7ad6FNzGdLagxlmyTT2IpHLitJBdfQGThSB/TOcWnPKq+pc1x1CK5H5FDMwzFjhDfulLfrPjp4y6ewVh1HlTar/uP1A/E1zQFvr2MdhqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706601367; c=relaxed/simple; bh=wHR2CwdXVam+dMxen82xzir/2gKlgyfk9KNbt22I+O0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NUNXJK2RzEsAJ80h4+Ph+/RrcyPXW8Go3KM8xKgaQdze/+8a84Y5yOOOaAmzOhmnfZc/P46AFVuH9UHffIaV8TkVZ78cypZFhveFhnIiQFAd4vv+JHv04FUufHnZecmuH2sQNUFUCyL9l2zyOPoQQWvjrzH/XvjwR2+T6ww8iig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jabtirok; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-556c3f0d6c5so3705147a12.2 for ; Mon, 29 Jan 2024 23:56:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706601363; x=1707206163; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ngybv8O9iGjxqt6rcpROCs4pkncSLIQiKAAur4B+yfo=; b=jabtirokNvFgtX1HOVMrgGHwJH+0S7lxe9NZTn1DjRFO4gecjR3R2pZSYoHJPloYNU CdyGlgaPWP6eqQ4sRNSrfysD3OA3RR9pvA3GAbuq1yC9+da4/ZNImwEozpXd1wjaHEpV WdLyCrJmy4bn6tyngxgS0DTuVv6GhyoeRuSJ4DwVTWBdmjRAKWq8/RLuik5nflLPXUuB llEpwZetew2YJ0YlsgTYTdvMpciTxFH7tW5OqYVkSY1slDkskcJUQEQqGcNhxLDFimZs S4dg3urJafwTRY4jbxLaTFLlanzNYTv1kLRHI9Sy2//51chJ/ZT1iUWxgae7UmiAM5+x zTGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706601363; x=1707206163; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ngybv8O9iGjxqt6rcpROCs4pkncSLIQiKAAur4B+yfo=; b=PpBQZqPQt10VAUJHU5qxymZClu8C1XVgrip5SCqrTTmRqc4egCvvo2Q0bJOJluBxLz 4XB/yKBmuFtHzfvYgzjpwiKHGE9qgDAPgPllel7HIU0DTID5hatChL1kwtwesgFL1v4r g/epGE8RMj+imigZ8JwpR64EutAaypbMkwO+4LxUevbErY8niCWAIjrRtkFUjFBA6jHO qMjSKIHOYHGQ0qduh9MGAScEM7FcGdp4d/CmsnMPmKj5Rb4i0vpq2l7Smj+b6Zc+kpfV S7avlmz/+Vlh44Ptk8+ZjthXEgzfeE7xrnqQ8AVQbyTJiqFRl8+jmMrZHuZnuzNicgjK suiA== X-Gm-Message-State: AOJu0YyqQzYLnR+Klo+0kx3dvl9sIgyf4nRNcufl4e1CbefzfQgCQUaZ 80+XB3lmgXKNAzpmJ87Nx0pHQKqaYPpE9Euj8hRsWXvxcsnUgJQ4D77aDt4znyA= X-Received: by 2002:a05:6402:17ce:b0:55f:1ae8:2f1d with SMTP id s14-20020a05640217ce00b0055f1ae82f1dmr2044451edy.11.1706601363429; Mon, 29 Jan 2024 23:56:03 -0800 (PST) Received: from [192.168.1.20] ([178.197.222.62]) by smtp.gmail.com with ESMTPSA id d15-20020a056402000f00b0055f1af929c2sm1205360edu.28.2024.01.29.23.56.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 23:56:03 -0800 (PST) Message-ID: <4c6a7898-d300-468c-9e2f-13f639ca4407@linaro.org> Date: Tue, 30 Jan 2024 08:56:01 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] fpga: xilinx-selectmap: add new driver Content-Language: en-US To: Charles Perry , mdf@kernel.org Cc: hao.wu@intel.com, yilun.xu@intel.com, trix@redhat.com, krzysztof.kozlowski+dt@linaro.org, bcody@markem-imaje.com, avandiver@markem-imaje.com, linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240129225602.3832449-1-charles.perry@savoirfairelinux.com> <20240129225602.3832449-3-charles.perry@savoirfairelinux.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZ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PMGZ2rZ6zITrMip+12jgw4mGjy 5y06JZvA02rZT2k9aa7i9dUUFggaanI09jNGbRA/ABEBAAHCwXwEGAEKACYCGwwWIQSb0H4O DFH41ZZ3t1Qbk0N9O0FimwUCYDzvagUJFF+UtgAKCRAbk0N9O0Fim9JzD/0auoGtUu4mgnna oEEpQEOjgT7l9TVuO3Qa/SeH+E0m55y5Fjpp6ZToc481za3xAcxK/BtIX5Wn1mQ6+szfrJQ6 59y2io437BeuWIRjQniSxHz1kgtFECiV30yHRgOoQlzUea7FgsnuWdstgfWi6LxstswEzxLZ Sj1EqpXYZE4uLjh6dW292sO+j4LEqPYr53hyV4I2LPmptPE9Rb9yCTAbSUlzgjiyyjuXhcwM qf3lzsm02y7Ooq+ERVKiJzlvLd9tSe4jRx6Z6LMXhB21fa5DGs/tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240129225602.3832449-3-charles.perry@savoirfairelinux.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 29/01/2024 23:56, Charles Perry wrote: > Xilinx 7 series FPGA can be programmed using a slave parallel port named > the SelectMAP interface in the datasheet. This slave interface is > compatible with the i.MX6 EIM bus controller but other types of external > memory mapped parallel bus might work. > > xilinx-selectmap currently only supports the x8 mode where data is loaded > at one byte per rising edge of the clock, with the MSb of each byte > presented to the D0 pin. > > The following DT fragment shows a valid configuration on a custom i.MX6 > board (pinctrl not shown for readability): > > &weim { > status = "okay"; > ranges = <0 0 0x08000000 0x04000000>; > > fpga_mgr: fpga_programmer@0,0 { > compatible = "xlnx,fpga-slave-selectmap"; > reg = <0 0 0x4000000>; > fsl,weim-cs-timing = <0x00070031 0x00000142 > 0x00020000 0x00000000 > 0x0c000645 0x00000000>; > prog_b-gpios = <&gpio5 5 GPIO_ACTIVE_LOW>; > init-b-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>; > done-gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>; > csi-b-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; > rdwr-b-gpios = <&gpio3 10 GPIO_ACTIVE_LOW>; > }; > }; Drop that example. First, it is not correct. Second, a correct one in bindings is enough. > > Signed-off-by: Charles Perry > --- .. > +static int xilinx_selectmap_probe(struct platform_device *pdev) > +{ > + struct xilinx_selectmap_conf *conf; > + struct resource *r; > + void __iomem *base; > + > + conf = devm_kzalloc(&pdev->dev, sizeof(*conf), GFP_KERNEL); > + if (!conf) > + return -ENOMEM; > + > + base = devm_platform_get_and_ioremap_resource(pdev, 0, &r); > + if (IS_ERR(base)) > + return dev_err_probe(&pdev->dev, PTR_ERR(base), "ioremap error\n"); > + conf->base = base; > + > + /* CSI_B is active low */ > + conf->csi_b = devm_gpiod_get_optional(&pdev->dev, "csi-b", GPIOD_OUT_HIGH); > + if (IS_ERR(conf->csi_b)) > + return dev_err_probe(&pdev->dev, PTR_ERR(conf->csi_b), > + "Failed to get CSI_B gpio\n"); > + > + /* RDWR_B is active low */ > + conf->rdwr_b = devm_gpiod_get_optional(&pdev->dev, "rdwr-b", GPIOD_OUT_HIGH); > + if (IS_ERR(conf->rdwr_b)) > + return dev_err_probe(&pdev->dev, PTR_ERR(conf->rdwr_b), > + "Failed to get RDWR_B gpio\n"); > + > + return xilinx_core_probe(&conf->core, &pdev->dev, > + xilinx_selectmap_write, > + xilinx_selectmap_apply_padding); Totally messed indentation. Please run scripts/checkpatch.pl and fix reported warnings. Some warnings can be ignored, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear. > +} > + > +static const struct of_device_id xlnx_selectmap_of_match[] = { > + { .compatible = "xlnx,fpga-slave-selectmap", }, > + {} > +}; > +MODULE_DEVICE_TABLE(of, xlnx_selectmap_of_match); > + > +static struct platform_driver xilinx_slave_selectmap_driver = { > + .driver = { > + .name = "xilinx-slave-selectmap", > + .of_match_table = of_match_ptr(xlnx_selectmap_of_match), Drop of_match_ptr, it leads to warnings. > + }, > + .probe = xilinx_selectmap_probe, > +}; Best regards, Krzysztof