summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/mach-powertv/asic_regs.h
blob: 9a65c93782f94d7d37b9c488cc8703d7f820b809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * Copyright (C) 2009  Cisco Systems, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __ASM_MACH_POWERTV_ASIC_H_
#define __ASM_MACH_POWERTV_ASIC_H_
#include <linux/io.h>

/* ASIC types */
enum asic_type {
	ASIC_UNKNOWN,
	ASIC_ZEUS,
	ASIC_CALLIOPE,
	ASIC_CRONUS,
	ASIC_CRONUSLITE,
	ASICS
};

/* hardcoded values read from Chip Version registers */
#define CRONUS_10	0x0B4C1C20
#define CRONUS_11	0x0B4C1C21
#define CRONUSLITE_10	0x0B4C1C40

#define NAND_FLASH_BASE	0x03000000
#define ZEUS_IO_BASE	0x09000000
#define CALLIOPE_IO_BASE	0x08000000
#define CRONUS_IO_BASE	0x09000000
#define ASIC_IO_SIZE	0x01000000

/* Definitions for backward compatibility */
#define UART1_INTSTAT	uart1_intstat
#define UART1_INTEN	uart1_inten
#define UART1_CONFIG1	uart1_config1
#define UART1_CONFIG2	uart1_config2
#define UART1_DIVISORHI	uart1_divisorhi
#define UART1_DIVISORLO	uart1_divisorlo
#define UART1_DATA	uart1_data
#define UART1_STATUS	uart1_status

/* ASIC register enumeration */
struct register_map {
	u32 eic_slow0_strt_add;
	u32 eic_cfg_bits;
	u32 eic_ready_status;

	u32 chipver3;
	u32 chipver2;
	u32 chipver1;
	u32 chipver0;

	u32 uart1_intstat;
	u32 uart1_inten;
	u32 uart1_config1;
	u32 uart1_config2;
	u32 uart1_divisorhi;
	u32 uart1_divisorlo;
	u32 uart1_data;
	u32 uart1_status;

	u32 int_stat_3;
	u32 int_stat_2;
	u32 int_stat_1;
	u32 int_stat_0;
	u32 int_config;
	u32 int_int_scan;
	u32 ien_int_3;
	u32 ien_int_2;
	u32 ien_int_1;
	u32 ien_int_0;
	u32 int_level_3_3;
	u32 int_level_3_2;
	u32 int_level_3_1;
	u32 int_level_3_0;
	u32 int_level_2_3;
	u32 int_level_2_2;
	u32 int_level_2_1;
	u32 int_level_2_0;
	u32 int_level_1_3;
	u32 int_level_1_2;
	u32 int_level_1_1;
	u32 int_level_1_0;
	u32 int_level_0_3;
	u32 int_level_0_2;
	u32 int_level_0_1;
	u32 int_level_0_0;
	u32 int_docsis_en;

	u32 mips_pll_setup;
	u32 usb_fs;
	u32 test_bus;
	u32 crt_spare;
	u32 usb2_ohci_int_mask;
	u32 usb2_strap;
	u32 ehci_hcapbase;
	u32 ohci_hc_revision;
	u32 bcm1_bs_lmi_steer;
	u32 usb2_control;
	u32 usb2_stbus_obc;
	u32 usb2_stbus_mess_size;
	u32 usb2_stbus_chunk_size;

	u32 pcie_regs;
	u32 tim_ch;
	u32 tim_cl;
	u32 gpio_dout;
	u32 gpio_din;
	u32 gpio_dir;
	u32 watchdog;
	u32 front_panel;

	u32 register_maps;
};

extern enum asic_type asic;
extern const struct register_map *register_map;
extern unsigned long asic_phy_base;	/* Physical address of ASIC */
extern unsigned long asic_base;		/* Virtual address of ASIC */

/*
 * Macros to interface to registers through their ioremapped address
 * asic_reg_offset	Returns the offset of a given register from the start
 *			of the ASIC address space
 * asic_reg_phys_addr	Returns the physical address of the given register
 * asic_reg_addr	Returns the iomapped virtual address of the given
 *			register.
 */
#define asic_reg_offset(x)	(register_map->x)
#define asic_reg_phys_addr(x)	(asic_phy_base + asic_reg_offset(x))
#define asic_reg_addr(x) \
	((unsigned int *) (asic_base + asic_reg_offset(x)))

/*
 * The asic_reg macro is gone. It should be replaced by either asic_read or
 * asic_write, as appropriate.
 */

#define asic_read(x)		readl(asic_reg_addr(x))
#define asic_write(v, x)	writel(v, asic_reg_addr(x))

extern void asic_irq_init(void);
#endif