]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fastboot: Rename fb_set_reboot_flag to fastboot_set_reboot_flag
authorAlex Kiernan <alex.kiernan@gmail.com>
Tue, 29 May 2018 15:30:46 +0000 (15:30 +0000)
committerMarek Vasut <marex@denx.de>
Wed, 30 May 2018 09:59:21 +0000 (11:59 +0200)
Rename fb_set_reboot_flag to fastboot_set_reboot_flag so it matches
all other fastboot code in the global name space. Fix the guards around
them so that they're dependent on FASTBOOT, not just USB_FUNCTION_FASTBOOT.

Move the weak implementation of fastboot_set_reboot_flag to fb_common.c
so we can call it from non-USB fastboot code.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
arch/arm/mach-omap2/boot-common.c
arch/arm/mach-rockchip/rk3128-board.c
arch/arm/mach-rockchip/rk322x-board.c
board/amazon/kc1/kc1.c
board/lg/sniper/sniper.c
drivers/fastboot/fb_common.c
drivers/usb/gadget/f_fastboot.c
include/fastboot.h

index 0e9fd03fefb05d645859d8822c6d245d6e809b9c..b22b6713e5fd4b4781f18d6cb7beaaf7181838bd 100644 (file)
@@ -237,8 +237,8 @@ void arch_preboot_os(void)
 }
 #endif
 
-#if defined(CONFIG_USB_FUNCTION_FASTBOOT) && !defined(CONFIG_ENV_IS_NOWHERE)
-int fb_set_reboot_flag(void)
+#if CONFIG_IS_ENABLED(FASTBOOT) && !CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
+int fastboot_set_reboot_flag(void)
 {
        printf("Setting reboot to fastboot flag ...\n");
        env_set("dofastboot", "1");
index 48cd8ba81e08d9a9002381c3333f650fd7dbf537..7fd667a0b8ec94a43df1f27b488c758892035e94 100644 (file)
@@ -111,8 +111,8 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 }
 #endif
 
-#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
-int fb_set_reboot_flag(void)
+#if CONFIG_IS_ENABLED(FASTBOOT)
+int fastboot_set_reboot_flag(void)
 {
        struct rk3128_grf *grf;
 
index 99a60c4e2ee62178da8b9d6315b43c6ac83c5aeb..7366d45ab6c0ef7ffd4df31ccdddb5740a708add 100644 (file)
@@ -139,8 +139,8 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 }
 #endif
 
-#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
-int fb_set_reboot_flag(void)
+#if CONFIG_IS_ENABLED(FASTBOOT)
+int fastboot_set_reboot_flag(void)
 {
        struct rk322x_grf *grf;
 
index d9ca18363cda8dd769e4bebbd290e40f012c106a..031fd110923c5e5c87602ada5ffef9282878223c 100644 (file)
@@ -161,7 +161,7 @@ void get_board_serial(struct tag_serialnr *serialnr)
        omap_die_id_get_board_serial(serialnr);
 }
 
-int fb_set_reboot_flag(void)
+int fastboot_set_reboot_flag(void)
 {
        return omap_reboot_mode_store("b");
 }
index 34a7a11f053dbde5d01ed78147c8562bc76a7aba..a7de4c21674c4eaa114aa5d096ac418df55d6879 100644 (file)
@@ -173,7 +173,7 @@ void reset_misc(void)
        omap_reboot_mode_store(reboot_mode);
 }
 
-int fb_set_reboot_flag(void)
+int fastboot_set_reboot_flag(void)
 {
        return omap_reboot_mode_store("b");
 }
index c4a7702bb3d7999bdc442194a85ad0c64b912ea7..79e080ac8765e06b2db33ffceb1965da7ab5c57d 100644 (file)
@@ -59,3 +59,18 @@ void fastboot_okay(const char *reason, char *response)
        else
                fastboot_response("OKAY", response, NULL);
 }
+
+/**
+ * fastboot_set_reboot_flag() - Set flag to indicate reboot-bootloader
+ *
+ * Set flag which indicates that we should reboot into the bootloader
+ * following the reboot that fastboot executes after this function.
+ *
+ * This function should be overridden in your board file with one
+ * which sets whatever flag your board specific Android bootloader flow
+ * requires in order to re-enter the bootloader.
+ */
+int __weak fastboot_set_reboot_flag(void)
+{
+       return -ENOSYS;
+}
index 323ac89417ab357120da9b504f1913e768fc60b0..697eee57d002644f148a5d383baffdaf75864b64 100644 (file)
@@ -357,16 +357,11 @@ static void compl_do_reset(struct usb_ep *ep, struct usb_request *req)
        do_reset(NULL, 0, 0, NULL);
 }
 
-int __weak fb_set_reboot_flag(void)
-{
-       return -ENOSYS;
-}
-
 static void cb_reboot(struct usb_ep *ep, struct usb_request *req)
 {
        char *cmd = req->buf;
        if (!strcmp_l1("reboot-bootloader", cmd)) {
-               if (fb_set_reboot_flag()) {
+               if (fastboot_set_reboot_flag()) {
                        fastboot_tx_write_str("FAILCannot set reboot flag");
                        return;
                }
index 6cd44d2ab9240b06c6241abd5ab453804686500f..816e71b4d0d5d77caa7403f8f0d1dd02bca80ece 100644 (file)
@@ -41,5 +41,5 @@ void fastboot_fail(const char *reason, char *response);
  * @response: Pointer to fastboot response buffer
  */
 void fastboot_okay(const char *reason, char *response);
-
+int fastboot_set_reboot_flag(void);
 #endif /* _FASTBOOT_H_ */