Gale Board: Populate mac address to device tree.
authorKan Yan <kyan@google.com>
Thu, 21 Jul 2016 18:45:08 +0000 (11:45 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Tue, 2 Aug 2016 05:20:45 +0000 (22:20 -0700)
Ethernet mac address need be read from VPD and pass to device tree for
EVT3 board.

BUG=chrome-os-partner:55435
TEST=None
BRANCH=None

Change-Id: I2bbeb454900506395fb35cbca577d7eee6d823b0
Signed-off-by: Kan Yan <kyan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/362677
Tested-by: Daniel Hung-yu Wu <hywu@google.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
src/board/gale/board.c

index 9f056d2..7db8d47 100644 (file)
@@ -86,7 +86,6 @@ static void fill_board_descriptor(void)
 static const DtPathMap mac_maps[] = {
        { 0, "soc/edma@c080000/gmac0/local-mac-address" },
        { 0, "soc/edma@c080000/gmac1/local-mac-address" },
-       //{ 1, "chosen/bluetooth/local-mac-address" },
        {}
 };
 
@@ -100,12 +99,13 @@ static const DtPathMap calibration_maps[] = {
 
 static int fix_device_tree(DeviceTreeFixup *fixup, DeviceTree *tree)
 {
-       int rv;
+       int rv = 0;
 
-       //rv = dt_set_mac_addresses(tree, mac_maps);
+       if (lib_sysinfo.board_id >= BOARD_ID_GALE_EVT3)
+               rv = dt_set_mac_addresses(tree, mac_maps);
 
-       //if (bdescriptor.calibration_needed)
-               rv = dt_set_wifi_calibration(tree, calibration_maps);
+       if (bdescriptor.calibration_needed)
+               rv |= dt_set_wifi_calibration(tree, calibration_maps);
 
        return rv;
 }