PCIe support for i.MX7
Subsystems (9)
v3 cover PCIe support for i.MX7
Everyone:
This seires is a build-up on previously submitted PCI sync set [1] and contains the patches I created while working on adding support for PCIe on i.MX7. The series consists of following:
- Patches adding necessary regulator pluming to support porint ANATOP driver
- ANATOP driver port
- Port of basic power domain infrastructure from Linux kernel needed for controlling GPCv2 (useful for both i.MX7 and, especially, for i.MX8MQ)
- Port of GPCv2 driver from Linux as well as of some bug fixes for it
- Port of i.MX7 reset controller driver
- Patches adding support for i.MX7 to existing i.MX6 PCIe host controller driver
- Misc fixes
This series has been tested on i.MX7D SabreSD board against Toshiba NVMe device.
Feedback is welcome!
Changes since [v2]:
- Dropped "base: Port driver_deferred_probe_check_state() from Linux" and adjusted the rest of the series accordingly
Changes since [v1]:
- Patches containing bugfixes for GPCv2 were squashed into the patch introducing the driver
- Patches containing bugfixes for i.MX7 reset controller were squashed into the patch introducing the driver
- Deffered probe by GPIO support in i.MX6 PCI driver fixed by having GPIO request preceed the call to dev_request_mem_resource()
Thanks,
Andrey Smirnov
[1] http://lists.infradead.org/pipermail/barebox/2018-December/036005.html
[v1] http://lists.infradead.org/pipermail/barebox/2019-January/036318.html
[v2] http://lists.infradead.org/pipermail/barebox/2019-January/036406.html
Andrey Smirnov (17):
regulator: Convert drivers to use struct regulator_desc
regulator: Port basic regmap regulator functions
regulator: Add support for setting regulator's voltage
base: driver: Drop redundant list_empty() check
regulator: Assume probe deferral instead of missing regulator
regulator: Port ANATOP driver from Linux
drivers: base: Port power management code from Linux
soc: imx: Add GPCv2 power gating driver
reset: Add i.MX7 SRC reset driver
reset: Mark local functions as static
PCI: imx6: Add code to support i.MX7D
PCI: imx6: Allow probe deferral by reset GPIO
PCI: imx6: Do not wait for speed change on i.MX7
PCI: imx6: Do not switch speed if Gen2 is disabled
PCI: imx6: Fix spelling mistake: "contol" -> "control"
PCI: imx6: Drop unnecessary root_bus_nr setting
PCI: imx6: Port imx6_pcie_ltssm_enable()
arch/arm/mach-imx/Kconfig | 1 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/base/Kconfig | 3 + drivers/base/Makefile | 4 +- drivers/base/driver.c | 5 +- drivers/base/platform.c | 7 + drivers/base/power.c | 249 +++++++++++++++++++++ drivers/pci/Kconfig | 4 +- drivers/pci/pci-imx6.c | 255 +++++++++++++++------- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 5 +- drivers/regulator/anatop-regulator.c | 161 ++++++++++++++ drivers/regulator/bcm2835.c | 6 +- drivers/regulator/core.c | 59 ++++- drivers/regulator/fixed.c | 6 +- drivers/regulator/helpers.c | 186 ++++++++++++++++ drivers/reset/Kconfig | 11 + drivers/reset/Makefile | 1 + drivers/reset/core.c | 8 +- drivers/reset/reset-imx7.c | 151 +++++++++++++ drivers/soc/imx/Kconfig | 9 + drivers/soc/imx/Makefile | 1 + drivers/soc/imx/gpcv2.c | 315 +++++++++++++++++++++++++++ include/pm_domain.h | 82 +++++++ include/regulator.h | 41 +++- 26 files changed, 1480 insertions(+), 101 deletions(-) create mode 100644 drivers/base/Kconfig create mode 100644 drivers/base/power.c create mode 100644 drivers/regulator/anatop-regulator.c create mode 100644 drivers/regulator/helpers.c create mode 100644 drivers/reset/reset-imx7.c create mode 100644 drivers/soc/imx/Kconfig create mode 100644 drivers/soc/imx/Makefile create mode 100644 drivers/soc/imx/gpcv2.c create mode 100644 include/pm_domain.h
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 1/17 regulator: Convert drivers to use struct regulator_desc
To simplify porting kernel code, port a very basic struct regulator_desc and convert all of the code to use it.
--- drivers/regulator/bcm2835.c | 6 ++++-- drivers/regulator/core.c | 8 ++++---- drivers/regulator/fixed.c | 6 ++++-- include/regulator.h | 6 +++++- 4 files changed, 17 insertions(+), 9 deletions(-)
drivers/regulator/bcm2835.c +4 -2
@@ -24,6 +24,7 @@ static struct regulator_bcm2835 {struct device_d *dev;struct regulator_dev rdev; +struct regulator_desc rdesc; } regs[] = {REG_DEV (BCM2835_MBOX_POWER_DEVID_SDHCI ,"bcm2835_mci0" ), REG_DEV(BCM2835_MBOX_POWER_DEVID_UART0, "uart0-pl0110"),
@@ -108,7 +109,7 @@ static int regulator_bcm2835_is_enabled(struct regulator_dev *rdev)return msg_pwr->get_power_state.body.resp.state; } -static struct regulator_ops bcm2835_ops = { +const static struct regulator_ops bcm2835_ops = { .enable = regulator_bcm2835_enable, .disable = regulator_bcm2835_disable, .is_enabled = regulator_bcm2835_is_enabled,
@@ -122,7 +123,8 @@ static int regulator_bcm2835_probe(struct device_d *dev)for (i =0 ; i <ARRAY_SIZE (regs); i++) { rb = ®s[i]; - rb->rdev.ops = &bcm2835_ops; + rb->rdesc.ops = &bcm2835_ops; + rb->rdev.desc = &rb->rdesc; rb->dev = dev; ret =dev_regulator_register (&rb->rdev, rb->devname,NULL );
drivers/regulator/core.c +4 -4
@@ -52,10 +52,10 @@ static int regulator_enable_internal(struct regulator_internal *ri)return 0 ; } -if (!ri->rdev->ops->enable) +if (!ri->rdev->desc->ops->enable)return -ENOSYS ; - ret = ri->rdev->ops->enable (ri->rdev); + ret = ri->rdev->desc->ops->enable (ri->rdev);if (ret)return ret;
@@ -74,10 +74,10 @@ static int regulator_disable_internal(struct regulator_internal *ri)if (!ri->enable_count)return -EINVAL ; -if (!ri->rdev->ops->disable) +if (!ri->rdev->desc->ops->disable)return -ENOSYS ; - ret = ri->rdev->ops->disable (ri->rdev); + ret = ri->rdev->desc->ops->disable (ri->rdev);if (ret)return ret;
drivers/regulator/fixed.c +4 -2
@@ -29,6 +29,7 @@ struct regulator_fixed {int active_low;int always_on;struct regulator_dev rdev; +struct regulator_desc rdesc; };static int regulator_fixed_enable (struct regulator_dev *rdev)
@@ -54,7 +55,7 @@ static int regulator_fixed_disable(struct regulator_dev *rdev)return gpio_direction_output (fix->gpio, fix->active_low); } -static struct regulator_ops fixed_ops = { +const static struct regulator_ops fixed_ops = { .enable = regulator_fixed_enable, .disable = regulator_fixed_disable, };
@@ -82,7 +83,8 @@ static int regulator_fixed_probe(struct device_d *dev) fix->active_low =1 ; } - fix->rdev.ops = &fixed_ops; + fix->rdesc.ops = &fixed_ops; + fix->rdev.desc = &fix->rdesc;if (of_find_property (dev->device_node,"regulator-always-on" ,NULL )) { fix->always_on =1 ;
include/regulator.h +5 -1
@@ -4,8 +4,12 @@/* struct regulator is an opaque object for consumers */ struct regulator ; +struct regulator_desc { +const struct regulator_ops *ops; +}; +struct regulator_dev { -struct regulator_ops *ops; +const struct regulator_desc *desc;int boot_on; };
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 2/17 regulator: Port basic regmap regulator functions
In reply to Andrey SmirnovIn order to be able to port Linux driver relying on this API, port various regmap related regulator function to Barebox.
--- drivers/regulator/Makefile | 2 +- drivers/regulator/helpers.c | 87 +++++++++++++++++++++++++++++++++++++ include/regulator.h | 11 ++++- 3 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 drivers/regulator/helpers.c
drivers/regulator/Makefile +1 -1
@@ -1,4 +1,4 @@ -obj-$(CONFIG_REGULATOR) += core.o +obj-$(CONFIG_REGULATOR) += core.o helpers.o obj-$(CONFIG_REGULATOR_FIXED) += fixed.o obj-$(CONFIG_REGULATOR_BCM283X) += bcm2835.o obj-$(CONFIG_REGULATOR_PFUZE) += pfuze.o
drivers/regulator/helpers.c new file +87 -0
87 lines not on this page · raw message
include/regulator.h +10 -1
@@ -6,10 +6,17 @@ struct regulator;struct regulator_desc {const struct regulator_ops *ops; + +unsigned int enable_reg; +unsigned int enable_mask; +unsigned int enable_val; +unsigned int disable_val; +bool enable_is_inverted; };struct regulator_dev {const struct regulator_desc *desc; +struct regmap *regmap;int boot_on; };
@@ -39,7 +46,9 @@ void regulators_print(void);struct regulator *regulator_get (struct device_d *,const char *);int regulator_enable (struct regulator *);int regulator_disable (struct regulator *); - +int regulator_is_enabled_regmap (struct regulator_dev *); +int regulator_enable_regmap (struct regulator_dev *); +int regulator_disable_regmap (struct regulator_dev *);#else static inline struct regulator *regulator_get (struct device_d *dev,const char *id)
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 3/17 regulator: Add support for setting regulator's voltage
In reply to Andrey SmirnovAdd code needed to implement regulator_set_voltage(). Currently only bare minmum needed for ANATOP driver (added in follow up commit) is supported.
--- drivers/regulator/core.c | 44 +++++++++++++++++ drivers/regulator/helpers.c | 99 +++++++++++++++++++++++++++++++++++++ include/regulator.h | 24 +++++++++ 3 files changed, 167 insertions(+)
drivers/regulator/core.c +44 -0
@@ -43,6 +43,15 @@ struct regulator {struct device_d *dev; }; +static int regulator_map_voltage (struct regulator_dev *rdev,int min_uV, +int max_uV) +{ +if (rdev->desc->ops->list_voltage == regulator_list_voltage_linear) +return regulator_map_voltage_linear (rdev, min_uV, max_uV); + +return -ENOSYS ; +} +static int regulator_enable_internal (struct regulator_internal *ri) {int ret;
@@ -86,6 +95,33 @@ static int regulator_disable_internal(struct regulator_internal *ri)return 0 ; } +static int regulator_set_voltage_internal (struct regulator_internal *ri, +int min_uV,int max_uV) +{ +struct regulator_dev *rdev = ri->rdev; +const struct regulator_ops *ops = rdev->desc->ops; +unsigned int selector; +int best_val =0 ; +int ret; + +if (ops->set_voltage_sel) { + ret =regulator_map_voltage (rdev, min_uV, max_uV); +if (ret >=0 ) { + best_val = ops->list_voltage (rdev, ret); +if (min_uV <= best_val && max_uV >= best_val) { + selector = ret; + ret = ops->set_voltage_sel (rdev, selector); + }else { + ret = -EINVAL ; + } + } + +return ret; + } + +return -ENOSYS ; +} +static struct regulator_internal *__regulator_register (struct regulator_dev *rd,const char *name) {struct regulator_internal *ri;
@@ -320,6 +356,14 @@ int regulator_disable(struct regulator *r)return regulator_disable_internal (r->ri); } +int regulator_set_voltage (struct regulator *r,int min_uV,int max_uV) +{ +if (!r) +return 0 ; + +return regulator_set_voltage_internal (r->ri, min_uV, max_uV); +} +static void regulator_print_one (struct regulator_internal *ri) {struct regulator *r;
drivers/regulator/helpers.c +99 -0
102 lines not on this page · raw message
include/regulator.h +24 -0
@@ -5,8 +5,17 @@struct regulator ;struct regulator_desc { +unsigned n_voltages;const struct regulator_ops *ops; +unsigned int min_uV; +unsigned int uV_step; +unsigned int linear_min_sel; + +unsigned int vsel_reg; +unsigned int vsel_mask; +unsigned int apply_reg; +unsigned int apply_bit;unsigned int enable_reg;unsigned int enable_mask;unsigned int enable_val;
@@ -25,6 +34,9 @@ struct regulator_ops {int (*enable) (struct regulator_dev *);int (*disable) (struct regulator_dev *);int (*is_enabled) (struct regulator_dev *); + +int (*list_voltage) (struct regulator_dev *,unsigned int ); +int (*set_voltage_sel) (struct regulator_dev *,unsigned int ); };#ifdef CONFIG_OFDEVICE
@@ -49,6 +61,12 @@ int regulator_disable(struct regulator *);int regulator_is_enabled_regmap (struct regulator_dev *);int regulator_enable_regmap (struct regulator_dev *);int regulator_disable_regmap (struct regulator_dev *); +int regulator_set_voltage_sel_regmap (struct regulator_dev *,unsigned ); +int regulator_set_voltage (struct regulator *regulator,int min_uV,int max_uV); +int regulator_map_voltage_linear (struct regulator_dev *rdev, +int min_uV,int max_uV); +int regulator_list_voltage_linear (struct regulator_dev *rdev, +unsigned int selector);#else static inline struct regulator *regulator_get (struct device_d *dev,const char *id)
@@ -66,6 +84,12 @@ static inline int regulator_disable(struct regulator *r)return 0 ; } +static inline int regulator_set_voltage (struct regulator *regulator, +int min_uV,int max_uV) +{ +return 0 ; +} +#endif #endif /* __REGULATOR_H */
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 4/17 base: driver: Drop redundant list_empty() check
In reply to Andrey Smirnov--- drivers/base/driver.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/base/driver.c +1 -4
@@ -269,7 +269,7 @@ static int device_probe_deferred(void) success = false;if (list_empty (&deferred)) -break ; +return 0 ;list_for_each_entry_safe (dev, tmp, &deferred, active) {list_del (&dev->active);
@@ -285,9 +285,6 @@ static int device_probe_deferred(void) } }while (success); -if (list_empty (&deferred)) -return 0 ; -list_for_each_entry (dev, &deferred, active)dev_err (dev,"probe permanently deferred\n" );
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 5/17 regulator: Assume probe deferral instead of missing regulator
In reply to Andrey SmirnovDon't report requested regulator (via of_regulator_get()) as non-existent if said regulator is missing from regulator list. Instead report it as probe deferral to give other, unprobed, drivers a chance to resolve this.
--- drivers/regulator/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/regulator/core.c +6 -1
@@ -227,7 +227,12 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c } } - ri =ERR_PTR (-ENODEV ); +/* +* It is possible that regulator we are looking for will be +* added in future initcalls, so, instead of reporting a +* complete failure report probe deferral +*/ + ri =ERR_PTR (-EPROBE_DEFER ); out:free (propname);
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 6/17 regulator: Port ANATOP driver from Linux
In reply to Andrey SmirnovPort a subset of Linux driver sufficient enough to support feature needed for PCIe on i.MX7.
--- drivers/regulator/Kconfig | 8 ++ drivers/regulator/Makefile | 3 +- drivers/regulator/anatop-regulator.c | 161 +++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 drivers/regulator/anatop-regulator.c
drivers/regulator/Kconfig +8 -0
@@ -21,4 +21,12 @@ config REGULATOR_PFUZE depends on I2C depends on ARCH_IMX6 +config REGULATOR_ANATOP + tristate "Freescale i.MX on-chip ANATOP LDO regulators" + depends on MFD_SYSCON + help + Say y here to support Freescale i.MX on-chip ANATOP LDOs + regulators. It is recommended that this option be + enabled on i.MX6 platform. + endif
drivers/regulator/Makefile +2 -1
@@ -1,4 +1,5 @@ obj-$(CONFIG_REGULATOR) += core.o helpers.o obj-$(CONFIG_REGULATOR_FIXED) += fixed.o obj-$(CONFIG_REGULATOR_BCM283X) += bcm2835.o -obj-$(CONFIG_REGULATOR_PFUZE) += pfuze.o +obj-$(CONFIG_REGULATOR_PFUZE) += pfuze.o +obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o
drivers/regulator/anatop-regulator.c new file +161 -0
161 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 06/17] regulator: Port ANATOP driver from Linux
Quoted 168 lines · Andrey Smirnov
Port a subset of Linux driver sufficient enough to support feature needed for PCIe on i.MX7.
Signed-off-by Andrey Smirnov <[email protected]>--- drivers/regulator/Kconfig | 8 ++ drivers/regulator/Makefile | 3 +- drivers/regulator/anatop-regulator.c | 161 +++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 drivers/regulator/anatop-regulator.cdrivers/regulator/Kconfig +8
-0@@ -21,4 +21,12 @@ config REGULATOR_PFUZE depends on I2C depends on ARCH_IMX6 +config REGULATOR_ANATOP + tristate "Freescale i.MX on-chip ANATOP LDO regulators" + depends on MFD_SYSCON + help + Say y here to support Freescale i.MX on-chip ANATOP LDOs + regulators. It is recommended that this option be + enabled on i.MX6 platform. + endifdrivers/regulator/Makefile +2
-1@@ -1,4 +1,5 @@ obj-$(CONFIG_REGULATOR) += core.o helpers.o obj-$(CONFIG_REGULATOR_FIXED) += fixed.o obj-$(CONFIG_REGULATOR_BCM283X) += bcm2835.o -obj-$(CONFIG_REGULATOR_PFUZE) += pfuze.o +obj-$(CONFIG_REGULATOR_PFUZE) += pfuze.o +obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.odrivers/regulator/anatop-regulator.c new file +120
-0@@ -0,0 +1,161 @@ +/* +* Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. +*/ + +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. + +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. + +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include <common.h> +#include <init.h> +#include <mfd/syscon.h> +#include <regmap.h> +#include <regulator.h> + +struct anatop_regulator { +u32 control_reg; +struct regmap *anatop; +int vol_bit_shift; +int vol_bit_width; +u32 delay_reg; +int delay_bit_shift; +int delay_bit_width; +int min_bit_val; +int min_voltage; +int max_voltage; + +struct regulator_dev rdev; +struct regulator_desc rdesc; + +bool bypass; +int sel; +}; + +static struct regulator_ops anatop_rops = { + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .list_voltage = regulator_list_voltage_linear, +}; + +static int anatop_regulator_probe (struct device_d *dev) +{ +struct device_node *np = dev->device_node; +struct device_node *anatop_np; +struct regulator_desc *rdesc; +struct regulator_dev *rdev; +struct anatop_regulator *sreg; +int ret =0 ; + + sreg =xzalloc (sizeof (*sreg)); + rdesc = &sreg->rdesc; + rdev = &sreg->rdev; + + anatop_np =of_get_parent (np); +if (!anatop_np) +return -ENODEV ; + + rdev->desc = rdesc; + rdev->regmap =syscon_node_to_regmap (anatop_np); +if (IS_ERR (rdev->regmap)) +return PTR_ERR (rdev->regmap); + + ret =of_property_read_u32 (np,"anatop-reg-offset" , + &sreg->control_reg); +if (ret) { +dev_err (dev,"no anatop-reg-offset property set\n" ); +return ret; + } + ret =of_property_read_u32 (np,"anatop-vol-bit-width" , + &sreg->vol_bit_width); +if (ret) { +dev_err (dev,"no anatop-vol-bit-width property set\n" ); +return ret; + } + ret =of_property_read_u32 (np,"anatop-vol-bit-shift" , + &sreg->vol_bit_shift); +if (ret) { +dev_err (dev,"no anatop-vol-bit-shift property set\n" ); +return ret; + } + ret =of_property_read_u32 (np,"anatop-min-bit-val" , + &sreg->min_bit_val); +if (ret) { +dev_err (dev,"no anatop-min-bit-val property set\n" ); +return ret; + } + ret =of_property_read_u32 (np,"anatop-min-voltage" , + &sreg->min_voltage); +if (ret) { +dev_err (dev,"no anatop-min-voltage property set\n" ); +return ret; + } + ret =of_property_read_u32 (np,"anatop-max-voltage" , + &sreg->max_voltage); +if (ret) { +dev_err (dev,"no anatop-max-voltage property set\n" ); +return ret; + } + +/* read LDO ramp up setting, only for core reg */ +of_property_read_u32 (np,"anatop-delay-reg-offset" , + &sreg->delay_reg); +of_property_read_u32 (np,"anatop-delay-bit-width" , + &sreg->delay_bit_width); +of_property_read_u32 (np,"anatop-delay-bit-shift" , + &sreg->delay_bit_shift); + + rdesc->n_voltages = (sreg->max_voltage - sreg->min_voltage) /25000 +1 + + sreg->min_bit_val; + rdesc->min_uV = sreg->min_voltage;
drivers/regulator/anatop-regulator.c line 130
Quoted 10 lines
drivers/regulator/anatop-regulator.c new file +10
-0+ rdesc->uV_step =25000 ; + rdesc->linear_min_sel = sreg->min_bit_val; + rdesc->vsel_reg = sreg->control_reg; + rdesc->vsel_mask =GENMASK (sreg->vol_bit_width + sreg->vol_bit_shift, + sreg->vol_bit_shift); + +/* Only core regulators have the ramp up delay configuration. */ +if (sreg->control_reg && sreg->delay_bit_width) { +free (sreg); +return -ENODEV ;
Ugh, missed the fact that I need to return 0 here to avoid bogus boot error messages. I'll either send a separte fixup or spin a v4 if more changes are necessary.
Thanks,
Andrey Smirnov
Quoted 32 lines
drivers/regulator/anatop-regulator.c new file +31
-1+ }else { +u32 enable_bit; + + rdesc->ops = &anatop_rops; + +if (!of_property_read_u32 (np,"anatop-enable-bit" , + &enable_bit)) { + anatop_rops.enable = regulator_enable_regmap; + anatop_rops.disable = regulator_disable_regmap; + anatop_rops.is_enabled = regulator_is_enabled_regmap; + + rdesc->enable_reg = sreg->control_reg; + rdesc->enable_mask =BIT (enable_bit); + } + } + +return of_regulator_register (rdev, dev->device_node); +} + +static const struct of_device_id of_anatop_regulator_match_tbl[] = { + { .compatible ="fsl,anatop-regulator" , }, + {/* end */ } +}; + +static struct driver_d anatop_regulator_driver = { + .name ="anatop_regulator" , + .probe = anatop_regulator_probe, + .of_compatible =DRV_OF_COMPAT (of_anatop_regulator_match_tbl), +}; +device_platform_driver (anatop_regulator_driver); + --
Quoted 2 lines
2.20.1
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 7/17 drivers: base: Port power management code from Linux
In reply to Andrey SmirnovPort an extremely abridged version of power management/power domain code from Linux as a dependency of i.MX7D PCIe work. Currenlty only bare minimum of functionality is implemented.
--- drivers/Kconfig | 1 + drivers/base/Kconfig | 3 + drivers/base/Makefile | 4 +- drivers/base/platform.c | 7 ++ drivers/base/power.c | 249 ++++++++++++++++++++++++++++++++++++++++ include/pm_domain.h | 82 +++++++++++++ 6 files changed, 345 insertions(+), 1 deletion(-) create mode 100644 drivers/base/Kconfig create mode 100644 drivers/base/power.c create mode 100644 include/pm_domain.h
drivers/Kconfig +1 -0
@@ -1,5 +1,6 @@ menu "Drivers" +source "drivers/base/Kconfig" source "drivers/efi/Kconfig" source "drivers/of/Kconfig" source "drivers/aiodev/Kconfig"
drivers/base/Kconfig new file +3 -0
@@ -0,0 +1,3 @@ + +config PM_GENERIC_DOMAINS + bool
drivers/base/Makefile +3 -1
@@ -2,4 +2,6 @@ obj-y += bus.o obj-y += driver.o obj-y += platform.o obj-y += resource.o -obj-y += regmap/ +obj-y += regmap/ + +obj-$(CONFIG_PM_GENERIC_DOMAINS) += power.o
drivers/base/platform.c +7 -0
@@ -21,9 +21,16 @@#include <errno.h> #include <init.h> #include <of.h> +#include <pm_domain.h> static int platform_probe (struct device_d *dev) { +int ret; + + ret =genpd_dev_pm_attach (dev); +if (ret <0 ) +return ret; +return dev->driver->probe (dev); }
drivers/base/power.c new file +249 -0
249 lines not on this page · raw message
include/pm_domain.h new file +82 -0
83 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 8/17 soc: imx: Add GPCv2 power gating driver
In reply to Andrey SmirnovPort of a Linux commit 03aa12629fc4f73acf28e519c9ee9cb1f5dd3706
Add code allowing for control of various power domains managed by GPCv2 IP block found in i.MX7 series of SoCs. Power domains covered by this patch are:
- PCIE PHY
- MIPI PHY
- USB HSIC PHY
- USB OTG1/2 PHY
Support for any other power domain controlled by GPC is not present, and can be added at some later point.
Testing of this code was done against a PCIe driver.
Linux commit 9e01e2d56db23485a75864b6aeee8e443f024ddb was squashed here as well:
soc: imx: gpcv2: fix regulator deferred probe
If a regulator requests a deferred probe, the power domain gets initialized twice. This leads to a list double add (without list debugging the kernel hangs due to the double add later):
WARNING: CPU: 0 PID: 19 at lib/list_debug.c:31 __list_add_valid+0xbc/0xc4
list_add double add: new=c1229754, prev=c12383b4, next=c1229754.Initialize the power domain after we get the regulator. Also do not print an error in case the regulator defers probing.
Linux commit 3637f12faf507b0a4b8ac1e7115fc99583ab1db3 was squashed here as well
soc: imx: gpcv2: correct PGC offset
Correct MIPI/PCIe/USB_HSIC's PGC offset based on design RTL, the values in the Reference Manual (Rev. 1, 01/2018 and the older ones) are incorrect.
The correct offset values should be as below:
0x800 ~ 0x83F: PGC for core0 of A7 platform;
0x840 ~ 0x87F: PGC for core1 of A7 platform;
0x880 ~ 0x8BF: PGC for SCU of A7 platform;
0xA00 ~ 0xA3F: PGC for fastmix/megamix;
0xC00 ~ 0xC3F: PGC for MIPI PHY;
0xC40 ~ 0xC7F: PGC for PCIe_PHY;
0xC80 ~ 0xCBF: PGC for USB OTG1 PHY;
0xCC0 ~ 0xCFF: PGC for USB OTG2 PHY;
0xD00 ~ 0xD3F: PGC for USB HSIC PHY;
--- drivers/Kconfig | 1 + drivers/Makefile | 1 + drivers/soc/imx/Kconfig | 9 ++ drivers/soc/imx/Makefile | 1 + drivers/soc/imx/gpcv2.c | 315 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 327 insertions(+) create mode 100644 drivers/soc/imx/Kconfig create mode 100644 drivers/soc/imx/Makefile create mode 100644 drivers/soc/imx/gpcv2.c
drivers/Kconfig +1 -0
@@ -38,5 +38,6 @@ source "drivers/firmware/Kconfig" source "drivers/phy/Kconfig" source "drivers/crypto/Kconfig" source "drivers/memory/Kconfig" +source "drivers/soc/imx/Kconfig" endmenu
drivers/Makefile +1 -0
@@ -38,3 +38,4 @@ obj-$(CONFIG_HAB) += hab/ obj-$(CONFIG_CRYPTO_HW) += crypto/ obj-$(CONFIG_AIODEV) += aiodev/ obj-y += memory/ +obj-y += soc/imx/
drivers/soc/imx/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +menu "i.MX SoC drivers" + +config IMX7_PM_DOMAINS + bool "i.MX7 PM domains" + depends on ARCH_IMX7 + select PM_GENERIC_DOMAINS + default y if ARCH_IMX7 + +endmenu
drivers/soc/imx/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_IMX7_PM_DOMAINS) += gpcv2.o
drivers/soc/imx/gpcv2.c new file +315 -0
315 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 9/17 reset: Add i.MX7 SRC reset driver
In reply to Andrey SmirnovPort of a Linux commit abf97755ae31aaaf35156438dd3036e96f66da83
Add reset controller driver exposing various reset faculties, implemented by System Reset Controller IP block.
Linux commit 26fce0557fa639fb7bbc33e31a57cff7df25c3a0 was squashed here as well:
reset: imx7: Fix always writing bits as 0
Right now the only user of reset-imx7 is pci-imx6 and the reset_control_assert and deassert calls on pciephy_reset don't toggle the PCIEPHY_BTN and PCIEPHY_G_RST bits as expected. Fix this by writing 1 or 0 respectively.
The reference manual is not very clear regarding SRC_PCIEPHY_RCR but for other registers like MIPIPHY and HSICPHY the bits are explicitly documented as "1 means assert, 0 means deassert".
The values are still reversed for IMX7_RESET_PCIE_CTRL_APPS_EN.
--- drivers/reset/Kconfig | 11 +++ drivers/reset/Makefile | 1 + drivers/reset/reset-imx7.c | 151 +++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+) create mode 100644 drivers/reset/reset-imx7.c
drivers/reset/Kconfig +11 -0
@@ -11,3 +11,14 @@ menuconfig RESET_CONTROLLER via GPIOs or SoC-internal reset controller modules. If unsure, say no. + +if RESET_CONTROLLER + +config RESET_IMX7 + bool "i.MX7 Reset Driver" + default SOC_IMX7D + select MFD_SYSCON + help + This enables the reset controller driver for i.MX7 SoCs. + +endif
drivers/reset/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_RESET_CONTROLLER) += core.o obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o +obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
drivers/reset/reset-imx7.c new file +151 -0
151 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 10/17 reset: Mark local functions as static
In reply to Andrey SmirnovThere are no outside users of of_reset_control_get() or gpio_reset_control_get(), so mark them as static. This allows us to avoid "no previous prototype" warning as well.
--- drivers/reset/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/reset/core.c +4 -4
@@ -147,8 +147,8 @@ EXPORT_SYMBOL_GPL(reset_control_deassert);* * Use of id names is optional. */ -struct reset_control *of_reset_control_get (struct device_node *node, -const char *id) +static struct reset_control *of_reset_control_get (struct device_node *node, +const char *id) {struct reset_control *rstc =ERR_PTR (-ENODEV );struct reset_controller_dev *r, *rcdev;
@@ -194,9 +194,9 @@ struct reset_control *of_reset_control_get(struct device_node *node,return rstc; } -EXPORT_SYMBOL_GPL (of_reset_control_get); -struct reset_control *gpio_reset_control_get (struct device_d *dev,const char *id) +static struct reset_control * +gpio_reset_control_get (struct device_d *dev,const char *id) {struct reset_control *rc;int gpio;
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 11/17 PCI: imx6: Add code to support i.MX7D
In reply to Andrey SmirnovPort of a Linux commit 9b3fe6796d7c0e0c2b87243ce0c7f4744c54efad
Add various bits of code needed to support i.MX7D variant of the IP.
--- arch/arm/mach-imx/Kconfig | 1 + drivers/pci/Kconfig | 4 +- drivers/pci/pci-imx6.c | 166 ++++++++++++++++++++++++++++---------- 3 files changed, 125 insertions(+), 46 deletions(-)
arch/arm/mach-imx/Kconfig +1 -0
@@ -173,6 +173,7 @@ config ARCH_IMX7 select COMMON_CLK_OF_PROVIDER select ARCH_HAS_FEC_IMX select ARCH_HAS_IMX_GPT + select HW_HAS_PCI config ARCH_IMX8MQ bool
drivers/pci/Kconfig +2 -2
@@ -41,8 +41,8 @@ config PCI_TEGRA select PCI config PCI_IMX6 - bool "Freescale i.MX6 PCIe controller" - depends on ARCH_IMX6 + bool "Freescale i.MX6/7 PCIe controller" + depends on ARCH_IMX6 || ARCH_IMX7 select PCIE_DW select OF_PCI select PCI
drivers/pci/pci-imx6.c +122 -44
245 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 12/17 PCI: imx6: Allow probe deferral by reset GPIO
In reply to Andrey SmirnovPort of a Linux commit bde4a5a00e761f55be92f62378cf5024ced79ee3
Some designs implement reset GPIO via a GPIO expander connected to a peripheral bus. One such example would be i.MX7 Sabre board where said GPIO is provided by SPI shift register connected to a bitbanged SPI bus. To support such designs, allow reset GPIO request to defer probing of the driver.
--- drivers/pci/pci-imx6.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/pci/pci-imx6.c +11 -8
@@ -562,8 +562,8 @@ static const struct dw_pcie_host_ops imx6_pcie_host_ops = { .host_init = imx6_pcie_host_init, }; -static int __init imx6_add_pcie_port (struct imx6_pcie *imx6_pcie, -struct device_d *dev) +static int imx6_add_pcie_port (struct imx6_pcie *imx6_pcie, +struct device_d *dev) {struct dw_pcie *pci = imx6_pcie->pci;struct pcie_port *pp = &pci->pp;
@@ -581,7 +581,7 @@ static int __init imx6_add_pcie_port(struct imx6_pcie *imx6_pcie,return 0 ; } -static int __init imx6_pcie_probe (struct device_d *dev) +static int imx6_pcie_probe (struct device_d *dev) {struct resource *iores;struct dw_pcie *pci;
@@ -599,13 +599,11 @@ static int __init imx6_pcie_probe(struct device_d *dev) imx6_pcie->variant = (enum imx6_pcie_variants )of_device_get_match_data (dev); - iores =dev_request_mem_resource (dev,0 ); -if (IS_ERR (iores)) -return PTR_ERR (iores); - pci->dbi_base =IOMEM (iores->start); -/* Fetch GPIOs */ imx6_pcie->reset_gpio =of_get_named_gpio (np,"reset-gpio" ,0 ); +if (imx6_pcie->reset_gpio == -EPROBE_DEFER ) +return imx6_pcie->reset_gpio; +if (gpio_is_valid (imx6_pcie->reset_gpio)) { ret =gpio_request_one (imx6_pcie->reset_gpio,GPIOF_OUT_INIT_LOW ,"PCIe reset" );
@@ -615,6 +613,11 @@ static int __init imx6_pcie_probe(struct device_d *dev) } } + iores =dev_request_mem_resource (dev,0 ); +if (IS_ERR (iores)) +return PTR_ERR (iores); + pci->dbi_base =IOMEM (iores->start); +/* Fetch clocks */ imx6_pcie->pcie_phy =clk_get (dev,"pcie_phy" );if (IS_ERR (imx6_pcie->pcie_phy)) {
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 13/17 PCI: imx6: Do not wait for speed change on i.MX7
In reply to Andrey SmirnovPort of a Linux commit e6dcd87fff69a9d454104b65569074855cf95b1e
As can be seen from [1]:
"...the different behavior between iMX6Q PCIe and iMX7D PCIe maybe caused by the different controller version.
Regarding to the DOC description, the DIRECT_SPEED_CHANGE should be cleared after the speed change from GEN1 to GEN2. Unfortunately, when GEN1 device is used, the behavior is not documented.
So, IC design guys run the simulation and find out the following behaviors:
1. DIRECT_SPEED_CHANGE will be cleared in 7D after speed change from GEN1 to GEN2. This matches doc’s description
2. set MAX link speed(PCIE_CAP_TARGET_LINK_SPEED=0x01) as GEN1 and re-run the simulation, DIRECT_SPEED_CHANGE will not be cleared; remain as 1, this matches your result, but function test is passed, so this bit should not affect the normal PCIe function."
imx6_pcie_wait_for_speed_change() will report false failures for Gen1 -> Gen1 speed transition, so avoid doing that check and just rely on imx6_pcie_wait_for_link() only.
[1] https://community.nxp.com/message/867943
--- drivers/pci/pci-imx6.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/pci/pci-imx6.c +15 -4
@@ -508,10 +508,21 @@ static int imx6_pcie_establish_link(struct imx6_pcie *imx6_pcie) tmp |=PORT_LOGIC_SPEED_CHANGE ;dw_pcie_writel_dbi (pci,PCIE_LINK_WIDTH_SPEED_CONTROL , tmp); - ret =imx6_pcie_wait_for_speed_change (imx6_pcie); -if (ret) { -dev_err (dev,"Failed to bring link up!\n" ); - goto err_reset_phy; +if (imx6_pcie->variant !=IMX7D ) { +/* +* On i.MX7, DIRECT_SPEED_CHANGE behaves differently +* from i.MX6 family when no link speed transition +* occurs and we go Gen1 -> yep, Gen1. The difference +* is that, in such case, it will not be cleared by HW +* which will cause the following code to report false +* failure. +*/ + + ret =imx6_pcie_wait_for_speed_change (imx6_pcie); +if (ret) { +dev_err (dev,"Failed to bring link up!\n" ); + goto err_reset_phy; + } }/* Make sure link training is finished as well! */
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 14/17 PCI: imx6: Do not switch speed if Gen2 is disabled
In reply to Andrey SmirnovPort of a Linux commit 93b226f9c65a951a91617f87ba1f05f14e59f26f
Save a bit of time and avoid going through link speed change procedure in configuration where link max speed is limited to Gen1 in DT.
--- drivers/pci/pci-imx6.c | 55 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 27 deletions(-)
drivers/pci/pci-imx6.c +28 -27
@@ -496,41 +496,42 @@ static int imx6_pcie_establish_link(struct imx6_pcie *imx6_pcie) tmp &= ~PCIE_RC_LCR_MAX_LINK_SPEEDS_MASK ; tmp |=PCIE_RC_LCR_MAX_LINK_SPEEDS_GEN2 ;dw_pcie_writel_dbi (pci,PCIE_RC_LCR , tmp); - }else { -dev_info (dev,"Link: Gen2 disabled\n" ); - } - -/* -* Start Directed Speed Change so the best possible speed both link -* partners support can be negotiated. -*/ - tmp =dw_pcie_readl_dbi (pci,PCIE_LINK_WIDTH_SPEED_CONTROL ); - tmp |=PORT_LOGIC_SPEED_CHANGE ; -dw_pcie_writel_dbi (pci,PCIE_LINK_WIDTH_SPEED_CONTROL , tmp); -if (imx6_pcie->variant !=IMX7D ) {/* -* On i.MX7, DIRECT_SPEED_CHANGE behaves differently -* from i.MX6 family when no link speed transition -* occurs and we go Gen1 -> yep, Gen1. The difference -* is that, in such case, it will not be cleared by HW -* which will cause the following code to report false -* failure. +* Start Directed Speed Change so the best possible +* speed both link partners support can be negotiated. */ + tmp =dw_pcie_readl_dbi (pci,PCIE_LINK_WIDTH_SPEED_CONTROL ); + tmp |=PORT_LOGIC_SPEED_CHANGE ; +dw_pcie_writel_dbi (pci,PCIE_LINK_WIDTH_SPEED_CONTROL , tmp); + +if (imx6_pcie->variant !=IMX7D ) { +/* +* On i.MX7, DIRECT_SPEED_CHANGE behaves +* differently from i.MX6 family when no link +* speed transition occurs and we go Gen1 -> +* yep, Gen1. The difference is that, in such +* case, it will not be cleared by HW which +* will cause the following code to report +* false failure. +*/ + + ret =imx6_pcie_wait_for_speed_change (imx6_pcie); +if (ret) { +dev_err (dev,"Failed to bring link up!\n" ); + goto err_reset_phy; + } + } - ret =imx6_pcie_wait_for_speed_change (imx6_pcie); +/* Make sure link training is finished as well! */ + ret =imx6_pcie_wait_for_link (imx6_pcie);if (ret) {dev_err (dev,"Failed to bring link up!\n" ); goto err_reset_phy; } - } - -/* Make sure link training is finished as well! */ - ret =imx6_pcie_wait_for_link (imx6_pcie); -if (ret) { -dev_err (dev,"Failed to bring link up!\n" ); - goto err_reset_phy; - } + }else { +dev_info (dev,"Link: Gen2 disabled\n" ); + } tmp =dw_pcie_readl_dbi (pci,PCIE_RC_LCSR );dev_info (dev,"Link up, Gen%i\n" , (tmp >>16 ) &0xf );
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 15/17 PCI: imx6: Fix spelling mistake: "contol" -> "control"
In reply to Andrey SmirnovPort of a Linux commit 7221547e55b7929e4d46983f6f3ca15f36ee4dac
Trivial fix to spelling mistake in dev_err message
--- drivers/pci/pci-imx6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pci-imx6.c +2 -2
@@ -655,13 +655,13 @@ static int imx6_pcie_probe(struct device_d *dev) imx6_pcie->pciephy_reset =reset_control_get (dev,"pciephy" );if (IS_ERR (imx6_pcie->pciephy_reset)) { -dev_err (dev,"Failed to get PCIEPHY reset contol\n" ); +dev_err (dev,"Failed to get PCIEPHY reset control\n" );return PTR_ERR (imx6_pcie->pciephy_reset); } imx6_pcie->apps_reset =reset_control_get (dev,"apps" );if (IS_ERR (imx6_pcie->apps_reset)) { -dev_err (dev,"Failed to get PCIE APPS reset contol\n" ); +dev_err (dev,"Failed to get PCIE APPS reset control\n" );return PTR_ERR (imx6_pcie->apps_reset); }break ;
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 16/17 PCI: imx6: Drop unnecessary root_bus_nr setting
In reply to Andrey SmirnovPort of a Linux commit 39f712e989c5e591c58b65b62981b85027ba3103
Function dw_pcie_host_init() already initializes the root_bus_nr field of 'struct pcie_port', so the -1 assignment prior to calling dw_pcie_host_init() in platform specific driver is not really needed. Drop it.
--- drivers/pci/pci-imx6.c | 1 - 1 file changed, 1 deletion(-)
drivers/pci/pci-imx6.c +0 -1
@@ -581,7 +581,6 @@ static int imx6_add_pcie_port(struct imx6_pcie *imx6_pcie,struct pcie_port *pp = &pci->pp;int ret; - pp->root_bus_nr =-1 ; pp->ops = &imx6_pcie_host_ops; ret =dw_pcie_host_init (pp);
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 17/17 PCI: imx6: Port imx6_pcie_ltssm_enable()
In reply to Andrey SmirnovPort imx6_pcie_ltssm_enable() from Linux kernel driver.
--- drivers/pci/pci-imx6.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/pci/pci-imx6.c +18 -9
@@ -457,6 +457,23 @@ static int imx6_pcie_wait_for_speed_change(struct imx6_pcie *imx6_pcie)return -EINVAL ; } +static void imx6_pcie_ltssm_enable (struct device_d *dev) +{ +struct imx6_pcie *imx6_pcie = dev->priv; +u32 gpr12; + +switch (imx6_pcie->variant) { +case IMX6Q : +case IMX6QP : + gpr12 =readl (imx6_pcie->iomuxc_gpr +IOMUXC_GPR12 ); + gpr12 |=IMX6Q_GPR12_PCIE_CTL_2 ; +writel (gpr12, imx6_pcie->iomuxc_gpr +IOMUXC_GPR12 ); +break ; +case IMX7D : +reset_control_deassert (imx6_pcie->apps_reset); +break ; + } +}static int imx6_pcie_establish_link (struct imx6_pcie *imx6_pcie) {
@@ -464,7 +481,6 @@ static int imx6_pcie_establish_link(struct imx6_pcie *imx6_pcie)struct device_d *dev = pci->dev;uint32_t tmp;int ret; -u32 gpr12;/* * Force Gen1 operation when starting the link. In case the link is
@@ -476,14 +492,7 @@ static int imx6_pcie_establish_link(struct imx6_pcie *imx6_pcie) tmp |=PCIE_RC_LCR_MAX_LINK_SPEEDS_GEN1 ;dw_pcie_writel_dbi (pci,PCIE_RC_LCR , tmp); -/* Start LTSSM. */ -if (imx6_pcie->variant ==IMX7D ) { -reset_control_deassert (imx6_pcie->apps_reset); - }else { - gpr12 =readl (imx6_pcie->iomuxc_gpr +IOMUXC_GPR12 ); - gpr12 |=IMX6Q_GPR12_PCIE_CTL_2 ; -writel (gpr12, imx6_pcie->iomuxc_gpr +IOMUXC_GPR12 ); - } +imx6_pcie_ltssm_enable (dev); ret =imx6_pcie_wait_for_link (imx6_pcie);if (ret)
Signature · 7 lines
2.20.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox