Skip to content
Snippets Groups Projects
  1. Jul 16, 2021
  2. Jul 15, 2021
  3. Jul 14, 2021
    • Stephan Gerhold's avatar
      board: stemmy: Copy atags for booting downstream/vendor kernel · e2f82f93
      Stephan Gerhold authored and Tom Rini's avatar Tom Rini committed
      
      The U-Boot "stemmy" board is mainly intended to simplify booting
      mainline Linux on various smartphones from Samsung based on ST-Ericsson
      Ux500. While the mainline kernel is working great, there are still some
      features missing there. In particular, it is currently not possible to
      charge the battery when using the mainline kernel.
      
      This means that it is still necessary to boot the downstream/vendor
      kernel from Samsung sometimes to charge the device. That kernel is
      ancient, still uses board files + ATAGS instead of device trees and
      relies on a strange very long kernel command line hardcoded in the
      Samsung bootloader.
      
      Actually, since mainline is booted with device trees there is a very
      simple way to make the old downstream kernel work as well: We can
      simply take most of the ATAGS passed to U-Boot from the Samsung
      bootloader and copy them as-is when booting a kernel without device
      tree. That way the long command line and other needed ATAGS are copied
      as-is without having to bother with them.
      
      The only exception is the ATAG_INITRD - since the initrd is loaded
      by U-Boot, the atag for that should be generated in U-Boot so it points
      to the correct address. All other ATAGS are copied as-is and not
      generated in U-Boot.
      
      Also use the chance and provide a serial# for U-Boot by parsing the
      ATAG_SERIAL that is also passed by the Samsung bootloader.
      
      Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      e2f82f93
    • Stephan Gerhold's avatar
      board: stemmy: Parse atags to get available memory · 03585d52
      Stephan Gerhold authored and Tom Rini's avatar Tom Rini committed
      
      At the moment the "stemmy" board attempts to detect the RAM size with
      a simple memory test (get_ram_size()). Unfortunately, this does not work
      correctly for devices with 768 MiB RAM (e.g. Samsung Galaxy Ace 2
      (GT-I8160), "codina"). Reading/writing memory after the 768 MiB RAM
      succeeds but actually overwrites some earlier parts of the memory.
      
      For U-Boot this does not result in any major problems, but on Linux
      this will eventually lead to strange crashes because of the memory
      corruption.
      
      Since the "stemmy" U-Boot port is designed to be chainloaded from
      the original Samsung bootloader, the most reliable way to get the
      available amount of RAM is to look at the ATAGS passed by the Samsung
      bootloader. Fortunately, the header used to generate ATAGS in U-Boot
      (asm/setup.h) can also be easily used to parse them.
      
      Also clarify and simplify stemmy.h a bit to make it more clear where
      some of the magic values in there are actually coming from.
      
      Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      03585d52
    • Kunihiko Hayashi's avatar
      ARM: dts: uniphier: Add support for Akebi96 · 9e9074bc
      Kunihiko Hayashi authored and Tom Rini's avatar Tom Rini committed
      Add the device tree for Akebi96. Akebi96 is a 96boards certified
      development board based on UniPhier LD20.
      ( https://www.96boards.org/product/akebi96/
      
       )
      
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu@linaro.org>
      Signed-off-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
      9e9074bc
    • Stephan Gerhold's avatar
      arm: mach-snapdragon: pinctrl: Place pin_name in .data section · 548b89f8
      Stephan Gerhold authored and Tom Rini's avatar Tom Rini committed
      
      According to arch/arm/lib/crt0_64.S, the BSS section is "UNAVAILABLE"
      and uninitialized before relocation. Also, it overlaps with the
      appended DTB before relocation, so writing data into a variable
      in the BSS section might corrupt the appended DTB.
      
      Unfortunately, pinctrl-apq8016.c and pinctrl-apq8096.c do place the
      "pin_name" variable in the BSS section (since it's uninitialized).
      It's also used before relocation, when setting up the pinctrl for
      the serial driver.
      
      On DB410c this causes "GPIO_5" to be written into some part of an
      appended DTB, e.g.:
      
      80111820: edfe0dd0 9f100000 38000000 c00e0000    ...........8....
      80111830: 28000000 11000000 10000000 00000000    ...(............
      80111840: 4f495047 8800355f 00000000 00000000    GPIO_5..........
      80111850: 00000000 00000000 01000000 00000000    ................
      80111860: 03000000 04000000 00000000 02000000    ................
      80111870: 03000000 04000000 0f000000 02000000    ................
      80111880: 03000000 2d000000 1b000000 6c617551    .......-....Qual
      80111890: 6d6d6f63 63655420 6c6f6e68 6569676f    comm Technologie
      
      Depending on the part of the DTB that is corrupted this might not
      cause any problems, but it can also result in strange reboots
      without any serial output.
      
      Fortunately, in practice this does not cause issues on DB410c yet
      because board_fdt_blob_setup() in dragonboard410c.c currently
      overrides the appended DTB with the one passed by the previous
      bootloader (LK) (which does not get corrupted).
      
      DB820c does not have board_fdt_blob_setup() so I would expect it to
      be affected by this problem. Perhaps everyone was just fortunate to
      not compile an U-Boot configuration where the pin_name corrupts an
      important part of the DTB.
      
      Make sure "pin_name" is explicitly placed in the .data section
      instead of .bss to fix this.
      
      Cc: Ramon Fried <rfried.dev@gmail.com>
      Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
      Reviewed-by: default avatarRamon Fried <rfried.dev@gmail.com>
      548b89f8
  4. Jul 10, 2021
    • André Przywara's avatar
      mmc: sunxi: Increase MMIO FIFO read performance · 9faae545
      André Przywara authored
      
      To avoid the complexity of DMA operations (with chained descriptors), we
      use repeated MMIO reads and writes to the SD_FIFO_REG, which allows us
      to drain or fill the MMC data buffer FIFO very easily.
      
      However those MMIO accesses are somewhat costly, so this limits our MMC
      performance, to between 17 and 22 MB/s, but down to 9.5 MB/s on the H6
      (partly due to the lower AHB1 frequency).
      
      As it turns out we read the FIFO status register after *every* word we
      read or write, which effectively doubles the number of MMIO accesses,
      thus effectively more than halving our performance.
      
      To avoid this overhead, we can make use of the FIFO level bits, which are
      in the very same FIFO status registers.
      So for a read request, we now can collect as many words as the FIFO
      level originally indicated, and only then need to update the status
      register.
      
      We don't know for sure the size of the FIFO (and it seems to differ
      across SoCs anyway), so writing is more fragile, which is why we still
      use the old method for that. If we find a minimum FIFO size available on
      all SoCs, we could use that, in a later optimisation.
      
      This patch increases the eMMC read speed on a Pine64-LTS from about
      22MB/s to 44 MB/s. SD card reads don't gain that much, but with 23 MB/s
      we now reach the practical limit for 3.3V SD cards.
      On the H6 we double our transfer speed, from 9.5 MB/s to 19.7 MB/s.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      9faae545
    • André Przywara's avatar
      mmc: sunxi: Enable "new timing mode" on all new SoCs · b6e3bf1e
      André Przywara authored
      
      All SoCs since the Allwinner A64 (H5, H6, R40, H616) feature the so
      called "new timing mode", so enable this in Kconfig for those SoCs.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      b6e3bf1e
    • André Przywara's avatar
      mmc: sunxi: Fix MMC clock parent selection · 937ee31e
      André Przywara authored
      
      Most Allwinner SoCs which use the so called "new timing mode" in their
      MMC controllers actually use the double-rate PLL6/PERIPH0 clock as their
      parent input clock. This is interestingly enough compensated by a hidden
      "by 2" post-divider in the mod clock, so the divider and actual output
      rate stay the same.
      
      Even though for the H6 and H616 (but only for them!) we use the doubled
      input clock for the divider computation, we never accounted for the
      implicit post-divider, so the clock was only half the speed on those SoCs.
      This didn't really matter so far, as our slow MMIO routine limits the
      transfer speed anyway, but we will fix this soon.
      
      Clean up the code around that selection, to always use the normal PLL6
      (PERIPH0(1x)) clock as an input. As the rate and divider are the same,
      that makes no difference.
      Explain the hardware differences in a comment.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      937ee31e
    • André Przywara's avatar
      sunxi: H616: Enable full 4GB of DRAM · b8747854
      André Przywara authored
      
      The H616 is our first supported Allwinner SoC which goes beyond the 4GB
      address space "barrier", by having more than 32 address bits.
      
      Lift the preliminary 3GB DRAM limit for the H616, and update the page
      table setup on the way, to actually map that last GB as well.
      
      As not all devices are actually capable of dealing with more than 32
      bits (the DMA in the EMAC for instance), we also limit U-Boot's own
      DRAM usage to 4GB on the way.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      b8747854
    • Yu-Tung Chang's avatar
      sunxi: h3: Add initial ZeroPi support · 2527b24f
      Yu-Tung Chang authored and André Przywara's avatar André Przywara committed
      
      ZeroPi is a new board of high performance with low cost
      designed by FriendlyElec., using the Allwinner H3 SOC.
      
      ZeroPi features
      - Allwinner H3, Quad-core Cortex-A7@1.2GHz
      - 256MB/512MB DDR3 RAM
      - microsd slot
      - 10/100/1000Mbps Ethernet
      - Debug Serial Port
      - DC 5V/2A power-supply
      
      Signed-off-by: default avatarYu-Tung Chang <mtwget@gmail.com>
      Reviewed-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      2527b24f
    • André Przywara's avatar
      sunxi: clock: H6/H616: Fix PLL clock factor encodings · f9d13247
      André Przywara authored
      
      Most clock factors and dividers in the H6 PLLs use a "+1 encoding",
      which we were missing on two occasions.
      
      This fixes the MMC clock setup on the H6, which could be slightly off due
      to the wrong parent frequency:
      mmc 2 set mod-clk req 52000000 parent 1176000000 n 2 m 12 rate 49000000
      
      Also the CPU frequency (PLL1) was a tad too high before.
      
      For PLL5 (DRAM) we already accounted for this +1, but in the DRAM code
      itself, not in the bit field macro. Move this there to be aligned with
      what the other SoCs and other PLLs do.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
      f9d13247
    • André Przywara's avatar
      arm: dts: sunxi: h3: Update DT files · 8fcf1fa2
      André Przywara authored
      
      Update the H3 DT files from the Linux 5.12 release.
      
      The changes update some boards, and don't affect U-Boot, but fix Gigabit
      Ethernet when this DT is passed on to the Linux kernel.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      8fcf1fa2
    • André Przywara's avatar
      arm: dts: sunxi: h5: Update DT files · 58f68611
      André Przywara authored
      
      Update the H5 DT files from the Linux 5.12 release.
      
      The changes don't affect U-Boot at all, but fix Gigabit Ethernet when
      this DT is passed on to the Linux kernel. It also introduces DVFS.
      
      This also updates the shared sunxi-h3-h5.dtsi, but that only adds nodes
      that are of no concern to U-Boot.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      58f68611
    • André Przywara's avatar
      arm: dts: sunxi: h6: Update DT files · 127e57c6
      André Przywara authored
      
      Update the H6 DT files from the Linux 5.12 release.
      
      The changes are minimal (many LED node renames), but also help to enable
      USB port 0 in U-Boot (later), enable the RSB device (not yet used in
      U-Boot), and also introduce an MMC frequency limit.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      127e57c6
  5. Jul 09, 2021
  6. Jul 08, 2021
  7. Jul 06, 2021
Loading