MA-10983-1 Load HDMI firmware from u-boot.bin
authorHaoran.Wang <elven.wang@nxp.com>
Thu, 4 Jan 2018 13:02:38 +0000 (21:02 +0800)
committerHaoran.Wang <elven.wang@nxp.com>
Wed, 17 Jan 2018 08:25:47 +0000 (16:25 +0800)
Load HDMI firmware from u-boot.bin instead of
/system partition.

Change-Id: I8945940cfe14db50c95a56b8bff2a94990a7fbaf
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
board/freescale/imx8qm_mek/imx8qm_mek.c
configs/mx8qm_mek_android_defconfig
drivers/usb/gadget/f_fastboot.c
include/configs/imx8qm_mek_android.h

index 9ba68c1..4546dac 100644 (file)
@@ -401,6 +401,7 @@ int mmc_map_to_kernel_blk(int dev_no)
        return dev_no;
 }
 
+extern uint32_t _end_ofs;
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
@@ -412,6 +413,18 @@ int board_late_init(void)
        board_late_mmc_env_init();
 #endif
 
+#ifdef IMX_LOAD_HDMI_FIMRWARE
+       char *end_of_uboot;
+       char command[256];
+       end_of_uboot = (char *)(ulong)(CONFIG_SYS_TEXT_BASE + _end_ofs + fdt_totalsize(gd->fdt_blob));
+       end_of_uboot += 9;
+
+       memcpy(IMX_HDMI_FIRMWARE_LOAD_ADDR, end_of_uboot, IMX_HDMI_FIRMWARE_SIZE);
+
+       sprintf(command, "hdp load 0x%x", IMX_HDMI_FIRMWARE_LOAD_ADDR);
+       run_command(command, 0);
+#endif
+
        return 0;
 }
 
index 6d1c798..80c5e49 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_DM_I2C=y
 # CONFIG_DM_I2C_COMPAT is not set
 CONFIG_SYS_I2C_IMX_LPI2C=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_EXT4=y
 
 CONFIG_CMD_USB=y
 CONFIG_USB=y
index 5a5ddff..a1da88d 100755 (executable)
@@ -241,11 +241,7 @@ static struct usb_gadget_strings *fastboot_strings[] = {
 #else
 #define ANDROID_BOOTLOADER_OFFSET   0x400
 #endif
-#define ANDROID_BOOTLOADER_SIZE            0xFFC00
-#define ANDROID_KERNEL_OFFSET      0x100000
-#define ANDROID_KERNEL_SIZE        0x500000
-#define ANDROID_URAMDISK_OFFSET            0x600000
-#define ANDROID_URAMDISK_SIZE      0x100000
+#define ANDROID_BOOTLOADER_SIZE            0x1FFC00
 
 #define MMC_SATA_BLOCK_SIZE 512
 #define FASTBOOT_FBPARTS_ENV_MAX_LEN 1024
@@ -263,10 +259,6 @@ enum {
 };
 static unsigned int download_bytes_unpadded;
 
-#ifdef IMX_LOAD_HDMI_FIMRWARE
-int hdmi_firmware_load(char* slot);
-#endif
-
 static struct cmd_fastboot_interface interface = {
        .rx_handler            = NULL,
        .reset_handler         = NULL,
@@ -1589,10 +1581,6 @@ int do_boota(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {
                                        avb_out_data->ab_suffix);
                }
                setenv("bootargs_sec", bootargs_sec);
-#ifdef IMX_LOAD_HDMI_FIMRWARE
-               hdmi_firmware_load(avb_out_data->ab_suffix);
-#endif
-
 #ifdef CONFIG_SYSTEM_RAMDISK_SUPPORT
                if(!is_recovery_mode)
                        fastboot_setup_system_boot_args(avb_out_data->ab_suffix);
@@ -1643,9 +1631,6 @@ int do_boota(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {
                sprintf(bootargs_sec,
                                "androidboot.verifiedbootstate=orange androidboot.slot_suffix=%s", slot);
                setenv("bootargs_sec", bootargs_sec);
-#ifdef IMX_LOAD_HDMI_FIMRWARE
-               hdmi_firmware_load(slot);
-#endif
 #ifdef CONFIG_SYSTEM_RAMDISK_SUPPORT
                if(!is_recovery_mode)
                        fastboot_setup_system_boot_args(slot);
@@ -2648,38 +2633,6 @@ static void cb_continue(struct usb_ep *ep, struct usb_request *req)
        fastboot_tx_write_str("OKAY");
 }
 
-#ifdef IMX_LOAD_HDMI_FIMRWARE
-int hdmi_firmware_load(char *slot) {
-       int mmcc = mmc_get_env_dev();
-       int mmc_id;
-       char part_str[32];
-       char command[256];
-       int ret;
-
-       sprintf(part_str, "%s%s", IMX_HDMI_FIRMWARE_PART, slot);
-       mmc_id = fastboot_flash_find_index(part_str);
-       if (mmc_id <= 0)
-               return -1;
-
-       sprintf(command, "ext4load mmc %x:%x 0x%x %s",
-               mmcc, mmc_id, IMX_HDMI_FIRMWARE_LOAD_ADDR, IMX_HDMI_FIRMWARE_PATH);
-
-       ret = run_command(command, 0);
-       if (ret) {
-           printf("execute command '%s' error!\n", command);
-           return -1;
-       }
-
-       sprintf(command, "hdp load 0x%x", IMX_HDMI_FIRMWARE_LOAD_ADDR);
-
-       ret = run_command(command, 0);
-       if (ret) {
-           printf("execute command '%s' error!\n", command);
-           return -1;
-       }
-}
-#endif
-
 #ifdef CONFIG_FASTBOOT_LOCK
 
 int do_lock_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {
index a03c357..ab44819 100644 (file)
@@ -26,9 +26,8 @@
 #define FSL_FASTBOOT_FB_DEV "mmc"
 
 #define IMX_LOAD_HDMI_FIMRWARE
-#define IMX_HDMI_FIRMWARE_PATH "etc/firmware/hdmi/hdmitxfw.bin"
-#define IMX_HDMI_FIRMWARE_PART "system"
 #define IMX_HDMI_FIRMWARE_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_256M)
+#define IMX_HDMI_FIRMWARE_SIZE 0x20000
 
 #ifdef CONFIG_SYS_MALLOC_LEN
 #undef CONFIG_SYS_MALLOC_LEN