Files
OpenCellular/chip/npcx/build.mk
CHLin a0f25e398e npcx7: Add definition/configuration for npcx7m6xb/npcx7m7w
In this CL, we add the following changes to support the CHIP_VARIANT
npcx7m6xb and npcx7m7w:
1. Define the code RAM, data RAM, BBRAM base address/size.
2. Initialize the wov.c file for WoV driver development. (It will be
compiled only when CHIP_VARIANT=npcx7m7w in the build.mk and
CONFIG_WAKE_ON_VOICE is defined in board.h)
3. Fix the the incorrect offset of PWDWN_CTRL7 register.

BRANCH=none
BUG=none
TEST=No build errors for make buildall.
TEST=Change CHIP_VARIANT to npcx7m7w/npcx7m6xb in
board/npcx7_evb/build.mk; "BOARD=npcx7_evb make"; Check ec image can be
built. Flash the image on EVB; make sure EVB bootup.

Change-Id: I87bccb9097f8f0a6c67f96a8d90adf201ae9e773
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/858637
Commit-Ready: CH Lin <chlin56@nuvoton.com>
Tested-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-01-17 23:37:27 -08:00

70 lines
2.5 KiB
Makefile

# -*- makefile -*-
# 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.
#
# NPCX chip specific files build
#
# NPCX SoC has a Cortex-M4F ARM core
CORE:=cortex-m
# Allow the full Cortex-M4 instruction set
CFLAGS_CPU+=-march=armv7e-m -mcpu=cortex-m4
# Assign default CHIP_FAMILY as npcx5 for old boards used npcx5 series
ifeq ($(CHIP_FAMILY),)
CHIP_FAMILY:=npcx5
endif
# Required chip modules
chip-y=header.o clock.o gpio.o hwtimer.o system.o uart.o
chip-y+=system-$(CHIP_FAMILY).o
# Optional chip modules
chip-$(CONFIG_ADC)+=adc.o
chip-$(CONFIG_FANS)+=fan.o
chip-$(CONFIG_FLASH_PHYSICAL)+=flash.o
chip-$(CONFIG_I2C)+=i2c.o i2c-$(CHIP_FAMILY).o
chip-$(CONFIG_LPC)+=lpc.o
chip-$(CONFIG_ESPI)+=espi.o
chip-$(CONFIG_PECI)+=peci.o
chip-$(CONFIG_HOSTCMD_SPS)+=shi.o
# pwm functions are implemented with the fan functions
chip-$(CONFIG_PWM)+=pwm.o
chip-$(CONFIG_SPI)+=spi.o
chip-$(CONFIG_WATCHDOG)+=watchdog.o
chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o
chip-$(CONFIG_WAKE_ON_VOICE)+=wov.o
# spi monitor program fw for openocd and UUT(UART Update Tool)
npcx-monitor-fw=chip/npcx/spiflashfw/npcx_monitor
npcx-monitor-fw-bin=${out}/$(npcx-monitor-fw).bin
PROJECT_EXTRA+=${npcx-monitor-fw-bin}
# Monitor header is only used for UUT which is not supported on npcx5.
ifneq "$(CHIP_FAMILY)" "npcx5"
npcx-monitor-hdr=chip/npcx/spiflashfw/monitor_hdr
npcx-monitor-hdr-ro-bin=${out}/$(npcx-monitor-hdr)_ro.bin
npcx-monitor-hdr-rw-bin=${out}/$(npcx-monitor-hdr)_rw.bin
PROJECT_EXTRA+=${npcx-monitor-hdr-ro-bin} ${npcx-monitor-hdr-rw-bin}
endif
# ECST tool is for filling the header used by booter of npcx EC
show_esct_cmd=$(if $(V),,echo ' ECST ' $(subst $(out)/,,$@) ; )
# ECST options for header
bld_ecst=${out}/util/ecst -chip $(CHIP_VARIANT) -usearmrst -mode bt -ph -i $(1) -o $(2) -nohcrc \
-nofcrc -flashsize 8 -spimaxclk 50 -spireadmode dual 1> /dev/null
# Replace original one with the flat file including header
moveflat=mv -f $(1) $(2)
# Commands for ECST
cmd_ecst=$(show_esct_cmd)$(call moveflat,$@,$@.tmp);$(call bld_ecst,$@.tmp,$@)
# Commands to append npcx header in ec.RO.flat
cmd_org_ec_elf_to_flat = $(OBJCOPY) --set-section-flags .roshared=share \
-O binary $(patsubst %.flat,%.elf,$@) $@
cmd_npcx_ro_elf_to_flat=$(cmd_org_ec_elf_to_flat);$(cmd_ecst)
cmd_ec_elf_to_flat = $(if $(filter $(out)/RO/ec.RO.flat, $@), \
$(cmd_npcx_ro_elf_to_flat), $(cmd_org_ec_elf_to_flat) )