RTEMS 7.0-rc1
Loading...
Searching...
No Matches
pxa255.h
1/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
3/*
4 * Copyright (c) 2009 Yang Xi <hiyangxi@gmail.com>
5 *
6 * The license and distribution terms for this file may be
7 * found in the file LICENSE in this distribution or at
8 * http://www.rtems.org/license/LICENSE.
9 */
10
11#ifndef __PXA_255_H__
12#define __PXA_255_H__
13
14typedef unsigned int word_t;
15
16/*Interrupt*/
17
18#define PRIMARY_IRQS 32
19#define GPIO_IRQS (85 - 2) /* The first two IRQs have level
20 one interrupts */
21#define GPIO_IRQ 10
22
23#define IRQS (PRIMARY_IRQS + GPIO_IRQS)
24
25/* Interrupt Controller */
26#define INTERRUPT_OFFSET 0xd00000
27#define XSCALE_IRQ_OS_TIMER 26
28#define XSCALE_IRQ_PMU 12
29#define XSCALE_IRQ_STUART 20
30#define XSCALE_IRQ_NETWORK 16
31
32#define PMU_IRQ 12
33#define CCNT_IRQ_ENABLE 1UL << 6
34#define PMN1_IRQ_ENABLE 1UL << 5
35#define PMN0_IRQ_ENABLE 1UL << 4
36
37#define IODEVICE_VADDR 0x40000000
38#define XSCALE_INT (IODEVICE_VADDR + INTERRUPT_OFFSET)
39
40#define XSCALE_INT_ICMR (*(volatile word_t *)(XSCALE_INT + 0x04)) /* Mask register */
41#define XSCALE_INT_ICLR (*(volatile word_t *)(XSCALE_INT + 0x08)) /* FIQ / IRQ selection */
42#define XSCALE_INT_ICCR (*(volatile word_t *)(XSCALE_INT + 0x14)) /* Control register */
43#define XSCALE_INT_ICIP (*(volatile word_t *)(XSCALE_INT + 0x00)) /* IRQ pending */
44#define XSCALE_INT_ICFP (*(volatile word_t *)(XSCALE_INT + 0x0c)) /* FIQ pending */
45#define XSCALE_INT_ICPR (*(volatile word_t *)(XSCALE_INT + 0x10)) /* Pending (unmasked) */
46
47/* GPIO */
48#define GPIO_OFFSET 0xe00000
49#define PXA_GPIO (IODEVICE_VADDR + GPIO_OFFSET)
50
51#define PXA_GEDR0 (*(volatile word_t *)(PXA_GPIO + 0x48)) /* GPIO edge detect 0 */
52#define PXA_GEDR1 (*(volatile word_t *)(PXA_GPIO + 0x4C)) /* GPIO edge detect 1 */
53#define PXA_GEDR2 (*(volatile word_t *)(PXA_GPIO + 0x50)) /* GPIO edge detect 2 */
54
55
56/* PXA2XX Timer */
57
58#define TIMER_OFFSET 0x0a00000
59#define CLOCKS_OFFSET 0x1300000
60/*I change the TIMER_RATE to 36864,because when I use 3686400, the period will be calculate
61 to 30000*/
62#define TIMER_RATE 36864
63
64#define XSCALE_TIMERS (IODEVICE_VADDR + TIMER_OFFSET)
65
66/* Match registers */
67#define XSCALE_OS_TIMER_MR0 (*(volatile word_t *)(XSCALE_TIMERS + 0x00))
68#define XSCALE_OS_TIMER_MR1 (*(volatile word_t *)(XSCALE_TIMERS + 0x04))
69#define XSCALE_OS_TIMER_MR2 (*(volatile word_t *)(XSCALE_TIMERS + 0x08))
70#define XSCALE_OS_TIMER_MR3 (*(volatile word_t *)(XSCALE_TIMERS + 0x0c))
71
72/* Interrupt enable register */
73#define XSCALE_OS_TIMER_IER (*(volatile word_t *)(XSCALE_TIMERS + 0x1c))
74/* Watchdog match enable register */
75#define XSCALE_OS_TIMER_WMER (*(volatile word_t *)(XSCALE_TIMERS + 0x18))
76/* Timer count register */
77#define XSCALE_OS_TIMER_TCR (*(volatile word_t *)(XSCALE_TIMERS + 0x10))
78/* Timer status register */
79#define XSCALE_OS_TIMER_TSR (*(volatile word_t *)(XSCALE_TIMERS + 0x14))
80
81#define XSCALE_CLOCKS (IODEVICE_VADDR + CLOCKS_VOFFSET)
82
83#define XSCALE_CLOCKS_CCCR (*(volatile word_t *)(XSCALE_CLOCKS + 0x00))
84
85/*Use ffuart port as the console*/
86#define FFUART_BASE 0x40100000
87
88/*Write to SKYEYE_MAGIC_ADDRESS to make SKYEYE exit*/
89
90#define SKYEYE_MAGIC_ADDRESS (*(volatile word_t *)(0xb0000000))
91#define SKYEYE_MAGIC_NUMBER (0xf0f0f0f0)
92
93/*PMC*/
94#define PMC_PMNC 0
95#define PMC_CCNT 1
96#define PMC_INTEN 2
97#define PMC_FLAG 3
98#define PMC_EVTSEL 4
99#define PMC_PMN0 5
100#define PMC_PMN1 6
101#define PMC_PMN2 7
102#define PMC_PMN3 8
103
104#define PMC_PMNC_E (0x01)
105#define PMC_PMNC_PCR (0x01 << 1)
106#define PMC_PMNC_CCR (0x01 << 2)
107#define PMC_PMNC_CCD (0x01 << 3)
108#define PMC_PMNC_PCD (0x01 << 4)
109
110/*LCD*/
111#define LCCR0 (*(volatile word_t *)(0x44000000))
112#define LCCR1 (*(volatile word_t *)(0x44000004))
113#define LCCR2 (*(volatile word_t *)(0x44000008))
114#define LCCR3 (*(volatile word_t *)(0x4400000C))
115
116#define FDADR0 (*(volatile word_t *)(0x44000200))
117#define FSADR0 (*(volatile word_t *)(0x44000204))
118#define FIDR0 (*(volatile word_t *)(0x44000208))
119#define LDCMD0 (*(volatile word_t *)(0x4400020C))
120
121#define FDADR1 (*(volatile word_t *)(0x44000210))
122#define FSADR1 (*(volatile word_t *)(0x44000214))
123#define FIDR1 (*(volatile word_t *)(0x44000218))
124#define LDCMD1 (*(volatile word_t *)(0x4400021C))
125
126#define LCCR0_ENB 0x00000001
127#define LCCR1_PPL 0x000003FF
128#define LCCR2_LPP 0x000003FF
129#define LCCR3_BPP 0x07000000
130#endif