Lines Matching +full:data +full:- +full:shift
1 // SPDX-License-Identifier: GPL-2.0
3 * Generic SH-4 / SH-4A PCIC operations (SH7751, SH7780).
5 * Copyright (C) 2002 - 2009 Paul Mundt
11 #include "pci-sh4.h"
17 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
25 struct pci_channel *chan = bus->sysdata; in sh4_pci_read()
27 u32 data; in sh4_pci_read() local
35 data = pci_read_reg(chan, SH4_PCIPDR); in sh4_pci_read()
40 *val = (data >> ((where & 3) << 3)) & 0xff; in sh4_pci_read()
43 *val = (data >> ((where & 2) << 3)) & 0xffff; in sh4_pci_read()
46 *val = data; in sh4_pci_read()
63 struct pci_channel *chan = bus->sysdata; in sh4_pci_write()
65 int shift; in sh4_pci_write() local
66 u32 data; in sh4_pci_write() local
70 data = pci_read_reg(chan, SH4_PCIPDR); in sh4_pci_write()
75 shift = (where & 3) << 3; in sh4_pci_write()
76 data &= ~(0xff << shift); in sh4_pci_write()
77 data |= ((val & 0xff) << shift); in sh4_pci_write()
80 shift = (where & 2) << 3; in sh4_pci_write()
81 data &= ~(0xffff << shift); in sh4_pci_write()
82 data |= ((val & 0xffff) << shift); in sh4_pci_write()
85 data = val; in sh4_pci_write()
91 pci_write_reg(chan, data, SH4_PCIPDR); in sh4_pci_write()