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>
51 /*--------------------------------------------------------------------------*/
367 .name = "timb-dma",
374 .name = "timb-uart",
379 .name = "xiic-i2c",
386 .name = "timb-gpio",
393 .name = "timb-video",
400 .name = "timb-radio",
424 .name = "timb-dma",
431 .name = "timb-uart",
441 .name = "xiic-i2c",
448 .name = "timb-gpio",
455 .name = "timb-mlogicore",
460 .name = "timb-video",
467 .name = "timb-radio",
491 .name = "timb-dma",
498 .name = "timb-uart",
503 .name = "xiic-i2c",
510 .name = "timb-gpio",
517 .name = "timb-video",
524 .name = "timb-radio",
541 .name = "timb-dma",
548 .name = "timb-uart",
553 .name = "ocores-i2c",
560 .name = "timb-gpio",
567 .name = "timb-video",
574 .name = "timb-radio",
631 return sprintf(buf, "%d.%d.%d\n", priv->fw.major, priv->fw.minor, in fw_ver_show()
632 priv->fw.config); in fw_ver_show()
637 /*--------------------------------------------------------------------------*/
650 return -ENOMEM; in timb_probe()
660 dev_err(&dev->dev, "No resource\n"); in timb_probe()
665 priv->ctl_mapbase = mapbase + CHIPCTLOFFSET; in timb_probe()
666 if (!request_mem_region(priv->ctl_mapbase, CHIPCTLSIZE, "timb-ctl")) { in timb_probe()
667 dev_err(&dev->dev, "Failed to request ctl mem\n"); in timb_probe()
671 priv->ctl_membase = ioremap(priv->ctl_mapbase, CHIPCTLSIZE); in timb_probe()
672 if (!priv->ctl_membase) { in timb_probe()
673 dev_err(&dev->dev, "ioremap failed for ctl mem\n"); in timb_probe()
678 priv->fw.major = ioread32(priv->ctl_membase + TIMB_REV_MAJOR); in timb_probe()
679 priv->fw.minor = ioread32(priv->ctl_membase + TIMB_REV_MINOR); in timb_probe()
680 priv->fw.config = ioread32(priv->ctl_membase + TIMB_HW_CONFIG); in timb_probe()
682 if (priv->fw.major > TIMB_SUPPORTED_MAJOR) { in timb_probe()
683 dev_err(&dev->dev, "The driver supports an older " in timb_probe()
685 "support %d.%d\n", priv->fw.major, priv->fw.minor); in timb_probe()
688 if (priv->fw.major < TIMB_SUPPORTED_MAJOR || in timb_probe()
689 priv->fw.minor < TIMB_REQUIRED_MINOR) { in timb_probe()
690 dev_err(&dev->dev, "The FPGA image is too old (%d.%d), " in timb_probe()
692 priv->fw.major, priv->fw.minor, in timb_probe()
707 dev_err(&dev->dev, in timb_probe()
708 "MSI-X init failed: %d, expected entries: %d\n", in timb_probe()
713 err = device_create_file(&dev->dev, &dev_attr_fw_ver); in timb_probe()
718 iowrite32(0x1, priv->ctl_membase + TIMB_SW_RST); in timb_probe()
720 /* update IRQ offsets in I2C board info */ in timb_probe()
726 if (priv->fw.config & TIMB_HW_CONFIG_SPI_8BIT) { in timb_probe()
740 ip_setup = priv->fw.config & TIMB_HW_VER_MASK; in timb_probe()
743 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
746 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
749 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
752 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
755 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
758 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
761 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
764 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
767 dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n", in timb_probe()
768 priv->fw.major, priv->fw.minor, ip_setup); in timb_probe()
769 err = -ENODEV; in timb_probe()
774 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
778 err = mfd_add_devices(&dev->dev, 0, in timb_probe()
780 &dev->resource[1], msix_entries[0].vector, NULL); in timb_probe()
782 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
787 if (((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER0) || in timb_probe()
788 ((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER3)) { in timb_probe()
789 err = mfd_add_devices(&dev->dev, 1, timberdale_cells_bar2, in timb_probe()
791 &dev->resource[2], msix_entries[0].vector, NULL); in timb_probe()
793 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
800 dev_info(&dev->dev, in timb_probe()
802 priv->fw.major, priv->fw.minor, priv->fw.config); in timb_probe()
807 mfd_remove_devices(&dev->dev); in timb_probe()
809 device_remove_file(&dev->dev, &dev_attr_fw_ver); in timb_probe()
815 iounmap(priv->ctl_membase); in timb_probe()
817 release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE); in timb_probe()
822 return -ENODEV; in timb_probe()
829 mfd_remove_devices(&dev->dev); in timb_remove()
831 device_remove_file(&dev->dev, &dev_attr_fw_ver); in timb_remove()
833 iounmap(priv->ctl_membase); in timb_remove()
834 release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE); in timb_remove()
856 MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");