-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
arc: hsdk: bug fixes and new feature supports #19173
Merged
nashif
merged 5 commits into
zephyrproject-rtos:master
from
foss-for-synopsys-dwc-arc-processors:arc_fixes
Sep 17, 2019
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
75c7b69
arc: arc_connect: bug fix in arc_connect
IRISZZW a629a07
arc: hsdk: dts: bug fix
IRISZZW d13cad5
arc: hsdk: add pinmux driver support and doc enhancement
IRISZZW 6fa7d96
drivers: spi_dw: add WORD only access support
IRISZZW 3891fa6
arc: hsdk: add lvgl support for hsdk board
IRISZZW File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright (c) 2019 Synopsys, Inc. All rights reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
zephyr_sources_ifdef(CONFIG_PINMUX_HSDK pinmux.c) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2019 Synopsys | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <soc.h> | ||
#include <init.h> | ||
#include <drivers/pinmux.h> | ||
|
||
static int board_pinmux_init(struct device *device) | ||
{ | ||
ARG_UNUSED(device); | ||
|
||
struct device *pinmux = device_get_binding(CONFIG_PINMUX_NAME); | ||
|
||
if (pinmux == NULL) { | ||
return -ENXIO; | ||
} | ||
/* | ||
* 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (c) 2019 Synopsys, Inc. All rights reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
menuconfig PINMUX_HSDK | ||
bool "ARC HSDK I/O pin mux driver" | ||
depends on SOC_ARC_HSDK | ||
help | ||
Enable driver for ARC HSDK I/O pin mux. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (c) 2019 Synopsys, Inc. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <errno.h> | ||
#include <device.h> | ||
#include <drivers/pinmux.h> | ||
#include <soc.h> | ||
|
||
#define creg_gpio_mux_reg (*(volatile u32_t *)CREG_GPIO_MUX_BASE_ADDR) | ||
|
||
void _arc_sync(void) | ||
{ | ||
__asm__ volatile("sync"); | ||
} | ||
|
||
static int pinmux_hsdk_set(struct device *dev, u32_t pin, u32_t func) | ||
{ | ||
|
||
if (func >= HSDK_PINMUX_FUNS || pin >= HSDK_PINMUX_SELS) | ||
return -EINVAL; | ||
|
||
creg_gpio_mux_reg &= ~(0x07U << (pin * 3)); | ||
creg_gpio_mux_reg |= (func << (pin * 3)); | ||
|
||
_arc_sync(); | ||
|
||
return 0; | ||
} | ||
|
||
static int pinmux_hsdk_get(struct device *dev, u32_t pin, u32_t *func) | ||
{ | ||
|
||
if (pin >= HSDK_PINMUX_SELS || func == NULL) | ||
return -EINVAL; | ||
|
||
*func = (creg_gpio_mux_reg >> (pin * 3)) & 0x07U; | ||
|
||
return 0; | ||
} | ||
|
||
static int pinmux_hsdk_pullup(struct device *dev, u32_t pin, u8_t func) | ||
{ | ||
return -ENOTSUP; | ||
} | ||
|
||
static int pinmux_hsdk_input(struct device *dev, u32_t pin, u8_t func) | ||
{ | ||
return -ENOTSUP; | ||
} | ||
|
||
static int pinmux_hsdk_init(struct device *dev) | ||
{ | ||
ARG_UNUSED(dev); | ||
return 0; | ||
} | ||
|
||
static const struct pinmux_driver_api pinmux_hsdk_driver_api = { | ||
.set = pinmux_hsdk_set, | ||
.get = pinmux_hsdk_get, | ||
.pullup = pinmux_hsdk_pullup, | ||
.input = pinmux_hsdk_input, | ||
}; | ||
|
||
DEVICE_AND_API_INIT(pinmux_hsdk, CONFIG_PINMUX_NAME, | ||
&pinmux_hsdk_init, NULL, NULL, | ||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, | ||
&pinmux_hsdk_driver_api); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it has nothing to do with either DW SSI controller or with HSDK board per se but instead it depends on APB data bus configuration. So please don't mention HSDK at least here - it's a good justification for commit message but not for Kconfig - other users don't care about HSDK board at all though they might need this feature also.
Moreover in U-Boot we switched to 32-bit only accessed and so far nobody complained, see https://gitlab.denx.de/u-boot/u-boot/commit/4b5f6c52e78d43710a0d062e31de741ec76ceea1 so maybe we do the same thing here?
I.e. don't introduce yet another Kconfig option and just use 32-bit accesses all the time.
Though there seem to be some cases like picoXcell pc3x3 where 16-bit access is really required, see torvalds/linux@c4fe57f
But still if 16-bit access is not needed I'd try to go with 32-bit only for now until somebody starts to complain as this will make code cleaner and simpler for now.