Dave Chapman | d16a8b8 | 2006-02-05 16:52:22 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2004 by Thom Johansen |
| 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 | d16a8b8 | 2006-02-05 16:52:22 +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 __PP5002_H__ |
| 22 | #define __PP5002_H__ |
| 23 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 24 | /* Much info gleaned and/or copied from the iPodLinux project. */ |
Barry Wardell | 84b509d | 2007-01-28 18:42:11 +0000 | [diff] [blame] | 25 | #define DRAM_START 0x28000000 |
| 26 | |
Jens Arnold | 1f0d06f | 2007-10-07 16:44:55 +0000 | [diff] [blame] | 27 | /* LCD bridge */ |
Jens Arnold | 8aeed2d | 2007-10-12 00:28:57 +0000 | [diff] [blame] | 28 | #define LCD1_BASE 0xc0001000 |
Michael Sevakis | da55251 | 2007-09-29 06:17:33 +0000 | [diff] [blame] | 29 | |
Jens Arnold | 8aeed2d | 2007-10-12 00:28:57 +0000 | [diff] [blame] | 30 | #define LCD1_CONTROL (*(volatile unsigned long *)(0xc0001000)) |
| 31 | #define LCD1_CMD (*(volatile unsigned long *)(0xc0001008)) |
| 32 | #define LCD1_DATA (*(volatile unsigned long *)(0xc0001010)) |
| 33 | |
| 34 | #define LCD1_BUSY_MASK 0x8000 |
Barry Wardell | 84b509d | 2007-01-28 18:42:11 +0000 | [diff] [blame] | 35 | |
Jens Arnold | 1f0d06f | 2007-10-07 16:44:55 +0000 | [diff] [blame] | 36 | /* I2S controller */ |
Michael Sevakis | 6077e5b | 2007-10-06 22:27:27 +0000 | [diff] [blame] | 37 | #define IISCONFIG (*(volatile unsigned long *)(0xc0002500)) |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 38 | #define IISFIFO_CFG (*(volatile unsigned long *)(0xc000251c)) |
| 39 | #define IISFIFO_WR (*(volatile unsigned long *)(0xc0002540)) |
| 40 | #define IISFIFO_RD (*(volatile unsigned long *)(0xc0002580)) |
| 41 | |
Michael Sevakis | 6077e5b | 2007-10-06 22:27:27 +0000 | [diff] [blame] | 42 | /* IISCONFIG bits: */ |
| 43 | #define IIS_TXFIFOEN (1 << 2) |
| 44 | #define IIS_TX_FREE_MASK (0xf << 23) |
| 45 | #define IIS_TX_FREE_COUNT ((IISFIFO_CFG & IIS_TX_FREE_MASK) >> 23) |
| 46 | |
| 47 | /* IISFIFO_CFG bits: */ |
| 48 | #define IIS_IRQTX_REG IISFIFO_CFG |
| 49 | #define IIS_IRQTX (1 << 9) |
| 50 | |
Jens Arnold | 174c7ab | 2007-08-01 10:43:45 +0000 | [diff] [blame] | 51 | #define IDE_BASE 0xc0003000 |
| 52 | |
| 53 | #define IDE_CFG_STATUS (*(volatile unsigned long *)(0xc0003024)) |
| 54 | |
| 55 | #define USB_BASE 0xc0005000 |
| 56 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 57 | #define I2C_BASE 0xc0008000 |
| 58 | |
Jens Arnold | 1f0d06f | 2007-10-07 16:44:55 +0000 | [diff] [blame] | 59 | /* Processor ID */ |
| 60 | #define PROCESSOR_ID (*(volatile unsigned long *)(0xc4000000)) |
| 61 | |
| 62 | #define PROC_ID_CPU 0x55 |
| 63 | #define PROC_ID_COP 0xaa |
| 64 | |
Dave Chapman | fb4e384 | 2006-02-24 20:54:09 +0000 | [diff] [blame] | 65 | #define GPIOA_ENABLE (*(volatile unsigned char *)(0xcf000000)) |
| 66 | #define GPIOB_ENABLE (*(volatile unsigned char *)(0xcf000004)) |
| 67 | #define GPIOC_ENABLE (*(volatile unsigned char *)(0xcf000008)) |
| 68 | #define GPIOD_ENABLE (*(volatile unsigned char *)(0xcf00000c)) |
| 69 | #define GPIOA_OUTPUT_EN (*(volatile unsigned char *)(0xcf000010)) |
| 70 | #define GPIOB_OUTPUT_EN (*(volatile unsigned char *)(0xcf000014)) |
| 71 | #define GPIOC_OUTPUT_EN (*(volatile unsigned char *)(0xcf000018)) |
| 72 | #define GPIOD_OUTPUT_EN (*(volatile unsigned char *)(0xcf00001c)) |
| 73 | #define GPIOA_OUTPUT_VAL (*(volatile unsigned char *)(0xcf000020)) |
| 74 | #define GPIOB_OUTPUT_VAL (*(volatile unsigned char *)(0xcf000024)) |
| 75 | #define GPIOC_OUTPUT_VAL (*(volatile unsigned char *)(0xcf000028)) |
| 76 | #define GPIOD_OUTPUT_VAL (*(volatile unsigned char *)(0xcf00002c)) |
| 77 | #define GPIOA_INPUT_VAL (*(volatile unsigned char *)(0xcf000030)) |
| 78 | #define GPIOB_INPUT_VAL (*(volatile unsigned char *)(0xcf000034)) |
| 79 | #define GPIOC_INPUT_VAL (*(volatile unsigned char *)(0xcf000038)) |
| 80 | #define GPIOD_INPUT_VAL (*(volatile unsigned char *)(0xcf00003c)) |
| 81 | #define GPIOA_INT_STAT (*(volatile unsigned char *)(0xcf000040)) |
| 82 | #define GPIOB_INT_STAT (*(volatile unsigned char *)(0xcf000044)) |
| 83 | #define GPIOC_INT_STAT (*(volatile unsigned char *)(0xcf000048)) |
| 84 | #define GPIOD_INT_STAT (*(volatile unsigned char *)(0xcf00004c)) |
| 85 | #define GPIOA_INT_EN (*(volatile unsigned char *)(0xcf000050)) |
| 86 | #define GPIOB_INT_EN (*(volatile unsigned char *)(0xcf000054)) |
| 87 | #define GPIOC_INT_EN (*(volatile unsigned char *)(0xcf000058)) |
| 88 | #define GPIOD_INT_EN (*(volatile unsigned char *)(0xcf00005c)) |
| 89 | #define GPIOA_INT_LEV (*(volatile unsigned char *)(0xcf000060)) |
| 90 | #define GPIOB_INT_LEV (*(volatile unsigned char *)(0xcf000064)) |
| 91 | #define GPIOC_INT_LEV (*(volatile unsigned char *)(0xcf000068)) |
| 92 | #define GPIOD_INT_LEV (*(volatile unsigned char *)(0xcf00006c)) |
| 93 | #define GPIOA_INT_CLR (*(volatile unsigned char *)(0xcf000070)) |
| 94 | #define GPIOB_INT_CLR (*(volatile unsigned char *)(0xcf000074)) |
| 95 | #define GPIOC_INT_CLR (*(volatile unsigned char *)(0xcf000078)) |
| 96 | #define GPIOD_INT_CLR (*(volatile unsigned char *)(0xcf00007c)) |
Dave Chapman | d16a8b8 | 2006-02-05 16:52:22 +0000 | [diff] [blame] | 97 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 98 | #define CPU_INT_STAT (*(volatile unsigned long *)(0xcf001000)) |
Jens Arnold | fbfe6d6 | 2008-04-03 21:48:41 +0000 | [diff] [blame] | 99 | #define COP_INT_STAT (*(volatile unsigned long *)(0xcf001004)) |
| 100 | #define CPU_FIQ_STAT (*(volatile unsigned long *)(0xcf001008)) |
| 101 | #define COP_FIQ_STAT (*(volatile unsigned long *)(0xcf00100c)) |
| 102 | |
| 103 | #define INT_STAT (*(volatile unsigned long *)(0xcf001010)) |
| 104 | #define INT_FORCED_STAT (*(volatile unsigned long *)(0xcf001014)) |
| 105 | #define INT_FORCED_SET (*(volatile unsigned long *)(0xcf001018)) |
| 106 | #define INT_FORCED_CLR (*(volatile unsigned long *)(0xcf00101c)) |
| 107 | |
| 108 | #define CPU_INT_EN_STAT (*(volatile unsigned long *)(0xcf001020)) |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 109 | #define CPU_INT_EN (*(volatile unsigned long *)(0xcf001024)) |
Michael Sevakis | 191320c | 2008-06-03 05:08:24 +0000 | [diff] [blame] | 110 | #define CPU_INT_DIS (*(volatile unsigned long *)(0xcf001028)) |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 111 | #define CPU_INT_PRIORITY (*(volatile unsigned long *)(0xcf00102c)) |
Jens Arnold | fbfe6d6 | 2008-04-03 21:48:41 +0000 | [diff] [blame] | 112 | |
| 113 | #define COP_INT_EN_STAT (*(volatile unsigned long *)(0xcf001030)) |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 114 | #define COP_INT_EN (*(volatile unsigned long *)(0xcf001034)) |
Michael Sevakis | 191320c | 2008-06-03 05:08:24 +0000 | [diff] [blame] | 115 | #define COP_INT_DIS (*(volatile unsigned long *)(0xcf001038)) |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 116 | #define COP_INT_PRIORITY (*(volatile unsigned long *)(0xcf00103c)) |
Dave Chapman | d16a8b8 | 2006-02-05 16:52:22 +0000 | [diff] [blame] | 117 | |
| 118 | #define IDE_IRQ 1 |
| 119 | #define SER0_IRQ 4 |
| 120 | #define I2S_IRQ 5 |
| 121 | #define SER1_IRQ 7 |
| 122 | #define TIMER1_IRQ 11 |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 123 | #define TIMER2_IRQ 12 |
Dave Chapman | d16a8b8 | 2006-02-05 16:52:22 +0000 | [diff] [blame] | 124 | #define GPIO_IRQ 14 |
| 125 | #define DMA_OUT_IRQ 30 |
| 126 | #define DMA_IN_IRQ 31 |
| 127 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 128 | #define IDE_MASK (1 << IDE_IRQ) |
| 129 | #define SER0_MASK (1 << SER0_IRQ) |
| 130 | #define I2S_MASK (1 << I2S_IRQ) |
| 131 | #define SER1_MASK (1 << SER1_IRQ) |
| 132 | #define TIMER1_MASK (1 << TIMER1_IRQ) |
| 133 | #define TIMER2_MASK (1 << TIMER2_IRQ) |
| 134 | #define GPIO_MASK (1 << GPIO_IRQ) |
| 135 | #define DMA_OUT_MASK (1 << DMA_OUT_IRQ) |
| 136 | #define DMA_IN_MASK (1 << DMA_IN_IRQ) |
Dave Chapman | a1e2a52 | 2006-02-26 20:29:29 +0000 | [diff] [blame] | 137 | |
Michael Sevakis | 6077e5b | 2007-10-06 22:27:27 +0000 | [diff] [blame] | 138 | /* Yes, there is I2S_MASK but this cleans up the pcm code */ |
| 139 | #define IIS_MASK DMA_OUT_MASK |
Jens Arnold | 85568d6 | 2007-07-10 20:47:01 +0000 | [diff] [blame] | 140 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 141 | #define TIMER1_CFG (*(volatile unsigned long *)(0xcf001100)) |
| 142 | #define TIMER1_VAL (*(volatile unsigned long *)(0xcf001104)) |
| 143 | #define TIMER2_CFG (*(volatile unsigned long *)(0xcf001108)) |
| 144 | #define TIMER2_VAL (*(volatile unsigned long *)(0xcf00110c)) |
Jens Arnold | 85568d6 | 2007-07-10 20:47:01 +0000 | [diff] [blame] | 145 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 146 | #define USEC_TIMER (*(volatile unsigned long *)(0xcf001110)) |
Dave Chapman | fda1498 | 2007-02-23 23:22:03 +0000 | [diff] [blame] | 147 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 148 | #define TIMING1_CTL (*(volatile unsigned long *)(0xcf004000)) |
| 149 | #define TIMING2_CTL (*(volatile unsigned long *)(0xcf004008)) |
Barry Wardell | 620c62e | 2007-02-16 22:28:07 +0000 | [diff] [blame] | 150 | |
Jens Arnold | c9fca1e | 2007-11-03 08:09:07 +0000 | [diff] [blame] | 151 | #define PP_VER1 (*(volatile unsigned long *)(0xcf004030)) |
| 152 | #define PP_VER2 (*(volatile unsigned long *)(0xcf004034)) |
| 153 | #define PP_VER3 (*(volatile unsigned long *)(0xcf004038)) |
| 154 | #define PP_VER4 (*(volatile unsigned long *)(0xcf00403c)) |
| 155 | |
Michael Sevakis | a8b388f | 2007-11-27 01:20:26 +0000 | [diff] [blame] | 156 | /* Processors Control */ |
| 157 | #define PROC_STAT (*(volatile unsigned long *)(0xcf004050)) |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 158 | #define CPU_CTL (*(volatile unsigned char *)(0xcf004054)) |
| 159 | #define COP_CTL (*(volatile unsigned char *)(0xcf004058)) |
| 160 | |
Michael Sevakis | a8b388f | 2007-11-27 01:20:26 +0000 | [diff] [blame] | 161 | #define CPU_SLEEPING 0x8000 |
| 162 | #define COP_SLEEPING 0x4000 |
| 163 | #define PROC_SLEEPING(core) (0x8000 >> (core)) |
| 164 | |
Michael Sevakis | a9b2fb5 | 2007-10-16 01:25:17 +0000 | [diff] [blame] | 165 | #define PROC_CTL(core) ((&CPU_CTL)[(core)*4]) |
| 166 | |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 167 | #define PROC_SLEEP 0xca |
| 168 | #define PROC_WAKE 0xce |
| 169 | |
Michael Sevakis | a8b388f | 2007-11-27 01:20:26 +0000 | [diff] [blame] | 170 | /* Cache Control */ |
| 171 | #define CACHE_CTL (*(volatile unsigned long *)(0xcf004024)) |
| 172 | #define CACHE_RUN 0x1 |
| 173 | #define CACHE_INIT 0x2 |
| 174 | |
| 175 | #define CACHE_MASK (*(volatile unsigned long *)(0xf000f020)) |
| 176 | #define CACHE_OPERATION (*(volatile unsigned long *)(0xf000f024)) |
| 177 | #define CACHE_FLUSH_BASE (*(volatile unsigned long *)(0xf000c000)) |
| 178 | #define CACHE_INVALIDATE_BASE (*(volatile unsigned long *)(0xf0004000)) |
| 179 | #define CACHE_SIZE 0x2000 /* PP5002 has 8KB cache */ |
| 180 | |
| 181 | #define CACHE_OP_UNKNOWN1 (1<<11) /* 0x800 */ |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 182 | |
| 183 | #define DEV_EN (*(volatile unsigned long *)(0xcf005000)) |
| 184 | #define DEV_RS (*(volatile unsigned long *)(0xcf005030)) |
| 185 | |
| 186 | #define DEV_I2C (1<<8) |
| 187 | #define DEV_USB 0x400000 |
| 188 | |
| 189 | #define CLOCK_ENABLE (*(volatile unsigned long *)(0xcf005008)) |
| 190 | #define CLOCK_SOURCE (*(volatile unsigned long *)(0xcf00500c)) |
| 191 | #define PLL_CONTROL (*(volatile unsigned long *)(0xcf005010)) |
| 192 | #define PLL_DIV (*(volatile unsigned long *)(0xcf005018)) |
| 193 | #define PLL_MULT (*(volatile unsigned long *)(0xcf00501c)) |
Jens Arnold | 1bc3b7f | 2007-07-31 10:56:50 +0000 | [diff] [blame] | 194 | #define PLL_UNLOCK (*(volatile unsigned long *)(0xcf005038)) |
Jens Arnold | 604e44d | 2007-07-29 07:50:34 +0000 | [diff] [blame] | 195 | |
| 196 | #define MMAP0_LOGICAL (*(volatile unsigned long *)(0xf000f000)) |
| 197 | #define MMAP0_PHYSICAL (*(volatile unsigned long *)(0xf000f004)) |
| 198 | #define MMAP1_LOGICAL (*(volatile unsigned long *)(0xf000f008)) |
| 199 | #define MMAP1_PHYSICAL (*(volatile unsigned long *)(0xf000f00c)) |
| 200 | #define MMAP2_LOGICAL (*(volatile unsigned long *)(0xf000f010)) |
| 201 | #define MMAP2_PHYSICAL (*(volatile unsigned long *)(0xf000f014)) |
| 202 | #define MMAP3_LOGICAL (*(volatile unsigned long *)(0xf000f018)) |
| 203 | #define MMAP3_PHYSICAL (*(volatile unsigned long *)(0xf000f01c)) |
| 204 | |
Dave Chapman | d16a8b8 | 2006-02-05 16:52:22 +0000 | [diff] [blame] | 205 | #endif |