aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini2021-02-04 08:19:23 -0500
committerTom Rini2021-02-04 08:19:23 -0500
commit21cb717e79e3f6588abae52fe55e2c415850c913 (patch)
treea471725c36bdb2d8578b2343ff0b8a5488db744b /include
parent67472aa0594186a203e4384ef82b313b0b5922e9 (diff)
parent6f5edbaf938952e4a9860727c633dcaa36caf699 (diff)
Merge tag 'dm-pull-3feb21' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Support late device removal Allow booting a 32-bit system with a top memory address beyond 4 GiB
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/global_data.h2
-rw-r--r--include/dm/device-internal.h15
-rw-r--r--include/dm/device.h15
-rw-r--r--include/init.h3
-rw-r--r--include/os.h2
5 files changed, 30 insertions, 7 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index b6f707e97e5..998beb01760 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -147,7 +147,7 @@ struct global_data {
/**
* @ram_top: top address of RAM used by U-Boot
*/
- unsigned long ram_top;
+ phys_addr_t ram_top;
/**
* @relocaddr: start address of U-Boot in RAM
*
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 639bbd293d9..39406c3f352 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -123,7 +123,9 @@ int device_probe(struct udevice *dev);
*
* @dev: Pointer to device to remove
* @flags: Flags for selective device removal (DM_REMOVE_...)
- * @return 0 if OK, -ve on error (an error here is normally a very bad thing)
+ * @return 0 if OK, -EKEYREJECTED if not removed due to flags, -EPROBE_DEFER if
+ * this is a vital device and flags is DM_REMOVE_NON_VITAL, other -ve on
+ * error (such an error here is normally a very bad thing)
*/
#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)
int device_remove(struct udevice *dev, uint flags);
@@ -173,10 +175,19 @@ static inline int device_chld_unbind(struct udevice *dev, struct driver *drv)
/**
* device_chld_remove() - Stop all device's children
+ *
+ * This continues through all children recursively stopping part-way through if
+ * an error occurs. Return values of -EKEYREJECTED are ignored and processing
+ * continues, since they just indicate that the child did not elect to be
+ * removed based on the value of @flags. Return values of -EPROBE_DEFER cause
+ * processing of other children to continue, but the function will return
+ * -EPROBE_DEFER.
+ *
* @dev: The device whose children are to be removed
* @drv: The targeted driver
* @flags: Flag, if this functions is called in the pre-OS stage
- * @return 0 on success, -ve on error
+ * @return 0 on success, -EPROBE_DEFER if any child failed to remove, other
+ * -ve on error
*/
#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)
int device_chld_remove(struct udevice *dev, struct driver *drv,
diff --git a/include/dm/device.h b/include/dm/device.h
index e665558444b..28533ce0b6d 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -71,12 +71,22 @@ struct driver_info;
* Device is removed without switching off its power domain. This might
* be required, i. e. for serial console (debug) output when booting OS.
*/
-#define DM_FLAG_REMOVE_WITH_PD_ON (1 << 13)
+#define DM_FLAG_LEAVE_PD_ON (1 << 13)
+
+/*
+ * Device is vital to the operation of other devices. It is possible to remove
+ * removed this device after all regular devices are removed. This is useful
+ * e.g. for clock, which need to be active during the device-removal phase.
+ */
+#define DM_FLAG_VITAL (1 << 14)
/*
* One or multiple of these flags are passed to device_remove() so that
* a selective device removal as specified by the remove-stage and the
* driver flags can be done.
+ *
+ * DO NOT use these flags in your driver's @flags value...
+ * use the above DM_FLAG_... values instead
*/
enum {
/* Normal remove, remove all devices */
@@ -88,7 +98,8 @@ enum {
/* Remove devices which need some final OS preparation steps */
DM_REMOVE_OS_PREPARE = DM_FLAG_OS_PREPARE,
- /* Add more use cases here */
+ /* Remove only devices that are not marked vital */
+ DM_REMOVE_NON_VITAL = DM_FLAG_VITAL,
/* Remove devices with any active flag */
DM_REMOVE_ACTIVE_ALL = DM_REMOVE_ACTIVE_DMA | DM_REMOVE_OS_PREPARE,
diff --git a/include/init.h b/include/init.h
index 980be279936..88f84599e9e 100644
--- a/include/init.h
+++ b/include/init.h
@@ -326,7 +326,8 @@ void relocate_code(ulong start_addr_sp, struct global_data *new_gd,
#endif
/* Print a numeric value (for use in arch_print_bdinfo()) */
-void bdinfo_print_num(const char *name, ulong value);
+void bdinfo_print_num_l(const char *name, ulong value);
+void bdinfo_print_num_ll(const char *name, unsigned long long value);
/* Print a clock speed in MHz */
void bdinfo_print_mhz(const char *name, unsigned long hz);
diff --git a/include/os.h b/include/os.h
index e192e32d592..65bcb232cab 100644
--- a/include/os.h
+++ b/include/os.h
@@ -341,7 +341,7 @@ void os_localtime(struct rtc_time *rt);
/**
* os_abort() - raise SIGABRT to exit sandbox (e.g. to debugger)
*/
-void os_abort(void);
+void os_abort(void) __attribute__((noreturn));
/**
* os_mprotect_allow() - Remove write-protection on a region of memory