Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182018
b: refs/heads/master
c: 27dd65a
h: refs/heads/master
v: v3
  • Loading branch information
Manuel Lauss authored and Ralf Baechle committed Feb 27, 2010
1 parent 6087753 commit dcebe5f
Show file tree
Hide file tree
Showing 23 changed files with 413 additions and 126 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66213b3ccfc770704025ce9465fa3aaedde21b55
refs/heads/master: 27dd65ac9afabc8e67ab73f7c2f575eddbb47167
2 changes: 1 addition & 1 deletion trunk/arch/mips/alchemy/devboards/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Alchemy Develboards
#

obj-y += prom.o bcsr.o
obj-y += prom.o bcsr.o platform.o
obj-$(CONFIG_PM) += pm.o
obj-$(CONFIG_MIPS_PB1000) += pb1000/
obj-$(CONFIG_MIPS_PB1100) += pb1100/
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/alchemy/devboards/db1x00/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# Makefile for the Alchemy Semiconductor DBAu1xx0 boards.
#

obj-y := board_setup.o
obj-y := board_setup.o platform.o
4 changes: 4 additions & 0 deletions trunk/arch/mips/alchemy/devboards/db1x00/board_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,12 @@ static int __init db1x00_init_irq(void)
#if defined(CONFIG_MIPS_MIRAGE)
set_irq_type(AU1000_GPIO_7, IRQF_TRIGGER_RISING); /* TS pendown */
#elif defined(CONFIG_MIPS_DB1550)
set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW); /* CD0# */
set_irq_type(AU1000_GPIO_1, IRQF_TRIGGER_LOW); /* CD1# */
set_irq_type(AU1000_GPIO_3, IRQF_TRIGGER_LOW); /* CARD0# */
set_irq_type(AU1000_GPIO_5, IRQF_TRIGGER_LOW); /* CARD1# */
set_irq_type(AU1000_GPIO_21, IRQF_TRIGGER_LOW); /* STSCHG0# */
set_irq_type(AU1000_GPIO_22, IRQF_TRIGGER_LOW); /* STSCHG1# */
#else
set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW); /* CD0# */
set_irq_type(AU1000_GPIO_3, IRQF_TRIGGER_LOW); /* CD1# */
Expand Down
84 changes: 84 additions & 0 deletions trunk/arch/mips/alchemy/devboards/db1x00/platform.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* DBAu1xxx board platform device registration
*
* Copyright (C) 2009 Manuel Lauss
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <linux/init.h>
#include <linux/platform_device.h>

#include <asm/mach-au1x00/au1xxx.h>
#include "../platform.h"

#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || \
defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550)
#define DB1XXX_HAS_PCMCIA
#endif

/* DB1xxx PCMCIA interrupt sources:
* CD0/1 GPIO0/3
* STSCHG0/1 GPIO1/4
* CARD0/1 GPIO2/5
* Db1550: 0/1, 21/22, 3/5
*/
#ifndef CONFIG_MIPS_DB1550
/* Db1000, Db1100, Db1500 */
#define DB1XXX_PCMCIA_CD0 AU1000_GPIO_0
#define DB1XXX_PCMCIA_STSCHG0 AU1000_GPIO_1
#define DB1XXX_PCMCIA_CARD0 AU1000_GPIO_2
#define DB1XXX_PCMCIA_CD1 AU1000_GPIO_3
#define DB1XXX_PCMCIA_STSCHG1 AU1000_GPIO_4
#define DB1XXX_PCMCIA_CARD1 AU1000_GPIO_5
#else
#define DB1XXX_PCMCIA_CD0 AU1000_GPIO_0
#define DB1XXX_PCMCIA_STSCHG0 AU1500_GPIO_21
#define DB1XXX_PCMCIA_CARD0 AU1000_GPIO_3
#define DB1XXX_PCMCIA_CD1 AU1000_GPIO_1
#define DB1XXX_PCMCIA_STSCHG1 AU1500_GPIO_22
#define DB1XXX_PCMCIA_CARD1 AU1000_GPIO_5
#endif

static int __init db1xxx_dev_init(void)
{
#ifdef DB1XXX_HAS_PCMCIA
db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_MEM_PSEUDO_PHYS,
PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_IO_PSEUDO_PHYS,
PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
DB1XXX_PCMCIA_CARD0,
DB1XXX_PCMCIA_CD0,
/*DB1XXX_PCMCIA_STSCHG0*/0,
0,
0);

db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00400000,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00440000 - 1,
PCMCIA_MEM_PSEUDO_PHYS + 0x00400000,
PCMCIA_MEM_PSEUDO_PHYS + 0x00440000 - 1,
PCMCIA_IO_PSEUDO_PHYS + 0x00400000,
PCMCIA_IO_PSEUDO_PHYS + 0x00401000 - 1,
DB1XXX_PCMCIA_CARD1,
DB1XXX_PCMCIA_CD1,
/*DB1XXX_PCMCIA_STSCHG1*/0,
0,
1);
#endif
return 0;
}
device_initcall(db1xxx_dev_init);
2 changes: 1 addition & 1 deletion trunk/arch/mips/alchemy/devboards/pb1100/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# Makefile for the Alchemy Semiconductor Pb1100 board.
#

obj-y := board_setup.o
obj-y := board_setup.o platform.o
1 change: 0 additions & 1 deletion trunk/arch/mips/alchemy/devboards/pb1100/board_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/interrupt.h>

#include <asm/mach-au1x00/au1000.h>
#include <asm/mach-pb1x00/pb1100.h>
#include <asm/mach-db1x00/bcsr.h>

#include <prom.h>
Expand Down
43 changes: 43 additions & 0 deletions trunk/arch/mips/alchemy/devboards/pb1100/platform.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Pb1100 board platform device registration
*
* Copyright (C) 2009 Manuel Lauss
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <linux/init.h>

#include <asm/mach-au1x00/au1000.h>

#include "../platform.h"

static int __init pb1100_dev_init(void)
{
/* PCMCIA. single socket, identical to Pb1500 */
db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_MEM_PSEUDO_PHYS,
PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_IO_PSEUDO_PHYS,
PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
AU1000_GPIO_11, /* card */
AU1000_GPIO_9, /* insert */
/*AU1000_GPIO_10*/0, /* stschg */
0, /* eject */
0); /* id */
return 0;
}
device_initcall(pb1100_dev_init);
55 changes: 53 additions & 2 deletions trunk/arch/mips/alchemy/devboards/pb1200/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <asm/mach-au1x00/au1100_mmc.h>
#include <asm/mach-db1x00/bcsr.h>

#include "../platform.h"

static int mmc_activity;

static void pb1200mmc0_set_power(void *mmc_host, int state)
Expand Down Expand Up @@ -170,8 +172,57 @@ static struct platform_device *board_platform_devices[] __initdata = {

static int __init board_register_devices(void)
{
#ifdef CONFIG_MIPS_PB1200
db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_MEM_PSEUDO_PHYS,
PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_IO_PSEUDO_PHYS,
PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
PB1200_PC0_INT,
PB1200_PC0_INSERT_INT,
/*PB1200_PC0_STSCHG_INT*/0,
PB1200_PC0_EJECT_INT,
0);

db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00800000,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00840000 - 1,
PCMCIA_MEM_PSEUDO_PHYS + 0x00800000,
PCMCIA_MEM_PSEUDO_PHYS + 0x00840000 - 1,
PCMCIA_IO_PSEUDO_PHYS + 0x00800000,
PCMCIA_IO_PSEUDO_PHYS + 0x00801000 - 1,
PB1200_PC1_INT,
PB1200_PC1_INSERT_INT,
/*PB1200_PC1_STSCHG_INT*/0,
PB1200_PC1_EJECT_INT,
1);
#else
db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_MEM_PSEUDO_PHYS,
PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_IO_PSEUDO_PHYS,
PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
DB1200_PC0_INT,
DB1200_PC0_INSERT_INT,
/*DB1200_PC0_STSCHG_INT*/0,
DB1200_PC0_EJECT_INT,
0);

db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00400000,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00440000 - 1,
PCMCIA_MEM_PSEUDO_PHYS + 0x00400000,
PCMCIA_MEM_PSEUDO_PHYS + 0x00440000 - 1,
PCMCIA_IO_PSEUDO_PHYS + 0x00400000,
PCMCIA_IO_PSEUDO_PHYS + 0x00401000 - 1,
DB1200_PC1_INT,
DB1200_PC1_INSERT_INT,
/*DB1200_PC1_STSCHG_INT*/0,
DB1200_PC1_EJECT_INT,
1);
#endif

return platform_add_devices(board_platform_devices,
ARRAY_SIZE(board_platform_devices));
}

arch_initcall(board_register_devices);
device_initcall(board_register_devices);
2 changes: 1 addition & 1 deletion trunk/arch/mips/alchemy/devboards/pb1500/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# Makefile for the Alchemy Semiconductor Pb1500 board.
#

obj-y := board_setup.o
obj-y := board_setup.o platform.o
4 changes: 3 additions & 1 deletion trunk/arch/mips/alchemy/devboards/pb1500/board_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/interrupt.h>

#include <asm/mach-au1x00/au1000.h>
#include <asm/mach-pb1x00/pb1500.h>
#include <asm/mach-db1x00/bcsr.h>

#include <prom.h>
Expand Down Expand Up @@ -156,6 +155,9 @@ void __init board_setup(void)

static int __init pb1500_init_irq(void)
{
set_irq_type(AU1000_GPIO_9, IRQF_TRIGGER_LOW); /* CD0# */
set_irq_type(AU1000_GPIO_10, IRQF_TRIGGER_LOW); /* CARD0 */
set_irq_type(AU1000_GPIO_11, IRQF_TRIGGER_LOW); /* STSCHG0# */
set_irq_type(AU1500_GPIO_204, IRQF_TRIGGER_HIGH);
set_irq_type(AU1500_GPIO_201, IRQF_TRIGGER_LOW);
set_irq_type(AU1500_GPIO_202, IRQF_TRIGGER_LOW);
Expand Down
42 changes: 42 additions & 0 deletions trunk/arch/mips/alchemy/devboards/pb1500/platform.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Pb1500 board platform device registration
*
* Copyright (C) 2009 Manuel Lauss
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <linux/init.h>
#include <asm/mach-au1x00/au1000.h>

#include "../platform.h"

static int __init pb1500_dev_init(void)
{
/* PCMCIA. single socket, identical to Pb1500 */
db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_MEM_PSEUDO_PHYS,
PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
PCMCIA_IO_PSEUDO_PHYS,
PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
AU1000_GPIO_11, /* card */
AU1000_GPIO_9, /* insert */
/*AU1000_GPIO_10*/0, /* stschg */
0, /* eject */
0); /* id */
return 0;
}
device_initcall(pb1500_dev_init);
2 changes: 1 addition & 1 deletion trunk/arch/mips/alchemy/devboards/pb1550/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# Makefile for the Alchemy Semiconductor Pb1550 board.
#

obj-y := board_setup.o
obj-y := board_setup.o platform.o
8 changes: 8 additions & 0 deletions trunk/arch/mips/alchemy/devboards/pb1550/board_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <asm/mach-au1x00/au1000.h>
#include <asm/mach-pb1x00/pb1550.h>
#include <asm/mach-db1x00/bcsr.h>
#include <asm/mach-au1x00/gpio.h>

#include <prom.h>

Expand Down Expand Up @@ -70,6 +71,8 @@ void __init board_setup(void)
}
#endif

alchemy_gpio2_enable();

/*
* Enable PSC1 SYNC for AC'97. Normaly done in audio driver,
* but it is board specific code, so put it here.
Expand All @@ -88,6 +91,11 @@ static int __init pb1550_init_irq(void)
{
set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW);
set_irq_type(AU1000_GPIO_1, IRQF_TRIGGER_LOW);
set_irq_type(AU1500_GPIO_201_205, IRQF_TRIGGER_HIGH);

/* enable both PCMCIA card irqs in the shared line */
alchemy_gpio2_enable_int(201);
alchemy_gpio2_enable_int(202);

return 0;
}
Expand Down
Loading

0 comments on commit dcebe5f

Please sign in to comment.