Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
Simon Glass | 4af0d7e | 2017-05-17 17:18:07 -0600 | [diff] [blame] | 8 | #include <common.h> |
Simon Glass | 9d92245 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 9 | #include <dm.h> |
Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 10 | #include <dm/pinctrl.h> |
| 11 | |
| 12 | #include "pinctrl-imx.h" |
| 13 | |
| 14 | static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info; |
| 15 | |
Jagan Teki | bb0297c | 2017-11-21 00:02:13 +0530 | [diff] [blame] | 16 | /* FIXME Before reloaction, BSS is overlapped with DT area */ |
| 17 | static struct imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = { |
| 18 | .flags = ZERO_OFFSET_VALID, |
| 19 | }; |
| 20 | |
Peng Fan | ca75159 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 21 | static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = { |
| 22 | .flags = ZERO_OFFSET_VALID, |
| 23 | }; |
| 24 | |
Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 25 | static int imx6_pinctrl_probe(struct udevice *dev) |
| 26 | { |
| 27 | struct imx_pinctrl_soc_info *info = |
| 28 | (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev); |
| 29 | |
| 30 | return imx_pinctrl_probe(dev, info); |
| 31 | } |
| 32 | |
| 33 | static const struct udevice_id imx6_pinctrl_match[] = { |
| 34 | { .compatible = "fsl,imx6q-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 35 | { .compatible = "fsl,imx6dl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
| 36 | { .compatible = "fsl,imx6sl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | ef0afaa | 2016-12-11 19:24:35 +0800 | [diff] [blame] | 37 | { .compatible = "fsl,imx6sll-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
| 38 | { .compatible = "fsl,imx6sll-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 39 | { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, |
Jagan Teki | bb0297c | 2017-11-21 00:02:13 +0530 | [diff] [blame] | 40 | { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6ul_pinctrl_soc_info }, |
Peng Fan | ca75159 | 2016-08-11 14:02:52 +0800 | [diff] [blame] | 41 | { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, |
Peng Fan | 745df68 | 2016-02-03 10:06:07 +0800 | [diff] [blame] | 42 | { /* sentinel */ } |
| 43 | }; |
| 44 | |
| 45 | U_BOOT_DRIVER(imx6_pinctrl) = { |
| 46 | .name = "imx6-pinctrl", |
| 47 | .id = UCLASS_PINCTRL, |
| 48 | .of_match = of_match_ptr(imx6_pinctrl_match), |
| 49 | .probe = imx6_pinctrl_probe, |
| 50 | .remove = imx_pinctrl_remove, |
| 51 | .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), |
| 52 | .ops = &imx_pinctrl_ops, |
| 53 | .flags = DM_FLAG_PRE_RELOC, |
| 54 | }; |