Skip to contentSkip to conversation

Adds support for Exynos5422 odroid xu3 board

PATCH Superseded Hyungwon Hwang 10 participants 48 messages Nov 27, 2014 – Jan 7, 2015

Subsystems (2)

v9 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v9 cover Adds support for Exynos5422 odroid xu3 board

This is v9 of the patchset adding support Odroud XU3 board.

link to the previous version:
v2: https://www.mail-archive.com/u-boot at lists.denx.de/msg152275.html
v3: https://www.mail-archive.com/u-boot%40lists.denx.de/msg152677.html
v4: https://patchwork.ozlabs.org/patch/407411/
v5: https://patchwork.ozlabs.org/patch/407941/
v6: https://patchwork.ozlabs.org/patch/408647/
v7: https://patchwork.ozlabs.org/patch/410204/
v8: https://patchwork.ozlabs.org/patch/410709/

The patchset by Akshay Saraswat is already merged into u-boot-samsung. Please ignore the instruction about the additional patchset in v8.

How to test this patch:
1. git clone http://git.denx.de/u-boot-samsung.git
2. Apply this patchset
3. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- odroid-xu3_config
4. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j8
5. Now you can use u-boot-dtb.bin for your downloading

WANRNING: The u-boot-dtb.bin must not be bigger than 335872 bytes. Depending on your compiler, it can be. Try another one if you get a problem. I use 'gcc version 4.8.2 (Ubuntu/Linaro 4.8.2-16ubuntu4)' on Ubuntu 64-bit machine.

Note: If you use micro SD card for your test you have to apply the below patch additionally. This patch is needed, because micro sd card is recognized as MMC1 instead of MMC0. Additional work is needed to make it work regardless of device id.

include/configs/exynos5-common.h +1 -1
index ba591e7..437eaae 100644
@@ -109,7 +109,7 @@
 
 #define CONFIG_SYS_MONITOR_BASE        0x00000000
 
-#define CONFIG_SYS_MMC_ENV_DEV         0
+#define CONFIG_SYS_MMC_ENV_DEV         1
 
 #define CONFIG_SECURE_BL1_ONLY
 
include/configs/odroid_xu3.h +4 -4
index cda4f26..b46ccad 100644
@@ -110,15 +110,15 @@
                "run kernel_args;" \
                "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
        "autoboot=" \
-               "if test -e mmc 0 Image.itb; then; " \
+               "if test -e mmc 1 Image.itb; then; " \
                        "run boot_fit;" \
-               "elif test -e mmc 0 zImage; then; " \
+               "elif test -e mmc 1 zImage; then; " \
                        "run boot_zimg;" \
-               "elif test -e mmc 0 uImage; then; " \
+               "elif test -e mmc 1 uImage; then; " \
                        "run boot_uimg;" \
                "fi;\0" \
        "console=" CONFIG_DEFAULT_CONSOLE \
-       "mmcbootdev=0\0" \
+       "mmcbootdev=1\0" \
        "mmcbootpart=1\0" \
        "mmcrootdev=0\0" \
        "mmcrootpart=2\0" \

Changes for v2:
- Add a patch to add new common setup header file for Odroid X2/U3 and Odroid XU3

Changes for v3:
- Remove the patch which adds new common setup header file from v2
- Remove the wrong patch to fix GPIO information of Exynos 5800
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Fix some trivial typos in comments

Changes for v4:
- Add MMC FIFO buffer's configuration to DT file
- Make CONFIG_OF_CONTROL be set by the target information
- Add basic document to doc/README.odroid-xu3
- Add CONFIG_CMD_EXT4 to config file
- Add environment size and offset to config file
- Add extra default environment to make bootable without modification
- Remove unnecessary features from config file

Changes for v5:
- Add the specific build instruction
- Update the information of patchset by Akshay Saraswat
- Convert /include/ to #include in DT file

Changes for v6:
- Separate out the documentation to new commit
- Remove unnecessary header file inclusuib from the board-specific setup file
- Make the function board_clock_init be declared, only when CONFIG_BOARD_EARLY_INIT_F is defined

Changes for v7:
- Fix several errata in the documentation
- Remove OF_CONTROL dependency from !SPL_BUILD

Changes for v8:
- Remove unnecessary properties in DT mmc node

Changes for v9:
- Remove the first patch which change GPIO entries order. It became useless, after DT support is added
- Remove useless variables in the default environment
- Add the new contents to the documentation of Odroid X2/U2, instead of making new document for Odorid XU3
- Remove the detailed information in the header file, and leave the reference to the documentation

Hyungwon Hwang (2):
Odroid-XU3: Add support for Odroid-XU3
Odroid-XU3: Add documentation for Odroid-XU3

 arch/arm/cpu/armv7/exynos/Kconfig     |   5 ++
 arch/arm/dts/Makefile                 |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  57 +++++++++++++++
 board/samsung/odroid-xu3/Kconfig      |  12 +++
 board/samsung/odroid-xu3/MAINTAINERS  |   6 ++
 board/samsung/odroid-xu3/Makefile     |   7 ++
 board/samsung/odroid-xu3/odroid-xu3.c | 122 +++++++++++++++++++++++++++++++
 board/samsung/odroid-xu3/setup.h      |  95 ++++++++++++++++++++++++
 configs/odroid-xu3_defconfig          |   4 +
 doc/README.odroid                     |  46 ++++++++----
 include/configs/odroid.h              |   5 --
 include/configs/odroid_xu3.h          | 133 ++++++++++++++++++++++++++++++++++
 12 files changed, 473 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts
 create mode 100644 board/samsung/odroid-xu3/Kconfig
 create mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 create mode 100644 board/samsung/odroid-xu3/Makefile
 create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 create mode 100644 board/samsung/odroid-xu3/setup.h
 create mode 100644 configs/odroid-xu3_defconfig
 create mode 100644 include/configs/odroid_xu3.h
Signature · 1 line
1.9.1
#1 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

This patch adds support for Odroid-XU3.

---
Changes for v3:
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Remove unnecessary macros from board-specific header file
- Fix some trivial typos in comments

Changes for v4:
- Add MMC FIFO buffer's configuration to DT file
- Make CONFIG_OF_CONTROL be set by the target information
- Add basic document to doc/README.odroid-xu3
- Add CONFIG_CMD_EXT4 to config file
- Add environment size and offset to config file
- Add extra default environment to make bootable without modification
- Remove unnecessary features from config file

Changes for v5:
- Convert /include/ to #include in DT file

Changes for v6:
- Separate out the documentation to new commit
- Remove unnecessary header file inclusions from the board-specific setup file
- Make the function board_clock_init be declared, only when CONFIG_BOARD_EARLY_INIT_F is defined

Changes for v7:
- Remove OF_CONTROL dependency from !SPL_BUILD

Changes for v8:
- Remove unnecessary properties in DT mmc node

Changes for v9:
- Remove useless variables in the default environment
- Replace the detailed information to the reference to the documentation

 arch/arm/cpu/armv7/exynos/Kconfig     |   5 ++
 arch/arm/dts/Makefile                 |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  57 +++++++++++++++
 board/samsung/odroid-xu3/Kconfig      |  12 +++
 board/samsung/odroid-xu3/MAINTAINERS  |   6 ++
 board/samsung/odroid-xu3/Makefile     |   7 ++
 board/samsung/odroid-xu3/odroid-xu3.c | 122 +++++++++++++++++++++++++++++++
 board/samsung/odroid-xu3/setup.h      |  95 ++++++++++++++++++++++++
 configs/odroid-xu3_defconfig          |   4 +
 include/configs/odroid.h              |   5 --
 include/configs/odroid_xu3.h          | 133 ++++++++++++++++++++++++++++++++++
 11 files changed, 443 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts
 create mode 100644 board/samsung/odroid-xu3/Kconfig
 create mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 create mode 100644 board/samsung/odroid-xu3/Makefile
 create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 create mode 100644 board/samsung/odroid-xu3/setup.h
 create mode 100644 configs/odroid-xu3_defconfig
 create mode 100644 include/configs/odroid_xu3.h
arch/arm/cpu/armv7/exynos/Kconfig +5 -0
index 13dbd95..16c9a0e 100644
@@ -24,6 +24,10 @@ config TARGET_TRATS2
 config TARGET_ODROID
 	bool "Exynos4412 Odroid board"
 
+config TARGET_ODROID_XU3
+	bool "Exynos5422 Odroid board"
+	select OF_CONTROL
+
 config TARGET_ARNDALE
 	bool "Exynos5250 Arndale board"
 	select SUPPORT_SPL
@@ -65,6 +69,7 @@ source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
+source "board/samsung/odroid-xu3/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
arch/arm/dts/Makefile +2 -1
index e5846ea..a811b1b 100644
@@ -13,7 +13,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-smdk5250.dtb \
 	exynos5420-smdk5420.dtb \
 	exynos5420-peach-pit.dtb \
-	exynos5800-peach-pi.dtb
+	exynos5800-peach-pi.dtb \
+	exynos5422-odroidxu3.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra20-medcom-wide.dtb \
 	tegra20-paz00.dtb \
arch/arm/dts/exynos5422-odroidxu3.dts new file +57 -0

57 lines not on this page · raw message

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

122 lines not on this page · raw message

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

95 lines not on this page · raw message

configs/odroid-xu3_defconfig new file +4 -0
new file mode 100644
index 0000000..74aa0cf
@@ -0,0 +1,4 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID_XU3=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
include/configs/odroid.h +0 -5
index 807e96b..660b6ae 100644
@@ -166,11 +166,6 @@
 	"mmcbootpart=1\0" \
 	"mmcrootdev=0\0" \
 	"mmcrootpart=2\0" \
-	"bootdelay=0\0" \
-	"dfu_alt_system="CONFIG_DFU_ALT \
-	"dfu_alt_info=Please reset the board\0" \
-	"consoleon=set console console=ttySAC1,115200n8; save; reset\0" \
-	"consoleoff=set console console=ram; save; reset\0" \
 	"initrdname=uInitrd\0" \
 	"initrdaddr=42000000\0" \
 	"fdtaddr=40800000\0"
include/configs/odroid_xu3.h new file +133 -0

133 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Quoted 137 lines · Hyungwon Hwang

This patch adds support for Odroid-XU3.

---
Changes for v3:
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Remove unnecessary macros from board-specific header file
- Fix some trivial typos in comments

Changes for v4:
- Add MMC FIFO buffer's configuration to DT file
- Make CONFIG_OF_CONTROL be set by the target information
- Add basic document to doc/README.odroid-xu3
- Add CONFIG_CMD_EXT4 to config file
- Add environment size and offset to config file
- Add extra default environment to make bootable without modification
- Remove unnecessary features from config file

Changes for v5:
- Convert /include/ to #include in DT file

Changes for v6:
- Separate out the documentation to new commit
- Remove unnecessary header file inclusions from the board-specific setup file
- Make the function board_clock_init be declared, only when CONFIG_BOARD_EARLY_INIT_F is defined

Changes for v7:
- Remove OF_CONTROL dependency from !SPL_BUILD

Changes for v8:
- Remove unnecessary properties in DT mmc node

Changes for v9:
- Remove useless variables in the default environment
- Replace the detailed information to the reference to the documentation

 arch/arm/cpu/armv7/exynos/Kconfig     |   5 ++
 arch/arm/dts/Makefile                 |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  57 +++++++++++++++
 board/samsung/odroid-xu3/Kconfig      |  12 +++
 board/samsung/odroid-xu3/MAINTAINERS  |   6 ++
 board/samsung/odroid-xu3/Makefile     |   7 ++
 board/samsung/odroid-xu3/odroid-xu3.c | 122 +++++++++++++++++++++++++++++++
 board/samsung/odroid-xu3/setup.h      |  95 ++++++++++++++++++++++++
 configs/odroid-xu3_defconfig          |   4 +
 include/configs/odroid.h              |   5 --
 include/configs/odroid_xu3.h          | 133 ++++++++++++++++++++++++++++++++++
 11 files changed, 443 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts
 create mode 100644 board/samsung/odroid-xu3/Kconfig
 create mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 create mode 100644 board/samsung/odroid-xu3/Makefile
 create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 create mode 100644 board/samsung/odroid-xu3/setup.h
 create mode 100644 configs/odroid-xu3_defconfig
 create mode 100644 include/configs/odroid_xu3.h
arch/arm/cpu/armv7/exynos/Kconfig +5 -0
index 13dbd95..16c9a0e 100644
@@ -24,6 +24,10 @@ config TARGET_TRATS2
 config TARGET_ODROID
 	bool "Exynos4412 Odroid board"
 
+config TARGET_ODROID_XU3
+	bool "Exynos5422 Odroid board"
+	select OF_CONTROL
+
 config TARGET_ARNDALE
 	bool "Exynos5250 Arndale board"
 	select SUPPORT_SPL
@@ -65,6 +69,7 @@ source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
+source "board/samsung/odroid-xu3/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
arch/arm/dts/Makefile +2 -1
index e5846ea..a811b1b 100644
@@ -13,7 +13,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-smdk5250.dtb \
 	exynos5420-smdk5420.dtb \
 	exynos5420-peach-pit.dtb \
-	exynos5800-peach-pi.dtb
+	exynos5800-peach-pi.dtb \
+	exynos5422-odroidxu3.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra20-medcom-wide.dtb \
 	tegra20-paz00.dtb \
arch/arm/dts/exynos5422-odroidxu3.dts new file +31 -0
new file mode 100644
index 0000000..533d88e
@@ -0,0 +1,57 @@
+/*
+ * Odroid XU3 device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/dts-v1/;
+#include "exynos54xx.dtsi"
+
+/ {
+	model = "Odroid XU3 based on EXYNOS5422";
+	compatible = "samsung,odroidxu3", "samsung,exynos5";
+
+	aliases {
+		serial0 = "/serial at 12C00000";
+		console = "/serial at 12C20000";
+	};
+
+	memory {
+		device_type = "memory";
+		reg =  <0x40000000 0x10000000
+			0x50000000 0x10000000
+			0x60000000 0x10000000
+			0x70000000 0x10000000
+			0x80000000 0x10000000
+			0x90000000 0x10000000
+			0xa0000000 0x10000000
+			0xb0000000 0xea00000>;

arch/arm/dts/exynos5422-odroidxu3.dts line 41

Quoted 10 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +10 -0
+	};
+
+	serial at 12C20000 {
+		status="okay";
+	};
+
+	mmc at 12200000 {
+		samsung,bus-width = <8>;
+		samsung,timing = <1 3 3>;
+		fifoth_val = <0x200f0020>;

If you resend the patch, i want to change the fifoth_val from 0x200f0020 to 0x201f0020. (Well, i'm not sure what's right. but when i have checked, the fifoth_depth is 0x40. Then Rx_MASK = FIFOTH_DEPTH/2 - 1, TX_MASK = FIFOTH_DEPTH/2.

arch/arm/dts/exynos5422-odroidxu3.dts line 51

Quoted 10 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +10 -0
+	};
+
+	mmc at 12210000 {
+		status = "disabled";
+	};
+
+	mmc at 12220000 {
+		samsung,bus-width = <4>;
+		samsung,timing = <1 2 3>;
+		fifoth_val = <0x200f0020>;

Ditto.

Quoted 294 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +6 -0
+	};
+
+	mmc at 12230000 {
+		status = "disabled";
+	};
+};
board/samsung/odroid-xu3/Kconfig new file +12 -0
new file mode 100644
index 0000000..6159692
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+	default "odroid-xu3"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
+	default "odroid_xu3"
+
+endif
board/samsung/odroid-xu3/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..50cf928
@@ -0,0 +1,6 @@
+ODROID-XU3 BOARD
+M:	Hyungwon Hwang <[email protected]>
+S:	Maintained
+F:	board/samsung/odroid-xu3/
+F:	include/configs/odroid_xu3.h
+F:	configs/odroid-xu3_defconfig
board/samsung/odroid-xu3/Makefile new file +7 -0
new file mode 100644
index 0000000..85ae5c5
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid-xu3.o
board/samsung/odroid-xu3/odroid-xu3.c new file +122 -0
new file mode 100644
index 0000000..8c54842
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+	return 0;
+}
+
+int exynos_init(void)
+{
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+	unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+	struct exynos5420_clock *clk = (struct exynos5420_clock *)
+						samsung_get_base_clock();
+	/*
+	 * CMU_CPU clocks src to MPLL
+	 * Bit values:                 0  ; 1
+	 * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+	 * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+	 * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+	 * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+	*/
+
+	/* Set CMU_CPU clocks src to OSCCLK */
+	clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+	set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	/* Set APLL to 1200MHz */
+	clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+			PLL_ENABLE(1);
+	set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CMU_CPU clocks src to APLL */
+	set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+	      PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+	set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+	      PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+	while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+		continue;
+
+	/* Set MPLL to 800MHz */
+	set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CLKMUX_UART src to MPLL */
+	clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) | UART3_SEL(7);
+	set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) | UART3_SEL(3);
+
+	clrsetbits_le32(&clk->src_peric0, clr, set);
+
+	/* Set SCLK_UART to 400 MHz (MPLL / 2) */
+	clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+	      UART3_RATIO(15);
+	set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+	      UART3_RATIO(1);
+
+	clrsetbits_le32(&clk->div_peric0, clr, set);
+
+	while (readl(&clk->div_stat_peric0) & DIV_STAT_PERIC0_CHANGING)
+		continue;
+
+	/* Set CLKMUX_MMC src to MPLL */
+	clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+	set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+	clrsetbits_le32(&clk->src_fsys, clr, set);
+
+	clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) | MMC2_RATIO(0x3ff);
+	set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+	/* Wait for divider ready status */
+	while (readl(&clk->div_stat_fsys1) & DIV_STAT_FSYS1_CHANGING)
+		continue;
+
+	return 0;
+}
+
+int exynos_early_init_f(void)
+{
+	return board_clock_init();
+}
+#endif
board/samsung/odroid-xu3/setup.h new file +95 -0
new file mode 100644
index 0000000..143c189
@@ -0,0 +1,95 @@
+/*
+ * (C) Copyright 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __ODROID_XU3_SETUP__
+#define __ODROID_XU3_SETUP__
+
+#define SDIV(x)                 ((x) & 0x7)
+#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)
+
+/* CLK_MUX_STAT_CPU */
+#define APLL_SEL(x)             ((x) & 0x7)
+#define CORE_SEL(x)             (((x) & 0x7) << 16)
+#define MUX_STAT_CPU_CHANGING(x)	!(((x) & APLL_SEL(0)) ||	\
+					   (x) & APLL_SEL(1) ||		\
+					   (x) & CORE_SEL(0) ||		\
+					   (x) & CORE_SEL(1))
+
+/* CLK_DIV_CPU0 */
+#define ARM_RATIO(x)           ((x) & 0x7)
+#define CPUD_RATIO(x)         (((x) & 0x7) << 4)
+#define ATB_RATIO(x)         (((x) & 0x7) << 16)
+#define PCLK_DBG_RATIO(x)       (((x) & 0x7) << 20)
+#define APLL_RATIO(x)           (((x) & 0x7) << 24)
+#define ARM2_RATIO(x)         (((x) & 0x7) << 28)
+
+/* CLK_DIV_STAT_CPU0 */
+#define DIV_CPUD(x)           (((x) & 0x1) << 4)
+#define DIV_ATB(x)              (((x) & 0x1) << 16)
+#define DIV_PCLK_DBG(x)         (((x) & 0x1) << 20)
+#define DIV_APLL(x)             (((x) & 0x1) << 24)
+#define DIV_ARM2(x)            (((x) & 0x1) << 28)
+
+#define DIV_STAT_CHANGING	0x1
+#define DIV_STAT_CPU0_CHANGING  (DIV_CPUD(DIV_STAT_CHANGING) | \
+				 DIV_ATB(DIV_STAT_CHANGING) | \
+				 DIV_PCLK_DBG(DIV_STAT_CHANGING) | \
+				 DIV_APLL(DIV_STAT_CHANGING) | \
+				 DIV_ARM2(DIV_STAT_CHANGING))
+
+/* Set CLK_SRC_PERIC0 */
+#define UART0_SEL(x)		(((x) & 0xf) << 4)
+#define UART1_SEL(x)		(((x) & 0xf) << 8)
+#define UART2_SEL(x)		(((x) & 0xf) << 12)
+#define UART3_SEL(x)		(((x) & 0xf) << 16)
+
+/* Set CLK_DIV_PERIC0 */
+#define UART0_RATIO(x)		(((x) & 0xf) << 8)
+#define UART1_RATIO(x)		(((x) & 0xf) << 12)
+#define UART2_RATIO(x)		(((x) & 0xf) << 16)
+#define UART3_RATIO(x)		(((x) & 0xf) << 20)
+
+/* Set CLK_DIV_STAT_PERIC0 */
+#define DIV_UART0(x)		((x) & 0x1)
+#define DIV_UART1(x)		(((x) & 0x1) << 4)
+#define DIV_UART2(x)		(((x) & 0x1) << 8)
+#define DIV_UART3(x)		(((x) & 0x1) << 12)
+#define DIV_UART4(x)		(((x) & 0x1) << 16)
+
+#define DIV_STAT_PERIC0_CHANGING (DIV_UART4(DIV_STAT_CHANGING) | \
+				  DIV_UART3(DIV_STAT_CHANGING) | \
+				  DIV_UART2(DIV_STAT_CHANGING) | \
+				  DIV_UART1(DIV_STAT_CHANGING) | \
+				  DIV_UART0(DIV_STAT_CHANGING))
+
+/* CLK_SRC_FSYS */
+#define MUX_MMC0_SEL(x)		(((x) & 0x7) << 8)
+#define MUX_MMC1_SEL(x)		(((x) & 0x7) << 12)
+#define MUX_MMC2_SEL(x)		(((x) & 0x7) << 16)
+
+/* CLK_DIV_FSYS1 */
+#define MMC0_RATIO(x)		((x) & 0x3ff)
+#define MMC1_RATIO(x)		(((x) & 0x3ff) << 10)
+#define MMC2_RATIO(x)		(((x) & 0x3ff) << 20)
+
+#define DIV_MMC0(x)		(((x) & 1) << 20)
+#define DIV_MMC1(x)		(((x) & 1) << 24)
+#define DIV_MMC2(x)		(((x) & 1) << 28)
+
+#define DIV_STAT_FSYS1_CHANGING	(DIV_MMC0(DIV_STAT_CHANGING) | \
+				 DIV_MMC1(DIV_STAT_CHANGING) | \
+				 DIV_MMC2(DIV_STAT_CHANGING))
+
+#endif
configs/odroid-xu3_defconfig new file +4 -0
new file mode 100644
index 0000000..74aa0cf
@@ -0,0 +1,4 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID_XU3=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
include/configs/odroid.h +0 -0
index 807e96b..660b6ae 100644
@@ -166,11 +166,6 @@
 	"mmcbootpart=1\0" \

include/configs/odroid.h line 171

Quoted 10 lines
include/configs/odroid.h +0 -5
 	"mmcrootdev=0\0" \
 	"mmcrootpart=2\0" \
-	"bootdelay=0\0" \
-	"dfu_alt_system="CONFIG_DFU_ALT \
-	"dfu_alt_info=Please reset the board\0" \
-	"consoleon=set console console=ttySAC1,115200n8; save; reset\0" \
-	"consoleoff=set console console=ram; save; reset\0" \
 	"initrdname=uInitrd\0" \
 	"initrdaddr=42000000\0" \
 	"fdtaddr=40800000\0"

This is not XU3, separate the patch.

Quoted 113 lines
include/configs/odroid_xu3.h new file +107 -0
new file mode 100644
index 0000000..1d53653
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_ODROID_XU3_H
+#define __CONFIG_ODROID_XU3_H
+
+#include "exynos5-common.h"
+
+#define CONFIG_SYS_PROMPT		"ODROID-XU3 # "
+#define CONFIG_IDENT_STRING		" for ODROID-XU3"
+
+#define CONFIG_BOARD_COMMON
+
+#define CONFIG_SYS_SDRAM_BASE		0x40000000
+#define CONFIG_SYS_TEXT_BASE		0x43E00000
+
+/* select serial console configuration */
+#define CONFIG_SERIAL2			/* use SERIAL 2 */
+
+#define TZPC_BASE_OFFSET		0x10000
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FAT
+
+/*
+ * FIXME: The number of bank is actually 8. But there is no way to reserver the
+ * last 16 Mib in the last bank now. So I just excluded the last bank
+ * temporally.
+ */
+#define CONFIG_NR_DRAM_BANKS	7
+#define SDRAM_BANK_SIZE		(256UL << 20UL)	/* 256 MB */
+
+#define CONFIG_ENV_IS_IN_MMC
+
+#undef CONFIG_ENV_SIZE
+#undef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_SIZE			4096
+#define CONFIG_ENV_OFFSET		(SZ_1K * 1280) /* 1.25 MiB offset */
+
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - 0x1000000)
+
+#define CONFIG_BOOTCOMMAND		"run autoboot"
+#define CONFIG_DEFAULT_CONSOLE		"console=ttySAC2,115200n8\0"
+
+/*
+ * For details, refer the documentation: doc/README.odroid
+*/
+#ifdef CONFIG_EXTRA_ENV_SETTINGS
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#endif
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadkernel=fatload mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
+		"${kernelname}\0" \
+	"loadinitrd=fatload mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
+		"${initrdname}\0" \
+	"loaddtb=fatload mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \
+		"${fdtfile}\0" \
+	"check_ramdisk=" \
+		"if run loadinitrd; then " \
+			"setenv initrd_addr ${initrdaddr};" \
+		"else " \
+			"setenv initrd_addr -;" \
+		"fi;\0" \
+	"check_dtb=" \
+		"if run loaddtb; then " \
+			"setenv fdt_addr ${fdtaddr};" \
+		"else " \
+			"setenv fdt_addr;" \
+		"fi;\0" \
+	"kernel_args=" \
+		"setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
+		" rootwait ${console} ${opts}\0" \
+	"boot_fit=" \
+		"setenv kerneladdr 0x42000000;" \
+		"setenv kernelname Image.itb;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootm ${kerneladdr}#${boardname}\0" \
+	"boot_uimg=" \
+		"setenv kerneladdr 0x40007FC0;" \
+		"setenv kernelname uImage;" \
+		"run check_dtb;" \
+		"run check_ramdisk;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
+	"boot_zimg=" \
+		"setenv kerneladdr 0x40007FC0;" \
+		"setenv kernelname zImage;" \
+		"run check_dtb;" \
+		"run check_ramdisk;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
+	"autoboot=" \
+		"if test -e mmc 0 Image.itb; then; " \
+			"run boot_fit;" \
+		"elif test -e mmc 0 zImage; then; " \
+			"run boot_zimg;" \
+		"elif test -e mmc 0 uImage; then; " \
+			"run boot_uimg;" \

include/configs/odroid_xu3.h line 117

Quoted 10 lines
include/configs/odroid_xu3.h new file +10 -0
+		"fi;\0" \
+	"console=" CONFIG_DEFAULT_CONSOLE \
+	"mmcbootdev=0\0" \
+	"mmcbootpart=1\0" \
+	"mmcrootdev=0\0" \
+	"mmcrootpart=2\0" \
+	"bootdelay=0\0" \
+	"dfu_alt_info=Please reset the board\0" \
+	"consoleon=set console console=ttySAC2,115200n8; save; reset\0" \
+	"consoleoff=set console console=ram; save; reset\0" \

I think you want to remove these.

Best Regards,
Jaehoon Chung

Quoted 17 lines
include/configs/odroid_xu3.h new file +16 -0
+	"initrdname=uInitrd\0" \
+	"initrdaddr=42000000\0" \
+	"fdtaddr=40800000\0"
+
+/* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
+#undef CONFIG_EXYNOS_TMU
+#undef CONFIG_TMU_CMD_DTT
+
+#ifdef CONFIG_CMD_NET
+#undef CONFIG_CMD_NET
+#undef CONFIG_SMC911X
+#undef CONFIG_CMD_PXE
+#undef CONFIG_MENU
+#endif
+
+#endif	/* __CONFIG_H */
#3 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Quoted 150 lines · On Fri, 28 Nov 2014 00:16:15 +0900 Jaehoon Chung <[email protected]> wrote:
Quoted 149 lines · Hyungwon Hwang

This patch adds support for Odroid-XU3.

---
Changes for v3:
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Remove unnecessary macros from board-specific header file
- Fix some trivial typos in comments

Changes for v4:
- Add MMC FIFO buffer's configuration to DT file
- Make CONFIG_OF_CONTROL be set by the target information
- Add basic document to doc/README.odroid-xu3
- Add CONFIG_CMD_EXT4 to config file
- Add environment size and offset to config file
- Add extra default environment to make bootable without modification
- Remove unnecessary features from config file

Changes for v5:
- Convert /include/ to #include in DT file

Changes for v6:
- Separate out the documentation to new commit
- Remove unnecessary header file inclusions from the board-specific setup file
- Make the function board_clock_init be declared, only when CONFIG_BOARD_EARLY_INIT_F is defined

Changes for v7:
- Remove OF_CONTROL dependency from !SPL_BUILD

Changes for v8:
- Remove unnecessary properties in DT mmc node

Changes for v9:
- Remove useless variables in the default environment
- Replace the detailed information to the reference to the documentation

 arch/arm/cpu/armv7/exynos/Kconfig     |   5 ++
 arch/arm/dts/Makefile                 |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  57 +++++++++++++++
 board/samsung/odroid-xu3/Kconfig      |  12 +++
 board/samsung/odroid-xu3/MAINTAINERS  |   6 ++
 board/samsung/odroid-xu3/Makefile     |   7 ++
 board/samsung/odroid-xu3/odroid-xu3.c | 122

+++++++++++++++++++++++++++++++
board/samsung/odroid-xu3/setup.h | 95
++++++++++++++++++++++++ configs/odroid-xu3_defconfig |
4 + include/configs/odroid.h | 5 --
include/configs/odroid_xu3.h | 133
++++++++++++++++++++++++++++++++++ 11 files changed, 443 insertions(+), 6 deletions(-) create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts create mode 100644 board/samsung/odroid-xu3/Kconfig create mode 100644 board/samsung/odroid-xu3/MAINTAINERS create mode 100644 board/samsung/odroid-xu3/Makefile create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c create mode 100644 board/samsung/odroid-xu3/setup.h create mode 100644 configs/odroid-xu3_defconfig create mode 100644 include/configs/odroid_xu3.h

(quoted diff) +0 -0

b/arch/arm/cpu/armv7/exynos/Kconfig index 13dbd95..16c9a0e 100644

arch/arm/cpu/armv7/exynos/Kconfig +5 -0
@@ -24,6 +24,10 @@ config TARGET_TRATS2
 config TARGET_ODROID
 	bool "Exynos4412 Odroid board"
 
+config TARGET_ODROID_XU3
+	bool "Exynos5422 Odroid board"
+	select OF_CONTROL
+
 config TARGET_ARNDALE
 	bool "Exynos5250 Arndale board"
 	select SUPPORT_SPL
@@ -65,6 +69,7 @@ source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
+source "board/samsung/odroid-xu3/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
arch/arm/dts/Makefile +2 -1
index e5846ea..a811b1b 100644
@@ -13,7 +13,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
 	exynos5250-smdk5250.dtb \
 	exynos5420-smdk5420.dtb \
 	exynos5420-peach-pit.dtb \
-	exynos5800-peach-pi.dtb
+	exynos5800-peach-pi.dtb \
+	exynos5422-odroidxu3.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra20-medcom-wide.dtb \
 	tegra20-paz00.dtb \
(quoted diff) +0 -0

b/arch/arm/dts/exynos5422-odroidxu3.dts new file mode 100644 index 0000000..533d88e

arch/arm/dts/exynos5422-odroidxu3.dts new file +38 -0
@@ -0,0 +1,57 @@
+/*
+ * Odroid XU3 device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/dts-v1/;
+#include "exynos54xx.dtsi"
+
+/ {
+	model = "Odroid XU3 based on EXYNOS5422";
+	compatible = "samsung,odroidxu3", "samsung,exynos5";
+
+	aliases {
+		serial0 = "/serial at 12C00000";
+		console = "/serial at 12C20000";
+	};
+
+	memory {
+		device_type = "memory";
+		reg =  <0x40000000 0x10000000
+			0x50000000 0x10000000
+			0x60000000 0x10000000
+			0x70000000 0x10000000
+			0x80000000 0x10000000
+			0x90000000 0x10000000
+			0xa0000000 0x10000000
+			0xb0000000 0xea00000>;
+	};
+
+	serial at 12C20000 {
+		status="okay";
+	};
+
+	mmc at 12200000 {
Quoted 8 lines

arch/arm/dts/exynos5422-odroidxu3.dts line 41

Quoted 3 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +3 -0
+		samsung,bus-width = <8>;
+		samsung,timing = <1 3 3>;
+		fifoth_val = <0x200f0020>;

If you resend the patch, i want to change the fifoth_val from 0x200f0020 to 0x201f0020. (Well, i'm not sure what's right. but when i have checked, the fifoth_depth is 0x40. Then Rx_MASK = FIFOTH_DEPTH/2 - 1, TX_MASK = FIFOTH_DEPTH/2.

You are right. I checked the document, and found that RX_MASK is recommened to be set by (FIFOTH_DEPTH/2 - 1) as you said.

Quoted 458 lines

arch/arm/dts/exynos5422-odroidxu3.dts line 51

Quoted 11 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +10 -0
+	};
+
+	mmc at 12210000 {
+		status = "disabled";
+	};
+
+	mmc at 12220000 {
+		samsung,bus-width = <4>;
+		samsung,timing = <1 2 3>;
+		fifoth_val = <0x200f0020>;

Ditto.

Quoted 314 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +6 -0
+	};
+
+	mmc at 12230000 {
+		status = "disabled";
+	};
+};
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/Kconfig new file mode 100644 index 0000000..6159692

board/samsung/odroid-xu3/Kconfig new file +12 -0
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+	default "odroid-xu3"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
+	default "odroid_xu3"
+
+endif
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/MAINTAINERS new file mode 100644 index 0000000..50cf928

board/samsung/odroid-xu3/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@
+ODROID-XU3 BOARD
+M:	Hyungwon Hwang <[email protected]>
+S:	Maintained
+F:	board/samsung/odroid-xu3/
+F:	include/configs/odroid_xu3.h
+F:	configs/odroid-xu3_defconfig
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/Makefile new file mode 100644 index 0000000..85ae5c5

board/samsung/odroid-xu3/Makefile new file +2 -0
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights

reserved. +#

board/samsung/odroid-xu3/Makefile new file +4 -0
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid-xu3.o
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/odroid-xu3.c new file mode 100644 index 0000000..8c54842

board/samsung/odroid-xu3/odroid-xu3.c new file +29 -0
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+	return 0;
+}
+
+int exynos_init(void)
+{
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+	unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+	struct exynos5420_clock *clk = (struct exynos5420_clock *)
+

samsung_get_base_clock();

board/samsung/odroid-xu3/odroid-xu3.c new file +55 -0
+	/*
+	 * CMU_CPU clocks src to MPLL
+	 * Bit values:                 0  ; 1
+	 * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+	 * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+	 * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+	 * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+	*/
+
+	/* Set CMU_CPU clocks src to OSCCLK */
+	clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+	set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	/* Set APLL to 1200MHz */
+	clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+			PLL_ENABLE(1);
+	set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CMU_CPU clocks src to APLL */
+	set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+	      PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+	set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+	      PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+	while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+		continue;
+
+	/* Set MPLL to 800MHz */
+	set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CLKMUX_UART src to MPLL */
+	clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) |

UART3_SEL(7);

board/samsung/odroid-xu3/odroid-xu3.c new file +1 -0
+	set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) |

UART3_SEL(3); +

board/samsung/odroid-xu3/odroid-xu3.c new file +11 -0
+	clrsetbits_le32(&clk->src_peric0, clr, set);
+
+	/* Set SCLK_UART to 400 MHz (MPLL / 2) */
+	clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+	      UART3_RATIO(15);
+	set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+	      UART3_RATIO(1);
+
+	clrsetbits_le32(&clk->div_peric0, clr, set);
+
+	while (readl(&clk->div_stat_peric0) &

DIV_STAT_PERIC0_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +9 -0
+		continue;
+
+	/* Set CLKMUX_MMC src to MPLL */
+	clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+	set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+	clrsetbits_le32(&clk->src_fsys, clr, set);
+
+	clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) |

MMC2_RATIO(0x3ff);

board/samsung/odroid-xu3/odroid-xu3.c new file +6 -0
+	set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+	/* Wait for divider ready status */
+	while (readl(&clk->div_stat_fsys1) &

DIV_STAT_FSYS1_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +10 -0
+		continue;
+
+	return 0;
+}
+
+int exynos_early_init_f(void)
+{
+	return board_clock_init();
+}
+#endif
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/setup.h new file mode 100644 index 0000000..143c189

board/samsung/odroid-xu3/setup.h new file +25 -0
@@ -0,0 +1,95 @@
+/*
+ * (C) Copyright 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __ODROID_XU3_SETUP__
+#define __ODROID_XU3_SETUP__
+
+#define SDIV(x)                 ((x) & 0x7)
+#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)
+
+/* CLK_MUX_STAT_CPU */
+#define APLL_SEL(x)             ((x) & 0x7)
+#define CORE_SEL(x)             (((x) & 0x7) << 16)
+#define MUX_STAT_CPU_CHANGING(x)	!(((x) & APLL_SEL(0))

|| \

board/samsung/odroid-xu3/setup.h new file +1 -0
+					   (x) & APLL_SEL(1)

|| \

board/samsung/odroid-xu3/setup.h new file +1 -0
+					   (x) & CORE_SEL(0)

|| \

board/samsung/odroid-xu3/setup.h new file +21 -0
+					   (x) & CORE_SEL(1))
+
+/* CLK_DIV_CPU0 */
+#define ARM_RATIO(x)           ((x) & 0x7)
+#define CPUD_RATIO(x)         (((x) & 0x7) << 4)
+#define ATB_RATIO(x)         (((x) & 0x7) << 16)
+#define PCLK_DBG_RATIO(x)       (((x) & 0x7) << 20)
+#define APLL_RATIO(x)           (((x) & 0x7) << 24)
+#define ARM2_RATIO(x)         (((x) & 0x7) << 28)
+
+/* CLK_DIV_STAT_CPU0 */
+#define DIV_CPUD(x)           (((x) & 0x1) << 4)
+#define DIV_ATB(x)              (((x) & 0x1) << 16)
+#define DIV_PCLK_DBG(x)         (((x) & 0x1) << 20)
+#define DIV_APLL(x)             (((x) & 0x1) << 24)
+#define DIV_ARM2(x)            (((x) & 0x1) << 28)
+
+#define DIV_STAT_CHANGING	0x1
+#define DIV_STAT_CPU0_CHANGING  (DIV_CPUD(DIV_STAT_CHANGING) | \
+				 DIV_ATB(DIV_STAT_CHANGING) | \
+				 DIV_PCLK_DBG(DIV_STAT_CHANGING) |

\

board/samsung/odroid-xu3/setup.h new file +43 -0
+				 DIV_APLL(DIV_STAT_CHANGING) | \
+				 DIV_ARM2(DIV_STAT_CHANGING))
+
+/* Set CLK_SRC_PERIC0 */
+#define UART0_SEL(x)		(((x) & 0xf) << 4)
+#define UART1_SEL(x)		(((x) & 0xf) << 8)
+#define UART2_SEL(x)		(((x) & 0xf) << 12)
+#define UART3_SEL(x)		(((x) & 0xf) << 16)
+
+/* Set CLK_DIV_PERIC0 */
+#define UART0_RATIO(x)		(((x) & 0xf) << 8)
+#define UART1_RATIO(x)		(((x) & 0xf) << 12)
+#define UART2_RATIO(x)		(((x) & 0xf) << 16)
+#define UART3_RATIO(x)		(((x) & 0xf) << 20)
+
+/* Set CLK_DIV_STAT_PERIC0 */
+#define DIV_UART0(x)		((x) & 0x1)
+#define DIV_UART1(x)		(((x) & 0x1) << 4)
+#define DIV_UART2(x)		(((x) & 0x1) << 8)
+#define DIV_UART3(x)		(((x) & 0x1) << 12)
+#define DIV_UART4(x)		(((x) & 0x1) << 16)
+
+#define DIV_STAT_PERIC0_CHANGING (DIV_UART4(DIV_STAT_CHANGING) | \
+				  DIV_UART3(DIV_STAT_CHANGING) | \
+				  DIV_UART2(DIV_STAT_CHANGING) | \
+				  DIV_UART1(DIV_STAT_CHANGING) | \
+				  DIV_UART0(DIV_STAT_CHANGING))
+
+/* CLK_SRC_FSYS */
+#define MUX_MMC0_SEL(x)		(((x) & 0x7) << 8)
+#define MUX_MMC1_SEL(x)		(((x) & 0x7) << 12)
+#define MUX_MMC2_SEL(x)		(((x) & 0x7) << 16)
+
+/* CLK_DIV_FSYS1 */
+#define MMC0_RATIO(x)		((x) & 0x3ff)
+#define MMC1_RATIO(x)		(((x) & 0x3ff) << 10)
+#define MMC2_RATIO(x)		(((x) & 0x3ff) << 20)
+
+#define DIV_MMC0(x)		(((x) & 1) << 20)
+#define DIV_MMC1(x)		(((x) & 1) << 24)
+#define DIV_MMC2(x)		(((x) & 1) << 28)
+
+#define DIV_STAT_FSYS1_CHANGING

(DIV_MMC0(DIV_STAT_CHANGING) | \

board/samsung/odroid-xu3/setup.h new file +4 -0
+				 DIV_MMC1(DIV_STAT_CHANGING) | \
+				 DIV_MMC2(DIV_STAT_CHANGING))
+
+#endif
(quoted diff) +0 -0

b/configs/odroid-xu3_defconfig new file mode 100644 index 0000000..74aa0cf

configs/odroid-xu3_defconfig new file +4 -0
@@ -0,0 +1,4 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID_XU3=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
include/configs/odroid.h +0 -5
index 807e96b..660b6ae 100644
@@ -166,11 +166,6 @@
 	"mmcbootpart=1\0" \
 	"mmcrootdev=0\0" \
 	"mmcrootpart=2\0" \
-	"bootdelay=0\0" \
-	"dfu_alt_system="CONFIG_DFU_ALT \
-	"dfu_alt_info=Please reset the board\0" \
-	"consoleon=set console console=ttySAC1,115200n8; save;
 reset\0" \
-	"consoleoff=set console console=ram; save; reset\0" \
 	"initrdname=uInitrd\0" \
 	"initrdaddr=42000000\0" \
Quoted 1 line

"fdtaddr=40800000\0"

This is not XU3, separate the patch.

Quoted 126 lines
(quoted diff) +0 -0

b/include/configs/odroid_xu3.h new file mode 100644 index 0000000..1d53653

include/configs/odroid_xu3.h new file +32 -0
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_ODROID_XU3_H
+#define __CONFIG_ODROID_XU3_H
+
+#include "exynos5-common.h"
+
+#define CONFIG_SYS_PROMPT		"ODROID-XU3 # "
+#define CONFIG_IDENT_STRING		" for ODROID-XU3"
+
+#define CONFIG_BOARD_COMMON
+
+#define CONFIG_SYS_SDRAM_BASE		0x40000000
+#define CONFIG_SYS_TEXT_BASE		0x43E00000
+
+/* select serial console configuration */
+#define CONFIG_SERIAL2			/* use SERIAL 2 */
+
+#define TZPC_BASE_OFFSET		0x10000
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FAT
+
+/*
+ * FIXME: The number of bank is actually 8. But there is no way to

reserver the
+ * last 16 Mib in the last bank now. So I just excluded the last bank
+ * temporally.
+ */

include/configs/odroid_xu3.h new file +2 -0
+#define CONFIG_NR_DRAM_BANKS	7
+#define SDRAM_BANK_SIZE		(256UL << 20UL)	/*

256 MB */ +

include/configs/odroid_xu3.h new file +6 -0
+#define CONFIG_ENV_IS_IN_MMC
+
+#undef CONFIG_ENV_SIZE
+#undef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_SIZE			4096
+#define CONFIG_ENV_OFFSET		(SZ_1K * 1280) /* 1.25

MiB offset */ +
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR -
0x1000000) +

include/configs/odroid_xu3.h new file +2 -0
+#define CONFIG_BOOTCOMMAND		"run autoboot"
+#define

CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0" +

include/configs/odroid_xu3.h new file +8 -0
+/*
+ * For details, refer the documentation: doc/README.odroid
+*/
+#ifdef CONFIG_EXTRA_ENV_SETTINGS
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#endif
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadkernel=fatload mmc ${mmcbootdev}:${mmcbootpart}

${kerneladdr} " \

include/configs/odroid_xu3.h new file +2 -0
+		"${kernelname}\0" \
+	"loadinitrd=fatload mmc ${mmcbootdev}:${mmcbootpart}

${initrdaddr} " \

include/configs/odroid_xu3.h new file +2 -0
+		"${initrdname}\0" \
+	"loaddtb=fatload mmc ${mmcbootdev}:${mmcbootpart}

${fdtaddr} " \

include/configs/odroid_xu3.h new file +15 -0
+		"${fdtfile}\0" \
+	"check_ramdisk=" \
+		"if run loadinitrd; then " \
+			"setenv initrd_addr ${initrdaddr};" \
+		"else " \
+			"setenv initrd_addr -;" \
+		"fi;\0" \
+	"check_dtb=" \
+		"if run loaddtb; then " \
+			"setenv fdt_addr ${fdtaddr};" \
+		"else " \
+			"setenv fdt_addr;" \
+		"fi;\0" \
+	"kernel_args=" \
+		"setenv bootargs

root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \

include/configs/odroid_xu3.h new file +15 -0
+		" rootwait ${console} ${opts}\0" \
+	"boot_fit=" \
+		"setenv kerneladdr 0x42000000;" \
+		"setenv kernelname Image.itb;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootm ${kerneladdr}#${boardname}\0" \
+	"boot_uimg=" \
+		"setenv kerneladdr 0x40007FC0;" \
+		"setenv kernelname uImage;" \
+		"run check_dtb;" \
+		"run check_ramdisk;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootm ${kerneladdr} ${initrd_addr}

${fdt_addr};\0" \

include/configs/odroid_xu3.h new file +8 -0
+	"boot_zimg=" \
+		"setenv kerneladdr 0x40007FC0;" \
+		"setenv kernelname zImage;" \
+		"run check_dtb;" \
+		"run check_ramdisk;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootz ${kerneladdr} ${initrd_addr}

${fdt_addr};\0" \

include/configs/odroid_xu3.h new file +12 -0
+	"autoboot=" \
+		"if test -e mmc 0 Image.itb; then; " \
+			"run boot_fit;" \
+		"elif test -e mmc 0 zImage; then; " \
+			"run boot_zimg;" \
+		"elif test -e mmc 0 uImage; then; " \
+			"run boot_uimg;" \
+		"fi;\0" \
+	"console=" CONFIG_DEFAULT_CONSOLE \
+	"mmcbootdev=0\0" \
+	"mmcbootpart=1\0" \
+	"mmcrootdev=0\0" \
Quoted 8 lines

include/configs/odroid_xu3.h line 117

Quoted 6 lines
include/configs/odroid_xu3.h new file +4 -0
+	"mmcrootpart=2\0" \
+	"bootdelay=0\0" \
+	"dfu_alt_info=Please reset the board\0" \
+	"consoleon=set console console=ttySAC2,115200n8; save;

reset\0" \

include/configs/odroid_xu3.h new file +1 -0
+	"consoleoff=set console console=ram; save; reset\0" \

I think you want to remove these.

I thought I removed it. There was a mistake when I made this patch. I am Sorry for that.

Quoted 22 lines

Best Regards,
Jaehoon Chung

Quoted 17 lines
include/configs/odroid_xu3.h new file +16 -0
+	"initrdname=uInitrd\0" \
+	"initrdaddr=42000000\0" \
+	"fdtaddr=40800000\0"
+
+/* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
+#undef CONFIG_EXYNOS_TMU
+#undef CONFIG_TMU_CMD_DTT
+
+#ifdef CONFIG_CMD_NET
+#undef CONFIG_CMD_NET
+#undef CONFIG_SMC911X
+#undef CONFIG_CMD_PXE
+#undef CONFIG_MENU
+#endif
+
+#endif	/* __CONFIG_H */
#4 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

In reply to Hyungwon Hwang
Quoted 12 lines · Hyungwon Hwang

This patch adds support for Odroid-XU3.

---

index 0000000..533d88e

arch/arm/dts/exynos5422-odroidxu3.dts line 42

Quoted 6 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +6 -0
+
+	mmc at 12200000 {
+		samsung,bus-width = <8>;
+		samsung,timing = <1 3 3>;
+		fifoth_val = <0x200f0020>;
+	};

Apart from the fifoth_val, all this information is already part of the incude exynos54xx dtsi, so those fields can be removed.

As

arch/arm/dts/exynos5422-odroidxu3.dts line 46

Quoted 3 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +3 -0
+	mmc at 12210000 {
+		status = "disabled";
+	};

Not needed, Already disabled in exynos54xx dtsi

arch/arm/dts/exynos5422-odroidxu3.dts line 52

Quoted 5 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +5 -0
+	mmc at 12220000 {
+		samsung,bus-width = <4>;
+		samsung,timing = <1 2 3>;
+		fifoth_val = <0x200f0020>;
+	};

Same as above

arch/arm/dts/exynos5422-odroidxu3.dts line 57

Quoted 4 lines
arch/arm/dts/exynos5422-odroidxu3.dts new file +4 -0
+	mmc at 12230000 {
+		status = "disabled";
+	};
+};

Same as above, Already disabled in exynos54xx dtsi

Quoted 384 lines
board/samsung/odroid-xu3/Makefile new file +7 -0
new file mode 100644
index 0000000..85ae5c5
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= odroid-xu3.o
board/samsung/odroid-xu3/odroid-xu3.c new file +122 -0
new file mode 100644
index 0000000..8c54842
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+	return 0;
+}
+
+int exynos_init(void)
+{
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+	unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+	struct exynos5420_clock *clk = (struct exynos5420_clock *)
+						samsung_get_base_clock();
+	/*
+	 * CMU_CPU clocks src to MPLL
+	 * Bit values:                 0  ; 1
+	 * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+	 * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+	 * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+	 * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+	*/
+
+	/* Set CMU_CPU clocks src to OSCCLK */
+	clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+	set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	/* Set APLL to 1200MHz */
+	clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+			PLL_ENABLE(1);
+	set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CMU_CPU clocks src to APLL */
+	set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+	      PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+	set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+	      PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+	while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+		continue;
+
+	/* Set MPLL to 800MHz */
+	set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CLKMUX_UART src to MPLL */
+	clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) | UART3_SEL(7);
+	set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) | UART3_SEL(3);
+
+	clrsetbits_le32(&clk->src_peric0, clr, set);
+
+	/* Set SCLK_UART to 400 MHz (MPLL / 2) */
+	clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+	      UART3_RATIO(15);
+	set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+	      UART3_RATIO(1);
+
+	clrsetbits_le32(&clk->div_peric0, clr, set);
+
+	while (readl(&clk->div_stat_peric0) & DIV_STAT_PERIC0_CHANGING)
+		continue;
+
+	/* Set CLKMUX_MMC src to MPLL */
+	clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+	set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+	clrsetbits_le32(&clk->src_fsys, clr, set);
+
+	clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) | MMC2_RATIO(0x3ff);
+	set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+	/* Wait for divider ready status */
+	while (readl(&clk->div_stat_fsys1) & DIV_STAT_FSYS1_CHANGING)
+		continue;
+
+	return 0;
+}
+
+int exynos_early_init_f(void)
+{
+	return board_clock_init();
+}
+#endif
board/samsung/odroid-xu3/setup.h new file +95 -0
new file mode 100644
index 0000000..143c189
@@ -0,0 +1,95 @@
+/*
+ * (C) Copyright 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __ODROID_XU3_SETUP__
+#define __ODROID_XU3_SETUP__
+
+#define SDIV(x)                 ((x) & 0x7)
+#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)
+
+/* CLK_MUX_STAT_CPU */
+#define APLL_SEL(x)             ((x) & 0x7)
+#define CORE_SEL(x)             (((x) & 0x7) << 16)
+#define MUX_STAT_CPU_CHANGING(x)	!(((x) & APLL_SEL(0)) ||	\
+					   (x) & APLL_SEL(1) ||		\
+					   (x) & CORE_SEL(0) ||		\
+					   (x) & CORE_SEL(1))
+
+/* CLK_DIV_CPU0 */
+#define ARM_RATIO(x)           ((x) & 0x7)
+#define CPUD_RATIO(x)         (((x) & 0x7) << 4)
+#define ATB_RATIO(x)         (((x) & 0x7) << 16)
+#define PCLK_DBG_RATIO(x)       (((x) & 0x7) << 20)
+#define APLL_RATIO(x)           (((x) & 0x7) << 24)
+#define ARM2_RATIO(x)         (((x) & 0x7) << 28)
+
+/* CLK_DIV_STAT_CPU0 */
+#define DIV_CPUD(x)           (((x) & 0x1) << 4)
+#define DIV_ATB(x)              (((x) & 0x1) << 16)
+#define DIV_PCLK_DBG(x)         (((x) & 0x1) << 20)
+#define DIV_APLL(x)             (((x) & 0x1) << 24)
+#define DIV_ARM2(x)            (((x) & 0x1) << 28)
+
+#define DIV_STAT_CHANGING	0x1
+#define DIV_STAT_CPU0_CHANGING  (DIV_CPUD(DIV_STAT_CHANGING) | \
+				 DIV_ATB(DIV_STAT_CHANGING) | \
+				 DIV_PCLK_DBG(DIV_STAT_CHANGING) | \
+				 DIV_APLL(DIV_STAT_CHANGING) | \
+				 DIV_ARM2(DIV_STAT_CHANGING))
+
+/* Set CLK_SRC_PERIC0 */
+#define UART0_SEL(x)		(((x) & 0xf) << 4)
+#define UART1_SEL(x)		(((x) & 0xf) << 8)
+#define UART2_SEL(x)		(((x) & 0xf) << 12)
+#define UART3_SEL(x)		(((x) & 0xf) << 16)
+
+/* Set CLK_DIV_PERIC0 */
+#define UART0_RATIO(x)		(((x) & 0xf) << 8)
+#define UART1_RATIO(x)		(((x) & 0xf) << 12)
+#define UART2_RATIO(x)		(((x) & 0xf) << 16)
+#define UART3_RATIO(x)		(((x) & 0xf) << 20)
+
+/* Set CLK_DIV_STAT_PERIC0 */
+#define DIV_UART0(x)		((x) & 0x1)
+#define DIV_UART1(x)		(((x) & 0x1) << 4)
+#define DIV_UART2(x)		(((x) & 0x1) << 8)
+#define DIV_UART3(x)		(((x) & 0x1) << 12)
+#define DIV_UART4(x)		(((x) & 0x1) << 16)
+
+#define DIV_STAT_PERIC0_CHANGING (DIV_UART4(DIV_STAT_CHANGING) | \
+				  DIV_UART3(DIV_STAT_CHANGING) | \
+				  DIV_UART2(DIV_STAT_CHANGING) | \
+				  DIV_UART1(DIV_STAT_CHANGING) | \
+				  DIV_UART0(DIV_STAT_CHANGING))
+
+/* CLK_SRC_FSYS */
+#define MUX_MMC0_SEL(x)		(((x) & 0x7) << 8)
+#define MUX_MMC1_SEL(x)		(((x) & 0x7) << 12)
+#define MUX_MMC2_SEL(x)		(((x) & 0x7) << 16)
+
+/* CLK_DIV_FSYS1 */
+#define MMC0_RATIO(x)		((x) & 0x3ff)
+#define MMC1_RATIO(x)		(((x) & 0x3ff) << 10)
+#define MMC2_RATIO(x)		(((x) & 0x3ff) << 20)
+
+#define DIV_MMC0(x)		(((x) & 1) << 20)
+#define DIV_MMC1(x)		(((x) & 1) << 24)
+#define DIV_MMC2(x)		(((x) & 1) << 28)
+
+#define DIV_STAT_FSYS1_CHANGING	(DIV_MMC0(DIV_STAT_CHANGING) | \
+				 DIV_MMC1(DIV_STAT_CHANGING) | \
+				 DIV_MMC2(DIV_STAT_CHANGING))
+
+#endif
configs/odroid-xu3_defconfig new file +4 -0
new file mode 100644
index 0000000..74aa0cf
@@ -0,0 +1,4 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID_XU3=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
include/configs/odroid.h +0 -5
index 807e96b..660b6ae 100644
@@ -166,11 +166,6 @@
 	"mmcbootpart=1\0" \
 	"mmcrootdev=0\0" \
 	"mmcrootpart=2\0" \
-	"bootdelay=0\0" \
-	"dfu_alt_system="CONFIG_DFU_ALT \
-	"dfu_alt_info=Please reset the board\0" \
-	"consoleon=set console console=ttySAC1,115200n8; save; reset\0" \
-	"consoleoff=set console console=ram; save; reset\0" \
 	"initrdname=uInitrd\0" \
 	"initrdaddr=42000000\0" \
 	"fdtaddr=40800000\0"
include/configs/odroid_xu3.h new file +110 -0
new file mode 100644
index 0000000..1d53653
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_ODROID_XU3_H
+#define __CONFIG_ODROID_XU3_H
+
+#include "exynos5-common.h"
+
+#define CONFIG_SYS_PROMPT		"ODROID-XU3 # "
+#define CONFIG_IDENT_STRING		" for ODROID-XU3"
+
+#define CONFIG_BOARD_COMMON
+
+#define CONFIG_SYS_SDRAM_BASE		0x40000000
+#define CONFIG_SYS_TEXT_BASE		0x43E00000
+
+/* select serial console configuration */
+#define CONFIG_SERIAL2			/* use SERIAL 2 */
+
+#define TZPC_BASE_OFFSET		0x10000
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FAT
+
+/*
+ * FIXME: The number of bank is actually 8. But there is no way to reserver the
+ * last 16 Mib in the last bank now. So I just excluded the last bank
+ * temporally.
+ */
+#define CONFIG_NR_DRAM_BANKS	7
+#define SDRAM_BANK_SIZE		(256UL << 20UL)	/* 256 MB */
+
+#define CONFIG_ENV_IS_IN_MMC
+
+#undef CONFIG_ENV_SIZE
+#undef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_SIZE			4096
+#define CONFIG_ENV_OFFSET		(SZ_1K * 1280) /* 1.25 MiB offset */
+
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - 0x1000000)
+
+#define CONFIG_BOOTCOMMAND		"run autoboot"
+#define CONFIG_DEFAULT_CONSOLE		"console=ttySAC2,115200n8\0"
+
+/*
+ * For details, refer the documentation: doc/README.odroid
+*/
+#ifdef CONFIG_EXTRA_ENV_SETTINGS
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#endif
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadkernel=fatload mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
+		"${kernelname}\0" \
+	"loadinitrd=fatload mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
+		"${initrdname}\0" \
+	"loaddtb=fatload mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \
+		"${fdtfile}\0" \
+	"check_ramdisk=" \
+		"if run loadinitrd; then " \
+			"setenv initrd_addr ${initrdaddr};" \
+		"else " \
+			"setenv initrd_addr -;" \
+		"fi;\0" \
+	"check_dtb=" \
+		"if run loaddtb; then " \
+			"setenv fdt_addr ${fdtaddr};" \
+		"else " \
+			"setenv fdt_addr;" \
+		"fi;\0" \
+	"kernel_args=" \
+		"setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
+		" rootwait ${console} ${opts}\0" \
+	"boot_fit=" \
+		"setenv kerneladdr 0x42000000;" \
+		"setenv kernelname Image.itb;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootm ${kerneladdr}#${boardname}\0" \
+	"boot_uimg=" \
+		"setenv kerneladdr 0x40007FC0;" \
+		"setenv kernelname uImage;" \
+		"run check_dtb;" \
+		"run check_ramdisk;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
+	"boot_zimg=" \
+		"setenv kerneladdr 0x40007FC0;" \
+		"setenv kernelname zImage;" \
+		"run check_dtb;" \
+		"run check_ramdisk;" \
+		"run loadkernel;" \
+		"run kernel_args;" \
+		"bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
+	"autoboot=" \
+		"if test -e mmc 0 Image.itb; then; " \
+			"run boot_fit;" \
+		"elif test -e mmc 0 zImage; then; " \
+			"run boot_zimg;" \
+		"elif test -e mmc 0 uImage; then; " \
+			"run boot_uimg;" \
+		"fi;\0" \
+	"console=" CONFIG_DEFAULT_CONSOLE \
+	"mmcbootdev=0\0" \

include/configs/odroid_xu3.h line 120

Quoted 10 lines
include/configs/odroid_xu3.h new file +10 -0
+	"mmcbootpart=1\0" \
+	"mmcrootdev=0\0" \
+	"mmcrootpart=2\0" \
+	"bootdelay=0\0" \
+	"dfu_alt_info=Please reset the board\0" \
+	"consoleon=set console console=ttySAC2,115200n8; save; reset\0" \
+	"consoleoff=set console console=ram; save; reset\0" \
+	"initrdname=uInitrd\0" \
+	"initrdaddr=42000000\0" \
+	"fdtaddr=40800000\0"

Would be nice if config_distro_defaults.h config_distro_bootcmd.h could be used instead an odroid XU3 specific default environment & settings..

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141127/a9cdd404/attachment.bin>
#5 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Quoted 5 lines · On Thu, 27 Nov 2014 17:35:05 +0100 Sjoerd Simons…

Would be nice if config_distro_defaults.h config_distro_bootcmd.h could be used instead an odroid XU3 specific default environment & settings..

You have the peach-pi board. Right? Does it boot without typing something to boot linux kernel withour modification? I explored the source code, but could not find the point where makes the peach-pi board boot automatically with the configuration.

#6 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Quoted 4 lines · Hyungwon Hwang

On Thu, 27 Nov 2014 17:35:05 +0100
Sjoerd Simons <[email protected]> wrote:

Quoted 8 lines
Quoted 3 lines

Would be nice if config_distro_defaults.h config_distro_bootcmd.h could be used instead an odroid XU3 specific default environment & settings..

You have the peach-pi board. Right? Does it boot without typing something to boot linux kernel withour modification? I explored the source code, but could not find the point where makes the peach-pi board boot automatically with the configuration.

exynos5-common includes config_distro_bootcmd.h and defines CONFIG_EXTRA_ENV_SETTINGS to include BOOTENV. BOOTENV in turn is defines in the config_distro_bootcmd.h file and defined a bootcmd which searches for a boot script on various devies.

So simply not overriding CONFIG_EXTRA_ENV_SETTINGS should do the right thing.

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/85369817/attachment.bin>
#7 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

In reply to Hyungwon Hwang
Quoted 1 line · Hyungwon Hwang

This patch adds support for Odroid-XU3.

I can't seem to access the EMMC with this patch, is that expected?

Quoted 5 lines
board/samsung/odroid-xu3/Kconfig new file +2 -0
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+

board/samsung/odroid-xu3/Kconfig line 12

Quoted 10 lines
board/samsung/odroid-xu3/Kconfig new file +10 -0
+config SYS_BOARD
+	default "odroid-xu3"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
+	default "odroid_xu3"
+
+endif

I was studying the different between the peach-pi and the XU3 hardware enablement a bit. I was wondering whta's the rationale for the XU3 having it's own board file and reconfiguring various clocks? Does the hardkernel SPL/bl2 not setup things correctly?

Quoted 128 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +122 -0
new file mode 100644
index 0000000..8c54842
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+	return 0;
+}
+
+int exynos_init(void)
+{
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+	unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+	struct exynos5420_clock *clk = (struct exynos5420_clock *)
+						samsung_get_base_clock();
+	/*
+	 * CMU_CPU clocks src to MPLL
+	 * Bit values:                 0  ; 1
+	 * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+	 * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+	 * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+	 * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+	*/
+
+	/* Set CMU_CPU clocks src to OSCCLK */
+	clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+	set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	/* Set APLL to 1200MHz */
+	clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+			PLL_ENABLE(1);
+	set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CMU_CPU clocks src to APLL */
+	set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+	      PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+	set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+	      PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+	while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+		continue;
+
+	/* Set MPLL to 800MHz */
+	set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CLKMUX_UART src to MPLL */
+	clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) | UART3_SEL(7);
+	set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) | UART3_SEL(3);
+
+	clrsetbits_le32(&clk->src_peric0, clr, set);
+
+	/* Set SCLK_UART to 400 MHz (MPLL / 2) */
+	clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+	      UART3_RATIO(15);
+	set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+	      UART3_RATIO(1);
+
+	clrsetbits_le32(&clk->div_peric0, clr, set);
+
+	while (readl(&clk->div_stat_peric0) & DIV_STAT_PERIC0_CHANGING)
+		continue;
+
+	/* Set CLKMUX_MMC src to MPLL */
+	clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+	set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+	clrsetbits_le32(&clk->src_fsys, clr, set);
+
+	clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) | MMC2_RATIO(0x3ff);
+	set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+	/* Wait for divider ready status */
+	while (readl(&clk->div_stat_fsys1) & DIV_STAT_FSYS1_CHANGING)
+		continue;
+
+	return 0;
+}
+
+int exynos_early_init_f(void)
+{
+	return board_clock_init();
+}
+#endif
Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141127/65bfa96d/attachment.bin>
#8 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Quoted 5 lines · On Thu, 27 Nov 2014 22:45:18 +0100 Sjoerd Simons…
Quoted 1 line · Hyungwon Hwang

This patch adds support for Odroid-XU3.

I can't seem to access the EMMC with this patch, is that expected?

Yes. EMMC is not supported yet. Actually even I did not test whether it works or not. EMMC support will be done soon.

Quoted 13 lines
Quoted 13 lines
board/samsung/odroid-xu3/Kconfig new file +9 -0
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+	default "odroid-xu3"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
Quoted 9 lines

board/samsung/odroid-xu3/Kconfig line 12

Quoted 3 lines
board/samsung/odroid-xu3/Kconfig new file +3 -0
+	default "odroid_xu3"
+
+endif

I was studying the different between the peach-pi and the XU3 hardware enablement a bit. I was wondering whta's the rationale for the XU3 having it's own board file and reconfiguring various clocks? Does the hardkernel SPL/bl2 not setup things correctly?

Hmm. It is my first time to make codes to add support for new board, and I am not sure what is right. Is it needless to set clocks for the cases when SPL/BL2 is expected to set clocks already?

Quoted 135 lines
Quoted 133 lines
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/odroid-xu3.c new file mode 100644 index 0000000..8c54842

board/samsung/odroid-xu3/odroid-xu3.c new file +29 -0
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+	return 0;
+}
+
+int exynos_init(void)
+{
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+	unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+	struct exynos5420_clock *clk = (struct exynos5420_clock *)
+

samsung_get_base_clock();

board/samsung/odroid-xu3/odroid-xu3.c new file +55 -0
+	/*
+	 * CMU_CPU clocks src to MPLL
+	 * Bit values:                 0  ; 1
+	 * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+	 * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+	 * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+	 * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+	*/
+
+	/* Set CMU_CPU clocks src to OSCCLK */
+	clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+	set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	/* Set APLL to 1200MHz */
+	clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+			PLL_ENABLE(1);
+	set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CMU_CPU clocks src to APLL */
+	set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+	      PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+	set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+	      PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+	while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+		continue;
+
+	/* Set MPLL to 800MHz */
+	set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CLKMUX_UART src to MPLL */
+	clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) |

UART3_SEL(7);

board/samsung/odroid-xu3/odroid-xu3.c new file +1 -0
+	set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) |

UART3_SEL(3); +

board/samsung/odroid-xu3/odroid-xu3.c new file +11 -0
+	clrsetbits_le32(&clk->src_peric0, clr, set);
+
+	/* Set SCLK_UART to 400 MHz (MPLL / 2) */
+	clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+	      UART3_RATIO(15);
+	set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+	      UART3_RATIO(1);
+
+	clrsetbits_le32(&clk->div_peric0, clr, set);
+
+	while (readl(&clk->div_stat_peric0) &

DIV_STAT_PERIC0_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +9 -0
+		continue;
+
+	/* Set CLKMUX_MMC src to MPLL */
+	clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+	set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+	clrsetbits_le32(&clk->src_fsys, clr, set);
+
+	clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) |

MMC2_RATIO(0x3ff);

board/samsung/odroid-xu3/odroid-xu3.c new file +6 -0
+	set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+	/* Wait for divider ready status */
+	while (readl(&clk->div_stat_fsys1) &

DIV_STAT_FSYS1_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +10 -0
+		continue;
+
+	return 0;
+}
+
+int exynos_early_init_f(void)
+{
+	return board_clock_init();
+}
+#endif
#9 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Quoted 35 lines · Hyungwon Hwang
Quoted 5 lines · On Thu, 27 Nov 2014 22:45:18 +0100 Sjoerd Simons…
Quoted 1 line · Hyungwon Hwang

This patch adds support for Odroid-XU3.

I can't seem to access the EMMC with this patch, is that expected?

Yes. EMMC is not supported yet. Actually even I did not test whether it works or not. EMMC support will be done soon.

Quoted 13 lines
Quoted 13 lines
board/samsung/odroid-xu3/Kconfig new file +9 -0
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+	default "odroid-xu3"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
Quoted 9 lines

board/samsung/odroid-xu3/Kconfig line 12

Quoted 3 lines
board/samsung/odroid-xu3/Kconfig new file +3 -0
+	default "odroid_xu3"
+
+endif

I was studying the different between the peach-pi and the XU3 hardware enablement a bit. I was wondering whta's the rationale for the XU3 having it's own board file and reconfiguring various clocks? Does the hardkernel SPL/bl2 not setup things correctly?

Quoted 3 lines

Hmm. It is my first time to make codes to add support for new board, and I am not sure what is right. Is it needless to set clocks for the cases when SPL/BL2 is expected to set clocks already?

That is my impresssion indeed. If you look at the enablement for the SMDK5420 board and the peach pi/pit boards they don't do any setup of these clocks, the only time that's done is in exynos5420_system_clock_init (from clock_init_exynos5.c) which only gets executed on SPL builds.

I did a quick test changing SYS_BOARD to smdk5420 and that worked without any problems. So in principle you should be able to drop the odroid-xu3 board directory and simply add your Kconfig snippet to board/samsung/smdk5420/Kconfig as is done for the Peach boards

Quoted 127 lines
Quoted 127 lines
Quoted 127 lines
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/odroid-xu3.c new file mode 100644 index 0000000..8c54842

board/samsung/odroid-xu3/odroid-xu3.c new file +29 -0
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+	return 0;
+}
+
+int exynos_init(void)
+{
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+	unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+	struct exynos5420_clock *clk = (struct exynos5420_clock *)
+

samsung_get_base_clock();

board/samsung/odroid-xu3/odroid-xu3.c new file +55 -0
+	/*
+	 * CMU_CPU clocks src to MPLL
+	 * Bit values:                 0  ; 1
+	 * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+	 * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+	 * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+	 * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+	*/
+
+	/* Set CMU_CPU clocks src to OSCCLK */
+	clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+	set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	/* Set APLL to 1200MHz */
+	clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+			PLL_ENABLE(1);
+	set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CMU_CPU clocks src to APLL */
+	set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+	      PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+	set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+	      PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+	while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+		continue;
+
+	/* Set MPLL to 800MHz */
+	set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CLKMUX_UART src to MPLL */
+	clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) |

UART3_SEL(7);

board/samsung/odroid-xu3/odroid-xu3.c new file +1 -0
+	set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) |

UART3_SEL(3); +

board/samsung/odroid-xu3/odroid-xu3.c new file +11 -0
+	clrsetbits_le32(&clk->src_peric0, clr, set);
+
+	/* Set SCLK_UART to 400 MHz (MPLL / 2) */
+	clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+	      UART3_RATIO(15);
+	set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+	      UART3_RATIO(1);
+
+	clrsetbits_le32(&clk->div_peric0, clr, set);
+
+	while (readl(&clk->div_stat_peric0) &

DIV_STAT_PERIC0_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +9 -0
+		continue;
+
+	/* Set CLKMUX_MMC src to MPLL */
+	clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+	set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+	clrsetbits_le32(&clk->src_fsys, clr, set);
+
+	clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) |

MMC2_RATIO(0x3ff);

board/samsung/odroid-xu3/odroid-xu3.c new file +6 -0
+	set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+	/* Wait for divider ready status */
+	while (readl(&clk->div_stat_fsys1) &

DIV_STAT_FSYS1_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +4 -0
+		continue;
+
+	return 0;
+}
Quoted 9 lines
Quoted 8 lines

board/samsung/odroid-xu3/odroid-xu3.c line 122

Quoted 6 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +6 -0
+
+int exynos_early_init_f(void)
+{
+	return board_clock_init();
+}
+#endif

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/b71ffda8/attachment.bin>

#10 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

In reply to Hyungwon Hwang
Quoted 11 lines · Hyungwon Hwang
Quoted 5 lines · On Thu, 27 Nov 2014 22:45:18 +0100 Sjoerd Simons…
Quoted 1 line · Hyungwon Hwang

This patch adds support for Odroid-XU3.

I can't seem to access the EMMC with this patch, is that expected?

Yes. EMMC is not supported yet. Actually even I did not test whether it works or not. EMMC support will be done soon.

Actually, eMMC doesn't work with these patches.
But I have enabled the eMMC based on these..but I needs more time to support booting.

Best Regards,
Jaehoon Chung

Quoted 169 lines
Quoted 14 lines
Quoted 14 lines
board/samsung/odroid-xu3/Kconfig new file +9 -0
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+	default "odroid-xu3"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
Quoted 9 lines

board/samsung/odroid-xu3/Kconfig line 12

Quoted 3 lines
board/samsung/odroid-xu3/Kconfig new file +3 -0
+	default "odroid_xu3"
+
+endif

I was studying the different between the peach-pi and the XU3 hardware enablement a bit. I was wondering whta's the rationale for the XU3 having it's own board file and reconfiguring various clocks? Does the hardkernel SPL/bl2 not setup things correctly?

Hmm. It is my first time to make codes to add support for new board, and I am not sure what is right. Is it needless to set clocks for the cases when SPL/BL2 is expected to set clocks already?

Quoted 125 lines
Quoted 125 lines
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/odroid-xu3.c new file mode 100644 index 0000000..8c54842

board/samsung/odroid-xu3/odroid-xu3.c new file +29 -0
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+	return 0;
+}
+
+int exynos_init(void)
+{
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+	unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+	struct exynos5420_clock *clk = (struct exynos5420_clock *)
+

samsung_get_base_clock();

board/samsung/odroid-xu3/odroid-xu3.c new file +55 -0
+	/*
+	 * CMU_CPU clocks src to MPLL
+	 * Bit values:                 0  ; 1
+	 * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+	 * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+	 * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+	 * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+	*/
+
+	/* Set CMU_CPU clocks src to OSCCLK */
+	clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+	set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	/* Set APLL to 1200MHz */
+	clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+			PLL_ENABLE(1);
+	set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CMU_CPU clocks src to APLL */
+	set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+	clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+	while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+		continue;
+
+	clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+	      PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+	set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+	      PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+	while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+		continue;
+
+	/* Set MPLL to 800MHz */
+	set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+	clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+	while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+		continue;
+
+	/* Set CLKMUX_UART src to MPLL */
+	clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) |

UART3_SEL(7);

board/samsung/odroid-xu3/odroid-xu3.c new file +1 -0
+	set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) |

UART3_SEL(3); +

board/samsung/odroid-xu3/odroid-xu3.c new file +11 -0
+	clrsetbits_le32(&clk->src_peric0, clr, set);
+
+	/* Set SCLK_UART to 400 MHz (MPLL / 2) */
+	clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+	      UART3_RATIO(15);
+	set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+	      UART3_RATIO(1);
+
+	clrsetbits_le32(&clk->div_peric0, clr, set);
+
+	while (readl(&clk->div_stat_peric0) &

DIV_STAT_PERIC0_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +9 -0
+		continue;
+
+	/* Set CLKMUX_MMC src to MPLL */
+	clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+	set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+	clrsetbits_le32(&clk->src_fsys, clr, set);
+
+	clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) |

MMC2_RATIO(0x3ff);

board/samsung/odroid-xu3/odroid-xu3.c new file +6 -0
+	set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+	clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+	/* Wait for divider ready status */
+	while (readl(&clk->div_stat_fsys1) &

DIV_STAT_FSYS1_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +2 -0
+		continue;
+
Quoted 10 lines

board/samsung/odroid-xu3/odroid-xu3.c line 122

Quoted 8 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +8 -0
+	return 0;
+}
+
+int exynos_early_init_f(void)
+{
+	return board_clock_init();
+}
+#endif

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#11 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Hey Jaehoon,

Quoted 7 lines · Jaehoon Chung
Quoted 6 lines · Hyungwon Hwang
Quoted 3 lines · On Thu, 27 Nov 2014 22:45:18 +0100 Sjoerd Simons…
Quoted 1 line · Hyungwon Hwang

This patch adds support for Odroid-XU3.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I can't seem to access the EMMC with this patch, is that expected?

Yes. EMMC is not supported yet. Actually even I did not test whether it works or not. EMMC support will be done soon.

Actually, eMMC doesn't work with these patches.
But I have enabled the eMMC based on these..but I needs more time to support booting.

If you have initial patches for eMMC would be great if you could share those. I'm quite interested in testing that even if it's still quite raw

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141203/b88456e4/attachment.bin>
#12 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

In reply to Hyungwon Hwang

Hi,

Quoted 35 lines · Hyungwon Hwang

This patch adds support for Odroid-XU3.

---
Changes for v3:
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Remove unnecessary macros from board-specific header file
- Fix some trivial typos in comments

Changes for v4:
- Add MMC FIFO buffer's configuration to DT file
- Make CONFIG_OF_CONTROL be set by the target information
- Add basic document to doc/README.odroid-xu3
- Add CONFIG_CMD_EXT4 to config file
- Add environment size and offset to config file
- Add extra default environment to make bootable without modification
- Remove unnecessary features from config file

Changes for v5:
- Convert /include/ to #include in DT file

Changes for v6:
- Separate out the documentation to new commit
- Remove unnecessary header file inclusions from the board-specific setup file
- Make the function board_clock_init be declared, only when CONFIG_BOARD_EARLY_INIT_F is defined

Changes for v7:
- Remove OF_CONTROL dependency from !SPL_BUILD

Quoted 6 lines

Changes for v8:
- Remove unnecessary properties in DT mmc node

Changes for v9:
- Remove useless variables in the default environment
- Replace the detailed information to the reference to the documentation

Great to see this series. I wanted to test it earlier but had problems with it not being reliable. I tracked this down to a uSD card (which works fine on other boards but boots reliably only to SPL on XU3).

Quoted 50 lines
 arch/arm/cpu/armv7/exynos/Kconfig     |   5 ++
 arch/arm/dts/Makefile                 |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  57 +++++++++++++++
 board/samsung/odroid-xu3/Kconfig      |  12 +++
 board/samsung/odroid-xu3/MAINTAINERS  |   6 ++
 board/samsung/odroid-xu3/Makefile     |   7 ++
 board/samsung/odroid-xu3/odroid-xu3.c | 122 +++++++++++++++++++++++++++++++
 board/samsung/odroid-xu3/setup.h      |  95 ++++++++++++++++++++++++
 configs/odroid-xu3_defconfig          |   4 +
 include/configs/odroid.h              |   5 --
 include/configs/odroid_xu3.h          | 133 ++++++++++++++++++++++++++++++++++
 11 files changed, 443 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts
 create mode 100644 board/samsung/odroid-xu3/Kconfig
 create mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 create mode 100644 board/samsung/odroid-xu3/Makefile
 create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 create mode 100644 board/samsung/odroid-xu3/setup.h
 create mode 100644 configs/odroid-xu3_defconfig
 create mode 100644 include/configs/odroid_xu3.h
arch/arm/cpu/armv7/exynos/Kconfig +5 -0
index 13dbd95..16c9a0e 100644
@@ -24,6 +24,10 @@ config TARGET_TRATS2
 config TARGET_ODROID
        bool "Exynos4412 Odroid board"
 
+config TARGET_ODROID_XU3
+       bool "Exynos5422 Odroid board"
+       select OF_CONTROL
+
 config TARGET_ARNDALE
        bool "Exynos5250 Arndale board"
        select SUPPORT_SPL
@@ -65,6 +69,7 @@ source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
+source "board/samsung/odroid-xu3/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
arch/arm/dts/Makefile +0 -0
index e5846ea..a811b1b 100644

arch/arm/dts/Makefile dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ · line 17

Quoted 6 lines
arch/arm/dts/Makefile +2 -1
@@ -13,7 +13,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
        exynos5250-smdk5250.dtb \
        exynos5420-smdk5420.dtb \
        exynos5420-peach-pit.dtb \
-       exynos5800-peach-pi.dtb
+       exynos5800-peach-pi.dtb \
+       exynos5422-odroidxu3.dtb

Is it 5422 or 45800? Is there any difference really?

Quoted 134 lines
arch/arm/dts/Makefile +0 -0
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
        tegra20-medcom-wide.dtb \
        tegra20-paz00.dtb \
arch/arm/dts/exynos5422-odroidxu3.dts new file +57 -0
new file mode 100644
index 0000000..533d88e
@@ -0,0 +1,57 @@
+/*
+ * Odroid XU3 device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+#include "exynos54xx.dtsi"
+
+/ {
+       model = "Odroid XU3 based on EXYNOS5422";
+       compatible = "samsung,odroidxu3", "samsung,exynos5";
+
+       aliases {
+               serial0 = "/serial at 12C00000";
+               console = "/serial at 12C20000";
+       };
+
+       memory {
+               device_type = "memory";
+               reg =  <0x40000000 0x10000000
+                       0x50000000 0x10000000
+                       0x60000000 0x10000000
+                       0x70000000 0x10000000
+                       0x80000000 0x10000000
+                       0x90000000 0x10000000
+                       0xa0000000 0x10000000
+                       0xb0000000 0xea00000>;
+       };
+
+       serial at 12C20000 {
+               status="okay";
+       };
+
+       mmc at 12200000 {
+               samsung,bus-width = <8>;
+               samsung,timing = <1 3 3>;
+               fifoth_val = <0x200f0020>;
+       };
+
+       mmc at 12210000 {
+               status = "disabled";
+       };
+
+       mmc at 12220000 {
+               samsung,bus-width = <4>;
+               samsung,timing = <1 2 3>;
+               fifoth_val = <0x200f0020>;
+       };
+
+       mmc at 12230000 {
+               status = "disabled";
+       };
+};
board/samsung/odroid-xu3/Kconfig new file +12 -0
new file mode 100644
index 0000000..6159692
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+       default "odroid-xu3"
+
+config SYS_VENDOR
+       default "samsung"
+
+config SYS_CONFIG_NAME
+       default "odroid_xu3"
+
+endif
board/samsung/odroid-xu3/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..50cf928
@@ -0,0 +1,6 @@
+ODROID-XU3 BOARD
+M:     Hyungwon Hwang <[email protected]>
+S:     Maintained
+F:     board/samsung/odroid-xu3/
+F:     include/configs/odroid_xu3.h
+F:     configs/odroid-xu3_defconfig
board/samsung/odroid-xu3/Makefile new file +7 -0
new file mode 100644
index 0000000..85ae5c5
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  := odroid-xu3.o
board/samsung/odroid-xu3/odroid-xu3.c new file +19 -0
new file mode 100644
index 0000000..8c54842
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+       return 0;
+}
+
+int exynos_init(void)

board/samsung/odroid-xu3/odroid-xu3.c line 29

Quoted 10 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +10 -0
+{
+       return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+       unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+       struct exynos5420_clock *clk = (struct exynos5420_clock *)
+                                               samsung_get_base_clock();

This stuff needs to move into SPL - if it works then perhaps hardkernel can do this work. It doesn't make sense to set up the clocks in SPL and then again in U-Boot.

At the least this should be commented as a temporary hack, and enable with a CONFIG_EXYNOS_REINIT_CLOCKS option, or something.

Quoted 9 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +9 -0
+       /*
+        * CMU_CPU clocks src to MPLL
+        * Bit values:                 0  ; 1
+        * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+        * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+        * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+        * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+       */
+

board/samsung/odroid-xu3/odroid-xu3.c line 48

Quoted 10 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +10 -0
+       /* Set CMU_CPU clocks src to OSCCLK */
+       clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+       set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
+       clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+       while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+               continue;
+
+       /* Set APLL to 1200MHz */

Why not 1.7GHz?

Quoted 208 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +74 -0
+       clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+                       PLL_ENABLE(1);
+       set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+       clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+       while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+               continue;
+
+       /* Set CMU_CPU clocks src to APLL */
+       set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+       clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+       while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+               continue;
+
+       clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+             PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+       set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+             PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+       clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+       while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+               continue;
+
+       /* Set MPLL to 800MHz */
+       set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+       clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+       while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+               continue;
+
+       /* Set CLKMUX_UART src to MPLL */
+       clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) | UART3_SEL(7);
+       set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) | UART3_SEL(3);
+
+       clrsetbits_le32(&clk->src_peric0, clr, set);
+
+       /* Set SCLK_UART to 400 MHz (MPLL / 2) */
+       clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+             UART3_RATIO(15);
+       set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+             UART3_RATIO(1);
+
+       clrsetbits_le32(&clk->div_peric0, clr, set);
+
+       while (readl(&clk->div_stat_peric0) & DIV_STAT_PERIC0_CHANGING)
+               continue;
+
+       /* Set CLKMUX_MMC src to MPLL */
+       clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+       set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+       clrsetbits_le32(&clk->src_fsys, clr, set);
+
+       clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) | MMC2_RATIO(0x3ff);
+       set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+       clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+       /* Wait for divider ready status */
+       while (readl(&clk->div_stat_fsys1) & DIV_STAT_FSYS1_CHANGING)
+               continue;
+
+       return 0;
+}
+
+int exynos_early_init_f(void)
+{
+       return board_clock_init();
+}
+#endif
board/samsung/odroid-xu3/setup.h new file +95 -0
new file mode 100644
index 0000000..143c189
@@ -0,0 +1,95 @@
+/*
+ * (C) Copyright 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __ODROID_XU3_SETUP__
+#define __ODROID_XU3_SETUP__
+
+#define SDIV(x)                 ((x) & 0x7)
+#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)
+
+/* CLK_MUX_STAT_CPU */
+#define APLL_SEL(x)             ((x) & 0x7)
+#define CORE_SEL(x)             (((x) & 0x7) << 16)
+#define MUX_STAT_CPU_CHANGING(x)       !(((x) & APLL_SEL(0)) ||        \
+                                          (x) & APLL_SEL(1) ||         \
+                                          (x) & CORE_SEL(0) ||         \
+                                          (x) & CORE_SEL(1))
+
+/* CLK_DIV_CPU0 */
+#define ARM_RATIO(x)           ((x) & 0x7)
+#define CPUD_RATIO(x)         (((x) & 0x7) << 4)
+#define ATB_RATIO(x)         (((x) & 0x7) << 16)
+#define PCLK_DBG_RATIO(x)       (((x) & 0x7) << 20)
+#define APLL_RATIO(x)           (((x) & 0x7) << 24)
+#define ARM2_RATIO(x)         (((x) & 0x7) << 28)
+
+/* CLK_DIV_STAT_CPU0 */
+#define DIV_CPUD(x)           (((x) & 0x1) << 4)
+#define DIV_ATB(x)              (((x) & 0x1) << 16)
+#define DIV_PCLK_DBG(x)         (((x) & 0x1) << 20)
+#define DIV_APLL(x)             (((x) & 0x1) << 24)
+#define DIV_ARM2(x)            (((x) & 0x1) << 28)
+
+#define DIV_STAT_CHANGING      0x1
+#define DIV_STAT_CPU0_CHANGING  (DIV_CPUD(DIV_STAT_CHANGING) | \
+                                DIV_ATB(DIV_STAT_CHANGING) | \
+                                DIV_PCLK_DBG(DIV_STAT_CHANGING) | \
+                                DIV_APLL(DIV_STAT_CHANGING) | \
+                                DIV_ARM2(DIV_STAT_CHANGING))
+
+/* Set CLK_SRC_PERIC0 */
+#define UART0_SEL(x)           (((x) & 0xf) << 4)
+#define UART1_SEL(x)           (((x) & 0xf) << 8)
+#define UART2_SEL(x)           (((x) & 0xf) << 12)
+#define UART3_SEL(x)           (((x) & 0xf) << 16)
+
+/* Set CLK_DIV_PERIC0 */
+#define UART0_RATIO(x)         (((x) & 0xf) << 8)
+#define UART1_RATIO(x)         (((x) & 0xf) << 12)
+#define UART2_RATIO(x)         (((x) & 0xf) << 16)
+#define UART3_RATIO(x)         (((x) & 0xf) << 20)
+
+/* Set CLK_DIV_STAT_PERIC0 */
+#define DIV_UART0(x)           ((x) & 0x1)
+#define DIV_UART1(x)           (((x) & 0x1) << 4)
+#define DIV_UART2(x)           (((x) & 0x1) << 8)
+#define DIV_UART3(x)           (((x) & 0x1) << 12)
+#define DIV_UART4(x)           (((x) & 0x1) << 16)
+
+#define DIV_STAT_PERIC0_CHANGING (DIV_UART4(DIV_STAT_CHANGING) | \
+                                 DIV_UART3(DIV_STAT_CHANGING) | \
+                                 DIV_UART2(DIV_STAT_CHANGING) | \
+                                 DIV_UART1(DIV_STAT_CHANGING) | \
+                                 DIV_UART0(DIV_STAT_CHANGING))
+
+/* CLK_SRC_FSYS */
+#define MUX_MMC0_SEL(x)                (((x) & 0x7) << 8)
+#define MUX_MMC1_SEL(x)                (((x) & 0x7) << 12)
+#define MUX_MMC2_SEL(x)                (((x) & 0x7) << 16)
+
+/* CLK_DIV_FSYS1 */
+#define MMC0_RATIO(x)          ((x) & 0x3ff)
+#define MMC1_RATIO(x)          (((x) & 0x3ff) << 10)
+#define MMC2_RATIO(x)          (((x) & 0x3ff) << 20)
+
+#define DIV_MMC0(x)            (((x) & 1) << 20)
+#define DIV_MMC1(x)            (((x) & 1) << 24)
+#define DIV_MMC2(x)            (((x) & 1) << 28)
+
+#define DIV_STAT_FSYS1_CHANGING        (DIV_MMC0(DIV_STAT_CHANGING) | \
+                                DIV_MMC1(DIV_STAT_CHANGING) | \
+                                DIV_MMC2(DIV_STAT_CHANGING))
+
+#endif
configs/odroid-xu3_defconfig new file +4 -0
new file mode 100644
index 0000000..74aa0cf
@@ -0,0 +1,4 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID_XU3=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
include/configs/odroid.h +0 -5
index 807e96b..660b6ae 100644
@@ -166,11 +166,6 @@
        "mmcbootpart=1\0" \
        "mmcrootdev=0\0" \
        "mmcrootpart=2\0" \
-       "bootdelay=0\0" \
-       "dfu_alt_system="CONFIG_DFU_ALT \
-       "dfu_alt_info=Please reset the board\0" \
-       "consoleon=set console console=ttySAC1,115200n8; save; reset\0" \
-       "consoleoff=set console console=ram; save; reset\0" \
        "initrdname=uInitrd\0" \
        "initrdaddr=42000000\0" \
        "fdtaddr=40800000\0"
include/configs/odroid_xu3.h new file +1 -0
new file mode 100644
index 0000000..1d53653
@@ -0,0 +1,133 @@
+/*

include/configs/odroid_xu3.h line 11

Quoted 10 lines
include/configs/odroid_xu3.h new file +10 -0
+ * Copyright (C) 2013 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_ODROID_XU3_H
+#define __CONFIG_ODROID_XU3_H
+
+#include "exynos5-common.h"

Should include exynos5420-common.h. If there are things in there that should not be common, then you could add a patch to move them out.

This causes a build warning in I2C.

Quoted 110 lines
include/configs/odroid_xu3.h new file +110 -0
+
+#define CONFIG_SYS_PROMPT              "ODROID-XU3 # "
+#define CONFIG_IDENT_STRING            " for ODROID-XU3"
+
+#define CONFIG_BOARD_COMMON
+
+#define CONFIG_SYS_SDRAM_BASE          0x40000000
+#define CONFIG_SYS_TEXT_BASE           0x43E00000
+
+/* select serial console configuration */
+#define CONFIG_SERIAL2                 /* use SERIAL 2 */
+
+#define TZPC_BASE_OFFSET               0x10000
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FAT
+
+/*
+ * FIXME: The number of bank is actually 8. But there is no way to reserver the
+ * last 16 Mib in the last bank now. So I just excluded the last bank
+ * temporally.
+ */
+#define CONFIG_NR_DRAM_BANKS   7
+#define SDRAM_BANK_SIZE                (256UL << 20UL) /* 256 MB */
+
+#define CONFIG_ENV_IS_IN_MMC
+
+#undef CONFIG_ENV_SIZE
+#undef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_SIZE                        4096
+#define CONFIG_ENV_OFFSET              (SZ_1K * 1280) /* 1.25 MiB offset */
+
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - 0x1000000)
+
+#define CONFIG_BOOTCOMMAND             "run autoboot"
+#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"
+
+/*
+ * For details, refer the documentation: doc/README.odroid
+*/
+#ifdef CONFIG_EXTRA_ENV_SETTINGS
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#endif
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadkernel=fatload mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
+               "${kernelname}\0" \
+       "loadinitrd=fatload mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
+               "${initrdname}\0" \
+       "loaddtb=fatload mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \
+               "${fdtfile}\0" \
+       "check_ramdisk=" \
+               "if run loadinitrd; then " \
+                       "setenv initrd_addr ${initrdaddr};" \
+               "else " \
+                       "setenv initrd_addr -;" \
+               "fi;\0" \
+       "check_dtb=" \
+               "if run loaddtb; then " \
+                       "setenv fdt_addr ${fdtaddr};" \
+               "else " \
+                       "setenv fdt_addr;" \
+               "fi;\0" \
+       "kernel_args=" \
+               "setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
+               " rootwait ${console} ${opts}\0" \
+       "boot_fit=" \
+               "setenv kerneladdr 0x42000000;" \
+               "setenv kernelname Image.itb;" \
+               "run loadkernel;" \
+               "run kernel_args;" \
+               "bootm ${kerneladdr}#${boardname}\0" \
+       "boot_uimg=" \
+               "setenv kerneladdr 0x40007FC0;" \
+               "setenv kernelname uImage;" \
+               "run check_dtb;" \
+               "run check_ramdisk;" \
+               "run loadkernel;" \
+               "run kernel_args;" \
+               "bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
+       "boot_zimg=" \
+               "setenv kerneladdr 0x40007FC0;" \
+               "setenv kernelname zImage;" \
+               "run check_dtb;" \
+               "run check_ramdisk;" \
+               "run loadkernel;" \
+               "run kernel_args;" \
+               "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
+       "autoboot=" \
+               "if test -e mmc 0 Image.itb; then; " \
+                       "run boot_fit;" \
+               "elif test -e mmc 0 zImage; then; " \
+                       "run boot_zimg;" \
+               "elif test -e mmc 0 uImage; then; " \
+                       "run boot_uimg;" \
+               "fi;\0" \
+       "console=" CONFIG_DEFAULT_CONSOLE \
+       "mmcbootdev=0\0" \
+       "mmcbootpart=1\0" \
+       "mmcrootdev=0\0" \
+       "mmcrootpart=2\0" \
+       "bootdelay=0\0" \
+       "dfu_alt_info=Please reset the board\0" \
+       "consoleon=set console console=ttySAC2,115200n8; save; reset\0" \
+       "consoleoff=set console console=ram; save; reset\0" \
+       "initrdname=uInitrd\0" \
+       "initrdaddr=42000000\0" \
+       "fdtaddr=40800000\0"
+

include/configs/odroid_xu3.h line 131

Quoted 10 lines
include/configs/odroid_xu3.h new file +10 -0
+/* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
+#undef CONFIG_EXYNOS_TMU
+#undef CONFIG_TMU_CMD_DTT
+
+#ifdef CONFIG_CMD_NET
+#undef CONFIG_CMD_NET
+#undef CONFIG_SMC911X
+#undef CONFIG_CMD_PXE
+#undef CONFIG_MENU
+#endif

Why remove net?

Quoted 9 lines
include/configs/odroid_xu3.h new file +2 -1
+
+#endif /* __CONFIG_H */
--

1.9.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Regards,
SImon

#13 lore raw

PATCH v9 1/2 Odroid-XU3: Add support for Odroid-XU3

Quoted 105 lines · On Mon, 01 Dec 2014 10:30:15 -0700 Simon Glass <[email protected]> wrote:

Hi,

Quoted 37 lines · Hyungwon Hwang

This patch adds support for Odroid-XU3.

---
Changes for v3:
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Remove unnecessary macros from board-specific header file
- Fix some trivial typos in comments

Changes for v4:
- Add MMC FIFO buffer's configuration to DT file
- Make CONFIG_OF_CONTROL be set by the target information
- Add basic document to doc/README.odroid-xu3
- Add CONFIG_CMD_EXT4 to config file
- Add environment size and offset to config file
- Add extra default environment to make bootable without modification
- Remove unnecessary features from config file

Changes for v5:
- Convert /include/ to #include in DT file

Changes for v6:
- Separate out the documentation to new commit
- Remove unnecessary header file inclusions from the board-specific setup file
- Make the function board_clock_init be declared, only when CONFIG_BOARD_EARLY_INIT_F is defined

Changes for v7:
- Remove OF_CONTROL dependency from !SPL_BUILD

Quoted 7 lines

Changes for v8:
- Remove unnecessary properties in DT mmc node

Changes for v9:
- Remove useless variables in the default environment
- Replace the detailed information to the reference to the documentation

Great to see this series. I wanted to test it earlier but had problems with it not being reliable. I tracked this down to a uSD card (which works fine on other boards but boots reliably only to SPL on XU3).

Quoted 52 lines
 arch/arm/cpu/armv7/exynos/Kconfig     |   5 ++
 arch/arm/dts/Makefile                 |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  57 +++++++++++++++
 board/samsung/odroid-xu3/Kconfig      |  12 +++
 board/samsung/odroid-xu3/MAINTAINERS  |   6 ++
 board/samsung/odroid-xu3/Makefile     |   7 ++
 board/samsung/odroid-xu3/odroid-xu3.c | 122

+++++++++++++++++++++++++++++++
board/samsung/odroid-xu3/setup.h | 95
++++++++++++++++++++++++ configs/odroid-xu3_defconfig |
4 + include/configs/odroid.h | 5 --
include/configs/odroid_xu3.h | 133
++++++++++++++++++++++++++++++++++ 11 files changed, 443 insertions(+), 6 deletions(-) create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts create mode 100644 board/samsung/odroid-xu3/Kconfig create mode 100644 board/samsung/odroid-xu3/MAINTAINERS create mode 100644 board/samsung/odroid-xu3/Makefile create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c create mode 100644 board/samsung/odroid-xu3/setup.h create mode 100644 configs/odroid-xu3_defconfig create mode 100644 include/configs/odroid_xu3.h

(quoted diff) +0 -0

b/arch/arm/cpu/armv7/exynos/Kconfig index 13dbd95..16c9a0e 100644

arch/arm/cpu/armv7/exynos/Kconfig +5 -0
@@ -24,6 +24,10 @@ config TARGET_TRATS2
 config TARGET_ODROID
        bool "Exynos4412 Odroid board"
 
+config TARGET_ODROID_XU3
+       bool "Exynos5422 Odroid board"
+       select OF_CONTROL
+
 config TARGET_ARNDALE
        bool "Exynos5250 Arndale board"
        select SUPPORT_SPL
@@ -65,6 +69,7 @@ source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
+source "board/samsung/odroid-xu3/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
arch/arm/dts/Makefile +0 -0
index e5846ea..a811b1b 100644
@@ -13,7 +13,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
Quoted 8 lines

arch/arm/dts/Makefile dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ · line 17

Quoted 6 lines
arch/arm/dts/Makefile +2 -1
        exynos5250-smdk5250.dtb \
        exynos5420-smdk5420.dtb \
        exynos5420-peach-pit.dtb \
-       exynos5800-peach-pi.dtb
+       exynos5800-peach-pi.dtb \
+       exynos5422-odroidxu3.dtb

Is it 5422 or 45800? Is there any difference really?

Actually the processor in XU3 is Exynos5422. Exynos5800 is a variant of Exynos5422 for Chromebook. You can find the information about it from:
http://www.samsung.com/global/business/semiconductor/minisite/Exynos/w/solution.html#?v=octa_5422

Quoted 151 lines
Quoted 145 lines
arch/arm/dts/Makefile +0 -0
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
        tegra20-medcom-wide.dtb \
        tegra20-paz00.dtb \
(quoted diff) +0 -0

b/arch/arm/dts/exynos5422-odroidxu3.dts new file mode 100644 index 0000000..533d88e

arch/arm/dts/exynos5422-odroidxu3.dts new file +57 -0
@@ -0,0 +1,57 @@
+/*
+ * Odroid XU3 device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+#include "exynos54xx.dtsi"
+
+/ {
+       model = "Odroid XU3 based on EXYNOS5422";
+       compatible = "samsung,odroidxu3", "samsung,exynos5";
+
+       aliases {
+               serial0 = "/serial at 12C00000";
+               console = "/serial at 12C20000";
+       };
+
+       memory {
+               device_type = "memory";
+               reg =  <0x40000000 0x10000000
+                       0x50000000 0x10000000
+                       0x60000000 0x10000000
+                       0x70000000 0x10000000
+                       0x80000000 0x10000000
+                       0x90000000 0x10000000
+                       0xa0000000 0x10000000
+                       0xb0000000 0xea00000>;
+       };
+
+       serial at 12C20000 {
+               status="okay";
+       };
+
+       mmc at 12200000 {
+               samsung,bus-width = <8>;
+               samsung,timing = <1 3 3>;
+               fifoth_val = <0x200f0020>;
+       };
+
+       mmc at 12210000 {
+               status = "disabled";
+       };
+
+       mmc at 12220000 {
+               samsung,bus-width = <4>;
+               samsung,timing = <1 2 3>;
+               fifoth_val = <0x200f0020>;
+       };
+
+       mmc at 12230000 {
+               status = "disabled";
+       };
+};
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/Kconfig new file mode 100644 index 0000000..6159692

board/samsung/odroid-xu3/Kconfig new file +12 -0
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+       default "odroid-xu3"
+
+config SYS_VENDOR
+       default "samsung"
+
+config SYS_CONFIG_NAME
+       default "odroid_xu3"
+
+endif
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/MAINTAINERS new file mode 100644 index 0000000..50cf928

board/samsung/odroid-xu3/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@
+ODROID-XU3 BOARD
+M:     Hyungwon Hwang <[email protected]>
+S:     Maintained
+F:     board/samsung/odroid-xu3/
+F:     include/configs/odroid_xu3.h
+F:     configs/odroid-xu3_defconfig
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/Makefile new file mode 100644 index 0000000..85ae5c5

board/samsung/odroid-xu3/Makefile new file +2 -0
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights

reserved. +#

board/samsung/odroid-xu3/Makefile new file +4 -0
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  := odroid-xu3.o
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/odroid-xu3.c new file mode 100644 index 0000000..8c54842

board/samsung/odroid-xu3/odroid-xu3.c new file +29 -0
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/clock.h>
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int get_board_rev(void)
+{
+       return 0;
+}
+
+int exynos_init(void)
+{
+       return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+static int board_clock_init(void)
+{
+       unsigned int set, clr, clr_src_cpu, clr_pll_con0;
+       struct exynos5420_clock *clk = (struct exynos5420_clock *)
+
Quoted 1 line

samsung_get_base_clock();

This stuff needs to move into SPL - if it works then perhaps hardkernel can do this work. It doesn't make sense to set up the clocks in SPL and then again in U-Boot.

Quoted 2 lines

At the least this should be commented as a temporary hack, and enable with a CONFIG_EXYNOS_REINIT_CLOCKS option, or something.

OK. As we discussed, I found that it is needless. I will remove it from next version.

Quoted 14 lines
Quoted 14 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +13 -0
+       /*
+        * CMU_CPU clocks src to MPLL
+        * Bit values:                 0  ; 1
+        * MUX_APLL_SEL:        FIN_PLL   ; FOUT_APLL
+        * MUX_CORE_SEL:        MOUT_APLL ; SCLK_MPLL
+        * MUX_HPM_SEL:         MOUT_APLL ; SCLK_MPLL_USER_C
+        * MUX_MPLL_USER_SEL_C: FIN_PLL   ; SCLK_MPLL
+       */
+
+       /* Set CMU_CPU clocks src to OSCCLK */
+       clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1);
+       set = MUX_APLL_SEL(0) | MUX_CORE_SEL(1);
+
Quoted 8 lines

board/samsung/odroid-xu3/odroid-xu3.c line 48

Quoted 6 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +6 -0
+       clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+       while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+               continue;
+
+       /* Set APLL to 1200MHz */

Why not 1.7GHz?

This function will be removed in whole.

Quoted 232 lines
Quoted 218 lines
board/samsung/odroid-xu3/odroid-xu3.c new file +36 -0
+       clr_pll_con0 = SDIV(7) | PDIV(63) | MDIV(1023) | FSEL(1) |
+                       PLL_ENABLE(1);
+       set = SDIV(0) | PDIV(2) | MDIV(100) | PLL_ENABLE(1);
+
+       clrsetbits_le32(&clk->apll_con0, clr_pll_con0, set);
+
+       while (!(readl(&clk->apll_con0) & PLL_LOCKED_BIT))
+               continue;
+
+       /* Set CMU_CPU clocks src to APLL */
+       set = MUX_APLL_SEL(1) | MUX_CORE_SEL(0);
+       clrsetbits_le32(&clk->src_cpu, clr_src_cpu, set);
+
+       while (MUX_STAT_CPU_CHANGING(readl(&clk->mux_stat_cpu)))
+               continue;
+
+       clr = ARM_RATIO(7) | CPUD_RATIO(7) | ATB_RATIO(7) |
+             PCLK_DBG_RATIO(7) | APLL_RATIO(7) | ARM2_RATIO(7);
+       set = ARM_RATIO(0) | CPUD_RATIO(2) | ATB_RATIO(5) |
+             PCLK_DBG_RATIO(5) | APLL_RATIO(0) | ARM2_RATIO(0);
+
+       clrsetbits_le32(&clk->div_cpu0, clr, set);
+
+       while (readl(&clk->div_stat_cpu0) & DIV_STAT_CPU0_CHANGING)
+               continue;
+
+       /* Set MPLL to 800MHz */
+       set = SDIV(1) | PDIV(3) | MDIV(200) | PLL_ENABLE(1);
+
+       clrsetbits_le32(&clk->mpll_con0, clr_pll_con0, set);
+
+       while (!(readl(&clk->mpll_con0) & PLL_LOCKED_BIT))
+               continue;
+
+       /* Set CLKMUX_UART src to MPLL */
+       clr = UART0_SEL(7) | UART1_SEL(7) | UART2_SEL(7) |

UART3_SEL(7);
+ set = UART0_SEL(3) | UART1_SEL(3) | UART2_SEL(3) |
UART3_SEL(3); +

board/samsung/odroid-xu3/odroid-xu3.c new file +11 -0
+       clrsetbits_le32(&clk->src_peric0, clr, set);
+
+       /* Set SCLK_UART to 400 MHz (MPLL / 2) */
+       clr = UART0_RATIO(15) | UART1_RATIO(15) | UART2_RATIO(15) |
+             UART3_RATIO(15);
+       set = UART0_RATIO(1) | UART1_RATIO(1) | UART2_RATIO(1) |
+             UART3_RATIO(1);
+
+       clrsetbits_le32(&clk->div_peric0, clr, set);
+
+       while (readl(&clk->div_stat_peric0) &

DIV_STAT_PERIC0_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +9 -0
+               continue;
+
+       /* Set CLKMUX_MMC src to MPLL */
+       clr = MUX_MMC0_SEL(7) | MUX_MMC1_SEL(7) | MUX_MMC2_SEL(7);
+       set = MUX_MMC0_SEL(3) | MUX_MMC1_SEL(3) | MUX_MMC2_SEL(3);
+
+       clrsetbits_le32(&clk->src_fsys, clr, set);
+
+       clr = MMC0_RATIO(0x3ff) | MMC1_RATIO(0x3ff) |

MMC2_RATIO(0x3ff);

board/samsung/odroid-xu3/odroid-xu3.c new file +6 -0
+       set = MMC0_RATIO(0) | MMC1_RATIO(0) | MMC2_RATIO(0);
+
+       clrsetbits_le32(&clk->div_fsys1, clr, set);
+
+       /* Wait for divider ready status */
+       while (readl(&clk->div_stat_fsys1) &

DIV_STAT_FSYS1_CHANGING)

board/samsung/odroid-xu3/odroid-xu3.c new file +10 -0
+               continue;
+
+       return 0;
+}
+
+int exynos_early_init_f(void)
+{
+       return board_clock_init();
+}
+#endif
(quoted diff) +0 -0

b/board/samsung/odroid-xu3/setup.h new file mode 100644 index 0000000..143c189

board/samsung/odroid-xu3/setup.h new file +25 -0
@@ -0,0 +1,95 @@
+/*
+ * (C) Copyright 2014 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __ODROID_XU3_SETUP__
+#define __ODROID_XU3_SETUP__
+
+#define SDIV(x)                 ((x) & 0x7)
+#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)
+
+/* CLK_MUX_STAT_CPU */
+#define APLL_SEL(x)             ((x) & 0x7)
+#define CORE_SEL(x)             (((x) & 0x7) << 16)
+#define MUX_STAT_CPU_CHANGING(x)       !(((x) & APLL_SEL(0))
||        \
+                                          (x) & APLL_SEL(1)
||         \
+                                          (x) & CORE_SEL(0)
||         \
board/samsung/odroid-xu3/setup.h new file +64 -0
+                                          (x) & CORE_SEL(1))
+
+/* CLK_DIV_CPU0 */
+#define ARM_RATIO(x)           ((x) & 0x7)
+#define CPUD_RATIO(x)         (((x) & 0x7) << 4)
+#define ATB_RATIO(x)         (((x) & 0x7) << 16)
+#define PCLK_DBG_RATIO(x)       (((x) & 0x7) << 20)
+#define APLL_RATIO(x)           (((x) & 0x7) << 24)
+#define ARM2_RATIO(x)         (((x) & 0x7) << 28)
+
+/* CLK_DIV_STAT_CPU0 */
+#define DIV_CPUD(x)           (((x) & 0x1) << 4)
+#define DIV_ATB(x)              (((x) & 0x1) << 16)
+#define DIV_PCLK_DBG(x)         (((x) & 0x1) << 20)
+#define DIV_APLL(x)             (((x) & 0x1) << 24)
+#define DIV_ARM2(x)            (((x) & 0x1) << 28)
+
+#define DIV_STAT_CHANGING      0x1
+#define DIV_STAT_CPU0_CHANGING  (DIV_CPUD(DIV_STAT_CHANGING) | \
+                                DIV_ATB(DIV_STAT_CHANGING) | \
+                                DIV_PCLK_DBG(DIV_STAT_CHANGING) | \
+                                DIV_APLL(DIV_STAT_CHANGING) | \
+                                DIV_ARM2(DIV_STAT_CHANGING))
+
+/* Set CLK_SRC_PERIC0 */
+#define UART0_SEL(x)           (((x) & 0xf) << 4)
+#define UART1_SEL(x)           (((x) & 0xf) << 8)
+#define UART2_SEL(x)           (((x) & 0xf) << 12)
+#define UART3_SEL(x)           (((x) & 0xf) << 16)
+
+/* Set CLK_DIV_PERIC0 */
+#define UART0_RATIO(x)         (((x) & 0xf) << 8)
+#define UART1_RATIO(x)         (((x) & 0xf) << 12)
+#define UART2_RATIO(x)         (((x) & 0xf) << 16)
+#define UART3_RATIO(x)         (((x) & 0xf) << 20)
+
+/* Set CLK_DIV_STAT_PERIC0 */
+#define DIV_UART0(x)           ((x) & 0x1)
+#define DIV_UART1(x)           (((x) & 0x1) << 4)
+#define DIV_UART2(x)           (((x) & 0x1) << 8)
+#define DIV_UART3(x)           (((x) & 0x1) << 12)
+#define DIV_UART4(x)           (((x) & 0x1) << 16)
+
+#define DIV_STAT_PERIC0_CHANGING (DIV_UART4(DIV_STAT_CHANGING) | \
+                                 DIV_UART3(DIV_STAT_CHANGING) | \
+                                 DIV_UART2(DIV_STAT_CHANGING) | \
+                                 DIV_UART1(DIV_STAT_CHANGING) | \
+                                 DIV_UART0(DIV_STAT_CHANGING))
+
+/* CLK_SRC_FSYS */
+#define MUX_MMC0_SEL(x)                (((x) & 0x7) << 8)
+#define MUX_MMC1_SEL(x)                (((x) & 0x7) << 12)
+#define MUX_MMC2_SEL(x)                (((x) & 0x7) << 16)
+
+/* CLK_DIV_FSYS1 */
+#define MMC0_RATIO(x)          ((x) & 0x3ff)
+#define MMC1_RATIO(x)          (((x) & 0x3ff) << 10)
+#define MMC2_RATIO(x)          (((x) & 0x3ff) << 20)
+
+#define DIV_MMC0(x)            (((x) & 1) << 20)
+#define DIV_MMC1(x)            (((x) & 1) << 24)
+#define DIV_MMC2(x)            (((x) & 1) << 28)
+
+#define DIV_STAT_FSYS1_CHANGING

(DIV_MMC0(DIV_STAT_CHANGING) | \

board/samsung/odroid-xu3/setup.h new file +4 -0
+                                DIV_MMC1(DIV_STAT_CHANGING) | \
+                                DIV_MMC2(DIV_STAT_CHANGING))
+
+#endif
(quoted diff) +0 -0

b/configs/odroid-xu3_defconfig new file mode 100644 index 0000000..74aa0cf

configs/odroid-xu3_defconfig new file +4 -0
@@ -0,0 +1,4 @@
+CONFIG_ARM=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_TARGET_ODROID_XU3=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
include/configs/odroid.h +0 -5
index 807e96b..660b6ae 100644
@@ -166,11 +166,6 @@
        "mmcbootpart=1\0" \
        "mmcrootdev=0\0" \
        "mmcrootpart=2\0" \
-       "bootdelay=0\0" \
-       "dfu_alt_system="CONFIG_DFU_ALT \
-       "dfu_alt_info=Please reset the board\0" \
-       "consoleon=set console console=ttySAC1,115200n8; save;
 reset\0" \
-       "consoleoff=set console console=ram; save; reset\0" \
        "initrdname=uInitrd\0" \
        "initrdaddr=42000000\0" \
        "fdtaddr=40800000\0"
(quoted diff) +0 -0

b/include/configs/odroid_xu3.h new file mode 100644 index 0000000..1d53653

include/configs/odroid_xu3.h new file +1 -0
@@ -0,0 +1,133 @@
+/*

include/configs/odroid_xu3.h line 11

Quoted 10 lines
include/configs/odroid_xu3.h new file +10 -0
+ * Copyright (C) 2013 Samsung Electronics
+ * Hyungwon Hwang <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_ODROID_XU3_H
+#define __CONFIG_ODROID_XU3_H
+
+#include "exynos5-common.h"

Should include exynos5420-common.h. If there are things in there that should not be common, then you could add a patch to move them out.

Quoted 1 line

This causes a build warning in I2C.

Yes. I agree with you. I will fix it.

Quoted 124 lines
Quoted 124 lines
include/configs/odroid_xu3.h new file +21 -0
+
+#define CONFIG_SYS_PROMPT              "ODROID-XU3 # "
+#define CONFIG_IDENT_STRING            " for ODROID-XU3"
+
+#define CONFIG_BOARD_COMMON
+
+#define CONFIG_SYS_SDRAM_BASE          0x40000000
+#define CONFIG_SYS_TEXT_BASE           0x43E00000
+
+/* select serial console configuration */
+#define CONFIG_SERIAL2                 /* use SERIAL 2 */
+
+#define TZPC_BASE_OFFSET               0x10000
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FAT
+
+/*
+ * FIXME: The number of bank is actually 8. But there is no way to

reserver the
+ * last 16 Mib in the last bank now. So I just excluded the last bank
+ * temporally.
+ */

include/configs/odroid_xu3.h new file +9 -0
+#define CONFIG_NR_DRAM_BANKS   7
+#define SDRAM_BANK_SIZE                (256UL << 20UL) /* 256 MB */
+
+#define CONFIG_ENV_IS_IN_MMC
+
+#undef CONFIG_ENV_SIZE
+#undef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_SIZE                        4096
+#define CONFIG_ENV_OFFSET              (SZ_1K * 1280) /* 1.25 MiB

offset */ +
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR -
0x1000000) +

include/configs/odroid_xu3.h new file +11 -0
+#define CONFIG_BOOTCOMMAND             "run autoboot"
+#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"
+
+/*
+ * For details, refer the documentation: doc/README.odroid
+*/
+#ifdef CONFIG_EXTRA_ENV_SETTINGS
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#endif
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadkernel=fatload mmc ${mmcbootdev}:${mmcbootpart}

${kerneladdr} " \

include/configs/odroid_xu3.h new file +2 -0
+               "${kernelname}\0" \
+       "loadinitrd=fatload mmc ${mmcbootdev}:${mmcbootpart}

${initrdaddr} " \

include/configs/odroid_xu3.h new file +2 -0
+               "${initrdname}\0" \
+       "loaddtb=fatload mmc ${mmcbootdev}:${mmcbootpart}

${fdtaddr} " \

include/configs/odroid_xu3.h new file +15 -0
+               "${fdtfile}\0" \
+       "check_ramdisk=" \
+               "if run loadinitrd; then " \
+                       "setenv initrd_addr ${initrdaddr};" \
+               "else " \
+                       "setenv initrd_addr -;" \
+               "fi;\0" \
+       "check_dtb=" \
+               "if run loaddtb; then " \
+                       "setenv fdt_addr ${fdtaddr};" \
+               "else " \
+                       "setenv fdt_addr;" \
+               "fi;\0" \
+       "kernel_args=" \
+               "setenv bootargs

root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \

include/configs/odroid_xu3.h new file +15 -0
+               " rootwait ${console} ${opts}\0" \
+       "boot_fit=" \
+               "setenv kerneladdr 0x42000000;" \
+               "setenv kernelname Image.itb;" \
+               "run loadkernel;" \
+               "run kernel_args;" \
+               "bootm ${kerneladdr}#${boardname}\0" \
+       "boot_uimg=" \
+               "setenv kerneladdr 0x40007FC0;" \
+               "setenv kernelname uImage;" \
+               "run check_dtb;" \
+               "run check_ramdisk;" \
+               "run loadkernel;" \
+               "run kernel_args;" \
+               "bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0"

\

include/configs/odroid_xu3.h new file +8 -0
+       "boot_zimg=" \
+               "setenv kerneladdr 0x40007FC0;" \
+               "setenv kernelname zImage;" \
+               "run check_dtb;" \
+               "run check_ramdisk;" \
+               "run loadkernel;" \
+               "run kernel_args;" \
+               "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0"

\

include/configs/odroid_xu3.h new file +16 -0
+       "autoboot=" \
+               "if test -e mmc 0 Image.itb; then; " \
+                       "run boot_fit;" \
+               "elif test -e mmc 0 zImage; then; " \
+                       "run boot_zimg;" \
+               "elif test -e mmc 0 uImage; then; " \
+                       "run boot_uimg;" \
+               "fi;\0" \
+       "console=" CONFIG_DEFAULT_CONSOLE \
+       "mmcbootdev=0\0" \
+       "mmcbootpart=1\0" \
+       "mmcrootdev=0\0" \
+       "mmcrootpart=2\0" \
+       "bootdelay=0\0" \
+       "dfu_alt_info=Please reset the board\0" \
+       "consoleon=set console console=ttySAC2,115200n8; save;

reset\0" \

include/configs/odroid_xu3.h new file +9 -0
+       "consoleoff=set console console=ram; save; reset\0" \
+       "initrdname=uInitrd\0" \
+       "initrdaddr=42000000\0" \
+       "fdtaddr=40800000\0"
+
+/* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
+#undef CONFIG_EXYNOS_TMU
+#undef CONFIG_TMU_CMD_DTT
+
Quoted 8 lines

include/configs/odroid_xu3.h line 131

Quoted 6 lines
include/configs/odroid_xu3.h new file +6 -0
+#ifdef CONFIG_CMD_NET
+#undef CONFIG_CMD_NET
+#undef CONFIG_SMC911X
+#undef CONFIG_CMD_PXE
+#undef CONFIG_MENU
+#endif

Why remove net?

I removed it to make u-boot binary smaller. I will test it again after remove these lines. If the u-boot binary is small enough, I will remove them. But if it fails, I will remain them until the size issue is resovled.

Quoted 14 lines
Quoted 10 lines
include/configs/odroid_xu3.h new file +2 -1
+
+#endif /* __CONFIG_H */
--

1.9.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Regards,
SImon

#14 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

In reply to Hyungwon Hwang

This patch adds documentation for Odroid-XU3. This documentation is based on that of Odroid (doc/README-odroid) made by Przemyslaw Marczak. The documentation includes basic information about boot media layout, environment, partition layout, and the instruction to burn the u-boot image to boot media.

---
Changes for v6:
- Newly added

Changes for v7:
- Fix several errata in the documentation

Changes for v8:
- None

Changes for v9:
- Add the new contents to the documentation of Odroid X2/U2, instead of making new document for Odorid XU3

 doc/README.odroid | 46 ++++++++++++++++++++++++++++++----------------
 1 file changed, 30 insertions(+), 16 deletions(-)
doc/README.odroid +30 -16
index 25b962b..99693d4 100644
@@ -1,28 +1,39 @@
- U-boot for Odroid X2/U3
+ U-boot for Odroid X2/U3/XU3
 ========================
 
 1. Summary
 ==========
-This is a quick instruction for setup Odroid boards based on Exynos4412.
-Board config: odroid_config
+This is a quick instruction for setup Odroid boards.
+Board config: odroid_config for X2/U3
+Board config: odroid-xu3_config for XU3
 
 2. Supported devices
 ====================
-This U-BOOT config can be used on two boards:
+This U-BOOT config can be used on three boards:
 - Odroid U3
 - Odroid X2
 with CPU Exynos 4412 rev 2.0 and 2GB of RAM
+- Odroid XU3
+with CPU Exynos5422 and 2GB of RAM
 
 3. Boot sequence
 ================
 iROM->BL1->(BL2 + TrustZone)->U-BOOT
 
-This version of U-BOOT doesn't implement SPL but it is required(BL2)
-and can be found in "boot.tar.gz" from here:
+This version of U-BOOT doesn't implement SPL. So, BL1, BL2, and TrustZone
+binaries are needed to boot up.
+
+<< X2/U3 >>
+It can be found in "boot.tar.gz" from here:
 http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz
 or here:
 http://odroid.in/guides/ubuntu-lfs/boot.tar.gz
 
+<< XU3 >>
+It can be downloaded from:
+https://github.com/hardkernel/u-boot/tree/odroidxu3-v2012.07/sd_fuse/hardkernel
+
+
 4. Boot media layout
 ====================
 The table below shows SD/eMMC cards layout for U-boot.
@@ -35,18 +46,20 @@ The block offset is starting from 0 and the block size is 512B.
 | Bl2       | 31   | 30   |  1 (boot) |
 | U-boot    | 63   | 62   |  1 (boot) |
 | Tzsw      | 2111 | 2110 |  1 (boot) |
-| Uboot Env | 2500 | 2500 |  0 (user) |
+| Uboot Env | 2560 | 2560 |  0 (user) |
  -------------------------------------
 
 5. Prepare the SD boot card - with SD card reader
 =================================================
 To prepare bootable media you need boot binaries provided by hardkernel.
-File "boot.tar.gz" (link in point 3.) contains:
-- E4412_S.bl1.HardKernel.bin
-- E4412_S.tzsw.signed.bin
-- bl2.signed.bin
+From the downloaded files, You can find:
+- bl1.bin
+- tzsw.bin
+- bl2.bin
 - sd_fusing.sh
 - u-boot.bin
+(The file names can be slightly different, but you can distinguish what they are
+without problem)
 
 This is all you need to boot this board. But if you want to use your custom
 u-boot then you need to change u-boot.bin with your own u-boot binary*
@@ -56,7 +69,7 @@ and run the script "sd_fusing.sh" - this script is valid only for SD card.
 The proper binary file of current U-boot is u-boot-dtb.bin.
 
 quick steps for Linux:
-- extract boot.tar.gz
+- Download all files from the link at point 3 and extract it if needed.
 - put any SD card into the SD reader
 - check the device with "dmesg"
 - run ./sd_fusing.sh /dev/sdX - where X is SD card device (but not a partition)
@@ -66,7 +79,7 @@ Check if Hardkernel U-boot is booting, and next do the same with your U-boot.
    with a eMMC card reader (boot from eMMC card slot)
 =====================================================
 To boot the device from the eMMC slot you should use a special card reader
-which supports eMMC partiion switch. All of the boot binaries are stored
+which supports eMMC partition switch. All of the boot binaries are stored
 on the eMMC boot partition which is normally hidden.
 
 The "sd_fusing.sh" script can be used after updating offsets of binaries
@@ -81,8 +94,8 @@ But then the device can boot only from the SD card slot.
 
 8. Prepare the boot media using Hardkernel U-boot
 =================================================
-You can update the U-boot to the custom one if you have an working bootloader
-delivered with the board on a eMMC/SD card. Then follow the steps:
+You can update the U-boot to the custom one if you have a working bootloader
+delivered with the board on the eMMC/SD card. Then follow the steps:
 - install the android fastboot tool
 - connect a micro usb cable to the board
 - on the U-boot prompt, run command: fastboot (as a root)
@@ -91,7 +104,7 @@ delivered with the board on a eMMC/SD card. Then follow the steps:
 
 9. Partition layout
 ====================
-Default U-boot environment is setup for fixed partiion layout.
+Default U-boot environment is setup for fixed partition layout.
 
 Partition table: MSDOS. Disk layout and files as listed in the table below.
  ----- ------ ------ ------ -------- ---------------------------------
@@ -106,6 +119,7 @@ Partition table: MSDOS. Disk layout and files as listed in the table below.
 Supported fdt files are:
 - exynos4412-odroidx2.dtb
 - exynos4412-odroidu3.dtb
+- exynos5422-odroidxu3.dtb
 
 Supported kernel files are:
 - Image.itb
Signature · 1 line
1.9.1
#15 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 10 lines · Hyungwon Hwang

This patch adds documentation for Odroid-XU3. This documentation is based on that of Odroid (doc/README-odroid) made by Przemyslaw Marczak. The documentation includes basic information about boot media layout, environment, partition layout, and the instruction to burn the u-boot image to boot media.

4. Boot media layout
====================
The table below shows SD/eMMC cards layout for U-boot.

doc/README.odroid The block offset is starting from 0 and the block size is 512B. · line 50

Quoted 6 lines
doc/README.odroid +1 -1
@@ -35,18 +46,20 @@ The block offset is starting from 0 and the block size is 512B.
 | Bl2       | 31   | 30   |  1 (boot) |
 | U-boot    | 63   | 62   |  1 (boot) |
 | Tzsw      | 2111 | 2110 |  1 (boot) |
-| Uboot Env | 2500 | 2500 |  0 (user) |
+| Uboot Env | 2560 | 2560 |  0 (user) |
  -------------------------------------

Where the previous values incorrect? Also this doesn't seem to match the hardkerel script which has:

signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
env_position=1231

for the various locations.. Which also explains the limit 335872 bytes in your initial mail.. Awkward one though. Wonder if that's an SoC issue or something hardkernel could fix by having a different bl1/bl2?

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141127/2f5ddae8/attachment.bin>
#16 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 7 lines · On Thu, 27 Nov 2014 15:33:05 +0100 Sjoerd Simons…
Quoted 5 lines · Hyungwon Hwang

This patch adds documentation for Odroid-XU3. This documentation is based on that of Odroid (doc/README-odroid) made by Przemyslaw Marczak. The documentation includes basic information about boot media layout, environment, partition layout, and the instruction to burn the u-boot image to boot media.

Quoted 13 lines
Quoted 10 lines

4. Boot media layout
====================
The table below shows SD/eMMC cards layout for U-boot.

(quoted diff) +0 -0
@@ -35,18 +46,20 @@ The block offset is starting from 0 and the
block size is 512B. | Bl2       | 31   | 30   |  1 (boot) |
 | U-boot    | 63   | 62   |  1 (boot) |
 | Tzsw      | 2111 | 2110 |  1 (boot) |
-| Uboot Env | 2500 | 2500 |  0 (user) |
+| Uboot Env | 2560 | 2560 |  0 (user) |

-------------------------------------

Where the previous values incorrect? Also this doesn't seem to match the hardkerel script which has:

This boot media layout is for x2/u3. I will update it in next version.

But the env offset is
#define CONFIG_ENV_OFFSET (SZ_1K * 1280) /* 1.25 MiB offset */
as you can see in odroid.h and odroid_xu3.h.

CONFIG_ENV_OFFSET / 512 = 2560, not 2500.

Quoted 11 lines

signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
env_position=1231

for the various locations.. Which also explains the limit 335872 bytes in your initial mail.. Awkward one though. Wonder if that's an SoC issue or something hardkernel could fix by having a different bl1/bl2?

(719 - 63) * 512 = 335876 bytes. The limitation is needed not to overwrite tzsw.

Are you saying that the limitation can be removed? Yes, with different bl1/bl2. But I do not think that another bl1/bl2 will be released to relieve the limitation.

#17 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 14 lines · Hyungwon Hwang
Quoted 10 lines · On Thu, 27 Nov 2014 15:33:05 +0100 Sjoerd Simons…

signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
env_position=1231

for the various locations.. Which also explains the limit 335872 bytes in your initial mail.. Awkward one though. Wonder if that's an SoC issue or something hardkernel could fix by having a different bl1/bl2?

Quoted 6 lines

(719 - 63) * 512 = 335876 bytes. The limitation is needed not to overwrite tzsw.

Are you saying that the limitation can be removed? Yes, with different bl1/bl2. But I do not think that another bl1/bl2 will be released to relieve the limitation.

It was a something i was wondering. After send this e-mail i had a chat with Mauro Ribeiro on #linux-exynos. He indicate that the BL2 determines the u-boot load location and that it's an u-boot SPL build from their u-boot branch. Also he indicated that he would be happy to sign a modified SPL build which e.g. loads u-boot from behind the TZSW.

You can find the IRC log here:
http://irclog.whitequark.org/linux-exynos/2014-11-27

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/278d00f1/attachment.bin>
#18 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hi Sjoerd,

Quoted 30 lines · Hyungwon Hwang
Quoted 15 lines
Quoted 11 lines · On Thu, 27 Nov 2014 15:33:05 +0100 Sjoerd Simons…

signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
env_position=1231

for the various locations.. Which also explains the limit 335872 bytes in your initial mail.. Awkward one though. Wonder if that's an SoC issue or something hardkernel could fix by having a different bl1/bl2?

Quoted 6 lines

(719 - 63) * 512 = 335876 bytes. The limitation is needed not to overwrite tzsw.

Are you saying that the limitation can be removed? Yes, with different bl1/bl2. But I do not think that another bl1/bl2 will be released to relieve the limitation.

It was a something i was wondering. After send this e-mail i had a chat with Mauro Ribeiro on #linux-exynos. He indicate that the BL2 determines the u-boot load location and that it's an u-boot SPL build from their u-boot branch. Also he indicated that he would be happy to sign a modified SPL build which e.g. loads u-boot from behind the TZSW.

Quoted 6 lines

You can find the IRC log here:
http://irclog.whitequark.org/linux-exynos/2014-11-27

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

Best regards,
Lukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/c17ef85f/attachment.pgp>

#19 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 46 lines · Lukasz Majewski

Hi Sjoerd,

Quoted 30 lines · Hyungwon Hwang
Quoted 15 lines
Quoted 11 lines · On Thu, 27 Nov 2014 15:33:05 +0100 Sjoerd Simons…

signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
env_position=1231

for the various locations.. Which also explains the limit 335872 bytes in your initial mail.. Awkward one though. Wonder if that's an SoC issue or something hardkernel could fix by having a different bl1/bl2?

Quoted 6 lines

(719 - 63) * 512 = 335876 bytes. The limitation is needed not to overwrite tzsw.

Are you saying that the limitation can be removed? Yes, with different bl1/bl2. But I do not think that another bl1/bl2 will be released to relieve the limitation.

It was a something i was wondering. After send this e-mail i had a chat with Mauro Ribeiro on #linux-exynos. He indicate that the BL2 determines the u-boot load location and that it's an u-boot SPL build from their u-boot branch. Also he indicated that he would be happy to sign a modified SPL build which e.g. loads u-boot from behind the TZSW.

Quoted 6 lines

You can find the IRC log here:
http://irclog.whitequark.org/linux-exynos/2014-11-27

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

Quoted 5 lines

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

I don't see a big issue with telling the "normal" user[0] to replace both the BL2 and u-boot itself. If the hardkernel folks indeed do sign the BL2 for us, i'm more then happy to make that publically available.

0: Do normal users replace u-boot?

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/62ac9358/attachment.bin>
#20 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hi Sjoerd,

Quoted 51 lines · Lukasz Majewski
Quoted 49 lines

Hi Sjoerd,

Quoted 30 lines · Hyungwon Hwang
Quoted 15 lines
Quoted 11 lines · On Thu, 27 Nov 2014 15:33:05 +0100 Sjoerd Simons…

signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
env_position=1231

for the various locations.. Which also explains the limit 335872 bytes in your initial mail.. Awkward one though. Wonder if that's an SoC issue or something hardkernel could fix by having a different bl1/bl2?

Quoted 6 lines

(719 - 63) * 512 = 335876 bytes. The limitation is needed not to overwrite tzsw.

Are you saying that the limitation can be removed? Yes, with different bl1/bl2. But I do not think that another bl1/bl2 will be released to relieve the limitation.

It was a something i was wondering. After send this e-mail i had a chat with Mauro Ribeiro on #linux-exynos. He indicate that the BL2 determines the u-boot load location and that it's an u-boot SPL build from their u-boot branch. Also he indicated that he would be happy to sign a modified SPL build which e.g. loads u-boot from behind the TZSW.

Quoted 7 lines

You can find the IRC log here:
http://irclog.whitequark.org/linux-exynos/2014-11-27

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

Quoted 7 lines
Quoted 2 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

I don't see a big issue with telling the "normal" user[0] to replace both the BL2 and u-boot itself. If the hardkernel folks indeed do sign the BL2 for us, i'm more then happy to make that publically available.

I just would like to avoid having two incompatible BL2s floating around.

Does your use case require u-boot size larger than 328 KiB? Hyungwon has managed to provide functional one with size less than 328 KiB.

Another issue is the exact SPL source code from which you would like to build BL2 with modified layout.

Do you plan to use HardKernel's source code and only modify the layout or use SPL from cutting edge mainline?

Please note that even for tests BL2 must be signed by HardKernel to cooperate with Samsung's proprietary BL1.

Quoted 3 lines

0: Do normal users replace u-boot?

I know a few developers who did this because they needed new features missing in HardKernel's version (like UMS support).

Best regards,
Lukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/ae93ad2f/attachment.pgp>

#21 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 61 lines · Lukasz Majewski

Hi Sjoerd,

Quoted 51 lines · Lukasz Majewski
Quoted 49 lines

Hi Sjoerd,

Quoted 30 lines · Hyungwon Hwang
Quoted 15 lines
Quoted 11 lines · On Thu, 27 Nov 2014 15:33:05 +0100 Sjoerd Simons…

signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=719
env_position=1231

for the various locations.. Which also explains the limit 335872 bytes in your initial mail.. Awkward one though. Wonder if that's an SoC issue or something hardkernel could fix by having a different bl1/bl2?

Quoted 6 lines

(719 - 63) * 512 = 335876 bytes. The limitation is needed not to overwrite tzsw.

Are you saying that the limitation can be removed? Yes, with different bl1/bl2. But I do not think that another bl1/bl2 will be released to relieve the limitation.

It was a something i was wondering. After send this e-mail i had a chat with Mauro Ribeiro on #linux-exynos. He indicate that the BL2 determines the u-boot load location and that it's an u-boot SPL build from their u-boot branch. Also he indicated that he would be happy to sign a modified SPL build which e.g. loads u-boot from behind the TZSW.

Quoted 7 lines

You can find the IRC log here:
http://irclog.whitequark.org/linux-exynos/2014-11-27

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

Quoted 7 lines
Quoted 2 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

I don't see a big issue with telling the "normal" user[0] to replace both the BL2 and u-boot itself. If the hardkernel folks indeed do sign the BL2 for us, i'm more then happy to make that publically available.

Quoted 6 lines

I just would like to avoid having two incompatible BL2s floating around.

Does your use case require u-boot size larger than 328 KiB? Hyungwon has managed to provide functional one with size less than 328 KiB.

Even with that functionality it's incredibly on the edge, if build with gcc-4.7 it's too big. gcc-4.9 manages to make it *just* small enough. And that's without support for USB networking, which is pretty useful.

I've done some quick hacks locally to add USB/tftp boot support and re-use exynos5-dt-common.h/exynos5420-common.h, which already resulted in it growing to ~440kb.

Quoted 8 lines

Another issue is the exact SPL source code from which you would like to build BL2 with modified layout.

Do you plan to use HardKernel's source code and only modify the layout or use SPL from cutting edge mainline?

Please note that even for tests BL2 must be signed by HardKernel to cooperate with Samsung's proprietary BL1.

Yeah, I was planning to just use the SPL from Hardkernels source code and modify the layout so the behaviour SPL only differ in where they load u-boot from not in other behaviour.

Quoted 5 lines
Quoted 2 lines

0: Do normal users replace u-boot?

I know a few developers who did this because they needed new features missing in HardKernel's version (like UMS support).

That was a bit tongue in cheek. I'm currently chainloading my u-boot (which is too big to boot from SD) over tftp from hardkernels u-boot, so that i can tftp boot a kernel + initramfs with the new version.. As hardkernels u-boot seems to corrupt the initramfs (fun!)..

But apart from that anecdote, the main reason developers replace u-boot is that the vendors one is missing features. So ideally the default build of upstream u-boot should be feature-packed, which means the size gets bigger, which means this limitation in itself is quite annoying again.

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/ca07d1fe/attachment.bin>
#22 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

In reply to Lukasz Majewski

Hello Lukasz,

Quoted 7 lines · Lukasz Majewski
Quoted 3 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 7 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

Quoted 5 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available. Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

Quoted 3 lines

Best regards,
Lukasz Majewski

Best regards,
Javier

#23 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hello Javier,

Quoted 19 lines

Hello Lukasz,

Quoted 7 lines · Lukasz Majewski
Quoted 3 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 7 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

Quoted 8 lines

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

I agree that 328 KiB size for u-boot is a constraint. I don't know HardKernel's justification for this.

Quoted 8 lines
Quoted 6 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

For practical/pragmatic reasons:

1. It is difficult to have signed BL2 - each time we need to ask HardKernel for signing it. It is impractical and hampers usage of mainline SPL (BL2) with XU3.

2. All the documentation on the HardKernel wiki site refers to the default BL2.

3. We will have "new" BL2, which source code is based on 2012.07 mainline u-boot.

4. Two BL2 binaries - IMHO will hurt (i.e. brick) some device sooner or latter.

Quoted 3 lines

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available.

Sorry, but I'm a bit sceptical about updating such low level code. Bad things do happen.

Quoted 2 lines

Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

We would then require HardKernel to:

1. Provide updated BL2.img
2. Update their wiki to reflect the new BL2.

Quoted 6 lines

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

I totally agree.

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

2. If u-boot's size less than 328 KiB is _really_ a problem to somebody then ask hardkernel to change BL2 or:
- modify their sources to change the layout (I regard this as a "quick hack" solution)
- with a lot of pain develop BL2/SPL (by whom?) which base on newest mainline (then for each test hardkernel must sign the binary).

Quoted 7 lines
Quoted 4 lines

Best regards,
Lukasz Majewski

Best regards,
Javier

Best regards,
Lukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/d52a3fa0/attachment.pgp>

#24 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 4 lines · Lukasz Majewski

Hello Javier,

Quoted 2 lines

Hello Lukasz,

Quoted 8 lines
Quoted 2 lines

On Fri, Nov 28, 2014 at 9:39 AM, Lukasz Majewski
<[email protected]> wrote:

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

Oh, i never said this is a blocker for his patches. So yeah, ofcourse, lets polish these further so they can land :)

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/977ee9e9/attachment.bin>
#25 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 8 lines · On Fri, 28 Nov 2014 16:06:54 +0100 Sjoerd Simons…
Quoted 6 lines · Lukasz Majewski

Hello Javier,

Quoted 4 lines

Hello Lukasz,

On Fri, Nov 28, 2014 at 9:39 AM, Lukasz Majewski
<[email protected]> wrote:

Quoted 9 lines
Quoted 5 lines

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

Oh, i never said this is a blocker for his patches. So yeah, ofcourse, lets polish these further so they can land :)

+1 :-)

Quoted 3 lines

Best regards,
Lukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141129/82eb8f1e/attachment.pgp>

#26 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

In reply to Lukasz Majewski

Hi,

Quoted 87 lines · Lukasz Majewski

Hello Javier,

Quoted 19 lines

Hello Lukasz,

Quoted 7 lines · Lukasz Majewski
Quoted 3 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 7 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

Quoted 8 lines

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

I agree that 328 KiB size for u-boot is a constraint. I don't know HardKernel's justification for this.

Quoted 8 lines
Quoted 6 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

For practical/pragmatic reasons:

1. It is difficult to have signed BL2 - each time we need to ask HardKernel for signing it. It is impractical and hampers usage of mainline SPL (BL2) with XU3.

2. All the documentation on the HardKernel wiki site refers to the default BL2.

3. We will have "new" BL2, which source code is based on 2012.07 mainline u-boot.

4. Two BL2 binaries - IMHO will hurt (i.e. brick) some device sooner or latter.

Quoted 3 lines

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available.

Sorry, but I'm a bit sceptical about updating such low level code. Bad things do happen.

Quoted 2 lines

Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

We would then require HardKernel to:

1. Provide updated BL2.img
2. Update their wiki to reflect the new BL2.

Quoted 6 lines

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

I totally agree.

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

Quoted 7 lines

2. If u-boot's size less than 328 KiB is _really_ a problem to somebody then ask hardkernel to change BL2 or:
- modify their sources to change the layout (I regard this as a "quick hack" solution)
- with a lot of pain develop BL2/SPL (by whom?) which base on newest mainline (then for each test hardkernel must sign the binary).

My 2p worth...

The current Hardkernel BL1 looks broken to me - it is just too old. While it is shipped with the board if you get an eMMC, the main way people will get this is by downloading it from their site. So why not download something different?

Re the plan, I think 1 is fine so long as it is protected by a big ugly hack CONFIG and we can turn it off soon and revert the code.

For 2, the size issue is one problem, but the clock code in U-Boot is another IMO. We should try to get both resolved. Maybe it is possible to use the peach-pit BL2 and get hardkernel to test it and sign it? Then people will download that one instead.

is there a contact at hardkernel on the mailing list?

Regards,
Simon

#27 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hi Simon,

Quoted 105 lines

Hi,

Quoted 93 lines · Lukasz Majewski

Hello Javier,

Quoted 24 lines

Hello Lukasz,

Quoted 8 lines · Lukasz Majewski
Quoted 4 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 8 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

Quoted 6 lines

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

I agree that 328 KiB size for u-boot is a constraint. I don't know HardKernel's justification for this.

Quoted 9 lines
Quoted 7 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

For practical/pragmatic reasons:

1. It is difficult to have signed BL2 - each time we need to ask HardKernel for signing it. It is impractical and hampers usage of mainline SPL (BL2) with XU3.

2. All the documentation on the HardKernel wiki site refers to the default BL2.

3. We will have "new" BL2, which source code is based on 2012.07 mainline u-boot.

4. Two BL2 binaries - IMHO will hurt (i.e. brick) some device sooner or latter.

Quoted 4 lines

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available.

Sorry, but I'm a bit sceptical about updating such low level code. Bad things do happen.

Quoted 3 lines

Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

We would then require HardKernel to:

1. Provide updated BL2.img
2. Update their wiki to reflect the new BL2.

Quoted 6 lines

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

I totally agree.

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

Quoted 7 lines

2. If u-boot's size less than 328 KiB is _really_ a problem to somebody then ask hardkernel to change BL2 or:
- modify their sources to change the layout (I regard this
as a "quick hack" solution)
- with a lot of pain develop BL2/SPL (by whom?) which base
on newest mainline (then for each test hardkernel must sign the
binary).

Quoted 3 lines

My 2p worth...

The current Hardkernel BL1 looks broken to me - it is just too old.

+1

Quoted 3 lines

While it is shipped with the board if you get an eMMC, the main way people will get this is by downloading it from their site. So why not download something different?

As far as I remember U3 and probably XU3 in their README only points for HardKernel's site to grab BL1 and BL2. We don't plan to include their binaries to u-boot repository.

Quoted 3 lines

Re the plan, I think 1 is fine so long as it is protected by a big ugly hack CONFIG and we can turn it off soon and revert the code.

Hyungwon's patches only touch u-boot and rely (temporary I hope) on BL1 and BL2/SPL from Hardkernel.

Quoted 4 lines

For 2, the size issue is one problem, but the clock code in U-Boot is another IMO. We should try to get both resolved. Maybe it is possible to use the peach-pit BL2 and get hardkernel to test it and sign it?

I guess that SPL from peach-pit should be tunable to work with XU3 (in a finite number of iterations including signing from HardKernel).

As it is based on recent u-boot it should be easy to produce BL2/SPL only for XU3 (if needed).

Quoted 3 lines

Then people will download that one instead.

is there a contact at hardkernel on the mailing list?

As fair as I know no.

I was posting questions on their forum. Maybe it is a right place to ask for contact point?
As fair as I remember they were willing to sign SPL/BL2 when sent to them.

Quoted 3 lines

Regards,
Simon

Best regards,
Lukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141202/2af452fc/attachment.pgp>

#28 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hello Simon, Lukasz,

Quoted 141 lines · Lukasz Majewski

Hi Simon,

Quoted 105 lines

Hi,

Quoted 93 lines · Lukasz Majewski

Hello Javier,

Quoted 24 lines

Hello Lukasz,

Quoted 8 lines · Lukasz Majewski
Quoted 4 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 8 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

Quoted 6 lines

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

I agree that 328 KiB size for u-boot is a constraint. I don't know HardKernel's justification for this.

Quoted 9 lines
Quoted 7 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

For practical/pragmatic reasons:

1. It is difficult to have signed BL2 - each time we need to ask HardKernel for signing it. It is impractical and hampers usage of mainline SPL (BL2) with XU3.

2. All the documentation on the HardKernel wiki site refers to the default BL2.

3. We will have "new" BL2, which source code is based on 2012.07 mainline u-boot.

4. Two BL2 binaries - IMHO will hurt (i.e. brick) some device sooner or latter.

Quoted 4 lines

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available.

Sorry, but I'm a bit sceptical about updating such low level code. Bad things do happen.

Quoted 3 lines

Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

We would then require HardKernel to:

1. Provide updated BL2.img
2. Update their wiki to reflect the new BL2.

Quoted 6 lines

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

I totally agree.

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

Quoted 7 lines

2. If u-boot's size less than 328 KiB is _really_ a problem to somebody then ask hardkernel to change BL2 or:
- modify their sources to change the layout (I regard this
as a "quick hack" solution)
- with a lot of pain develop BL2/SPL (by whom?) which base
on newest mainline (then for each test hardkernel must sign the
binary).

Quoted 3 lines

My 2p worth...

The current Hardkernel BL1 looks broken to me - it is just too old.

+1

Quoted 3 lines

While it is shipped with the board if you get an eMMC, the main way people will get this is by downloading it from their site. So why not download something different?

As far as I remember U3 and probably XU3 in their README only points for HardKernel's site to grab BL1 and BL2. We don't plan to include their binaries to u-boot repository.

Quoted 3 lines

Re the plan, I think 1 is fine so long as it is protected by a big ugly hack CONFIG and we can turn it off soon and revert the code.

Hyungwon's patches only touch u-boot and rely (temporary I hope) on BL1 and BL2/SPL from Hardkernel.

Quoted 4 lines

For 2, the size issue is one problem, but the clock code in U-Boot is another IMO. We should try to get both resolved. Maybe it is possible to use the peach-pit BL2 and get hardkernel to test it and sign it?

I guess that SPL from peach-pit should be tunable to work with XU3 (in a finite number of iterations including signing from HardKernel).

As it is based on recent u-boot it should be easy to produce BL2/SPL only for XU3 (if needed).

Quoted 2 lines

Then people will download that one instead.

Quoted 9 lines
Quoted 1 line

is there a contact at hardkernel on the mailing list?

As fair as I know no.

I was posting questions on their forum. Maybe it is a right place to ask for contact point?
As fair as I remember they were willing to sign SPL/BL2 when sent to them.

I have gotten a BL2 signed (based of their repository) which allows a bigger U-Boot for testing, and it works. I have currently requested another signed BL2 which lets one use a 1MB U-Boot image which should be adequate. This is in the works.
I do not work for hardkernel but I do have a working relationship with them. From the looks of it they are more than willing to accomodate this BL2 change.
I can take this action point of getting this BL2 and its related paraphernalia hosted on their website once they are OK with its testing.

Regards
- Suriyan

Quoted 12 lines
Quoted 3 lines

Regards,
Simon

Best regards,
Lukasz Majewski

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#29 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

In reply to Lukasz Majewski

Lukasz Majewski <[email protected]> writes:

[...]

Quoted 103 lines
Quoted 103 lines
Quoted 100 lines · Lukasz Majewski

Hello Javier,

Quoted 24 lines

Hello Lukasz,

Quoted 8 lines · Lukasz Majewski
Quoted 4 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 8 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

Quoted 6 lines

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

I agree that 328 KiB size for u-boot is a constraint. I don't know HardKernel's justification for this.

Quoted 9 lines
Quoted 7 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

For practical/pragmatic reasons:

1. It is difficult to have signed BL2 - each time we need to ask HardKernel for signing it. It is impractical and hampers usage of mainline SPL (BL2) with XU3.

2. All the documentation on the HardKernel wiki site refers to the default BL2.

3. We will have "new" BL2, which source code is based on 2012.07 mainline u-boot.

4. Two BL2 binaries - IMHO will hurt (i.e. brick) some device sooner or latter.

Quoted 4 lines

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available.

Sorry, but I'm a bit sceptical about updating such low level code. Bad things do happen.

Quoted 3 lines

Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

We would then require HardKernel to:

1. Provide updated BL2.img
2. Update their wiki to reflect the new BL2.

Quoted 6 lines

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

I totally agree.

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

2. If u-boot's size less than 328 KiB is _really_ a problem to somebody then ask hardkernel to change BL2 or:
- modify their sources to change the layout (I regard this
as a "quick hack" solution)
- with a lot of pain develop BL2/SPL (by whom?) which base
on newest mainline (then for each test hardkernel must sign the
binary).

Quoted 6 lines
Quoted 3 lines

My 2p worth...

The current Hardkernel BL1 looks broken to me - it is just too old.

+1

FWIW, the XU3 firmware is broken in other ways as well which have a major impact on power management.

First, with mainline kernels using MCPM, only 6 of 8 CPUs come online. However, even with that fixed[1], it turns out that the kernel can't properly manage CCI due to secure firmware[2], which means that MCPM (multi-cluster power management) can't work, and thus the low-power cluster-idle states can't work, the big.LITTLE switcher cannot work, and the ongoing work on energy-aware scheduling will not be useful on this platform.

Anyone know what are the chances of getting a non-secure version of the firmware for this platform. The Samsung Chromebook2 with basically the same SoC (5800 compared to the 5422 on the XU3) ships with non-secure firmware so all of the above mentioned features are working just fine.

I'm working on getting these same features working on the XU3, but this broken firmware as brought a halt to any real progress.

Kevin

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/305790.html
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/306480.html

#30 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hi Kevin,

Quoted 125 lines · Kevin Hilman

Lukasz Majewski <[email protected]> writes:

[...]

Quoted 103 lines
Quoted 103 lines
Quoted 100 lines · Lukasz Majewski

Hello Javier,

Quoted 24 lines

Hello Lukasz,

Quoted 8 lines · Lukasz Majewski
Quoted 4 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 8 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

Quoted 6 lines

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

I agree that 328 KiB size for u-boot is a constraint. I don't know HardKernel's justification for this.

Quoted 9 lines
Quoted 7 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

For practical/pragmatic reasons:

1. It is difficult to have signed BL2 - each time we need to ask HardKernel for signing it. It is impractical and hampers usage of mainline SPL (BL2) with XU3.

2. All the documentation on the HardKernel wiki site refers to the default BL2.

3. We will have "new" BL2, which source code is based on 2012.07 mainline u-boot.

4. Two BL2 binaries - IMHO will hurt (i.e. brick) some device sooner or latter.

Quoted 4 lines

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available.

Sorry, but I'm a bit sceptical about updating such low level code. Bad things do happen.

Quoted 3 lines

Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

We would then require HardKernel to:

1. Provide updated BL2.img
2. Update their wiki to reflect the new BL2.

Quoted 6 lines

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

I totally agree.

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

2. If u-boot's size less than 328 KiB is _really_ a problem to somebody then ask hardkernel to change BL2 or:
- modify their sources to change the layout (I regard this
as a "quick hack" solution)
- with a lot of pain develop BL2/SPL (by whom?) which base
on newest mainline (then for each test hardkernel must sign the
binary).

Quoted 6 lines
Quoted 3 lines

My 2p worth...

The current Hardkernel BL1 looks broken to me - it is just too old.

+1

FWIW, the XU3 firmware is broken in other ways as well which have a major impact on power management.

First, with mainline kernels using MCPM, only 6 of 8 CPUs come online. However, even with that fixed[1], it turns out that the kernel can't properly manage CCI due to secure firmware[2], which means that MCPM (multi-cluster power management) can't work, and thus the low-power cluster-idle states can't work, the big.LITTLE switcher cannot work, and the ongoing work on energy-aware scheduling will not be useful on this platform.

Quoted 4 lines

Anyone know what are the chances of getting a non-secure version of the firmware for this platform. The Samsung Chromebook2 with basically the same SoC (5800 compared to the 5422 on the XU3) ships with non-secure firmware so all of the above mentioned features are working just fine.

I have pushed on this but apparently it is not possible - they need to sign every BL2. The only implementation I've seen sets up the chip in BL2 (U-Boot SPL) so I don't think we can work around it. It takes us back to the 1960s where we sent off our code at night to run it :-)

I think the best bet is the current effort to mainline the rest of the Chromebook code then try to build it for XU3.

Quoted 3 lines

I'm working on getting these same features working on the XU3, but this broken firmware as brought a halt to any real progress.

Agreed, but I think this is feasible once U-Boot on XU3 is sorted out.

Regards,
Simon

#31 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hi Simon,

Quoted 1 line · Simon Glass

On 8 December 2014 at 10:58, Kevin Hilman <[email protected]> wrote:

[...]

Quoted 11 lines
Quoted 11 lines

FWIW, the XU3 firmware is broken in other ways as well which have a major impact on power management.

First, with mainline kernels using MCPM, only 6 of 8 CPUs come online. However, even with that fixed[1], it turns out that the kernel can't properly manage CCI due to secure firmware[2], which means that MCPM (multi-cluster power management) can't work, and thus the low-power cluster-idle states can't work, the big.LITTLE switcher cannot work, and the ongoing work on energy-aware scheduling will not be useful on this platform.

Quoted 8 lines
Quoted 4 lines

Anyone know what are the chances of getting a non-secure version of the firmware for this platform. The Samsung Chromebook2 with basically the same SoC (5800 compared to the 5422 on the XU3) ships with non-secure firmware so all of the above mentioned features are working just fine.

I have pushed on this but apparently it is not possible - they need to sign every BL2. The only implementation I've seen sets up the chip in BL2 (U-Boot SPL) so I don't think we can work around it.

Not quite sure I'm following...

So is secure-mode enabled before BL2 is started? Or do you mean BL2 is where secure-mode is enabled? If it's done in BL2, and if the hardkernel folks are willing to sign BL2 images (which I gathered from discussions elsewhere in this series) then it seems possible to turn off secure-mode.

So I went to look in the u-boot-samsung repo and didn't see the code for the SPL there. Is the BL2 source (which I understood to be u-boot SPL) in some other repo?

Quoted 5 lines

It takes us back to the 1960s where we sent off our code at night to run it :-)

I think the best bet is the current effort to mainline the rest of the Chromebook code then try to build it for XU3.

What's the status of that effort?

Quoted 5 lines
Quoted 3 lines

I'm working on getting these same features working on the XU3, but this broken firmware as brought a halt to any real progress.

Agreed, but I think this is feasible once U-Boot on XU3 is sorted out.

Let's hope so.

Kevin

#32 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hi,

Quoted 29 lines · Kevin Hilman

Hi Simon,

Quoted 1 line · Simon Glass

On 8 December 2014 at 10:58, Kevin Hilman <[email protected]> wrote:

[...]

Quoted 11 lines
Quoted 11 lines

FWIW, the XU3 firmware is broken in other ways as well which have a major impact on power management.

First, with mainline kernels using MCPM, only 6 of 8 CPUs come online. However, even with that fixed[1], it turns out that the kernel can't properly manage CCI due to secure firmware[2], which means that MCPM (multi-cluster power management) can't work, and thus the low-power cluster-idle states can't work, the big.LITTLE switcher cannot work, and the ongoing work on energy-aware scheduling will not be useful on this platform.

Quoted 8 lines
Quoted 4 lines

Anyone know what are the chances of getting a non-secure version of the firmware for this platform. The Samsung Chromebook2 with basically the same SoC (5800 compared to the 5422 on the XU3) ships with non-secure firmware so all of the above mentioned features are working just fine.

I have pushed on this but apparently it is not possible - they need to sign every BL2. The only implementation I've seen sets up the chip in BL2 (U-Boot SPL) so I don't think we can work around it.

Quoted 7 lines

Not quite sure I'm following...

So is secure-mode enabled before BL2 is started? Or do you mean BL2 is where secure-mode is enabled? If it's done in BL2, and if the hardkernel folks are willing to sign BL2 images (which I gathered from discussions elsewhere in this series) then it seems possible to turn off secure-mode.

Yes it is possible - and easy - to do in BL2 / U-Boot SPL. This is what the Chromebooks do.

Quoted 5 lines

So I went to look in the u-boot-samsung repo and didn't see the code for the SPL there. Is the BL2 source (which I understood to be u-boot SPL) in some other repo?

It's in mainline U-Boot so no particular need to go to the Samsung tree. See arch/arm/cpu/armv7/exynos/spl_boot.c and tzpc.c for the TrustZone stuff.

Quoted 8 lines
Quoted 6 lines

It takes us back to the 1960s where we sent off our code at night to run it :-)

I think the best bet is the current effort to mainline the rest of the Chromebook code then try to build it for XU3.

What's the status of that effort?

Coming along but the big/little support is still not there. The display works and most core peripherals. Needs more SPL work.

Quoted 12 lines
Quoted 7 lines
Quoted 5 lines

I'm working on getting these same features working on the XU3, but this broken firmware as brought a halt to any real progress.

Agreed, but I think this is feasible once U-Boot on XU3 is sorted out.

Let's hope so.

Kevin

Regards,
Simon

#33 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Quoted 2 lines · Simon Glass
Quoted 1 line · Kevin Hilman

[...]

Quoted 8 lines
Quoted 5 lines

So is secure-mode enabled before BL2 is started? Or do you mean BL2 is where secure-mode is enabled? If it's done in BL2, and if the hardkernel folks are willing to sign BL2 images (which I gathered from discussions elsewhere in this series) then it seems possible to turn off secure-mode.

Yes it is possible - and easy - to do in BL2 / U-Boot SPL. This is what the Chromebooks do.

OK, good.

Quoted 8 lines
Quoted 4 lines

So I went to look in the u-boot-samsung repo and didn't see the code for the SPL there. Is the BL2 source (which I understood to be u-boot SPL) in some other repo?

It's in mainline U-Boot so no particular need to go to the Samsung tree.

I went to the samsung tree since the cover letter for this series pointed me there. But I just tried the latest version of this series (v11) using mainlin u-boot. Thanks for the pointer.

Quoted 2 lines

See arch/arm/cpu/armv7/exynos/spl_boot.c and tzpc.c for the TrustZone stuff.

OK, thanks. Any pointers on how to get this building with mainline u-boot? Just adding CONFIG_SPL to odroid_xu3.h doesn't seem to work (compile errors.) I'm quite comfortable in the kernel, but I'm not very familiar with u-boot, especially SPL.

Quoted 10 lines
Quoted 7 lines
Quoted 5 lines

It takes us back to the 1960s where we sent off our code at night to run it :-)

I think the best bet is the current effort to mainline the rest of the Chromebook code then try to build it for XU3.

What's the status of that effort?

Coming along but the big/little support is still not there. The display works and most core peripherals. Needs more SPL work.

OK, I'll be glad to be a beta tester if/when you get to that point.

Thanks,

Kevin

#34 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Hi Kevin,

Quoted 31 lines · Kevin Hilman
Quoted 2 lines · Simon Glass
Quoted 1 line · Kevin Hilman

[...]

Quoted 8 lines
Quoted 5 lines

So is secure-mode enabled before BL2 is started? Or do you mean BL2 is where secure-mode is enabled? If it's done in BL2, and if the hardkernel folks are willing to sign BL2 images (which I gathered from discussions elsewhere in this series) then it seems possible to turn off secure-mode.

Yes it is possible - and easy - to do in BL2 / U-Boot SPL. This is what the Chromebooks do.

OK, good.

Quoted 8 lines
Quoted 4 lines

So I went to look in the u-boot-samsung repo and didn't see the code for the SPL there. Is the BL2 source (which I understood to be u-boot SPL) in some other repo?

It's in mainline U-Boot so no particular need to go to the Samsung tree.

I went to the samsung tree since the cover letter for this series pointed me there. But I just tried the latest version of this series (v11) using mainlin u-boot. Thanks for the pointer.

Quoted 8 lines
Quoted 2 lines

See arch/arm/cpu/armv7/exynos/spl_boot.c and tzpc.c for the TrustZone stuff.

OK, thanks. Any pointers on how to get this building with mainline u-boot? Just adding CONFIG_SPL to odroid_xu3.h doesn't seem to work (compile errors.) I'm quite comfortable in the kernel, but I'm not very familiar with u-boot, especially SPL.

It's normally automatic unless some special disabling was done - see spl/u-boot-spl.bin in the output. You need to sign it though :-(

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

It takes us back to the 1960s where we sent off our code at night to run it :-)

I think the best bet is the current effort to mainline the rest of the Chromebook code then try to build it for XU3.

What's the status of that effort?

Quoted 9 lines
Quoted 2 lines

Coming along but the big/little support is still not there. The display works and most core peripherals. Needs more SPL work.

OK, I'll be glad to be a beta tester if/when you get to that point.

Thanks,

Kevin

Regards,
Simon

#35 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Simon Glass <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 5 lines

OK, thanks. Any pointers on how to get this building with mainline u-boot? Just adding CONFIG_SPL to odroid_xu3.h doesn't seem to work (compile errors.) I'm quite comfortable in the kernel, but I'm not very familiar with u-boot, especially SPL.

It's normally automatic unless some special disabling was done - see spl/u-boot-spl.bin in the output. You need to sign it though :-(

Right, I'm used to finding it there, but there's nothing there when buildling using odroid-xu3_config with $SUBJECT series.

Kevin

#36 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

Dear Kevin,

Quoted 10 lines · On Wed, 10 Dec 2014 11:20:43 -0800 Kevin Hilman <[email protected]> wrote:

Simon Glass <[email protected]> writes:

[...]

Quoted 6 lines
Quoted 5 lines

OK, thanks. Any pointers on how to get this building with mainline u-boot? Just adding CONFIG_SPL to odroid_xu3.h doesn't seem to work (compile errors.) I'm quite comfortable in the kernel, but I'm not very familiar with u-boot, especially SPL.

Quoted 5 lines
Quoted 2 lines

It's normally automatic unless some special disabling was done - see spl/u-boot-spl.bin in the output. You need to sign it though :-(

Right, I'm used to finding it there, but there's nothing there when buildling using odroid-xu3_config with $SUBJECT series.

CONFIG_SPL_BUILD must be turn on for that(You can find the detailesin doc/README.SPL). But neither common exynos config files nor odroid xu3 specific config file contain the config option. Before I turned on that option, but not work at the moment. Some work should be done by someone. I am sorry to say, but I cannot assure I can do that immediately.

Quoted 3 lines

Kevin

Best regards,
Hyungwon Hwang

#37 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

In reply to Kevin Hilman

Hi Kevin,

Quoted 117 lines

Lukasz Majewski <[email protected]> writes:

[...]

Quoted 103 lines
Quoted 103 lines
Quoted 100 lines · Lukasz Majewski

Hello Javier,

Quoted 24 lines

Hello Lukasz,

Quoted 8 lines · Lukasz Majewski
Quoted 4 lines

I have yet to take him up on that offer though, but it sounds like a good way forward. The current layout really isn't practical.

It indeed isn't very practical, but this is what you received from HardKernel when you buy XU3 board.

Quoted 8 lines

Of course you can grab their sources, modify the layout, prepare u-boot's SPL and send it to them to be signed. However, it is not the way the "normal" user do things.

He or she would like to replace standard (and outdated) HardKernel u-boot on their SD card and go forward with booting kernel.

I agree with Sjoed that normal users don't replace the low-level components that are provided by the board vendor.

Quoted 6 lines

After all you can boot a mainline kernel using the vendor u-boot, just append the DTB and create a uImage. The practical reason why someone would want to replace the vendor u-boot is to have more features but is very hard to do if there is a constraint in the maximum u-boot image size (even harder if the maximum is such small like in the XU3).

I agree that 328 KiB size for u-boot is a constraint. I don't know HardKernel's justification for this.

Quoted 9 lines
Quoted 7 lines

For now we _must_ focus on supporting XU3 with default BL1/BL2 and hence we are obliged to have u-boot size smaller than 328 KiB.

It is challenging but for sure doable.

It is doable but I don't see why the default BL2 _must_ be used.

For practical/pragmatic reasons:

1. It is difficult to have signed BL2 - each time we need to ask HardKernel for signing it. It is impractical and hampers usage of mainline SPL (BL2) with XU3.

2. All the documentation on the HardKernel wiki site refers to the default BL2.

3. We will have "new" BL2, which source code is based on 2012.07 mainline u-boot.

4. Two BL2 binaries - IMHO will hurt (i.e. brick) some device sooner or latter.

Quoted 4 lines

A user that wants to replace the kernel or u-boot is already tech-savy and can for sure replace the BL2 as well if it's publicly available.

Sorry, but I'm a bit sceptical about updating such low level code. Bad things do happen.

Quoted 3 lines

Maybe hardkernel folks can even make the modified BL2 available on their website and the link added in the comment explaining the layout?

We would then require HardKernel to:

1. Provide updated BL2.img
2. Update their wiki to reflect the new BL2.

Quoted 6 lines

Also, it is an artificial constraint after all and can be easily modified. In fact I think we should push hardkernel to change that layout by default and use a BL2/SPL that has more sensible size for the u-boot binary even if they don't need it for their vendor u-boot which seems to be quite small.

I totally agree.

I'd like to propose a following plan:

1. Accept Hyungwon's patches to have XU3 u-boot < 328 KiB (with link to default BL2) to have XU3 support in place (and treat it as a starting point)

2. If u-boot's size less than 328 KiB is _really_ a problem to somebody then ask hardkernel to change BL2 or:
- modify their sources to change the layout (I regard
this as a "quick hack" solution)
- with a lot of pain develop BL2/SPL (by whom?) which
base on newest mainline (then for each test hardkernel must sign the binary).

Quoted 6 lines
Quoted 3 lines

My 2p worth...

The current Hardkernel BL1 looks broken to me - it is just too old.

+1

FWIW, the XU3 firmware is broken in other ways as well which have a major impact on power management.

Quoted 7 lines

First, with mainline kernels using MCPM, only 6 of 8 CPUs come online. However, even with that fixed[1], it turns out that the kernel can't properly manage CCI due to secure firmware[2], which means that MCPM (multi-cluster power management) can't work, and thus the low-power cluster-idle states can't work, the big.LITTLE switcher cannot work, and the ongoing work on energy-aware scheduling will not be useful on this platform.

I've stumbled upon the "imprecise aborts" in Exynos5422. Moreover I've heard about problems with bringing up all 8 CPUs on that platform.

Quoted 6 lines

Anyone know what are the chances of getting a non-secure version of the firmware for this platform. The Samsung Chromebook2 with basically the same SoC (5800 compared to the 5422 on the XU3) ships with non-secure firmware so all of the above mentioned features are working just fine.

You can look into the HardKernle's u-boot from their github:
https://github.com/hardkernel/u-boot

then tune it and send to hardkernel to be signed.

I guess that the described above problem might be with TZSW software - the one from Chromebook2 might be different from the one from Hard Kernel.

Correct me if I'm wrong, but isn't power management governed by TZSW - by calling smc instruction with proper parameter?

Regarding Hard Kernel - their u-boot/u-boot-spl(SPL/BL2) is from 2012. It is quite old. Problem here is that to update (SPL/BL2) one needs to send this binary to Hard Kernel for signing.

However, in my opinion working BL1 and BL2 for XU3 should be delivered by Hard Kernel. Period.

Therefore, please ask them on support/forum why do we experience such problems with cluster/power management on mainline Linux .

Quoted 10 lines

I'm working on getting these same features working on the XU3, but this broken firmware as brought a halt to any real progress.

Kevin

[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/305790.html
[2]
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/306480.html

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#38 lore raw

PATCH v9 2/2 Odroid-XU3: Add documentation for Odroid-XU3

In reply to Hyungwon Hwang
Quoted 33 lines · Hyungwon Hwang

This patch adds documentation for Odroid-XU3. This documentation is based on that of Odroid (doc/README-odroid) made by Przemyslaw Marczak. The documentation includes basic information about boot media layout, environment, partition layout, and the instruction to burn the u-boot image to boot media.

---
Changes for v6:
- Newly added

Changes for v7:
- Fix several errata in the documentation

Changes for v8:
- None

Changes for v9:
- Add the new contents to the documentation of Odroid X2/U2, instead of making new document for Odorid XU3

 doc/README.odroid | 46 ++++++++++++++++++++++++++++++----------------
 1 file changed, 30 insertions(+), 16 deletions(-)
doc/README.odroid +0 -0
index 25b962b..99693d4 100644

doc/README.odroid line 6

Quoted 7 lines
doc/README.odroid +1 -2
@@ -1,28 +1,39 @@
- U-boot for Odroid X2/U3
+ U-boot for Odroid X2/U3/XU3
 ========================
 
 1. Summary
 ==========
-This is a quick instruction for setup Odroid boards based on Exynos4412.

s/Exynos4412/Exynos/ ?

Best Regards,
Jaehoon Chung

Quoted 111 lines
doc/README.odroid +29 -14
-Board config: odroid_config
+This is a quick instruction for setup Odroid boards.
+Board config: odroid_config for X2/U3
+Board config: odroid-xu3_config for XU3
 
 2. Supported devices
 ====================
-This U-BOOT config can be used on two boards:
+This U-BOOT config can be used on three boards:
 - Odroid U3
 - Odroid X2
 with CPU Exynos 4412 rev 2.0 and 2GB of RAM
+- Odroid XU3
+with CPU Exynos5422 and 2GB of RAM
 
 3. Boot sequence
 ================
 iROM->BL1->(BL2 + TrustZone)->U-BOOT
 
-This version of U-BOOT doesn't implement SPL but it is required(BL2)
-and can be found in "boot.tar.gz" from here:
+This version of U-BOOT doesn't implement SPL. So, BL1, BL2, and TrustZone
+binaries are needed to boot up.
+
+<< X2/U3 >>
+It can be found in "boot.tar.gz" from here:
 http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz
 or here:
 http://odroid.in/guides/ubuntu-lfs/boot.tar.gz
 
+<< XU3 >>
+It can be downloaded from:
+https://github.com/hardkernel/u-boot/tree/odroidxu3-v2012.07/sd_fuse/hardkernel
+
+
 4. Boot media layout
 ====================
 The table below shows SD/eMMC cards layout for U-boot.
@@ -35,18 +46,20 @@ The block offset is starting from 0 and the block size is 512B.
 | Bl2       | 31   | 30   |  1 (boot) |
 | U-boot    | 63   | 62   |  1 (boot) |
 | Tzsw      | 2111 | 2110 |  1 (boot) |
-| Uboot Env | 2500 | 2500 |  0 (user) |
+| Uboot Env | 2560 | 2560 |  0 (user) |
  -------------------------------------
 
 5. Prepare the SD boot card - with SD card reader
 =================================================
 To prepare bootable media you need boot binaries provided by hardkernel.
-File "boot.tar.gz" (link in point 3.) contains:
-- E4412_S.bl1.HardKernel.bin
-- E4412_S.tzsw.signed.bin
-- bl2.signed.bin
+From the downloaded files, You can find:
+- bl1.bin
+- tzsw.bin
+- bl2.bin
 - sd_fusing.sh
 - u-boot.bin
+(The file names can be slightly different, but you can distinguish what they are
+without problem)
 
 This is all you need to boot this board. But if you want to use your custom
 u-boot then you need to change u-boot.bin with your own u-boot binary*
@@ -56,7 +69,7 @@ and run the script "sd_fusing.sh" - this script is valid only for SD card.
 The proper binary file of current U-boot is u-boot-dtb.bin.
 
 quick steps for Linux:
-- extract boot.tar.gz
+- Download all files from the link at point 3 and extract it if needed.
 - put any SD card into the SD reader
 - check the device with "dmesg"
 - run ./sd_fusing.sh /dev/sdX - where X is SD card device (but not a partition)
@@ -66,7 +79,7 @@ Check if Hardkernel U-boot is booting, and next do the same with your U-boot.
    with a eMMC card reader (boot from eMMC card slot)
 =====================================================
 To boot the device from the eMMC slot you should use a special card reader
-which supports eMMC partiion switch. All of the boot binaries are stored
+which supports eMMC partition switch. All of the boot binaries are stored
 on the eMMC boot partition which is normally hidden.
 
 The "sd_fusing.sh" script can be used after updating offsets of binaries
@@ -81,8 +94,8 @@ But then the device can boot only from the SD card slot.
 
 8. Prepare the boot media using Hardkernel U-boot
 =================================================
-You can update the U-boot to the custom one if you have an working bootloader
-delivered with the board on a eMMC/SD card. Then follow the steps:
+You can update the U-boot to the custom one if you have a working bootloader
+delivered with the board on the eMMC/SD card. Then follow the steps:
 - install the android fastboot tool
 - connect a micro usb cable to the board
 - on the U-boot prompt, run command: fastboot (as a root)
@@ -91,7 +104,7 @@ delivered with the board on a eMMC/SD card. Then follow the steps:
 
 9. Partition layout
 ====================
-Default U-boot environment is setup for fixed partiion layout.
+Default U-boot environment is setup for fixed partition layout.
 
 Partition table: MSDOS. Disk layout and files as listed in the table below.
  ----- ------ ------ ------ -------- ---------------------------------
@@ -106,6 +119,7 @@ Partition table: MSDOS. Disk layout and files as listed in the table below.
 Supported fdt files are:
 - exynos4412-odroidx2.dtb
 - exynos4412-odroidu3.dtb
+- exynos5422-odroidxu3.dtb
 
 Supported kernel files are:
 - Image.itb
#39 lore raw

cover Odroid XU3 support additions

In reply to Hyungwon Hwang

Hey Hyungwon,

The following are some of the patches i had locally on top of your v9 Odroid. Feel free to merge them into your patchset (or squash them into your existing patches) if they look good to you.

Sjoerd Simons (4):
Odroid-XU3: Drop redundant fields
Odroid-XU3: Add entry for DTS EHCI GPIO
ODROID-XU3: Make odroid-xu3 an smdk5420 variant
ODROID-XU3: drop overriding the boot environment

 arch/arm/cpu/armv7/exynos/Kconfig     |   1 -
 arch/arm/dts/exynos5422-odroidxu3.dts |  16 ++---
 board/samsung/odroid-xu3/Kconfig      |  12 ----
 board/samsung/odroid-xu3/MAINTAINERS  |   6 --
 board/samsung/odroid-xu3/Makefile     |   7 --
 board/samsung/odroid-xu3/odroid-xu3.c | 122 ----------------------------------
 board/samsung/odroid-xu3/setup.h      |  95 --------------------------
 board/samsung/smdk5420/Kconfig        |  13 ++++
 include/configs/odroid_xu3.h          |  72 --------------------
 9 files changed, 17 insertions(+), 327 deletions(-)
 delete mode 100644 board/samsung/odroid-xu3/Kconfig
 delete mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 delete mode 100644 board/samsung/odroid-xu3/Makefile
 delete mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 delete mode 100644 board/samsung/odroid-xu3/setup.h
Signature · 1 line
2.1.3
#40 lore raw

PATCH 1/4 Odroid-XU3: Drop redundant fields

Drop MMC related fields from the DTS that are already setup by exynos54xx.dtsi and correct the value of fifoth_val

---
 arch/arm/dts/exynos5422-odroidxu3.dts | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
arch/arm/dts/exynos5422-odroidxu3.dts +2 -13
index 533d88e..bd88450 100644
@@ -36,22 +36,11 @@
 	};
 
 	mmc at 12200000 {
-		samsung,bus-width = <8>;
-		samsung,timing = <1 3 3>;
-		fifoth_val = <0x200f0020>;
-	};
-
-	mmc at 12210000 {
-		status = "disabled";
+		fifoth_val = <0x201f0020>;
 	};
 
 	mmc at 12220000 {
-		samsung,bus-width = <4>;
-		samsung,timing = <1 2 3>;
-		fifoth_val = <0x200f0020>;
+		fifoth_val = <0x201f0020>;
 	};
 
-	mmc at 12230000 {
-		status = "disabled";
-	};
 };
Signature · 1 line
2.1.3
#41 lore raw

PATCH 2/4 Odroid-XU3: Add entry for DTS EHCI GPIO

In reply to Sjoerd Simons

Add samsung,vbus-gpio information for the XU3. This allows the usage of the EHCI controller on the XU3, which is connected to the SMSC LAN9514 chip (usb hub + network).

Note that this patch doesn't enable support for USB/USB networking in the default config as makes the u-boot binary too big for the current odroid setup.

---
 arch/arm/dts/exynos5422-odroidxu3.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/dts/exynos5422-odroidxu3.dts +3 -0
index bd88450..1cbb835 100644
@@ -43,4 +43,7 @@
 		fifoth_val = <0x201f0020>;
 	};
 
+	ehci at 12110000 {
+		samsung,vbus-gpio = <&gpio 0x316 0>; /* X26 */
+	};
 };
Signature · 1 line
2.1.3
#42 lore raw

PATCH 3/4 ODROID-XU3: Make odroid-xu3 an smdk5420 variant

In reply to Sjoerd Simons

The odroid-xu3 board file sets up clocks that should have are setup by the SPL/BL2, so that code should be redundant. Drop it and make the XU3 an smdk5420 variant like e.g. Peach pit/pi, that way the only differences in the boards u-boot binary are purely due to configuration changes, not code differences.

---
 arch/arm/cpu/armv7/exynos/Kconfig     |   1 -
 board/samsung/odroid-xu3/Kconfig      |  12 ----
 board/samsung/odroid-xu3/MAINTAINERS  |   6 --
 board/samsung/odroid-xu3/Makefile     |   7 --
 board/samsung/odroid-xu3/odroid-xu3.c | 122 ----------------------------------
 board/samsung/odroid-xu3/setup.h      |  95 --------------------------
 board/samsung/smdk5420/Kconfig        |  13 ++++
 7 files changed, 13 insertions(+), 243 deletions(-)
 delete mode 100644 board/samsung/odroid-xu3/Kconfig
 delete mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 delete mode 100644 board/samsung/odroid-xu3/Makefile
 delete mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 delete mode 100644 board/samsung/odroid-xu3/setup.h
arch/arm/cpu/armv7/exynos/Kconfig +0 -1
index 16c9a0e..88017c7 100644
@@ -69,7 +69,6 @@ source "board/samsung/universal_c210/Kconfig"
 source "board/samsung/origen/Kconfig"
 source "board/samsung/trats2/Kconfig"
 source "board/samsung/odroid/Kconfig"
-source "board/samsung/odroid-xu3/Kconfig"
 source "board/samsung/arndale/Kconfig"
 source "board/samsung/smdk5250/Kconfig"
 source "board/samsung/smdk5420/Kconfig"
board/samsung/odroid-xu3/Kconfig deleted +0 -12
deleted file mode 100644
index 6159692..0000000
@@ -1,12 +0,0 @@
-if TARGET_ODROID_XU3
-
-config SYS_BOARD
-	default "odroid-xu3"
-
-config SYS_VENDOR
-	default "samsung"
-
-config SYS_CONFIG_NAME
-	default "odroid_xu3"
-
-endif
board/samsung/odroid-xu3/MAINTAINERS deleted +0 -6
deleted file mode 100644
index 50cf928..0000000
@@ -1,6 +0,0 @@
-ODROID-XU3 BOARD
-M:	Hyungwon Hwang <[email protected]>
-S:	Maintained
-F:	board/samsung/odroid-xu3/
-F:	include/configs/odroid_xu3.h
-F:	configs/odroid-xu3_defconfig
board/samsung/odroid-xu3/Makefile deleted +0 -7
deleted file mode 100644
index 85ae5c5..0000000
@@ -1,7 +0,0 @@
-#
-# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y	:= odroid-xu3.o
board/samsung/odroid-xu3/odroid-xu3.c deleted +0 -122

122 lines not on this page · raw message

board/samsung/odroid-xu3/setup.h deleted +0 -95

95 lines not on this page · raw message

board/samsung/smdk5420/Kconfig +13 -0
index e7aafe5..ff28b1d 100644
@@ -1,3 +1,16 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+	default "smdk5420"
+
+config SYS_VENDOR
+	default "samsung"
+
+config SYS_CONFIG_NAME
+	default "odroid_xu3"
+
+endif
+
 if TARGET_PEACH_PI
 
 config SYS_BOARD
Signature · 1 line
2.1.3
#43 lore raw

PATCH 4/4 ODROID-XU3: drop overriding the boot environment

In reply to Sjoerd Simons

Remove the override of the boot environment, this causes the board to use the distro_bootcmd setup for booting as included by exynos5-common.h.

---
 include/configs/odroid_xu3.h | 72 --------------------------------------------
 1 file changed, 72 deletions(-)
include/configs/odroid_xu3.h +0 -72
index 1d53653..a60d4e5 100644
@@ -45,80 +45,8 @@
 
 #define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - 0x1000000)
 
-#define CONFIG_BOOTCOMMAND		"run autoboot"
 #define CONFIG_DEFAULT_CONSOLE		"console=ttySAC2,115200n8\0"
 
-/*
- * For details, refer the documentation: doc/README.odroid
-*/
-#ifdef CONFIG_EXTRA_ENV_SETTINGS
-#undef CONFIG_EXTRA_ENV_SETTINGS
-#endif
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"loadkernel=fatload mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
-		"${kernelname}\0" \
-	"loadinitrd=fatload mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
-		"${initrdname}\0" \
-	"loaddtb=fatload mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \
-		"${fdtfile}\0" \
-	"check_ramdisk=" \
-		"if run loadinitrd; then " \
-			"setenv initrd_addr ${initrdaddr};" \
-		"else " \
-			"setenv initrd_addr -;" \
-		"fi;\0" \
-	"check_dtb=" \
-		"if run loaddtb; then " \
-			"setenv fdt_addr ${fdtaddr};" \
-		"else " \
-			"setenv fdt_addr;" \
-		"fi;\0" \
-	"kernel_args=" \
-		"setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
-		" rootwait ${console} ${opts}\0" \
-	"boot_fit=" \
-		"setenv kerneladdr 0x42000000;" \
-		"setenv kernelname Image.itb;" \
-		"run loadkernel;" \
-		"run kernel_args;" \
-		"bootm ${kerneladdr}#${boardname}\0" \
-	"boot_uimg=" \
-		"setenv kerneladdr 0x40007FC0;" \
-		"setenv kernelname uImage;" \
-		"run check_dtb;" \
-		"run check_ramdisk;" \
-		"run loadkernel;" \
-		"run kernel_args;" \
-		"bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
-	"boot_zimg=" \
-		"setenv kerneladdr 0x40007FC0;" \
-		"setenv kernelname zImage;" \
-		"run check_dtb;" \
-		"run check_ramdisk;" \
-		"run loadkernel;" \
-		"run kernel_args;" \
-		"bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
-	"autoboot=" \
-		"if test -e mmc 0 Image.itb; then; " \
-			"run boot_fit;" \
-		"elif test -e mmc 0 zImage; then; " \
-			"run boot_zimg;" \
-		"elif test -e mmc 0 uImage; then; " \
-			"run boot_uimg;" \
-		"fi;\0" \
-	"console=" CONFIG_DEFAULT_CONSOLE \
-	"mmcbootdev=0\0" \
-	"mmcbootpart=1\0" \
-	"mmcrootdev=0\0" \
-	"mmcrootpart=2\0" \
-	"bootdelay=0\0" \
-	"dfu_alt_info=Please reset the board\0" \
-	"consoleon=set console console=ttySAC2,115200n8; save; reset\0" \
-	"consoleoff=set console console=ram; save; reset\0" \
-	"initrdname=uInitrd\0" \
-	"initrdaddr=42000000\0" \
-	"fdtaddr=40800000\0"
-
 /* FIXME: MUST BE REMOVED AFTER TMU IS TURNED ON */
 #undef CONFIG_EXYNOS_TMU
 #undef CONFIG_TMU_CMD_DTT
Signature · 1 line
2.1.3
#44 lore raw

cover Odroid XU3 support additions

In reply to Sjoerd Simons

Dear Sjoerd,

Thanks for this work. I think it is better to squash patch #1, #3, #4 into my patchs, because these patches remove the code which needlessly being added by my patches. I will include patch #2 also from next version.

Quoted 18 lines · On Mon, 01 Dec 2014 13:34:16 +0100 Sjoerd Simons…

Hey Hyungwon,

The following are some of the patches i had locally on top of your v9 Odroid. Feel free to merge them into your patchset (or squash them into your existing patches) if they look good to you.

Sjoerd Simons (4):
Odroid-XU3: Drop redundant fields
Odroid-XU3: Add entry for DTS EHCI GPIO
ODROID-XU3: Make odroid-xu3 an smdk5420 variant
ODROID-XU3: drop overriding the boot environment

 arch/arm/cpu/armv7/exynos/Kconfig     |   1 -
 arch/arm/dts/exynos5422-odroidxu3.dts |  16 ++---
 board/samsung/odroid-xu3/Kconfig      |  12 ----
 board/samsung/odroid-xu3/MAINTAINERS  |   6 --
 board/samsung/odroid-xu3/Makefile     |   7 --
 board/samsung/odroid-xu3/odroid-xu3.c | 122
Quoted 11 lines

----------------------------------
board/samsung/odroid-xu3/setup.h | 95
-------------------------- board/samsung/smdk5420/Kconfig |
13 ++++ include/configs/odroid_xu3.h | 72
-------------------- 9 files changed, 17 insertions(+), 327 deletions(-) delete mode 100644 board/samsung/odroid-xu3/Kconfig delete mode 100644 board/samsung/odroid-xu3/MAINTAINERS delete mode 100644 board/samsung/odroid-xu3/Makefile delete mode 100644 board/samsung/odroid-xu3/odroid-xu3.c delete mode 100644 board/samsung/odroid-xu3/setup.h

Best regards,
Hyungwon Hwang

#45 lore raw

cover Odroid XU3 support additions

Hi,

Quoted 20 lines · Hyungwon Hwang

Dear Sjoerd,

Thanks for this work. I think it is better to squash patch #1, #3, #4 into my patchs, because these patches remove the code which needlessly being added by my patches. I will include patch #2 also from next version.

Quoted 10 lines · On Mon, 01 Dec 2014 13:34:16 +0100 Sjoerd Simons…

Hey Hyungwon,

The following are some of the patches i had locally on top of your v9 Odroid. Feel free to merge them into your patchset (or squash them into your existing patches) if they look good to you.

Sjoerd Simons (4):
Odroid-XU3: Drop redundant fields
Odroid-XU3: Add entry for DTS EHCI GPIO
ODROID-XU3: Make odroid-xu3 an smdk5420 variant

I need to support odroid xu3 specific gpio setting e.g. to reset emmc for reset command support. Also there are specific gpio setting codes for only smdk5420 board on board/samsung/smdk5420/smdk5420.c and they are not related with odroid xu3 board.

So, i think that need to split them.

First, split board file. It's easiest way to make separate board directory.

Second, we can make just board file for odroid xu3 in same directory and we should distinguish them from Makefile but i don't know this is general way.

Third, using same board file like now but we will need any way to distinguish boards on runtime.

Any ideas?

Thanks.

Quoted 27 lines
Quoted 8 lines

ODROID-XU3: drop overriding the boot environment

 arch/arm/cpu/armv7/exynos/Kconfig     |   1 -
 arch/arm/dts/exynos5422-odroidxu3.dts |  16 ++---
 board/samsung/odroid-xu3/Kconfig      |  12 ----
 board/samsung/odroid-xu3/MAINTAINERS  |   6 --
 board/samsung/odroid-xu3/Makefile     |   7 --
 board/samsung/odroid-xu3/odroid-xu3.c | 122
Quoted 11 lines

----------------------------------
board/samsung/odroid-xu3/setup.h | 95
-------------------------- board/samsung/smdk5420/Kconfig |
13 ++++ include/configs/odroid_xu3.h | 72
-------------------- 9 files changed, 17 insertions(+), 327 deletions(-) delete mode 100644 board/samsung/odroid-xu3/Kconfig delete mode 100644 board/samsung/odroid-xu3/MAINTAINERS delete mode 100644 board/samsung/odroid-xu3/Makefile delete mode 100644 board/samsung/odroid-xu3/odroid-xu3.c delete mode 100644 board/samsung/odroid-xu3/setup.h

Best regards,
Hyungwon Hwang
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#46 lore raw

cover Odroid XU3 support additions

Quoted 24 lines · Joonyoung Shim

Hi,

Quoted 20 lines · Hyungwon Hwang

Dear Sjoerd,

Thanks for this work. I think it is better to squash patch #1, #3, #4 into my patchs, because these patches remove the code which needlessly being added by my patches. I will include patch #2 also from next version.

Quoted 10 lines · On Mon, 01 Dec 2014 13:34:16 +0100 Sjoerd Simons…

Hey Hyungwon,

The following are some of the patches i had locally on top of your v9 Odroid. Feel free to merge them into your patchset (or squash them into your existing patches) if they look good to you.

Sjoerd Simons (4):
Odroid-XU3: Drop redundant fields
Odroid-XU3: Add entry for DTS EHCI GPIO
ODROID-XU3: Make odroid-xu3 an smdk5420 variant

Quoted 6 lines

I need to support odroid xu3 specific gpio setting e.g. to reset emmc for reset command support. Also there are specific gpio setting codes for only smdk5420 board on board/samsung/smdk5420/smdk5420.c and they are not related with odroid xu3 board.

So i think that need to split them.

For the gpio specific to the smdk5420 are you referring to the usb vbus gpio ? (For which i've dropped the code in a later, merged commit as it's handled by common code).

Quoted 9 lines

First, split board file. It's easiest way to make separate board directory.

Second, we can make just board file for odroid xu3 in same directory and we should distinguish them from Makefile but i don't know this is general way.

Third, using same board file like now but we will need any way to distinguish boards on runtime.

To distinguish boards at runtime you should use the information from the DT file of the board rather then hardcoding it in a board file.

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150107/94042ec9/attachment.bin>
#47 lore raw

cover Odroid XU3 support additions

Hi Sjoerd,

Quoted 30 lines · Sjoerd Simons
Quoted 29 lines · Joonyoung Shim

Hi,

Quoted 20 lines · Hyungwon Hwang

Dear Sjoerd,

Thanks for this work. I think it is better to squash patch #1, #3, #4 into my patchs, because these patches remove the code which needlessly being added by my patches. I will include patch #2 also from next version.

Quoted 10 lines · On Mon, 01 Dec 2014 13:34:16 +0100 Sjoerd Simons…

Hey Hyungwon,

The following are some of the patches i had locally on top of your v9 Odroid. Feel free to merge them into your patchset (or squash them into your existing patches) if they look good to you.

Sjoerd Simons (4):
Odroid-XU3: Drop redundant fields
Odroid-XU3: Add entry for DTS EHCI GPIO
ODROID-XU3: Make odroid-xu3 an smdk5420 variant

I need to support odroid xu3 specific gpio setting e.g. to reset emmc for reset command support. Also there are specific gpio setting codes for only smdk5420 board on board/samsung/smdk5420/smdk5420.c and they are not related with odroid xu3 board.

Quoted 5 lines
Quoted 1 line

So i think that need to split them.

For the gpio specific to the smdk5420 are you referring to the usb vbus gpio ? (For which i've dropped the code in a later, merged commit as it's handled by common code).

I just mean current remaining - lcd and pwm codes, but maybe can move them to device tree.

Quoted 8 lines
Quoted 8 lines

First, split board file. It's easiest way to make separate board directory.

Second, we can make just board file for odroid xu3 in same directory and we should distinguish them from Makefile but i don't know this is general way.

Quoted 6 lines
Quoted 2 lines

Third, using same board file like now but we will need any way to distinguish boards on runtime.

To distinguish boards at runtime you should use the information from the DT file of the board rather then hardcoding it in a board file.

OK, let's try to use device tree.

Thanks for guide.