MA-9763 Include init.${ro.hardware}.${ro.boot.soc_type}.rc based uboot's soc_type
authorguoyin.chen <guoyin.chen@nxp.com>
Mon, 19 Jun 2017 09:59:42 +0000 (17:59 +0800)
committerJason Liu <jason.hui.liu@nxp.com>
Thu, 2 Nov 2017 18:36:54 +0000 (02:36 +0800)
Append androidboot.soc_type based on the imx soc type

Change-Id: I3ae18bff42b434eb77728a7db70dd3baf6d7e0a6
Signed-off-by: guoyin.chen <guoyin.chen@nxp.com>
common/image-android.c
drivers/usb/gadget/f_fastboot.c

index d2ad997..32e20c6 100644 (file)
@@ -98,6 +98,16 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
                                        serialnr.low);
        strcat(commandline, newbootargs);
 #endif
+
+       /* append soc type into bootargs */
+       char *soc_type = getenv("soc_type");
+       if (soc_type) {
+               sprintf(newbootargs,
+                       " androidboot.soc_type=%s",
+                       soc_type);
+               strcat(commandline, newbootargs);
+       }
+
        int bootdev = get_boot_device();
        if (bootdev == SD1_BOOT || bootdev == SD2_BOOT ||
                bootdev == SD3_BOOT || bootdev == SD4_BOOT) {
index 33cad88..0bf6c49 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 
 #ifdef CONFIG_FSL_FASTBOOT
+#include <asm/imx-common/sys_proto.h>
 #include <fsl_fastboot.h>
 #include <mmc.h>
 #include <android_image.h>
@@ -1586,6 +1587,39 @@ void board_fastboot_setup(void)
                printf("unsupported boot devices\n");
                break;
        }
+
+       /* add soc type into bootargs */
+       if (is_mx6dqp()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx6qp");
+       } else if (is_mx6dq()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx6q");
+       } else if (is_mx6sdl()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx6dl");
+       } else if (is_mx6sx()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx6sx");
+       } else if (is_mx6sl()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx6sl");
+       } else if (is_mx6ul()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx6ul");
+       } else if (is_mx7()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx7d");
+       } else if (is_mx7ulp()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx7ulp");
+       } else if (is_imx8qm()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx8qm");
+       } else if (is_imx8qxp()) {
+               if (!getenv("soc_type"))
+                       setenv("soc_type", "imx8qxp");
+       }
 }
 
 #ifdef CONFIG_ANDROID_RECOVERY