Alchemy: devboard and platform updates
Subsystems (5)
PATCH v2 1/6 Alchemy: devboard register abstraction
In reply to Manuel LaussAll Alchemy development boards have external CPLDs with a few registers in them. They all share an identical register layout with only a few minor differences (except the PB1000) in bit functions and base addresses.
This patch
- adds a primitive facility to initialize and use these external registers,
- replaces all occurrences of bcsr->xxx accesses with calls to the new functions (the pb1200 cascade irq handling code is special).
- collects BCSR register information scattered throughout the board headers in a central place.
--- arch/mips/alchemy/devboards/Makefile | 2 +- arch/mips/alchemy/devboards/bcsr.c | 76 +++++++ arch/mips/alchemy/devboards/db1x00/board_setup.c | 62 +++--- arch/mips/alchemy/devboards/pb1100/board_setup.c | 7 +- arch/mips/alchemy/devboards/pb1200/board_setup.c | 49 ++--- arch/mips/alchemy/devboards/pb1200/irqmap.c | 42 +++-- arch/mips/alchemy/devboards/pb1200/platform.c | 25 ++- arch/mips/alchemy/devboards/pb1500/board_setup.c | 7 +- arch/mips/alchemy/devboards/pb1550/board_setup.c | 11 +- arch/mips/include/asm/mach-db1x00/bcsr.h | 235 ++++++++++++++++++++++ arch/mips/include/asm/mach-db1x00/db1200.h | 109 +---------- arch/mips/include/asm/mach-db1x00/db1x00.h | 92 --------- arch/mips/include/asm/mach-pb1x00/pb1100.h | 49 ----- arch/mips/include/asm/mach-pb1x00/pb1200.h | 109 +---------- arch/mips/include/asm/mach-pb1x00/pb1500.h | 13 -- arch/mips/include/asm/mach-pb1x00/pb1550.h | 89 -------- drivers/mtd/nand/au1550nd.c | 4 +- drivers/net/irda/au1k_ir.c | 14 +- drivers/pcmcia/au1000_db1x00.c | 76 ++++---- 19 files changed, 475 insertions(+), 596 deletions(-) create mode 100644 arch/mips/alchemy/devboards/bcsr.c create mode 100644 arch/mips/include/asm/mach-db1x00/bcsr.h
arch/mips/alchemy/devboards/Makefile +1 -1
@@ -2,7 +2,7 @@ # Alchemy Develboards # -obj-y += prom.o +obj-y += prom.o bcsr.o obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_MIPS_PB1000) += pb1000/ obj-$(CONFIG_MIPS_PB1100) += pb1100/
arch/mips/alchemy/devboards/bcsr.c new file +76 -0
76 lines not on this page · raw message
arch/mips/alchemy/devboards/db1x00/board_setup.c +34 -28
95 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1100/board_setup.c +5 -2
@@ -30,6 +30,7 @@#include <asm/mach-au1x00/au1000.h> #include <asm/mach-pb1x00/pb1100.h> +#include <asm/mach-db1x00/bcsr.h> #include <prom.h>
@@ -49,8 +50,7 @@ const char *get_system_type(void)void board_reset (void ) { -/* Hit BCSR.RST_VDDI[SOFT_RESET] */ -au_writel (0x00000000 ,PB1100_RST_VDDI ); +bcsr_write (BCSR_SYSTEM ,0 ); }void __init board_init_irq (void )
@@ -63,6 +63,9 @@ void __init board_setup(void)volatile void __iomem *base = (volatile void __iomem *)0xac000000UL ;char *argptr; +bcsr_init (DB1000_BCSR_PHYS_ADDR , +DB1000_BCSR_PHYS_ADDR +DB1000_BCSR_HEXLED_OFS ); + argptr =prom_getcmdline ();#ifdef CONFIG_SERIAL_8250_CONSOLE argptr =strstr (argptr,"console=" );
arch/mips/alchemy/devboards/pb1200/board_setup.c +23 -26
98 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1200/irqmap.c +26 -16
88 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1200/platform.c +13 -12
@@ -26,27 +26,28 @@#include <asm/mach-au1x00/au1xxx.h> #include <asm/mach-au1x00/au1100_mmc.h> +#include <asm/mach-db1x00/bcsr.h> static int mmc_activity;static void pb1200mmc0_set_power (void *mmc_host,int state) {if (state) - bcsr->board |=BCSR_BOARD_SD0PWR ; +bcsr_mod (BCSR_BOARD ,0 ,BCSR_BOARD_SD0PWR );else - bcsr->board &= ~BCSR_BOARD_SD0PWR ; +bcsr_mod (BCSR_BOARD ,BCSR_BOARD_SD0PWR ,0 ); -au_sync_delay (1 ); +msleep (1 ); }static int pb1200mmc0_card_readonly (void *mmc_host) { -return (bcsr->status &BCSR_STATUS_SD0WP ) ?1 :0 ; +return (bcsr_read (BCSR_STATUS ) &BCSR_STATUS_SD0WP ) ?1 :0 ; }static int pb1200mmc0_card_inserted (void *mmc_host) { -return (bcsr->sig_status &BCSR_INT_SD0INSERT ) ?1 :0 ; +return (bcsr_read (BCSR_SIGSTAT ) &BCSR_INT_SD0INSERT ) ?1 :0 ; } static void pb1200_mmcled_set(struct led_classdev *led,
@@ -54,10 +55,10 @@ static void pb1200_mmcled_set(struct led_classdev *led, {if (brightness !=LED_OFF ) {if (++mmc_activity ==1 ) - bcsr->disk_leds &= ~(1 <<8 ); +bcsr_mod (BCSR_LEDS ,BCSR_LEDS_LED0 ,0 ); }else {if (--mmc_activity ==0 ) - bcsr->disk_leds |= (1 <<8 ); +bcsr_mod (BCSR_LEDS ,0 ,BCSR_LEDS_LED0 ); } }
@@ -69,21 +70,21 @@ static struct led_classdev pb1200mmc_led = {static void pb1200mmc1_set_power (void *mmc_host,int state) {if (state) - bcsr->board |=BCSR_BOARD_SD1PWR ; +bcsr_mod (BCSR_BOARD ,0 ,BCSR_BOARD_SD1PWR );else - bcsr->board &= ~BCSR_BOARD_SD1PWR ; +bcsr_mod (BCSR_BOARD ,BCSR_BOARD_SD1PWR ,0 ); -au_sync_delay (1 ); +msleep (1 ); }static int pb1200mmc1_card_readonly (void *mmc_host) { -return (bcsr->status &BCSR_STATUS_SD1WP ) ?1 :0 ; +return (bcsr_read (BCSR_STATUS ) &BCSR_STATUS_SD1WP ) ?1 :0 ; }static int pb1200mmc1_card_inserted (void *mmc_host) { -return (bcsr->sig_status &BCSR_INT_SD1INSERT ) ?1 :0 ; +return (bcsr_read (BCSR_SIGSTAT ) &BCSR_INT_SD1INSERT ) ?1 :0 ; }#endif
arch/mips/alchemy/devboards/pb1500/board_setup.c +5 -2
@@ -30,6 +30,7 @@#include <asm/mach-au1x00/au1000.h> #include <asm/mach-pb1x00/pb1500.h> +#include <asm/mach-db1x00/bcsr.h> #include <prom.h>
@@ -55,8 +56,7 @@ const char *get_system_type(void)void board_reset (void ) { -/* Hit BCSR.RST_VDDI[SOFT_RESET] */ -au_writel (0x00000000 ,PB1500_RST_VDDI ); +bcsr_write (BCSR_SYSTEM ,0 ); }void __init board_init_irq (void )
@@ -70,6 +70,9 @@ void __init board_setup(void)u32 sys_freqctrl, sys_clksrc;char *argptr; +bcsr_init (DB1000_BCSR_PHYS_ADDR , +DB1000_BCSR_PHYS_ADDR +DB1000_BCSR_HEXLED_OFS ); + argptr =prom_getcmdline ();#ifdef CONFIG_SERIAL_8250_CONSOLE argptr =strstr (argptr,"console=" );
arch/mips/alchemy/devboards/pb1550/board_setup.c +7 -4
@@ -32,6 +32,7 @@#include <asm/mach-au1x00/au1000.h> #include <asm/mach-pb1x00/pb1550.h> +#include <asm/mach-db1x00/bcsr.h> #include <prom.h>
@@ -53,8 +54,7 @@ const char *get_system_type(void)void board_reset (void ) { -/* Hit BCSR.SYSTEM[RESET] */ -au_writew (au_readw (0xAF00001C ) & ~BCSR_SYSTEM_RESET ,0xAF00001C ); +bcsr_write (BCSR_SYSTEM ,0 ); }void __init board_init_irq (void )
@@ -66,6 +66,10 @@ void __init board_setup(void) {u32 pin_func; +bcsr_init (PB1550_BCSR_PHYS_ADDR , +PB1550_BCSR_PHYS_ADDR +PB1550_BCSR_HEXLED_OFS ); + +#ifdef CONFIG_SERIAL_8250_CONSOLE char *argptr; argptr =prom_getcmdline ();
@@ -85,8 +89,7 @@ void __init board_setup(void) pin_func |=SYS_PF_MUST_BE_SET |SYS_PF_PSC1_S1 ;au_writel (pin_func,SYS_PINFUNC ); -au_writel (0 , (u32 )bcsr |0x10 );/* turn off PCMCIA power */ -au_sync (); +bcsr_write (BCSR_PCMCIA ,0 );/* turn off PCMCIA power */ printk (KERN_INFO "AMD Alchemy Pb1550 Board\n" ); }
arch/mips/include/asm/mach-db1x00/bcsr.h new file +235 -0
235 lines not on this page · raw message
arch/mips/include/asm/mach-db1x00/db1200.h +1 -108
121 lines not on this page · raw message
arch/mips/include/asm/mach-db1x00/db1x00.h +0 -92
102 lines not on this page · raw message
arch/mips/include/asm/mach-pb1x00/pb1100.h +0 -49
55 lines not on this page · raw message
arch/mips/include/asm/mach-pb1x00/pb1200.h +2 -107
122 lines not on this page · raw message
arch/mips/include/asm/mach-pb1x00/pb1500.h +0 -13
@@ -26,19 +26,6 @@#ifndef __ASM_PB1500_H#define __ASM_PB1500_H -#define IDENT_BOARD_REG 0xAE000000 -#define BOARD_STATUS_REG 0xAE000004 -#define PCI_BOARD_REG 0xAE000010 -#define PCMCIA_BOARD_REG 0xAE000010 -# define PC_DEASSERT_RST 0x80 -# define PC_DRV_EN 0x10 -#define PB1500_G_CONTROL 0xAE000014 -#define PB1500_RST_VDDI 0xAE00001C -#define PB1500_LEDS 0xAE000018 - -#define PB1500_HEX_LED 0xAF000004 -#define PB1500_HEX_LED_BLANK 0xAF000008 -/* PCMCIA Pb1500 specific defines */ #define PCMCIA_MAX_SOCK 0#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
arch/mips/include/asm/mach-pb1x00/pb1550.h +0 -89
95 lines not on this page · raw message
drivers/mtd/nand/au1550nd.c +3 -1
@@ -19,6 +19,7 @@#include <asm/io.h> #include <asm/mach-au1x00/au1xxx.h> +#include <asm/mach-db1x00/bcsr.h> /* * MTD structure for NAND controller
@@ -475,7 +476,8 @@ static int __init au1xxx_nand_init(void)/* set gpio206 high */ au_writel (au_readl (GPIO2_DIR ) & ~(1 <<6 ),GPIO2_DIR ); - boot_swapboot = (au_readl (MEM_STSTAT ) & (0x7 <<1 )) | ((bcsr->status >>6 ) &0x1 ); + boot_swapboot = (au_readl (MEM_STSTAT ) & (0x7 <<1 )) | ((bcsr_read (BCSR_STATUS ) >>6 ) &0x1 ); +switch (boot_swapboot) {case 0 :case 2 :
drivers/net/irda/au1k_ir.c +5 -9
@@ -36,6 +36,7 @@#include <asm/pb1000.h> #elif defined(CONFIG_MIPS_DB1000 ) || defined(CONFIG_MIPS_DB1100 )#include <asm/db1x00.h> +#include <asm/mach-db1x00/bcsr.h> #else #error au1k_ir: unsupported board#endif
@@ -66,10 +67,6 @@ static char version[] __devinitdata =#define RUN_AT (x) (jiffies + (x)) -#if defined(CONFIG_MIPS_DB1000 ) || defined(CONFIG_MIPS_DB1100 ) -static BCSR *const bcsr = (BCSR *)0xAE000000 ; -#endif -static DEFINE_SPINLOCK (ir_lock);/*
@@ -282,9 +279,8 @@ static int au1k_irda_net_init(struct net_device *dev)#if defined(CONFIG_MIPS_DB1000 ) || defined(CONFIG_MIPS_DB1100 )/* power on */ - bcsr->resets &= ~BCSR_RESETS_IRDA_MODE_MASK ; - bcsr->resets |=BCSR_RESETS_IRDA_MODE_FULL ; -au_sync (); +bcsr_mod (BCSR_RESETS ,BCSR_RESETS_IRDA_MODE_MASK , +BCSR_RESETS_IRDA_MODE_FULL );#endif return 0 ;
@@ -720,14 +716,14 @@ au1k_irda_set_speed(struct net_device *dev, int speed)if (speed ==4000000 ) {#if defined(CONFIG_MIPS_DB1000 ) || defined(CONFIG_MIPS_DB1100 ) - bcsr->resets |=BCSR_RESETS_FIR_SEL ; +bcsr_mod (BCSR_RESETS ,0 ,BCSR_RESETS_FIR_SEL );#else /* Pb1000 and Pb1100 */ writel (1 <<13 ,CPLD_AUX1 );#endif }else {#if defined(CONFIG_MIPS_DB1000 ) || defined(CONFIG_MIPS_DB1100 ) - bcsr->resets &= ~BCSR_RESETS_FIR_SEL ; +bcsr_mod (BCSR_RESETS ,BCSR_RESETS_FIR_SEL ,0 );#else /* Pb1000 and Pb1100 */ writel (readl (CPLD_AUX1 ) & ~(1 <<13 ),CPLD_AUX1 );#endif
drivers/pcmcia/au1000_db1x00.c +39 -37
153 lines not on this page · raw message
Signature · 1 line
1.6.5.rc2
v2 cover Alchemy: devboard and platform updates
This is a V2 of the series formerly sent as "BCSR abstraction and new PCMCIA socket driver".
Changes V1->V2:
- split the pcmcia socket driver patch in a driver-patch and board-support patch (#4 / #5);
- fixed typos in #1
- added new patch #3
- added #6 to the series, since it depends on #4 to compile.
#1 adds basic devboard register ("BCSR" space) API and converts
all "bcsr->" invocations to use the new API.
The API is slower than direct access but adds locking to register modify operations, which patch #3 can take advantage of.
#2 generalizes PB1200's CPLD IRQ controller code; DB1300 can use it
too.
#3 gets rid of the "board_init_irq" callback in the boards: On all
currently supported boards it's sufficient to initialize GPIO-based interrupts in an arch_initcall through use of standard irq functions.
#4 replaces the current devboard PCMCIA socket code. See patch for
more details. While it doesn't really belong to this series
per-se, it does make use of the functions introduced by #1.
#5 wire up the new pcmcia driver
#6 new pcmcia socket driver for XXS1500 systems (compiled only).
As always, run-tested on the DB1200 where possible; although testers for all other boards would be very much appreciated!
Patches 1-3 are more-or-less MIPS-specific, I'd like for them to get applied while 4-6 await feedback from pcmcia list.
Thanks,
Manuel Lauss
Manuel Lauss (6):
Alchemy: devboard register abstraction
Alchemy: devboards: factor out PB1200 IRQ cascade code.
Alchemy: remove board_init_irq() function.
PCMCIA: new socket driver for Au1000 demoboards.
Alchemy: devboards: wire up new PCMCIA driver.
Alchemy: XXS1500 PCMCIA driver rewrite
arch/mips/alchemy/common/irq.c | 15 +- arch/mips/alchemy/common/platform.c | 6 - arch/mips/alchemy/common/setup.c | 3 +- arch/mips/alchemy/devboards/Makefile | 2 +- arch/mips/alchemy/devboards/bcsr.c | 148 +++++ arch/mips/alchemy/devboards/db1x00/Makefile | 2 +- arch/mips/alchemy/devboards/db1x00/board_setup.c | 109 +++- arch/mips/alchemy/devboards/db1x00/irqmap.c | 90 --- arch/mips/alchemy/devboards/db1x00/platform.c | 84 +++ arch/mips/alchemy/devboards/pb1000/board_setup.c | 17 +- arch/mips/alchemy/devboards/pb1100/Makefile | 3 +- arch/mips/alchemy/devboards/pb1100/board_setup.c | 31 +- arch/mips/alchemy/devboards/pb1100/platform.c | 41 ++ arch/mips/alchemy/devboards/pb1200/Makefile | 2 +- arch/mips/alchemy/devboards/pb1200/board_setup.c | 91 +++- arch/mips/alchemy/devboards/pb1200/irqmap.c | 134 ----- arch/mips/alchemy/devboards/pb1200/platform.c | 80 +++- arch/mips/alchemy/devboards/pb1500/Makefile | 3 +- arch/mips/alchemy/devboards/pb1500/board_setup.c | 35 +- arch/mips/alchemy/devboards/pb1500/platform.c | 41 ++ arch/mips/alchemy/devboards/pb1550/Makefile | 3 +- arch/mips/alchemy/devboards/pb1550/board_setup.c | 38 +- arch/mips/alchemy/devboards/pb1550/platform.c | 63 +++ arch/mips/alchemy/devboards/platform.c | 89 +++ arch/mips/alchemy/devboards/platform.h | 18 + arch/mips/alchemy/mtx-1/Makefile | 2 +- arch/mips/alchemy/mtx-1/board_setup.c | 24 + arch/mips/alchemy/mtx-1/irqmap.c | 56 -- arch/mips/alchemy/xxs1500/Makefile | 2 +- arch/mips/alchemy/xxs1500/board_setup.c | 37 +- arch/mips/alchemy/xxs1500/irqmap.c | 52 -- arch/mips/alchemy/xxs1500/platform.c | 63 +++ arch/mips/include/asm/mach-au1x00/au1000.h | 29 +- arch/mips/include/asm/mach-db1x00/bcsr.h | 238 ++++++++ arch/mips/include/asm/mach-db1x00/db1200.h | 123 +----- arch/mips/include/asm/mach-db1x00/db1x00.h | 100 ---- arch/mips/include/asm/mach-pb1x00/pb1100.h | 85 --- arch/mips/include/asm/mach-pb1x00/pb1200.h | 122 +---- arch/mips/include/asm/mach-pb1x00/pb1500.h | 49 -- arch/mips/include/asm/mach-pb1x00/pb1550.h | 96 ---- drivers/mtd/nand/au1550nd.c | 4 +- drivers/net/irda/au1k_ir.c | 14 +- drivers/pcmcia/Kconfig | 21 + drivers/pcmcia/Makefile | 12 +- drivers/pcmcia/au1000_db1x00.c | 305 ----------- drivers/pcmcia/au1000_generic.h | 12 +- drivers/pcmcia/au1000_pb1x00.c | 119 +---- drivers/pcmcia/au1000_xxs1500.c | 188 ------- drivers/pcmcia/db1xxx_ss.c | 630 ++++++++++++++++++++++ drivers/pcmcia/xxs1500_ss.c | 357 ++++++++++++ 50 files changed, 2172 insertions(+), 1716 deletions(-) create mode 100644 arch/mips/alchemy/devboards/bcsr.c delete mode 100644 arch/mips/alchemy/devboards/db1x00/irqmap.c create mode 100644 arch/mips/alchemy/devboards/db1x00/platform.c create mode 100644 arch/mips/alchemy/devboards/pb1100/platform.c delete mode 100644 arch/mips/alchemy/devboards/pb1200/irqmap.c create mode 100644 arch/mips/alchemy/devboards/pb1500/platform.c create mode 100644 arch/mips/alchemy/devboards/pb1550/platform.c create mode 100644 arch/mips/alchemy/devboards/platform.c create mode 100644 arch/mips/alchemy/devboards/platform.h delete mode 100644 arch/mips/alchemy/mtx-1/irqmap.c delete mode 100644 arch/mips/alchemy/xxs1500/irqmap.c create mode 100644 arch/mips/alchemy/xxs1500/platform.c create mode 100644 arch/mips/include/asm/mach-db1x00/bcsr.h delete mode 100644 arch/mips/include/asm/mach-pb1x00/pb1100.h delete mode 100644 arch/mips/include/asm/mach-pb1x00/pb1500.h delete mode 100644 drivers/pcmcia/au1000_db1x00.c delete mode 100644 drivers/pcmcia/au1000_xxs1500.c create mode 100644 drivers/pcmcia/db1xxx_ss.c create mode 100644 drivers/pcmcia/xxs1500_ss.c
PATCH v2 2/6 Alchemy: devboards: factor out PB1200 IRQ cascade code.
In reply to Manuel LaussMove the PB1200 IRQ cascade code out to the BCSR support code:
upcoming DB1300 support can use it too.
--- arch/mips/alchemy/devboards/bcsr.c | 72 +++++++++++++++++++++++++++ arch/mips/alchemy/devboards/pb1200/irqmap.c | 71 +-------------------------- arch/mips/include/asm/mach-db1x00/bcsr.h | 3 + 3 files changed, 76 insertions(+), 70 deletions(-)
arch/mips/alchemy/devboards/bcsr.c +72 -0
@@ -7,6 +7,7 @@* All registers are 16bits wide with 32bit spacing. */ +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/spinlock.h> #include <asm/addrspace.h>
@@ -18,6 +19,9 @@ static struct bcsr_reg {spinlock_t lock; } bcsr_regs[BCSR_CNT ]; +static void __iomem *bcsr_virt;/* KSEG1 addr of BCSR base */ +static int bcsr_csc_base;/* linux-irq of first cascaded irq */ +void __init bcsr_init (unsigned long bcsr1_phys,unsigned long bcsr2_phys) {int i;
@@ -25,6 +29,8 @@ void __init bcsr_init(unsigned long bcsr1_phys, unsigned long bcsr2_phys) bcsr1_phys =KSEG1ADDR (CPHYSADDR (bcsr1_phys)); bcsr2_phys =KSEG1ADDR (CPHYSADDR (bcsr2_phys)); + bcsr_virt = (void __iomem *)bcsr1_phys; +for (i =0 ; i <BCSR_CNT ; i++) {if (i >=BCSR_HEXLEDS ) bcsr_regs[i].raddr = (void __iomem *)bcsr2_phys +
@@ -74,3 +80,69 @@ void bcsr_mod(enum bcsr_id reg, unsigned short clr, unsigned short set)spin_unlock_irqrestore (&bcsr_regs[reg].lock, flags); }EXPORT_SYMBOL_GPL (bcsr_mod); + +/* +* DB1200/PB1200 CPLD IRQ muxer +*/ +static void bcsr_csc_handler (unsigned int irq,struct irq_desc *d) +{ +unsigned short bisr =__raw_readw (bcsr_virt +BCSR_REG_INTSTAT ); + +for ( ; bisr; bisr &= bisr -1 ) +generic_handle_irq (bcsr_csc_base +__ffs (bisr)); +} + +/* NOTE: both the enable and mask bits must be cleared, otherwise the +* CPLD generates tons of spurious interrupts (at least on my DB1200). +* -- mlau +*/ +static void bcsr_irq_mask (unsigned int irq_nr) +{ +unsigned short v =1 << (irq_nr - bcsr_csc_base); +__raw_writew (v, bcsr_virt +BCSR_REG_INTCLR ); +__raw_writew (v, bcsr_virt +BCSR_REG_MASKCLR ); +wmb (); +} + +static void bcsr_irq_maskack (unsigned int irq_nr) +{ +unsigned short v =1 << (irq_nr - bcsr_csc_base); +__raw_writew (v, bcsr_virt +BCSR_REG_INTCLR ); +__raw_writew (v, bcsr_virt +BCSR_REG_MASKCLR ); +__raw_writew (v, bcsr_virt +BCSR_REG_INTSTAT );/* ack */ +wmb (); +} + +static void bcsr_irq_unmask (unsigned int irq_nr) +{ +unsigned short v =1 << (irq_nr - bcsr_csc_base); +__raw_writew (v, bcsr_virt +BCSR_REG_INTSET ); +__raw_writew (v, bcsr_virt +BCSR_REG_MASKSET ); +wmb (); +} + +static struct irq_chip bcsr_irq_type = { + .name ="CPLD" , + .mask = bcsr_irq_mask, + .mask_ack = bcsr_irq_maskack, + .unmask = bcsr_irq_unmask, +}; + +void __init bcsr_init_irq (int csc_start,int csc_end,int hook_irq) +{ +unsigned int irq; + +/* mask & disable & ack all */ +__raw_writew (0xffff , bcsr_virt +BCSR_REG_INTCLR ); +__raw_writew (0xffff , bcsr_virt +BCSR_REG_MASKCLR ); +__raw_writew (0xffff , bcsr_virt +BCSR_REG_INTSTAT ); +wmb (); + + bcsr_csc_base = csc_start; + +for (irq = csc_start; irq <= csc_end; irq++) +set_irq_chip_and_handler_name (irq, &bcsr_irq_type, + handle_level_irq,"level" ); + +set_irq_chained_handler (hook_irq, bcsr_csc_handler); +}
arch/mips/alchemy/devboards/pb1200/irqmap.c +1 -70
88 lines not on this page · raw message
arch/mips/include/asm/mach-db1x00/bcsr.h +3 -0
@@ -232,4 +232,7 @@ void bcsr_write(enum bcsr_id reg, unsigned short val);/* modify a register. clear bits set in 'clr', set bits set in 'set' */ void bcsr_mod (enum bcsr_id reg,unsigned short clr,unsigned short set); +/* install CPLD IRQ demuxer (DB1200/PB1200) */ +void __init bcsr_init_irq (int csc_start,int csc_end,int hook_irq); +#endif
Signature · 1 line
1.6.5.rc2
PATCH v2 3/6 Alchemy: remove board_init_irq() function.
remove board_init_irq(): On all in-kernel boards it is sufficient to initialize board interrupts in an arch_initcall by using the default linux irq functions.
Some small irqmap.c files have been folded into board_setup files.
Run-tested on DB1200; compile-tested on all other affected boards.
--- arch/mips/alchemy/common/irq.c | 15 ++-- arch/mips/alchemy/devboards/db1x00/Makefile | 2 +- arch/mips/alchemy/devboards/db1x00/board_setup.c | 51 ++++++++++++ arch/mips/alchemy/devboards/db1x00/irqmap.c | 90 ---------------------- arch/mips/alchemy/devboards/pb1000/board_setup.c | 17 ++--- arch/mips/alchemy/devboards/pb1100/board_setup.c | 24 +++--- arch/mips/alchemy/devboards/pb1200/Makefile | 2 +- arch/mips/alchemy/devboards/pb1200/board_setup.c | 48 +++++++++++- arch/mips/alchemy/devboards/pb1200/irqmap.c | 75 ------------------ arch/mips/alchemy/devboards/pb1500/board_setup.c | 25 +++--- arch/mips/alchemy/devboards/pb1550/board_setup.c | 19 ++--- arch/mips/alchemy/mtx-1/Makefile | 2 +- arch/mips/alchemy/mtx-1/board_setup.c | 24 ++++++ arch/mips/alchemy/mtx-1/irqmap.c | 56 ------------- arch/mips/alchemy/xxs1500/Makefile | 2 +- arch/mips/alchemy/xxs1500/board_setup.c | 21 +++++ arch/mips/alchemy/xxs1500/irqmap.c | 52 ------------- arch/mips/include/asm/mach-au1x00/au1000.h | 15 ---- arch/mips/include/asm/mach-db1x00/db1200.h | 1 + arch/mips/include/asm/mach-pb1x00/pb1200.h | 1 + 20 files changed, 194 insertions(+), 348 deletions(-) delete mode 100644 arch/mips/alchemy/devboards/db1x00/irqmap.c delete mode 100644 arch/mips/alchemy/devboards/pb1200/irqmap.c delete mode 100644 arch/mips/alchemy/mtx-1/irqmap.c delete mode 100644 arch/mips/alchemy/xxs1500/irqmap.c
arch/mips/alchemy/common/irq.c +7 -8
@@ -40,8 +40,11 @@static int au1x_ic_settype (unsigned int irq,unsigned int flow_type);/* per-processor fixed function irqs */ -struct au1xxx_irqmap au1xxx_ic0_map[] __initdata = { - +struct au1xxx_irqmap { +int im_irq; +int im_type; +int im_request; +} au1xxx_ic0_map[]__initdata = { #if defined(CONFIG_SOC_AU1000) {AU1000_UART0_INT ,IRQ_TYPE_LEVEL_HIGH ,0 }, { AU1000_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
@@ -529,7 +532,7 @@ spurious: }/* setup edge/level and assign request 0/1 */ -void __init au1xxx_setup_irqmap (struct au1xxx_irqmap *map,int count) +static void __init setup_irqmap (struct au1xxx_irqmap *map,int count) {unsigned int bit, irq_nr;
@@ -601,11 +604,7 @@ void __init arch_init_irq(void)/* * Initialize IC0, which is fixed per processor. */ -au1xxx_setup_irqmap (au1xxx_ic0_map,ARRAY_SIZE (au1xxx_ic0_map)); - -/* Boards can register additional (GPIO-based) IRQs. -*/ -board_init_irq (); +setup_irqmap (au1xxx_ic0_map,ARRAY_SIZE (au1xxx_ic0_map));set_c0_status (IE_IRQ0 |IE_IRQ1 |IE_IRQ2 |IE_IRQ3 ); }
arch/mips/alchemy/devboards/db1x00/Makefile +1 -1
@@ -5,4 +5,4 @@ # Makefile for the Alchemy Semiconductor DBAu1xx0 boards. # -obj-y := board_setup.o irqmap.o +obj-y := board_setup.o
arch/mips/alchemy/devboards/db1x00/board_setup.c +51 -0
66 lines not on this page · raw message
arch/mips/alchemy/devboards/db1x00/irqmap.c deleted +0 -90
90 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1000/board_setup.c +7 -10
@@ -32,11 +32,6 @@#include <prom.h> -struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { - {AU1000_GPIO_15 ,IRQF_TRIGGER_LOW ,0 }, -}; - -const char *get_system_type (void ) {return "Alchemy Pb1000" ;
@@ -46,11 +41,6 @@ void board_reset(void) { } -void __init board_init_irq (void ) -{ -au1xxx_setup_irqmap (au1xxx_irq_map,ARRAY_SIZE (au1xxx_irq_map)); -} -void __init board_setup (void ) {u32 pin_func, static_cfg0;
@@ -193,3 +183,10 @@ void __init board_setup(void)break ; } } + +static int __init pb1000_init_irq (void ) +{ +set_irq_type (AU1000_GPIO_15 ,IRQF_TRIGGER_LOW ); +return 0 ; +} +arch_initcall (pb1000_init_irq);
arch/mips/alchemy/devboards/pb1100/board_setup.c +11 -13
@@ -35,14 +35,6 @@#include <prom.h> -struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { - {AU1000_GPIO_9 ,IRQF_TRIGGER_LOW ,0 },/* PCMCIA Card Fully_Inserted# */ - {AU1000_GPIO_10 ,IRQF_TRIGGER_LOW ,0 },/* PCMCIA Card STSCHG# */ - {AU1000_GPIO_11 ,IRQF_TRIGGER_LOW ,0 },/* PCMCIA Card IRQ# */ - {AU1000_GPIO_13 ,IRQF_TRIGGER_LOW ,0 },/* DC_IRQ# */ -}; - -const char *get_system_type (void ) {return "Alchemy Pb1100" ;
@@ -53,11 +45,6 @@ void board_reset(void)bcsr_write (BCSR_SYSTEM ,0 ); } -void __init board_init_irq (void ) -{ -au1xxx_setup_irqmap (au1xxx_irq_map,ARRAY_SIZE (au1xxx_irq_map)); -} -void __init board_setup (void ) {volatile void __iomem *base = (volatile void __iomem *)0xac000000UL ;
@@ -158,3 +145,14 @@ void __init board_setup(void)au_sync (); } } + +static int __init pb1100_init_irq (void ) +{ +set_irq_type (AU1000_GPIO_9 ,IRQF_TRIGGER_LOW );/* PCCD# */ +set_irq_type (AU1000_GPIO_10 ,IRQF_TRIGGER_LOW );/* PCSTSCHG# */ +set_irq_type (AU1000_GPIO_11 ,IRQF_TRIGGER_LOW );/* PCCard# */ +set_irq_type (AU1000_GPIO_13 ,IRQF_TRIGGER_LOW );/* DC_IRQ# */ + +return 0 ; +} +arch_initcall (pb1100_init_irq);
arch/mips/alchemy/devboards/pb1200/Makefile +1 -1
@@ -2,6 +2,6 @@ # Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards. # -obj-y := board_setup.o irqmap.o platform.o +obj-y := board_setup.o platform.o EXTRA_CFLAGS += -Werror
arch/mips/alchemy/devboards/pb1200/board_setup.c +46 -2
65 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1200/irqmap.c deleted +0 -75
75 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1500/board_setup.c +12 -13
@@ -40,14 +40,6 @@ char irq_tab_alchemy[][5] __initdata = { [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */ }; -struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { - {AU1500_GPIO_204 ,IRQF_TRIGGER_HIGH ,0 }, - {AU1500_GPIO_201 ,IRQF_TRIGGER_LOW ,0 }, - {AU1500_GPIO_202 ,IRQF_TRIGGER_LOW ,0 }, - {AU1500_GPIO_203 ,IRQF_TRIGGER_LOW ,0 }, - {AU1500_GPIO_205 ,IRQF_TRIGGER_LOW ,0 }, -}; -const char *get_system_type (void ) {
@@ -59,11 +51,6 @@ void board_reset(void)bcsr_write (BCSR_SYSTEM ,0 ); } -void __init board_init_irq (void ) -{ -au1xxx_setup_irqmap (au1xxx_irq_map,ARRAY_SIZE (au1xxx_irq_map)); -} -void __init board_setup (void ) {u32 pin_func;
@@ -166,3 +153,15 @@ void __init board_setup(void)au_sync (); } } + +static int __init pb1500_init_irq (void ) +{ +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 ); +set_irq_type (AU1500_GPIO_203 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1500_GPIO_205 ,IRQF_TRIGGER_LOW ); + +return 0 ; +} +arch_initcall (pb1500_init_irq);
arch/mips/alchemy/devboards/pb1550/board_setup.c +9 -10
@@ -42,11 +42,6 @@ char irq_tab_alchemy[][5] __initdata = { [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */ }; -struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { - {AU1000_GPIO_0 ,IRQF_TRIGGER_LOW ,0 }, - {AU1000_GPIO_1 ,IRQF_TRIGGER_LOW ,0 }, -}; -const char *get_system_type (void ) {return "Alchemy Pb1550" ;
@@ -57,11 +52,6 @@ void board_reset(void)bcsr_write (BCSR_SYSTEM ,0 ); } -void __init board_init_irq (void ) -{ -au1xxx_setup_irqmap (au1xxx_irq_map,ARRAY_SIZE (au1xxx_irq_map)); -} -void __init board_setup (void ) {u32 pin_func;
@@ -93,3 +83,12 @@ void __init board_setup(void)printk (KERN_INFO "AMD Alchemy Pb1550 Board\n" ); } + +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 ); + +return 0 ; +} +arch_initcall (pb1550_init_irq);
arch/mips/alchemy/mtx-1/Makefile +1 -1
@@ -6,7 +6,7 @@ # Makefile for 4G Systems MTX-1 board. # -lib-y := init.o board_setup.o irqmap.o +lib-y := init.o board_setup.o obj-y := platform.o EXTRA_CFLAGS += -Werror
arch/mips/alchemy/mtx-1/board_setup.c +24 -0
@@ -30,11 +30,23 @@#include <linux/gpio.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <asm/mach-au1x00/au1000.h> #include <prom.h> +char irq_tab_alchemy[][5 ]__initdata = { + [0 ] = {-1 ,INTA ,INTA ,INTX ,INTX },/* IDSEL 00 - AdapterA-Slot0 (top) */ + [1 ] = {-1 ,INTB ,INTA ,INTX ,INTX },/* IDSEL 01 - AdapterA-Slot1 (bottom) */ + [2 ] = {-1 ,INTC ,INTD ,INTX ,INTX },/* IDSEL 02 - AdapterB-Slot0 (top) */ + [3 ] = {-1 ,INTD ,INTC ,INTX ,INTX },/* IDSEL 03 - AdapterB-Slot1 (bottom) */ + [4 ] = {-1 ,INTA ,INTB ,INTX ,INTX },/* IDSEL 04 - AdapterC-Slot0 (top) */ + [5 ] = {-1 ,INTB ,INTA ,INTX ,INTX },/* IDSEL 05 - AdapterC-Slot1 (bottom) */ + [6 ] = {-1 ,INTC ,INTD ,INTX ,INTX },/* IDSEL 06 - AdapterD-Slot0 (top) */ + [7 ] = {-1 ,INTD ,INTC ,INTX ,INTX },/* IDSEL 07 - AdapterD-Slot1 (bottom) */ +}; +extern int (*board_pci_idsel)(unsigned int devsel,int assert);int mtx1_pci_idsel (unsigned int devsel,int assert);
@@ -110,3 +122,15 @@ mtx1_pci_idsel(unsigned int devsel, int assert)au_sync_udelay (1 );return 1 ; } + +static int __init mtx1_init_irq (void ) +{ +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 ); +set_irq_type (AU1500_GPIO_203 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1500_GPIO_205 ,IRQF_TRIGGER_LOW ); + +return 0 ; +} +arch_initcall (mtx1_init_irq);
arch/mips/alchemy/mtx-1/irqmap.c deleted +0 -56
56 lines not on this page · raw message
arch/mips/alchemy/xxs1500/Makefile +1 -1
@@ -5,4 +5,4 @@ # Makefile for MyCable XXS1500 board. # -lib-y := init.o board_setup.o irqmap.o +lib-y := init.o board_setup.o
arch/mips/alchemy/xxs1500/board_setup.c +21 -0
@@ -25,6 +25,7 @@#include <linux/gpio.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/delay.h> #include <asm/mach-au1x00/au1000.h>
@@ -92,3 +93,23 @@ void __init board_setup(void)#endif #endif } + +static int __init xxs1500_init_irq (void ) +{ +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 ); +set_irq_type (AU1500_GPIO_203 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1500_GPIO_205 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1500_GPIO_207 ,IRQF_TRIGGER_LOW ); + +set_irq_type (AU1000_GPIO_0 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1000_GPIO_1 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1000_GPIO_2 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1000_GPIO_3 ,IRQF_TRIGGER_LOW ); +set_irq_type (AU1000_GPIO_4 ,IRQF_TRIGGER_LOW );/* CF interrupt */ +set_irq_type (AU1000_GPIO_5 ,IRQF_TRIGGER_LOW ); + +return 0 ; +} +arch_initcall (xxs1500_init_irq);
arch/mips/alchemy/xxs1500/irqmap.c deleted +0 -52
52 lines not on this page · raw message
arch/mips/include/asm/mach-au1x00/au1000.h +0 -15
@@ -143,21 +143,6 @@ void au_sleep(void);void save_au1xxx_intctl (void );void restore_au1xxx_intctl (void ); -/* -* Every board describes its IRQ mapping with this table. -*/ -struct au1xxx_irqmap { -int im_irq; -int im_type; -int im_request; -}; - -/* core calls this function to let boards initialize other IRQ sources */ -void board_init_irq (void ); - -/* boards call this to register additional (GPIO) interrupts */ -void au1xxx_setup_irqmap (struct au1xxx_irqmap *map,int count); -#endif /* !defined (_LANGUAGE_ASSEMBLY) */ /*
arch/mips/include/asm/mach-db1x00/db1200.h +1 -0
@@ -25,6 +25,7 @@#define __ASM_DB1200_H#include <linux/types.h> +#include <asm/mach-au1x00/au1000.h> #include <asm/mach-au1x00/au1xxx_psc.h> #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
arch/mips/include/asm/mach-pb1x00/pb1200.h +1 -0
@@ -25,6 +25,7 @@#define __ASM_PB1200_H#include <linux/types.h> +#include <asm/mach-au1x00/au1000.h> #include <asm/mach-au1x00/au1xxx_psc.h> #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
Signature · 1 line
1.6.5.rc2
PATCH v2 5/6 Alchemy: devboards: wire up new PCMCIA driver.
In reply to Manuel LaussRegister the PCMCIA driver on all boards supported by it, get rid of now-unused pcmcia macros in the board headers (and subsequently empty pb1100/pb1500 ones).
---
V2: split the previous patch in 2 parts; one with the PCMCIA driver,
the other (this one) to add the socket device registration to the various boards.
Instead of dumping the whole "struct resource" tables for every socket into each boards' platform file, they now call a fucntion with socket data to setup the whole resource/platform_device stuff; saves a lot of lines.
arch/mips/alchemy/devboards/Makefile | 2 +- arch/mips/alchemy/devboards/db1x00/board_setup.c | 4 + arch/mips/alchemy/devboards/db1x00/platform.c | 84 ++++++++++++++++++++ arch/mips/alchemy/devboards/pb1100/Makefile | 3 +- arch/mips/alchemy/devboards/pb1100/platform.c | 41 ++++++++++ arch/mips/alchemy/devboards/pb1200/platform.c | 55 +++++++++++++- arch/mips/alchemy/devboards/pb1500/Makefile | 3 +- arch/mips/alchemy/devboards/pb1500/board_setup.c | 3 + arch/mips/alchemy/devboards/pb1500/platform.c | 41 ++++++++++ arch/mips/alchemy/devboards/pb1550/Makefile | 3 +- arch/mips/alchemy/devboards/pb1550/board_setup.c | 8 ++ arch/mips/alchemy/devboards/pb1550/platform.c | 63 +++++++++++++++ arch/mips/alchemy/devboards/platform.c | 89 ++++++++++++++++++++++ arch/mips/alchemy/devboards/platform.h | 18 +++++ arch/mips/include/asm/mach-db1x00/db1200.h | 15 ---- arch/mips/include/asm/mach-db1x00/db1x00.h | 8 -- arch/mips/include/asm/mach-pb1x00/pb1100.h | 36 --------- arch/mips/include/asm/mach-pb1x00/pb1200.h | 14 ---- arch/mips/include/asm/mach-pb1x00/pb1500.h | 36 --------- arch/mips/include/asm/mach-pb1x00/pb1550.h | 7 -- 20 files changed, 411 insertions(+), 122 deletions(-) create mode 100644 arch/mips/alchemy/devboards/db1x00/platform.c create mode 100644 arch/mips/alchemy/devboards/pb1100/platform.c create mode 100644 arch/mips/alchemy/devboards/pb1500/platform.c create mode 100644 arch/mips/alchemy/devboards/pb1550/platform.c create mode 100644 arch/mips/alchemy/devboards/platform.c create mode 100644 arch/mips/alchemy/devboards/platform.h delete mode 100644 arch/mips/include/asm/mach-pb1x00/pb1100.h delete mode 100644 arch/mips/include/asm/mach-pb1x00/pb1500.h
arch/mips/alchemy/devboards/Makefile +1 -1
@@ -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/
arch/mips/alchemy/devboards/db1x00/board_setup.c +4 -0
@@ -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# */
arch/mips/alchemy/devboards/db1x00/platform.c new file +84 -0
84 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1100/Makefile +2 -1
@@ -5,4 +5,5 @@ # Makefile for the Alchemy Semiconductor Pb1100 board. # -obj-y := board_setup.o +obj-y := board_setup.o platform.o +
arch/mips/alchemy/devboards/pb1100/platform.c new file +41 -0
41 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1200/platform.c +53 -2
67 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1500/Makefile +2 -1
@@ -5,4 +5,5 @@ # Makefile for the Alchemy Semiconductor Pb1500 board. # -obj-y := board_setup.o +obj-y := board_setup.o platform.o +
arch/mips/alchemy/devboards/pb1500/board_setup.c +3 -0
@@ -156,6 +156,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 );
arch/mips/alchemy/devboards/pb1500/platform.c new file +41 -0
41 lines not on this page · raw message
arch/mips/alchemy/devboards/pb1550/Makefile +2 -1
@@ -5,4 +5,5 @@ # Makefile for the Alchemy Semiconductor Pb1550 board. # -obj-y := board_setup.o +obj-y := board_setup.o platform.o +
arch/mips/alchemy/devboards/pb1550/board_setup.c +8 -0
@@ -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>
@@ -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.
@@ -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 ; }
arch/mips/alchemy/devboards/pb1550/platform.c new file +63 -0
63 lines not on this page · raw message
arch/mips/alchemy/devboards/platform.c new file +89 -0
89 lines not on this page · raw message
arch/mips/alchemy/devboards/platform.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef _DEVBOARD_PLATFORM_H_ +#define _DEVBOARD_PLATFORM_H_ + +#include <linux/init.h> + +int __init db1x_register_pcmcia_socket (unsigned long pseudo_attr_start, +unsigned long pseudo_attr_len, +unsigned long pseudo_mem_start, +unsigned long pseudo_mem_end, +unsigned long pseudo_io_start, +unsigned long pseudo_io_end, +int card_irq, +int cd_irq, +int stschg_irq, +int eject_irq, +int id); + +#endif
arch/mips/include/asm/mach-db1x00/db1200.h +0 -15
@@ -103,21 +103,6 @@ enum external_pb1200_ints { DB1200_INT_END = DB1200_INT_BEGIN + 15, }; - -/* -* DBAu1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c -*/ -#define PCMCIA_MAX_SOCK 1 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) - -/* VPP/VCC */ -#define SET_VCC_VPP (VCC ,VPP ,SLOT ) \ - ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) - -#define BOARD_PC0_INT DB1200_PC0_INT -#define BOARD_PC1_INT DB1200_PC1_INT -#define BOARD_CARD_INSERTED (SOCKET ) (bcsr_read(BCSR_SIGSTAT) & (1 << (8 + (2 * SOCKET)))) -/* NAND chip select */ #define NAND_CS 1
arch/mips/include/asm/mach-db1x00/db1x00.h +0 -8
@@ -45,14 +45,6 @@#endif -/* PCMCIA DBAu1x00 specific defines */ -#define PCMCIA_MAX_SOCK 1 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) - -/* VPP/VCC */ -#define SET_VCC_VPP (VCC ,VPP ,SLOT )\ - ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) -/* * NAND defines *
arch/mips/include/asm/mach-pb1x00/pb1100.h deleted +0 -36
@@ -1,36 +0,0 @@ -/* -* Alchemy Semi Pb1100 Referrence Board -* -* Copyright 2001, 2008 MontaVista Software Inc. -* Author: MontaVista Software, Inc. <[email protected]> -* -* ######################################################################## -* -* This program is free software; you can distribute it and/or modify it -* under the terms of the GNU General Public License (Version 2) as -* published by the Free Software Foundation. -* -* This program is distributed in the hope 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., -* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. -* -* ######################################################################## -* -* -*/ -#ifndef __ASM_PB1100_H -#define __ASM_PB1100_H - -/* PCMCIA Pb1100 specific defines */ -#define PCMCIA_MAX_SOCK 0 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) - -/* VPP/VCC */ -#define SET_VCC_VPP (VCC ,VPP ) (((VCC) << 2) | ((VPP) << 0)) - -#endif /* __ASM_PB1100_H */
arch/mips/include/asm/mach-pb1x00/pb1200.h +0 -14
@@ -135,20 +135,6 @@ enum external_pb1200_ints { PB1200_INT_END = PB1200_INT_BEGIN + 15 }; -/* -* Pb1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c -*/ -#define PCMCIA_MAX_SOCK 1 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) - -/* VPP/VCC */ -#define SET_VCC_VPP (VCC ,VPP ,SLOT ) \ - ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) - -#define BOARD_PC0_INT PB1200_PC0_INT -#define BOARD_PC1_INT PB1200_PC1_INT -#define BOARD_CARD_INSERTED (SOCKET ) (bcsr_read(BCSR_SIGSTAT & (1 << (8 + (2 * SOCKET)))) -/* NAND chip select */ #define NAND_CS 1
arch/mips/include/asm/mach-pb1x00/pb1500.h deleted +0 -36
@@ -1,36 +0,0 @@ -/* -* Alchemy Semi Pb1500 Referrence Board -* -* Copyright 2001, 2008 MontaVista Software Inc. -* Author: MontaVista Software, Inc. <[email protected]> -* -* ######################################################################## -* -* This program is free software; you can distribute it and/or modify it -* under the terms of the GNU General Public License (Version 2) as -* published by the Free Software Foundation. -* -* This program is distributed in the hope 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., -* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. -* -* ######################################################################## -* -* -*/ -#ifndef __ASM_PB1500_H -#define __ASM_PB1500_H - -/* PCMCIA Pb1500 specific defines */ -#define PCMCIA_MAX_SOCK 0 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) - -/* VPP/VCC */ -#define SET_VCC_VPP (VCC ,VPP ) (((VCC) << 2) | ((VPP) << 0)) - -#endif /* __ASM_PB1500_H */
arch/mips/include/asm/mach-pb1x00/pb1550.h +0 -7
@@ -40,13 +40,6 @@#define SMBUS_PSC_BASE PSC2_BASE_ADDR#define I2S_PSC_BASE PSC3_BASE_ADDR -#define PCMCIA_MAX_SOCK 1 -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1) - -/* VPP/VCC */ -#define SET_VCC_VPP (VCC ,VPP ,SLOT ) \ - ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8)) -#if defined(CONFIG_MTD_PB1550_BOOT ) && defined(CONFIG_MTD_PB1550_USER )#define PB1550_BOTH_BANKS #elif defined(CONFIG_MTD_PB1550_BOOT ) && !defined(CONFIG_MTD_PB1550_USER )
Signature · 1 line
1.6.5.rc2
PATCH v2 4/6 PCMCIA: new socket driver for Au1000 demoboards.
In reply to Manuel LaussNew PCMCIA socket driver for all Db/Pb1xxx boards (except Pb1000), which replaces au1000_db1x00.c and (most of) au1000_pb1x00.c. Notable improvements:
- supports Db1000, DB/PB1100/1500/1550/1200.
- support for carddetect and statuschange IRQs.
- pcmcia socket mem/io/attr areas and irqs passed through platform resource information.
- doesn't freeze system during card insertion/ejection like the one it replaces.
- boardtype is automatically detected using BCSR ID register.
Run-tested on the DB1200.
---
V2: split the patch in two, one (this) with the PCMCIA driver part,
the other (following) adds the board-specific socket device registration.
Fixed a thinko: use bcsr_mod() in socket_configure() function.
arch/mips/alchemy/common/platform.c | 6 - arch/mips/alchemy/common/setup.c | 3 +- arch/mips/include/asm/mach-au1x00/au1000.h | 14 + drivers/pcmcia/Kconfig | 11 + drivers/pcmcia/Makefile | 9 +- drivers/pcmcia/au1000_db1x00.c | 307 -------------- drivers/pcmcia/au1000_generic.h | 12 +- drivers/pcmcia/au1000_pb1x00.c | 119 +------ drivers/pcmcia/db1xxx_ss.c | 630 ++++++++++++++++++++++++++++ 9 files changed, 660 insertions(+), 451 deletions(-) delete mode 100644 drivers/pcmcia/au1000_db1x00.c create mode 100644 drivers/pcmcia/db1xxx_ss.c
arch/mips/alchemy/common/platform.c +0 -6
@@ -308,11 +308,6 @@ static struct platform_device au1200_mmc1_device = {#endif /* #ifndef CONFIG_MIPS_DB1200 */ #endif /* #ifdef CONFIG_SOC_AU1200 */ -static struct platform_device au1x00_pcmcia_device = { - .name ="au1x00-pcmcia" , - .id =0 , -}; -/* All Alchemy demoboards with I2C have this #define in their headers */ #ifdef SMBUS_PSC_BASE static struct resource pbdb_smbus_resources[] = {
@@ -334,7 +329,6 @@ static struct platform_device pbdb_smbus_device = {static struct platform_device *au1xxx_platform_devices[]__initdata = { &au1xx0_uart_device, &au1xxx_usb_ohci_device, - &au1x00_pcmcia_device, #ifdef CONFIG_FB_AU1100 &au1100_lcd_device, #endif
arch/mips/alchemy/common/setup.c +2 -1
@@ -107,7 +107,8 @@ phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)* The pseudo address we use is 0xF400 0000. Any address over * 0xF400 0000 is a PCMCIA pseudo address. */ -if ((phys_addr >=0xF4000000 ) && (phys_addr <0xFFFFFFFF )) +if ((phys_addr >=PCMCIA_ATTR_PSEUDO_PHYS ) && + (phys_addr <PCMCIA_PSEUDO_END ))return (phys_t)(phys_addr <<4 );/* default nop */
arch/mips/include/asm/mach-au1x00/au1000.h +14 -0
@@ -1724,6 +1724,20 @@ enum soc_au1200_ints {#endif +/* +* All Au1xx0 SOCs have a PCMCIA controller. +* We setup our 32-bit pseudo addresses to be equal to the +* 36-bit addr >> 4, to make it easier to check the address +* and fix it. +* The PCMCIA socket 0 physical attribute address is 0xF 4000 0000. +* The pseudo address we use is 0xF400 0000. Any address over +* 0xF400 0000 is a PCMCIA pseudo address. +*/ +#define PCMCIA_IO_PSEUDO_PHYS (PCMCIA_IO_PHYS_ADDR >> 4) +#define PCMCIA_ATTR_PSEUDO_PHYS (PCMCIA_ATTR_PHYS_ADDR >> 4) +#define PCMCIA_MEM_PSEUDO_PHYS (PCMCIA_MEM_PHYS_ADDR >> 4) +#define PCMCIA_PSEUDO_END (0xffffffff) + #ifndef _LANGUAGE_ASSEMBLY typedef volatile struct { /* 0x0000 */ u32 toytrim;
drivers/pcmcia/Kconfig +11 -0
@@ -192,6 +192,17 @@ config PCMCIA_AU1X00 tristate "Au1x00 pcmcia support" depends on SOC_AU1X00 && PCMCIA +config PCMCIA_ALCHEMY_DEVBOARD + tristate "Alchemy Db/Pb1xxx PCMCIA socket services" + depends on SOC_AU1X00 && PCMCIA + select 64BIT_PHYS_ADDR + help + Enable this driver of you want PCMCIA support on your Alchemy + Db1000, Db/Pb1100, Db/Pb1500, Db/Pb1550, Db/Pb1200 board. + NOT suitable for the PB1000! + + This driver is also available as a module called db1xxx_ss.ko + config PCMCIA_BCM63XX tristate "bcm63xx pcmcia support" depends on BCM63XX && PCMCIA
drivers/pcmcia/Makefile +1 -8
@@ -34,20 +34,13 @@ obj-$(CONFIG_OMAP_CF) += omap_cf.o obj-$(CONFIG_BFIN_CFPCMCIA) += bfin_cf_pcmcia.o obj-$(CONFIG_AT91_CF) += at91_cf.o obj-$(CONFIG_ELECTRA_CF) += electra_cf.o +obj-$(CONFIG_PCMCIA_ALCHEMY_DEVBOARD) += db1xxx_ss.o sa11xx_core-y += soc_common.o sa11xx_base.o pxa2xx_core-y += soc_common.o pxa2xx_base.o au1x00_ss-y += au1000_generic.o au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o -au1x00_ss-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o -au1x00_ss-$(CONFIG_MIPS_PB1200) += au1000_db1x00.o -au1x00_ss-$(CONFIG_MIPS_PB1500) += au1000_pb1x00.o -au1x00_ss-$(CONFIG_MIPS_DB1000) += au1000_db1x00.o -au1x00_ss-$(CONFIG_MIPS_DB1100) += au1000_db1x00.o -au1x00_ss-$(CONFIG_MIPS_DB1200) += au1000_db1x00.o -au1x00_ss-$(CONFIG_MIPS_DB1500) += au1000_db1x00.o -au1x00_ss-$(CONFIG_MIPS_DB1550) += au1000_db1x00.o au1x00_ss-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o sa1111_cs-y += sa1111_generic.o
drivers/pcmcia/au1000_db1x00.c deleted +0 -307
307 lines not on this page · raw message
drivers/pcmcia/au1000_generic.h +1 -11
@@ -44,22 +44,12 @@/* pcmcia socket 1 needs external glue logic so the memory map * differs from board to board. */ -#if defined(CONFIG_MIPS_PB1000 ) || defined(CONFIG_MIPS_PB1100 ) || \ - defined(CONFIG_MIPS_PB1500 ) || defined(CONFIG_MIPS_PB1550 ) || \ - defined(CONFIG_MIPS_PB1200 ) +#if defined(CONFIG_MIPS_PB1000 )#define AU1X_SOCK1_IO 0xF08000000ULL#define AU1X_SOCK1_PHYS_ATTR 0xF48000000ULL#define AU1X_SOCK1_PHYS_MEM 0xF88000000ULL#define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4800000#define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8800000 -#elif defined(CONFIG_MIPS_DB1000 ) || defined(CONFIG_MIPS_DB1100 ) || \ - defined(CONFIG_MIPS_DB1500 ) || defined(CONFIG_MIPS_DB1550 ) || \ - defined(CONFIG_MIPS_DB1200 ) -#define AU1X_SOCK1_IO 0xF04000000ULL -#define AU1X_SOCK1_PHYS_ATTR 0xF44000000ULL -#define AU1X_SOCK1_PHYS_MEM 0xF84000000ULL -#define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4400000 -#define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8400000#endif struct pcmcia_state {
drivers/pcmcia/au1000_pb1x00.c +1 -118
174 lines not on this page · raw message
drivers/pcmcia/db1xxx_ss.c new file +630 -0
630 lines not on this page · raw message
Signature · 1 line
1.6.5.rc2
PATCH v2 6/6 Alchemy: XXS1500 PCMCIA driver rewrite
In reply to Manuel LaussRewritten XXS1500 PCMCIA socket driver, standalone (doesn't depend on au1000_generic.c) and added carddetect IRQ support.
---
Compile-tested only; I don't have hardware to test, CC'ing Florian, he might still have one.
V2: this one depends on the previous db1xxx_ss.c patch to apply
cleanly; no other changes.
arch/mips/alchemy/xxs1500/Makefile | 2 +- arch/mips/alchemy/xxs1500/board_setup.c | 16 -- arch/mips/alchemy/xxs1500/platform.c | 63 ++++++ drivers/pcmcia/Kconfig | 10 + drivers/pcmcia/Makefile | 3 +- drivers/pcmcia/au1000_xxs1500.c | 188 ---------------- drivers/pcmcia/xxs1500_ss.c | 357 +++++++++++++++++++++++++++++++ 7 files changed, 433 insertions(+), 206 deletions(-) create mode 100644 arch/mips/alchemy/xxs1500/platform.c delete mode 100644 drivers/pcmcia/au1000_xxs1500.c create mode 100644 drivers/pcmcia/xxs1500_ss.c
arch/mips/alchemy/xxs1500/Makefile +1 -1
@@ -5,4 +5,4 @@ # Makefile for MyCable XXS1500 board. # -lib-y := init.o board_setup.o +lib-y := init.o board_setup.o platform.o
arch/mips/alchemy/xxs1500/board_setup.c +0 -16
@@ -69,22 +69,6 @@ void __init board_setup(void)/* Enable DTR = USB power up */ au_writel (0x01 ,UART3_ADDR +UART_MCR );/* UART_MCR_DTR is 0x01??? */ -#ifdef CONFIG_PCMCIA_XXS1500 -/* GPIO 0, 1, and 4 are inputs */ -alchemy_gpio_direction_input (0 ); -alchemy_gpio_direction_input (1 ); -alchemy_gpio_direction_input (4 ); - -/* GPIO2 208/9/10/11 are inputs */ -alchemy_gpio_direction_input (208 ); -alchemy_gpio_direction_input (209 ); -alchemy_gpio_direction_input (210 ); -alchemy_gpio_direction_input (211 ); - -/* Turn off power */ -alchemy_gpio_direction_output (214 ,0 ); -#endif -#ifdef CONFIG_PCI #if defined(__MIPSEB__)au_writel (0xf | (2 <<6 ) | (1 <<4 ), Au1500_PCI_CFG);
arch/mips/alchemy/xxs1500/platform.c new file +63 -0
63 lines not on this page · raw message
drivers/pcmcia/Kconfig +10 -0
@@ -203,6 +203,16 @@ config PCMCIA_ALCHEMY_DEVBOARD This driver is also available as a module called db1xxx_ss.ko +config PCMCIA_XXS1500 + tristate "MyCable XXS1500 PCMCIA socket support" + depends on PCMCIA && MIPS_XXS1500 + select 64BIT_PHYS_ADDR + help + Support for the PCMCIA/CF socket interface on MyCable XXS1500 + systems. + + This driver is also available as a module called xxs1500_ss.ko + config PCMCIA_BCM63XX tristate "bcm63xx pcmcia support" depends on BCM63XX && PCMCIA
drivers/pcmcia/Makefile +2 -1
@@ -41,7 +41,6 @@ pxa2xx_core-y += soc_common.o pxa2xx_base.o au1x00_ss-y += au1000_generic.o au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o -au1x00_ss-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o sa1111_cs-y += sa1111_generic.o sa1111_cs-$(CONFIG_ASSABET_NEPONSET) += sa1100_neponset.o
@@ -71,3 +70,5 @@ pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_core.o $(pxa2xx-obj-y) + +obj-$(CONFIG_PCMCIA_XXS1500) += xxs1500_ss.o
drivers/pcmcia/au1000_xxs1500.c deleted +0 -188
188 lines not on this page · raw message
drivers/pcmcia/xxs1500_ss.c new file +357 -0
357 lines not on this page · raw message
Signature · 1 line
1.6.5.rc2
Quoted 2 lines · Manuel Lauss
Patches 1-3 are more-or-less MIPS-specific, I'd like for them to get applied while 4-6 await feedback from pcmcia list.
For the time being I've dropped the entire series into -queue.
Ralf