Skip to contentSkip to conversation

Alchemy: core and platform updates

PATCH New Manuel Lauss 1 participant 6 messages Jun 3, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Alchemy: core and platform updates

Minor updates to the Alchemy core code to get rid of a hack in the irq dispatcher and the global variable "allow_au1k_wait".

The bulk of this series is in patches #3 to #5, which introduce new DB1200 platform code, a new PCMCIA socket driver for almost all Alchemy demoboards and finally the elimination of the alchemy-flash MTD map driver in favor of physmap_flash platform devices.

As always, run-tested on the DB1200 only.

Manuel Lauss (5):
Alchemy: prioritize timer and usb irqs
Alchemy: get rid of allow_au1k_wait
Alchemy: extended DB1200 board support.
Alchemy: new PCMCIA socket driver for devboards.
Alchemy: convert to physmap flash

 arch/mips/alchemy/common/irq.c                   |  275 ++--
 arch/mips/alchemy/common/platform.c              |    6 -
 arch/mips/alchemy/common/reset.c                 |    3 -
 arch/mips/alchemy/common/setup.c                 |    3 +-
 arch/mips/alchemy/common/time.c                  |   14 +-
 arch/mips/alchemy/devboards/Makefile             |    2 +-
 arch/mips/alchemy/devboards/db1200/Makefile      |    1 +
 arch/mips/alchemy/devboards/db1200/platform.c    |  667 +++++++++
 arch/mips/alchemy/devboards/db1200/setup.c       |  181 +++
 arch/mips/alchemy/devboards/db1x00/Makefile      |    3 +-
 arch/mips/alchemy/devboards/db1x00/platform.c    |  243 ++++
 arch/mips/alchemy/devboards/pb1000/Makefile      |    3 +-
 arch/mips/alchemy/devboards/pb1000/platform.c    |   84 ++
 arch/mips/alchemy/devboards/pb1100/Makefile      |    3 +-
 arch/mips/alchemy/devboards/pb1100/platform.c    |  134 ++
 arch/mips/alchemy/devboards/pb1200/board_setup.c |    5 -
 arch/mips/alchemy/devboards/pb1200/irqmap.c      |   19 +-
 arch/mips/alchemy/devboards/pb1200/platform.c    |  167 +++-
 arch/mips/alchemy/devboards/pb1500/Makefile      |    3 +-
 arch/mips/alchemy/devboards/pb1500/platform.c    |  134 ++
 arch/mips/alchemy/devboards/pb1550/Makefile      |    3 +-
 arch/mips/alchemy/devboards/pb1550/board_setup.c |    3 +
 arch/mips/alchemy/devboards/pb1550/platform.c    |  181 +++
 arch/mips/configs/db1200_defconfig               | 1629 +++++++++++++---------
 arch/mips/include/asm/mach-au1x00/au1000.h       |   14 +
 arch/mips/include/asm/mach-db1x00/db1200.h       |   38 +-
 arch/mips/include/asm/mach-db1x00/db1x00.h       |    8 -
 arch/mips/include/asm/mach-pb1x00/pb1100.h       |    7 -
 arch/mips/include/asm/mach-pb1x00/pb1200.h       |   14 -
 arch/mips/include/asm/mach-pb1x00/pb1500.h       |    7 -
 arch/mips/include/asm/mach-pb1x00/pb1550.h       |    7 -
 arch/mips/kernel/cpu-probe.c                     |   10 +-
 drivers/mtd/maps/Kconfig                         |    6 -
 drivers/mtd/maps/Makefile                        |    1 -
 drivers/mtd/maps/alchemy-flash.c                 |  166 ---
 drivers/pcmcia/Kconfig                           |   17 +-
 drivers/pcmcia/Makefile                          |    9 +-
 drivers/pcmcia/au1000_db1x00.c                   |  305 ----
 drivers/pcmcia/db1xxx_ss.c                       |  700 ++++++++++
 sound/soc/au1x/Kconfig                           |   10 +-
 sound/soc/au1x/Makefile                          |    4 +-
 sound/soc/au1x/db1200.c                          |  189 +++
 sound/soc/au1x/sample-ac97.c                     |  144 --
 43 files changed, 3875 insertions(+), 1547 deletions(-)
 create mode 100644 arch/mips/alchemy/devboards/db1200/Makefile
 create mode 100644 arch/mips/alchemy/devboards/db1200/platform.c
 create mode 100644 arch/mips/alchemy/devboards/db1200/setup.c
 create mode 100644 arch/mips/alchemy/devboards/db1x00/platform.c
 create mode 100644 arch/mips/alchemy/devboards/pb1000/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
 delete mode 100644 drivers/mtd/maps/alchemy-flash.c
 delete mode 100644 drivers/pcmcia/au1000_db1x00.c
 create mode 100644 drivers/pcmcia/db1xxx_ss.c
 create mode 100644 sound/soc/au1x/db1200.c
 delete mode 100644 sound/soc/au1x/sample-ac97.c
#1 lore raw

PATCH 1/5 Alchemy: prioritize timer and usb irqs

MIPS IRQ0-3 are already processed in order; to assure that the system timer and usb-device (if it exists) irqs are processed with highest priority, assign the RTCMATCH2 and USB device irq to request0 of IC0 (=IRQ0) and all other IC0 sources to request1 (=IRQ1).

This makes the USB-device priority hack unnecessary (in theory at least, I have no hardware to actually test this on).

---
 arch/mips/alchemy/common/irq.c |  275 +++++++++++++++++++---------------------
 1 files changed, 133 insertions(+), 142 deletions(-)
arch/mips/alchemy/common/irq.c +133 -142
index c88c821..6882de3 100644
@@ -39,164 +39,168 @@
 
 static int au1x_ic_settype(unsigned int irq, unsigned int flow_type);
 
-/* per-processor fixed function irqs */
+/* per-processor fixed function irqs.
+ * Note on request assignments:  to ensure timer (rtcmatch2) and usb
+ * device interrupts are processed with highest priority, they are
+ * exclusively assigned to request 0 and all others to request 1.
+ */
 struct au1xxx_irqmap 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 },
-	{ AU1000_UART2_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_UART2_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
-	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
+	{ AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
 	{ AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 1 },
 
 #elif defined(CONFIG_SOC_AU1500)
 
-	{ AU1500_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1000_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1500_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1000_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1500_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1000_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1500_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1000_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
-	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
 	{ AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1500_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1500_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1500_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1500_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 1 },
 
 #elif defined(CONFIG_SOC_AU1100)
 
-	{ AU1100_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1100_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1100_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1100_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1100_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1100_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1100_SD_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1100_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
-	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
+	{ AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
 	{ AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1100_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1100_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1100_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1100_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 1 },
 
 #elif defined(CONFIG_SOC_AU1550)
 
-	{ AU1550_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1550_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1550_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_CRYPTO_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1550_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1550_PCI_RST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1550_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_PSC2_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_PSC3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1550_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1550_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1550_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_CRYPTO_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1550_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1550_PCI_RST_INT, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1550_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_PSC2_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_PSC3_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
-	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1550_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1550_NAND_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1550_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1550_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
-	{ AU1550_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1550_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
+	{ AU1550_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1550_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 1 },
+	{ AU1550_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1550_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
 
 #elif defined(CONFIG_SOC_AU1200)
 
-	{ AU1200_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_SWT_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1200_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_MAE_BE_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_MAE_FE_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_AES_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_CAMERA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1200_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_SWT_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1200_SD_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_MAE_BE_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_MAE_FE_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_AES_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_CAMERA_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
-	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 1 },
+	{ AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
-	{ AU1200_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 },
+	{ AU1200_NAND_INT, IRQ_TYPE_EDGE_RISING, 1 },
 	{ AU1200_USB_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
-	{ AU1200_MAE_BOTH_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
+	{ AU1200_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
+	{ AU1200_MAE_BOTH_INT, IRQ_TYPE_LEVEL_HIGH, 1 },
 
 #else
 #error "Error: Unknown Alchemy SOC"
@@ -486,7 +490,7 @@ static int au1x_ic_settype(unsigned int irq, unsigned int flow_type)
 asmlinkage void plat_irq_dispatch(void)
 {
 	unsigned int pending = read_c0_status() & read_c0_cause();
-	unsigned long s, off, bit;
+	unsigned long s, off;
 
 	if (pending & CAUSEF_IP7) {
 		do_IRQ(MIPS_CPU_IRQ_BASE + 7);
@@ -506,25 +510,12 @@ asmlinkage void plat_irq_dispatch(void)
 	} else
 		goto spurious;
 
-	bit = 0;
 	s = au_readl(s);
 	if (unlikely(!s)) {
 spurious:
 		spurious_interrupt();
 		return;
 	}
-#ifdef AU1000_USB_DEV_REQ_INT
-	/*
-	 * Because of the tight timing of SETUP token to reply
-	 * transactions, the USB devices-side packet complete
-	 * interrupt needs the highest priority.
-	 */
-	bit = 1 << (AU1000_USB_DEV_REQ_INT - AU1000_INTC0_INT_BASE);
-	if ((pending & CAUSEF_IP2) && (s & bit)) {
-		do_IRQ(AU1000_USB_DEV_REQ_INT);
-		return;
-	}
-#endif
 	do_IRQ(__ffs(s) + off);
 }
 
Signature · 1 line
1.6.3.1
#2 lore raw

PATCH 2/5 Alchemy: get rid of allow_au1k_wait

Eliminate the 'allow_au1k_wait' variable. MIPS kernel installs the Alchemy-specific wait code before timer initialization; if the C0 timer must be used for timekeeping the wait function is set to NULL which means no wait implementation is available.

This also corrects the 'wait instruction available' output in cpuinfo.

Run-tested on DB1200.

---
 arch/mips/alchemy/common/time.c |   14 ++++++++------
 arch/mips/kernel/cpu-probe.c    |   10 +++-------
 2 files changed, 11 insertions(+), 13 deletions(-)
arch/mips/alchemy/common/time.c +8 -6
index 33fbae7..9fc0d44 100644
@@ -36,14 +36,13 @@
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 
+#include <asm/processor.h>
 #include <asm/time.h>
 #include <asm/mach-au1x00/au1000.h>
 
 /* 32kHz clock enabled and detected */
 #define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S)
 
-extern int allow_au1k_wait; /* default off for CP0 Counter */
-
 static cycle_t au1x_counter1_read(struct clocksource *cs)
 {
 	return au_readl(SYS_RTCREAD);
@@ -153,13 +152,16 @@ void __init plat_time_init(void)
 
 	printk(KERN_INFO "Alchemy clocksource installed\n");
 
-	/* can now use 'wait' */
-	allow_au1k_wait = 1;
 	return;
 
 cntr_err:
-	/* counters unusable, use C0 counter */
+	/* MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this
+	 * function is called.  Because the Alchemy counters are unusable
+	 * the C0 timekeeping code is installed and use of the 'wait'
+	 * instruction must be prohibited, which is done most easily by
+	 * assigning NULL to cpu_wait.
+	 */
+	cpu_wait = NULL;
 	r4k_clockevent_init();
 	init_r4k_clocksource();
-	allow_au1k_wait = 0;
 }
arch/mips/kernel/cpu-probe.c +3 -7
index b13b8eb..262ea9c 100644
@@ -91,15 +91,11 @@ static void rm7k_wait_irqoff(void)
 }
 
 /* The Au1xxx wait is available only if using 32khz counter or
- * external timer source, but specifically not CP0 Counter. */
-int allow_au1k_wait;
-
+ * external timer source, but specifically not CP0 Counter.
+ * alchemy/common/time.c may override cpu_wait!
+ */
 static void au1k_wait(void)
 {
-	if (!allow_au1k_wait)
-		return;
-
-	/* using the wait instruction makes CP0 counter unusable */
 	__asm__("	.set	mips3			\n"
 		"	cache	0x14, 0(%0)		\n"
 		"	cache	0x14, 32(%0)		\n"
Signature · 1 line
1.6.3.1
#3 lore raw

PATCH 3/5 Alchemy: extended DB1200 board support.

Create own directory for DB1200 code and update it with new features.

- SPI support
- tmp121 temperature sensor
- SPI flash on DB1200 (untested, mine doesn't have this chip)
- I2C support
- NE1619 sensor
- AT24 eeprom
- Audio AC97 and I2S (I2S requires I2C)
- I2C/SPI and AC97/I2S can be selected at boot time via switches S6.8 and S6.7
- Carddetect IRQs for SD cards.
- gen_nand based NAND support.
- hexleds count sleep/wake transitions
- defconfig update

---
 arch/mips/alchemy/common/reset.c                 |    3 -
 arch/mips/alchemy/devboards/Makefile             |    2 +-
 arch/mips/alchemy/devboards/db1200/Makefile      |    1 +
 arch/mips/alchemy/devboards/db1200/platform.c    |  505 +++++++
 arch/mips/alchemy/devboards/db1200/setup.c       |  181 +++
 arch/mips/alchemy/devboards/pb1200/board_setup.c |    5 -
 arch/mips/alchemy/devboards/pb1200/irqmap.c      |   19 +-
 arch/mips/alchemy/devboards/pb1200/platform.c    |    4 -
 arch/mips/configs/db1200_defconfig               | 1629 +++++++++++++---------
 arch/mips/include/asm/mach-db1x00/db1200.h       |   23 +-
 sound/soc/au1x/Kconfig                           |   10 +-
 sound/soc/au1x/Makefile                          |    4 +-
 sound/soc/au1x/db1200.c                          |  189 +++
 sound/soc/au1x/sample-ac97.c                     |  144 --
 14 files changed, 1887 insertions(+), 832 deletions(-)
 create mode 100644 arch/mips/alchemy/devboards/db1200/Makefile
 create mode 100644 arch/mips/alchemy/devboards/db1200/platform.c
 create mode 100644 arch/mips/alchemy/devboards/db1200/setup.c
 create mode 100644 sound/soc/au1x/db1200.c
 delete mode 100644 sound/soc/au1x/sample-ac97.c
arch/mips/alchemy/common/reset.c +0 -3
index 0ec33dc..e985068 100644
@@ -164,9 +164,6 @@ void au1000_halt(void)
 #ifdef CONFIG_MIPS_MIRAGE
 	gpio_direction_output(10, 1);
 #endif
-#ifdef CONFIG_MIPS_DB1200
-	au_writew(au_readw(0xB980001C) | (1 << 14), 0xB980001C);
-#endif
 #ifdef CONFIG_PM
 	au_sleep();
 
arch/mips/alchemy/devboards/Makefile +1 -1
index 730f9f2..ed2bd04 100644
@@ -11,7 +11,7 @@ obj-$(CONFIG_MIPS_PB1500)	+= pb1500/
 obj-$(CONFIG_MIPS_PB1550)	+= pb1550/
 obj-$(CONFIG_MIPS_DB1000)	+= db1x00/
 obj-$(CONFIG_MIPS_DB1100)	+= db1x00/
-obj-$(CONFIG_MIPS_DB1200)	+= pb1200/
+obj-$(CONFIG_MIPS_DB1200)	+= db1200/
 obj-$(CONFIG_MIPS_DB1500)	+= db1x00/
 obj-$(CONFIG_MIPS_DB1550)	+= db1x00/
 obj-$(CONFIG_MIPS_BOSPORUS)	+= db1x00/
arch/mips/alchemy/devboards/db1200/Makefile new file +1 -0
new file mode 100644
index 0000000..17840a5
@@ -0,0 +1 @@
+obj-y += setup.o platform.o
arch/mips/alchemy/devboards/db1200/platform.c new file +505 -0

505 lines not on this page · raw message

arch/mips/alchemy/devboards/db1200/setup.c new file +181 -0

181 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1200/board_setup.c +0 -5
index 94e6b7e..2829f45 100644
@@ -123,12 +123,7 @@ void __init board_setup(void)
 #endif
 	au_sync();
 
-#ifdef CONFIG_MIPS_PB1200
 	printk(KERN_INFO "AMD Alchemy Pb1200 Board\n");
-#endif
-#ifdef CONFIG_MIPS_DB1200
-	printk(KERN_INFO "AMD Alchemy Db1200 Board\n");
-#endif
 }
 
 int board_au1200fb_panel(void)
arch/mips/alchemy/devboards/pb1200/irqmap.c +2 -17
index fe47498..453e18b 100644
@@ -27,16 +27,7 @@
 #include <linux/interrupt.h>
 
 #include <asm/mach-au1x00/au1000.h>
-
-#ifdef CONFIG_MIPS_PB1200
 #include <asm/mach-pb1x00/pb1200.h>
-#endif
-
-#ifdef CONFIG_MIPS_DB1200
-#include <asm/mach-db1x00/db1200.h>
-#define PB1200_INT_BEGIN DB1200_INT_BEGIN
-#define PB1200_INT_END DB1200_INT_END
-#endif
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
 	/* This is external interrupt cascade */
@@ -82,12 +73,7 @@ static void pb1200_unmask_irq(unsigned int irq_nr)
 }
 
 static struct irq_chip pb1200_cpld_irq_type = {
-#ifdef CONFIG_MIPS_PB1200
-	.name = "Pb1200 Ext",
-#endif
-#ifdef CONFIG_MIPS_DB1200
-	.name = "Db1200 Ext",
-#endif
+	.name		= "Pb1200 Ext",
 	.mask		= pb1200_mask_irq,
 	.mask_ack	= pb1200_maskack_irq,
 	.unmask		= pb1200_unmask_irq,
@@ -99,7 +85,6 @@ void __init board_init_irq(void)
 
 	au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
 
-#ifdef CONFIG_MIPS_PB1200
 	/* We have a problem with CPLD rev 3. */
 	if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) {
 		printk(KERN_ERR "WARNING!!!\n");
@@ -119,7 +104,7 @@ void __init board_init_irq(void)
 		printk(KERN_ERR "WARNING!!!\n");
 		panic("Game over.  Your score is 0.");
 	}
-#endif
+
 	/* mask & disable & ack all */
 	bcsr->intclr_mask = 0xffff;
 	bcsr->intclr = 0xffff;
arch/mips/alchemy/devboards/pb1200/platform.c +0 -4
index b93dff4..4d6edd8 100644
@@ -65,7 +65,6 @@ static struct led_classdev pb1200mmc_led = {
 	.brightness_set	= pb1200_mmcled_set,
 };
 
-#ifndef CONFIG_MIPS_DB1200
 static void pb1200mmc1_set_power(void *mmc_host, int state)
 {
 	if (state)
@@ -85,7 +84,6 @@ static int pb1200mmc1_card_inserted(void *mmc_host)
 {
 	return (bcsr->sig_status & BCSR_INT_SD1INSERT) ? 1 : 0;
 }
-#endif
 
 const struct au1xmmc_platform_data au1xmmc_platdata[2] = {
 	[0] = {
@@ -95,7 +93,6 @@ const struct au1xmmc_platform_data au1xmmc_platdata[2] = {
 		.cd_setup	= NULL,		/* use poll-timer in driver */
 		.led		= &pb1200mmc_led,
 	},
-#ifndef CONFIG_MIPS_DB1200
 	[1] = {
 		.set_power	= pb1200mmc1_set_power,
 		.card_inserted	= pb1200mmc1_card_inserted,
@@ -103,7 +100,6 @@ const struct au1xmmc_platform_data au1xmmc_platdata[2] = {
 		.cd_setup	= NULL,		/* use poll-timer in driver */
 		.led		= &pb1200mmc_led,
 	},
-#endif
 };
 
 static struct resource ide_resources[] = {
arch/mips/configs/db1200_defconfig +998 -631

2,178 lines not on this page · raw message

arch/mips/include/asm/mach-db1x00/db1200.h +2 -21
index 27f2610..2a54103 100644
@@ -25,25 +25,6 @@
 #define __ASM_DB1200_H
 
 #include <linux/types.h>
-#include <asm/mach-au1x00/au1xxx_psc.h>
-
-#define DBDMA_AC97_TX_CHAN	DSCR_CMD0_PSC1_TX
-#define DBDMA_AC97_RX_CHAN	DSCR_CMD0_PSC1_RX
-#define DBDMA_I2S_TX_CHAN	DSCR_CMD0_PSC1_TX
-#define DBDMA_I2S_RX_CHAN	DSCR_CMD0_PSC1_RX
-
-/*
- * SPI and SMB are muxed on the DBAu1200 board.
- * Refer to board documentation.
- */
-#define SPI_PSC_BASE		PSC0_BASE_ADDR
-#define SMBUS_PSC_BASE		PSC0_BASE_ADDR
-/*
- * AC'97 and I2S are muxed on the DBAu1200 board.
- * Refer to board documentation.
- */
-#define AC97_PSC_BASE		PSC1_BASE_ADDR
-#define I2S_PSC_BASE		PSC1_BASE_ADDR
 
 #define BCSR_KSEG1_ADDR 	0xB9800000
 
@@ -123,8 +104,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
 #define BCSR_RESETS_TV		0x0010
 /* Not resets but in the same register */
 #define BCSR_RESETS_PWMR1MUX	0x0800
-#define BCSR_RESETS_PCS0MUX	0x1000
-#define BCSR_RESETS_PCS1MUX	0x2000
+#define BCSR_RESETS_PSC0MUX	0x1000
+#define BCSR_RESETS_PSC1MUX	0x2000
 #define BCSR_RESETS_SPISEL	0x4000
 
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

sound/soc/au1x/Kconfig +6 -4
index 410a893..4b67140 100644

Lines of this file are not shown. View the raw message.

sound/soc/au1x/Makefile +2 -2
index 6c6950b..1687307 100644

Lines of this file are not shown. View the raw message.

sound/soc/au1x/db1200.c new file +189 -0

189 lines not on this page · raw message

sound/soc/au1x/sample-ac97.c deleted +0 -144

144 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.3.1

Part of the diff is not shown here. View the raw message.

#4 lore raw

PATCH 4/5 Alchemy: new PCMCIA socket driver for devboards.

New PCMCIA socket driver for all Db/Pb1xxx boards (except Pb1000) Notable features:
- it builds for all supported boards.
- support for carddetect and statuschange (disabled) IRQs.
- pcmcia socket mem/io/attr areas and irqs passed through platform resource information.
- doesn't freeze system during card insertion/ejection like the old one.

Also add platform device registration for all boards supported by this driver.

Run-tested on Db1200; however since all of these boards have an identical PCMCIA setup (at least eletrically; some differ in IRQs used) I'm fairly confident that it works on them too.

---
 arch/mips/alchemy/common/platform.c              |    6 -
 arch/mips/alchemy/common/setup.c                 |    3 +-
 arch/mips/alchemy/devboards/db1200/platform.c    |  113 ++++
 arch/mips/alchemy/devboards/db1x00/Makefile      |    3 +-
 arch/mips/alchemy/devboards/db1x00/platform.c    |  166 +++++
 arch/mips/alchemy/devboards/pb1100/Makefile      |    3 +-
 arch/mips/alchemy/devboards/pb1100/platform.c    |   83 +++
 arch/mips/alchemy/devboards/pb1200/platform.c    |  113 ++++-
 arch/mips/alchemy/devboards/pb1500/Makefile      |    3 +-
 arch/mips/alchemy/devboards/pb1500/platform.c    |   83 +++
 arch/mips/alchemy/devboards/pb1550/Makefile      |    3 +-
 arch/mips/alchemy/devboards/pb1550/board_setup.c |    3 +
 arch/mips/alchemy/devboards/pb1550/platform.c    |  130 ++++
 arch/mips/include/asm/mach-au1x00/au1000.h       |   14 +
 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       |    7 -
 arch/mips/include/asm/mach-pb1x00/pb1200.h       |   14 -
 arch/mips/include/asm/mach-pb1x00/pb1500.h       |    7 -
 arch/mips/include/asm/mach-pb1x00/pb1550.h       |    7 -
 drivers/pcmcia/Kconfig                           |   17 +-
 drivers/pcmcia/Makefile                          |    9 +-
 drivers/pcmcia/au1000_db1x00.c                   |  305 ----------
 drivers/pcmcia/db1xxx_ss.c                       |  700 ++++++++++++++++++++++
 24 files changed, 1429 insertions(+), 386 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
 delete mode 100644 drivers/pcmcia/au1000_db1x00.c
 create mode 100644 drivers/pcmcia/db1xxx_ss.c
arch/mips/alchemy/common/platform.c +0 -6
index 117f99f..2b76a57 100644
@@ -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
index 3f036b3..e8d27f6 100644
@@ -103,7 +103,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/alchemy/devboards/db1200/platform.c +113 -0

125 lines not on this page · raw message

arch/mips/alchemy/devboards/db1x00/Makefile +2 -1
index 432241a..5024d16 100644
@@ -5,4 +5,5 @@
 # Makefile for the Alchemy Semiconductor DBAu1xx0 boards.
 #
 
-obj-y := board_setup.o irqmap.o
+obj-y := board_setup.o irqmap.o platform.o
+
arch/mips/alchemy/devboards/db1x00/platform.c new file +166 -0

166 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1100/Makefile +2 -1
index c586dd7..60cf5b9 100644
@@ -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 +83 -0

83 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1200/platform.c +112 -1

121 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1500/Makefile +2 -1
index 173b419..c29545d 100644
@@ -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/platform.c new file +83 -0

83 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1550/Makefile +2 -1
index cff95bc..86b410b 100644
@@ -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 +3 -0
index b6e9e7d..56d33df 100644
@@ -32,6 +32,7 @@
 
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1550.h>
+#include <asm/mach-au1x00/gpio.h>
 
 #include <prom.h>
 
@@ -76,6 +77,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.
arch/mips/alchemy/devboards/pb1550/platform.c new file +130 -0

130 lines not on this page · raw message

arch/mips/include/asm/mach-au1x00/au1000.h +14 -0
index 854e95f..df04e91 100644
@@ -1739,6 +1739,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;
arch/mips/include/asm/mach-db1x00/db1200.h +0 -15
index 2a54103..acb7042 100644
@@ -190,21 +190,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->sig_status & (1 << (8 + (2 * SOCKET)))
-
 /* NAND chip select */
 #define NAND_CS 1
 
arch/mips/include/asm/mach-db1x00/db1x00.h +0 -8
index 1a515b8..d654434 100644
@@ -137,14 +137,6 @@ typedef volatile struct
 
 #define BCSR_SWRESET_RESET		0x0080
 
-/* 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 +0 -7
index b1a60f1..2621f65 100644
@@ -75,11 +75,4 @@
  */
 #define PB1100_HEX_LED		0xAE000018
 
-/* 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
index c8618df..fa1c295 100644
@@ -239,20 +239,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->sig_status & (1 << (8 + (2 * SOCKET)))
-
 /* NAND chip select */
 #define NAND_CS 1
 
arch/mips/include/asm/mach-pb1x00/pb1500.h +0 -7
index da51a2e..66b770a 100644
@@ -39,11 +39,4 @@
 #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)
-
-/* 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
index 6704a11..c437d9b 100644
@@ -129,13 +129,6 @@ static BCSR * const bcsr = (BCSR *)BCSR_PHYS_ADDR;
 #define BCSR_SYSTEM_POWEROFF	0x4000
 #define BCSR_SYSTEM_RESET	0x8000
 
-#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)
drivers/pcmcia/Kconfig +14 -3
index 2764735..c94ba1e 100644
@@ -82,7 +82,7 @@ config PCMCIA_IOCTL
 	  If unsure, say Y.
 
 config CARDBUS
-	bool "32-bit CardBus support"	
+	bool "32-bit CardBus support"
 	depends on PCI
 	default y
 	---help---
@@ -105,8 +105,8 @@ config YENTA
 	select PCCARD_NONSTATIC
 	---help---
 	  This option enables support for CardBus host bridges.  Virtually
-	  all modern PCMCIA bridges are CardBus compatible.  A "bridge" is 
-	  the hardware inside your computer that PCMCIA cards are plugged 
+	  all modern PCMCIA bridges are CardBus compatible.  A "bridge" is
+	  the hardware inside your computer that PCMCIA cards are plugged
 	  into.
 
 	  To compile this driver as modules, choose M here: the
@@ -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_SA1100
 	tristate "SA1100 support"
 	depends on ARM && ARCH_SA1100 && PCMCIA
drivers/pcmcia/Makefile +1 -8
index bbac463..3c52108 100644
@@ -33,20 +33,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 -305

305 lines not on this page · raw message

drivers/pcmcia/db1xxx_ss.c new file +700 -0

700 lines not on this page · raw message

Signature · 1 line
1.6.3.1
#5 lore raw

PATCH 5/5 Alchemy: convert to physmap flash

Add physmap-flash support to all Alchemy devboards and get rid of the alchemy-flash.c MTD map driver.

---
 arch/mips/alchemy/devboards/db1200/platform.c |   49 +++++++
 arch/mips/alchemy/devboards/db1x00/platform.c |   77 ++++++++++++
 arch/mips/alchemy/devboards/pb1000/Makefile   |    3 +-
 arch/mips/alchemy/devboards/pb1000/platform.c |   84 +++++++++++++
 arch/mips/alchemy/devboards/pb1100/platform.c |   51 ++++++++
 arch/mips/alchemy/devboards/pb1200/platform.c |   50 ++++++++
 arch/mips/alchemy/devboards/pb1500/platform.c |   51 ++++++++
 arch/mips/alchemy/devboards/pb1550/platform.c |   51 ++++++++
 drivers/mtd/maps/Kconfig                      |    6 -
 drivers/mtd/maps/Makefile                     |    1 -
 drivers/mtd/maps/alchemy-flash.c              |  166 -------------------------
 11 files changed, 415 insertions(+), 174 deletions(-)
 create mode 100644 arch/mips/alchemy/devboards/pb1000/platform.c
 delete mode 100644 drivers/mtd/maps/alchemy-flash.c
arch/mips/alchemy/devboards/db1200/platform.c +49 -0
index fb63026..1da114e 100644
@@ -27,6 +27,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 #include <linux/spi/spi.h>
@@ -39,6 +40,10 @@
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
 #include <asm/mach-au1x00/au1550_spi.h>
 
+/* NOR flash */
+#define BOARD_FLASH_SIZE	0x04000000	/* 64MB */
+#define BOARD_FLASH_WIDTH	2		/* 16-bits */
+
 static struct mtd_partition db1200_spiflash_parts[] = {
 	{
 		.name	= "DB1200 SPI flash",
@@ -169,6 +174,49 @@ static struct platform_device nand_dev = {
 	}
 };
 
+static struct mtd_partition db1200_nor_partitions[] = {
+	{
+		.name	= "User FS",
+		.size	= BOARD_FLASH_SIZE - 0x00400000,
+		.offset	= 0x0000000,
+	},
+	{
+		.name	= "YAMON",
+		.size	= 0x0100000,
+		.offset	= MTDPART_OFS_APPEND,
+		.mask_flags = MTD_WRITEABLE,
+	},
+	{
+		.name	= "raw kernel",
+		.size	= (0x300000 - 0x40000), /* last 256KB is yamon env */
+		.offset	= MTDPART_OFS_APPEND,
+	}
+};
+
+static struct physmap_flash_data db1200_nor_data = {
+	.width		= BOARD_FLASH_WIDTH,
+	.nr_parts	= ARRAY_SIZE(db1200_nor_partitions),
+	.parts		= &db1200_nor_partitions[0],
+};
+
+static struct resource db1200_nor_res[] = {
+	[0] = {
+		.start	= 0x20000000 - BOARD_FLASH_SIZE,
+		.end	= 0x1fffffff,
+		.flags	= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device db1200_nor_dev = {
+	.name	= "physmap-flash",
+	.id	= -1,
+	.dev	= {
+		.platform_data = &db1200_nor_data,
+	},
+	.resource	= db1200_nor_res,
+	.num_resources	= ARRAY_SIZE(db1200_nor_res),
+};
+
 /**********************************************************************/
 
 static struct smc91x_platdata smc_data = {
@@ -526,6 +574,7 @@ static struct platform_device *db1200_devs[] __initdata = {
 	&ide_dev,
 	&smc91x_dev,
 	&rtc_dev,
+	&db1200_nor_dev,
 	&nand_dev,
 	&db1200_pcmcia0_dev,
 	&db1200_pcmcia1_dev,
arch/mips/alchemy/devboards/db1x00/platform.c +77 -0

90 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1000/Makefile +2 -1
index 97c6615..ff838be 100644
@@ -5,4 +5,5 @@
 # Makefile for the Alchemy Semiconductor Pb1000 board.
 #
 
-obj-y := board_setup.o
+obj-y := board_setup.o platform.o
+
arch/mips/alchemy/devboards/pb1000/platform.c new file +84 -0

84 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1100/platform.c +51 -0

64 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1200/platform.c +50 -0

71 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1500/platform.c +51 -0

68 lines not on this page · raw message

arch/mips/alchemy/devboards/pb1550/platform.c +51 -0

69 lines not on this page · raw message

drivers/mtd/maps/Kconfig +0 -6
index 82923bd..118cab4 100644
@@ -262,12 +262,6 @@ config MTD_NETtel
 	help
 	  Support for flash chips on NETtel/SecureEdge/SnapGear boards.
 
-config MTD_ALCHEMY
-	tristate "AMD Alchemy Pb1xxx/Db1xxx/RDK MTD support"
-	depends on SOC_AU1X00 && MTD_PARTITIONS && MTD_CFI
-	help
-	  Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
-
 config MTD_DILNETPC
 	tristate "CFI Flash device mapped on DIL/Net PC"
 	depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
drivers/mtd/maps/Makefile +0 -1
index 2dbc1be..2c846c9 100644
@@ -41,7 +41,6 @@ obj-$(CONFIG_MTD_SCx200_DOCFLASH)+= scx200_docflash.o
 obj-$(CONFIG_MTD_DBOX2)		+= dbox2-flash.o
 obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
 obj-$(CONFIG_MTD_PCI)		+= pci.o
-obj-$(CONFIG_MTD_ALCHEMY)       += alchemy-flash.o
 obj-$(CONFIG_MTD_AUTCPU12)	+= autcpu12-nvram.o
 obj-$(CONFIG_MTD_EDB7312)	+= edb7312.o
 obj-$(CONFIG_MTD_IMPA7)		+= impa7.o
drivers/mtd/maps/alchemy-flash.c deleted +0 -166

166 lines not on this page · raw message

Signature · 1 line
1.6.3.1