Au1300/DB1300 support
cover Au1300/DB1300 support
The following 2 patches implement basic Au1300/DB1300 support.
It's possible to boot a filesystem from NFSroot, mount IDE devices (CF cards and harddisks; however using a harddisk as a root device hangs the system early in the boot process), work with NAND/NOR flashes and use the ddma controller.
This is a resend of the patches I sent out earlier this year, rebased on latest linus -git.
Please consider for 2.6.37.
Thanks,
Manuel Lauss
Manuel Lauss (2):
MIPS: Alchemy: Au1300 SoC support
MIPS: Alchemy: DB1300 support
arch/mips/alchemy/Kconfig | 17 + arch/mips/alchemy/Platform | 7 + arch/mips/alchemy/common/Makefile | 2 + arch/mips/alchemy/common/dbdma.c | 48 ++- arch/mips/alchemy/common/gpioint.c | 468 +++++++++++++++++ arch/mips/alchemy/common/gpiolib-au1300.c | 54 ++ arch/mips/alchemy/common/platform.c | 9 + arch/mips/alchemy/common/power.c | 9 +- arch/mips/alchemy/common/sleeper.S | 73 +++ arch/mips/alchemy/common/time.c | 1 + arch/mips/alchemy/devboards/Makefile | 1 + arch/mips/alchemy/devboards/db1300/Makefile | 1 + arch/mips/alchemy/devboards/db1300/platform.c | 608 ++++++++++++++++++++++ arch/mips/alchemy/devboards/db1300/setup.c | 269 ++++++++++ arch/mips/alchemy/devboards/prom.c | 8 +- arch/mips/boot/compressed/uart-alchemy.c | 5 +- arch/mips/configs/db1300_defconfig | 298 +++++++++++ arch/mips/include/asm/cpu.h | 8 + arch/mips/include/asm/mach-au1x00/au1000.h | 198 +++++++- arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h | 33 ++ arch/mips/include/asm/mach-au1x00/gpio-au1300.h | 250 +++++++++ arch/mips/include/asm/mach-au1x00/gpio.h | 4 + arch/mips/include/asm/mach-db1x00/bcsr.h | 5 +- arch/mips/include/asm/mach-db1x00/db1300.h | 40 ++ arch/mips/include/asm/mach-db1x00/irq.h | 23 + arch/mips/kernel/cpu-probe.c | 18 + drivers/i2c/busses/Kconfig | 6 +- drivers/pcmcia/Kconfig | 4 +- drivers/pcmcia/db1xxx_ss.c | 30 +- drivers/spi/Kconfig | 2 +- drivers/video/Kconfig | 8 +- sound/soc/au1x/Kconfig | 6 +- 32 files changed, 2483 insertions(+), 30 deletions(-) create mode 100644 arch/mips/alchemy/common/gpioint.c create mode 100644 arch/mips/alchemy/common/gpiolib-au1300.c create mode 100644 arch/mips/alchemy/devboards/db1300/Makefile create mode 100644 arch/mips/alchemy/devboards/db1300/platform.c create mode 100644 arch/mips/alchemy/devboards/db1300/setup.c create mode 100644 arch/mips/configs/db1300_defconfig create mode 100644 arch/mips/include/asm/mach-au1x00/gpio-au1300.h create mode 100644 arch/mips/include/asm/mach-db1x00/db1300.h create mode 100644 arch/mips/include/asm/mach-db1x00/irq.h
Signature · 1 line
1.7.3.2
PATCH RESEND 1/2 MIPS: Alchemy: Au1300 SoC support
Add support for the Au1300 SoC: New GPIO/Interrupt controller code, basic integration. Sleepcode taken from RMI sources.
--- arch/mips/alchemy/Kconfig | 9 + arch/mips/alchemy/common/Makefile | 2 + arch/mips/alchemy/common/dbdma.c | 48 ++- arch/mips/alchemy/common/gpioint.c | 468 ++++++++++++++++++++++ arch/mips/alchemy/common/gpiolib-au1300.c | 54 +++ arch/mips/alchemy/common/platform.c | 9 + arch/mips/alchemy/common/power.c | 9 +- arch/mips/alchemy/common/sleeper.S | 73 ++++ arch/mips/alchemy/common/time.c | 1 + arch/mips/include/asm/cpu.h | 8 + arch/mips/include/asm/mach-au1x00/au1000.h | 198 +++++++++- arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h | 33 ++ arch/mips/include/asm/mach-au1x00/gpio-au1300.h | 250 ++++++++++++ arch/mips/include/asm/mach-au1x00/gpio.h | 4 + arch/mips/kernel/cpu-probe.c | 18 + drivers/i2c/busses/Kconfig | 6 +- drivers/spi/Kconfig | 2 +- drivers/video/Kconfig | 8 +- sound/soc/au1x/Kconfig | 6 +- 19 files changed, 1187 insertions(+), 19 deletions(-) create mode 100644 arch/mips/alchemy/common/gpioint.c create mode 100644 arch/mips/alchemy/common/gpiolib-au1300.c create mode 100644 arch/mips/include/asm/mach-au1x00/gpio-au1300.h
arch/mips/alchemy/Kconfig +9 -0
@@ -2,6 +2,10 @@ config ALCHEMY_GPIOINT_AU1000 bool +# au1300-style GPIO/INT controller +config ALCHEMY_GPIOINT_AU1300 + bool + # select this in your board config if you don't want to use the gpio # namespace as documented in the manuals. In this case however you need # to create the necessary gpio_* functions in your board code/headers!
@@ -158,3 +162,8 @@ config SOC_AU1550 config SOC_AU1200 bool select ALCHEMY_GPIOINT_AU1000 + +config SOC_AU1300 + bool + select SOC_AU1X00 + select ALCHEMY_GPIOINT_AU1300
arch/mips/alchemy/common/Makefile +2 -0
@@ -9,11 +9,13 @@ obj-y += prom.o time.o clocks.o platform.o power.o setup.o \ sleeper.o dma.o dbdma.o obj-$(CONFIG_ALCHEMY_GPIOINT_AU1000) += irq.o +obj-$(CONFIG_ALCHEMY_GPIOINT_AU1300) += gpioint.o # optional gpiolib support ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),) ifeq ($(CONFIG_GPIOLIB),y) obj-$(CONFIG_ALCHEMY_GPIOINT_AU1000) += gpiolib-au1000.o + obj-$(CONFIG_ALCHEMY_GPIOINT_AU1300) += gpiolib-au1300.o endif endif
arch/mips/alchemy/common/dbdma.c +44 -4
69 lines not on this page · raw message
arch/mips/alchemy/common/gpioint.c new file +468 -0
468 lines not on this page · raw message
arch/mips/alchemy/common/gpiolib-au1300.c new file +54 -0
54 lines not on this page · raw message
arch/mips/alchemy/common/platform.c +9 -0
@@ -83,6 +83,11 @@ static struct plat_serial8250_port au1x00_uart_data[] = {#elif defined(CONFIG_SOC_AU1200 ) PORT(UART0_PHYS_ADDR, AU1200_UART0_INT), PORT(UART1_PHYS_ADDR, AU1200_UART1_INT), +#elif defined(CONFIG_SOC_AU1300 ) +PORT (AU1300_UART0_PHYS_ADDR ,AU1300_UART0_INT ), +PORT (AU1300_UART1_PHYS_ADDR ,AU1300_UART1_INT ), +PORT (AU1300_UART2_PHYS_ADDR ,AU1300_UART2_INT ), + PORT(AU1300_UART3_PHYS_ADDR, AU1300_UART3_INT), #endif { }, };
@@ -95,6 +100,7 @@ static struct platform_device au1xx0_uart_device = { }, }; +#ifdef FOR_PLATFORM_C_USB_HOST_INT /* OHCI (USB full speed host controller) */ static struct resource au1xxx_usb_ohci_resources[] = { [0] = {
@@ -122,6 +128,7 @@ static struct platform_device au1xxx_usb_ohci_device = { .num_resources = ARRAY_SIZE(au1xxx_usb_ohci_resources), .resource = au1xxx_usb_ohci_resources, }; +#endif /*** AU1100 LCD controller ***/
@@ -441,7 +448,9 @@ void __init au1xxx_override_eth_cfg(unsigned int port,static struct platform_device *au1xxx_platform_devices[]__initdata = { &au1xx0_uart_device, +#ifdef FOR_PLATFORM_C_USB_HOST_INT &au1xxx_usb_ohci_device, +#endif #ifdef CONFIG_FB_AU1100 &au1100_lcd_device, #endif
arch/mips/alchemy/common/power.c +8 -1
@@ -49,7 +49,9 @@* We only have to save/restore registers that aren't otherwise * done as part of a driver pm_* function. */ +#ifndef CONFIG_SOC_AU1300 /* ugly but quick fix */ static unsigned int sleep_usb[2 ]; +#endif static unsigned int sleep_sys_clocks[5 ];static unsigned int sleep_sys_pinfunc;static unsigned int sleep_static_memctlr[4 ][3 ];
@@ -58,6 +60,7 @@ static unsigned int sleep_static_memctlr[4][3];static void save_core_regs (void ) {#ifndef CONFIG_SOC_AU1200 +#ifndef CONFIG_SOC_AU1300 /* doesn't apply to Au1300 USB */ /* Shutdown USB host/device. */ sleep_usb[0 ] =au_readl (USB_HOST_CONFIG );
@@ -70,7 +73,7 @@ static void save_core_regs(void) sleep_usb[1 ] =au_readl (USBD_ENABLE );au_writel (0 ,USBD_ENABLE );au_sync (); - +#endif /* au1300 */ #else /* AU1200 */ /* enable access to OTG mmio so we can save OTG CAP/MUX.
@@ -126,9 +129,11 @@ static void restore_core_regs(void)au_sync ();#ifndef CONFIG_SOC_AU1200 +#ifndef CONFIG_SOC_AU1300 /* doesn't apply to Au1300 either */ au_writel (sleep_usb[0 ],USB_HOST_CONFIG );au_writel (sleep_usb[1 ],USBD_ENABLE );au_sync (); +#endif #else /* enable accces to OTG memory */ au_writel (au_readl (USB_MSR_BASE +4 ) | (1 <<6 ),USB_MSR_BASE +4 );
@@ -165,6 +170,8 @@ void au_sleep(void)alchemy_sleep_au1000 (); else if (cpuid <= ALCHEMY_CPU_AU1200) alchemy_sleep_au1550(); + else if (cpuid <= ALCHEMY_CPU_AU1300) + alchemy_sleep_au1300();restore_core_regs (); } }
arch/mips/alchemy/common/sleeper.S +73 -0
79 lines not on this page · raw message
arch/mips/alchemy/common/time.c +1 -0
@@ -179,6 +179,7 @@ static int alchemy_m2inttab[] __initdata = {AU1100_RTC_MATCH2_INT ,AU1550_RTC_MATCH2_INT ,AU1200_RTC_MATCH2_INT , + AU1300_RTC_MATCH2_INT, };void __init plat_time_init (void )
arch/mips/include/asm/cpu.h +8 -0
@@ -33,6 +33,7 @@#define PRID_COMP_TOSHIBA 0x070000#define PRID_COMP_LSI 0x080000#define PRID_COMP_LEXRA 0x0b0000 +#define PRID_COMP_RMI 0x0c0000#define PRID_COMP_CAVIUM 0x0d0000#define PRID_COMP_INGENIC 0xd00000
@@ -121,6 +122,13 @@#define PRID_REV_BCM6368 0x0030/* +* These are the PRID's for when 23:16 == PRID_COMP_RMI +*/ + +#define PRID_IMP_AU13XX 0x8000 + + +/* * These are the PRID's for when 23:16 == PRID_COMP_CAVIUM */
arch/mips/include/asm/mach-au1x00/au1000.h +195 -3
262 lines not on this page · raw message
arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h +33 -0
@@ -195,6 +195,39 @@ typedef volatile struct au1xxx_ddma_desc {#define DSCR_CMD0_CIM_SYNC 26#endif /* CONFIG_SOC_AU1200 */ +#ifdef CONFIG_SOC_AU1300 +#define DSCR_CMD0_UART0_TX 0 +#define DSCR_CMD0_UART0_RX 1 +#define DSCR_CMD0_UART1_TX 2 +#define DSCR_CMD0_UART1_RX 3 +#define DSCR_CMD0_UART2_TX 4 +#define DSCR_CMD0_UART2_RX 5 +#define DSCR_CMD0_UART3_TX 6 +#define DSCR_CMD0_UART3_RX 7 +#define DSCR_CMD0_SDMS_TX0 8 +#define DSCR_CMD0_SDMS_RX0 9 +#define DSCR_CMD0_SDMS_TX1 10 +#define DSCR_CMD0_SDMS_RX1 11 +#define DSCR_CMD0_AES_TX 12 +#define DSCR_CMD0_AES_RX 13 +#define DSCR_CMD0_PSC0_TX 14 +#define DSCR_CMD0_PSC0_RX 15 +#define DSCR_CMD0_PSC1_TX 16 +#define DSCR_CMD0_PSC1_RX 17 +#define DSCR_CMD0_PSC2_TX 18 +#define DSCR_CMD0_PSC2_RX 19 +#define DSCR_CMD0_PSC3_TX 20 +#define DSCR_CMD0_PSC3_RX 21 +#define DSCR_CMD0_LCD 22 +#define DSCR_CMD0_NAND_FLASH 23 +#define DSCR_CMD0_SDMS_TX2 24 +#define DSCR_CMD0_SDMS_RX2 25 +#define DSCR_CMD0_CIM_SYNC 26 +#define DSCR_CMD0_UDMA 27 +#define DSCR_CMD0_DMA_REQ0 28 +#define DSCR_CMD0_DMA_REQ1 29 +#endif /* CONFIG_SOC_AU1300 */ +#define DSCR_CMD0_THROTTLE 30#define DSCR_CMD0_ALWAYS 31#define DSCR_NDEV_IDS 32
arch/mips/include/asm/mach-au1x00/gpio-au1300.h new file +250 -0
250 lines not on this page · raw message
arch/mips/include/asm/mach-au1x00/gpio.h +4 -0
@@ -5,6 +5,10 @@#include <asm/mach-au1x00/gpio-au1000.h> +#elif defined(CONFIG_ALCHEMY_GPIOINT_AU1300 ) + +#include <asm/mach-au1x00/gpio-au1300.h> +#endif #endif /* _ALCHEMY_GPIO_H_ */
arch/mips/kernel/cpu-probe.c +18 -0
@@ -854,6 +854,21 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) } } +static inline void cpu_probe_rmi (struct cpuinfo_mips *c,int cpu) +{ +decode_configs (c); + +switch (c->processor_id &0xff00 ) { +case PRID_IMP_AU13XX : + c->cputype =CPU_ALCHEMY ; + __cpu_name[cpu] ="Au13xx" ; +break ; +default : +panic ("Unknown RMI core!\n" ); +break ; + } +} +static inline void cpu_probe_sibyte (struct cpuinfo_mips *c,unsigned int cpu) {decode_configs (c);
@@ -1011,6 +1026,9 @@ __cpuinit void cpu_probe(void)case PRID_COMP_NXP :cpu_probe_nxp (c, cpu);break ; +case PRID_COMP_RMI : +cpu_probe_rmi (c, cpu); +break ;case PRID_COMP_CAVIUM :cpu_probe_cavium (c, cpu);break ;
drivers/i2c/busses/Kconfig +3 -3
@@ -296,11 +296,11 @@ config I2C_AT91 unless your system can cope with those limitations. config I2C_AU1550 - tristate "Au1550/Au1200 SMBus interface" - depends on SOC_AU1550 || SOC_AU1200 + tristate "Au1550/Au1200/Au1300 SMBus interface" + depends on SOC_AU1550 || SOC_AU1200 || SOC_AU1300 help If you say yes to this option, support will be included for the - Au1550 and Au1200 SMBus interface. + Au1550/Au1200/Au1300 SMBus interface. This driver can also be built as a module. If so, the module will be called i2c-au1550.
drivers/spi/Kconfig +1 -1
@@ -68,7 +68,7 @@ config SPI_BFIN config SPI_AU1550 tristate "Au1550/Au12x0 SPI Controller" - depends on (SOC_AU1550 || SOC_AU1200) && EXPERIMENTAL + depends on (SOC_AU1550 || SOC_AU1200 || SOC_AU1300) && EXPERIMENTAL select SPI_BITBANG help If you say yes to this option, support will be included for the
drivers/video/Kconfig +4 -4
@@ -1711,14 +1711,14 @@ config FB_AU1100 config FB_AU1200 bool "Au1200 LCD Driver" - depends on (FB = y) && MIPS && SOC_AU1200 + depends on (FB = y) && MIPS && (SOC_AU1200 || SOC_AU1300) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help - This is the framebuffer driver for the AMD Au1200 SOC. It can drive - various panels and CRTs by passing in kernel cmd line option - au1200fb:panel=<name>. + This is the framebuffer driver for the AMD Au1200/Au1300 SOCs. + It can drive various panels and CRTs by passing in kernel cmd line + option au1200fb:panel=<name>. source "drivers/video/geode/Kconfig"
sound/soc/au1x/Kconfig +3 -3
@@ -2,12 +2,12 @@ ## Au1200/Au1550 PSC + DBDMA ## config SND_SOC_AU1XPSC - tristate "SoC Audio for Au1200/Au1250/Au1550" - depends on SOC_AU1200 || SOC_AU1550 + tristate "SoC Audio for Au12xx/Au13xx0/Au1550" + depends on SOC_AU1200 || SOC_AU1550 || SOC_AU1300 help This option enables support for the Programmable Serial Controllers in AC97 and I2S mode, and the Descriptor-Based DMA - Controller (DBDMA) as found on the Au1200/Au1250/Au1550 SoC. + Controller (DBDMA) as found on the Au12xx/Au13xx/Au1550 SoC. config SND_SOC_AU1XPSC_I2S tristate
Signature · 1 line
1.7.3.2
PATCH RESEND 2/2 MIPS: Alchemy: DB1300 support
In reply to Manuel LaussBasic support for the DB1300 board.
---
What works:
- Ethernet (NFSroot), PCMCIA, serial ports, IDE (no DMA, booting broken) NOR/NAND flashes, the 5-way switch, RTC, I2C.
- Audio works as well but depends on ASoC merge and another bug to be fixed.
- other stuff is in the works and will come as time permits.
arch/mips/alchemy/Kconfig | 8 + arch/mips/alchemy/Platform | 7 + arch/mips/alchemy/devboards/Makefile | 1 + arch/mips/alchemy/devboards/db1300/Makefile | 1 + arch/mips/alchemy/devboards/db1300/platform.c | 608 +++++++++++++++++++++++++ arch/mips/alchemy/devboards/db1300/setup.c | 269 +++++++++++ arch/mips/alchemy/devboards/prom.c | 8 +- arch/mips/boot/compressed/uart-alchemy.c | 5 +- arch/mips/configs/db1300_defconfig | 298 ++++++++++++ arch/mips/include/asm/mach-db1x00/bcsr.h | 5 +- arch/mips/include/asm/mach-db1x00/db1300.h | 40 ++ arch/mips/include/asm/mach-db1x00/irq.h | 23 + drivers/pcmcia/Kconfig | 4 +- drivers/pcmcia/db1xxx_ss.c | 30 +- 14 files changed, 1296 insertions(+), 11 deletions(-) create mode 100644 arch/mips/alchemy/devboards/db1300/Makefile create mode 100644 arch/mips/alchemy/devboards/db1300/platform.c create mode 100644 arch/mips/alchemy/devboards/db1300/setup.c create mode 100644 arch/mips/configs/db1300_defconfig create mode 100644 arch/mips/include/asm/mach-db1x00/db1300.h create mode 100644 arch/mips/include/asm/mach-db1x00/irq.h
arch/mips/alchemy/Kconfig +8 -0
@@ -56,6 +56,14 @@ config MIPS_DB1200 select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_HAS_EARLY_PRINTK +config MIPS_DB1300 + bool "RMI DB1300 board" + select SOC_AU1300 + select DMA_COHERENT + select MIPS_DISABLE_OBSOLETE_IDE + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_HAS_EARLY_PRINTK + config MIPS_DB1500 bool "Alchemy DB1500 board" select SOC_AU1500
arch/mips/alchemy/Platform +7 -0
@@ -75,6 +75,13 @@ cflags-$(CONFIG_MIPS_DB1200) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 load-$(CONFIG_MIPS_DB1200) += 0xffffffff80100000 # +# NetLogic DBAu1300 development platform +# +platform-$(CONFIG_MIPS_DB1300) += alchemy/devboards/ +cflags-$(CONFIG_MIPS_DB1300) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 +load-$(CONFIG_MIPS_DB1300) += 0xffffffff80100000 + +# # AMD Alchemy Bosporus eval board # platform-$(CONFIG_MIPS_BOSPORUS) += alchemy/devboards/
arch/mips/alchemy/devboards/Makefile +1 -0
@@ -16,3 +16,4 @@ obj-$(CONFIG_MIPS_DB1500) += db1x00/ obj-$(CONFIG_MIPS_DB1550) += db1x00/ obj-$(CONFIG_MIPS_BOSPORUS) += db1x00/ obj-$(CONFIG_MIPS_MIRAGE) += db1x00/ +obj-$(CONFIG_MIPS_DB1300) += db1300/
arch/mips/alchemy/devboards/db1300/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y := setup.o platform.o
arch/mips/alchemy/devboards/db1300/platform.c new file +608 -0
608 lines not on this page · raw message
arch/mips/alchemy/devboards/db1300/setup.c new file +269 -0
269 lines not on this page · raw message
arch/mips/alchemy/devboards/prom.c +6 -2
@@ -39,7 +39,7 @@ defined(CONFIG_MIPS_BOSPORUS) || defined(CONFIG_MIPS_MIRAGE)#define ALCHEMY_BOARD_DEFAULT_MEMSIZE 0x04000000 -#else /* Au1550/Au1200-based develboards */ +#else /* Au1550/Au1200/Au1300-based develboards */ #define ALCHEMY_BOARD_DEFAULT_MEMSIZE 0x08000000#endif
@@ -63,5 +63,9 @@ void __init prom_init(void)void prom_putchar (unsigned char c) { -alchemy_uart_putchar (UART0_PHYS_ADDR , c); +#ifdef CONFIG_MIPS_DB1300 +alchemy_uart_putchar (AU1300_UART2_PHYS_ADDR , c); +#else +alchemy_uart_putchar (UART0_PHYS_ADDR , c); +#endif }
arch/mips/boot/compressed/uart-alchemy.c +4 -1
@@ -2,6 +2,9 @@void putc (char c) { -/* all current (Jan. 2010) in-kernel boards */ +#ifdef CONFIG_MIPS_DB1300 +alchemy_uart_putchar (AU1300_UART2_PHYS_ADDR , c); +#else alchemy_uart_putchar (UART0_PHYS_ADDR , c); +#endif }
arch/mips/configs/db1300_defconfig new file +298 -0
298 lines not on this page · raw message
arch/mips/include/asm/mach-db1x00/bcsr.h +4 -1
@@ -34,6 +34,8 @@#define PB1200_BCSR_PHYS_ADDR 0x0D800000#define PB1200_BCSR_HEXLED_OFS 0x00400000 +#define DB1300_BCSR_PHYS_ADDR 0x19800000 +#define DB1300_BCSR_HEXLED_OFS 0x00400000enum bcsr_id {/* BCSR base 1 */
@@ -105,6 +107,7 @@ enum bcsr_whoami_boards {BCSR_WHOAMI_PB1200 =BCSR_WHOAMI_PB1200_DDR1 ,BCSR_WHOAMI_PB1200_DDR2 ,BCSR_WHOAMI_DB1200 , + BCSR_WHOAMI_DB1300, };/* STATUS reg. Unless otherwise noted, they're valid on all boards.
@@ -118,7 +121,7 @@ enum bcsr_whoami_boards {#define BCSR_STATUS_SRAMWIDTH 0x0080#define BCSR_STATUS_FLASHBUSY 0x0100#define BCSR_STATUS_ROMBUSY 0x0400 -#define BCSR_STATUS_SD0WP 0x0400/* DB1200 */ +#define BCSR_STATUS_SD0WP 0x0400/* DB1200/DB1300:SD1 */ #define BCSR_STATUS_SD1WP 0x0800#define BCSR_STATUS_USBOTGID 0x0800/* PB/DB1550 */ #define BCSR_STATUS_DB1000_SWAPBOOT 0x2000
arch/mips/include/asm/mach-db1x00/db1300.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* NetLogic DB1300 board constants +*/ + +#ifndef _DB1300_H_ +#define _DB1300_H_ + +/* FPGA (external mux) interrupt sources */ +#define DB1300_FIRST_INT (ALCHEMY_GPIC_INT_LAST + 1) +#define DB1300_IDE_INT (DB1300_FIRST_INT + 0) +#define DB1300_ETH_INT (DB1300_FIRST_INT + 1) +#define DB1300_CF_INT (DB1300_FIRST_INT + 2) +#define DB1300_VIDEO_INT (DB1300_FIRST_INT + 4) +#define DB1300_HDMI_INT (DB1300_FIRST_INT + 5) +#define DB1300_DC_INT (DB1300_FIRST_INT + 6) +#define DB1300_FLASH_INT (DB1300_FIRST_INT + 7) +#define DB1300_CF_INSERT_INT (DB1300_FIRST_INT + 8) +#define DB1300_CF_EJECT_INT (DB1300_FIRST_INT + 9) +#define DB1300_AC97_INT (DB1300_FIRST_INT + 10) +#define DB1300_AC97_PEN_INT (DB1300_FIRST_INT + 11) +#define DB1300_SD1_INSERT_INT (DB1300_FIRST_INT + 12) +#define DB1300_SD1_EJECT_INT (DB1300_FIRST_INT + 13) +#define DB1300_OTG_VBUS_OC_INT (DB1300_FIRST_INT + 14) +#define DB1300_HOST_VBUS_OC_INT (DB1300_FIRST_INT + 15) +#define DB1300_LAST_INT (DB1300_FIRST_INT + 15) + +/* SMSC9210 CS */ +#define DB1300_ETH_PHYS_ADDR 0x19000000 +#define DB1300_ETH_PHYS_END 0x197fffff + +/* ATA CS */ +#define DB1300_IDE_PHYS_ADDR 0x18800000 +#define DB1300_IDE_REG_SHIFT 5 +#define DB1300_IDE_PHYS_LEN (16 << DB1300_IDE_REG_SHIFT) + +/* NAND CS */ +#define DB1300_NAND_PHYS_ADDR 0x20000000 +#define DB1300_NAND_PHYS_END 0x20000fff + +#endif /* _DB1300_H_ */
arch/mips/include/asm/mach-db1x00/irq.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 2003 by Ralf Baechle +*/ +#ifndef __ASM_MACH_GENERIC_IRQ_H +#define __ASM_MACH_GENERIC_IRQ_H + + +#ifdef NR_IRQS +#undef NR_IRQS +#endif + +#ifndef MIPS_CPU_IRQ_BASE +#define MIPS_CPU_IRQ_BASE 0 +#endif + +/* 8 (MIPS) + 128 (au1300) + 16 (cpld) */ +#define NR_IRQS 152 + +#endif /* __ASM_MACH_GENERIC_IRQ_H */
drivers/pcmcia/Kconfig +2 -2
@@ -165,8 +165,8 @@ config PCMCIA_ALCHEMY_DEVBOARD 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! + Db1000, Db/Pb1100, Db/Pb1500, Db/Pb1550, Db/Pb1200, DB1300 + board. NOT suitable for the PB1000! This driver is also available as a module called db1xxx_ss.ko
drivers/pcmcia/db1xxx_ss.c +25 -5
@@ -7,7 +7,7 @@/* This is a fairly generic PCMCIA socket driver suitable for the * following Alchemy Development boards: -* Db1000, Db/Pb1500, Db/Pb1100, Db/Pb1550, Db/Pb1200. +* Db1000, Db/Pb1500, Db/Pb1100, Db/Pb1550, Db/Pb1200, Db1300 * * The Db1000 is used as a reference: Per-socket card-, carddetect- and * statuschange IRQs connected to SoC GPIOs, control and status register
@@ -18,6 +18,7 @@* - Pb1100/Pb1500: single socket only; voltage key bits VS are * at STATUS[5:4] (instead of STATUS[1:0]). * - Au1200-based: additional card-eject irqs, irqs not gpios! +* - Db1300: Db1200-like, no pwr ctrl, single socket (#1). */ #include <linux/delay.h>
@@ -58,11 +59,17 @@ struct db1x_pcmcia_sock {#define BOARD_TYPE_DEFAULT 0/* most boards */ #define BOARD_TYPE_DB1200 1/* IRQs aren't gpios */ #define BOARD_TYPE_PB1100 2/* VS bits slightly different */ +#define BOARD_TYPE_DB1300 3/* no power control */ int board_type; };#define to_db1x_socket (x) container_of(x, struct db1x_pcmcia_sock, socket) +static int db1300_card_inserted (struct db1x_pcmcia_sock *sock) +{ +return bcsr_read (BCSR_SIGSTAT ) & (1 <<8 ); +} +/* DB/PB1200: check CPLD SIGSTATUS register bit 10/12 */ static int db1200_card_inserted (struct db1x_pcmcia_sock *sock) {
@@ -83,6 +90,8 @@ static int db1x_card_inserted(struct db1x_pcmcia_sock *sock)switch (sock->board_type) {case BOARD_TYPE_DB1200 :return db1200_card_inserted (sock); +case BOARD_TYPE_DB1300 : +return db1300_card_inserted (sock);default :return db1000_card_inserted (sock); }
@@ -159,7 +168,8 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)* ejection handler have been registered and the currently * active one disabled. */ -if (sock->board_type ==BOARD_TYPE_DB1200 ) { +if ((sock->board_type ==BOARD_TYPE_DB1200 ) || + (sock->board_type ==BOARD_TYPE_DB1300 )) { ret =request_irq (sock->insert_irq, db1200_pcmcia_cdirq,IRQF_DISABLED ,"pcmcia_insert" , sock);if (ret)
@@ -173,7 +183,7 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) }/* enable the currently silent one */ -if (db1200_card_inserted (sock)) +if (db1x_card_inserted (sock))enable_irq (sock->eject_irq);else enable_irq (sock->insert_irq);
@@ -269,7 +279,8 @@ static int db1x_pcmcia_configure(struct pcmcia_socket *skt, }/* create new voltage code */ - cr_set |= ((v <<2 ) | p) << (sock->nr *8 ); +if (sock->board_type !=BOARD_TYPE_DB1300 ) + cr_set |= ((v <<2 ) | p) << (sock->nr *8 ); changed = state->flags ^ sock->old_flags;
@@ -319,7 +330,7 @@ static int db1x_pcmcia_get_status(struct pcmcia_socket *skt,unsigned short cr, sr;unsigned int status; - status =db1x_card_inserted (sock) ?SS_DETECT :0 ; + status =0 ; cr =bcsr_read (BCSR_PCMCIA ); sr =bcsr_read (BCSR_STATUS );
@@ -342,6 +353,12 @@ static int db1x_pcmcia_get_status(struct pcmcia_socket *skt,/* if Vcc is not zero, we have applied power to a card */ status |=GET_VCC (cr, sock->nr) ?SS_POWERON :0 ; +/* DB1300: power is always on */ +if (sock->board_type ==BOARD_TYPE_DB1300 ) + status =SS_POWERON |SS_3VCARD ; + + status |=db1x_card_inserted (sock) ?SS_DETECT :0 ; +/* reset de-asserted? then we're ready */ status |= (GET_RESET (cr, sock->nr)) ?SS_READY :SS_RESET ;
@@ -418,6 +435,9 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev) case BCSR_WHOAMI_PB1200 ... BCSR_WHOAMI_DB1200: sock->board_type =BOARD_TYPE_DB1200 ;break ; +case BCSR_WHOAMI_DB1300 : + sock->board_type =BOARD_TYPE_DB1300 ; +break ;default :printk (KERN_INFO "db1xxx-ss: unknown board %d!\n" , bid); ret = -ENODEV ;
Signature · 1 line
1.7.3.2