2 * Copyright © 2008 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29 #include <sys/types.h>
30 #include <sys/ioctl.h>
33 #define CC_DATA CP2101_GPIO_MASK(0)
34 #define CC_CLOCK CP2101_GPIO_MASK(1)
35 #define CC_RESET_N CP2101_GPIO_MASK(2)
37 /* painfully slow for now */
38 #define CC_CLOCK_US (2 * 1000)
48 #define CC_CHIP_ERASE 0x14
50 #define CC_WR_CONFIG 0x1d
51 #define CC_RD_CONFIG 0x24
52 # define CC_CONFIG_TIMERS_OFF (1 << 3)
53 # define CC_CONFIG_DMA_PAUSE (1 << 2)
54 # define CC_CONFIG_TIMER_SUSPEND (1 << 1)
55 # define CC_SET_FLASH_INFO_PAGE (1 << 0)
57 #define CC_GET_PC 0x28
58 #define CC_READ_STATUS 0x34
59 # define CC_STATUS_CHIP_ERASE_DONE (1 << 7)
60 # define CC_STATUS_PCON_IDLE (1 << 6)
61 # define CC_STATUS_CPU_HALTED (1 << 5)
62 # define CC_STATUS_POWER_MODE_0 (1 << 4)
63 # define CC_STATUS_HALT_STATUS (1 << 3)
64 # define CC_STATUS_DEBUG_LOCKED (1 << 2)
65 # define CC_STATUS_OSCILLATOR_STABLE (1 << 1)
66 # define CC_STATUS_STACK_OVERFLOW (1 << 0)
68 #define CC_SET_HW_BRKPNT 0x3b
69 # define CC_HW_BRKPNT_N(n) ((n) << 3)
70 # define CC_HW_BRKPNT_N_MASK (0x3 << 3)
71 # define CC_HW_BRKPNT_ENABLE (1 << 2)
74 #define CC_RESUME 0x4c
75 #define CC_DEBUG_INSTR(n) (0x54|(n))
76 #define CC_STEP_INSTR 0x5c
77 #define CC_STEP_REPLACE (0x64|(n))
78 #define CC_GET_CHIP_ID 0x68
80 #endif /* _CCDBG_H_ */