Project

General

Profile

RE: uPP receive problem ยป upp_reg.txt

register settings - Scott Whitney, 10/21/2011 02:34 PM

 
1
    //--------------------------------------------------------------------------
2
    // UPPCTL - tx/rx selection, data width, data format, data rate,
3
    //            data interleave enable
4
    //--------------------------------------------------------------------------
5
    iowrite32( 0x02020007, (void *)(upp_base + UPCTL) );
6
    reg_val = ioread32( (void *)(upp_base + UPCTL) );
7
    //    printk( KERN_ALERT "UPCTL = 0x%08x\n", reg_val);
8

    
9
    //--------------------------------------------------------------------------
10
    // UPPICR - signal enable, signal inversion, clk div (tx only)
11
    //--------------------------------------------------------------------------
12
    //    iowrite32( 0x0F180F20, (void *)(upp_base + UPICR) );
13
    //    iowrite32( 0x0F180F20, (void *)(upp_base + UPICR) );
14
    iowrite32( 0x0F180F20, (void *)(upp_base + UPICR) );
15
    reg_val = ioread32( (void *)(upp_base + UPICR) );
16
    //    printk( KERN_ALERT "UPICR = 0x%08x\n", reg_val);
17

    
18
    //--------------------------------------------------------------------------
19
    // UPPIVR - idle value (tx only)
20
    //--------------------------------------------------------------------------
21
    iowrite32( 0x1234, (void *)(upp_base + UPIVR) );
22
    reg_val = ioread32( (void *)(upp_base + UPIVR) );
23
    //    printk( KERN_ALERT "UPIVR = 0x%08x\n", reg_val);
24

    
25
    //--------------------------------------------------------------------------
26
    // UPPTCR - i/o tx thresh (tx only), dma read burst size
27
    //--------------------------------------------------------------------------
28
    //    iowrite32( 0x00010100, (void *)(upp_base + UPTCR) );
29
    iowrite32( 0x00000000, (void *)(upp_base + UPTCR) );
30
    reg_val = ioread32( (void *)(upp_base + UPTCR) );
31
    //    printk( KERN_ALERT "UPTCR = 0x%08x\n", reg_val);
32

    
33
    //--------------------------------------------------------------------------
34
    // UPPDLB - digital loopback
35
    //--------------------------------------------------------------------------
36
    if ( UPP_CFG_DOLOOPBACK )
37
    {
38
        iowrite32( 0x00001000, (void *)(upp_base + UPDLB) );
39
    }
40
    else
41
    {
42
        iowrite32( 0x00000000, (void *)(upp_base + UPDLB) );
43
    }
44

    
45

    
46
//the rxdma_line_size and txdma_line_size are bot 0x40 
47
// the rxdma_line_count and txdma_line count are both 0x01
48
    //--------------------------------------------------------------------------
49
    // UPQD0 - Channel B (Rx)
50
    //--------------------------------------------------------------------------
51
    iowrite32( rx_start_addr, (void *)(upp_base + UPQD0) );
52
    printk( KERN_ALERT "UPQD0 = 0x%08x\n", *(int32_t *)(upp_base + UPQD0));
53

    
54
    //--------------------------------------------------------------------------
55
    // UPQD1 - Channel B (Rx)
56
    //--------------------------------------------------------------------------
57
    iowrite32( (rxdma_line_count << 16 | rxdma_line_size),
58
            (void *)(upp_base + UPQD1) );
59
    printk( KERN_ALERT "UPQD1 = 0x%08x\n", *(int32_t *)(upp_base + UPQD1));
60

    
61
    //--------------------------------------------------------------------------
62
    // UPQD2 - Channel B (Rx)
63
    //--------------------------------------------------------------------------
64
    iowrite32( rxdma_line_size, (void *)(upp_base + UPQD2) );
65
    printk( KERN_ALERT "UPQD2 = 0x%08x\n", *(int32_t *)(upp_base + UPQD2));
66

    
67
    return 0;
68
}
69

    
70

    
71
//static int upp_txdma_config( upp_dev_t *dev )
72
static int upp_txdma_config( void)
73
{
74
  //    int32_t reg_val;
75

    
76
    // wait for dma active/pending bits to clear
77
    while ( ioread32( upp_base + UPIS2 ) & 0x00000002 )
78
        ;
79

    
80

    
81
    //==========================================================================
82
    // Program DMA channel desc. reg's
83
    //   - UPID0-2 and/or UPQD0-2.
84
    //==========================================================================
85

    
86
    //--------------------------------------------------------------------------
87
    // UPID0 - Channel A (Tx)
88
    //--------------------------------------------------------------------------
89
    iowrite32( tx_start_addr, (void *)(upp_base + UPID0) );
90
    printk( KERN_ALERT "UPID0 = 0x%08x\n", *(int32_t *)(upp_base + UPID0));
91

    
92
    //--------------------------------------------------------------------------
93
    // UPID1 - Channel A (Tx)
94
    //--------------------------------------------------------------------------
95
    iowrite32( (txdma_line_count << 16 | txdma_line_size),
96
            (void *)(upp_base + UPID1) );
97
    printk( KERN_ALERT "UPID1 = 0x%08x\n", *(int32_t *)(upp_base + UPID1));
98

    
99
    //--------------------------------------------------------------------------
100
    // UPID2 - Channel A (Tx)
101
    //--------------------------------------------------------------------------
102
    iowrite32( txdma_line_size, (void *)(upp_base + UPID2) );
103
    printk( KERN_ALERT "UPID2 = 0x%08x\n", *(int32_t *)(upp_base + UPID2));
104

    
105

    
106
    return 0;
107
}
108

    
    (1-1/1)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)