|
@@ -18,6 +18,7 @@
|
|
|
#include <linux/mv643xx_eth.h>
|
|
|
#include <linux/mv643xx_i2c.h>
|
|
|
#include <linux/ata_platform.h>
|
|
|
+#include <linux/spi/orion_spi.h>
|
|
|
#include <asm/page.h>
|
|
|
#include <asm/setup.h>
|
|
|
#include <asm/timex.h>
|
|
@@ -270,6 +271,38 @@ void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data)
|
|
|
}
|
|
|
|
|
|
|
|
|
+/*****************************************************************************
|
|
|
+ * SPI
|
|
|
+ ****************************************************************************/
|
|
|
+static struct orion_spi_info orion5x_spi_plat_data = {
|
|
|
+ .tclk = 0,
|
|
|
+};
|
|
|
+
|
|
|
+static struct resource orion5x_spi_resources[] = {
|
|
|
+ {
|
|
|
+ .name = "spi base",
|
|
|
+ .start = SPI_PHYS_BASE,
|
|
|
+ .end = SPI_PHYS_BASE + 0x1f,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device orion5x_spi = {
|
|
|
+ .name = "orion_spi",
|
|
|
+ .id = 0,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &orion5x_spi_plat_data,
|
|
|
+ },
|
|
|
+ .num_resources = ARRAY_SIZE(orion5x_spi_resources),
|
|
|
+ .resource = orion5x_spi_resources,
|
|
|
+};
|
|
|
+
|
|
|
+void __init orion5x_spi_init()
|
|
|
+{
|
|
|
+ platform_device_register(&orion5x_spi);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/*****************************************************************************
|
|
|
* UART0
|
|
|
****************************************************************************/
|
|
@@ -462,6 +495,13 @@ int orion5x_tclk;
|
|
|
|
|
|
int __init orion5x_find_tclk(void)
|
|
|
{
|
|
|
+ u32 dev, rev;
|
|
|
+
|
|
|
+ orion5x_pcie_id(&dev, &rev);
|
|
|
+ if (dev == MV88F6183_DEV_ID &&
|
|
|
+ (readl(MPP_RESET_SAMPLE) & 0x00000200) == 0)
|
|
|
+ return 133333333;
|
|
|
+
|
|
|
return 166666667;
|
|
|
}
|
|
|
|
|
@@ -510,6 +550,12 @@ static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
|
|
|
} else {
|
|
|
*dev_name = "MV88F5181(L)-Rev-Unsupported";
|
|
|
}
|
|
|
+ } else if (*dev == MV88F6183_DEV_ID) {
|
|
|
+ if (*rev == MV88F6183_REV_B0) {
|
|
|
+ *dev_name = "MV88F6183-Rev-B0";
|
|
|
+ } else {
|
|
|
+ *dev_name = "MV88F6183-Rev-Unsupported";
|
|
|
+ }
|
|
|
} else {
|
|
|
*dev_name = "Device-Unknown";
|
|
|
}
|
|
@@ -524,6 +570,7 @@ void __init orion5x_init(void)
|
|
|
printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
|
|
|
|
|
|
orion5x_eth_shared_data.t_clk = orion5x_tclk;
|
|
|
+ orion5x_spi_plat_data.tclk = orion5x_tclk;
|
|
|
orion5x_uart0_data[0].uartclk = orion5x_tclk;
|
|
|
orion5x_uart1_data[0].uartclk = orion5x_tclk;
|
|
|
|