Commit 22abfa84 authored by Zhang Bo's avatar Zhang Bo Committed by Jason Liu
Browse files

MA-9795-1[Android] imx8mq-evk: bring up android in u-boot v2017



Add get_boot_device and get_board_serial in soc.c.
Add is_recovery_key_pressing function definition
Use CONFIG_USB_GADGET and CONFIG_FSL_FASTBOOT to separate the usb related code
in the f_fastboot.c.The CONFIG_USB_FUNCTION_FASTBOOT should be defined So the
boota can work normally.

Change-Id: I6c0d3851ba28b147d0da310485a06f102de5a813
Signed-off-by: default avatarZhang Bo <bo.zhang@nxp.com>
parent 502acd59
......@@ -9,6 +9,7 @@
#include <asm/io.h>
#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
#include <asm/imx-common/boot_mode.h>
#include <asm/armv8/mmu.h>
#include <errno.h>
......@@ -154,3 +155,18 @@ int arch_auxiliary_core_check_up(u32 core_id)
return 1;
}
#endif
#ifdef CONFIG_SERIAL_TAG
void get_board_serial(struct tag_serialnr *serialnr)
{
/* TODO: */
serialnr->low = 0;
serialnr->high = 0;
}
#endif
enum boot_device get_boot_device(void)
{
/* TODO: */
return SD2_BOOT;
}
......@@ -353,3 +353,12 @@ int board_init(void)
#endif
return 0;
}
#ifdef CONFIG_FSL_FASTBOOT
#ifdef CONFIG_ANDROID_RECOVERY
int is_recovery_key_pressing(void)
{
return 0; /*TODO*/
}
#endif /*CONFIG_ANDROID_RECOVERY*/
#endif /*CONFIG_FSL_FASTBOOT*/
......@@ -32,7 +32,15 @@ obj-$(CONFIG_FASTBOOT_LOCK) += fastboot_lock_unlock.o
obj-$(CONFIG_FSL_BOOTCTL) += bootctrl.o
obj-$(CONFIG_BCB_SUPPORT) += command.o bcb.o
endif
else
ifdef CONFIG_FSL_FASTBOOT
obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
obj-$(CONFIG_FASTBOOT_LOCK) += fastboot_lock_unlock.o
obj-$(CONFIG_FSL_BOOTCTL) += bootctrl.o
obj-$(CONFIG_BCB_SUPPORT) += command.o bcb.o
endif
endif
ifdef CONFIG_USB_ETHER
obj-y += ether.o
obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o
......
......@@ -84,7 +84,13 @@
* (64 or 512 or 1024), else we break on certain controllers like DWC3
* that expect bulk OUT requests to be divisible by maxpacket size.
*/
static unsigned int download_size;
static unsigned int download_bytes;
#ifdef CONFIG_SYSTEM_RAMDISK_SUPPORT
static bool is_recovery_mode;
#endif
#ifdef CONFIG_USB_GADGET
struct f_fastboot {
struct usb_function usb_function;
......@@ -97,16 +103,9 @@ static inline struct f_fastboot *func_to_fastboot(struct usb_function *f)
{
return container_of(f, struct f_fastboot, usb_function);
}
static struct f_fastboot *fastboot_func;
static unsigned int download_size;
static unsigned int download_bytes;
#ifdef CONFIG_SYSTEM_RAMDISK_SUPPORT
static bool is_recovery_mode;
#endif
static int strcmp_l1(const char *s1, const char *s2);
static struct f_fastboot *fastboot_func;
static struct usb_endpoint_descriptor fs_ep_in = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
......@@ -171,6 +170,7 @@ fb_ep_desc(struct usb_gadget *g, struct usb_endpoint_descriptor *fs,
return hs;
return fs;
}
#endif
/*
* static strings, in UTF-8
......@@ -1823,13 +1823,14 @@ static AvbOps fsl_avb_ops = {
void fastboot_setup(void)
{
#ifdef CONFIG_USB_GADGET
struct tag_serialnr serialnr;
char serial[17];
get_board_serial(&serialnr);
sprintf(serial, "%08x%08x", serialnr.high, serialnr.low);
g_dnl_set_serialnumber(serial);
#endif
/*execute board relevant initilizations for preparing fastboot */
board_fastboot_setup();
......@@ -2508,6 +2509,7 @@ U_BOOT_CMD(
#endif /* CONFIG_CMD_BOOTA */
#endif
#ifdef CONFIG_USB_GADGET
static void rx_handler_command(struct usb_ep *ep, struct usb_request *req);
......@@ -3462,3 +3464,4 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
req->actual = 0;
usb_ep_queue(ep, req, 0);
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment