Enable driver model for GPIOs on Tegra and Exynos
Subsystems (6)
v5 cover Enable driver model for GPIOs on Tegra and Exynos
Now that driver model is part of U-Boot, the task of converting drivers over to it begins. GPIO is one of the easiest to convert, since it already has a sandbox driver and a uclass driver.
The Tegra GPIO driver is relatively simple since it has a linear numbering and already uses the generic GPIO framework. Each GPIO bank has a separate device. Some arguments have been made that a single device should support all the GPIO banks, but currently the driver model uclass does not work that way and it would require a second-level data structure to handle the bank feature.
This driver has been tested on Trimslice (Tegra 20).
For exynos, the pinctrl device tree files are brought in from the kernel and cut down to remove the groupings which we don't yet use. Very small additions are made to avoid replicating the awful tables that Linux has for every exynos SoC. This series sits on top of the exynos refactors.
The 'gpio' command is updated to support display of only the allocated GPIOs. This is much more friendly than displaying a large table.
A few related clean-ups are provided as well.
This series is available at u-boot-dm.git, branch working.
Changes in v5:
- Put this patch before the others to avoid breaking bisectability
- Add additional gpio_request() calls for other samsung boards
- Use a mask instead of division in gpio_request() naming call
- Remove RFC label now that build errors are fixed
- Tidy up and update cover letter message
Changes in v4:
- Rename struct device to struct udevice
- Add new patch to enhance 'gpio' command
- Add patches for exynos GPIO support
Changes in v3:
- Move dm command enable to previous patch
- Use gpio number for the internal helper functions
Changes in v2:
- Split out driver model changes into separate patches
- Correct bugs found during testing
Simon Glass (11):
tegra: Convert tegra GPIO driver to use driver model
exynos: dts: Convert /include/ to #include
exynos: Bring in pinctrl dts files from Linux kernel
exynos: dts: Remove unused pinctrl information to save space
exynos: dts: Adjust device tree files for U-Boot
exynos: Tidy up GPIO headers
exynos: Tidy up GPIO defines
exynos: Make sure that GPIOs are requested
dm: gpio: Enhance gpio command to show only active GPIOs
exynos: gpio: Convert to driver model
dm: sandbox: dts: Add a GPIO bank
arch/arm/cpu/armv7/exynos/pinmux.c | 5 +- arch/arm/dts/exynos4.dtsi | 9 +- arch/arm/dts/exynos4210-origen.dts | 4 +- arch/arm/dts/exynos4210-pinctrl.dtsi | 305 ++++++++++++++++++++ arch/arm/dts/exynos4210-smdkv310.dts | 2 +- arch/arm/dts/exynos4210-trats.dts | 2 +- arch/arm/dts/exynos4210-universal_c210.dts | 2 +- arch/arm/dts/exynos4210.dtsi | 161 +++++++++++ arch/arm/dts/exynos4412-trats2.dts | 2 +- arch/arm/dts/exynos4412.dtsi | 38 +++ arch/arm/dts/exynos4x12-pinctrl.dtsi | 350 +++++++++++++++++++++++ arch/arm/dts/exynos4x12.dtsi | 122 ++++++++ arch/arm/dts/exynos5.dtsi | 56 +++- arch/arm/dts/exynos5250-pinctrl.dtsi | 335 ++++++++++++++++++++++ arch/arm/dts/exynos5250-smdk5250.dts | 2 +- arch/arm/dts/exynos5250-snow.dts | 2 +- arch/arm/dts/exynos5250.dtsi | 48 +++- arch/arm/dts/exynos5420-peach-pit.dts | 2 +- arch/arm/dts/exynos5420-pinctrl.dtsi | 316 ++++++++++++++++++++ arch/arm/dts/exynos5420-smdk5420.dts | 2 +- arch/arm/dts/exynos5420.dtsi | 125 ++++++++ arch/arm/dts/exynos54xx.dtsi | 56 +++- arch/arm/dts/s5pc1xx-goni.dts | 2 +- arch/arm/dts/s5pc1xx-smdkc100.dts | 2 +- arch/arm/include/asm/arch-exynos/gpio.h | 5 - arch/arm/include/asm/arch-s5pc1xx/gpio.h | 4 - arch/arm/include/asm/arch-tegra/gpio.h | 15 +- arch/sandbox/dts/sandbox.dts | 9 + board/nvidia/seaboard/seaboard.c | 2 +- board/samsung/arndale/arndale.c | 4 +- board/samsung/common/board.c | 2 +- board/samsung/common/misc.c | 3 +- board/samsung/goni/goni.c | 4 +- board/samsung/origen/origen.c | 2 +- board/samsung/smdk5250/exynos5-dt.c | 7 + board/samsung/smdk5420/smdk5420.c | 6 +- board/samsung/smdkc100/smdkc100.c | 2 +- board/samsung/smdkv310/smdkv310.c | 2 +- board/samsung/trats/trats.c | 17 +- board/samsung/trats2/trats2.c | 27 +- board/samsung/universal_c210/universal.c | 4 +- common/cmd_gpio.c | 101 ++++--- drivers/gpio/s5p_gpio.c | 443 +++++++++++++++++++---------- drivers/gpio/tegra_gpio.c | 313 ++++++++++++++++---- drivers/mmc/s5p_sdhci.c | 7 +- include/asm-generic/gpio.h | 15 +- include/configs/exynos-common.h | 4 + include/configs/tegra-common.h | 1 + 48 files changed, 2657 insertions(+), 292 deletions(-) create mode 100644 arch/arm/dts/exynos4210-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos4210.dtsi create mode 100644 arch/arm/dts/exynos4412.dtsi create mode 100644 arch/arm/dts/exynos4x12-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos4x12.dtsi create mode 100644 arch/arm/dts/exynos5250-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos5420-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos5420.dtsi
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 1/11 tegra: Convert tegra GPIO driver to use driver model
This is an implementation of GPIOs for Tegra that uses driver model. It has been tested on trimslice and also using the new iotrace feature.
The implementation uses a top-level GPIO device (which has no actual GPIOS). Under this all the banks are created as separate GPIO devices.
The GPIOs are named as per the Tegra datasheet/header files: A0..A7, B0..B7, ..., Z0..Z7, AA0..AA7, etc.
Since driver model is not yet available before relocation, or in SPL, a special function is provided for seaboard's SPL code.
---
Changes in v5: None
Changes in v4:
- Rename struct device to struct udevice
Changes in v3:
- Move dm command enable to previous patch
- Use gpio number for the internal helper functions
Changes in v2:
- Split out driver model changes into separate patches
- Correct bugs found during testing
arch/arm/include/asm/arch-tegra/gpio.h | 15 +- board/nvidia/seaboard/seaboard.c | 2 +- drivers/gpio/tegra_gpio.c | 313 +++++++++++++++++++++++++++------ include/configs/tegra-common.h | 1 + 4 files changed, 266 insertions(+), 65 deletions(-)
arch/arm/include/asm/arch-tegra/gpio.h +9 -6
@@ -6,6 +6,8 @@#ifndef _TEGRA_GPIO_H_#define _TEGRA_GPIO_H_ +#define TEGRA_GPIOS_PER_PORT 8 +#define TEGRA_PORTS_PER_BANK 4#define MAX_NUM_GPIOS (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8)#define GPIO_NAME_SIZE 20/* gpio_request max label len */
@@ -25,9 +27,14 @@ struct tegra_gpio_config { u32 init:2; }; -/* -* Tegra-specific GPIO API +/** +* tegra_spl_gpio_direction_output() - set the output value of a GPIO +* +* This function is only used from SPL on seaboard, which needs to enable a +* GPIO to get the UART running. It could be done in U-Boot rather than SPL, +* but for now, this gets it working */ +int tegra_spl_gpio_direction_output (int gpio,int value);/** * Configure a list of GPIOs
@@ -37,8 +44,4 @@ struct tegra_gpio_config {*/ void gpio_config_table (const struct tegra_gpio_config *config,int len); -void gpio_info (void ); - -#define gpio_status () gpio_info() -#endif /* TEGRA_GPIO_H_ */
board/nvidia/seaboard/seaboard.c +1 -1
@@ -22,7 +22,7 @@ void gpio_early_init_uart(void)#ifndef CONFIG_SPL_BUILD gpio_request (GPIO_PI3 ,NULL );#endif - gpio_direction_output(GPIO_PI3, 0); + tegra_spl_gpio_direction_output(GPIO_PI3, 0); }#endif
drivers/gpio/tegra_gpio.c +255 -58
400 lines not on this page · raw message
include/configs/tegra-common.h +1 -0
@@ -21,6 +21,7 @@#define CONFIG_DM #define CONFIG_CMD_DM +#define CONFIG_DM_GPIO #define CONFIG_SYS_TIMER_RATE 1000000#define CONFIG_SYS_TIMER_COUNTER NV_PA_TMRUS_BASE
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 2/11 exynos: dts: Convert /include/ to #include
In reply to Simon GlassWe should be consistent about this. The kernel has moved to #include which breaks error reporting to some extent but does allow us to include binding files.
---
Changes in v5:
- Put this patch before the others to avoid breaking bisectability
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/dts/exynos4.dtsi | 2 +- arch/arm/dts/exynos4210-origen.dts | 4 ++-- arch/arm/dts/exynos4210-smdkv310.dts | 2 +- arch/arm/dts/exynos4210-trats.dts | 2 +- arch/arm/dts/exynos4210-universal_c210.dts | 2 +- arch/arm/dts/exynos4412-trats2.dts | 2 +- arch/arm/dts/exynos5.dtsi | 2 +- arch/arm/dts/exynos5250-smdk5250.dts | 2 +- arch/arm/dts/exynos5250-snow.dts | 2 +- arch/arm/dts/exynos5250.dtsi | 2 +- arch/arm/dts/exynos5420-peach-pit.dts | 2 +- arch/arm/dts/exynos5420-smdk5420.dts | 2 +- arch/arm/dts/exynos54xx.dtsi | 2 +- arch/arm/dts/s5pc1xx-goni.dts | 2 +- arch/arm/dts/s5pc1xx-smdkc100.dts | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-)
arch/arm/dts/exynos4.dtsi +1 -1
@@ -7,7 +7,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ -/include/ "skeleton.dtsi" +#include "skeleton.dtsi" / { serial at 13800000 {
arch/arm/dts/exynos4210-origen.dts +2 -2
@@ -8,8 +8,8 @@ */ /dts-v1/; -/include/ "skeleton.dtsi" -/include/ "exynos4.dtsi" +#include "skeleton.dtsi" +#include "exynos4.dtsi" / { model = "Insignal Origen evaluation board based on Exynos4210";
arch/arm/dts/exynos4210-smdkv310.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "exynos4.dtsi" +#include "exynos4.dtsi" / { model = "Samsung SMDKV310 on Exynos4210";
arch/arm/dts/exynos4210-trats.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "exynos4.dtsi" +#include "exynos4.dtsi" / { model = "Samsung Trats based on Exynos4210";
arch/arm/dts/exynos4210-universal_c210.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "exynos4.dtsi" +#include "exynos4.dtsi" / { model = "Samsung Universal C210 based on Exynos4210 rev0";
arch/arm/dts/exynos4412-trats2.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "exynos4.dtsi" +#include "exynos4.dtsi" / { model = "Samsung Trats2 based on Exynos4412";
arch/arm/dts/exynos5.dtsi +1 -1
@@ -5,7 +5,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ -/include/ "skeleton.dtsi" +#include "skeleton.dtsi" / { compatible = "samsung,exynos5";
arch/arm/dts/exynos5250-smdk5250.dts +1 -1
@@ -10,7 +10,7 @@ */ /dts-v1/; -/include/ "exynos5250.dtsi" +#include "exynos5250.dtsi" / { model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
arch/arm/dts/exynos5250-snow.dts +1 -1
@@ -10,7 +10,7 @@ */ /dts-v1/; -/include/ "exynos5250.dtsi" +#include "exynos5250.dtsi" / { model = "Google Snow";
arch/arm/dts/exynos5250.dtsi +1 -1
@@ -5,7 +5,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ -/include/ "exynos5.dtsi" +#include "exynos5.dtsi" / { i2c at 12ca0000 {
arch/arm/dts/exynos5420-peach-pit.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "exynos54xx.dtsi" +#include "exynos54xx.dtsi" / { model = "Samsung/Google Peach Pit board based on Exynos5420";
arch/arm/dts/exynos5420-smdk5420.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "exynos54xx.dtsi" +#include "exynos54xx.dtsi" / { model = "SAMSUNG SMDK5420 board based on EXYNOS5420";
arch/arm/dts/exynos54xx.dtsi +1 -1
@@ -5,7 +5,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ -/include/ "exynos5.dtsi" +#include "exynos5.dtsi" / { config {
arch/arm/dts/s5pc1xx-goni.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "exynos4.dtsi" +#include "exynos4.dtsi" / { model = "Samsung SMDKV310 on Exynos4210";
arch/arm/dts/s5pc1xx-smdkc100.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "exynos4.dtsi" +#include "exynos4.dtsi" / { model = "Samsung SMDKC100";
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 3/11 exynos: Bring in pinctrl dts files from Linux kernel
In reply to Simon GlassBring in required device tree files for pinctrl from Linux v3.14. These are initially unchanged and have a number of pieces not needed by U-Boot.
Note that exynos5420 is renamed to exynos54xx here since we want to support exynos5422 also.
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/dts/exynos4.dtsi | 7 + arch/arm/dts/exynos4210-origen.dts | 2 +- arch/arm/dts/exynos4210-pinctrl.dtsi | 847 +++++++++++++++++++++++++ arch/arm/dts/exynos4210-trats.dts | 2 +- arch/arm/dts/exynos4210-universal_c210.dts | 2 +- arch/arm/dts/exynos4210.dtsi | 155 +++++ arch/arm/dts/exynos4412-trats2.dts | 2 +- arch/arm/dts/exynos4412.dtsi | 38 ++ arch/arm/dts/exynos4x12-pinctrl.dtsi | 956 +++++++++++++++++++++++++++++ arch/arm/dts/exynos4x12.dtsi | 214 +++++++ arch/arm/dts/exynos5.dtsi | 54 ++ arch/arm/dts/exynos5250-pinctrl.dtsi | 790 ++++++++++++++++++++++++ arch/arm/dts/exynos5250.dtsi | 40 +- arch/arm/dts/exynos5420-pinctrl.dtsi | 687 +++++++++++++++++++++ arch/arm/dts/exynos5420.dtsi | 115 ++++ arch/arm/dts/exynos54xx.dtsi | 44 ++ 16 files changed, 3950 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/exynos4210-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos4210.dtsi create mode 100644 arch/arm/dts/exynos4412.dtsi create mode 100644 arch/arm/dts/exynos4x12-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos4x12.dtsi create mode 100644 arch/arm/dts/exynos5250-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos5420-pinctrl.dtsi create mode 100644 arch/arm/dts/exynos5420.dtsi
arch/arm/dts/exynos4.dtsi +7 -0
@@ -10,6 +10,13 @@ #include "skeleton.dtsi" / { + combiner: interrupt-controller at 10440000 { + compatible = "samsung,exynos4210-combiner"; + #interrupt-cells = <2>; + interrupt-controller; + reg = <0x10440000 0x1000>; + }; + serial at 13800000 { compatible = "samsung,exynos4210-uart"; reg = <0x13800000 0x3c>;
arch/arm/dts/exynos4210-origen.dts +1 -1
@@ -9,7 +9,7 @@ /dts-v1/; #include "skeleton.dtsi" -#include "exynos4.dtsi" +#include "exynos4210.dtsi" / { model = "Insignal Origen evaluation board based on Exynos4210";
arch/arm/dts/exynos4210-pinctrl.dtsi new file +847 -0
847 lines not on this page · raw message
arch/arm/dts/exynos4210-trats.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -#include "exynos4.dtsi" +#include "exynos4210.dtsi" / { model = "Samsung Trats based on Exynos4210";
arch/arm/dts/exynos4210-universal_c210.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -#include "exynos4.dtsi" +#include "exynos4210.dtsi" / { model = "Samsung Universal C210 based on Exynos4210 rev0";
arch/arm/dts/exynos4210.dtsi new file +155 -0
155 lines not on this page · raw message
arch/arm/dts/exynos4412-trats2.dts +1 -1
@@ -8,7 +8,7 @@ */ /dts-v1/; -#include "exynos4.dtsi" +#include "exynos4412.dtsi" / { model = "Samsung Trats2 based on Exynos4412";
arch/arm/dts/exynos4412.dtsi new file +38 -0
@@ -0,0 +1,38 @@ +/* + * Samsung's Exynos4412 SoC device tree source + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Samsung's Exynos4412 SoC device nodes are listed in this file. Exynos4412 + * based board files can include this file and provide values for board specfic + * bindings. + * + * Note: This file does not include device nodes for all the controllers in + * Exynos4412 SoC. As device tree coverage for Exynos4412 increases, additional + * nodes can be added to this file. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include "exynos4x12.dtsi" + +/ { + compatible = "samsung,exynos4412"; + + gic: interrupt-controller at 10490000 { + cpu-offset = <0x4000>; + }; + + interrupt-controller at 10440000 { + samsung,combiner-nr = <20>; + interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>, + <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>, + <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>, + <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>, + <0 107 0>, <0 108 0>, <0 48 0>, <0 42 0>; + }; + +};
arch/arm/dts/exynos4x12-pinctrl.dtsi new file +956 -0
956 lines not on this page · raw message
arch/arm/dts/exynos4x12.dtsi new file +214 -0
214 lines not on this page · raw message
arch/arm/dts/exynos5.dtsi +54 -0
66 lines not on this page · raw message
arch/arm/dts/exynos5250-pinctrl.dtsi new file +790 -0
679 lines not on this page · raw message
arch/arm/dts/exynos5420-pinctrl.dtsi new file +687 -0
687 lines not on this page · raw message
arch/arm/dts/exynos5420.dtsi new file +115 -0
115 lines not on this page · raw message
arch/arm/dts/exynos54xx.dtsi +44 -0
44 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.0.0.526.g5318336
Part of the diff is not shown here. View the raw message.
PATCH v5 4/11 exynos: dts: Remove unused pinctrl information to save space
In reply to Simon GlassWe don't include the pinctrl functions for U-Boot as they use up quite a bit of space and are not used.
We could instead perhaps eliminate this material with fdtgrep, but so far this tool has not made it to upstream.
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/dts/exynos4210-pinctrl.dtsi | 543 ------------------------------- arch/arm/dts/exynos4x12-pinctrl.dtsi | 612 ----------------------------------- arch/arm/dts/exynos4x12.dtsi | 100 ------ arch/arm/dts/exynos5250-pinctrl.dtsi | 459 -------------------------- arch/arm/dts/exynos5420-pinctrl.dtsi | 384 ---------------------- 5 files changed, 2098 deletions(-)
arch/arm/dts/exynos4210-pinctrl.dtsi +0 -543
@@ -144,281 +144,6 @@ #interrupt-cells = <2>; }; - uart0_data: uart0-data { - samsung,pins = "gpa0-0", "gpa0-1"; - samsung,pin-function = <0x2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - uart0_fctl: uart0-fctl { - samsung,pins = "gpa0-2", "gpa0-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - uart1_data: uart1-data { - samsung,pins = "gpa0-4", "gpa0-5"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - uart1_fctl: uart1-fctl { - samsung,pins = "gpa0-6", "gpa0-7"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - i2c2_bus: i2c2-bus { - samsung,pins = "gpa0-6", "gpa0-7"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - uart2_data: uart2-data { - samsung,pins = "gpa1-0", "gpa1-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - uart2_fctl: uart2-fctl { - samsung,pins = "gpa1-2", "gpa1-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - uart_audio_a: uart-audio-a { - samsung,pins = "gpa1-0", "gpa1-1"; - samsung,pin-function = <4>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - i2c3_bus: i2c3-bus { - samsung,pins = "gpa1-2", "gpa1-3"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - uart3_data: uart3-data { - samsung,pins = "gpa1-4", "gpa1-5"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - uart_audio_b: uart-audio-b { - samsung,pins = "gpa1-4", "gpa1-5"; - samsung,pin-function = <4>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - spi0_bus: spi0-bus { - samsung,pins = "gpb-0", "gpb-2", "gpb-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - i2c4_bus: i2c4-bus { - samsung,pins = "gpb-2", "gpb-3"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - spi1_bus: spi1-bus { - samsung,pins = "gpb-4", "gpb-6", "gpb-7"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - i2c5_bus: i2c5-bus { - samsung,pins = "gpb-6", "gpb-7"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - i2s1_bus: i2s1-bus { - samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3", - "gpc0-4"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - pcm1_bus: pcm1-bus { - samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3", - "gpc0-4"; - samsung,pin-function = <3>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - ac97_bus: ac97-bus { - samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3", - "gpc0-4"; - samsung,pin-function = <4>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - i2s2_bus: i2s2-bus { - samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3", - "gpc1-4"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - pcm2_bus: pcm2-bus { - samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3", - "gpc1-4"; - samsung,pin-function = <3>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - spdif_bus: spdif-bus { - samsung,pins = "gpc1-0", "gpc1-1"; - samsung,pin-function = <4>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - i2c6_bus: i2c6-bus { - samsung,pins = "gpc1-3", "gpc1-4"; - samsung,pin-function = <4>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - spi2_bus: spi2-bus { - samsung,pins = "gpc1-1", "gpc1-2", "gpc1-3", "gpc1-4"; - samsung,pin-function = <5>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - i2c7_bus: i2c7-bus { - samsung,pins = "gpd0-2", "gpd0-3"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - i2c0_bus: i2c0-bus { - samsung,pins = "gpd1-0", "gpd1-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - i2c1_bus: i2c1-bus { - samsung,pins = "gpd1-2", "gpd1-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <0>; - }; - - pwm0_out: pwm0-out { - samsung,pins = "gpd0-0"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - pwm1_out: pwm1-out { - samsung,pins = "gpd0-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - pwm2_out: pwm2-out { - samsung,pins = "gpd0-2"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - pwm3_out: pwm3-out { - samsung,pins = "gpd0-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - lcd_ctrl: lcd-ctrl { - samsung,pins = "gpd0-0", "gpd0-1"; - samsung,pin-function = <3>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - lcd_sync: lcd-sync { - samsung,pins = "gpf0-0", "gpf0-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - lcd_en: lcd-en { - samsung,pins = "gpe3-4"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - lcd_clk: lcd-clk { - samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - lcd_data16: lcd-data-width16 { - samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2", - "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0", - "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7", - "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - lcd_data18: lcd-data-width18 { - samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1", - "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7", - "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3", - "gpf2-6", "gpf2-7", "gpf3-0", "gpf3-1", - "gpf3-2", "gpf3-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - lcd_data24: lcd-data-width24 { - samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7", - "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3", - "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7", - "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3", - "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7", - "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; }; pinctrl at 11000000 {
@@ -567,259 +292,6 @@ #interrupt-cells = <2>; }; - sd0_clk: sd0-clk { - samsung,pins = "gpk0-0"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd0_cmd: sd0-cmd { - samsung,pins = "gpk0-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd0_cd: sd0-cd { - samsung,pins = "gpk0-2"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd0_bus1: sd0-bus-width1 { - samsung,pins = "gpk0-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd0_bus4: sd0-bus-width4 { - samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd0_bus8: sd0-bus-width8 { - samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd4_clk: sd4-clk { - samsung,pins = "gpk0-0"; - samsung,pin-function = <3>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd4_cmd: sd4-cmd { - samsung,pins = "gpk0-1"; - samsung,pin-function = <3>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd4_cd: sd4-cd { - samsung,pins = "gpk0-2"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd4_bus1: sd4-bus-width1 { - samsung,pins = "gpk0-3"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd4_bus4: sd4-bus-width4 { - samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd4_bus8: sd4-bus-width8 { - samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; - samsung,pin-function = <3>; - samsung,pin-pud = <4>; - samsung,pin-drv = <3>; - }; - - sd1_clk: sd1-clk { - samsung,pins = "gpk1-0"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd1_cmd: sd1-cmd { - samsung,pins = "gpk1-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd1_cd: sd1-cd { - samsung,pins = "gpk1-2"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd1_bus1: sd1-bus-width1 { - samsung,pins = "gpk1-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd1_bus4: sd1-bus-width4 { - samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd2_clk: sd2-clk { - samsung,pins = "gpk2-0"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd2_cmd: sd2-cmd { - samsung,pins = "gpk2-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd2_cd: sd2-cd { - samsung,pins = "gpk2-2"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd2_bus1: sd2-bus-width1 { - samsung,pins = "gpk2-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd2_bus4: sd2-bus-width4 { - samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd2_bus8: sd2-bus-width8 { - samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6"; - samsung,pin-function = <3>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd3_clk: sd3-clk { - samsung,pins = "gpk3-0"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd3_cmd: sd3-cmd { - samsung,pins = "gpk3-1"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - sd3_cd: sd3-cd { - samsung,pins = "gpk3-2"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd3_bus1: sd3-bus-width1 { - samsung,pins = "gpk3-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - sd3_bus4: sd3-bus-width4 { - samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6"; - samsung,pin-function = <2>; - samsung,pin-pud = <3>; - samsung,pin-drv = <3>; - }; - - eint0: ext-int0 { - samsung,pins = "gpx0-0"; - samsung,pin-function = <0xf>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - eint8: ext-int8 { - samsung,pins = "gpx1-0"; - samsung,pin-function = <0xf>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - eint15: ext-int15 { - samsung,pins = "gpx1-7"; - samsung,pin-function = <0xf>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - eint16: ext-int16 { - samsung,pins = "gpx2-0"; - samsung,pin-function = <0xf>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - eint31: ext-int31 { - samsung,pins = "gpx3-7"; - samsung,pin-function = <0xf>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - cam_port_a_io: cam-port-a-io { - samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3", - "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7", - "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - cam_port_a_clk_active: cam-port-a-clk-active { - samsung,pins = "gpj1-3"; - samsung,pin-function = <2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <3>; - }; - - cam_port_a_clk_idle: cam-port-a-clk-idle { - samsung,pins = "gpj1-3"; - samsung,pin-function = <0>; - samsung,pin-pud = <1>; - samsung,pin-drv = <0>; - }; }; pinctrl at 03860000 {
@@ -828,20 +300,5 @@ #gpio-cells = <2>; }; - i2s0_bus: i2s0-bus { - samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3", - "gpz-4", "gpz-5", "gpz-6"; - samsung,pin-function = <0x2>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; - - pcm0_bus: pcm0-bus { - samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3", - "gpz-4"; - samsung,pin-function = <0x3>; - samsung,pin-pud = <0>; - samsung,pin-drv = <0>; - }; }; };
arch/arm/dts/exynos4x12-pinctrl.dtsi +0 -612
635 lines not on this page · raw message
arch/arm/dts/exynos4x12.dtsi +0 -100
112 lines not on this page · raw message
arch/arm/dts/exynos5250-pinctrl.dtsi +0 -459
482 lines not on this page · raw message
arch/arm/dts/exynos5420-pinctrl.dtsi +0 -384
413 lines not on this page · raw message
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
In reply to Simon GlassThe pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/dts/exynos4210-pinctrl.dtsi | 1 + arch/arm/dts/exynos4210.dtsi | 6 ++++++ arch/arm/dts/exynos4x12-pinctrl.dtsi | 6 ++++++ arch/arm/dts/exynos4x12.dtsi | 8 ++++++++ arch/arm/dts/exynos5250-pinctrl.dtsi | 4 ++++ arch/arm/dts/exynos5250.dtsi | 10 +++++++++- arch/arm/dts/exynos5420-pinctrl.dtsi | 13 +++++++++++++ arch/arm/dts/exynos5420.dtsi | 10 ++++++++++ arch/arm/dts/exynos54xx.dtsi | 10 ++++++++++ 9 files changed, 67 insertions(+), 1 deletion(-)
arch/arm/dts/exynos4210-pinctrl.dtsi +1 -0
@@ -220,6 +220,7 @@ }; gpy0: gpy0 { + reg = <0xc00>; gpio-controller; #gpio-cells = <2>; };
arch/arm/dts/exynos4210.dtsi +6 -0
@@ -82,12 +82,16 @@ }; pinctrl_0: pinctrl at 11400000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos4210-pinctrl"; reg = <0x11400000 0x1000>; interrupts = <0 47 0>; }; pinctrl_1: pinctrl at 11000000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos4210-pinctrl"; reg = <0x11000000 0x1000>; interrupts = <0 46 0>;
@@ -100,6 +104,8 @@ }; pinctrl_2: pinctrl at 03860000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos4210-pinctrl"; reg = <0x03860000 0x1000>; };
arch/arm/dts/exynos4x12-pinctrl.dtsi +6 -0
@@ -71,6 +71,7 @@ }; gpf0: gpf0 { + reg = <0xc180>; gpio-controller; #gpio-cells = <2>;
@@ -103,6 +104,7 @@ }; gpj0: gpj0 { + reg = <0x240>; gpio-controller; #gpio-cells = <2>;
@@ -120,6 +122,7 @@ }; pinctrl at 11000000 { + reg = <0x40>; gpk0: gpk0 { gpio-controller; #gpio-cells = <2>;
@@ -177,6 +180,7 @@ }; gpm0: gpm0 { + reg = <0x260>; gpio-controller; #gpio-cells = <2>;
@@ -217,6 +221,7 @@ }; gpy0: gpy0 { + reg = <0x120>; gpio-controller; #gpio-cells = <2>; };
@@ -252,6 +257,7 @@ }; gpx0: gpx0 { + reg = <0xc00>; gpio-controller; #gpio-cells = <2>;
arch/arm/dts/exynos4x12.dtsi +8 -0
@@ -61,12 +61,16 @@ }; pinctrl_0: pinctrl at 11400000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos4x12-pinctrl"; reg = <0x11400000 0x1000>; interrupts = <0 47 0>; }; pinctrl_1: pinctrl at 11000000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos4x12-pinctrl"; reg = <0x11000000 0x1000>; interrupts = <0 46 0>;
@@ -79,6 +83,8 @@ }; pinctrl_2: pinctrl at 03860000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos4x12-pinctrl"; reg = <0x03860000 0x1000>; interrupt-parent = <&combiner>;
@@ -86,6 +92,8 @@ }; pinctrl_3: pinctrl at 106E0000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos4x12-pinctrl"; reg = <0x106E0000 0x1000>; interrupts = <0 72 0>;
arch/arm/dts/exynos5250-pinctrl.dtsi +4 -0
@@ -154,6 +154,7 @@ }; gpc4: gpc4 { + reg = <0x2e0>; gpio-controller; #gpio-cells = <2>;
@@ -162,6 +163,7 @@ }; gpx0: gpx0 { + reg = <0xc00>; gpio-controller; #gpio-cells = <2>;
@@ -293,6 +295,7 @@ }; gpv2: gpv2 { + reg = <0x060>; gpio-controller; #gpio-cells = <2>;
@@ -309,6 +312,7 @@ }; gpv4: gpv4 { + reg = <0xc0>; gpio-controller; #gpio-cells = <2>;
arch/arm/dts/exynos5250.dtsi +9 -1
@@ -17,6 +17,8 @@ }; pinctrl_0: pinctrl at 11400000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5250-pinctrl"; reg = <0x11400000 0x1000>; interrupts = <0 46 0>;
@@ -29,18 +31,24 @@ }; pinctrl_1: pinctrl at 13400000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5250-pinctrl"; reg = <0x13400000 0x1000>; interrupts = <0 45 0>; }; pinctrl_2: pinctrl at 10d10000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5250-pinctrl"; reg = <0x10d10000 0x1000>; interrupts = <0 50 0>; }; pinctrl_3: pinctrl at 03860000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5250-pinctrl"; reg = <0x03860000 0x1000>; interrupts = <0 47 0>;
@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };
arch/arm/dts/exynos5420-pinctrl.dtsi +13 -0
@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */ + pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + }; + pinctrl at 13400000 { gpy7: gpy7 { gpio-controller;
@@ -23,6 +35,7 @@ }; gpx0: gpx0 { + reg = <0xc00>; gpio-controller; #gpio-cells = <2>;
arch/arm/dts/exynos5420.dtsi +10 -0
@@ -22,6 +22,8 @@ }; pinctrl_0: pinctrl at 13400000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x13400000 0x1000>; interrupts = <0 45 0>;
@@ -34,24 +36,32 @@ }; pinctrl_1: pinctrl at 13410000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x13410000 0x1000>; interrupts = <0 78 0>; }; pinctrl_2: pinctrl at 14000000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x14000000 0x1000>; interrupts = <0 46 0>; }; pinctrl_3: pinctrl at 14010000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x14010000 0x1000>; interrupts = <0 50 0>; }; pinctrl_4: pinctrl at 03860000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x03860000 0x1000>; interrupts = <0 47 0>;
arch/arm/dts/exynos54xx.dtsi +10 -0
@@ -132,6 +132,8 @@ }; pinctrl_0: pinctrl at 13400000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x13400000 0x1000>; interrupts = <0 45 0>;
@@ -144,24 +146,32 @@ }; pinctrl_1: pinctrl at 13410000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x13410000 0x1000>; interrupts = <0 78 0>; }; pinctrl_2: pinctrl at 14000000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x14000000 0x1000>; interrupts = <0 46 0>; }; pinctrl_3: pinctrl at 14010000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x14010000 0x1000>; interrupts = <0 50 0>; }; pinctrl_4: pinctrl at 03860000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "samsung,exynos5420-pinctrl"; reg = <0x03860000 0x1000>; interrupts = <0 47 0>;
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Quoted 5 lines · Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
So here's my fear..
[snip]
arch/arm/dts/exynos5250.dtsi line 63
Quoted 9 lines
arch/arm/dts/exynos5250.dtsi +1
-1@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };
Except for the above (what's going on? pulling in a typo fix from upstream?) they're legal "regular" non-U-Boot-prefixed changes. Are they going back into the master copy in Linux?
Quoted 9 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +1
-0@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */
arch/arm/dts/exynos5420-pinctrl.dtsi line 26
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +10
-0+ pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + };
So this isn't going to head back to Linux, clearly...
Is there some way we can contain our changes under includes perhaps?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140728/2f308976/attachment.pgp>
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Hi Tom,
Quoted 11 lines · Tom Rini
Quoted 5 lines · Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
So here's my fear..
[snip]
Quoted 13 lines
arch/arm/dts/exynos5250.dtsi line 63
Quoted 9 lines
arch/arm/dts/exynos5250.dtsi +1
-1@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };Except for the above (what's going on? pulling in a typo fix from upstream?) they're legal "regular" non-U-Boot-prefixed changes. Are they going back into the master copy in Linux?
Oops I missed this email. The typo is just my mistake - we don't need this change and the typo is in the previous patch.
Quoted 23 lines
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +1
-0@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */arch/arm/dts/exynos5420-pinctrl.dtsi line 26
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +10
-0+ pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + };So this isn't going to head back to Linux, clearly...
Quoted 1 line
Is there some way we can contain our changes under includes perhaps?
I hope that this one could go away, since the order of GPIOs doesn't ultimately matter. At present we assume a particular order due to the numbering of GPIOs. But once we move to named GPIOs in the device tree we can drop this ordering patch.
In general, yes we could create a new include file for the U-Boot device tree additions.
We might be able to send these up to the kernel as they are pretty harmless and do describe the hardware. Perhaps the kernel people will push back on the basis that they are unnecessary for the kernel. I'm not sure. What do you think?
Regards,
Simon
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Hi Tom,
Quoted 56 lines · Simon Glass
Hi Tom,
Quoted 11 lines · Tom Rini
Quoted 5 lines · Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
So here's my fear..
[snip]
Quoted 13 lines
arch/arm/dts/exynos5250.dtsi line 63
Quoted 9 lines
arch/arm/dts/exynos5250.dtsi +1
-1@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };Except for the above (what's going on? pulling in a typo fix from upstream?) they're legal "regular" non-U-Boot-prefixed changes. Are they going back into the master copy in Linux?
Oops I missed this email. The typo is just my mistake - we don't need this change and the typo is in the previous patch.
Quoted 23 lines
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +1
-0@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */arch/arm/dts/exynos5420-pinctrl.dtsi line 26
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +10
-0+ pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + };So this isn't going to head back to Linux, clearly...
Quoted 1 line
Is there some way we can contain our changes under includes perhaps?
Quoted 7 lines
I hope that this one could go away, since the order of GPIOs doesn't ultimately matter. At present we assume a particular order due to the numbering of GPIOs. But once we move to named GPIOs in the device tree we can drop this ordering patch.
In general, yes we could create a new include file for the U-Boot device tree additions.
Update: I took a look at the includes. I can create a new file, like arch/arm/dts/exynos4210-pinctrl.dtsi which I include from arch/arm/dts/exynos4210.dtsi. But I think I will still need to modify arch/arm/dts/exynos4210.dtsi. The alternative is to put the changes in something like exynos4210-u-boot.dtsi and include those in every board file that uses that include.
This needs to be done for each of the 4/5 SoCs.
Quoted 5 lines
We might be able to send these up to the kernel as they are pretty harmless and do describe the hardware. Perhaps the kernel people will push back on the basis that they are unnecessary for the kernel. I'm not sure. What do you think?
The good news is that I think my changes fit within the binding definition so they may be accepted eventually.
Regards,
Simon
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Quoted 67 lines · Simon Glass
Hi Tom,
Quoted 56 lines · Simon Glass
Hi Tom,
Quoted 11 lines · Tom Rini
Quoted 5 lines · Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
So here's my fear..
[snip]
Quoted 13 lines
arch/arm/dts/exynos5250.dtsi line 63
Quoted 9 lines
arch/arm/dts/exynos5250.dtsi +1
-1@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };Except for the above (what's going on? pulling in a typo fix from upstream?) they're legal "regular" non-U-Boot-prefixed changes. Are they going back into the master copy in Linux?
Oops I missed this email. The typo is just my mistake - we don't need this change and the typo is in the previous patch.
Quoted 23 lines
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +1
-0@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */arch/arm/dts/exynos5420-pinctrl.dtsi line 26
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +10
-0+ pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + };So this isn't going to head back to Linux, clearly...
Quoted 1 line
Is there some way we can contain our changes under includes perhaps?
Quoted 7 lines
I hope that this one could go away, since the order of GPIOs doesn't ultimately matter. At present we assume a particular order due to the numbering of GPIOs. But once we move to named GPIOs in the device tree we can drop this ordering patch.
In general, yes we could create a new include file for the U-Boot device tree additions.
Quoted 6 lines
Update: I took a look at the includes. I can create a new file, like
arch/arm/dts/exynos4210-pinctrl.dtsiwhich I include fromarch/arm/dts/exynos4210.dtsi. But I think I will still need to modifyarch/arm/dts/exynos4210.dtsi. The alternative is to put the changes in something likeexynos4210-u-boot.dtsiand include those in every board file that uses that include.
With arch/arm/dts/exynos4210-pinctrl.dtsi + arch/arm/dts/exynos4210.dtsi the modification to the later is just to include the former, right? I'm OK with that.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140804/70718a41/attachment.pgp>
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Hi Tom,
Quoted 75 lines · Tom Rini
Quoted 67 lines · Simon Glass
Hi Tom,
Quoted 56 lines · Simon Glass
Hi Tom,
Quoted 11 lines · Tom Rini
Quoted 5 lines · Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
So here's my fear..
[snip]
Quoted 13 lines
arch/arm/dts/exynos5250.dtsi line 63
Quoted 9 lines
arch/arm/dts/exynos5250.dtsi +1
-1@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };Except for the above (what's going on? pulling in a typo fix from upstream?) they're legal "regular" non-U-Boot-prefixed changes. Are they going back into the master copy in Linux?
Oops I missed this email. The typo is just my mistake - we don't need this change and the typo is in the previous patch.
Quoted 23 lines
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +1
-0@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */arch/arm/dts/exynos5420-pinctrl.dtsi line 26
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +10
-0+ pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + };So this isn't going to head back to Linux, clearly...
Quoted 1 line
Is there some way we can contain our changes under includes perhaps?
Quoted 7 lines
I hope that this one could go away, since the order of GPIOs doesn't ultimately matter. At present we assume a particular order due to the numbering of GPIOs. But once we move to named GPIOs in the device tree we can drop this ordering patch.
In general, yes we could create a new include file for the U-Boot device tree additions.
Quoted 6 lines
Update: I took a look at the includes. I can create a new file, like
arch/arm/dts/exynos4210-pinctrl.dtsiwhich I include fromarch/arm/dts/exynos4210.dtsi. But I think I will still need to modifyarch/arm/dts/exynos4210.dtsi. The alternative is to put the changes in something likeexynos4210-u-boot.dtsiand include those in every board file that uses that include.
Quoted 3 lines
With
arch/arm/dts/exynos4210-pinctrl.dtsi+arch/arm/dts/exynos4210.dtsithe modification to the later is just to include the former, right? I'm OK with that.
Almost, but we still need the #address-cells and #size-cells properties in the pinctrl nodes.
Regards,
Simon
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Quoted 78 lines · Simon Glass
Hi Tom,
Quoted 75 lines · Tom Rini
Quoted 73 lines · Simon Glass
Hi Tom,
Quoted 56 lines · Simon Glass
Hi Tom,
Quoted 11 lines · Tom Rini
Quoted 5 lines · Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
So here's my fear..
[snip]
Quoted 13 lines
arch/arm/dts/exynos5250.dtsi line 63
Quoted 9 lines
arch/arm/dts/exynos5250.dtsi +1
-1@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };Except for the above (what's going on? pulling in a typo fix from upstream?) they're legal "regular" non-U-Boot-prefixed changes. Are they going back into the master copy in Linux?
Oops I missed this email. The typo is just my mistake - we don't need this change and the typo is in the previous patch.
Quoted 23 lines
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +1
-0@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */arch/arm/dts/exynos5420-pinctrl.dtsi line 26
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +10
-0+ pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + };So this isn't going to head back to Linux, clearly...
Quoted 1 line
Is there some way we can contain our changes under includes perhaps?
Quoted 7 lines
I hope that this one could go away, since the order of GPIOs doesn't ultimately matter. At present we assume a particular order due to the numbering of GPIOs. But once we move to named GPIOs in the device tree we can drop this ordering patch.
In general, yes we could create a new include file for the U-Boot device tree additions.
Update: I took a look at the includes. I can create a new file, like
arch/arm/dts/exynos4210-pinctrl.dtsiwhich I include fromarch/arm/dts/exynos4210.dtsi. But I think I will still need to modifyarch/arm/dts/exynos4210.dtsi. The alternative is to put the changes in something likeexynos4210-u-boot.dtsiand include those in every board file that uses that include.
Quoted 6 lines
Quoted 3 lines
With
arch/arm/dts/exynos4210-pinctrl.dtsi+arch/arm/dts/exynos4210.dtsithe modification to the later is just to include the former, right? I'm OK with that.Almost, but we still need the #address-cells and #size-cells properties in the pinctrl nodes.
And these, as you said I think, are HW description things that should be included in the master DT file upstream, right?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140805/f3f74849/attachment.pgp>
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Hi Tom,
Quoted 83 lines · Tom Rini
Quoted 82 lines · Simon Glass
Hi Tom,
Quoted 78 lines · Tom Rini
Quoted 67 lines · Simon Glass
Hi Tom,
Quoted 56 lines · Simon Glass
Hi Tom,
Quoted 11 lines · Tom Rini
Quoted 5 lines · Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the hardware. It is possible in most cases to determine the register address of each, but not in all cases. By adding an additional property we can fix this, and avoid adding a table to U-Boot for every single Exynos SOC.
So here's my fear..
[snip]
Quoted 13 lines
Review line 63
Quoted 9 lines
(quoted diff) +1
-1@@ -49,7 +57,7 @@ i2c at 12ca0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "samsung,s3c2440-i27c"; + compatible = "samsung,s3c2440-i2c"; reg = <0x12CA0000 0x100>; interrupts = <0 60 0>; };Except for the above (what's going on? pulling in a typo fix from upstream?) they're legal "regular" non-U-Boot-prefixed changes. Are they going back into the master copy in Linux?
Oops I missed this email. The typo is just my mistake - we don't need this change and the typo is in the previous patch.
Quoted 23 lines
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +1
-0@@ -13,6 +13,18 @@ */ / { + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */arch/arm/dts/exynos5420-pinctrl.dtsi line 26
Quoted 10 lines
arch/arm/dts/exynos5420-pinctrl.dtsi +10
-0+ pinctrl at 14010000 { + }; + pinctrl at 13400000 { + }; + pinctrl at 13410000 { + }; + pinctrl at 14000000 { + }; + pinctrl at 03860000 { + };So this isn't going to head back to Linux, clearly...
Quoted 1 line
Is there some way we can contain our changes under includes perhaps?
Quoted 7 lines
I hope that this one could go away, since the order of GPIOs doesn't ultimately matter. At present we assume a particular order due to the numbering of GPIOs. But once we move to named GPIOs in the device tree we can drop this ordering patch.
In general, yes we could create a new include file for the U-Boot device tree additions.
Quoted 6 lines
Update: I took a look at the includes. I can create a new file, like
arch/arm/dts/exynos4210-pinctrl.dtsiwhich I include fromarch/arm/dts/exynos4210.dtsi. But I think I will still need to modifyarch/arm/dts/exynos4210.dtsi. The alternative is to put the changes in something likeexynos4210-u-boot.dtsiand include those in every board file that uses that include.With
arch/arm/dts/exynos4210-pinctrl.dtsi+arch/arm/dts/exynos4210.dtsithe modification to the later is just to include the former, right? I'm OK with that.
Quoted 5 lines
Quoted 2 lines
Almost, but we still need the #address-cells and #size-cells properties in the pinctrl nodes.
And these, as you said I think, are HW description things that should be included in the master DT file upstream, right?
Well we only need them because we are added 'reg' properties to the subnodes. There would certainly be no harm in including them upstream. The only bad thing I'm doing is the 'Replicate the ordering' bit. That should just go away once the GPIO numbering doesn't matter anymore (which requires that we use the device tree binding in GPIOs - this is the next step!).
Regards,
Simon
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Quoted 10 lines
Quoted 3 lines
And these, as you said I think, are HW description things that should be included in the master DT file upstream, right?
Well we only need them because we are added 'reg' properties to the subnodes. There would certainly be no harm in including them upstream. The only bad thing I'm doing is the 'Replicate the ordering' bit. That should just go away once the GPIO numbering doesn't matter anymore (which requires that we use the device tree binding in GPIOs - this is the next step!).
HI Simon,
I'm trying to understand what you are saying here. Specifically, is this your solution to the GPIO renumbering problem that I've droning on and on about?
jdl
PATCH v5 5/11 exynos: dts: Adjust device tree files for U-Boot
Hi Jon,
Quoted 12 lines · Jon Loeliger
Quoted 10 lines
Quoted 3 lines
And these, as you said I think, are HW description things that should be included in the master DT file upstream, right?
Well we only need them because we are added 'reg' properties to the subnodes. There would certainly be no harm in including them upstream. The only bad thing I'm doing is the 'Replicate the ordering' bit. That should just go away once the GPIO numbering doesn't matter anymore (which requires that we use the device tree binding in GPIOs - this is the next step!).
Quoted 5 lines
HI Simon,
I'm trying to understand what you are saying here. Specifically, is this your solution to the GPIO renumbering problem that I've droning on and on about?
No this is unrelated. The existing exynos4 code defines the GPIOs in a particular order, and the DT has them in a different order (and there are not aliases to change it). So it's really just a work-around until we can get away from having GPIO defines in exynos.
Regards,
Simon
PATCH v5 6/11 exynos: Tidy up GPIO headers
In reply to Simon GlassThe wrong header is being included, thus requiring the code to re-declare the generic GPIO interface in each GPIO header.
Fix this.
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/cpu/armv7/exynos/pinmux.c | 2 +- arch/arm/include/asm/arch-exynos/gpio.h | 5 ----- arch/arm/include/asm/arch-s5pc1xx/gpio.h | 4 ---- board/samsung/arndale/arndale.c | 2 +- board/samsung/common/board.c | 2 +- board/samsung/common/misc.c | 1 - board/samsung/goni/goni.c | 2 +- board/samsung/origen/origen.c | 2 +- board/samsung/smdk5420/smdk5420.c | 2 +- board/samsung/smdkc100/smdkc100.c | 2 +- board/samsung/smdkv310/smdkv310.c | 2 +- board/samsung/trats/trats.c | 2 +- board/samsung/trats2/trats2.c | 1 + board/samsung/universal_c210/universal.c | 1 - drivers/gpio/s5p_gpio.c | 3 +-- 15 files changed, 11 insertions(+), 22 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +1 -1
@@ -7,7 +7,7 @@#include <common.h> #include <fdtdec.h> -#include <asm/arch/gpio.h> +#include <asm/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch/sromc.h>
arch/arm/include/asm/arch-exynos/gpio.h +0 -5
@@ -1504,12 +1504,7 @@ static const struct gpio_name_num_table exynos5420_gpio_table[] = {void gpio_cfg_pin (int gpio,int cfg);void gpio_set_pull (int gpio,int mode);void gpio_set_drv (int gpio,int mode); -int gpio_direction_input (unsigned gpio); -int gpio_direction_output (unsigned gpio,int value); -int gpio_set_value (unsigned gpio,int value); -int gpio_get_value (unsigned gpio);void gpio_set_rate (int gpio,int mode); -struct s5p_gpio_bank *s5p_gpio_get_bank (unsigned gpio);int s5p_gpio_get_pin (unsigned gpio);#endif
arch/arm/include/asm/arch-s5pc1xx/gpio.h +0 -4
@@ -815,11 +815,7 @@ static const struct gpio_name_num_table s5pc110_gpio_table[] = {void gpio_cfg_pin (int gpio,int cfg);void gpio_set_pull (int gpio,int mode);void gpio_set_drv (int gpio,int mode); -int gpio_direction_output (unsigned gpio,int value); -int gpio_set_value (unsigned gpio,int value); -int gpio_get_value (unsigned gpio);void gpio_set_rate (int gpio,int mode); -struct s5p_gpio_bank *s5p_gpio_get_bank (unsigned gpio);int s5p_gpio_get_pin (unsigned gpio);/* GPIO pins per bank */
board/samsung/arndale/arndale.c +1 -1
@@ -6,9 +6,9 @@#include <common.h> #include <usb.h> +#include <asm/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch/dwmmc.h> -#include <asm/arch/gpio.h> #include <asm/arch/power.h> DECLARE_GLOBAL_DATA_PTR ;
board/samsung/common/board.c +1 -1
@@ -13,10 +13,10 @@#include <tmu.h> #include <netdev.h> #include <asm/io.h> +#include <asm/gpio.h> #include <asm/arch/board.h> #include <asm/arch/cpu.h> #include <asm/arch/dwmmc.h> -#include <asm/arch/gpio.h> #include <asm/arch/mmc.h> #include <asm/arch/pinmux.h> #include <asm/arch/power.h>
board/samsung/common/misc.c +0 -1
@@ -13,7 +13,6 @@#include <version.h> #include <linux/sizes.h> #include <asm/arch/cpu.h> -#include <asm/arch/gpio.h> #include <asm/gpio.h> #include <linux/input.h> #include <power/pmic.h>
board/samsung/goni/goni.c +1 -1
@@ -7,7 +7,7 @@*/ #include <common.h> -#include <asm/arch/gpio.h> +#include <asm/gpio.h> #include <asm/arch/mmc.h> #include <power/pmic.h> #include <usb/s3c_udc.h>
board/samsung/origen/origen.c +1 -1
@@ -6,8 +6,8 @@#include <common.h> #include <asm/io.h> +#include <asm/gpio.h> #include <asm/arch/cpu.h> -#include <asm/arch/gpio.h> #include <asm/arch/mmc.h> #include <asm/arch/periph.h> #include <asm/arch/pinmux.h>
board/samsung/smdk5420/smdk5420.c +1 -1
@@ -11,9 +11,9 @@#include <lcd.h> #include <spi.h> #include <errno.h> +#include <asm/gpio.h> #include <asm/arch/board.h> #include <asm/arch/cpu.h> -#include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch/system.h> #include <asm/arch/dp_info.h>
board/samsung/smdkc100/smdkc100.c +1 -1
@@ -7,9 +7,9 @@*/ #include <common.h> +#include <asm/gpio.h> #include <asm/io.h> #include <asm/arch/sromc.h> -#include <asm/arch/gpio.h> #include <netdev.h> DECLARE_GLOBAL_DATA_PTR ;
board/samsung/smdkv310/smdkv310.c +1 -1
@@ -5,10 +5,10 @@*/ #include <common.h> +#include <asm/gpio.h> #include <asm/io.h> #include <netdev.h> #include <asm/arch/cpu.h> -#include <asm/arch/gpio.h> #include <asm/arch/mmc.h> #include <asm/arch/periph.h> #include <asm/arch/pinmux.h>
board/samsung/trats/trats.c +1 -1
@@ -10,8 +10,8 @@#include <common.h> #include <lcd.h> #include <asm/io.h> +#include <asm/gpio.h> #include <asm/arch/cpu.h> -#include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch/clock.h> #include <asm/arch/mipi_dsim.h>
board/samsung/trats2/trats2.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <lcd.h> +#include <asm/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch/power.h> #include <asm/arch/mipi_dsim.h>
board/samsung/universal_c210/universal.c +0 -1
@@ -12,7 +12,6 @@#include <asm/io.h> #include <asm/gpio.h> #include <asm/arch/adc.h> -#include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch/watchdog.h> #include <ld9040.h>
drivers/gpio/s5p_gpio.c +1 -2
@@ -8,7 +8,6 @@#include <common.h> #include <asm/io.h> #include <asm/gpio.h> -#include <asm/arch/gpio.h> #define S5P_GPIO_GET_PIN (x) (x % GPIO_PER_BANK)
@@ -222,7 +221,7 @@ static void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode)writel (value, &bank->drv); } -struct s5p_gpio_bank *s5p_gpio_get_bank (unsigned int gpio) +static struct s5p_gpio_bank *s5p_gpio_get_bank (unsigned int gpio) {const struct gpio_info *data;unsigned int upto;
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 7/11 exynos: Tidy up GPIO defines
In reply to Simon GlassThe defines at the top of the GPIO driver use single-character names for parameters which are not very descriptive.
Improve these to use descriptive parameter names.
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
drivers/gpio/s5p_gpio.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/gpio/s5p_gpio.c +11 -10
@@ -11,19 +11,20 @@#define S5P_GPIO_GET_PIN (x) (x % GPIO_PER_BANK) -#define CON_MASK (x) (0xf << ((x) << 2)) -#define CON_SFR (x, v) ((v) << ((x) << 2)) +#define CON_MASK (val) (0xf << ((val) << 2)) +#define CON_SFR (gpio, cfg) ((cfg) << ((gpio) << 2)) +#define CON_SFR_UNSHIFT (val, gpio) ((val) >> ((gpio) << 2)) -#define DAT_MASK (x) (0x1 << (x)) -#define DAT_SET (x) (0x1 << (x)) +#define DAT_MASK (gpio) (0x1 << (gpio)) +#define DAT_SET (gpio) (0x1 << (gpio)) -#define PULL_MASK (x) (0x3 << ((x) << 1)) -#define PULL_MODE (x, v) ((v) << ((x) << 1)) +#define PULL_MASK (gpio) (0x3 << ((gpio) << 1)) +#define PULL_MODE (gpio, pull) ((pull) << ((gpio) << 1)) -#define DRV_MASK (x) (0x3 << ((x) << 1)) -#define DRV_SET (x, m) ((m) << ((x) << 1)) -#define RATE_MASK (x) (0x1 << (x + 16)) -#define RATE_SET (x) (0x1 << (x + 16)) +#define DRV_MASK (gpio) (0x3 << ((gpio) << 1)) +#define DRV_SET (gpio, mode) ((mode) << ((gpio) << 1)) +#define RATE_MASK (gpio) (0x1 << (gpio + 16)) +#define RATE_SET (gpio) (0x1 << (gpio + 16))#define name_to_gpio (n) s5p_name_to_gpio(n)static inline int s5p_name_to_gpio (const char *name)
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 8/11 exynos: Make sure that GPIOs are requested
In reply to Simon GlassWith driver model GPIOs must be requested before use. Make sure this is done correctly.
(Note that the soft SPI part of universal is omitted, since this driver is about to be replaced with a driver-model-aware version)
---
Changes in v5:
- Add additional gpio_request() calls for other samsung boards
- Use a mask instead of division in gpio_request() naming call
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/cpu/armv7/exynos/pinmux.c | 3 +++ board/samsung/arndale/arndale.c | 2 ++ board/samsung/common/misc.c | 2 ++ board/samsung/goni/goni.c | 2 ++ board/samsung/smdk5250/exynos5-dt.c | 7 +++++++ board/samsung/smdk5420/smdk5420.c | 4 ++++ board/samsung/trats/trats.c | 15 ++++++++++++--- board/samsung/trats2/trats2.c | 26 +++++++++++++++++++++----- board/samsung/universal_c210/universal.c | 3 +++ drivers/mmc/s5p_sdhci.c | 7 ++++++- 10 files changed, 62 insertions(+), 9 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +3 -0
@@ -172,6 +172,9 @@ static int exynos5420_mmc_config(int peripheral, int flags)* this same assumption. */ if ((peripheral ==PERIPH_ID_SDMMC0 ) && (i == (start +2 ))) { +#ifndef CONFIG_SPL_BUILD +gpio_request (i,"sdmmc0_vdden" ); +#endif gpio_set_value (i,1 );gpio_cfg_pin (i,S5P_GPIO_OUTPUT ); }else {
board/samsung/arndale/arndale.c +2 -0
@@ -19,6 +19,8 @@ int board_usb_init(int index, enum usb_init_type init)/* Configure gpios for usb 3503 hub: * disconnect, toggle reset and connect */ +gpio_request (EXYNOS5_GPIO_D17 ,"usb_connect" ); +gpio_request (EXYNOS5_GPIO_X35 ,"usb_reset" );gpio_direction_output (EXYNOS5_GPIO_D17 ,0 );gpio_direction_output (EXYNOS5_GPIO_X35 ,0 );
board/samsung/common/misc.c +2 -0
@@ -362,6 +362,8 @@ void check_boot_mode(void)void keys_init (void ) {/* Set direction to input */ +gpio_request (KEY_VOL_UP_GPIO ,"volume-up" ); +gpio_request (KEY_VOL_DOWN_GPIO ,"volume-down" );gpio_direction_input (KEY_VOL_UP_GPIO );gpio_direction_input (KEY_VOL_DOWN_GPIO ); }
board/samsung/goni/goni.c +2 -0
@@ -80,6 +80,7 @@ int board_mmc_init(bd_t *bis)int i, ret, ret_sd =0 ;/* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */ +gpio_request (S5PC110_GPIO_J27 ,"massmemory_en" );gpio_direction_output (S5PC110_GPIO_J27 ,1 );/*
@@ -108,6 +109,7 @@ int board_mmc_init(bd_t *bis)* SD card (T_FLASH) detect and init * T_FLASH_DETECT: EINT28: GPH3[4] input mode */ +gpio_request (S5PC110_GPIO_H34 ,"t_flash_detect" );gpio_cfg_pin (S5PC110_GPIO_H34 ,S5P_GPIO_INPUT );gpio_set_pull (S5PC110_GPIO_H34 ,S5P_GPIO_PULL_UP );
board/samsung/smdk5250/exynos5-dt.c +7 -0
@@ -29,6 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;static void board_enable_audio_codec (void ) {/* Enable MAX98095 Codec */ +gpio_request (EXYNOS5_GPIO_X17 ,"max98095_enable" );gpio_direction_output (EXYNOS5_GPIO_X17 ,1 );gpio_set_pull (EXYNOS5_GPIO_X17 ,S5P_GPIO_PULL_NONE ); }
@@ -199,16 +200,19 @@ static int board_dp_bridge_setup(void)/* Setup the GPIOs */ /* PD is ACTIVE_LOW, and initially de-asserted */ +gpio_request (EXYNOS5_GPIO_Y25 ,"dp_bridge_pd" );gpio_set_pull (EXYNOS5_GPIO_Y25 ,S5P_GPIO_PULL_NONE );gpio_direction_output (EXYNOS5_GPIO_Y25 ,1 );/* Reset is ACTIVE_LOW */ +gpio_request (EXYNOS5_GPIO_X15 ,"dp_bridge_reset" );gpio_set_pull (EXYNOS5_GPIO_X15 ,S5P_GPIO_PULL_NONE );gpio_direction_output (EXYNOS5_GPIO_X15 ,0 );udelay (10 );gpio_set_value (EXYNOS5_GPIO_X15 ,1 ); +gpio_request (EXYNOS5_GPIO_X07 ,"dp_bridge_hpd" );gpio_direction_input (EXYNOS5_GPIO_X07 );/*
@@ -236,10 +240,12 @@ static int board_dp_bridge_setup(void)void exynos_cfg_lcd_gpio (void ) {/* For Backlight */ +gpio_request (EXYNOS5_GPIO_B20 ,"lcd_backlight" );gpio_cfg_pin (EXYNOS5_GPIO_B20 ,S5P_GPIO_OUTPUT );gpio_set_value (EXYNOS5_GPIO_B20 ,1 );/* LCD power on */ +gpio_request (EXYNOS5_GPIO_X15 ,"lcd_power" );gpio_cfg_pin (EXYNOS5_GPIO_X15 ,S5P_GPIO_OUTPUT );gpio_set_value (EXYNOS5_GPIO_X15 ,1 );
@@ -276,6 +282,7 @@ void exynos_backlight_on(unsigned int on)mdelay (10 );/* board_dp_backlight_en */ +gpio_request (EXYNOS5_GPIO_X30 ,"board_dp_backlight_en" );gpio_direction_output (EXYNOS5_GPIO_X30 ,1 );#endif }
board/samsung/smdk5420/smdk5420.c +4 -0
@@ -74,9 +74,12 @@ void exynos_lcd_power_on(void)mdelay (5 );/* TODO(ajaykumar.rs at samsung.com): Use device tree */ +gpio_request (EXYNOS5420_GPIO_X35 ,"edp_slp#" );gpio_direction_output (EXYNOS5420_GPIO_X35 ,1 );/* EDP_SLP# */ mdelay (10 ); +gpio_request (EXYNOS5420_GPIO_Y77 ,"edp_rst#" );gpio_direction_output (EXYNOS5420_GPIO_Y77 ,1 );/* EDP_RST# */ +gpio_request (EXYNOS5420_GPIO_X26 ,"edp_hpd" );gpio_direction_input (EXYNOS5420_GPIO_X26 );/* EDP_HPD */ gpio_set_pull (EXYNOS5420_GPIO_X26 ,S5P_GPIO_PULL_NONE );
@@ -88,6 +91,7 @@ void exynos_lcd_power_on(void)void exynos_backlight_on (unsigned int onoff) {/* For PWM */ +gpio_request (EXYNOS5420_GPIO_B20 ,"backlight_on" );gpio_cfg_pin (EXYNOS5420_GPIO_B20 ,S5P_GPIO_FUNC (0x1 ));gpio_set_value (EXYNOS5420_GPIO_B20 ,1 );
board/samsung/trats/trats.c +12 -3
@@ -63,6 +63,8 @@ void i2c_init_board(void) }/* I2C_8 -> FG */ +gpio_request (EXYNOS4_GPIO_Y40 ,"i2c_clk" ); +gpio_request (EXYNOS4_GPIO_Y41 ,"i2c_data" );gpio_direction_output (EXYNOS4_GPIO_Y40 ,1 );gpio_direction_output (EXYNOS4_GPIO_Y41 ,1 ); }
@@ -346,12 +348,17 @@ int exynos_power_init(void)static unsigned int get_hw_revision (void ) {int hwrev =0 ; +char str[10 ];int i;/* hw_rev[3:0] == GPE1[3:0] */ -for (i =EXYNOS4_GPIO_E10 ; i <EXYNOS4_GPIO_E14 ; i++) { -gpio_cfg_pin (i,S5P_GPIO_INPUT ); -gpio_set_pull (i,S5P_GPIO_PULL_NONE ); +for (i =0 ; i <4 ; i++) { +int pin = i +EXYNOS4_GPIO_E10 ; + +sprintf (str,"hw_rev%d" , i); +gpio_request (pin, str); +gpio_cfg_pin (pin,S5P_GPIO_INPUT ); +gpio_set_pull (pin,S5P_GPIO_PULL_NONE ); }udelay (1 );
@@ -517,6 +524,7 @@ static void board_power_init(void)static void exynos_uart_init (void ) {/* UART_SEL GPY4[7] (part2)@EXYNOS4 */ +gpio_request (EXYNOS4_GPIO_Y47 ,"uart_sel" );gpio_set_pull (EXYNOS4_GPIO_Y47 ,S5P_GPIO_PULL_UP );gpio_direction_output (EXYNOS4_GPIO_Y47 ,1 ); }
@@ -534,6 +542,7 @@ int exynos_early_init_f(void)void exynos_reset_lcd (void ) { +gpio_request (EXYNOS4_GPIO_Y45 ,"lcd_reset" );gpio_direction_output (EXYNOS4_GPIO_Y45 ,1 );udelay (10000 );gpio_direction_output (EXYNOS4_GPIO_Y45 ,0 );
board/samsung/trats2/trats2.c +21 -5
@@ -33,6 +33,7 @@ static inline u32 get_model_rev(void);static void check_hw_revision (void ) {int modelrev =0 ; +char str[12 ];int i;/*
@@ -41,13 +42,22 @@ static void check_hw_revision(void)* TRM say that it may cause unexcepted state and leakage current. * and pull-none is only for output function. */ -for (i =EXYNOS4X12_GPIO_M10 ; i <EXYNOS4X12_GPIO_M12 ; i++) -gpio_cfg_pin (i,S5P_GPIO_INPUT ); +for (i =0 ; i <2 ; i++) { +int pin = i +EXYNOS4X12_GPIO_M10 ; + +sprintf (str,"model_rev%d" , i); +gpio_request (pin, str); +gpio_cfg_pin (pin,S5P_GPIO_INPUT ); + }/* GPM1[5:2]: HW_REV[3:0] */ -for (i =EXYNOS4X12_GPIO_M12 ; i <EXYNOS4X12_GPIO_M16 ; i++) { -gpio_cfg_pin (i,S5P_GPIO_INPUT ); -gpio_set_pull (i,S5P_GPIO_PULL_NONE ); +for (i =0 ; i <4 ; i++) { +int pin = i +EXYNOS4X12_GPIO_M12 ; + +sprintf (str,"hw_rev%d" , i); +gpio_request (pin, str); +gpio_cfg_pin (pin,S5P_GPIO_INPUT ); +gpio_set_pull (pin,S5P_GPIO_PULL_NONE ); }/* GPM1[1:0]: MODEL_REV[1:0] */
@@ -103,10 +113,14 @@ static void board_init_i2c(void) }/* I2C_8 */ +gpio_request (EXYNOS4X12_GPIO_F14 ,"i2c8_clk" ); +gpio_request (EXYNOS4X12_GPIO_F15 ,"i2c8_data" );gpio_direction_output (EXYNOS4X12_GPIO_F14 ,1 );gpio_direction_output (EXYNOS4X12_GPIO_F15 ,1 );/* I2C_9 */ +gpio_request (EXYNOS4X12_GPIO_M21 ,"i2c9_clk" ); +gpio_request (EXYNOS4X12_GPIO_M20 ,"i2c9_data" );gpio_direction_output (EXYNOS4X12_GPIO_M21 ,1 );gpio_direction_output (EXYNOS4X12_GPIO_M20 ,1 ); }
@@ -388,6 +402,7 @@ void exynos_lcd_power_on(void)struct pmic *p =pmic_get ("MAX77686_PMIC" );/* LCD_2.2V_EN: GPC0[1] */ +gpio_request (EXYNOS4X12_GPIO_C01 ,"lcd_2v2_en" );gpio_set_pull (EXYNOS4X12_GPIO_C01 ,S5P_GPIO_PULL_UP );gpio_direction_output (EXYNOS4X12_GPIO_C01 ,1 );
@@ -400,6 +415,7 @@ void exynos_lcd_power_on(void)void exynos_reset_lcd (void ) {/* reset lcd */ +gpio_request (EXYNOS4X12_GPIO_F21 ,"lcd_reset" );gpio_direction_output (EXYNOS4X12_GPIO_F21 ,0 );udelay (10 );gpio_set_value (EXYNOS4X12_GPIO_F21 ,1 );
board/samsung/universal_c210/universal.c +3 -0
@@ -330,6 +330,7 @@ void exynos_cfg_lcd_gpio(void) }/* gpio pad configuration for LCD reset. */ +gpio_request (EXYNOS4_GPIO_Y45 ,"lcd_reset" );gpio_cfg_pin (EXYNOS4_GPIO_Y45 ,S5P_GPIO_OUTPUT );spi_init ();
@@ -386,6 +387,7 @@ int exynos_init(void)* you should set it HIGH since it removes the inverter */ /* MASSMEMORY_EN: XMDMDATA_6: GPE3[6] */ +gpio_request (EXYNOS4_GPIO_E36 ,"ldo_en" );gpio_direction_output (EXYNOS4_GPIO_E36 ,0 );break ;default :
@@ -394,6 +396,7 @@ int exynos_init(void)* But set it as HIGH to ensure */ /* MASSMEMORY_EN: XMDMADDR_3: GPE1[3] */ +gpio_request (EXYNOS4_GPIO_E13 ,"massmemory_en" );gpio_direction_output (EXYNOS4_GPIO_E13 ,1 );break ; }
drivers/mmc/s5p_sdhci.c +6 -1
@@ -102,6 +102,7 @@ struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];static int do_sdhci_init (struct sdhci_host *host) { +char str[20 ];int dev_id, flag;int err =0 ;
@@ -109,6 +110,8 @@ static int do_sdhci_init(struct sdhci_host *host) dev_id = host->index +PERIPH_ID_SDMMC0 ;if (fdt_gpio_isvalid (&host->pwr_gpio)) { +sprintf (str,"sdhci%d_power" , host->index &0xf ); +gpio_request (host->pwr_gpio.gpio, str);gpio_direction_output (host->pwr_gpio.gpio,1 ); err =exynos_pinmux_config (dev_id, flag);if (err) {
@@ -118,7 +121,9 @@ static int do_sdhci_init(struct sdhci_host *host) }if (fdt_gpio_isvalid (&host->cd_gpio)) { -gpio_direction_output (host->cd_gpio.gpio,0xf ); +sprintf (str,"sdhci%d_cd" , host->index &0xf ); +gpio_request (host->cd_gpio.gpio, str); +gpio_direction_output (host->cd_gpio.gpio,1 );if (gpio_get_value (host->cd_gpio.gpio))return -ENODEV ;
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 9/11 dm: gpio: Enhance gpio command to show only active GPIOs
In reply to Simon GlassThe GPIO list is very long in many cases and most of them are not used. By default, show only the GPIOs that are in use, and provide a flag to show all of them. This makes the 'gpio status' command much more pleasant.
In order to do this, driver model now exposes a method for obtaining the 'function' of a GPIO, which describes whether it is an input or output, for example. Implementation of this method is optional.
---
Changes in v5: None
Changes in v4:
- Add new patch to enhance 'gpio' command
Changes in v3: None
Changes in v2: None
common/cmd_gpio.c | 101 +++++++++++++++++++++++++++++++-------------- include/asm-generic/gpio.h | 15 ++++++- 2 files changed, 82 insertions(+), 34 deletions(-)
common/cmd_gpio.c +69 -32
@@ -24,18 +24,46 @@ enum gpio_cmd { };#if defined(CONFIG_DM_GPIO ) && !defined(gpio_status) -static const char *const gpio_function[] = { +static const char *const gpio_function[GPIOF_COUNT ] = {"input" ,"output" , +"unused" ,"unknown" , +"func" , }; -static void show_gpio (struct udevice *dev,const char *bank_name,int offset) +/* A few flags used by show_gpio() */ +enum { +FLAG_SHOW_ALL =1 <<0 , +FLAG_SHOW_BANK =1 <<1 , +FLAG_SHOW_NEWLINE =1 <<2 , +}; + +static void show_gpio (struct udevice *dev,const char *bank_name,int offset, +int *flagsp) {struct dm_gpio_ops *ops =gpio_get_ops (dev); +int func =GPIOF_UNKNOWN ;char buf[80 ];int ret; +BUILD_BUG_ON (GPIOF_COUNT !=ARRAY_SIZE (gpio_function)); + +if (ops->get_function) { + ret = ops->get_function (dev, offset); +if (ret >=0 && ret <ARRAY_SIZE (gpio_function)) + func = ret; + } +if (!(*flagsp &FLAG_SHOW_ALL ) && func ==GPIOF_UNUSED ) +return ; +if ((*flagsp &FLAG_SHOW_BANK ) && bank_name) { +if (*flagsp &FLAG_SHOW_NEWLINE ) { +putc ('\n' ); + *flagsp &= ~FLAG_SHOW_NEWLINE ; + } +printf ("Bank %s:\n" , bank_name); + *flagsp &= ~FLAG_SHOW_BANK ; + } *buf ='\0' ;if (ops->get_state) { ret = ops->get_state (dev, offset, buf,sizeof (buf));
@@ -44,14 +72,6 @@ static void show_gpio(struct udevice *dev, const char *bank_name, int offset)return ; } }else { -int func =GPIOF_UNKNOWN ; -int ret; - -if (ops->get_function) { - ret = ops->get_function (dev, offset); -if (ret >=0 && ret <ARRAY_SIZE (gpio_function)) - func = ret; - }sprintf (buf,"%s%u: %8s %d" , bank_name, offset, gpio_function[func], ops->get_value (dev, offset)); }
@@ -60,12 +80,14 @@ static void show_gpio(struct udevice *dev, const char *bank_name, int offset)puts ("\n" ); } -static int do_gpio_status (const char *gpio_name) +static int do_gpio_status (bool all,const char *gpio_name) {struct udevice *dev; -int newline =0 ; +int banklen; +int flags;int ret; + flags =0 ;if (gpio_name && !*gpio_name) gpio_name =NULL ; for (ret = uclass_first_device(UCLASS_GPIO, &dev);
@@ -74,28 +96,33 @@ static int do_gpio_status(const char *gpio_name)const char *bank_name;int num_bits; + flags |=FLAG_SHOW_BANK ; +if (all) + flags |=FLAG_SHOW_ALL ; bank_name =gpio_get_bank_info (dev, &num_bits); +if (!num_bits) +continue ; + banklen = bank_name ?strlen (bank_name) :0 ;if (!gpio_name || !bank_name || - !strncmp (gpio_name, bank_name,strlen (bank_name))) { + !strncmp (gpio_name, bank_name, banklen)) {const char *p =NULL ;int offset; -if (bank_name) { -if (newline) -putc ('\n' ); -printf ("Bank %s:\n" , bank_name); - } - newline =1 ; -if (gpio_name && bank_name) { - p = gpio_name +strlen (bank_name); + p = gpio_name + banklen; +if (gpio_name && *p) { offset =simple_strtoul (p,NULL ,10 ); -show_gpio (dev, bank_name, offset); +show_gpio (dev, bank_name, offset, &flags); }else { -for (offset =0 ; offset < num_bits; offset++) -show_gpio (dev, bank_name, offset); +for (offset =0 ; offset < num_bits; offset++) { +show_gpio (dev, bank_name, offset, + &flags); + } } } +/* Add a newline between bank names */ +if (!(flags &FLAG_SHOW_BANK )) + flags |=FLAG_SHOW_NEWLINE ; }return ret;
@@ -109,6 +136,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])ulong value;const char *str_cmd, *str_gpio =NULL ;#ifdef CONFIG_DM_GPIO +bool all = false;int ret;#endif
@@ -116,15 +144,24 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) show_usage:return CMD_RET_USAGE ; str_cmd = argv[1 ]; -if (argc >2 ) - str_gpio = argv[2 ]; + argc -=2 ; + argv +=2 ; +#ifdef CONFIG_DM_GPIO +if (argc >0 && !strcmp (*argv,"-a" )) { + all = true; + argc--; + argv++; + } +#endif +if (argc >0 ) + str_gpio = *argv;if (!strcmp (str_cmd,"status" )) {/* Support deprecated gpio_status() */ #ifdef gpio_statusgpio_status ();return 0 ;#elif defined(CONFIG_DM_GPIO ) -return cmd_process_error (cmdtp,do_gpio_status (str_gpio)); +return cmd_process_error (cmdtp,do_gpio_status (all, str_gpio));#else goto show_usage;#endif
@@ -186,8 +223,8 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])return value; } -U_BOOT_CMD (gpio,3 ,0 , do_gpio, -"query and control gpio pins" , -"<input|set|clear|toggle> <pin>\n" -" - input/set/clear/toggle the specified pin\n" -"gpio status [<bank> | <pin>]" ); +U_BOOT_CMD (gpio,4 ,0 , do_gpio, +"query and control gpio pins" , +"<input|set|clear|toggle> <pin>\n" +" - input/set/clear/toggle the specified pin\n" +"gpio status [-a] [<bank> | <pin>] - show [all/claimed] GPIOs" );
include/asm-generic/gpio.h +13 -2
@@ -79,11 +79,15 @@ int gpio_get_value(unsigned gpio);*/ int gpio_set_value (unsigned gpio,int value); -/* State of a GPIO, as reported by get_state() */ +/* State of a GPIO, as reported by get_function() */ enum {GPIOF_INPUT =0 ,GPIOF_OUTPUT , -GPIOF_UNKNOWN , +GPIOF_UNUSED ,/* Not claimed */ +GPIOF_UNKNOWN ,/* Not known */ +GPIOF_FUNC ,/* Not used as a GPIO */ + +GPIOF_COUNT , };struct udevice ;
@@ -123,6 +127,13 @@ struct dm_gpio_ops { int value);int (*get_value)(struct udevice *dev,unsigned offset);int (*set_value)(struct udevice *dev,unsigned offset,int value); +/** +* get_function() Get the GPIO function +* +* @dev: Device to check +* @offset: GPIO offset within that device +* @return current function - GPIOF_... +*/ int (*get_function)(struct udevice *dev,unsigned offset);int (*get_state)(struct udevice *dev,unsigned offset,char *state,int maxlen);
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 10/11 exynos: gpio: Convert to driver model
In reply to Simon GlassConvert the exynos GPIO driver to driver model. This implements the generic GPIO interface but not the extra Exynos-specific functions.
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
drivers/gpio/s5p_gpio.c | 419 +++++++++++++++++++++++++++------------- include/configs/exynos-common.h | 4 + 2 files changed, 287 insertions(+), 136 deletions(-)
drivers/gpio/s5p_gpio.c +283 -136
@@ -6,8 +6,15 @@*/ #include <common.h> +#include <dm.h> +#include <errno.h> +#include <fdtdec.h> +#include <malloc.h> #include <asm/io.h> #include <asm/gpio.h> +#include <dm/device-internal.h> + +DECLARE_GLOBAL_DATA_PTR ;#define S5P_GPIO_GET_PIN (x) (x % GPIO_PER_BANK)
@@ -26,101 +33,19 @@#define RATE_MASK (gpio) (0x1 << (gpio + 16))#define RATE_SET (gpio) (0x1 << (gpio + 16)) -#define name_to_gpio (n) s5p_name_to_gpio(n) -static inline int s5p_name_to_gpio (const char *name) -{ -unsigned num, irregular_set_number, irregular_bank_base; -const struct gpio_name_num_table *tabp; -char this_bank, bank_name, irregular_bank_name; -char *endp; - -/* -* The gpio name starts with either 'g' or 'gp' followed by the bank -* name character. Skip one or two characters depending on the prefix. -*/ -if (name[0 ] =='g' && name[1 ] =='p' ) - name +=2 ; -else if (name[0 ] =='g' ) - name++; -else -return -1 ;/* Name must start with 'g' */ - - bank_name = *name++; -if (!*name) -return -1 ;/* At least one digit is required/expected. */ - -/* -* On both exynos5 and exynos5420 architectures there is a bank of -* GPIOs which does not fall into the regular address pattern. Those -* banks are c4 on Exynos5 and y7 on Exynos5420. The rest of the below -* assignments help to handle these irregularities. -*/ -#if defined(CONFIG_EXYNOS4 ) || defined(CONFIG_EXYNOS5 ) -if (cpu_is_exynos5 ()) { -if (proid_is_exynos5420 ()) { - tabp = exynos5420_gpio_table; - irregular_bank_name ='y' ; - irregular_set_number ='7' ; - irregular_bank_base =EXYNOS5420_GPIO_Y70 ; - }else { - tabp = exynos5_gpio_table; - irregular_bank_name ='c' ; - irregular_set_number ='4' ; - irregular_bank_base =EXYNOS5_GPIO_C40 ; - } - }else { -if (proid_is_exynos4412 ()) - tabp = exynos4x12_gpio_table; -else - tabp = exynos4_gpio_table; - irregular_bank_name =0 ; - irregular_set_number =0 ; - irregular_bank_base =0 ; - } -#else -if (cpu_is_s5pc110 ()) - tabp = s5pc110_gpio_table; -else - tabp = s5pc100_gpio_table; - irregular_bank_name =0 ; - irregular_set_number =0 ; - irregular_bank_base =0 ; -#endif +#define GPIO_NAME_SIZE 20 - this_bank = tabp->bank; -do { -if (bank_name == this_bank) { -unsigned pin_index;/* pin number within the bank */ -if ((bank_name == irregular_bank_name) && - (name[0 ] == irregular_set_number)) { - pin_index = name[1 ] -'0' ; -/* Irregular sets have 8 pins. */ -if (pin_index >=GPIO_PER_BANK ) -return -1 ; - num = irregular_bank_base + pin_index; - }else { - pin_index =simple_strtoul (name, &endp,8 ); - pin_index -= tabp->bank_offset; -/* -* Sanity check: bunk 'z' has no set number, -* for all other banks there must be exactly -* two octal digits, and the resulting number -* should not exceed the number of pins in the -* bank. -*/ -if (((bank_name !='z' ) && !name[1 ]) || - *endp || - (pin_index >= tabp->bank_size)) -return -1 ; - num = tabp->base + pin_index; - } -return num; - } - this_bank = (++tabp)->bank; - }while (this_bank); +/* Platform data for each bank */ +struct exynos_gpio_platdata { +struct s5p_gpio_bank *bank; +const char *bank_name;/* Name of port, e.g. 'gpa0" */ +}; -return -1 ; -} +/* Information about each bank at run-time */ +struct exynos_bank_info { +char label[GPIO_PER_BANK ][GPIO_NAME_SIZE ]; +struct s5p_gpio_bank *bank; +};static void s5p_gpio_cfg_pin (struct s5p_gpio_bank *bank,int gpio,int cfg) {
@@ -132,35 +57,34 @@ static void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg)writel (value, &bank->con); } -static void s5p_gpio_set_value (struct s5p_gpio_bank *bank,int gpio,int en) +#ifndef CONFIG_SPL_BUILD +static int s5p_gpio_get_cfg_pin (struct s5p_gpio_bank *bank,int gpio) {unsigned int value; - value =readl (&bank->dat); - value &= ~DAT_MASK (gpio); -if (en) - value |=DAT_SET (gpio); -writel (value, &bank->dat); + value =readl (&bank->con); + value &=CON_MASK (gpio); +return CON_SFR_UNSHIFT (value, gpio); } -static void s5p_gpio_direction_output (struct s5p_gpio_bank *bank, -int gpio,int en) +static unsigned int s5p_gpio_get_value (struct s5p_gpio_bank *bank,int gpio) { -s5p_gpio_cfg_pin (bank, gpio,S5P_GPIO_OUTPUT ); -s5p_gpio_set_value (bank, gpio, en); -} +unsigned int value; -static void s5p_gpio_direction_input (struct s5p_gpio_bank *bank,int gpio) -{ -s5p_gpio_cfg_pin (bank, gpio,S5P_GPIO_INPUT ); + value =readl (&bank->dat); +return !!(value &DAT_MASK (gpio)); } +#endif -static unsigned int s5p_gpio_get_value (struct s5p_gpio_bank *bank,int gpio) +static void s5p_gpio_set_value (struct s5p_gpio_bank *bank,int gpio,int en) {unsigned int value; value =readl (&bank->dat); -return !!(value &DAT_MASK (gpio)); + value &= ~DAT_MASK (gpio); +if (en) + value |=DAT_SET (gpio); +writel (value, &bank->dat); }static void s5p_gpio_set_pull (struct s5p_gpio_bank *bank,int gpio,int mode)
@@ -254,66 +178,289 @@ int s5p_gpio_get_pin(unsigned gpio)return S5P_GPIO_GET_PIN (gpio); } -/* Common GPIO API */ +#ifdef CONFIG_SPL_BUILD +/* Common GPIO API - SPL does not support driver model yet */ +int gpio_set_value (unsigned gpio,int value) +{ +s5p_gpio_set_value (s5p_gpio_get_bank (gpio), +s5p_gpio_get_pin (gpio), value); + +return 0 ; +} +#endif /* CONFIG_SPL_BUILD */ + +/* There is no common GPIO API for pull, drv, pin, rate (yet) */ +void gpio_set_pull (int gpio,int mode) +{ +s5p_gpio_set_pull (s5p_gpio_get_bank (gpio), +s5p_gpio_get_pin (gpio), mode); +} + +void gpio_set_drv (int gpio,int mode) +{ +s5p_gpio_set_drv (s5p_gpio_get_bank (gpio), +s5p_gpio_get_pin (gpio), mode); +} + +void gpio_cfg_pin (int gpio,int cfg) +{ +s5p_gpio_cfg_pin (s5p_gpio_get_bank (gpio), +s5p_gpio_get_pin (gpio), cfg); +} + +void gpio_set_rate (int gpio,int mode) +{ +s5p_gpio_set_rate (s5p_gpio_get_bank (gpio), +s5p_gpio_get_pin (gpio), mode); +} -int gpio_request (unsigned gpio,const char *label) +/* Driver model interface */ +#ifndef CONFIG_SPL_BUILD +static int exynos_gpio_get_state (struct udevice *dev,unsigned int offset, +char *buf,int bufsize) { +struct gpio_dev_priv *uc_priv = dev->uclass_priv; +struct exynos_bank_info *state =dev_get_priv (dev); +const char *label; +bool is_output; +int size; +int cfg; + + label = state->label[offset]; + cfg =s5p_gpio_get_cfg_pin (state->bank, offset); + is_output = cfg ==S5P_GPIO_OUTPUT ; + size =snprintf (buf, bufsize,"%s%d: " , + uc_priv->bank_name ? uc_priv->bank_name :"" , offset); + buf += size; + bufsize -= size; +if (is_output || cfg ==S5P_GPIO_INPUT ) { +snprintf (buf, bufsize,"%s: %d [%c]%s%s" , + is_output ?"out" :" in" , +s5p_gpio_get_value (state->bank, offset), + *label ?'x' :' ' , + *label ?" " :"" , + label); + }else { +snprintf (buf, bufsize,"sfpio" ); + } +return 0 ; } -int gpio_free (unsigned gpio) +static int check_reserved (struct udevice *dev,unsigned offset, +const char *func) { +struct exynos_bank_info *state =dev_get_priv (dev); +struct gpio_dev_priv *uc_priv = dev->uclass_priv; + +if (!*state->label[offset]) { +printf ("exynos_gpio: %s: error: gpio %s%d not reserved\n" , + func, uc_priv->bank_name, offset); +return -EPERM ; + } +return 0 ; } -int gpio_direction_input (unsigned gpio) +static int exynos_gpio_request (struct udevice *dev,unsigned offset, +const char *label) { -s5p_gpio_direction_input (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio)); +struct exynos_bank_info *state =dev_get_priv (dev); + +if (*state->label[offset]) +return -EBUSY ; + +strncpy (state->label[offset], label,GPIO_NAME_SIZE ); + state->label[offset][GPIO_NAME_SIZE -1 ] ='\0' ; +return 0 ; } -int gpio_direction_output (unsigned gpio,int value) +static int exynos_gpio_free (struct udevice *dev,unsigned offset) { -s5p_gpio_direction_output (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio), value); +struct exynos_bank_info *state =dev_get_priv (dev); +int ret; + + ret =check_reserved (dev, offset, __func__); +if (ret) +return ret; + state->label[offset][0 ] ='\0' ; +return 0 ; } -int gpio_get_value (unsigned gpio) +/* set GPIO pin 'gpio' as an input */ +static int exynos_gpio_direction_input (struct udevice *dev,unsigned offset) { -return (int )s5p_gpio_get_value (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio)); +struct exynos_bank_info *state =dev_get_priv (dev); +int ret; + + ret =check_reserved (dev, offset, __func__); +if (ret) +return ret; + +/* Configure GPIO direction as input. */ +s5p_gpio_cfg_pin (state->bank, offset,S5P_GPIO_INPUT ); + +return 0 ; } -int gpio_set_value (unsigned gpio,int value) +/* set GPIO pin 'gpio' as an output, with polarity 'value' */ +static int exynos_gpio_direction_output (struct udevice *dev,unsigned offset, +int value) { -s5p_gpio_set_value (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio), value); +struct exynos_bank_info *state =dev_get_priv (dev); +int ret; + + ret =check_reserved (dev, offset, __func__); +if (ret) +return ret; + +/* Configure GPIO output value. */ +s5p_gpio_set_value (state->bank, offset, value); + +/* Configure GPIO direction as output. */ +s5p_gpio_cfg_pin (state->bank, offset,S5P_GPIO_OUTPUT );return 0 ; } -void gpio_set_pull (int gpio,int mode) +/* read GPIO IN value of pin 'gpio' */ +static int exynos_gpio_get_value (struct udevice *dev,unsigned offset) { -s5p_gpio_set_pull (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio), mode); +struct exynos_bank_info *state =dev_get_priv (dev); +int ret; + + ret =check_reserved (dev, offset, __func__); +if (ret) +return ret; + +return s5p_gpio_get_value (state->bank, offset); } -void gpio_set_drv (int gpio,int mode) +/* write GPIO OUT value to pin 'gpio' */ +static int exynos_gpio_set_value (struct udevice *dev,unsigned offset, +int value) { -s5p_gpio_set_drv (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio), mode); +struct exynos_bank_info *state =dev_get_priv (dev); +int ret; + + ret =check_reserved (dev, offset, __func__); +if (ret) +return ret; + +s5p_gpio_set_value (state->bank, offset, value); + +return 0 ; } -void gpio_cfg_pin (int gpio,int cfg) +static int exynos_gpio_get_function (struct udevice *dev,unsigned offset) { -s5p_gpio_cfg_pin (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio), cfg); +struct exynos_bank_info *state =dev_get_priv (dev); +int cfg; + +if (!*state->label[offset]) +return GPIOF_UNUSED ; + cfg =s5p_gpio_get_cfg_pin (state->bank, offset); +if (cfg ==S5P_GPIO_OUTPUT ) +return GPIOF_OUTPUT ; +else if (cfg ==S5P_GPIO_INPUT ) +return GPIOF_INPUT ; +else +return GPIOF_FUNC ; } -void gpio_set_rate (int gpio,int mode) +static const struct dm_gpio_ops gpio_exynos_ops = { + .request = exynos_gpio_request, + .free = exynos_gpio_free, + .direction_input = exynos_gpio_direction_input, + .direction_output = exynos_gpio_direction_output, + .get_value = exynos_gpio_get_value, + .set_value = exynos_gpio_set_value, + .get_function = exynos_gpio_get_function, + .get_state = exynos_gpio_get_state, +}; + +static int gpio_exynos_probe (struct udevice *dev) { -s5p_gpio_set_rate (s5p_gpio_get_bank (gpio), -s5p_gpio_get_pin (gpio), mode); +struct gpio_dev_priv *uc_priv = dev->uclass_priv; +struct exynos_bank_info *priv = dev->priv; +struct exynos_gpio_platdata *plat = dev->platdata; + +/* Only child devices have ports */ +if (!plat) +return 0 ; + + priv->bank = plat->bank; + + uc_priv->gpio_count =GPIO_PER_BANK ; + uc_priv->bank_name = plat->bank_name; + +return 0 ; +} + +/** +* We have a top-level GPIO device with no actual GPIOs. It has a child +* device for each Exynos GPIO bank. +*/ +static int gpio_exynos_bind (struct udevice *parent) +{ +struct exynos_gpio_platdata *plat = parent->platdata; +struct s5p_gpio_bank *bank, *base; +const void *blob = gd->fdt_blob; +int node; + +/* If this is a child device, there is nothing to do here */ +if (plat) +return 0 ; + + base = (struct s5p_gpio_bank *)fdtdec_get_addr (gd->fdt_blob, + parent->of_offset,"reg" ); +for (node =fdt_first_subnode (blob, parent->of_offset), bank = base; + node >0 ; + node =fdt_next_subnode (blob, node), bank++) { +struct exynos_gpio_platdata *plat; +struct udevice *dev; +fdt_addr_t reg; +int ret; + +if (!fdtdec_get_bool (blob, node,"gpio-controller" )) +continue ; + plat =calloc (1 ,sizeof (*plat)); +if (!plat) +return -ENOMEM ; + reg =fdtdec_get_addr (blob, node,"reg" ); +if (reg !=FDT_ADDR_T_NONE ) + bank = (struct s5p_gpio_bank *)((ulong )base + reg); + plat->bank = bank; + plat->bank_name =fdt_get_name (blob, node,NULL ); +debug ("dev at %p: %s\n" , bank, plat->bank_name); + + ret =device_bind (parent, parent->driver, + plat->bank_name, plat,-1 , &dev); +if (ret) +return ret; + dev->of_offset = parent->of_offset; + } + +return 0 ; } + +static const struct udevice_id exynos_gpio_ids[] = { + { .compatible ="samsung,exynos4210-pinctrl" }, + { .compatible ="samsung,exynos4x12-pinctrl" }, + { .compatible ="samsung,exynos5250-pinctrl" }, + { .compatible ="samsung,exynos5420-pinctrl" }, + { } +}; + +U_BOOT_DRIVER (gpio_exynos) = { + .name ="gpio_exynos" , + .id =UCLASS_GPIO , + .of_match = exynos_gpio_ids, + .bind = gpio_exynos_bind, + .probe = gpio_exynos_probe, + .priv_auto_alloc_size =sizeof (struct exynos_bank_info ), + .ops = &gpio_exynos_ops, +}; +#endif
include/configs/exynos-common.h +4 -0
@@ -17,6 +17,10 @@#include <linux/sizes.h> #define CONFIG_SYS_GENERIC_BOARD +#define CONFIG_DM +#define CONFIG_CMD_DM +#define CONFIG_DM_GPIO +#define CONFIG_ARCH_CPU_INIT #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO
Signature · 1 line
2.0.0.526.g5318336
PATCH v5 10/11 exynos: gpio: Convert to driver model
Quoted 2 lines · Simon Glass
Convert the exynos GPIO driver to driver model. This implements the generic GPIO interface but not the extra Exynos-specific functions.
OK, so same comment as about the serial conversion. And, I hear you about there being big changes, but I think this illustrates best why we need to keep function ordering the same:
[snip]
Quoted 19 lines
drivers/gpio/s5p_gpio.c +5
-6@@ -132,35 +57,34 @@ static void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg)writel (value, &bank->con); } -static void s5p_gpio_set_value (struct s5p_gpio_bank *bank,int gpio,int en) +#ifndef CONFIG_SPL_BUILD +static int s5p_gpio_get_cfg_pin (struct s5p_gpio_bank *bank,int gpio) {unsigned int value; - value =readl (&bank->dat); - value &= ~DAT_MASK (gpio); -if (en) - value |=DAT_SET (gpio); -writel (value, &bank->dat); + value =readl (&bank->con); + value &=CON_MASK (gpio); +return CON_SFR_UNSHIFT (value, gpio); }
[snip]
drivers/gpio/s5p_gpio.c static void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg) · line 88
Quoted 12 lines
drivers/gpio/s5p_gpio.c +5
-2-static unsigned int s5p_gpio_get_value (struct s5p_gpio_bank *bank,int gpio) +static void s5p_gpio_set_value (struct s5p_gpio_bank *bank,int gpio,int en) {unsigned int value; value =readl (&bank->dat); -return !!(value &DAT_MASK (gpio)); + value &= ~DAT_MASK (gpio); +if (en) + value |=DAT_SET (gpio); +writel (value, &bank->dat); }
We've moved the function around, the signature changed but the guts didn't at all?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140728/16e06cb7/attachment.pgp>
PATCH v5 10/11 exynos: gpio: Convert to driver model
Hi Tom,
Quoted 35 lines · Tom Rini
Quoted 2 lines · Simon Glass
Convert the exynos GPIO driver to driver model. This implements the generic GPIO interface but not the extra Exynos-specific functions.
OK, so same comment as about the serial conversion. And, I hear you about there being big changes, but I think this illustrates best why we need to keep function ordering the same:
[snip]
Quoted 19 lines
drivers/gpio/s5p_gpio.c +5
-6@@ -132,35 +57,34 @@ static void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg)writel (value, &bank->con); } -static void s5p_gpio_set_value (struct s5p_gpio_bank *bank,int gpio,int en) +#ifndef CONFIG_SPL_BUILD +static int s5p_gpio_get_cfg_pin (struct s5p_gpio_bank *bank,int gpio) {unsigned int value; - value =readl (&bank->dat); - value &= ~DAT_MASK (gpio); -if (en) - value |=DAT_SET (gpio); -writel (value, &bank->dat); + value =readl (&bank->con); + value &=CON_MASK (gpio); +return CON_SFR_UNSHIFT (value, gpio); }[snip]
Quoted 5 lines
drivers/gpio/s5p_gpio.c +1
-1-static unsigned int s5p_gpio_get_value (struct s5p_gpio_bank *bank,int gpio) +static void s5p_gpio_set_value (struct s5p_gpio_bank *bank,int gpio,int en) {unsigned int value;
Quoted 10 lines
drivers/gpio/s5p_gpio.c static void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg) · line 88
Quoted 7 lines
value = readl(&bank->dat);drivers/gpio/s5p_gpio.c +4
-1-return !!(value &DAT_MASK (gpio)); + value &= ~DAT_MASK (gpio); +if (en) + value |=DAT_SET (gpio); +writel (value, &bank->dat); }We've moved the function around, the signature changed but the guts didn't at all?
Yes that's just wrong, I will fix it.
Regards,
Simon
PATCH v5 11/11 dm: sandbox: dts: Add a GPIO bank
In reply to Simon GlassAdd a bank of GPIOs for sandbox which can be used for testing this functionality.
---
Changes in v5:
- Remove RFC label now that build errors are fixed
- Tidy up and update cover letter message
Changes in v4:
- Add patches for exynos GPIO support
Changes in v3: None
Changes in v2: None
arch/sandbox/dts/sandbox.dts | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/sandbox/dts/sandbox.dts +9 -0
@@ -113,4 +113,13 @@ 0x070b0067 0x070c0069>; }; + gpio_a: gpios { + gpio-controller; + compatible = "sandbox,gpio"; + #gpio-cells = <1>; + gpio-bank-name = "a"; + num-gpios = <20>; + }; + + };
Signature · 1 line
2.0.0.526.g5318336