97 lines
2.6 KiB
Diff
97 lines
2.6 KiB
Diff
--- a/arch/arm/mach-orion5x/dns323-setup.c 2008-10-23 21:16:57.000000000 +1100
|
|
+++ b/arch/arm/mach-orion5x/dns323-setup.c 2008-10-23 21:17:12.000000000 +1100
|
|
@@ -21,6 +21,7 @@
|
|
#include <linux/gpio_keys.h>
|
|
#include <linux/input.h>
|
|
#include <linux/i2c.h>
|
|
+#include <linux/ata_platform.h>
|
|
#include <asm/mach-types.h>
|
|
#include <asm/gpio.h>
|
|
#include <asm/mach/arch.h>
|
|
@@ -67,8 +68,18 @@
|
|
|
|
static int __init dns323_pci_init(void)
|
|
{
|
|
- if (machine_is_dns323())
|
|
- pci_common_init(&dns323_pci);
|
|
+ u32 dev, rev;
|
|
+
|
|
+ orion5x_pcie_id(&dev, &rev);
|
|
+
|
|
+ if (machine_is_dns323()) {
|
|
+ if (dev != MV88F5182_DEV_ID) {
|
|
+ /* The 5182 doesn't really use it's PCI bus, so
|
|
+ * we don't initialise it.
|
|
+ */
|
|
+ pci_common_init(&dns323_pci);
|
|
+ }
|
|
+ }
|
|
|
|
return 0;
|
|
}
|
|
@@ -268,6 +279,13 @@
|
|
.dev = { .platform_data = &dns323_button_data, },
|
|
};
|
|
|
|
+/*****************************************************************************
|
|
+ * SATA
|
|
+ ****************************************************************************/
|
|
+static struct mv_sata_platform_data dns323_sata_data = {
|
|
+ .n_ports = 2,
|
|
+};
|
|
+
|
|
/****************************************************************************
|
|
* General Setup
|
|
*/
|
|
@@ -311,6 +329,11 @@
|
|
|
|
static void __init dns323_init(void)
|
|
{
|
|
+ u32 rev, dev;
|
|
+
|
|
+ /* Whooooooo are we? Who who, who who? */
|
|
+ orion5x_pcie_id(&dev, &rev);
|
|
+
|
|
/* Setup basic Orion functions. Need to be called early. */
|
|
orion5x_init();
|
|
|
|
@@ -326,11 +349,21 @@
|
|
orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
|
|
ORION5X_PCIE_WA_SIZE);
|
|
|
|
- /* set MPP to 0 as D-Link's 2.6.12.6 kernel did */
|
|
- orion5x_write(MPP_0_7_CTRL, 0);
|
|
- orion5x_write(MPP_8_15_CTRL, 0);
|
|
- orion5x_write(MPP_16_19_CTRL, 0);
|
|
- orion5x_write(MPP_DEV_CTRL, 0);
|
|
+ if (dev == MV88F5182_DEV_ID) {
|
|
+ /* The 5182 has a different MPP map, so we wire it up this way
|
|
+ * to let the HDD LEDs do their thing. Values taken directly
|
|
+ * from the D-Link kernel.
|
|
+ */
|
|
+ orion5x_write(MPP_0_7_CTRL, 0x3);
|
|
+ orion5x_write(MPP_8_15_CTRL, 0x55550000);
|
|
+ orion5x_write(MPP_16_19_CTRL, 0x5555);
|
|
+ } else {
|
|
+ /* set MPP to 0 as D-Link's 2.6.12.6 kernel did */
|
|
+ orion5x_write(MPP_0_7_CTRL, 0);
|
|
+ orion5x_write(MPP_8_15_CTRL, 0);
|
|
+ orion5x_write(MPP_16_19_CTRL, 0);
|
|
+ orion5x_write(MPP_DEV_CTRL, 0);
|
|
+ }
|
|
|
|
/* Define used GPIO pins
|
|
|
|
@@ -373,6 +406,11 @@
|
|
printk("ERROR: Failed to read MAC address\n");
|
|
|
|
orion5x_eth_init(&dns323_eth_data);
|
|
+ /* The 5182 has it's SATA controller internally, and it needs it's own
|
|
+ * little init routine.
|
|
+ */
|
|
+ if (dev == MV88F5182_DEV_ID)
|
|
+ orion5x_sata_init(&dns323_sata_data);
|
|
}
|
|
|
|
/* Warning: D-Link uses a wrong mach-type (=526) in their bootloader */
|