Skip to contentSkip to conversation

exynos5: fix GPIO information of exynos5420

PATCH New Hyungwon Hwang 1 participant 3 messages Oct 31, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 exynos5: fix GPIO information of exynos5420

This patch fixes wrong GPIO information such as GPIO bank, table which is used to convert GPIO name to index, bank base address, and etc.

I have done this work on the patchset submitted by Akshay Saraswat.

https://patchwork.ozlabs.org/patch/400043/

---
 arch/arm/include/asm/arch-exynos/cpu.h  |  11 +-
 arch/arm/include/asm/arch-exynos/gpio.h | 232 +++++++++++++++-----------------
 2 files changed, 117 insertions(+), 126 deletions(-)
arch/arm/include/asm/arch-exynos/cpu.h +5 -6
index 7c5c4ff..da4ac6b 100644
@@ -139,7 +139,7 @@
 
 /* EXYNOS5420 */
 #define EXYNOS5420_AUDIOSS_BASE		0x03810000
-#define EXYNOS5420_GPIO_PART6_BASE	0x03860000
+#define EXYNOS5420_GPIO_PART5_BASE	0x03860000
 #define EXYNOS5420_PRO_ID		0x10000000
 #define EXYNOS5420_CLOCK_BASE		0x10010000
 #define EXYNOS5420_POWER_BASE		0x10040000
@@ -161,11 +161,10 @@
 #define EXYNOS5420_I2S_BASE		0x12D60000
 #define EXYNOS5420_PWMTIMER_BASE	0x12DD0000
 #define EXYNOS5420_SPI_ISP_BASE		0x131A0000
-#define EXYNOS5420_GPIO_PART2_BASE	0x13400000
-#define EXYNOS5420_GPIO_PART3_BASE	0x13400C00
-#define EXYNOS5420_GPIO_PART4_BASE	0x13410000
-#define EXYNOS5420_GPIO_PART5_BASE	0x14000000
-#define EXYNOS5420_GPIO_PART1_BASE	0x14010000
+#define EXYNOS5420_GPIO_PART1_BASE	0x13400000
+#define EXYNOS5420_GPIO_PART2_BASE	0x13410000
+#define EXYNOS5420_GPIO_PART3_BASE	0x14000000
+#define EXYNOS5420_GPIO_PART4_BASE	0x14010000
 #define EXYNOS5420_MIPI_DSIM_BASE	0x14500000
 #define EXYNOS5420_DP_BASE		0x145B0000
 
arch/arm/include/asm/arch-exynos/gpio.h +112 -120

423 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 2/3 Exynos5800: Add support for Exynos5800

The gpios of Exynos5800 are different from that of Exynos5420. This patch adds the gpio information and table of Exynos5800.

Change-Id Ic609973ab531e2b6ee9a68cfec0b6b9571f203a8
---
 arch/arm/include/asm/arch-exynos/gpio.h | 31 +++++++++++++++++++++++++++++--
 drivers/gpio/s5p_gpio.c                 |  4 +++-
 2 files changed, 32 insertions(+), 3 deletions(-)
arch/arm/include/asm/arch-exynos/gpio.h +29 -2
index 431ae3a..8f82ef0 100644
@@ -1368,11 +1368,21 @@ static struct gpio_info exynos5420_gpio_data[EXYNOS5420_GPIO_NUM_PARTS] = {
 	{ EXYNOS5420_GPIO_PART5_BASE, EXYNOS5420_GPIO_MAX_PORT },
 };
 
+#define EXYNOS5800_GPIO_NUM_PARTS	4
+static struct gpio_info exynos5800_gpio_data[EXYNOS5800_GPIO_NUM_PARTS] = {
+	{ EXYNOS5420_GPIO_PART1_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_1 },
+	{ EXYNOS5420_GPIO_PART2_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_2 },
+	{ EXYNOS5420_GPIO_PART3_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_3 },
+	{ EXYNOS5420_GPIO_PART4_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_4 },
+};
+
 static inline struct gpio_info *get_gpio_data(void)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5800())
+		if (proid_is_exynos5420())
 			return exynos5420_gpio_data;
+		else if (proid_is_exynos5800())
+			return exynos5800_gpio_data;
 		else
 			return exynos5_gpio_data;
 	} else if (cpu_is_exynos4()) {
@@ -1388,8 +1398,10 @@ static inline struct gpio_info *get_gpio_data(void)
 static inline unsigned int get_bank_num(void)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5800())
+		if (proid_is_exynos5420())
 			return EXYNOS5420_GPIO_NUM_PARTS;
+		if (proid_is_exynos5800())
+			return EXYNOS5800_GPIO_NUM_PARTS;
 		else
 			return EXYNOS5_GPIO_NUM_PARTS;
 	} else if (cpu_is_exynos4()) {
@@ -1493,6 +1505,21 @@ static const struct gpio_name_num_table exynos5420_gpio_table[] = {
 	{ 0 }
 };
 
+static const struct gpio_name_num_table exynos5800_gpio_table[] = {
+	GPIO_ENTRY('x', EXYNOS5420_GPIO_X00, EXYNOS5420_GPIO_C00, 0),
+	GPIO_ENTRY('c', EXYNOS5420_GPIO_C00, EXYNOS5420_GPIO_D10, 0),
+	GPIO_ENTRY('d', EXYNOS5420_GPIO_D10, EXYNOS5420_GPIO_Y00, 0),
+	GPIO_ENTRY('y', EXYNOS5420_GPIO_Y00, EXYNOS5420_GPIO_E00, 0),
+	GPIO_ENTRY('e', EXYNOS5420_GPIO_E00, EXYNOS5420_GPIO_F00, 0),
+	GPIO_ENTRY('f', EXYNOS5420_GPIO_F00, EXYNOS5420_GPIO_G00, 0),
+	GPIO_ENTRY('g', EXYNOS5420_GPIO_G00, EXYNOS5420_GPIO_J40, 0),
+	GPIO_ENTRY('j', EXYNOS5420_GPIO_J40, EXYNOS5420_GPIO_A00, 0),
+	GPIO_ENTRY('a', EXYNOS5420_GPIO_A00, EXYNOS5420_GPIO_B00, 0),
+	GPIO_ENTRY('b', EXYNOS5420_GPIO_B00, EXYNOS5420_GPIO_H00, 0),
+	GPIO_ENTRY('h', EXYNOS5420_GPIO_H00, EXYNOS5420_GPIO_Z0, 0),
+	{ 0 }
+};
+
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
drivers/gpio/s5p_gpio.c +3 -1
index bcf44eb..bed7cd7 100644
@@ -57,11 +57,13 @@ static inline int s5p_name_to_gpio(const char *name)
 	 */
 #if defined(CONFIG_EXYNOS4) || defined(CONFIG_EXYNOS5)
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5800()) {
+		if (proid_is_exynos5420()) {
 			tabp = exynos5420_gpio_table;
 			irregular_bank_name = 'y';
 			irregular_set_number = '7';
 			irregular_bank_base = EXYNOS5420_GPIO_Y70;
+		} else if (proid_is_exynos5800()) {
+			tabp = exynos5800_gpio_table;
 		} else {
 			tabp = exynos5_gpio_table;
 			irregular_bank_name = 'c';
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 3/3 Odroid-XU3: Add support for Odroid-XU3

In reply to Hyungwon Hwang

This patch adds support for Odroid-XU3.

Change-Id Ia45d119a62b126f2328684485b8c372ba6acbe00
---
 arch/arm/cpu/armv7/exynos/Kconfig     |   4 +
 arch/arm/dts/Makefile                 |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  72 ++++++++++
 board/samsung/odroid-xu3/Kconfig      |  12 ++
 board/samsung/odroid-xu3/MAINTAINERS  |   6 +
 board/samsung/odroid-xu3/Makefile     |   7 +
 board/samsung/odroid-xu3/odroid-xu3.c | 132 ++++++++++++++++++
 board/samsung/odroid-xu3/setup.h      | 123 +++++++++++++++++
 configs/odroid-xu3_defconfig          |   4 +
 include/configs/odroid_xu3.h          | 243 ++++++++++++++++++++++++++++++++++
 10 files changed, 605 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts
 create mode 100644 board/samsung/odroid-xu3/Kconfig
 create mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 create mode 100644 board/samsung/odroid-xu3/Makefile
 create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 create mode 100644 board/samsung/odroid-xu3/setup.h
 create mode 100644 configs/odroid-xu3_defconfig
 create mode 100644 include/configs/odroid_xu3.h
arch/arm/cpu/armv7/exynos/Kconfig +4 -0
index 3a25fee..a47cb34 100644
@@ -22,6 +22,9 @@ config TARGET_TRATS2
 config TARGET_ODROID
 	bool "Exynos4412 Odroid board"
 
+config TARGET_ODROID_XU3
+	bool "Exynos5422 Odroid board"
+
 config TARGET_ARNDALE
 	bool "Exynos5250 Arndale board"
 	select OF_CONTROL if !SPL_BUILD
@@ -60,6 +63,7 @@ source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
+source "board/samsung/odroid-xu3/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
arch/arm/dts/Makefile +2 -1
index 2dcfcc0..66191f9 100644
@@ -12,7 +12,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-smdk5250.dtb \
 	exynos5420-smdk5420.dtb \
 	exynos5420-peach-pit.dtb \
-	exynos5800-peach-pi.dtb
+	exynos5800-peach-pi.dtb \
+	exynos5422-odroidxu3.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra20-medcom-wide.dtb \
 	tegra20-paz00.dtb \
arch/arm/dts/exynos5422-odroidxu3.dts new file +72 -0

72 lines not on this page · raw message

board/samsung/odroid-xu3/Kconfig new file +12 -0
new file mode 100644
index 0000000..6159692
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+	default "odroid-xu3"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
+	default "odroid_xu3"
+
+endif
board/samsung/odroid-xu3/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..50cf928
@@ -0,0 +1,6 @@
+ODROID-XU3 BOARD
+M:	Hyungwon Hwang <[email protected]>
+S:	Maintained
+F:	board/samsung/odroid-xu3/
+F:	include/configs/odroid_xu3.h
+F:	configs/odroid-xu3_defconfig
board/samsung/odroid-xu3/Makefile new file +7 -0
new file mode 100644
index 0000000..85ae5c5
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid-xu3.o
board/samsung/odroid-xu3/odroid-xu3.c new file +132 -0

132 lines not on this page · raw message

board/samsung/odroid-xu3/setup.h new file +123 -0

123 lines not on this page · raw message

configs/odroid-xu3_defconfig new file +4 -0
new file mode 100644
index 0000000..74aa0cf
@@ -0,0 +1,4 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID_XU3=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
include/configs/odroid_xu3.h new file +243 -0

243 lines not on this page · raw message

Signature · 1 line
1.8.3.2