Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 2 | |
| 3 | /* |
| 4 | * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com> |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 7 | #include <dm.h> |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 8 | #include <dm/pinctrl.h> |
| 9 | |
| 10 | #include "pinctrl-imx.h" |
| 11 | |
Lukasz Majewski | 45bb767 | 2019-04-23 16:44:51 +0200 | [diff] [blame] | 12 | static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info __section(".data"); |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 13 | |
Jagan Teki | b1e81ef | 2017-11-21 00:02:13 +0530 | [diff] [blame] | 14 | /* FIXME Before reloaction, BSS is overlapped with DT area */ |
| 15 | static struct imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = { |
| 16 | .flags = ZERO_OFFSET_VALID, |
| 17 | }; |
| 18 | |
Peng Fan | 83c8f84 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 19 | static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = { |
| 20 | .flags = ZERO_OFFSET_VALID, |
| 21 | }; |
| 22 | |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 23 | static int imx6_pinctrl_probe(struct udevice *dev) |
| 24 | { |
| 25 | struct imx_pinctrl_soc_info *info = |
| 26 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 27 | |
| 28 | return imx_pinctrl_probe(dev, info); |
| 29 | } |
| 30 | |
| 31 | static const struct udevice_id imx6_pinctrl_match[] = { |
| 32 | { .compatible = "fsl,imx6q-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 33 | { .compatible = "fsl,imx6dl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 34 | { .compatible = "fsl,imx6sl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | f75b480 | 2016-12-11 19:24:35 +0800 | [diff] [blame] | 35 | { .compatible = "fsl,imx6sll-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
| 36 | { .compatible = "fsl,imx6sll-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 37 | { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Jagan Teki | b1e81ef | 2017-11-21 00:02:13 +0530 | [diff] [blame] | 38 | { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6ul_pinctrl_soc_info }, |
Peng Fan | 83c8f84 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 39 | { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 40 | { /* sentinel */ } |
| 41 | }; |
| 42 | |
Walter Lozano | 35f6187 | 2020-07-29 12:31:20 -0300 | [diff] [blame] | 43 | U_BOOT_DRIVER(fsl_imx6q_iomuxc) = { |
| 44 | .name = "fsl_imx6q_iomuxc", |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 45 | .id = UCLASS_PINCTRL, |
| 46 | .of_match = of_match_ptr(imx6_pinctrl_match), |
| 47 | .probe = imx6_pinctrl_probe, |
| 48 | .remove = imx_pinctrl_remove, |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 49 | .priv_auto = sizeof(struct imx_pinctrl_priv), |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 50 | .ops = &imx_pinctrl_ops, |
| 51 | .flags = DM_FLAG_PRE_RELOC, |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 52 | }; |
Walter Lozano | 35f6187 | 2020-07-29 12:31:20 -0300 | [diff] [blame] | 53 | |
Simon Glass | df65db8 | 2020-12-28 20:34:57 -0700 | [diff] [blame] | 54 | DM_DRIVER_ALIAS(fsl_imx6q_iomuxc, fsl_imx6dl_iomuxc) |