• Jon Hunter's avatar
    ARM: OMAP: Add DT support for timer driver · 9725f445
    Jon Hunter authored
    In order to add device-tree support to the timer driver the following changes
    were made ...
    
    1. Allocate system timers (used for clock-events and clock-source) based upon
       timer properties rather than using an hard-coded timer instance ID. To allow
       this a new helper function called omap_dmtimer_find_by_property() has been
       added for finding a timer with the particular properties in the device-tree
       blob. Please note that this is an internal helper function for system timers
       only to find a timer in the device-tree blob. This cannot be used by device
       drivers, another API has been added for that (see below). Timers that are
       allocated for system timers are dynamically disabled at boot time by adding
       a status property with the value "disabled" to the timer's device-tree node.
    
       Please note that when allocating system timers we now pass a timer ID and
       timer property. The timer ID is only be used for allocating a timer when
       booting without device-tree. Once device-tree migration is complete, all
       the timer ID references will be removed.
    
    2. System timer resources (memory and interrupts) are directly obtained from
       the device-tree timer node when booting with device-tree, so that system
       timers are no longer reliant upon the OMAP HWMOD framework to provide these
       resources.
    
    3. If DT blob is present, then let device-tree create the timer devices
       dynamically.
    
    4. When device-tree is present the "id" field in the platform_device structure
       (pdev->id) is initialised to -1 and hence cannot be used to identify a timer
       instance. Due to this the following changes were made ...
       a). The API omap_dm_timer_request_specific() is not supported when using
           device-tree, because it uses the device ID to request a specific timer.
           This function will return an error if called when device-tree is present.
           Users of this API should use omap_dm_timer_request_by_cap() instead.
       b). When removing the DMTIMER driver, the timer "id" was used to identify the
           timer instance. The remove function has been modified to use the device
           name instead of the "id".
    
    5. When device-tree is present the platform_data structure will be NULL and so
       check for this.
    
    6. The OMAP timer device tree binding has the following optional parameters ...
       a). ti,timer-alwon  --> Timer is in an always-on power domain
       b). ti,timer-dsp    --> Timer can generate an interrupt to the on-chip DSP
       c). ti,timer-pwm    --> Timer can generate a PWM output
       d). ti,timer-secure --> Timer is reserved on a secure OMAP device
       Search for the above parameters and set the appropriate timer attribute
       flags.
    Signed-off-by: default avatarJon Hunter <jon-hunter@ti.com>
    9725f445
dmtimer.c 22.2 KB