From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 03/21] mci: sdhci: support compiling common SDHCI code for sandbox PBL
Date: Thu, 5 Jun 2025 13:35:12 +0200 [thread overview]
Message-ID: <20250605113530.2076990-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250605113530.2076990-1-a.fatoum@pengutronix.de>
We do not link sandbox with --gc-sections, so having references to
non-existent functions would lead to errors, even if they are never
called. Fix this by providing stubs.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
include/dma.h | 22 +++++++++++++++++-----
include/mci.h | 9 +++++++++
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/include/dma.h b/include/dma.h
index cb44963cc02e..b8016c2e890e 100644
--- a/include/dma.h
+++ b/include/dma.h
@@ -105,6 +105,12 @@ void dma_sync_single_for_cpu(struct device *dev, dma_addr_t address,
void dma_sync_single_for_device(struct device *dev, dma_addr_t address,
size_t size, enum dma_data_direction dir);
+
+dma_addr_t dma_map_single(struct device *dev, void *ptr,
+ size_t size, enum dma_data_direction dir);
+
+void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
+ size_t size, enum dma_data_direction dir);
#else
/*
* assumes buffers are in coherent/uncached memory, e.g. because
@@ -121,13 +127,19 @@ static inline void dma_sync_single_for_device(struct device *dev, dma_addr_t add
{
barrier_data(address);
}
+
+static inline dma_addr_t dma_map_single(struct device *dev, void *ptr,
+ size_t size, enum dma_data_direction dir)
+{
+ return virt_to_phys(ptr);
+}
+
+static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
+ size_t size, enum dma_data_direction dir)
+{
+}
#endif
-dma_addr_t dma_map_single(struct device *dev, void *ptr,
- size_t size, enum dma_data_direction dir);
-
-void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
- size_t size, enum dma_data_direction dir);
#ifndef dma_alloc_coherent
void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle);
diff --git a/include/mci.h b/include/mci.h
index 207fb9779a14..82099f118e65 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -767,6 +767,7 @@ static inline int mmc_card_hs(struct mci *mci)
mci->host->ios.timing == MMC_TIMING_MMC_HS;
}
+#if IN_PROPER
/*
* Execute tuning sequence to seek the proper bus operating
* conditions for HS200 and HS400, which sends CMD21 to the device.
@@ -775,6 +776,14 @@ int mmc_hs200_tuning(struct mci *mci);
int mci_execute_tuning(struct mci *mci);
int mmc_send_tuning(struct mci *mci, u32 opcode);
int mci_send_abort_tuning(struct mci *mci, u32 opcode);
+
+#else
+static inline int mmc_hs200_tuning(struct mci *mci) { return -ENOSYS; }
+static inline int mci_execute_tuning(struct mci *mci) { return -ENOSYS; }
+static inline int mmc_send_tuning(struct mci *mci, u32 opcode) { return -ENOSYS; }
+static inline int mci_send_abort_tuning(struct mci *mci, u32 opcode) { return -ENOSYS; }
+#endif
+
int mmc_select_timing(struct mci *mci);
int mci_set_blockcount(struct mci *mci, unsigned int cmdarg);
int mci_blk_part_switch(struct mci_part *part);
--
2.39.5
next prev parent reply other threads:[~2025-06-05 11:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 11:35 [PATCH 00/21] sandbox: add libfuzzer-based fuzzing Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 01/21] pbl: add provision for architectures without piggy loader Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 02/21] firmware: make Layerscape FMan firmware proper-only Ahmad Fatoum
2025-06-05 11:35 ` Ahmad Fatoum [this message]
2025-06-05 11:35 ` [PATCH 04/21] kbuild: define and use more generic symlink command Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 05/21] kbuild: collect compatibility symlink creation in symlink-y Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 06/21] kbuild: allow customizing barebox proper binary Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 07/21] sandbox: make available all CONFIG_ symbols to OS glue code Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 08/21] sandbox: switch to using PBL Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 09/21] kbuild: populate non-host CXX variables Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 10/21] string: add fortify source support Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 11/21] sandbox: populate UNAME_M variable Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 12/21] Add fuzzing infrastructure Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 13/21] filetype: add fuzz target Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 14/21] block: mark underlying cdev with DEVFS_IS_BLOCK_DEV Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 15/21] block: add lightweight ramdisk support Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 16/21] fuzz: add support for passing fuzz data as r/o ramdisk Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 17/21] partitions: add partition table parser fuzz target Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 18/21] fdt: add fuzz test Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 19/21] fit: " Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 20/21] Documentation: add LLVM libfuzzer documentation Ahmad Fatoum
2025-06-05 11:35 ` [PATCH 21/21] sandbox: add support for coverage info generation Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250605113530.2076990-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox