1
2
3
4
5
6 #ifndef __ASM_POWERPC_MPC5121_H__
7 #define __ASM_POWERPC_MPC5121_H__
8
9
10 struct mpc512x_reset_module {
11 u32 rcwlr;
12 u32 rcwhr;
13 u32 reserved1;
14 u32 reserved2;
15 u32 rsr;
16 u32 rmr;
17 u32 rpr;
18 u32 rcr;
19 u32 rcer;
20 };
21
22
23
24
25 struct mpc512x_ccm {
26 u32 spmr;
27 u32 sccr1;
28 u32 sccr2;
29 u32 scfr1;
30 u32 scfr2;
31 u32 scfr2s;
32 u32 bcr;
33 u32 psc_ccr[12];
34 u32 spccr;
35 u32 cccr;
36 u32 dccr;
37 u32 mscan_ccr[4];
38 u32 out_ccr[4];
39 u32 rsv0[2];
40 u32 scfr3;
41 u32 rsv1[3];
42 u32 spll_lock_cnt;
43 u8 res[0x6c];
44 };
45
46
47
48
49 struct mpc512x_lpc {
50 u32 cs_cfg[8];
51 u32 cs_ctrl;
52 u32 cs_status;
53 u32 burst_ctrl;
54 u32 deadcycle_ctrl;
55 u32 holdcycle_ctrl;
56 u32 alt;
57 };
58
59 int mpc512x_cs_config(unsigned int cs, u32 val);
60
61
62
63
64 struct mpc512x_lpbfifo {
65 u32 pkt_size;
66 u32 start_addr;
67 u32 ctrl;
68 u32 enable;
69 u32 reserved1;
70 u32 status;
71 u32 bytes_done;
72 u32 emb_sc;
73 u32 emb_pc;
74 u32 reserved2[7];
75 u32 data_word;
76 u32 fifo_status;
77 u32 fifo_ctrl;
78 u32 fifo_alarm;
79 };
80
81 #define MPC512X_SCLPC_START (1 << 31)
82 #define MPC512X_SCLPC_CS(x) (((x) & 0x7) << 24)
83 #define MPC512X_SCLPC_FLUSH (1 << 17)
84 #define MPC512X_SCLPC_READ (1 << 16)
85 #define MPC512X_SCLPC_DAI (1 << 8)
86 #define MPC512X_SCLPC_BPT(x) ((x) & 0x3f)
87 #define MPC512X_SCLPC_RESET (1 << 24)
88 #define MPC512X_SCLPC_FIFO_RESET (1 << 16)
89 #define MPC512X_SCLPC_ABORT_INT_ENABLE (1 << 9)
90 #define MPC512X_SCLPC_NORM_INT_ENABLE (1 << 8)
91 #define MPC512X_SCLPC_ENABLE (1 << 0)
92 #define MPC512X_SCLPC_SUCCESS (1 << 24)
93 #define MPC512X_SCLPC_FIFO_CTRL(x) (((x) & 0x7) << 24)
94 #define MPC512X_SCLPC_FIFO_ALARM(x) ((x) & 0x3ff)
95
96 enum lpb_dev_portsize {
97 LPB_DEV_PORTSIZE_UNDEFINED = 0,
98 LPB_DEV_PORTSIZE_1_BYTE = 1,
99 LPB_DEV_PORTSIZE_2_BYTES = 2,
100 LPB_DEV_PORTSIZE_4_BYTES = 4,
101 LPB_DEV_PORTSIZE_8_BYTES = 8
102 };
103
104 enum mpc512x_lpbfifo_req_dir {
105 MPC512X_LPBFIFO_REQ_DIR_READ,
106 MPC512X_LPBFIFO_REQ_DIR_WRITE
107 };
108
109 struct mpc512x_lpbfifo_request {
110 phys_addr_t dev_phys_addr;
111 void *ram_virt_addr;
112 u32 size;
113 enum lpb_dev_portsize portsize;
114 enum mpc512x_lpbfifo_req_dir dir;
115 void (*callback)(struct mpc512x_lpbfifo_request *);
116 };
117
118 int mpc512x_lpbfifo_submit(struct mpc512x_lpbfifo_request *req);
119
120 #endif