Skip to content
  • Kurban Mallachiev's avatar
    c98c9eba
    ARM i.MX timers: fix reset handling · c98c9eba
    Kurban Mallachiev authored
    
    
    The i.MX timer device can be reset by writing to the SWR bit
    of the CR register. This has to behave differently from hard
    (power-on) reset because it does not reset all of the bits
    in the CR register.
    
    We were incorrectly implementing soft reset and hard reset
    the same way, and in addition had a logic error which meant
    that we were clearing the bits that soft-reset is supposed
    to preserve and not touching the bits that soft-reset clears.
    This was not correct behaviour for either kind of reset.
    
    Separate out the soft reset and hard reset code paths, and
    correct the handling of reset of the CR register so that it
    is correct in both cases.
    
    Signed-off-by: default avatarKurban Mallachiev <mallachiev@ispras.ru>
    [PMM: rephrased commit message, spacing on operators;
     use bool rather than int for is_soft_reset]
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    c98c9eba
    ARM i.MX timers: fix reset handling
    Kurban Mallachiev authored
    
    
    The i.MX timer device can be reset by writing to the SWR bit
    of the CR register. This has to behave differently from hard
    (power-on) reset because it does not reset all of the bits
    in the CR register.
    
    We were incorrectly implementing soft reset and hard reset
    the same way, and in addition had a logic error which meant
    that we were clearing the bits that soft-reset is supposed
    to preserve and not touching the bits that soft-reset clears.
    This was not correct behaviour for either kind of reset.
    
    Separate out the soft reset and hard reset code paths, and
    correct the handling of reset of the CR register so that it
    is correct in both cases.
    
    Signed-off-by: default avatarKurban Mallachiev <mallachiev@ispras.ru>
    [PMM: rephrased commit message, spacing on operators;
     use bool rather than int for is_soft_reset]
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Loading