Skip to contentSkip to conversation

Add support to Odroid U3/X2

PATCH Superseded Przemyslaw Marczak 4 participants 58 messages Jul 17, 2014 – Sep 5, 2014

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

v5 cover Add support to Odroid U3/X2

This patch set introduces changes to common Samsung code as a preparation of new board support:
- boot device check - code cleanup
- automatic init order of mmc drivers
- automatic setting of dfu entities which depends on boot device
- pre reset function call for board own implementation
- setting board info environment for multi board support

New board config:
- odroid_config - Odroid U3/X2 support

V5 main changes:
- fix kernel crash - decrease mem size by 1MB
- ramdisk support
- OTG fix for Odroid U3+
- some code cleanup

Przemyslaw Marczak (12):
samsung: misc: fix soc revision setting in the set_board_info()
exynos: pinmux: fix the gpio names for exynos4x12 mmc arch:exynos: boot mode: add get_boot_mode(), code cleanup board:samsung: check the boot device and init the right mmc driver.
samsung: misc: add function for setting $dfu_alt_info samsung:board: misc_init_r: call set_dfu_alt_info() arm:reset: call the reset_misc() before the cpu reset
samsung: board: enable support of multiple board types
samsung: misc: use board specific functions to set env board info
odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412
odroid: add odroid U3/X2 device tree description
odroid: add odroid_config

 arch/arm/cpu/armv7/exynos/pinmux.c       |   4 +-
 arch/arm/cpu/armv7/exynos/power.c        |   7 +
 arch/arm/cpu/armv7/exynos/spl_boot.c     |   5 +-
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/exynos4412-odroid.dts       |  70 +++++
 arch/arm/include/asm/arch-exynos/power.h |  21 ++
 arch/arm/include/asm/arch-exynos/spl.h   |  17 +-
 arch/arm/lib/reset.c                     |   6 +
 board/samsung/common/board.c             |  55 +++-
 board/samsung/common/misc.c              |  57 +++-
 board/samsung/odroid/Makefile            |   8 +
 board/samsung/odroid/odroid.c            | 470 +++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h             | 255 +++++++++++++++++
 boards.cfg                               |   1 +
 doc/README.odroid                        | 143 ++++++++++
 include/common.h                         |   1 +
 include/configs/odroid.h                 | 216 ++++++++++++++
 include/samsung/misc.h                   |  10 +
 18 files changed, 1309 insertions(+), 40 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
Signature · 1 line
1.9.1
#1 lore raw

PATCH v5 1/12 samsung: misc: fix soc revision setting in the set_board_info()

The byte order of soc revision was inverted, now it is fixed.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>
---
 board/samsung/common/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +2 -2
index 03106fd..a453a82 100644
@@ -26,8 +26,8 @@ void set_board_info(void)
 {
 	char info[64];
 
-	snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f,
-		 (s5p_cpu_rev & 0xf0) >> 0x04);
+	snprintf(info, ARRAY_SIZE(info), "%u.%u", (s5p_cpu_rev & 0xf0) >> 4,
+		 s5p_cpu_rev & 0xf);
 	setenv("soc_rev", info);
 
 	snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
Signature · 1 line
1.9.1
#2 lore raw

PATCH v5 2/12 exynos: pinmux: fix the gpio names for exynos4x12 mmc

In reply to Przemyslaw Marczak

This change fixes the bad gpio configuration for the exynos dwmmc.

Cc Beomho Seo <[email protected]>
Cc Minkyu Kang <[email protected]>
Cc Jaehoon Chung <[email protected]>
---
 arch/arm/cpu/armv7/exynos/pinmux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +2 -2
index 86a0c75..b929486 100644
@@ -704,8 +704,8 @@ static int exynos4x12_mmc_config(int peripheral, int flags)
 		ext_func = S5P_GPIO_FUNC(0x3);
 		break;
 	case PERIPH_ID_SDMMC4:
-		start = EXYNOS4_GPIO_K00;
-		start_ext = EXYNOS4_GPIO_K13;
+		start = EXYNOS4X12_GPIO_K00;
+		start_ext = EXYNOS4X12_GPIO_K13;
 		func = S5P_GPIO_FUNC(0x3);
 		ext_func = S5P_GPIO_FUNC(0x4);
 		break;
Signature · 1 line
1.9.1
#3 lore raw

PATCH v5 3/12 arch:exynos: boot mode: add get_boot_mode(), code cleanup

In reply to Przemyslaw Marczak

This patch introduces code clean-up for exynos boot mode check. It includes:
- removal of typedef: boot_mode
- move the boot mode enum to arch-exynos/power.h
- add bootmode for sequence: eMMC 4.4 ch4 / SD ch2
- add new function: get_boot_mode() for OM[5:1] pin check
- update spl boot code

Changes v5:
- exynos: boot mode: add missing bootmode (1st:EMMC 4.4 / 2nd:SD ch2)

---
 arch/arm/cpu/armv7/exynos/power.c        |  7 +++++++
 arch/arm/cpu/armv7/exynos/spl_boot.c     |  5 ++---
 arch/arm/include/asm/arch-exynos/power.h | 21 +++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/spl.h   | 17 ++---------------
 4 files changed, 32 insertions(+), 18 deletions(-)
arch/arm/cpu/armv7/exynos/power.c +7 -0
index 638ee0b..e1ab3d6 100644
@@ -202,3 +202,10 @@ void power_exit_wakeup(void)
 	else
 		exynos4_power_exit_wakeup();
 }
+
+unsigned int get_boot_mode(void)
+{
+	unsigned int om_pin = samsung_get_base_power();
+
+	return readl(om_pin) & OM_PIN_MASK;
+}
arch/arm/cpu/armv7/exynos/spl_boot.c +2 -3
index 7916630..87f9214 100644
@@ -20,7 +20,6 @@
 #include "clock_init.h"
 
 DECLARE_GLOBAL_DATA_PTR;
-#define OM_STAT         (0x1f << 1)
 
 /* Index into irom ptr table */
 enum index {
@@ -184,7 +183,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
 */
 void copy_uboot_to_ram(void)
 {
-	enum boot_mode bootmode = BOOT_MODE_OM;
+	u32 bootmode = BOOT_MODE_OM;
 
 	u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
 	u32 offset = 0, size = 0;
@@ -207,7 +206,7 @@ void copy_uboot_to_ram(void)
 #endif
 
 	if (bootmode == BOOT_MODE_OM)
-		bootmode = readl(samsung_get_base_power()) & OM_STAT;
+		bootmode = get_boot_mode();
 
 	switch (bootmode) {
 #ifdef CONFIG_SPI_BOOTING
arch/arm/include/asm/arch-exynos/power.h +21 -0
index 4f2447b..1c0f144 100644
@@ -1670,6 +1670,27 @@ struct exynos5420_power {
 };
 #endif	/* __ASSEMBLY__ */
 
+#define OM_PIN_BITS	0x1f
+#define OM_PIN_SHIFT	0x1
+#define OM_PIN_MASK	(OM_PIN_BITS << OM_PIN_SHIFT)
+
+enum {
+	/*
+	 * Assign the OM pin values for respective boot modes.
+	 * Exynos4 does not support spi boot and the mmc boot OM
+	 * pin values are the same across Exynos4 and Exynos5.
+	 */
+	BOOT_MODE_MMC = 4,      /* SD_CH2  | USB */
+	BOOT_MODE_EMMC = 8,     /* EMMC4.4 | USB */
+	BOOT_MODE_EMMC_SD = 40, /* EMMC4.4 | SD_CH2 */
+	BOOT_MODE_SERIAL = 20,
+	/* Boot based on Operating Mode pin settings */
+	BOOT_MODE_OM = 32,
+	BOOT_MODE_USB,	/* Boot using USB download */
+};
+
+unsigned int get_boot_mode(void);
+
 void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable);
 
 #define EXYNOS_MIPI_PHY_ENABLE		(1 << 0)
arch/arm/include/asm/arch-exynos/spl.h +2 -15
index b1d68c3..cdcb2bc 100644
@@ -8,20 +8,7 @@
 #define __ASM_ARCH_EXYNOS_SPL_H__
 
 #include <asm/arch-exynos/dmc.h>
-
-enum boot_mode {
-	/*
-	 * Assign the OM pin values for respective boot modes.
-	 * Exynos4 does not support spi boot and the mmc boot OM
-	 * pin values are the same across Exynos4 and Exynos5.
-	 */
-	BOOT_MODE_MMC = 4,
-	BOOT_MODE_EMMC = 8,     /* EMMC4.4 */
-	BOOT_MODE_SERIAL = 20,
-	/* Boot based on Operating Mode pin settings */
-	BOOT_MODE_OM = 32,
-	BOOT_MODE_USB,	/* Boot using USB download */
-};
+#include <asm/arch/power.h>
 
 #ifndef __ASSEMBLY__
 /* Parameters of early board initialization in SPL */
@@ -62,7 +49,7 @@ struct spl_machine_param {
 	 * table only for mmc boot.
 	 */
 	u32		uboot_size;
-	enum boot_mode	boot_source;	/* Boot device */
+	unsigned	boot_source;	/* Boot device */
 	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
 	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
 	u32		serial_base;	/* Serial base address */
Signature · 1 line
1.9.1
#4 lore raw

PATCH v5 4/12 board:samsung: check the boot device and init the right mmc driver.

In reply to Przemyslaw Marczak

It is possible to boot device using a micro SD or eMMC slots. In this situation, boot device should be registered as a block device 0 in the MMC framework, because CONFIG_SYS_MMC_ENV_DEV is usually set to "0" in the most config cases.

---
Changes V3:
- separate two changes into two commits

Changes V4:
- board.c: add functions: init_mmc() and init_dwmmc()
- board_mmc_init(): call get_boot_mode()

---
 board/samsung/common/board.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)
board/samsung/common/board.c +27 -10
index 9dc7c83..4d3f216 100644
@@ -240,22 +240,39 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
+static int init_mmc(void)
+{
+#ifdef CONFIG_SDHCI
+	return exynos_mmc_init(gd->fdt_blob);
+#else
+	return 0;
+#endif
+}
+
+static int init_dwmmc(void)
 {
-	int ret;
 #ifdef CONFIG_DWMMC
-	/* dwmmc initializattion for available channels */
-	ret = exynos_dwmmc_init(gd->fdt_blob);
-	if (ret)
-		debug("dwmmc init failed\n");
+	return exynos_dwmmc_init(gd->fdt_blob);
+#else
+	return 0;
 #endif
+}
+
+int board_mmc_init(bd_t *bis)
+{
+	int ret;
+
+	if (get_boot_mode() == BOOT_MODE_MMC) {
+		ret = init_mmc();
+		ret |= init_dwmmc();
+	} else {
+		ret = init_dwmmc();
+		ret |= init_mmc();
+	}
 
-#ifdef CONFIG_SDHCI
-	/* mmc initializattion for available channels */
-	ret = exynos_mmc_init(gd->fdt_blob);
 	if (ret)
 		debug("mmc init failed\n");
-#endif
+
 	return ret;
 }
 #endif
Signature · 1 line
1.9.1
#5 lore raw

PATCH v5 5/12 samsung: misc: add function for setting $dfu_alt_info

In reply to Przemyslaw Marczak

This change introduces new common function:
- set_dfu_alt_info() - put dfu system and bootloader setting into $dfu_alt_info.
functions declaration:
- char *get_dfu_alt_system(void)
- char *get_dfu_alt_boot(void)
- void set_dfu_alt_info(void)
and new config:
- CONFIG_SET_DFU_ALT_INFO

This function can be used for auto setting dfu configuration on boot. Such feature is useful for multi board support by one u-boot binary. Each board should define two functions:
- get_dfu_alt_system()
- get_dfu_alt_boot()

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v2:
- change config names:
CONFIG_SET_DFU_BOOT_ALT to CONFIG_DFU_ALT_BOOTLOADER and CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*
- change function name: set_dfu_boot_alt() to set_dfu_alt_boot()
- remove superfluous ifdefs

Changes v3:
- set $dfu_alt_info at every boot
- new config: CONFIG_SET_DFU_ALT_INFO
- update commit msg

Changes v4:
- set_dfu_alt_info(): add checking the pointer returned by malloc

Changes v5:
- set_dfu_alt_info(): remove malloc and declare cache aligned buffer
- set_dfu_alt_info(): introduce CONFIG_SET_DFU_ALT_BUF_LEN

---
 board/samsung/common/misc.c | 41 +++++++++++++++++++++++++++++++++++++++++
 include/samsung/misc.h      |  6 ++++++
 2 files changed, 47 insertions(+)
board/samsung/common/misc.c +41 -0
index a453a82..9e52452 100644
@@ -11,6 +11,7 @@
 #include <samsung/misc.h>
 #include <errno.h>
 #include <version.h>
+#include <malloc.h>
 #include <linux/sizes.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
@@ -21,6 +22,46 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+void set_dfu_alt_info(void)
+{
+	size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
+	ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
+	char *alt_info = "Settings not found!";
+	char *status = "error!\n";
+	char *alt_setting;
+	char *alt_sep;
+	int offset = 0;
+
+	puts("DFU alt info setting: ");
+
+	alt_setting = get_dfu_alt_boot();
+	if (alt_setting) {
+		setenv("dfu_alt_boot", alt_setting);
+		offset = snprintf(buf, buf_size, "%s", alt_setting);
+	}
+
+	alt_setting = get_dfu_alt_system();
+	if (alt_setting) {
+		if (offset)
+			alt_sep = ";";
+		else
+			alt_sep = "";
+
+		offset += snprintf(buf + offset, buf_size - offset,
+				    "%s%s", alt_sep, alt_setting);
+	}
+
+	if (offset) {
+		alt_info = buf;
+		status = "done\n";
+	}
+
+	setenv("dfu_alt_info", alt_info);
+	puts(status);
+}
+#endif
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 void set_board_info(void)
 {
include/samsung/misc.h +6 -0
index 10653a1..e82bf32 100644
@@ -28,4 +28,10 @@ void check_boot_mode(void);
 void draw_logo(void);
 #endif
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+char *get_dfu_alt_system(void);
+char *get_dfu_alt_boot(void);
+void set_dfu_alt_info(void);
+#endif
+
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#6 lore raw

PATCH v5 6/12 samsung:board: misc_init_r: call set_dfu_alt_info()

In reply to Przemyslaw Marczak

This change enable automatic setting of dfu alt info on every boot. This is useful in case of booting one u-boot binary from multiple media.

---
 board/samsung/common/board.c | 3 +++
 1 file changed, 3 insertions(+)
board/samsung/common/board.c +3 -0
index 4d3f216..a46e87b 100644
@@ -324,6 +324,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_SET_DFU_ALT_INFO
+	set_dfu_alt_info();
+#endif
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	set_board_info();
 #endif
Signature · 1 line
1.9.1
#7 lore raw

PATCH v5 7/12 arm:reset: call the reset_misc() before the cpu reset

In reply to Przemyslaw Marczak

On an Odroid U3 board, the SOC is unable to reset the eMMC card in the DWMMC mode by the cpu software reset. Manual reset of the card by switching proper gpio pin - fixes this issue.

Such solution needs to add a call to pre reset function.
This is done by the reset_misc() function, which is called before reset_cpu(). The function reset_misc() is a weak function.

Cc Minkyu Kang <[email protected]>
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Cc Albert ARIBAUD <[email protected]>
Cc Tom Rini <[email protected]>

Changes v4:
- arch/arm/reset: fix weak function attribute to proper style

---
 arch/arm/lib/reset.c | 6 ++++++
 include/common.h     | 1 +
 2 files changed, 7 insertions(+)
arch/arm/lib/reset.c +6 -0
index 7a03580..9a95f08 100644
@@ -23,6 +23,10 @@
 
 #include <common.h>
 
+__weak void reset_misc(void)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	puts ("resetting ...\n");
@@ -30,6 +34,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	udelay (50000);				/* wait 50 ms */
 
 	disable_interrupts();
+
+	reset_misc();
 	reset_cpu(0);
 
 	/*NOTREACHED*/
include/common.h +1 -0
index 82c0a5a..48e4cbd 100644
@@ -619,6 +619,7 @@ int	checkicache   (void);
 int	checkdcache   (void);
 void	upmconfig     (unsigned int, unsigned int *, unsigned int);
 ulong	get_tbclk     (void);
+void	reset_misc    (void);
 void	reset_cpu     (ulong addr);
 #if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup(void *blob, bd_t *bd);
Signature · 1 line
1.9.1
#8 lore raw

PATCH v5 8/12 samsung: board: enable support of multiple board types

In reply to Przemyslaw Marczak

This change adds declaration of functions:
- set_board_type() - called at board_early_init_f()
- get_board_type() - called at checkboard()

For supporting multiple board types in a one config - it is welcome to display the current board model. This is what get_board_type() should return.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v3:
- change the commit order
- include/samsung/misc.h: add new functions declaration
- update a commit message

Changes v4:
- checkboard(): remove redundant variable

Changes v5:
- board.c: move call to set_board_type() into board_early_init_f()
- misc.h: remove get_board_name() function declaration

---
 board/samsung/common/board.c | 15 ++++++++++-----
 include/samsung/misc.h       |  4 ++++
 2 files changed, 14 insertions(+), 5 deletions(-)
board/samsung/common/board.c +10 -5
index a46e87b..3de828a 100644
@@ -137,7 +137,9 @@ static int board_uart_init(void)
 int board_early_init_f(void)
 {
 	int err;
-
+#ifdef CONFIG_BOARD_TYPES
+	set_board_type();
+#endif
 	err = board_uart_init();
 	if (err) {
 		debug("UART init failed\n");
@@ -147,7 +149,6 @@ int board_early_init_f(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 	board_i2c_init(gd->fdt_blob);
 #endif
-
 	return exynos_early_init_f();
 }
 #endif
@@ -280,11 +281,15 @@ int board_mmc_init(bd_t *bis)
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
-	const char *board_name;
+	const char *board_info;
 
-	board_name = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
-	printf("Board: %s\n", board_name ? board_name : "unknown");
+	board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+	printf("Board: %s\n", board_info ? board_info : "unknown");
+#ifdef CONFIG_BOARD_TYPES
+	board_info = get_board_type();
 
+	printf("Model: %s\n", board_info ? board_info : "unknown");
+#endif
 	return 0;
 }
 #endif
include/samsung/misc.h +4 -0
index e82bf32..607e8d4 100644
@@ -33,5 +33,9 @@ char *get_dfu_alt_system(void);
 char *get_dfu_alt_boot(void);
 void set_dfu_alt_info(void);
 #endif
+#ifdef CONFIG_BOARD_TYPES
+void set_board_type(void);
+const char *get_board_type(void);
+#endif
 
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#9 lore raw

PATCH v5 9/12 samsung: misc: use board specific functions to set env board info

In reply to Przemyslaw Marczak

This change adds setup of environmental board info using get_board_name() and get_board_type() functions for config CONFIG_BOARD_TYPES.

This is useful in case of running many boards with just one config.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v2:
- set_board_info: move the bdtype pointer to avoid unused pointer compilation warning

Changes v3:
- samsung: misc: change get_board_type_fdt() to get_board_type()
- samsung: misc: set env $boardname using get_board_* functions for CONFIG_BOARD_TYPES
- update commit msg

Changes v5:
- misc.c: set_bard_info(): remove a call to get_board_name()

---
 board/samsung/common/misc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +10 -2
index 9e52452..8766f0c 100644
@@ -79,8 +79,16 @@ void set_board_info(void)
 	setenv("board_rev", info);
 #endif
 #ifdef CONFIG_OF_LIBFDT
-	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s.dtb",
-		 CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+	const char *bdtype = "";
+	const char *bdname = CONFIG_SYS_BOARD;
+
+#ifdef CONFIG_BOARD_TYPES
+	bdtype = get_board_type();
+	sprintf(info, "%s%s", bdname, bdtype);
+	setenv("boardname", info);
+#endif
+	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
+		 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
 	setenv("fdtfile", info);
 #endif
 }
Signature · 1 line
1.9.1
#10 lore raw

PATCH v5 10/12 odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412

In reply to Przemyslaw Marczak

This board file supports standard features of Odroid X2 and U3 boards:
- Exynos4412 core clock set to 1000MHz and MPLL peripherial clock set to 800MHz,
- MAX77686 power regulator,
- USB PHY,
- enable XCL205 - power for board peripherials
- check board type: U3 or X2.
- enable Odroid U3 FAN cooler

---
Changes v2:
- enable fan on odroid U3

Changes v3:
- odroid.c: clean up board name related code
- odroid.c: remove static from set_board_type()
- odroid.c: add implementation of functions: get_dfu_alt_*
- odroid.c: include misc.h

Changes v4:
- odroid.c: dfu_get_alt_boot: add call get_boot_mode()

Changes v5:
- odroid.c: set_board_type: change mdelay to sdelay, define XCL205 GPIO config
- odroid.c: board_gpio_init(): fix OTG for Odroid U3+
- odroid.c: reserve the last 1 MB of dram for secure firmware
- odroid.c: board_clock_init(): code cleanup
- odroid.c: get_dfu_alt_boot(): remove setenv()
- odroid.c: remove get_board_name() function definition
- odroid.c: add enum ODROID_TYPES

---
 board/samsung/odroid/Makefile |   8 +
 board/samsung/odroid/odroid.c | 470 ++++++++++++++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h  | 255 +++++++++++++++++++++++
 3 files changed, 733 insertions(+)
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
board/samsung/odroid/Makefile new file +8 -0
new file mode 100644
index 0000000..b98aaeb
@@ -0,0 +1,8 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+# Przemyslaw Marczak <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid.o
board/samsung/odroid/odroid.c new file +470 -0

470 lines not on this page · raw message

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

255 lines not on this page · raw message

Signature · 1 line
1.9.1
#11 lore raw

PATCH v5 11/12 odroid: add odroid U3/X2 device tree description

In reply to Przemyslaw Marczak

This is a standard description for Odroid boards.

---
 arch/arm/dts/Makefile              |  3 +-
 arch/arm/dts/exynos4412-odroid.dts | 70 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
arch/arm/dts/Makefile +2 -1
index 6e2e313..8bcc69c 100644
@@ -1,7 +1,8 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
 	exynos4210-universal_c210.dtb \
 	exynos4210-trats.dtb \
-	exynos4412-trats2.dtb
+	exynos4412-trats2.dtb \
+	exynos4412-odroid.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-snow.dtb \
arch/arm/dts/exynos4412-odroid.dts new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
1.9.1
#12 lore raw

PATCH v5 12/12 odroid: add odroid_config

In reply to Przemyslaw Marczak

This config is valid for two devices:
- Odroid X2,
- Odroid U3.

---
Changes v2:
- odroid config: add CONFIG_DFU_ALT_BOOTLOADER
- odroid config: change name of CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*

Changes v3:
- odroid.h: update CONFIG_DFU_ALT_BOOT_** with required bootloader binaries
- odroid.h: add multi image support (CONFIG_FIT)
- odroid.h: add "autoboot" script for multi boot options
- odroid.h: change env name: dfu_alt_info -> dfu_alt_system
- odroid.h: update config name: CONFIG_SET_DFU_ALT_INFO
- odroid.h: reduce boot delay to 0 seconds
- update: doc/README.odroid

Changes v5:
- odroid.h: default environment cleanup
- odroid.h: remove unused definitions
- odroid.h: dfu_alt_system update
- odroid.h: define CONFIG_SET_DFU_ALT_BUF_LEN to 1k
- odroid.h: add init ramdisk support
- update: doc/README.odroid

---
 boards.cfg               |   1 +
 doc/README.odroid        | 143 +++++++++++++++++++++++++++++++
 include/configs/odroid.h | 216 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 360 insertions(+)
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
boards.cfg +1 -0
index 1ba2081..da16ec2 100644
@@ -298,6 +298,7 @@ Active  arm         armv7          exynos      samsung         smdk5420
 Active  arm         armv7          exynos      samsung         smdkv310            smdkv310                              -                                                                                                                                 Chander Kashyap <[email protected]>
 Active  arm         armv7          exynos      samsung         trats               trats                                 -                                                                                                                                 Lukasz Majewski <[email protected]>
 Active  arm         armv7          exynos      samsung         trats2              trats2                                -                                                                                                                                 Piotr Wilczek <[email protected]>
+Active  arm         armv7          exynos      samsung         odroid              odroid                                -                                                                                                                                 Przemyslaw Marczak <[email protected]>
 Active  arm         armv7          exynos      samsung         universal_c210      s5pc210_universal                     -                                                                                                                                 Przemyslaw Marczak <[email protected]>
 Active  arm         armv7          highbank    -               highbank            highbank                              -                                                                                                                                 Rob Herring <[email protected]>
 Active  arm         armv7          keystone    ti              k2hk_evm            k2hk_evm                              -                                                                                                                                 Vitaly Andrianov <[email protected]>
doc/README.odroid new file +143 -0

143 lines not on this page · raw message

include/configs/odroid.h new file +216 -0

216 lines not on this page · raw message

Signature · 1 line
1.9.1
#13 lore raw

v6 cover Add support to Odroid U3/X2

In reply to Przemyslaw Marczak

This patch set introduces changes to common Samsung code as a preparation of new board support:
- boot device check - code cleanup
- automatic init order of mmc drivers
- automatic setting of dfu entities which depends on boot device
- pre reset function call for board own implementation
- setting board info environment for multi board support

New board config:
- odroid_config - Odroid U3/X2 support

V6 change:
- fix ramdisk load issue

Przemyslaw Marczak (12):
samsung: misc: fix soc revision setting in the set_board_info()
exynos: pinmux: fix the gpio names for exynos4x12 mmc arch:exynos: boot mode: add get_boot_mode(), code cleanup board:samsung: check the boot device and init the right mmc driver.
samsung: misc: add function for setting $dfu_alt_info samsung:board: misc_init_r: call set_dfu_alt_info() arm:reset: call the reset_misc() before the cpu reset
samsung: board: enable support of multiple board types
samsung: misc: use board specific functions to set env board info
odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412
odroid: add odroid U3/X2 device tree description
odroid: add odroid_config

 arch/arm/cpu/armv7/exynos/pinmux.c       |   4 +-
 arch/arm/cpu/armv7/exynos/power.c        |   7 +
 arch/arm/cpu/armv7/exynos/spl_boot.c     |   5 +-
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/exynos4412-odroid.dts       |  70 +++++
 arch/arm/include/asm/arch-exynos/power.h |  21 ++
 arch/arm/include/asm/arch-exynos/spl.h   |  17 +-
 arch/arm/lib/reset.c                     |   6 +
 board/samsung/common/board.c             |  55 +++-
 board/samsung/common/misc.c              |  57 +++-
 board/samsung/odroid/Makefile            |   8 +
 board/samsung/odroid/odroid.c            | 470 +++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h             | 255 +++++++++++++++++
 boards.cfg                               |   1 +
 doc/README.odroid                        | 143 ++++++++++
 include/common.h                         |   1 +
 include/configs/odroid.h                 | 216 ++++++++++++++
 include/samsung/misc.h                   |  10 +
 18 files changed, 1309 insertions(+), 40 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
Signature · 1 line
1.9.1
#14 lore raw

PATCH v6 1/12 samsung: misc: fix soc revision setting in the set_board_info()

The byte order of soc revision was inverted, now it is fixed.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>
---
 board/samsung/common/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +2 -2
index 03106fd..a453a82 100644
@@ -26,8 +26,8 @@ void set_board_info(void)
 {
 	char info[64];
 
-	snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f,
-		 (s5p_cpu_rev & 0xf0) >> 0x04);
+	snprintf(info, ARRAY_SIZE(info), "%u.%u", (s5p_cpu_rev & 0xf0) >> 4,
+		 s5p_cpu_rev & 0xf);
 	setenv("soc_rev", info);
 
 	snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
Signature · 1 line
1.9.1
#15 lore raw

PATCH v6 2/12 exynos: pinmux: fix the gpio names for exynos4x12 mmc

In reply to Przemyslaw Marczak

This change fixes the bad gpio configuration for the exynos dwmmc.

Cc Beomho Seo <[email protected]>
Cc Minkyu Kang <[email protected]>
Cc Jaehoon Chung <[email protected]>
---
 arch/arm/cpu/armv7/exynos/pinmux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +2 -2
index 86a0c75..b929486 100644
@@ -704,8 +704,8 @@ static int exynos4x12_mmc_config(int peripheral, int flags)
 		ext_func = S5P_GPIO_FUNC(0x3);
 		break;
 	case PERIPH_ID_SDMMC4:
-		start = EXYNOS4_GPIO_K00;
-		start_ext = EXYNOS4_GPIO_K13;
+		start = EXYNOS4X12_GPIO_K00;
+		start_ext = EXYNOS4X12_GPIO_K13;
 		func = S5P_GPIO_FUNC(0x3);
 		ext_func = S5P_GPIO_FUNC(0x4);
 		break;
Signature · 1 line
1.9.1
#16 lore raw

PATCH v6 3/12 arch:exynos: boot mode: add get_boot_mode(), code cleanup

In reply to Przemyslaw Marczak

This patch introduces code clean-up for exynos boot mode check. It includes:
- removal of typedef: boot_mode
- move the boot mode enum to arch-exynos/power.h
- add bootmode for sequence: eMMC 4.4 ch4 / SD ch2
- add new function: get_boot_mode() for OM[5:1] pin check
- update spl boot code

Changes v5:
- exynos: boot mode: add missing bootmode (1st:EMMC 4.4 / 2nd:SD ch2)

---
 arch/arm/cpu/armv7/exynos/power.c        |  7 +++++++
 arch/arm/cpu/armv7/exynos/spl_boot.c     |  5 ++---
 arch/arm/include/asm/arch-exynos/power.h | 21 +++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/spl.h   | 17 ++---------------
 4 files changed, 32 insertions(+), 18 deletions(-)
arch/arm/cpu/armv7/exynos/power.c +7 -0
index 638ee0b..e1ab3d6 100644
@@ -202,3 +202,10 @@ void power_exit_wakeup(void)
 	else
 		exynos4_power_exit_wakeup();
 }
+
+unsigned int get_boot_mode(void)
+{
+	unsigned int om_pin = samsung_get_base_power();
+
+	return readl(om_pin) & OM_PIN_MASK;
+}
arch/arm/cpu/armv7/exynos/spl_boot.c +2 -3
index 7916630..87f9214 100644
@@ -20,7 +20,6 @@
 #include "clock_init.h"
 
 DECLARE_GLOBAL_DATA_PTR;
-#define OM_STAT         (0x1f << 1)
 
 /* Index into irom ptr table */
 enum index {
@@ -184,7 +183,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
 */
 void copy_uboot_to_ram(void)
 {
-	enum boot_mode bootmode = BOOT_MODE_OM;
+	u32 bootmode = BOOT_MODE_OM;
 
 	u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
 	u32 offset = 0, size = 0;
@@ -207,7 +206,7 @@ void copy_uboot_to_ram(void)
 #endif
 
 	if (bootmode == BOOT_MODE_OM)
-		bootmode = readl(samsung_get_base_power()) & OM_STAT;
+		bootmode = get_boot_mode();
 
 	switch (bootmode) {
 #ifdef CONFIG_SPI_BOOTING
arch/arm/include/asm/arch-exynos/power.h +21 -0
index 4f2447b..1c0f144 100644
@@ -1670,6 +1670,27 @@ struct exynos5420_power {
 };
 #endif	/* __ASSEMBLY__ */
 
+#define OM_PIN_BITS	0x1f
+#define OM_PIN_SHIFT	0x1
+#define OM_PIN_MASK	(OM_PIN_BITS << OM_PIN_SHIFT)
+
+enum {
+	/*
+	 * Assign the OM pin values for respective boot modes.
+	 * Exynos4 does not support spi boot and the mmc boot OM
+	 * pin values are the same across Exynos4 and Exynos5.
+	 */
+	BOOT_MODE_MMC = 4,      /* SD_CH2  | USB */
+	BOOT_MODE_EMMC = 8,     /* EMMC4.4 | USB */
+	BOOT_MODE_EMMC_SD = 40, /* EMMC4.4 | SD_CH2 */
+	BOOT_MODE_SERIAL = 20,
+	/* Boot based on Operating Mode pin settings */
+	BOOT_MODE_OM = 32,
+	BOOT_MODE_USB,	/* Boot using USB download */
+};
+
+unsigned int get_boot_mode(void);
+
 void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable);
 
 #define EXYNOS_MIPI_PHY_ENABLE		(1 << 0)
arch/arm/include/asm/arch-exynos/spl.h +2 -15
index b1d68c3..cdcb2bc 100644
@@ -8,20 +8,7 @@
 #define __ASM_ARCH_EXYNOS_SPL_H__
 
 #include <asm/arch-exynos/dmc.h>
-
-enum boot_mode {
-	/*
-	 * Assign the OM pin values for respective boot modes.
-	 * Exynos4 does not support spi boot and the mmc boot OM
-	 * pin values are the same across Exynos4 and Exynos5.
-	 */
-	BOOT_MODE_MMC = 4,
-	BOOT_MODE_EMMC = 8,     /* EMMC4.4 */
-	BOOT_MODE_SERIAL = 20,
-	/* Boot based on Operating Mode pin settings */
-	BOOT_MODE_OM = 32,
-	BOOT_MODE_USB,	/* Boot using USB download */
-};
+#include <asm/arch/power.h>
 
 #ifndef __ASSEMBLY__
 /* Parameters of early board initialization in SPL */
@@ -62,7 +49,7 @@ struct spl_machine_param {
 	 * table only for mmc boot.
 	 */
 	u32		uboot_size;
-	enum boot_mode	boot_source;	/* Boot device */
+	unsigned	boot_source;	/* Boot device */
 	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
 	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
 	u32		serial_base;	/* Serial base address */
Signature · 1 line
1.9.1
#17 lore raw

PATCH v6 3/12 arch:exynos: boot mode: add get_boot_mode(), code cleanup

Hi, Przemyslaw.

Quoted 47 lines · Przemyslaw Marczak

This patch introduces code clean-up for exynos boot mode check. It includes:
- removal of typedef: boot_mode
- move the boot mode enum to arch-exynos/power.h
- add bootmode for sequence: eMMC 4.4 ch4 / SD ch2
- add new function: get_boot_mode() for OM[5:1] pin check
- update spl boot code

Changes v5:
- exynos: boot mode: add missing bootmode (1st:EMMC 4.4 / 2nd:SD ch2)

---
 arch/arm/cpu/armv7/exynos/power.c        |  7 +++++++
 arch/arm/cpu/armv7/exynos/spl_boot.c     |  5 ++---
 arch/arm/include/asm/arch-exynos/power.h | 21 +++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/spl.h   | 17 ++---------------
 4 files changed, 32 insertions(+), 18 deletions(-)
arch/arm/cpu/armv7/exynos/power.c +7 -0
index 638ee0b..e1ab3d6 100644
@@ -202,3 +202,10 @@ void power_exit_wakeup(void)
 	else
 		exynos4_power_exit_wakeup();
 }
+
+unsigned int get_boot_mode(void)
+{
+	unsigned int om_pin = samsung_get_base_power();
+
+	return readl(om_pin) & OM_PIN_MASK;
+}
arch/arm/cpu/armv7/exynos/spl_boot.c +0 -1
index 7916630..87f9214 100644
@@ -20,7 +20,6 @@
 #include "clock_init.h"
 
 DECLARE_GLOBAL_DATA_PTR;
-#define OM_STAT         (0x1f << 1)
 
 /* Index into irom ptr table */
 enum index {

arch/arm/cpu/armv7/exynos/spl_boot.c static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr) · line 186

Quoted 5 lines
arch/arm/cpu/armv7/exynos/spl_boot.c +1 -1
@@ -184,7 +183,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
 */
 void copy_uboot_to_ram(void)
 {
-	enum boot_mode bootmode = BOOT_MODE_OM;
+	u32 bootmode = BOOT_MODE_OM;

Need to use "u32"?

Quoted 21 lines
arch/arm/cpu/armv7/exynos/spl_boot.c +1 -1
 	u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
 	u32 offset = 0, size = 0;
@@ -207,7 +206,7 @@ void copy_uboot_to_ram(void)
 #endif
 
 	if (bootmode == BOOT_MODE_OM)
-		bootmode = readl(samsung_get_base_power()) & OM_STAT;
+		bootmode = get_boot_mode();
 
 	switch (bootmode) {
 #ifdef CONFIG_SPI_BOOTING
arch/arm/include/asm/arch-exynos/power.h +1 -0
index 4f2447b..1c0f144 100644
@@ -1670,6 +1670,27 @@ struct exynos5420_power {
 };
 #endif	/* __ASSEMBLY__ */
 
+#define OM_PIN_BITS	0x1f

arch/arm/include/asm/arch-exynos/power.h struct exynos5420_power { · line 1683

Quoted 10 lines
arch/arm/include/asm/arch-exynos/power.h +10 -0
+#define OM_PIN_SHIFT	0x1
+#define OM_PIN_MASK	(OM_PIN_BITS << OM_PIN_SHIFT)
+
+enum {
+	/*
+	 * Assign the OM pin values for respective boot modes.
+	 * Exynos4 does not support spi boot and the mmc boot OM
+	 * pin values are the same across Exynos4 and Exynos5.
+	 */
+	BOOT_MODE_MMC = 4,      /* SD_CH2  | USB */

I think good that use "BOOT_MODE_SD" instead of "BOOT_MODE_MMC".

Best Regards,
Jaehoon Chung

Quoted 49 lines
arch/arm/include/asm/arch-exynos/power.h +10 -0
+	BOOT_MODE_EMMC = 8,     /* EMMC4.4 | USB */
+	BOOT_MODE_EMMC_SD = 40, /* EMMC4.4 | SD_CH2 */
+	BOOT_MODE_SERIAL = 20,
+	/* Boot based on Operating Mode pin settings */
+	BOOT_MODE_OM = 32,
+	BOOT_MODE_USB,	/* Boot using USB download */
+};
+
+unsigned int get_boot_mode(void);
+
 void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable);
 
 #define EXYNOS_MIPI_PHY_ENABLE		(1 << 0)
arch/arm/include/asm/arch-exynos/spl.h +2 -15
index b1d68c3..cdcb2bc 100644
@@ -8,20 +8,7 @@
 #define __ASM_ARCH_EXYNOS_SPL_H__
 
 #include <asm/arch-exynos/dmc.h>
-
-enum boot_mode {
-	/*
-	 * Assign the OM pin values for respective boot modes.
-	 * Exynos4 does not support spi boot and the mmc boot OM
-	 * pin values are the same across Exynos4 and Exynos5.
-	 */
-	BOOT_MODE_MMC = 4,
-	BOOT_MODE_EMMC = 8,     /* EMMC4.4 */
-	BOOT_MODE_SERIAL = 20,
-	/* Boot based on Operating Mode pin settings */
-	BOOT_MODE_OM = 32,
-	BOOT_MODE_USB,	/* Boot using USB download */
-};
+#include <asm/arch/power.h>
 
 #ifndef __ASSEMBLY__
 /* Parameters of early board initialization in SPL */
@@ -62,7 +49,7 @@ struct spl_machine_param {
 	 * table only for mmc boot.
 	 */
 	u32		uboot_size;
-	enum boot_mode	boot_source;	/* Boot device */
+	unsigned	boot_source;	/* Boot device */
 	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
 	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
 	u32		serial_base;	/* Serial base address */
#18 lore raw

PATCH v6 3/12 arch:exynos: boot mode: add get_boot_mode(), code cleanup

Hello Jaehoon,

Quoted 47 lines · Jaehoon Chung

Hi, Przemyslaw.

Quoted 44 lines · Przemyslaw Marczak

This patch introduces code clean-up for exynos boot mode check. It includes:
- removal of typedef: boot_mode
- move the boot mode enum to arch-exynos/power.h
- add bootmode for sequence: eMMC 4.4 ch4 / SD ch2
- add new function: get_boot_mode() for OM[5:1] pin check
- update spl boot code

Changes v5:
- exynos: boot mode: add missing bootmode (1st:EMMC 4.4 / 2nd:SD ch2)

---
  arch/arm/cpu/armv7/exynos/power.c        |  7 +++++++
  arch/arm/cpu/armv7/exynos/spl_boot.c     |  5 ++---
  arch/arm/include/asm/arch-exynos/power.h | 21 +++++++++++++++++++++
  arch/arm/include/asm/arch-exynos/spl.h   | 17 ++---------------
  4 files changed, 32 insertions(+), 18 deletions(-)
arch/arm/cpu/armv7/exynos/power.c +7 -0
index 638ee0b..e1ab3d6 100644
@@ -202,3 +202,10 @@ void power_exit_wakeup(void)
  	else
  		exynos4_power_exit_wakeup();
  }
+
+unsigned int get_boot_mode(void)
+{
+	unsigned int om_pin = samsung_get_base_power();
+
+	return readl(om_pin) & OM_PIN_MASK;
+}
arch/arm/cpu/armv7/exynos/spl_boot.c +0 -1
index 7916630..87f9214 100644
@@ -20,7 +20,6 @@
  #include "clock_init.h"
 
  DECLARE_GLOBAL_DATA_PTR;
-#define OM_STAT         (0x1f << 1)
 
Quoted 11 lines

arch/arm/cpu/armv7/exynos/spl_boot.c static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr) · line 186

Quoted 8 lines
arch/arm/cpu/armv7/exynos/spl_boot.c +1 -1
  /* Index into irom ptr table */
  enum index {
@@ -184,7 +183,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
  */
  void copy_uboot_to_ram(void)
  {
-	enum boot_mode bootmode = BOOT_MODE_OM;
+	u32 bootmode = BOOT_MODE_OM;

Need to use "u32"?

Ok, will change to "unsigned int".

Quoted 34 lines
Quoted 21 lines
arch/arm/cpu/armv7/exynos/spl_boot.c +1 -1
  	u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
  	u32 offset = 0, size = 0;
@@ -207,7 +206,7 @@ void copy_uboot_to_ram(void)
  #endif
 
  	if (bootmode == BOOT_MODE_OM)
-		bootmode = readl(samsung_get_base_power()) & OM_STAT;
+		bootmode = get_boot_mode();
 
  	switch (bootmode) {
  #ifdef CONFIG_SPI_BOOTING
arch/arm/include/asm/arch-exynos/power.h +1 -0
index 4f2447b..1c0f144 100644
@@ -1670,6 +1670,27 @@ struct exynos5420_power {
  };
  #endif	/* __ASSEMBLY__ */
 
+#define OM_PIN_BITS	0x1f

arch/arm/include/asm/arch-exynos/power.h struct exynos5420_power { · line 1683

Quoted 10 lines
arch/arm/include/asm/arch-exynos/power.h +10 -0
+#define OM_PIN_SHIFT	0x1
+#define OM_PIN_MASK	(OM_PIN_BITS << OM_PIN_SHIFT)
+
+enum {
+	/*
+	 * Assign the OM pin values for respective boot modes.
+	 * Exynos4 does not support spi boot and the mmc boot OM
+	 * pin values are the same across Exynos4 and Exynos5.
+	 */
+	BOOT_MODE_MMC = 4,      /* SD_CH2  | USB */

I think good that use "BOOT_MODE_SD" instead of "BOOT_MODE_MMC".

Quoted 3 lines

Best Regards,
Jaehoon Chung

Ok, I can change this.

Quoted 37 lines
Quoted 37 lines
arch/arm/include/asm/arch-exynos/power.h +10 -0
+	BOOT_MODE_EMMC = 8,     /* EMMC4.4 | USB */
+	BOOT_MODE_EMMC_SD = 40, /* EMMC4.4 | SD_CH2 */
+	BOOT_MODE_SERIAL = 20,
+	/* Boot based on Operating Mode pin settings */
+	BOOT_MODE_OM = 32,
+	BOOT_MODE_USB,	/* Boot using USB download */
+};
+
+unsigned int get_boot_mode(void);
+
  void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable);
 
  #define EXYNOS_MIPI_PHY_ENABLE		(1 << 0)
arch/arm/include/asm/arch-exynos/spl.h +1 -14
index b1d68c3..cdcb2bc 100644
@@ -8,20 +8,7 @@
  #define __ASM_ARCH_EXYNOS_SPL_H__
 
  #include <asm/arch-exynos/dmc.h>
-
-enum boot_mode {
-	/*
-	 * Assign the OM pin values for respective boot modes.
-	 * Exynos4 does not support spi boot and the mmc boot OM
-	 * pin values are the same across Exynos4 and Exynos5.
-	 */
-	BOOT_MODE_MMC = 4,
-	BOOT_MODE_EMMC = 8,     /* EMMC4.4 */
-	BOOT_MODE_SERIAL = 20,
-	/* Boot based on Operating Mode pin settings */
-	BOOT_MODE_OM = 32,
-	BOOT_MODE_USB,	/* Boot using USB download */
-};
+#include <asm/arch/power.h>
 
Quoted 14 lines

arch/arm/include/asm/arch-exynos/spl.h struct spl_machine_param { · line 55

Quoted 12 lines
arch/arm/include/asm/arch-exynos/spl.h +1 -1
  #ifndef __ASSEMBLY__
  /* Parameters of early board initialization in SPL */
@@ -62,7 +49,7 @@ struct spl_machine_param {
  	 * table only for mmc boot.
  	 */
  	u32		uboot_size;
-	enum boot_mode	boot_source;	/* Boot device */
+	unsigned	boot_source;	/* Boot device */
  	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
  	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
  	u32		serial_base;	/* Serial base address */

Thanks,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#19 lore raw

PATCH v6 4/12 board:samsung: check the boot device and init the right mmc driver.

In reply to Przemyslaw Marczak

It is possible to boot device using a micro SD or eMMC slots. In this situation, boot device should be registered as a block device 0 in the MMC framework, because CONFIG_SYS_MMC_ENV_DEV is usually set to "0" in the most config cases.

---
Changes V3:
- separate two changes into two commits

Changes V4:
- board.c: add functions: init_mmc() and init_dwmmc()
- board_mmc_init(): call get_boot_mode()

---
 board/samsung/common/board.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)
board/samsung/common/board.c +27 -10
index 9dc7c83..4d3f216 100644
@@ -240,22 +240,39 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
+static int init_mmc(void)
+{
+#ifdef CONFIG_SDHCI
+	return exynos_mmc_init(gd->fdt_blob);
+#else
+	return 0;
+#endif
+}
+
+static int init_dwmmc(void)
 {
-	int ret;
 #ifdef CONFIG_DWMMC
-	/* dwmmc initializattion for available channels */
-	ret = exynos_dwmmc_init(gd->fdt_blob);
-	if (ret)
-		debug("dwmmc init failed\n");
+	return exynos_dwmmc_init(gd->fdt_blob);
+#else
+	return 0;
 #endif
+}
+
+int board_mmc_init(bd_t *bis)
+{
+	int ret;
+
+	if (get_boot_mode() == BOOT_MODE_MMC) {
+		ret = init_mmc();
+		ret |= init_dwmmc();
+	} else {
+		ret = init_dwmmc();
+		ret |= init_mmc();
+	}
 
-#ifdef CONFIG_SDHCI
-	/* mmc initializattion for available channels */
-	ret = exynos_mmc_init(gd->fdt_blob);
 	if (ret)
 		debug("mmc init failed\n");
-#endif
+
 	return ret;
 }
 #endif
Signature · 1 line
1.9.1
#20 lore raw

PATCH v6 5/12 samsung: misc: add function for setting $dfu_alt_info

In reply to Przemyslaw Marczak

This change introduces new common function:
- set_dfu_alt_info() - put dfu system and bootloader setting into $dfu_alt_info.
functions declaration:
- char *get_dfu_alt_system(void)
- char *get_dfu_alt_boot(void)
- void set_dfu_alt_info(void)
and new config:
- CONFIG_SET_DFU_ALT_INFO

This function can be used for auto setting dfu configuration on boot. Such feature is useful for multi board support by one u-boot binary. Each board should define two functions:
- get_dfu_alt_system()
- get_dfu_alt_boot()

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v2:
- change config names:
CONFIG_SET_DFU_BOOT_ALT to CONFIG_DFU_ALT_BOOTLOADER and CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*
- change function name: set_dfu_boot_alt() to set_dfu_alt_boot()
- remove superfluous ifdefs

Changes v3:
- set $dfu_alt_info at every boot
- new config: CONFIG_SET_DFU_ALT_INFO
- update commit msg

Changes v4:
- set_dfu_alt_info(): add checking the pointer returned by malloc

Changes v5:
- set_dfu_alt_info(): remove malloc and declare cache aligned buffer
- set_dfu_alt_info(): introduce CONFIG_SET_DFU_ALT_BUF_LEN

---
 board/samsung/common/misc.c | 41 +++++++++++++++++++++++++++++++++++++++++
 include/samsung/misc.h      |  6 ++++++
 2 files changed, 47 insertions(+)
board/samsung/common/misc.c +41 -0
index a453a82..9e52452 100644
@@ -11,6 +11,7 @@
 #include <samsung/misc.h>
 #include <errno.h>
 #include <version.h>
+#include <malloc.h>
 #include <linux/sizes.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
@@ -21,6 +22,46 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+void set_dfu_alt_info(void)
+{
+	size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
+	ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
+	char *alt_info = "Settings not found!";
+	char *status = "error!\n";
+	char *alt_setting;
+	char *alt_sep;
+	int offset = 0;
+
+	puts("DFU alt info setting: ");
+
+	alt_setting = get_dfu_alt_boot();
+	if (alt_setting) {
+		setenv("dfu_alt_boot", alt_setting);
+		offset = snprintf(buf, buf_size, "%s", alt_setting);
+	}
+
+	alt_setting = get_dfu_alt_system();
+	if (alt_setting) {
+		if (offset)
+			alt_sep = ";";
+		else
+			alt_sep = "";
+
+		offset += snprintf(buf + offset, buf_size - offset,
+				    "%s%s", alt_sep, alt_setting);
+	}
+
+	if (offset) {
+		alt_info = buf;
+		status = "done\n";
+	}
+
+	setenv("dfu_alt_info", alt_info);
+	puts(status);
+}
+#endif
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 void set_board_info(void)
 {
include/samsung/misc.h +6 -0
index 10653a1..e82bf32 100644
@@ -28,4 +28,10 @@ void check_boot_mode(void);
 void draw_logo(void);
 #endif
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+char *get_dfu_alt_system(void);
+char *get_dfu_alt_boot(void);
+void set_dfu_alt_info(void);
+#endif
+
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#21 lore raw

PATCH v6 6/12 samsung:board: misc_init_r: call set_dfu_alt_info()

In reply to Przemyslaw Marczak

This change enable automatic setting of dfu alt info on every boot. This is useful in case of booting one u-boot binary from multiple media.

---
 board/samsung/common/board.c | 3 +++
 1 file changed, 3 insertions(+)
board/samsung/common/board.c +3 -0
index 4d3f216..a46e87b 100644
@@ -324,6 +324,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_SET_DFU_ALT_INFO
+	set_dfu_alt_info();
+#endif
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	set_board_info();
 #endif
Signature · 1 line
1.9.1
#22 lore raw

PATCH v6 7/12 arm:reset: call the reset_misc() before the cpu reset

In reply to Przemyslaw Marczak

On an Odroid U3 board, the SOC is unable to reset the eMMC card in the DWMMC mode by the cpu software reset. Manual reset of the card by switching proper gpio pin - fixes this issue.

Such solution needs to add a call to pre reset function.
This is done by the reset_misc() function, which is called before reset_cpu(). The function reset_misc() is a weak function.

Cc Minkyu Kang <[email protected]>
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Cc Albert ARIBAUD <[email protected]>
Cc Tom Rini <[email protected]>

Changes v4:
- arch/arm/reset: fix weak function attribute to proper style

---
 arch/arm/lib/reset.c | 6 ++++++
 include/common.h     | 1 +
 2 files changed, 7 insertions(+)
arch/arm/lib/reset.c +6 -0
index 7a03580..9a95f08 100644
@@ -23,6 +23,10 @@
 
 #include <common.h>
 
+__weak void reset_misc(void)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	puts ("resetting ...\n");
@@ -30,6 +34,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	udelay (50000);				/* wait 50 ms */
 
 	disable_interrupts();
+
+	reset_misc();
 	reset_cpu(0);
 
 	/*NOTREACHED*/
include/common.h +1 -0
index 82c0a5a..48e4cbd 100644
@@ -619,6 +619,7 @@ int	checkicache   (void);
 int	checkdcache   (void);
 void	upmconfig     (unsigned int, unsigned int *, unsigned int);
 ulong	get_tbclk     (void);
+void	reset_misc    (void);
 void	reset_cpu     (ulong addr);
 #if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup(void *blob, bd_t *bd);
Signature · 1 line
1.9.1
#23 lore raw

PATCH v6 8/12 samsung: board: enable support of multiple board types

In reply to Przemyslaw Marczak

This change adds declaration of functions:
- set_board_type() - called at board_early_init_f()
- get_board_type() - called at checkboard()

For supporting multiple board types in a one config - it is welcome to display the current board model. This is what get_board_type() should return.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v3:
- change the commit order
- include/samsung/misc.h: add new functions declaration
- update a commit message

Changes v4:
- checkboard(): remove redundant variable

Changes v5:
- board.c: move call to set_board_type() into board_early_init_f()
- misc.h: remove get_board_name() function declaration

---
 board/samsung/common/board.c | 15 ++++++++++-----
 include/samsung/misc.h       |  4 ++++
 2 files changed, 14 insertions(+), 5 deletions(-)
board/samsung/common/board.c +10 -5
index a46e87b..3de828a 100644
@@ -137,7 +137,9 @@ static int board_uart_init(void)
 int board_early_init_f(void)
 {
 	int err;
-
+#ifdef CONFIG_BOARD_TYPES
+	set_board_type();
+#endif
 	err = board_uart_init();
 	if (err) {
 		debug("UART init failed\n");
@@ -147,7 +149,6 @@ int board_early_init_f(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 	board_i2c_init(gd->fdt_blob);
 #endif
-
 	return exynos_early_init_f();
 }
 #endif
@@ -280,11 +281,15 @@ int board_mmc_init(bd_t *bis)
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
-	const char *board_name;
+	const char *board_info;
 
-	board_name = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
-	printf("Board: %s\n", board_name ? board_name : "unknown");
+	board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+	printf("Board: %s\n", board_info ? board_info : "unknown");
+#ifdef CONFIG_BOARD_TYPES
+	board_info = get_board_type();
 
+	printf("Model: %s\n", board_info ? board_info : "unknown");
+#endif
 	return 0;
 }
 #endif
include/samsung/misc.h +4 -0
index e82bf32..607e8d4 100644
@@ -33,5 +33,9 @@ char *get_dfu_alt_system(void);
 char *get_dfu_alt_boot(void);
 void set_dfu_alt_info(void);
 #endif
+#ifdef CONFIG_BOARD_TYPES
+void set_board_type(void);
+const char *get_board_type(void);
+#endif
 
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#24 lore raw

PATCH v6 9/12 samsung: misc: use board specific functions to set env board info

In reply to Przemyslaw Marczak

This change adds setup of environmental board info using get_board_name() and get_board_type() functions for config CONFIG_BOARD_TYPES.

This is useful in case of running many boards with just one config.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v2:
- set_board_info: move the bdtype pointer to avoid unused pointer compilation warning

Changes v3:
- samsung: misc: change get_board_type_fdt() to get_board_type()
- samsung: misc: set env $boardname using get_board_* functions for CONFIG_BOARD_TYPES
- update commit msg

Changes v5:
- misc.c: set_bard_info(): remove a call to get_board_name()

---
 board/samsung/common/misc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +10 -2
index 9e52452..8766f0c 100644
@@ -79,8 +79,16 @@ void set_board_info(void)
 	setenv("board_rev", info);
 #endif
 #ifdef CONFIG_OF_LIBFDT
-	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s.dtb",
-		 CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+	const char *bdtype = "";
+	const char *bdname = CONFIG_SYS_BOARD;
+
+#ifdef CONFIG_BOARD_TYPES
+	bdtype = get_board_type();
+	sprintf(info, "%s%s", bdname, bdtype);
+	setenv("boardname", info);
+#endif
+	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
+		 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
 	setenv("fdtfile", info);
 #endif
 }
Signature · 1 line
1.9.1
#25 lore raw

PATCH v6 10/12 odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412

In reply to Przemyslaw Marczak

This board file supports standard features of Odroid X2 and U3 boards:
- Exynos4412 core clock set to 1000MHz and MPLL peripherial clock set to 800MHz,
- MAX77686 power regulator,
- USB PHY,
- enable XCL205 - power for board peripherials
- check board type: U3 or X2.
- enable Odroid U3 FAN cooler

---
Changes v2:
- enable fan on odroid U3

Changes v3:
- odroid.c: clean up board name related code
- odroid.c: remove static from set_board_type()
- odroid.c: add implementation of functions: get_dfu_alt_*
- odroid.c: include misc.h

Changes v4:
- odroid.c: dfu_get_alt_boot: add call get_boot_mode()

Changes v5:
- odroid.c: set_board_type: change mdelay to sdelay, define XCL205 GPIO config
- odroid.c: board_gpio_init(): fix OTG for Odroid U3+
- odroid.c: reserve the last 1 MB of dram for secure firmware
- odroid.c: board_clock_init(): code cleanup
- odroid.c: get_dfu_alt_boot(): remove setenv()
- odroid.c: remove get_board_name() function definition
- odroid.c: add enum ODROID_TYPES

---
 board/samsung/odroid/Makefile |   8 +
 board/samsung/odroid/odroid.c | 470 ++++++++++++++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h  | 255 +++++++++++++++++++++++
 3 files changed, 733 insertions(+)
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
board/samsung/odroid/Makefile new file +8 -0
new file mode 100644
index 0000000..b98aaeb
@@ -0,0 +1,8 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+# Przemyslaw Marczak <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid.o
board/samsung/odroid/odroid.c new file +470 -0

470 lines not on this page · raw message

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

255 lines not on this page · raw message

Signature · 1 line
1.9.1
#26 lore raw

PATCH v6 10/12 odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412

Dear Przemyslaw Marczak,

Quoted 54 lines · Przemyslaw Marczak

This board file supports standard features of Odroid X2 and U3 boards:
- Exynos4412 core clock set to 1000MHz and MPLL peripherial clock set to 800MHz,
- MAX77686 power regulator,
- USB PHY,
- enable XCL205 - power for board peripherials
- check board type: U3 or X2.
- enable Odroid U3 FAN cooler

---
Changes v2:
- enable fan on odroid U3

Changes v3:
- odroid.c: clean up board name related code
- odroid.c: remove static from set_board_type()
- odroid.c: add implementation of functions: get_dfu_alt_*
- odroid.c: include misc.h

Changes v4:
- odroid.c: dfu_get_alt_boot: add call get_boot_mode()

Changes v5:
- odroid.c: set_board_type: change mdelay to sdelay, define XCL205 GPIO config
- odroid.c: board_gpio_init(): fix OTG for Odroid U3+
- odroid.c: reserve the last 1 MB of dram for secure firmware
- odroid.c: board_clock_init(): code cleanup
- odroid.c: get_dfu_alt_boot(): remove setenv()
- odroid.c: remove get_board_name() function definition
- odroid.c: add enum ODROID_TYPES

---
 board/samsung/odroid/Makefile |   8 +
 board/samsung/odroid/odroid.c | 470
++++++++++++++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h  | 255 +++++++++++++++++++++++
 3 files changed, 733 insertions(+)
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
board/samsung/odroid/setup.h new file +2 -0
new file mode 100644
index 0000000..f6acbff
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics

board/samsung/odroid/setup.h line 12

Quoted 10 lines
board/samsung/odroid/setup.h new file +10 -0
+ * Przemyslaw Marczak <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __ODROIDU3_SETUP__
+#define __ODROIDU3_SETUP__
+
+/* A/M PLL_CON0 */
+#define SDIV(x)                 (x & 0x7)

In this file, x should be wrapped with ().
Please fix it.

board/samsung/odroid/setup.h line 24

Quoted 13 lines
board/samsung/odroid/setup.h new file +12 -0
+#define PDIV(x)                 ((x & 0x3f) << 8)
+#define MDIV(x)                 ((x & 0x3ff) << 16)
+#define FSEL(x)                 ((x & 0x1) << 27)
+#define PLL_LOCKED_BIT          (0x1 << 29)
+#define PLL_ENABLE(x)           ((x & 0x1) << 31)
+
+/* CLK_SRC_CPU */
+#define MUX_APLL_SEL(x)         (x & 0x1)
+#define MUX_CORE_SEL(x)         ((x & 0x1) << 16)
+#define MUX_HPM_SEL(x)          ((x & 0x1) << 20)
+#define MUX_MPLL_USER_SEL_C(x)  ((x & 0x1) << 24)
+

Others are looks good to me.

Thanks,
Minkyu Kang.

Signature · 2 lines
from. prom.
www.promsoft.net
#27 lore raw

PATCH v6 10/12 odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412

Hello Minkyu,

Quoted 73 lines · Minkyu Kang

Dear Przemyslaw Marczak,

On 19 July 2014 00:29, Przemyslaw Marczak <[email protected] <mailto:[email protected]>> wrote:

This board file supports standard features of Odroid X2 and U3 boards:
- Exynos4412 core clock set to 1000MHz and MPLL peripherial clock set to 800MHz,
- MAX77686 power regulator,
- USB PHY,
- enable XCL205 - power for board peripherials
- check board type: U3 or X2.
- enable Odroid U3 FAN cooler

<mailto:[email protected]>>
Cc: Minkyu Kang <mk7.kang at samsung.com <mailto:[email protected]>>
Cc: Tom Rini <trini at ti.com <mailto:[email protected]>>

---
Changes v2:
- enable fan on odroid U3

Changes v3:
- odroid.c: clean up board name related code
- odroid.c: remove static from set_board_type()
- odroid.c: add implementation of functions: get_dfu_alt_*
- odroid.c: include misc.h

Changes v4:
- odroid.c: dfu_get_alt_boot: add call get_boot_mode()

Changes v5:
- odroid.c: set_board_type: change mdelay to sdelay, define XCL205 GPIO config
- odroid.c: board_gpio_init(): fix OTG for Odroid U3+
- odroid.c: reserve the last 1 MB of dram for secure firmware
- odroid.c: board_clock_init(): code cleanup
- odroid.c: get_dfu_alt_boot(): remove setenv()
- odroid.c: remove get_board_name() function definition
- odroid.c: add enum ODROID_TYPES
---
board/samsung/odroid/Makefile | 8 +
board/samsung/odroid/odroid.c | 470
++++++++++++++++++++++++++++++++++++++++++
board/samsung/odroid/setup.h | 255 +++++++++++++++++++++++ 3 files changed, 733 insertions(+)
create mode 100644 board/samsung/odroid/Makefile create mode 100644 board/samsung/odroid/odroid.c create mode 100644 board/samsung/odroid/setup.h

diff --git a/board/samsung/odroid/setup.h b/board/samsung/odroid/setup.h new file mode 100644
index 0000000..f6acbff
--- /dev/null
+++ b/board/samsung/odroid/setup.h
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Przemyslaw Marczak <[email protected] <mailto:[email protected]>>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __ODROIDU3_SETUP__
+#define __ODROIDU3_SETUP__
+
+/* A/M PLL_CON0 */
+#define SDIV(x) (x & 0x7)

Quoted 2 lines

In this file, x should be wrapped with ().
Please fix it.

Ok, I will fix this.

Quoted 15 lines
    +#define PDIV(x)                 ((x & 0x3f) << 8)
    +#define MDIV(x)                 ((x & 0x3ff) << 16)
    +#define FSEL(x)                 ((x & 0x1) << 27)
    +#define PLL_LOCKED_BIT          (0x1 << 29)
    +#define PLL_ENABLE(x)           ((x & 0x1) << 31)
    +
    +/* CLK_SRC_CPU */
    +#define MUX_APLL_SEL(x)         (x & 0x1)
    +#define MUX_CORE_SEL(x)         ((x & 0x1) << 16)
    +#define MUX_HPM_SEL(x)          ((x & 0x1) << 20)
    +#define MUX_MPLL_USER_SEL_C(x)  ((x & 0x1) << 24)
    +
Quoted 8 lines

Others are looks good to me.

Thanks,
Minkyu Kang.

--
from. prom.
www.promsoft.net <http://www.promsoft.net>

Thank you,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#28 lore raw

PATCH v6 11/12 odroid: add odroid U3/X2 device tree description

In reply to Przemyslaw Marczak

This is a standard description for Odroid boards.

---
 arch/arm/dts/Makefile              |  3 +-
 arch/arm/dts/exynos4412-odroid.dts | 70 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
arch/arm/dts/Makefile +2 -1
index 6e2e313..8bcc69c 100644
@@ -1,7 +1,8 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
 	exynos4210-universal_c210.dtb \
 	exynos4210-trats.dtb \
-	exynos4412-trats2.dtb
+	exynos4412-trats2.dtb \
+	exynos4412-odroid.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-snow.dtb \
arch/arm/dts/exynos4412-odroid.dts new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
1.9.1
#29 lore raw

PATCH v6 12/12 odroid: add odroid_config

In reply to Przemyslaw Marczak

This config is valid for two devices:
- Odroid X2,
- Odroid U3.

---
Changes v2:
- odroid config: add CONFIG_DFU_ALT_BOOTLOADER
- odroid config: change name of CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*

Changes v3:
- odroid.h: update CONFIG_DFU_ALT_BOOT_** with required bootloader binaries
- odroid.h: add multi image support (CONFIG_FIT)
- odroid.h: add "autoboot" script for multi boot options
- odroid.h: change env name: dfu_alt_info -> dfu_alt_system
- odroid.h: update config name: CONFIG_SET_DFU_ALT_INFO
- odroid.h: reduce boot delay to 0 seconds
- update: doc/README.odroid

Changes v5:
- odroid.h: default environment cleanup
- odroid.h: remove unused definitions
- odroid.h: dfu_alt_system update
- odroid.h: define CONFIG_SET_DFU_ALT_BUF_LEN to 1k
- odroid.h: add init ramdisk support
- update: doc/README.odroid

Changes v6:
- odroid.h: fix ramdisk load issue

---
 boards.cfg               |   1 +
 doc/README.odroid        | 143 +++++++++++++++++++++++++++++++
 include/configs/odroid.h | 216 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 360 insertions(+)
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
boards.cfg +1 -0
index 1ba2081..da16ec2 100644
@@ -298,6 +298,7 @@ Active  arm         armv7          exynos      samsung         smdk5420
 Active  arm         armv7          exynos      samsung         smdkv310            smdkv310                              -                                                                                                                                 Chander Kashyap <[email protected]>
 Active  arm         armv7          exynos      samsung         trats               trats                                 -                                                                                                                                 Lukasz Majewski <[email protected]>
 Active  arm         armv7          exynos      samsung         trats2              trats2                                -                                                                                                                                 Piotr Wilczek <[email protected]>
+Active  arm         armv7          exynos      samsung         odroid              odroid                                -                                                                                                                                 Przemyslaw Marczak <[email protected]>
 Active  arm         armv7          exynos      samsung         universal_c210      s5pc210_universal                     -                                                                                                                                 Przemyslaw Marczak <[email protected]>
 Active  arm         armv7          highbank    -               highbank            highbank                              -                                                                                                                                 Rob Herring <[email protected]>
 Active  arm         armv7          keystone    ti              k2hk_evm            k2hk_evm                              -                                                                                                                                 Vitaly Andrianov <[email protected]>
doc/README.odroid new file +143 -0

143 lines not on this page · raw message

include/configs/odroid.h new file +216 -0

216 lines not on this page · raw message

Signature · 1 line
1.9.1
#30 lore raw

v7 cover Add support to Odroid U3/X2

In reply to Przemyslaw Marczak

This patch set introduces changes to common Samsung code as a preparation of new board support:
- boot device check - code cleanup
- automatic init order of mmc drivers
- automatic setting of dfu entities which depends on boot device
- pre reset function call for board own implementation
- setting board info environment for multi board support

New board config:
- odroid_config - Odroid U3/X2 support

V7 changes:
- some code cleanup

Przemyslaw Marczak (12):
samsung: misc: fix soc revision setting in the set_board_info()
exynos: pinmux: fix the gpio names for exynos4x12 mmc arch:exynos: boot mode: add get_boot_mode(), code cleanup board:samsung: check the boot device and init the right mmc driver.
samsung: misc: add function for setting $dfu_alt_info samsung:board: misc_init_r: call set_dfu_alt_info() arm:reset: call the reset_misc() before the cpu reset
samsung: board: enable support of multiple board types
samsung: misc: use board specific functions to set env board info
odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412
odroid: add odroid U3/X2 device tree description
odroid: add odroid_config

 arch/arm/cpu/armv7/exynos/pinmux.c       |   4 +-
 arch/arm/cpu/armv7/exynos/power.c        |   7 +
 arch/arm/cpu/armv7/exynos/spl_boot.c     |   7 +-
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/exynos4412-odroid.dts       |  70 +++++
 arch/arm/include/asm/arch-exynos/power.h |  21 ++
 arch/arm/include/asm/arch-exynos/spl.h   |  17 +-
 arch/arm/lib/reset.c                     |   6 +
 board/samsung/common/board.c             |  55 +++-
 board/samsung/common/misc.c              |  57 +++-
 board/samsung/odroid/Makefile            |   8 +
 board/samsung/odroid/odroid.c            | 470 +++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h             | 255 +++++++++++++++++
 boards.cfg                               |   1 +
 doc/README.odroid                        | 143 ++++++++++
 include/common.h                         |   1 +
 include/configs/odroid.h                 | 216 ++++++++++++++
 include/samsung/misc.h                   |  10 +
 18 files changed, 1310 insertions(+), 41 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
Signature · 1 line
1.9.1
#31 lore raw

PATCH v7 1/12 samsung: misc: fix soc revision setting in the set_board_info()

The byte order of soc revision was inverted, now it is fixed.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>
---
 board/samsung/common/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +2 -2
index 03106fd..a453a82 100644
@@ -26,8 +26,8 @@ void set_board_info(void)
 {
 	char info[64];
 
-	snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f,
-		 (s5p_cpu_rev & 0xf0) >> 0x04);
+	snprintf(info, ARRAY_SIZE(info), "%u.%u", (s5p_cpu_rev & 0xf0) >> 4,
+		 s5p_cpu_rev & 0xf);
 	setenv("soc_rev", info);
 
 	snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
Signature · 1 line
1.9.1
#32 lore raw

PATCH v7 2/12 exynos: pinmux: fix the gpio names for exynos4x12 mmc

In reply to Przemyslaw Marczak

This change fixes the bad gpio configuration for the exynos dwmmc.

Cc Beomho Seo <[email protected]>
Cc Minkyu Kang <[email protected]>
Cc Jaehoon Chung <[email protected]>
---
 arch/arm/cpu/armv7/exynos/pinmux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +2 -2
index 86a0c75..b929486 100644
@@ -704,8 +704,8 @@ static int exynos4x12_mmc_config(int peripheral, int flags)
 		ext_func = S5P_GPIO_FUNC(0x3);
 		break;
 	case PERIPH_ID_SDMMC4:
-		start = EXYNOS4_GPIO_K00;
-		start_ext = EXYNOS4_GPIO_K13;
+		start = EXYNOS4X12_GPIO_K00;
+		start_ext = EXYNOS4X12_GPIO_K13;
 		func = S5P_GPIO_FUNC(0x3);
 		ext_func = S5P_GPIO_FUNC(0x4);
 		break;
Signature · 1 line
1.9.1
#33 lore raw

PATCH v7 3/12 arch:exynos: boot mode: add get_boot_mode(), code cleanup

In reply to Przemyslaw Marczak

This patch introduces code clean-up for exynos boot mode check. It includes:
- removal of typedef: boot_mode
- move the boot mode enum to arch-exynos/power.h
- add bootmode for sequence: eMMC 4.4 ch4 / SD ch2
- add new function: get_boot_mode() for OM[5:1] pin check
- update spl boot code

Changes v5:
- exynos: boot mode: add missing bootmode (1st:EMMC 4.4 / 2nd:SD ch2)

Changes v6:
- none

changes v7:
- change boot mode name: BOOT_MODE_MMC to BOOT_MODE_SD

---
 arch/arm/cpu/armv7/exynos/power.c        |  7 +++++++
 arch/arm/cpu/armv7/exynos/spl_boot.c     |  7 +++----
 arch/arm/include/asm/arch-exynos/power.h | 21 +++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/spl.h   | 17 ++---------------
 4 files changed, 33 insertions(+), 19 deletions(-)
arch/arm/cpu/armv7/exynos/power.c +7 -0
index 638ee0b..e1ab3d6 100644
@@ -202,3 +202,10 @@ void power_exit_wakeup(void)
 	else
 		exynos4_power_exit_wakeup();
 }
+
+unsigned int get_boot_mode(void)
+{
+	unsigned int om_pin = samsung_get_base_power();
+
+	return readl(om_pin) & OM_PIN_MASK;
+}
arch/arm/cpu/armv7/exynos/spl_boot.c +3 -4
index 7916630..658e4cb 100644
@@ -20,7 +20,6 @@
 #include "clock_init.h"
 
 DECLARE_GLOBAL_DATA_PTR;
-#define OM_STAT         (0x1f << 1)
 
 /* Index into irom ptr table */
 enum index {
@@ -184,7 +183,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
 */
 void copy_uboot_to_ram(void)
 {
-	enum boot_mode bootmode = BOOT_MODE_OM;
+	unsigned int bootmode = BOOT_MODE_OM;
 
 	u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
 	u32 offset = 0, size = 0;
@@ -207,7 +206,7 @@ void copy_uboot_to_ram(void)
 #endif
 
 	if (bootmode == BOOT_MODE_OM)
-		bootmode = readl(samsung_get_base_power()) & OM_STAT;
+		bootmode = get_boot_mode();
 
 	switch (bootmode) {
 #ifdef CONFIG_SPI_BOOTING
@@ -216,7 +215,7 @@ void copy_uboot_to_ram(void)
 		exynos_spi_copy(param->uboot_size, CONFIG_SYS_TEXT_BASE);
 		break;
 #endif
-	case BOOT_MODE_MMC:
+	case BOOT_MODE_SD:
 		offset = BL2_START_OFFSET;
 		size = BL2_SIZE_BLOC_COUNT;
 		copy_bl2 = get_irom_func(MMC_INDEX);
arch/arm/include/asm/arch-exynos/power.h +21 -0
index 4f2447b..e8a98a5 100644
@@ -1670,6 +1670,27 @@ struct exynos5420_power {
 };
 #endif	/* __ASSEMBLY__ */
 
+#define OM_PIN_BITS	0x1f
+#define OM_PIN_SHIFT	0x1
+#define OM_PIN_MASK	(OM_PIN_BITS << OM_PIN_SHIFT)
+
+enum {
+	/*
+	 * Assign the OM pin values for respective boot modes.
+	 * Exynos4 does not support spi boot and the mmc boot OM
+	 * pin values are the same across Exynos4 and Exynos5.
+	 */
+	BOOT_MODE_SD = 4,      /* SD_CH2  | USB */
+	BOOT_MODE_EMMC = 8,     /* EMMC4.4 | USB */
+	BOOT_MODE_EMMC_SD = 40, /* EMMC4.4 | SD_CH2 */
+	BOOT_MODE_SERIAL = 20,
+	/* Boot based on Operating Mode pin settings */
+	BOOT_MODE_OM = 32,
+	BOOT_MODE_USB,	/* Boot using USB download */
+};
+
+unsigned int get_boot_mode(void);
+
 void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable);
 
 #define EXYNOS_MIPI_PHY_ENABLE		(1 << 0)
arch/arm/include/asm/arch-exynos/spl.h +2 -15
index b1d68c3..cdcb2bc 100644
@@ -8,20 +8,7 @@
 #define __ASM_ARCH_EXYNOS_SPL_H__
 
 #include <asm/arch-exynos/dmc.h>
-
-enum boot_mode {
-	/*
-	 * Assign the OM pin values for respective boot modes.
-	 * Exynos4 does not support spi boot and the mmc boot OM
-	 * pin values are the same across Exynos4 and Exynos5.
-	 */
-	BOOT_MODE_MMC = 4,
-	BOOT_MODE_EMMC = 8,     /* EMMC4.4 */
-	BOOT_MODE_SERIAL = 20,
-	/* Boot based on Operating Mode pin settings */
-	BOOT_MODE_OM = 32,
-	BOOT_MODE_USB,	/* Boot using USB download */
-};
+#include <asm/arch/power.h>
 
 #ifndef __ASSEMBLY__
 /* Parameters of early board initialization in SPL */
@@ -62,7 +49,7 @@ struct spl_machine_param {
 	 * table only for mmc boot.
 	 */
 	u32		uboot_size;
-	enum boot_mode	boot_source;	/* Boot device */
+	unsigned	boot_source;	/* Boot device */
 	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
 	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
 	u32		serial_base;	/* Serial base address */
Signature · 1 line
1.9.1
#34 lore raw

PATCH v7 4/12 board:samsung: check the boot device and init the right mmc driver.

In reply to Przemyslaw Marczak

It is possible to boot device using a micro SD or eMMC slots. In this situation, boot device should be registered as a block device 0 in the MMC framework, because CONFIG_SYS_MMC_ENV_DEV is usually set to "0" in the most config cases.

---
Changes V3:
- separate two changes into two commits

Changes V4:
- board.c: add functions: init_mmc() and init_dwmmc()
- board_mmc_init(): call get_boot_mode()

Changes V5:
- none

Changes V6:
- update boot mode name

---
 board/samsung/common/board.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)
board/samsung/common/board.c +27 -10
index 9dc7c83..1fa0e51 100644
@@ -240,22 +240,39 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
+static int init_mmc(void)
+{
+#ifdef CONFIG_SDHCI
+	return exynos_mmc_init(gd->fdt_blob);
+#else
+	return 0;
+#endif
+}
+
+static int init_dwmmc(void)
 {
-	int ret;
 #ifdef CONFIG_DWMMC
-	/* dwmmc initializattion for available channels */
-	ret = exynos_dwmmc_init(gd->fdt_blob);
-	if (ret)
-		debug("dwmmc init failed\n");
+	return exynos_dwmmc_init(gd->fdt_blob);
+#else
+	return 0;
 #endif
+}
+
+int board_mmc_init(bd_t *bis)
+{
+	int ret;
+
+	if (get_boot_mode() == BOOT_MODE_SD) {
+		ret = init_mmc();
+		ret |= init_dwmmc();
+	} else {
+		ret = init_dwmmc();
+		ret |= init_mmc();
+	}
 
-#ifdef CONFIG_SDHCI
-	/* mmc initializattion for available channels */
-	ret = exynos_mmc_init(gd->fdt_blob);
 	if (ret)
 		debug("mmc init failed\n");
-#endif
+
 	return ret;
 }
 #endif
Signature · 1 line
1.9.1
#35 lore raw

PATCH v7 5/12 samsung: misc: add function for setting $dfu_alt_info

In reply to Przemyslaw Marczak

This change introduces new common function:
- set_dfu_alt_info() - put dfu system and bootloader setting into $dfu_alt_info.
functions declaration:
- char *get_dfu_alt_system(void)
- char *get_dfu_alt_boot(void)
- void set_dfu_alt_info(void)
and new config:
- CONFIG_SET_DFU_ALT_INFO

This function can be used for auto setting dfu configuration on boot. Such feature is useful for multi board support by one u-boot binary. Each board should define two functions:
- get_dfu_alt_system()
- get_dfu_alt_boot()

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v2:
- change config names:
CONFIG_SET_DFU_BOOT_ALT to CONFIG_DFU_ALT_BOOTLOADER and CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*
- change function name: set_dfu_boot_alt() to set_dfu_alt_boot()
- remove superfluous ifdefs

Changes v3:
- set $dfu_alt_info at every boot
- new config: CONFIG_SET_DFU_ALT_INFO
- update commit msg

Changes v4:
- set_dfu_alt_info(): add checking the pointer returned by malloc

Changes v5:
- set_dfu_alt_info(): remove malloc and declare cache aligned buffer
- set_dfu_alt_info(): introduce CONFIG_SET_DFU_ALT_BUF_LEN

---
 board/samsung/common/misc.c | 41 +++++++++++++++++++++++++++++++++++++++++
 include/samsung/misc.h      |  6 ++++++
 2 files changed, 47 insertions(+)
board/samsung/common/misc.c +41 -0
index a453a82..9e52452 100644
@@ -11,6 +11,7 @@
 #include <samsung/misc.h>
 #include <errno.h>
 #include <version.h>
+#include <malloc.h>
 #include <linux/sizes.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
@@ -21,6 +22,46 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+void set_dfu_alt_info(void)
+{
+	size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
+	ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
+	char *alt_info = "Settings not found!";
+	char *status = "error!\n";
+	char *alt_setting;
+	char *alt_sep;
+	int offset = 0;
+
+	puts("DFU alt info setting: ");
+
+	alt_setting = get_dfu_alt_boot();
+	if (alt_setting) {
+		setenv("dfu_alt_boot", alt_setting);
+		offset = snprintf(buf, buf_size, "%s", alt_setting);
+	}
+
+	alt_setting = get_dfu_alt_system();
+	if (alt_setting) {
+		if (offset)
+			alt_sep = ";";
+		else
+			alt_sep = "";
+
+		offset += snprintf(buf + offset, buf_size - offset,
+				    "%s%s", alt_sep, alt_setting);
+	}
+
+	if (offset) {
+		alt_info = buf;
+		status = "done\n";
+	}
+
+	setenv("dfu_alt_info", alt_info);
+	puts(status);
+}
+#endif
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 void set_board_info(void)
 {
include/samsung/misc.h +6 -0
index 10653a1..e82bf32 100644
@@ -28,4 +28,10 @@ void check_boot_mode(void);
 void draw_logo(void);
 #endif
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+char *get_dfu_alt_system(void);
+char *get_dfu_alt_boot(void);
+void set_dfu_alt_info(void);
+#endif
+
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#36 lore raw

PATCH v7 6/12 samsung:board: misc_init_r: call set_dfu_alt_info()

In reply to Przemyslaw Marczak

This change enable automatic setting of dfu alt info on every boot. This is useful in case of booting one u-boot binary from multiple media.

---
 board/samsung/common/board.c | 3 +++
 1 file changed, 3 insertions(+)
board/samsung/common/board.c +3 -0
index 1fa0e51..5693813 100644
@@ -324,6 +324,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_SET_DFU_ALT_INFO
+	set_dfu_alt_info();
+#endif
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	set_board_info();
 #endif
Signature · 1 line
1.9.1
#37 lore raw

PATCH v7 7/12 arm:reset: call the reset_misc() before the cpu reset

In reply to Przemyslaw Marczak

On an Odroid U3 board, the SOC is unable to reset the eMMC card in the DWMMC mode by the cpu software reset. Manual reset of the card by switching proper gpio pin - fixes this issue.

Such solution needs to add a call to pre reset function.
This is done by the reset_misc() function, which is called before reset_cpu(). The function reset_misc() is a weak function.

Cc Minkyu Kang <[email protected]>
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Cc Albert ARIBAUD <[email protected]>
Cc Tom Rini <[email protected]>

Changes v4:
- arch/arm/reset: fix weak function attribute to proper style

---
 arch/arm/lib/reset.c | 6 ++++++
 include/common.h     | 1 +
 2 files changed, 7 insertions(+)
arch/arm/lib/reset.c +6 -0
index 7a03580..9a95f08 100644
@@ -23,6 +23,10 @@
 
 #include <common.h>
 
+__weak void reset_misc(void)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	puts ("resetting ...\n");
@@ -30,6 +34,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	udelay (50000);				/* wait 50 ms */
 
 	disable_interrupts();
+
+	reset_misc();
 	reset_cpu(0);
 
 	/*NOTREACHED*/
include/common.h +1 -0
index cc74633..557893a 100644
@@ -623,6 +623,7 @@ int	checkicache   (void);
 int	checkdcache   (void);
 void	upmconfig     (unsigned int, unsigned int *, unsigned int);
 ulong	get_tbclk     (void);
+void	reset_misc    (void);
 void	reset_cpu     (ulong addr);
 #if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup(void *blob, bd_t *bd);
Signature · 1 line
1.9.1
#38 lore raw

PATCH v7 8/12 samsung: board: enable support of multiple board types

In reply to Przemyslaw Marczak

This change adds declaration of functions:
- set_board_type() - called at board_early_init_f()
- get_board_type() - called at checkboard()

For supporting multiple board types in a one config - it is welcome to display the current board model. This is what get_board_type() should return.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v3:
- change the commit order
- include/samsung/misc.h: add new functions declaration
- update a commit message

Changes v4:
- checkboard(): remove redundant variable

Changes v5:
- board.c: move call to set_board_type() into board_early_init_f()
- misc.h: remove get_board_name() function declaration

---
 board/samsung/common/board.c | 15 ++++++++++-----
 include/samsung/misc.h       |  4 ++++
 2 files changed, 14 insertions(+), 5 deletions(-)
board/samsung/common/board.c +10 -5
index 5693813..3d1cf43 100644
@@ -137,7 +137,9 @@ static int board_uart_init(void)
 int board_early_init_f(void)
 {
 	int err;
-
+#ifdef CONFIG_BOARD_TYPES
+	set_board_type();
+#endif
 	err = board_uart_init();
 	if (err) {
 		debug("UART init failed\n");
@@ -147,7 +149,6 @@ int board_early_init_f(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 	board_i2c_init(gd->fdt_blob);
 #endif
-
 	return exynos_early_init_f();
 }
 #endif
@@ -280,11 +281,15 @@ int board_mmc_init(bd_t *bis)
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
-	const char *board_name;
+	const char *board_info;
 
-	board_name = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
-	printf("Board: %s\n", board_name ? board_name : "unknown");
+	board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+	printf("Board: %s\n", board_info ? board_info : "unknown");
+#ifdef CONFIG_BOARD_TYPES
+	board_info = get_board_type();
 
+	printf("Model: %s\n", board_info ? board_info : "unknown");
+#endif
 	return 0;
 }
 #endif
include/samsung/misc.h +4 -0
index e82bf32..607e8d4 100644
@@ -33,5 +33,9 @@ char *get_dfu_alt_system(void);
 char *get_dfu_alt_boot(void);
 void set_dfu_alt_info(void);
 #endif
+#ifdef CONFIG_BOARD_TYPES
+void set_board_type(void);
+const char *get_board_type(void);
+#endif
 
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#39 lore raw

PATCH v7 9/12 samsung: misc: use board specific functions to set env board info

In reply to Przemyslaw Marczak

This change adds setup of environmental board info using get_board_name() and get_board_type() functions for config CONFIG_BOARD_TYPES.

This is useful in case of running many boards with just one config.

Cc Piotr Wilczek <[email protected]>
Cc Minkyu Kang <[email protected]>

---
Changes v2:
- set_board_info: move the bdtype pointer to avoid unused pointer compilation warning

Changes v3:
- samsung: misc: change get_board_type_fdt() to get_board_type()
- samsung: misc: set env $boardname using get_board_* functions for CONFIG_BOARD_TYPES
- update commit msg

Changes v5:
- misc.c: set_bard_info(): remove a call to get_board_name()

---
 board/samsung/common/misc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +10 -2
index 9e52452..8766f0c 100644
@@ -79,8 +79,16 @@ void set_board_info(void)
 	setenv("board_rev", info);
 #endif
 #ifdef CONFIG_OF_LIBFDT
-	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s.dtb",
-		 CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+	const char *bdtype = "";
+	const char *bdname = CONFIG_SYS_BOARD;
+
+#ifdef CONFIG_BOARD_TYPES
+	bdtype = get_board_type();
+	sprintf(info, "%s%s", bdname, bdtype);
+	setenv("boardname", info);
+#endif
+	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
+		 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
 	setenv("fdtfile", info);
 #endif
 }
Signature · 1 line
1.9.1
#40 lore raw

PATCH v7 10/12 odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412

In reply to Przemyslaw Marczak

This board file supports standard features of Odroid X2 and U3 boards:
- Exynos4412 core clock set to 1000MHz and MPLL peripherial clock set to 800MHz,
- MAX77686 power regulator,
- USB PHY,
- enable XCL205 - power for board peripherials
- check board type: U3 or X2.
- enable Odroid U3 FAN cooler

---
Changes v2:
- enable fan on odroid U3

Changes v3:
- odroid.c: clean up board name related code
- odroid.c: remove static from set_board_type()
- odroid.c: add implementation of functions: get_dfu_alt_*
- odroid.c: include misc.h

Changes v4:
- odroid.c: dfu_get_alt_boot: add call get_boot_mode()

Changes v5:
- odroid.c: set_board_type: change mdelay to sdelay, define XCL205 GPIO config
- odroid.c: board_gpio_init(): fix OTG for Odroid U3+
- odroid.c: reserve the last 1 MB of dram for secure firmware
- odroid.c: board_clock_init(): code cleanup
- odroid.c: get_dfu_alt_boot(): remove setenv()
- odroid.c: remove get_board_name() function definition
- odroid.c: add enum ODROID_TYPES

---
 board/samsung/odroid/Makefile |   8 +
 board/samsung/odroid/odroid.c | 470 ++++++++++++++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h  | 255 +++++++++++++++++++++++
 3 files changed, 733 insertions(+)
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
board/samsung/odroid/Makefile new file +8 -0
new file mode 100644
index 0000000..b98aaeb
@@ -0,0 +1,8 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+# Przemyslaw Marczak <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid.o
board/samsung/odroid/odroid.c new file +470 -0

470 lines not on this page · raw message

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

255 lines not on this page · raw message

Signature · 1 line
1.9.1
#41 lore raw

PATCH v7 11/12 odroid: add odroid U3/X2 device tree description

In reply to Przemyslaw Marczak

This is a standard description for Odroid boards.

---
 arch/arm/dts/Makefile              |  3 +-
 arch/arm/dts/exynos4412-odroid.dts | 70 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
arch/arm/dts/Makefile +2 -1
index 6e2e313..8bcc69c 100644
@@ -1,7 +1,8 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
 	exynos4210-universal_c210.dtb \
 	exynos4210-trats.dtb \
-	exynos4412-trats2.dtb
+	exynos4412-trats2.dtb \
+	exynos4412-odroid.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-snow.dtb \
arch/arm/dts/exynos4412-odroid.dts new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
1.9.1
#42 lore raw

PATCH v7 12/12 odroid: add odroid_config

In reply to Przemyslaw Marczak

This config is valid for two devices:
- Odroid X2,
- Odroid U3.

---
Changes v2:
- odroid config: add CONFIG_DFU_ALT_BOOTLOADER
- odroid config: change name of CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*

Changes v3:
- odroid.h: update CONFIG_DFU_ALT_BOOT_** with required bootloader binaries
- odroid.h: add multi image support (CONFIG_FIT)
- odroid.h: add "autoboot" script for multi boot options
- odroid.h: change env name: dfu_alt_info -> dfu_alt_system
- odroid.h: update config name: CONFIG_SET_DFU_ALT_INFO
- odroid.h: reduce boot delay to 0 seconds
- update: doc/README.odroid

Changes v5:
- odroid.h: default environment cleanup
- odroid.h: remove unused definitions
- odroid.h: dfu_alt_system update
- odroid.h: define CONFIG_SET_DFU_ALT_BUF_LEN to 1k
- odroid.h: add init ramdisk support
- update: doc/README.odroid

Changes v6:
- odroid.h: fix ramdisk load issue

---
 boards.cfg               |   1 +
 doc/README.odroid        | 143 +++++++++++++++++++++++++++++++
 include/configs/odroid.h | 216 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 360 insertions(+)
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
boards.cfg +1 -0
index 8e2db82..458c500 100644
@@ -293,6 +293,7 @@ Active  arm         armv7          exynos      samsung         smdk5420
 Active  arm         armv7          exynos      samsung         smdkv310            smdkv310                              -                                                                                                                                 Chander Kashyap <[email protected]>
 Active  arm         armv7          exynos      samsung         trats               trats                                 -                                                                                                                                 Lukasz Majewski <[email protected]>
 Active  arm         armv7          exynos      samsung         trats2              trats2                                -                                                                                                                                 Piotr Wilczek <[email protected]>
+Active  arm         armv7          exynos      samsung         odroid              odroid                                -                                                                                                                                 Przemyslaw Marczak <[email protected]>
 Active  arm         armv7          exynos      samsung         universal_c210      s5pc210_universal                     -                                                                                                                                 Przemyslaw Marczak <[email protected]>
 Active  arm         armv7          highbank    -               highbank            highbank                              -                                                                                                                                 Rob Herring <[email protected]>
 Active  arm         armv7          keystone    ti              k2hk_evm            k2hk_evm                              -                                                                                                                                 Vitaly Andrianov <[email protected]>
doc/README.odroid new file +143 -0

143 lines not on this page · raw message

include/configs/odroid.h new file +216 -0

216 lines not on this page · raw message

Signature · 1 line
1.9.1
#43 lore raw

v8 cover Add support to Odroid U3/X2

In reply to Przemyslaw Marczak

This patch set introduces changes to common Samsung code as a preparation of new board support:
- boot device check - code cleanup
- automatic init order of mmc drivers
- automatic setting of dfu entities which depends on boot device
- pre reset function call for board own implementation
- setting board info environment for multi board support

New board config:
- odroid_config - Odroid U3/X2 support

V8 changes:
- patchset adjust to Kconfig

Przemyslaw Marczak (12):
samsung: misc: fix soc revision setting in the set_board_info()
exynos: pinmux: fix the gpio names for exynos4x12 mmc arch:exynos: boot mode: add get_boot_mode(), code cleanup board:samsung: check the boot device and init the right mmc driver.
samsung: misc: add function for setting $dfu_alt_info samsung:board: misc_init_r: call set_dfu_alt_info() arm:reset: call the reset_misc() before the cpu reset
samsung: board: enable support of multiple board types
samsung: misc: use board specific functions to set env board info
odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412
odroid: add odroid U3/X2 device tree description
odroid: kconfig: add odroid_defconfig

 arch/arm/cpu/armv7/exynos/Kconfig        |   4 +
 arch/arm/cpu/armv7/exynos/pinmux.c       |   4 +-
 arch/arm/cpu/armv7/exynos/power.c        |   7 +
 arch/arm/cpu/armv7/exynos/spl_boot.c     |   7 +-
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/exynos4412-odroid.dts       |  70 +++++
 arch/arm/include/asm/arch-exynos/power.h |  21 ++
 arch/arm/include/asm/arch-exynos/spl.h   |  17 +-
 arch/arm/lib/reset.c                     |   6 +
 board/samsung/common/board.c             |  55 +++-
 board/samsung/common/misc.c              |  57 +++-
 board/samsung/odroid/Kconfig             |  15 +
 board/samsung/odroid/MAINTAINERS         |   6 +
 board/samsung/odroid/Makefile            |   8 +
 board/samsung/odroid/odroid.c            | 470 +++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h             | 255 +++++++++++++++++
 configs/odroid_defconfig                 |   3 +
 doc/README.odroid                        | 143 ++++++++++
 include/common.h                         |   1 +
 include/configs/odroid.h                 | 216 ++++++++++++++
 include/samsung/misc.h                   |  10 +
 21 files changed, 1337 insertions(+), 41 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
 create mode 100644 board/samsung/odroid/Kconfig
 create mode 100644 board/samsung/odroid/MAINTAINERS
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
 create mode 100644 configs/odroid_defconfig
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
Signature · 1 line
1.9.1
#44 lore raw

PATCH v8 1/12 samsung: misc: fix soc revision setting in the set_board_info()

The byte order of soc revision was inverted, now it is fixed.

---
 board/samsung/common/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +2 -2
index 03106fd..a453a82 100644
@@ -26,8 +26,8 @@ void set_board_info(void)
 {
 	char info[64];
 
-	snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f,
-		 (s5p_cpu_rev & 0xf0) >> 0x04);
+	snprintf(info, ARRAY_SIZE(info), "%u.%u", (s5p_cpu_rev & 0xf0) >> 4,
+		 s5p_cpu_rev & 0xf);
 	setenv("soc_rev", info);
 
 	snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
Signature · 1 line
1.9.1
#45 lore raw

PATCH v8 2/12 exynos: pinmux: fix the gpio names for exynos4x12 mmc

In reply to Przemyslaw Marczak

This change fixes the bad gpio configuration for the exynos dwmmc.

Cc Beomho Seo <[email protected]>
Cc Minkyu Kang <[email protected]>
Cc Jaehoon Chung <[email protected]>
---
 arch/arm/cpu/armv7/exynos/pinmux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +2 -2
index 86a0c75..b929486 100644
@@ -704,8 +704,8 @@ static int exynos4x12_mmc_config(int peripheral, int flags)
 		ext_func = S5P_GPIO_FUNC(0x3);
 		break;
 	case PERIPH_ID_SDMMC4:
-		start = EXYNOS4_GPIO_K00;
-		start_ext = EXYNOS4_GPIO_K13;
+		start = EXYNOS4X12_GPIO_K00;
+		start_ext = EXYNOS4X12_GPIO_K13;
 		func = S5P_GPIO_FUNC(0x3);
 		ext_func = S5P_GPIO_FUNC(0x4);
 		break;
Signature · 1 line
1.9.1
#46 lore raw

PATCH v8 3/12 arch:exynos: boot mode: add get_boot_mode(), code cleanup

In reply to Przemyslaw Marczak

This patch introduces code clean-up for exynos boot mode check. It includes:
- removal of typedef: boot_mode
- move the boot mode enum to arch-exynos/power.h
- add bootmode for sequence: eMMC 4.4 ch4 / SD ch2
- add new function: get_boot_mode() for OM[5:1] pin check
- update spl boot code

Changes v5:
- exynos: boot mode: add missing bootmode (1st:EMMC 4.4 / 2nd:SD ch2)

Changes v6:
- none

changes v7:
- change boot mode name: BOOT_MODE_MMC to BOOT_MODE_SD

---
 arch/arm/cpu/armv7/exynos/power.c        |  7 +++++++
 arch/arm/cpu/armv7/exynos/spl_boot.c     |  7 +++----
 arch/arm/include/asm/arch-exynos/power.h | 21 +++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/spl.h   | 17 ++---------------
 4 files changed, 33 insertions(+), 19 deletions(-)
arch/arm/cpu/armv7/exynos/power.c +7 -0
index 638ee0b..e1ab3d6 100644
@@ -202,3 +202,10 @@ void power_exit_wakeup(void)
 	else
 		exynos4_power_exit_wakeup();
 }
+
+unsigned int get_boot_mode(void)
+{
+	unsigned int om_pin = samsung_get_base_power();
+
+	return readl(om_pin) & OM_PIN_MASK;
+}
arch/arm/cpu/armv7/exynos/spl_boot.c +3 -4
index 7916630..658e4cb 100644
@@ -20,7 +20,6 @@
 #include "clock_init.h"
 
 DECLARE_GLOBAL_DATA_PTR;
-#define OM_STAT         (0x1f << 1)
 
 /* Index into irom ptr table */
 enum index {
@@ -184,7 +183,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
 */
 void copy_uboot_to_ram(void)
 {
-	enum boot_mode bootmode = BOOT_MODE_OM;
+	unsigned int bootmode = BOOT_MODE_OM;
 
 	u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
 	u32 offset = 0, size = 0;
@@ -207,7 +206,7 @@ void copy_uboot_to_ram(void)
 #endif
 
 	if (bootmode == BOOT_MODE_OM)
-		bootmode = readl(samsung_get_base_power()) & OM_STAT;
+		bootmode = get_boot_mode();
 
 	switch (bootmode) {
 #ifdef CONFIG_SPI_BOOTING
@@ -216,7 +215,7 @@ void copy_uboot_to_ram(void)
 		exynos_spi_copy(param->uboot_size, CONFIG_SYS_TEXT_BASE);
 		break;
 #endif
-	case BOOT_MODE_MMC:
+	case BOOT_MODE_SD:
 		offset = BL2_START_OFFSET;
 		size = BL2_SIZE_BLOC_COUNT;
 		copy_bl2 = get_irom_func(MMC_INDEX);
arch/arm/include/asm/arch-exynos/power.h +21 -0
index 4f2447b..e8a98a5 100644
@@ -1670,6 +1670,27 @@ struct exynos5420_power {
 };
 #endif	/* __ASSEMBLY__ */
 
+#define OM_PIN_BITS	0x1f
+#define OM_PIN_SHIFT	0x1
+#define OM_PIN_MASK	(OM_PIN_BITS << OM_PIN_SHIFT)
+
+enum {
+	/*
+	 * Assign the OM pin values for respective boot modes.
+	 * Exynos4 does not support spi boot and the mmc boot OM
+	 * pin values are the same across Exynos4 and Exynos5.
+	 */
+	BOOT_MODE_SD = 4,      /* SD_CH2  | USB */
+	BOOT_MODE_EMMC = 8,     /* EMMC4.4 | USB */
+	BOOT_MODE_EMMC_SD = 40, /* EMMC4.4 | SD_CH2 */
+	BOOT_MODE_SERIAL = 20,
+	/* Boot based on Operating Mode pin settings */
+	BOOT_MODE_OM = 32,
+	BOOT_MODE_USB,	/* Boot using USB download */
+};
+
+unsigned int get_boot_mode(void);
+
 void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable);
 
 #define EXYNOS_MIPI_PHY_ENABLE		(1 << 0)
arch/arm/include/asm/arch-exynos/spl.h +2 -15
index b1d68c3..cdcb2bc 100644
@@ -8,20 +8,7 @@
 #define __ASM_ARCH_EXYNOS_SPL_H__
 
 #include <asm/arch-exynos/dmc.h>
-
-enum boot_mode {
-	/*
-	 * Assign the OM pin values for respective boot modes.
-	 * Exynos4 does not support spi boot and the mmc boot OM
-	 * pin values are the same across Exynos4 and Exynos5.
-	 */
-	BOOT_MODE_MMC = 4,
-	BOOT_MODE_EMMC = 8,     /* EMMC4.4 */
-	BOOT_MODE_SERIAL = 20,
-	/* Boot based on Operating Mode pin settings */
-	BOOT_MODE_OM = 32,
-	BOOT_MODE_USB,	/* Boot using USB download */
-};
+#include <asm/arch/power.h>
 
 #ifndef __ASSEMBLY__
 /* Parameters of early board initialization in SPL */
@@ -62,7 +49,7 @@ struct spl_machine_param {
 	 * table only for mmc boot.
 	 */
 	u32		uboot_size;
-	enum boot_mode	boot_source;	/* Boot device */
+	unsigned	boot_source;	/* Boot device */
 	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
 	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
 	u32		serial_base;	/* Serial base address */
Signature · 1 line
1.9.1
#47 lore raw

PATCH v8 4/12 board:samsung: check the boot device and init the right mmc driver.

In reply to Przemyslaw Marczak

It is possible to boot device using a micro SD or eMMC slots. In this situation, boot device should be registered as a block device 0 in the MMC framework, because CONFIG_SYS_MMC_ENV_DEV is usually set to "0" in the most config cases.

---
Changes V3:
- separate two changes into two commits

Changes V4:
- board.c: add functions: init_mmc() and init_dwmmc()
- board_mmc_init(): call get_boot_mode()

Changes V5:
- none

Changes V6:
- update boot mode name

---
 board/samsung/common/board.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)
board/samsung/common/board.c +27 -10
index 9dc7c83..1fa0e51 100644
@@ -240,22 +240,39 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
+static int init_mmc(void)
+{
+#ifdef CONFIG_SDHCI
+	return exynos_mmc_init(gd->fdt_blob);
+#else
+	return 0;
+#endif
+}
+
+static int init_dwmmc(void)
 {
-	int ret;
 #ifdef CONFIG_DWMMC
-	/* dwmmc initializattion for available channels */
-	ret = exynos_dwmmc_init(gd->fdt_blob);
-	if (ret)
-		debug("dwmmc init failed\n");
+	return exynos_dwmmc_init(gd->fdt_blob);
+#else
+	return 0;
 #endif
+}
+
+int board_mmc_init(bd_t *bis)
+{
+	int ret;
+
+	if (get_boot_mode() == BOOT_MODE_SD) {
+		ret = init_mmc();
+		ret |= init_dwmmc();
+	} else {
+		ret = init_dwmmc();
+		ret |= init_mmc();
+	}
 
-#ifdef CONFIG_SDHCI
-	/* mmc initializattion for available channels */
-	ret = exynos_mmc_init(gd->fdt_blob);
 	if (ret)
 		debug("mmc init failed\n");
-#endif
+
 	return ret;
 }
 #endif
Signature · 1 line
1.9.1
#48 lore raw

PATCH v8 5/12 samsung: misc: add function for setting $dfu_alt_info

In reply to Przemyslaw Marczak

This change introduces new common function:
- set_dfu_alt_info() - put dfu system and bootloader setting into $dfu_alt_info.
functions declaration:
- char *get_dfu_alt_system(void)
- char *get_dfu_alt_boot(void)
- void set_dfu_alt_info(void)
and new config:
- CONFIG_SET_DFU_ALT_INFO

This function can be used for auto setting dfu configuration on boot. Such feature is useful for multi board support by one u-boot binary. Each board should define two functions:
- get_dfu_alt_system()
- get_dfu_alt_boot()

---
Changes v2:
- change config names:
CONFIG_SET_DFU_BOOT_ALT to CONFIG_DFU_ALT_BOOTLOADER and CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*
- change function name: set_dfu_boot_alt() to set_dfu_alt_boot()
- remove superfluous ifdefs

Changes v3:
- set $dfu_alt_info at every boot
- new config: CONFIG_SET_DFU_ALT_INFO
- update commit msg

Changes v4:
- set_dfu_alt_info(): add checking the pointer returned by malloc

Changes v5:
- set_dfu_alt_info(): remove malloc and declare cache aligned buffer
- set_dfu_alt_info(): introduce CONFIG_SET_DFU_ALT_BUF_LEN

---
 board/samsung/common/misc.c | 41 +++++++++++++++++++++++++++++++++++++++++
 include/samsung/misc.h      |  6 ++++++
 2 files changed, 47 insertions(+)
board/samsung/common/misc.c +41 -0
index a453a82..9e52452 100644
@@ -11,6 +11,7 @@
 #include <samsung/misc.h>
 #include <errno.h>
 #include <version.h>
+#include <malloc.h>
 #include <linux/sizes.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
@@ -21,6 +22,46 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+void set_dfu_alt_info(void)
+{
+	size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
+	ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
+	char *alt_info = "Settings not found!";
+	char *status = "error!\n";
+	char *alt_setting;
+	char *alt_sep;
+	int offset = 0;
+
+	puts("DFU alt info setting: ");
+
+	alt_setting = get_dfu_alt_boot();
+	if (alt_setting) {
+		setenv("dfu_alt_boot", alt_setting);
+		offset = snprintf(buf, buf_size, "%s", alt_setting);
+	}
+
+	alt_setting = get_dfu_alt_system();
+	if (alt_setting) {
+		if (offset)
+			alt_sep = ";";
+		else
+			alt_sep = "";
+
+		offset += snprintf(buf + offset, buf_size - offset,
+				    "%s%s", alt_sep, alt_setting);
+	}
+
+	if (offset) {
+		alt_info = buf;
+		status = "done\n";
+	}
+
+	setenv("dfu_alt_info", alt_info);
+	puts(status);
+}
+#endif
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 void set_board_info(void)
 {
include/samsung/misc.h +6 -0
index 10653a1..e82bf32 100644
@@ -28,4 +28,10 @@ void check_boot_mode(void);
 void draw_logo(void);
 #endif
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+char *get_dfu_alt_system(void);
+char *get_dfu_alt_boot(void);
+void set_dfu_alt_info(void);
+#endif
+
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#49 lore raw

PATCH v8 6/12 samsung:board: misc_init_r: call set_dfu_alt_info()

In reply to Przemyslaw Marczak

This change enable automatic setting of dfu alt info on every boot. This is useful in case of booting one u-boot binary from multiple media.

---
 board/samsung/common/board.c | 3 +++
 1 file changed, 3 insertions(+)
board/samsung/common/board.c +3 -0
index 1fa0e51..5693813 100644
@@ -324,6 +324,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_SET_DFU_ALT_INFO
+	set_dfu_alt_info();
+#endif
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	set_board_info();
 #endif
Signature · 1 line
1.9.1
#50 lore raw

PATCH v8 7/12 arm:reset: call the reset_misc() before the cpu reset

In reply to Przemyslaw Marczak

On an Odroid U3 board, the SOC is unable to reset the eMMC card in the DWMMC mode by the cpu software reset. Manual reset of the card by switching proper gpio pin - fixes this issue.

Such solution needs to add a call to pre reset function.
This is done by the reset_misc() function, which is called before reset_cpu(). The function reset_misc() is a weak function.

Cc Minkyu Kang <[email protected]>
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Cc Albert ARIBAUD <[email protected]>
Cc Tom Rini <[email protected]>

Changes v4:
- arch/arm/reset: fix weak function attribute to proper style

---
 arch/arm/lib/reset.c | 6 ++++++
 include/common.h     | 1 +
 2 files changed, 7 insertions(+)
arch/arm/lib/reset.c +6 -0
index 7a03580..9a95f08 100644
@@ -23,6 +23,10 @@
 
 #include <common.h>
 
+__weak void reset_misc(void)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	puts ("resetting ...\n");
@@ -30,6 +34,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	udelay (50000);				/* wait 50 ms */
 
 	disable_interrupts();
+
+	reset_misc();
 	reset_cpu(0);
 
 	/*NOTREACHED*/
include/common.h +1 -0
index c7e51ca..97c04df 100644
@@ -616,6 +616,7 @@ int	checkicache   (void);
 int	checkdcache   (void);
 void	upmconfig     (unsigned int, unsigned int *, unsigned int);
 ulong	get_tbclk     (void);
+void	reset_misc    (void);
 void	reset_cpu     (ulong addr);
 #if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup(void *blob, bd_t *bd);
Signature · 1 line
1.9.1
#51 lore raw

PATCH v8 8/12 samsung: board: enable support of multiple board types

In reply to Przemyslaw Marczak

This change adds declaration of functions:
- set_board_type() - called at board_early_init_f()
- get_board_type() - called at checkboard()

For supporting multiple board types in a one config - it is welcome to display the current board model. This is what get_board_type() should return.

---
Changes v3:
- change the commit order
- include/samsung/misc.h: add new functions declaration
- update a commit message

Changes v4:
- checkboard(): remove redundant variable

Changes v5:
- board.c: move call to set_board_type() into board_early_init_f()
- misc.h: remove get_board_name() function declaration

---
 board/samsung/common/board.c | 15 ++++++++++-----
 include/samsung/misc.h       |  4 ++++
 2 files changed, 14 insertions(+), 5 deletions(-)
board/samsung/common/board.c +10 -5
index 5693813..3d1cf43 100644
@@ -137,7 +137,9 @@ static int board_uart_init(void)
 int board_early_init_f(void)
 {
 	int err;
-
+#ifdef CONFIG_BOARD_TYPES
+	set_board_type();
+#endif
 	err = board_uart_init();
 	if (err) {
 		debug("UART init failed\n");
@@ -147,7 +149,6 @@ int board_early_init_f(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 	board_i2c_init(gd->fdt_blob);
 #endif
-
 	return exynos_early_init_f();
 }
 #endif
@@ -280,11 +281,15 @@ int board_mmc_init(bd_t *bis)
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
-	const char *board_name;
+	const char *board_info;
 
-	board_name = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
-	printf("Board: %s\n", board_name ? board_name : "unknown");
+	board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+	printf("Board: %s\n", board_info ? board_info : "unknown");
+#ifdef CONFIG_BOARD_TYPES
+	board_info = get_board_type();
 
+	printf("Model: %s\n", board_info ? board_info : "unknown");
+#endif
 	return 0;
 }
 #endif
include/samsung/misc.h +4 -0
index e82bf32..607e8d4 100644
@@ -33,5 +33,9 @@ char *get_dfu_alt_system(void);
 char *get_dfu_alt_boot(void);
 void set_dfu_alt_info(void);
 #endif
+#ifdef CONFIG_BOARD_TYPES
+void set_board_type(void);
+const char *get_board_type(void);
+#endif
 
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
Signature · 1 line
1.9.1
#52 lore raw

PATCH v8 9/12 samsung: misc: use board specific functions to set env board info

In reply to Przemyslaw Marczak

This change adds setup of environmental board info using get_board_name() and get_board_type() functions for config CONFIG_BOARD_TYPES.

This is useful in case of running many boards with just one config.

---
Changes v2:
- set_board_info: move the bdtype pointer to avoid unused pointer compilation warning

Changes v3:
- samsung: misc: change get_board_type_fdt() to get_board_type()
- samsung: misc: set env $boardname using get_board_* functions for CONFIG_BOARD_TYPES
- update commit msg

Changes v5:
- misc.c: set_bard_info(): remove a call to get_board_name()

---
 board/samsung/common/misc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
board/samsung/common/misc.c +10 -2
index 9e52452..8766f0c 100644
@@ -79,8 +79,16 @@ void set_board_info(void)
 	setenv("board_rev", info);
 #endif
 #ifdef CONFIG_OF_LIBFDT
-	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s.dtb",
-		 CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+	const char *bdtype = "";
+	const char *bdname = CONFIG_SYS_BOARD;
+
+#ifdef CONFIG_BOARD_TYPES
+	bdtype = get_board_type();
+	sprintf(info, "%s%s", bdname, bdtype);
+	setenv("boardname", info);
+#endif
+	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
+		 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
 	setenv("fdtfile", info);
 #endif
 }
Signature · 1 line
1.9.1
#53 lore raw

PATCH v8 10/12 odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412

In reply to Przemyslaw Marczak

This board file supports standard features of Odroid X2 and U3 boards:
- Exynos4412 core clock set to 1000MHz and MPLL peripherial clock set to 800MHz,
- MAX77686 power regulator,
- USB PHY,
- enable XCL205 - power for board peripherials
- check board type: U3 or X2.
- enable Odroid U3 FAN cooler

---
Changes v2:
- enable fan on odroid U3

Changes v3:
- odroid.c: clean up board name related code
- odroid.c: remove static from set_board_type()
- odroid.c: add implementation of functions: get_dfu_alt_*
- odroid.c: include misc.h

Changes v4:
- odroid.c: dfu_get_alt_boot: add call get_boot_mode()

Changes v5:
- odroid.c: set_board_type: change mdelay to sdelay, define XCL205 GPIO config
- odroid.c: board_gpio_init(): fix OTG for Odroid U3+
- odroid.c: reserve the last 1 MB of dram for secure firmware
- odroid.c: board_clock_init(): code cleanup
- odroid.c: get_dfu_alt_boot(): remove setenv()
- odroid.c: remove get_board_name() function definition
- odroid.c: add enum ODROID_TYPES

---
 board/samsung/odroid/Makefile |   8 +
 board/samsung/odroid/odroid.c | 470 ++++++++++++++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h  | 255 +++++++++++++++++++++++
 3 files changed, 733 insertions(+)
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
board/samsung/odroid/Makefile new file +8 -0
new file mode 100644
index 0000000..b98aaeb
@@ -0,0 +1,8 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+# Przemyslaw Marczak <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid.o
board/samsung/odroid/odroid.c new file +470 -0

470 lines not on this page · raw message

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

255 lines not on this page · raw message

Signature · 1 line
1.9.1
#54 lore raw

PATCH v8 11/12 odroid: add odroid U3/X2 device tree description

In reply to Przemyslaw Marczak

This is a standard description for Odroid boards.

---
 arch/arm/dts/Makefile              |  3 +-
 arch/arm/dts/exynos4412-odroid.dts | 70 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
arch/arm/dts/Makefile +2 -1
index c46b7be..1ccd827 100644
@@ -1,7 +1,8 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
 	exynos4210-universal_c210.dtb \
 	exynos4210-trats.dtb \
-	exynos4412-trats2.dtb
+	exynos4412-trats2.dtb \
+	exynos4412-odroid.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-snow.dtb \
arch/arm/dts/exynos4412-odroid.dts new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
1.9.1
#55 lore raw

PATCH v8 12/12 odroid: kconfig: add odroid_defconfig

In reply to Przemyslaw Marczak

This config is valid for two devices:
- Odroid X2,
- Odroid U3.

---
Changes v2:
- odroid config: add CONFIG_DFU_ALT_BOOTLOADER
- odroid config: change name of CONFIG_DFU_BOOT_ALT_* to CONFIG_DFU_ALT_BOOT_*

Changes v3:
- odroid.h: update CONFIG_DFU_ALT_BOOT_** with required bootloader binaries
- odroid.h: add multi image support (CONFIG_FIT)
- odroid.h: add "autoboot" script for multi boot options
- odroid.h: change env name: dfu_alt_info -> dfu_alt_system
- odroid.h: update config name: CONFIG_SET_DFU_ALT_INFO
- odroid.h: reduce boot delay to 0 seconds
- update: doc/README.odroid

Changes v5:
- odroid.h: default environment cleanup
- odroid.h: remove unused definitions
- odroid.h: dfu_alt_system update
- odroid.h: define CONFIG_SET_DFU_ALT_BUF_LEN to 1k
- odroid.h: add init ramdisk support
- update: doc/README.odroid

Changes v6:
- odroid.h: fix ramdisk load issue

Changes v8:
- add Kconfig configuration for Odroid

---
 arch/arm/cpu/armv7/exynos/Kconfig |   4 +
 board/samsung/odroid/Kconfig      |  15 +++
 board/samsung/odroid/MAINTAINERS  |   6 ++
 configs/odroid_defconfig          |   3 +
 doc/README.odroid                 | 143 +++++++++++++++++++++++++
 include/configs/odroid.h          | 216 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 387 insertions(+)
 create mode 100644 board/samsung/odroid/Kconfig
 create mode 100644 board/samsung/odroid/MAINTAINERS
 create mode 100644 configs/odroid_defconfig
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h
arch/arm/cpu/armv7/exynos/Kconfig +4 -0
index f1cacdc..b6a558b 100644
@@ -18,6 +18,9 @@ config TARGET_ORIGEN
 config TARGET_TRATS2
 	bool "Exynos4412 Trat2 board"
 
+config TARGET_ODROID
+	bool "Exynos4412 Odroid board"
+
 config TARGET_ARNDALE
 	bool "Exynos5250 Arndale board"
 
@@ -48,6 +51,7 @@ source "board/samsung/trats/Kconfig"
 source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
+source "board/samsung/odroid/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
board/samsung/odroid/Kconfig new file +15 -0
new file mode 100644
index 0000000..8dcfb48
@@ -0,0 +1,15 @@
+if TARGET_ODROID
+
+config SYS_BOARD
+	string
+	default "odroid"
+
+config SYS_VENDOR
+	string
+	default "samsung"
+
+config SYS_CONFIG_NAME
+	string
+	default "odroid"
+
+endif
board/samsung/odroid/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..2131d36
@@ -0,0 +1,6 @@
+ODROID BOARD
+M:	Przemyslaw Marczak <[email protected]>
+S:	Maintained
+F:	board/samsung/odroid/
+F:	include/configs/odroid.h
+F:	configs/odroid_defconfig
configs/odroid_defconfig new file +3 -0
new file mode 100644
index 0000000..a1c7ac5
@@ -0,0 +1,3 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID=y
doc/README.odroid new file +143 -0

143 lines not on this page · raw message

include/configs/odroid.h new file +216 -0

216 lines not on this page · raw message

Signature · 1 line
1.9.1
#56 lore raw

v8 cover Add support to Odroid U3/X2

In reply to Przemyslaw Marczak

Hello Minkyu,

Quoted 14 lines · Przemyslaw Marczak

This patch set introduces changes to common Samsung code as a preparation of new board support:
- boot device check - code cleanup
- automatic init order of mmc drivers
- automatic setting of dfu entities which depends on boot device
- pre reset function call for board own implementation
- setting board info environment for multi board support

New board config:
- odroid_config - Odroid U3/X2 support

V8 changes:
- patchset adjust to Kconfig

Quoted 14 lines

Przemyslaw Marczak (12):
samsung: misc: fix soc revision setting in the set_board_info()
exynos: pinmux: fix the gpio names for exynos4x12 mmc arch:exynos: boot mode: add get_boot_mode(), code cleanup board:samsung: check the boot device and init the right mmc driver.
samsung: misc: add function for setting $dfu_alt_info samsung:board: misc_init_r: call set_dfu_alt_info() arm:reset: call the reset_misc() before the cpu reset
samsung: board: enable support of multiple board types
samsung: misc: use board specific functions to set env board info
odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412
odroid: add odroid U3/X2 device tree description
odroid: kconfig: add odroid_defconfig

Can you please merge this patch set as a result of rebase on the top of the last Kconfig changes?

Best Regards,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#57 lore raw

v8 cover Add support to Odroid U3/X2

In reply to Przemyslaw Marczak
Quoted 51 lines · Przemyslaw Marczak

This patch set introduces changes to common Samsung code as a preparation of new board support:
- boot device check - code cleanup
- automatic init order of mmc drivers
- automatic setting of dfu entities which depends on boot device
- pre reset function call for board own implementation
- setting board info environment for multi board support

New board config:
- odroid_config - Odroid U3/X2 support

V8 changes:
- patchset adjust to Kconfig

Przemyslaw Marczak (12):
samsung: misc: fix soc revision setting in the set_board_info()
exynos: pinmux: fix the gpio names for exynos4x12 mmc arch:exynos: boot mode: add get_boot_mode(), code cleanup board:samsung: check the boot device and init the right mmc driver.
samsung: misc: add function for setting $dfu_alt_info samsung:board: misc_init_r: call set_dfu_alt_info() arm:reset: call the reset_misc() before the cpu reset
samsung: board: enable support of multiple board types
samsung: misc: use board specific functions to set env board info
odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412
odroid: add odroid U3/X2 device tree description
odroid: kconfig: add odroid_defconfig

 arch/arm/cpu/armv7/exynos/Kconfig        |   4 +
 arch/arm/cpu/armv7/exynos/pinmux.c       |   4 +-
 arch/arm/cpu/armv7/exynos/power.c        |   7 +
 arch/arm/cpu/armv7/exynos/spl_boot.c     |   7 +-
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/exynos4412-odroid.dts       |  70 +++++
 arch/arm/include/asm/arch-exynos/power.h |  21 ++
 arch/arm/include/asm/arch-exynos/spl.h   |  17 +-
 arch/arm/lib/reset.c                     |   6 +
 board/samsung/common/board.c             |  55 +++-
 board/samsung/common/misc.c              |  57 +++-
 board/samsung/odroid/Kconfig             |  15 +
 board/samsung/odroid/MAINTAINERS         |   6 +
 board/samsung/odroid/Makefile            |   8 +
 board/samsung/odroid/odroid.c            | 470 +++++++++++++++++++++++++++++++
 board/samsung/odroid/setup.h             | 255 +++++++++++++++++
 configs/odroid_defconfig                 |   3 +
 doc/README.odroid                        | 143 ++++++++++
 include/common.h                         |   1 +
 include/configs/odroid.h                 | 216 ++++++++++++++
 include/samsung/misc.h                   |  10 +
 21 files changed, 1337 insertions(+), 41 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts
Quoted 9 lines
 create mode 100644 board/samsung/odroid/Kconfig
 create mode 100644 board/samsung/odroid/MAINTAINERS
 create mode 100644 board/samsung/odroid/Makefile
 create mode 100644 board/samsung/odroid/odroid.c
 create mode 100644 board/samsung/odroid/setup.h
 create mode 100644 configs/odroid_defconfig
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h

applied to u-boot-samsung

Thanks,
Minkyu Kang.