Verified Commit cbaaab32 authored by Dan Johansen's avatar Dan Johansen
Browse files

add patch to fix ap6256 wifi on amlogic boards, like the Radxa Zero


Signed-off-by: Dan Johansen's avatarDan Johansen <strit@manjaro.org>
parent dae36148
Pipeline #4521 passed with stage
in 100 minutes and 8 seconds
This revets 103a5348c22c3fca8b96c735a9e353b8a0801842
Revert is required hack to get ap6256 wifi working ok on Amlogic.
Propper fix will be added soon...
Milion thx for Neil Armstrong for helping with this!
diff -Naur linux-5.13.5-old/drivers/mmc/host/meson-gx-mmc.c linux-5.13.5-new/drivers/mmc/host/meson-gx-mmc.c
--- linux-5.13.5-old/drivers/mmc/host/meson-gx-mmc.c 2021-07-25 14:37:37.000000000 +0200
+++ linux-5.13.5-new/drivers/mmc/host/meson-gx-mmc.c 2021-07-26 14:45:59.626665204 +0200
@@ -165,7 +165,6 @@
unsigned int bounce_buf_size;
void *bounce_buf;
- void __iomem *bounce_iomem_buf;
dma_addr_t bounce_dma_addr;
struct sd_emmc_desc *descs;
dma_addr_t descs_dma_addr;
@@ -746,47 +745,6 @@
writel(start, host->regs + SD_EMMC_START);
}
-/* local sg copy to buffer version with _to/fromio usage for dram_access_quirk */
-static void meson_mmc_copy_buffer(struct meson_host *host, struct mmc_data *data,
- size_t buflen, bool to_buffer)
-{
- unsigned int sg_flags = SG_MITER_ATOMIC;
- struct scatterlist *sgl = data->sg;
- unsigned int nents = data->sg_len;
- struct sg_mapping_iter miter;
- unsigned int offset = 0;
-
- if (to_buffer)
- sg_flags |= SG_MITER_FROM_SG;
- else
- sg_flags |= SG_MITER_TO_SG;
-
- sg_miter_start(&miter, sgl, nents, sg_flags);
-
- while ((offset < buflen) && sg_miter_next(&miter)) {
- unsigned int len;
-
- len = min(miter.length, buflen - offset);
-
- /* When dram_access_quirk, the bounce buffer is a iomem mapping */
- if (host->dram_access_quirk) {
- if (to_buffer)
- memcpy_toio(host->bounce_iomem_buf + offset, miter.addr, len);
- else
- memcpy_fromio(miter.addr, host->bounce_iomem_buf + offset, len);
- } else {
- if (to_buffer)
- memcpy(host->bounce_buf + offset, miter.addr, len);
- else
- memcpy(miter.addr, host->bounce_buf + offset, len);
- }
-
- offset += len;
- }
-
- sg_miter_stop(&miter);
-}
-
static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
{
struct meson_host *host = mmc_priv(mmc);
@@ -830,7 +788,8 @@
if (data->flags & MMC_DATA_WRITE) {
cmd_cfg |= CMD_CFG_DATA_WR;
WARN_ON(xfer_bytes > host->bounce_buf_size);
- meson_mmc_copy_buffer(host, data, xfer_bytes, true);
+ sg_copy_to_buffer(data->sg, data->sg_len,
+ host->bounce_buf, xfer_bytes);
dma_wmb();
}
@@ -999,7 +958,8 @@
if (meson_mmc_bounce_buf_read(data)) {
xfer_bytes = data->blksz * data->blocks;
WARN_ON(xfer_bytes > host->bounce_buf_size);
- meson_mmc_copy_buffer(host, data, xfer_bytes, false);
+ sg_copy_from_buffer(data->sg, data->sg_len,
+ host->bounce_buf, xfer_bytes);
}
next_cmd = meson_mmc_get_next_command(cmd);
@@ -1219,7 +1179,7 @@
* instead of the DDR memory
*/
host->bounce_buf_size = SD_EMMC_SRAM_DATA_BUF_LEN;
- host->bounce_iomem_buf = host->regs + SD_EMMC_SRAM_DATA_BUF_OFF;
+ host->bounce_buf = host->regs + SD_EMMC_SRAM_DATA_BUF_OFF;
host->bounce_dma_addr = res->start + SD_EMMC_SRAM_DATA_BUF_OFF;
} else {
/* data bounce buffer */
......@@ -10,7 +10,7 @@ _srcname=linux-${_rcver}-rc${_rcrel}
_kernelname=${pkgbase#linux}
_desc="AArch64 multi-platform (release candidate)"
pkgver=${_rcver}.rc${_rcrel}
pkgrel=2
pkgrel=3
arch=('aarch64')
url="http://www.kernel.org/"
license=('GPL2')
......@@ -19,6 +19,7 @@ options=('!strip')
source=("https://git.kernel.org/torvalds/t/${_srcname}.tar.gz"
'0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch'
'0002-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch'
'0003-fix-ap6256-wifi-on-amlogic.patch'
'0005-arm64-dts-allwinner-add-hdmi-sound-to-pine-devices.patch'
'0006-arm64-dts-allwinner-add-ohci-ehci-to-h5-nanopi.patch'
'0007-drm-bridge-analogix_dp-Add-enable_psr-param.patch'
......@@ -64,6 +65,7 @@ source=("https://git.kernel.org/torvalds/t/${_srcname}.tar.gz"
md5sums=('233e8313e6db6f62df7c40418f796965'
'9e6b7f44db105fef525d715213dce7cf'
'754cf09a858498e1d98b44baa043a196'
'9d0cdb7e6deae9b185e07a5bc342f116'
'0d47dea87f03bf36262171e01889f832'
'e6fe272dc95a1c0a8f871924699fea16'
'9f27b2a05eaeb1995fc0fcf6a8b923c4'
......@@ -115,6 +117,7 @@ prepare() {
# Manjaro ARM Patches
patch -Np1 -i "${srcdir}/0002-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch" #Radxa Zero
patch -Np1 -i "${srcdir}/0003-fix-ap6256-wifi-on-amlogic.patch" #AMLogic
patch -Np1 -i "${srcdir}/0005-arm64-dts-allwinner-add-hdmi-sound-to-pine-devices.patch" #Pine64
patch -Np1 -i "${srcdir}/0006-arm64-dts-allwinner-add-ohci-ehci-to-h5-nanopi.patch" #Nanopi Neo Plus 2
patch -Np1 -i "${srcdir}/0007-drm-bridge-analogix_dp-Add-enable_psr-param.patch" #Pinebook Pro
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment