Skip to content
Snippets Groups Projects
  1. Apr 22, 2024
    • André Przywara's avatar
      sunxi: sun50i_h6: make more clock functions SPL only · c209a716
      André Przywara authored
      
      In clock_sun50i_h6.c, responsible for (mostly early) clock setup on
      newer generation Allwinner SoCs, many functions are only needed by the
      SPL, and are thus already guarded by CONFIG_SPL_BUILD.
      
      Over the years drivers like for the UART or I2C were converted to DM,
      so they care about clock setup themselves now, by using a proper DM clock
      driver.
      
      This means those devices need the clock setup functions here for the SPL
      only. Include those functions into the existing CONFIG_SPL_BUILD guards,
      so they are compiled for the SPL only. By moving the clock_get_pll6()
      function to the end of the file, all SPL-only clocks can be contained
      within one #ifdef guard.
      
      This avoids unnecessary code in U-Boot proper and helps further
      refactoring. Add some comments on the way to help understanding of the
      file.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      c209a716
    • André Przywara's avatar
      sunxi: sun6i: make more clock functions SPL only · 58bf0899
      André Przywara authored
      
      In clock_sun6i.c, responsible for (mostly early) clock setup on older
      generation Allwinner SoCs, many functions are only needed by the SPL,
      and are thus already guarded by CONFIG_SPL_BUILD.
      
      Over the years drivers like for the UART or I2C were converted to DM,
      so they care about clock setup themselves now, by using a proper DM clock
      driver.
      
      This means those devices need the clock setup functions here for the SPL
      only. Include those functions into the existing CONFIG_SPL_BUILD guards,
      so they are compiled for the SPL only.
      
      This avoids unnecessary code in U-Boot proper and helps further
      refactoring. Add some comments on the way to help understanding of the
      file.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      58bf0899
    • André Przywara's avatar
      sunxi: sun4i: make more clock functions SPL only · a2b2a47a
      André Przywara authored
      
      In clock_sun4i.c, responsible for (mostly early) clock setup on early
      generation Allwinner SoCs, many functions are only needed by the SPL,
      and are thus already guarded by CONFIG_SPL_BUILD.
      
      Over the years drivers like for the UART or I2C were converted to DM,
      so they care about clock setup themselves now, by using a proper DM clock
      driver.
      
      This means those devices need the clock setup functions here for the SPL
      only. Include those functions into the existing CONFIG_SPL_BUILD guards,
      so they are compiled for the SPL only.
      
      This avoids unnecessary code in U-Boot proper and helps further
      refactoring. Add some comments on the way to help understanding of the
      file.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      a2b2a47a
    • André Przywara's avatar
      sunxi: compile clock.c for SPL only · 8cb3c494
      André Przywara authored
      
      With the clock_twi_onoff() function now being called only from the SPL,
      the whole clock.c file in arch/arm/mach-sunxi is needed by SPL code
      only.
      
      Remove the redundant #ifdef from the clock_init() function, actually
      this function was already only called from the SPL.
      Then adjust the Makefile to compile clock.c only with CONFIG_SPL_BUILD
      defined.
      
      This avoids unnecessary code in U-Boot proper and allows further
      refactoring and code-split between the SPL and U-Boot proper.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      8cb3c494
    • André Przywara's avatar
      sunxi: remove unneeded i2c_init_board() call for U-Boot proper · 1a6828d0
      André Przywara authored
      
      The driver used for the Allwinner I2C IP is using proper DT and DM
      enablement for a while: we enable the clock gate and de-assert the reset
      line in the driver's probe() routine, and the pinmux setup is taken care
      of by the DM framework.
      
      This means the explicit call to the i2c_init_board() routine is not
      needed for U-Boot proper. As the board_init() function in board.c is
      only called for U-Boot proper, we can remove the call, something that
      the comment there hinted at already.
      
      Fix the comment for the board_init() function on the way: we were not
      really doing board specific setup there. The fact that this function
      is called from U-Boot proper only is probably more helpful for reasoning
      about this code.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      1a6828d0
    • André Przywara's avatar
      sunxi: move #ifdef guards around tzpc_init() to header file · 02780a1c
      André Przywara authored
      
      Some later 32-bit SoCs require some setup of the Secure Peripherals
      Controller, which is handled in tzpc_init().
      At the moment this is guarded in board.c by some #ifdefs selecting the
      SoCs that need it.
      
      Move those #ifdef guards into the header file, providing an empty stub
      function for all other SoCs, so that the #ifdefs can be removed from the
      .c file, to improve readability.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      02780a1c
    • André Przywara's avatar
      usb: musb-new: add Allwinner F1C100s support · 6f68b9ce
      André Przywara authored
      
      The Allwinner F1C100s SoC has a MUSB controller like the one in the A33,
      but needs an SRAM region to be claimed like the A10. We do the latter
      anyway, even on chips that don't need it, so there is no real difference
      in our compatible string matching.
      
      Add a mapping between the config struct used in the Linux to our
      requirements here on the way.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      6f68b9ce
  2. Apr 21, 2024
    • Maksim Kiselev's avatar
      sunxi: SPL SPI: Add SPI boot support for the Allwinner R528/T113 SoCs · 83d5e3c9
      Maksim Kiselev authored and André Przywara's avatar André Przywara committed
      
      R528/T113 SoCs uses the same SPI IP as the H6, also have the same clocks
      and reset bits layout, but the CCU base is different. Another difference
      is that the new SoCs do not have a clock divider inside. Instead of this
      we should configure sample mode depending on input clock rate.
      
      The pin assignment is also different: the H6 uses PC0, the R528/T113 PC4
      instead. This makes for a change in spi0_pinmux_setup() routine.
      
      This patch extends the H6/H616 #ifdef guards to also cover the R528/T113,
      using the shared CONFIG_SUNXI_GEN_NCAT2 and CONFIG_MACH_SUN8I_R528
      symbols. Also use CONFIG_SUNXI_GEN_NCAT2 symbol for the Kconfig
      dependency.
      
      Signed-off-by: default avatarMaksim Kiselev <bigunclemax@gmail.com>
      Tested-by: default avatarSam Edwards <CFSworks@gmail.com>
      83d5e3c9
  3. Apr 20, 2024
  4. Apr 19, 2024
Loading