From nobody Wed Dec 17 11:25:26 2025 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 355A9C25B71 for ; Wed, 25 Oct 2023 14:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344417AbjJYOvW (ORCPT ); Wed, 25 Oct 2023 10:51:22 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin T=C5=AFma 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=C5=AFma --- 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/mg= b4_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 @@ =20 #define MGB4_USER_IRQS 16 =20 +#define DIGITEQ_VID 0x1ed8 +#define T100_DID 0x0101 +#define T200_DID 0x0201 + ATTRIBUTE_GROUPS(mgb4_pci); =20 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; } =20 -static int init_spi(struct mgb4_dev *mgbdev) +static int init_spi(struct mgb4_dev *mgbdev, u32 devid) { struct resource spi_resources[] =3D { { @@ -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 =3D mgbdev->fw_part_name; - mgbdev->partitions[0].size =3D 0x400000; - mgbdev->partitions[0].offset =3D 0x400000; + if (devid =3D=3D T200_DID) { + mgbdev->partitions[0].size =3D 0x950000; + mgbdev->partitions[0].offset =3D 0x1000000; + } else { + mgbdev->partitions[0].size =3D 0x400000; + mgbdev->partitions[0].offset =3D 0x400000; + } mgbdev->partitions[0].mask_flags =3D 0; =20 snprintf(mgbdev->data_part_name, sizeof(mgbdev->data_part_name), @@ -551,7 +560,7 @@ static int mgb4_probe(struct pci_dev *pdev, const struc= t pci_device_id *id) goto err_video_regs; =20 /* SPI FLASH */ - rv =3D init_spi(mgbdev); + rv =3D init_spi(mgbdev, id->device); if (rv < 0) goto err_cmt_regs; =20 @@ -666,7 +675,8 @@ static void mgb4_remove(struct pci_dev *pdev) } =20 static const struct pci_device_id mgb4_pci_ids[] =3D { - { 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 --=20 2.40.1