diff options
author | Li Yang <leoli@freescale.com> | 2006-10-04 00:10:46 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-04 01:24:27 -0400 |
commit | 9865853851313e0d94a4acde42d6f9d8070bb376 (patch) | |
tree | 0f4cca2bda6d2a21b8beb02ec2883bf328f1935c /include/asm-powerpc/ucc.h | |
parent | 9a1ab883c04e43f9f9819c40eb435bcdc4136193 (diff) |
[POWERPC] Add QUICC Engine (QE) infrastructure
Add QUICC Engine (QE) configuration, header files, and
QE management and library code that are used by QE devices
drivers.
Includes Leo's modifications up to, and including, the
platform_device to of_device adaptation:
"The series of patches add generic QE infrastructure called
qe_lib, and MPC8360EMDS board support. Qe_lib is used by
QE device drivers such as ucc_geth driver.
This version updates QE interrupt controller to use new irq
mapping mechanism, addresses all the comments received with
last submission and includes some style fixes.
v2: Change to use device tree for BCSR and MURAM;
Remove I/O port interrupt handling code as it is not generic
enough.
v3: Address comments from Kumar; Update definition of several
device tree nodes; Copyright style change."
In addition, the following changes have been made:
o removed typedefs
o uint -> u32 conversions
o removed following defines:
QE_SIZEOF_BD, BD_BUFFER_ARG, BD_BUFFER_CLEAR, BD_BUFFER,
BD_STATUS_AND_LENGTH_SET, BD_STATUS_AND_LENGTH, and BD_BUFFER_SET
because they hid sizeof/in_be32/out_be32 operations from the reader.
o fixed qe_snums_init() serial num assignment to use a const array
o made CONFIG_UCC_FAST select UCC_SLOW
o reduced NR_QE_IC_INTS from 128 to 64
o remove _IO_BASE, etc. defines (not used)
o removed irrelevant comments, added others to resemble removed BD_ defines
o realigned struct definitions in headers
o various other style fixes including things like pinMask -> pin_mask
o fixed a ton of whitespace issues
o marked ioregs as __be32/__be16
o removed platform_device code and redundant get_qe_base()
o removed redundant comments
o added cpu_relax() to qe_reset
o uncasted all get_property() assignments
o eliminated unneeded casts
o eliminated immrbar_phys_to_virt (not used)
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Shlomi Gridish <gridish@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/ucc.h')
-rw-r--r-- | include/asm-powerpc/ucc.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/include/asm-powerpc/ucc.h b/include/asm-powerpc/ucc.h new file mode 100644 index 000000000000..afe3076bdc03 --- /dev/null +++ b/include/asm-powerpc/ucc.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. | ||
3 | * | ||
4 | * Authors: Shlomi Gridish <gridish@freescale.com> | ||
5 | * Li Yang <leoli@freescale.com> | ||
6 | * | ||
7 | * Description: | ||
8 | * Internal header file for UCC unit routines. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | ||
15 | #ifndef __UCC_H__ | ||
16 | #define __UCC_H__ | ||
17 | |||
18 | #include <asm/immap_qe.h> | ||
19 | #include <asm/qe.h> | ||
20 | |||
21 | #define STATISTICS | ||
22 | |||
23 | #define UCC_MAX_NUM 8 | ||
24 | |||
25 | /* Slow or fast type for UCCs. | ||
26 | */ | ||
27 | enum ucc_speed_type { | ||
28 | UCC_SPEED_TYPE_FAST, UCC_SPEED_TYPE_SLOW | ||
29 | }; | ||
30 | |||
31 | /* Initial UCCs Parameter RAM address relative to: MEM_MAP_BASE (IMMR). | ||
32 | */ | ||
33 | enum ucc_pram_initial_offset { | ||
34 | UCC_PRAM_OFFSET_UCC1 = 0x8400, | ||
35 | UCC_PRAM_OFFSET_UCC2 = 0x8500, | ||
36 | UCC_PRAM_OFFSET_UCC3 = 0x8600, | ||
37 | UCC_PRAM_OFFSET_UCC4 = 0x9000, | ||
38 | UCC_PRAM_OFFSET_UCC5 = 0x8000, | ||
39 | UCC_PRAM_OFFSET_UCC6 = 0x8100, | ||
40 | UCC_PRAM_OFFSET_UCC7 = 0x8200, | ||
41 | UCC_PRAM_OFFSET_UCC8 = 0x8300 | ||
42 | }; | ||
43 | |||
44 | /* ucc_set_type | ||
45 | * Sets UCC to slow or fast mode. | ||
46 | * | ||
47 | * ucc_num - (In) number of UCC (0-7). | ||
48 | * regs - (In) pointer to registers base for the UCC. | ||
49 | * speed - (In) slow or fast mode for UCC. | ||
50 | */ | ||
51 | int ucc_set_type(int ucc_num, struct ucc_common *regs, | ||
52 | enum ucc_speed_type speed); | ||
53 | |||
54 | /* ucc_init_guemr | ||
55 | * Init the Guemr register. | ||
56 | * | ||
57 | * regs - (In) pointer to registers base for the UCC. | ||
58 | */ | ||
59 | int ucc_init_guemr(struct ucc_common *regs); | ||
60 | |||
61 | int ucc_set_qe_mux_mii_mng(int ucc_num); | ||
62 | |||
63 | int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode); | ||
64 | |||
65 | int ucc_mux_set_grant_tsa_bkpt(int ucc_num, int set, u32 mask); | ||
66 | |||
67 | /* QE MUX clock routing for UCC | ||
68 | */ | ||
69 | static inline int ucc_set_qe_mux_grant(int ucc_num, int set) | ||
70 | { | ||
71 | return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_GRANT); | ||
72 | } | ||
73 | |||
74 | static inline int ucc_set_qe_mux_tsa(int ucc_num, int set) | ||
75 | { | ||
76 | return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_TSA); | ||
77 | } | ||
78 | |||
79 | static inline int ucc_set_qe_mux_bkpt(int ucc_num, int set) | ||
80 | { | ||
81 | return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_BKPT); | ||
82 | } | ||
83 | |||
84 | #endif /* __UCC_H__ */ | ||