Commit 1e87347c authored by Russell King's avatar Russell King
parents f29251ff 3cff484d
This diff is collapsed.
...@@ -11,24 +11,17 @@ ...@@ -11,24 +11,17 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/io.h> #include <linux/io.h>
#include <plat/mpp.h>
#include <mach/dove.h> #include <mach/dove.h>
#include "mpp.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 { struct dove_mpp_grp {
int start; int start;
int end; 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] = { [MPP_24_39] = {
.start = 24, .start = 24,
.end = 39, .end = 39,
...@@ -38,8 +31,8 @@ static struct dove_mpp_grp dove_mpp_grp[] = { ...@@ -38,8 +31,8 @@ static struct dove_mpp_grp dove_mpp_grp[] = {
.end = 45, .end = 45,
}, },
[MPP_46_51] = { [MPP_46_51] = {
.start = 40, .start = 46,
.end = 45, .end = 51,
}, },
[MPP_58_61] = { [MPP_58_61] = {
.start = 58, .start = 58,
...@@ -51,6 +44,8 @@ static struct dove_mpp_grp dove_mpp_grp[] = { ...@@ -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) static void dove_mpp_gpio_mode(int start, int end, int gpio_mode)
{ {
int i; int i;
...@@ -59,24 +54,17 @@ static void dove_mpp_gpio_mode(int start, int end, int gpio_mode) ...@@ -59,24 +54,17 @@ static void dove_mpp_gpio_mode(int start, int end, int gpio_mode)
orion_gpio_set_valid(i, 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) static void dove_mpp_dump_regs(void)
{ {
#ifdef DEBUG pr_debug("PMU_CTRL4_CTRL: %08x\n",
int i; readl(DOVE_MPP_CTRL4_VIRT_BASE));
pr_debug("MPP_CTRL regs:"); pr_debug("PMU_MPP_GENERAL_CTRL: %08x\n",
for (i = 0; i < MPP_NR_REGS; i++) readl(DOVE_PMU_MPP_GENERAL_CTRL));
printk(" %08x", readl(MPP_CTRL(i)));
printk("\n");
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)); pr_debug("MPP_GENERAL: %08x\n", readl(DOVE_MPP_GENERAL_VIRT_BASE));
#endif
} }
static void dove_mpp_cfg_nfc(int sel) static void dove_mpp_cfg_nfc(int sel)
...@@ -92,7 +80,7 @@ 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) 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 ssp_ctrl1 = readl(DOVE_SSP_CTRL_STATUS_1);
u32 mpp_gen_ctrl = readl(DOVE_MPP_GENERAL_VIRT_BASE); u32 mpp_gen_ctrl = readl(DOVE_MPP_GENERAL_VIRT_BASE);
u32 global_cfg_2 = readl(DOVE_GLOBAL_CONFIG_2); u32 global_cfg_2 = readl(DOVE_GLOBAL_CONFIG_2);
...@@ -128,82 +116,46 @@ static void dove_mpp_cfg_au1(int sel) ...@@ -128,82 +116,46 @@ static void dove_mpp_cfg_au1(int sel)
writel(global_cfg_2, DOVE_GLOBAL_CONFIG_2); writel(global_cfg_2, DOVE_GLOBAL_CONFIG_2);
} }
static void dove_mpp_conf_grp(int num, int sel, u32 *mpp_ctrl) /* Configure the group registers, enabling GPIO if sel indicates the
{ pin is to be used for GPIO */
int start = dove_mpp_grp[num].start; static void dove_mpp_conf_grp(unsigned int *mpp_grp_list)
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)
{ {
u32 mpp_ctrl[MPP_NR_REGS]; u32 mpp_ctrl4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
u32 pmu_mpp_ctrl = 0; int gpio_mode;
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);
dove_mpp_dump_regs(); for ( ; *mpp_grp_list; mpp_grp_list++) {
unsigned int num = MPP_NUM(*mpp_grp_list);
for ( ; *mpp_list != MPP_END; mpp_list++) { unsigned int sel = MPP_SEL(*mpp_grp_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;
}
if (*mpp_list & MPP_AU1_MASK) { if (num > MPP_GRP_MAX) {
dove_mpp_cfg_au1(sel); pr_err("dove: invalid MPP GRP number (%u)\n", num);
continue; continue;
} }
if (*mpp_list & MPP_GRP_MASK) { mpp_ctrl4 &= ~(0x1 << num);
dove_mpp_conf_grp(num, sel, &mpp_ctrl[3]); mpp_ctrl4 |= sel << num;
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;
}
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++) /* Configure the various MPP pins on Dove */
writel(mpp_ctrl[i], MPP_CTRL(i)); 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++) /* Use platform code for pins 0-23 */
writel(pmu_sig_ctrl[i], PMU_SIG_CTRL(i)); 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(); dove_mpp_dump_regs();
} }
This diff is collapsed.
This diff is collapsed.
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#define IRQ_KIRKWOOD_GPIO_HIGH_16_23 41 #define IRQ_KIRKWOOD_GPIO_HIGH_16_23 41
#define IRQ_KIRKWOOD_GE00_ERR 46 #define IRQ_KIRKWOOD_GE00_ERR 46
#define IRQ_KIRKWOOD_GE01_ERR 47 #define IRQ_KIRKWOOD_GE01_ERR 47
#define IRQ_KIRKWOOD_RTC 53
/* /*
* KIRKWOOD General Purpose Pins * KIRKWOOD General Purpose Pins
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <asm/gpio.h> #include <asm/gpio.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <plat/mpp.h>
#include "common.h" #include "common.h"
#include "mpp.h" #include "mpp.h"
...@@ -36,61 +37,8 @@ static unsigned int __init kirkwood_variant(void) ...@@ -36,61 +37,8 @@ static unsigned int __init kirkwood_variant(void)
return 0; 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) void __init kirkwood_mpp_conf(unsigned int *mpp_list)
{ {
u32 mpp_ctrl[MPP_NR_REGS]; orion_mpp_conf(mpp_list, kirkwood_variant(),
unsigned int variant_mask; MPP_MAX, DEV_BUS_VIRT_BASE);
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");
} }
...@@ -22,14 +22,8 @@ ...@@ -22,14 +22,8 @@
/* available on F6281 */ ((!!(_F6281)) << 17) | \ /* available on F6281 */ ((!!(_F6281)) << 17) | \
/* available on F6282 */ ((!!(_F6282)) << 18)) /* 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 */ /* 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_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_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 ) #define MPP_F6192_MASK MPP( 0, 0x0, 0, 0, 0, 0, 1, 0, 0 )
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/serial_8250.h> #include <linux/serial_8250.h>
#include <linux/mbus.h> #include <linux/mbus.h>
#include <linux/mv643xx_eth.h> #include <linux/dma-mapping.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/timex.h> #include <asm/timex.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <mach/loki.h> #include <mach/loki.h>
#include <plat/orion_nand.h> #include <plat/orion_nand.h>
#include <plat/time.h> #include <plat/time.h>
#include <plat/common.h>
#include "common.h" #include "common.h"
/***************************************************************************** /*****************************************************************************
...@@ -43,116 +44,28 @@ void __init loki_map_io(void) ...@@ -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) 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); 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) 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); 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 = { ...@@ -187,7 +100,7 @@ static struct platform_device loki_sas = {
.name = "mvsas", .name = "mvsas",
.id = 0, .id = 0,
.dev = { .dev = {
.coherent_dma_mask = 0xffffffff, .coherent_dma_mask = DMA_BIT_MASK(32),
}, },
.num_resources = ARRAY_SIZE(loki_sas_resources), .num_resources = ARRAY_SIZE(loki_sas_resources),
.resource = loki_sas_resources, .resource = loki_sas_resources,
...@@ -203,88 +116,19 @@ void __init loki_sas_init(void) ...@@ -203,88 +116,19 @@ void __init loki_sas_init(void)
/***************************************************************************** /*****************************************************************************
* UART0 * 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) 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 * 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) 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 @@ ...@@ -12,6 +12,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/mbus.h> #include <linux/mbus.h>
#include <linux/io.h> #include <linux/io.h>
#include <plat/mpp.h>
#include <asm/gpio.h> #include <asm/gpio.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include "common.h" #include "common.h"
...@@ -31,61 +32,8 @@ static unsigned int __init mv78xx0_variant(void) ...@@ -31,61 +32,8 @@ static unsigned int __init mv78xx0_variant(void)
return 0; 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) void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
{ {
u32 mpp_ctrl[MPP_NR_REGS]; orion_mpp_conf(mpp_list, mv78xx0_variant(),
unsigned int variant_mask; MPP_MAX, DEV_BUS_VIRT_BASE);
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");
} }
...@@ -19,14 +19,8 @@ ...@@ -19,14 +19,8 @@
/* may be output signal */ ((!!(_out)) << 13) | \ /* may be output signal */ ((!!(_out)) << 13) | \
/* available on A0 */ ((!!(_78100_A0)) << 14)) /* 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 */ /* 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 MPP_78100_A0_MASK MPP(0, 0x0, 0, 0, 1)
#define MPP0_GPIO MPP(0, 0x0, 1, 1, 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 = { ...@@ -267,28 +267,28 @@ static struct platform_device d2net_gpio_buttons = {
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode d2net_mpp_modes[] __initdata = { static unsigned int d2net_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Board ID (bit 0) */ MPP0_GPIO, /* Board ID (bit 0) */
{ 1, MPP_GPIO }, /* Board ID (bit 1) */ MPP1_GPIO, /* Board ID (bit 1) */
{ 2, MPP_GPIO }, /* Board ID (bit 2) */ MPP2_GPIO, /* Board ID (bit 2) */
{ 3, MPP_GPIO }, /* SATA 0 power */ MPP3_GPIO, /* SATA 0 power */
{ 4, MPP_UNUSED }, MPP4_UNUSED,
{ 5, MPP_GPIO }, /* Fan fail detection */ MPP5_GPIO, /* Fan fail detection */
{ 6, MPP_GPIO }, /* Red front LED */ MPP6_GPIO, /* Red front LED */
{ 7, MPP_UNUSED }, MPP7_UNUSED,
{ 8, MPP_GPIO }, /* Rear power switch (on|auto) */ MPP8_GPIO, /* Rear power switch (on|auto) */
{ 9, MPP_GPIO }, /* Rear power switch (auto|off) */ MPP9_GPIO, /* Rear power switch (auto|off) */
{ 10, MPP_UNUSED }, MPP10_UNUSED,
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_GPIO }, /* SATA 1 power */ MPP12_GPIO, /* SATA 1 power */
{ 13, MPP_UNUSED }, MPP13_UNUSED,
{ 14, MPP_SATA_LED }, /* SATA 0 active */ MPP14_SATA_LED, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */ MPP15_SATA_LED, /* SATA 1 active */
{ 16, MPP_GPIO }, /* Blue front LED blink control */ MPP16_GPIO, /* Blue front LED blink control */
{ 17, MPP_UNUSED }, MPP17_UNUSED,
{ 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */ MPP18_GPIO, /* Front button (0 = Released, 1 = Pushed ) */
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 } 0,
/* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */ /* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */
/* 23: Blue front LED off */ /* 23: Blue front LED off */
/* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */ /* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */
......
...@@ -298,28 +298,28 @@ static struct i2c_board_info __initdata db88f5281_i2c_rtc = { ...@@ -298,28 +298,28 @@ static struct i2c_board_info __initdata db88f5281_i2c_rtc = {
/***************************************************************************** /*****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode db88f5281_mpp_modes[] __initdata = { static unsigned int db88f5281_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* USB Over Current */ MPP0_GPIO, /* USB Over Current */
{ 1, MPP_GPIO }, /* USB Vbat input */ MPP1_GPIO, /* USB Vbat input */
{ 2, MPP_PCI_ARB }, /* PCI_REQn[2] */ MPP2_PCI_ARB, /* PCI_REQn[2] */
{ 3, MPP_PCI_ARB }, /* PCI_GNTn[2] */ MPP3_PCI_ARB, /* PCI_GNTn[2] */
{ 4, MPP_PCI_ARB }, /* PCI_REQn[3] */ MPP4_PCI_ARB, /* PCI_REQn[3] */
{ 5, MPP_PCI_ARB }, /* PCI_GNTn[3] */ MPP5_PCI_ARB, /* PCI_GNTn[3] */
{ 6, MPP_GPIO }, /* JP0, CON17.2 */ MPP6_GPIO, /* JP0, CON17.2 */
{ 7, MPP_GPIO }, /* JP1, CON17.1 */ MPP7_GPIO, /* JP1, CON17.1 */
{ 8, MPP_GPIO }, /* JP2, CON11.2 */ MPP8_GPIO, /* JP2, CON11.2 */
{ 9, MPP_GPIO }, /* JP3, CON11.3 */ MPP9_GPIO, /* JP3, CON11.3 */
{ 10, MPP_GPIO }, /* RTC int */ MPP10_GPIO, /* RTC int */
{ 11, MPP_GPIO }, /* Baud Rate Generator */ MPP11_GPIO, /* Baud Rate Generator */
{ 12, MPP_GPIO }, /* PCI int 1 */ MPP12_GPIO, /* PCI int 1 */
{ 13, MPP_GPIO }, /* PCI int 2 */ MPP13_GPIO, /* PCI int 2 */
{ 14, MPP_NAND }, /* NAND_REn[2] */ MPP14_NAND, /* NAND_REn[2] */
{ 15, MPP_NAND }, /* NAND_WEn[2] */ MPP15_NAND, /* NAND_WEn[2] */
{ 16, MPP_UART }, /* UART1_RX */ MPP16_UART, /* UART1_RX */
{ 17, MPP_UART }, /* UART1_TX */ MPP17_UART, /* UART1_TX */
{ 18, MPP_UART }, /* UART1_CTSn */ MPP18_UART, /* UART1_CTSn */
{ 19, MPP_UART }, /* UART1_RTSn */ MPP19_UART, /* UART1_RTSn */
{ -1 }, 0,
}; };
static void __init db88f5281_init(void) static void __init db88f5281_init(void)
......
...@@ -385,76 +385,76 @@ static struct mv_sata_platform_data dns323_sata_data = { ...@@ -385,76 +385,76 @@ static struct mv_sata_platform_data dns323_sata_data = {
/**************************************************************************** /****************************************************************************
* General Setup * General Setup
*/ */
static struct orion5x_mpp_mode dns323a_mpp_modes[] __initdata = { static unsigned int dns323a_mpp_modes[] __initdata = {
{ 0, MPP_PCIE_RST_OUTn }, MPP0_PCIE_RST_OUTn,
{ 1, MPP_GPIO }, /* right amber LED (sata ch0) */ MPP1_GPIO, /* right amber LED (sata ch0) */
{ 2, MPP_GPIO }, /* left amber LED (sata ch1) */ MPP2_GPIO, /* left amber LED (sata ch1) */
{ 3, MPP_UNUSED }, MPP3_UNUSED,
{ 4, MPP_GPIO }, /* power button LED */ MPP4_GPIO, /* power button LED */
{ 5, MPP_GPIO }, /* power button LED */ MPP5_GPIO, /* power button LED */
{ 6, MPP_GPIO }, /* GMT G751-2f overtemp */ MPP6_GPIO, /* GMT G751-2f overtemp */
{ 7, MPP_GPIO }, /* M41T80 nIRQ/OUT/SQW */ MPP7_GPIO, /* M41T80 nIRQ/OUT/SQW */
{ 8, MPP_GPIO }, /* triggers power off */ MPP8_GPIO, /* triggers power off */
{ 9, MPP_GPIO }, /* power button switch */ MPP9_GPIO, /* power button switch */
{ 10, MPP_GPIO }, /* reset button switch */ MPP10_GPIO, /* reset button switch */
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_UNUSED }, MPP12_UNUSED,
{ 13, MPP_UNUSED }, MPP13_UNUSED,
{ 14, MPP_UNUSED }, MPP14_UNUSED,
{ 15, MPP_UNUSED }, MPP15_UNUSED,
{ 16, MPP_UNUSED }, MPP16_UNUSED,
{ 17, MPP_UNUSED }, MPP17_UNUSED,
{ 18, MPP_UNUSED }, MPP18_UNUSED,
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 }, 0,
}; };
static struct orion5x_mpp_mode dns323b_mpp_modes[] __initdata = { static unsigned int dns323b_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED }, MPP0_UNUSED,
{ 1, MPP_GPIO }, /* right amber LED (sata ch0) */ MPP1_GPIO, /* right amber LED (sata ch0) */
{ 2, MPP_GPIO }, /* left amber LED (sata ch1) */ MPP2_GPIO, /* left amber LED (sata ch1) */
{ 3, MPP_GPIO }, /* system up flag */ MPP3_GPIO, /* system up flag */
{ 4, MPP_GPIO }, /* power button LED */ MPP4_GPIO, /* power button LED */
{ 5, MPP_GPIO }, /* power button LED */ MPP5_GPIO, /* power button LED */
{ 6, MPP_GPIO }, /* GMT G751-2f overtemp */ MPP6_GPIO, /* GMT G751-2f overtemp */
{ 7, MPP_GPIO }, /* M41T80 nIRQ/OUT/SQW */ MPP7_GPIO, /* M41T80 nIRQ/OUT/SQW */
{ 8, MPP_GPIO }, /* triggers power off */ MPP8_GPIO, /* triggers power off */
{ 9, MPP_GPIO }, /* power button switch */ MPP9_GPIO, /* power button switch */
{ 10, MPP_GPIO }, /* reset button switch */ MPP10_GPIO, /* reset button switch */
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_SATA_LED }, MPP12_SATA_LED,
{ 13, MPP_SATA_LED }, MPP13_SATA_LED,
{ 14, MPP_SATA_LED }, MPP14_SATA_LED,
{ 15, MPP_SATA_LED }, MPP15_SATA_LED,
{ 16, MPP_UNUSED }, MPP16_UNUSED,
{ 17, MPP_UNUSED }, MPP17_UNUSED,
{ 18, MPP_UNUSED }, MPP18_UNUSED,
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 }, 0,
}; };
static struct orion5x_mpp_mode dns323c_mpp_modes[] __initdata = { static unsigned int dns323c_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* ? input */ MPP0_GPIO, /* ? input */
{ 1, MPP_GPIO }, /* input power switch (0 = pressed) */ MPP1_GPIO, /* input power switch (0 = pressed) */
{ 2, MPP_GPIO }, /* output power off */ MPP2_GPIO, /* output power off */
{ 3, MPP_UNUSED }, /* ? output */ MPP3_UNUSED, /* ? output */
{ 4, MPP_UNUSED }, /* ? output */ MPP4_UNUSED, /* ? output */
{ 5, MPP_UNUSED }, /* ? output */ MPP5_UNUSED, /* ? output */
{ 6, MPP_UNUSED }, /* ? output */ MPP6_UNUSED, /* ? output */
{ 7, MPP_UNUSED }, /* ? output */ MPP7_UNUSED, /* ? output */
{ 8, MPP_GPIO }, /* i/o right amber LED */ MPP8_GPIO, /* i/o right amber LED */
{ 9, MPP_GPIO }, /* i/o left amber LED */ MPP9_GPIO, /* i/o left amber LED */
{ 10, MPP_GPIO }, /* input */ MPP10_GPIO, /* input */
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_SATA_LED }, MPP12_SATA_LED,
{ 13, MPP_SATA_LED }, MPP13_SATA_LED,
{ 14, MPP_SATA_LED }, MPP14_SATA_LED,
{ 15, MPP_SATA_LED }, MPP15_SATA_LED,
{ 16, MPP_UNUSED }, MPP16_UNUSED,
{ 17, MPP_GPIO }, /* power button LED */ MPP17_GPIO, /* power button LED */
{ 18, MPP_GPIO }, /* fan speed bit 0 */ MPP18_GPIO, /* fan speed bit 0 */
{ 19, MPP_GPIO }, /* fan speed bit 1 */ MPP19_GPIO, /* fan speed bit 1 */
{ -1 }, 0,
}; };
/* Rev C1 Fan speed notes: /* Rev C1 Fan speed notes:
......
...@@ -180,31 +180,31 @@ static struct platform_device edmini_v2_gpio_buttons = { ...@@ -180,31 +180,31 @@ static struct platform_device edmini_v2_gpio_buttons = {
/***************************************************************************** /*****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode edminiv2_mpp_modes[] __initdata = { static unsigned int edminiv2_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED }, MPP0_UNUSED,
{ 1, MPP_UNUSED }, MPP1_UNUSED,
{ 2, MPP_UNUSED }, MPP2_UNUSED,
{ 3, MPP_GPIO }, /* RTC interrupt */ MPP3_GPIO, /* RTC interrupt */
{ 4, MPP_UNUSED }, MPP4_UNUSED,
{ 5, MPP_UNUSED }, MPP5_UNUSED,
{ 6, MPP_UNUSED }, MPP6_UNUSED,
{ 7, MPP_UNUSED }, MPP7_UNUSED,
{ 8, MPP_UNUSED }, MPP8_UNUSED,
{ 9, MPP_UNUSED }, MPP9_UNUSED,
{ 10, MPP_UNUSED }, MPP10_UNUSED,
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_SATA_LED }, /* SATA 0 presence */ MPP12_SATA_LED, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */ MPP13_SATA_LED, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */ MPP14_SATA_LED, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */ MPP15_SATA_LED, /* SATA 1 active */
/* 16: Power LED control (0 = On, 1 = Off) */ /* 16: Power LED control (0 = On, 1 = Off) */
{ 16, MPP_GPIO }, MPP16_GPIO,
/* 17: Power LED control select (0 = CPLD, 1 = GPIO16) */ /* 17: Power LED control select (0 = CPLD, 1 = GPIO16) */
{ 17, MPP_GPIO }, MPP17_GPIO,
/* 18: Power button status (0 = Released, 1 = Pressed) */ /* 18: Power button status (0 = Released, 1 = Pressed) */
{ 18, MPP_GPIO }, MPP18_GPIO,
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 } 0,
}; };
static void __init edmini_v2_init(void) static void __init edmini_v2_init(void)
......
...@@ -315,28 +315,28 @@ static void kurobox_pro_power_off(void) ...@@ -315,28 +315,28 @@ static void kurobox_pro_power_off(void)
/***************************************************************************** /*****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode kurobox_pro_mpp_modes[] __initdata = { static unsigned int kurobox_pro_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED }, MPP0_UNUSED,
{ 1, MPP_UNUSED }, MPP1_UNUSED,
{ 2, MPP_GPIO }, /* GPIO Micon */ MPP2_GPIO, /* GPIO Micon */
{ 3, MPP_GPIO }, /* GPIO Rtc */ MPP3_GPIO, /* GPIO Rtc */
{ 4, MPP_UNUSED }, MPP4_UNUSED,
{ 5, MPP_UNUSED }, MPP5_UNUSED,
{ 6, MPP_NAND }, /* NAND Flash REn */ MPP6_NAND, /* NAND Flash REn */
{ 7, MPP_NAND }, /* NAND Flash WEn */ MPP7_NAND, /* NAND Flash WEn */
{ 8, MPP_UNUSED }, MPP8_UNUSED,
{ 9, MPP_UNUSED }, MPP9_UNUSED,
{ 10, MPP_UNUSED }, MPP10_UNUSED,
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_SATA_LED }, /* SATA 0 presence */ MPP12_SATA_LED, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */ MPP13_SATA_LED, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */ MPP14_SATA_LED, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */ MPP15_SATA_LED, /* SATA 1 active */
{ 16, MPP_UART }, /* UART1 RXD */ MPP16_UART, /* UART1 RXD */
{ 17, MPP_UART }, /* UART1 TXD */ MPP17_UART, /* UART1 TXD */
{ 18, MPP_UART }, /* UART1 CTSn */ MPP18_UART, /* UART1 CTSn */
{ 19, MPP_UART }, /* UART1 RTSn */ MPP19_UART, /* UART1 RTSn */
{ -1 }, 0,
}; };
static void __init kurobox_pro_init(void) static void __init kurobox_pro_init(void)
......
...@@ -251,28 +251,28 @@ static struct platform_device lschl_fan_device = { ...@@ -251,28 +251,28 @@ static struct platform_device lschl_fan_device = {
* GPIO Data * GPIO Data
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode lschl_mpp_modes[] __initdata = { static unsigned int lschl_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED POWER */ MPP0_GPIO, /* LED POWER */
{ 1, MPP_GPIO }, /* HDD POWER */ MPP1_GPIO, /* HDD POWER */
{ 2, MPP_GPIO }, /* LED ALARM */ MPP2_GPIO, /* LED ALARM */
{ 3, MPP_GPIO }, /* LED INFO */ MPP3_GPIO, /* LED INFO */
{ 4, MPP_UNUSED }, MPP4_UNUSED,
{ 5, MPP_UNUSED }, MPP5_UNUSED,
{ 6, MPP_GPIO }, /* FAN LOCK */ MPP6_GPIO, /* FAN LOCK */
{ 7, MPP_GPIO }, /* SW INIT */ MPP7_GPIO, /* SW INIT */
{ 8, MPP_GPIO }, /* SW POWER */ MPP8_GPIO, /* SW POWER */
{ 9, MPP_GPIO }, /* USB POWER */ MPP9_GPIO, /* USB POWER */
{ 10, MPP_GPIO }, /* SW AUTO POWER */ MPP10_GPIO, /* SW AUTO POWER */
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_UNUSED }, MPP12_UNUSED,
{ 13, MPP_UNUSED }, MPP13_UNUSED,
{ 14, MPP_GPIO }, /* FAN HIGH */ MPP14_GPIO, /* FAN HIGH */
{ 15, MPP_GPIO }, /* SW FUNC */ MPP15_GPIO, /* SW FUNC */
{ 16, MPP_GPIO }, /* FAN LOW */ MPP16_GPIO, /* FAN LOW */
{ 17, MPP_GPIO }, /* LED FUNC */ MPP17_GPIO, /* LED FUNC */
{ 18, MPP_UNUSED }, MPP18_UNUSED,
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 }, 0,
}; };
static void __init lschl_init(void) static void __init lschl_init(void)
......
...@@ -200,28 +200,28 @@ static void ls_hgl_power_off(void) ...@@ -200,28 +200,28 @@ static void ls_hgl_power_off(void)
#define LS_HGL_GPIO_HDD_POWER 1 #define LS_HGL_GPIO_HDD_POWER 1
static struct orion5x_mpp_mode ls_hgl_mpp_modes[] __initdata = { static unsigned int ls_hgl_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED_PWR */ MPP0_GPIO, /* LED_PWR */
{ 1, MPP_GPIO }, /* HDD_PWR */ MPP1_GPIO, /* HDD_PWR */
{ 2, MPP_GPIO }, /* LED_ALARM */ MPP2_GPIO, /* LED_ALARM */
{ 3, MPP_GPIO }, /* LED_INFO */ MPP3_GPIO, /* LED_INFO */
{ 4, MPP_UNUSED }, MPP4_UNUSED,
{ 5, MPP_UNUSED }, MPP5_UNUSED,
{ 6, MPP_GPIO }, /* FAN_LCK */ MPP6_GPIO, /* FAN_LCK */
{ 7, MPP_GPIO }, /* INIT */ MPP7_GPIO, /* INIT */
{ 8, MPP_GPIO }, /* POWER */ MPP8_GPIO, /* POWER */
{ 9, MPP_GPIO }, /* USB_PWR */ MPP9_GPIO, /* USB_PWR */
{ 10, MPP_GPIO }, /* AUTO_POWER */ MPP10_GPIO, /* AUTO_POWER */
{ 11, MPP_UNUSED }, /* LED_ETH (dummy) */ MPP11_UNUSED, /* LED_ETH (dummy) */
{ 12, MPP_UNUSED }, MPP12_UNUSED,
{ 13, MPP_UNUSED }, MPP13_UNUSED,
{ 14, MPP_UNUSED }, MPP14_UNUSED,
{ 15, MPP_GPIO }, /* FUNC */ MPP15_GPIO, /* FUNC */
{ 16, MPP_UNUSED }, MPP16_UNUSED,
{ 17, MPP_GPIO }, /* LED_FUNC */ MPP17_GPIO, /* LED_FUNC */
{ 18, MPP_UNUSED }, MPP18_UNUSED,
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 }, 0,
}; };
static void __init ls_hgl_init(void) static void __init ls_hgl_init(void)
......
...@@ -201,28 +201,28 @@ static void lsmini_power_off(void) ...@@ -201,28 +201,28 @@ static void lsmini_power_off(void)
#define LSMINI_GPIO_HDD_POWER0 1 #define LSMINI_GPIO_HDD_POWER0 1
#define LSMINI_GPIO_HDD_POWER1 19 #define LSMINI_GPIO_HDD_POWER1 19
static struct orion5x_mpp_mode lsmini_mpp_modes[] __initdata = { static unsigned int lsmini_mpp_modes[] __initdata = {
{ 0, MPP_UNUSED }, /* LED_RESERVE1 (unused) */ MPP0_UNUSED, /* LED_RESERVE1 (unused) */
{ 1, MPP_GPIO }, /* HDD_PWR */ MPP1_GPIO, /* HDD_PWR */
{ 2, MPP_GPIO }, /* LED_ALARM */ MPP2_GPIO, /* LED_ALARM */
{ 3, MPP_GPIO }, /* LED_INFO */ MPP3_GPIO, /* LED_INFO */
{ 4, MPP_UNUSED }, MPP4_UNUSED,
{ 5, MPP_UNUSED }, MPP5_UNUSED,
{ 6, MPP_UNUSED }, MPP6_UNUSED,
{ 7, MPP_UNUSED }, MPP7_UNUSED,
{ 8, MPP_UNUSED }, MPP8_UNUSED,
{ 9, MPP_GPIO }, /* LED_FUNC */ MPP9_GPIO, /* LED_FUNC */
{ 10, MPP_UNUSED }, MPP10_UNUSED,
{ 11, MPP_UNUSED }, /* LED_ETH (dummy) */ MPP11_UNUSED, /* LED_ETH (dummy) */
{ 12, MPP_UNUSED }, MPP12_UNUSED,
{ 13, MPP_UNUSED }, MPP13_UNUSED,
{ 14, MPP_GPIO }, /* LED_PWR */ MPP14_GPIO, /* LED_PWR */
{ 15, MPP_GPIO }, /* FUNC */ MPP15_GPIO, /* FUNC */
{ 16, MPP_GPIO }, /* USB_PWR */ MPP16_GPIO, /* USB_PWR */
{ 17, MPP_GPIO }, /* AUTO_POWER */ MPP17_GPIO, /* AUTO_POWER */
{ 18, MPP_GPIO }, /* POWER */ MPP18_GPIO, /* POWER */
{ 19, MPP_GPIO }, /* HDD_PWR1 */ MPP19_GPIO, /* HDD_PWR1 */
{ -1 }, 0,
}; };
static void __init lsmini_init(void) static void __init lsmini_init(void)
......
...@@ -12,154 +12,34 @@ ...@@ -12,154 +12,34 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/mbus.h> #include <linux/mbus.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/gpio.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include "common.h" #include <plat/mpp.h>
#include "mpp.h" #include "mpp.h"
#include "common.h"
static int is_5181l(void) static unsigned int __init orion5x_variant(void)
{
u32 dev;
u32 rev;
orion5x_pcie_id(&dev, &rev);
return !!(dev == MV88F5181_DEV_ID && rev >= MV88F5181L_REV_A0);
}
static int is_5182(void)
{ {
u32 dev; u32 dev;
u32 rev; u32 rev;
orion5x_pcie_id(&dev, &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) if (dev == MV88F5182_DEV_ID)
{ return MPP_F5182_MASK;
u32 dev;
u32 rev;
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) { orion_mpp_conf(mpp_list, orion5x_variant(),
case MPP_UNUSED: MPP_MAX, ORION5X_DEV_BUS_VIRT_BASE);
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);
} }
#ifndef __ARCH_ORION5X_MPP_H #ifndef __ARCH_ORION5X_MPP_H
#define __ARCH_ORION5X_MPP_H #define __ARCH_ORION5X_MPP_H
enum orion5x_mpp_type { #define MPP(_num, _sel, _in, _out, _F5181l, _F5182, _F5281) ( \
/* /* MPP number */ ((_num) & 0xff) | \
* This MPP is unused. /* MPP select value */ (((_sel) & 0xf) << 8) | \
*/ /* may be input signal */ ((!!(_in)) << 12) | \
MPP_UNUSED, /* may be output signal */ ((!!(_out)) << 13) | \
/* available on F5181l */ ((!!(_F5181l)) << 14) | \
/* /* available on F5182 */ ((!!(_F5182)) << 15) | \
* This MPP pin is used as a generic GPIO pin. Valid for /* available on F5281 */ ((!!(_F5281)) << 16))
* 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);
/* 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 #endif
...@@ -193,28 +193,28 @@ static void mss2_power_off(void) ...@@ -193,28 +193,28 @@ static void mss2_power_off(void)
/**************************************************************************** /****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode mss2_mpp_modes[] __initdata = { static unsigned int mss2_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Power LED */ MPP0_GPIO, /* Power LED */
{ 1, MPP_GPIO }, /* Error LED */ MPP1_GPIO, /* Error LED */
{ 2, MPP_UNUSED }, MPP2_UNUSED,
{ 3, MPP_GPIO }, /* RTC interrupt */ MPP3_GPIO, /* RTC interrupt */
{ 4, MPP_GPIO }, /* HDD ind. (Single/Dual)*/ MPP4_GPIO, /* HDD ind. (Single/Dual)*/
{ 5, MPP_GPIO }, /* HD0 5V control */ MPP5_GPIO, /* HD0 5V control */
{ 6, MPP_GPIO }, /* HD0 12V control */ MPP6_GPIO, /* HD0 12V control */
{ 7, MPP_GPIO }, /* HD1 5V control */ MPP7_GPIO, /* HD1 5V control */
{ 8, MPP_GPIO }, /* HD1 12V control */ MPP8_GPIO, /* HD1 12V control */
{ 9, MPP_UNUSED }, MPP9_UNUSED,
{ 10, MPP_GPIO }, /* Fan control */ MPP10_GPIO, /* Fan control */
{ 11, MPP_GPIO }, /* Power button */ MPP11_GPIO, /* Power button */
{ 12, MPP_GPIO }, /* Reset button */ MPP12_GPIO, /* Reset button */
{ 13, MPP_UNUSED }, MPP13_UNUSED,
{ 14, MPP_SATA_LED }, /* SATA 0 active */ MPP14_SATA_LED, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */ MPP15_SATA_LED, /* SATA 1 active */
{ 16, MPP_UNUSED }, MPP16_UNUSED,
{ 17, MPP_UNUSED }, MPP17_UNUSED,
{ 18, MPP_UNUSED }, MPP18_UNUSED,
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 }, 0,
}; };
static void __init mss2_init(void) static void __init mss2_init(void)
......
...@@ -108,28 +108,28 @@ static struct platform_device mv2120_button_device = { ...@@ -108,28 +108,28 @@ static struct platform_device mv2120_button_device = {
/**************************************************************************** /****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode mv2120_mpp_modes[] __initdata = { static unsigned int mv2120_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Sys status LED */ MPP0_GPIO, /* Sys status LED */
{ 1, MPP_GPIO }, /* Sys error LED */ MPP1_GPIO, /* Sys error LED */
{ 2, MPP_GPIO }, /* OverTemp interrupt */ MPP2_GPIO, /* OverTemp interrupt */
{ 3, MPP_GPIO }, /* RTC interrupt */ MPP3_GPIO, /* RTC interrupt */
{ 4, MPP_GPIO }, /* V_LED 5V */ MPP4_GPIO, /* V_LED 5V */
{ 5, MPP_GPIO }, /* V_LED 3.3V */ MPP5_GPIO, /* V_LED 3.3V */
{ 6, MPP_UNUSED }, MPP6_UNUSED,
{ 7, MPP_UNUSED }, MPP7_UNUSED,
{ 8, MPP_GPIO }, /* SATA 0 fail LED */ MPP8_GPIO, /* SATA 0 fail LED */
{ 9, MPP_GPIO }, /* SATA 1 fail LED */ MPP9_GPIO, /* SATA 1 fail LED */
{ 10, MPP_UNUSED }, MPP10_UNUSED,
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_SATA_LED }, /* SATA 0 presence */ MPP12_SATA_LED, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */ MPP13_SATA_LED, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */ MPP14_SATA_LED, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */ MPP15_SATA_LED, /* SATA 1 active */
{ 16, MPP_UNUSED }, MPP16_UNUSED,
{ 17, MPP_GPIO }, /* Reset button */ MPP17_GPIO, /* Reset button */
{ 18, MPP_GPIO }, /* Power button */ MPP18_GPIO, /* Power button */
{ 19, MPP_GPIO }, /* Power off */ MPP19_GPIO, /* Power off */
{ -1 }, 0,
}; };
static struct i2c_board_info __initdata mv2120_i2c_rtc = { static struct i2c_board_info __initdata mv2120_i2c_rtc = {
......
...@@ -339,28 +339,28 @@ static struct platform_device net2big_gpio_buttons = { ...@@ -339,28 +339,28 @@ static struct platform_device net2big_gpio_buttons = {
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode net2big_mpp_modes[] __initdata = { static unsigned int net2big_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Raid mode (bit 0) */ MPP0_GPIO, /* Raid mode (bit 0) */
{ 1, MPP_GPIO }, /* USB port 2 fuse (0 = Fail, 1 = Ok) */ MPP1_GPIO, /* USB port 2 fuse (0 = Fail, 1 = Ok) */
{ 2, MPP_GPIO }, /* Raid mode (bit 1) */ MPP2_GPIO, /* Raid mode (bit 1) */
{ 3, MPP_GPIO }, /* Board ID (bit 0) */ MPP3_GPIO, /* Board ID (bit 0) */
{ 4, MPP_GPIO }, /* Fan activity (0 = Off, 1 = On) */ MPP4_GPIO, /* Fan activity (0 = Off, 1 = On) */
{ 5, MPP_GPIO }, /* Fan fail detection */ MPP5_GPIO, /* Fan fail detection */
{ 6, MPP_GPIO }, /* Red front LED (0 = Off, 1 = On) */ MPP6_GPIO, /* Red front LED (0 = Off, 1 = On) */
{ 7, MPP_GPIO }, /* Disable initial blinking on front LED */ MPP7_GPIO, /* Disable initial blinking on front LED */
{ 8, MPP_GPIO }, /* Rear power switch (on|auto) */ MPP8_GPIO, /* Rear power switch (on|auto) */
{ 9, MPP_GPIO }, /* Rear power switch (auto|off) */ MPP9_GPIO, /* Rear power switch (auto|off) */
{ 10, MPP_GPIO }, /* SATA 1 red LED (0 = Off, 1 = On) */ MPP10_GPIO, /* SATA 1 red LED (0 = Off, 1 = On) */
{ 11, MPP_GPIO }, /* SATA 0 red LED (0 = Off, 1 = On) */ MPP11_GPIO, /* SATA 0 red LED (0 = Off, 1 = On) */
{ 12, MPP_GPIO }, /* Board ID (bit 1) */ MPP12_GPIO, /* Board ID (bit 1) */
{ 13, MPP_GPIO }, /* SATA 1 blue LED blink control */ MPP13_GPIO, /* SATA 1 blue LED blink control */
{ 14, MPP_SATA_LED }, MPP14_SATA_LED,
{ 15, MPP_SATA_LED }, MPP15_SATA_LED,
{ 16, MPP_GPIO }, /* Blue front LED control */ MPP16_GPIO, /* Blue front LED control */
{ 17, MPP_GPIO }, /* SATA 0 blue LED blink control */ MPP17_GPIO, /* SATA 0 blue LED blink control */
{ 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */ MPP18_GPIO, /* Front button (0 = Released, 1 = Pushed ) */
{ 19, MPP_GPIO }, /* SATA{0,1} power On/Off request */ MPP19_GPIO, /* SATA{0,1} power On/Off request */
{ -1 } 0,
/* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */ /* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */
/* 23: SATA 0 power status */ /* 23: SATA 0 power status */
/* 24: Board power off */ /* 24: Board power off */
......
...@@ -64,28 +64,28 @@ static struct platform_device rd88f5181l_fxo_nor_boot_flash = { ...@@ -64,28 +64,28 @@ static struct platform_device rd88f5181l_fxo_nor_boot_flash = {
/***************************************************************************** /*****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode rd88f5181l_fxo_mpp_modes[] __initdata = { static unsigned int rd88f5181l_fxo_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED1 CardBus LED (front panel) */ MPP0_GPIO, /* LED1 CardBus LED (front panel) */
{ 1, MPP_GPIO }, /* PCI_intA */ MPP1_GPIO, /* PCI_intA */
{ 2, MPP_GPIO }, /* Hard Reset / Factory Init*/ MPP2_GPIO, /* Hard Reset / Factory Init*/
{ 3, MPP_GPIO }, /* FXS or DAA select */ MPP3_GPIO, /* FXS or DAA select */
{ 4, MPP_GPIO }, /* LED6 - phone LED (front panel) */ MPP4_GPIO, /* LED6 - phone LED (front panel) */
{ 5, MPP_GPIO }, /* LED5 - phone LED (front panel) */ MPP5_GPIO, /* LED5 - phone LED (front panel) */
{ 6, MPP_PCI_CLK }, /* CPU PCI refclk */ MPP6_PCI_CLK, /* CPU PCI refclk */
{ 7, MPP_PCI_CLK }, /* PCI/PCIe refclk */ MPP7_PCI_CLK, /* PCI/PCIe refclk */
{ 8, MPP_GPIO }, /* CardBus reset */ MPP8_GPIO, /* CardBus reset */
{ 9, MPP_GPIO }, /* GE_RXERR */ MPP9_GPIO, /* GE_RXERR */
{ 10, MPP_GPIO }, /* LED2 MiniPCI LED (front panel) */ MPP10_GPIO, /* LED2 MiniPCI LED (front panel) */
{ 11, MPP_GPIO }, /* Lifeline control */ MPP11_GPIO, /* Lifeline control */
{ 12, MPP_GIGE }, /* GE_TXD[4] */ MPP12_GIGE, /* GE_TXD[4] */
{ 13, MPP_GIGE }, /* GE_TXD[5] */ MPP13_GIGE, /* GE_TXD[5] */
{ 14, MPP_GIGE }, /* GE_TXD[6] */ MPP14_GIGE, /* GE_TXD[6] */
{ 15, MPP_GIGE }, /* GE_TXD[7] */ MPP15_GIGE, /* GE_TXD[7] */
{ 16, MPP_GIGE }, /* GE_RXD[4] */ MPP16_GIGE, /* GE_RXD[4] */
{ 17, MPP_GIGE }, /* GE_RXD[5] */ MPP17_GIGE, /* GE_RXD[5] */
{ 18, MPP_GIGE }, /* GE_RXD[6] */ MPP18_GIGE, /* GE_RXD[6] */
{ 19, MPP_GIGE }, /* GE_RXD[7] */ MPP19_GIGE, /* GE_RXD[7] */
{ -1 }, 0,
}; };
static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = { static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = {
......
...@@ -65,28 +65,28 @@ static struct platform_device rd88f5181l_ge_nor_boot_flash = { ...@@ -65,28 +65,28 @@ static struct platform_device rd88f5181l_ge_nor_boot_flash = {
/***************************************************************************** /*****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode rd88f5181l_ge_mpp_modes[] __initdata = { static unsigned int rd88f5181l_ge_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* LED1 */ MPP0_GPIO, /* LED1 */
{ 1, MPP_GPIO }, /* LED5 */ MPP1_GPIO, /* LED5 */
{ 2, MPP_GPIO }, /* LED4 */ MPP2_GPIO, /* LED4 */
{ 3, MPP_GPIO }, /* LED3 */ MPP3_GPIO, /* LED3 */
{ 4, MPP_GPIO }, /* PCI_intA */ MPP4_GPIO, /* PCI_intA */
{ 5, MPP_GPIO }, /* RTC interrupt */ MPP5_GPIO, /* RTC interrupt */
{ 6, MPP_PCI_CLK }, /* CPU PCI refclk */ MPP6_PCI_CLK, /* CPU PCI refclk */
{ 7, MPP_PCI_CLK }, /* PCI/PCIe refclk */ MPP7_PCI_CLK, /* PCI/PCIe refclk */
{ 8, MPP_GPIO }, /* 88e6131 interrupt */ MPP8_GPIO, /* 88e6131 interrupt */
{ 9, MPP_GPIO }, /* GE_RXERR */ MPP9_GPIO, /* GE_RXERR */
{ 10, MPP_GPIO }, /* PCI_intB */ MPP10_GPIO, /* PCI_intB */
{ 11, MPP_GPIO }, /* LED2 */ MPP11_GPIO, /* LED2 */
{ 12, MPP_GIGE }, /* GE_TXD[4] */ MPP12_GIGE, /* GE_TXD[4] */
{ 13, MPP_GIGE }, /* GE_TXD[5] */ MPP13_GIGE, /* GE_TXD[5] */
{ 14, MPP_GIGE }, /* GE_TXD[6] */ MPP14_GIGE, /* GE_TXD[6] */
{ 15, MPP_GIGE }, /* GE_TXD[7] */ MPP15_GIGE, /* GE_TXD[7] */
{ 16, MPP_GIGE }, /* GE_RXD[4] */ MPP16_GIGE, /* GE_RXD[4] */
{ 17, MPP_GIGE }, /* GE_RXD[5] */ MPP17_GIGE, /* GE_RXD[5] */
{ 18, MPP_GIGE }, /* GE_RXD[6] */ MPP18_GIGE, /* GE_RXD[6] */
{ 19, MPP_GIGE }, /* GE_RXD[7] */ MPP19_GIGE, /* GE_RXD[7] */
{ -1 }, 0,
}; };
static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = { static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = {
......
...@@ -241,28 +241,28 @@ static struct mv_sata_platform_data rd88f5182_sata_data = { ...@@ -241,28 +241,28 @@ static struct mv_sata_platform_data rd88f5182_sata_data = {
/***************************************************************************** /*****************************************************************************
* General Setup * General Setup
****************************************************************************/ ****************************************************************************/
static struct orion5x_mpp_mode rd88f5182_mpp_modes[] __initdata = { static unsigned int rd88f5182_mpp_modes[] __initdata = {
{ 0, MPP_GPIO }, /* Debug Led */ MPP0_GPIO, /* Debug Led */
{ 1, MPP_GPIO }, /* Reset Switch */ MPP1_GPIO, /* Reset Switch */
{ 2, MPP_UNUSED }, MPP2_UNUSED,
{ 3, MPP_GPIO }, /* RTC Int */ MPP3_GPIO, /* RTC Int */
{ 4, MPP_GPIO }, MPP4_GPIO,
{ 5, MPP_GPIO }, MPP5_GPIO,
{ 6, MPP_GPIO }, /* PCI_intA */ MPP6_GPIO, /* PCI_intA */
{ 7, MPP_GPIO }, /* PCI_intB */ MPP7_GPIO, /* PCI_intB */
{ 8, MPP_UNUSED }, MPP8_UNUSED,
{ 9, MPP_UNUSED }, MPP9_UNUSED,
{ 10, MPP_UNUSED }, MPP10_UNUSED,
{ 11, MPP_UNUSED }, MPP11_UNUSED,
{ 12, MPP_SATA_LED }, /* SATA 0 presence */ MPP12_SATA_LED, /* SATA 0 presence */
{ 13, MPP_SATA_LED }, /* SATA 1 presence */ MPP13_SATA_LED, /* SATA 1 presence */
{ 14, MPP_SATA_LED }, /* SATA 0 active */ MPP14_SATA_LED, /* SATA 0 active */
{ 15, MPP_SATA_LED }, /* SATA 1 active */ MPP15_SATA_LED, /* SATA 1 active */
{ 16, MPP_UNUSED }, MPP16_UNUSED,
{ 17, MPP_UNUSED }, MPP17_UNUSED,
{ 18, MPP_UNUSED }, MPP18_UNUSED,
{ 19, MPP_UNUSED }, MPP19_UNUSED,
{ -1 }, 0,
}; };
static void __init rd88f5182_init(void) static void __init rd88f5182_init(void)
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
#include <mach/orion5x.h> #include <mach/orion5x.h>
#include "common.h" #include "common.h"
#include "mpp.h"
static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = { static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
.phy_addr = -1, .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 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # 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-m :=
obj-n := obj-n :=
obj- := 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, ...@@ -39,7 +39,6 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
/* /*
* GPIO interrupt handling. * GPIO interrupt handling.
*/ */
extern struct irq_chip orion_gpio_irq_chip;
void orion_gpio_irq_handler(int irqoff); 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