summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authoryang.tian <yang.tian@nxp.com>2018-12-11 17:38:48 +0800
committeryang.tian <yang.tian@nxp.com>2018-12-11 17:56:06 +0800
commit6e57497c143981b5d9ec4cd725ba920c156138b5 (patch)
treebfb752d6932f6b2a901a107acd60fbde9b3a9b5d /common
parentee85812d93881e289ca700e359732c43c6b4eeec (diff)
MA-13748 Pass BDADDR from uboot cmdline
Pass bt mac address from uboot cmdline to write ro.boot.btmacaddr property for bluetooth hal to parse BDADDR which is composed from ro.boot.serialno, or it will fall back to persist property seted in init.rc. Change-Id: If6886596c79c699b8530d3249b1cc98f19aad51f Signed-off-by: yang.tian <yang.tian@nxp.com>
Diffstat (limited to 'common')
-rw-r--r--common/image-android.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/image-android.c b/common/image-android.c
index 67cb86f0fe..71b93da2d5 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -125,6 +125,17 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
serialnr.high,
serialnr.low);
strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
+
+ char bd_addr[16]={0};
+ sprintf(bd_addr,
+ "%08x%08x",
+ serialnr.high,
+ serialnr.low);
+ sprintf(newbootargs,
+ " androidboot.btmacaddr=%c%c:%c%c:%c%c:%c%c:%c%c:%c%c",
+ bd_addr[0],bd_addr[1],bd_addr[2],bd_addr[3],bd_addr[4],bd_addr[5],
+ bd_addr[6],bd_addr[7],bd_addr[8],bd_addr[9],bd_addr[10],bd_addr[11]);
+ strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
#endif
/* append soc type into bootargs */