Skip to content

Commit 9ea7be9

Browse files
tumicdqHans Verkuil
authored andcommitted
media: mgb4: Added support for T200 card variant
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 <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent b85ea95 commit 9ea7be9

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

drivers/media/pci/mgb4/mgb4_core.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242

4343
#define MGB4_USER_IRQS 16
4444

45+
#define DIGITEQ_VID 0x1ed8
46+
#define T100_DID 0x0101
47+
#define T200_DID 0x0201
48+
4549
ATTRIBUTE_GROUPS(mgb4_pci);
4650

4751
static int flashid;
@@ -151,7 +155,7 @@ static struct spi_master *get_spi_adap(struct platform_device *pdev)
151155
return dev ? container_of(dev, struct spi_master, dev) : NULL;
152156
}
153157

154-
static int init_spi(struct mgb4_dev *mgbdev)
158+
static int init_spi(struct mgb4_dev *mgbdev, u32 devid)
155159
{
156160
struct resource spi_resources[] = {
157161
{
@@ -213,8 +217,13 @@ static int init_spi(struct mgb4_dev *mgbdev)
213217
snprintf(mgbdev->fw_part_name, sizeof(mgbdev->fw_part_name),
214218
"mgb4-fw.%d", flashid);
215219
mgbdev->partitions[0].name = mgbdev->fw_part_name;
216-
mgbdev->partitions[0].size = 0x400000;
217-
mgbdev->partitions[0].offset = 0x400000;
220+
if (devid == T200_DID) {
221+
mgbdev->partitions[0].size = 0x950000;
222+
mgbdev->partitions[0].offset = 0x1000000;
223+
} else {
224+
mgbdev->partitions[0].size = 0x400000;
225+
mgbdev->partitions[0].offset = 0x400000;
226+
}
218227
mgbdev->partitions[0].mask_flags = 0;
219228

220229
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)
551560
goto err_video_regs;
552561

553562
/* SPI FLASH */
554-
rv = init_spi(mgbdev);
563+
rv = init_spi(mgbdev, id->device);
555564
if (rv < 0)
556565
goto err_cmt_regs;
557566

@@ -666,7 +675,8 @@ static void mgb4_remove(struct pci_dev *pdev)
666675
}
667676

668677
static const struct pci_device_id mgb4_pci_ids[] = {
669-
{ PCI_DEVICE(0x1ed8, 0x0101), },
678+
{ PCI_DEVICE(DIGITEQ_VID, T100_DID), },
679+
{ PCI_DEVICE(DIGITEQ_VID, T200_DID), },
670680
{ 0, }
671681
};
672682
MODULE_DEVICE_TABLE(pci, mgb4_pci_ids);

0 commit comments

Comments
 (0)