Commit 725278e0 authored by Russell King's avatar Russell King
parents c947f69f 7350f419
...@@ -854,10 +854,9 @@ int __init kirkwood_find_tclk(void) ...@@ -854,10 +854,9 @@ int __init kirkwood_find_tclk(void)
kirkwood_pcie_id(&dev, &rev); kirkwood_pcie_id(&dev, &rev);
if ((dev == MV88F6281_DEV_ID && (rev == MV88F6281_REV_A0 || if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
rev == MV88F6281_REV_A1)) || if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
(dev == MV88F6282_DEV_ID)) return 200000000;
return 200000000;
return 166666667; return 166666667;
} }
......
...@@ -225,5 +225,5 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2") ...@@ -225,5 +225,5 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
.init_machine = d2net_v2_init, .init_machine = d2net_v2_init,
.map_io = kirkwood_map_io, .map_io = kirkwood_map_io,
.init_irq = kirkwood_init_irq, .init_irq = kirkwood_init_irq,
.timer = &lacie_v2_timer, .timer = &kirkwood_timer,
MACHINE_END MACHINE_END
...@@ -111,17 +111,3 @@ void __init lacie_v2_hdd_power_init(int hdd_num) ...@@ -111,17 +111,3 @@ void __init lacie_v2_hdd_power_init(int hdd_num)
pr_err("Failed to power up HDD%d\n", i + 1); pr_err("Failed to power up HDD%d\n", i + 1);
} }
} }
/*****************************************************************************
* Timer
****************************************************************************/
static void lacie_v2_timer_init(void)
{
kirkwood_tclk = 166666667;
orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
}
struct sys_timer lacie_v2_timer = {
.init = lacie_v2_timer_init,
};
...@@ -13,6 +13,4 @@ void lacie_v2_register_flash(void); ...@@ -13,6 +13,4 @@ void lacie_v2_register_flash(void);
void lacie_v2_register_i2c_devices(void); void lacie_v2_register_i2c_devices(void);
void lacie_v2_hdd_power_init(int hdd_num); void lacie_v2_hdd_power_init(int hdd_num);
extern struct sys_timer lacie_v2_timer;
#endif #endif
...@@ -59,7 +59,7 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list) ...@@ -59,7 +59,7 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list)
} }
printk("\n"); printk("\n");
while (*mpp_list) { for ( ; *mpp_list; mpp_list++) {
unsigned int num = MPP_NUM(*mpp_list); unsigned int num = MPP_NUM(*mpp_list);
unsigned int sel = MPP_SEL(*mpp_list); unsigned int sel = MPP_SEL(*mpp_list);
int shift, gpio_mode; int shift, gpio_mode;
...@@ -88,8 +88,6 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list) ...@@ -88,8 +88,6 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list)
if (sel != 0) if (sel != 0)
gpio_mode = 0; gpio_mode = 0;
orion_gpio_set_valid(num, gpio_mode); orion_gpio_set_valid(num, gpio_mode);
mpp_list++;
} }
printk(KERN_DEBUG " final MPP regs:"); printk(KERN_DEBUG " final MPP regs:");
......
...@@ -262,7 +262,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2") ...@@ -262,7 +262,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
.init_machine = netspace_v2_init, .init_machine = netspace_v2_init,
.map_io = kirkwood_map_io, .map_io = kirkwood_map_io,
.init_irq = kirkwood_init_irq, .init_irq = kirkwood_init_irq,
.timer = &lacie_v2_timer, .timer = &kirkwood_timer,
MACHINE_END MACHINE_END
#endif #endif
...@@ -272,7 +272,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2") ...@@ -272,7 +272,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
.init_machine = netspace_v2_init, .init_machine = netspace_v2_init,
.map_io = kirkwood_map_io, .map_io = kirkwood_map_io,
.init_irq = kirkwood_init_irq, .init_irq = kirkwood_init_irq,
.timer = &lacie_v2_timer, .timer = &kirkwood_timer,
MACHINE_END MACHINE_END
#endif #endif
...@@ -282,6 +282,6 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2") ...@@ -282,6 +282,6 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
.init_machine = netspace_v2_init, .init_machine = netspace_v2_init,
.map_io = kirkwood_map_io, .map_io = kirkwood_map_io,
.init_irq = kirkwood_init_irq, .init_irq = kirkwood_init_irq,
.timer = &lacie_v2_timer, .timer = &kirkwood_timer,
MACHINE_END MACHINE_END
#endif #endif
...@@ -403,7 +403,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2") ...@@ -403,7 +403,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
.init_machine = netxbig_v2_init, .init_machine = netxbig_v2_init,
.map_io = kirkwood_map_io, .map_io = kirkwood_map_io,
.init_irq = kirkwood_init_irq, .init_irq = kirkwood_init_irq,
.timer = &lacie_v2_timer, .timer = &kirkwood_timer,
MACHINE_END MACHINE_END
#endif #endif
...@@ -413,6 +413,6 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2") ...@@ -413,6 +413,6 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
.init_machine = netxbig_v2_init, .init_machine = netxbig_v2_init,
.map_io = kirkwood_map_io, .map_io = kirkwood_map_io,
.init_irq = kirkwood_init_irq, .init_irq = kirkwood_init_irq,
.timer = &lacie_v2_timer, .timer = &kirkwood_timer,
MACHINE_END MACHINE_END
#endif #endif
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
#include "mpp.h" #include "mpp.h"
#include "tsx1x-common.h" #include "tsx1x-common.h"
/* for the PCIe reset workaround */
#include <plat/pcie.h>
#define QNAP_TS41X_JUMPER_JP1 45 #define QNAP_TS41X_JUMPER_JP1 45
static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = { static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = {
...@@ -140,8 +144,16 @@ static void __init qnap_ts41x_init(void) ...@@ -140,8 +144,16 @@ static void __init qnap_ts41x_init(void)
static int __init ts41x_pci_init(void) static int __init ts41x_pci_init(void)
{ {
if (machine_is_ts41x()) if (machine_is_ts41x()) {
/*
* Without this explicit reset, the PCIe SATA controller
* (Marvell 88sx7042/sata_mv) is known to stop working
* after a few minutes.
*/
orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE);
kirkwood_pcie_init(KW_PCIE0); kirkwood_pcie_init(KW_PCIE0);
}
return 0; return 0;
} }
......
...@@ -54,7 +54,7 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list) ...@@ -54,7 +54,7 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
} }
printk("\n"); printk("\n");
while (*mpp_list) { for ( ; *mpp_list; mpp_list++) {
unsigned int num = MPP_NUM(*mpp_list); unsigned int num = MPP_NUM(*mpp_list);
unsigned int sel = MPP_SEL(*mpp_list); unsigned int sel = MPP_SEL(*mpp_list);
int shift, gpio_mode; int shift, gpio_mode;
...@@ -83,8 +83,6 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list) ...@@ -83,8 +83,6 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
if (sel != 0) if (sel != 0)
gpio_mode = 0; gpio_mode = 0;
orion_gpio_set_valid(num, gpio_mode); orion_gpio_set_valid(num, gpio_mode);
mpp_list++;
} }
printk(KERN_DEBUG " final MPP regs:"); printk(KERN_DEBUG " final MPP regs:");
......
...@@ -127,7 +127,7 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode) ...@@ -127,7 +127,7 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
/* Initialize gpiolib. */ /* Initialize gpiolib. */
orion_gpio_init(); orion_gpio_init();
while (mode->mpp >= 0) { for ( ; mode->mpp >= 0; mode++) {
u32 *reg; u32 *reg;
int num_type; int num_type;
int shift; int shift;
...@@ -160,8 +160,6 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode) ...@@ -160,8 +160,6 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
orion_gpio_set_unused(mode->mpp); orion_gpio_set_unused(mode->mpp);
orion_gpio_set_valid(mode->mpp, !!(mode->type == MPP_GPIO)); orion_gpio_set_valid(mode->mpp, !!(mode->type == MPP_GPIO));
mode++;
} }
writel(mpp_0_7_ctrl, MPP_0_7_CTRL); writel(mpp_0_7_ctrl, MPP_0_7_CTRL);
......
...@@ -239,7 +239,7 @@ static struct platform_nand_data ts78xx_ts_nand_data = { ...@@ -239,7 +239,7 @@ static struct platform_nand_data ts78xx_ts_nand_data = {
static struct resource ts78xx_ts_nand_resources = { static struct resource ts78xx_ts_nand_resources = {
.start = TS_NAND_DATA, .start = TS_NAND_DATA,
.end = TS_NAND_DATA + 4, .end = TS_NAND_DATA + 4,
.flags = IORESOURCE_IO, .flags = IORESOURCE_MEM,
}; };
static struct platform_device ts78xx_ts_nand_device = { static struct platform_device ts78xx_ts_nand_device = {
......
...@@ -11,12 +11,15 @@ ...@@ -11,12 +11,15 @@
#ifndef __PLAT_PCIE_H #ifndef __PLAT_PCIE_H
#define __PLAT_PCIE_H #define __PLAT_PCIE_H
struct pci_bus;
u32 orion_pcie_dev_id(void __iomem *base); u32 orion_pcie_dev_id(void __iomem *base);
u32 orion_pcie_rev(void __iomem *base); u32 orion_pcie_rev(void __iomem *base);
int orion_pcie_link_up(void __iomem *base); int orion_pcie_link_up(void __iomem *base);
int orion_pcie_x4_mode(void __iomem *base); int orion_pcie_x4_mode(void __iomem *base);
int orion_pcie_get_local_bus_nr(void __iomem *base); int orion_pcie_get_local_bus_nr(void __iomem *base);
void orion_pcie_set_local_bus_nr(void __iomem *base, int nr); void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
void orion_pcie_reset(void __iomem *base);
void orion_pcie_setup(void __iomem *base, void orion_pcie_setup(void __iomem *base,
struct mbus_dram_target_info *dram); struct mbus_dram_target_info *dram);
int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
......
...@@ -181,11 +181,6 @@ void __init orion_pcie_setup(void __iomem *base, ...@@ -181,11 +181,6 @@ void __init orion_pcie_setup(void __iomem *base,
u16 cmd; u16 cmd;
u32 mask; u32 mask;
/*
* soft reset PCIe unit
*/
orion_pcie_reset(base);
/* /*
* Point PCIe unit MBUS decode windows to DRAM space. * Point PCIe unit MBUS decode windows to DRAM space.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment