Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2619172rda; Wed, 25 Oct 2023 07:52:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAtE+I0ABVZad/ASgd05oOkJhg0EqwccYdUa5ZTF6VpCkQASWyXMjkEy+BfrJTO4YakcaA X-Received: by 2002:a25:2fd3:0:b0:d91:6d2e:6f17 with SMTP id v202-20020a252fd3000000b00d916d2e6f17mr15272704ybv.54.1698245532750; Wed, 25 Oct 2023 07:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698245532; cv=none; d=google.com; s=arc-20160816; b=VrJTg6pfdyB3SDu7zCxxKapqTWQTS1jJJrJvZAQ2oSCFJufaQvqDUX2WW+OTITi6iN 15LdUfxyDVfHLfMjG64McNFjRZUVYJZjJaw5utTcB182bq95sZsSktGLDIz47T5xthsT H1NgHyeUYVooPZ//ncHKIefpYDvSA06GNyn6e6hoXrkCS+WdVwUKh8GyWgGDRdvizA4S rX+u9ePzqyxrF8brlE3MD3PInM20LvAi8fuDqfXj19K2QCmBwpbNFXGVoiDHomTroLuq UJ5+cy8RczqXenapzaJKln1QdgdqJXN9TFTKM3QtF4IPHGppqI7SX+9zmGUjIJ7GwuZ8 3jWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gVv9JrT5b0QNn9eojrfqiiwtXM8fy36evknIDkduqcU=; fh=UZvOXHsEvTCyWTYhEg+xBB9+09e4W6W2NV88vxfo2B8=; b=f5EJ5Jtuv9COjfNgaH4tc642fWAdTUh3e4t4asmLzni2nNk7OyQLragUg+2Uq4tbRr 72QzPMDOwUJGEZEHVc1QPhq4+rjDQYr6Govg1drLP8vt//204QRX9aruiGrbFJyCX1CY +kbbpnJiXqHDD7WHCH5qXohJsYroIx9iBQW3g52V+FFlDQXdXc9hhMlZF5F9qBwxnYfo Nt8jrLB0hKo6/rOlfUzjQ5+LYr0fZr/i1R4KNTJB60REbr26a/aPOPYulvUc30wTtatT vjUDYA27pZw7hM7QqorUu+smX6xZ9w+AjYPPHJjuS2kknKo1eWONzdX602e8cRMURMQr G1aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 204-20020a2501d5000000b00d9a49bb5ce6si10890999ybb.598.2023.10.25.07.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:52:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2D7E48074040; Wed, 25 Oct 2023 07:52:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344192AbjJYOvV (ORCPT + 99 others); Wed, 25 Oct 2023 10:51:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344379AbjJYOvT (ORCPT ); Wed, 25 Oct 2023 10:51:19 -0400 Received: from mx.gpxsee.org (mx.gpxsee.org [37.205.14.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7771137; Wed, 25 Oct 2023 07:51:15 -0700 (PDT) Received: from mgb4.digiteq.red (unknown [62.77.71.229]) by mx.gpxsee.org (Postfix) with ESMTPSA id A855956681; Wed, 25 Oct 2023 16:51:13 +0200 (CEST) From: tumic@gpxsee.org To: Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20T=C5=AFma?= Subject: [PATCH] media: mgb4: Added support for T200 card variant Date: Wed, 25 Oct 2023 18:51:47 +0200 Message-Id: <20231025165147.1316-1-tumic@gpxsee.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 25 Oct 2023 07:52:05 -0700 (PDT) From: Martin Tůma T200 card variants use the XC7A200T FPGA instead of XC7A100T. The SPI FLASH memory layout is different as the FPGA requires bigger FW images. Signed-off-by: Martin Tůma --- drivers/media/pci/mgb4/mgb4_core.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c index 3efb33fbf40c..5bfb8a06202e 100644 --- a/drivers/media/pci/mgb4/mgb4_core.c +++ b/drivers/media/pci/mgb4/mgb4_core.c @@ -42,6 +42,10 @@ #define MGB4_USER_IRQS 16 +#define DIGITEQ_VID 0x1ed8 +#define T100_DID 0x0101 +#define T200_DID 0x0201 + ATTRIBUTE_GROUPS(mgb4_pci); static int flashid; @@ -151,7 +155,7 @@ static struct spi_master *get_spi_adap(struct platform_device *pdev) return dev ? container_of(dev, struct spi_master, dev) : NULL; } -static int init_spi(struct mgb4_dev *mgbdev) +static int init_spi(struct mgb4_dev *mgbdev, u32 devid) { struct resource spi_resources[] = { { @@ -213,8 +217,13 @@ static int init_spi(struct mgb4_dev *mgbdev) snprintf(mgbdev->fw_part_name, sizeof(mgbdev->fw_part_name), "mgb4-fw.%d", flashid); mgbdev->partitions[0].name = mgbdev->fw_part_name; - mgbdev->partitions[0].size = 0x400000; - mgbdev->partitions[0].offset = 0x400000; + if (devid == T200_DID) { + mgbdev->partitions[0].size = 0x950000; + mgbdev->partitions[0].offset = 0x1000000; + } else { + mgbdev->partitions[0].size = 0x400000; + mgbdev->partitions[0].offset = 0x400000; + } mgbdev->partitions[0].mask_flags = 0; snprintf(mgbdev->data_part_name, sizeof(mgbdev->data_part_name), @@ -551,7 +560,7 @@ static int mgb4_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err_video_regs; /* SPI FLASH */ - rv = init_spi(mgbdev); + rv = init_spi(mgbdev, id->device); if (rv < 0) goto err_cmt_regs; @@ -666,7 +675,8 @@ static void mgb4_remove(struct pci_dev *pdev) } static const struct pci_device_id mgb4_pci_ids[] = { - { PCI_DEVICE(0x1ed8, 0x0101), }, + { PCI_DEVICE(DIGITEQ_VID, T100_DID), }, + { PCI_DEVICE(DIGITEQ_VID, T200_DID), }, { 0, } }; MODULE_DEVICE_TABLE(pci, mgb4_pci_ids); base-commit: 19e67e01eb1e84f3529770d084b93f16a4894c42 -- 2.40.1