Commit 9e613f8a authored by Andrew Lunn's avatar Andrew Lunn Committed by Nicolas Pitre

ARM: orion: Consolidate SATA platform setup.

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarNicolas Pitre <nico@fluxnic.net>
parent 4fcd3f37
...@@ -107,35 +107,11 @@ void __init dove_rtc_init(void) ...@@ -107,35 +107,11 @@ void __init dove_rtc_init(void)
/***************************************************************************** /*****************************************************************************
* SATA * SATA
****************************************************************************/ ****************************************************************************/
static struct resource dove_sata_resources[] = {
{
.name = "sata base",
.start = DOVE_SATA_PHYS_BASE,
.end = DOVE_SATA_PHYS_BASE + 0x5000 - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "sata irq",
.start = IRQ_DOVE_SATA,
.end = IRQ_DOVE_SATA,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device dove_sata = {
.name = "sata_mv",
.id = 0,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(dove_sata_resources),
.resource = dove_sata_resources,
};
void __init dove_sata_init(struct mv_sata_platform_data *sata_data) void __init dove_sata_init(struct mv_sata_platform_data *sata_data)
{ {
sata_data->dram = &dove_mbus_dram_info; orion_sata_init(sata_data, &dove_mbus_dram_info,
dove_sata.dev.platform_data = sata_data; DOVE_SATA_PHYS_BASE, IRQ_DOVE_SATA);
platform_device_register(&dove_sata);
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -172,38 +172,14 @@ static void __init kirkwood_rtc_init(void) ...@@ -172,38 +172,14 @@ static void __init kirkwood_rtc_init(void)
/***************************************************************************** /*****************************************************************************
* SATA * SATA
****************************************************************************/ ****************************************************************************/
static struct resource kirkwood_sata_resources[] = {
{
.name = "sata base",
.start = SATA_PHYS_BASE,
.end = SATA_PHYS_BASE + 0x5000 - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "sata irq",
.start = IRQ_KIRKWOOD_SATA,
.end = IRQ_KIRKWOOD_SATA,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device kirkwood_sata = {
.name = "sata_mv",
.id = 0,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(kirkwood_sata_resources),
.resource = kirkwood_sata_resources,
};
void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
{ {
kirkwood_clk_ctrl |= CGC_SATA0; kirkwood_clk_ctrl |= CGC_SATA0;
if (sata_data->n_ports > 1) if (sata_data->n_ports > 1)
kirkwood_clk_ctrl |= CGC_SATA1; kirkwood_clk_ctrl |= CGC_SATA1;
sata_data->dram = &kirkwood_mbus_dram_info;
kirkwood_sata.dev.platform_data = sata_data; orion_sata_init(sata_data, &kirkwood_mbus_dram_info,
platform_device_register(&kirkwood_sata); SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA);
} }
......
...@@ -275,35 +275,10 @@ void __init mv78xx0_i2c_init(void) ...@@ -275,35 +275,10 @@ void __init mv78xx0_i2c_init(void)
/***************************************************************************** /*****************************************************************************
* SATA * SATA
****************************************************************************/ ****************************************************************************/
static struct resource mv78xx0_sata_resources[] = {
{
.name = "sata base",
.start = SATA_PHYS_BASE,
.end = SATA_PHYS_BASE + 0x5000 - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "sata irq",
.start = IRQ_MV78XX0_SATA,
.end = IRQ_MV78XX0_SATA,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device mv78xx0_sata = {
.name = "sata_mv",
.id = 0,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(mv78xx0_sata_resources),
.resource = mv78xx0_sata_resources,
};
void __init mv78xx0_sata_init(struct mv_sata_platform_data *sata_data) void __init mv78xx0_sata_init(struct mv_sata_platform_data *sata_data)
{ {
sata_data->dram = &mv78xx0_mbus_dram_info; orion_sata_init(sata_data, &mv78xx0_mbus_dram_info,
mv78xx0_sata.dev.platform_data = sata_data; SATA_PHYS_BASE, IRQ_MV78XX0_SATA);
platform_device_register(&mv78xx0_sata);
} }
......
...@@ -119,35 +119,10 @@ void __init orion5x_i2c_init(void) ...@@ -119,35 +119,10 @@ void __init orion5x_i2c_init(void)
/***************************************************************************** /*****************************************************************************
* SATA * SATA
****************************************************************************/ ****************************************************************************/
static struct resource orion5x_sata_resources[] = {
{
.name = "sata base",
.start = ORION5X_SATA_PHYS_BASE,
.end = ORION5X_SATA_PHYS_BASE + 0x5000 - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "sata irq",
.start = IRQ_ORION5X_SATA,
.end = IRQ_ORION5X_SATA,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device orion5x_sata = {
.name = "sata_mv",
.id = 0,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(orion5x_sata_resources),
.resource = orion5x_sata_resources,
};
void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data) void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data)
{ {
sata_data->dram = &orion5x_mbus_dram_info; orion_sata_init(sata_data, &orion5x_mbus_dram_info,
orion5x_sata.dev.platform_data = sata_data; ORION5X_SATA_PHYS_BASE, IRQ_ORION5X_SATA);
platform_device_register(&orion5x_sata);
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/serial_8250.h> #include <linux/serial_8250.h>
#include <linux/mbus.h> #include <linux/mbus.h>
#include <linux/ata_platform.h>
#include <linux/mv643xx_eth.h> #include <linux/mv643xx_eth.h>
#include <linux/mv643xx_i2c.h> #include <linux/mv643xx_i2c.h>
#include <net/dsa.h> #include <net/dsa.h>
...@@ -889,3 +890,37 @@ void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info, ...@@ -889,3 +890,37 @@ void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info,
platform_device_register(&orion_ehci_2); platform_device_register(&orion_ehci_2);
} }
/*****************************************************************************
* SATA
****************************************************************************/
static struct resource orion_sata_resources[2] = {
{
.name = "sata base",
}, {
.name = "sata irq",
},
};
static struct platform_device orion_sata = {
.name = "sata_mv",
.id = 0,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
void __init orion_sata_init(struct mv_sata_platform_data *sata_data,
struct mbus_dram_target_info *mbus_dram_info,
unsigned long mapbase,
unsigned long irq)
{
sata_data->dram = mbus_dram_info;
orion_sata.dev.platform_data = sata_data;
fill_resources(&orion_sata, orion_sata_resources,
mapbase, 0x5000 - 1, irq);
platform_device_register(&orion_sata);
}
...@@ -104,4 +104,9 @@ void __init orion_ehci_1_init(struct mbus_dram_target_info *mbus_dram_info, ...@@ -104,4 +104,9 @@ void __init orion_ehci_1_init(struct mbus_dram_target_info *mbus_dram_info,
void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info, void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info,
unsigned long mapbase, unsigned long mapbase,
unsigned long irq); unsigned long irq);
void __init orion_sata_init(struct mv_sata_platform_data *sata_data,
struct mbus_dram_target_info *mbus_dram_info,
unsigned long mapbase,
unsigned long irq);
#endif #endif
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