blob: 84004e59212756ee31452ee4ff61cfdea3ffa752 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peng Fan745df682016-02-03 10:06:07 +08002
3/*
4 * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
Peng Fan745df682016-02-03 10:06:07 +08005 */
6
Simon Glass4af0d7e2017-05-17 17:18:07 -06007#include <common.h>
Simon Glass9d922452017-05-17 17:18:03 -06008#include <dm.h>
Peng Fan745df682016-02-03 10:06:07 +08009#include <dm/pinctrl.h>
10
11#include "pinctrl-imx.h"
12
Lukasz Majewskic0df1212019-04-23 16:44:51 +020013static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info __section(".data");
Peng Fan745df682016-02-03 10:06:07 +080014
Jagan Tekibb0297c2017-11-21 00:02:13 +053015/* FIXME Before reloaction, BSS is overlapped with DT area */
16static struct imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = {
17 .flags = ZERO_OFFSET_VALID,
18};
19
Peng Fanca751592016-08-11 14:02:52 +080020static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = {
21 .flags = ZERO_OFFSET_VALID,
22};
23
Peng Fan745df682016-02-03 10:06:07 +080024static 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
32static 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 Fanef0afaa2016-12-11 19:24:35 +080036 { .compatible = "fsl,imx6sll-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info },
37 { .compatible = "fsl,imx6sll-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
Peng Fan745df682016-02-03 10:06:07 +080038 { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info },
Jagan Tekibb0297c2017-11-21 00:02:13 +053039 { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6ul_pinctrl_soc_info },
Peng Fanca751592016-08-11 14:02:52 +080040 { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info },
Peng Fan745df682016-02-03 10:06:07 +080041 { /* sentinel */ }
42};
43
Walter Lozano24968d92020-07-29 12:31:20 -030044U_BOOT_DRIVER(fsl_imx6q_iomuxc) = {
45 .name = "fsl_imx6q_iomuxc",
Peng Fan745df682016-02-03 10:06:07 +080046 .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,
52 .flags = DM_FLAG_PRE_RELOC,
Peng Fan745df682016-02-03 10:06:07 +080053};
Walter Lozano24968d92020-07-29 12:31:20 -030054
55U_BOOT_DRIVER_ALIAS(fsl_imx6q_iomuxc, fsl_imx6dl_iomuxc)