01 Sep, 2017

1 commit

  • When enabling the new mmc timing mode, we inadvertently clear all the
    remaining bits in the new timing mode register. The bits cleared
    include a default phase delay on the output clock. The BSP kernel
    states that the default values are supposed to be used. Clearing them
    results in decreased performance or transfer errors on some boards.

    Fixes: de9b1771c3b6 ("mmc: sunxi: Support new mode")
    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Reviewed-by: Jagan Teki

    Chen-Yu Tsai
     

29 Aug, 2017

2 commits

  • The driver-model rework changed, among other things, the way the private
    data were moved around. It now uses the private field in the struct mmc.

    However, the mmc_create argument was changed in the process to always pass
    the array we used to have to store our private structures.

    The basically means that all the MMC driver instances will now have the
    private data of the first instance, which obviously doesn't work very well.

    Pass the proper pointer to mmc_create.

    Fixes: 034e226bc77e ("dm: mmc: sunxi: Pass private data around explicitly")
    Signed-off-by: Maxime Ripard
    Tested-by: Chen-Yu Tsai
    Tested-by: Jagan Teki
    Reviewed-by: Jagan Teki

    Maxime Ripard
     
  • Almost all of the newer Allwinner SoCs have a new operating mode for the
    eMMC clocks that needs to be enabled in both the clock and the MMC
    controller.

    Details about that mode are sparse, and the name itself (new mode vs old
    mode) doesn't give much details, but it seems that the it changes the
    sampling of the MMC clock. One side effect is also that it divides the
    parent clock rate by 2.

    Add support for it through a Kconfig option.

    Signed-off-by: Maxime Ripard
    Reviewed-by: Jagan Teki

    Maxime Ripard
     

01 Aug, 2017

5 commits


11 Jan, 2017

1 commit


16 Nov, 2016

1 commit


05 Aug, 2016

1 commit


15 Jul, 2016

2 commits


01 Apr, 2016

2 commits

  • The Allwinner A64 SoC is used in the Pine64. This patch adds
    all bits necessary to compile U-Boot for it running in AArch64
    mode.

    Unfortunately SPL is not ready yet due to legal problems, so
    we need to boot using the binary boot0 for now.

    Signed-off-by: Siarhei Siamashka
    [agraf: remove SPL code, move to AArch64]
    Signed-off-by: Alexander Graf
    Acked-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Siarhei Siamashka
     
  • Some parts of the sunxi code cast explicitly between u32 values and pointers.
    This is not a problem in practice, because all 64bit SoCs today only use the
    lower 32 bits for their phyical address space. But we need to make sure that
    the compiler is sure this is not an accident as well.

    Signed-off-by: Alexander Graf
    Acked-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Alexander Graf
     

14 Jan, 2016

1 commit

  • This will allow the implementation to make use of data in the block_dev
    structure beyond the base device number. This will be useful so that eMMC
    block devices can encompass the HW partition ID rather than treating this
    out-of-band. Equally, the existence of the priv field is crying out for
    this patch to exist.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini

    Stephen Warren
     

29 Sep, 2015

1 commit

  • In recent allwinner kernel sources the mmc/sdio clk-delay settings have
    been slightly tweaked, and for sun9i they are completely different then
    what we are using.

    This commit brings us in sync with what allwinner does, fixing problems
    accessing sdcards on some A33 devices (and likely others).

    For pre sun9i hardware this makes the following changes:
    -At 400Khz change the sample delay from 7 to 0 (first introduced in A31 sdk)
    -At 50 Mhz change the sample delay from 5 to 4 (first introduced in A23 sdk)
    -Above 50 MHz change the out delay from 2 to 1 (first introduced in A20 sdk)

    Signed-off-by: Hans de Goede
    Acked-by: Ian Campbell

    Hans de Goede
     

31 Aug, 2015

1 commit

  • Originally a timeout value of 2 seconds was used regardless of the size
    of data to be transfered. This prevented slow devices from working
    correctly while there was no much gain for faster devices, e.g. it takes
    3708ms for a transfer of uImage of size 1899008 bytes.

    Signed-off-by: Yousong Zhou
    Acked-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Yousong Zhou
     

24 Jul, 2015

1 commit

  • This patch extracts checking for valid SD card "eGON.BT0" signature from
    `board_mmc_init` into function `sunxi_mmc_has_egon_boot_signature`.

    Buffer for mmc sector is allocated and freed at runtime. `panic` is
    triggered on malloc failure.

    Signed-off-by: Daniel Kochmański
    CC: Roy Spliet
    Cc: Ian Campbell
    [hdegoede@redhat.com: Small bugfix to make it work for devs other then mmc0]
    Acked-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Daniel Kochmański
     

04 Jun, 2015

1 commit


05 May, 2015

2 commits


04 May, 2015

2 commits

  • The driver-model gpio functions may return another value then -1 as error,
    make the sunxi mmc code properly handle this.

    Signed-off-by: Hans de Goede
    Reviewed-by: Simon Glass
    Acked-by: Ian Campbell

    Hans de Goede
     
  • sun6i and newer (derived) SoCs such as the sun8i-a23, sun8i-a33 and sun9i
    have a various things in common, like having separate ahb reset control
    registers, the SID living inside the pmic, custom pmic busses, new style
    watchdog, etc.

    This commit introduces a new hidden SUNXI_GEN_SUN6I Kconfig bool which can be
    used to check for these features avoiding the need for an ever growing list
    of "#if defined CONFIG_MACH_SUN?I" conditionals as we add support for more
    "new style" sunxi SoCs.

    Note that this commit changes the behavior of the gmac and hdmi code for
    sun8i and the upcoming sun9i devices. This does not matter as sun8i does
    not have gmac nor hdmi, and sun9i has new hardware-blocks for these so
    the old code will not work there.

    Also this is intentional as if a sun8i / sun9i variant which does use the
    old hwblocks shows up then the GEN_SUN6I code paths will be the right ones
    to use.

    For completeness this also adds a SUNXI_GEN_SUN4I bool for A10/A13/A20.

    Signed-off-by: Hans de Goede
    Acked-by: Ian Campbell

    Hans de Goede
     

21 Feb, 2015

1 commit


02 Feb, 2015

1 commit


22 Jan, 2015

2 commits


14 Jan, 2015

2 commits

  • It does not make sense to make gpio_direction_input() return the gpio input
    status. The return value of gpio_direction_input() is inconsistent if
    CONFIG_DM_GPIO is defined.
    And we don't need to call gpio_direction_input() int sunxi_mmc_getcd().
    Just init the gpio once in mmc_resource_init() is enough.

    Signed-off-by: Axel Lin
    Reviewed-by: Simon Glass
    Signed-off-by: Ian Campbell

    Axel Lin
     
  • The sunxi mmc controller has both an internal clock divider, as well as
    the divider in the mod0-clk for the mmc controller.

    The internal divider cannot be used, as it conflicts with the setting of
    clock sampling phases which is done in the mod0-clk, so it must be set to
    0 (divide by 1).

    For some reason while the kernel has had this correct from day one, the
    u-boot sunxi mmc code has been using a fixed mod0-clk and setting its
    internal divider depending on the desired speed. This is something which
    we've inherited from the original Allwinner u-boot sources, but while this
    has been fixed in Allwinner's own u-boot code at least for the A23 and later
    upstream u-boot was still doing this wrong.

    This commit fixes this, thereby also fixing mmc support not working reliable
    on the A23 (which seems more sensitive to this) and possible also fixes some
    other sunxi mmc issues.

    Signed-off-by: Hans de Goede
    Acked-by: Ian Campbell

    Hans de Goede
     

05 Nov, 2014

2 commits


24 Oct, 2014

5 commits


07 Jul, 2014

1 commit

  • The DMA code in sunxi_mmc.c is broken. mmc_trans_data_by_dma() allocates the
    dma descriptors on the stack, and then exits while the dma transfer is in
    progress, so the dma engine is reading stack memory which at that point may
    be re-used. So far we've gotten away with this by luck, but recent u-boot
    changes have shifted the stack start address by 16 bytes, which combined
    with dma alignment now exposes this problem.

    Since we end up just busy waiting for the dma engine anyway, this commit
    fixes things by simply removing the dma code, resulting in smaller bug-free
    code.

    Signed-off-by: Hans de Goede
    Acked-by: Ian Campbell

    Hans de Goede
     

25 May, 2014

1 commit

  • On Mon, 2014-05-05 at 14:18 +0200, Stefan Roese wrote:
    > > + case 1:
    > > +#if CONFIG_MMC1_PG

    > Are you sure that this is correct and shouldn't be:
    >
    > +#ifdef CONFIG_MMC1_PG
    >
    > ?

    It's "correct" in so far as it works (the boards.cfg config stuff
    #defines things to 1), but I think you are right that it isn't the
    preferred style. But...

    > A quick scan through this patch series shows that this define
    > is not set at all. Perhaps its outdated? Or is it used to support
    > some other sunxi SoC? Not sure, perhaps it should be removed for
    > now.

    ...I had thought that it was to support some other board which wasn't
    being upstreamed right now, so eventually useful and harmless for now,
    but I've just checked and it isn't actually used by any of the boards in
    u-boot-sunxi.git. So rather than fix it to use #ifdef lets drop it.
    Rather than resend the entire series, here is v5.1 of this patch.

    > Other than this please add my:
    >
    > Reviewed-by: Stefan Roese

    Thanks!

    8From 20704e35a41664de5f516ed0e02981ac06085102 Mon Sep 17 00:00:00 2001
    From: Ian Campbell
    Date: Fri, 7 Mar 2014 04:29:39 +0000
    Subject: [PATCH v5.1 7/8] sunxi: mmc support

    This adds support for the MMC controller on the Allwinner A20 (sun7i)
    processor.

    Signed-off-by: Henrik Nordstrom
    Signed-off-by: Luke Leighton
    Signed-off-by: Oliver Schinagl
    Signed-off-by: Wills Wang
    Signed-off-by: Ian Campbell
    Reviewed-by: Marek Vasut
    Reviewed-by: Stefan Roese
    Cc: Tom Cubie
    Cc: Aaron Maoye
    Cc: Pantelis Antoniou
    Reviewed-by: Tom Rini

    Ian Campbell