1473f01f7SAlan Tull // SPDX-License-Identifier: GPL-2.0 25b73cb5bSMatthew Gerlach /* 35b73cb5bSMatthew Gerlach * Driver for Altera Partial Reconfiguration IP Core 45b73cb5bSMatthew Gerlach * 55b73cb5bSMatthew Gerlach * Copyright (C) 2016-2017 Intel Corporation 65b73cb5bSMatthew Gerlach * 75b73cb5bSMatthew Gerlach * Based on socfpga-a10.c Copyright (C) 2015-2016 Altera Corporation 85b73cb5bSMatthew Gerlach * by Alan Tull <atull@opensource.altera.com> 95b73cb5bSMatthew Gerlach */ 105b73cb5bSMatthew Gerlach #include <linux/fpga/altera-pr-ip-core.h> 115b73cb5bSMatthew Gerlach #include <linux/module.h> 125b73cb5bSMatthew Gerlach #include <linux/of_device.h> 135b73cb5bSMatthew Gerlach 145b73cb5bSMatthew Gerlach static int alt_pr_platform_probe(struct platform_device *pdev) 155b73cb5bSMatthew Gerlach { 165b73cb5bSMatthew Gerlach struct device *dev = &pdev->dev; 175b73cb5bSMatthew Gerlach void __iomem *reg_base; 185b73cb5bSMatthew Gerlach 195b73cb5bSMatthew Gerlach /* First mmio base is for register access */ 20*c9b5ff3bSYangtao Li reg_base = devm_platform_ioremap_resource(pdev, 0); 215b73cb5bSMatthew Gerlach if (IS_ERR(reg_base)) 225b73cb5bSMatthew Gerlach return PTR_ERR(reg_base); 235b73cb5bSMatthew Gerlach 245b73cb5bSMatthew Gerlach return alt_pr_register(dev, reg_base); 255b73cb5bSMatthew Gerlach } 265b73cb5bSMatthew Gerlach 275b73cb5bSMatthew Gerlach static const struct of_device_id alt_pr_of_match[] = { 285b73cb5bSMatthew Gerlach { .compatible = "altr,a10-pr-ip", }, 295b73cb5bSMatthew Gerlach {}, 305b73cb5bSMatthew Gerlach }; 315b73cb5bSMatthew Gerlach 325b73cb5bSMatthew Gerlach MODULE_DEVICE_TABLE(of, alt_pr_of_match); 335b73cb5bSMatthew Gerlach 345b73cb5bSMatthew Gerlach static struct platform_driver alt_pr_platform_driver = { 355b73cb5bSMatthew Gerlach .probe = alt_pr_platform_probe, 365b73cb5bSMatthew Gerlach .driver = { 375b73cb5bSMatthew Gerlach .name = "alt_a10_pr_ip", 385b73cb5bSMatthew Gerlach .of_match_table = alt_pr_of_match, 395b73cb5bSMatthew Gerlach }, 405b73cb5bSMatthew Gerlach }; 415b73cb5bSMatthew Gerlach 425b73cb5bSMatthew Gerlach module_platform_driver(alt_pr_platform_driver); 435b73cb5bSMatthew Gerlach MODULE_AUTHOR("Matthew Gerlach <matthew.gerlach@linux.intel.com>"); 445b73cb5bSMatthew Gerlach MODULE_DESCRIPTION("Altera Partial Reconfiguration IP Platform Driver"); 455b73cb5bSMatthew Gerlach MODULE_LICENSE("GPL v2"); 46