summaryrefslogtreecommitdiff
path: root/board/nami_fp/flash_fp_mcu
blob: 70e98245977761696f6e49b4ff52fc8494ab89d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Copyright 2018 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.

. "$(dirname "$(readlink -f "$0")")"/../share/flash_fp_mcu/flash_fp_mcu_common.sh

# Kabylake PCH GPIOs
readonly KBL_GPIOCHIP="gpiochip360"

if [[ -e "/sys/class/gpio/${KBL_GPIOCHIP}" ]]; then
  # Ekko configuration
  echo "NOTE: For use with updating FP MCU on NAMI boards only"
  readonly SPIDEV="/dev/spidev32765.0"
  # FPMCU RST_ODL is on GPP_C9 = 360 + 57 = 417
  readonly GPIO_NRST=417
  # FPMCU BOOT0 is on GPP_D5 = 360 + 77 = 437
  readonly GPIO_BOOT0=437
  # FP_PWR_EN is on GPP_B11 = 360 + 35 = 395
  readonly GPIO_PWREN=395
else
  echo "Cannot find a known GPIO chip."
  exit 1
fi

flash_fp_mcu_stm32 \
  "${SPIDEV}"      \
  "${GPIO_NRST}"   \
  "${GPIO_BOOT0}"  \
  "${GPIO_PWREN}"  \
  "${1}"