• Home
  • Raw
  • Download

Lines Matching +full:i2c +full:- +full:ocores

1 // SPDX-License-Identifier: GPL-2.0-only
19 #include <linux/i2c.h>
20 #include <linux/platform_data/i2c-ocores.h>
21 #include <linux/platform_data/i2c-xiic.h>
50 /*--------------------------------------------------------------------------*/
366 .name = "timb-dma",
373 .name = "timb-uart",
378 .name = "xiic-i2c",
385 .name = "timb-gpio",
392 .name = "timb-video",
399 .name = "timb-radio",
423 .name = "timb-dma",
430 .name = "timb-uart",
440 .name = "xiic-i2c",
447 .name = "timb-gpio",
454 .name = "timb-mlogicore",
459 .name = "timb-video",
466 .name = "timb-radio",
490 .name = "timb-dma",
497 .name = "timb-uart",
502 .name = "xiic-i2c",
509 .name = "timb-gpio",
516 .name = "timb-video",
523 .name = "timb-radio",
540 .name = "timb-dma",
547 .name = "timb-uart",
552 .name = "ocores-i2c",
559 .name = "timb-gpio",
566 .name = "timb-video",
573 .name = "timb-radio",
630 return sprintf(buf, "%d.%d.%d\n", priv->fw.major, priv->fw.minor, in fw_ver_show()
631 priv->fw.config); in fw_ver_show()
636 /*--------------------------------------------------------------------------*/
649 return -ENOMEM; in timb_probe()
659 dev_err(&dev->dev, "No resource\n"); in timb_probe()
664 priv->ctl_mapbase = mapbase + CHIPCTLOFFSET; in timb_probe()
665 if (!request_mem_region(priv->ctl_mapbase, CHIPCTLSIZE, "timb-ctl")) { in timb_probe()
666 dev_err(&dev->dev, "Failed to request ctl mem\n"); in timb_probe()
670 priv->ctl_membase = ioremap(priv->ctl_mapbase, CHIPCTLSIZE); in timb_probe()
671 if (!priv->ctl_membase) { in timb_probe()
672 dev_err(&dev->dev, "ioremap failed for ctl mem\n"); in timb_probe()
677 priv->fw.major = ioread32(priv->ctl_membase + TIMB_REV_MAJOR); in timb_probe()
678 priv->fw.minor = ioread32(priv->ctl_membase + TIMB_REV_MINOR); in timb_probe()
679 priv->fw.config = ioread32(priv->ctl_membase + TIMB_HW_CONFIG); in timb_probe()
681 if (priv->fw.major > TIMB_SUPPORTED_MAJOR) { in timb_probe()
682 dev_err(&dev->dev, "The driver supports an older " in timb_probe()
684 "support %d.%d\n", priv->fw.major, priv->fw.minor); in timb_probe()
687 if (priv->fw.major < TIMB_SUPPORTED_MAJOR || in timb_probe()
688 priv->fw.minor < TIMB_REQUIRED_MINOR) { in timb_probe()
689 dev_err(&dev->dev, "The FPGA image is too old (%d.%d), " in timb_probe()
691 priv->fw.major, priv->fw.minor, in timb_probe()
706 dev_err(&dev->dev, in timb_probe()
707 "MSI-X init failed: %d, expected entries: %d\n", in timb_probe()
712 err = device_create_file(&dev->dev, &dev_attr_fw_ver); in timb_probe()
717 iowrite32(0x1, priv->ctl_membase + TIMB_SW_RST); in timb_probe()
719 /* update IRQ offsets in I2C board info */ in timb_probe()
725 if (priv->fw.config & TIMB_HW_CONFIG_SPI_8BIT) { in timb_probe()
739 ip_setup = priv->fw.config & TIMB_HW_VER_MASK; in timb_probe()
742 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
745 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
748 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
751 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
754 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
757 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
760 err = mfd_add_devices(&dev->dev, -1, in timb_probe()
763 &dev->resource[0], msix_entries[0].vector, NULL); in timb_probe()
766 dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n", in timb_probe()
767 priv->fw.major, priv->fw.minor, ip_setup); in timb_probe()
768 err = -ENODEV; in timb_probe()
773 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
777 err = mfd_add_devices(&dev->dev, 0, in timb_probe()
779 &dev->resource[1], msix_entries[0].vector, NULL); in timb_probe()
781 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
786 if (((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER0) || in timb_probe()
787 ((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER3)) { in timb_probe()
788 err = mfd_add_devices(&dev->dev, 1, timberdale_cells_bar2, in timb_probe()
790 &dev->resource[2], msix_entries[0].vector, NULL); in timb_probe()
792 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); in timb_probe()
799 dev_info(&dev->dev, in timb_probe()
801 priv->fw.major, priv->fw.minor, priv->fw.config); in timb_probe()
806 mfd_remove_devices(&dev->dev); in timb_probe()
808 device_remove_file(&dev->dev, &dev_attr_fw_ver); in timb_probe()
814 iounmap(priv->ctl_membase); in timb_probe()
816 release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE); in timb_probe()
821 return -ENODEV; in timb_probe()
828 mfd_remove_devices(&dev->dev); in timb_remove()
830 device_remove_file(&dev->dev, &dev_attr_fw_ver); in timb_remove()
832 iounmap(priv->ctl_membase); in timb_remove()
833 release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE); in timb_remove()
855 MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");