summaryrefslogtreecommitdiffstats
path: root/bsps/arm/gumstix
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/arm/gumstix')
-rw-r--r--bsps/arm/gumstix/headers.am12
-rw-r--r--bsps/arm/gumstix/include/bsp.h84
-rw-r--r--bsps/arm/gumstix/include/bsp/irq.h29
-rw-r--r--bsps/arm/gumstix/include/ffuart.h48
-rw-r--r--bsps/arm/gumstix/include/pxa255.h128
-rw-r--r--bsps/arm/gumstix/include/tm27.h1
6 files changed, 302 insertions, 0 deletions
diff --git a/bsps/arm/gumstix/headers.am b/bsps/arm/gumstix/headers.am
new file mode 100644
index 0000000000..410ad6cf75
--- /dev/null
+++ b/bsps/arm/gumstix/headers.am
@@ -0,0 +1,12 @@
+## This file was generated by "./boostrap -H".
+
+include_HEADERS =
+include_HEADERS += ../../../../../../bsps/arm/gumstix/include/bsp.h
+include_HEADERS += include/bspopts.h
+include_HEADERS += ../../../../../../bsps/arm/gumstix/include/ffuart.h
+include_HEADERS += ../../../../../../bsps/arm/gumstix/include/pxa255.h
+include_HEADERS += ../../../../../../bsps/arm/gumstix/include/tm27.h
+
+include_bspdir = $(includedir)/bsp
+include_bsp_HEADERS =
+include_bsp_HEADERS += ../../../../../../bsps/arm/gumstix/include/bsp/irq.h
diff --git a/bsps/arm/gumstix/include/bsp.h b/bsps/arm/gumstix/include/bsp.h
new file mode 100644
index 0000000000..caee8f9e19
--- /dev/null
+++ b/bsps/arm/gumstix/include/bsp.h
@@ -0,0 +1,84 @@
+/**
+ * @file
+ * @ingroup arm_gumstix
+ * @brief Global BSP definitions.
+ */
+
+/*
+ * By Yang Xi <hiyangxi@gmail.com>.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef LIBBSP_ARM_GUMSTIX_BSP_H
+#define LIBBSP_ARM_GUMSTIX_BSP_H
+
+#include <bspopts.h>
+#include <bsp/default-initial-extension.h>
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup arm_gumstix Gumstix Support
+ * @ingroup bsp_arm
+ * @brief Gumstix support package
+ * @{
+ */
+
+#define BSP_FEATURE_IRQ_EXTENSION
+
+#define BSP_HAS_FRAME_BUFFER 1
+
+/** @brief What is the input clock freq in hertz */
+#define BSP_MAIN_FREQ 3686400 /* 3.6864 MHz */
+#define BSP_SLCK_FREQ 32768 /* 32.768 KHz */
+
+/** @brief What is the last interrupt */
+#define BSP_MAX_INT AT91RM9200_MAX_INT
+
+/*
+ * forward reference the type to avoid conflicts between libchip serial
+ * and libchip rtc get and set register types.
+ */
+typedef struct _console_tbl console_tbl;
+console_tbl *BSP_get_uart_from_minor(int minor);
+
+static inline int32_t BSP_get_baud(void) {return 115200;}
+
+/** @brief How big should the interrupt stack be? */
+#define CONFIGURE_INTERRUPT_STACK_MEMORY (16 * 1024)
+
+#define ST_PIMR_PIV 33 /* 33 ticks of the 32.768Khz clock ~= 1msec */
+
+#define outport_byte(port,val) *((unsigned char volatile*)(port)) = (val)
+#define inport_byte(port,val) (val) = *((unsigned char volatile*)(port))
+#define outport_word(port,val) *((unsigned short volatile*)(port)) = (val)
+#define inport_word(port,val) (val) = *((unsigned short volatile*)(port))
+
+struct rtems_bsdnet_ifconfig;
+extern int rtems_ne_driver_attach(struct rtems_bsdnet_ifconfig *, int);
+#define BSP_NE2000_NETWORK_DRIVER_NAME "ne1"
+#define BSP_NE2000_NETWORK_DRIVER_ATTACH rtems_ne_driver_attach
+
+#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
+#define RTEMS_BSP_NETWORK_DRIVER_NAME BSP_NE2000_NETWORK_DRIVER_NAME
+#endif
+
+#ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
+#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_NE2000_NETWORK_DRIVER_ATTACH
+#endif
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BSP_H */
+
diff --git a/bsps/arm/gumstix/include/bsp/irq.h b/bsps/arm/gumstix/include/bsp/irq.h
new file mode 100644
index 0000000000..a8b5d24da1
--- /dev/null
+++ b/bsps/arm/gumstix/include/bsp/irq.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2010 embedded brains GmbH.
+ *
+ * Interrupt handler Header file for PXA By Yang Xi <hiyangxi@gmail.com>
+ * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef __IRQ_H__
+#define __IRQ_H__
+
+#ifndef __asm__
+
+#include <rtems.h>
+#include <rtems/irq.h>
+#include <rtems/irq-extension.h>
+
+#include <pxa255.h>
+
+#define BSP_INTERRUPT_VECTOR_MIN 0
+
+#define BSP_INTERRUPT_VECTOR_MAX (PRIMARY_IRQS - 1)
+
+#endif /* __asm__ */
+
+#endif /* __IRQ_H__ */
diff --git a/bsps/arm/gumstix/include/ffuart.h b/bsps/arm/gumstix/include/ffuart.h
new file mode 100644
index 0000000000..68df822183
--- /dev/null
+++ b/bsps/arm/gumstix/include/ffuart.h
@@ -0,0 +1,48 @@
+/*
+ * FFUART for PXA250 CPU by Yang Xi<hiyangxi@gmail.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef __FFUART_H__
+#define __FFUART_H__
+
+typedef struct {
+ /*
+ *Receive buffer(DLAB=0).Transmit buffer(DLAB=0).
+ *Divisor Latch Low(DLAB=1)
+ */
+ volatile unsigned int rbr;
+ /*Interrupt enable(DLAB=0). Divisor Latch High(DLAB=1)*/
+ volatile unsigned int ier;
+ /*Interrupt identification.FIFO control*/
+ volatile unsigned int iir;
+ /*Line Control*/
+ volatile unsigned int lcr;
+ /*Modem control*/
+ volatile unsigned int mcr;
+ /*Line Status*/
+ volatile unsigned int lsr;
+ /*Modem status*/
+ volatile unsigned int msr;
+ /*Scratch Pad*/
+ volatile unsigned int spr;
+ /*Infrared Selection*/
+ volatile unsigned int isr;
+} ffuart_reg_t;
+
+
+#define EIGHT_BITS_NOPARITY_1STOPBIT 0x3
+#define DLAB 0x80
+
+
+/*Divisor = frequency_uart/(16 * BaudRate*)*/
+#define FREQUENCY_UART (14745600)
+
+#define SEND_EMPTY 0x20
+#define FULL_RECEIVE 0x01
+
+#endif
+
diff --git a/bsps/arm/gumstix/include/pxa255.h b/bsps/arm/gumstix/include/pxa255.h
new file mode 100644
index 0000000000..d5f2830c53
--- /dev/null
+++ b/bsps/arm/gumstix/include/pxa255.h
@@ -0,0 +1,128 @@
+/*
+ * By Yang Xi <hiyangxi@gmail.com>.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef __PXA_255_H__
+#define __PXA_255_H__
+
+typedef unsigned int word_t;
+
+/*Interrupt*/
+
+#define PRIMARY_IRQS 32
+#define GPIO_IRQS (85 - 2) /* The first two IRQs have level
+ one interrupts */
+#define GPIO_IRQ 10
+
+#define IRQS (PRIMARY_IRQS + GPIO_IRQS)
+
+/* Interrupt Controller */
+#define INTERRUPT_OFFSET 0xd00000
+#define XSCALE_IRQ_OS_TIMER 26
+#define XSCALE_IRQ_PMU 12
+#define XSCALE_IRQ_STUART 20
+#define XSCALE_IRQ_NETWORK 16
+
+#define PMU_IRQ 12
+#define CCNT_IRQ_ENABLE 1UL << 6
+#define PMN1_IRQ_ENABLE 1UL << 5
+#define PMN0_IRQ_ENABLE 1UL << 4
+
+#define IODEVICE_VADDR 0x40000000
+#define XSCALE_INT (IODEVICE_VADDR + INTERRUPT_OFFSET)
+
+#define XSCALE_INT_ICMR (*(volatile word_t *)(XSCALE_INT + 0x04)) /* Mask register */
+#define XSCALE_INT_ICLR (*(volatile word_t *)(XSCALE_INT + 0x08)) /* FIQ / IRQ selection */
+#define XSCALE_INT_ICCR (*(volatile word_t *)(XSCALE_INT + 0x14)) /* Control register */
+#define XSCALE_INT_ICIP (*(volatile word_t *)(XSCALE_INT + 0x00)) /* IRQ pending */
+#define XSCALE_INT_ICFP (*(volatile word_t *)(XSCALE_INT + 0x0c)) /* FIQ pending */
+#define XSCALE_INT_ICPR (*(volatile word_t *)(XSCALE_INT + 0x10)) /* Pending (unmasked) */
+
+/* GPIO */
+#define GPIO_OFFSET 0xe00000
+#define PXA_GPIO (IODEVICE_VADDR + GPIO_OFFSET)
+
+#define PXA_GEDR0 (*(volatile word_t *)(PXA_GPIO + 0x48)) /* GPIO edge detect 0 */
+#define PXA_GEDR1 (*(volatile word_t *)(PXA_GPIO + 0x4C)) /* GPIO edge detect 1 */
+#define PXA_GEDR2 (*(volatile word_t *)(PXA_GPIO + 0x50)) /* GPIO edge detect 2 */
+
+
+/* PXA2XX Timer */
+
+#define TIMER_OFFSET 0x0a00000
+#define CLOCKS_OFFSET 0x1300000
+/*I change the TIMER_RATE to 36864,because when I use 3686400, the period will be calculate
+ to 30000*/
+#define TIMER_RATE 36864
+
+#define XSCALE_TIMERS (IODEVICE_VADDR + TIMER_OFFSET)
+
+/* Match registers */
+#define XSCALE_OS_TIMER_MR0 (*(volatile word_t *)(XSCALE_TIMERS + 0x00))
+#define XSCALE_OS_TIMER_MR1 (*(volatile word_t *)(XSCALE_TIMERS + 0x04))
+#define XSCALE_OS_TIMER_MR2 (*(volatile word_t *)(XSCALE_TIMERS + 0x08))
+#define XSCALE_OS_TIMER_MR3 (*(volatile word_t *)(XSCALE_TIMERS + 0x0c))
+
+/* Interrupt enable register */
+#define XSCALE_OS_TIMER_IER (*(volatile word_t *)(XSCALE_TIMERS + 0x1c))
+/* Watchdog match enable register */
+#define XSCALE_OS_TIMER_WMER (*(volatile word_t *)(XSCALE_TIMERS + 0x18))
+/* Timer count register */
+#define XSCALE_OS_TIMER_TCR (*(volatile word_t *)(XSCALE_TIMERS + 0x10))
+/* Timer status register */
+#define XSCALE_OS_TIMER_TSR (*(volatile word_t *)(XSCALE_TIMERS + 0x14))
+
+#define XSCALE_CLOCKS (IODEVICE_VADDR + CLOCKS_VOFFSET)
+
+#define XSCALE_CLOCKS_CCCR (*(volatile word_t *)(XSCALE_CLOCKS + 0x00))
+
+/*Use ffuart port as the console*/
+#define FFUART_BASE 0x40100000
+
+/*Write to SKYEYE_MAGIC_ADDRESS to make SKYEYE exit*/
+
+#define SKYEYE_MAGIC_ADDRESS (*(volatile word_t *)(0xb0000000))
+#define SKYEYE_MAGIC_NUMBER (0xf0f0f0f0)
+
+/*PMC*/
+#define PMC_PMNC 0
+#define PMC_CCNT 1
+#define PMC_INTEN 2
+#define PMC_FLAG 3
+#define PMC_EVTSEL 4
+#define PMC_PMN0 5
+#define PMC_PMN1 6
+#define PMC_PMN2 7
+#define PMC_PMN3 8
+
+#define PMC_PMNC_E (0x01)
+#define PMC_PMNC_PCR (0x01 << 1)
+#define PMC_PMNC_CCR (0x01 << 2)
+#define PMC_PMNC_CCD (0x01 << 3)
+#define PMC_PMNC_PCD (0x01 << 4)
+
+/*LCD*/
+#define LCCR0 (*(volatile word_t *)(0x44000000))
+#define LCCR1 (*(volatile word_t *)(0x44000004))
+#define LCCR2 (*(volatile word_t *)(0x44000008))
+#define LCCR3 (*(volatile word_t *)(0x4400000C))
+
+#define FDADR0 (*(volatile word_t *)(0x44000200))
+#define FSADR0 (*(volatile word_t *)(0x44000204))
+#define FIDR0 (*(volatile word_t *)(0x44000208))
+#define LDCMD0 (*(volatile word_t *)(0x4400020C))
+
+#define FDADR1 (*(volatile word_t *)(0x44000210))
+#define FSADR1 (*(volatile word_t *)(0x44000214))
+#define FIDR1 (*(volatile word_t *)(0x44000218))
+#define LDCMD1 (*(volatile word_t *)(0x4400021C))
+
+#define LCCR0_ENB 0x00000001
+#define LCCR1_PPL 0x000003FF
+#define LCCR2_LPP 0x000003FF
+#define LCCR3_BPP 0x07000000
+#endif
diff --git a/bsps/arm/gumstix/include/tm27.h b/bsps/arm/gumstix/include/tm27.h
new file mode 100644
index 0000000000..0dfa7bf628
--- /dev/null
+++ b/bsps/arm/gumstix/include/tm27.h
@@ -0,0 +1 @@
+#include <rtems/tm27-default.h>