Brillo: brillo-m10-dev @ DragonBoard 410c

终于下定决心,买了块高通DragonBoard 410c。老实说DragonBoard 410c出来已经有好长一段时间了,为什么迟迟不下手,只因性价比太低。相对于RPi 2B来说,只因多了WiFi与Bluetooth,但价格要高上好几倍,而brillo系统完全可以在RPi 2B上跑起来。而brillo系统也已经到m10版本了,思来想去,还是觉得应该买一块可以安装brillo原生系统的开发板,以便做对比开发。

作为google brillo系统的starter board, 意味着你可以不修改一行代码,就可以让brillo系统在这块板子上跑起来。下面,我们来看一下如何下载,编译可以在DragonBoard 410c上跑起来的brillo-m10-dev系统。

产品链接在此:https://developer.qualcomm.com/hardware/dragonboard-410c

2016_04_04_dragonboard_410c

  • 开发环境:

主机: ubuntu 14.04 x86_64系统。

  • 代码下载

google brillo项目代码下载:

$ mkdir -pv /local/brillo-m10-dev-410c && cd /local/brillo-m10-dev-410c
$ repo init -u https://android.googlesource.com/brillo/manifest -b brillo-m10-dev

将.repo/manifest.xml中与dragonboard相关的代码删除:

  <!-- Qualcomm Dragonboard -->
<!--
  <project path="device/qcom/dragonboard"
           name="device/qcom/dragonboard"
           groups="dragonboard" />
  <project path="hardware/bsp/qcom"
           name="platform/hardware/bsp/qcom"
           groups="dragonboard" />
  <project path="hardware/bsp/kernel/qcom/qcom-msm-3.10"
           name="platform/hardware/bsp/kernel/qcom/qcom-msm-v3.10"
           groups="dragonboard" />
-->

不然下载安装bsp包的时候会有如下问题(由于device/qcom/dragonboard, hardware/bsp/qcom, hardware/bsp/kernel/qcom文件夹已经存在,安装bsp包时不会去覆盖这些文件夹下的文件):

Do you accept this license (Y/n)? 
Y
Qualcomm Dragonboard 410c - Unrecognized
 * qcom_dragonboard_bsp_code
    * device - Unrecognized
    * hardware_base - Unrecognized
    * hardware_kernel - Unrecognized
 * qcom_dragonboard_bsp_binaries
    * vendor_binaries - Installed
The following paths exist but do not link to BSP packages:
 * /local/brillo-m10-dev-410c/device/qcom/dragonboard
 * /local/brillo-m10-dev-410c/hardware/bsp/qcom
 * /local/brillo-m10-dev-410c/hardware/bsp/kernel/qcom
If this is not intentional, consider removing them and installing again.

NOTE:实际上是创建软链接:

hzak@B85RPI:/local/brillo-m10-dev-410c$ ls -l device/qcom/
total 4
lrwxrwxrwx 1 hzak hzak 117 Mar 21 10:43 dragonboard -> /home/hzak/.brillo/.BSPs/1acd91d23b243a9654912fe9e70686ebe4c410dbeef9245134945b3c96779a3e/bdk/device/qcom/dragonboard

下载下来的文件保存在~/.brillo下,会下载在约200MB数据,解压出来有724MB,需要保证你的home目录有足够的空间。

下载代码:

$ repo sync

dragonboard 410c bsp代码下载(下载完后会要求accept license才能继续安装):

$ tools/bdk/brunch/brunch bsp download dragonboard
Downloading package qcom_dragonboard_bsp_code
Qualcomm Dragonboard 410c - Installed
 * qcom_dragonboard_bsp_code
    * device - Installed
    * hardware_base - Installed
    * hardware_kernel - Installed
 * qcom_dragonboard_bsp_binaries
    * vendor_binaries - Installed
  • 编译

建立编译环境:

hzak@B85RPI:/local/brillo-m10-dev-410c$ . build/envsetup.sh 
including device/generic/brillo/vendorsetup.sh
including device/generic/brillo/brilloemulator_arm64/base_product/devicesetup.sh
including device/generic/brillo/brilloemulator_arm/base_product/devicesetup.sh
including device/generic/brillo/brilloemulator_x86_64/base_product/devicesetup.sh
including device/generic/brillo/brilloemulator_x86/base_product/devicesetup.sh
including device/qcom/dragonboard/base_product/devicesetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including product/google/common/brillo_gpios/vendorsetup.sh
including product/google/common/brillo_i2c/vendorsetup.sh
including product/google/common/brillo_leds/vendorsetup.sh
including product/google/example-ledflasher/vendorsetup.sh
hzak@B85RPI:/local/brillo-m10-dev-410c$ lunch dragonboard-eng 

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
TARGET_PRODUCT=dragonboard
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-30-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=MASTER
OUT_DIR=out
============================================

开始编译:

hzak@B85RPI:/local/brillo-m10-dev-410c$ make -j 4
  • 运行

由于预装的是android系统,上电开机之后会自动运行,可以通过adb命令进入bootloader,再通过fastboot命令烧机:

hzak@B85RPI:/local/brillo-m10-dev-410c$ adb reboot-bootloader   
hzak@B85RPI:/local/brillo-m10-dev-410c$ out/target/product/dragonboard/provision-device 
target reported max download size of 268435456 bytes
sending 'partition' (33 KB)...
OKAY [  0.005s]
writing 'partition'...
OKAY [  0.667s]
sending 'modem' (65536 KB)...
OKAY [  2.058s]
writing 'modem'...
OKAY [  2.067s]
sending 'fsc' (1 KB)...
OKAY [  0.010s]
writing 'fsc'...
OKAY [  0.008s]
sending 'sbl1' (512 KB)...
OKAY [  0.020s]
writing 'sbl1'...
OKAY [  0.048s]
sending 'sbl1bak' (512 KB)...
OKAY [  0.020s]
writing 'sbl1bak'...
OKAY [  0.045s]
sending 'rpm' (512 KB)...
OKAY [  0.020s]
writing 'rpm'...
OKAY [  0.042s]
sending 'rpmbak' (512 KB)...
OKAY [  0.020s]
writing 'rpmbak'...
OKAY [  0.043s]
sending 'tz' (512 KB)...
OKAY [  0.020s]
writing 'tz'...
OKAY [  0.042s]
sending 'tzbak' (512 KB)...
OKAY [  0.020s]
writing 'tzbak'...
OKAY [  0.048s]
sending 'hyp' (512 KB)...
OKAY [  0.020s]
writing 'hyp'...
OKAY [  0.047s]
sending 'hypbak' (512 KB)...
OKAY [  0.020s]
writing 'hypbak'...
OKAY [  0.042s]
sending 'modemst1' (1536 KB)...
OKAY [  0.052s]
writing 'modemst1'...
OKAY [  0.113s]
sending 'modemst2' (1536 KB)...
OKAY [  0.052s]
writing 'modemst2'...
OKAY [  0.118s]
sending 'DDR' (32 KB)...
OKAY [  0.005s]
writing 'DDR'...
OKAY [  0.010s]
sending 'fsg' (1536 KB)...
OKAY [  0.052s]
writing 'fsg'...
OKAY [  0.131s]
sending 'sec' (16 KB)...
OKAY [  0.005s]
writing 'sec'...
OKAY [  0.007s]
sending 'aboot' (505 KB)...
OKAY [  0.020s]
writing 'aboot'...
OKAY [  0.040s]
sending 'abootbak' (505 KB)...
OKAY [  0.020s]
writing 'abootbak'...
OKAY [  0.041s]
sending 'misc' (1024 KB)...
OKAY [  0.036s]
writing 'misc'...
OKAY [  0.080s]
sending 'boot_a' (15872 KB)...
OKAY [  0.501s]
writing 'boot_a'...
OKAY [  1.160s]
sending 'system_a' (60511 KB)...
OKAY [  1.902s]
writing 'system_a'...
OKAY [  4.842s]
sending 'boot_b' (15872 KB)...
OKAY [  0.507s]
writing 'boot_b'...
OKAY [  1.003s]
sending 'system_b' (60511 KB)...
OKAY [  1.902s]
writing 'system_b'...
OKAY [  4.853s]
erasing 'userdata'...
OKAY [  0.268s]
sending 'userdata' (86868 KB)...
OKAY [  2.733s]
writing 'userdata'...
OKAY [  6.377s]
finished. total time: 32.159s

烧机后重启系统:

hzak@B85RPI:/local/brillo-m10-dev-410c$ fastboot reboot
rebooting...

finished. total time: 0.056s

开机之后,WiFi工作在AP模式,手机可以接入这个网络进行初步的配置(如将该设备接入家庭网络)。

设备的基本信息如下:

{
   "authentication": {
      "anonymousMaxScope": "none",
      "crypto": [ "p224_spake2" ],
      "mode": [ "anonymous", "pairing" ],
      "pairing": [ "embeddedCode" ]
   },
   "basicModelManifest": {
      "modelName": "DragonBoard",
      "oemName": "Qualcomm Technologies, Inc.", 
      "uiDeviceKind": "developmentBoard"
   },
   "description": "Qualcomm DragonBoard 410c",
   "endpoints": {
      "httpPort": 80,
      "httpUpdatesPort": 80,
      "httpsPort": 443,
      "httpsUpdatesPort": 443
   },
   "gcd": {
      "id": "",
      "oauth_url": "https://accounts.google.com/o/oauth2/",
      "service_url": "https://www.googleapis.com/weave/v1/",
      "status": "unconfigured",
      "xmpp_endpoint": "talk.google.com:5223"   
   },
   "id": "F1AA8DEB-39D9-4E79-BF3D-29D3E048086A",
   "modelManifestId": "ABHNy",
   "name": "Starter Board",
   "services": [ "developmentBoard" ],
   "sessionId": "511888408:3",
   "time": 1458573208025.315918,
   "version": "3.0",
   "wifi": {
      "capabilities": [ "2.4GHz" ],
      "hostedSsid": "Starter Board 74.ABHNyDBprv",
      "ssid": "",
      "status": "unconfigured"
   }
}
  • 相关的参考文档:
  1. https://developer.qualcomm.com/hardware/dragonboard-410c
  2. https://www.96boards.org/products/ce/dragonboard410c/

《Brillo: brillo-m10-dev @ DragonBoard 410c》有13个想法

  1. pairing 是pinCode,如何获得access token呢?
    {
    “authentication”: {
    “anonymousMaxScope”: “none”,
    “crypto”: [ “p224_spake2” ],
    “mode”: [ “anonymous”, “pairing” ],
    “pairing”: [ “pinCode” ]
    }

    }

    1. 如果pairing为pinCode:
      在brillo-m10-dev上看,可以看到在external/libweave/src/privet/security_manager.cc中,会随机生成4位数的pairing code:
      case PairingType::kPinCode:
      code = base::StringPrintf(“%04i”, base::RandInt(0, 9999));
      break;
      最终这个pairing code如何通知用户,需要vendor自已实现:
      1. 如果有显示屏的话,可以直接显示出来;
      2. 如果有speaker的话,可以通过语言播放出来。。。
      而在ledflasher(product/google/example-ledflasher/src/ledflasher/ledflasher.cpp)中,它是这么做的:
      void Daemon::OnPairingInfoChanged(
      const weaved::Service::PairingInfo* pairing_info) {
      LOG(INFO) << "Daemon::OnPairingInfoChanged: " << pairing_info; if (!pairing_info) return StopAnimation(); StartAnimation("blink", base::TimeDelta::FromMilliseconds(500)); } 这里,pairing_info中就包含了pairing code。

  2. $ curl -H “Authorization: Privet anonymous” -H ‘Content-Type: application/json’ -X POST \–data ‘{ “mode”: “anonymous”, “requestedScope”: “viewer” }’ -k \ https://localhost:8001/privet/v3/auth
    {
    “error”: {
    “code”: “accessDenied”,
    “debugInfo”: [ {
    “code”: “accessDenied”,
    “debugInfo”: “HandleAuth@external/libweave/src/privet/privet_handler.cc:606”,
    “message”: “Scope ‘owner’ is not allowed”
    } ],
    “message”: “Scope ‘owner’ is not allowed”
    }
    }

  3. 通过 curl -H “Authorization: Privet anonymous” -k https://localhost:8001/privet/info
    该问题已经解决,谢谢!

  4. 您好,我是一名大四学生正在学习使用这款板。不知道版主知不知道如何用着块板子在kernel level产生PWMsignal。

    1. 从http://linaro.co/96b-hwm-db P15上看,可用的PWM pin脚在Low speed Expansion connector Pin28(PM_MPP_4)用于LCD backlight control, 你可以参考kernel/qcom/qcom-msm-3.10/arch/arm/boot/dts/qcom/apq8016-sbc.dtsi中的做法:
      &dsi_jdi_1080_vid {
      qcom,mdss-dsi-bl-pmic-control-type = “bl_ctrl_pwm”;
      qcom,mdss-dsi-bl-pmic-pwm-frequency = <100>;
      qcom,mdss-dsi-bl-pmic-bank-select = <0>;
      qcom,mdss-dsi-pwm-gpio = < &pm8916_mpps 4 0>;
      };
      修改dts文件,同时按照kernel/qcom/qcom-msm-3.10/drivers/video/msm/mdss/mdss_dsi_panel.c的做法修改c代码。

      你也可以参考这篇文档:https://developer.qualcomm.com/download/db410c/gpio-usage-low-speed-connector-application-note.pdf P8 – Controlling PMIC MPP

  5. 使用 snapdragon 410E(msm8916)的高通开发板,LCD driver使用tps65132,现在TPS65132的i2c已经注册成功,挂载在i2c_6上,但是无法写操作 测量clock和data一直保持1.8v,没有波形出来。 无法通信,请问问题可能出在哪里?
    NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x3e

    1. 挂在这条总线上的其他i2c设备能正常通信吗?看情况像是i2c总线的pin脚选择有问题,请先参考下面两个文档:
      https://developer.qualcomm.com/download/db410c/gpio-usage-low-speed-connector-application-note.pdf
      https://developer.qualcomm.com/download/db410c/interfacing-grove-digital-light-i2c-sensor-application-note.pdf

发表评论

电子邮件地址不会被公开。 必填项已用*标注