mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-01 21:02:27 +00:00
kevin: Add support for SPI_MASTER on kevin
Enabling SPI_MASTER on SPIP port in npcx BUG=chrome-os-partner:52844 TEST=spixfer rlen 0 0 1 shows 0xd2 on kevin BRANCH=None Change-Id: I3fe333a7d69fe16c2c630c3c2487320a0d1c020b Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/341577 Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "pwm_chip.h"
|
||||
#include "registers.h"
|
||||
#include "shi_chip.h"
|
||||
#include "spi.h"
|
||||
#include "switch.h"
|
||||
#include "timer.h"
|
||||
#include "thermal.h"
|
||||
@@ -99,6 +100,13 @@ const struct power_signal_info power_signal_list[] = {
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
|
||||
|
||||
/******************************************************************************/
|
||||
/* SPI devices */
|
||||
const struct spi_device_t spi_devices[] = {
|
||||
{ CONFIG_SPI_ACCEL_PORT, 1, GPIO_SPI_SENSOR_CS_L }
|
||||
};
|
||||
const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices);
|
||||
|
||||
/******************************************************************************/
|
||||
/* Wake-up pins for hibernate */
|
||||
const enum gpio_signal hibernate_wake_pins[] = {
|
||||
@@ -213,6 +221,11 @@ static void board_init(void)
|
||||
i,
|
||||
&charge_none);
|
||||
}
|
||||
|
||||
/* Sensor Init */
|
||||
gpio_config_module(MODULE_SPI_MASTER, 1);
|
||||
spi_enable(CONFIG_SPI_ACCEL_PORT, 1);
|
||||
CPRINTS("Board using SPI sensors");
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#define CONFIG_KEYBOARD_COL2_INVERTED
|
||||
#define CONFIG_KEYBOARD_PROTOCOL_MKBP /* Instead of 8042 protocol of keyboard */
|
||||
#define CONFIG_POWER_BUTTON
|
||||
/* TODO: Verify W25Q40 protect regs are compatible with W25X40 */
|
||||
#define CONFIG_SPI_FLASH_W25X40
|
||||
#define CONFIG_SPI
|
||||
#define CONFIG_SPI_MASTER
|
||||
#define CONFIG_VBOOT_HASH
|
||||
|
||||
#define CONFIG_CHARGER
|
||||
@@ -77,7 +77,7 @@
|
||||
#define CONFIG_CMD_STACKOVERFLOW
|
||||
#define CONFIG_CMD_JUMPTAGS
|
||||
#define CONFIG_CMD_FLASH
|
||||
#define CONFIG_CMD_SPI_FLASH
|
||||
#define CONFIG_CMD_SPI_XFER
|
||||
#define CONFIG_CMD_SCRATCHPAD
|
||||
|
||||
#define CONFIG_UART_HOST 0
|
||||
@@ -99,6 +99,9 @@
|
||||
#define I2C_PORT_CHARGER NPCX_I2C_PORT2
|
||||
#define I2C_PORT_BATTERY NPCX_I2C_PORT3
|
||||
|
||||
/* Enable Accel over SPI */
|
||||
#define CONFIG_SPI_ACCEL_PORT 0 /* SPI master port (SPIP) form BMI160 */
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
enum adc_channel {
|
||||
|
||||
Reference in New Issue
Block a user