blob: 4e8fa08bc6e3cfdc76e02fd252c2c93cddacc525 [file] [log] [blame]
Ye Li0bf4a772021-08-07 16:00:43 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2020 NXP
4 *
5 */
6
7#include <common.h>
8#include <dm.h>
9#include <dm/pinctrl.h>
10
11#include "pinctrl-imx.h"
12
13static struct imx_pinctrl_soc_info imx8ulp_pinctrl_soc_info0 = {
Tom Rini6e7df1d2023-01-10 11:19:45 -050014 .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG | CFG_IBE_OBE,
Ye Li0bf4a772021-08-07 16:00:43 +080015};
16
17static struct imx_pinctrl_soc_info imx8ulp_pinctrl_soc_info1 = {
Tom Rini6e7df1d2023-01-10 11:19:45 -050018 .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG | CFG_IBE_OBE,
Ye Li0bf4a772021-08-07 16:00:43 +080019};
20
21static int imx8ulp_pinctrl_probe(struct udevice *dev)
22{
23 struct imx_pinctrl_soc_info *info =
24 (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev);
25
26 return imx_pinctrl_probe(dev, info);
27}
28
29static const struct udevice_id imx8ulp_pinctrl_match[] = {
30 { .compatible = "fsl,imx8ulp-iomuxc0", .data = (ulong)&imx8ulp_pinctrl_soc_info0 },
31 { .compatible = "fsl,imx8ulp-iomuxc1", .data = (ulong)&imx8ulp_pinctrl_soc_info1 },
32 { /* sentinel */ }
33};
34
35U_BOOT_DRIVER(imx8ulp_pinctrl) = {
36 .name = "imx8ulp-pinctrl",
37 .id = UCLASS_PINCTRL,
38 .of_match = of_match_ptr(imx8ulp_pinctrl_match),
39 .probe = imx8ulp_pinctrl_probe,
40 .remove = imx_pinctrl_remove,
41 .priv_auto = sizeof(struct imx_pinctrl_priv),
42 .ops = &imx_pinctrl_ops,
43 .flags = DM_FLAG_PRE_RELOC,
44};