Lines Matching +full:system +full:- +full:ctl

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2013-2016 Altera Corporation, All Rights Reserved.
10 * host processor system (HPS).
18 * is passed in a handoff register in the system manager.
23 * reprogramming the FPGA and re-enabled after the FPGA has been programmed.
26 #include <linux/fpga/fpga-bridge.h>
58 struct alt_fpga2sdram_data *priv = bridge->priv; in alt_fpga2sdram_enable_show()
61 regmap_read(priv->sdrctl, ALT_SDR_CTL_FPGAPORTRST_OFST, &value); in alt_fpga2sdram_enable_show()
63 return (value & priv->mask) == priv->mask; in alt_fpga2sdram_enable_show()
69 return regmap_update_bits(priv->sdrctl, ALT_SDR_CTL_FPGAPORTRST_OFST, in _alt_fpga2sdram_enable_set()
70 priv->mask, enable ? priv->mask : 0); in _alt_fpga2sdram_enable_set()
75 return _alt_fpga2sdram_enable_set(bridge->priv, enable); in alt_fpga2sdram_enable_set()
84 { .compatible = "altr,socfpga-fpga2sdram-bridge" },
90 struct device *dev = &pdev->dev; in alt_fpga_bridge_probe()
99 return -ENOMEM; in alt_fpga_bridge_probe()
101 priv->dev = dev; in alt_fpga_bridge_probe()
103 priv->sdrctl = syscon_regmap_lookup_by_compatible("altr,sdr-ctl"); in alt_fpga_bridge_probe()
104 if (IS_ERR(priv->sdrctl)) { in alt_fpga_bridge_probe()
105 dev_err(dev, "regmap for altr,sdr-ctl lookup failed.\n"); in alt_fpga_bridge_probe()
106 return PTR_ERR(priv->sdrctl); in alt_fpga_bridge_probe()
109 sysmgr = syscon_regmap_lookup_by_compatible("altr,sys-mgr"); in alt_fpga_bridge_probe()
111 dev_err(dev, "regmap for altr,sys-mgr lookup failed.\n"); in alt_fpga_bridge_probe()
116 regmap_read(sysmgr, SYSMGR_ISWGRP_HANDOFF3, &priv->mask); in alt_fpga_bridge_probe()
125 dev_info(dev, "driver initialized with handoff %08x\n", priv->mask); in alt_fpga_bridge_probe()
127 if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) { in alt_fpga_bridge_probe()
129 dev_warn(dev, "invalid bridge-enable %u > 1\n", enable); in alt_fpga_bridge_probe()