| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mci_of_parse takes care of the generic oftree bits, like removable flag,
aliases and max-frequency. Insert it, so we can start to refer to the
controller's block devices by a fixed name.
Sticking in the mci_of_parse shows that the SD/MMC2 driver in barebox
doesn't play nicely with the device tree specification of the SD/MMC2
for the dk2 board, however:
Specifying the bus-width = <4> property in the device tree now made mmc
usage fail when reading the environment:
ERROR: error SDMMC_STA_DCRCFAIL (0x81042) for cmd 18
ERROR: stm32_sdmmc2_end_cmd: error SDMMC_STA_CTIMEOUT (0x4) for cmd 12
WARNING: stm32_sdmmc2_send_cmd: cmd 12 failed, retrying ...
ERROR: stm32_sdmmc2_end_cmd: error SDMMC_STA_CTIMEOUT (0x4) for cmd 12
WARNING: stm32_sdmmc2_send_cmd: cmd 12 failed, retrying ...
ERROR: stm32_sdmmc2_end_cmd: error SDMMC_STA_CTIMEOUT (0x4) for cmd 12
WARNING: stm32_sdmmc2_send_cmd: cmd 12 failed, retrying ...
ERROR: stm32_sdmmc2_end_cmd: error SDMMC_STA_CTIMEOUT (0x4) for cmd 12
We'll want to fix this eventually, but for now force the bus width to 1.
So we don't forget about this, print a notice to the console that we've
done so.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
This driver was ported from u-boot v2019.10.
Instead of devicetree compatible it is using ARM AMBA id. So, there is
no need to patch devicetree with different compatible as it was
implemented in u-boot.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Currently the the driver don't handle any error and return immediately.
Handling the errors correctly is a must to support defered probing.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
If the current regulator can't be requested because of -EPROBE_DEFER we
shouldn't print a error and ignore it.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Layerscape and i.MX have different semantics of Watermark Level
Register. Whereas the former uses "0" to signify maximum allowed
value, the latter does not.
According to the RM (i.MX8MQ, i.MX6):
"...The read burst length must be less than or equal to the read
watermark level.."
Setting Watermark Level Register to zero violates that limitation. It
appears that, on i.MX8MQ, not following that rule causes certain
configs + toolchains to result in non-bootable image. Specifically,
polling for CICHB, CIDHB and DLA to clear in esdhc_send_cmd() times
out. There doesn't appear to be any clear relationship as to what kind
of image will have the problem, but the following combinations failed
to boot on ZII i.MX8MQ Zest board:
- gcc version 9.2.1 20190827 (Red Hat Cross 9.2.1-1) (GCC) +
imx_v8_defconfig + CONFIG_DEBUG_LL and CONFIG_PBL_CONSOLE
- gcc version 5.5.0 (Timesys 20190405) (custom toolchain) +
imx_v8_defconfig
Setting WML's *_BRST_LE to 16 and *_WML to 128 on i.MX resolves the
issue (same setting that's selected by writing 0 on Layerscape).
Fixes: 48562aeaa8 ("esdhc-xload: check for PRSSTAT_BREN only after each block")
Cc: Chris Healy <cphealy@gmail.com>
Cc: Ruslan Sushko <ruslan.sushko@zii.aero>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
We are running at MX8MQ_ATF_BL33_BASE_ADDR now, so we can't use
this as a temporary buffer. Add 32MiB to that address and use this
instead. Also copy the piggydata to the place where we expect it
later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Add a function to load and copy the piggy data to the correct offset
expected by barebox in the RAM. This way the PBL can later verify the
piggydata before uncompressing and loading the main barebox.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Extract the header parsing code from esdc_start_image. The header
parsing function will be used by the piggy loading code added in the
next commit.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use the potentially endianness-changing readl, writel and siblings
directly. They looks prettier and are the correct thing to do, as
even if the CPU is in big-endian mode, the peripherals are little-endian.
Unlike Linux, barebox readl,writel are the same Linux'
{readl,writel}_relaxed (they don't imply memory barriers)
and thus there shouldn't be any functional change.
Patch was generated by a mass search and replace. I looked it over,
adjust some whitespace and further verified by reviewing the output of
git diff HEAD~1 --word-diff | \
perl -pe 's/\[-(.*?)__raw_/{+$1/; s/-\]\{\+/+}{+/;' \
-e 's/(\{\+.*?\+\})\1/__ALL_IS_WELL__/' | grep '+}{+'
which filters out the common case of lines where a single
__raw_{readT,writeT} had its __raw_ prefix stripped without any
further changes.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Tested-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have several places in the code which which prepares just modified code
for execution. This is done differently in all the places, so add a common
function to be used by all.
Most places called arm_early_mmu_cache_flush(). This function includes
invalidating the instruction cache, so doing it again is unnecessary.
Sometimes we had arm_early_mmu_cache_flush() inside #ifdef CONFIG_MMU.
The ifdef seems unnecessary since we do not have it consistently, so
remove the ifdef.
Some early i.MX xload code had icache_invalidate() but forgot to flush
the caches. Replace the instruction cache invalidation with
sync_caches_for_execution().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The sdhost is a simple MMC controller found on the Broadcom
BCM283x line of SoCs. The driver code was ported from U-Boot
and then simplified a bit, by dropping a lot of the state
tracking.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
| |
MMC Frequency was set to something like 55MHz. This doesn't work for all
SD cards. Set to 25MHz which is supported by all SD cards.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
15b64fd520 introduced the ESDHC_FLAG_CACHE_SNOOPING for layerscape
support, but didn't actually set it for layerscape. Add the new
flag to the layerscape SoC data.
Fixes: 15b64fd520 ("mci: imx-esdhc: Add layerscape support")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With commit 3354adee3920 ("mci: imx-esdhc: Add bigendian register access
support") and commit 15b64fd520c2 ("mci: imx-esdhc: Add layerscape support")
two ESDHC_FLAGs got assigned to already existing values. This conflict made
the imx6sl usdhc appear to be big endian.
Resolve this conflict by assign the new flags to the next vacant values.
Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
Initialize is_be, otherwise the value of is_be is undefined.
So it is possible that the i.MX8 will not boot because the bigendian
functions are used.
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Our cyc_crc16() function is the same function as crc_itu_t() in the
Linux kernel. Import and use crc_itu_t() from the Kernel for
consistency.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The driver was missing a call to mci_of_parse() which fills in properties such
as "bus-width", "no-sd" into the mci_host struct.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
pinctrl driver needs to be initialized before mci driver on Raspberry Pi.
Otherwise the pinctrl device tree properties in the mci node are ignored.
pinctrl is initialized by coredevice_initcall(), so moving mci-bcm2835 to
device_initcall() ensures that it is initialized later.
There is no reason for mci-bcm2835 to use coredevice_initcall(). Other mci
drivers already use device_initcall().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The BREN bit tells us a watermark level sized buffer is ready for read.
Instead of testing it before each FIFO read we must only check it once
and then read a watermark level sized buffer. This is at least necessary
on Layerscape, otherwise timeouts occur while reading the buffer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
We'll need big endian support for Layerscape, so put the io accessors
into static inline wrappers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
To make them usable for the PBL driver aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
| |
The esdhc-xload code will be used by upcoming Layerscape support aswell,
so move it from architecture code to drivers/mci/.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The mci-bcm2835 driver registers itself as an MCI driver on probing, and
is thereby used through the MCI interface, so these functions are not
meant to act as a public interface and only used internally in this
compilation unit.
This fixes the following build warnings:
.../drivers/mci/mci-bcm2835.c:56:6: warning: no previous prototype for 'bcm2835_mci_write' [-Wmissing-prototypes]
void bcm2835_mci_write(struct bcm2835_mci_host *host, u32 reg, u32 val)
^~~~~~~~~~~~~~~~~
.../drivers/mci/mci-bcm2835.c:74:5: warning: no previous prototype for 'bcm2835_mci_read' [-Wmissing-prototypes]
u32 bcm2835_mci_read(struct bcm2835_mci_host *host, u32 reg)
^~~~~~~~~~~~~~~~
.../drivers/mci/mci-bcm2835.c:83:6: warning: no previous prototype for 'bcm2835_mci_write_data' [-Wmissing-prototypes]
void bcm2835_mci_write_data(struct bcm2835_mci_host *host, u32 *p)
^~~~~~~~~~~~~~~~~~~~~~
.../drivers/mci/mci-bcm2835.c:89:6: warning: no previous prototype for 'bcm2835_mci_read_data' [-Wmissing-prototypes]
void bcm2835_mci_read_data(struct bcm2835_mci_host *host, u32 *p)
^~~~~~~~~~~~~~~~~~~~~
CC common/date.o
.../drivers/mci/mci-bcm2835.c:419:5: warning: no previous prototype for 'bcm2835_mci_reset' [-Wmissing-prototypes]
int bcm2835_mci_reset(struct mci_host *mci, struct device_d *mci_dev)
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This adds support for the esdhc controller found on Layerscape SoCs.
This means adding the compatible and a driver data to access the
controller in bigendian mode.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
Layerscape will need bigendian io accessors. Add support for them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
Layerscape will need accesses in big endian mode. To make this
possible create static inline wrappers for the io accessors.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
Drop inclusion of unnecessary include from mach-imx/include/mach.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Other architectures using this driver may need a different clk_id to
find its clock. Make this configurable as a preparation for layerscape
support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
move platform_data from mach-imx/include/mach/ to include/platform_data
where it's available for other architectures aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
Avoid using cpu_is_* macros and use a dev_id instead. This will make it
easier to integrate the driver into another architecture.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
The esdhc controller is resetted once during probe by calling
esdhc_reset() and once open coded in esdhc_init(). Resetting it once is
enough, so drop the open coded reset from esdhc_init() and call
esdhc_reset() there. With this we can remove the call to esdhc_reset()
during probe.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Drop explicit devname setup code. Same setup will be done by
mci_of_parse().
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Drop explicit devname setup code. Same setup will be done by
mci_of_parse().
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Drop explicit devname setup code. Same setup will be done by
mci_of_parse().
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Drop explicit devname setup code. Same setup will be done by
mci_of_parse().
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Drop explicit devname setup code. Same setup will be done by
mci_of_parse().
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This idiom is repeatead by almost every mci driver, so move it to
mci_of_parse() in order to reduce amount of duplicated code.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The bootN-partitions binding is barebox-specific, so it shouldn't
be fixed up into the kernel device tree.
Suggested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|