ARC: boards: HSDK: ged rid of pinmux usage
Pinmux is deprecated (see #39740) so let's get rid of it's usage for HSDK board. As we call pinmux only once at init phase we simply do register setup in platform code instead of pinmux. Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
This commit is contained in:
parent
dfabb2e3e5
commit
f81b3e03ac
|
@ -4,4 +4,4 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
zephyr_sources_ifdef(CONFIG_PINMUX_HSDK pinmux.c)
|
||||
zephyr_sources(platform.c)
|
||||
|
|
|
@ -11,8 +11,6 @@ CONFIG_ARCV2_TIMER=y
|
|||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_PINMUX=y
|
||||
CONFIG_PINMUX_HSDK=y
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SMP=y
|
||||
|
|
|
@ -11,8 +11,6 @@ CONFIG_ARCV2_TIMER=y
|
|||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_PINMUX=y
|
||||
CONFIG_PINMUX_HSDK=y
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SMP=y
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Synopsys
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <soc.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/drivers/pinmux.h>
|
||||
|
||||
static int board_pinmux_init(const struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
const struct device *pinmux = DEVICE_DT_GET(DT_NODELABEL(pinctrl));
|
||||
|
||||
__ASSERT_NO_MSG(device_is_ready(pinmux));
|
||||
|
||||
/*
|
||||
* to do configuration for each sel,
|
||||
* please refer the doc for hsdk board.
|
||||
*/
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL0, HSDK_PINMUX_FUN0);
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL1, HSDK_PINMUX_FUN0);
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL2, HSDK_PINMUX_FUN0);
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL3, HSDK_PINMUX_FUN2);
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL4, HSDK_PINMUX_FUN0);
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL5, HSDK_PINMUX_FUN0);
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL6, HSDK_PINMUX_FUN0);
|
||||
pinmux_pin_set(pinmux, HSDK_PINMUX_SEL7, HSDK_PINMUX_FUN0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
SYS_INIT(board_pinmux_init, PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY);
|
22
boards/arc/hsdk/platform.c
Normal file
22
boards/arc/hsdk/platform.c
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Synopsys
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <soc.h>
|
||||
#include <init.h>
|
||||
|
||||
#define HSDK_CREG_GPIO_MUX_REG 0xf0001484
|
||||
#define HSDK_CREG_GPIO_MUX_VAL 0x00000400
|
||||
|
||||
static int hsdk_creg_gpio_mux_init(const struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
sys_write32(HSDK_CREG_GPIO_MUX_REG, HSDK_CREG_GPIO_MUX_VAL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(hsdk_creg_gpio_mux_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
@ -66,11 +66,6 @@
|
|||
reg = <0x90000000 0x50000000>;
|
||||
};
|
||||
|
||||
pinctrl: pinctrl@f0001484 {
|
||||
compatible = "snps,creg-gpio-mux-hsdk";
|
||||
reg = <0xf0001484 0x4>;
|
||||
};
|
||||
|
||||
uart0: uart@f0005000 {
|
||||
compatible = "ns16550";
|
||||
clock-frequency = <33333333>;
|
||||
|
|
Loading…
Reference in a new issue