I'm trying to write ethernet driver for Linux kernel 4.13.x for Banana Pi M2 ultra. Some time ago so called "device tree" (DT) has been introduced in Linux kernel infrastructure. I have no much experience with using DT while writing device drivers and because of that I've got a few questions.
As far as I know - in case of banana pi system - it is needed to provide some clock source for given peripheral device. It is function of CCU in banana pi to provide such a clock. The CCU is memory mapped resource available at some address in the linux kernel. I'd like to write driver for ethernet which needs some clock from CCU.
I know that physical address of CCU must be mapped via ioremap() or similar function to virtual address.
My question is how can I fetch the virtual address of CCU in my ethernet driver? Is it possible to do via device tree? If yes - how to do this? Or maybe this virtual address can be get another way?
I'm just not sure if it is done (fetching virt address) via DT or just by some procedure or via global pointer.
Any ideas or suggestions?