Commit 1e87347c authored by Russell King's avatar Russell King
parents f29251ff 3cff484d
This diff is collapsed.
......@@ -11,24 +11,17 @@
#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/io.h>
#include <plat/mpp.h>
#include <mach/dove.h>
#include "mpp.h"
#define MPP_NR_REGS 4
#define MPP_CTRL(i) ((i) == 3 ? \
DOVE_MPP_CTRL4_VIRT_BASE : \
DOVE_MPP_VIRT_BASE + (i) * 4)
#define PMU_SIG_REGS 2
#define PMU_SIG_CTRL(i) (DOVE_PMU_SIG_CTRL + (i) * 4)
struct dove_mpp_grp {
int start;
int end;
};
static struct dove_mpp_grp dove_mpp_grp[] = {
/* Map a group to a range of GPIO pins in that group */
static const struct dove_mpp_grp dove_mpp_grp[] = {
[MPP_24_39] = {
.start = 24,
.end = 39,
......@@ -38,8 +31,8 @@ static struct dove_mpp_grp dove_mpp_grp[] = {
.end = 45,
},
[MPP_46_51] = {
.start = 40,
.end = 45,
.start = 46,
.end = 51,
},
[MPP_58_61] = {
.start = 58,
......@@ -51,6 +44,8 @@ static struct dove_mpp_grp dove_mpp_grp[] = {
},
};
/* Enable gpio for a range of pins. mode should be a combination of
GPIO_OUTPUT_OK | GPIO_INPUT_OK */
static void dove_mpp_gpio_mode(int start, int end, int gpio_mode)
{
int i;
......@@ -59,24 +54,17 @@ static void dove_mpp_gpio_mode(int start, int end, int gpio_mode)
orion_gpio_set_valid(i, gpio_mode);
}
/* Dump all the extra MPP registers. The platform code will dump the
registers for pins 0-23. */
static void dove_mpp_dump_regs(void)
{
#ifdef DEBUG
int i;
pr_debug("PMU_CTRL4_CTRL: %08x\n",
readl(DOVE_MPP_CTRL4_VIRT_BASE));
pr_debug("MPP_CTRL regs:");
for (i = 0; i < MPP_NR_REGS; i++)
printk(" %08x", readl(MPP_CTRL(i)));
printk("\n");
pr_debug("PMU_MPP_GENERAL_CTRL: %08x\n",
readl(DOVE_PMU_MPP_GENERAL_CTRL));
pr_debug("PMU_SIG_CTRL regs:");
for (i = 0; i < PMU_SIG_REGS; i++)
printk(" %08x", readl(PMU_SIG_CTRL(i)));
printk("\n");
pr_debug("PMU_MPP_GENERAL_CTRL: %08x\n", readl(DOVE_PMU_MPP_GENERAL_CTRL));
pr_debug("MPP_GENERAL: %08x\n", readl(DOVE_MPP_GENERAL_VIRT_BASE));
#endif
}
static void dove_mpp_cfg_nfc(int sel)
......@@ -92,7 +80,7 @@ static void dove_mpp_cfg_nfc(int sel)
static void dove_mpp_cfg_au1(int sel)
{
u32 mpp_ctrl4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
u32 mpp_ctrl4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
u32 ssp_ctrl1 = readl(DOVE_SSP_CTRL_STATUS_1);
u32 mpp_gen_ctrl = readl(DOVE_MPP_GENERAL_VIRT_BASE);
u32 global_cfg_2 = readl(DOVE_GLOBAL_CONFIG_2);
......@@ -128,82 +116,46 @@ static void dove_mpp_cfg_au1(int sel)
writel(global_cfg_2, DOVE_GLOBAL_CONFIG_2);
}
static void dove_mpp_conf_grp(int num, int sel, u32 *mpp_ctrl)
{
int start = dove_mpp_grp[num].start;
int end = dove_mpp_grp[num].end;
int gpio_mode = sel ? GPIO_OUTPUT_OK | GPIO_INPUT_OK : 0;
*mpp_ctrl &= ~(0x1 << num);
*mpp_ctrl |= sel << num;
dove_mpp_gpio_mode(start, end, gpio_mode);
}
void __init dove_mpp_conf(unsigned int *mpp_list)
/* Configure the group registers, enabling GPIO if sel indicates the
pin is to be used for GPIO */
static void dove_mpp_conf_grp(unsigned int *mpp_grp_list)
{
u32 mpp_ctrl[MPP_NR_REGS];
u32 pmu_mpp_ctrl = 0;
u32 pmu_sig_ctrl[PMU_SIG_REGS];
int i;
for (i = 0; i < MPP_NR_REGS; i++)
mpp_ctrl[i] = readl(MPP_CTRL(i));
for (i = 0; i < PMU_SIG_REGS; i++)
pmu_sig_ctrl[i] = readl(PMU_SIG_CTRL(i));
pmu_mpp_ctrl = readl(DOVE_PMU_MPP_GENERAL_CTRL);
u32 mpp_ctrl4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
int gpio_mode;
dove_mpp_dump_regs();
for ( ; *mpp_list != MPP_END; mpp_list++) {
unsigned int num = MPP_NUM(*mpp_list);
unsigned int sel = MPP_SEL(*mpp_list);
int shift, gpio_mode;
if (num > MPP_MAX) {
pr_err("dove: invalid MPP number (%u)\n", num);
continue;
}
if (*mpp_list & MPP_NFC_MASK) {
dove_mpp_cfg_nfc(sel);
continue;
}
for ( ; *mpp_grp_list; mpp_grp_list++) {
unsigned int num = MPP_NUM(*mpp_grp_list);
unsigned int sel = MPP_SEL(*mpp_grp_list);
if (*mpp_list & MPP_AU1_MASK) {
dove_mpp_cfg_au1(sel);
if (num > MPP_GRP_MAX) {
pr_err("dove: invalid MPP GRP number (%u)\n", num);
continue;
}
if (*mpp_list & MPP_GRP_MASK) {
dove_mpp_conf_grp(num, sel, &mpp_ctrl[3]);
continue;
}
shift = (num & 7) << 2;
if (*mpp_list & MPP_PMU_MASK) {
pmu_mpp_ctrl |= (0x1 << num);
pmu_sig_ctrl[num / 8] &= ~(0xf << shift);
pmu_sig_ctrl[num / 8] |= 0xf << shift;
gpio_mode = 0;
} else {
mpp_ctrl[num / 8] &= ~(0xf << shift);
mpp_ctrl[num / 8] |= sel << shift;
gpio_mode = GPIO_OUTPUT_OK | GPIO_INPUT_OK;
}
mpp_ctrl4 &= ~(0x1 << num);
mpp_ctrl4 |= sel << num;
orion_gpio_set_valid(num, gpio_mode);
gpio_mode = sel ? GPIO_OUTPUT_OK | GPIO_INPUT_OK : 0;
dove_mpp_gpio_mode(dove_mpp_grp[num].start,
dove_mpp_grp[num].end, gpio_mode);
}
writel(mpp_ctrl4, DOVE_MPP_CTRL4_VIRT_BASE);
}
for (i = 0; i < MPP_NR_REGS; i++)
writel(mpp_ctrl[i], MPP_CTRL(i));
/* Configure the various MPP pins on Dove */
void __init dove_mpp_conf(unsigned int *mpp_list,
unsigned int *mpp_grp_list,
unsigned int grp_au1_52_57,
unsigned int grp_nfc_64_71)
{
dove_mpp_dump_regs();
for (i = 0; i < PMU_SIG_REGS; i++)
writel(pmu_sig_ctrl[i], PMU_SIG_CTRL(i));
/* Use platform code for pins 0-23 */
orion_mpp_conf(mpp_list, 0, MPP_MAX, DOVE_MPP_VIRT_BASE);
writel(pmu_mpp_ctrl, DOVE_PMU_MPP_GENERAL_CTRL);
dove_mpp_conf_grp(mpp_grp_list);
dove_mpp_cfg_au1(grp_au1_52_57);
dove_mpp_cfg_nfc(grp_nfc_64_71);
dove_mpp_dump_regs();
}
This diff is collapsed.
This diff is collapsed.
......@@ -51,6 +51,7 @@
#define IRQ_KIRKWOOD_GPIO_HIGH_16_23 41
#define IRQ_KIRKWOOD_GE00_ERR 46
#define IRQ_KIRKWOOD_GE01_ERR 47
#define IRQ_KIRKWOOD_RTC 53
/*
* KIRKWOOD General Purpose Pins
......
......@@ -14,6 +14,7 @@
#include <linux/io.h>
#include <asm/gpio.h>
#include <mach/hardware.h>
#include <plat/mpp.h>
#include "common.h"
#include "mpp.h"
......@@ -36,61 +37,8 @@ static unsigned int __init kirkwood_variant(void)
return 0;
}
#define MPP_CTRL(i) (DEV_BUS_VIRT_BASE + (i) * 4)
#define MPP_NR_REGS (1 + MPP_MAX/8)
void __init kirkwood_mpp_conf(unsigned int *mpp_list)
{
u32 mpp_ctrl[MPP_NR_REGS];
unsigned int variant_mask;
int i;
variant_mask = kirkwood_variant();
if (!variant_mask)
return;
printk(KERN_DEBUG "initial MPP regs:");
for (i = 0; i < MPP_NR_REGS; i++) {
mpp_ctrl[i] = readl(MPP_CTRL(i));
printk(" %08x", mpp_ctrl[i]);
}
printk("\n");
for ( ; *mpp_list; mpp_list++) {
unsigned int num = MPP_NUM(*mpp_list);
unsigned int sel = MPP_SEL(*mpp_list);
int shift, gpio_mode;
if (num > MPP_MAX) {
printk(KERN_ERR "kirkwood_mpp_conf: invalid MPP "
"number (%u)\n", num);
continue;
}
if (!(*mpp_list & variant_mask)) {
printk(KERN_WARNING
"kirkwood_mpp_conf: requested MPP%u config "
"unavailable on this hardware\n", num);
continue;
}
shift = (num & 7) << 2;
mpp_ctrl[num / 8] &= ~(0xf << shift);
mpp_ctrl[num / 8] |= sel << shift;
gpio_mode = 0;
if (*mpp_list & MPP_INPUT_MASK)
gpio_mode |= GPIO_INPUT_OK;
if (*mpp_list & MPP_OUTPUT_MASK)
gpio_mode |= GPIO_OUTPUT_OK;
if (sel != 0)
gpio_mode = 0;
orion_gpio_set_valid(num, gpio_mode);
}
printk(KERN_DEBUG " final MPP regs:");
for (i = 0; i < MPP_NR_REGS; i++) {
writel(mpp_ctrl[i], MPP_CTRL(i));
printk(" %08x", mpp_ctrl[i]);
}
printk("\n");
orion_mpp_conf(mpp_list, kirkwood_variant(),
MPP_MAX, DEV_BUS_VIRT_BASE);
}
......@@ -22,14 +22,8 @@
/* available on F6281 */ ((!!(_F6281)) << 17) | \
/* available on F6282 */ ((!!(_F6282)) << 18))
#define MPP_NUM(x) ((x) & 0xff)
#define MPP_SEL(x) (((x) >> 8) & 0xf)
/* num sel i o 6180 6190 6192 6281 6282 */
#define MPP_INPUT_MASK MPP( 0, 0x0, 1, 0, 0, 0, 0, 0, 0 )
#define MPP_OUTPUT_MASK MPP( 0, 0x0, 0, 1, 0, 0, 0, 0, 0 )
#define MPP_F6180_MASK MPP( 0, 0x0, 0, 0, 1, 0, 0, 0, 0 )
#define MPP_F6190_MASK MPP( 0, 0x0, 0, 0, 0, 1, 0, 0, 0 )
#define MPP_F6192_MASK MPP( 0, 0x0, 0, 0, 0, 0, 1, 0, 0 )
......
......@@ -13,7 +13,7 @@
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
#include <linux/mbus.h>
#include <linux/mv643xx_eth.h>
#include <linux/dma-mapping.h>
#include <asm/page.h>
#include <asm/timex.h>
#include <asm/mach/map.h>
......@@ -22,6 +22,7 @@
#include <mach/loki.h>
#include <plat/orion_nand.h>
#include <plat/time.h>
#include <plat/common.h>
#include "common.h"
/*****************************************************************************
......@@ -43,116 +44,28 @@ void __init loki_map_io(void)
/*****************************************************************************
* GE0
* GE00
****************************************************************************/
struct mv643xx_eth_shared_platform_data loki_ge0_shared_data = {
.t_clk = LOKI_TCLK,
.dram = &loki_mbus_dram_info,
};
static struct resource loki_ge0_shared_resources[] = {
{
.name = "ge0 base",
.start = GE0_PHYS_BASE + 0x2000,
.end = GE0_PHYS_BASE + 0x3fff,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device loki_ge0_shared = {
.name = MV643XX_ETH_SHARED_NAME,
.id = 0,
.dev = {
.platform_data = &loki_ge0_shared_data,
},
.num_resources = 1,
.resource = loki_ge0_shared_resources,
};
static struct resource loki_ge0_resources[] = {
{
.name = "ge0 irq",
.start = IRQ_LOKI_GBE_A_INT,
.end = IRQ_LOKI_GBE_A_INT,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device loki_ge0 = {
.name = MV643XX_ETH_NAME,
.id = 0,
.num_resources = 1,
.resource = loki_ge0_resources,
.dev = {
.coherent_dma_mask = 0xffffffff,
},
};
void __init loki_ge0_init(struct mv643xx_eth_platform_data *eth_data)
{
eth_data->shared = &loki_ge0_shared;
loki_ge0.dev.platform_data = eth_data;
writel(0x00079220, GE0_VIRT_BASE + 0x20b0);
platform_device_register(&loki_ge0_shared);
platform_device_register(&loki_ge0);
orion_ge00_init(eth_data, &loki_mbus_dram_info,
GE0_PHYS_BASE, IRQ_LOKI_GBE_A_INT,
0, LOKI_TCLK);
}
/*****************************************************************************
* GE1
* GE01
****************************************************************************/
struct mv643xx_eth_shared_platform_data loki_ge1_shared_data = {
.t_clk = LOKI_TCLK,
.dram = &loki_mbus_dram_info,
};
static struct resource loki_ge1_shared_resources[] = {
{
.name = "ge1 base",
.start = GE1_PHYS_BASE + 0x2000,
.end = GE1_PHYS_BASE + 0x3fff,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device loki_ge1_shared = {
.name = MV643XX_ETH_SHARED_NAME,
.id = 1,
.dev = {
.platform_data = &loki_ge1_shared_data,
},
.num_resources = 1,
.resource = loki_ge1_shared_resources,
};
static struct resource loki_ge1_resources[] = {
{
.name = "ge1 irq",
.start = IRQ_LOKI_GBE_B_INT,
.end = IRQ_LOKI_GBE_B_INT,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device loki_ge1 = {
.name = MV643XX_ETH_NAME,
.id = 1,
.num_resources = 1,
.resource = loki_ge1_resources,
.dev = {
.coherent_dma_mask = 0xffffffff,
},
};
void __init loki_ge1_init(struct mv643xx_eth_platform_data *eth_data)
{
eth_data->shared = &loki_ge1_shared;
loki_ge1.dev.platform_data = eth_data;
writel(0x00079220, GE1_VIRT_BASE + 0x20b0);
platform_device_register(&loki_ge1_shared);
platform_device_register(&loki_ge1);
orion_ge01_init(eth_data, &loki_mbus_dram_info,
GE1_PHYS_BASE, IRQ_LOKI_GBE_B_INT,
0, LOKI_TCLK);
}
......@@ -187,7 +100,7 @@ static struct platform_device loki_sas = {
.name = "mvsas",
.id = 0,
.dev = {
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(loki_sas_resources),
.resource = loki_sas_resources,
......@@ -203,88 +116,19 @@ void __init loki_sas_init(void)
/*****************************************************************************
* UART0
****************************************************************************/
static struct plat_serial8250_port loki_uart0_data[] = {
{
.mapbase = UART0_PHYS_BASE,
.membase = (char *)UART0_VIRT_BASE,
.irq = IRQ_LOKI_UART0,
.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = LOKI_TCLK,
}, {
},
};
static struct resource loki_uart0_resources[] = {
{
.start = UART0_PHYS_BASE,
.end = UART0_PHYS_BASE + 0xff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_LOKI_UART0,
.end = IRQ_LOKI_UART0,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device loki_uart0 = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = loki_uart0_data,
},
.resource = loki_uart0_resources,
.num_resources = ARRAY_SIZE(loki_uart0_resources),
};
void __init loki_uart0_init(void)
{
platform_device_register(&loki_uart0);
orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE,
IRQ_LOKI_UART0, LOKI_TCLK);
}
/*****************************************************************************
* UART1
****************************************************************************/
static struct plat_serial8250_port loki_uart1_data[] = {
{
.mapbase = UART1_PHYS_BASE,
.membase = (char *)UART1_VIRT_BASE,
.irq = IRQ_LOKI_UART1,
.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = LOKI_TCLK,
}, {
},
};
static struct resource loki_uart1_resources[] = {
{
.start = UART1_PHYS_BASE,
.end = UART1_PHYS_BASE + 0xff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_LOKI_UART1,
.end = IRQ_LOKI_UART1,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device loki_uart1 = {
.name = "serial8250",
.id = 1,
.dev = {
.platform_data = loki_uart1_data,
},
.resource = loki_uart1_resources,
.num_resources = ARRAY_SIZE(loki_uart1_resources),
};
void __init loki_uart1_init(void)
{
platform_device_register(&loki_uart1);
orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE,
IRQ_LOKI_UART1, LOKI_TCLK);
}
......
This diff is collapsed.
......@@ -12,6 +12,7 @@
#include <linux/init.h>
#include <linux/mbus.h>
#include <linux/io.h>
#include <plat/mpp.h>
#include <asm/gpio.h>
#include <mach/hardware.h>
#include "common.h"
......@@ -31,61 +32,8 @@ static unsigned int __init mv78xx0_variant(void)
return 0;
}
#define MPP_CTRL(i) (DEV_BUS_VIRT_BASE + (i) * 4)
#define MPP_NR_REGS (1 + MPP_MAX/8)
void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
{
u32 mpp_ctrl[MPP_NR_REGS];
unsigned int variant_mask;
int i;
variant_mask = mv78xx0_variant();
if (!variant_mask)
return;
printk(KERN_DEBUG "initial MPP regs:");
for (i = 0; i < MPP_NR_REGS; i++) {
mpp_ctrl[i] = readl(MPP_CTRL(i));
printk(" %08x", mpp_ctrl[i]);
}
printk("\n");
for ( ; *mpp_list; mpp_list++) {
unsigned int num = MPP_NUM(*mpp_list);
unsigned int sel = MPP_SEL(*mpp_list);
int shift, gpio_mode;
if (num > MPP_MAX) {
printk(KERN_ERR "mv78xx0_mpp_conf: invalid MPP "
"number (%u)\n", num);
continue;
}
if (!(*mpp_list & variant_mask)) {
printk(KERN_WARNING
"mv78xx0_mpp_conf: requested MPP%u config "
"unavailable on this hardware\n", num);
continue;
}
shift = (num & 7) << 2;
mpp_ctrl[num / 8] &= ~(0xf << shift);
mpp_ctrl[num / 8] |= sel << shift;
gpio_mode = 0;
if (*mpp_list & MPP_INPUT_MASK)
gpio_mode |= GPIO_INPUT_OK;
if (*mpp_list & MPP_OUTPUT_MASK)
gpio_mode |= GPIO_OUTPUT_OK;
if (sel != 0)
gpio_mode = 0;
orion_gpio_set_valid(num, gpio_mode);
}
printk(KERN_DEBUG " final MPP regs:");
for (i = 0; i < MPP_NR_REGS; i++) {
writel(mpp_ctrl[i], MPP_CTRL(i));
printk(" %08x", mpp_ctrl[i]);
}
printk("\n");
orion_mpp_conf(mpp_list, mv78xx0_variant(),
MPP_MAX, DEV_BUS_VIRT_BASE);
}
......@@ -19,14 +19,8 @@
/* may be output signal */ ((!!(_out)) << 13) | \
/* available on A0 */ ((!!(_78100_A0)) << 14))
#define MPP_NUM(x) ((x) & 0xff)
#define MPP_SEL(x) (((x) >> 8) & 0xf)
/* num sel i o 78100_A0 */
#define MPP_INPUT_MASK MPP(0, 0x0, 1, 0, 0)
#define MPP_OUTPUT_MASK MPP(0, 0x0, 0, 1, 0)
#define MPP_78100_A0_MASK MPP(0, 0x0, 0, 0, 1)
#define MPP0_GPIO MPP(0, 0x0, 1, 1, 1)
......
This diff is collapsed.
......@@ -267,28 +267,28 @@ static struct platform_device d2net_gpio_buttons = {
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode d2net_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Board ID (bit 0) */
{ 1, MPP_GPIO }, /* Board ID (bit 1) */
{ 2, MPP_GPIO }, /* Board ID (bit 2) */
{ 3, MPP_GPIO }, /* SATA 0 power */
{ 4, MPP_UNUSED },
{ 5, MPP_GPIO }, /* Fan fail detection */
{ 6, MPP_GPIO }, /* Red front LED */
{ 7, MPP_UNUSED },
{ 8, MPP_GPIO }, /* Rear power switch (on|auto) */
{ 9, MPP_GPIO }, /* Rear power switch (auto|off) */
{ 10, MPP_UNUSED },
{ 11, MPP_UNUSED },
{ 12, MPP_GPIO }, /* SATA 1 power */
{ 13, MPP_UNUSED },
{ 14, MPP_SATA_LED }, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */
{ 16, MPP_GPIO }, /* Blue front LED blink control */
{ 17, MPP_UNUSED },
{ 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */
{ 19, MPP_UNUSED },
{ -1 }
static unsigned int d2net_mpp_modes[] __initdata = {
MPP0_GPIO, /* Board ID (bit 0) */
MPP1_GPIO, /* Board ID (bit 1) */
MPP2_GPIO, /* Board ID (bit 2) */
MPP3_GPIO, /* SATA 0 power */
MPP4_UNUSED,
MPP5_GPIO, /* Fan fail detection */
MPP6_GPIO, /* Red front LED */
MPP7_UNUSED,
MPP8_GPIO, /* Rear power switch (on|auto) */
MPP9_GPIO, /* Rear power switch (auto|off) */
MPP10_UNUSED,
MPP11_UNUSED,
MPP12_GPIO, /* SATA 1 power */
MPP13_UNUSED,
MPP14_SATA_LED, /* SATA 0 active */
MPP15_SATA_LED, /* SATA 1 active */
MPP16_GPIO, /* Blue front LED blink control */
MPP17_UNUSED,
MPP18_GPIO, /* Front button (0 = Released, 1 = Pushed ) */
MPP19_UNUSED,
0,
/* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */
/* 23: Blue front LED off */
/* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */
......
......@@ -298,28 +298,28 @@ static struct i2c_board_info __initdata db88f5281_i2c_rtc = {
/*****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode db88f5281_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* USB Over Current */
{ 1, MPP_GPIO }, /* USB Vbat input */
{ 2, MPP_PCI_ARB }, /* PCI_REQn[2] */
{ 3, MPP_PCI_ARB }, /* PCI_GNTn[2] */
{ 4, MPP_PCI_ARB }, /* PCI_REQn[3] */
{ 5, MPP_PCI_ARB }, /* PCI_GNTn[3] */
{ 6, MPP_GPIO }, /* JP0, CON17.2 */
{ 7, MPP_GPIO }, /* JP1, CON17.1 */
{ 8, MPP_GPIO }, /* JP2, CON11.2 */
{ 9, MPP_GPIO }, /* JP3, CON11.3 */
{ 10, MPP_GPIO }, /* RTC int */
{ 11, MPP_GPIO }, /* Baud Rate Generator */
{ 12, MPP_GPIO }, /* PCI int 1 */
{ 13, MPP_GPIO }, /* PCI int 2 */
{ 14, MPP_NAND }, /* NAND_REn[2] */
{ 15, MPP_NAND }, /* NAND_WEn[2] */
{ 16, MPP_UART }, /* UART1_RX */
{ 17, MPP_UART }, /* UART1_TX */
{ 18, MPP_UART }, /* UART1_CTSn */
{ 19, MPP_UART }, /* UART1_RTSn */
{ -1 },
static unsigned int db88f5281_mpp_modes[] __initdata = {
MPP0_GPIO, /* USB Over Current */
MPP1_GPIO, /* USB Vbat input */
MPP2_PCI_ARB, /* PCI_REQn[2] */
MPP3_PCI_ARB, /* PCI_GNTn[2] */
MPP4_PCI_ARB, /* PCI_REQn[3] */
MPP5_PCI_ARB, /* PCI_GNTn[3] */
MPP6_GPIO, /* JP0, CON17.2 */
MPP7_GPIO, /* JP1, CON17.1 */
MPP8_GPIO, /* JP2, CON11.2 */
MPP9_GPIO, /* JP3, CON11.3 */
MPP10_GPIO, /* RTC int */
MPP11_GPIO, /* Baud Rate Generator */
MPP12_GPIO, /* PCI int 1 */
MPP13_GPIO, /* PCI int 2 */
MPP14_NAND, /* NAND_REn[2] */
MPP15_NAND, /* NAND_WEn[2] */
MPP16_UART, /* UART1_RX */
MPP17_UART, /* UART1_TX */
MPP18_UART, /* UART1_CTSn */
MPP19_UART, /* UART1_RTSn */
0,
};
static void __init db88f5281_init(void)
......
......@@ -385,76 +385,76 @@ static struct mv_sata_platform_data dns323_sata_data = {
/****************************************************************************
* General Setup
*/
static struct orion5x_mpp_mode dns323a_mpp_modes[] __initdata = {
{ 0, MPP_PCIE_RST_OUTn },
{ 1, MPP_GPIO }, /* right amber LED (sata ch0) */
{ 2, MPP_GPIO }, /* left amber LED (sata ch1) */
{ 3, MPP_UNUSED },
{ 4, MPP_GPIO }, /* power button LED */
{ 5, MPP_GPIO }, /* power button LED */
{ 6, MPP_GPIO }, /* GMT G751-2f overtemp */
{ 7, MPP_GPIO }, /* M41T80 nIRQ/OUT/SQW */
{ 8, MPP_GPIO }, /* triggers power off */
{ 9, MPP_GPIO }, /* power button switch */
{ 10, MPP_GPIO }, /* reset button switch */
{ 11, MPP_UNUSED },
{ 12, MPP_UNUSED },
{ 13, MPP_UNUSED },
{ 14, MPP_UNUSED },
{ 15, MPP_UNUSED },
{ 16, MPP_UNUSED },
{ 17, MPP_UNUSED },
{ 18, MPP_UNUSED },
{ 19, MPP_UNUSED },
{ -1 },
static unsigned int dns323a_mpp_modes[] __initdata = {
MPP0_PCIE_RST_OUTn,
MPP1_GPIO, /* right amber LED (sata ch0) */
MPP2_GPIO, /* left amber LED (sata ch1) */
MPP3_UNUSED,
MPP4_GPIO, /* power button LED */
MPP5_GPIO, /* power button LED */
MPP6_GPIO, /* GMT G751-2f overtemp */
MPP7_GPIO, /* M41T80 nIRQ/OUT/SQW */
MPP8_GPIO, /* triggers power off */
MPP9_GPIO, /* power button switch */
MPP10_GPIO, /* reset button switch */
MPP11_UNUSED,
MPP12_UNUSED,
MPP13_UNUSED,
MPP14_UNUSED,
MPP15_UNUSED,
MPP16_UNUSED,
MPP17_UNUSED,
MPP18_UNUSED,
MPP19_UNUSED,
0,
};
static struct orion5x_mpp_mode dns323b_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED },
{ 1, MPP_GPIO }, /* right amber LED (sata ch0) */
{ 2, MPP_GPIO }, /* left amber LED (sata ch1) */
{ 3, MPP_GPIO }, /* system up flag */
{ 4, MPP_GPIO }, /* power button LED */
{ 5, MPP_GPIO }, /* power button LED */
{ 6, MPP_GPIO }, /* GMT G751-2f overtemp */
{ 7, MPP_GPIO }, /* M41T80 nIRQ/OUT/SQW */
{ 8, MPP_GPIO }, /* triggers power off */
{ 9, MPP_GPIO }, /* power button switch */
{ 10, MPP_GPIO }, /* reset button switch */
{ 11, MPP_UNUSED },
{ 12, MPP_SATA_LED },
{ 13, MPP_SATA_LED },
{ 14, MPP_SATA_LED },
{ 15, MPP_SATA_LED },
{ 16, MPP_UNUSED },
{ 17, MPP_UNUSED },
{ 18, MPP_UNUSED },
{ 19, MPP_UNUSED },
{ -1 },
static unsigned int dns323b_mpp_modes[] __initdata = {
MPP0_UNUSED,
MPP1_GPIO, /* right amber LED (sata ch0) */
MPP2_GPIO, /* left amber LED (sata ch1) */
MPP3_GPIO, /* system up flag */
MPP4_GPIO, /* power button LED */
MPP5_GPIO, /* power button LED */
MPP6_GPIO, /* GMT G751-2f overtemp */
MPP7_GPIO, /* M41T80 nIRQ/OUT/SQW */
MPP8_GPIO, /* triggers power off */
MPP9_GPIO, /* power button switch */
MPP10_GPIO, /* reset button switch */
MPP11_UNUSED,
MPP12_SATA_LED,
MPP13_SATA_LED,
MPP14_SATA_LED,
MPP15_SATA_LED,
MPP16_UNUSED,
MPP17_UNUSED,
MPP18_UNUSED,
MPP19_UNUSED,
0,
};
static struct orion5x_mpp_mode dns323c_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* ? input */
{ 1, MPP_GPIO }, /* input power switch (0 = pressed) */
{ 2, MPP_GPIO }, /* output power off */
{ 3, MPP_UNUSED }, /* ? output */
{ 4, MPP_UNUSED }, /* ? output */
{ 5, MPP_UNUSED }, /* ? output */
{ 6, MPP_UNUSED }, /* ? output */
{ 7, MPP_UNUSED }, /* ? output */
{ 8, MPP_GPIO }, /* i/o right amber LED */
{ 9, MPP_GPIO }, /* i/o left amber LED */
{ 10, MPP_GPIO }, /* input */
{ 11, MPP_UNUSED },
{ 12, MPP_SATA_LED },
{ 13, MPP_SATA_LED },
{ 14, MPP_SATA_LED },
{ 15, MPP_SATA_LED },
{ 16, MPP_UNUSED },
{ 17, MPP_GPIO }, /* power button LED */
{ 18, MPP_GPIO }, /* fan speed bit 0 */
{ 19, MPP_GPIO }, /* fan speed bit 1 */
{ -1 },
static unsigned int dns323c_mpp_modes[] __initdata = {
MPP0_GPIO, /* ? input */
MPP1_GPIO, /* input power switch (0 = pressed) */
MPP2_GPIO, /* output power off */
MPP3_UNUSED, /* ? output */
MPP4_UNUSED, /* ? output */
MPP5_UNUSED, /* ? output */
MPP6_UNUSED, /* ? output */
MPP7_UNUSED, /* ? output */
MPP8_GPIO, /* i/o right amber LED */
MPP9_GPIO, /* i/o left amber LED */
MPP10_GPIO, /* input */
MPP11_UNUSED,
MPP12_SATA_LED,
MPP13_SATA_LED,
MPP14_SATA_LED,
MPP15_SATA_LED,
MPP16_UNUSED,
MPP17_GPIO, /* power button LED */
MPP18_GPIO, /* fan speed bit 0 */
MPP19_GPIO, /* fan speed bit 1 */
0,
};
/* Rev C1 Fan speed notes:
......
......@@ -180,31 +180,31 @@ static struct platform_device edmini_v2_gpio_buttons = {
/*****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode edminiv2_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED },
{ 1, MPP_UNUSED },
{ 2, MPP_UNUSED },
{ 3, MPP_GPIO }, /* RTC interrupt */
{ 4, MPP_UNUSED },
{ 5, MPP_UNUSED },
{ 6, MPP_UNUSED },
{ 7, MPP_UNUSED },
{ 8, MPP_UNUSED },
{ 9, MPP_UNUSED },
{ 10, MPP_UNUSED },
{ 11, MPP_UNUSED },
{ 12, MPP_SATA_LED }, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */
static unsigned int edminiv2_mpp_modes[] __initdata = {
MPP0_UNUSED,
MPP1_UNUSED,
MPP2_UNUSED,
MPP3_GPIO, /* RTC interrupt */
MPP4_UNUSED,
MPP5_UNUSED,
MPP6_UNUSED,
MPP7_UNUSED,
MPP8_UNUSED,
MPP9_UNUSED,
MPP10_UNUSED,
MPP11_UNUSED,
MPP12_SATA_LED, /* SATA 0 presence */
MPP13_SATA_LED, /* SATA 1 presence */
MPP14_SATA_LED, /* SATA 0 active */
MPP15_SATA_LED, /* SATA 1 active */
/* 16: Power LED control (0 = On, 1 = Off) */
{ 16, MPP_GPIO },
MPP16_GPIO,
/* 17: Power LED control select (0 = CPLD, 1 = GPIO16) */
{ 17, MPP_GPIO },
MPP17_GPIO,
/* 18: Power button status (0 = Released, 1 = Pressed) */
{ 18, MPP_GPIO },
{ 19, MPP_UNUSED },
{ -1 }
MPP18_GPIO,
MPP19_UNUSED,
0,
};
static void __init edmini_v2_init(void)
......
......@@ -315,28 +315,28 @@ static void kurobox_pro_power_off(void)
/*****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode kurobox_pro_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED },
{ 1, MPP_UNUSED },
{ 2, MPP_GPIO }, /* GPIO Micon */
{ 3, MPP_GPIO }, /* GPIO Rtc */
{ 4, MPP_UNUSED },
{ 5, MPP_UNUSED },
{ 6, MPP_NAND }, /* NAND Flash REn */
{ 7, MPP_NAND }, /* NAND Flash WEn */
{ 8, MPP_UNUSED },
{ 9, MPP_UNUSED },
{ 10, MPP_UNUSED },
{ 11, MPP_UNUSED },
{ 12, MPP_SATA_LED }, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */
{ 16, MPP_UART }, /* UART1 RXD */
{ 17, MPP_UART }, /* UART1 TXD */
{ 18, MPP_UART }, /* UART1 CTSn */
{ 19, MPP_UART }, /* UART1 RTSn */
{ -1 },
static unsigned int kurobox_pro_mpp_modes[] __initdata = {
MPP0_UNUSED,
MPP1_UNUSED,
MPP2_GPIO, /* GPIO Micon */
MPP3_GPIO, /* GPIO Rtc */
MPP4_UNUSED,
MPP5_UNUSED,
MPP6_NAND, /* NAND Flash REn */
MPP7_NAND, /* NAND Flash WEn */
MPP8_UNUSED,
MPP9_UNUSED,
MPP10_UNUSED,
MPP11_UNUSED,
MPP12_SATA_LED, /* SATA 0 presence */
MPP13_SATA_LED, /* SATA 1 presence */
MPP14_SATA_LED, /* SATA 0 active */
MPP15_SATA_LED, /* SATA 1 active */
MPP16_UART, /* UART1 RXD */
MPP17_UART, /* UART1 TXD */
MPP18_UART, /* UART1 CTSn */
MPP19_UART, /* UART1 RTSn */
0,
};
static void __init kurobox_pro_init(void)
......
......@@ -251,28 +251,28 @@ static struct platform_device lschl_fan_device = {
* GPIO Data
****************************************************************************/
static struct orion5x_mpp_mode lschl_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED POWER */
{ 1, MPP_GPIO }, /* HDD POWER */
{ 2, MPP_GPIO }, /* LED ALARM */
{ 3, MPP_GPIO }, /* LED INFO */
{ 4, MPP_UNUSED },
{ 5, MPP_UNUSED },
{ 6, MPP_GPIO }, /* FAN LOCK */
{ 7, MPP_GPIO }, /* SW INIT */
{ 8, MPP_GPIO }, /* SW POWER */
{ 9, MPP_GPIO }, /* USB POWER */
{ 10, MPP_GPIO }, /* SW AUTO POWER */
{ 11, MPP_UNUSED },
{ 12, MPP_UNUSED },
{ 13, MPP_UNUSED },
{ 14, MPP_GPIO }, /* FAN HIGH */
{ 15, MPP_GPIO }, /* SW FUNC */
{ 16, MPP_GPIO }, /* FAN LOW */
{ 17, MPP_GPIO }, /* LED FUNC */
{ 18, MPP_UNUSED },
{ 19, MPP_UNUSED },
{ -1 },
static unsigned int lschl_mpp_modes[] __initdata = {
MPP0_GPIO, /* LED POWER */
MPP1_GPIO, /* HDD POWER */
MPP2_GPIO, /* LED ALARM */
MPP3_GPIO, /* LED INFO */
MPP4_UNUSED,
MPP5_UNUSED,
MPP6_GPIO, /* FAN LOCK */
MPP7_GPIO, /* SW INIT */
MPP8_GPIO, /* SW POWER */
MPP9_GPIO, /* USB POWER */
MPP10_GPIO, /* SW AUTO POWER */
MPP11_UNUSED,
MPP12_UNUSED,
MPP13_UNUSED,
MPP14_GPIO, /* FAN HIGH */
MPP15_GPIO, /* SW FUNC */
MPP16_GPIO, /* FAN LOW */
MPP17_GPIO, /* LED FUNC */
MPP18_UNUSED,
MPP19_UNUSED,
0,
};
static void __init lschl_init(void)
......
......@@ -200,28 +200,28 @@ static void ls_hgl_power_off(void)
#define LS_HGL_GPIO_HDD_POWER 1
static struct orion5x_mpp_mode ls_hgl_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED_PWR */
{ 1, MPP_GPIO }, /* HDD_PWR */
{ 2, MPP_GPIO }, /* LED_ALARM */
{ 3, MPP_GPIO }, /* LED_INFO */
{ 4, MPP_UNUSED },
{ 5, MPP_UNUSED },
{ 6, MPP_GPIO }, /* FAN_LCK */
{ 7, MPP_GPIO }, /* INIT */
{ 8, MPP_GPIO }, /* POWER */
{ 9, MPP_GPIO }, /* USB_PWR */
{ 10, MPP_GPIO }, /* AUTO_POWER */
{ 11, MPP_UNUSED }, /* LED_ETH (dummy) */
{ 12, MPP_UNUSED },
{ 13, MPP_UNUSED },
{ 14, MPP_UNUSED },
{ 15, MPP_GPIO }, /* FUNC */
{ 16, MPP_UNUSED },
{ 17, MPP_GPIO }, /* LED_FUNC */
{ 18, MPP_UNUSED },
{ 19, MPP_UNUSED },
{ -1 },
static unsigned int ls_hgl_mpp_modes[] __initdata = {
MPP0_GPIO, /* LED_PWR */
MPP1_GPIO, /* HDD_PWR */
MPP2_GPIO, /* LED_ALARM */
MPP3_GPIO, /* LED_INFO */
MPP4_UNUSED,
MPP5_UNUSED,
MPP6_GPIO, /* FAN_LCK */
MPP7_GPIO, /* INIT */
MPP8_GPIO, /* POWER */
MPP9_GPIO, /* USB_PWR */
MPP10_GPIO, /* AUTO_POWER */
MPP11_UNUSED, /* LED_ETH (dummy) */
MPP12_UNUSED,
MPP13_UNUSED,
MPP14_UNUSED,
MPP15_GPIO, /* FUNC */
MPP16_UNUSED,
MPP17_GPIO, /* LED_FUNC */
MPP18_UNUSED,
MPP19_UNUSED,
0,
};
static void __init ls_hgl_init(void)
......
......@@ -201,28 +201,28 @@ static void lsmini_power_off(void)
#define LSMINI_GPIO_HDD_POWER0 1
#define LSMINI_GPIO_HDD_POWER1 19
static struct orion5x_mpp_mode lsmini_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED }, /* LED_RESERVE1 (unused) */
{ 1, MPP_GPIO }, /* HDD_PWR */
{ 2, MPP_GPIO }, /* LED_ALARM */
{ 3, MPP_GPIO }, /* LED_INFO */
{ 4, MPP_UNUSED },
{ 5, MPP_UNUSED },
{ 6, MPP_UNUSED },
{ 7, MPP_UNUSED },
{ 8, MPP_UNUSED },
{ 9, MPP_GPIO }, /* LED_FUNC */
{ 10, MPP_UNUSED },
{ 11, MPP_UNUSED }, /* LED_ETH (dummy) */
{ 12, MPP_UNUSED },
{ 13, MPP_UNUSED },
{ 14, MPP_GPIO }, /* LED_PWR */
{ 15, MPP_GPIO }, /* FUNC */
{ 16, MPP_GPIO }, /* USB_PWR */
{ 17, MPP_GPIO }, /* AUTO_POWER */
{ 18, MPP_GPIO }, /* POWER */
{ 19, MPP_GPIO }, /* HDD_PWR1 */
{ -1 },
static unsigned int lsmini_mpp_modes[] __initdata = {
MPP0_UNUSED, /* LED_RESERVE1 (unused) */
MPP1_GPIO, /* HDD_PWR */
MPP2_GPIO, /* LED_ALARM */
MPP3_GPIO, /* LED_INFO */
MPP4_UNUSED,
MPP5_UNUSED,
MPP6_UNUSED,
MPP7_UNUSED,
MPP8_UNUSED,
MPP9_GPIO, /* LED_FUNC */
MPP10_UNUSED,
MPP11_UNUSED, /* LED_ETH (dummy) */
MPP12_UNUSED,
MPP13_UNUSED,
MPP14_GPIO, /* LED_PWR */
MPP15_GPIO, /* FUNC */
MPP16_GPIO, /* USB_PWR */
MPP17_GPIO, /* AUTO_POWER */
MPP18_GPIO, /* POWER */
MPP19_GPIO, /* HDD_PWR1 */
0,
};
static void __init lsmini_init(void)
......
......@@ -12,154 +12,34 @@
#include <linux/init.h>
#include <linux/mbus.h>
#include <linux/io.h>
#include <asm/gpio.h>
#include <mach/hardware.h>
#include "common.h"
#include <plat/mpp.h>
#include "mpp.h"
#include "common.h"
static int is_5181l(void)
{
u32 dev;
u32 rev;
orion5x_pcie_id(&dev, &rev);
return !!(dev == MV88F5181_DEV_ID && rev >= MV88F5181L_REV_A0);
}
static int is_5182(void)
static unsigned int __init orion5x_variant(void)
{
u32 dev;
u32 rev;
orion5x_pcie_id(&dev, &rev);
return !!(dev == MV88F5182_DEV_ID);
}
if (dev == MV88F5181_DEV_ID && rev >= MV88F5181L_REV_A0)
return MPP_F5181_MASK;
static int is_5281(void)
{
u32 dev;
u32 rev;
if (dev == MV88F5182_DEV_ID)
return MPP_F5182_MASK;
orion5x_pcie_id(&dev, &rev);
if (dev == MV88F5281_DEV_ID)
return MPP_F5281_MASK;
return !!(dev == MV88F5281_DEV_ID);
printk(KERN_ERR "MPP setup: unknown orion5x variant "
"(dev %#x rev %#x)\n", dev, rev);
return 0;
}
static int __init determine_type_encoding(int mpp, enum orion5x_mpp_type type)
void __init orion5x_mpp_conf(unsigned int *mpp_list)
{
switch (type) {
case MPP_UNUSED:
case MPP_GPIO:
if (mpp == 0)
return 3;
if (mpp >= 1 && mpp <= 15)
return 0;
if (mpp >= 16 && mpp <= 19) {
if (is_5182())
return 5;
if (type == MPP_UNUSED)
return 0;
}
return -1;
case MPP_PCIE_RST_OUTn:
if (mpp == 0)
return 0;
return -1;
case MPP_PCI_ARB:
if (mpp >= 0 && mpp <= 7)
return 2;
return -1;
case MPP_PCI_PMEn:
if (mpp == 2)
return 3;
return -1;
case MPP_GIGE:
if (mpp >= 8 && mpp <= 19)
return 1;
return -1;
case MPP_NAND:
if (is_5182() || is_5281()) {
if (mpp >= 4 && mpp <= 7)
return 4;
if (mpp >= 12 && mpp <= 17)
return 4;
}
return -1;
case MPP_PCI_CLK:
if (is_5181l() && mpp >= 6 && mpp <= 7)
return 5;
return -1;
case MPP_SATA_LED:
if (is_5182()) {
if (mpp >= 4 && mpp <= 7)
return 5;
if (mpp >= 12 && mpp <= 15)
return 5;
}
return -1;
case MPP_UART:
if (mpp >= 16 && mpp <= 19)
return 0;
return -1;
}
printk(KERN_INFO "unknown MPP type %d\n", type);
return -1;
}
void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
{
u32 mpp_0_7_ctrl = readl(MPP_0_7_CTRL);
u32 mpp_8_15_ctrl = readl(MPP_8_15_CTRL);
u32 mpp_16_19_ctrl = readl(MPP_16_19_CTRL);
for ( ; mode->mpp >= 0; mode++) {
u32 *reg;
int num_type;
int shift;
if (mode->mpp >= 0 && mode->mpp <= 7)
reg = &mpp_0_7_ctrl;
else if (mode->mpp >= 8 && mode->mpp <= 15)
reg = &mpp_8_15_ctrl;
else if (mode->mpp >= 16 && mode->mpp <= 19)
reg = &mpp_16_19_ctrl;
else {
printk(KERN_ERR "orion5x_mpp_conf: invalid MPP "
"(%d)\n", mode->mpp);
continue;
}
num_type = determine_type_encoding(mode->mpp, mode->type);
if (num_type < 0) {
printk(KERN_ERR "orion5x_mpp_conf: invalid MPP "
"combination (%d, %d)\n", mode->mpp,
mode->type);
continue;
}
shift = (mode->mpp & 7) << 2;
*reg &= ~(0xf << shift);
*reg |= (num_type & 0xf) << shift;
if (mode->type == MPP_UNUSED && (mode->mpp < 16 || is_5182()))
orion_gpio_set_unused(mode->mpp);
orion_gpio_set_valid(mode->mpp, !!(mode->type == MPP_GPIO));
}
writel(mpp_0_7_ctrl, MPP_0_7_CTRL);
writel(mpp_8_15_ctrl, MPP_8_15_CTRL);
writel(mpp_16_19_ctrl, MPP_16_19_CTRL);
orion_mpp_conf(mpp_list, orion5x_variant(),
MPP_MAX, ORION5X_DEV_BUS_VIRT_BASE);
}
#ifndef __ARCH_ORION5X_MPP_H
#define __ARCH_ORION5X_MPP_H
enum orion5x_mpp_type {
/*
* This MPP is unused.
*/
MPP_UNUSED,
/*
* This MPP pin is used as a generic GPIO pin. Valid for
* MPPs 0-15 and device bus data pins 16-31. On 5182, also
* valid for MPPs 16-19.
*/
MPP_GPIO,
/*
* This MPP is used as PCIe_RST_OUTn pin. Valid for
* MPP 0 only.
*/
MPP_PCIE_RST_OUTn,
/*
* This MPP is used as PCI arbiter pin (REQn/GNTn).
* Valid for MPPs 0-7 only.
*/
MPP_PCI_ARB,
/*
* This MPP is used as PCI_PMEn pin. Valid for MPP 2 only.
*/
MPP_PCI_PMEn,
/*
* This MPP is used as GigE half-duplex (COL, CRS) or GMII
* (RXERR, CRS, TXERR, TXD[7:4], RXD[7:4]) pin. Valid for
* MPPs 8-19 only.
*/
MPP_GIGE,
/*
* This MPP is used as NAND REn/WEn pin. Valid for MPPs
* 4-7 and 12-17 only, and only on the 5181l/5182/5281.
*/
MPP_NAND,
/*
* This MPP is used as a PCI clock output pin. Valid for
* MPPs 6-7 only, and only on the 5181l.
*/
MPP_PCI_CLK,
/*
* This MPP is used as a SATA presence/activity LED.
* Valid for MPPs 4-7 and 12-15 only, and only on the 5182.
*/
MPP_SATA_LED,
/*
* This MPP is used as UART1 RXD/TXD/CTSn/RTSn pin.
* Valid for MPPs 16-19 only.
*/
MPP_UART,
};
struct orion5x_mpp_mode {
int mpp;
enum orion5x_mpp_type type;
};
void orion5x_mpp_conf(struct orion5x_mpp_mode *mode);
#define MPP(_num, _sel, _in, _out, _F5181l, _F5182, _F5281) ( \
/* MPP number */ ((_num) & 0xff) | \
/* MPP select value */ (((_sel) & 0xf) << 8) | \
/* may be input signal */ ((!!(_in)) << 12) | \
/* may be output signal */ ((!!(_out)) << 13) | \
/* available on F5181l */ ((!!(_F5181l)) << 14) | \
/* available on F5182 */ ((!!(_F5182)) << 15) | \
/* available on F5281 */ ((!!(_F5281)) << 16))
/* num sel i o 5181 5182 5281 */
#define MPP_F5181_MASK MPP(0, 0x0, 0, 0, 1, 0, 0)
#define MPP_F5182_MASK MPP(0, 0x0, 0, 0, 0, 1, 0)
#define MPP_F5281_MASK MPP(0, 0x0, 0, 0, 0, 0, 1)
#define MPP0_UNUSED MPP(0, 0x3, 0, 0, 1, 1, 1)
#define MPP0_GPIO MPP(0, 0x3, 1, 1, 1, 1, 1)
#define MPP0_PCIE_RST_OUTn MPP(0, 0x0, 0, 0, 1, 1, 1)
#define MPP0_PCI_ARB MPP(0, 0x2, 0, 0, 1, 1, 1)
#define MPP1_UNUSED MPP(1, 0x0, 0, 0, 1, 1, 1)
#define MPP1_GPIO MPP(1, 0x0, 1, 1, 1, 1, 1)
#define MPP1_PCI_ARB MPP(1, 0x2, 0, 0, 1, 1, 1)
#define MPP2_UNUSED MPP(2, 0x0, 0, 0, 1, 1, 1)
#define MPP2_GPIO MPP(2, 0x0, 1, 1, 1, 1, 1)
#define MPP2_PCI_ARB MPP(2, 0x2, 0, 0, 1, 1, 1)
#define MPP2_PCI_PMEn MPP(2, 0x3, 0, 0, 1, 1, 1)
#define MPP3_UNUSED MPP(3, 0x0, 0, 0, 1, 1, 1)
#define MPP3_GPIO MPP(3, 0x0, 1, 1, 1, 1, 1)
#define MPP3_PCI_ARB MPP(3, 0x2, 0, 0, 1, 1, 1)
#define MPP4_UNUSED MPP(4, 0x0, 0, 0, 1, 1, 1)
#define MPP4_GPIO MPP(4, 0x0, 1, 1, 1, 1, 1)
#define MPP4_PCI_ARB MPP(4, 0x2, 0, 0, 1, 1, 1)
#define MPP4_NAND MPP(4, 0x4, 0, 0, 0, 1, 1)
#define MPP4_SATA_LED MPP(4, 0x5, 0, 0, 0, 1, 0)
#define MPP5_UNUSED MPP(5, 0x0, 0, 0, 1, 1, 1)
#define MPP5_GPIO MPP(5, 0x0, 1, 1, 1, 1, 1)
#define MPP5_PCI_ARB MPP(5, 0x2, 0, 0, 1, 1, 1)
#define MPP5_NAND MPP(5, 0x4, 0, 0, 0, 1, 1)
#define MPP5_SATA_LED MPP(5, 0x5, 0, 0, 0, 1, 0)
#define MPP6_UNUSED MPP(6, 0x0, 0, 0, 1, 1, 1)
#define MPP6_GPIO MPP(6, 0x0, 1, 1, 1, 1, 1)
#define MPP6_PCI_ARB MPP(6, 0x2, 0, 0, 1, 1, 1)
#define MPP6_NAND MPP(6, 0x4, 0, 0, 0, 1, 1)
#define MPP6_PCI_CLK MPP(6, 0x5, 0, 0, 1, 0, 0)
#define MPP6_SATA_LED MPP(6, 0x5, 0, 0, 0, 1, 0)
#define MPP7_UNUSED MPP(7, 0x0, 0, 0, 1, 1, 1)
#define MPP7_GPIO MPP(7, 0x0, 1, 1, 1, 1, 1)
#define MPP7_PCI_ARB MPP(7, 0x2, 0, 0, 1, 1, 1)
#define MPP7_NAND MPP(7, 0x4, 0, 0, 0, 1, 1)
#define MPP7_PCI_CLK MPP(7, 0x5, 0, 0, 1, 0, 0)
#define MPP7_SATA_LED MPP(7, 0x5, 0, 0, 0, 1, 0)
#define MPP8_UNUSED MPP(8, 0x0, 0, 0, 1, 1, 1)
#define MPP8_GPIO MPP(8, 0x0, 1, 1, 1, 1, 1)
#define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1)
#define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1)
#define MPP9_GPIO MPP(9, 0x0, 0, 0, 1, 1, 1)
#define MPP9_GIGE MPP(9, 0x1, 1, 1, 1, 1, 1)
#define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1)
#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1)
#define MPP10_GIGE MPP(10, 0x1, 0, 0, 1, 1, 1)
#define MPP11_UNUSED MPP(11, 0x0, 0, 0, 1, 1, 1)
#define MPP11_GPIO MPP(11, 0x0, 1, 1, 1, 1, 1)
#define MPP11_GIGE MPP(11, 0x1, 0, 0, 1, 1, 1)
#define MPP12_UNUSED MPP(12, 0x0, 0, 0, 1, 1, 1)
#define MPP12_GPIO MPP(12, 0x0, 1, 1, 1, 1, 1)
#define MPP12_GIGE MPP(12, 0x1, 0, 0, 1, 1, 1)
#define MPP12_NAND MPP(12, 0x4, 0, 0, 0, 1, 1)
#define MPP12_SATA_LED MPP(12, 0x5, 0, 0, 0, 1, 0)
#define MPP13_UNUSED MPP(13, 0x0, 0, 0, 1, 1, 1)
#define MPP13_GPIO MPP(13, 0x0, 1, 1, 1, 1, 1)
#define MPP13_GIGE MPP(13, 0x1, 0, 0, 1, 1, 1)
#define MPP13_NAND MPP(13, 0x4, 0, 0, 0, 1, 1)
#define MPP13_SATA_LED MPP(13, 0x5, 0, 0, 0, 1, 0)
#define MPP14_UNUSED MPP(14, 0x0, 0, 0, 1, 1, 1)
#define MPP14_GPIO MPP(14, 0x0, 1, 1, 1, 1, 1)
#define MPP14_GIGE MPP(14, 0x1, 0, 0, 1, 1, 1)
#define MPP14_NAND MPP(14, 0x4, 0, 0, 0, 1, 1)
#define MPP14_SATA_LED MPP(14, 0x5, 0, 0, 0, 1, 0)
#define MPP15_UNUSED MPP(15, 0x0, 0, 0, 1, 1, 1)
#define MPP15_GPIO MPP(15, 0x0, 1, 1, 1, 1, 1)
#define MPP15_GIGE MPP(15, 0x1, 0, 0, 1, 1, 1)
#define MPP15_NAND MPP(15, 0x4, 0, 0, 0, 1, 1)
#define MPP15_SATA_LED MPP(15, 0x5, 0, 0, 0, 1, 0)
#define MPP16_UNUSED MPP(16, 0x0, 0, 0, 1, 1, 1)
#define MPP16_GPIO MPP(16, 0x5, 1, 1, 0, 1, 0)
#define MPP16_GIGE MPP(16, 0x1, 0, 0, 1, 1, 1)
#define MPP16_NAND MPP(16, 0x4, 0, 0, 0, 1, 1)
#define MPP16_UART MPP(16, 0x0, 0, 0, 0, 1, 1)
#define MPP17_UNUSED MPP(17, 0x0, 0, 0, 1, 1, 1)
#define MPP17_GPIO MPP(17, 0x5, 1, 1, 0, 1, 0)
#define MPP17_GIGE MPP(17, 0x1, 0, 0, 1, 1, 1)
#define MPP17_NAND MPP(17, 0x4, 0, 0, 0, 1, 1)
#define MPP17_UART MPP(17, 0x0, 0, 0, 0, 1, 1)
#define MPP18_UNUSED MPP(18, 0x0, 0, 0, 1, 1, 1)
#define MPP18_GPIO MPP(18, 0x5, 1, 1, 0, 1, 0)
#define MPP18_GIGE MPP(18, 0x1, 0, 0, 1, 1, 1)
#define MPP18_UART MPP(18, 0x0, 0, 0, 0, 1, 1)
#define MPP19_UNUSED MPP(19, 0x0, 0, 0, 1, 1, 1)
#define MPP19_GPIO MPP(19, 0x5, 1, 1, 0, 1, 0)
#define MPP19_GIGE MPP(19, 0x1, 0, 0, 1, 1, 1)
#define MPP19_UART MPP(19, 0x0, 0, 0, 0, 1, 1)
#define MPP_MAX 19
void orion5x_mpp_conf(unsigned int *mpp_list);
#endif
......@@ -193,28 +193,28 @@ static void mss2_power_off(void)
/****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode mss2_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Power LED */
{ 1, MPP_GPIO }, /* Error LED */
{ 2, MPP_UNUSED },
{ 3, MPP_GPIO }, /* RTC interrupt */
{ 4, MPP_GPIO }, /* HDD ind. (Single/Dual)*/
{ 5, MPP_GPIO }, /* HD0 5V control */
{ 6, MPP_GPIO }, /* HD0 12V control */
{ 7, MPP_GPIO }, /* HD1 5V control */
{ 8, MPP_GPIO }, /* HD1 12V control */
{ 9, MPP_UNUSED },
{ 10, MPP_GPIO }, /* Fan control */
{ 11, MPP_GPIO }, /* Power button */
{ 12, MPP_GPIO }, /* Reset button */
{ 13, MPP_UNUSED },
{ 14, MPP_SATA_LED }, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */
{ 16, MPP_UNUSED },
{ 17, MPP_UNUSED },
{ 18, MPP_UNUSED },
{ 19, MPP_UNUSED },
{ -1 },
static unsigned int mss2_mpp_modes[] __initdata = {
MPP0_GPIO, /* Power LED */
MPP1_GPIO, /* Error LED */
MPP2_UNUSED,
MPP3_GPIO, /* RTC interrupt */
MPP4_GPIO, /* HDD ind. (Single/Dual)*/
MPP5_GPIO, /* HD0 5V control */
MPP6_GPIO, /* HD0 12V control */
MPP7_GPIO, /* HD1 5V control */
MPP8_GPIO, /* HD1 12V control */
MPP9_UNUSED,
MPP10_GPIO, /* Fan control */
MPP11_GPIO, /* Power button */
MPP12_GPIO, /* Reset button */
MPP13_UNUSED,
MPP14_SATA_LED, /* SATA 0 active */
MPP15_SATA_LED, /* SATA 1 active */
MPP16_UNUSED,
MPP17_UNUSED,
MPP18_UNUSED,
MPP19_UNUSED,
0,
};
static void __init mss2_init(void)
......
......@@ -108,28 +108,28 @@ static struct platform_device mv2120_button_device = {
/****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode mv2120_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Sys status LED */
{ 1, MPP_GPIO }, /* Sys error LED */
{ 2, MPP_GPIO }, /* OverTemp interrupt */
{ 3, MPP_GPIO }, /* RTC interrupt */
{ 4, MPP_GPIO }, /* V_LED 5V */
{ 5, MPP_GPIO }, /* V_LED 3.3V */
{ 6, MPP_UNUSED },
{ 7, MPP_UNUSED },
{ 8, MPP_GPIO }, /* SATA 0 fail LED */
{ 9, MPP_GPIO }, /* SATA 1 fail LED */
{ 10, MPP_UNUSED },
{ 11, MPP_UNUSED },
{ 12, MPP_SATA_LED }, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */
{ 16, MPP_UNUSED },
{ 17, MPP_GPIO }, /* Reset button */
{ 18, MPP_GPIO }, /* Power button */
{ 19, MPP_GPIO }, /* Power off */
{ -1 },
static unsigned int mv2120_mpp_modes[] __initdata = {
MPP0_GPIO, /* Sys status LED */
MPP1_GPIO, /* Sys error LED */
MPP2_GPIO, /* OverTemp interrupt */
MPP3_GPIO, /* RTC interrupt */
MPP4_GPIO, /* V_LED 5V */
MPP5_GPIO, /* V_LED 3.3V */
MPP6_UNUSED,
MPP7_UNUSED,
MPP8_GPIO, /* SATA 0 fail LED */
MPP9_GPIO, /* SATA 1 fail LED */
MPP10_UNUSED,
MPP11_UNUSED,
MPP12_SATA_LED, /* SATA 0 presence */
MPP13_SATA_LED, /* SATA 1 presence */
MPP14_SATA_LED, /* SATA 0 active */
MPP15_SATA_LED, /* SATA 1 active */
MPP16_UNUSED,
MPP17_GPIO, /* Reset button */
MPP18_GPIO, /* Power button */
MPP19_GPIO, /* Power off */
0,
};
static struct i2c_board_info __initdata mv2120_i2c_rtc = {
......
......@@ -339,28 +339,28 @@ static struct platform_device net2big_gpio_buttons = {
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode net2big_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Raid mode (bit 0) */
{ 1, MPP_GPIO }, /* USB port 2 fuse (0 = Fail, 1 = Ok) */
{ 2, MPP_GPIO }, /* Raid mode (bit 1) */
{ 3, MPP_GPIO }, /* Board ID (bit 0) */
{ 4, MPP_GPIO }, /* Fan activity (0 = Off, 1 = On) */
{ 5, MPP_GPIO }, /* Fan fail detection */
{ 6, MPP_GPIO }, /* Red front LED (0 = Off, 1 = On) */
{ 7, MPP_GPIO }, /* Disable initial blinking on front LED */
{ 8, MPP_GPIO }, /* Rear power switch (on|auto) */
{ 9, MPP_GPIO }, /* Rear power switch (auto|off) */
{ 10, MPP_GPIO }, /* SATA 1 red LED (0 = Off, 1 = On) */
{ 11, MPP_GPIO }, /* SATA 0 red LED (0 = Off, 1 = On) */
{ 12, MPP_GPIO }, /* Board ID (bit 1) */
{ 13, MPP_GPIO }, /* SATA 1 blue LED blink control */
{ 14, MPP_SATA_LED },
{ 15, MPP_SATA_LED },
{ 16, MPP_GPIO }, /* Blue front LED control */
{ 17, MPP_GPIO }, /* SATA 0 blue LED blink control */
{ 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */
{ 19, MPP_GPIO }, /* SATA{0,1} power On/Off request */
{ -1 }
static unsigned int net2big_mpp_modes[] __initdata = {
MPP0_GPIO, /* Raid mode (bit 0) */
MPP1_GPIO, /* USB port 2 fuse (0 = Fail, 1 = Ok) */
MPP2_GPIO, /* Raid mode (bit 1) */
MPP3_GPIO, /* Board ID (bit 0) */
MPP4_GPIO, /* Fan activity (0 = Off, 1 = On) */
MPP5_GPIO, /* Fan fail detection */
MPP6_GPIO, /* Red front LED (0 = Off, 1 = On) */
MPP7_GPIO, /* Disable initial blinking on front LED */
MPP8_GPIO, /* Rear power switch (on|auto) */
MPP9_GPIO, /* Rear power switch (auto|off) */
MPP10_GPIO, /* SATA 1 red LED (0 = Off, 1 = On) */
MPP11_GPIO, /* SATA 0 red LED (0 = Off, 1 = On) */
MPP12_GPIO, /* Board ID (bit 1) */
MPP13_GPIO, /* SATA 1 blue LED blink control */
MPP14_SATA_LED,
MPP15_SATA_LED,
MPP16_GPIO, /* Blue front LED control */
MPP17_GPIO, /* SATA 0 blue LED blink control */
MPP18_GPIO, /* Front button (0 = Released, 1 = Pushed ) */
MPP19_GPIO, /* SATA{0,1} power On/Off request */
0,
/* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */
/* 23: SATA 0 power status */
/* 24: Board power off */
......
......@@ -64,28 +64,28 @@ static struct platform_device rd88f5181l_fxo_nor_boot_flash = {
/*****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode rd88f5181l_fxo_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED1 CardBus LED (front panel) */
{ 1, MPP_GPIO }, /* PCI_intA */
{ 2, MPP_GPIO }, /* Hard Reset / Factory Init*/
{ 3, MPP_GPIO }, /* FXS or DAA select */
{ 4, MPP_GPIO }, /* LED6 - phone LED (front panel) */
{ 5, MPP_GPIO }, /* LED5 - phone LED (front panel) */
{ 6, MPP_PCI_CLK }, /* CPU PCI refclk */
{ 7, MPP_PCI_CLK }, /* PCI/PCIe refclk */
{ 8, MPP_GPIO }, /* CardBus reset */
{ 9, MPP_GPIO }, /* GE_RXERR */
{ 10, MPP_GPIO }, /* LED2 MiniPCI LED (front panel) */
{ 11, MPP_GPIO }, /* Lifeline control */
{ 12, MPP_GIGE }, /* GE_TXD[4] */
{ 13, MPP_GIGE }, /* GE_TXD[5] */
{ 14, MPP_GIGE }, /* GE_TXD[6] */
{ 15, MPP_GIGE }, /* GE_TXD[7] */
{ 16, MPP_GIGE }, /* GE_RXD[4] */
{ 17, MPP_GIGE }, /* GE_RXD[5] */
{ 18, MPP_GIGE }, /* GE_RXD[6] */
{ 19, MPP_GIGE }, /* GE_RXD[7] */
{ -1 },
static unsigned int rd88f5181l_fxo_mpp_modes[] __initdata = {
MPP0_GPIO, /* LED1 CardBus LED (front panel) */
MPP1_GPIO, /* PCI_intA */
MPP2_GPIO, /* Hard Reset / Factory Init*/
MPP3_GPIO, /* FXS or DAA select */
MPP4_GPIO, /* LED6 - phone LED (front panel) */
MPP5_GPIO, /* LED5 - phone LED (front panel) */
MPP6_PCI_CLK, /* CPU PCI refclk */
MPP7_PCI_CLK, /* PCI/PCIe refclk */
MPP8_GPIO, /* CardBus reset */
MPP9_GPIO, /* GE_RXERR */
MPP10_GPIO, /* LED2 MiniPCI LED (front panel) */
MPP11_GPIO, /* Lifeline control */
MPP12_GIGE, /* GE_TXD[4] */
MPP13_GIGE, /* GE_TXD[5] */
MPP14_GIGE, /* GE_TXD[6] */
MPP15_GIGE, /* GE_TXD[7] */
MPP16_GIGE, /* GE_RXD[4] */
MPP17_GIGE, /* GE_RXD[5] */
MPP18_GIGE, /* GE_RXD[6] */
MPP19_GIGE, /* GE_RXD[7] */
0,
};
static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = {
......
......@@ -65,28 +65,28 @@ static struct platform_device rd88f5181l_ge_nor_boot_flash = {
/*****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode rd88f5181l_ge_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED1 */
{ 1, MPP_GPIO }, /* LED5 */
{ 2, MPP_GPIO }, /* LED4 */
{ 3, MPP_GPIO }, /* LED3 */
{ 4, MPP_GPIO }, /* PCI_intA */
{ 5, MPP_GPIO }, /* RTC interrupt */
{ 6, MPP_PCI_CLK }, /* CPU PCI refclk */
{ 7, MPP_PCI_CLK }, /* PCI/PCIe refclk */
{ 8, MPP_GPIO }, /* 88e6131 interrupt */
{ 9, MPP_GPIO }, /* GE_RXERR */
{ 10, MPP_GPIO }, /* PCI_intB */
{ 11, MPP_GPIO }, /* LED2 */
{ 12, MPP_GIGE }, /* GE_TXD[4] */
{ 13, MPP_GIGE }, /* GE_TXD[5] */
{ 14, MPP_GIGE }, /* GE_TXD[6] */
{ 15, MPP_GIGE }, /* GE_TXD[7] */
{ 16, MPP_GIGE }, /* GE_RXD[4] */
{ 17, MPP_GIGE }, /* GE_RXD[5] */
{ 18, MPP_GIGE }, /* GE_RXD[6] */
{ 19, MPP_GIGE }, /* GE_RXD[7] */
{ -1 },
static unsigned int rd88f5181l_ge_mpp_modes[] __initdata = {
MPP0_GPIO, /* LED1 */
MPP1_GPIO, /* LED5 */
MPP2_GPIO, /* LED4 */
MPP3_GPIO, /* LED3 */
MPP4_GPIO, /* PCI_intA */
MPP5_GPIO, /* RTC interrupt */
MPP6_PCI_CLK, /* CPU PCI refclk */
MPP7_PCI_CLK, /* PCI/PCIe refclk */
MPP8_GPIO, /* 88e6131 interrupt */
MPP9_GPIO, /* GE_RXERR */
MPP10_GPIO, /* PCI_intB */
MPP11_GPIO, /* LED2 */
MPP12_GIGE, /* GE_TXD[4] */
MPP13_GIGE, /* GE_TXD[5] */
MPP14_GIGE, /* GE_TXD[6] */
MPP15_GIGE, /* GE_TXD[7] */
MPP16_GIGE, /* GE_RXD[4] */
MPP17_GIGE, /* GE_RXD[5] */
MPP18_GIGE, /* GE_RXD[6] */
MPP19_GIGE, /* GE_RXD[7] */
0,
};
static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = {
......
......@@ -241,28 +241,28 @@ static struct mv_sata_platform_data rd88f5182_sata_data = {
/*****************************************************************************
* General Setup
****************************************************************************/
static struct orion5x_mpp_mode rd88f5182_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Debug Led */
{ 1, MPP_GPIO }, /* Reset Switch */
{ 2, MPP_UNUSED },
{ 3, MPP_GPIO }, /* RTC Int */
{ 4, MPP_GPIO },
{ 5, MPP_GPIO },
{ 6, MPP_GPIO }, /* PCI_intA */
{ 7, MPP_GPIO }, /* PCI_intB */
{ 8, MPP_UNUSED },
{ 9, MPP_UNUSED },
{ 10, MPP_UNUSED },
{ 11, MPP_UNUSED },
{ 12, MPP_SATA_LED }, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */
{ 16, MPP_UNUSED },
{ 17, MPP_UNUSED },
{ 18, MPP_UNUSED },
{ 19, MPP_UNUSED },
{ -1 },
static unsigned int rd88f5182_mpp_modes[] __initdata = {
MPP0_GPIO, /* Debug Led */
MPP1_GPIO, /* Reset Switch */
MPP2_UNUSED,
MPP3_GPIO, /* RTC Int */
MPP4_GPIO,
MPP5_GPIO,
MPP6_GPIO, /* PCI_intA */
MPP7_GPIO, /* PCI_intB */
MPP8_UNUSED,
MPP9_UNUSED,
MPP10_UNUSED,
MPP11_UNUSED,
MPP12_SATA_LED, /* SATA 0 presence */
MPP13_SATA_LED, /* SATA 1 presence */
MPP14_SATA_LED, /* SATA 0 active */
MPP15_SATA_LED, /* SATA 1 active */
MPP16_UNUSED,
MPP17_UNUSED,
MPP18_UNUSED,
MPP19_UNUSED,
0,
};
static void __init rd88f5182_init(void)
......
......@@ -27,7 +27,6 @@
#include <asm/mach/pci.h>
#include <mach/orion5x.h>
#include "common.h"
#include "mpp.h"
static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
.phy_addr = -1,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
obj-y := irq.o pcie.o time.o
obj-y := irq.o pcie.o time.o common.o mpp.o
obj-m :=
obj-n :=
obj- :=
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -39,7 +39,6 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
/*
* GPIO interrupt handling.
*/
extern struct irq_chip orion_gpio_irq_chip;
void orion_gpio_irq_handler(int irqoff);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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