Enable fastboot for MX50 RD3 board -blog archive

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enable fastboot for MX50 RD3 board -blog archive

2,537 Views
PeterChan
NXP Employee
NXP Employee

The fastboot is an utility for download images from Windows/Linux PC host to the target device by USB via Android ADB interface. This utility is released by Google in the Android SDK packages, which can be downloaded from Android's official site.

 

To enable fastboot for MX50 RD3 board, simply copy those fastboot configure options from mx50_rdp_android.h to mx50_rd3.h as below and then rebuild the u-boot.

 

diff --git a/include/configs/mx50_rd3.h b/include/configs/mx50_rd3.h
index 58229a1..c07a56b 100644
--- a/include/configs/mx50_rd3.h
+++ b/include/configs/mx50_rd3.h
@@ -299,4 +299,42 @@
 #else
  #define CONFIG_ENV_IS_NOWHERE 1
 #endif
+
+/*
+ * Android support Configs
+ */
+
+/* Android fastboot configs */
+#define CONFIG_USB_DEVICE
+#define CONFIG_IMX_UDC                 1
+#define CONFIG_FASTBOOT                1
+#define CONFIG_FASTBOOT_STORAGE_EMMC_SATA
+#define CONFIG_FASTBOOT_VENDOR_ID      0xbb4
+#define CONFIG_FASTBOOT_PRODUCT_ID     0xc01
+#define CONFIG_FASTBOOT_BCD_DEVICE     0x311
+#define CONFIG_FASTBOOT_MANUFACTURER_STR  "Freescale"
+#define CONFIG_FASTBOOT_PRODUCT_NAME_STR "i.mx50 rdp"
+#define CONFIG_FASTBOOT_CONFIGURATION_STR  "Android fastboot"
+#define CONFIG_FASTBOOT_INTERFACE_STR    "Android fastboot"
+#define CONFIG_FASTBOOT_SERIAL_NUM      "12345"
+#define CONFIG_FASTBOOT_SATA_NO          0
+#define CONFIG_FASTBOOT_TRANSFER_BUF    0x80000000
+#define CONFIG_FASTBOOT_TRANSFER_BUF_SIZE 0x8000000 /* 128M byte */
+
+#define CONFIG_ANDROID_RECOVERY
+#define CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC \
+       "setenv bootargs ${bootargs} init=/init root=/dev/mmcblk0p4"    \
+       " rootfs=ext4 keypad"
+#define CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC  \
+       "run bootargs_base bootargs_android_recovery;"  \
+       "mmc read 0 ${loadaddr} 0x800 0x2000;bootm"
+#define CONFIG_ANDROID_RECOVERY_CMD_FILE "/recovery/command"
+
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+
+#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 2
+#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 4
+#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
+
 #endif    /* __CONFIG_H */

 

Before starting the fastboot, Android SDK must be installed on a PC HOST, the u-boot.bin is downloaded to target device and all the Android system partitions are created and formatted on a MMC/SD card. For detail, please refer to i.MX Android R10.3 User Guide.

 

When the board is powered, press any key to enter uboot shell. Since my MX50_RD3 board is boot from a SD card on the SD1 port, I use this command to choose SD/MMC card to download the fastboot images.

 

MX50_RD3 U-Boot > setenv fastboot_dev mmc0

 

Then I run the fastboot command in u-boot shell and connect USB cable to my board.

 

MX50_RD3 U-Boot > fasboot

fastboot is in init......flash target is MMC:0
USB Mini b cable Connected!
fastboot initialized
USB_SUSPEND
USB_RESET
USB_RESET

 

 

On host side, the fastboot utility is located under "platform-tools" where the Android-SDK installed. Supposing all your images are under an "images" folder, use these fastboot commands to download these images to your target devices. 

 

C:\Android\android-sdk\platform-tools>fastboot flash bootloader images\u-boot-no-padding.bin

C:\Android\android-sdk\platform-tools>fastboot flash kernel images\uImage

C:\Android\android-sdk\platform-tools>fastboot flash uramdisk images\uramdisk.img

C:\Android\android-sdk\platform-tools>fastboot flash system images\system.img

C:\Android\android-sdk\platform-tools>fastboot flash recovery images\recovery.img

 

Finally reboot the device after downloading all the images.

 

C:\Android\android-sdk\platform-tools>fastboot reboot

Tags (1)
1 Reply

1,541 Views
PeterChan
NXP Employee
NXP Employee

Here is the additional change for fastboot if MX50 is booting from MMC/SD at SDHC3 port.

=========================================================

diff --git a/cpu/arm_cortexa8/mx50/generic.c b/cpu/arm_cortexa8/mx50/generic.c
index e1f55d1..20c3512 100644
--- a/cpu/arm_cortexa8/mx50/generic.c
+++ b/cpu/arm_cortexa8/mx50/generic.c
@@ -547,6 +547,7 @@ static u32 __get_bch_clk(void)

void set_usboh3_clk(void)
{
+/*
unsigned int reg;

reg = readl(MXC_CCM_CSCMR1) &
@@ -561,6 +562,7 @@ void set_usboh3_clk(void)
reg |= 1 << MXC_CCM_CSCDR1_USBOH3_CLK_PODF_OFFSET;

writel(reg, MXC_CCM_CSCDR1);
+*/
}

void set_usb_phy1_clk(void)
@@ -574,14 +576,14 @@ void set_usb_phy1_clk(void)

void enable_usboh3_clk(unsigned char enable)
{
- unsigned int reg;
+/* unsigned int reg;

reg = readl(MXC_CCM_CCGR2);
if (enable)
reg |= 1 << MXC_CCM_CCGR2_CG14_OFFSET;
else
reg &= ~(1 << MXC_CCM_CCGR2_CG14_OFFSET);
- writel(reg, MXC_CCM_CCGR2);
+ writel(reg, MXC_CCM_CCGR2);*/
}

void enable_usb_phy1_clk(unsigned char enable)