Skip to content

Commit 8233008

Browse files
committed
Merge tag 'pci-v4.9-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: - Update MAINTAINERS for Intel VMD driver filename - Update Rockchip rk3399 host bridge driver DTS and resets - Fix ROM shadow problem that made some video device initialization fail * tag 'pci-v4.9-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: VMD: Update filename to reflect move arm64: dts: rockchip: add three new resets for rk3399 PCIe controller PCI: rockchip: Add three new resets as required properties PCI: Don't attempt to claim shadow copies of ROM
2 parents 4fb68f9 + bc79c98 commit 8233008

5 files changed

Lines changed: 84 additions & 6 deletions

File tree

Documentation/devicetree/bindings/pci/rockchip-pcie.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ Required properties:
2626
- "sys"
2727
- "legacy"
2828
- "client"
29-
- resets: Must contain five entries for each entry in reset-names.
29+
- resets: Must contain seven entries for each entry in reset-names.
3030
See ../reset/reset.txt for details.
3131
- reset-names: Must include the following names
3232
- "core"
3333
- "mgmt"
3434
- "mgmt-sticky"
3535
- "pipe"
36+
- "pm"
37+
- "aclk"
38+
- "pclk"
3639
- pinctrl-names : The pin control state names
3740
- pinctrl-0: The "default" pinctrl state
3841
- #interrupt-cells: specifies the number of cells needed to encode an
@@ -86,8 +89,10 @@ pcie0: pcie@f8000000 {
8689
reg = <0x0 0xf8000000 0x0 0x2000000>, <0x0 0xfd000000 0x0 0x1000000>;
8790
reg-names = "axi-base", "apb-base";
8891
resets = <&cru SRST_PCIE_CORE>, <&cru SRST_PCIE_MGMT>,
89-
<&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE>;
90-
reset-names = "core", "mgmt", "mgmt-sticky", "pipe";
92+
<&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE> ,
93+
<&cru SRST_PCIE_PM>, <&cru SRST_P_PCIE>, <&cru SRST_A_PCIE>;
94+
reset-names = "core", "mgmt", "mgmt-sticky", "pipe",
95+
"pm", "pclk", "aclk";
9196
phys = <&pcie_phy>;
9297
phy-names = "pcie-phy";
9398
pinctrl-names = "default";

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9335,7 +9335,7 @@ PCI DRIVER FOR INTEL VOLUME MANAGEMENT DEVICE (VMD)
93359335
M: Keith Busch <keith.busch@intel.com>
93369336
L: linux-pci@vger.kernel.org
93379337
S: Supported
9338-
F: arch/x86/pci/vmd.c
9338+
F: drivers/pci/host/vmd.c
93399339

93409340
PCIE DRIVER FOR ST SPEAR13XX
93419341
M: Pratyush Anand <pratyush.anand@gmail.com>

arch/arm64/boot/dts/rockchip/rk3399.dtsi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,11 @@
300300
ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x600000
301301
0x81000000 0x0 0xfa600000 0x0 0xfa600000 0x0 0x100000>;
302302
resets = <&cru SRST_PCIE_CORE>, <&cru SRST_PCIE_MGMT>,
303-
<&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE>;
304-
reset-names = "core", "mgmt", "mgmt-sticky", "pipe";
303+
<&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE>,
304+
<&cru SRST_PCIE_PM>, <&cru SRST_P_PCIE>,
305+
<&cru SRST_A_PCIE>;
306+
reset-names = "core", "mgmt", "mgmt-sticky", "pipe",
307+
"pm", "pclk", "aclk";
305308
status = "disabled";
306309

307310
pcie0_intc: interrupt-controller {

drivers/pci/host/pcie-rockchip.c

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ struct rockchip_pcie {
190190
struct reset_control *mgmt_rst;
191191
struct reset_control *mgmt_sticky_rst;
192192
struct reset_control *pipe_rst;
193+
struct reset_control *pm_rst;
194+
struct reset_control *aclk_rst;
195+
struct reset_control *pclk_rst;
193196
struct clk *aclk_pcie;
194197
struct clk *aclk_perf_pcie;
195198
struct clk *hclk_pcie;
@@ -408,6 +411,44 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
408411

409412
gpiod_set_value(rockchip->ep_gpio, 0);
410413

414+
err = reset_control_assert(rockchip->aclk_rst);
415+
if (err) {
416+
dev_err(dev, "assert aclk_rst err %d\n", err);
417+
return err;
418+
}
419+
420+
err = reset_control_assert(rockchip->pclk_rst);
421+
if (err) {
422+
dev_err(dev, "assert pclk_rst err %d\n", err);
423+
return err;
424+
}
425+
426+
err = reset_control_assert(rockchip->pm_rst);
427+
if (err) {
428+
dev_err(dev, "assert pm_rst err %d\n", err);
429+
return err;
430+
}
431+
432+
udelay(10);
433+
434+
err = reset_control_deassert(rockchip->pm_rst);
435+
if (err) {
436+
dev_err(dev, "deassert pm_rst err %d\n", err);
437+
return err;
438+
}
439+
440+
err = reset_control_deassert(rockchip->aclk_rst);
441+
if (err) {
442+
dev_err(dev, "deassert mgmt_sticky_rst err %d\n", err);
443+
return err;
444+
}
445+
446+
err = reset_control_deassert(rockchip->pclk_rst);
447+
if (err) {
448+
dev_err(dev, "deassert mgmt_sticky_rst err %d\n", err);
449+
return err;
450+
}
451+
411452
err = phy_init(rockchip->phy);
412453
if (err < 0) {
413454
dev_err(dev, "fail to init phy, err %d\n", err);
@@ -781,6 +822,27 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
781822
return PTR_ERR(rockchip->pipe_rst);
782823
}
783824

825+
rockchip->pm_rst = devm_reset_control_get(dev, "pm");
826+
if (IS_ERR(rockchip->pm_rst)) {
827+
if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
828+
dev_err(dev, "missing pm reset property in node\n");
829+
return PTR_ERR(rockchip->pm_rst);
830+
}
831+
832+
rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
833+
if (IS_ERR(rockchip->pclk_rst)) {
834+
if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
835+
dev_err(dev, "missing pclk reset property in node\n");
836+
return PTR_ERR(rockchip->pclk_rst);
837+
}
838+
839+
rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
840+
if (IS_ERR(rockchip->aclk_rst)) {
841+
if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
842+
dev_err(dev, "missing aclk reset property in node\n");
843+
return PTR_ERR(rockchip->aclk_rst);
844+
}
845+
784846
rockchip->ep_gpio = devm_gpiod_get(dev, "ep", GPIOD_OUT_HIGH);
785847
if (IS_ERR(rockchip->ep_gpio)) {
786848
dev_err(dev, "missing ep-gpios property in node\n");

drivers/pci/setup-res.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
121121
return -EINVAL;
122122
}
123123

124+
/*
125+
* If we have a shadow copy in RAM, the PCI device doesn't respond
126+
* to the shadow range, so we don't need to claim it, and upstream
127+
* bridges don't need to route the range to the device.
128+
*/
129+
if (res->flags & IORESOURCE_ROM_SHADOW)
130+
return 0;
131+
124132
root = pci_find_parent_resource(dev, res);
125133
if (!root) {
126134
dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n",

0 commit comments

Comments
 (0)