This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5718: McSPI clock frequency

Part Number: AM5718


I am using AM5718 IDK EVM,and ti-processor-sdk-linux-am57xx-evm-05.03.00.07.

I have enabled McSPI2 in DTS as given below:
&mcspi2 {
status = "okay";
ti,pindir-d0-out-d1-in;

mydev@0 {
compatible = "rohm,dh2228fv";
spi-max-frequency = <1000000>;
reg = <0>;
spi-cpol;
};
};

I am able to communicate with McSPI2 as master and the data sent is correctly received at slave side. User Space application is used to communicate with McSPI2.


Code fragment is given below:
---------------------------------------------------------------------------
/* Set the SPI bus speed in Hz */
unsigned long spi_bus_speed = 24000000;

if(ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &spi_bus_speed)==-1) {
perror("SPI: Failed to set SPI bus frequency |");
return -1;
}
if(ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &spi_bus_speed)==-1) {
perror("SPI: Failed to set SPI bus frequency |");
return -1;
}
......

/* Perform a SPI Transaction */
if (ioctl(fd, SPI_IOC_MESSAGE(1), &transfer_spidev)<0)
{
perror("SPI: SPI_IOC_MESSAGE Failed |");
return -1;
}
---------------------------------------------------------------------------

My problem is even if I set the clock frequency of McSPI2 above 24 MHz, only 24 Mhz (approximate) is shown in the Oscilloscope.
From Table 7-42. "Timing Requirements for SPI - Master Mode" (Page 262) in AM57XX TRM, I understand that maximum frequency of McSPI as master is 48 MHz. What else should I do to  attain this frequency?

regards,

Anupama

  • Hi Anupama,

    Anupama Sreekumar said:

    &mcspi2 {
    status = "okay";
    ti,pindir-d0-out-d1-in;

    mydev@0 {
    compatible = "rohm,dh2228fv";
    spi-max-frequency = <1000000>;
    reg = <0>;
    spi-cpol;
    };
    };

    Please update spi-max-frequency entry from <1000000> to <48000000>

    Check below txtx files for details:

    linux-kernel/Documentation/devicetree/bindings/spi/omap-spi.txt


    Check also what values you have in below registers/bits:

    MCSPI_CHxCONF[5:2] CLKD


    Check AM571x TRM section 24.4.4.3.8 Programmable SPI Clock, for what registers settings you should have regarding 48MHz.

    Regards,
    Pavel

  • Hi Pavel,


    I am able to get 48 Mhz after changing spi-max-frequency entry from <1000000> to <48000000> as you suggested. Thank you for the guidance.


    I have another doubt regarding reading of McSPI CHx_CONF register at address 0x4809A12c. (0x4809A12c from Table 24-316. McSPI Register Summary).

    I tried to read it using devmem2 and using the method from kernel space suggested in one of your posts :
    -------------------------------------------
    static void __iomem *mcasp3_base;
    uint32_t value,ui_temp;

    mcasp3_base = ioremap(0x4809a12c ,4);
    value = __raw_readl(mcasp3_base);
    printk(KERN_INFO "CM_L4PER2_MCASP3_CLKCTRL %x\n",value);
    ----------------------------------------------------------
    the devmem2 error I go

                                                                        
    root@am57xx-evm:~/apps# devmem2 0x4809a12c                                                                    
    /dev/mem opened.[  825.655999] ------------[ cut here ]------------                                           
    [  825.661973] WARNING: CPU: 0 PID: 1045 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x254/0x370    
    [  825.671409] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Read): Data Access in User mode dus
    [  825.683020] Modules linked in: ipt_MASQUERADE nf_nat_masquerade_ipv4 xfrm_user xfrm_algo iptable_nat nf_co)
    [  825.750988] CPU: 0 PID: 1045 Comm: devmem2 Tainted: G      D W  O    4.14.79-ge669d52447 #1                
    [  825.759374] Hardware name: Generic DRA72X (Flattened Device Tree)                                          
    [  825.765491] Backtrace:                                                                                     
    [  825.767956] [<c020b4dc>] (dump_backtrace) from [<c020b7c0>] (show_stack+0x18/0x1c)                         
    [  825.775559]  r7:00000009 r6:600b0193 r5:00000000 r4:c1053d90                                               
    [  825.781247] [<c020b7a8>] (show_stack) from [<c09326e8>] (dump_stack+0x90/0xa4)                             
    [  825.788505] [<c0932658>] (dump_stack) from [<c022b9cc>] (__warn+0xec/0x104)                                
    [  825.795496]  r7:00000009 r6:c0bd4efc r5:00000000 r4:ee35ddd0                                               
    [  825.801181] [<c022b8e0>] (__warn) from [<c022ba24>] (warn_slowpath_fmt+0x40/0x48)                          
    [  825.808696]  r9:00000006 r8:ef1bb0d0 r7:c0bd4d68 r6:00000002 r5:c0bd4e28 r4:c0bd4ecc                       
    [  825.816475] [<c022b9e8>] (warn_slowpath_fmt) from [<c051bd20>] (l3_interrupt_handler+0x254/0x370)          
    [  825.825382]  r3:ef1b2f00 r2:c0bd4ecc                                                                       
    [  825.828971]  r4:80080003                                                                                   
    [  825.831519] [<c051bacc>] (l3_interrupt_handler) from [<c027f5a4>] (__handle_irq_event_percpu+0x6c/0x134)   
    [  825.841040]  r10:c105578d r9:ef1b6200 r8:00000017 r7:ee35def4 r6:00000000 r5:ef1b6200                      
    [  825.848901]  r4:ef1bb440                                                                                   
    [  825.851448] [<c027f538>] (__handle_irq_event_percpu) from [<c027f690>] (handle_irq_event_percpu+0x24/0x60) 
    [  825.861143]  r10:00000002 r9:00000001 r8:ef008000 r7:00000000 r6:c10093ac r5:ef1b6200                      
    [  825.869005]  r4:ef1b6200                                                                                   
    [  825.871551] [<c027f66c>] (handle_irq_event_percpu) from [<c027f70c>] (handle_irq_event+0x40/0x64)          
    [  825.880459]  r5:ef1b6264 r4:ef1b6200                                                                       
    [  825.884053] [<c027f6cc>] (handle_irq_event) from [<c0283020>] (handle_fasteoi_irq+0xac/0x160)              
    [  825.892613]  r7:00000000 r6:c10093ac r5:ef1b6264 r4:ef1b6200                                               
    [  825.898299] [<c0282f74>] (handle_fasteoi_irq) from [<c027e7f4>] (generic_handle_irq+0x2c/0x3c)             
    [  825.906946]  r7:00000000 r6:00000000 r5:00000017 r4:c0e64b3c                                               
    [  825.912631] [<c027e7c8>] (generic_handle_irq) from [<c027ed7c>] (__handle_domain_irq+0x64/0xbc)            
    [  825.921369] [<c027ed18>] (__handle_domain_irq) from [<c0201474>] (gic_handle_irq+0x44/0x80)                
    [  825.929758]  r9:00000001 r8:fa213000 r7:fa212000 r6:ee35dfb0 r5:fa21200c r4:c1004000                       
    [  825.937535] [<c0201430>] (gic_handle_irq) from [<c020c6e8>] (__irq_usr+0x48/0x60)                          
    [  825.945049] Exception stack(0xee35dfb0 to 0xee35dff8)                                                      
    [  825.950122] dfa0:                                     000103e3 b6f6e960 be8fab4c b6f6eb18                  
    [  825.958335] dfc0: 00000000 00021048 b6f6bd40 be8faab8 000103e3 00000001 00000002 be8faba0                  
    [  825.966548] dfe0: 000103cc be8faa98 b6f50efb b6f4d286 200b0030 ffffffff                                    
    [  825.973191]  r9:00000001 r8:30c5387d r7:30c5387d r6:ffffffff r5:200b0030 r4:b6f4d286                       
    [  825.980965] ---[ end trace 43ea851c99f14d37 ]---                                                           
                                                                                                                  
    Memory mapped at address 0xb6f6a000.                                                                          
    [  825.985755] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000                            
    [  825.996503] pgd = ee6fe380                                                                                 
    [  825.999219] [00000000] *pgd=ae287003, *pmd=00000000                                                        
    Read at address  0x4809A12C (0xb6f6a12c): 0x00000000                                                          
    [  826.024891] systemd[1]: systemd-journald.service: Failed with result 'core-dump'.                          
    root@am57xx-evm:~/apps# [  826.053631] systemd[1]: systemd-journald.service: Service has no hold-off time, sc.
    [  826.071557] systemd[1]: Stopped Flush Journal to Persistent Storage.                                       
    [  826.078031] systemd[1]: Stopping Flush Journal to Persistent Storage...                                    
    [  826.101037] systemd[1]: Stopped Journal Service.                                                           
    [  826.111598] systemd[1]: Starting Journal Service...                                                        
    [  826.152646] systemd-journald[1047]: File /run/log/journal/e4ae268341d640829884528ab6b0c7ce/system.journal .
    [  826.241772] systemd[1]: Started Journal Service.                                                           
    [  826.595911] systemd-coredump[1046]: MESSAGE=Process 1038 (systemd-journal) of user 0 dumped core.          
    [  826.604935] systemd-coredump[1046]: Coredump diverted to /var/lib/systemd/coredump/core.systemd-journal.0.z
                                                                                                                  
    root@am57xx-evm:~/apps# devmem2 0x4809a140                                                                    
    /dev/mem opened.[  831.194956] ------------[ cut here ]------------                                           
    [  831.200881] WARNING: CPU: 0 PID: 1049 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x254/0x370    
    [  831.210317] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Read): Data Access in User mode dus
    [  831.221928] Modules linked in: ipt_MASQUERADE nf_nat_masquerade_ipv4 xfrm_user xfrm_algo iptable_nat nf_co)
    [  831.289897] CPU: 0 PID: 1049 Comm: devmem2 Tainted: G      D W  O    4.14.79-ge669d52447 #1                
    [  831.298283] Hardware name: Generic DRA72X (Flattened Device Tree)                                          
    [  831.304400] Backtrace:                                                                                     
    [  831.306866] [<c020b4dc>] (dump_backtrace) from [<c020b7c0>] (show_stack+0x18/0x1c)                         
    [  831.314470]  r7:00000009 r6:600b0193 r5:00000000 r4:c1053d90                                               
    [  831.320159] [<c020b7a8>] (show_stack) from [<c09326e8>] (dump_stack+0x90/0xa4)                             
    [  831.327415] [<c0932658>] (dump_stack) from [<c022b9cc>] (__warn+0xec/0x104)                                
    [  831.334407]  r7:00000009 r6:c0bd4efc r5:00000000 r4:ee281dd0                                               
    [  831.340091] [<c022b8e0>] (__warn) from [<c022ba24>] (warn_slowpath_fmt+0x40/0x48)                          
    [  831.347608]  r9:00000006 r8:ef1bb0d0 r7:c0bd4d68 r6:00000002 r5:c0bd4e28 r4:c0bd4ecc                       
    [  831.355386] [<c022b9e8>] (warn_slowpath_fmt) from [<c051bd20>] (l3_interrupt_handler+0x254/0x370)          
    [  831.364295]  r3:ef1b2f00 r2:c0bd4ecc                                                                       
    [  831.367883]  r4:80080003                                                                                   
    [  831.370430] [<c051bacc>] (l3_interrupt_handler) from [<c027f5a4>] (__handle_irq_event_percpu+0x6c/0x134)   
    [  831.379951]  r10:c105578d r9:ef1b6200 r8:00000017 r7:ee281ef4 r6:00000000 r5:ef1b6200                      
    [  831.387813]  r4:ef1bb440                                                                                   
    [  831.390359] [<c027f538>] (__handle_irq_event_percpu) from [<c027f690>] (handle_irq_event_percpu+0x24/0x60) 
    [  831.400054]  r10:00000002 r9:00000001 r8:ef008000 r7:00000000 r6:c10093ac r5:ef1b6200                      
    [  831.407915]  r4:ef1b6200                                                                                   
    [  831.410462] [<c027f66c>] (handle_irq_event_percpu) from [<c027f70c>] (handle_irq_event+0x40/0x64)          
    [  831.419371]  r5:ef1b6264 r4:ef1b6200                                                                       
    [  831.422964] [<c027f6cc>] (handle_irq_event) from [<c0283020>] (handle_fasteoi_irq+0xac/0x160)              
    [  831.431524]  r7:00000000 r6:c10093ac r5:ef1b6264 r4:ef1b6200                                               
    [  831.437211] [<c0282f74>] (handle_fasteoi_irq) from [<c027e7f4>] (generic_handle_irq+0x2c/0x3c)             
    [  831.445858]  r7:00000000 r6:00000000 r5:00000017 r4:c0e64b3c                                               
    [  831.451543] [<c027e7c8>] (generic_handle_irq) from [<c027ed7c>] (__handle_domain_irq+0x64/0xbc)            
    [  831.460281] [<c027ed18>] (__handle_domain_irq) from [<c0201474>] (gic_handle_irq+0x44/0x80)                
    [  831.468668]  r9:00000001 r8:fa213000 r7:fa212000 r6:ee281fb0 r5:fa21200c r4:c1004000                       
    [  831.476447] [<c0201430>] (gic_handle_irq) from [<c020c6e8>] (__irq_usr+0x48/0x60)                          
    [  831.483960] Exception stack(0xee281fb0 to 0xee281ff8)                                                      
    [  831.489032] 1fa0:                                     000103e3 b6f76960 be8bcb4c b6f76b18                  
    [  831.497246] 1fc0: 00000000 00021048 b6f73d40 be8bcab8 000103e3 00000001 00000002 be8bcba0                  
    [  831.505457] 1fe0: 000103cc be8bca98 b6f58efb b6f55286 200b0030 ffffffff                                    
    [  831.512100]  r9:00000001 r8:30c5387d r7:30c5387d r6:ffffffff r5:200b0030 r4:b6f55286                       
    [  831.519874] ---[ end trace 43ea851c99f14d38 ]---                                                           
                                                                                                                  
    Memory mapped at address 0xb6f72000.                                                                          
    [  831.526871] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000                            
    [  831.535404] pgd = ec452200                                                                                 
    [  831.538116] [00000000] *pgd=ae1ca003, *pmd=00000000                                                        
    [  831.563142] systemd[1]: systemd-journald.service: Failed with result 'core-dump'.                          
    [  831.584080] systemd[1]: systemd-journald.service: Service has no hold-off time, scheduling restart.        
    [  831.606264] systemd[1]: Stopped Flush Journal to Persistent Storage.                                       
    [  831.621114] systemd[1]: Stopping Flush Journal to Persistent Storage...                                    
    [  831.627796] systemd[1]: Stopped Journal Service.                                                           
    [  831.654238] systemd[1]: Starting Journal Service...                                                        
    [  831.683796] systemd-journald[1051]: File /run/log/journal/e4ae268341d640829884528ab6b0c7ce/system.journal .
    [  831.781472] systemd[1]: Started Journal Service.                                                           
    Read at address  0x4809A140 (0xb6f72140): 0x00000000                                                          
    root@am57xx-evm:~/apps# [  832.136032] systemd-coredump[1050]: MESSAGE=Process 1047 (systemd-journal) of user.
    [  832.145027] systemd-coredump[1050]: Coredump diverted to /var/lib/systemd/coredump/core.systemd-journal.0.z
                                                                                                                  
    root@am57xx-evm:~/apps# devmem2 0x4809a154                                                                    
    /dev/mem opened.[  837.395307] ------------[ cut here ]------------                                           
    [  837.401232] WARNING: CPU: 0 PID: 1054 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x254/0x370    
    [  837.410669] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Read): Data Access in User mode dus
    [  837.422280] Modules linked in: ipt_MASQUERADE nf_nat_masquerade_ipv4 xfrm_user xfrm_algo iptable_nat nf_co)
    [  837.490248] CPU: 0 PID: 1054 Comm: devmem2 Tainted: G      D W  O    4.14.79-ge669d52447 #1                
    [  837.498634] Hardware name: Generic DRA72X (Flattened Device Tree)                                          
    [  837.504752] Backtrace:                                                                                     
    [  837.507218] [<c020b4dc>] (dump_backtrace) from [<c020b7c0>] (show_stack+0x18/0x1c)                         
    [  837.514821]  r7:00000009 r6:600b0193 r5:00000000 r4:c1053d90                                               
    [  837.520512] [<c020b7a8>] (show_stack) from [<c09326e8>] (dump_stack+0x90/0xa4)                             
    [  837.527768] [<c0932658>] (dump_stack) from [<c022b9cc>] (__warn+0xec/0x104)                                
    [  837.534760]  r7:00000009 r6:c0bd4efc r5:00000000 r4:ee459dd0                                               
    [  837.540444] [<c022b8e0>] (__warn) from [<c022ba24>] (warn_slowpath_fmt+0x40/0x48)                          
    [  837.547959]  r9:00000006 r8:ef1bb0d0 r7:c0bd4d68 r6:00000002 r5:c0bd4e28 r4:c0bd4ecc                       
    [  837.555738] [<c022b9e8>] (warn_slowpath_fmt) from [<c051bd20>] (l3_interrupt_handler+0x254/0x370)          
    [  837.564646]  r3:ef1b2f00 r2:c0bd4ecc                                                                       
    [  837.568234]  r4:80080003                                                                                   
    [  837.570782] [<c051bacc>] (l3_interrupt_handler) from [<c027f5a4>] (__handle_irq_event_percpu+0x6c/0x134)   
    [  837.580303]  r10:c105578d r9:ef1b6200 r8:00000017 r7:ee459ef4 r6:00000000 r5:ef1b6200                      
    [  837.588164]  r4:ef1bb440                                                                                   
    [  837.590711] [<c027f538>] (__handle_irq_event_percpu) from [<c027f690>] (handle_irq_event_percpu+0x24/0x60) 
    [  837.600406]  r10:00000002 r9:00000001 r8:ef008000 r7:00000000 r6:c10093ac r5:ef1b6200                      
    [  837.608267]  r4:ef1b6200                                                                                   
    [  837.610813] [<c027f66c>] (handle_irq_event_percpu) from [<c027f70c>] (handle_irq_event+0x40/0x64)          
    [  837.619721]  r5:ef1b6264 r4:ef1b6200                                                                       
    [  837.623315] [<c027f6cc>] (handle_irq_event) from [<c0283020>] (handle_fasteoi_irq+0xac/0x160)              
    [  837.631876]  r7:00000000 r6:c10093ac r5:ef1b6264 r4:ef1b6200                                               
    [  837.637562] [<c0282f74>] (handle_fasteoi_irq) from [<c027e7f4>] (generic_handle_irq+0x2c/0x3c)             
    [  837.646211]  r7:00000000 r6:00000000 r5:00000017 r4:c0e64b3c                                               
    [  837.651895] [<c027e7c8>] (generic_handle_irq) from [<c027ed7c>] (__handle_domain_irq+0x64/0xbc)            
    [  837.660633] [<c027ed18>] (__handle_domain_irq) from [<c0201474>] (gic_handle_irq+0x44/0x80)                
    [  837.669019]  r9:00000001 r8:fa213000 r7:fa212000 r6:ee459fb0 r5:fa21200c r4:c1004000                       
    [  837.676798] [<c0201430>] (gic_handle_irq) from [<c020c6e8>] (__irq_usr+0x48/0x60)                          
    [  837.684310] Exception stack(0xee459fb0 to 0xee459ff8)                                                      
    [  837.689382] 9fa0:                                     000103e3 b6f78960 beab0b4c b6f78b18                  
    [  837.697595] 9fc0: 00000000 00021048 b6f75d40 beab0ab8 000103e3 00000001 00000002 beab0ba0                  
    [  837.705807] 9fe0: 000103cc beab0a98 b6f5aefb b6f57286 200b0030 ffffffff                                    
    [  837.712450]  r9:00000001 r8:30c5387d r7:30c5387d r6:ffffffff r5:200b0030 r4:b6f57286                       
    [  837.720225] ---[ end trace 43ea851c99f14d39 ]---                                                           
                                                                                                                  
    Memory mapped at address 0xb6f74000.                                                                          
    [  837.725086] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000                            
    [  837.735771] pgd = ec4538c0                                                                                 
    [  837.738486] [00000000] *pgd=ae304003, *pmd=00000000                                                        
    Read at address  0x4809A154 (0xb6f74154): 0x00000000                                                          
    [  837.765461] systemd[1]: systemd-journald.service: Failed with result 'core-dump'.                          
    root@am57xx-evm:~/apps# [  837.792603] systemd[1]: systemd-journald.service: Service has no hold-off time, sc.
    [  837.812727] systemd[1]: Stopped Flush Journal to Persistent Storage.                                       
    [  837.819147] systemd[1]: Stopping Flush Journal to Persistent Storage...                                    
    [  837.841042] systemd[1]: Stopped Journal Service.                                                           
    [  837.851525] systemd[1]: Starting Journal Service...                                                        
    [  837.891882] systemd-journald[1056]: File /run/log/journal/e4ae268341d640829884528ab6b0c7ce/system.journal .
    [  837.984340] systemd[1]: Started Journal Service.                                                           
    [  838.339427] systemd-coredump[1055]: MESSAGE=Process 1051 (systemd-journal) of user 0 dumped core.          
    [  838.348463] systemd-coredump[1055]: Coredump diverted to /var/lib/systemd/coredump/core.systemd-journal.0.z
                                                                                                                  
    root@am57xx-evm:~/apps# devmem2 0x4809a168                                                                    
    /dev/mem opened.[  841.954900] ------------[ cut here ]------------                                           
    [  841.960872] WARNING: CPU: 0 PID: 1059 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x254/0x370    
    [  841.970307] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Read): Data Access in User mode dus
    [  841.981919] Modules linked in: ipt_MASQUERADE nf_nat_masquerade_ipv4 xfrm_user xfrm_algo iptable_nat nf_co)
    [  842.049888] CPU: 0 PID: 1059 Comm: devmem2 Tainted: G      D W  O    4.14.79-ge669d52447 #1                
    [  842.058273] Hardware name: Generic DRA72X (Flattened Device Tree)                                          
    [  842.064390] Backtrace:                                                                                     
    [  842.066855] [<c020b4dc>] (dump_backtrace) from [<c020b7c0>] (show_stack+0x18/0x1c)                         
    [  842.074459]  r7:00000009 r6:600b0193 r5:00000000 r4:c1053d90                                               
    [  842.080148] [<c020b7a8>] (show_stack) from [<c09326e8>] (dump_stack+0x90/0xa4)                             
    [  842.087406] [<c0932658>] (dump_stack) from [<c022b9cc>] (__warn+0xec/0x104)                                
    [  842.094397]  r7:00000009 r6:c0bd4efc r5:00000000 r4:ee281dd0                                               
    [  842.100081] [<c022b8e0>] (__warn) from [<c022ba24>] (warn_slowpath_fmt+0x40/0x48)                          
    [  842.107597]  r9:00000006 r8:ef1bb0d0 r7:c0bd4d68 r6:00000002 r5:c0bd4e28 r4:c0bd4ecc                       
    [  842.115375] [<c022b9e8>] (warn_slowpath_fmt) from [<c051bd20>] (l3_interrupt_handler+0x254/0x370)          
    [  842.124284]  r3:ef1b2f00 r2:c0bd4ecc                                                                       
    [  842.127871]  r4:80080003                                                                                   
    [  842.130419] [<c051bacc>] (l3_interrupt_handler) from [<c027f5a4>] (__handle_irq_event_percpu+0x6c/0x134)   
    [  842.139941]  r10:c105578d r9:ef1b6200 r8:00000017 r7:ee281ef4 r6:00000000 r5:ef1b6200                      
    [  842.147802]  r4:ef1bb440                                                                                   
    [  842.150349] [<c027f538>] (__handle_irq_event_percpu) from [<c027f690>] (handle_irq_event_percpu+0x24/0x60) 
    [  842.160046]  r10:00000002 r9:00000001 r8:ef008000 r7:00000000 r6:c10093ac r5:ef1b6200                      
    [  842.167907]  r4:ef1b6200                                                                                   
    [  842.170454] [<c027f66c>] (handle_irq_event_percpu) from [<c027f70c>] (handle_irq_event+0x40/0x64)          
    [  842.179363]  r5:ef1b6264 r4:ef1b6200                                                                       
    [  842.182957] [<c027f6cc>] (handle_irq_event) from [<c0283020>] (handle_fasteoi_irq+0xac/0x160)              
    [  842.191517]  r7:00000000 r6:c10093ac r5:ef1b6264 r4:ef1b6200                                               
    [  842.197203] [<c0282f74>] (handle_fasteoi_irq) from [<c027e7f4>] (generic_handle_irq+0x2c/0x3c)             
    [  842.205851]  r7:00000000 r6:00000000 r5:00000017 r4:c0e64b3c                                               
    [  842.211536] [<c027e7c8>] (generic_handle_irq) from [<c027ed7c>] (__handle_domain_irq+0x64/0xbc)            
    [  842.220274] [<c027ed18>] (__handle_domain_irq) from [<c0201474>] (gic_handle_irq+0x44/0x80)                
    [  842.228662]  r9:00000001 r8:fa213000 r7:fa212000 r6:ee281fb0 r5:fa21200c r4:c1004000                       
    [  842.236440] [<c0201430>] (gic_handle_irq) from [<c020c6e8>] (__irq_usr+0x48/0x60)                          
    [  842.243953] Exception stack(0xee281fb0 to 0xee281ff8)                                                      
    [  842.249025] 1fa0:                                     000103e3 b6ffe960 bec50b4c b6ffeb18                  
    [  842.257238] 1fc0: 00000000 00021048 b6ffbd40 bec50ab8 000103e3 00000001 00000002 bec50ba0                  
    [  842.265450] 1fe0: 000103cc bec50a98 b6fe0efb b6fdd286 200b0030 ffffffff                                    
    [  842.272094]  r9:00000001 r8:30c5387d r7:30c5387d r6:ffffffff r5:200b0030 r4:b6fdd286                       
    [  842.279868] ---[ end trace 43ea851c99f14d3a ]---                                                           
                                                                                                                  
    Memory mapped at address 0xb6ffa000.                                                                          
    [  842.284683] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000                            
    [  842.295404] pgd = ee7bab40                                                                                 
    [  842.298121] [00000000] *pgd=ac43f003, *pmd=00000000                                                        
    Read at address  0x4809A168 (0xb6ffa168): 0x00000000                                                          
    [  842.323898] systemd[1]: systemd-journald.service: Failed with result 'core-dump'.                          
    root@am57xx-evm:~/apps# [  842.352279] systemd[1]: systemd-journald.service: Service has no hold-off time, sc.
    [  842.372412] systemd[1]: Stopped Flush Journal to Persistent Storage.                                       
    [  842.415789] systemd-journald[1061]: File /run/log/journal/e4ae268341d640829884528ab6b0c7ce/system.journal .
    [  842.877437] systemd-coredump[1060]: MESSAGE=Process 1056 (systemd-journal) of user 0 dumped core.          
    [  842.886428] systemd-coredump[1060]: Coredump diverted to /var/lib/systemd/coredump/core.systemd-journal.0.z
    
    
    
    t is attached in the log.

    After searching the TI forum and following a similar post related to I2C,
    ()

    I have added
    ti,no-idle;

    ti,no-reset-on-init;

    in my McSPI2 node. But still the same error comes. Please help me in reading this register.

    regards,

    Anupama

  • Anumapa,

    Before reading McSPI2.MCSPI_CH0CONF register (addr 0x4809A12C), you need to verify the clock is enabled in PRCM register CM_L4PER_MCSPI2_CLKCTRL (addr 0x4A0097F8).

    This McSPI2 clock might be enabled when you start SPI application (or run spidev command) then disabled at the end of the application/command. In this case, you should dump McSPI2 registers during application/command execution (i.e. at the end).

    Or you can write 0x2 in CM_L4PER_MCSPI2_CLKCTRL with devmem2 tool, then you can read McSPI2 module registers with devmem2 tool.

    Regards,
    Pavel

  • Hi Pavel,

                     I wrote 0x2 in CM_L4PER_MCSPI2_CLKCTRL with devmem2 tool and I am able to read McSPI2 regitser at address 0x4809A12C.

    Thank you for your support.

    regards,

    Anupama