| /openbmc/u-boot/drivers/usb/host/ |
| H A D | ehci-hcd.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /*- 3 * Copyright (c) 2007-2008, Juniper Networks, Inc. 50 2, /* bNrPorts -- runtime modified */ 115 return dev_get_priv(usb_get_bus(udev->dev)); in ehci_get_ctrl() 117 return udev->controller; in ehci_get_ctrl() 121 static int ehci_get_port_speed(struct ehci_ctrl *ctrl, uint32_t reg) in ehci_get_port_speed() argument 126 static void ehci_set_usbmode(struct ehci_ctrl *ctrl) in ehci_set_usbmode() argument 131 reg_ptr = (uint32_t *)((u8 *)&ctrl->hcor->or_usbcmd + USBMODE); in ehci_set_usbmode() 142 static void ehci_powerup_fixup(struct ehci_ctrl *ctrl, uint32_t *status_reg, in ehci_powerup_fixup() argument [all …]
|
| H A D | xhci-mem.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Based on xHCI host controller driver in linux-kernel 38 flush_dcache_range(addr & ~(CACHELINE_SIZE - 1), in xhci_flush_cache() 53 invalidate_dcache_range(addr & ~(CACHELINE_SIZE - 1), in xhci_inval_cache() 66 free(seg->trbs); in xhci_segment_free() 67 seg->trbs = NULL; in xhci_segment_free() 85 first_seg = ring->first_seg; in xhci_ring_free() 86 seg = first_seg->next; in xhci_ring_free() 88 struct xhci_segment *next = seg->next; in xhci_ring_free() 100 * @ctrl host controller data structure [all …]
|
| H A D | xhci.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Based on xHCI host controller driver in linux-kernel 48 2, /* bNrPorts -- runtime modified */ 118 struct udevice *dev; in xhci_get_ctrl() local 121 for (dev = udev->dev; in xhci_get_ctrl() 122 device_get_uclass_id(dev) != UCLASS_USB; in xhci_get_ctrl() 123 dev = dev->parent) in xhci_get_ctrl() 125 return dev_get_priv(dev); in xhci_get_ctrl() 127 return udev->controller; in xhci_get_ctrl() 149 return -ENODEV; in handshake() [all …]
|
| H A D | ehci-msm.c | 1 // SPDX-License-Identifier: GPL-2.0+ 16 #include <usb/ehci-ci.h> 25 struct ehci_ctrl ctrl; /* Needed by EHCI */ member 31 static int msm_init_after_reset(struct ehci_ctrl *dev) in msm_init_after_reset() argument 33 struct msm_ehci_priv *p = container_of(dev, struct msm_ehci_priv, ctrl); in msm_init_after_reset() 34 struct usb_ehci *ehci = p->ehci; in msm_init_after_reset() 36 generic_phy_reset(&p->phy); in msm_init_after_reset() 39 writel(CM_HOST, &ehci->usbmode); in msm_init_after_reset() 48 static int ehci_usb_probe(struct udevice *dev) in ehci_usb_probe() argument 50 struct msm_ehci_priv *p = dev_get_priv(dev); in ehci_usb_probe() [all …]
|
| H A D | ehci-mx6.c | 1 // SPDX-License-Identifier: GPL-2.0+ 12 #include <usb/ehci-ci.h> 14 #include <asm/arch/imx-regs.h> 16 #include <asm/mach-imx/iomux-v3.h> 17 #include <asm/mach-imx/sys_proto.h> 19 #include <asm/mach-types.h> 94 chrg_detect = &anatop->usb1_chrg_detect; in usb_power_config() 95 pll_480_ctrl_clr = &anatop->usb1_pll_480_ctrl_clr; in usb_power_config() 96 pll_480_ctrl_set = &anatop->usb1_pll_480_ctrl_set; in usb_power_config() 99 chrg_detect = &anatop->usb2_chrg_detect; in usb_power_config() [all …]
|
| H A D | usb-sandbox.c | 1 // SPDX-License-Identifier: GPL-2.0+ 25 bus->seq, in usbmon_trace() 29 debug(" s %02x %02x %04x %04x %04x", setup->requesttype, in usbmon_trace() 30 setup->request, setup->value, setup->index, in usbmon_trace() 31 setup->length); in usbmon_trace() 33 debug(" %s", emul ? emul->name : "(no emul found)"); in usbmon_trace() 44 struct sandbox_usb_ctrl *ctrl = dev_get_priv(bus); in sandbox_submit_control() local 48 /* Just use child of dev as emulator? */ in sandbox_submit_control() 49 debug("%s: bus=%s\n", __func__, bus->name); in sandbox_submit_control() 50 ret = usb_emul_find(bus, pipe, udev->portnr, &emul); in sandbox_submit_control() [all …]
|
| /openbmc/u-boot/drivers/net/ |
| H A D | ftmac110.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 * Dante Su <dantesu@faraday-tech.com> 15 #include <asm/dma-mapping.h> 35 * accepts only 16-bits aligned address, 32-bits aligned is not 42 * 4 bytes aligned: O.K (-> u-boot ZeroCopy is possible) 65 static int ftmac110_reset(struct eth_device *dev); 67 static uint16_t mdio_read(struct eth_device *dev, in mdio_read() argument 70 struct ftmac110_chip *chip = dev->priv; in mdio_read() 71 struct ftmac110_regs *regs = chip->regs; in mdio_read() 79 writel(tmp, ®s->phycr); in mdio_read() [all …]
|
| H A D | ravb.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 * Copyright (C) 2015-2017 Renesas Electronics Corporation 103 u32 ctrl; member 135 u32 start = addr & ~((uintptr_t)ARCH_DMA_MINALIGN - 1); in ravb_invalidate_dcache() 140 static int ravb_send(struct udevice *dev, void *packet, int len) in ravb_send() argument 142 struct ravb_priv *eth = dev_get_priv(dev); in ravb_send() 143 struct ravb_desc *desc = ð->tx_desc[eth->tx_desc_idx]; in ravb_send() 149 desc->ctrl = RAVB_DESC_DT_FSINGLE | RAVB_DESC_DS(len); in ravb_send() 150 desc->dptr = (uintptr_t)packet; in ravb_send() 154 if (!(readl(eth->iobase + RAVB_REG_TCCR) & TCCR_TSRQ0)) in ravb_send() [all …]
|
| /openbmc/u-boot/drivers/rtc/ |
| H A D | rx8010sj.c | 25 /*---------------------------------------------------------------------*/ 33 /*---------------------------------------------------------------------*/ 93 static int rx8010sj_rtc_read8(DEV_TYPE *dev, unsigned int reg) in rx8010sj_rtc_read8() argument 99 ret = dm_i2c_read(dev, reg, &val, sizeof(val)); in rx8010sj_rtc_read8() 101 ret = i2c_read(dev->chip, reg, 1, &val, 1); in rx8010sj_rtc_read8() 107 static int rx8010sj_rtc_write8(DEV_TYPE *dev, unsigned int reg, int val) in rx8010sj_rtc_write8() argument 113 ret = dm_i2c_write(dev, reg, &lval, 1); in rx8010sj_rtc_write8() 115 ret = i2c_write(dev->chip, reg, 1, &lval, 1); in rx8010sj_rtc_write8() 123 if ((tm->tm_year < 2000) || (tm->tm_year > 2099)) in validate_time() 124 return -EINVAL; in validate_time() [all …]
|
| /openbmc/u-boot/drivers/usb/dwc3/ |
| H A D | ep0.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * ep0.c - DesignWare USB3 DRD Controller Endpoint 0 Handling 5 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com 10 * Taken from Linux Kernel v3.19-rc1 (drivers/usb/dwc3/ep0.c) and ported 13 * commit c00552ebaf : Merge 3.18-rc7 into usb-next 27 #include "linux-compat.h" 58 dep = dwc->eps[epnum]; in dwc3_ep0_start_trans() 59 if (dep->flags & DWC3_EP_BUSY) { in dwc3_ep0_start_trans() 60 dev_vdbg(dwc->dev, "%s still busy", dep->name); in dwc3_ep0_start_trans() 64 trb = &dwc->ep0_trb[dep->free_slot]; in dwc3_ep0_start_trans() [all …]
|
| /openbmc/u-boot/drivers/pinctrl/rockchip/ |
| H A D | pinctrl-rockchip-core.c | 1 // SPDX-License-Identifier: GPL-2.0+ 13 #include "pinctrl-rockchip.h" 19 static int rockchip_verify_config(struct udevice *dev, u32 bank, u32 pin) in rockchip_verify_config() argument 21 struct rockchip_pinctrl_priv *priv = dev_get_priv(dev); in rockchip_verify_config() 22 struct rockchip_pin_ctrl *ctrl = priv->ctrl; in rockchip_verify_config() local 24 if (bank >= ctrl->nr_banks) { in rockchip_verify_config() 25 debug("pin conf bank %d >= nbanks %d\n", bank, ctrl->nr_banks); in rockchip_verify_config() 26 return -EINVAL; in rockchip_verify_config() 32 return -EINVAL; in rockchip_verify_config() 41 struct rockchip_pinctrl_priv *priv = bank->priv; in rockchip_get_recalced_mux() [all …]
|
| /openbmc/qemu/hw/usb/ |
| H A D | hcd-uhci.c | 31 #include "hw/usb/uhci-regs.h" 35 #include "hw/qdev-properties.h" 41 #include "qemu/main-loop.h" 44 #include "hcd-uhci.h" 98 uint32_t ctrl; /* see TD_CTRL_xxx */ member 114 if ((td->token & (0xf << 15)) == 0) { in uhci_queue_token() 115 /* ctrl ep, cover ep and dev, not pid! */ in uhci_queue_token() 116 return td->token & 0x7ff00; in uhci_queue_token() 118 /* covers ep, dev, pid -> identifies the endpoint */ in uhci_queue_token() 119 return td->token & 0x7ffff; in uhci_queue_token() [all …]
|
| /openbmc/qemu/hw/block/ |
| H A D | swim.c | 4 * Copyright (c) 2014-2018 Laurent Vivier <laurent@vivier.eu> 7 * the COPYING file in the top-level directory. 14 #include "qemu/main-loop.h" 16 #include "system/block-backend.h" 21 #include "hw/qdev-properties.h" 155 blk_set_perm(drive->blk, 0, BLK_PERM_ALL, &error_abort); in swim_change_cb() 157 if (!blkconf_apply_backend_options(drive->conf, in swim_change_cb() 158 !blk_supports_write_perm(drive->blk), in swim_change_cb() 170 DEFINE_PROP_INT32("unit", SWIMDrive, unit, -1), 176 SWIMDrive *dev = SWIM_DRIVE(qdev); in swim_drive_realize() local [all …]
|
| /openbmc/u-boot/drivers/pwm/ |
| H A D | sunxi_pwm.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Copyright (c) 2017-2018 Vasily Khoruzhick <anarsoul@gmail.com> 54 static int sunxi_pwm_set_invert(struct udevice *dev, uint channel, in sunxi_pwm_set_invert() argument 57 struct sunxi_pwm_priv *priv = dev_get_priv(dev); in sunxi_pwm_set_invert() 60 priv->invert = polarity; in sunxi_pwm_set_invert() 65 static int sunxi_pwm_set_config(struct udevice *dev, uint channel, in sunxi_pwm_set_config() argument 68 struct sunxi_pwm_priv *priv = dev_get_priv(dev); in sunxi_pwm_set_config() 69 struct sunxi_pwm *regs = priv->regs; in sunxi_pwm_set_config() 85 if ((period - 1 <= SUNXI_PWM_CH0_PERIOD_MAX) && in sunxi_pwm_set_config() 93 if (best_period - 1 > SUNXI_PWM_CH0_PERIOD_MAX) { in sunxi_pwm_set_config() [all …]
|
| /openbmc/u-boot/drivers/mmc/ |
| H A D | zynq_sdhci.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * (C) Copyright 2013 - 2015 Xilinx, Inc. 75 dev_err(mmc_dev(host->mmc), in arasan_zynqmp_dll_reset() 79 timeout--; in arasan_zynqmp_dll_reset() 91 u32 ctrl; in arasan_sdhci_execute_tuning() local 93 struct arasan_sdhci_priv *priv = dev_get_priv(mmc->dev); in arasan_sdhci_execute_tuning() 99 host = priv->host; in arasan_sdhci_execute_tuning() 100 deviceid = priv->deviceid; in arasan_sdhci_execute_tuning() 102 ctrl = sdhci_readw(host, SDHCI_HOST_CTRL2); in arasan_sdhci_execute_tuning() 103 ctrl |= SDHCI_CTRL_EXEC_TUNING; in arasan_sdhci_execute_tuning() [all …]
|
| /openbmc/u-boot/drivers/serial/ |
| H A D | serial_linflexuart.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * (C) Copyright 2013-2016 Freescale Semiconductor, Inc. 13 #include <asm/arch/imx-regs.h> 45 ibr = (u32) (clk / (16 * gd->baudrate)); in _linflex_serial_setbrg() 46 fbr = (u32) (clk % (16 * gd->baudrate)) * 16; in _linflex_serial_setbrg() 48 __raw_writel(ibr, &base->linibrr); in _linflex_serial_setbrg() 49 __raw_writel(fbr, &base->linfbrr); in _linflex_serial_setbrg() 56 if (!(__raw_readb(&base->uartsr) & UARTSR_DRF)) in _linflex_serial_getc() 57 return -EAGAIN; in _linflex_serial_getc() 59 if (!(__raw_readl(&base->uartsr) & UARTSR_RMB)) in _linflex_serial_getc() [all …]
|
| /openbmc/u-boot/drivers/adc/ |
| H A D | rockchip-saradc.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Rockchip SARADC driver for U-Boot 25 unsigned int ctrl; member 41 int rockchip_saradc_channel_data(struct udevice *dev, int channel, in rockchip_saradc_channel_data() argument 44 struct rockchip_saradc_priv *priv = dev_get_priv(dev); in rockchip_saradc_channel_data() 45 struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev); in rockchip_saradc_channel_data() 47 if (channel != priv->active_channel) { in rockchip_saradc_channel_data() 49 return -EINVAL; in rockchip_saradc_channel_data() 52 if ((readl(&priv->regs->ctrl) & SARADC_CTRL_IRQ_STATUS) != in rockchip_saradc_channel_data() 54 return -EBUSY; in rockchip_saradc_channel_data() [all …]
|
| /openbmc/u-boot/drivers/misc/ |
| H A D | rockchip-efuse.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 * Written by Philipp Tomsich <philipp.tomsich@theobroma-systems.com> 31 u32 ctrl; /* 0x00 efuse control register */ member 55 struct udevice *dev; in dump_efuses() local 61 DM_GET_DRIVER(rockchip_efuse), &dev); in dump_efuses() 63 printf("%s: no misc-device found\n", __func__); in dump_efuses() 67 ret = misc_read(dev, 0, &fuses, sizeof(fuses)); in dump_efuses() 73 printf("efuse-contents:\n"); in dump_efuses() 86 static int rockchip_rk3399_efuse_read(struct udevice *dev, int offset, in rockchip_rk3399_efuse_read() argument 89 struct rockchip_efuse_platdata *plat = dev_get_platdata(dev); in rockchip_rk3399_efuse_read() [all …]
|
| /openbmc/u-boot/arch/arm/mach-orion5x/ |
| H A D | cpu.c | 1 // SPDX-License-Identifier: GPL-2.0+ 8 * Written-by: Prafulla Wadaskar <prafulla@marvell.com> 15 #include <u-boot/md5.h> 25 writel(readl(&cpureg->rstoutn_mask) | (1 << 2), in reset_cpu() 26 &cpureg->rstoutn_mask); in reset_cpu() 27 writel(readl(&cpureg->sys_soft_rst) | 1, in reset_cpu() 28 &cpureg->sys_soft_rst); in reset_cpu() 48 * sizeval = (u32) ceil((double) sizeval / 65536.0) - 1 in orion5x_winctrl_calcsize() 50 sizeval = (sizeval - 1) >> 16; in orion5x_winctrl_calcsize() 54 * We need only treat bits 15-0. in orion5x_winctrl_calcsize() [all …]
|
| /openbmc/u-boot/drivers/video/sunxi/ |
| H A D | sunxi_dw_hdmi.c | 1 // SPDX-License-Identifier: GPL-2.0+ 28 u32 ctrl; member 64 * HDMI PHY settings are taken as-is from Allwinner BSP code. in sunxi_dw_hdmi_phy_init() 67 writel(0, &phy->ctrl); in sunxi_dw_hdmi_phy_init() 68 setbits_le32(&phy->ctrl, BIT(0)); in sunxi_dw_hdmi_phy_init() 70 setbits_le32(&phy->ctrl, BIT(16)); in sunxi_dw_hdmi_phy_init() 71 setbits_le32(&phy->ctrl, BIT(1)); in sunxi_dw_hdmi_phy_init() 73 setbits_le32(&phy->ctrl, BIT(2)); in sunxi_dw_hdmi_phy_init() 75 setbits_le32(&phy->ctrl, BIT(3)); in sunxi_dw_hdmi_phy_init() 77 setbits_le32(&phy->ctrl, BIT(19)); in sunxi_dw_hdmi_phy_init() [all …]
|
| /openbmc/qemu/hw/misc/ |
| H A D | bcm2835_mphi.c | 5 * allow the dwc-otg USB host controller driver in the Raspbian kernel 25 #include "qemu/error-report.h" 27 #include "qemu/main-loop.h" 31 qemu_set_irq(s->irq, 1); in mphi_raise_irq() 36 qemu_set_irq(s->irq, 0); in mphi_lower_irq() 46 val = s->outdda; in mphi_reg_read() 49 val = s->outddb; in mphi_reg_read() 51 case 0x4c: /* ctrl */ in mphi_reg_read() 52 val = s->ctrl; in mphi_reg_read() 56 val = s->intstat; in mphi_reg_read() [all …]
|
| /openbmc/u-boot/drivers/phy/ |
| H A D | sti_usb_phy.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved 13 #include <generic-phy.h> 16 #include <reset-uclass.h> 40 int ctrl; member 47 ret = reset_deassert(&phy->global_ctl); in sti_usb_phy_deassert() 53 ret = reset_deassert(&phy->port_ctl); in sti_usb_phy_deassert() 62 struct udevice *dev = usb_phy->dev; in sti_usb_phy_init() local 63 struct sti_usb_phy *phy = dev_get_priv(dev); in sti_usb_phy_init() 66 /* set ctrl picophy value */ in sti_usb_phy_init() [all …]
|
| /openbmc/u-boot/drivers/nvme/ |
| H A D | nvme.c | 1 // SPDX-License-Identifier: GPL-2.0+ 12 #include <dm/device-internal.h> 34 struct nvme_dev *dev; member 50 static int nvme_wait_ready(struct nvme_dev *dev, bool enabled) in nvme_wait_ready() argument 57 timeout = NVME_CAP_TIMEOUT(dev->cap) * 500; in nvme_wait_ready() 61 if ((readl(&dev->bar->csts) & NVME_CSTS_RDY) == bit) in nvme_wait_ready() 65 return -ETIME; in nvme_wait_ready() 68 static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, in nvme_setup_prps() argument 71 u32 page_size = dev->page_size; in nvme_setup_prps() 72 int offset = dma_addr & (page_size - 1); in nvme_setup_prps() [all …]
|
| /openbmc/u-boot/drivers/watchdog/ |
| H A D | ast_wdt.c | 1 // SPDX-License-Identifier: GPL-2.0+ 80 u32 ctrl; member 84 /* On pre-ast2500 SoCs this register is reserved. */ 98 static int ast_wdt_start(struct udevice *dev, u64 timeout, ulong flags) in ast_wdt_start() argument 100 struct ast_wdt_priv *priv = dev_get_priv(dev); in ast_wdt_start() 102 writel((u32) timeout, &priv->regs->counter_reload_val); in ast_wdt_start() 104 writel(WDT_COUNTER_RESTART_VAL, &priv->regs->counter_restart); in ast_wdt_start() 106 writel(WDT_CTRL_EN | WDT_CTRL_RESET, &priv->regs->ctrl); in ast_wdt_start() 111 static int ast_wdt_stop(struct udevice *dev) in ast_wdt_stop() argument 113 struct ast_wdt_priv *priv = dev_get_priv(dev); in ast_wdt_stop() [all …]
|
| /openbmc/u-boot/board/theobroma-systems/puma_rk3399/ |
| H A D | puma-rk3399.c | 1 // SPDX-License-Identifier: GPL-2.0+ 14 #include <dm/uclass-internal.h> 24 #include <u-boot/sha256.h> 46 debug("%s: trying to force a power-on reset\n", __func__); in rk3399_force_power_on_reset() 54 if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0, in rk3399_force_power_on_reset() 56 debug("%s: could not find a /config/sysreset-gpio\n", __func__); in rk3399_force_power_on_reset() 71 * This may cause issues during boot-up for some configurations of in spl_board_init() 75 * a power-on reset and (if not) issue an overtemp-reset to reset in spl_board_init() 79 * that could generate a software reset (e.g. U-Boot's sysreset in spl_board_init() 83 if (cru->glb_rst_st != 0) in spl_board_init() [all …]
|