mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-06 12:44:14 +08:00
staging: mt7621-pci: avoid mapping sysctls registers
The sysctl register are already claimed by palmbus, so
pci fails to claim it. The best way to access the sysc registers
is to use rt_sysc_[rwm]32().
Fixes: 89e9f6e6ad
: staging: mt7621-pci: remap and use sysctl from device tree
Reported-by: NeilBrown <neil@brown.name>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Tested-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
64c4c4ca6c
commit
ce0c99e22e
@ -185,7 +185,6 @@ struct mt7621_pcie_port {
|
|||||||
/**
|
/**
|
||||||
* struct mt7621_pcie - PCIe host information
|
* struct mt7621_pcie - PCIe host information
|
||||||
* @base: IO Mapped Register Base
|
* @base: IO Mapped Register Base
|
||||||
* @sysctl: system control mapped register base
|
|
||||||
* @io: IO resource
|
* @io: IO resource
|
||||||
* @mem: non-prefetchable memory resource
|
* @mem: non-prefetchable memory resource
|
||||||
* @busn: bus range
|
* @busn: bus range
|
||||||
@ -195,7 +194,6 @@ struct mt7621_pcie_port {
|
|||||||
*/
|
*/
|
||||||
struct mt7621_pcie {
|
struct mt7621_pcie {
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
void __iomem *sysctl;
|
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct resource io;
|
struct resource io;
|
||||||
struct resource mem;
|
struct resource mem;
|
||||||
@ -407,8 +405,7 @@ static void set_phy_for_ssc(struct mt7621_pcie_port *port)
|
|||||||
|
|
||||||
static void mt7621_enable_phy(struct mt7621_pcie_port *port)
|
static void mt7621_enable_phy(struct mt7621_pcie_port *port)
|
||||||
{
|
{
|
||||||
struct mt7621_pcie *pcie = port->pcie;
|
u32 chip_rev_id = rt_sysc_r32(MT7621_CHIP_REV_ID);
|
||||||
u32 chip_rev_id = ioread32(pcie->sysctl + MT7621_CHIP_REV_ID);
|
|
||||||
|
|
||||||
if ((chip_rev_id & 0xFFFF) == CHIP_REV_MT7621_E2)
|
if ((chip_rev_id & 0xFFFF) == CHIP_REV_MT7621_E2)
|
||||||
bypass_pipe_rst(port);
|
bypass_pipe_rst(port);
|
||||||
@ -548,16 +545,6 @@ static int mt7621_pcie_parse_dt(struct mt7621_pcie *pcie)
|
|||||||
if (IS_ERR(pcie->base))
|
if (IS_ERR(pcie->base))
|
||||||
return PTR_ERR(pcie->base);
|
return PTR_ERR(pcie->base);
|
||||||
|
|
||||||
err = of_address_to_resource(node, 4, ®s);
|
|
||||||
if (err) {
|
|
||||||
dev_err(dev, "missing \"reg\" property\n");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
pcie->sysctl = devm_ioremap_resource(dev, ®s);
|
|
||||||
if (IS_ERR(pcie->sysctl))
|
|
||||||
return PTR_ERR(pcie->sysctl);
|
|
||||||
|
|
||||||
for_each_available_child_of_node(node, child) {
|
for_each_available_child_of_node(node, child) {
|
||||||
int slot;
|
int slot;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user