summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/socfpga.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware/socfpga.c')
-rw-r--r--drivers/firmware/socfpga.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/drivers/firmware/socfpga.c b/drivers/firmware/socfpga.c
index dd9202bf2b..419bd27945 100644
--- a/drivers/firmware/socfpga.c
+++ b/drivers/firmware/socfpga.c
@@ -1,29 +1,8 @@
+// SPDX-License-Identifier: BSD-3-Clause
/*
*
* Copyright (C) 2012 Altera Corporation <www.altera.com>
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * - Neither the name of the Altera Corporation nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL ALTERA CORPORATION BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <firmware.h>
@@ -35,10 +14,10 @@
#include <fcntl.h>
#include <init.h>
#include <io.h>
-#include <mach/cyclone5-system-manager.h>
-#include <mach/cyclone5-reset-manager.h>
-#include <mach/cyclone5-regs.h>
-#include <mach/cyclone5-sdram.h>
+#include <mach/socfpga/cyclone5-system-manager.h>
+#include <mach/socfpga/cyclone5-reset-manager.h>
+#include <mach/socfpga/cyclone5-regs.h>
+#include <mach/socfpga/cyclone5-sdram.h>
#include <asm/fncpy.h>
#include <mmu.h>
#include <asm/cache.h>
@@ -398,12 +377,12 @@ static int programmed_get(struct param_d *p, void *priv)
return 0;
}
-static int socfpga_fpgamgr_probe(struct device_d *dev)
+static int socfpga_fpgamgr_probe(struct device *dev)
{
struct resource *iores;
struct fpgamgr *mgr;
struct firmware_handler *fh;
- const char *alias = of_alias_get(dev->device_node);
+ const char *alias = of_alias_get(dev->of_node);
const char *model = NULL;
struct param_d *p;
int ret;
@@ -435,7 +414,7 @@ static int socfpga_fpgamgr_probe(struct device_d *dev)
fh->open = socfpga_fpgamgr_program_start;
fh->write = socfpga_fpgamgr_program_write_buf;
fh->close = socfpga_fpgamgr_program_finish;
- of_property_read_string(dev->device_node, "compatible", &model);
+ of_property_read_string(dev->of_node, "compatible", &model);
if (model)
fh->model = xstrdup(model);
fh->dev = dev;
@@ -456,7 +435,7 @@ static int socfpga_fpgamgr_probe(struct device_d *dev)
}
fh->dev = &mgr->dev;
- fh->device_node = dev->device_node;
+ fh->device_node = dev->of_node;
ret = firmwaremgr_register(fh);
if (ret != 0) {
@@ -480,8 +459,9 @@ static struct of_device_id socfpga_fpgamgr_id_table[] = {
},
{ /* sentinel */ }
};
+MODULE_DEVICE_TABLE(of, socfpga_fpgamgr_id_table);
-static struct driver_d socfpga_fpgamgr_driver = {
+static struct driver socfpga_fpgamgr_driver = {
.name = "socfpa-fpgamgr",
.of_compatible = DRV_OF_COMPAT(socfpga_fpgamgr_id_table),
.probe = socfpga_fpgamgr_probe,