[ifxmips]:
[openwrt/svn-archive/archive.git] / package / ifxmips-dsl-api / patches-2.6.33 / 400-debug-output.patch
1 --- a/src/mei/ifxmips_mei.c
2 +++ b/src/mei/ifxmips_mei.c
3 @@ -79,8 +79,8 @@
4 #define ifxmips_w32(val, reg) __raw_writel(val, reg)
5 #define ifxmips_w32_mask(clear, set, reg) ifxmips_w32((ifxmips_r32(reg) & ~clear) | set, reg)
6 */
7 -#define IFX_MEI_EMSG(fmt, args...) printk(KERN_ERR "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
8 -#define IFX_MEI_DMSG(fmt, args...) printk(KERN_INFO "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
9 +#define IFX_MEI_EMSG(fmt, args...) pr_err("[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
10 +#define IFX_MEI_DMSG(fmt, args...) pr_debug("[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
11
12 #ifdef CONFIG_IFXMIPS_MEI_FW_LOOPBACK
13 //#define DFE_MEM_TEST
14 @@ -1301,7 +1301,7 @@ IFX_MEI_RunAdslModem (DSL_DEV_Device_t *
15 IFX_MEI_EMSG (">>> malloc fail for codeswap buff!!! <<<\n");
16 return DSL_DEV_MEI_ERR_FAILURE;
17 }
18 - printk("allocate %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff);
19 + IFX_MEI_DMSG("allocate %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff);
20 }
21
22 DSL_DEV_PRIVATE(pDev)->img_hdr =
23 @@ -1476,7 +1476,7 @@ IFX_MEI_DFEMemoryFree (DSL_DEV_Device_t
24 }
25
26 if(mei_arc_swap_buff != NULL){
27 - printk("free %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff);
28 + IFX_MEI_DMSG("free %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff);
29 kfree(mei_arc_swap_buff);
30 mei_arc_swap_buff=NULL;
31 }
32 @@ -1496,7 +1496,7 @@ IFX_MEI_DFEMemoryAlloc (DSL_DEV_Device_t
33 // DSL_DEV_PRIVATE(pDev)->adsl_mem_info;
34 int allocate_size = SDRAM_SEGMENT_SIZE;
35
36 - printk(KERN_INFO "[%s %d]: image_size = %ld\n", __func__, __LINE__, size);
37 + IFX_MEI_DMSG("image_size = %ld\n", size);
38 // Alloc Swap Pages
39 for (idx = 0; size > 0 && idx < MAX_BAR_REGISTERS; idx++) {
40 // skip bar15 for XDATA usage.
41 @@ -1596,7 +1596,7 @@ DSL_BSP_FWDownload (DSL_DEV_Device_t * p
42 ssize_t retval = -ENOMEM;
43 int idx = 0;
44
45 - printk("\n%s\n", __func__);
46 + IFX_MEI_DMSG("\n");
47
48 if (*loff == 0) {
49 if (size < sizeof (img_hdr_tmp)) {
50 @@ -1648,7 +1648,7 @@ DSL_BSP_FWDownload (DSL_DEV_Device_t * p
51 goto error;
52 }
53 adsl_mem_info[XDATA_REGISTER].type = FREE_RELOAD;
54 - printk(KERN_INFO "[%s %d] -> IFX_MEI_BarUpdate()\n", __func__, __LINE__);
55 + IFX_MEI_DMSG("-> IFX_MEI_BarUpdate()\n");
56 IFX_MEI_BarUpdate (pDev, (DSL_DEV_PRIVATE(pDev)->nBar));
57 }
58 else if (DSL_DEV_PRIVATE(pDev)-> image_size == 0) {
59 @@ -1927,7 +1927,7 @@ static void
60 WriteMbox (u32 * mboxarray, u32 size)
61 {
62 IFX_MEI_DebugWrite (&dsl_devices[0], IMBOX_BASE, mboxarray, size);
63 - printk ("write to %X\n", IMBOX_BASE);
64 + IFX_MEI_DMSG("write to %X\n", IMBOX_BASE);
65 IFX_MEI_LongWordWriteOffset (&dsl_devices[0], (u32) ME_ME2ARC_INT, MEI_TO_ARC_MSGAV);
66 }
67
68 @@ -1936,7 +1936,7 @@ static void
69 ReadMbox (u32 * mboxarray, u32 size)
70 {
71 IFX_MEI_DebugRead (&dsl_devices[0], OMBOX_BASE, mboxarray, size);
72 - printk ("read from %X\n", OMBOX_BASE);
73 + IFX_MEI_DMSG("read from %X\n", OMBOX_BASE);
74 }
75
76 static void
77 @@ -1966,7 +1966,7 @@ arc_code_page_download (uint32_t arc_cod
78 {
79 int count;
80
81 - printk ("try to download pages,size=%d\n", arc_code_length);
82 + IFX_MEI_DMSG("try to download pages,size=%d\n", arc_code_length);
83 IFX_MEI_ControlModeSet (&dsl_devices[0], MEI_MASTER_MODE);
84 IFX_MEI_HaltArc (&dsl_devices[0]);
85 IFX_MEI_LongWordWriteOffset (&dsl_devices[0], (u32) ME_DX_AD, 0);
86 @@ -2005,21 +2005,21 @@ dfe_loopback_irq_handler (DSL_DEV_Device
87 memset (&rd_mbox[0], 0, 10 * 4);
88 ReadMbox (&rd_mbox[0], 6);
89 if (rd_mbox[0] == 0x0) {
90 - printk ("Get ARC_ACK\n");
91 + FX_MEI_DMSG("Get ARC_ACK\n");
92 got_int = 1;
93 }
94 else if (rd_mbox[0] == 0x5) {
95 - printk ("Get ARC_BUSY\n");
96 + IFX_MEI_DMSG("Get ARC_BUSY\n");
97 got_int = 2;
98 }
99 else if (rd_mbox[0] == 0x3) {
100 - printk ("Get ARC_EDONE\n");
101 + IFX_MEI_DMSG("Get ARC_EDONE\n");
102 if (rd_mbox[1] == 0x0) {
103 got_int = 3;
104 - printk ("Get E_MEMTEST\n");
105 + IFX_MEI_DMSG("Get E_MEMTEST\n");
106 if (rd_mbox[2] != 0x1) {
107 got_int = 4;
108 - printk ("Get Result %X\n", rd_mbox[2]);
109 + IFX_MEI_DMSG("Get Result %X\n", rd_mbox[2]);
110 }
111 }
112 }
113 @@ -2037,21 +2037,21 @@ wait_mem_test_result (void)
114 uint32_t mbox[5];
115 mbox[0] = 0;
116
117 - printk ("Waiting Starting\n");
118 + IFX_MEI_DMSG("Waiting Starting\n");
119 while (mbox[0] == 0) {
120 ReadMbox (&mbox[0], 5);
121 }
122 - printk ("Try to get mem test result.\n");
123 + IFX_MEI_DMSG("Try to get mem test result.\n");
124 ReadMbox (&mbox[0], 5);
125 if (mbox[0] == 0xA) {
126 - printk ("Success.\n");
127 + IFX_MEI_DMSG("Success.\n");
128 }
129 else if (mbox[0] == 0xA) {
130 - printk ("Fail,address %X,except data %X,receive data %X\n",
131 + IFX_MEI_EMSG("Fail,address %X,except data %X,receive data %X\n",
132 mbox[1], mbox[2], mbox[3]);
133 }
134 else {
135 - printk ("Fail\n");
136 + IFX_MEI_EMSG("Fail\n");
137 }
138 }
139
140 @@ -2067,7 +2067,7 @@ arc_ping_testing (DSL_DEV_Device_t *pDev
141 rd_mbox[i] = 0;
142 }
143
144 - printk ("send ping msg\n");
145 + FX_MEI_DMSG("send ping msg\n");
146 wr_mbox[0] = MEI_PING;
147 WriteMbox (&wr_mbox[0], 10);
148
149 @@ -2075,7 +2075,7 @@ arc_ping_testing (DSL_DEV_Device_t *pDev
150 MEI_WAIT (100);
151 }
152
153 - printk ("send start event\n");
154 + IFX_MEI_DMSG("send start event\n");
155 got_int = 0;
156
157 wr_mbox[0] = 0x4;
158 @@ -2094,14 +2094,14 @@ arc_ping_testing (DSL_DEV_Device_t *pDev
159 IFX_MEI_LongWordWriteOffset (&dsl_devices[0],
160 (u32) ME_ME2ARC_INT,
161 MEI_TO_ARC_MSGAV);
162 - printk ("sleeping\n");
163 + IFX_MEI_DMSG("sleeping\n");
164 while (1) {
165 if (got_int > 0) {
166
167 if (got_int > 3)
168 - printk ("got_int >>>> 3\n");
169 + IFX_MEI_DMSG("got_int >>>> 3\n");
170 else
171 - printk ("got int = %d\n", got_int);
172 + IFX_MEI_DMSG("got int = %d\n", got_int);
173 got_int = 0;
174 //schedule();
175 DSL_ENABLE_IRQ (pDev->nIrq[IFX_DFEIR]);
176 @@ -2152,7 +2152,7 @@ DFE_Loopback_Test (void)
177 DSL_DEV_PRIVATE(pDev)->adsl_mem_info[idx].type = FREE_RELOAD;
178 IFX_MEI_WRITE_REGISTER_L ((((uint32_t) DSL_DEV_PRIVATE(pDev)->adsl_mem_info[idx].address) & 0x0fffffff),
179 IFXMIPS_MEI_BASE_ADDR + ME_XMEM_BAR_BASE + idx * 4);
180 - printk ("bar%d(%X)=%X\n", idx,
181 + IFX_MEI_DMSG("bar%d(%X)=%X\n", idx,
182 IFXMIPS_MEI_BASE_ADDR + ME_XMEM_BAR_BASE +
183 idx * 4, (((uint32_t)
184 ((ifx_mei_device_private_t *)
185 @@ -2169,20 +2169,20 @@ DFE_Loopback_Test (void)
186 return DSL_DEV_MEI_ERR_FAILURE;
187 }
188 //WriteARCreg(AUX_IC_CTRL,2);
189 - printk(KERN_INFO "[%s %s %d]: Setting MEI_MASTER_MODE..\n", __FILE__, __func__, __LINE__);
190 + IFX_MEI_DMSG("Setting MEI_MASTER_MODE..\n");
191 IFX_MEI_ControlModeSet (pDev, MEI_MASTER_MODE);
192 #define AUX_IC_CTRL 0x11
193 _IFX_MEI_DBGLongWordWrite (pDev, MEI_DEBUG_DEC_AUX_MASK,
194 AUX_IC_CTRL, 2);
195 - printk(KERN_INFO "[%s %s %d]: Setting JTAG_MASTER_MODE..\n", __FILE__, __func__, __LINE__);
196 + IFX_MEI_DMSG("Setting JTAG_MASTER_MODE..\n");
197 IFX_MEI_ControlModeSet (pDev, JTAG_MASTER_MODE);
198
199 - printk(KERN_INFO "[%s %s %d]: Halting ARC...\n", __FILE__, __func__, __LINE__);
200 + IFX_MEI_DMSG("Halting ARC...\n");
201 IFX_MEI_HaltArc (&dsl_devices[0]);
202
203 #ifdef DFE_PING_TEST
204
205 - printk ("ping test image size=%d\n", sizeof (arc_ahb_access_code));
206 + IFX_MEI_DMSG("ping test image size=%d\n", sizeof (arc_ahb_access_code));
207 memcpy ((u8 *) (DSL_DEV_PRIVATE(pDev)->
208 adsl_mem_info[0].address + 0x1004),
209 &arc_ahb_access_code[0], sizeof (arc_ahb_access_code));
210 @@ -2190,13 +2190,13 @@ DFE_Loopback_Test (void)
211
212 #endif //DFE_PING_TEST
213
214 - printk ("ARC ping test code download complete\n");
215 + IFX_MEI_DMSG("ARC ping test code download complete\n");
216 #endif //defined( DFE_PING_TEST )|| defined( DFE_ATM_LOOPBACK)
217 #ifdef DFE_MEM_TEST
218 IFX_MEI_LongWordWriteOffset (&dsl_devices[0], (u32) ME_ARC2ME_MASK, MSGAV_EN);
219
220 arc_code_page_download (1537, &code_array[0]);
221 - printk ("ARC mem test code download complete\n");
222 + IFX_MEI_DMSG("ARC mem test code download complete\n");
223 #endif //DFE_MEM_TEST
224 #ifdef DFE_ATM_LOOPBACK
225 arc_debug_data = 0xf;
226 @@ -2215,7 +2215,7 @@ DFE_Loopback_Test (void)
227 IFX_MEI_DebugWrite (&dsl_devices[0], 0x32010, &arc_debug_data, 1);
228 #endif //DFE_ATM_LOOPBACK
229 IFX_MEI_IRQEnable (pDev);
230 - printk(KERN_INFO "[%s %s %d]: run ARC...\n", __FILE__, __func__, __LINE__);
231 + IFX_MEI_DMSG("run ARC...\n");
232 IFX_MEI_RunArc (&dsl_devices[0]);
233
234 #ifdef DFE_PING_TEST
235 @@ -2526,7 +2526,7 @@ IFX_MEI_Ioctls (DSL_DEV_Device_t * pDev,
236 break;
237
238 case DSL_FIO_BSP_DSL_START:
239 - printk("\n%s: DSL_FIO_BSP_DSL_START\n",__func__);
240 + IFX_MEI_DMSG("DSL_FIO_BSP_DSL_START\n");
241 if ((meierr = IFX_MEI_RunAdslModem (pDev)) != DSL_DEV_MEI_ERR_SUCCESS) {
242 IFX_MEI_EMSG ("IFX_MEI_RunAdslModem() error...");
243 meierr = DSL_DEV_MEI_ERR_FAILURE;
244 @@ -2927,11 +2927,11 @@ IFX_MEI_ModuleInit (void)
245 int i = 0;
246 static struct class *dsl_class;
247
248 - printk ("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision);
249 + pr_info("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision);
250
251 for (i = 0; i < BSP_MAX_DEVICES; i++) {
252 if (IFX_MEI_InitDevice (i) != 0) {
253 - printk ("%s: Init device fail!\n", __FUNCTION__);
254 + IFX_MEI_EMSG("Init device fail!\n");
255 return -EIO;
256 }
257 IFX_MEI_InitDevNode (i);
258 @@ -2943,7 +2943,7 @@ IFX_MEI_ModuleInit (void)
259 dsl_bsp_event_callback[i].function = NULL;
260
261 #ifdef CONFIG_IFXMIPS_MEI_FW_LOOPBACK
262 - printk(KERN_INFO "[%s %s %d]: Start loopback test...\n", __FILE__, __func__, __LINE__);
263 + IFX_MEI_DMSG("Start loopback test...\n");
264 DFE_Loopback_Test ();
265 #endif
266 dsl_class = class_create(THIS_MODULE, "ifx_mei");
267 --- a/src/mei/ifxmips_atm_core.c
268 +++ b/src/mei/ifxmips_atm_core.c
269 @@ -2335,7 +2335,7 @@ static int atm_showtime_enter(struct por
270 IFX_REG_W32(0x0F, UTP_CFG);
271 #endif
272
273 - printk("enter showtime, cell rate: 0 - %d, 1 - %d, xdata addr: 0x%08x\n", g_atm_priv_data.port[0].tx_max_cell_rate, g_atm_priv_data.port[1].tx_max_cell_rate, (unsigned int)g_xdata_addr);
274 + pr_debug("enter showtime, cell rate: 0 - %d, 1 - %d, xdata addr: 0x%08x\n", g_atm_priv_data.port[0].tx_max_cell_rate, g_atm_priv_data.port[1].tx_max_cell_rate, (unsigned int)g_xdata_addr);
275
276 return IFX_SUCCESS;
277 }
278 @@ -2351,7 +2351,7 @@ static int atm_showtime_exit(void)
279 // TODO: ReTX clean state
280 g_xdata_addr = NULL;
281
282 - printk("leave showtime\n");
283 + pr_debug("leave showtime\n");
284
285 return IFX_SUCCESS;
286 }