Skip to content

Commit 311757b

Browse files
sjg20MinkyuKang
authored andcommitted
samsung: Enable device tree for s5p_goni
Change this board to add a device tree. This also adds a pinmux header file although it is not used as yet. Signed-off-by: Simon Glass <[email protected]> Signed-off-by: Minkyu Kang <[email protected]>
1 parent 1d55110 commit 311757b

File tree

9 files changed

+170
-7
lines changed

9 files changed

+170
-7
lines changed

arch/arm/Kconfig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ config TARGET_BCM958622HR
336336
config ARCH_EXYNOS
337337
bool "Samsung EXYNOS"
338338

339+
config ARCH_S5PC1XX
340+
bool "Samsung S5PC1XX"
341+
339342
config ARCH_HIGHBANK
340343
bool "Calxeda Highbank"
341344

@@ -429,9 +432,6 @@ config RMOBILE
429432
config TARGET_CM_FX6
430433
bool "Support cm_fx6"
431434

432-
config TARGET_S5P_GONI
433-
bool "Support s5p_goni"
434-
435435
config TARGET_SMDKC100
436436
bool "Support smdkc100"
437437

@@ -550,6 +550,8 @@ source "arch/arm/cpu/arm926ejs/orion5x/Kconfig"
550550

551551
source "arch/arm/cpu/armv7/rmobile/Kconfig"
552552

553+
source "arch/arm/cpu/armv7/s5pc1xx/Kconfig"
554+
553555
source "arch/arm/cpu/armv7/tegra-common/Kconfig"
554556

555557
source "arch/arm/cpu/armv7/uniphier/Kconfig"
@@ -657,7 +659,6 @@ source "board/raspberrypi/rpi_b/Kconfig"
657659
source "board/ronetix/pm9261/Kconfig"
658660
source "board/ronetix/pm9263/Kconfig"
659661
source "board/ronetix/pm9g45/Kconfig"
660-
source "board/samsung/goni/Kconfig"
661662
source "board/samsung/smdk2410/Kconfig"
662663
source "board/samsung/smdkc100/Kconfig"
663664
source "board/sandisk/sansa_fuze_plus/Kconfig"

arch/arm/cpu/armv7/s5pc1xx/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
if ARCH_S5PC1XX
2+
3+
choice
4+
prompt "S5PC1XX board select"
5+
6+
config TARGET_S5P_GONI
7+
bool "S5P Goni board"
8+
select OF_CONTROL if !SPL_BUILD
9+
10+
endchoice
11+
12+
config SYS_CPU
13+
default "armv7"
14+
15+
config SYS_SOC
16+
default "s5pc1xx"
17+
18+
source "board/samsung/goni/Kconfig"
19+
20+
endif

arch/arm/dts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
12
dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
23
exynos4210-smdkv310.dtb \
34
exynos4210-universal_c210.dtb \

arch/arm/dts/s5pc1xx-goni.dts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Samsung's S5PC110-based Goni board device tree source
3+
*
4+
* Copyright (c) 2014 Google, Inc
5+
*
6+
* SPDX-License-Identifier: GPL-2.0+
7+
*/
8+
9+
/dts-v1/;
10+
11+
#include "skeleton.dtsi"
12+
13+
/ {
14+
model = "Samsung Goni based on S5PC110";
15+
compatible = "samsung,goni", "samsung,s5pc110";
16+
17+
aliases {
18+
serial2 = "/serial@e2900800";
19+
console = "/serial@e2900800";
20+
};
21+
22+
serial@e2900800 {
23+
compatible = "samsung,exynos4210-uart";
24+
reg = <0xe2900800 0x400>;
25+
id = <2>;
26+
};
27+
28+
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright (C) 2012 Samsung Electronics
3+
* Rajeshwari Shinde <[email protected]>
4+
*
5+
* SPDX-License-Identifier: GPL-2.0+
6+
*/
7+
8+
#ifndef __ASM_ARM_ARCH_PERIPH_H
9+
#define __ASM_ARM_ARCH_PERIPH_H
10+
11+
/*
12+
* Peripherals required for pinmux configuration. List will
13+
* grow with support for more devices getting added.
14+
* Numbering based on interrupt table.
15+
*
16+
*/
17+
enum periph_id {
18+
PERIPH_ID_UART0 = 51,
19+
PERIPH_ID_UART1,
20+
PERIPH_ID_UART2,
21+
PERIPH_ID_UART3,
22+
PERIPH_ID_I2C0 = 56,
23+
PERIPH_ID_I2C1,
24+
PERIPH_ID_I2C2,
25+
PERIPH_ID_I2C3,
26+
PERIPH_ID_I2C4,
27+
PERIPH_ID_I2C5,
28+
PERIPH_ID_I2C6,
29+
PERIPH_ID_I2C7,
30+
PERIPH_ID_SPI0 = 68,
31+
PERIPH_ID_SPI1,
32+
PERIPH_ID_SPI2,
33+
PERIPH_ID_SDMMC0 = 75,
34+
PERIPH_ID_SDMMC1,
35+
PERIPH_ID_SDMMC2,
36+
PERIPH_ID_SDMMC3,
37+
PERIPH_ID_I2C8 = 87,
38+
PERIPH_ID_I2C9,
39+
PERIPH_ID_I2S0 = 98,
40+
PERIPH_ID_I2S1 = 99,
41+
42+
/* Since following peripherals do
43+
* not have shared peripheral interrupts (SPIs)
44+
* they are numbered arbitiraly after the maximum
45+
* SPIs Exynos has (128)
46+
*/
47+
PERIPH_ID_SROMC = 128,
48+
PERIPH_ID_SPI3,
49+
PERIPH_ID_SPI4,
50+
PERIPH_ID_SDMMC4,
51+
PERIPH_ID_PWM0,
52+
PERIPH_ID_PWM1,
53+
PERIPH_ID_PWM2,
54+
PERIPH_ID_PWM3,
55+
PERIPH_ID_PWM4,
56+
PERIPH_ID_I2C10 = 203,
57+
58+
PERIPH_ID_NONE = -1,
59+
};
60+
61+
#endif /* __ASM_ARM_ARCH_PERIPH_H */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (C) 2012 Samsung Electronics
3+
* Abhilash Kesavan <[email protected]>
4+
*
5+
* SPDX-License-Identifier: GPL-2.0+
6+
*/
7+
8+
#ifndef __ASM_ARM_ARCH_PINMUX_H
9+
#define __ASM_ARM_ARCH_PINMUX_H
10+
11+
#include "periph.h"
12+
13+
/*
14+
* Flags for setting specific configarations of peripherals.
15+
* List will grow with support for more devices getting added.
16+
*/
17+
enum {
18+
PINMUX_FLAG_NONE = 0x00000000,
19+
20+
/* Flags for eMMC */
21+
PINMUX_FLAG_8BIT_MODE = 1 << 0, /* SDMMC 8-bit mode */
22+
23+
/* Flags for SROM controller */
24+
PINMUX_FLAG_BANK = 3 << 0, /* bank number (0-3) */
25+
PINMUX_FLAG_16BIT = 1 << 2, /* 16-bit width */
26+
};
27+
28+
/**
29+
* Configures the pinmux for a particular peripheral.
30+
*
31+
* Each gpio can be configured in many different ways (4 bits on exynos)
32+
* such as "input", "output", "special function", "external interrupt"
33+
* etc. This function will configure the peripheral pinmux along with
34+
* pull-up/down and drive strength.
35+
*
36+
* @param peripheral peripheral to be configured
37+
* @param flags configure flags
38+
* @return 0 if ok, -1 on error (e.g. unsupported peripheral)
39+
*/
40+
int exynos_pinmux_config(int peripheral, int flags);
41+
42+
/**
43+
* Decode the peripheral id using the interrpt numbers.
44+
*
45+
* @param blob Device tree blob
46+
* @param node FDT I2C node to find
47+
* @return peripheral id if ok, PERIPH_ID_NONE on error
48+
*/
49+
int pinmux_decode_periph_id(const void *blob, int node);
50+
#endif

configs/s5p_goni_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
CONFIG_ARM=y
2+
CONFIG_ARCH_S5PC1XX=y
23
CONFIG_TARGET_S5P_GONI=y
4+
CONFIG_DEFAULT_DEVICE_TREE="s5pc1xx-goni"

drivers/mmc/s5p_sdhci.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#include <asm/arch/mmc.h>
1515
#include <asm/arch/clk.h>
1616
#include <errno.h>
17-
#ifdef CONFIG_OF_CONTROL
1817
#include <asm/arch/pinmux.h>
19-
#endif
2018

2119
static char *S5P_NAME = "SAMSUNG SDHCI";
2220
static void s5p_sdhci_set_control_reg(struct sdhci_host *host)

include/configs/s5p_goni.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#define CONFIG_MMC
5454
#define CONFIG_SDHCI
5555
#define CONFIG_S5P_SDHCI
56+
#define SDHCI_MAX_HOSTS 4
5657

5758
/* PWM */
5859
#define CONFIG_PWM 1
@@ -106,7 +107,6 @@
106107
",12m(modem)"\
107108
",60m(qboot)\0"
108109

109-
#define CONFIG_BOOTDELAY 1
110110
#define CONFIG_ZERO_BOOTDELAY_CHECK
111111

112112
/* partitions definitions */
@@ -283,4 +283,6 @@
283283
#define CONFIG_CMD_USB_MASS_STORAGE
284284
#define CONFIG_USB_GADGET_MASS_STORAGE
285285

286+
#define CONFIG_OF_LIBFDT
287+
286288
#endif /* __CONFIG_H */

0 commit comments

Comments
 (0)