Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update zephyr 2.6 for gpio and west flash #83

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion boards/arm/npcm400f_evb/board.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=npcm400f" "--speed=4000")
board_runner_args(jlink "--bin-file=./build/zephyr/zephyr_signed.bin")
board_runner_args(jlink "--bin-file=./build/zephyr/${CONFIG_KERNEL_BIN_NAME}_signed.bin")
board_runner_args(jlink "--reset-after-load")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
14 changes: 10 additions & 4 deletions soc/arm/npcm4xx/common/reg/reg_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,22 @@ struct scfg_reg {
volatile uint8_t reserved1[3];
/* 0x006: Device Control 4 */
volatile uint8_t DEV_CTL4;
volatile uint8_t reserved2[9];
volatile uint8_t reserved2[4];
volatile uint8_t DEVALT10;
volatile uint8_t DEVALT11;
volatile uint8_t DEVALT12;
volatile uint8_t reserved3[2];
/* 0x010 - 1F: Device Alternate Function 0 - F */
volatile uint8_t DEVALT0[16];
volatile uint8_t reserved3[4];
volatile uint8_t reserved4[4];
/* 0x024: DEVALTCX */
volatile uint8_t DEVALTCX;
volatile uint8_t reserved4[3];
volatile uint8_t reserved5[3];
/* 0x028: Device Pull-Up Enable 0 */
volatile uint8_t DEVPU0;
/* 0x029: Device Pull-Down Enable 1 */
volatile uint8_t DEVPD1;
volatile uint8_t reserved5;
volatile uint8_t reserved6;
/* 0x02B: Low-Voltage Pins Control 1 */
volatile uint8_t LV_CTL1;
};
Expand Down Expand Up @@ -202,6 +206,8 @@ struct scfg_reg {
#define NPCM4XX_DEVPU0_I2C2_0_PUE 4
#define NPCM4XX_DEVPU0_I2C3_0_PUE 6
#define NPCM4XX_DEVPU1_F_SPI_PUD_EN 7
#define NPCM4XX_DEVALT10_CRGPIO_SELECT_SL_CORE 0
#define NPCM4XX_DEVALT10_CRGPIO_SELECT_SL_POWER 1
#define NPCM4XX_DEVALTCX_GPIO_PULL_EN 7

#define SCFG_BASE_ADDR (0x400C3000)
Expand Down
15 changes: 15 additions & 0 deletions soc/arm/npcm4xx/npcm400f/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ config ESPI_NPCM4XX
https://www.intel.com/content/www/us/en/support/articles/000020952/
software/chipset-software.html for more detail.

choice GPIO_NPCM4XX_RESET_SL
prompt "Selects the GPIO reset to the corresponding reset source"
default GPIO_NPCM4XX_RESET_SL_CORE_DOMAIN

config GPIO_NPCM4XX_RESET_SL_CORE_DOMAIN
bool "GPIO Reset by Core domain reset"
help
GPIO port 0-9, A-F is reset by Core domain reset.

config GPIO_NPCM4XX_RESET_SL_POWER_UP
bool "GPIO Reset by VSB Power-Up reset"
help
GPIO port 0-9, A-F is reset by VSB Power-Up reset.
endchoice

DT_CHOSEN_Z_FLASH := zephyr,flash

config FLASH_SIZE
Expand Down
11 changes: 11 additions & 0 deletions soc/arm/npcm4xx/npcm400f/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@

LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);

uintptr_t scfg_base = DT_REG_ADDR_BY_IDX(DT_NODELABEL(scfg), 0);

void z_platform_init(void)
{
struct scfg_reg *inst_scfg = (struct scfg_reg *)scfg_base;

if (scfg_base) {
#if CONFIG_GPIO_NPCM4XX_RESET_SL_POWER_UP
inst_scfg->DEVALT10 = NPCM4XX_DEVALT10_CRGPIO_SELECT_SL_POWER;
#else
inst_scfg->DEVALT10 = NPCM4XX_DEVALT10_CRGPIO_SELECT_SL_CORE;
#endif
}
}

static int soc_init(const struct device *dev)
Expand Down
Loading