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
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 -
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
01 Aug, 2017
5 commits
-
Add a driver-model version of this driver which mostly uses the existing
code. The old code can be removed once all boards are switched over.Signed-off-by: Simon Glass
-
This function has #ifdefs in it which we want to avoid for driver model.
Instead we should use different compatible strings and the .data field.
It also uses the MMC device number which is not available in driver
model except through aliases.Move the function's into its caller so that the driver-model version can
do things its own way.Signed-off-by: Simon Glass
Acked-by: Maxime Ripard -
At present the driver-private data is obtained in various functions by
various means. With driver model this is provided automatically. Without
driver model it comes from a C array declared at the top of the file.Adjust internal functions so that they are passed the private data as
a parameter, allowing the caller to obtain it using either means.Signed-off-by: Simon Glass
Acked-by: Maxime Ripard -
Use the driver-model naming convention for this structure. It is data
private to the driver so the local variable should be called 'priv'.Signed-off-by: Simon Glass
Acked-by: Maxime Ripard -
Use the driver-model naming convention for this structure. It is data
private to the driver.Signed-off-by: Simon Glass
Acked-by: Maxime Ripard
11 Jan, 2017
1 commit
-
To maintain consistency, set_ios type of legacy mmc_ops changed to int.
Signed-off-by: Jaehoon Chung
16 Nov, 2016
1 commit
-
The sun8i SoCs also have a 8 bits capable MMC2 controller. Enable the
support for those too.Signed-off-by: Maxime Ripard
Reviewed-by: Chen-Yu Tsai
Reviewed-by: Hans de Goede
05 Aug, 2016
1 commit
-
Use the generic error number instead of specific error number.
If use the generic error number, it can debug more easier.Signed-off-by: Jaehoon Chung
Reviewed-by: Simon Glass
Reviewed-by: Minkyu Kang
15 Jul, 2016
2 commits
-
Now that we know that the BROM stores a value indicating the boot-source
at the beginning of SRAM, use that instead of trying to recreate the
BROM's boot probing.Signed-off-by: Hans de Goede
Acked-by: Ian Campbell -
With a recent bunch of SD3.0 cards in our A20-based board we
experienced data transfer rates of about 250 KiB/s instead of 10 MiB/s
with previous cards from the same vendor (both 4 GB/class 10). By
increasing status register polling rate from 1 kHz to 1 MHz we were
able to reach the original transfer rates again. With the old cards
we now even reach about 16 MiB/s.Signed-off-by: Tobias Doerffel
Reviewed-by: Hans de Goede
Signed-off-by: Hans de Goede
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 -
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
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
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
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
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
04 Jun, 2015
1 commit
-
On some boards we need to enable the internal pull-up te reliable detect
that no card is inserted.Signed-off-by: Hans de Goede
05 May, 2015
2 commits
-
High capacity support is not a host capability, but a device capability
that is queried via the OCR. The flag in the operating conditions
request argument can just be set unconditionally. This matches the Linux
implementation.[panto] Hand merged and renumbering MMC_MODE_DDR_52MHz.
Signed-off-by: Rob Herring
Signed-off-by: Pantelis Antoniou
Cc: Pantelis Antoniou
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 -
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
21 Feb, 2015
1 commit
-
High Capacity (e)MMC cards work fine on sun4i / sun5i, and not having this
capability set causes u-boot to not recognize the eMMC on an Utoo P66 A13
tablet, so always set it thereby fixing this.Signed-off-by: Hans de Goede
Acked-by: Ian Campbell
02 Feb, 2015
1 commit
-
This results in a much more readable callgraph, because now they
can't be confused with the function having exactly the same name
in the generic mmc code.Signed-off-by: Siarhei Siamashka
Acked-by: Hans de Goede
Signed-off-by: Hans de Goede
22 Jan, 2015
2 commits
-
The clocks on the A80 are hooked up slightly different, add support for this.
Signed-off-by: Hans de Goede
Acked-by: Ian Campbell -
Wait 1 second for the sdcard to respond, rather then waiting for
0xfffff milliseconds.Signed-off-by: Hans de Goede
Acked-by: Ian Campbell
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 -
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
05 Nov, 2014
2 commits
-
This is necessary for the device-model enabled builds to work properly.
Signed-off-by: Hans de Goede
Acked-by: Simon Glass -
Mostly automatic with:
sed -i -e 's/CONFIG_\(SUN[45678]I\)/CONFIG_MACH_\1/g' $(git grep -l CONFIG_SUN[45678]I)
followed by removing the relevant #defines from include/configs/sun?i.h by
hand.Signed-off-by: Ian Campbell
Reviewed-by: Hans de Goede
Signed-off-by: Hans de Goede
24 Oct, 2014
5 commits
-
The Allwinner A23 SoC has reset controls like the A31 (sun6i).
The FIFO address is also the same as sun6i.Re-use code added for sun6i.
Signed-off-by: Chen-Yu Tsai
Acked-by: Ian Campbell -
sunxi SOCs can boot from both mmc0 and mmc2, detect from which one we're
booting, and make that one "mmc dev 0" so that a single u-boot binary can
be used for both the onboard eMMC and for external sdcards.When we're booting from mmc2, we make it dev 0 because that is where the SPL
will load the tertiary payload (the actual u-boot binary in our case) from,
see: common/spl/spl_mmc.c, which has dev 0 hardcoded everywhere.Signed-off-by: Hans de Goede
Acked-by: Ian Campbell -
Signed-off-by: Hans de Goede
Acked-by: Ian Campbell -
The mmc hardware on sun6i has an extra reset control that needs to
be de-asserted prior to usage. Also the FIFO address is different.Signed-off-by: Hans de Goede
[wens@csie.org: use setbits_le32 for reset control, drop obsolete changes,
rewrite different FIFO address handling, add commit message]
Signed-off-by: Chen-Yu Tsai
Acked-by: Ian Campbell -
Allwinner A20/A23/A31's SD/MMC host support SDHC High Capacity feature.
Signed-off-by: Wills Wang
Signed-off-by: Hans de Goede
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
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 RoeseThanks!
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 supportThis 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