summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-04-23 12:21:37 -0400
committerTom Rini <trini@konsulko.com>2021-04-23 12:21:37 -0400
commit84baa65dffdbce20752279101548ba888be53b3e (patch)
tree430720a45d81277ca3cd9ee85be755d55f0f2e72 /include
parent4d85f42716ceff1143e55c7697dd559cfc438489 (diff)
parent0089affee275e47047be8ae9deac6ca08a5da478 (diff)
downloadu-boot-84baa65dffdbce20752279101548ba888be53b3e.tar.gz
u-boot-84baa65dffdbce20752279101548ba888be53b3e.tar.xz
u-boot-84baa65dffdbce20752279101548ba888be53b3e.zip
Merge branch '2021-04-22-assorted-updates'
- Move LMB to Kconfig, improve functionality - Add partlabel support to more fs cmds
Diffstat (limited to 'include')
-rw-r--r--include/configs/10m50_devboard.h5
-rw-r--r--include/configs/3c120_devboard.h5
-rw-r--r--include/configs/sandbox.h2
-rw-r--r--include/configs/x86-common.h2
-rw-r--r--include/image.h2
-rw-r--r--include/lmb.h40
-rw-r--r--include/part.h12
7 files changed, 48 insertions, 20 deletions
diff --git a/include/configs/10m50_devboard.h b/include/configs/10m50_devboard.h
index 768b4a6dfc..3ffc744928 100644
--- a/include/configs/10m50_devboard.h
+++ b/include/configs/10m50_devboard.h
@@ -35,11 +35,6 @@
#define CONFIG_BOOTP_BOOTFILESIZE
/*
- * FDT options
- */
-#define CONFIG_LMB
-
-/*
* MEMORY ORGANIZATION
* -Monitor at top of sdram.
* -The heap is placed below the monitor
diff --git a/include/configs/3c120_devboard.h b/include/configs/3c120_devboard.h
index 30bbd716b2..3f065ff315 100644
--- a/include/configs/3c120_devboard.h
+++ b/include/configs/3c120_devboard.h
@@ -35,11 +35,6 @@
#define CONFIG_BOOTP_BOOTFILESIZE
/*
- * FDT options
- */
-#define CONFIG_LMB
-
-/*
* MEMORY ORGANIZATION
* -Monitor at top of sdram.
* -The heap is placed below the monitor
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 6e79d3f56e..8eeccdd426 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -22,8 +22,6 @@
#define CONFIG_SYS_TIMER_RATE 1000000
#endif
-#define CONFIG_LMB
-
#define CONFIG_HOST_MAX_DEVICES 4
/*
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 641ed2c5ec..f186dd6b82 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -16,8 +16,6 @@
*/
#define CONFIG_PHYSMEM
-#define CONFIG_LMB
-
#define CONFIG_SYS_BOOTM_LEN (16 << 20)
/* SATA AHCI storage */
diff --git a/include/image.h b/include/image.h
index 3ff3c035a7..459685d4d4 100644
--- a/include/image.h
+++ b/include/image.h
@@ -434,7 +434,7 @@ typedef struct bootm_headers {
#define BOOTM_STATE_OS_GO (0x00000400)
int state;
-#ifdef CONFIG_LMB
+#if defined(CONFIG_LMB) && !defined(USE_HOSTCC)
struct lmb lmb; /* for memory mgmt */
#endif
} bootm_headers_t;
diff --git a/include/lmb.h b/include/lmb.h
index e9f19b16ea..541e17093c 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -12,22 +12,54 @@
* Copyright (C) 2001 Peter Bergner, IBM Corp.
*/
-#define MAX_LMB_REGIONS 8
-
+/**
+ * struct lmb_property - Description of one region.
+ *
+ * @base: Base address of the region.
+ * @size: Size of the region
+ */
struct lmb_property {
phys_addr_t base;
phys_size_t size;
};
+/**
+ * struct lmb_region - Description of a set of region.
+ *
+ * @cnt: Number of regions.
+ * @max: Size of the region array, max value of cnt.
+ * @region: Array of the region properties
+ */
struct lmb_region {
unsigned long cnt;
- phys_size_t size;
- struct lmb_property region[MAX_LMB_REGIONS+1];
+ unsigned long max;
+#if IS_ENABLED(CONFIG_LMB_USE_MAX_REGIONS)
+ struct lmb_property region[CONFIG_LMB_MAX_REGIONS];
+#else
+ struct lmb_property *region;
+#endif
};
+/**
+ * struct lmb - Logical memory block handle.
+ *
+ * Clients provide storage for Logical memory block (lmb) handles.
+ * The content of the structure is managed by the lmb library.
+ * A lmb struct is initialized by lmb_init() functions.
+ * The lmb struct is passed to all other lmb APIs.
+ *
+ * @memory: Description of memory regions.
+ * @reserved: Description of reserved regions.
+ * @memory_regions: Array of the memory regions (statically allocated)
+ * @reserved_regions: Array of the reserved regions (statically allocated)
+ */
struct lmb {
struct lmb_region memory;
struct lmb_region reserved;
+#if !IS_ENABLED(CONFIG_LMB_USE_MAX_REGIONS)
+ struct lmb_property memory_regions[CONFIG_LMB_MEMORY_REGIONS];
+ struct lmb_property reserved_regions[CONFIG_LMB_RESERVED_REGIONS];
+#endif
};
extern void lmb_init(struct lmb *lmb);
diff --git a/include/part.h b/include/part.h
index 7f78271a98..419c859708 100644
--- a/include/part.h
+++ b/include/part.h
@@ -230,7 +230,7 @@ int part_get_info_by_name(struct blk_desc *dev_desc,
* @param[in] allow_whole_dev true to allow the user to select partition 0
* (which means the whole device), false to require a valid
* partition number >= 1
- * @return 0 on success, or a negative on error
+ * @return the partition number on success, or negative errno on error
*/
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
const char *dev_part_str,
@@ -275,6 +275,16 @@ static inline int blk_get_device_part_str(const char *ifname,
struct disk_partition *info,
int allow_whole_dev)
{ *dev_desc = NULL; return -1; }
+static inline int
+part_get_info_by_dev_and_name_or_num(const char *dev_iface,
+ const char *dev_part_str,
+ struct blk_desc **dev_desc,
+ struct disk_partition *part_info,
+ int allow_whole_dev)
+{
+ *dev_desc = NULL;
+ return -ENOSYS;
+}
#endif
/*