Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 554cdaef authored by Andrew Lunn's avatar Andrew Lunn Committed by Nicolas Pitre
Browse files

ARM: orion5x: Refactor mpp code to use common orion platform mpp.



Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarNicolas Pitre <nico@fluxnic.net>
parent b2f427a1
Loading
Loading
Loading
Loading
+22 −22
Original line number Diff line number Diff line
@@ -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) */
+22 −22
Original line number Diff line number Diff line
@@ -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)
+66 −66
Original line number Diff line number Diff line
@@ -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:
+22 −22
Original line number Diff line number Diff line
@@ -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)
+22 −22
Original line number Diff line number Diff line
@@ -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)
Loading