Lines Matching +full:- +full:- +full:disable +full:- +full:fdt
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2005-2007 by Texas Instruments
13 #include <dm/device-internal.h>
20 #include "linux-compat.h"
30 l = musb_readl(musb->mregs, OTG_FORCESTDBY); in omap2430_low_level_exit()
32 musb_writel(musb->mregs, OTG_FORCESTDBY, l); in omap2430_low_level_exit()
39 l = musb_readl(musb->mregs, OTG_FORCESTDBY); in omap2430_low_level_init()
40 l &= ~ENABLEFORCE; /* disable MSTANDBY */ in omap2430_low_level_init()
41 musb_writel(musb->mregs, OTG_FORCESTDBY, l); in omap2430_low_level_init()
52 (struct omap_musb_board_data *)musb->controller; in omap2430_musb_init()
55 musb_writel(musb->mregs, OTG_SYSCONFIG, SOFTRST); in omap2430_musb_init()
60 l = musb_readl(musb->mregs, OTG_SYSCONFIG); in omap2430_musb_init()
65 dev_err(musb->controller, "MUSB reset is taking too long\n"); in omap2430_musb_init()
66 return -ENODEV; in omap2430_musb_init()
70 l = musb_readl(musb->mregs, OTG_INTERFSEL); in omap2430_musb_init()
72 if (data->interface_type == MUSB_INTERFACE_UTMI) { in omap2430_musb_init()
74 l &= ~ULPI_12PIN; /* Disable ULPI */ in omap2430_musb_init()
80 musb_writel(musb->mregs, OTG_INTERFSEL, l); in omap2430_musb_init()
84 musb_readl(musb->mregs, OTG_REVISION), in omap2430_musb_init()
85 musb_readl(musb->mregs, OTG_SYSCONFIG), in omap2430_musb_init()
86 musb_readl(musb->mregs, OTG_SYSSTATUS), in omap2430_musb_init()
87 musb_readl(musb->mregs, OTG_INTERFSEL), in omap2430_musb_init()
88 musb_readl(musb->mregs, OTG_SIMENABLE)); in omap2430_musb_init()
109 u32 *usbotghs_control = (u32 *)((*ctrl)->control_usbotghs_ctrl); in omap2430_musb_enable()
135 .disable = omap2430_musb_disable,
151 const void *fdt = gd->fdt_blob; in omap2430_musb_ofdata_to_platdata() local
154 platdata->base = (void *)dev_read_addr_ptr(dev); in omap2430_musb_ofdata_to_platdata()
156 platdata->musb_config.multipoint = fdtdec_get_int(fdt, node, in omap2430_musb_ofdata_to_platdata()
158 -1); in omap2430_musb_ofdata_to_platdata()
159 if (platdata->musb_config.multipoint < 0) { in omap2430_musb_ofdata_to_platdata()
161 return -ENOENT; in omap2430_musb_ofdata_to_platdata()
164 platdata->musb_config.dyn_fifo = 1; in omap2430_musb_ofdata_to_platdata()
165 platdata->musb_config.num_eps = fdtdec_get_int(fdt, node, in omap2430_musb_ofdata_to_platdata()
166 "num-eps", -1); in omap2430_musb_ofdata_to_platdata()
167 if (platdata->musb_config.num_eps < 0) { in omap2430_musb_ofdata_to_platdata()
168 pr_err("MUSB num-eps DT entry missing\n"); in omap2430_musb_ofdata_to_platdata()
169 return -ENOENT; in omap2430_musb_ofdata_to_platdata()
172 platdata->musb_config.ram_bits = fdtdec_get_int(fdt, node, in omap2430_musb_ofdata_to_platdata()
173 "ram-bits", -1); in omap2430_musb_ofdata_to_platdata()
174 if (platdata->musb_config.ram_bits < 0) { in omap2430_musb_ofdata_to_platdata()
175 pr_err("MUSB ram-bits DT entry missing\n"); in omap2430_musb_ofdata_to_platdata()
176 return -ENOENT; in omap2430_musb_ofdata_to_platdata()
179 platdata->plat.power = fdtdec_get_int(fdt, node, in omap2430_musb_ofdata_to_platdata()
180 "power", -1); in omap2430_musb_ofdata_to_platdata()
181 if (platdata->plat.power < 0) { in omap2430_musb_ofdata_to_platdata()
183 return -ENOENT; in omap2430_musb_ofdata_to_platdata()
186 platdata->otg_board_data.interface_type = fdtdec_get_int(fdt, node, in omap2430_musb_ofdata_to_platdata()
187 "interface-type", -1); in omap2430_musb_ofdata_to_platdata()
188 if (platdata->otg_board_data.interface_type < 0) { in omap2430_musb_ofdata_to_platdata()
189 pr_err("MUSB interface-type DT entry missing\n"); in omap2430_musb_ofdata_to_platdata()
190 return -ENOENT; in omap2430_musb_ofdata_to_platdata()
194 platdata->plat.mode = fdtdec_get_int(fdt, node, in omap2430_musb_ofdata_to_platdata()
195 "mode", -1); in omap2430_musb_ofdata_to_platdata()
196 if (platdata->plat.mode < 0) { in omap2430_musb_ofdata_to_platdata()
198 return -ENOENT; in omap2430_musb_ofdata_to_platdata()
202 platdata->plat.mode = MUSB_HOST; in omap2430_musb_ofdata_to_platdata()
204 platdata->plat.mode = MUSB_PERIPHERAL; in omap2430_musb_ofdata_to_platdata()
207 platdata->otg_board_data.dev = dev; in omap2430_musb_ofdata_to_platdata()
208 platdata->plat.config = &platdata->musb_config; in omap2430_musb_ofdata_to_platdata()
209 platdata->plat.platform_ops = &omap2430_ops; in omap2430_musb_ofdata_to_platdata()
210 platdata->plat.board_data = &platdata->otg_board_data; in omap2430_musb_ofdata_to_platdata()
225 priv->desc_before_addr = true; in omap2430_musb_probe()
227 otg_board_data = &platdata->otg_board_data; in omap2430_musb_probe()
230 host->host = musb_init_controller(&platdata->plat, in omap2430_musb_probe()
232 platdata->base); in omap2430_musb_probe()
233 if (!host->host) { in omap2430_musb_probe()
234 return -EIO; in omap2430_musb_probe()
239 ret = musb_register(&platdata->plat, in omap2430_musb_probe()
241 platdata->base); in omap2430_musb_probe()
250 musb_stop(host->host); in omap2430_musb_remove()
256 { .compatible = "ti,omap3-musb" },
257 { .compatible = "ti,omap4-musb" },
262 .name = "omap2430-musb",