summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2017-09-21 13:34:49 +0200
committerchrome-bot <chrome-bot@chromium.org>2017-09-22 08:08:57 -0700
commit6f07b9212c72bc467d3c284ca2c8cebf51dd0a98 (patch)
tree6a98dcb9530c7aa9852346713cdfbf738b83828b
parent877842889c678b8340abe9cac74566529d8bc3f4 (diff)
downloadchrome-ec-6f07b9212c72bc467d3c284ca2c8cebf51dd0a98.tar.gz
twinkie: replace combined firmware bash script
In order to get a Twinkie firmware image with the regular Twinkie sniffer firmware in the RO partition and a firmware behaving as a USB PD sink in the RW partition, I had created the (questionable) build_rw_variant bash script. Now the EC build can do this natively, so remove the script and the dedicated task list and use conditional task declaration in the ec.tasklist. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=twinkie BUG=none TEST=build the former firmware with './board/twinkie/build_rw_variant', build the new one with this patch and 'make BOARD=twinkie' -j, compare the 2 resulting binaries, they are identical. Change-Id: I3adb24e2c2825e5bd6f43a7440f829efd70038cc Reviewed-on: https://chromium-review.googlesource.com/677284 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rwxr-xr-xboard/twinkie/build_rw_variant29
-rw-r--r--board/twinkie/ec.tasklist3
-rw-r--r--board/twinkie/sink.tasklist29
3 files changed, 2 insertions, 59 deletions
diff --git a/board/twinkie/build_rw_variant b/board/twinkie/build_rw_variant
deleted file mode 100755
index a17851f910..0000000000
--- a/board/twinkie/build_rw_variant
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-
-#
-# Build a Twinkie firmware image with
-# the regular Twinkie sniffer firmware in the RO partition
-# and a firmware behaving as a USB PD sink in the RW partition.
-#
-BOARD=twinkie
-VARIANT=sink
-RO_SIZE=65536
-
-# Clean build
-make BOARD=${BOARD} clean
-make BOARD=${BOARD} out=build/${BOARD}_${VARIANT} clean
-# Build regular Twinkie sniffer firmware
-make BOARD=${BOARD}
-# Build Twinkie as a USB PD consumer/producer (defaulting as a sink)
-make BOARD=${BOARD} PROJECT=${VARIANT} out=build/${BOARD}_${VARIANT}
-
-# Generate the final image by concatenating the built images
-VERSION=$(echo "VERSION" | cpp -P -imacros build/${BOARD}/ec_version.h)
-FINAL_IMG=build/${BOARD}/${VERSION//\"}.combined.bin
-cp build/${BOARD}/ec.bin ${FINAL_IMG}
-dd if=build/${BOARD}_${VARIANT}/RW/${VARIANT}.RW.bin of=${FINAL_IMG} bs=1 seek=${RO_SIZE} conv=notrunc
diff --git a/board/twinkie/ec.tasklist b/board/twinkie/ec.tasklist
index 5b232b78fe..e09bfd602c 100644
--- a/board/twinkie/ec.tasklist
+++ b/board/twinkie/ec.tasklist
@@ -19,4 +19,5 @@
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(SNIFFER, sniffer_task, NULL, TASK_STACK_SIZE)
+ TASK_ALWAYS_RO(SNIFFER, sniffer_task, NULL, TASK_STACK_SIZE) \
+ TASK_ALWAYS_RW(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE)
diff --git a/board/twinkie/sink.tasklist b/board/twinkie/sink.tasklist
deleted file mode 100644
index aaf83ab95e..0000000000
--- a/board/twinkie/sink.tasklist
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*
- * To get Twinkie to behave as a USB Power Delivery consumer/provider
- * device rather than a transparent sniffer, build it as below :
- * make BOARD=twinkie PROJ=sink
- * to use this task file instead of the default ec.tasklist.
- */
-
-/**
- * List of enabled tasks in the priority order
- *
- * The first one has the lowest priority.
- *
- * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and
- * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries,
- * where :
- * 'n' in the name of the task
- * 'r' in the main routine of the task
- * 'd' in an opaque parameter passed to the routine at startup
- * 's' is the stack size in bytes; must be a multiple of 8
- */
-#define CONFIG_TASK_LIST \
- TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \
- TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE)