Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
clocksource: Rewrite Xilinx AXI timer driver
This rewrites the Xilinx AXI timer driver to be more platform agnostic. Some common code has been split off so it can be reused. These routines currently live in drivers/mfd. The largest changes have taken place in the initialization: - We now support any number of timer devices, possibly with only one counter each. The first counter will be used as a clocksource. Every other counter will be used as a clockevent. - We do not use timer_of_init because we need to perform some tasks in between different stages. For example, we must ensure that ->read and ->write are initialized before registering the irq. This can only happen after we have gotten the register base (to detect endianness). We also have a rather unusual clock initialization sequence in order to remain backwards compatible. Due to this, it's ok for the initial clock request to fail, and we do not want other initialization to be undone. Lastly, it is more convenient to do one allocation for xilinx_clockevent_device than to do one for timer_of and one for xilinx_timer_priv. - We now pay attention to xlnx,count-width and handle smaller width timers. The default remains 32. - We access registers using regmap. This automatically deals with endianness issues, so we no longer have to use our own wrappers. It also provides locking for clockevents which have to worry about being interrupted in the middle of a read/modify/write. Note that while the existing timer driver always sets the cpumask to cpu 0, this version sets it to all possible CPUs. I believe this is correct for multiprocessor systems where the timer is not physically wired to a particular CPU's interrupt line. For uniprocessor systems (like most microblaze systems) this makes no difference. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
- Loading branch information