Lines Matching +full:data +full:- +full:shift
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series.
5 * Copyright (C) 2001-2003 MontaVista Software Inc.
7 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
12 * - New creation, NEC VR4122 and VR4131 are supported.
30 return -EINVAL; in set_pci_configuration_address()
39 return -EINVAL; in set_pci_configuration_address()
51 uint32_t data; in pci_config_read() local
54 if (set_pci_configuration_address(bus->number, devfn, where) < 0) in pci_config_read()
57 data = readl(PCICONFDREG); in pci_config_read()
61 *val = (data >> ((where & 3) << 3)) & 0xffU; in pci_config_read()
64 *val = (data >> ((where & 2) << 3)) & 0xffffU; in pci_config_read()
67 *val = data; in pci_config_read()
79 uint32_t data; in pci_config_write() local
80 int shift; in pci_config_write() local
82 if (set_pci_configuration_address(bus->number, devfn, where) < 0) in pci_config_write()
85 data = readl(PCICONFDREG); in pci_config_write()
89 shift = (where & 3) << 3; in pci_config_write()
90 data &= ~(0xffU << shift); in pci_config_write()
91 data |= ((val & 0xffU) << shift); in pci_config_write()
94 shift = (where & 2) << 3; in pci_config_write()
95 data &= ~(0xffffU << shift); in pci_config_write()
96 data |= ((val & 0xffffU) << shift); in pci_config_write()
99 data = val; in pci_config_write()
105 writel(data, PCICONFDREG); in pci_config_write()