blob: 322eec87ff5d4ccaa7340d74e8ade2a5d45514c3 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peng Fane2fd36cc2016-02-03 10:06:07 +08002
3/*
4 * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
Peng Fane2fd36cc2016-02-03 10:06:07 +08005 */
6
Simon Glass11c89f32017-05-17 17:18:03 -06007#include <dm.h>
Peng Fane2fd36cc2016-02-03 10:06:07 +08008#include <dm/pinctrl.h>
9
10#include "pinctrl-imx.h"
11
Lukasz Majewski45bb7672019-04-23 16:44:51 +020012static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info __section(".data");
Peng Fane2fd36cc2016-02-03 10:06:07 +080013
Jagan Tekib1e81ef2017-11-21 00:02:13 +053014/* FIXME Before reloaction, BSS is overlapped with DT area */
15static struct imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = {
16 .flags = ZERO_OFFSET_VALID,
17};
18
Peng Fan83c8f842016-08-11 14:02:52 +080019static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = {
20 .flags = ZERO_OFFSET_VALID,
21};
22
Peng Fane2fd36cc2016-02-03 10:06:07 +080023static 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
31static 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 Fanf75b4802016-12-11 19:24:35 +080035 { .compatible = "fsl,imx6sll-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info },
36 { .compatible = "fsl,imx6sll-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
Peng Fane2fd36cc2016-02-03 10:06:07 +080037 { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
Jagan Tekib1e81ef2017-11-21 00:02:13 +053038 { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6ul_pinctrl_soc_info },
Peng Fan83c8f842016-08-11 14:02:52 +080039 { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info },
Peng Fane2fd36cc2016-02-03 10:06:07 +080040 { /* sentinel */ }
41};
42
Walter Lozano35f61872020-07-29 12:31:20 -030043U_BOOT_DRIVER(fsl_imx6q_iomuxc) = {
44 .name = "fsl_imx6q_iomuxc",
Peng Fane2fd36cc2016-02-03 10:06:07 +080045 .id = UCLASS_PINCTRL,
46 .of_match = of_match_ptr(imx6_pinctrl_match),
47 .probe = imx6_pinctrl_probe,
48 .remove = imx_pinctrl_remove,
Simon Glass8a2b47f2020-12-03 16:55:17 -070049 .priv_auto = sizeof(struct imx_pinctrl_priv),
Peng Fane2fd36cc2016-02-03 10:06:07 +080050 .ops = &imx_pinctrl_ops,
51 .flags = DM_FLAG_PRE_RELOC,
Peng Fane2fd36cc2016-02-03 10:06:07 +080052};
Walter Lozano35f61872020-07-29 12:31:20 -030053
Simon Glassdf65db82020-12-28 20:34:57 -070054DM_DRIVER_ALIAS(fsl_imx6q_iomuxc, fsl_imx6dl_iomuxc)