Skip to content

Commit

Permalink
[PATCH] ARM: 2686/2: AAEC-2000 Core support
Browse files Browse the repository at this point in the history
Patch from Bellido Nicolas

Core support for AAEC-2000 based platforms.
This is an updated version of the previous patch, and takes
into account Russell's comments.
AAED-2000 default configuration will follow as soon
as some problems with the bootloader are sorted out...

Signed-off-by: Nicolas Bellido
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Bellido Nicolas authored and Russell King committed Jun 20, 2005
1 parent 09f0551 commit 038c5b6
Show file tree
Hide file tree
Showing 21 changed files with 794 additions and 1 deletion.
7 changes: 7 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ config ARCH_H720X
help
This enables support for systems based on the Hynix HMS720x

config ARCH_AAEC2000
bool "Agilent AAEC-2000 based"
help
This enables support for systems based on the Agilent AAEC-2000

endchoice

source "arch/arm/mach-clps711x/Kconfig"
Expand Down Expand Up @@ -230,6 +235,8 @@ source "arch/arm/mach-h720x/Kconfig"

source "arch/arm/mach-versatile/Kconfig"

source "arch/arm/mach-aaec2000/Kconfig"

# Definitions to make life easier
config ARCH_ACORN
bool
Expand Down
1 change: 1 addition & 0 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ textaddr-$(CONFIG_ARCH_FORTUNET) := 0xc0008000
machine-$(CONFIG_ARCH_VERSATILE) := versatile
machine-$(CONFIG_ARCH_IMX) := imx
machine-$(CONFIG_ARCH_H720X) := h720x
machine-$(CONFIG_ARCH_AAEC2000) := aaec2000

ifeq ($(CONFIG_ARCH_EBSA110),y)
# This is what happens if you forget the IOCS16 line.
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/mach-aaec2000/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if ARCH_AAEC2000

menu "Agilent AAEC-2000 Implementations"

config MACH_AAED2000
bool "Agilent AAED-2000 Development Platform"
select CPU_ARM920T

endmenu

endif
9 changes: 9 additions & 0 deletions arch/arm/mach-aaec2000/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Makefile for the linux kernel.
#

# Common support (must be linked before board specific support)
obj-y += core.o

# Specific board support
obj-$(CONFIG_MACH_AAED2000) += aaed2000.o
48 changes: 48 additions & 0 deletions arch/arm/mach-aaec2000/aaed2000.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* linux/arch/arm/mach-aaec2000/aaed2000.c
*
* Support for the Agilent AAED-2000 Development Platform.
*
* Copyright (c) 2005 Nicolas Bellido Y Ortega
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/major.h>
#include <linux/interrupt.h>

#include <asm/setup.h>
#include <asm/memory.h>
#include <asm/mach-types.h>
#include <asm/hardware.h>
#include <asm/irq.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>

#include "core.h"

static void __init aaed2000_init_irq(void)
{
aaec2000_init_irq();
}

static void __init aaed2000_map_io(void)
{
aaec2000_map_io();
}

MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
MAINTAINER("Nicolas Bellido Y Ortega")
BOOT_MEM(0xf0000000, PIO_BASE, VIO_BASE)
MAPIO(aaed2000_map_io)
INITIRQ(aaed2000_init_irq)
.timer = &aaec2000_timer,
MACHINE_END
157 changes: 157 additions & 0 deletions arch/arm/mach-aaec2000/core.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/*
* linux/arch/arm/mach-aaec2000/core.c
*
* Code common to all AAEC-2000 machines
*
* Copyright (c) 2005 Nicolas Bellido Y Ortega
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <linux/signal.h>

#include <asm/hardware.h>
#include <asm/irq.h>

#include <asm/mach/irq.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>

/*
* Common I/O mapping:
*
* Static virtual address mappings are as follow:
*
* 0xf8000000-0xf8001ffff: Devices connected to APB bus
* 0xf8002000-0xf8003ffff: Devices connected to AHB bus
*
* Below 0xe8000000 is reserved for vm allocation.
*
* The machine specific code must provide the extra mapping beside the
* default mapping provided here.
*/
static struct map_desc standard_io_desc[] __initdata = {
/* virtual physical length type */
{ VIO_APB_BASE, PIO_APB_BASE, IO_APB_LENGTH, MT_DEVICE },
{ VIO_AHB_BASE, PIO_AHB_BASE, IO_AHB_LENGTH, MT_DEVICE }
};

void __init aaec2000_map_io(void)
{
iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
}

/*
* Interrupt handling routines
*/
static void aaec2000_int_ack(unsigned int irq)
{
IRQ_INTSR = 1 << irq;
}

static void aaec2000_int_mask(unsigned int irq)
{
IRQ_INTENC |= (1 << irq);
}

static void aaec2000_int_unmask(unsigned int irq)
{
IRQ_INTENS |= (1 << irq);
}

static struct irqchip aaec2000_irq_chip = {
.ack = aaec2000_int_ack,
.mask = aaec2000_int_mask,
.unmask = aaec2000_int_unmask,
};

void __init aaec2000_init_irq(void)
{
unsigned int i;

for (i = 0; i < NR_IRQS; i++) {
set_irq_handler(i, do_level_IRQ);
set_irq_chip(i, &aaec2000_irq_chip);
set_irq_flags(i, IRQF_VALID);
}

/* Disable all interrupts */
IRQ_INTENC = 0xffffffff;

/* Clear any pending interrupts */
IRQ_INTSR = IRQ_INTSR;
}

/*
* Time keeping
*/
/* IRQs are disabled before entering here from do_gettimeofday() */
static unsigned long aaec2000_gettimeoffset(void)
{
unsigned long ticks_to_match, elapsed, usec;

/* Get ticks before next timer match */
ticks_to_match = TIMER1_LOAD - TIMER1_VAL;

/* We need elapsed ticks since last match */
elapsed = LATCH - ticks_to_match;

/* Now, convert them to usec */
usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;

return usec;
}

/* We enter here with IRQs enabled */
static irqreturn_t
aaec2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
/* TODO: Check timer accuracy */
write_seqlock(&xtime_lock);

timer_tick(regs);
TIMER1_CLEAR = 1;

write_sequnlock(&xtime_lock);

return IRQ_HANDLED;
}

static struct irqaction aaec2000_timer_irq = {
.name = "AAEC-2000 Timer Tick",
.flags = SA_INTERRUPT,
.handler = aaec2000_timer_interrupt
};

static void __init aaec2000_timer_init(void)
{
/* Disable timer 1 */
TIMER1_CTRL = 0;

/* We have somehow to generate a 100Hz clock.
* We then use the 508KHz timer in periodic mode.
*/
TIMER1_LOAD = LATCH;
TIMER1_CLEAR = 1; /* Clear interrupt */

setup_irq(INT_TMR1_OFL, &aaec2000_timer_irq);

TIMER1_CTRL = TIMER_CTRL_ENABLE |
TIMER_CTRL_PERIODIC |
TIMER_CTRL_CLKSEL_508K;
}

struct sys_timer aaec2000_timer = {
.init = aaec2000_timer_init,
.offset = aaec2000_gettimeoffset,
};

16 changes: 16 additions & 0 deletions arch/arm/mach-aaec2000/core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* linux/arch/arm/mach-aaec2000/core.h
*
* Copyright (c) 2005 Nicolas Bellido Y Ortega
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/

struct sys_timer;

extern struct sys_timer aaec2000_timer;
extern void __init aaec2000_map_io(void);
extern void __init aaec2000_init_irq(void);
2 changes: 1 addition & 1 deletion arch/arm/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ config CPU_ARM720T
# ARM920T
config CPU_ARM920T
bool "Support ARM920T processor" if !ARCH_S3C2410
depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX
depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000
default y if ARCH_S3C2410
select CPU_32v4
select CPU_ABRT_EV4T
Expand Down
Loading

0 comments on commit 038c5b6

Please sign in to comment.