Merge tag 'u-boot-atmel-fixes-2021.01-b' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / drivers / pinctrl / pinctrl-sti.c
index a9c1495..2f3ee00 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Pinctrl driver for STMicroelectronics STi SoCs
  *
  * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
- * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics.
- *
- * SPDX-License-Identifier:    GPL-2.0+
+ * Author(s): Patrice Chotard, <patrice.chotard@foss.st.com> for STMicroelectronics.
  */
 
 #include <common.h>
@@ -15,6 +14,8 @@
 #include <syscon.h>
 #include <asm/io.h>
 #include <dm/pinctrl.h>
+#include <linux/bug.h>
+#include <linux/libfdt.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -62,7 +63,7 @@ void sti_alternate_select(struct udevice *dev, struct sti_pin_desc *pin_desc)
        int bank = pin_desc->bank;
        int pin = pin_desc->pin;
 
-       sysconfreg = (unsigned long *)plat->regmap->base;
+       sysconfreg = (unsigned long *)plat->regmap->ranges[0].start;
 
        switch (bank) {
        case 0 ... 5:           /* in "SBC Bank" */
@@ -96,7 +97,7 @@ void sti_pin_configure(struct udevice *dev, struct sti_pin_desc *pin_desc)
        unsigned long *sysconfreg;
        int bank = pin_desc->bank;
 
-       sysconfreg = (unsigned long *)plat->regmap->base + 40;
+       sysconfreg = (unsigned long *)plat->regmap->ranges[0].start + 40;
 
        /*
         * NOTE: The PIO configuration for the PIO pins in the