-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdsl_hal_support.h
878 lines (792 loc) · 31.7 KB
/
dsl_hal_support.h
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
#ifndef DSL_HAL_SUPPORT_H__
#define DSL_HAL_SUPPORT_H__ 1
/*******************************************************************************
* FILE PURPOSE: DSL Driver API functions for Sangam
*
********************************************************************************
* FILE NAME: dsl_hal_functiondefines.c
*
* DESCRIPTION:
* Contains basic DSL HAL API declarations for Sangam
*
*
* (C) Copyright 2001-02, Texas Instruments, Inc.
* History
* Date Version Notes
* 06Feb03 0.00.00 RamP Created
* 21Mar03 0.00.01 RamP Removed byteswap functions
* 21Mar03 0.00.02 RamP Added extern osFreeVMemory declaration
* 10Apr03 0.00.03 RamP Changed declaration for loadFWImage &
* loadDebugFWImage to remove ptidsl param
* 12Apr03 0.00.04 RamP Added function to set Interrupt Bit
* Masks for bitfield & Mailboxes
* 14Apr03 0.00.05 RamP Added modem state bit field processing
* 15Apr03 0.00.06 RamP Added function osAllocateVMemory
* 21Apr03 0.01.00 RamP Added function osAllocateDmaMemory
* Added function osFreeDmaMemory
* (Alpha) Added macro virtual2Physical,
* 22Apr03 0.01.01 RamP Moved acknowledgeInterrupt to api.h
* 24Apr03 0.01.02 RamP Added checkOvelayPage function
* 29May03 0.01.03 RamP Added critical enter/exit function decl
* 06Jun03 0.01.04 RamP Added Interrupt source parsing function
* 06Oct03 0.01.05 RamP Added function abstraction switches
* 12Oct03 0.01.06 RamP Added ADSL2 Message function prototypes
* 14Nov03 0.03.07 RamP Added function to gather Rate Messages
* 29Apr04 0.03.08 RamP Added function to determine dsNumTones
* 26Aug04 0.03.09 Brian Made changes to support switching DSP
* frequency to 250Mhz
* 14June05 0.03.10 CPH Added dslhal_support_getTrainedModeEx()
* 20Jul05 0.03.11 CPH Added dslhal_support_shortSwap32()
* 26Jul05 0.05.00 CPH - Added dslhal_support_getTrainedMode(),
* dslhal_support_readInternalOffset(),
* dslhal_support_readOffset(),
* dslhal_support_getNumUsTones()
* - Rename dslhal_support_getNumTones() to dslhal_support_getNumDsTones()
* 7 Oct05 0.06.00 AV/CPH Changed dprintf to dgprintf and compile time
* selection of dslhal_api_getQLNpsds() dslhal_api_getSNRpsds()
* and for code size reduction.
* 04Nov05 0.11.00 CPH Fixed T1413 mode got Zero DS/US rate when DSL_BIT_TMODE is set.
*******************************************************************************/
#include <dsl_hal_api.h>
#define virtual2Physical(a) (((int)a)&~0xe0000000)
/* External Function Prototype Declarations */
extern unsigned int shim_osGetCpuFrequency(void);
extern void shim_osClockWait(int val);
extern unsigned int shim_osClockTick(void);
extern int shim_osStringCmp(const char *s1, const char *s2);
extern void dprintf( int uDbgLevel, char * szFmt, ...);
/*
#ifdef DEBUG_BUILD
#define dgprintf(uDbgLevel, szFmt, ...) dprintf(uDbgLevel, szFmt, ...)
#else
#define dgprintf(uDbgLevel, szFmt, ...)
#endif
*/
#ifdef DEBUG_BUILD
#define dgprintf dprintf
#else
#define dgprintf(uDbgLevel, szFmt, args...)
#endif
extern int shim_osLoadFWImage(unsigned char *firmwareImage);
extern int shim_osLoadDebugFWImage(unsigned char *debugFirmwareImage);
extern unsigned int shim_read_overlay_page(void *ptr, unsigned int secOffset, unsigned int secLength);
extern void shim_osMoveMemory(char *dst, char *src, unsigned int numBytes);
extern void shim_osZeroMemory(char *dst, unsigned int numBytes);
extern void *shim_osAllocateMemory(unsigned int size);
extern void *shim_osAllocateVMemory(unsigned int size);
extern void *shim_osAllocateDmaMemory(unsigned int size);
extern void shim_osFreeMemory(void *ptr, unsigned int size);
extern void shim_osFreeVMemory(void *ptr, unsigned int size);
extern void shim_osFreeDmaMemory(void *ptr, unsigned int size);
extern void shim_osWriteBackCache(void *pMem, unsigned int size);
extern void shim_osCriticalEnter(void);
extern void shim_osCriticalExit(void);
/*******************************************************************************************
* FUNCTION NAME: dslhal_support_writeHostMailbox
*
********************************************************************************************
* DESCRIPTION: Send a message to a mailbox
*
* ARGUMENTS: int cmd command to write
* int tag tag (currently unused)
* int p1 parameter 1 (currently unused)
* int p2 parameter 2 (currently unused)
*
* RETURNS: 0 if successful
* NZ otherwise
*
*******************************************************************************************/
int dslhal_support_writeHostMailbox
(tidsl_t *ptidsl,
int cmd,
int tag,
int p1,
int p2);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_readDspMailbox
*
*********************************************************************************************
* DESCRIPTION: Reads a message from the mailbox
*
* ARGUMENTS: int *pcmd Pointer to command read
*
* RETURNS: 0 if successful
* 1 if no mail
* NZ otherwise
*
*****************************************************************************************/
int dslhal_support_readDspMailbox
(tidsl_t *ptidsl,
int *pcmd,
int *ptag,
int *pprm1,
int *pprm2);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_readTextMailbox
*
*********************************************************************************************
* DESCRIPTION: Reads a message from the mailbox
*
* ARGUMENTS: int *pcmd Pointer to command read
*
* RETURNS: 0 if successful
* 1 if no mail
* NZ otherwise
*
*****************************************************************************************/
int dslhal_support_readTextMailbox
(tidsl_t *ptidsl,
int *pmsg1,
int *pmsg2);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_blockRead
*
*********************************************************************************************
* DESCRIPTION: This rouin simulates DSP memory read as done in ax5 pci nic card
*
* INPUT: void *addr, memory address to be read
* void *buffer, dat buffer to be filled with from memmory
* size_t count, number of bytes to be written
*
* RETURN: 0 --succeeded
* 1 --Failed
*
*****************************************************************************************/
int dslhal_support_blockRead
(void *addr,
void *buffer,
size_t count);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_blockWrite
*
*******************************************************************************************
* DESCRIPTION: This rouin simulates DSP memory write as done in ax5 pci nic card
*
* INPUT: void *buffer, data need to written
* void *adde, memory address to be written
* size_t count, number of bytes to be written
*
* RETURN: 0 --succeeded
* 1 --Failed
*
*****************************************************************************************/
int dslhal_support_blockWrite
(void *buffer,
void *addr,
size_t count);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_hostDspAddressTranslate
*
*******************************************************************************************
* DESCRIPTION: This function moves the address window to translate physical address
*
* INPUT: unsigned int addr : address that requires translation
*
* RETURN: Translated address or error condition
*
*
*****************************************************************************************/
unsigned int dslhal_support_hostDspAddressTranslate
( unsigned int addr
);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_unresetDslSubsystem
*
*******************************************************************************************
* DESCRIPTION: This function unreset Dsl Subsystem
*
* INPUT: None
*
* RETURN: 0 if Pass; 1 if Fail
*
*****************************************************************************************/
int dslhal_support_unresetDslSubsystem
(void
);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_unresetDsp()
*
*******************************************************************************************
* DESCRIPTION: This fuction takes ax5 daugter board out of reset.
*
* INPUT: None
*
* RETURN: 0 --successful.
* 1 --failed
*
*****************************************************************************************/
int dslhal_support_unresetDsp
(void
);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_resetDslSubsystem
*
*******************************************************************************************
* DESCRIPTION: This function unreset Dsl Subsystem
*
* INPUT: None
*
* RETURN: 0 if Pass; 1 if Fail
*
*****************************************************************************************/
int dslhal_support_resetDslSubsystem
(void
);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_resetDsp()
*
*******************************************************************************************
* DESCRIPTION: This fuction takes ax5 daugter board out of reset.
*
* INPUT: None
*
* RETURN: 0 --successful.
* 1 --failed
*
*****************************************************************************************/
int dslhal_support_resetDsp
(void
);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_setDsp250MHzTrigger(void)
*
*********************************************************************************************
* DESCRIPTION:
* Set the trigger to run DSP at 250Mhz.
*
* Input: none
*
* Return: >=0, success
* -1, failure
*
*
********************************************************************************************/
int dslhal_support_setDsp250MHzTrigger(tidsl_t *ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_hostDspCodeDownload()
*
*********************************************************************************************
* DESCRIPTION:
* download DSP image from host memory to dsp memory
*
* Return: 0 success
* 1 failed
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
int dslhal_support_hostDspCodeDownload
(tidsl_t * ptidsl
);
/********************************************************************************************
* FUNCTION NAME: dslhal_diags_digi_assignMemTestSpace()
*
*********************************************************************************************
* DESCRIPTION: Assigns Memory Space in SDRAM for External Memory Test
* Input: tidsl_t *ptidsl
*
* Return: 0 success
* 1 failed
*
********************************************************************************************/
unsigned int dslhal_diags_digi_assignMemTestSpace
(tidsl_t *ptidsl
);
/********************************************************************************************
* FUNCTION NAME: dslhal_diags_digi_readMemTestResult()
*
*********************************************************************************************
* DESCRIPTION: Reads Results of External Memory Test
* Input: tidsl_t *ptidsl
*
* Return: 0 success
* 1 failed
*
********************************************************************************************/
unsigned int dslhal_diags_digi_readMemTestResult
(tidsl_t *ptidsl,
unsigned int testResult
);
/********************************************************************************************
* FUNCTION NAME: dslhal_diags_codeDownload()
*
*********************************************************************************************
* DESCRIPTION: Brings DSLSS out of Reset, Downloads Diag Firmware,
* brings DSP out of Reset
* Input: tidsl_t *ptidsl
*
* Return: 0 success
* 1 failed
*
********************************************************************************************/
unsigned int dslhal_diags_codeDownload
(tidsl_t *ptidsl,
unsigned char* missingTones
);
/********************************************************************************************
* FUNCTION NAME: dslhal_diags_anlg_setPgaParams()
*
*********************************************************************************************
* DESCRIPTION: This function instructs the Transciever to transmit the Reverb with missing
* tones and Medley's with missing tones. These signals are defined in ITU
* G.992.1 ADSL Standards.
*
* Input: Test selects between the Reverb or Medley tests. 0 - Reverb, 1 - Medley
* Tones selects the .
* Return: NULL
*
********************************************************************************************/
unsigned int dslhal_diags_anlg_setPgaParams
(tidsl_t *ptidsl,
int agcFlag,
short pga1,
short pga2,
short pga3,
short aeq
);
/********************************************************************************************
* FUNCTION NAME: dslhal_diags_anlg_getRxNoisePower()
*
*********************************************************************************************
* DESCRIPTION: This function instructs the Transciever to transmit the Reverb with missing
* tones and Medley's with missing tones. These signals are defined in ITU
* G.992.1 ADSL Standards.
*
* Input: Test selects between the Reverb or Medley tests. 0 - Reverb, 1 - Medley
* Tones selects the .
* Return: NULL
*
********************************************************************************************/
unsigned int dslhal_diags_anlg_getRxNoisePower
(tidsl_t *ptidsl
);
/********************************************************************************************
* FUNCTION NAME: dslhal_diags_anlg_setMissingTones()
*
*********************************************************************************************
* DESCRIPTION: This function instructs the Transciever to transmit the Reverb with missing
* tones and Medley's with missing tones. These signals are defined in ITU
* G.992.1 ADSL Standards.
*
* Input: Test selects between the Reverb or Medley tests. 0 - Reverb, 1 - Medley
* Tones selects the .
* Return: NULL
*
********************************************************************************************/
unsigned int dslhal_diags_anlg_setMissingTones
(tidsl_t *ptidsl,
unsigned char* missingTones
);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_readDelineationState()
*
*********************************************************************************************
* DESCRIPTION:
* download DSP image from host memory to dsp memory
*
* Return: 0 success
* 1 failed
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_readDelineationState
(tidsl_t *ptidsl
);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_processModemStateBitField()
*
*********************************************************************************************
* DESCRIPTION:
* download DSP image from host memory to dsp memory
*
* Return: 0 success
* 1 failed
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_processModemStateBitField
(tidsl_t *ptidsl
);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_setInterruptMask()
*
*********************************************************************************************
* DESCRIPTION:
* Sets the host interrupt bit masks
*
* Return: 0 success
* 1 failed
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_setInterruptMask
(tidsl_t * ptidsl,
unsigned int inputMask
);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_computeCrc32()
*
*********************************************************************************************
* DESCRIPTION:
* Computes the CRC-32 for the input data
*
* Return: 32 bit CRC of the input data
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_computeCrc32
(unsigned char *data,
int len
);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_checkOverlayPage()
*
*********************************************************************************************
* DESCRIPTION:
* Computes the CRC-32 for the input data and compares it with reference
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_checkOverlayPage
(tidsl_t *ptidsl,
unsigned int tag
);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_restoreTrainingInfo()
*
*********************************************************************************************
* DESCRIPTION:
* Computes the CRC-32 for the input data and compares it with reference
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
int dslhal_support_restoreTrainingInfo(tidsl_t * ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_reloadTrainingInfo()
*
*********************************************************************************************
* DESCRIPTION:
* Computes the CRC-32 for the input data and compares it with reference
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
int dslhal_support_reloadTrainingInfo(tidsl_t * ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_clearTrainingInfo()
*
*********************************************************************************************
* DESCRIPTION:
* Computes the CRC-32 for the input data and compares it with reference
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
int dslhal_support_clearTrainingInfo(tidsl_t * ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_parseInterruptSource()
*
*********************************************************************************************
* DESCRIPTION:
* Sets the host interrupt bit masks
*
* Return: 0 success
* 1 failed
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_parseInterruptSource(tidsl_t * ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_advancedIdleProcessing()
*
*********************************************************************************************
* DESCRIPTION:
* Calls Advanced Idle State Processing Functions
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_advancedIdleProcessing(tidsl_t *ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_aocBitSwapProcessing()
*
*********************************************************************************************
* DESCRIPTION:
* Calls Advanced Bitswap buffer Processing Functions
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_aocBitSwapProcessing(tidsl_t *ptidsl,unsigned int usDs);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_gatherEocMessages()
*
*********************************************************************************************
* DESCRIPTION:
* Calls Advanced EOC Buffering functions
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_gatherEocMessages(tidsl_t *ptidsl,int usDs, int msgPart1, int msgPart2);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_gatherSnrPerBin()
*
*********************************************************************************************
* DESCRIPTION:
* Calls Advanced Snr per bin buffering Functions
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_gatherSnrPerBin(tidsl_t *ptidsl,unsigned int snrParm);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_processTrainingState()
*
*********************************************************************************************
* DESCRIPTION:
* Calls Advanced Training State Processing Functions
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_processTrainingState(tidsl_t *ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_gatherAdsl2Messages()
*
*********************************************************************************************
* DESCRIPTION:
* Calls Advanced EOC Buffering functions
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_gatherAdsl2Messages(tidsl_t *ptidsl,int msgTag, int param1, int param2);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_getAdsl2MsgLocation()
*
*********************************************************************************************
* DESCRIPTION:
* Gets the address to the ADSL2 Message being looked up
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_getAdsl2MessageLocation(tidsl_t *ptidsl,int msgOffset);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_getCMsgsRa()
*
*********************************************************************************************
* DESCRIPTION:
* Calls Advanced Training Message functions
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_getCMsgsRa(tidsl_t *ptidsl,void *cMsg);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_getMaxDsTones()
*
*********************************************************************************************
* DESCRIPTION:
* Gets Number of Down Stream tones
* Return: 256 or 512
*
********************************************************************************************/
unsigned int dslhal_support_getMaxDsTones(tidsl_t *ptidsl);
unsigned int dslhal_support_getNumTones(tidsl_t *ptidsl); // Kept for backward compatible
/********************************************************************************************
* FUNCTION NAME: dslhal_support_getMaxUsTones()
*
*********************************************************************************************
* DESCRIPTION:
* Gets Number of Up Stream tones
* Return: 256 or 512
*
********************************************************************************************/
unsigned int dslhal_support_getMaxUsTones(tidsl_t *ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_gatherRateMessages()
*
*********************************************************************************************
* DESCRIPTION:
* Gathers Advanced Training Messages
*
* Return: Error Condition (if any)
*
*
* NOTE:
* DSP image is based on LITTLE endian
*
********************************************************************************************/
unsigned int dslhal_support_gatherRateMessages(tidsl_t *ptidsl);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_byteSwap16()
*
*********************************************************************************************
* DESCRIPTION:
* byteswap a short
*
* INPUT:
* Return: NULL
*
********************************************************************************************/
unsigned short dslhal_support_byteSwap16(unsigned short in16Bits);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_byteSwap32()
*
*********************************************************************************************
* DESCRIPTION:
* byteswap within 32 bit unsigned integer
*
* INPUT: unsigned 32 bit integer
*
* Return: Byte Swapped 32 bit integer
* B0|B1|B2|B3 -> B3|B2|B1|B0 (where B0..B3 is byte(8bit) data within unsigned int32)
*
* Note: The function will do the swap when MIPS code is compiled as Big Endian
* For little endian, the result is the same as input.
********************************************************************************************/
unsigned int dslhal_support_byteSwap32_BE (unsigned int in32Bits);
#ifndef EB
#define dslhal_support_byteSwap32(x) ((unsigned int) (x))
#else
#define dslhal_support_byteSwap32 dslhal_support_byteSwap32_BE
#endif
/********************************************************************************************
* FUNCTION NAME: dslhal_support_shortSwap32()
*
*********************************************************************************************
* DESCRIPTION:
* shortswap within 32 bit unsigned integer
*
* INPUT: unsigned 32 bit integer
*
* Return: Short Swapped 32 bit integer
* S0|S1 -> S1|S0 (where S0,S1 is unsigned short (16bit)data within unsigned int32)
*
* Note: The function will do the swap when MIPS code is compiled as Big Endian
* For little endian, the result is the same as input.
********************************************************************************************/
unsigned int dslhal_support_shortSwap32(unsigned int in32Bits);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_getTrainedModeEx()
*
*********************************************************************************************
* DESCRIPTION:
* Construced the Extended (32bits) TrainedMode
*
* INPUT:
* Return: NULL
*
********************************************************************************************/
unsigned int dslhal_support_getTrainedMode (tidsl_t *ptidsl);
unsigned int dslhal_support_getTrainedModeEx(unsigned int trainMode, unsigned int annex_sel);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_readOffset
*
*********************************************************************************************
* DESCRIPTION:
* Read 32 bit endian converted value from Host-DSP Interface based on offset array.
* (Internal Used Only)
*
* INPUT: offsetnum: # entries in *offset array follows.
* *offset: offset table.
* Return: 32 bit endian converted value.
*
********************************************************************************************/
unsigned int dslhal_support_readOffset(tidsl_t *ptidsl, int offsetnum, int *offset);
/********************************************************************************************
* FUNCTION NAME: dslhal_support_readInternalOffset
*
*********************************************************************************************
* DESCRIPTION:
* Read 32 bit endian converted value from Internal Host-DSP Interface based on offset array.
* (Internal Used Only)
*
* INPUT: offsetnum: # entries in *offset array follows.
* *offset: offset table.
* Return: 32 bit endian converted value.
*
********************************************************************************************/
unsigned int dslhal_support_readInternalOffset(tidsl_t *ptidsl, int offsetnum, int *offset);
unsigned int dslhal_support_addrFromOffset(tidsl_t *ptidsl, int offsetnum, int *offset, int type);
unsigned int dslhal_support_writeFromOffset(tidsl_t *ptidsl, int offsetnum, int *offset, unsigned int dat, int type);
/******************************************************************************************
* FUNCTION NAME: dslhal_support_IsADSL1Mode
*
*******************************************************************************************
* DESCRIPTION: This function check current train mode see if it's GDMT, T1413, or GLITE.
* Detect & take care both old train mode scheme & new train mode scheme.
* It is expected the ptidsl->AppData.dsl_modulation is been set before calling
* this function.
*
* INPUT: PITIDSLHW_T *ptidsl
*
* RETURN: TRUE: It's one of ADSL1 (GDMT, T1413, or GLITE) mode.
* FALSE: It's not ADSL1 mode.
*****************************************************************************************/
int dslhal_support_IsADSL1Mode(tidsl_t *ptidsl);
#endif /* Pairs #ifndef DSL_HAL_FUNCTIONDEFINES_H__ */