Lines Matching refs:pcie2
20 static u32 bcma_core_pcie2_cfg_read(struct bcma_drv_pcie2 *pcie2, u32 addr)
22 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, addr);
23 pcie2_read32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR);
24 return pcie2_read32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA);
28 static void bcma_core_pcie2_cfg_write(struct bcma_drv_pcie2 *pcie2, u32 addr, in bcma_core_pcie2_cfg_write() argument
31 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, addr); in bcma_core_pcie2_cfg_write()
32 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, val); in bcma_core_pcie2_cfg_write()
39 static u32 bcma_core_pcie2_war_delay_perst_enab(struct bcma_drv_pcie2 *pcie2, in bcma_core_pcie2_war_delay_perst_enab() argument
45 val = pcie2_read32(pcie2, BCMA_CORE_PCIE2_CLK_CONTROL); in bcma_core_pcie2_war_delay_perst_enab()
52 pcie2_write32(pcie2, (BCMA_CORE_PCIE2_CLK_CONTROL), val); in bcma_core_pcie2_war_delay_perst_enab()
54 return pcie2_read32(pcie2, BCMA_CORE_PCIE2_CLK_CONTROL); in bcma_core_pcie2_war_delay_perst_enab()
57 static void bcma_core_pcie2_set_ltr_vals(struct bcma_drv_pcie2 *pcie2) in bcma_core_pcie2_set_ltr_vals() argument
60 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, 0x844); in bcma_core_pcie2_set_ltr_vals()
61 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, 0x883c883c); in bcma_core_pcie2_set_ltr_vals()
63 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, 0x848); in bcma_core_pcie2_set_ltr_vals()
64 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, 0x88648864); in bcma_core_pcie2_set_ltr_vals()
66 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, 0x84C); in bcma_core_pcie2_set_ltr_vals()
67 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, 0x90039003); in bcma_core_pcie2_set_ltr_vals()
70 static void bcma_core_pcie2_hw_ltr_war(struct bcma_drv_pcie2 *pcie2) in bcma_core_pcie2_hw_ltr_war() argument
72 u8 core_rev = pcie2->core->id.rev; in bcma_core_pcie2_hw_ltr_war()
78 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, in bcma_core_pcie2_hw_ltr_war()
80 devstsctr2 = pcie2_read32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA); in bcma_core_pcie2_hw_ltr_war()
83 bcma_core_pcie2_set_ltr_vals(pcie2); in bcma_core_pcie2_hw_ltr_war()
91 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, in bcma_core_pcie2_hw_ltr_war()
93 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, devstsctr2); in bcma_core_pcie2_hw_ltr_war()
96 pcie2_write32(pcie2, BCMA_CORE_PCIE2_LTR_STATE, in bcma_core_pcie2_hw_ltr_war()
101 pcie2_write32(pcie2, BCMA_CORE_PCIE2_LTR_STATE, in bcma_core_pcie2_hw_ltr_war()
107 static void pciedev_crwlpciegen2(struct bcma_drv_pcie2 *pcie2) in pciedev_crwlpciegen2() argument
109 u8 core_rev = pcie2->core->id.rev; in pciedev_crwlpciegen2()
121 pcie2_set32(pcie2, BCMA_CORE_PCIE2_CLK_CONTROL, in pciedev_crwlpciegen2()
124 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, in pciedev_crwlpciegen2()
126 pcie2_mask32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, in pciedev_crwlpciegen2()
132 static void pciedev_crwlpciegen2_180(struct bcma_drv_pcie2 *pcie2) in pciedev_crwlpciegen2_180() argument
134 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, PCIE2_PMCR_REFUP); in pciedev_crwlpciegen2_180()
135 pcie2_set32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, 0x1f); in pciedev_crwlpciegen2_180()
138 static void pciedev_crwlpciegen2_182(struct bcma_drv_pcie2 *pcie2) in pciedev_crwlpciegen2_182() argument
140 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, PCIE2_SBMBX); in pciedev_crwlpciegen2_182()
141 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, 1 << 0); in pciedev_crwlpciegen2_182()
144 static void pciedev_reg_pm_clk_period(struct bcma_drv_pcie2 *pcie2) in pciedev_reg_pm_clk_period() argument
146 struct bcma_drv_cc *drv_cc = &pcie2->core->bus->drv_cc; in pciedev_reg_pm_clk_period()
147 u8 core_rev = pcie2->core->id.rev; in pciedev_reg_pm_clk_period()
153 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, in pciedev_reg_pm_clk_period()
155 pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, pm_value); in pciedev_reg_pm_clk_period()
159 void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2) in bcma_core_pcie2_init() argument
161 struct bcma_bus *bus = pcie2->core->bus; in bcma_core_pcie2_init()
165 tmp = pcie2_read32(pcie2, BCMA_CORE_PCIE2_SPROM(54)); in bcma_core_pcie2_init()
167 bcma_core_pcie2_cfg_write(pcie2, 0x4e0, 0x17); in bcma_core_pcie2_init()
172 pcie2->reqsize = 1024; in bcma_core_pcie2_init()
175 pcie2->reqsize = 128; in bcma_core_pcie2_init()
180 bcma_core_pcie2_war_delay_perst_enab(pcie2, true); in bcma_core_pcie2_init()
181 bcma_core_pcie2_hw_ltr_war(pcie2); in bcma_core_pcie2_init()
182 pciedev_crwlpciegen2(pcie2); in bcma_core_pcie2_init()
183 pciedev_reg_pm_clk_period(pcie2); in bcma_core_pcie2_init()
184 pciedev_crwlpciegen2_180(pcie2); in bcma_core_pcie2_init()
185 pciedev_crwlpciegen2_182(pcie2); in bcma_core_pcie2_init()
192 void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2) in bcma_core_pcie2_up() argument
194 struct bcma_bus *bus = pcie2->core->bus; in bcma_core_pcie2_up()
198 err = pcie_set_readrq(dev, pcie2->reqsize); in bcma_core_pcie2_up()