2023-12-04 23:48:40 +00:00
|
|
|
From d9143f86330dd038fc48878558dd287ceee5d3d4 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Daniel Golle <daniel@makrotopia.org>
|
|
|
|
Date: Thu, 13 Jul 2023 04:13:04 +0100
|
|
|
|
Subject: [PATCH 14/15] mmc: block: set fwnode of disk devices
|
|
|
|
|
|
|
|
Set fwnode of disk devices to 'block', 'boot0' and 'boot1' subnodes of
|
|
|
|
the mmc-card. This is done in preparation for having the eMMC act as
|
|
|
|
NVMEM provider.
|
|
|
|
|
|
|
|
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
|
|
---
|
|
|
|
drivers/mmc/core/block.c | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
|
|
|
|
|
|
|
--- a/drivers/mmc/core/block.c
|
|
|
|
+++ b/drivers/mmc/core/block.c
|
2024-04-13 11:49:12 +00:00
|
|
|
@@ -2486,6 +2486,8 @@ static struct mmc_blk_data *mmc_blk_allo
|
2023-12-04 23:48:40 +00:00
|
|
|
int area_type,
|
|
|
|
unsigned int part_type)
|
|
|
|
{
|
|
|
|
+ struct fwnode_handle *fwnode;
|
|
|
|
+ struct device *ddev;
|
|
|
|
struct mmc_blk_data *md;
|
|
|
|
int devidx, ret;
|
|
|
|
char cap_str[10];
|
2024-04-13 11:49:12 +00:00
|
|
|
@@ -2582,6 +2584,13 @@ static struct mmc_blk_data *mmc_blk_allo
|
2023-12-04 23:48:40 +00:00
|
|
|
|
|
|
|
blk_queue_write_cache(md->queue.queue, cache_enabled, fua_enabled);
|
|
|
|
|
|
|
|
+ ddev = disk_to_dev(md->disk);
|
|
|
|
+ fwnode = device_get_named_child_node(subname ? md->parent->parent :
|
|
|
|
+ md->parent,
|
|
|
|
+ subname ? subname : "block");
|
2024-02-18 01:02:46 +00:00
|
|
|
+ if (fwnode)
|
|
|
|
+ device_set_node(ddev, fwnode);
|
2023-12-04 23:48:40 +00:00
|
|
|
+
|
|
|
|
string_get_size((u64)size, 512, STRING_UNITS_2,
|
|
|
|
cap_str, sizeof(cap_str));
|
|
|
|
pr_info("%s: %s %s %s %s\n",
|