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 | 51a3ec3 | 2017-05-17 17:18:07 -0600 | [diff] [blame] | 7 | #include <common.h> |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 8 | #include <dm.h> |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 9 | #include <dm/pinctrl.h> |
| 10 | |
| 11 | #include "pinctrl-imx.h" |
| 12 | |
| 13 | static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info; |
| 14 | |
Jagan Teki | b1e81ef | 2017-11-21 00:02:13 +0530 | [diff] [blame] | 15 | /* FIXME Before reloaction, BSS is overlapped with DT area */ |
| 16 | static struct imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = { |
| 17 | .flags = ZERO_OFFSET_VALID, |
| 18 | }; |
| 19 | |
Peng Fan | 83c8f84 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 20 | static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = { |
| 21 | .flags = ZERO_OFFSET_VALID, |
| 22 | }; |
| 23 | |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 24 | static int imx6_pinctrl_probe(struct udevice *dev) |
| 25 | { |
| 26 | struct imx_pinctrl_soc_info *info = |
| 27 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 28 | |
| 29 | return imx_pinctrl_probe(dev, info); |
| 30 | } |
| 31 | |
| 32 | static const struct udevice_id imx6_pinctrl_match[] = { |
| 33 | { .compatible = "fsl,imx6q-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 34 | { .compatible = "fsl,imx6dl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 35 | { .compatible = "fsl,imx6sl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | f75b480 | 2016-12-11 19:24:35 +0800 | [diff] [blame] | 36 | { .compatible = "fsl,imx6sll-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
| 37 | { .compatible = "fsl,imx6sll-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 38 | { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Jagan Teki | b1e81ef | 2017-11-21 00:02:13 +0530 | [diff] [blame] | 39 | { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6ul_pinctrl_soc_info }, |
Peng Fan | 83c8f84 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 40 | { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 41 | { /* sentinel */ } |
| 42 | }; |
| 43 | |
| 44 | U_BOOT_DRIVER(imx6_pinctrl) = { |
| 45 | .name = "imx6-pinctrl", |
| 46 | .id = UCLASS_PINCTRL, |
| 47 | .of_match = of_match_ptr(imx6_pinctrl_match), |
| 48 | .probe = imx6_pinctrl_probe, |
| 49 | .remove = imx_pinctrl_remove, |
| 50 | .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), |
| 51 | .ops = &imx_pinctrl_ops, |
Bin Meng | c2908c6 | 2018-10-24 06:36:33 -0700 | [diff] [blame] | 52 | #if !CONFIG_IS_ENABLED(OF_CONTROL) |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 53 | .flags = DM_FLAG_PRE_RELOC, |
Bin Meng | c2908c6 | 2018-10-24 06:36:33 -0700 | [diff] [blame] | 54 | #endif |
Peng Fan | e2fd36cc | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 55 | }; |