Accessing dtSEC registers using ioremap()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accessing dtSEC registers using ioremap()

895 Views
DemirYumruk
Contributor I

Hi,

We are trying to access dTSEC registers using CCSRBAR+FMAN block base address+register offset as suggested at DPAARM(QorIQ P3041). We are getting 'bus error'. (CCSRBAR: 0xfe000000, FMAN block base address: 0x400000, dTSEC ID offset: 0x00).

Do you have any suggestions about this problem?

Thank you.

0 Kudos
2 Replies

872 Views
bpe
NXP Employee
NXP Employee

There is no reason for a bus error other than a transaction with an invalid address.
Direct address calculation in a driver has many disadvantages, so, even if you
are writing a driver from scratch, I would suggest re-using the existing code
that finds and maps memory regions for dTSEC based on Linux native and platform-
independent methods, namely the the Device Tree and of_* kernel calls. You can
find this code in mac_probe() routine defined in drivers/net/ethernet/freescale/fman/mac.c.
Scroll down to the /* Get the address of the memory mapped registers */ comment
to get to it.

Hope this helps,
Platon

 

 

0 Kudos

854 Views
LordStark3232
Contributor I

Hi Platon,

Can I use ioremap(physical addr) instead of _of_address_to_resource(..).

I succesfully read version register by using ioremap. But I failed to set tctrl-rctrl registers.

 

What are dissadvantages you stated at your reply?

 

0 Kudos