Re: [PATCH v2] Add basic support from ARM Versatile/PB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems that I've been wrong, and the real versatile/pb board also
provides smc91c111. I've been confused my the naming diffirences
between barebox and Linux. I'll send an updated patch soon.

On Mon, Oct 11, 2010 at 19:15, Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx> wrote:
> To test in qemu:
>
> qemu-system-arm -kernel barebox.bin -M versatilepb -cpu arm926 -nographic -m 64 -net nic,model=smc91c111 -net user
>
> And don't forget to set CONFIG_VERSATILE_SMC91C111.
>
> Signed-off-by: Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx>
> ---
>
> Fixed a few minor problems.
>
> Where should I add the instructions on running qemu?
> Anyway, it seems to be quite straght-forward, and I've documented it
> in the commit message. I'll send an additional patch, if there is a
> better place.
>
> I have not added a default env yet. I'm new to barebox, and ran it for the first time only after porting it. Not sure I fully understand how works yet. ;)
>
> Âarch/arm/Kconfig                Â|  Â5
> Âarch/arm/Makefile                |  Â2
> Âarch/arm/boards/versatile/Kconfig        |  18 +
> Âarch/arm/boards/versatile/Makefile       Â|  Â2
> Âarch/arm/boards/versatile/config.h       Â|  Â5
> Âarch/arm/boards/versatile/env/bin/init     Â|  Â1
> Âarch/arm/boards/versatile/versatilepb.c     |  56 +++
> Âarch/arm/configs/versatilepb_defconfig     Â|  12 +
> Âarch/arm/include/asm/arm_timer.h        Â|  33 ++
> Âarch/arm/mach-versatile/Kconfig         |  16 +
> Âarch/arm/mach-versatile/Makefile        Â|  Â2
> Âarch/arm/mach-versatile/core.c         Â| Â212 ++++++++++++
> Âarch/arm/mach-versatile/include/mach/clkdev.h  |  Â7
> Âarch/arm/mach-versatile/include/mach/debug_ll.h | Â 37 ++
> Âarch/arm/mach-versatile/include/mach/init.h   |  Â8
> Âarch/arm/mach-versatile/include/mach/platform.h | Â417 +++++++++++++++++++++++
> Â16 files changed, 833 insertions(+), 0 deletions(-)
> Âcreate mode 100644 arch/arm/boards/versatile/Kconfig
> Âcreate mode 100644 arch/arm/boards/versatile/Makefile
> Âcreate mode 100644 arch/arm/boards/versatile/config.h
> Âcreate mode 100644 arch/arm/boards/versatile/env/bin/init
> Âcreate mode 100644 arch/arm/boards/versatile/versatilepb.c
> Âcreate mode 100644 arch/arm/configs/versatilepb_defconfig
> Âcreate mode 100644 arch/arm/include/asm/arm_timer.h
> Âcreate mode 100644 arch/arm/mach-versatile/Kconfig
> Âcreate mode 100644 arch/arm/mach-versatile/Makefile
> Âcreate mode 100644 arch/arm/mach-versatile/core.c
> Âcreate mode 100644 arch/arm/mach-versatile/include/mach/clkdev.h
> Âcreate mode 100644 arch/arm/mach-versatile/include/mach/debug_ll.h
> Âcreate mode 100644 arch/arm/mach-versatile/include/mach/init.h
> Âcreate mode 100644 arch/arm/mach-versatile/include/mach/platform.h
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index fa37036..1730ce8 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -56,6 +56,10 @@ config ARCH_S3C24xx
> Â Â Â Âbool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
> Â Â Â Âselect CPU_ARM920T
>
> +config ARCH_VERSATILE
> + Â Â Â bool "ARM Versatile boards (ARM926EJ-S)"
> + Â Â Â select CPU_ARM926T
> +
> Âendchoice
>
> Âsource arch/arm/cpu/Kconfig
> @@ -66,6 +70,7 @@ source arch/arm/mach-netx/Kconfig
> Âsource arch/arm/mach-nomadik/Kconfig
> Âsource arch/arm/mach-omap/Kconfig
> Âsource arch/arm/mach-s3c24xx/Kconfig
> +source arch/arm/mach-versatile/Kconfig
>
> Âconfig AEABI
> Â Â Â Âbool "Use the ARM EABI to compile barebox"
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index 77b6cf4..6ad14e7 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -45,6 +45,7 @@ machine-$(CONFIG_ARCH_NOMADIK) Â Â Â Â Â Â Â Â:= nomadik
> Âmachine-$(CONFIG_ARCH_NETX) Â Â Â Â Â Â:= netx
> Âmachine-$(CONFIG_ARCH_OMAP) Â Â Â Â Â Â:= omap
> Âmachine-$(CONFIG_ARCH_S3C24xx) Â Â Â Â := s3c24xx
> +machine-$(CONFIG_ARCH_VERSATILE) Â Â Â := versatile
>
> Â# Board directory name. ÂThis list is sorted alphanumerically
> Â# by CONFIG_* macro name.
> @@ -80,6 +81,7 @@ board-$(CONFIG_MACH_PCM043) Â Â Â Â Â Â Â Â Â := pcm043
> Âboard-$(CONFIG_MACH_PM9263) Â Â Â Â Â Â Â Â Â Â:= pm9263
> Âboard-$(CONFIG_MACH_SCB9328) Â Â Â Â Â Â Â Â Â := scb9328
> Âboard-$(CONFIG_MACH_NESO) Â Â Â Â Â Â Â Â Â Â Â:= guf-neso
> +board-$(CONFIG_MACH_VERSATILEPB) Â Â Â Â Â Â Â := versatile
>
> Âmachdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
>
> diff --git a/arch/arm/boards/versatile/Kconfig b/arch/arm/boards/versatile/Kconfig
> new file mode 100644
> index 0000000..9156d9c
> --- /dev/null
> +++ b/arch/arm/boards/versatile/Kconfig
> @@ -0,0 +1,18 @@
> +
> +if MACH_VERSATILEPB
> +
> +config ARCH_TEXT_BASE
> + Â Â Â hex
> + Â Â Â default 0
> +
> +config BOARDINFO
> + Â Â Â default "ARM Versatile/PB (ARM926EJ-S)"
> +endif
> +
> +config VERSATILE_SMC91C111
> + Â Â Â bool "Use smc91c111 instead of smc91x (for QEMU)"
> + Â Â Â help
> + Â Â Â ÂEnable this option to run barebox inside qemu.
> + Â Â Â ÂReal versatile boards are equipped with smc911x,
> + Â Â Â Âbut qemu only provides smc91c111, which is a bit different.
> +
> diff --git a/arch/arm/boards/versatile/Makefile b/arch/arm/boards/versatile/Makefile
> new file mode 100644
> index 0000000..a17aed3
> --- /dev/null
> +++ b/arch/arm/boards/versatile/Makefile
> @@ -0,0 +1,2 @@
> +
> +obj-$(CONFIG_MACH_VERSATILEPB) += versatilepb.o
> diff --git a/arch/arm/boards/versatile/config.h b/arch/arm/boards/versatile/config.h
> new file mode 100644
> index 0000000..25bb18f
> --- /dev/null
> +++ b/arch/arm/boards/versatile/config.h
> @@ -0,0 +1,5 @@
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +#endif /* __CONFIG_H */
> diff --git a/arch/arm/boards/versatile/env/bin/init b/arch/arm/boards/versatile/env/bin/init
> new file mode 100644
> index 0000000..224a6b4
> --- /dev/null
> +++ b/arch/arm/boards/versatile/env/bin/init
> @@ -0,0 +1 @@
> +# Dummy Init environment script
> diff --git a/arch/arm/boards/versatile/versatilepb.c b/arch/arm/boards/versatile/versatilepb.c
> new file mode 100644
> index 0000000..57e4991
> --- /dev/null
> +++ b/arch/arm/boards/versatile/versatilepb.c
> @@ -0,0 +1,56 @@
> +/*
> + * 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
> + *
> + */
> +
> +#include <common.h>
> +#include <init.h>
> +#include <asm/armlinux.h>
> +#include <generated/mach-types.h>
> +#include <mach/init.h>
> +#include <mach/platform.h>
> +
> +static int vpb_console_init(void)
> +{
> + Â Â Â versatile_register_uart(0);
> + Â Â Â return 0;
> +}
> +
> +console_initcall(vpb_console_init);
> +
> +static struct device_d smc911x_dev = {
> +    .id       = -1,
> +#ifdef CONFIG_VERSATILE_SMC91C111
> +    .name      = "smc91c111",
> +#else
> +    .name      = "smc911x",
> +#endif
> +    .map_base    = VERSATILE_ETH_BASE,
> +    .size      = 64 * 1024
> +};
> +
> +static int vpb_devices_init(void)
> +{
> + Â Â Â versatile_add_sdram(64 * 1024 *1024);
> +
> + Â Â Â register_device(&smc911x_dev);
> +
> + Â Â Â armlinux_set_architecture(MACH_TYPE_VERSATILE_PB);
> + Â Â Â armlinux_set_bootparams((void *)(0x00000100));
> +
> + Â Â Â return 0;
> +}
> +device_initcall(vpb_devices_init);
> diff --git a/arch/arm/configs/versatilepb_defconfig b/arch/arm/configs/versatilepb_defconfig
> new file mode 100644
> index 0000000..f505ac6
> --- /dev/null
> +++ b/arch/arm/configs/versatilepb_defconfig
> @@ -0,0 +1,12 @@
> +
> +CONFIG_ARCH_VERSATILE=y
> +CONFIG_MACH_VERSATILEPB=y
> +
> +CONFIG_TEXT_BASE=0x500000
> +CONFIG_HAVE_CONFIGURABLE_MEMORY_LAYOUT=y
> +CONFIG_MEMORY_LAYOUT_DEFAULT=y
> +CONFIG_PROMPT="versatilepb> "
> +CONFIG_DEFAULT_ENVIRONMENT=y
> +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/versatile/env"
> +CONFIG_SERIAL_AMBA_PL011=y
> +CONFIG_DRIVER_NET_SMC911X=y
> diff --git a/arch/arm/include/asm/arm_timer.h b/arch/arm/include/asm/arm_timer.h
> new file mode 100644
> index 0000000..0433279
> --- /dev/null
> +++ b/arch/arm/include/asm/arm_timer.h
> @@ -0,0 +1,33 @@
> +#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
> +#define __ASM_ARM_HARDWARE_ARM_TIMER_H
> +
> +/*
> + * From Linux v2.6.35
> + * arch/arm/include/asm/hardware/arm_timer.h
> + *
> + * ARM timer implementation, found in Integrator, Versatile and Realview
> + * platforms. ÂNot all platforms support all registers and bits in these
> + * registers, so we mark them with A for Integrator AP, C for Integrator
> + * CP, V for Versatile and R for Realview.
> + *
> + * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
> + * can have 16-bit or 32-bit selectable via a bit in the control register.
> + */
> +#define TIMER_LOAD Â Â 0x00 Â Â Â Â Â Â Â Â Â Â/* ACVR rw */
> +#define TIMER_VALUE Â Â0x04 Â Â Â Â Â Â Â Â Â Â/* ACVR ro */
> +#define TIMER_CTRL Â Â 0x08 Â Â Â Â Â Â Â Â Â Â/* ACVR rw */
> +#define TIMER_CTRL_ONESHOT Â Â (1 << 0) Â Â Â Â/* ÂCVR */
> +#define TIMER_CTRL_32BIT Â Â Â (1 << 1) Â Â Â Â/* ÂCVR */
> +#define TIMER_CTRL_DIV1 Â Â Â Â Â Â Â Â(0 << 2) Â Â Â Â/* ACVR */
> +#define TIMER_CTRL_DIV16 Â Â Â (1 << 2) Â Â Â Â/* ACVR */
> +#define TIMER_CTRL_DIV256 Â Â Â(2 << 2) Â Â Â Â/* ACVR */
> +#define TIMER_CTRL_IE Â Â Â Â Â(1 << 5) Â Â Â Â/* Â VR */
> +#define TIMER_CTRL_PERIODIC Â Â(1 << 6) Â Â Â Â/* ACVR */
> +#define TIMER_CTRL_ENABLE Â Â Â(1 << 7) Â Â Â Â/* ACVR */
> +
> +#define TIMER_INTCLR  0x0c          Â/* ACVR wo */
> +#define TIMER_RIS Â Â Â0x10 Â Â Â Â Â Â Â Â Â Â/* ÂCVR ro */
> +#define TIMER_MIS Â Â Â0x14 Â Â Â Â Â Â Â Â Â Â/* ÂCVR ro */
> +#define TIMER_BGLOAD Â 0x18 Â Â Â Â Â Â Â Â Â Â/* ÂCVR rw */
> +
> +#endif
> diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
> new file mode 100644
> index 0000000..9a1bf95
> --- /dev/null
> +++ b/arch/arm/mach-versatile/Kconfig
> @@ -0,0 +1,16 @@
> +
> +if ARCH_VERSATILE
> +
> +choice
> + Â Â Â prompt "ARM Board type"
> +
> +config MACH_VERSATILEPB
> + Â Â Â bool "ARM Versatile/PB (ARM926EJ-S)"
> + Â Â Â select ARM_AMBA
> + Â Â Â select CLKDEV_LOOKUP
> +
> +endchoice
> +
> +source arch/arm/boards/versatile/Kconfig
> +
> +endif
> diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile
> new file mode 100644
> index 0000000..a8da54c
> --- /dev/null
> +++ b/arch/arm/mach-versatile/Makefile
> @@ -0,0 +1,2 @@
> +
> +obj-y += core.o
> diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
> new file mode 100644
> index 0000000..94543c6
> --- /dev/null
> +++ b/arch/arm/mach-versatile/core.c
> @@ -0,0 +1,212 @@
> +/*
> + * Copyright (C) 2010 B Labs Ltd,
> + * http://l4dev.org
> + * Author: Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx>
> + *
> + * Based on mach-nomadik
> + * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnio@xxxxxxxxxxxx>
> + *
> + * 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; version 2 of
> + * the License.
> + *
> + * 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
> + *
> + */
> +
> +#include <common.h>
> +#include <init.h>
> +#include <clock.h>
> +#include <debug_ll.h>
> +
> +#include <linux/clkdev.h>
> +#include <linux/clk.h>
> +#include <linux/err.h>
> +
> +#include <asm/io.h>
> +#include <asm/arm_timer.h>
> +#include <asm/armlinux.h>
> +
> +#include <mach/platform.h>
> +#include <mach/init.h>
> +
> +static struct memory_platform_data ram_pdata = {
> + Â Â Â .name = "ram0",
> + Â Â Â .flags = DEVFS_RDWR,
> +};
> +
> +static struct device_d sdram_dev = {
> + Â Â Â .id = -1,
> + Â Â Â .name = "mem",
> + Â Â Â .map_base = 0x00000000,
> + Â Â Â .platform_data = &ram_pdata,
> +};
> +
> +void versatile_add_sdram(u32 size)
> +{
> + Â Â Â sdram_dev.size = size;
> + Â Â Â register_device(&sdram_dev);
> + Â Â Â armlinux_add_dram(&sdram_dev);
> +}
> +
> +static struct device_d uart0_serial_device = {
> + Â Â Â .id = 0,
> + Â Â Â .name = "uart-pl011",
> + Â Â Â .map_base = VERSATILE_UART0_BASE,
> + Â Â Â .size = 4096,
> +};
> +
> +static struct device_d uart1_serial_device = {
> + Â Â Â .id = 1,
> + Â Â Â .name = "uart-pl011",
> + Â Â Â .map_base = VERSATILE_UART1_BASE,
> + Â Â Â .size = 4096,
> +};
> +
> +static struct device_d uart2_serial_device = {
> + Â Â Â .id = 2,
> + Â Â Â .name = "uart-pl011",
> + Â Â Â .map_base = VERSATILE_UART2_BASE,
> + Â Â Â .size = 4096,
> +};
> +static struct device_d uart3_serial_device = {
> + Â Â Â .id = 3,
> + Â Â Â .name = "uart-pl011",
> + Â Â Â .map_base = VERSATILE_UART3_BASE,
> + Â Â Â .size = 4096,
> +};
> +
> +struct clk {
> + Â Â Â unsigned long rate;
> +};
> +
> +static struct clk ref_clk_24 = {
> + Â Â Â .rate = 24000000,
> +};
> +
> +unsigned long clk_get_rate(struct clk *clk)
> +{
> + Â Â Â return clk->rate;
> +}
> +EXPORT_SYMBOL(clk_get_rate);
> +
> +/* enable and disable do nothing */
> +int clk_enable(struct clk *clk)
> +{
> + Â Â Â return 0;
> +}
> +EXPORT_SYMBOL(clk_enable);
> +
> +void clk_disable(struct clk *clk)
> +{
> +}
> +EXPORT_SYMBOL(clk_disable);
> +
> +/* Create a clock structure with the given name */
> +int vpb_clk_create(struct clk *clk, const char *dev_id)
> +{
> + Â Â Â struct clk_lookup *clkdev;
> +
> + Â Â Â clkdev = clkdev_alloc(clk, NULL, dev_id);
> + Â Â Â if (!clkdev)
> + Â Â Â Â Â Â Â return -ENOMEM;
> +
> + Â Â Â clkdev_add(clkdev);
> + Â Â Â return 0;
> +}
> +
> +/* 1Mhz / 256 */
> +#define TIMER_FREQ (1000000/256)
> +
> +#define TIMER0_BASE (VERSATILE_TIMER0_1_BASE)
> +#define TIMER1_BASE ((VERSATILE_TIMER0_1_BASE) + 0x20)
> +#define TIMER2_BASE (VERSATILE_TIMER2_3_BASE)
> +#define TIMER3_BASE ((VERSATILE_TIMER2_3_BASE) + 0x20)
> +
> +static uint64_t vpb_clocksource_read(void)
> +{
> + Â Â Â return ~readl(TIMER0_BASE + TIMER_VALUE);
> +}
> +
> +static struct clocksource vpb_cs = {
> + Â Â Â .read = vpb_clocksource_read,
> + Â Â Â .mask = 0xffffffff,
> + Â Â Â .shift = 10,
> +};
> +
> +/* From Linux v2.6.35
> + * arch/arm/mach-versatile/core.c */
> +static void versatile_timer_init (void)
> +{
> + Â Â Â u32 val;
> +
> + Â Â Â /*
> + Â Â Â Â* set clock frequency:
> + Â Â Â Â* Â Â ÂVERSATILE_REFCLK is 32KHz
> + Â Â Â Â* Â Â ÂVERSATILE_TIMCLK is 1MHz
> + Â Â Â Â*/
> +
> + Â Â Â val = readl(VERSATILE_SCTL_BASE);
> + Â Â Â val |= (VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel);
> + Â Â Â writel(val, VERSATILE_SCTL_BASE);
> +
> + Â Â Â /*
> + Â Â Â Â* Disable all timers, just to be sure.
> + Â Â Â Â*/
> +
> + Â Â Â writel(0, TIMER0_BASE + TIMER_CTRL);
> + Â Â Â writel(0, TIMER1_BASE + TIMER_CTRL);
> + Â Â Â writel(0, TIMER2_BASE + TIMER_CTRL);
> + Â Â Â writel(0, TIMER3_BASE + TIMER_CTRL);
> +
> + Â Â Â Âwritel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_DIV256,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â TIMER0_BASE + TIMER_CTRL);
> +}
> +
> +static int vpb_clocksource_init(void)
> +{
> + Â Â Â versatile_timer_init();
> + Â Â Â vpb_cs.mult = clocksource_hz2mult(TIMER_FREQ, vpb_cs.shift);
> +
> + Â Â Â return init_clock(&vpb_cs);
> +}
> +
> +core_initcall(vpb_clocksource_init);
> +
> +void versatile_register_uart(unsigned id)
> +{
> + Â Â Â switch (id) {
> + Â Â Â case 0:
> + Â Â Â Â Â Â Â vpb_clk_create(&ref_clk_24, dev_name(&uart0_serial_device));
> + Â Â Â Â Â Â Â register_device(&uart0_serial_device);
> + Â Â Â Â Â Â Â break;
> + Â Â Â case 1:
> + Â Â Â Â Â Â Â vpb_clk_create(&ref_clk_24, dev_name(&uart1_serial_device));
> + Â Â Â Â Â Â Â register_device(&uart1_serial_device);
> + Â Â Â Â Â Â Â break;
> + Â Â Â case 2:
> + Â Â Â Â Â Â Â vpb_clk_create(&ref_clk_24, dev_name(&uart2_serial_device));
> + Â Â Â Â Â Â Â register_device(&uart2_serial_device);
> + Â Â Â Â Â Â Â break;
> + Â Â Â case 3:
> + Â Â Â Â Â Â Â vpb_clk_create(&ref_clk_24, dev_name(&uart3_serial_device));
> + Â Â Â Â Â Â Â register_device(&uart3_serial_device);
> + Â Â Â Â Â Â Â break;
> + Â Â Â }
> +}
> +
> +void __noreturn reset_cpu (unsigned long ignored)
> +{
> + Â Â Â while (1);
> +}
> +EXPORT_SYMBOL(reset_cpu);
> +
> diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h
> new file mode 100644
> index 0000000..04b37a8
> --- /dev/null
> +++ b/arch/arm/mach-versatile/include/mach/clkdev.h
> @@ -0,0 +1,7 @@
> +#ifndef __ASM_MACH_CLKDEV_H
> +#define __ASM_MACH_CLKDEV_H
> +
> +#define __clk_get(clk) ({ 1; })
> +#define __clk_put(clk) do { } while (0)
> +
> +#endif
> diff --git a/arch/arm/mach-versatile/include/mach/debug_ll.h b/arch/arm/mach-versatile/include/mach/debug_ll.h
> new file mode 100644
> index 0000000..514fcfb
> --- /dev/null
> +++ b/arch/arm/mach-versatile/include/mach/debug_ll.h
> @@ -0,0 +1,37 @@
> +/*
> + * Copyright (C) 2010 B Labs Ltd
> + * Author: Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx>
> + *
> + * barebox 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 3 of the License, or
> + * (at your option) any later version.
> + *
> + * barebox 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 barebox. ÂIf not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef __MACH_DEBUG_LL_H__
> +#define  __MACH_DEBUG_LL_H__
> +
> +#include <linux/amba/serial.h>
> +#include <asm/io.h>
> +
> +static inline void putc(char c)
> +{
> + Â Â Â /* Wait until there is space in the FIFO */
> + Â Â Â while (readl(0x101F1000 + UART01x_FR) & UART01x_FR_TXFF);
> +
> + Â Â Â /* Send the character */
> + Â Â Â writel(c, 0x101F1000 + UART01x_DR);
> +
> + Â Â Â /* Wait to make sure it hits the line, in case we die too soon. */
> + Â Â Â while (readl(0x101F1000 + UART01x_FR) & UART01x_FR_TXFF);
> +}
> +
> +#endif
> diff --git a/arch/arm/mach-versatile/include/mach/init.h b/arch/arm/mach-versatile/include/mach/init.h
> new file mode 100644
> index 0000000..878cde0
> --- /dev/null
> +++ b/arch/arm/mach-versatile/include/mach/init.h
> @@ -0,0 +1,8 @@
> +
> +#ifndef __VERSATILE_INIT_H__
> +#define __VERSATILE_INIT_H__
> +
> +void versatile_add_sdram(u32 size);
> +void versatile_register_uart(unsigned id);
> +
> +#endif
> diff --git a/arch/arm/mach-versatile/include/mach/platform.h b/arch/arm/mach-versatile/include/mach/platform.h
> new file mode 100644
> index 0000000..88b8032
> --- /dev/null
> +++ b/arch/arm/mach-versatile/include/mach/platform.h
> @@ -0,0 +1,417 @@
> +/*
> + * ach-arm926ejs/include/mach/platform.h
> + *
> + * Borrowed from Linux v2.6.35
> + * arch/arm/mach-versatile/include/mach/platform.h
> + *
> + * Copyright (c) ARM Limited 2003. ÂAll rights reserved.
> + *
> + * 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
> + */
> +
> +#ifndef __address_h
> +#define __address_h           1
> +
> +/*
> + * Memory definitions
> + */
> +#define VERSATILE_BOOT_ROM_LO Â Â Â Â Â0x30000000 Â Â Â Â Â Â Â/* DoC Base (64Mb)...*/
> +#define VERSATILE_BOOT_ROM_HI Â Â Â Â Â0x30000000
> +#define VERSATILE_BOOT_ROM_BASE Â Â Â ÂVERSATILE_BOOT_ROM_HI Â Â/* ÂNormal position */
> +#define VERSATILE_BOOT_ROM_SIZE Â Â Â ÂSZ_64M
> +
> +#define VERSATILE_SSRAM_BASE Â Â Â Â Â /* VERSATILE_SSMC_BASE ? */
> +#define VERSATILE_SSRAM_SIZE Â Â Â Â Â SZ_2M
> +
> +#define VERSATILE_FLASH_BASE Â Â Â Â Â 0x34000000
> +#define VERSATILE_FLASH_SIZE Â Â Â Â Â SZ_64M
> +
> +/*
> + * ÂSDRAM
> + */
> +#define VERSATILE_SDRAM_BASE Â Â Â Â Â 0x00000000
> +
> +/*
> + * ÂLogic expansion modules
> + *
> + */
> +
> +
> +/* ------------------------------------------------------------------------
> + * ÂVersatile Registers
> + * ------------------------------------------------------------------------
> + *
> + */
> +#define VERSATILE_SYS_ID_OFFSET Â Â Â Â Â Â Â 0x00
> +#define VERSATILE_SYS_SW_OFFSET Â Â Â Â Â Â Â 0x04
> +#define VERSATILE_SYS_LED_OFFSET Â Â Â Â Â Â Â0x08
> +#define VERSATILE_SYS_OSC0_OFFSET Â Â Â Â Â Â 0x0C
> +
> +#if defined(CONFIG_ARCH_VERSATILE_PB)
> +#define VERSATILE_SYS_OSC1_OFFSET Â Â Â Â Â Â 0x10
> +#define VERSATILE_SYS_OSC2_OFFSET Â Â Â Â Â Â 0x14
> +#define VERSATILE_SYS_OSC3_OFFSET Â Â Â Â Â Â 0x18
> +#define VERSATILE_SYS_OSC4_OFFSET Â Â Â Â Â Â 0x1C
> +#elif defined(CONFIG_MACH_VERSATILE_AB)
> +#define VERSATILE_SYS_OSC1_OFFSET Â Â Â Â Â Â 0x1C
> +#endif
> +
> +#define VERSATILE_SYS_OSCCLCD_OFFSET Â Â Â Â Â0x1c
> +
> +#define VERSATILE_SYS_LOCK_OFFSET Â Â Â Â Â Â 0x20
> +#define VERSATILE_SYS_100HZ_OFFSET Â Â Â Â Â Â0x24
> +#define VERSATILE_SYS_CFGDATA1_OFFSET Â Â Â Â 0x28
> +#define VERSATILE_SYS_CFGDATA2_OFFSET Â Â Â Â 0x2C
> +#define VERSATILE_SYS_FLAGS_OFFSET Â Â Â Â Â Â0x30
> +#define VERSATILE_SYS_FLAGSSET_OFFSET Â Â Â Â 0x30
> +#define VERSATILE_SYS_FLAGSCLR_OFFSET Â Â Â Â 0x34
> +#define VERSATILE_SYS_NVFLAGS_OFFSET Â Â Â Â Â0x38
> +#define VERSATILE_SYS_NVFLAGSSET_OFFSET Â Â Â 0x38
> +#define VERSATILE_SYS_NVFLAGSCLR_OFFSET Â Â Â 0x3C
> +#define VERSATILE_SYS_RESETCTL_OFFSET Â Â Â Â 0x40
> +#define VERSATILE_SYS_PCICTL_OFFSET Â Â Â Â Â 0x44
> +#define VERSATILE_SYS_MCI_OFFSET Â Â Â Â Â Â Â0x48
> +#define VERSATILE_SYS_FLASH_OFFSET Â Â Â Â Â Â0x4C
> +#define VERSATILE_SYS_CLCD_OFFSET Â Â Â Â Â Â 0x50
> +#define VERSATILE_SYS_CLCDSER_OFFSET Â Â Â Â Â0x54
> +#define VERSATILE_SYS_BOOTCS_OFFSET Â Â Â Â Â 0x58
> +#define VERSATILE_SYS_24MHz_OFFSET Â Â Â Â Â Â0x5C
> +#define VERSATILE_SYS_MISC_OFFSET Â Â Â Â Â Â 0x60
> +#define VERSATILE_SYS_TEST_OSC0_OFFSET Â Â Â Â0x80
> +#define VERSATILE_SYS_TEST_OSC1_OFFSET Â Â Â Â0x84
> +#define VERSATILE_SYS_TEST_OSC2_OFFSET Â Â Â Â0x88
> +#define VERSATILE_SYS_TEST_OSC3_OFFSET Â Â Â Â0x8C
> +#define VERSATILE_SYS_TEST_OSC4_OFFSET Â Â Â Â0x90
> +
> +#define VERSATILE_SYS_BASE Â Â Â Â Â Â Â Â Â Â0x10000000
> +#define VERSATILE_SYS_ID Â Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_ID_OFFSET)
> +#define VERSATILE_SYS_SW Â Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_SW_OFFSET)
> +#define VERSATILE_SYS_LED Â Â Â Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET)
> +#define VERSATILE_SYS_OSC0 Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_OSC0_OFFSET)
> +#define VERSATILE_SYS_OSC1 Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_OSC1_OFFSET)
> +
> +#if defined(CONFIG_ARCH_VERSATILE_PB)
> +#define VERSATILE_SYS_OSC2 Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_OSC2_OFFSET)
> +#define VERSATILE_SYS_OSC3 Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_OSC3_OFFSET)
> +#define VERSATILE_SYS_OSC4 Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_OSC4_OFFSET)
> +#endif
> +
> +#define VERSATILE_SYS_LOCK Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_LOCK_OFFSET)
> +#define VERSATILE_SYS_100HZ Â Â Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_100HZ_OFFSET)
> +#define VERSATILE_SYS_CFGDATA1 Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_CFGDATA1_OFFSET)
> +#define VERSATILE_SYS_CFGDATA2 Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_CFGDATA2_OFFSET)
> +#define VERSATILE_SYS_FLAGS Â Â Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGS_OFFSET)
> +#define VERSATILE_SYS_FLAGSSET Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGSSET_OFFSET)
> +#define VERSATILE_SYS_FLAGSCLR Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGSCLR_OFFSET)
> +#define VERSATILE_SYS_NVFLAGS Â Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGS_OFFSET)
> +#define VERSATILE_SYS_NVFLAGSSET Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSSET_OFFSET)
> +#define VERSATILE_SYS_NVFLAGSCLR Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSCLR_OFFSET)
> +#define VERSATILE_SYS_RESETCTL Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_RESETCTL_OFFSET)
> +#define VERSATILE_SYS_PCICTL Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_PCICTL_OFFSET)
> +#define VERSATILE_SYS_MCI Â Â Â Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_MCI_OFFSET)
> +#define VERSATILE_SYS_FLASH Â Â Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_FLASH_OFFSET)
> +#define VERSATILE_SYS_CLCD Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_CLCD_OFFSET)
> +#define VERSATILE_SYS_CLCDSER Â Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_CLCDSER_OFFSET)
> +#define VERSATILE_SYS_BOOTCS Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_BOOTCS_OFFSET)
> +#define VERSATILE_SYS_24MHz          (VERSATILE_SYS_BASE + VERSATILE_SYS_24MHz_OFFSET)
> +#define VERSATILE_SYS_MISC Â Â Â Â Â Â Â Â Â Â(VERSATILE_SYS_BASE + VERSATILE_SYS_MISC_OFFSET)
> +#define VERSATILE_SYS_TEST_OSC0 Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC0_OFFSET)
> +#define VERSATILE_SYS_TEST_OSC1 Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC1_OFFSET)
> +#define VERSATILE_SYS_TEST_OSC2 Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC2_OFFSET)
> +#define VERSATILE_SYS_TEST_OSC3 Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC3_OFFSET)
> +#define VERSATILE_SYS_TEST_OSC4 Â Â Â Â Â Â Â (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC4_OFFSET)
> +
> +/*
> + * Values for VERSATILE_SYS_RESET_CTRL
> + */
> +#define VERSATILE_SYS_CTRL_RESET_CONFIGCLR Â Â0x01
> +#define VERSATILE_SYS_CTRL_RESET_CONFIGINIT Â 0x02
> +#define VERSATILE_SYS_CTRL_RESET_DLLRESET Â Â 0x03
> +#define VERSATILE_SYS_CTRL_RESET_PLLRESET Â Â 0x04
> +#define VERSATILE_SYS_CTRL_RESET_POR Â Â Â Â Â0x05
> +#define VERSATILE_SYS_CTRL_RESET_DoC Â Â Â Â Â0x06
> +
> +#define VERSATILE_SYS_CTRL_LED Â Â Â Â (1 << 0)
> +
> +
> +/* ------------------------------------------------------------------------
> + * ÂVersatile control registers
> + * ------------------------------------------------------------------------
> + */
> +
> +/*
> + * VERSATILE_IDFIELD
> + *
> + * 31:24 = manufacturer (0x41 = ARM)
> + * 23:16 = architecture (0x08 = AHB system bus, ASB processor bus)
> + * 15:12 = FPGA (0x3 = XVC600 or XVC600E)
> + * 11:4 Â= build value
> + * 3:0 Â = revision number (0x1 = rev B (AHB))
> + */
> +
> +/*
> + * VERSATILE_SYS_LOCK
> + * Â Â control access to SYS_OSCx, SYS_CFGDATAx, SYS_RESETCTL,
> + * Â Â SYS_CLD, SYS_BOOTCS
> + */
> +#define VERSATILE_SYS_LOCK_LOCKED Â Â(1 << 16)
> +#define VERSATILE_SYS_LOCKVAL_MASK Â Â 0xFFFF Â Â Â Â Â/* write 0xA05F to enable write access */
> +
> +/*
> + * VERSATILE_SYS_FLASH
> + */
> +#define VERSATILE_FLASHPROG_FLVPPEN Â Â(1 << 0) Â Â Â Â/* Enable writing to flash */
> +
> +/*
> + * VERSATILE_INTREG
> + * Â Â - used to acknowledge and control MMCI and UART interrupts
> + */
> +#define VERSATILE_INTREG_WPROT Â Â Â Â0x00 Â Â/* MMC protection status (no interrupt generated) */
> +#define VERSATILE_INTREG_RI0 Â Â Â Â Â0x01 Â Â/* Ring indicator UART0 is asserted, Â Â Â Â Â Â Â*/
> +#define VERSATILE_INTREG_CARDIN    0x08  Â/* MMCI card in detect              Â*/
> +                        Â/* write 1 to acknowledge and clear        */
> +#define VERSATILE_INTREG_RI1 Â Â Â Â Â0x02 Â Â/* Ring indicator UART1 is asserted, Â Â Â Â Â Â Â*/
> +#define VERSATILE_INTREG_CARDINSERT  0x03  Â/* Signal insertion of MMC card          */
> +
> +/*
> + * VERSATILE peripheral addresses
> + */
> +#define VERSATILE_PCI_CORE_BASE Â Â Â Â0x10001000 Â Â Â/* PCI core control */
> +#define VERSATILE_I2C_BASE Â Â Â Â Â Â 0x10002000 Â Â Â/* I2C control */
> +#define VERSATILE_SIC_BASE Â Â Â Â Â Â 0x10003000 Â Â Â/* Secondary interrupt controller */
> +#define VERSATILE_AACI_BASE Â Â Â Â Â Â0x10004000 Â Â Â/* Audio */
> +#define VERSATILE_MMCI0_BASE Â Â Â Â Â 0x10005000 Â Â Â/* MMC interface */
> +#define VERSATILE_KMI0_BASE Â Â Â Â Â Â0x10006000 Â Â Â/* KMI interface */
> +#define VERSATILE_KMI1_BASE Â Â Â Â Â Â0x10007000 Â Â Â/* KMI 2nd interface */
> +#define VERSATILE_CHAR_LCD_BASE Â Â Â Â0x10008000 Â Â Â/* Character LCD */
> +#define VERSATILE_UART3_BASE Â Â Â Â Â 0x10009000 Â Â Â/* UART 3 */
> +#define VERSATILE_SCI1_BASE Â Â Â Â Â Â0x1000A000
> +#define VERSATILE_MMCI1_BASE Â Â Â Â Â 0x1000B000 Â Â/* MMC Interface */
> + Â Â Â /* 0x1000C000 - 0x1000CFFF = reserved */
> +#define VERSATILE_ETH_BASE Â Â Â Â Â Â 0x10010000 Â Â Â/* Ethernet */
> +#define VERSATILE_USB_BASE Â Â Â Â Â Â 0x10020000 Â Â Â/* USB */
> + Â Â Â /* 0x10030000 - 0x100FFFFF = reserved */
> +#define VERSATILE_SMC_BASE Â Â Â Â Â Â 0x10100000 Â Â Â/* SMC */
> +#define VERSATILE_MPMC_BASE Â Â Â Â Â Â0x10110000 Â Â Â/* MPMC */
> +#define VERSATILE_CLCD_BASE Â Â Â Â Â Â0x10120000 Â Â Â/* CLCD */
> +#define VERSATILE_DMAC_BASE Â Â Â Â Â Â0x10130000 Â Â Â/* DMA controller */
> +#define VERSATILE_VIC_BASE Â Â Â Â Â Â 0x10140000 Â Â Â/* Vectored interrupt controller */
> +#define VERSATILE_PERIPH_BASE Â Â Â Â Â0x10150000 Â Â Â/* off-chip peripherals alias from */
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â/* 0x10000000 - 0x100FFFFF */
> +#define VERSATILE_AHBM_BASE Â Â Â Â Â Â0x101D0000 Â Â Â/* AHB monitor */
> +#define VERSATILE_SCTL_BASE Â Â Â Â Â Â0x101E0000 Â Â Â/* System controller */
> +#define VERSATILE_WATCHDOG_BASE Â Â Â Â0x101E1000 Â Â Â/* Watchdog */
> +#define VERSATILE_TIMER0_1_BASE Â Â Â Â0x101E2000 Â Â Â/* Timer 0 and 1 */
> +#define VERSATILE_TIMER2_3_BASE Â Â Â Â0x101E3000 Â Â Â/* Timer 2 and 3 */
> +#define VERSATILE_GPIO0_BASE Â Â Â Â Â 0x101E4000 Â Â Â/* GPIO port 0 */
> +#define VERSATILE_GPIO1_BASE Â Â Â Â Â 0x101E5000 Â Â Â/* GPIO port 1 */
> +#define VERSATILE_GPIO2_BASE Â Â Â Â Â 0x101E6000 Â Â Â/* GPIO port 2 */
> +#define VERSATILE_GPIO3_BASE Â Â Â Â Â 0x101E7000 Â Â Â/* GPIO port 3 */
> +#define VERSATILE_RTC_BASE Â Â Â Â Â Â 0x101E8000 Â Â Â/* Real Time Clock */
> + Â Â Â /* 0x101E9000 - reserved */
> +#define VERSATILE_SCI_BASE Â Â Â Â Â Â 0x101F0000 Â Â Â/* Smart card controller */
> +#define VERSATILE_UART0_BASE Â Â Â Â Â 0x101F1000 Â Â Â/* Uart 0 */
> +#define VERSATILE_UART1_BASE Â Â Â Â Â 0x101F2000 Â Â Â/* Uart 1 */
> +#define VERSATILE_UART2_BASE Â Â Â Â Â 0x101F3000 Â Â Â/* Uart 2 */
> +#define VERSATILE_SSP_BASE Â Â Â Â Â Â 0x101F4000 Â Â Â/* Synchronous Serial Port */
> +
> +#define VERSATILE_SSMC_BASE Â Â Â Â Â Â0x20000000 Â Â Â/* SSMC */
> +#define VERSATILE_IB2_BASE Â Â Â Â Â Â 0x24000000 Â Â Â/* IB2 module */
> +#define VERSATILE_MBX_BASE Â Â Â Â Â Â 0x40000000 Â Â Â/* MBX */
> +
> +/* PCI space */
> +#define VERSATILE_PCI_BASE Â Â Â Â Â Â 0x41000000 Â Â Â/* PCI Interface */
> +#define VERSATILE_PCI_CFG_BASE Â Â Â Â0x42000000
> +#define VERSATILE_PCI_MEM_BASE0 Â Â Â Â0x44000000
> +#define VERSATILE_PCI_MEM_BASE1 Â Â Â Â0x50000000
> +#define VERSATILE_PCI_MEM_BASE2 Â Â Â Â0x60000000
> +/* Sizes of above maps */
> +#define VERSATILE_PCI_BASE_SIZE Â Â Â Â Â Â Â 0x01000000
> +#define VERSATILE_PCI_CFG_BASE_SIZE Â Â0x02000000
> +#define VERSATILE_PCI_MEM_BASE0_SIZE Â 0x0c000000 Â Â Â/* 32Mb */
> +#define VERSATILE_PCI_MEM_BASE1_SIZE Â 0x10000000 Â Â Â/* 256Mb */
> +#define VERSATILE_PCI_MEM_BASE2_SIZE Â 0x10000000 Â Â Â/* 256Mb */
> +
> +#define VERSATILE_SDRAM67_BASE Â Â Â Â 0x70000000 Â Â Â/* SDRAM banks 6 and 7 */
> +#define VERSATILE_LT_BASE Â Â Â Â Â Â Â0x80000000 Â Â Â/* Logic Tile expansion */
> +
> +/*
> + * Disk on Chip
> + */
> +#define VERSATILE_DOC_BASE Â Â Â Â Â Â 0x2C000000
> +#define VERSATILE_DOC_SIZE Â Â Â Â Â Â (16 << 20)
> +#define VERSATILE_DOC_PAGE_SIZE Â Â Â Â512
> +#define VERSATILE_DOC_TOTAL_PAGES Â Â (DOC_SIZE / PAGE_SIZE)
> +
> +#define ERASE_UNIT_PAGES Â Â32
> +#define START_PAGE Â Â Â Â Â0x80
> +
> +/*
> + * ÂLED settings, bits [7:0]
> + */
> +#define VERSATILE_SYS_LED0 Â Â Â Â Â Â (1 << 0)
> +#define VERSATILE_SYS_LED1 Â Â Â Â Â Â (1 << 1)
> +#define VERSATILE_SYS_LED2 Â Â Â Â Â Â (1 << 2)
> +#define VERSATILE_SYS_LED3 Â Â Â Â Â Â (1 << 3)
> +#define VERSATILE_SYS_LED4 Â Â Â Â Â Â (1 << 4)
> +#define VERSATILE_SYS_LED5 Â Â Â Â Â Â (1 << 5)
> +#define VERSATILE_SYS_LED6 Â Â Â Â Â Â (1 << 6)
> +#define VERSATILE_SYS_LED7 Â Â Â Â Â Â (1 << 7)
> +
> +#define ALL_LEDS Â Â Â Â Â Â Â Â Â0xFF
> +
> +#define LED_BANK Â Â Â Â Â Â Â Â ÂVERSATILE_SYS_LED
> +
> +/*
> + * Control registers
> + */
> +#define VERSATILE_IDFIELD_OFFSET Â Â Â 0x0 Â Â /* Versatile build information */
> +#define VERSATILE_FLASHPROG_OFFSET Â Â 0x4 Â Â /* Flash devices */
> +#define VERSATILE_INTREG_OFFSET Â Â Â Â Â Â Â Â0x8 Â Â /* Interrupt control */
> +#define VERSATILE_DECODE_OFFSET Â Â Â Â Â Â Â Â0xC Â Â /* Fitted logic modules */
> +
> +
> +/* ------------------------------------------------------------------------
> + * ÂVersatile Interrupt Controller - control registers
> + * ------------------------------------------------------------------------
> + *
> + * ÂOffsets from interrupt controller base
> + *
> + * ÂSystem Controller interrupt controller base is
> + *
> + * Â Â VERSATILE_IC_BASE
> + *
> + * ÂCore Module interrupt controller base is
> + *
> + * Â Â VERSATILE_SYS_IC
> + *
> + */
> +/* VIC definitions in include/asm-arm/hardware/vic.h */
> +
> +#define SIC_IRQ_STATUS Â Â Â Â Â Â Â Â Â0
> +#define SIC_IRQ_RAW_STATUS Â Â Â Â Â Â Â0x04
> +#define SIC_IRQ_ENABLE Â Â Â Â Â Â Â Â Â0x08
> +#define SIC_IRQ_ENABLE_SET Â Â Â Â Â Â Â0x08
> +#define SIC_IRQ_ENABLE_CLEAR Â Â Â Â Â Â0x0C
> +#define SIC_INT_SOFT_SET Â Â Â Â Â Â Â Â0x10
> +#define SIC_INT_SOFT_CLEAR Â Â Â Â Â Â Â0x14
> +#define SIC_INT_PIC_ENABLE Â Â Â Â Â Â Â0x20 Â /* read status of pass through mask */
> +#define SIC_INT_PIC_ENABLES Â Â Â Â Â Â 0x20 Â /* set interrupt pass through bits */
> +#define SIC_INT_PIC_ENABLEC Â Â Â Â Â Â 0x24 Â /* Clear interrupt pass through bits */
> +
> +/* ------------------------------------------------------------------------
> + * ÂInterrupts - bit assignment (primary)
> + * ------------------------------------------------------------------------
> + */
> +
> +#define INT_WDOGINT Â Â Â Â Â Â Â Â Â Â 0 Â Â Â/* Watchdog timer */
> +#define INT_SOFTINT Â Â Â Â Â Â Â Â Â Â 1 Â Â Â/* Software interrupt */
> +#define INT_COMMRx           Â2   Â/* Debug Comm Rx interrupt */
> +#define INT_COMMTx           Â3   Â/* Debug Comm Tx interrupt */
> +#define INT_TIMERINT0_1 Â Â Â Â Â Â Â Â 4 Â Â Â/* Timer 0 and 1 */
> +#define INT_TIMERINT2_3 Â Â Â Â Â Â Â Â 5 Â Â Â/* Timer 2 and 3 */
> +#define INT_GPIOINT0 Â Â Â Â Â Â Â Â Â Â6 Â Â Â/* GPIO 0 */
> +#define INT_GPIOINT1 Â Â Â Â Â Â Â Â Â Â7 Â Â Â/* GPIO 1 */
> +#define INT_GPIOINT2 Â Â Â Â Â Â Â Â Â Â8 Â Â Â/* GPIO 2 */
> +#define INT_GPIOINT3 Â Â Â Â Â Â Â Â Â Â9 Â Â Â/* GPIO 3 */
> +#define INT_RTCINT Â Â Â Â Â Â Â Â Â Â Â10 Â Â /* Real Time Clock */
> +#define INT_SSPINT Â Â Â Â Â Â Â Â Â Â Â11 Â Â /* Synchronous Serial Port */
> +#define INT_UARTINT0 Â Â Â Â Â Â Â Â Â Â12 Â Â /* UART 0 on development chip */
> +#define INT_UARTINT1 Â Â Â Â Â Â Â Â Â Â13 Â Â /* UART 1 on development chip */
> +#define INT_UARTINT2 Â Â Â Â Â Â Â Â Â Â14 Â Â /* UART 2 on development chip */
> +#define INT_SCIINT Â Â Â Â Â Â Â Â Â Â Â15 Â Â /* Smart Card Interface */
> +#define INT_CLCDINT Â Â Â Â Â Â Â Â Â Â 16 Â Â /* CLCD controller */
> +#define INT_DMAINT Â Â Â Â Â Â Â Â Â Â Â17 Â Â /* DMA controller */
> +#define INT_PWRFAILINT Â Â Â Â Â Â Â Â Â18 Â Â /* Power failure */
> +#define INT_MBXINT Â Â Â Â Â Â Â Â Â Â Â19 Â Â /* Graphics processor */
> +#define INT_GNDINT Â Â Â Â Â Â Â Â Â Â Â20 Â Â /* Reserved */
> + Â Â Â /* External interrupt signals from logic tiles or secondary controller */
> +#define INT_VICSOURCE21 Â Â Â Â Â Â Â Â 21 Â Â /* Disk on Chip */
> +#define INT_VICSOURCE22 Â Â Â Â Â Â Â Â 22 Â Â /* MCI0A */
> +#define INT_VICSOURCE23 Â Â Â Â Â Â Â Â 23 Â Â /* MCI1A */
> +#define INT_VICSOURCE24 Â Â Â Â Â Â Â Â 24 Â Â /* AACI */
> +#define INT_VICSOURCE25 Â Â Â Â Â Â Â Â 25 Â Â /* Ethernet */
> +#define INT_VICSOURCE26 Â Â Â Â Â Â Â Â 26 Â Â /* USB */
> +#define INT_VICSOURCE27 Â Â Â Â Â Â Â Â 27 Â Â /* PCI 0 */
> +#define INT_VICSOURCE28 Â Â Â Â Â Â Â Â 28 Â Â /* PCI 1 */
> +#define INT_VICSOURCE29 Â Â Â Â Â Â Â Â 29 Â Â /* PCI 2 */
> +#define INT_VICSOURCE30 Â Â Â Â Â Â Â Â 30 Â Â /* PCI 3 */
> +#define INT_VICSOURCE31 Â Â Â Â Â Â Â Â 31 Â Â /* SIC source */
> +
> +#define VERSATILE_SC_VALID_INT Â Â Â Â Â Â Â 0x003FFFFF
> +
> +#define MAXIRQNUM Â Â Â Â Â Â Â Â Â Â Â 31
> +#define MAXFIQNUM Â Â Â Â Â Â Â Â Â Â Â 31
> +#define MAXSWINUM Â Â Â Â Â Â Â Â Â Â Â 31
> +
> +/* ------------------------------------------------------------------------
> + * ÂInterrupts - bit assignment (secondary)
> + * ------------------------------------------------------------------------
> + */
> +#define SIC_INT_MMCI0B Â Â Â Â Â Â Â Â Â1 Â Â Â/* Multimedia Card 0B */
> +#define SIC_INT_MMCI1B Â Â Â Â Â Â Â Â Â2 Â Â Â/* Multimedia Card 1B */
> +#define SIC_INT_KMI0 Â Â Â Â Â Â Â Â Â Â3 Â Â Â/* Keyboard/Mouse port 0 */
> +#define SIC_INT_KMI1 Â Â Â Â Â Â Â Â Â Â4 Â Â Â/* Keyboard/Mouse port 1 */
> +#define SIC_INT_SCI3 Â Â Â Â Â Â Â Â Â Â5 Â Â Â/* Smart Card interface */
> +#define SIC_INT_UART3 Â Â Â Â Â Â Â Â Â 6 Â Â Â/* UART 3 empty or data available */
> +#define SIC_INT_CLCD Â Â Â Â Â Â Â Â Â Â7 Â Â Â/* Character LCD */
> +#define SIC_INT_TOUCH Â Â Â Â Â Â Â Â Â 8 Â Â Â/* Touchscreen */
> +#define SIC_INT_KEYPAD Â Â Â Â Â Â Â Â Â9 Â Â Â/* Key pressed on display keypad */
> + Â Â Â /* 10:20 - reserved */
> +#define SIC_INT_DoC Â Â Â Â Â Â Â Â Â Â 21 Â Â /* Disk on Chip memory controller */
> +#define SIC_INT_MMCI0A Â Â Â Â Â Â Â Â Â22 Â Â /* MMC 0A */
> +#define SIC_INT_MMCI1A Â Â Â Â Â Â Â Â Â23 Â Â /* MMC 1A */
> +#define SIC_INT_AACI Â Â Â Â Â Â Â Â Â Â24 Â Â /* Audio Codec */
> +#define SIC_INT_ETH Â Â Â Â Â Â Â Â Â Â 25 Â Â /* Ethernet controller */
> +#define SIC_INT_USB Â Â Â Â Â Â Â Â Â Â 26 Â Â /* USB controller */
> +#define SIC_INT_PCI0 Â Â Â Â Â Â Â Â Â Â27
> +#define SIC_INT_PCI1 Â Â Â Â Â Â Â Â Â Â28
> +#define SIC_INT_PCI2 Â Â Â Â Â Â Â Â Â Â29
> +#define SIC_INT_PCI3 Â Â Â Â Â Â Â Â Â Â30
> +
> +
> +/*
> + * System controller bit assignment
> + */
> +#define VERSATILE_REFCLK Â Â Â 0
> +#define VERSATILE_TIMCLK Â Â Â 1
> +
> +#define VERSATILE_TIMER1_EnSel 15
> +#define VERSATILE_TIMER2_EnSel 17
> +#define VERSATILE_TIMER3_EnSel 19
> +#define VERSATILE_TIMER4_EnSel 21
> +
> +
> +#define VERSATILE_CSR_BASE Â Â Â Â Â Â 0x10000000
> +#define VERSATILE_CSR_SIZE Â Â Â Â Â Â 0x10000000
> +
> +#ifdef CONFIG_MACH_VERSATILE_AB
> +/*
> + * IB2 Versatile/AB expansion board definitions
> + */
> +#define VERSATILE_IB2_CAMERA_BANK Â Â ÂVERSATILE_IB2_BASE
> +#define VERSATILE_IB2_KBD_DATAREG Â Â Â(VERSATILE_IB2_BASE + 0x01000000)
> +
> +/* VICINTSOURCE27 */
> +#define VERSATILE_IB2_INT_BASE Â Â Â Â (VERSATILE_IB2_BASE + 0x02000000)
> +#define VERSATILE_IB2_IER Â Â Â Â Â Â Â(VERSATILE_IB2_INT_BASE + 0)
> +#define VERSATILE_IB2_ISR Â Â Â Â Â Â Â(VERSATILE_IB2_INT_BASE + 4)
> +
> +#define VERSATILE_IB2_CTL_BASE Â Â Â Â (VERSATILE_IB2_BASE + 0x03000000)
> +#define VERSATILE_IB2_CTRL Â Â Â Â Â Â (VERSATILE_IB2_CTL_BASE + 0)
> +#define VERSATILE_IB2_STAT Â Â Â Â Â Â (VERSATILE_IB2_CTL_BASE + 4)
> +#endif
> +
> +#endif
>
>

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux