Skip to contentSkip to conversation

ARMV7: Add support for TRATS board

PATCH New HeungJun 2 participants 4 messages Jan 5, 2012 Arm/actions semi architecture

lore
Share & tools
lore

HeungJun

#0 lore raw

PATCH 1/1 ARMV7: Add support for TRATS board

This patch adds support for Samsung TRATS board

---
 MAINTAINERS                         |    4 +
 board/samsung/trats/Makefile        |   44 ++++
 board/samsung/trats/lowlevel_init.S |  284 +++++++++++++++++++++
 board/samsung/trats/trats.c         |  246 +++++++++++++++++++
 board/samsung/trats/trats_setup.h   |  460 +++++++++++++++++++++++++++++++++++
 boards.cfg                          |    1 +
 include/configs/trats.h             |  222 +++++++++++++++++
 7 files changed, 1261 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/trats/Makefile
 create mode 100644 board/samsung/trats/lowlevel_init.S
 create mode 100644 board/samsung/trats/trats.c
 create mode 100644 board/samsung/trats/trats_setup.h
 create mode 100644 include/configs/trats.h
MAINTAINERS +4 -0
index a56ca10..c856c59 100644
@@ -700,6 +700,10 @@ Minkyu Kang <[email protected]>
 	s5p_goni		ARM ARMV7 (S5PC110 SoC)
 	s5pc210_universal	ARM ARMV7 (EXYNOS4210 SoC)
 
+Heungjun Kim <[email protected]>
+
+	trats			ARM ARMV7 (EXYNOS4210 SoC)
+
 Chander Kashyap <[email protected]>
 
 	origen			ARM ARMV7 (EXYNOS4210 SoC)
board/samsung/trats/Makefile new file +44 -0

44 lines not on this page · raw message

board/samsung/trats/lowlevel_init.S new file +284 -0

284 lines not on this page · raw message

board/samsung/trats/trats.c new file +246 -0

246 lines not on this page · raw message

board/samsung/trats/trats_setup.h new file +460 -0

460 lines not on this page · raw message

boards.cfg +1 -0
index 1e5b3e0..53ebb77 100644
@@ -218,6 +218,7 @@ smdkc100                     arm         armv7       smdkc100            samsung
 origen			     arm	 armv7	     origen		 samsung	exynos
 s5pc210_universal            arm         armv7       universal_c210      samsung        exynos
 smdkv310		     arm	 armv7	     smdkv310		 samsung	exynos
+trats                        arm         armv7       trats               samsung        exynos
 harmony                      arm         armv7       harmony             nvidia         tegra2
 seaboard                     arm         armv7       seaboard            nvidia         tegra2
 ventana                      arm         armv7       ventana             nvidia         tegra2
include/configs/trats.h new file +222 -0

222 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 ARMV7: Add support for TRATS board

Dear "HeungJun, Kim",

Quoted 4 lines · In message <[email protected]> you…

This patch adds support for Samsung TRATS board

...

MAINTAINERS Minkyu Kang <[email protected]> · line 707

Quoted 13 lines
MAINTAINERS +4 -0
index a56ca10..c856c59 100644
@@ -700,6 +700,10 @@ Minkyu Kang <[email protected]>
 	s5p_goni		ARM ARMV7 (S5PC110 SoC)
 	s5pc210_universal	ARM ARMV7 (EXYNOS4210 SoC)
 
+Heungjun Kim <[email protected]>
+
+	trats			ARM ARMV7 (EXYNOS4210 SoC)
+
 Chander Kashyap <[email protected]>

Please keep list sorted ("Ki..." goes after "Ka...").

MAINTAINERS line 10

Quoted 12 lines
MAINTAINERS +11 -0
+++ b/board/samsung/trats/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2010 Samsung Electronics
+# Heungjun Kim <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.

Please see http://www.denx.de/wiki/view/U-Boot/Patches#Notes

We need GPLv2+ for all new files. Please fix globally.

Quoted 2 lines
MAINTAINERS +2 -0
+ */
+uart_asm_init:

...

Quoted 1 line

+system_clock_init:

...

Quoted 1 line

+system_power_init:

...

What are the compelling reasons to write thes functionms in assembler, and not in C?

Quoted 6 lines
MAINTAINERS +6 -0
+int board_init(void)
+{
+	gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
+	gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
+
+	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;

MAINTAINERS

Quoted 10 lines
MAINTAINERS +10 -0
+
+	check_hw_revision();
+	printf("HW Revision:\t0x%x\n", board_rev);
+
+#if defined(CONFIG_PMIC)
+	pmic_init();
+#endif
+
+	return 0;
+}

Does this code build free wof warnings? I would expect to see warnings here because of unused variables gpio1 and gpio2?

...

MAINTAINERS

Quoted 8 lines
MAINTAINERS +8 -0
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ */
+#define CONFIG_SAMSUNG		1	/* in a SAMSUNG core */
+#define CONFIG_S5P		1	/* which is in a S5P Family */
+#define CONFIG_EXYNOS4210	1	/* which is in a EXYNOS4210 */
+#define CONFIG_TRATS		1	/* working with TRATS */

Please do not define values for variables that select features only. Please fix globally.

Quoted 40 lines
MAINTAINERS +40 -0
+#include <asm/arch/cpu.h>		/* get chip and board defs */
+
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Keep L2 Cache Disabled */
+#define CONFIG_SYS_L2CACHE_OFF		1
+
+#define CONFIG_SYS_SDRAM_BASE		0x40000000
+#define CONFIG_SYS_TEXT_BASE		0x44800000
+
+/* input clock of PLL: TRATS has 24MHz input clock at EXYNOS4210 */
+#define CONFIG_SYS_CLK_FREQ_C210	24000000
+
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
+#define CONFIG_CMDLINE_EDITING
+
+/* MACH_TYPE_TRATS macro will be removed once added to mach-types */
+#define MACH_TYPE_TRATS			3928
+#define CONFIG_MACH_TYPE		MACH_TYPE_TRATS
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (1 << 20))
+
+/* select serial console configuration */
+#define CONFIG_SERIAL_MULTI	1
+#define CONFIG_SERIAL2		1	/* use SERIAL 2 */
+#define CONFIG_BAUDRATE		115200
+
+/* MMC */
+#define CONFIG_GENERIC_MMC	1
+#define CONFIG_MMC		1
+#define CONFIG_S5P_MMC		1
+
+/* PWM */
+#define CONFIG_PWM			1

...

Quoted 5 lines
MAINTAINERS +5 -0
+#define MBRPARTS_DEFAULT	"20M(permanent)"\
+				",20M(boot)"\
+				",1G(system)"\
+				",100M(swap)"\
+				",-(UMS)\0"

...

MAINTAINERS

Quoted 1 line
MAINTAINERS +1 -0
+	"mbrparts=" MBRPARTS_DEFAULT \

MBR ??? Is this a typo and you actually mean MTD ?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Es ist nicht genug zu wissen, man mu? auch anwenden; es ist nicht ge-
nug zu wollen, man mu? auch tun.   -- Goethe, Maximen und Reflexionen
#2 lore raw

PATCH 1/1 ARMV7: Add support for TRATS board

Hi Wolfgang Denk,

Thanks for the comments.

I'm preparing the modified version as you pointed out. But I have one curious thing among your comments.

Quoted 8 lines · Wolfgang Denk

Dear "HeungJun, Kim",

Quoted 4 lines · In message<[email protected]> you…

This patch adds support for Samsung TRATS board

...

....

Quoted 10 lines
Quoted 2 lines

+ */
+uart_asm_init:

...

Quoted 1 line

+system_clock_init:

...

Quoted 1 line

+system_power_init:

...

What are the compelling reasons to write thes functionms in assembler, and not in C?

No. There is not specific reason. It's just to fit the convention with lowlevel_init.S file of any other previous boards based on Exynos4 SoC. And it's true it's easy to check the changes between these boards. So, I thought there's not a big problem whether this is changed to be C or not.

I'm just curious the pros of using C rather than asm in this case. Could you explain it?

Thank you.

Regards,
Heungjun Kim

Quoted 5 lines

Best regards,

Wolfgang Denk

#3 lore raw

PATCH 1/1 ARMV7: Add support for TRATS board

Dear "Kim, Heungjun",

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines

What are the compelling reasons to write thes functionms in assembler, and not in C?

No. There is not specific reason. It's just to fit the convention with

Then please implement in C.

Quoted 1 line

lowlevel_init.S file of any other previous boards based on Exynos4 SoC.

It has always been a bad idea to follow bad examples ;-)

Quoted 2 lines

I'm just curious the pros of using C rather than asm in this case. Could you explain it?

Readability? Easier maintenance?

U-Boot is written in C. We use assembler only where it cannot be avoided or where there are significant anvantages over implementation in C. Here it seems there is no good reason for using assembler code.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
panic: can't find /