diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-08-29 00:55:06 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2008-09-25 16:26:44 -0400 |
commit | d323ade13b959dfcf14bf18902b600c5cc711dea (patch) | |
tree | 44a83db447688b3fc9d4fe768b321c392b3aad66 /arch/arm/mach-orion5x | |
parent | 104ea0781a7052e03d731e2ff3df8bde66036bad (diff) |
[ARM] Orion: add 88F6183 (Orion-1-90) support
The Orion-1-90 (88F6183) is another member of the Orion SoC family,
which has a 16 bit DDR2 interface, one x1 PCIe port (configurable as
Root Complex or Endpoint), one 10/100/1000 ethernet interface, one
USB 2.0 port with PHY, one SPDIF/I2S interface, one SDIO interface,
one TWSI interface, two UARTs, one SPI interface, a NAND controller,
a crypto engine, and a 4-channel DMA engine.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'arch/arm/mach-orion5x')
-rw-r--r-- | arch/arm/mach-orion5x/common.c | 47 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/include/mach/orion5x.h | 6 |
3 files changed, 53 insertions, 1 deletions
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 8a8b089b8b74..9625ef5975d0 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/mv643xx_eth.h> | 18 | #include <linux/mv643xx_eth.h> |
19 | #include <linux/mv643xx_i2c.h> | 19 | #include <linux/mv643xx_i2c.h> |
20 | #include <linux/ata_platform.h> | 20 | #include <linux/ata_platform.h> |
21 | #include <linux/spi/orion_spi.h> | ||
21 | #include <asm/page.h> | 22 | #include <asm/page.h> |
22 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
23 | #include <asm/timex.h> | 24 | #include <asm/timex.h> |
@@ -271,6 +272,38 @@ void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data) | |||
271 | 272 | ||
272 | 273 | ||
273 | /***************************************************************************** | 274 | /***************************************************************************** |
275 | * SPI | ||
276 | ****************************************************************************/ | ||
277 | static struct orion_spi_info orion5x_spi_plat_data = { | ||
278 | .tclk = 0, | ||
279 | }; | ||
280 | |||
281 | static struct resource orion5x_spi_resources[] = { | ||
282 | { | ||
283 | .name = "spi base", | ||
284 | .start = SPI_PHYS_BASE, | ||
285 | .end = SPI_PHYS_BASE + 0x1f, | ||
286 | .flags = IORESOURCE_MEM, | ||
287 | }, | ||
288 | }; | ||
289 | |||
290 | static struct platform_device orion5x_spi = { | ||
291 | .name = "orion_spi", | ||
292 | .id = 0, | ||
293 | .dev = { | ||
294 | .platform_data = &orion5x_spi_plat_data, | ||
295 | }, | ||
296 | .num_resources = ARRAY_SIZE(orion5x_spi_resources), | ||
297 | .resource = orion5x_spi_resources, | ||
298 | }; | ||
299 | |||
300 | void __init orion5x_spi_init() | ||
301 | { | ||
302 | platform_device_register(&orion5x_spi); | ||
303 | } | ||
304 | |||
305 | |||
306 | /***************************************************************************** | ||
274 | * UART0 | 307 | * UART0 |
275 | ****************************************************************************/ | 308 | ****************************************************************************/ |
276 | static struct plat_serial8250_port orion5x_uart0_data[] = { | 309 | static struct plat_serial8250_port orion5x_uart0_data[] = { |
@@ -462,6 +495,13 @@ int orion5x_tclk; | |||
462 | 495 | ||
463 | int __init orion5x_find_tclk(void) | 496 | int __init orion5x_find_tclk(void) |
464 | { | 497 | { |
498 | u32 dev, rev; | ||
499 | |||
500 | orion5x_pcie_id(&dev, &rev); | ||
501 | if (dev == MV88F6183_DEV_ID && | ||
502 | (readl(MPP_RESET_SAMPLE) & 0x00000200) == 0) | ||
503 | return 133333333; | ||
504 | |||
465 | return 166666667; | 505 | return 166666667; |
466 | } | 506 | } |
467 | 507 | ||
@@ -510,6 +550,12 @@ static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name) | |||
510 | } else { | 550 | } else { |
511 | *dev_name = "MV88F5181(L)-Rev-Unsupported"; | 551 | *dev_name = "MV88F5181(L)-Rev-Unsupported"; |
512 | } | 552 | } |
553 | } else if (*dev == MV88F6183_DEV_ID) { | ||
554 | if (*rev == MV88F6183_REV_B0) { | ||
555 | *dev_name = "MV88F6183-Rev-B0"; | ||
556 | } else { | ||
557 | *dev_name = "MV88F6183-Rev-Unsupported"; | ||
558 | } | ||
513 | } else { | 559 | } else { |
514 | *dev_name = "Device-Unknown"; | 560 | *dev_name = "Device-Unknown"; |
515 | } | 561 | } |
@@ -524,6 +570,7 @@ void __init orion5x_init(void) | |||
524 | printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); | 570 | printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); |
525 | 571 | ||
526 | orion5x_eth_shared_data.t_clk = orion5x_tclk; | 572 | orion5x_eth_shared_data.t_clk = orion5x_tclk; |
573 | orion5x_spi_plat_data.tclk = orion5x_tclk; | ||
527 | orion5x_uart0_data[0].uartclk = orion5x_tclk; | 574 | orion5x_uart0_data[0].uartclk = orion5x_tclk; |
528 | orion5x_uart1_data[0].uartclk = orion5x_tclk; | 575 | orion5x_uart1_data[0].uartclk = orion5x_tclk; |
529 | 576 | ||
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index c8598cc7cd58..af9588d23f29 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h | |||
@@ -31,6 +31,7 @@ void orion5x_ehci1_init(void); | |||
31 | void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data); | 31 | void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data); |
32 | void orion5x_i2c_init(void); | 32 | void orion5x_i2c_init(void); |
33 | void orion5x_sata_init(struct mv_sata_platform_data *sata_data); | 33 | void orion5x_sata_init(struct mv_sata_platform_data *sata_data); |
34 | void orion5x_spi_init(void); | ||
34 | void orion5x_uart0_init(void); | 35 | void orion5x_uart0_init(void); |
35 | void orion5x_uart1_init(void); | 36 | void orion5x_uart1_init(void); |
36 | void orion5x_xor_init(void); | 37 | void orion5x_xor_init(void); |
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h index 61eb74a88862..e67c843baa02 100644 --- a/arch/arm/mach-orion5x/include/mach/orion5x.h +++ b/arch/arm/mach-orion5x/include/mach/orion5x.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/arm/mach-orion5x/include/mach/orion5x.h | 2 | * arch/arm/mach-orion5x/include/mach/orion5x.h |
3 | * | 3 | * |
4 | * Generic definitions of Orion SoC flavors: | 4 | * Generic definitions of Orion SoC flavors: |
5 | * Orion-1, Orion-VoIP, Orion-NAS, and Orion-2. | 5 | * Orion-1, Orion-VoIP, Orion-NAS, Orion-2, and Orion-1-90. |
6 | * | 6 | * |
7 | * Maintainer: Tzachi Perelstein <tzachi@marvell.com> | 7 | * Maintainer: Tzachi Perelstein <tzachi@marvell.com> |
8 | * | 8 | * |
@@ -76,6 +76,9 @@ | |||
76 | #define MV88F5281_REV_D0 4 | 76 | #define MV88F5281_REV_D0 4 |
77 | #define MV88F5281_REV_D1 5 | 77 | #define MV88F5281_REV_D1 5 |
78 | #define MV88F5281_REV_D2 6 | 78 | #define MV88F5281_REV_D2 6 |
79 | /* Orion-1-90 (88F6183) */ | ||
80 | #define MV88F6183_DEV_ID 0x6183 | ||
81 | #define MV88F6183_REV_B0 3 | ||
79 | 82 | ||
80 | /******************************************************************************* | 83 | /******************************************************************************* |
81 | * Orion Registers Map | 84 | * Orion Registers Map |
@@ -86,6 +89,7 @@ | |||
86 | #define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000) | 89 | #define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000) |
87 | #define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000) | 90 | #define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000) |
88 | #define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x)) | 91 | #define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x)) |
92 | #define SPI_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x0600) | ||
89 | #define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000) | 93 | #define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000) |
90 | #define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000) | 94 | #define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000) |
91 | #define UART0_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2000) | 95 | #define UART0_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2000) |