1. 02 Jun, 2021 1 commit
    • Pali Rohár's avatar
      fix(plat/marvell/a3720/uart): fix UART parent clock rate determination · 5a91c439
      Pali Rohár authored
      
      
      The UART code for the A3K platform assumes that UART parent clock rate
      is always 25 MHz. This is incorrect, because the xtal clock can also run
      at 40 MHz (this is board specific).
      
      The frequency of the xtal clock is determined by a value on a strapping
      pin during SOC reset. The code to determine this frequency is already in
      A3K's comphy driver.
      
      Move the get_ref_clk() function from the comphy driver to a separate
      file and use it for UART parent clock rate determination.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I8bb18a2d020ef18fe65aa06ffa4ab205c71be92e
      5a91c439
  2. 01 Jun, 2021 3 commits
    • Pali Rohár's avatar
      refactor(plat/marvell/uart): de-duplicate PLAT_MARVELL_UART macros · 31336258
      Pali Rohár authored
      
      
      Macros PLAT_MARVELL_BOOT_UART* and PLAT_MARVELL_CRASH_UART* are defined
      to same values. De-duplicate them into PLAT_MARVELL_UART* macros.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: Iae5daf7cad6a971e6f3dbe561df3d0174106ca7f
      31336258
    • Pali Rohár's avatar
      refactor(plat/marvell/uart): remove unused macros · 6b557f48
      Pali Rohár authored
      Macros PLAT_MARVELL_BL31_RUN_UART* are not used since commit
      d7c4420c
      
       ("plat/marvell: Migrate to multi-console API").
      
      Remove them.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I5ec959ef4de87dcfb332c017ad2599bf8af6ffc3
      6b557f48
    • Pali Rohár's avatar
      fix(plat/marvell/a3720/uart): fix configuring UART clock · b9185c75
      Pali Rohár authored
      
      
      When configuring the UART_BAUD_REG register, the function
      console_a3700_core_init() currently only changes the baud divisor field,
      leaving other fields to their previous value.
      
      This is incorrect, because the baud divisor is computed with the
      assumption that the parent clock rate is 25 MHz, and since the other
      fields in this register configure the parent clock, which could have
      been changed by U-Boot or Linux.
      
      Fix this function to also configure the other fields so that the UART
      parent clock is selected to be the xtal clock.
      
      For example without this change TF-A prints only
      
          ERROR: a3700_system_off needs to be implemented
      
      followed by garbage after plat_crash_console_init() is called.
      
      After applying this change instead of garbage it also print crash info:
      
          PANIC at PC : 0x0000000004023800
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I72f338355cc60d939b8bb978d9c7fdd576416b81
      b9185c75
  3. 28 May, 2021 1 commit
    • Pali Rohár's avatar
      fix(plat/marvell/a3720/uart): fix UART clock rate value and divisor calculation · 66a77528
      Pali Rohár authored
      
      
      UART parent clock is by default the platform's xtal clock, which is
      25 MHz.
      
      The value defined in the driver, though, is 25.8048 MHz. This is a hack
      for the suboptimal divisor calculation
        Divisor = UART clock / (16 * baudrate)
      which does not use rounding division, resulting in a suboptimal value
      for divisor if the correct parent clock rate was used.
      
      Change the code for divisor calculation to
        Divisor = Round(UART clock / (16 * baudrate))
      and change the parent clock rate value to 25 MHz.
      
      The final UART divisor for default baudrate 115200 is not affected by
      this change.
      
      (Note that the parent clock rate should not be defined via a macro,
      since the xtal clock can also be 40 MHz. This is outside of the scope of
      this fix, though.)
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: Iaa401173df87aec94f2dd1b38a90fb6ed0bf0ec6
      66a77528
  4. 17 May, 2021 3 commits
  5. 14 May, 2021 3 commits
  6. 13 May, 2021 3 commits
  7. 12 May, 2021 3 commits
  8. 07 May, 2021 2 commits
  9. 05 May, 2021 3 commits
  10. 04 May, 2021 2 commits
  11. 30 Apr, 2021 14 commits
  12. 29 Apr, 2021 2 commits