Lines Matching +full:i2c +full:- +full:ocores
1 // SPDX-License-Identifier: GPL-2.0-only
20 #include <linux/i2c.h>
21 #include <linux/platform_data/i2c-ocores.h>
22 #include <linux/platform_data/i2c-xiic.h>
50 /*--------------------------------------------------------------------------*/
53 PROPERTY_ENTRY_U32("ti,x-plate-ohms", 100),
371 .name = "timb-dma",
378 .name = "timb-uart",
383 .name = "xiic-i2c",
390 .name = "timb-gpio",
397 .name = "timb-video",
404 .name = "timb-radio",
428 .name = "timb-dma",
435 .name = "timb-uart",
445 .name = "xiic-i2c",
452 .name = "timb-gpio",
459 .name = "timb-mlogicore",
464 .name = "timb-video",
471 .name = "timb-radio",
495 .name = "timb-dma",
502 .name = "timb-uart",
507 .name = "xiic-i2c",
514 .name = "timb-gpio",
521 .name = "timb-video",
528 .name = "timb-radio",
545 .name = "timb-dma",
552 .name = "timb-uart",
557 .name = "ocores-i2c",
564 .name = "timb-gpio",
571 .name = "timb-video",
578 .name = "timb-radio",
635 return sprintf(buf, "%d.%d.%d\n", priv->fw.major, priv->fw.minor, in fw_ver_show()
636 priv->fw.config); in fw_ver_show()
641 /*--------------------------------------------------------------------------*/
654 return -ENOMEM; in timb_probe()
664 dev_err(&dev->dev, "No resource\n"); in timb_probe()
669 priv->ctl_mapbase = mapbase + CHIPCTLOFFSET; in timb_probe()
670 if (!request_mem_region(priv->ctl_mapbase, CHIPCTLSIZE, "timb-ctl")) { in timb_probe()
671 dev_err(&dev->dev, "Failed to request ctl mem\n"); in timb_probe()
675 priv->ctl_membase = ioremap(priv->ctl_mapbase, CHIPCTLSIZE); in timb_probe()
676 if (!priv->ctl_membase) { in timb_probe()
677 dev_err(&dev->dev, "ioremap failed for ctl mem\n"); in timb_probe()
682 priv->fw.major = ioread32(priv->ctl_membase + TIMB_REV_MAJOR); in timb_probe()
683 priv->fw.minor = ioread32(priv->ctl_membase + TIMB_REV_MINOR); in timb_probe()
684 priv->fw.config = ioread32(priv->ctl_membase + TIMB_HW_CONFIG); in timb_probe()
686 if (priv->fw.major > TIMB_SUPPORTED_MAJOR) { in timb_probe()
687 dev_err(&dev->dev, "The driver supports an older " in timb_probe()
689 "support %d.%d\n", priv->fw.major, priv->fw.minor); in timb_probe()
692 if (priv->fw.major < TIMB_SUPPORTED_MAJOR || in timb_probe()
693 priv->fw.minor < TIMB_REQUIRED_MINOR) { in timb_probe()
694 dev_err(&dev->dev, "The FPGA image is too old (%d.%d), " in timb_probe()
696 priv->fw.major, priv->fw.minor, in timb_probe()
711 dev_err(&dev->dev, in timb_probe()
712 "MSI-X init failed: %d, expected entries: %d\n", in timb_probe()
717 err = device_create_file(&dev->dev, &dev_attr_fw_ver); in timb_probe()
722 iowrite32(0x1, priv->ctl_membase + TIMB_SW_RST); in timb_probe()
724 /* update IRQ offsets in I2C board info */ in timb_probe()
730 if (priv->fw.config & TIMB_HW_CONFIG_SPI_8BIT) { in timb_probe()
744 ip_setup = priv->fw.config & TIMB_HW_VER_MASK; in timb_probe()
747 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
750 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
753 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
756 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
759 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
762 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
765 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
768 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
771 dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n", in timb_probe()
772 priv->fw.major, priv->fw.minor, ip_setup); in timb_probe()
777 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
781 err = mfd_add_devices(&dev->dev, 0, in timb_probe()
783 &dev->resource[1], msix_entries[0].vector, NULL); in timb_probe()
785 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
790 if (((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER0) || in timb_probe()
791 ((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER3)) { in timb_probe()
792 err = mfd_add_devices(&dev->dev, 1, timberdale_cells_bar2, in timb_probe()
794 &dev->resource[2], msix_entries[0].vector, NULL); in timb_probe()
796 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
803 dev_info(&dev->dev, in timb_probe()
805 priv->fw.major, priv->fw.minor, priv->fw.config); in timb_probe()
810 mfd_remove_devices(&dev->dev); in timb_probe()
812 device_remove_file(&dev->dev, &dev_attr_fw_ver); in timb_probe()
818 iounmap(priv->ctl_membase); in timb_probe()
820 release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE); in timb_probe()
825 return -ENODEV; in timb_probe()
832 mfd_remove_devices(&dev->dev); in timb_remove()
834 device_remove_file(&dev->dev, &dev_attr_fw_ver); in timb_remove()
836 iounmap(priv->ctl_membase); in timb_remove()
837 release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE); in timb_remove()
859 MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");