diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig index 3d5d359bc..6a3426c29 100644 --- a/arch/arm/mach-s3c24xx/Kconfig +++ b/arch/arm/mach-s3c24xx/Kconfig @@ -14,6 +14,20 @@ config CPU_S3C2440 if ARCH_S3C24xx menu "Board specific settings " + +choice + prompt "A9M2440 baseboard" + depends on MACH_A9M2440 + +config MACH_A9M2410DEV + bool + prompt "A9M2410dev" + select HAS_CS8900 + help + Digi's evaluation board. + +endchoice + endmenu menu "S3C24X0 Features " diff --git a/board/a9m2440/Makefile b/board/a9m2440/Makefile index 53c890b84..779e83dc0 100644 --- a/board/a9m2440/Makefile +++ b/board/a9m2440/Makefile @@ -1,3 +1,4 @@ obj-y += lowlevel_init.o obj-y += a9m2440.o +obj-$(CONFIG_MACH_A9M2410DEV) += a9m2410dev.o diff --git a/board/a9m2440/a9m2410dev.c b/board/a9m2440/a9m2410dev.c new file mode 100644 index 000000000..139d17736 --- /dev/null +++ b/board/a9m2440/a9m2410dev.c @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2009 Juergen Beisert + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + */ + +/** + * @file + * @brief a9m2410dev Baseboad specific initialization routines + * + */ + +#include +#include +#include +#include +#include + +/** + * Initialize the CPU to be able to work with the a9m2410dev evaluation board + */ +int a9m2410dev_devices_init(void) +{ + /* ---------- configure the GPIOs ------------- */ + writel(0x007FFFFF, GPACON); + writel(0x00000000, GPCCON); + writel(0x00000000, GPCUP); + writel(0x00000000, GPDCON); + writel(0x00000000, GPDUP); + writel(0xAAAAAAAA, GPECON); + writel(0x0000E03F, GPEUP); + writel(0x00000000, GPBCON); /* all inputs */ + writel(0x00000007, GPBUP); /* pullup disabled for GPB0..3 */ + writel(0x00009000, GPFCON); /* GPF7 CLK_INT#, GPF6 Debug-LED */ + writel(0x000000FF, GPFUP); + writel(readl(GPGDAT) | 0x1010, GPGDAT); /* switch off IDLE_SW#, switch off LCD backlight */ + writel(0x0100A93A, GPGCON); /* switch on USB device */ + writel(0x0000F000, GPGUP); + writel(0x0029FAAA, GPHCON); + + writel((1 << 12) | (0 << 11), GPJDAT); + writel(0x0016aaaa, GPJCON); + writel(~((0<<12)| (1<<11)), GPJUP); + + writel((0 << 12) | (0 << 11), GPJDAT); + writel(0x0016aaaa, GPJCON); + writel(0x00001fff, GPJUP); + + writel(0x00000000, DSC0); + writel(0x00000000, DSC1); + + /* + * USB port1 normal, USB port0 normal, USB1 pads for device + * PCLK output on CLKOUT0, UPLL CLK output on CLKOUT1, + */ + writel((readl(MISCCR) & ~0xFFFF) | 0x0140, MISCCR); + + /* ----------- configure the access to the outer space ---------- */ + reg = readl(BWSCON); + + /* CS#1 to access the network controller */ + reg &= ~0xf0; + reg |= 0xe0; + writel(0x1350, BANKCON1); + + /* CS#2 to the dual 16550 UART */ + reg &= ~0xf00; + reg |= 0x400; + writel(0x0d50, BANKCON2); + + writel(reg, BWSCON); + + /* release the reset signal to the network and UART device */ + reg = readl(MISCCR); + reg |= 0x10000; + writel(reg, MISCCR); + + return 0; +} diff --git a/board/a9m2440/a9m2440.c b/board/a9m2440/a9m2440.c index 1156b198f..228fbde9f 100644 --- a/board/a9m2440/a9m2440.c +++ b/board/a9m2440/a9m2440.c @@ -36,6 +36,8 @@ #include #include +#include "baseboards.h" + static struct memory_platform_data ram_pdata = { .name = "ram0", .flags = DEVFS_RDWR, @@ -133,40 +135,6 @@ static int a9m2440_devices_init(void) sdram_dev.size = s3c24x0_get_memory_size(); - /* ---------- configure the GPIOs ------------- */ - writel(0x007FFFFF, GPACON); - writel(0x00000000, GPCCON); - writel(0x00000000, GPCUP); - writel(0x00000000, GPDCON); - writel(0x00000000, GPDUP); - writel(0xAAAAAAAA, GPECON); - writel(0x0000E03F, GPEUP); - writel(0x00000000, GPBCON); /* all inputs */ - writel(0x00000007, GPBUP); /* pullup disabled for GPB0..3 */ - writel(0x00009000, GPFCON); /* GPF7 CLK_INT#, GPF6 Debug-LED */ - writel(0x000000FF, GPFUP); - writel(readl(GPGDAT) | 0x1010, GPGDAT); /* switch off IDLE_SW#, switch off LCD backlight */ - writel(0x0100A93A, GPGCON); /* switch on USB device */ - writel(0x0000F000, GPGUP); - writel(0x0029FAAA, GPHCON); - - writel((1 << 12) | (0 << 11), GPJDAT); - writel(0x0016aaaa, GPJCON); - writel(~((0<<12)| (1<<11)), GPJUP); - - writel((0 << 12) | (0 << 11), GPJDAT); - writel(0x0016aaaa, GPJCON); - writel(0x00001fff, GPJUP); - - writel(0x00000000, DSC0); - writel(0x00000000, DSC1); - - /* - * USB port1 normal, USB port0 normal, USB1 pads for device - * PCLK output on CLKOUT0, UPLL CLK output on CLKOUT1, - */ - writel(0x00140, MISCCR); - /* ----------- configure the access to the outer space ---------- */ reg = readl(BWSCON); @@ -175,14 +143,13 @@ static int a9m2440_devices_init(void) reg |= 0x00d00000; /* 16 bit */ writel(0x1f4c, BANKCON5); - /* CS#2 to the dual 16550 UART */ - reg &= ~0xf00; - reg |= 0x400; - writel(0x0d50, BANKCON2); - writel(reg, BWSCON); - /* release the reset signal to the network and UART device */ +#ifdef CONFIG_MACH_A9M2410DEV + a9m2410dev_devices_init(); +#endif + + /* release the reset signal to external devices */ reg = readl(MISCCR); reg |= 0x10000; writel(reg, MISCCR); diff --git a/board/a9m2440/baseboards.h b/board/a9m2440/baseboards.h new file mode 100644 index 000000000..ec80312b6 --- /dev/null +++ b/board/a9m2440/baseboards.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2009 Juergen Beisert + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + */ + +#ifdef CONFIG_MACH_A9M2410DEV +extern int a9m2410dev_devices_init(void); +#endif