Commit 4276d7d2 authored by Kumar Gala's avatar Kumar Gala Committed by Anas Nashif
Browse files

pinmux: hsdk: Convert ARC HSDK pinmux to be devicetree based



Add a simple pinctrl node for the CREG GPIO MUX register to be used
by the pinmux driver.

Signed-off-by: default avatarKumar Gala <kumar.gala@linaro.org>
parent 147bb6b9
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -12,11 +12,10 @@ static int board_pinmux_init(const struct device *device)
{
	ARG_UNUSED(device);

	const struct device *pinmux = device_get_binding(CONFIG_PINMUX_NAME);
	const struct device *pinmux = DEVICE_DT_GET(DT_NODELABEL(pinctrl));

	__ASSERT_NO_MSG(device_is_ready(pinmux));

	if (pinmux == NULL) {
		return -ENXIO;
	}
	/*
	 * to do configuration for each sel,
	 * please refer the doc for hsdk board.
+0 −6
Original line number Diff line number Diff line
@@ -11,12 +11,6 @@ menuconfig PINMUX

if PINMUX

config PINMUX_NAME
	string "Pinmux driver name"
	default "PINMUX"
	help
	  The name of the pinmux driver.

config PINMUX_INIT_PRIORITY
	int "Init priority"
	default 45
+4 −2
Original line number Diff line number Diff line
@@ -4,12 +4,14 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#define DT_DRV_COMPAT snps_creg_gpio_mux_hsdk

#include <errno.h>
#include <device.h>
#include <drivers/pinmux.h>
#include <soc.h>

#define creg_gpio_mux_reg	(*(volatile uint32_t *)CREG_GPIO_MUX_BASE_ADDR)
#define creg_gpio_mux_reg	(*(volatile uint32_t *)DT_INST_REG_ADDR(0))

void _arc_sync(void)
{
@@ -68,7 +70,7 @@ static const struct pinmux_driver_api pinmux_hsdk_driver_api = {
	.input = pinmux_hsdk_input,
};

DEVICE_DEFINE(pinmux_hsdk, CONFIG_PINMUX_NAME,
DEVICE_DT_INST_DEFINE(0,
		&pinmux_hsdk_init, device_pm_control_nop, NULL, NULL,
		PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
		&pinmux_hsdk_driver_api);
+5 −0
Original line number Diff line number Diff line
@@ -66,6 +66,11 @@
			reg = <0x90000000 0x50000000>;
		};

		pinctrl: pinctrl@f0001484 {
			compatible = "snps,creg-gpio-mux-hsdk";
			reg = <0xf0001484 0x4>;
		};

		uart0: uart@f0005000 {
			compatible = "ns16550";
			clock-frequency = <33333333>;
+17 −0
Original line number Diff line number Diff line
# Copyright (c) 2021, Linaro Limited
# SPDX-License-Identifier: Apache-2.0

description: |
  Synopsys CREG HSDK GPIO pin mux

compatible: "snps,creg-gpio-mux-hsdk"

include: base.yaml

properties:
    reg:
      required: true

pinmux-cells:
  - pin
  - function
Loading