Commit Graph

13 Commits

Author SHA1 Message Date
Rong Chang
c2ebc9e477 oak: use EXTRA_CLFAGS instead of CONFIG_BOARD_OAK_REV
Oak board revisions are not global configs. Move them out of
include/config.h . This change also makes it easier to build EC
and PD image for different board revisions.

BRANCH=none
BUG=none
TEST=manual
  build for board revision n and load on oak:
    make BOARD=oak clean
    make BOARD=oak_pd claen
    make EXTRA_CFLAGS=-DBOARD_REV=n BOARD=oak -j
    make EXTRA_CFLAGS=-DBOARD_REV=n BOARD=oak_pd -j

Change-Id: I331b4c5a1af94b179d7c6f7878a9c3939ea6025a
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/294441
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-08-21 08:10:23 +00:00
Rong Chang
9f146c7b8a oak: enable oak TCPM power status
Oak doesn't have enough interrupt pins to detect VBUS change. This CL
enables oak TCPM power status alert.

BRANCH=none
BUG=chrome-os-partner:41226
BUG=chrome-os-partner:42610
TEST=manual
  load on oak rev2. plug in normal type-c charger or legacy type-c
  chargers and check charging status.

Change-Id: I9659e749b515f999fe9e81373567f52ec3fe956a
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291161
Reviewed-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-08-21 08:10:16 +00:00
Scott
198fd7f2c2 oak: Fix issue with pc_send_ec_int() function
There was a bug in this function where the bit for host_command was
being set in the ec_status variable. This caused the ALERT# GPIO
line to be held low which in turn caused the EC MCU to loop
and keep reading the ALERT register.

BUG=none
BRANCH=none
TEST=manual Tested against Zinger in both ports and Zinger and Samus
at connected into each port. Verified that it established a PD contract
for both ports and that the alert line was no longer being held low

Change-Id: I5540440a68581521eb002411f728a4eac2f22caf
Signed-off-by: Scott Collyer <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288252
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Alec Berg <alecaberg@chromium.org>
Tested-by: Alec Berg <alecaberg@chromium.org>
2015-07-27 19:30:55 +00:00
Aseda Aboagye
ce063e0829 build-infr: Add support for shared RO library.
This commit introduces the build infrastructure changes needed for
creating a shared RO library. (libsharedobjs).  The end goal is for the
library to contain various objects that can be shared with both the RO
and RW EC images.

Now, there are 3 make goals: ro, rw, and libsharedobjs.

In order for changes that are only specific to a single image (ie: RW
only) to be applied correctly, the object files are now built separately
for the RO, RW, shared objects library targets.

NOTE: Certain EC targets are incompatible with this model due to the
fact that only one image is present within flash at a time.

BRANCH=none
BUG=None
TEST=make -j buildall tests
TEST=make -j BOARD=cr50 xrefs
TEST=make BOARD=samus dis
TEST=Built samus EC image and compared that the final EC image was
identical to the upstream version (except for the git SHAs & version
strings).

CQ-DEPEND=CL:285934

Change-Id: I8e67f089710be9c6d7017718109262394bdad2f5
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/274079
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
2015-07-17 03:17:50 +00:00
Scott
99e964c018 pd: Add support for TCPC Alert and Alert_Mask registers
Changed the alert function to hold the ec_int line until
all of the alert bits are cleared. Added support for the
alert_mask register. In addition, created ec_int_status
variable to distinguish which of 3 ec_int sources is
driving the pd_mcu_int line.

BUG=none
BRANCH=tot
TEST=Tested Zinger to Glados and Zinger to Samus and verified
that it established a power contract in both cases. Did not
test Oak, but put exact same changes in board.c as in glados.

Change-Id: I372e75b8fd5d66a0c01db18b46100b86fd9ac064
Signed-off-by: Scott Collyer <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/278256
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-06-23 19:18:44 +00:00
Bill Richardson
104f811e67 cleanup: fix all the header guards
This unifies all the EC header files to use __CROS_EC_FILENAME_H
as the include guard. Well, except for test/ util/ and extra/
which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively.

BUG=chromium:496895
BRANCH=none
TEST=make buildall -j

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029
Reviewed-on: https://chromium-review.googlesource.com/278121
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-06-18 19:07:00 +00:00
Alec Berg
1599e7a6f1 glados_pd: oak_pd: fix PD tx_disable timing
Disabling CC TX_DATA needs to be very fast to avoid clocking out
an extra garbage bit at the end of transmit. This change fixes
pd_tx_disable() to disable the TX_DATA line as fast as possible.

BUG=chrome-os-partner:40920
BRANCH=none
TEST=test on glados with scope attached to CC. note before this
change we occasionally get a garbage bit at the end of CC transmit.
With this change, it looks clean.

Change-Id: I86b47881e3846b2e3dd4fc2afcf2d28386a068a6
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/277295
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-06-13 02:53:12 +00:00
Rong Chang
e8dc5e7d83 oak: change board hardware revisions
Per discussion in CL:274728, hardware revision numbers are integer. So
the previous rev1.5 becomes rev2. And the previous rev2 is now rev3.

BRANCH=none
BUG=none
TEST=none

Change-Id: Ic7a1a60ce0b17a3469965cdca99332df0243ce2a
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/276577
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-06-10 18:24:12 +00:00
Rong Chang
ffd83ca8e9 oak: use pdcmd task to handle tcpc interrupt
This change syncs oak with glados change CL:275296.

BRANCH=none
BUG=chrome-os-partner:41167
TEST=manual
  load on oak and plug zinger in both ports many times.

Change-Id: Idc00a50c2d7b7a865e70762e91b2e7a82c6e6896
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275852
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-06-10 15:49:31 +00:00
Rong Chang
483eba41c1 oak: add PD support for type-C port 1
Port CL:275072 to oak. Oak rev1 and rev1.5 type-C VBUS input controls
are connected to PD phy instead of EC. This change wakes both USB PD
task to handle power status change. This issue will be fixed in next
hardware revision, or enable TCPC power status alert.

BRANCH=none
BUG=chrome-os-partner:41167
BUG=chrome-os-partner:41226
TEST=manual
  plug type-C charger into port 1

Change-Id: Ifea19276d0eb74f3e4cac509abece362e6e8af17
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275851
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-06-10 15:49:28 +00:00
Rong Chang
63a9dc19b5 oak: Modify GPIO list for rev 1.5 boards
Rev 1.5 hardware redefined EC and PD phy IO controls. This change adds macro
to map configurations at compile time.

BRANCH=none
BUG=none
TEST=manual
  build and flash ec.bin
  plug type-c charger on port 0

Change-Id: I60c2f1448fbdea9bb72d1f3b19de366cad150087
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/274771
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-06-10 15:49:19 +00:00
Alec Berg
52cbad1062 oak: Add PD communication to oak
Add TCPM on EC side and TCPC on PD side to allow PD
communication. Enable PD communication on port 0.

BUG=none
BRANCH=none
TEST=load on oak. plug in hoho on port 0, and make sure
we successfully negotiate a PD contract. (note: you have
to manually enable 5V VBUS right now)

Change-Id: I0ce7c016545bc56c5e10f66b49b73722187f12dc
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/271829
Reviewed-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Commit-Queue: Sheng-liang Song <ssl@chromium.org>
2015-05-30 16:34:40 +00:00
Alec Berg
488f8c9565 oak_pd: add initial support for oak PD
Add initial support for Oak PD MCU on rev1 boards.
This does not include USB PD communication.

BUG=none
BRANCH=none
TEST=build and load on oak and get console. test we
resond to host commands from EC using "pdcmd 0 0" on
EC console.

Change-Id: I92045cf0fd682279ada6c286f5399f0e258a6305
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/271828
2015-05-27 19:40:18 +00:00