PCI: dwc: Group DBI registers writes requiring unlocking
authorVidya Sagar <vidyas@nvidia.com>
Tue, 13 Aug 2019 11:36:17 +0000 (17:06 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 13 Aug 2019 14:42:27 +0000 (15:42 +0100)
commit3924bc2fd1b607faa5cb0bc0655e9853656de31a
tree2e64e6596a718533a03d37ff0874f71dc2f81fe8
parent8c7e96d3fe75bb41fadf23e7a494f37d1cd9906c
PCI: dwc: Group DBI registers writes requiring unlocking

Some of DesignWare core's DBI registers (a.k.a configuration space
registers) are write-protected with a lock without enabling which they
are read-only by default.

These write-protected registers are implementation specific. Tegra194's
BAR-0 register which is at offset 0x10 in the configuration space is an
example. Current implementation in dw_pcie_setup_rc() API attempts to
unlock those write-protected registers whenever they are updated and
lock them back again for writing.

Group all write-protected registers writes so that locking and unlocking
is performed once to avoid bloating the code with multiple unlock/lock
sequences for all those write-protected registers.

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
drivers/pci/controller/dwc/pcie-designware-host.c