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>
This commit is contained in:
Vincent Palatin
2017-09-21 13:34:49 +02:00
committed by chrome-bot
parent 877842889c
commit 6f07b9212c
3 changed files with 2 additions and 59 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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)