Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2007 Dave Chapman |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | #ifndef __TCC77X_H__ |
| 22 | #define __TCC77X_H__ |
| 23 | |
| 24 | /* General-purpose IO */ |
| 25 | |
| 26 | #define GPIOA (*(volatile unsigned long *)0x80000300) |
| 27 | #define GPIOB (*(volatile unsigned long *)0x80000310) |
| 28 | #define GPIOC (*(volatile unsigned long *)0x80000320) |
| 29 | #define GPIOD (*(volatile unsigned long *)0x80000330) |
| 30 | #define GPIOE (*(volatile unsigned long *)0x80000340) |
| 31 | |
| 32 | #define GPIOA_DIR (*(volatile unsigned long *)0x80000304) |
| 33 | #define GPIOB_DIR (*(volatile unsigned long *)0x80000314) |
| 34 | #define GPIOC_DIR (*(volatile unsigned long *)0x80000324) |
| 35 | #define GPIOD_DIR (*(volatile unsigned long *)0x80000334) |
| 36 | #define GPIOE_DIR (*(volatile unsigned long *)0x80000344) |
| 37 | |
| 38 | #define GPIOA_FUNC (*(volatile unsigned long *)0x80000308) |
| 39 | #define GPIOB_FUNC (*(volatile unsigned long *)0x80000318) |
| 40 | #define GPIOC_FUNC (*(volatile unsigned long *)0x80000328) |
| 41 | #define GPIOD_FUNC (*(volatile unsigned long *)0x80000338) |
| 42 | #define GPIOE_FUNC (*(volatile unsigned long *)0x80000348) |
| 43 | |
| 44 | #define BMI (*(volatile unsigned long *)0x80000364) |
| 45 | |
| 46 | /* Clock Generator */ |
| 47 | |
| 48 | #define CLKCTRL (*(volatile unsigned long *)0x80000400) |
| 49 | #define PLL0CFG (*(volatile unsigned long *)0x80000404) |
Dave Chapman | f204298 | 2008-05-02 19:12:09 +0000 | [diff] [blame] | 50 | #define CLKDIVC (*(volatile unsigned long *)0x8000040c) |
Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 51 | #define MODECTR (*(volatile unsigned long *)0x80000410) |
| 52 | #define BCLKCTR (*(volatile unsigned long *)0x80000414) |
| 53 | #define SWRESET (*(volatile unsigned long *)0x80000418) |
| 54 | #define PCLKCFG0 (*(volatile unsigned long *)0x8000041c) |
| 55 | #define PCLKCFG1 (*(volatile unsigned long *)0x80000420) |
| 56 | #define PCLKCFG2 (*(volatile unsigned long *)0x80000424) |
| 57 | #define PCLKCFG3 (*(volatile unsigned long *)0x80000428) |
| 58 | #define PCLKCFG4 (*(volatile unsigned long *)0x8000042c) |
| 59 | #define PCLKCFG5 (*(volatile unsigned long *)0x80000430) |
| 60 | #define PCLKCFG6 (*(volatile unsigned long *)0x80000434) |
| 61 | |
| 62 | /* ADC */ |
| 63 | |
| 64 | #define ADCCON (*(volatile unsigned long *)0x80000a00) |
| 65 | #define ADCDATA (*(volatile unsigned long *)0x80000a04) |
| 66 | #define ADCCONA (*(volatile unsigned long *)0x80000a80) |
| 67 | #define ADCSTATUS (*(volatile unsigned long *)0x80000a84) |
| 68 | #define ADCCFG (*(volatile unsigned long *)0x80000a88) |
| 69 | |
| 70 | |
| 71 | /* Memory Controller */ |
| 72 | #define SDCFG (*(volatile unsigned long *)0xf0000000) |
| 73 | #define SDFSM (*(volatile unsigned long *)0xf0000004) |
| 74 | #define MCFG (*(volatile unsigned long *)0xf0000008) |
| 75 | #define TST (*(volatile unsigned long *)0xf000000c) |
| 76 | #define CSCFG0 (*(volatile unsigned long *)0xf0000010) |
| 77 | #define CSCFG1 (*(volatile unsigned long *)0xf0000014) |
| 78 | #define CSCFG2 (*(volatile unsigned long *)0xf0000018) |
| 79 | #define CSCFG3 (*(volatile unsigned long *)0xf000001c) |
| 80 | #define CLKCFG (*(volatile unsigned long *)0xf0000020) |
| 81 | #define SDCMD (*(volatile unsigned long *)0xf0000024) |
| 82 | |
Dave Chapman | f204298 | 2008-05-02 19:12:09 +0000 | [diff] [blame] | 83 | |
| 84 | /* IRQ Controller */ |
| 85 | |
| 86 | #define TIMER0_IRQ_MASK (1<<6) |
Dave Chapman | 9c1ab1f | 2008-05-03 07:49:39 +0000 | [diff] [blame] | 87 | #define ADC_IRQ_MASK (1<<16) |
Dave Chapman | f204298 | 2008-05-02 19:12:09 +0000 | [diff] [blame] | 88 | |
| 89 | #define IEN (*(volatile unsigned long *)0x80000100) |
| 90 | #define CREQ (*(volatile unsigned long *)0x80000104) |
| 91 | #define IREQ (*(volatile unsigned long *)0x80000108) |
| 92 | #define IRQSEL (*(volatile unsigned long *)0x8000010c) |
| 93 | #define ICFG (*(volatile unsigned long *)0x80000110) |
| 94 | #define MREQ (*(volatile unsigned long *)0x80000114) |
| 95 | #define TSTREQ (*(volatile unsigned long *)0x80000118) |
| 96 | #define IRQ (*(volatile unsigned long *)0x80000120) |
| 97 | #define FIQ (*(volatile unsigned long *)0x80000124) |
| 98 | #define MIRQ (*(volatile unsigned long *)0x80000128) |
| 99 | #define MFIQ (*(volatile unsigned long *)0x8000012c) |
| 100 | #define TMODE (*(volatile unsigned long *)0x80000130) |
| 101 | #define SYNC (*(volatile unsigned long *)0x80000134) |
| 102 | #define WKUP (*(volatile unsigned long *)0x80000138) |
| 103 | |
| 104 | /* Timer Controller */ |
| 105 | |
| 106 | #define TCFG0 (*(volatile unsigned long *)0x80000200) |
| 107 | #define TCNT0 (*(volatile unsigned long *)0x80000204) |
| 108 | #define TREF0 (*(volatile unsigned long *)0x80000208) |
| 109 | #define TMREF0 (*(volatile unsigned long *)0x8000020c) |
| 110 | #define TCFG1 (*(volatile unsigned long *)0x80000210) |
| 111 | #define TCNT1 (*(volatile unsigned long *)0x80000214) |
| 112 | #define TREF1 (*(volatile unsigned long *)0x80000218) |
| 113 | #define TMREF1 (*(volatile unsigned long *)0x8000021c) |
| 114 | #define TCFG2 (*(volatile unsigned long *)0x80000220) |
| 115 | #define TCNT2 (*(volatile unsigned long *)0x80000224) |
| 116 | #define TREF2 (*(volatile unsigned long *)0x80000228) |
| 117 | #define TMREF2 (*(volatile unsigned long *)0x8000022c) |
| 118 | #define TCFG3 (*(volatile unsigned long *)0x80000230) |
| 119 | #define TCNT3 (*(volatile unsigned long *)0x80000234) |
| 120 | #define TREF3 (*(volatile unsigned long *)0x80000238) |
| 121 | #define TMREF3 (*(volatile unsigned long *)0x8000023c) |
| 122 | #define TCFG4 (*(volatile unsigned long *)0x80000240) |
| 123 | #define TCNT4 (*(volatile unsigned long *)0x80000244) |
| 124 | #define TREF4 (*(volatile unsigned long *)0x80000248) |
| 125 | #define TCFG5 (*(volatile unsigned long *)0x80000250) |
| 126 | #define TCNT5 (*(volatile unsigned long *)0x80000254) |
| 127 | #define TREF5 (*(volatile unsigned long *)0x80000258) |
| 128 | #define TIREQ (*(volatile unsigned long *)0x80000260) |
| 129 | #define TWDCFG (*(volatile unsigned long *)0x80000270) |
| 130 | #define TWDCLR (*(volatile unsigned long *)0x80000274) |
| 131 | #define TC32EN (*(volatile unsigned long *)0x80000280) |
| 132 | #define TC32LDV (*(volatile unsigned long *)0x80000284) |
| 133 | #define TC32CMP0 (*(volatile unsigned long *)0x80000288) |
| 134 | #define TC32CMP1 (*(volatile unsigned long *)0x8000028c) |
| 135 | #define TC32PCNT (*(volatile unsigned long *)0x80000290) |
| 136 | #define TC32MCNT (*(volatile unsigned long *)0x80000294) |
| 137 | #define TC32IRQ (*(volatile unsigned long *)0x80000298) |
| 138 | |
| 139 | /* TIREQ flags */ |
| 140 | #define TF0 (1<<8) /* Timer 0 reference value reached */ |
| 141 | #define TF1 (1<<9) /* Timer 1 reference value reached */ |
| 142 | #define TI0 (1<<0) /* Timer 0 IRQ flag */ |
| 143 | #define TI1 (1<<1) /* Timer 1 IRQ flag */ |
| 144 | |
Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 145 | #endif |