Re: [U-Boot] [PATCH 2/2] support blackfin board initialization in generic board_f

2014-07-30 Thread Sonic Zhang
Hi Tom,

On Tue, Jul 29, 2014 at 8:33 PM, Tom Rini tr...@ti.com wrote:
 On Thu, Jul 24, 2014 at 10:47:02AM +0800, Sonic Zhang wrote:
 From: Sonic Zhang sonic.zh...@analog.com

 - init hardware watchdog if applicable
 - use CONFIG_SYS_MONITOR_LEN as the gd monitor len for Blackfin
 - reserve u-boot memory at the top field of the RAM for Blackfin
 - avoid refer to CONFIG_SYS_MONITOR_LEN, which is not defined by Blackfin

 Signed-off-by: Sonic Zhang sonic.zh...@analog.com
 ---

  common/board_f.c | 19 ++-
  1 file changed, 18 insertions(+), 1 deletion(-)

 diff --git a/common/board_f.c b/common/board_f.c
 index bdab38e..079e1fa 100644
 --- a/common/board_f.c
 +++ b/common/board_f.c
 @@ -107,6 +107,9 @@ __weak void blue_led_off(void) {}
  #if defined(CONFIG_WATCHDOG)
  static int init_func_watchdog_init(void)
  {
 +#ifdef CONFIG_HW_WATCHDOG
 + hw_watchdog_init();
 +#endif
   puts(   Watchdog enabled\n);
   WATCHDOG_RESET();


 So today we're inconsistent about hw_watchdog_init.  For ARM this is
 done at the board level, for blackfin/m68k as you've noted it's done in
 board_init_f, which makes sense I believe.  But we need to get folks to
 test the conversion over, so for now make this CONFIG_HW_WATCHDOG 
 (BLACKFIN || M68K || MICROBLAZE || SH) and we'll get everyone converted
 when we can.

OK. I will add these dependency to the patch.


 @@ -144,7 +147,11 @@ static int display_text_info(void)
   bss_end = (ulong)__bss_end;

   debug(U-Boot code: %08X - %08lX  BSS: - %08lX\n,
 +#ifdef CONFIG_SYS_TEXT_BASE
 CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
 +#else
 +   CONFIG_SYS_MONITOR_BASE, bss_start, bss_end);
 +#endif
  #endif

 These aren't the same for you?


According to Mike's patch in 2010, CONFIG_SYS_TEXT_BASE is not used in
Blackfin boards.

commit fbb21ff0478f1bac0b009133bf82b7412ea0230b
Author: Mike Frysinger vap...@gentoo.org
Date:   Thu Dec 23 14:13:41 2010 -0500

Blackfin: drop CONFIG_SYS_TEXT_BASE from boards

We don't want/use this value for Blackfin boards, so punt it and have the
common code error out when people try to use it.

Signed-off-by: Mike Frysinger vap...@gentoo.org



Thanks,

Sonic
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] env_mmc: support env partition setup in runtime

2014-07-30 Thread Igor Grinberg
Hi Jeroen,

On 07/29/14 20:44, Jeroen Hofstee wrote:
 Hello Dmitry,
 
 On 29-07-14 11:46, Dmitry Lifshitz wrote:
 Add callback with __weak annotation to allow setup of environment
 partition number in runtime from a board file.

 Propagate mmc_switch_part() return value into init_mmc_for_env() instead
 of -1 in case of failure.

 Signed-off-by: Dmitry Lifshitz lifsh...@compulab.co.il
 Signed-off-by: Igor Grinberg grinb...@compulab.co.il
 ---
   common/env_mmc.c |   35 +++
   1 files changed, 23 insertions(+), 12 deletions(-)

 diff --git a/common/env_mmc.c b/common/env_mmc.c
 index 7da10e6..a7621a8 100644
 --- a/common/env_mmc.c
 +++ b/common/env_mmc.c
 @@ -62,16 +62,36 @@ int env_init(void)
   return 0;
   }
   -static int init_mmc_for_env(struct mmc *mmc)
 -{
   #ifdef CONFIG_SYS_MMC_ENV_PART
 +__weak uint mmc_get_env_part(struct mmc *mmc)
 +{
 +return CONFIG_SYS_MMC_ENV_PART;
 +}
 +
 
 mmc_get_env_part lacks a prototype and there seems to be no
 strong version / user of this code.

Thanks for finding this one.
Indeed we forgot to add a prototype - will fix that shortly.

As to the strong version - it is already upstream:
1c8c36f (cm-t54: add environment partition runtime detection)


-- 
Regards,
Igor.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/2] blackfin: convert blackfin board_f and board_r to use generic board init functions

2014-07-30 Thread Sonic Zhang
From: Sonic Zhang sonic.zh...@analog.com

- move blackfin specific cpu init code from blackfin board.c to cpu.c
- remove blackfin specific board init code and invoke generic board_f fron cpu 
init entry
- rename section name bss_vma to bss_start in order to match the generic board 
init code
- add a fake relocate_code function to set up the new stack only

Signed-off-by: Sonic Zhang sonic.zh...@analog.com
---

 arch/blackfin/config.mk|   3 +
 arch/blackfin/cpu/cpu.c| 333 +---
 arch/blackfin/cpu/start.S  |  14 +-
 arch/blackfin/cpu/u-boot.lds   |   4 +-
 arch/blackfin/include/asm/u-boot.h |   3 +
 arch/blackfin/lib/Makefile |   7 +-
 arch/blackfin/lib/board.c  | 443 -
 arch/blackfin/lib/sections.c   |  11 +
 include/configs/bfin_adi_common.h  |   4 +
 9 files changed, 334 insertions(+), 488 deletions(-)
 delete mode 100644 arch/blackfin/lib/board.c
 create mode 100644 arch/blackfin/lib/sections.c

diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index fcaa44f..96730dd 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -20,6 +20,9 @@ CONFIG_BFIN_CPU := $(strip $(CONFIG_BFIN_CPU:%=%))
 endif
 CONFIG_BFIN_BOOT_MODE := $(strip $(CONFIG_BFIN_BOOT_MODE:%=%))
 
+# Support generic board on Blackfin
+__HAVE_ARCH_GENERIC_BOARD := y
+
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
 
diff --git a/arch/blackfin/cpu/cpu.c b/arch/blackfin/cpu/cpu.c
index 2409c30..6913879 100644
--- a/arch/blackfin/cpu/cpu.c
+++ b/arch/blackfin/cpu/cpu.c
@@ -11,17 +11,21 @@
 
 #include common.h
 #include command.h
+#include serial.h
+#include version.h
+
 #include asm/blackfin.h
 #include asm/cplb.h
+#include asm/clock.h
 #include asm/mach-common/bits/core.h
 #include asm/mach-common/bits/ebiu.h
 #include asm/mach-common/bits/trace.h
-#include asm/serial.h
 
 #include cpu.h
 #include initcode.h
 
 ulong bfin_poweron_retx;
+DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_CORE1_RUN)  defined(COREB_L1_CODE_START)
 void bfin_core1_start(void)
@@ -48,6 +52,252 @@ void bfin_core1_start(void)
 }
 #endif
 
+__attribute__((always_inline))
+static inline void serial_early_puts(const char *s)
+{
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+   serial_puts(Early: );
+   serial_puts(s);
+#endif
+}
+
+static int global_board_data_init(void)
+{
+#ifndef CONFIG_SYS_GBL_DATA_ADDR
+# define CONFIG_SYS_GBL_DATA_ADDR 0
+#endif
+#ifndef CONFIG_SYS_BD_INFO_ADDR
+# define CONFIG_SYS_BD_INFO_ADDR 0
+#endif
+
+   bd_t *bd;
+
+   if (CONFIG_SYS_GBL_DATA_ADDR) {
+   gd = (gd_t *)(CONFIG_SYS_GBL_DATA_ADDR);
+   memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
+   } else {
+   static gd_t _bfin_gd;
+   gd = _bfin_gd;
+   }
+   if (CONFIG_SYS_BD_INFO_ADDR) {
+   bd = (bd_t *)(CONFIG_SYS_BD_INFO_ADDR);
+   memset(bd, 0, GENERATED_BD_INFO_SIZE);
+   } else {
+   static bd_t _bfin_bd;
+   bd = _bfin_bd;
+   }
+
+   gd-bd = bd;
+
+   bd-bi_r_version = version_string;
+   bd-bi_cpu = __stringify(CONFIG_BFIN_CPU);
+   bd-bi_board_name = CONFIG_SYS_BOARD;
+   bd-bi_vco = get_vco();
+   bd-bi_cclk = get_cclk();
+   bd-bi_sclk = get_sclk();
+   bd-bi_memstart = CONFIG_SYS_SDRAM_BASE;
+   bd-bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
+
+   gd-ram_size = CONFIG_SYS_MAX_RAM_SIZE;
+
+   return 0;
+}
+
+static void display_global_data(void)
+{
+   bd_t *bd;
+
+#ifndef CONFIG_DEBUG_EARLY_SERIAL
+   return;
+#endif
+
+   bd = gd-bd;
+   printf( gd: %p\n, gd);
+   printf( |-flags: %lx\n, gd-flags);
+   printf( |-board_type: %lx\n, gd-arch.board_type);
+   printf( |-baudrate: %u\n, gd-baudrate);
+   printf( |-have_console: %lx\n, gd-have_console);
+   printf( |-ram_size: %lx\n, gd-ram_size);
+   printf( |-env_addr: %lx\n, gd-env_addr);
+   printf( |-env_valid: %lx\n, gd-env_valid);
+   printf( |-jt(%p): %p\n, gd-jt, *(gd-jt));
+   printf( \\-bd: %p\n, gd-bd);
+   printf(   |-bi_boot_params: %lx\n, bd-bi_boot_params);
+   printf(   |-bi_memstart: %lx\n, bd-bi_memstart);
+   printf(   |-bi_memsize: %lx\n, bd-bi_memsize);
+   printf(   |-bi_flashstart: %lx\n, bd-bi_flashstart);
+   printf(   |-bi_flashsize: %lx\n, bd-bi_flashsize);
+   printf(   \\-bi_flashoffset: %lx\n, bd-bi_flashoffset);
+}
+
+#define CPLB_PAGE_SIZE (4 * 1024 * 1024)
+#define CPLB_PAGE_MASK (~(CPLB_PAGE_SIZE - 1))
+#if defined(__ADSPBF60x__)
+#define CPLB_EX_PAGE_SIZE (16 * 1024 * 1024)
+#define CPLB_EX_PAGE_MASK (~(CPLB_EX_PAGE_SIZE - 1))
+#else
+#define CPLB_EX_PAGE_SIZE CPLB_PAGE_SIZE
+#define CPLB_EX_PAGE_MASK CPLB_PAGE_MASK
+#endif
+void init_cplbtables(void)
+{
+   uint32_t *ICPLB_ADDR, *ICPLB_DATA;
+   uint32_t *DCPLB_ADDR, *DCPLB_DATA;
+   uint32_t extern_memory;
+   

[U-Boot] [PATCH v2 2/2] support blackfin board initialization in generic board_f

2014-07-30 Thread Sonic Zhang
From: Sonic Zhang sonic.zh...@analog.com

- init hardware watchdog if applicable
- use CONFIG_SYS_MONITOR_LEN as the gd monitor len for Blackfin
- reserve u-boot memory at the top field of the RAM for Blackfin
- avoid refer to CONFIG_SYS_MONITOR_LEN, which is not defined by Blackfin

Signed-off-by: Sonic Zhang sonic.zh...@analog.com

---

v2-changes:
- make hardware watchdog init depend on BLACKFIN || M68K || MICROBLAZE || SH
- define watchdog init and reset macros for both software and hardware watchdog
---
 common/board_f.c   | 23 +--
 include/watchdog.h |  2 +-
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index bdab38e..7943d08 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -104,9 +104,14 @@ __weak void blue_led_off(void) {}
  * Could the CONFIG_SPL_BUILD infection become a flag in gd?
  */
 
-#if defined(CONFIG_WATCHDOG)
+#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
 static int init_func_watchdog_init(void)
 {
+# if defined(CONFIG_HW_WATCHDOG)  (defined(CONFIG_BLACKFIN) || \
+   defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \
+   defined(CONFIG_SH))
+   hw_watchdog_init();
+# endif
puts(   Watchdog enabled\n);
WATCHDOG_RESET();
 
@@ -144,7 +149,11 @@ static int display_text_info(void)
bss_end = (ulong)__bss_end;
 
debug(U-Boot code: %08X - %08lX  BSS: - %08lX\n,
+#ifdef CONFIG_SYS_TEXT_BASE
  CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
+#else
+ CONFIG_SYS_MONITOR_BASE, bss_start, bss_end);
+#endif
 #endif
 
 #ifdef CONFIG_MODEM_SUPPORT
@@ -259,6 +268,8 @@ static int setup_mon_len(void)
gd-mon_len = (ulong)__bss_end - (ulong)_start;
 #elif defined(CONFIG_SANDBOX)
gd-mon_len = (ulong)_end - (ulong)_init;
+#elif defined(CONFIG_BLACKFIN)
+   gd-mon_len = CONFIG_SYS_MONITOR_LEN;
 #else
/* TODO: use (ulong)__bss_end - (ulong)__text_start; ? */
gd-mon_len = (ulong)__bss_end - CONFIG_SYS_MONITOR_BASE;
@@ -719,7 +730,9 @@ static int reloc_fdt(void)
 
 static int setup_reloc(void)
 {
+#ifdef CONFIG_SYS_TEXT_BASE
gd-reloc_off = gd-relocaddr - CONFIG_SYS_TEXT_BASE;
+#endif
memcpy(gd-new_gd, (char *)gd, sizeof(gd_t));
 
debug(Relocation Offset is: %08lx\n, gd-reloc_off);
@@ -802,7 +815,7 @@ static init_fnc_t init_sequence_f[] = {
/* TODO: can we rename this to timer_init()? */
init_timebase,
 #endif
-#if defined(CONFIG_ARM) || defined(CONFIG_MIPS)
+#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || defined(CONFIG_BLACKFIN)
timer_init, /* initialize timer */
 #endif
 #ifdef CONFIG_SYS_ALLOC_DPRAM
@@ -901,6 +914,10 @@ static init_fnc_t init_sequence_f[] = {
 *  - board info struct
 */
setup_dest_addr,
+#if defined(CONFIG_BLACKFIN)
+   /* Blackfin u-boot monitor should be on top of the ram */
+   reserve_uboot,
+#endif
 #if defined(CONFIG_LOGBUFFER)  !defined(CONFIG_ALT_LB_ADDR)
reserve_logbuffer,
 #endif
@@ -921,7 +938,9 @@ static init_fnc_t init_sequence_f[] = {
 !defined(CONFIG_ARM)  !defined(CONFIG_X86)
reserve_video,
 #endif
+#if !defined(CONFIG_BLACKFIN)
reserve_uboot,
+#endif
 #ifndef CONFIG_SPL_BUILD
reserve_malloc,
reserve_board,
diff --git a/include/watchdog.h b/include/watchdog.h
index aacacb9..437df4b 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -21,7 +21,7 @@
 int init_func_watchdog_reset(void);
 #endif
 
-#ifdef CONFIG_WATCHDOG
+#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
 #define INIT_FUNC_WATCHDOG_INITinit_func_watchdog_init,
 #define INIT_FUNC_WATCHDOG_RESET   init_func_watchdog_reset,
 #else
-- 
1.8.2.3

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


Re: [U-Boot] [PATCH v2 1/4] MAINTAINERS: add initial version

2014-07-30 Thread Masahiro Yamada
Hi Daniel,

Could you fix one more, please?


On Tue, 29 Jul 2014 13:59:16 +0200
Daniel Schwierzeck daniel.schwierz...@gmail.com wrote:

 +FLATTENED DEVICE TREE
 +M:   Jerry Van Baren vanba...@cideas.com
 +S:   Maintained
 +T:   git git://git.denx.de/u-boot-fdt.git
 +F:   lib/libftd/


Typo.lib/libfdt/



Best Regards
Masahiro Yamada

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


[U-Boot] SPL and an LCD splash screen on AM335x

2014-07-30 Thread Andy Pont
Hello!

We are currently working on the specification for a project using the TI
AM335x where the overall system boot time has to be reduced as far as
possible.  In order to achieve that I am proposing that we implement a board
specific spl_start_uboot() function which under normal circumstances U-Boot
SPL will load the Linux kernel directly. 

One of the other requirements is to display a splash screen logo on the LCD
as early in the boot process as possible.  Is it possible to get U-Boot SPL
to do that or will we always have to boot through U-Boot or see if we can
get the Linux kernel to do it as early as possible?

Thoughts and ideas welcome.

Andy.


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


Re: [U-Boot] SPL and an LCD splash screen on AM335x

2014-07-30 Thread Heshsham Abdul Basit
Hi Andy,

I also tried to boot Linux directly on my Zynq board. But I could not
understand the instructions given in readme.falcon, so the project is
stalled.

google *falcon mode U-boot , *you will find couple of presentations, and in
doc you have readme.falcon.txt  that explains this with an example.

Since I also want to continue on this, so let us continue this discussion.


Thanks and regards,

Abdul Basit


On 30 July 2014 12:13, Andy Pont andy.p...@sdcsystems.com wrote:

 Hello!

 We are currently working on the specification for a project using the TI
 AM335x where the overall system boot time has to be reduced as far as
 possible.  In order to achieve that I am proposing that we implement a
 board
 specific spl_start_uboot() function which under normal circumstances U-Boot
 SPL will load the Linux kernel directly.

 One of the other requirements is to display a splash screen logo on the
 LCD
 as early in the boot process as possible.  Is it possible to get U-Boot
 SPL
 to do that or will we always have to boot through U-Boot or see if we can
 get the Linux kernel to do it as early as possible?

 Thoughts and ideas welcome.

 Andy.


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

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


[U-Boot] [PATCH] [blackfin] bf609: add register define required by core B on dual core BF609 processor

2014-07-30 Thread Aaron Wu
Add register define required by core B on dual core BF609 processor

Signed-off-by: Aaron Wu aaron...@analog.com
---
 arch/blackfin/include/asm/mach-bf609/BF609_def.h |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/blackfin/include/asm/mach-bf609/BF609_def.h 
b/arch/blackfin/include/asm/mach-bf609/BF609_def.h
index 02b81d3..fd0d86d 100644
--- a/arch/blackfin/include/asm/mach-bf609/BF609_def.h
+++ b/arch/blackfin/include/asm/mach-bf609/BF609_def.h
@@ -125,6 +125,8 @@
 #define WDOG1_CNT 0xFFC17804 /* WDOG1 Count Register */
 #define WDOG1_STAT0xFFC17808 /* WDOG1 Watchdog Timer Status Register */
 
+#define SDU0_MSG_SET  0xFFC1F084 /* SDU0 Message Set Register */
+
 #define EMAC0_MACCFG  0xFFC2 /* EMAC0 MAC Configuration Register */
 #define EMAC1_MACCFG  0xFFC22000 /* EMAC1 MAC Configuration Register */
 
-- 
1.7.9.5

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


[U-Boot] [PATCH] test email

2014-07-30 Thread Przemyslaw Marczak
Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
 test.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 test.c

diff --git a/test.c b/test.c
new file mode 100644
index 000..40e6141
--- /dev/null
+++ b/test.c
@@ -0,0 +1 @@
+#include test
\ No newline at end of file
-- 
1.9.1

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


Re: [U-Boot] [PATCH] [blackfin] bf609: add register define required by core B on dual core BF609 processor

2014-07-30 Thread Sonic Zhang
Hi Aaron,

Applied.

Thanks,

Sonic

On Wed, Jul 30, 2014 at 3:15 PM, Aaron Wu aaron...@analog.com wrote:
 Add register define required by core B on dual core BF609 processor

 Signed-off-by: Aaron Wu aaron...@analog.com
 ---
  arch/blackfin/include/asm/mach-bf609/BF609_def.h |2 ++
  1 file changed, 2 insertions(+)

 diff --git a/arch/blackfin/include/asm/mach-bf609/BF609_def.h 
 b/arch/blackfin/include/asm/mach-bf609/BF609_def.h
 index 02b81d3..fd0d86d 100644
 --- a/arch/blackfin/include/asm/mach-bf609/BF609_def.h
 +++ b/arch/blackfin/include/asm/mach-bf609/BF609_def.h
 @@ -125,6 +125,8 @@
  #define WDOG1_CNT 0xFFC17804 /* WDOG1 Count Register */
  #define WDOG1_STAT0xFFC17808 /* WDOG1 Watchdog Timer Status Register 
 */

 +#define SDU0_MSG_SET  0xFFC1F084 /* SDU0 Message Set Register */
 +
  #define EMAC0_MACCFG  0xFFC2 /* EMAC0 MAC Configuration Register */
  #define EMAC1_MACCFG  0xFFC22000 /* EMAC1 MAC Configuration Register */

 --
 1.7.9.5

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


Re: [U-Boot] [PATCH] test email

2014-07-30 Thread Przemyslaw Marczak

Hello,

On 07/30/2014 09:36 AM, Przemyslaw Marczak wrote:

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
  test.c | 1 +
  1 file changed, 1 insertion(+)
  create mode 100644 test.c

diff --git a/test.c b/test.c
new file mode 100644
index 000..40e6141
--- /dev/null
+++ b/test.c
@@ -0,0 +1 @@
+#include test
\ No newline at end of file



Sorry for this.
Regards,
--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] SPL and an LCD splash screen on AM335x

2014-07-30 Thread Stefano Babic
Hi Andy,

On 30/07/2014 08:43, Andy Pont wrote:
 Hello!
 
 We are currently working on the specification for a project using the TI
 AM335x where the overall system boot time has to be reduced as far as
 possible.  In order to achieve that I am proposing that we implement a board
 specific spl_start_uboot() function which under normal circumstances U-Boot
 SPL will load the Linux kernel directly. 

Of course: spl_start_uboot() is the board specific function that decides
to load either kernel or u-boot.

 
 One of the other requirements is to display a splash screen logo on the LCD
 as early in the boot process as possible.  Is it possible to get U-Boot SPL
 to do that or will we always have to boot through U-Boot or see if we can
 get the Linux kernel to do it as early as possible?

This is against the concept. Falcon boot is thought to start the kernel
as fast as possible, removing most of the stuff that belongs to u-boot.

The goal is reached in another way: booting the kernel faster let that
the framebuffer/drm driver in kernel is initialized very soon, and you
have to provide your logo during kernel boot.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Implementing spl_start_uboot() for directly booting linux

2014-07-30 Thread Heshsham Abdul Basit
Hello,

I am trying to directly boot the kernel i.e without u-boot, on my
Xilinx Zynq based microzed board.


I understand that for that I must implement the function
spl_start_uboot() in spl.c



Right now the definition is:



#ifdef CONFIG_SPL_OS_BOOT
int spl_start_uboot(void)
{
/* boot linux */
return 0;
}
#endif


Given here:
https://github.com/Xilinx/u-boot-xlnx/blob/2a0536fa48db1fc5332e3cd33b846d0da0c8bc1e/arch/arm/cpu/armv7/zynq/spl.c


Can someone explain how to implement this function for directly
booting the kernel?  Actually till now all the boards I have searched
have not implemented this function, So if you can provide any example
board implementation , it would give me a clear picture of how to do
this for my zynq board.

Thanks in advance,


Abdul Basit
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Implementing spl_start_uboot() for directly booting linux

2014-07-30 Thread Stefano Babic
Hi Abdul,

On 30/07/2014 10:21, Heshsham Abdul Basit wrote:
 Hello,
 
 I am trying to directly boot the kernel i.e without u-boot, on my
 Xilinx Zynq based microzed board.
 
 
 I understand that for that I must implement the function
 spl_start_uboot() in spl.c
 
 
 
 Right now the definition is:
 
 
 
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
 /* boot linux */
 return 0;
 }
 #endif
 
 
 Given here:
 https://github.com/Xilinx/u-boot-xlnx/blob/2a0536fa48db1fc5332e3cd33b846d0da0c8bc1e/arch/arm/cpu/armv7/zynq/spl.c

Anyway, you are not using mainline. Please stick with the sources on
u-boot mainline to get help here.

 Can someone explain how to implement this function for directly
 booting the kernel?  Actually till now all the boards I have searched
 have not implemented this function,

This means you have not deeply searched. Check for example
board/technexion/twister/twister.c:


int spl_start_uboot(void)
{
int val = 0;
if (!gpio_request(SPL_OS_BOOT_KEY, U-Boot key)) {
gpio_direction_input(SPL_OS_BOOT_KEY);
val = gpio_get_value(SPL_OS_BOOT_KEY);
gpio_free(SPL_OS_BOOT_KEY);
}
return val;
}

On this board, the decision which image to boot is taken by looking at a
GPIO (switch on the board). Of course, you can implement the way you
need based on your hardware.

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/15] Kconfig for U-Boot

2014-07-30 Thread Masahiro Yamada
Hi Simon,



On Mon, 28 Jul 2014 04:43:35 +0100
Simon Glass s...@chromium.org wrote:
 
 Also some thoughts for the future:
 
 1. The 'menuconfig' option makes it obvious that we are dealing with
 U-Boot / SPL / TPL. Can we do the same for 'xconfig'?


Sorry, I could not understand what you mean.

In my rough understanding, 'menuconfig' and 'xconfig' are equivalent
except the appearance of GUI.

What is expactly supported in 'menuconfig' and missing in 'xconfig'?




 2. If I do 'make tpl/menuconfig' and there is no TPL defined, I wonder
 if it should give an error rather than allowing you to edit it?

I am not sure if it should.
Anyway I can do this, if necessary, in a follow-up patch.



 3. With all of this code applied we could use some documentation about
 the defconfig file format and how it interacts with the board config
 files. This could come from your commit messages perhaps.

Yes. I can do this after the series is applied.
I agree this should be documented.


 BTW Python doc strings usually use  instead of ' and :
 
 http://legacy.python.org/dev/peps/pep-0008/#documentation-strings
 

Uh, thanks. Fixed.


Best Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH v2 1/4] MAINTAINERS: add initial version

2014-07-30 Thread Masahiro Yamada
Hi Daniel,


One more update, please.



On Tue, 29 Jul 2014 13:59:16 +0200
Daniel Schwierzeck daniel.schwierz...@gmail.com wrote:

 +FLATTENED DEVICE TREE
 +M:   Jerry Van Baren vanba...@cideas.com


Please replace with
M:  Simon Glass s...@chromium.org



Simon will pick up FDT custodianship.

Please refer:
http://patchwork.ozlabs.org/patch/374354/






Best Regards
Masahiro Yamada

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


[U-Boot] Please pull u-boot-sunxi.git/master

2014-07-30 Thread Hans de Goede
Hi Albert

Please pull from u-boot-sunxi.git/master for a set of patches adding
AHCI, EHCI, PSCI support + support for 14 new boards.

The following changes since commit 9d195a546179bc732aba9eacccf0a9a3db591288:

  ARM: HYP/non-sec: remove MIDR check to validate CBAR (2014-07-28 17:19:55 
+0200)

are available in the git repository at:

  http://git.denx.de/u-boot-sunxi.git master

for you to fetch changes up to 4854154002d92b3fc9fd708774cec7c04c954247:

  sun7i: Add bananapi board (2014-07-30 10:23:07 +0200)


Hans de Goede (8):
  sun4i: add USB EHCI settings
  sun5i: add USB EHCI settings
  sunxi: Enable EHCI on various sunxi boards
  sunxi: Add CONFIG_MACPWR option
  sun4i: Add support for a number of new sun4i boards
  sun5i: Add support for a number of new sun5i boards
  sun7i: Add support for a number of new sun7i boards
  sun7i: Add bananapi board

Ian Campbell (2):
  ahci: provide sunxi SATA driver using AHCI platform framework
  cubieboard2: Enable AXP209 power controller

Marc Zyngier (2):
  sunxi: HYP/non-sec: add sun7i PSCI backend
  sunxi: HYP/non-sec: configure CNTFRQ on all CPUs

Roman Byshko (5):
  sunxi: add defines to control USB Host clocks/resets
  sunxi: add USB EHCI driver
  sunxi: add general USB settings
  sun7i: add USB EHCI settings
  sun7i: cubietruck: enable USB EHCI

 arch/arm/cpu/armv7/sunxi/Makefile |   3 +
 arch/arm/cpu/armv7/sunxi/board.c  |   5 +
 arch/arm/cpu/armv7/sunxi/clock_sun4i.c|   4 +
 arch/arm/cpu/armv7/sunxi/psci.S   | 162 +
 arch/arm/include/asm/arch-sunxi/clock_sun4i.h |  15 +-
 board/sunxi/Makefile  |  16 ++
 board/sunxi/ahci.c|  84 +++
 board/sunxi/dram_a10_olinuxino_l.c|  31 
 board/sunxi/dram_a10s_olinuxino_m.c   |  31 
 board/sunxi/dram_a13_olinuxino.c  |  31 
 board/sunxi/dram_bananapi.c   |  31 
 board/sunxi/dram_linksprite_pcduino3.c|  31 
 board/sunxi/dram_sun4i_360_1024_iow16.c   |  31 
 board/sunxi/dram_sun4i_360_1024_iow8.c|  31 
 board/sunxi/dram_sun4i_360_512.c  |  31 
 board/sunxi/dram_sun4i_384_1024_iow8.c|  31 
 board/sunxi/dram_sun7i_384_1024_iow16.c   |  31 
 board/sunxi/dram_sun7i_384_512_busw16_iow16.c |  31 
 boards.cfg|  28 +++-
 drivers/block/ahci.c  |  16 ++
 drivers/usb/host/Makefile |   1 +
 drivers/usb/host/ehci-sunxi.c | 201 ++
 include/ahci.h|   4 +
 include/configs/sun4i.h   |  12 ++
 include/configs/sun5i.h   |   5 +
 include/configs/sun7i.h   |  19 +++
 include/configs/sunxi-common.h|  18 +++
 27 files changed, 923 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/sunxi/psci.S
 create mode 100644 board/sunxi/ahci.c
 create mode 100644 board/sunxi/dram_a10_olinuxino_l.c
 create mode 100644 board/sunxi/dram_a10s_olinuxino_m.c
 create mode 100644 board/sunxi/dram_a13_olinuxino.c
 create mode 100644 board/sunxi/dram_bananapi.c
 create mode 100644 board/sunxi/dram_linksprite_pcduino3.c
 create mode 100644 board/sunxi/dram_sun4i_360_1024_iow16.c
 create mode 100644 board/sunxi/dram_sun4i_360_1024_iow8.c
 create mode 100644 board/sunxi/dram_sun4i_360_512.c
 create mode 100644 board/sunxi/dram_sun4i_384_1024_iow8.c
 create mode 100644 board/sunxi/dram_sun7i_384_1024_iow16.c
 create mode 100644 board/sunxi/dram_sun7i_384_512_busw16_iow16.c
 create mode 100644 drivers/usb/host/ehci-sunxi.c

Regards,

Hans
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 22/25] tools/kwboot: Sync with latest barebox version to support Armada XP

2014-07-30 Thread Stefan Roese

Hi Luka,

On 30.07.2014 01:16, Luka Perkov wrote:

snip


-#define KWBOOT_MSG_REQ_DELAY   1000 /* ms */
-#define KWBOOT_MSG_RSP_TIMEO   1000 /* ms */
+#define KWBOOT_MSG_REQ_DELAY   10 /* ms */
+#define KWBOOT_MSG_RSP_TIMEO   50 /* ms */


Unfortunately these settings do not work with Armada XP. I tested a bit and
it seems that e.g. this setting works on Armada XP:

#define KWBOOT_MSG_REQ_DELAY10 /* ms */
#define KWBOOT_MSG_RSP_TIMEO1000 /* ms */

Could you please check this on your Kirkwood platform? And perhaps find a
configuration that works for the SoC's? That would be great!


I just tried this and it does not work on kirkwood. I've stumbled upon
this thread though, it might be useful:

http://lists.infradead.org/pipermail/barebox/2014-June/019618.html


Yes, thanks.


Can we just add a flag to kwboot which will use appropriate values for
kirkwood and armada? We can keep kirkwood by default, that way we won't
break anything.


If nobody comes up with a working solution (timeout values that work for 
both SoC's), then such a parameter is of course an option.


Thanks,
Stefan

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


Re: [U-Boot] [PATCH v2 1/4] MAINTAINERS: add initial version

2014-07-30 Thread Daniel Schwierzeck


On 30.07.2014 10:33, Masahiro Yamada wrote:
 Hi Daniel,
 
 
 One more update, please.
 
 
 
 On Tue, 29 Jul 2014 13:59:16 +0200
 Daniel Schwierzeck daniel.schwierz...@gmail.com wrote:
 
 +FLATTENED DEVICE TREE
 +M:  Jerry Van Baren vanba...@cideas.com
 
 
 Please replace with
 M:Simon Glass s...@chromium.org
 
 
 
 Simon will pick up FDT custodianship.
 
 Please refer:
 http://patchwork.ozlabs.org/patch/374354/
 

already fixed in v3, thanks

-- 
- Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/15] Kconfig for U-Boot

2014-07-30 Thread Simon Glass
Hi Masahiro,

On 30 July 2014 09:27, Masahiro Yamada yamad...@jp.panasonic.com wrote:
 Hi Simon,



 On Mon, 28 Jul 2014 04:43:35 +0100
 Simon Glass s...@chromium.org wrote:

 Also some thoughts for the future:

 1. The 'menuconfig' option makes it obvious that we are dealing with
 U-Boot / SPL / TPL. Can we do the same for 'xconfig'?


 Sorry, I could not understand what you mean.

 In my rough understanding, 'menuconfig' and 'xconfig' are equivalent
 except the appearance of GUI.

 What is expactly supported in 'menuconfig' and missing in 'xconfig'?

At the top with menuconfig it shows U-Boot, or SPL, or TPL so it is
clear which one you are configuring. With xconfig I don't see the same
thing. So when you are configuring SPL it is not clear that you are
not in fact configuring the main  U-Boot.





 2. If I do 'make tpl/menuconfig' and there is no TPL defined, I wonder
 if it should give an error rather than allowing you to edit it?

 I am not sure if it should.
 Anyway I can do this, if necessary, in a follow-up patch.

OK

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V4 5/9] video: Add driver for Parade PS8625 dP to LVDS bridge

2014-07-30 Thread Ajay Kumar
From: Vadim Bendebury vben...@chromium.org

The initialization table comes from the Illustration of I2C command
for initialing PS8625 document supplied by Parade.

Signed-off-by: Vadim Bendebury vben...@chromium.org
Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 drivers/video/Makefile |1 +
 drivers/video/parade.c |  220 
 include/fdtdec.h   |1 +
 lib/fdtdec.c   |1 +
 4 files changed, 223 insertions(+)
 create mode 100644 drivers/video/parade.c

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 945f35d..8618590 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -41,3 +41,4 @@ obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
 obj-$(CONFIG_VIDEO_TEGRA) += tegra.o
 obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
 obj-$(CONFIG_FORMIKE) += formike.o
+obj-$(CONFIG_VIDEO_PARADE) += parade.o
diff --git a/drivers/video/parade.c b/drivers/video/parade.c
new file mode 100644
index 000..0f543f6
--- /dev/null
+++ b/drivers/video/parade.c
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/*
+ * This file is a driver for Parade dP-LVDS bridges. The original submission
+ * is for the ps8625 chip.
+ */
+#include config.h
+#include common.h
+#include i2c.h
+#include fdtdec.h
+
+/*
+ * Initialization of the chip is a process of writing certaing values into
+ * certain registers over i2c bus. The chip in fact responds to a range of
+ * addresses on the i2c bus, so for each written value three parameters are
+ * required: i2c address, register address and the actual value.
+ *
+ * The base address is derived from the device tree, only address offset is
+ * stored in the table below.
+ */
+/**
+ * struct reg_data() - data for a parade register write
+ *
+ * @addr_offoffset from the i2c base address for parade
+ * @reg_addrregister address to write
+ * @value   value to be written
+ */
+struct reg_data {
+   uint8_t addr_off;
+   uint8_t reg;
+   uint8_t value;
+} _packed;
+
+#define END_OF_TABLE 0xff /* Ficticious offset */
+
+static const struct reg_data parade_values[] = {
+   {0x02, 0xa1, 0x01},  /* HPD low */
+/*
+ * SW setting
+ * [1:0] SW output 1.2V voltage is lower to 96%
+ */
+   {0x04, 0x14, 0x01},
+/*
+ * RCO SS setting
+ * [5:4] = b01 0.5%, b10 1%, b11 1.5%
+ */
+   {0x04, 0xe3, 0x20},
+   {0x04, 0xe2, 0x80}, /* [7] RCO SS enable */
+/*
+ *  RPHY Setting
+ * [3:2] CDR tune wait cycle before
+ * measure for fine tune b00: 1us,
+ * 01: 0.5us, 10:2us, 11:4us.
+ */
+   {0x04, 0x8a, 0x0c},
+   {0x04, 0x89, 0x08}, /* [3] RFD always on */
+/*
+ * CTN lock in/out:
+ * 2ppm/8ppm. Lock out 2
+ * times.
+ */
+   {0x04, 0x71, 0x2d},
+/*
+ * 2.7G CDR settings
+ * NOF=40LSB for HBR CDR setting
+ */
+   {0x04, 0x7d, 0x07},
+   {0x04, 0x7b, 0x00},  /* [1:0] Fmin=+4bands */
+   {0x04, 0x7a, 0xfd},  /* [7:5] DCO_FTRNG=+-40% */
+/*
+ * 1.62G CDR settings
+ * [5:2]NOF=64LSB [1:0]DCO scale is 2/5
+ */
+   {0x04, 0xc0, 0x12},
+   {0x04, 0xc1, 0x92},  /* Gitune=-37% */
+   {0x04, 0xc2, 0x1c},  /* Fbstep=100% */
+   {0x04, 0x32, 0x80},  /* [7] LOS signal disable */
+/*
+ * RPIO Setting
+ * [7:4] LVDS driver bias current :
+ * 75% (250mV swing)
+ */
+   {0x04, 0x00, 0xb0},
+/*
+ * [7:6] Right-bar GPIO output strength is 8mA
+ */
+   {0x04, 0x15, 0x40},
+/* EQ Training State Machine Setting */
+   {0x04, 0x54, 0x10},  /* RCO calibration start */
+/* [4:0] MAX_LANE_COUNT set to one lane */
+   {0x01, 0x02, 0x81},
+/* [4:0] LANE_COUNT_SET set to one lane */
+   {0x01, 0x21, 0x81},
+   {0x00, 0x52, 0x20},
+   {0x00, 0xf1, 0x03},  /* HPD CP toggle enable */
+   {0x00, 0x62, 0x41},
+/* Counter number, add 1ms counter delay */
+   {0x00, 0xf6, 0x01},
+/*
+ * [6]PWM function control by
+ * DPCD0040f[7], default is PWM
+ * block always works.
+ */
+   {0x00, 0x77, 0x06},
+/*
+ * 04h Adjust VTotal tolerance to
+ * fix the 30Hz no display issue
+ */
+   {0x00, 0x4c, 0x04},
+/* DPCD00400='h00, Parade OUI = 'h001cf8 */
+   {0x01, 0xc0, 0x00},
+   {0x01, 0xc1, 0x1c},  /* DPCD00401='h1c */
+   {0x01, 0xc2, 0xf8},  /* DPCD00402='hf8 */
+/*
+ * DPCD403~408 = ASCII code
+ * D2SLV5='h4432534c5635
+ */
+   {0x01, 0xc3, 0x44},
+   {0x01, 0xc4, 0x32},  /* DPCD404 */
+   {0x01, 0xc5, 0x53},  

[U-Boot] [PATCH V4 2/9] arm: exynos: Add RPLL for Exynos5420

2014-07-30 Thread Ajay Kumar
RPLL is needed to drive the LCD panel on Exynos5420 based boards.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/exynos/clock_init.h |3 +++
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c |   13 +
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/clock_init.h 
b/arch/arm/cpu/armv7/exynos/clock_init.h
index a875d0b..fce502f 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init.h
+++ b/arch/arm/cpu/armv7/exynos/clock_init.h
@@ -75,6 +75,9 @@ struct mem_timings {
unsigned spll_mdiv;
unsigned spll_pdiv;
unsigned spll_sdiv;
+   unsigned rpll_mdiv;
+   unsigned rpll_pdiv;
+   unsigned rpll_sdiv;
unsigned pclk_cdrex_ratio;
unsigned direct_cmd_msr[MEM_TIMINGS_MSR_COUNT];
 
diff --git a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c 
b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
index 1d6977f..b6a9bc1 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
+++ b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
@@ -179,6 +179,10 @@ struct mem_timings mem_timings[] = {
.spll_mdiv = 0xc8,
.spll_pdiv = 0x3,
.spll_sdiv = 0x2,
+   /* RPLL @70.5Mhz */
+   .rpll_mdiv = 0x5E,
+   .rpll_pdiv = 0x2,
+   .rpll_sdiv = 0x4,
 
.direct_cmd_msr = {
0x00020018, 0x0003, 0x00010046, 0x0d70,
@@ -800,6 +804,7 @@ static void exynos5420_system_clock_init(void)
writel(mem-ipll_pdiv * PLL_LOCK_FACTOR, clk-ipll_lock);
writel(mem-spll_pdiv * PLL_LOCK_FACTOR, clk-spll_lock);
writel(mem-kpll_pdiv * PLL_LOCK_FACTOR, clk-kpll_lock);
+   writel(mem-rpll_pdiv * PLL_X_LOCK_FACTOR, clk-rpll_lock);
 
setbits_le32(clk-src_cpu, MUX_HPM_SEL_MASK);
 
@@ -898,6 +903,14 @@ static void exynos5420_system_clock_init(void)
while ((readl(clk-spll_con0)  PLL_LOCKED) == 0)
;
 
+   /* Set RPLL */
+   writel(RPLL_CON2_VAL, clk-rpll_con2);
+   writel(RPLL_CON1_VAL, clk-rpll_con1);
+   val = set_pll(mem-rpll_mdiv, mem-rpll_pdiv, mem-rpll_sdiv);
+   writel(val, clk-rpll_con0);
+   while ((readl(clk-rpll_con0)  PLL_LOCKED) == 0)
+   ;
+
writel(CLK_DIV_CDREX0_VAL, clk-div_cdrex0);
writel(CLK_DIV_CDREX1_VAL, clk-div_cdrex1);
 
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 0/9] peach_pit: Add support for FIMD, DP and parade chip

2014-07-30 Thread Ajay Kumar
Patchset V1:
https://www.mail-archive.com/u-boot@lists.denx.de/msg140596.html

Patchset V2:
https://www.mail-archive.com/u-boot@lists.denx.de/msg141203.html

Patchset V3:
http://lists.denx.de/pipermail/u-boot/2014-July/183096.html

Changes from V1:
[PATCH V2 3/10] : Don't mix cpu_is and proid_is as per Minkyu's suggestion.
  Also, incorporate Simon's suggestion of not using else.
[PATCH V2 4/10] : For FIMD SYSMMU DT, use same compatible string as kernel.
[TEST_ONLY V2 6/10]: Make this patch TEST_ONLY

Changes from V2:
[PATCH V3 5/9] : Use SPDX tags to define the license for the file: parade.c
Removed TEST_ONLY patches.

Changes from V3:
[PATCH V4 1/9] : Fix comment style.
[PATCH V4 3/9] : Use 'else if' clause instead of 'if'.

Ajay Kumar (8):
  [PATCH V4 1/9] exynos_fb: Remove usage of static defines
  [PATCH V4 2/9] arm: exynos: Add RPLL for Exynos5420
  [PATCH V4 3/9] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for 
Exynos5420
  [PATCH V4 4/9] video: exynos_fimd: Add framework to disable FIMD sysmmu
  [PATCH V4 6/9] ARM: exynos: Add missing declaration for gpio_direction_input
  [PATCH V4 7/9] exynos5420: add callbacks needed for exynos_fb driver
  [PATCH V4 8/9] ARM: exynos: peach_pit: Add DT nodes for fimd and parade 
bridge chip
  [PATCH V4 9/9] CONFIGS: peach-pit: Enable display for peach_pit board

Vadim Bendebury (1):
  [PATCH V4 5/9] video: Add driver for Parade PS8625 dP to LVDS bridge

 arch/arm/cpu/armv7/exynos/clock.c  |   83 -
 arch/arm/cpu/armv7/exynos/clock_init.h |3 +
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c |   13 ++
 arch/arm/cpu/armv7/exynos/exynos5_setup.h  |2 +-
 arch/arm/dts/exynos5420-peach-pit.dts  |   30 
 arch/arm/dts/exynos54xx.dtsi   |   10 ++
 arch/arm/include/asm/arch-exynos/clk.h |1 +
 arch/arm/include/asm/arch-exynos/gpio.h|1 +
 arch/arm/include/asm/arch-exynos/system.h  |4 +
 board/samsung/common/board.c   |   15 ++
 board/samsung/smdk5420/smdk5420.c  |  129 +-
 doc/device-tree-bindings/video/exynos-fb.txt   |6 +
 drivers/video/Makefile |1 +
 drivers/video/exynos_fb.c  |   17 +-
 drivers/video/exynos_fimd.c|   43 +
 drivers/video/parade.c |  220 
 include/configs/exynos5250-dt.h|2 -
 include/configs/peach-pit.h|   10 ++
 include/configs/s5pc210_universal.h|3 -
 include/configs/trats.h|3 -
 include/configs/trats2.h   |3 -
 include/fdtdec.h   |2 +
 lib/fdtdec.c   |2 +
 23 files changed, 492 insertions(+), 111 deletions(-)
 create mode 100644 drivers/video/parade.c

-- 
1.7.9.5

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


[U-Boot] [PATCH V4 1/9] exynos_fb: Remove usage of static defines

2014-07-30 Thread Ajay Kumar
Previously, we used to statically assign values for vl_col, vl_row and
vl_bpix using #defines like LCD_XRES, LCD_YRES and LCD_COLOR16.

Introducing the function exynos_lcd_early_init() would take care of this
assignment on the fly by parsing FIMD DT properties, thereby allowing us
to remove LCD_XRES and LCD_YRES from the main config file.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 arch/arm/include/asm/arch-exynos/system.h |1 +
 board/samsung/common/board.c  |   15 +++
 drivers/video/exynos_fb.c |   17 +
 include/configs/exynos5250-dt.h   |2 --
 include/configs/s5pc210_universal.h   |3 ---
 include/configs/trats.h   |3 ---
 include/configs/trats2.h  |3 ---
 7 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/system.h 
b/arch/arm/include/asm/arch-exynos/system.h
index 7e2057c..4968d3d 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -39,5 +39,6 @@ struct exynos5_sysreg {
 
 void set_usbhost_mode(unsigned int mode);
 void set_system_display_ctrl(void);
+int exynos_lcd_early_init(const void *blob);
 
 #endif /* _EXYNOS4_SYSTEM_H */
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 9dc7c83..1f6f0a0 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -20,6 +20,7 @@
 #include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/power.h
+#include asm/arch/system.h
 #include power/pmic.h
 #include asm/arch/sromc.h
 #include lcd.h
@@ -148,6 +149,20 @@ int board_early_init_f(void)
board_i2c_init(gd-fdt_blob);
 #endif
 
+#if defined(CONFIG_OF_CONTROL)  defined(CONFIG_EXYNOS_FB)
+/*
+ * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs
+ * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix, to reserve
+ * FB memory at a very early stage. So, we need to fill panel_info.vl_col,
+ * panel_info.vl_row and panel_info.vl_bpix before lcd_setmem() is called.
+ */
+   err = exynos_lcd_early_init(gd-fdt_blob);
+   if (err) {
+   debug(LCD early init failed\n);
+   return err;
+   }
+#endif
+
return exynos_early_init_f();
 }
 #endif
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index e1e0d80..bc478a9 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -27,17 +27,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static unsigned int panel_width, panel_height;
 
-/*
- * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs
- * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix to reserve
- * FB memory at a very early stage, i.e even before exynos_fimd_parse_dt()
- * is called. So, we are forced to statically assign it.
- */
 #ifdef CONFIG_OF_CONTROL
 vidinfo_t panel_info  = {
-   .vl_col = LCD_XRES,
-   .vl_row = LCD_YRES,
-   .vl_bpix = LCD_COLOR16,
+   /*
+* Insert a value here so that we don't end up in the BSS
+* Reference: drivers/video/tegra.c
+*/
+   .vl_col = -1,
 };
 #endif
 
@@ -141,7 +136,7 @@ static void lcd_panel_on(vidinfo_t *vid)
 }
 
 #ifdef CONFIG_OF_CONTROL
-int exynos_fimd_parse_dt(const void *blob)
+int exynos_lcd_early_init(const void *blob)
 {
unsigned int node;
node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_FIMD);
@@ -286,8 +281,6 @@ void lcd_ctrl_init(void *lcdbase)
set_lcd_clk();
 
 #ifdef CONFIG_OF_CONTROL
-   if (exynos_fimd_parse_dt(gd-fdt_blob))
-   debug(Can't get proper panel info\n);
 #ifdef CONFIG_EXYNOS_MIPI_DSIM
exynos_init_dsim_platform_data(panel_info);
 #endif
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 74e72a5..c24984b 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -61,8 +61,6 @@
 #ifdef CONFIG_LCD
 #define CONFIG_EXYNOS_FB
 #define CONFIG_EXYNOS_DP
-#define LCD_XRES   2560
-#define LCD_YRES   1600
 #define LCD_BPPLCD_COLOR16
 #endif
 
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index eb046cd..20985da 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -247,7 +247,4 @@ int universal_spi_read(void);
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
 
-#define LCD_XRES   480
-#define LCD_YRES   800
-
 #endif /* __CONFIG_H */
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 90f1962..35c1feb 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -261,7 +261,4 @@
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE  ((500 * 160 * 4) + 54)
 
-#define LCD_XRES   

[U-Boot] [PATCH V4 6/9] ARM: exynos: Add missing declaration for gpio_direction_input

2014-07-30 Thread Ajay Kumar
This patch adds missing declaration for gpio_direction_input
function, thereby helps in resolving compilation warnings.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 arch/arm/include/asm/arch-exynos/gpio.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/arch-exynos/gpio.h 
b/arch/arm/include/asm/arch-exynos/gpio.h
index be5113f..8fb5c23 100644
--- a/arch/arm/include/asm/arch-exynos/gpio.h
+++ b/arch/arm/include/asm/arch-exynos/gpio.h
@@ -1504,6 +1504,7 @@ static const struct gpio_name_num_table 
exynos5420_gpio_table[] = {
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
+int gpio_direction_input(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
 int gpio_set_value(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 4/9] video: exynos_fimd: Add framework to disable FIMD sysmmu

2014-07-30 Thread Ajay Kumar
On Exynos5420 and newer versions, the FIMD sysmmus are in
on state by default.
We have to disable them in order to make FIMD DMA work.
This patch adds the required framework to exynos_fimd driver,
and disables FIMD sysmmu on Exynos5420.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
---
 arch/arm/dts/exynos54xx.dtsi |   10 ++
 doc/device-tree-bindings/video/exynos-fb.txt |6 
 drivers/video/exynos_fimd.c  |   43 ++
 include/fdtdec.h |1 +
 lib/fdtdec.c |1 +
 5 files changed, 61 insertions(+)

diff --git a/arch/arm/dts/exynos54xx.dtsi b/arch/arm/dts/exynos54xx.dtsi
index b9f8e0b..c21d798 100644
--- a/arch/arm/dts/exynos54xx.dtsi
+++ b/arch/arm/dts/exynos54xx.dtsi
@@ -113,6 +113,16 @@
status = disabled;
};
 
+   fimdm0_sysmmu@0x1464 {
+   compatible = samsung,sysmmu-v3.3;
+   reg = 0x1464 0x100;
+   };
+
+   fimdm1_sysmmu@0x1468 {
+   compatible = samsung,sysmmu-v3.3;
+   reg = 0x1468 0x100;
+   };
+
fimd@1440 {
/* sysmmu is not used in U-Boot */
samsung,disable-sysmmu;
diff --git a/doc/device-tree-bindings/video/exynos-fb.txt 
b/doc/device-tree-bindings/video/exynos-fb.txt
index bb7441c..dc4e44f 100644
--- a/doc/device-tree-bindings/video/exynos-fb.txt
+++ b/doc/device-tree-bindings/video/exynos-fb.txt
@@ -55,6 +55,12 @@ Board(panel specific):
samsung,pclk-name: parent clock identifier: 1(MPLL), 2(EPLL), 3(VPLL)
samsung,sclk-div: parent_clock/source_clock ratio
samsung,dual-lcd-enabled: 1 if you support two LCD, else 0
+   samsung,disable-sysmmu: Define this if you want to disable FIMD sysmmu.
+   (needed for Exynos5420 and newer versions)
+   Add the required FIMD sysmmu nodes to be
+   disabled with compatible string
+   samsung,sysmmu-v3.3, with a reg property
+   holding the register address of FIMD sysmmu.
 
 Example:
 SOC specific part:
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index cebbba7..f67fa81 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -251,6 +251,45 @@ void exynos_fimd_window_off(unsigned int win_id)
writel(cfg, fimd_ctrl-winshmap);
 }
 
+#ifdef CONFIG_OF_CONTROL
+/*
+* The reset value for FIMD SYSMMU register MMU_CTRL is 3
+* on Exynos5420 and newer versions.
+* This means FIMD SYSMMU is on by default on Exynos5420
+* and newer versions.
+* Since in u-boot we don't use SYSMMU, we should disable
+* those FIMD SYSMMU.
+* Note that there are 2 SYSMMU for FIMD: m0 and m1.
+* m0 handles windows 0 and 4, and m1 handles windows 1, 2 and 3.
+* We disable both of them here.
+*/
+void exynos_fimd_disable_sysmmu(void)
+{
+   u32 *sysmmufimd;
+   unsigned int node;
+   int node_list[2];
+   int count;
+   int i;
+
+   count = fdtdec_find_aliases_for_id(gd-fdt_blob, fimd,
+   COMPAT_SAMSUNG_EXYNOS_SYSMMU, node_list, 2);
+   for (i = 0; i  count; i++) {
+   node = node_list[i];
+   if (node = 0) {
+   debug(Can't get device node for fimd sysmmu\n);
+   return;
+   }
+
+   sysmmufimd = (u32 *)fdtdec_get_addr(gd-fdt_blob, node, reg);
+   if (!sysmmufimd) {
+   debug(Can't get base address for sysmmu fimdm0);
+   return;
+   }
+
+   writel(0x0, sysmmufimd);
+   }
+}
+#endif
 
 void exynos_fimd_lcd_init(vidinfo_t *vid)
 {
@@ -268,6 +307,10 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
node, reg);
if (fimd_ctrl == NULL)
debug(Can't get the FIMD base address\n);
+
+   if (fdtdec_get_bool(gd-fdt_blob, node, samsung,disable-sysmmu))
+   exynos_fimd_disable_sysmmu();
+
 #else
fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
 #endif
diff --git a/include/fdtdec.h b/include/fdtdec.h
index a7e6ee7..a583d68 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -94,6 +94,7 @@ enum fdt_compat_id {
COMPAT_SANDBOX_LCD_SDL, /* Sandbox LCD emulation with SDL */
COMPAT_TI_TPS65090, /* Texas Instrument TPS65090 */
COMPAT_NXP_PTN3460, /* NXP PTN3460 DP/LVDS bridge */
+   COMPAT_SAMSUNG_EXYNOS_SYSMMU,   /* Exynos sysmmu */
 
COMPAT_COUNT,
 };
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index aaa6620..64d2398 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -68,6 +68,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(SANDBOX_LCD_SDL, 

[U-Boot] [PATCH V4 7/9] exynos5420: add callbacks needed for exynos_fb driver

2014-07-30 Thread Ajay Kumar
Add initialization code for peach_pit panel, parade bridge chip,
and backlight.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 arch/arm/include/asm/arch-exynos/system.h |3 +
 board/samsung/smdk5420/smdk5420.c |  129 +++--
 2 files changed, 50 insertions(+), 82 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/system.h 
b/arch/arm/include/asm/arch-exynos/system.h
index 4968d3d..320763f 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -41,4 +41,7 @@ void set_usbhost_mode(unsigned int mode);
 void set_system_display_ctrl(void);
 int exynos_lcd_early_init(const void *blob);
 
+/* Initialize the Parade dP-LVDS bridge if present */
+int parade_init(const void *blob);
+
 #endif /* _EXYNOS4_SYSTEM_H */
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 183c522..270ee83 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -10,11 +10,14 @@
 #include i2c.h
 #include lcd.h
 #include spi.h
+#include errno.h
 #include asm/arch/board.h
 #include asm/arch/cpu.h
 #include asm/arch/gpio.h
 #include asm/arch/pinmux.h
+#include asm/arch/system.h
 #include asm/arch/dp_info.h
+#include power/tps65090_pmic.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -40,95 +43,57 @@ int exynos_init(void)
 }
 
 #ifdef CONFIG_LCD
-void cfg_lcd_gpio(void)
+static int has_edp_bridge(void)
 {
-   /* For Backlight */
-   gpio_cfg_pin(EXYNOS5420_GPIO_B20, S5P_GPIO_OUTPUT);
-   gpio_set_value(EXYNOS5420_GPIO_B20, 1);
+   int node;
+
+   node = fdtdec_next_compatible(gd-fdt_blob, 0, COMPAT_PARADE_PS8625);
 
-   /* LCD power on */
-   gpio_cfg_pin(EXYNOS5420_GPIO_X15, S5P_GPIO_OUTPUT);
-   gpio_set_value(EXYNOS5420_GPIO_X15, 1);
+   /* No node for bridge in device tree. */
+   if (node = 0)
+   return 0;
 
-   /* Set Hotplug detect for DP */
-   gpio_cfg_pin(EXYNOS5420_GPIO_X07, S5P_GPIO_FUNC(0x3));
+   /* Default is with bridge ic */
+   return 1;
 }
 
-vidinfo_t panel_info = {
-   .vl_freq= 60,
-   .vl_col = 2560,
-   .vl_row = 1600,
-   .vl_width   = 2560,
-   .vl_height  = 1600,
-   .vl_clkp= CONFIG_SYS_LOW,
-   .vl_hsp = CONFIG_SYS_LOW,
-   .vl_vsp = CONFIG_SYS_LOW,
-   .vl_dp  = CONFIG_SYS_LOW,
-   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
-
-   /* wDP panel timing infomation */
-   .vl_hspw= 32,
-   .vl_hbpd= 80,
-   .vl_hfpd= 48,
-
-   .vl_vspw= 6,
-   .vl_vbpd= 37,
-   .vl_vfpd= 3,
-   .vl_cmd_allow_len = 0xf,
-
-   .win_id = 3,
-   .cfg_gpio   = cfg_lcd_gpio,
-   .backlight_on   = NULL,
-   .lcd_power_on   = NULL,
-   .reset_lcd  = NULL,
-   .dual_lcd_enabled = 0,
-
-   .init_delay = 0,
-   .power_on_delay = 0,
-   .reset_delay= 0,
-   .interface_mode = FIMD_RGB_INTERFACE,
-   .dp_enabled = 1,
-};
-
-static struct edp_device_info edp_info = {
-   .disp_info = {
-   .h_res = 2560,
-   .h_sync_width = 32,
-   .h_back_porch = 80,
-   .h_front_porch = 48,
-   .v_res = 1600,
-   .v_sync_width  = 6,
-   .v_back_porch = 37,
-   .v_front_porch = 3,
-   .v_sync_rate = 60,
-   },
-   .lt_info = {
-   .lt_status = DP_LT_NONE,
-   },
-   .video_info = {
-   .master_mode = 0,
-   .bist_mode = DP_DISABLE,
-   .bist_pattern = NO_PATTERN,
-   .h_sync_polarity = 0,
-   .v_sync_polarity = 0,
-   .interlaced = 0,
-   .color_space = COLOR_RGB,
-   .dynamic_range = VESA,
-   .ycbcr_coeff = COLOR_YCBCR601,
-   .color_depth = COLOR_8,
-   },
-};
-
-static struct exynos_dp_platform_data dp_platform_data = {
-   .phy_enable = set_dp_phy_ctrl,
-   .edp_dev_info   = edp_info,
-};
-
-void init_panel_info(vidinfo_t *vid)
+void exynos_lcd_power_on(void)
 {
-   vid-rgb_mode   = MODE_RGB_P;
+   int ret;
+
+#ifdef CONFIG_POWER_TPS65090
+   ret = tps65090_init();
+   if (ret  0) {
+   printf(%s: tps65090_init() failed\n, __func__);
+   return;
+   }
+
+   tps65090_fet_enable(6);
+#endif
+
+   mdelay(5);
+
+   /* TODO(ajaykumar...@samsung.com): Use device tree */
+   gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
+   mdelay(10);
+   gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
+   gpio_direction_input(EXYNOS5420_GPIO_X26);  /* EDP_HPD */
+   gpio_set_pull(EXYNOS5420_GPIO_X26, 

[U-Boot] [PATCH V4 9/9] CONFIGS: peach-pit: Enable display for peach_pit board

2014-07-30 Thread Ajay Kumar
Enable drivers for FIMD, DP and parade bridge chip.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 include/configs/peach-pit.h |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index 76b8d7a..88c093f 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -22,4 +22,14 @@
 #define CONFIG_SYS_PROMPT  Peach # 
 #define CONFIG_IDENT_STRING for Peach
 
+#define CONFIG_VIDEO_PARADE
+
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPPLCD_COLOR16
+#endif
+
 #endif /* __CONFIG_PEACH_PIT_H */
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 8/9] ARM: exynos: peach_pit: Add DT nodes for fimd and parade bridge chip

2014-07-30 Thread Ajay Kumar
This patch adds DT properties for fimd and the parade bridge chip
present on peach_pit. The panel supports 1366x768 resolution.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 arch/arm/dts/exynos5420-peach-pit.dts |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/dts/exynos5420-peach-pit.dts 
b/arch/arm/dts/exynos5420-peach-pit.dts
index 8d148af..3ed70a8 100644
--- a/arch/arm/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/dts/exynos5420-peach-pit.dts
@@ -63,6 +63,11 @@
  reg = 0x20;
  compatible = maxim,max98090-codec;
   };
+
+   edp-lvds-bridge@48 {
+   compatible = parade,ps8625;
+   reg = 0x48;
+   };
};
 
 sound@383 {
@@ -124,4 +129,29 @@
xhci@1240 {
samsung,vbus-gpio = gpio 0x41 0; /* H01 */
};
+
+   fimd@1440 {
+   samsung,vl-freq = 60;
+   samsung,vl-col = 1366;
+   samsung,vl-row = 768;
+   samsung,vl-width = 1366;
+   samsung,vl-height = 768;
+
+   samsung,vl-clkp;
+   samsung,vl-dp;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 32;
+   samsung,vl-hbpd = 40;
+   samsung,vl-hfpd = 40;
+   samsung,vl-vspw = 6;
+   samsung,vl-vbpd = 10;
+   samsung,vl-vfpd = 12;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,winid = 3;
+   samsung,interface-mode = 1;
+   samsung,dp-enabled = 1;
+   samsung,dual-lcd-enabled = 0;
+   };
 };
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 3/9] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2014-07-30 Thread Ajay Kumar
Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by
exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/exynos/clock.c |   83 +++--
 arch/arm/cpu/armv7/exynos/exynos5_setup.h |2 +-
 arch/arm/include/asm/arch-exynos/clk.h|1 +
 3 files changed, 80 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index 400d134..c8be39b 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -82,7 +82,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, 
unsigned int k)
 * VPLL_CON: MIDV [24:16]
 * BPLL_CON: MIDV [25:16]: Exynos5
 */
-   if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
+   if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL ||
+   pllreg == SPLL)
mask = 0x3ff;
else
mask = 0x1ff;
@@ -391,6 +392,9 @@ static unsigned long exynos5420_get_pll_clk(int pllreg)
r = readl(clk-rpll_con0);
k = readl(clk-rpll_con1);
break;
+   case SPLL:
+   r = readl(clk-spll_con0);
+   break;
default:
printf(Unsupported PLL (%d)\n, pllreg);
return 0;
@@ -1027,6 +1031,40 @@ static unsigned long exynos5_get_lcd_clk(void)
return pclk;
 }
 
+static unsigned long exynos5420_get_lcd_clk(void)
+{
+   struct exynos5420_clock *clk =
+   (struct exynos5420_clock *)samsung_get_base_clock();
+   unsigned long pclk, sclk;
+   unsigned int sel;
+   unsigned int ratio;
+
+   /*
+* CLK_SRC_DISP10
+* FIMD1_SEL [4]
+* 0: SCLK_RPLL
+* 1: SCLK_SPLL
+*/
+   sel = readl(clk-src_disp10);
+   sel = (1  4);
+
+   if (sel)
+   sclk = get_pll_clk(SPLL);
+   else
+   sclk = get_pll_clk(RPLL);
+
+   /*
+* CLK_DIV_DISP10
+* FIMD1_RATIO [3:0]
+*/
+   ratio = readl(clk-div_disp10);
+   ratio = ratio  0xf;
+
+   pclk = sclk / (ratio + 1);
+
+   return pclk;
+}
+
 void exynos4_set_lcd_clk(void)
 {
struct exynos4_clock *clk =
@@ -1131,6 +1169,33 @@ void exynos5_set_lcd_clk(void)
clrsetbits_le32(clk-div_disp1_0, 0xf, 0x0);
 }
 
+void exynos5420_set_lcd_clk(void)
+{
+   struct exynos5420_clock *clk =
+   (struct exynos5420_clock *)samsung_get_base_clock();
+   unsigned int cfg;
+
+   /*
+* CLK_SRC_DISP10
+* FIMD1_SEL [4]
+* 0: SCLK_RPLL
+* 1: SCLK_SPLL
+*/
+   cfg = readl(clk-src_disp10);
+   cfg = ~(0x1  4);
+   cfg |= (0  4);
+   writel(cfg, clk-src_disp10);
+
+   /*
+* CLK_DIV_DISP10
+* FIMD1_RATIO  [3:0]
+*/
+   cfg = readl(clk-div_disp10);
+   cfg = ~(0xf  0);
+   cfg |= (0  0);
+   writel(cfg, clk-div_disp10);
+}
+
 void exynos4_set_mipi_clk(void)
 {
struct exynos4_clock *clk =
@@ -1602,16 +1667,24 @@ unsigned long get_lcd_clk(void)
 {
if (cpu_is_exynos4())
return exynos4_get_lcd_clk();
-   else
-   return exynos5_get_lcd_clk();
+   else {
+   if (proid_is_exynos5420())
+   return exynos5420_get_lcd_clk();
+   else
+   return exynos5_get_lcd_clk();
+   }
 }
 
 void set_lcd_clk(void)
 {
if (cpu_is_exynos4())
exynos4_set_lcd_clk();
-   else
-   exynos5_set_lcd_clk();
+   else {
+   if (proid_is_exynos5250())
+   exynos5_set_lcd_clk();
+   else if (proid_is_exynos5420())
+   exynos5420_set_lcd_clk();
+   }
 }
 
 void set_mipi_clk(void)
diff --git a/arch/arm/cpu/armv7/exynos/exynos5_setup.h 
b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
index 3242093..2eea48a 100644
--- a/arch/arm/cpu/armv7/exynos/exynos5_setup.h
+++ b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
@@ -783,7 +783,7 @@
 #define CLK_SRC_TOP2_VAL   0x11101000
 #define CLK_SRC_TOP3_VAL   0x
 #define CLK_SRC_TOP4_VAL   0x0111
-#define CLK_SRC_TOP5_VAL   0x1100
+#define CLK_SRC_TOP5_VAL   0x1101
 #define CLK_SRC_TOP6_VAL   0x0111
 #define CLK_SRC_TOP7_VAL   0x00022200
 
diff --git a/arch/arm/include/asm/arch-exynos/clk.h 
b/arch/arm/include/asm/arch-exynos/clk.h
index ffbc07e..db24dc0 100644
--- a/arch/arm/include/asm/arch-exynos/clk.h
+++ b/arch/arm/include/asm/arch-exynos/clk.h
@@ -15,6 +15,7 @@
 #define VPLL   4
 #define BPLL   5
 #define RPLL   6
+#define SPLL   7
 
 #define MASK_PRE_RATIO(x)  (0xff  ((x  4) + 8))
 #define MASK_RATIO(x)  (0xf  (x  

Re: [U-Boot] [PATCH v4 0/15] Kconfig for U-Boot

2014-07-30 Thread Masahiro Yamada
Hi Simon,


On Wed, 30 Jul 2014 10:08:53 +0100
Simon Glass s...@chromium.org wrote:

 Hi Masahiro,
 
 On 30 July 2014 09:27, Masahiro Yamada yamad...@jp.panasonic.com wrote:
  Hi Simon,
 
 
 
  On Mon, 28 Jul 2014 04:43:35 +0100
  Simon Glass s...@chromium.org wrote:
 
  Also some thoughts for the future:
 
  1. The 'menuconfig' option makes it obvious that we are dealing with
  U-Boot / SPL / TPL. Can we do the same for 'xconfig'?
 
 
  Sorry, I could not understand what you mean.
 
  In my rough understanding, 'menuconfig' and 'xconfig' are equivalent
  except the appearance of GUI.
 
  What is expactly supported in 'menuconfig' and missing in 'xconfig'?
 
 At the top with menuconfig it shows U-Boot, or SPL, or TPL so it is
 clear which one you are configuring. With xconfig I don't see the same
 thing. So when you are configuring SPL it is not clear that you are
 not in fact configuring the main  U-Boot.


Now I understood your question. Thanks.

As far as I tested, 'menuconfig' and 'nconfig' show which one
is being configured.

But I am afraid 'xconfig' and 'gconfig' don't.

Anyway, if we type 'make spl/xconfig', it means we are configuring for SPL.
It is clear enough, isn't it?



Best Regards
Masahiro Yamada

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


Re: [U-Boot] Implementing spl_start_uboot() for directly booting linux

2014-07-30 Thread Heshsham Abdul Basit
On 30 July 2014 13:56, Stefano Babic sba...@denx.de wrote:
 Hi Abdul,

 On 30/07/2014 10:21, Heshsham Abdul Basit wrote:
 Hello,

 I am trying to directly boot the kernel i.e without u-boot, on my
 Xilinx Zynq based microzed board.


 I understand that for that I must implement the function
 spl_start_uboot() in spl.c



 Right now the definition is:



 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
 /* boot linux */
 return 0;
 }
 #endif


 Given here:
 https://github.com/Xilinx/u-boot-xlnx/blob/2a0536fa48db1fc5332e3cd33b846d0da0c8bc1e/arch/arm/cpu/armv7/zynq/spl.c

 Anyway, you are not using mainline. Please stick with the sources on
 u-boot mainline to get help here.

OK.


 Can someone explain how to implement this function for directly
 booting the kernel?  Actually till now all the boards I have searched
 have not implemented this function,

 This means you have not deeply searched. Check for example
 board/technexion/twister/twister.c:


 int spl_start_uboot(void)
 {
 int val = 0;
 if (!gpio_request(SPL_OS_BOOT_KEY, U-Boot key)) {
 gpio_direction_input(SPL_OS_BOOT_KEY);
 val = gpio_get_value(SPL_OS_BOOT_KEY);
 gpio_free(SPL_OS_BOOT_KEY);
 }
 return val;
 }




Thanks.  I missed this.


 On this board, the decision which image to boot is taken by looking at a
 GPIO (switch on the board). Of course, you can implement the way you
 need based on your hardware.


Will give it a try.

 Best regards,
 Stefano Babic



Thanks.
 --
 =
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
 =
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/15] Kconfig for U-Boot

2014-07-30 Thread Simon Glass
Hi Masahiro,

On 30 July 2014 10:34, Masahiro Yamada yamad...@jp.panasonic.com wrote:
 Hi Simon,


 On Wed, 30 Jul 2014 10:08:53 +0100
 Simon Glass s...@chromium.org wrote:

 Hi Masahiro,

 On 30 July 2014 09:27, Masahiro Yamada yamad...@jp.panasonic.com wrote:
  Hi Simon,
 
 
 
  On Mon, 28 Jul 2014 04:43:35 +0100
  Simon Glass s...@chromium.org wrote:
 
  Also some thoughts for the future:
 
  1. The 'menuconfig' option makes it obvious that we are dealing with
  U-Boot / SPL / TPL. Can we do the same for 'xconfig'?
 
 
  Sorry, I could not understand what you mean.
 
  In my rough understanding, 'menuconfig' and 'xconfig' are equivalent
  except the appearance of GUI.
 
  What is expactly supported in 'menuconfig' and missing in 'xconfig'?

 At the top with menuconfig it shows U-Boot, or SPL, or TPL so it is
 clear which one you are configuring. With xconfig I don't see the same
 thing. So when you are configuring SPL it is not clear that you are
 not in fact configuring the main  U-Boot.


 Now I understood your question. Thanks.

 As far as I tested, 'menuconfig' and 'nconfig' show which one
 is being configured.

 But I am afraid 'xconfig' and 'gconfig' don't.

 Anyway, if we type 'make spl/xconfig', it means we are configuring for SPL.
 It is clear enough, isn't it?

I think it is OK. It is just a small suggestion.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 0/16] Introduce driver model serial uclass

2014-07-30 Thread Simon Glass
This series adds support for a serial uclass, enabling serial drivers to be
converted to use driver model.

Unfortunately this is quite a complicated process for a number of reasons:

- serial is used before relocation, but driver model does not support this
- stdio member functions are not passed a device pointer, but driver model
requires this (so does serial, but it uses an ugly work-around)
- driver model requires malloc() but this is not available before
  relocation
- for sandbox, if something goes wrong with the console, we still need to
  get an error message out through the fallback console

So this series relies on quite a few patches to address the above, as well
as the serial uclass and an implementation for sandbox.

If you have limited time, please take a look at least at the uclass patch
which is 'dm: Add a uclass for serial devices' (see include/serial.h).

With v3, exynos boards all build and an attempt has been made to add Tegra
support via the ns16550 driver. This is so-far untested but is offered for
review.

To see the current state of driver model, look at u-boot-dm.git branch
'working'.

Changes in v3:
- Add new change to enhance lists_bind_fdt()
- Add new patch for tegra serial port details
- Add new patch to collect common baud rate code in ns16550
- Add new patch to enable driver model for seial on tegra
- Add new patch to move baud rate calculation to ns16550.c
- Add new patch to support driver model in ns16550
- Add new patch to use V_NS16550_CLK only in SPL builds
- Automatically bind the console even if not marked for pre-relocation
- Avoid reordering functions
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'
- Fix typo in commit message

Changes in v2:
- Add exynos serial support
- Remove RFC status
- Rename struct device to struct udevice
- Split out core driver model patches into a separate set

Simon Glass (16):
  serial: Set up the 'priv' pointer when creating a serial device
  dm: Adjust lists_bind_fdt() to return the bound device
  dm: Add a uclass for serial devices
  Set up stdio earlier when using driver model
  sandbox: Convert serial driver to use driver model
  sandbox: serial: Support a coloured console
  sandbox: dts: Add a serial console node
  dm: exynos: Mark exynos5 console as pre-reloc
  dm: exynos: Move serial to driver model
  dm: Make driver model available before board_init()
  dm: serial: Move baud rate calculation to ns16550.c
  dm: serial: Collect common baud rate code in ns16550
  dm: serial: Add driver model support for ns16550
  tegra: dts: Add serial port details
  RFC: dm: tegra: Enable driver model for serial
  dm: tegra: Use V_NS16550_CLK only in SPL builds

 arch/arm/dts/exynos5.dtsi   |   1 +
 arch/arm/dts/tegra114-dalmore.dts   |   1 +
 arch/arm/dts/tegra114.dtsi  |  40 +
 arch/arm/dts/tegra124-jetson-tk1.dts|   1 +
 arch/arm/dts/tegra124-venice2.dts   |   1 +
 arch/arm/dts/tegra124.dtsi  |  40 +
 arch/arm/dts/tegra20-colibri_t20_iris.dts   |   1 +
 arch/arm/dts/tegra20-harmony.dts|   1 +
 arch/arm/dts/tegra20-medcom-wide.dts|   1 +
 arch/arm/dts/tegra20-paz00.dts  |   1 +
 arch/arm/dts/tegra20-plutux.dts |   1 +
 arch/arm/dts/tegra20-seaboard.dts   |   1 +
 arch/arm/dts/tegra20-tec.dts|   1 +
 arch/arm/dts/tegra20-trimslice.dts  |   1 +
 arch/arm/dts/tegra20-ventana.dts|   1 +
 arch/arm/dts/tegra20-whistler.dts   |   1 +
 arch/arm/dts/tegra20.dtsi   |  15 +-
 arch/arm/dts/tegra30-beaver.dts |   1 +
 arch/arm/dts/tegra30-cardhu.dts |   1 +
 arch/arm/dts/tegra30-tamonten.dtsi  |   1 +
 arch/arm/dts/tegra30.dtsi   |  40 +
 arch/sandbox/dts/sandbox.dts|  10 ++
 common/board_r.c|  19 ++-
 common/stdio.c  |  18 +-
 doc/device-tree-bindings/serial/ns16550.txt |  10 ++
 drivers/core/lists.c|  10 +-
 drivers/core/root.c |   2 +-
 drivers/serial/Makefile |   6 +-
 drivers/serial/ns16550.c| 224 +---
 drivers/serial/sandbox.c| 140 ---
 drivers/serial/serial-uclass.c  | 211 +++
 drivers/serial/serial.c |   1 +
 drivers/serial/serial_ns16550.c |  23 +--
 drivers/serial/serial_s5p.c | 255 
 include/configs/exynos-common.h |   1 +
 include/configs/sandbox.h   |   3 +
 include/configs/tegra-common.h  |   8 +-
 include/configs/tegra124-common.h   |   2 +
 include/configs/tegra20-common.h|   2 +
 include/configs/tegra30-common.h|   2 +
 include/dm/lists.h  |   6 +-
 include/dm/uclass-id.h   

[U-Boot] [PATCH v3 07/16] sandbox: dts: Add a serial console node

2014-07-30 Thread Simon Glass
If the sandbox device tree is provided to U-Boot (with the -d flag) then it
will use the device tree version in preference to the built-in device. The
only difference is the colour.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'

Changes in v2: None

 arch/sandbox/dts/sandbox.dts | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index efffacb..fd2b44b 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -1,6 +1,16 @@
 /dts-v1/;
 
 / {
+   aliases {
+   console = /serial;
+   };
+
+   uart0: serial {
+   compatible = sandbox,serial;
+   u-boot,dm-pre-reloc;
+   text-colour = cyan;
+   };
+
triangle {
compatible = demo-shape;
colour = cyan;
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 03/16] dm: Add a uclass for serial devices

2014-07-30 Thread Simon Glass
Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Automatically bind the console even if not marked for pre-relocation

Changes in v2:
- Rename struct device to struct udevice

 drivers/serial/Makefile|   4 +
 drivers/serial/serial-uclass.c | 211 +
 include/dm/uclass-id.h |   1 +
 include/serial.h   |  92 ++
 4 files changed, 308 insertions(+)
 create mode 100644 drivers/serial/serial-uclass.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 571c18f..4720e1d 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -5,7 +5,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef CONFIG_DM_SERIAL
+obj-y += serial-uclass.o
+else
 obj-y += serial.o
+endif
 
 obj-$(CONFIG_ALTERA_UART) += altera_uart.o
 obj-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
new file mode 100644
index 000..64e0c94
--- /dev/null
+++ b/drivers/serial/serial-uclass.c
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2014 The Chromium OS Authors.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include dm.h
+#include errno.h
+#include fdtdec.h
+#include os.h
+#include serial.h
+#include stdio_dev.h
+#include dm/lists.h
+#include dm/device-internal.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* The currently-selected console serial device */
+struct udevice *cur_dev __attribute__ ((section(.data)));
+
+#ifndef CONFIG_SYS_MALLOC_F_LEN
+#error Serial is required before relocation - define CONFIG_SYS_MALLOC_F_LEN 
to make this work
+#endif
+
+static void serial_find_console_or_panic(void)
+{
+   int node;
+
+   /* Check for a console alias */
+   node = fdtdec_get_alias_node(gd-fdt_blob, console);
+   if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, cur_dev))
+   return;
+
+   /*
+* If the console is not marked to be bound before relocation, bind
+* it anyway.
+*/
+   if (node  0 
+   !lists_bind_fdt(gd-dm_root, gd-fdt_blob, node, cur_dev)) {
+   if (!device_probe(cur_dev))
+   return;
+   cur_dev = NULL;
+   }
+
+   /*
+* Failing that, get the device with sequence number 0, or in extremis
+* just the first serial device we can find. But we insist on having
+* a console (even if it is silent).
+*/
+   if (uclass_get_device_by_seq(UCLASS_SERIAL, 0, cur_dev) 
+   (uclass_first_device(UCLASS_SERIAL, cur_dev) || !cur_dev))
+   panic(No serial driver found);
+}
+
+/* Called prior to relocation */
+int serial_init(void)
+{
+   serial_find_console_or_panic();
+   gd-flags |= GD_FLG_SERIAL_READY;
+
+   return 0;
+}
+
+/* Called after relocation */
+void serial_initialize(void)
+{
+   serial_find_console_or_panic();
+}
+
+void serial_putc(char ch)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+   int err;
+
+   do {
+   err = ops-putc(cur_dev, ch);
+   } while (err == -EAGAIN);
+   if (ch == '\n')
+   serial_putc('\r');
+}
+
+void serial_setbrg(void)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+
+   if (ops-setbrg)
+   ops-setbrg(cur_dev, gd-baudrate);
+}
+
+void serial_puts(const char *str)
+{
+   while (*str)
+   serial_putc(*str++);
+}
+
+int serial_tstc(void)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+
+   if (ops-pending)
+   return ops-pending(cur_dev, true);
+
+   return 1;
+}
+
+int serial_getc(void)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+   int err;
+
+   do {
+   err = ops-getc(cur_dev);
+   } while (err == -EAGAIN);
+
+   return err = 0 ? err : 0;
+}
+
+void serial_stdio_init(void)
+{
+}
+
+void serial_stub_putc(struct stdio_dev *sdev, const char ch)
+{
+   struct udevice *dev = sdev-priv;
+   struct dm_serial_ops *ops = serial_get_ops(dev);
+
+   ops-putc(dev, ch);
+}
+
+void serial_stub_puts(struct stdio_dev *sdev, const char *str)
+{
+   while (*str)
+   serial_stub_putc(sdev, *str++);
+}
+
+int serial_stub_getc(struct stdio_dev *sdev)
+{
+   struct udevice *dev = sdev-priv;
+   struct dm_serial_ops *ops = serial_get_ops(dev);
+
+   int err;
+
+   do {
+   err = ops-getc(dev);
+   } while (err == -EAGAIN);
+
+   return err = 0 ? err : 0;
+}
+
+int serial_stub_tstc(struct stdio_dev *sdev)
+{
+   struct udevice *dev = sdev-priv;
+   struct dm_serial_ops *ops = serial_get_ops(dev);
+
+   if (ops-pending)
+   return ops-pending(dev, 

[U-Boot] [PATCH v3 02/16] dm: Adjust lists_bind_fdt() to return the bound device

2014-07-30 Thread Simon Glass
Allow the caller to find out the device that was bound in response to this
call.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Add new change to enhance lists_bind_fdt()

Changes in v2: None

 drivers/core/lists.c | 10 +++---
 drivers/core/root.c  |  2 +-
 include/dm/lists.h   |  6 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 0f08bfd..699f94b 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -118,7 +118,8 @@ static int driver_check_compatible(const void *blob, int 
offset,
return -ENOENT;
 }
 
-int lists_bind_fdt(struct udevice *parent, const void *blob, int offset)
+int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
+  struct udevice **devp)
 {
struct driver *driver = ll_entry_start(struct driver, driver);
const int n_ents = ll_entry_count(struct driver, driver);
@@ -130,6 +131,8 @@ int lists_bind_fdt(struct udevice *parent, const void 
*blob, int offset)
int ret = 0;
 
dm_dbg(bind node %s\n, fdt_get_name(blob, offset, NULL));
+   if (devp)
+   *devp = NULL;
for (entry = driver; entry != driver + n_ents; entry++) {
ret = driver_check_compatible(blob, offset, entry-of_match);
name = fdt_get_name(blob, offset, NULL);
@@ -149,10 +152,11 @@ int lists_bind_fdt(struct udevice *parent, const void 
*blob, int offset)
ret = device_bind(parent, entry, name, NULL, offset, dev);
if (ret) {
dm_warn(Error binding driver '%s'\n, entry-name);
-   if (!result || ret != -ENOENT)
-   result = ret;
+   return ret;
} else {
found = true;
+   if (devp)
+   *devp = dev;
}
break;
}
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 393dd98..a328a48 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -91,7 +91,7 @@ int dm_scan_fdt_node(struct udevice *parent, const void 
*blob, int offset,
if (pre_reloc_only 
!fdt_getprop(blob, offset, u-boot,dm-pre-reloc, NULL))
continue;
-   err = lists_bind_fdt(parent, blob, offset);
+   err = lists_bind_fdt(parent, blob, offset, NULL);
if (err  !ret)
ret = err;
}
diff --git a/include/dm/lists.h b/include/dm/lists.h
index 87a3af5..2356895 100644
--- a/include/dm/lists.h
+++ b/include/dm/lists.h
@@ -53,7 +53,11 @@ int lists_bind_drivers(struct udevice *parent, bool 
pre_reloc_only);
  * @parent: parent driver (root)
  * @blob: device tree blob
  * @offset: offset of this device tree node
+ * @devp: if non-NULL, returns a pointer to the bound device
+ * @return 0 if device was bound, -EINVAL if the device tree is invalid,
+ * other -ve value on error
  */
-int lists_bind_fdt(struct udevice *parent, const void *blob, int offset);
+int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
+  struct udevice **devp);
 
 #endif
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 16/16] dm: tegra: Use V_NS16550_CLK only in SPL builds

2014-07-30 Thread Simon Glass
Since Tegra now uses driver model for serial, adjust the definition of
V_NS16550_CLK so that it is clear that this is only used for SPL.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Add new patch to use V_NS16550_CLK only in SPL builds

Changes in v2: None

 include/configs/tegra124-common.h | 2 ++
 include/configs/tegra20-common.h  | 2 ++
 include/configs/tegra30-common.h  | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/include/configs/tegra124-common.h 
b/include/configs/tegra124-common.h
index 61e5026..8c5842e 100644
--- a/include/configs/tegra124-common.h
+++ b/include/configs/tegra124-common.h
@@ -16,7 +16,9 @@
 /*
  * NS16550 Configuration
  */
+#ifdef CONFIG_SPL_BUILD
 #define V_NS16550_CLK  40800   /* 408MHz (pllp_out0) */
+#endif
 
 /* Environment information, boards can override if required */
 #define CONFIG_LOADADDR0x80408000  /* def. location for 
kernel */
diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
index 21bf977..4f8706a 100644
--- a/include/configs/tegra20-common.h
+++ b/include/configs/tegra20-common.h
@@ -22,7 +22,9 @@
 /*
  * NS16550 Configuration
  */
+#ifdef CONFIG_SPL_BUILD
 #define V_NS16550_CLK  21600   /* 216MHz (pllp_out0) */
+#endif
 
 /* Environment information, boards can override if required */
 #define CONFIG_LOADADDR0x00408000  /* def. location for 
kernel */
diff --git a/include/configs/tegra30-common.h b/include/configs/tegra30-common.h
index 443c842..6d2558c 100644
--- a/include/configs/tegra30-common.h
+++ b/include/configs/tegra30-common.h
@@ -21,7 +21,9 @@
 /*
  * NS16550 Configuration
  */
+#ifdef CONFIG_SPL_BUILD
 #define V_NS16550_CLK  40800   /* 408MHz (pllp_out0) */
+#endif
 
 /* Environment information, boards can override if required */
 #define CONFIG_LOADADDR0x80408000  /* def. location for 
kernel */
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 13/16] dm: serial: Add driver model support for ns16550

2014-07-30 Thread Simon Glass
Add driver model support so that ns16550 can support operation both with
and without driver model.

Add a suitable device tree binding also.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Add new patch to support driver model in ns16550

Changes in v2: None

 doc/device-tree-bindings/serial/ns16550.txt |  10 ++
 drivers/serial/Makefile |   2 +-
 drivers/serial/ns16550.c| 177 +++-
 include/ns16550.h   |  24 
 4 files changed, 210 insertions(+), 3 deletions(-)
 create mode 100644 doc/device-tree-bindings/serial/ns16550.txt

diff --git a/doc/device-tree-bindings/serial/ns16550.txt 
b/doc/device-tree-bindings/serial/ns16550.txt
new file mode 100644
index 000..ef0b9ae
--- /dev/null
+++ b/doc/device-tree-bindings/serial/ns16550.txt
@@ -0,0 +1,10 @@
+NS16550 UART
+
+This UART driver supports many chip variants and is used in mamy SoCs.
+
+Required properties:
+- compatible: ns16550 or nvidia,tegra20-uart
+- reg: start address and size of registers
+- reg-shift: shift value indicating register size: 0=byte, 1=16bit,2=32bit etc.
+- clock-frequency: input clock frequency for the UART (used to calculate the
+baud rate divisor)
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 4720e1d..5ae6416 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -9,6 +9,7 @@ ifdef CONFIG_DM_SERIAL
 obj-y += serial-uclass.o
 else
 obj-y += serial.o
+obj-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o
 endif
 
 obj-$(CONFIG_ALTERA_UART) += altera_uart.o
@@ -20,7 +21,6 @@ obj-$(CONFIG_MCFUART) += mcfuart.o
 obj-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
 obj-$(CONFIG_SYS_NS16550) += ns16550.o
 obj-$(CONFIG_S5P) += serial_s5p.o
-obj-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o
 obj-$(CONFIG_IMX_SERIAL) += serial_imx.o
 obj-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
 obj-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 9373c8d..c07a58c 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -5,17 +5,25 @@
  */
 
 #include common.h
+#include dm.h
+#include errno.h
+#include fdtdec.h
 #include ns16550.h
+#include serial.h
 #include watchdog.h
 #include linux/types.h
 #include asm/io.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define UART_LCRVAL UART_LCR_8N1   /* 8 data, 1 stop, no parity */
 #define UART_MCRVAL (UART_MCR_DTR | \
 UART_MCR_RTS)  /* RTS/DTR */
 #define UART_FCRVAL (UART_FCR_FIFO_EN |\
 UART_FCR_RXSR |\
 UART_FCR_TXSR) /* Clear  enable FIFOs */
+
+#ifndef CONFIG_DM_SERIAL
 #ifdef CONFIG_SYS_NS16550_PORT_MAPPED
 #define serial_out(x, y)   outb(x, (ulong)y)
 #define serial_in(y)   inb((ulong)y)
@@ -29,6 +37,7 @@
 #define serial_out(x, y)   writeb(x, y)
 #define serial_in(y)   readb(y)
 #endif
+#endif /* !CONFIG_DM_SERIAL */
 
 #if defined(CONFIG_K2HK_EVM)
 #define UART_REG_VAL_PWREMU_MGMT_UART_DISABLE   0
@@ -45,6 +54,58 @@
 #define CONFIG_SYS_NS16550_IER  0x00
 #endif /* CONFIG_SYS_NS16550_IER */
 
+#ifdef CONFIG_DM_SERIAL
+void ns16550_writeb(NS16550_t port, int offset, int value)
+{
+   struct ns16550_platdata *plat = port-plat;
+   unsigned char *addr;
+
+   offset *= 1  plat-reg_shift;
+   addr = plat-base + offset;
+   /*
+* As far as we know it doesn't make sense to support selection of
+* these options at run-time, so use the existing CONFIG options.
+*/
+#ifdef CONFIG_SYS_NS16550_PORT_MAPPED
+   outb(value, addr);
+#elif defined(CONFIG_SYS_NS16550_MEM32)  !defined(CONFIG_SYS_BIG_ENDIAN)
+   out_le32(addr, value);
+#elif defined(CONFIG_SYS_NS16550_MEM32)  defined(CONFIG_SYS_BIG_ENDIAN)
+   out_be32(addr, value);
+#elif defined(CONFIG_SYS_BIG_ENDIAN)
+   writeb(value, addr + (1  plat-reg_shift) - 1);
+#else
+   writeb(value, addr);
+#endif
+}
+
+int ns16550_readb(NS16550_t port, int offset)
+{
+   struct ns16550_platdata *plat = port-plat;
+   unsigned char *addr;
+
+   offset *= 1  plat-reg_shift;
+   addr = plat-base + offset;
+#ifdef CONFIG_SYS_NS16550_PORT_MAPPED
+   return inb(addr);
+#elif defined(CONFIG_SYS_NS16550_MEM32)  !defined(CONFIG_SYS_BIG_ENDIAN)
+   return in_le32(addr);
+#elif defined(CONFIG_SYS_NS16550_MEM32)  defined(CONFIG_SYS_BIG_ENDIAN)
+   return in_be32(addr);
+#elif defined(CONFIG_SYS_BIG_ENDIAN)
+   return readb(addr + (1  plat-reg_shift) - 1);
+#else
+   return readb(addr);
+#endif
+}
+
+/* We can clean these up once everything is moved to driver model */
+#define serial_out(value, addr)\
+   ns16550_writeb(com_port, addr - (unsigned char *)com_port, value)
+#define serial_in(addr) \
+   ns16550_readb(com_port, addr - (unsigned char *)com_port)
+#endif
+
 int ns16550_calc_divisor(NS16550_t port, int clock, int baudrate)

[U-Boot] [PATCH v3 04/16] Set up stdio earlier when using driver model

2014-07-30 Thread Simon Glass
Since driver model registers itself with the stdio subsystem, and we
want to avoid delayed registration and other complexity associated with
the current serial console, move the stdio subsystem init earlier when
driver model is used for serial.

This simplifies the implementation. Should there be any problems with
this approach they can be dealt with as boards are converted over to
use driver model for serial.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 common/board_r.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 8e7a3ac..2eed569 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -726,6 +726,15 @@ init_fnc_t init_sequence_r[] = {
set_cpu_clk_info, /* Setup clock information */
 #endif
initr_reloc_global_data,
+   initr_barrier,
+   initr_malloc,
+   bootstage_relocate,
+#ifdef CONFIG_DM_SERIAL
+   stdio_init,
+#endif
+#ifdef CONFIG_DM
+   initr_dm,
+#endif
initr_serial,
initr_announce,
INIT_FUNC_WATCHDOG_RESET
@@ -762,12 +771,6 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_WINBOND_83C553
initr_w83c553f,
 #endif
-   initr_barrier,
-   initr_malloc,
-   bootstage_relocate,
-#ifdef CONFIG_DM
-   initr_dm,
-#endif
 #ifdef CONFIG_ARCH_EARLY_INIT_R
arch_early_init_r,
 #endif
@@ -817,7 +820,9 @@ init_fnc_t init_sequence_r[] = {
 */
initr_pci,
 #endif
+#ifndef CONFIG_DM_SERIAL
stdio_init,
+#endif
initr_jumptable,
 #ifdef CONFIG_API
initr_api,
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 05/16] sandbox: Convert serial driver to use driver model

2014-07-30 Thread Simon Glass
Adjust the sandbox serial driver to use the new driver model uclass. The
driver works much as before, but within the new framework.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Rename struct device to struct udevice

 drivers/serial/sandbox.c  | 67 +--
 include/configs/sandbox.h |  3 +++
 2 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index 51fd871..ac54e01 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -11,12 +11,16 @@
  */
 
 #include common.h
+#include dm.h
+#include fdtdec.h
 #include lcd.h
 #include os.h
 #include serial.h
 #include linux/compiler.h
 #include asm/state.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  *
  *   serial_buf: A buffer that holds keyboard characters for the
@@ -30,27 +34,21 @@ static char serial_buf[16];
 static unsigned int serial_buf_write;
 static unsigned int serial_buf_read;
 
-static int sandbox_serial_init(void)
+static int sandbox_serial_probe(struct udevice *dev)
 {
struct sandbox_state *state = state_get_current();
 
if (state-term_raw != STATE_TERM_COOKED)
os_tty_raw(0, state-term_raw == STATE_TERM_RAW_WITH_SIGS);
-   return 0;
-}
 
-static void sandbox_serial_setbrg(void)
-{
+   return 0;
 }
 
-static void sandbox_serial_putc(const char ch)
+static int sandbox_serial_putc(struct udevice *dev, const char ch)
 {
os_write(1, ch, 1);
-}
 
-static void sandbox_serial_puts(const char *str)
-{
-   os_write(1, str, strlen(str));
+   return 0;
 }
 
 static unsigned int increment_buffer_index(unsigned int index)
@@ -58,12 +56,15 @@ static unsigned int increment_buffer_index(unsigned int 
index)
return (index + 1) % ARRAY_SIZE(serial_buf);
 }
 
-static int sandbox_serial_tstc(void)
+static int sandbox_serial_pending(struct udevice *dev, bool input)
 {
const unsigned int next_index =
increment_buffer_index(serial_buf_write);
ssize_t count;
 
+   if (!input)
+   return 0;
+
os_usleep(100);
 #ifdef CONFIG_LCD
lcd_sync();
@@ -74,38 +75,42 @@ static int sandbox_serial_tstc(void)
count = os_read_no_block(0, serial_buf[serial_buf_write], 1);
if (count == 1)
serial_buf_write = next_index;
+
return serial_buf_write != serial_buf_read;
 }
 
-static int sandbox_serial_getc(void)
+static int sandbox_serial_getc(struct udevice *dev)
 {
int result;
 
-   while (!sandbox_serial_tstc())
-   ;   /* buffer empty */
+   if (!sandbox_serial_pending(dev, true))
+   return -EAGAIN; /* buffer empty */
 
result = serial_buf[serial_buf_read];
serial_buf_read = increment_buffer_index(serial_buf_read);
return result;
 }
 
-static struct serial_device sandbox_serial_drv = {
-   .name   = sandbox_serial,
-   .start  = sandbox_serial_init,
-   .stop   = NULL,
-   .setbrg = sandbox_serial_setbrg,
-   .putc   = sandbox_serial_putc,
-   .puts   = sandbox_serial_puts,
-   .getc   = sandbox_serial_getc,
-   .tstc   = sandbox_serial_tstc,
+static const struct dm_serial_ops sandbox_serial_ops = {
+   .putc = sandbox_serial_putc,
+   .pending = sandbox_serial_pending,
+   .getc = sandbox_serial_getc,
 };
 
-void sandbox_serial_initialize(void)
-{
-   serial_register(sandbox_serial_drv);
-}
+static const struct udevice_id sandbox_serial_ids[] = {
+   { .compatible = sandbox,serial },
+   { }
+};
 
-__weak struct serial_device *default_serial_console(void)
-{
-   return sandbox_serial_drv;
-}
+U_BOOT_DRIVER(serial_sandbox) = {
+   .name   = serial_sandbox,
+   .id = UCLASS_SERIAL,
+   .of_match = sandbox_serial_ids,
+   .probe = sandbox_serial_probe,
+   .ops= sandbox_serial_ops,
+   .flags = DM_FLAG_PRE_RELOC,
+};
+
+U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
+   .name = serial_sandbox,
+};
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index bf2d25c..f5fa4b3 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -31,6 +31,9 @@
 #define CONFIG_DM_DEMO_SHAPE
 #define CONFIG_DM_GPIO
 #define CONFIG_DM_TEST
+#define CONFIG_DM_SERIAL
+
+#define CONFIG_SYS_STDIO_DEREGISTER
 
 /* Number of bits in a C 'long' on this architecture */
 #define CONFIG_SANDBOX_BITS_PER_LONG   64
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 08/16] dm: exynos: Mark exynos5 console as pre-reloc

2014-07-30 Thread Simon Glass
We will need the console before relocation, so mark it that way.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'

Changes in v2: None

 arch/arm/dts/exynos5.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/exynos5.dtsi b/arch/arm/dts/exynos5.dtsi
index dc5405b..e539068 100644
--- a/arch/arm/dts/exynos5.dtsi
+++ b/arch/arm/dts/exynos5.dtsi
@@ -244,6 +244,7 @@
compatible = samsung,exynos4210-uart;
reg = 0x12C3 0x100;
interrupts = 0 54 0;
+   u-boot,dm-pre-reloc;
id = 3;
};
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 11/16] dm: serial: Move baud rate calculation to ns16550.c

2014-07-30 Thread Simon Glass
Move the function that calculates the baud rate divisor into ns16550.c so
it can be used by that file.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Add new patch to move baud rate calculation to ns16550.c

Changes in v2: None

 drivers/serial/ns16550.c| 18 +-
 drivers/serial/serial_ns16550.c | 23 ---
 include/ns16550.h   | 13 +
 3 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index f26979d..056210e 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -4,7 +4,7 @@
  * modified to use CONFIG_SYS_ISA_MEM and new defines
  */
 
-#include config.h
+#include common.h
 #include ns16550.h
 #include watchdog.h
 #include linux/types.h
@@ -45,6 +45,22 @@
 #define CONFIG_SYS_NS16550_IER  0x00
 #endif /* CONFIG_SYS_NS16550_IER */
 
+int ns16550_calc_divisor(NS16550_t port, int clock, int baudrate)
+{
+   const unsigned int mode_x_div = 16;
+
+#ifdef CONFIG_OMAP1510
+   /* If can't cleanly clock 115200 set div to 1 */
+   if ((clock == 1200)  (baudrate == 115200)) {
+   port-osc_12m_sel = OSC_12M_SEL;  /* enable 6.5 * divisor */
+   return 1;   /* return 1 for base divisor */
+   }
+   port-osc_12m_sel = 0;  /* clear if previsouly set */
+#endif
+
+   return DIV_ROUND_CLOSEST(clock, mode_x_div * baudrate);
+}
+
 void NS16550_init(NS16550_t com_port, int baud_divisor)
 {
 #if (defined(CONFIG_SPL_BUILD)  defined(CONFIG_OMAP34XX))
diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index 4413e69..632da4c 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -81,7 +81,8 @@ static NS16550_t serial_ports[6] = {
static int  eserial##port##_init(void) \
{ \
int clock_divisor; \
-   clock_divisor = calc_divisor(serial_ports[port-1]); \
+   clock_divisor = ns16550_calc_divisor(serial_ports[port-1], \
+   CONFIG_SYS_NS16550_CLK, gd-baudrate); \
NS16550_init(serial_ports[port-1], clock_divisor); \
return 0 ; \
} \
@@ -118,23 +119,6 @@ static NS16550_t serial_ports[6] = {
.puts   = eserial##port##_puts, \
 }
 
-static int calc_divisor (NS16550_t port)
-{
-   const unsigned int mode_x_div = 16;
-
-#ifdef CONFIG_OMAP1510
-   /* If can't cleanly clock 115200 set div to 1 */
-   if ((CONFIG_SYS_NS16550_CLK == 1200)  (gd-baudrate == 115200)) {
-   port-osc_12m_sel = OSC_12M_SEL;/* enable 6.5 * divisor 
*/
-   return (1); /* return 1 for base 
divisor */
-   }
-   port-osc_12m_sel = 0;  /* clear if previsouly set */
-#endif
-
-   return DIV_ROUND_CLOSEST(CONFIG_SYS_NS16550_CLK,
-   mode_x_div * gd-baudrate);
-}
-
 void
 _serial_putc(const char c,const int port)
 {
@@ -176,7 +160,8 @@ _serial_setbrg (const int port)
 {
int clock_divisor;
 
-   clock_divisor = calc_divisor(PORT);
+   clock_divisor = ns16550_calc_divisor(PORT, CONFIG_SYS_NS16550_CLK,
+gd-baudrate);
NS16550_reinit(PORT, clock_divisor);
 }
 
diff --git a/include/ns16550.h b/include/ns16550.h
index 17f829f..b106f8a 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -177,3 +177,16 @@ void NS16550_putc(NS16550_t com_port, char c);
 char NS16550_getc(NS16550_t com_port);
 int NS16550_tstc(NS16550_t com_port);
 void NS16550_reinit(NS16550_t com_port, int baud_divisor);
+
+/**
+ * ns16550_calc_divisor() - calculate the divisor given clock and baud rate
+ *
+ * Given the UART input clock and required baudrate, calculate the divisor
+ * that should be used.
+ *
+ * @port:  UART port
+ * @clock: UART input clock speed in Hz
+ * @baudrate:  Required baud rate
+ * @return baud rate divisor that should be used
+ */
+int ns16550_calc_divisor(NS16550_t port, int clock, int baudrate);
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 14/16] tegra: dts: Add serial port details

2014-07-30 Thread Simon Glass
Some Tegra device tree files do not include information about the serial
ports. Add this and also add information about the input clock speed.

The console alias needs to be set up to indicate which port is used for
the console.

Also add a binding file since this is missing.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Add new patch for tegra serial port details

Changes in v2: None

 arch/arm/dts/tegra114-dalmore.dts |  1 +
 arch/arm/dts/tegra114.dtsi| 40 +++
 arch/arm/dts/tegra124-jetson-tk1.dts  |  1 +
 arch/arm/dts/tegra124-venice2.dts |  1 +
 arch/arm/dts/tegra124.dtsi| 40 +++
 arch/arm/dts/tegra20-colibri_t20_iris.dts |  1 +
 arch/arm/dts/tegra20-harmony.dts  |  1 +
 arch/arm/dts/tegra20-medcom-wide.dts  |  1 +
 arch/arm/dts/tegra20-paz00.dts|  1 +
 arch/arm/dts/tegra20-plutux.dts   |  1 +
 arch/arm/dts/tegra20-seaboard.dts |  1 +
 arch/arm/dts/tegra20-tec.dts  |  1 +
 arch/arm/dts/tegra20-trimslice.dts|  1 +
 arch/arm/dts/tegra20-ventana.dts  |  1 +
 arch/arm/dts/tegra20-whistler.dts |  1 +
 arch/arm/dts/tegra20.dtsi | 15 
 arch/arm/dts/tegra30-beaver.dts   |  1 +
 arch/arm/dts/tegra30-cardhu.dts   |  1 +
 arch/arm/dts/tegra30-tamonten.dtsi|  1 +
 arch/arm/dts/tegra30.dtsi | 40 +++
 20 files changed, 146 insertions(+), 5 deletions(-)

diff --git a/arch/arm/dts/tegra114-dalmore.dts 
b/arch/arm/dts/tegra114-dalmore.dts
index 435c01e..e2426ef 100644
--- a/arch/arm/dts/tegra114-dalmore.dts
+++ b/arch/arm/dts/tegra114-dalmore.dts
@@ -7,6 +7,7 @@
compatible = nvidia,dalmore, nvidia,tegra114;
 
aliases {
+   console = uart_d;
i2c0 = /i2c@7000d000;
i2c1 = /i2c@7000c000;
i2c2 = /i2c@7000c400;
diff --git a/arch/arm/dts/tegra114.dtsi b/arch/arm/dts/tegra114.dtsi
index 59434e0..f8d740b 100644
--- a/arch/arm/dts/tegra114.dtsi
+++ b/arch/arm/dts/tegra114.dtsi
@@ -116,6 +116,46 @@
status = disabled;
};
 
+   uart_a: serial@70006000 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006000 0x40;
+   reg-shift = 2;
+   clock-frequency = 40800;
+   interrupts =  68 ;
+   };
+
+   uart_b: serial@70006040 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006040 0x40;
+   reg-shift = 2;
+   clock-frequency = 40800;
+   interrupts =  69 ;
+   };
+
+   uart_c: serial@70006200 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006200 0x100;
+   reg-shift = 2;
+   clock-frequency = 40800;
+   interrupts =  78 ;
+   };
+
+   uart_d: serial@70006300 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006300 0x100;
+   reg-shift = 2;
+   clock-frequency = 40800;
+   interrupts =  122 ;
+   };
+
+   uart_e: serial@70006400 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006400 0x100;
+   reg-shift = 2;
+   clock-frequency = 40800;
+   interrupts =  123 ;
+   };
+
spi@7000d400 {
compatible = nvidia,tegra114-spi;
reg = 0x7000d400 0x200;
diff --git a/arch/arm/dts/tegra124-jetson-tk1.dts 
b/arch/arm/dts/tegra124-jetson-tk1.dts
index 464287e..368caaa 100644
--- a/arch/arm/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/dts/tegra124-jetson-tk1.dts
@@ -7,6 +7,7 @@
compatible = nvidia,jetson-tk1, nvidia,tegra124;
 
aliases {
+   console = uart_d;
i2c0 = /i2c@7000d000;
i2c1 = /i2c@7000c000;
i2c2 = /i2c@7000c400;
diff --git a/arch/arm/dts/tegra124-venice2.dts 
b/arch/arm/dts/tegra124-venice2.dts
index f003413..155 100644
--- a/arch/arm/dts/tegra124-venice2.dts
+++ b/arch/arm/dts/tegra124-venice2.dts
@@ -7,6 +7,7 @@
compatible = nvidia,venice2, nvidia,tegra124;
 
aliases {
+   console = uart_a;
i2c0 = /i2c@7000d000;
i2c1 = /i2c@7000c000;
i2c2 = /i2c@7000c400;
diff --git a/arch/arm/dts/tegra124.dtsi b/arch/arm/dts/tegra124.dtsi
index 4561c5f..5037036 100644
--- a/arch/arm/dts/tegra124.dtsi
+++ b/arch/arm/dts/tegra124.dtsi
@@ -126,6 +126,46 @@
status = disabled;
};
 
+   uart_a: serial@70006000 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006000 0x40;
+   reg-shift = 2;
+   clock-frequency = 40800;
+   interrupts =  68 ;
+   };
+
+   uart_b: serial@70006040 {
+   

[U-Boot] [PATCH v3 06/16] sandbox: serial: Support a coloured console

2014-07-30 Thread Simon Glass
The current sandbox serial driver is a pretty trivial example and does not
have the featues that might be needed for other board serial drivers. To
help provide a better example, add a text colour property to the device
tree for sandbox. This uses platform data, a device tree node, driver
private data and a remove() method.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Rename struct device to struct udevice

 drivers/serial/sandbox.c | 83 
 1 file changed, 83 insertions(+)

diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index ac54e01..9139104 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -34,19 +34,67 @@ static char serial_buf[16];
 static unsigned int serial_buf_write;
 static unsigned int serial_buf_read;
 
+struct sandbox_serial_platdata {
+   int colour; /* Text colour to use for output, -1 for none */
+};
+
+struct sandbox_serial_priv {
+   bool start_of_line;
+};
+
+/**
+ * output_ansi_colour() - Output an ANSI colour code
+ *
+ * @colour: Colour to output (0-7)
+ */
+static void output_ansi_colour(int colour)
+{
+   char ansi_code[] = \x1b[1;3Xm;
+
+   ansi_code[5] = '0' + colour;
+   os_write(1, ansi_code, sizeof(ansi_code) - 1);
+}
+
+static void output_ansi_reset(void)
+{
+   os_write(1, \x1b[0m, 4);
+}
+
 static int sandbox_serial_probe(struct udevice *dev)
 {
struct sandbox_state *state = state_get_current();
+   struct sandbox_serial_priv *priv = dev_get_priv(dev);
 
if (state-term_raw != STATE_TERM_COOKED)
os_tty_raw(0, state-term_raw == STATE_TERM_RAW_WITH_SIGS);
+   priv-start_of_line = 0;
+
+   return 0;
+}
+
+static int sandbox_serial_remove(struct udevice *dev)
+{
+   struct sandbox_serial_platdata *plat = dev-platdata;
+
+   if (plat-colour != -1)
+   output_ansi_reset();
 
return 0;
 }
 
 static int sandbox_serial_putc(struct udevice *dev, const char ch)
 {
+   struct sandbox_serial_priv *priv = dev_get_priv(dev);
+   struct sandbox_serial_platdata *plat = dev-platdata;
+
+   if (priv-start_of_line  plat-colour != -1) {
+   priv-start_of_line = false;
+   output_ansi_colour(plat-colour);
+   }
+
os_write(1, ch, 1);
+   if (ch == '\n')
+   priv-start_of_line = true;
 
return 0;
 }
@@ -91,6 +139,32 @@ static int sandbox_serial_getc(struct udevice *dev)
return result;
 }
 
+static const char * const ansi_colour[] = {
+   black, red, green, yellow, blue, megenta, cyan,
+   white,
+};
+
+static int sandbox_serial_ofdata_to_platdata(struct udevice *dev)
+{
+   struct sandbox_serial_platdata *plat = dev-platdata;
+   const char *colour;
+   int i;
+
+   plat-colour = -1;
+   colour = fdt_getprop(gd-fdt_blob, dev-of_offset, text-colour,
+NULL);
+   if (colour) {
+   for (i = 0; i  ARRAY_SIZE(ansi_colour); i++) {
+   if (!strcmp(colour, ansi_colour[i])) {
+   plat-colour = i;
+   break;
+   }
+   }
+   }
+
+   return 0;
+}
+
 static const struct dm_serial_ops sandbox_serial_ops = {
.putc = sandbox_serial_putc,
.pending = sandbox_serial_pending,
@@ -106,11 +180,20 @@ U_BOOT_DRIVER(serial_sandbox) = {
.name   = serial_sandbox,
.id = UCLASS_SERIAL,
.of_match = sandbox_serial_ids,
+   .ofdata_to_platdata = sandbox_serial_ofdata_to_platdata,
+   .platdata_auto_alloc_size = sizeof(struct sandbox_serial_platdata),
+   .priv_auto_alloc_size = sizeof(struct sandbox_serial_priv),
.probe = sandbox_serial_probe,
+   .remove = sandbox_serial_remove,
.ops= sandbox_serial_ops,
.flags = DM_FLAG_PRE_RELOC,
 };
 
+static const struct sandbox_serial_platdata platdata_non_fdt = {
+   .colour = -1,
+};
+
 U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
.name = serial_sandbox,
+   .platdata = platdata_non_fdt,
 };
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 01/16] serial: Set up the 'priv' pointer when creating a serial device

2014-07-30 Thread Simon Glass
The stdio_dev structure has a private pointer for its creator, but it is
not set up by the serial system. Set it to point to the serial device so
that it can be found by code called by stdio.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Fix typo in commit message

Changes in v2: None

 drivers/serial/serial.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index d2eb752..bbe60af 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -320,6 +320,7 @@ void serial_stdio_init(void)
dev.puts = serial_stub_puts;
dev.getc = serial_stub_getc;
dev.tstc = serial_stub_tstc;
+   dev.priv = s;
 
stdio_register(dev);
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 10/16] dm: Make driver model available before board_init()

2014-07-30 Thread Simon Glass
For some boards board_init() will change GPIOs, so we need to have driver
model available before then. Adjust the board init to arrange this, but
enable it for driver model only, just to be safe.

This does create additional #ifdef logic, but it is safer than trying to
make a pervasive change which may cause some boards to break.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Add exynos serial support
- Remove RFC status
- Split out core driver model patches into a separate set

 common/board_r.c| 24 +++-
 common/stdio.c  | 18 --
 include/stdio_dev.h | 24 +++-
 3 files changed, 50 insertions(+), 16 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 2eed569..e98ac9c 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -714,6 +714,15 @@ init_fnc_t init_sequence_r[] = {
/* TODO: could x86/PPC have this also perhaps? */
 #ifdef CONFIG_ARM
initr_caches,
+#endif
+   initr_reloc_global_data,
+   initr_barrier,
+   initr_malloc,
+   bootstage_relocate,
+#ifdef CONFIG_DM
+   initr_dm,
+#endif
+#ifdef CONFIG_ARM
board_init, /* Setup chipselects */
 #endif
/*
@@ -725,16 +734,7 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_CLOCKS
set_cpu_clk_info, /* Setup clock information */
 #endif
-   initr_reloc_global_data,
-   initr_barrier,
-   initr_malloc,
-   bootstage_relocate,
-#ifdef CONFIG_DM_SERIAL
-   stdio_init,
-#endif
-#ifdef CONFIG_DM
-   initr_dm,
-#endif
+   stdio_init_tables,
initr_serial,
initr_announce,
INIT_FUNC_WATCHDOG_RESET
@@ -820,9 +820,7 @@ init_fnc_t init_sequence_r[] = {
 */
initr_pci,
 #endif
-#ifndef CONFIG_DM_SERIAL
-   stdio_init,
-#endif
+   stdio_add_devices,
initr_jumptable,
 #ifdef CONFIG_API
initr_api,
diff --git a/common/stdio.c b/common/stdio.c
index 692ca7f..c878103 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -215,7 +215,7 @@ int stdio_deregister(const char *devname)
 }
 #endif /* CONFIG_SYS_STDIO_DEREGISTER */
 
-int stdio_init (void)
+int stdio_init_tables(void)
 {
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
/* already relocated for current ARM implementation */
@@ -232,6 +232,11 @@ int stdio_init (void)
/* Initialize the list */
INIT_LIST_HEAD((devs.list));
 
+   return 0;
+}
+
+int stdio_add_devices(void)
+{
 #ifdef CONFIG_SYS_I2C
i2c_init_all();
 #else
@@ -265,5 +270,14 @@ int stdio_init (void)
 #ifdef CONFIG_CBMEM_CONSOLE
cbmemc_init();
 #endif
-   return (0);
+
+   return 0;
+}
+
+int stdio_init(void)
+{
+   stdio_init_tables();
+   stdio_add_devices();
+
+   return 0;
 }
diff --git a/include/stdio_dev.h b/include/stdio_dev.h
index a7d0825..268de8e 100644
--- a/include/stdio_dev.h
+++ b/include/stdio_dev.h
@@ -78,7 +78,29 @@ extern char *stdio_names[MAX_FILES];
  */
 intstdio_register (struct stdio_dev * dev);
 int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp);
-intstdio_init (void);
+
+/**
+ * stdio_init_tables() - set up stdio tables ready for devices
+ *
+ * This does not add any devices, but just prepares stdio for use.
+ */
+int stdio_init_tables(void);
+
+/**
+ * stdio_add_devices() - Add stdio devices to the table
+ *
+ * This makes calls to all the various subsystems that use stdio, to make
+ * them register with stdio.
+ */
+int stdio_add_devices(void);
+
+/**
+ * stdio_init() - Sets up stdio ready for use
+ *
+ * This calls stdio_init_tables() and stdio_add_devices()
+ */
+int stdio_init(void);
+
 void   stdio_print_current_devices(void);
 #ifdef CONFIG_SYS_STDIO_DEREGISTER
 intstdio_deregister(const char *devname);
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 15/16] RFC: dm: tegra: Enable driver model for serial

2014-07-30 Thread Simon Glass
Use driver model for serial ports (for test and comment only).

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Add new patch to enable driver model for seial on tegra

Changes in v2: None

 include/configs/tegra-common.h | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 6eb0dd9..e0779f1 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -22,6 +22,9 @@
 #define CONFIG_DM
 #define CONFIG_CMD_DM
 #define CONFIG_DM_GPIO
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_DM_SERIAL
+#endif
 
 #define CONFIG_SYS_TIMER_RATE  100
 #define CONFIG_SYS_TIMER_COUNTER   NV_PA_TMRUS_BASE
@@ -42,14 +45,17 @@
  * Size of malloc() pool
  */
 #define CONFIG_SYS_MALLOC_LEN  (4  20)   /* 4MB  */
+#define CONFIG_SYS_MALLOC_F_LEN(1  10)
 
 /*
  * NS16550 Configuration
  */
-#define CONFIG_SYS_NS16550
+#ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE(-4)
 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
+#endif
+#define CONFIG_SYS_NS16550
 
 /*
  * Common HW configuration.
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 12/16] dm: serial: Collect common baud rate code in ns16550

2014-07-30 Thread Simon Glass
The same sequence is used in several places, so move it into a function.
Note that UART_LCR_BKSE is an alias for UART_LCR_DLAB.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Add new patch to collect common baud rate code in ns16550

Changes in v2: None

 drivers/serial/ns16550.c | 33 +
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 056210e..9373c8d 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -61,6 +61,14 @@ int ns16550_calc_divisor(NS16550_t port, int clock, int 
baudrate)
return DIV_ROUND_CLOSEST(clock, mode_x_div * baudrate);
 }
 
+static void NS16550_setbrg(NS16550_t com_port, int baud_divisor)
+{
+   serial_out(UART_LCR_BKSE | UART_LCRVAL, com_port-lcr);
+   serial_out(baud_divisor  0xff, com_port-dll);
+   serial_out((baud_divisor  8)  0xff, com_port-dlm);
+   serial_out(UART_LCRVAL, com_port-lcr);
+}
+
 void NS16550_init(NS16550_t com_port, int baud_divisor)
 {
 #if (defined(CONFIG_SPL_BUILD)  defined(CONFIG_OMAP34XX))
@@ -71,10 +79,7 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
 */
if ((serial_in(com_port-lsr)  (UART_LSR_TEMT | UART_LSR_THRE))
 == UART_LSR_THRE) {
-   serial_out(UART_LCR_DLAB, com_port-lcr);
-   serial_out(baud_divisor  0xff, com_port-dll);
-   serial_out((baud_divisor  8)  0xff, com_port-dlm);
-   serial_out(UART_LCRVAL, com_port-lcr);
+   NS16550_setbrg(com_port, baud_divisor);
serial_out(0, com_port-mdr1);
}
 #endif
@@ -87,16 +92,10 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX)
serial_out(0x7, com_port-mdr1);   /* mode select reset TL16C750*/
 #endif
-   serial_out(UART_LCR_BKSE | UART_LCRVAL, com_port-lcr);
-   serial_out(0, com_port-dll);
-   serial_out(0, com_port-dlm);
-   serial_out(UART_LCRVAL, com_port-lcr);
+   NS16550_setbrg(com_port, 0);
serial_out(UART_MCRVAL, com_port-mcr);
serial_out(UART_FCRVAL, com_port-fcr);
-   serial_out(UART_LCR_BKSE | UART_LCRVAL, com_port-lcr);
-   serial_out(baud_divisor  0xff, com_port-dll);
-   serial_out((baud_divisor  8)  0xff, com_port-dlm);
-   serial_out(UART_LCRVAL, com_port-lcr);
+   NS16550_setbrg(com_port, baud_divisor);
 #if (defined(CONFIG_OMAP)  !defined(CONFIG_OMAP3_ZOOM2)) || \
defined(CONFIG_AM33XX) || defined(CONFIG_SOC_DA8XX) || \
defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX)
@@ -113,16 +112,10 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
 void NS16550_reinit(NS16550_t com_port, int baud_divisor)
 {
serial_out(CONFIG_SYS_NS16550_IER, com_port-ier);
-   serial_out(UART_LCR_BKSE | UART_LCRVAL, com_port-lcr);
-   serial_out(0, com_port-dll);
-   serial_out(0, com_port-dlm);
-   serial_out(UART_LCRVAL, com_port-lcr);
+   NS16550_setbrg(com_port, 0);
serial_out(UART_MCRVAL, com_port-mcr);
serial_out(UART_FCRVAL, com_port-fcr);
-   serial_out(UART_LCR_BKSE, com_port-lcr);
-   serial_out(baud_divisor  0xff, com_port-dll);
-   serial_out((baud_divisor  8)  0xff, com_port-dlm);
-   serial_out(UART_LCRVAL, com_port-lcr);
+   NS16550_setbrg(com_port, baud_divisor);
 }
 #endif /* CONFIG_NS16550_MIN_FUNCTIONS */
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 09/16] dm: exynos: Move serial to driver model

2014-07-30 Thread Simon Glass
Change the Exynos serial driver to work with driver model and switch over
all Exynos5 boards to use it.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Avoid reordering functions

Changes in v2: None

 drivers/serial/serial_s5p.c | 255 
 include/configs/exynos-common.h |   1 +
 2 files changed, 73 insertions(+), 183 deletions(-)

diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
index 98c62b4..8469afd 100644
--- a/drivers/serial/serial_s5p.c
+++ b/drivers/serial/serial_s5p.c
@@ -9,6 +9,8 @@
  */
 
 #include common.h
+#include dm.h
+#include errno.h
 #include fdtdec.h
 #include linux/compiler.h
 #include asm/io.h
@@ -18,26 +20,18 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define RX_FIFO_COUNT_MASK 0xff
-#define RX_FIFO_FULL_MASK  (1  8)
-#define TX_FIFO_FULL_MASK  (1  24)
+#define RX_FIFO_COUNT_SHIFT0
+#define RX_FIFO_COUNT_MASK (0xff  RX_FIFO_COUNT_SHIFT)
+#define RX_FIFO_FULL   (1  8)
+#define TX_FIFO_COUNT_SHIFT16
+#define TX_FIFO_COUNT_MASK (0xff  TX_FIFO_COUNT_SHIFT)
+#define TX_FIFO_FULL   (1  24)
 
 /* Information about a serial port */
-struct fdt_serial {
-   u32 base_addr;  /* address of registers in physical memory */
+struct s5p_serial_platdata {
+   struct s5p_uart *reg;  /* address of registers in physical memory */
u8 port_id; /* uart port number */
-   u8 enabled; /* 1 if enabled, 0 if disabled */
-} config __attribute__ ((section(.data)));
-
-static inline struct s5p_uart *s5p_get_base_uart(int dev_index)
-{
-#ifdef CONFIG_OF_CONTROL
-   return (struct s5p_uart *)(config.base_addr);
-#else
-   u32 offset = dev_index * sizeof(struct s5p_uart);
-   return (struct s5p_uart *)(samsung_get_base_uart() + offset);
-#endif
-}
+};
 
 /*
  * The coefficient, used to calculate the baudrate on S5P UARTs is
@@ -65,23 +59,13 @@ static const int udivslot[] = {
0xffdf,
 };
 
-static void serial_setbrg_dev(const int dev_index)
+int s5p_serial_setbrg(struct udevice *dev, int baudrate)
 {
-   struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
-   u32 uclk = get_uart_clk(dev_index);
-   u32 baudrate = gd-baudrate;
+   struct s5p_serial_platdata *plat = dev-platdata;
+   struct s5p_uart *const uart = plat-reg;
+   u32 uclk = get_uart_clk(plat-port_id);
u32 val;
 
-#if defined(CONFIG_SILENT_CONSOLE)  \
-   defined(CONFIG_OF_CONTROL)  \
-   !defined(CONFIG_SPL_BUILD)
-   if (fdtdec_get_config_int(gd-fdt_blob, silent_console, 0))
-   gd-flags |= GD_FLG_SILENT;
-#endif
-
-   if (!config.enabled)
-   return;
-
val = uclk / baudrate;
 
writel(val / 16 - 1, uart-ubrdiv);
@@ -90,15 +74,14 @@ static void serial_setbrg_dev(const int dev_index)
writew(udivslot[val % 16], uart-rest.slot);
else
writeb(val % 16, uart-rest.value);
+
+   return 0;
 }
 
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- */
-static int serial_init_dev(const int dev_index)
+static int s5p_serial_probe(struct udevice *dev)
 {
-   struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
+   struct s5p_serial_platdata *plat = dev-platdata;
+   struct s5p_uart *const uart = plat-reg;
 
/* enable FIFOs, auto clear Rx FIFO */
writel(0x3, uart-ufcon);
@@ -108,14 +91,11 @@ static int serial_init_dev(const int dev_index)
/* No interrupts, no DMA, pure polling */
writel(0x245, uart-ucon);
 
-   serial_setbrg_dev(dev_index);
-
return 0;
 }
 
-static int serial_err_check(const int dev_index, int op)
+static int serial_err_check(const struct s5p_uart *const uart, int op)
 {
-   struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
unsigned int mask;
 
/*
@@ -133,169 +113,78 @@ static int serial_err_check(const int dev_index, int op)
return readl(uart-uerstat)  mask;
 }
 
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-static int serial_getc_dev(const int dev_index)
+static int s5p_serial_getc(struct udevice *dev)
 {
-   struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
-
-   if (!config.enabled)
-   return 0;
+   struct s5p_serial_platdata *plat = dev-platdata;
+   struct s5p_uart *const uart = plat-reg;
 
-   /* wait for character to arrive */
-   while (!(readl(uart-ufstat)  (RX_FIFO_COUNT_MASK |
-RX_FIFO_FULL_MASK))) {
-   if (serial_err_check(dev_index, 0))
-   return 0;
-   }
+   if (!(readl(uart-ufstat)  RX_FIFO_COUNT_MASK))
+   return -EAGAIN;
 
+   serial_err_check(uart, 0);
  

[U-Boot] [PATCH 2/2] fdt: Sync up with libfdt

2014-07-30 Thread Simon Glass
This brings in changes up to commit f9e91a48 in the libfdt repo.
Mostly this is whitespace/minor changes. But there are a few new
features:

- fdt_size_cells() and fdt_address_cells()
- fdt_resize()

Signed-off-by: Simon Glass s...@chromium.org
---

 include/libfdt.h | 73 +---
 lib/libfdt/Makefile  |  3 +-
 lib/libfdt/fdt_addresses.c   | 55 +
 lib/libfdt/fdt_rw.c  |  6 ++--
 lib/libfdt/fdt_sw.c  | 32 +++
 lib/libfdt/libfdt_internal.h |  6 ++--
 6 files changed, 163 insertions(+), 12 deletions(-)
 create mode 100644 lib/libfdt/fdt_addresses.c

diff --git a/include/libfdt.h b/include/libfdt.h
index 9eefaaf..a1ef1e1 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -116,7 +116,12 @@
 * Should never be returned, if it is, it indicates a bug in
 * libfdt itself. */
 
-#define FDT_ERR_MAX13
+/* Errors in device tree content */
+#define FDT_ERR_BADNCELLS  14
+   /* FDT_ERR_BADNCELLS: Device tree has a #address-cells, #size-cells
+* or similar property with a bad format or value */
+
+#define FDT_ERR_MAX14
 
 /**/
 /* Low-level functions (you probably don't need these)*/
@@ -596,9 +601,9 @@ const char *fdt_get_alias_namelen(const void *fdt,
  const char *name, int namelen);
 
 /**
- * fdt_get_alias - retrieve the path referenced by a given alias
+ * fdt_get_alias - retreive the path referenced by a given alias
  * @fdt: pointer to the device tree blob
- * @name: name of the alias to look up
+ * @name: name of the alias th look up
  *
  * fdt_get_alias() retrieves the value of a given alias.  That is, the
  * value of the property named 'name' in the node /aliases.
@@ -731,7 +736,7 @@ int fdt_parent_offset(const void *fdt, int nodeoffset);
  * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
  *propval, proplen);
  * while (offset != -FDT_ERR_NOTFOUND) {
- * ... other code here ...
+ * // other code here
  * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
  *propval, proplen);
  * }
@@ -816,7 +821,7 @@ int fdt_node_check_compatible(const void *fdt, int 
nodeoffset,
  * idiom can be used:
  * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
  * while (offset != -FDT_ERR_NOTFOUND) {
- * ... other code here ...
+ * // other code here
  * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
  * }
  *
@@ -853,6 +858,63 @@ int fdt_node_offset_by_compatible(const void *fdt, int 
startoffset,
 int fdt_stringlist_contains(const char *strlist, int listlen, const char *str);
 
 /**/
+/* Read-only functions (addressing related)   */
+/**/
+
+/**
+ * FDT_MAX_NCELLS - maximum value for #address-cells and #size-cells
+ *
+ * This is the maximum value for #address-cells, #size-cells and
+ * similar properties that will be processed by libfdt.  IEE1275
+ * requires that OF implementations handle values up to 4.
+ * Implementations may support larger values, but in practice higher
+ * values aren't used.
+ */
+#define FDT_MAX_NCELLS 4
+
+/**
+ * fdt_address_cells - retrieve address size for a bus represented in the tree
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to find the address size for
+ *
+ * When the node has a valid #address-cells property, returns its value.
+ *
+ * returns:
+ * 0 = n  FDT_MAX_NCELLS, on success
+ *  2, if the node has no #address-cells property
+ *  -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
+ * #address-cells property
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_address_cells(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_size_cells - retrieve address range size for a bus represented in the
+ *  tree
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to find the address range size for
+ *
+ * When the node has a valid #size-cells property, returns its value.
+ *
+ * returns:
+ * 0 = n  FDT_MAX_NCELLS, on success
+ *  2, if the node has no #address-cells property
+ *  -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
+ * #size-cells property
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+int 

[U-Boot] Please fix warning of Exynos

2014-07-30 Thread Masahiro Yamada
Hi, Samsung developers,


I notice the following warning when building Exynos family:



arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
array bounds [-Warray-bounds]
  struct clk_bit_info *bit_info = clk_bit_info[peripheral];
   ^
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
array bounds [-Warray-bounds]
arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
array bounds [-Warray-bounds]
  struct clk_bit_info *bit_info = clk_bit_info[peripheral];
   ^
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
array bounds [-Warray-bounds]




I think the cause is that
PERIPH_ID_PWM0 is defined as 132, but clk_bit_info
has much smaller array size.




You can repeat this with this toolchain:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_arm-unknown-linux-gnueabi.tar.xz




Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH 1/2] fdt: Rename fdt_resize() to fdt_shrink_to_minimum()

2014-07-30 Thread Simon Glass
Since libfdt now has an fdt_resize() function, we need to rename the
U-Boot one.

Signed-off-by: Simon Glass s...@chromium.org
---

 common/cmd_fdt.c  | 2 +-
 common/fdt_support.c  | 2 +-
 common/image-fdt.c| 2 +-
 include/fdt_support.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index e86d992..5640ded 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -621,7 +621,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
/* resize the fdt */
else if (strncmp(argv[1], re, 2) == 0) {
-   fdt_resize(working_fdt);
+   fdt_shrink_to_minimum(working_fdt);
}
else {
/* Unrecognized command */
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 7927a83..784a570 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -508,7 +508,7 @@ void fdt_fixup_ethernet(void *fdt)
 }
 
 /* Resize the fdt to its actual size + a bit of padding */
-int fdt_resize(void *blob)
+int fdt_shrink_to_minimum(void *blob)
 {
int i;
uint64_t addr, size;
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 9fc7481..0ea676b 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -476,7 +476,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
 (phys_size_t)fdt_totalsize(blob));
 
-   ret = fdt_resize(blob);
+   ret = fdt_shrink_to_minimum(blob);
if (ret  0)
return ret;
of_size = ret;
diff --git a/include/fdt_support.h b/include/fdt_support.h
index fd44d7e..1bda686 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -76,7 +76,7 @@ void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 
 void set_working_fdt_addr(void *addr);
-int fdt_resize(void *blob);
+int fdt_shrink_to_minimum(void *blob);
 int fdt_increase_size(void *fdt, int add_len);
 
 int fdt_fixup_nor_flash_size(void *blob);
-- 
2.0.0.526.g5318336

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


[U-Boot] Please fix warning of gw_ventana board

2014-07-30 Thread Masahiro Yamada
Hi Tim Harvey,


I am afraid I see a warning when building gw_ventana board.



board/gateworks/gw_ventana/gw_ventana.c: In function 'setup_board_gpio':
board/gateworks/gw_ventana/gw_ventana.c:987:27: warning: iteration 3u invokes 
undefined behavior [-Waggressive-loop-optimizations]
   if (gpio_cfg[board].leds[i])
   ^
board/gateworks/gw_ventana/gw_ventana.c:986:2: note: containing loop
  for (i = 0; i  4; i++) {
  ^
board/gateworks/gw_ventana/gw_ventana.c: In function 'setup_board_gpio':
board/gateworks/gw_ventana/gw_ventana.c:987:27: warning: iteration 3u invokes 
undefined behavior [-Waggressive-loop-optimizations]
   if (gpio_cfg[board].leds[i])
   ^
board/gateworks/gw_ventana/gw_ventana.c:986:2: note: containing loop
  for (i = 0; i  4; i++) {
  ^




The for statement in line 986 iterates 4 times,
but the array size of gpio_cfg[board].leds[i] is 2 or 3.


Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH] omap: clean-up dead configs

2014-07-30 Thread Masahiro Yamada
The following configs are not defined at all.

 - CONFIG_OMAP1510
 - CONFIG_OMAP_1510P1
 - CONFIG_OMAP_SX1
 - CONFIG_OMAP3_DMA
 - CONFIG_OMAP3_ZOOM2
 - CONFIG_OMAP_INNOVATOR

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Tom Rini tr...@ti.com
---

 drivers/dma/Makefile  |   1 -
 drivers/dma/omap3_dma.c   | 167 --
 drivers/serial/ns16550.c  |   2 +-
 drivers/serial/serial_ns16550.c   |   9 --
 drivers/serial/usbtty.h   |   2 -
 drivers/usb/gadget/Makefile   |   1 -
 drivers/usb/gadget/omap1510_udc.c |  49 ---
 include/configs/omap1510.h|  16 
 include/ns16550.h |   7 --
 include/usb/udc.h |   4 +-
 10 files changed, 3 insertions(+), 255 deletions(-)
 delete mode 100644 drivers/dma/omap3_dma.c

diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index 8b2821b..a79c391 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -8,4 +8,3 @@
 obj-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
 obj-$(CONFIG_APBH_DMA) += apbh_dma.o
 obj-$(CONFIG_FSL_DMA) += fsl_dma.o
-obj-$(CONFIG_OMAP3_DMA) += omap3_dma.o
diff --git a/drivers/dma/omap3_dma.c b/drivers/dma/omap3_dma.c
deleted file mode 100644
index 3320b3d..000
--- a/drivers/dma/omap3_dma.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Copyright (C) 2011
- * Corscience GmbH  Co. KG - Simon Schwarz schw...@corscience.de
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-/* This is a basic implementation of the SDMA/DMA4 controller of OMAP3
- * Tested on Silicon Revision major:0x4 minor:0x0
- */
-
-#include common.h
-#include asm/arch/cpu.h
-#include asm/arch/omap3.h
-#include asm/arch/dma.h
-#include asm/io.h
-#include asm/errno.h
-
-static struct dma4 *dma4_cfg = (struct dma4 *)OMAP34XX_DMA4_BASE;
-uint32_t dma_active; /* if a transfer is started the respective
-   bit is set for the logical channel */
-
-/* Check if we have the given channel
- * PARAMETERS:
- * chan: Channel number
- *
- * RETURN of non-zero means error */
-static inline int check_channel(uint32_t chan)
-{
-   if (chan  CHAN_NR_MIN || chan  CHAN_NR_MAX)
-   return -EINVAL;
-   return 0;
-}
-
-static inline void reset_irq(uint32_t chan)
-{
-   /* reset IRQ reason */
-   writel(0x1DFE, dma4_cfg-chan[chan].csr);
-   /* reset IRQ */
-   writel((1  chan), dma4_cfg-irqstatus_l[0]);
-   dma_active = ~(1  chan);
-}
-
-/* Set Source, Destination and Size of DMA transfer for the
- * specified channel.
- * PARAMETERS:
- * chan: channel to use
- * src: source of the transfer
- * dst: destination of the transfer
- * sze: Size of the transfer
- *
- * RETURN of non-zero means error */
-int omap3_dma_conf_transfer(uint32_t chan, uint32_t *src, uint32_t *dst,
-   uint32_t sze)
-{
-   if (check_channel(chan))
-   return -EINVAL;
-   /* CDSA0 */
-   writel((uint32_t)src, dma4_cfg-chan[chan].cssa);
-   writel((uint32_t)dst, dma4_cfg-chan[chan].cdsa);
-   writel(sze, dma4_cfg-chan[chan].cen);
-return 0;
-}
-
-/* Start the DMA transfer */
-int omap3_dma_start_transfer(uint32_t chan)
-{
-   uint32_t val;
-
-   if (check_channel(chan))
-   return -EINVAL;
-
-   val = readl(dma4_cfg-chan[chan].ccr);
-   /* Test for channel already in use */
-   if (val  CCR_ENABLE_ENABLE)
-   return -EBUSY;
-
-   writel((val | CCR_ENABLE_ENABLE), dma4_cfg-chan[chan].ccr);
-   dma_active |= (1  chan);
-   debug(started transfer...\n);
-   return 0;
-}
-
-/* Busy-waiting for a DMA transfer
- * This has to be called before another transfer is started
- * PARAMETER
- * chan: Channel to wait for
- *
- * RETURN of non-zero means error*/
-int omap3_dma_wait_for_transfer(uint32_t chan)
-{
-   uint32_t val;
-
-   if (!(dma_active  (1  chan))) {
-   val = readl(dma4_cfg-irqstatus_l[0]);
-   if (!(val  chan)) {
-   debug(dma: The channel you are trying to wait for 
-   was never activated - ERROR\n);
-   return -1; /* channel was never active */
-   }
-   }
-
-   /* all irqs on line 0 */
-   while (!(readl(dma4_cfg-irqstatus_l[0])  (1  chan)))
-   asm(nop);
-
-   val = readl(dma4_cfg-chan[chan].csr);
-   if ((val  CSR_TRANS_ERR) | (val  CSR_SUPERVISOR_ERR) |
-   (val  CSR_MISALIGNED_ADRS_ERR)) {
-   debug(err code: %X\n, val);
-   debug(dma: transfer error detected\n);
-   reset_irq(chan);
-   return -1;
-   }
-   reset_irq(chan);
-   return 0;
-}
-
-/* Get the revision of the DMA module
- * PARAMETER
- * minor: Address of minor revision to write
- * major: Address of major revision to write
- *
- * RETURN of non-zero means error
- */
-int omap3_dma_get_revision(uint32_t *minor, uint32_t *major)
-{
-   uint32_t 

[U-Boot] [PATCH v2 2/2] env_mmc: support env partition setup in runtime

2014-07-30 Thread Dmitry Lifshitz
Add callback with __weak annotation to allow setup of environment
partition number in runtime from a board file.

Propagate mmc_switch_part() return value into init_mmc_for_env() instead
of -1 in case of failure.

Signed-off-by: Dmitry Lifshitz lifsh...@compulab.co.il
Signed-off-by: Igor Grinberg grinb...@compulab.co.il
---

 Changes in v2:

* Added mmc_get_env_part() proto in environment.h.

 common/env_mmc.c  |   35 +++
 include/environment.h |3 +++
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 7da10e6..a7621a8 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -62,16 +62,36 @@ int env_init(void)
return 0;
 }
 
-static int init_mmc_for_env(struct mmc *mmc)
-{
 #ifdef CONFIG_SYS_MMC_ENV_PART
+__weak uint mmc_get_env_part(struct mmc *mmc)
+{
+   return CONFIG_SYS_MMC_ENV_PART;
+}
+
+static int mmc_set_env_part(struct mmc *mmc)
+{
+   uint part = mmc_get_env_part(mmc);
int dev = CONFIG_SYS_MMC_ENV_DEV;
+   int ret = 0;
 
 #ifdef CONFIG_SPL_BUILD
dev = 0;
 #endif
+
+   if (part != mmc-part_num) {
+   ret = mmc_switch_part(dev, part);
+   if (ret)
+   puts(MMC partition switch failed\n);
+   }
+
+   return ret;
+}
+#else
+static inline int mmc_set_env_part(struct mmc *mmc) {return 0; };
 #endif
 
+static int init_mmc_for_env(struct mmc *mmc)
+{
if (!mmc) {
puts(No MMC card found\n);
return -1;
@@ -82,16 +102,7 @@ static int init_mmc_for_env(struct mmc *mmc)
return -1;
}
 
-#ifdef CONFIG_SYS_MMC_ENV_PART
-   if (CONFIG_SYS_MMC_ENV_PART != mmc-part_num) {
-   if (mmc_switch_part(dev, CONFIG_SYS_MMC_ENV_PART)) {
-   puts(MMC partition switch failed\n);
-   return -1;
-   }
-   }
-#endif
-
-   return 0;
+   return mmc_set_env_part(mmc);
 }
 
 static void fini_mmc_for_env(struct mmc *mmc)
diff --git a/include/environment.h b/include/environment.h
index d7a1adf..1fdbdad 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -184,6 +184,9 @@ extern void env_reloc(void);
 #include mmc.h
 
 extern int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr);
+# ifdef CONFIG_SYS_MMC_ENV_PART
+extern uint mmc_get_env_part(struct mmc *mmc);
+# endif
 #endif
 
 #ifndef DO_DEPS_ONLY
-- 
1.7.5.4

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


[U-Boot] [PATCH 1/2] env_mmc: add mmc_get_env_addr() prototype

2014-07-30 Thread Dmitry Lifshitz
Add missing mmc_get_env_addr() prototype in environment.h

Signed-off-by: Dmitry Lifshitz lifsh...@compulab.co.il
---
 include/environment.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/environment.h b/include/environment.h
index 08679ae..d7a1adf 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -180,6 +180,12 @@ extern unsigned char env_get_char_spec(int);
 extern void env_reloc(void);
 #endif
 
+#ifdef CONFIG_ENV_IS_IN_MMC
+#include mmc.h
+
+extern int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr);
+#endif
+
 #ifndef DO_DEPS_ONLY
 
 #include env_attr.h
-- 
1.7.5.4

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


[U-Boot] [PATCH] drivers: rtc: remove dead drivers

2014-07-30 Thread Masahiro Yamada
The following configs are not defined at all:

 - CONFIG_RTC_DS1388
 - CONFIG_RTC_ISL1208
 - CONFIG_RTC_MX27
 - CONFIG_RTC_PL031
 - CONFIG_RTC_RS5C372A
 - CONFIG_SYS_DS1388_TCR_VAL

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 README|   1 -
 drivers/rtc/Makefile  |   5 -
 drivers/rtc/ds1337.c  |  25 -
 drivers/rtc/isl1208.c | 147 --
 drivers/rtc/mx27rtc.c |  70 -
 drivers/rtc/pl031.c   | 109 
 drivers/rtc/rs5c372.c | 281 --
 7 files changed, 638 deletions(-)
 delete mode 100644 drivers/rtc/isl1208.c
 delete mode 100644 drivers/rtc/mx27rtc.c
 delete mode 100644 drivers/rtc/pl031.c
 delete mode 100644 drivers/rtc/rs5c372.c

diff --git a/README b/README
index f704eb3..468a2bf 100644
--- a/README
+++ b/README
@@ -1153,7 +1153,6 @@ The following options need to be configured:
CONFIG_RTC_DS1337   - use Maxim, Inc. DS1337 RTC
CONFIG_RTC_DS1338   - use Maxim, Inc. DS1338 RTC
CONFIG_RTC_DS164x   - use Dallas DS164x RTC
-   CONFIG_RTC_ISL1208  - use Intersil ISL1208 RTC
CONFIG_RTC_MAX6900  - use Maxim, Inc. MAX6900 RTC
CONFIG_SYS_RTC_DS1337_NOOSC - Turn off the OSC output for 
DS1337
CONFIG_SYS_RV3029_TCR   - enable trickle charger on
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 003d322..a3ce4d4 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -18,14 +18,12 @@ obj-$(CONFIG_RTC_DS1307) += ds1307.o
 obj-$(CONFIG_RTC_DS1338) += ds1307.o
 obj-$(CONFIG_RTC_DS1337) += ds1337.o
 obj-$(CONFIG_RTC_DS1374) += ds1374.o
-obj-$(CONFIG_RTC_DS1388) += ds1337.o
 obj-$(CONFIG_RTC_DS1556) += ds1556.o
 obj-$(CONFIG_RTC_DS164x) += ds164x.o
 obj-$(CONFIG_RTC_DS174x) += ds174x.o
 obj-$(CONFIG_RTC_DS3231) += ds3231.o
 obj-$(CONFIG_RTC_FTRTC010) += ftrtc010.o
 obj-$(CONFIG_RTC_IMXDI) += imxdi.o
-obj-$(CONFIG_RTC_ISL1208) += isl1208.o
 obj-$(CONFIG_RTC_M41T11) += m41t11.o
 obj-$(CONFIG_RTC_M41T60) += m41t60.o
 obj-$(CONFIG_RTC_M41T62) += m41t62.o
@@ -39,12 +37,9 @@ obj-$(CONFIG_RTC_MK48T59) += mk48t59.o
 obj-$(CONFIG_RTC_MPC5200) += mpc5xxx.o
 obj-$(CONFIG_RTC_MPC8xx) += mpc8xx.o
 obj-$(CONFIG_RTC_MV) += mvrtc.o
-obj-$(CONFIG_RTC_MX27) += mx27rtc.o
 obj-$(CONFIG_RTC_MXS) += mxsrtc.o
 obj-$(CONFIG_RTC_PCF8563) += pcf8563.o
-obj-$(CONFIG_RTC_PL031) += pl031.o
 obj-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
-obj-$(CONFIG_RTC_RS5C372A) += rs5c372.o
 obj-$(CONFIG_RTC_RTC4543) += rtc4543.o
 obj-$(CONFIG_RTC_RV3029) += rv3029.o
 obj-$(CONFIG_RTC_RX8025) += rx8025.o
diff --git a/drivers/rtc/ds1337.c b/drivers/rtc/ds1337.c
index dae1b3c..550be90 100644
--- a/drivers/rtc/ds1337.c
+++ b/drivers/rtc/ds1337.c
@@ -21,7 +21,6 @@
 /*
  * RTC register addresses
  */
-#if defined CONFIG_RTC_DS1337
 #define RTC_SEC_REG_ADDR   0x0
 #define RTC_MIN_REG_ADDR   0x1
 #define RTC_HR_REG_ADDR0x2
@@ -32,18 +31,6 @@
 #define RTC_CTL_REG_ADDR   0x0e
 #define RTC_STAT_REG_ADDR  0x0f
 #define RTC_TC_REG_ADDR0x10
-#elif defined CONFIG_RTC_DS1388
-#define RTC_SEC_REG_ADDR   0x1
-#define RTC_MIN_REG_ADDR   0x2
-#define RTC_HR_REG_ADDR0x3
-#define RTC_DAY_REG_ADDR   0x4
-#define RTC_DATE_REG_ADDR  0x5
-#define RTC_MON_REG_ADDR   0x6
-#define RTC_YR_REG_ADDR0x7
-#define RTC_CTL_REG_ADDR   0x0c
-#define RTC_STAT_REG_ADDR  0x0b
-#define RTC_TC_REG_ADDR0x0a
-#endif
 
 /*
  * RTC control register bits
@@ -84,11 +71,6 @@ int rtc_get (struct rtc_time *tmp)
mon_cent = rtc_read (RTC_MON_REG_ADDR);
year = rtc_read (RTC_YR_REG_ADDR);
 
-   /* No century bit, assume year 2000 */
-#ifdef CONFIG_RTC_DS1388
-   mon_cent |= 0x80;
-#endif
-
debug(Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x 
hr: %02x min: %02x sec: %02x control: %02x status: %02x\n,
year, mon_cent, mday, wday, hour, min, sec, control, status);
@@ -162,17 +144,10 @@ int rtc_set (struct rtc_time *tmp)
 #endif
 void rtc_reset (void)
 {
-#ifdef CONFIG_SYS_RTC_DS1337
rtc_write (RTC_CTL_REG_ADDR, RTC_DS1337_RESET_VAL);
-#elif defined CONFIG_SYS_RTC_DS1388
-   rtc_write(RTC_CTL_REG_ADDR, 0x0); /* hw default */
-#endif
 #ifdef CONFIG_SYS_DS1339_TCR_VAL
rtc_write (RTC_TC_REG_ADDR, CONFIG_SYS_DS1339_TCR_VAL);
 #endif
-#ifdef CONFIG_SYS_DS1388_TCR_VAL
-   rtc_write(RTC_TC_REG_ADDR, CONFIG_SYS_DS1388_TCR_VAL);
-#endif
 }
 
 
diff --git a/drivers/rtc/isl1208.c b/drivers/rtc/isl1208.c
deleted file mode 100644
index 807e2e4..000
--- a/drivers/rtc/isl1208.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * (C) Copyright 2008
- * Tor Krill, Excito Elektronik i Skåne , t...@excito.com
- *
- * Modelled after the ds1337 driver
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-/*
- * Date  Time support (no alarms) for Intersil
- * 

[U-Boot] [PATCH] drivers: net: remove dead drivers

2014-07-30 Thread Masahiro Yamada
The following configs are not defined at all:

 - CONFIG_FTMAC110
 - CONFIG_INCA_IP_SWITCH
 - CONFIG_PBL2800_ETHER
 - CONFIG_PHY_ICPLUS

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 drivers/net/Makefile  |   3 -
 drivers/net/ftmac110.c| 480 --
 drivers/net/ftmac110.h| 176 -
 drivers/net/phy/Makefile  |   1 -
 drivers/net/phy/icplus.c  |  80 
 drivers/net/phy/phy.c |   3 -
 drivers/net/plb2800_eth.c | 373 ---
 include/netdev.h  |   2 -
 8 files changed, 1118 deletions(-)
 delete mode 100644 drivers/net/ftmac110.c
 delete mode 100644 drivers/net/ftmac110.h
 delete mode 100644 drivers/net/phy/icplus.c
 delete mode 100644 drivers/net/plb2800_eth.c

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 7cc6b6f..42f21a6 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -27,10 +27,8 @@ obj-$(CONFIG_ETHOC) += ethoc.o
 obj-$(CONFIG_FEC_MXC) += fec_mxc.o
 obj-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
 obj-$(CONFIG_FTGMAC100) += ftgmac100.o
-obj-$(CONFIG_FTMAC110) += ftmac110.o
 obj-$(CONFIG_FTMAC100) += ftmac100.o
 obj-$(CONFIG_GRETH) += greth.o
-obj-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
 obj-$(CONFIG_DRIVER_TI_KEYSTONE_NET) += keystone_net.o
 obj-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 obj-$(CONFIG_KS8851_MLL) += ks8851_mll.o
@@ -46,7 +44,6 @@ obj-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
 obj-$(CONFIG_NETCONSOLE) += netconsole.o
 obj-$(CONFIG_NS8382X) += ns8382x.o
 obj-$(CONFIG_PCNET) += pcnet.o
-obj-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
 obj-$(CONFIG_RTL8139) += rtl8139.o
 obj-$(CONFIG_RTL8169) += rtl8169.o
 obj-$(CONFIG_SH_ETHER) += sh_eth.o
diff --git a/drivers/net/ftmac110.c b/drivers/net/ftmac110.c
deleted file mode 100644
index 98c4f09..000
--- a/drivers/net/ftmac110.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Faraday 10/100Mbps Ethernet Controller
- *
- * (C) Copyright 2013 Faraday Technology
- * Dante Su dant...@faraday-tech.com
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include common.h
-#include command.h
-#include malloc.h
-#include net.h
-#include asm/errno.h
-#include asm/io.h
-#include asm/dma-mapping.h
-
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
-#include miiphy.h
-#endif
-
-#include ftmac110.h
-
-#define CFG_RXDES_NUM   8
-#define CFG_TXDES_NUM   2
-#define CFG_XBUF_SIZE   1536
-
-#define CFG_MDIORD_TIMEOUT  (CONFIG_SYS_HZ  1) /* 500 ms */
-#define CFG_MDIOWR_TIMEOUT  (CONFIG_SYS_HZ  1) /* 500 ms */
-#define CFG_LINKUP_TIMEOUT  (CONFIG_SYS_HZ  2) /* 4 sec */
-
-/*
- * FTMAC110 DMA design issue
- *
- * Its DMA engine has a weird restriction that its Rx DMA engine
- * accepts only 16-bits aligned address, 32-bits aligned is not
- * acceptable. However this restriction does not apply to Tx DMA.
- *
- * Conclusion:
- * (1) Tx DMA Buffer Address:
- * 1 bytes aligned: Invalid
- * 2 bytes aligned: O.K
- * 4 bytes aligned: O.K (- u-boot ZeroCopy is possible)
- * (2) Rx DMA Buffer Address:
- * 1 bytes aligned: Invalid
- * 2 bytes aligned: O.K
- * 4 bytes aligned: Invalid
- */
-
-struct ftmac110_chip {
-   void __iomem *regs;
-   uint32_t imr;
-   uint32_t maccr;
-   uint32_t lnkup;
-   uint32_t phy_addr;
-
-   struct ftmac110_desc *rxd;
-   ulongrxd_dma;
-   uint32_t rxd_idx;
-
-   struct ftmac110_desc *txd;
-   ulongtxd_dma;
-   uint32_t txd_idx;
-};
-
-static int ftmac110_reset(struct eth_device *dev);
-
-static uint16_t mdio_read(struct eth_device *dev,
-   uint8_t phyaddr, uint8_t phyreg)
-{
-   struct ftmac110_chip *chip = dev-priv;
-   struct ftmac110_regs *regs = chip-regs;
-   uint32_t tmp, ts;
-   uint16_t ret = 0x;
-
-   tmp = PHYCR_READ
-   | (phyaddr  PHYCR_ADDR_SHIFT)
-   | (phyreg   PHYCR_REG_SHIFT);
-
-   writel(tmp, regs-phycr);
-
-   for (ts = get_timer(0); get_timer(ts)  CFG_MDIORD_TIMEOUT; ) {
-   tmp = readl(regs-phycr);
-   if (tmp  PHYCR_READ)
-   continue;
-   break;
-   }
-
-   if (tmp  PHYCR_READ)
-   printf(ftmac110: mdio read timeout\n);
-   else
-   ret = (uint16_t)(tmp  0x);
-
-   return ret;
-}
-
-static void mdio_write(struct eth_device *dev,
-   uint8_t phyaddr, uint8_t phyreg, uint16_t phydata)
-{
-   struct ftmac110_chip *chip = dev-priv;
-   struct ftmac110_regs *regs = chip-regs;
-   uint32_t tmp, ts;
-
-   tmp = PHYCR_WRITE
-   | (phyaddr  PHYCR_ADDR_SHIFT)
-   | (phyreg   PHYCR_REG_SHIFT);
-
-   writel(phydata, regs-phydr);
-   writel(tmp, regs-phycr);
-
-   for (ts = get_timer(0); get_timer(ts)  CFG_MDIOWR_TIMEOUT; ) {
-   if (readl(regs-phycr)  PHYCR_WRITE)
-   continue;
-   break;

Re: [U-Boot] Please fix warning of Exynos

2014-07-30 Thread Jaehoon Chung
Hi, Masahiro.

Thanks for pointing out.
I will check it.

Best Regards,
Jaehoon Chung

On 07/30/2014 06:59 PM, Masahiro Yamada wrote:
 Hi, Samsung developers,
 
 
 I notice the following warning when building Exynos family:
 
 
 
 arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
 arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
 array bounds [-Warray-bounds]
   struct clk_bit_info *bit_info = clk_bit_info[peripheral];
^
 arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
 array bounds [-Warray-bounds]
 arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
 arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
 array bounds [-Warray-bounds]
   struct clk_bit_info *bit_info = clk_bit_info[peripheral];
^
 arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above 
 array bounds [-Warray-bounds]
 
 
 
 
 I think the cause is that
 PERIPH_ID_PWM0 is defined as 132, but clk_bit_info
 has much smaller array size.
 
 
 
 
 You can repeat this with this toolchain:
 https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_arm-unknown-linux-gnueabi.tar.xz
 
 
 
 
 Best Regards
 Masahiro Yamada
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 

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


[U-Boot] [PATCH v7 00/12] Add support to Odroid U3/X2

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

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

V7 changes:
- some code cleanup

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

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

-- 
1.9.1

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


[U-Boot] [PATCH v7 03/12] arch:exynos: boot mode: add get_boot_mode(), code cleanup

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

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

Changes v6:
- none

changes v7:
- change boot mode name: BOOT_MODE_MMC to BOOT_MODE_SD
---
 arch/arm/cpu/armv7/exynos/power.c|  7 +++
 arch/arm/cpu/armv7/exynos/spl_boot.c |  7 +++
 arch/arm/include/asm/arch-exynos/power.h | 21 +
 arch/arm/include/asm/arch-exynos/spl.h   | 17 ++---
 4 files changed, 33 insertions(+), 19 deletions(-)

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

[U-Boot] [PATCH v7 06/12] samsung:board: misc_init_r: call set_dfu_alt_info()

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
 board/samsung/common/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 1fa0e51..5693813 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -324,6 +324,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_SET_DFU_ALT_INFO
+   set_dfu_alt_info();
+#endif
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
set_board_info();
 #endif
-- 
1.9.1

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


[U-Boot] [PATCH v7 01/12] samsung: misc: fix soc revision setting in the set_board_info()

2014-07-30 Thread Przemyslaw Marczak
The byte order of soc revision was inverted, now it is fixed.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Piotr Wilczek p.wilc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 board/samsung/common/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 03106fd..a453a82 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -26,8 +26,8 @@ void set_board_info(void)
 {
char info[64];
 
-   snprintf(info, ARRAY_SIZE(info), %d.%d, s5p_cpu_rev  0x0f,
-(s5p_cpu_rev  0xf0)  0x04);
+   snprintf(info, ARRAY_SIZE(info), %u.%u, (s5p_cpu_rev  0xf0)  4,
+s5p_cpu_rev  0xf);
setenv(soc_rev, info);
 
snprintf(info, ARRAY_SIZE(info), %x, s5p_cpu_id);
-- 
1.9.1

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


[U-Boot] [PATCH v7 07/12] arm:reset: call the reset_misc() before the cpu reset

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

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
Cc: Tom Rini tr...@ti.com

Changes v4:
- arch/arm/reset: fix weak function attribute to proper style
---
 arch/arm/lib/reset.c | 6 ++
 include/common.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/arch/arm/lib/reset.c b/arch/arm/lib/reset.c
index 7a03580..9a95f08 100644
--- a/arch/arm/lib/reset.c
+++ b/arch/arm/lib/reset.c
@@ -23,6 +23,10 @@
 
 #include common.h
 
+__weak void reset_misc(void)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
puts (resetting ...\n);
@@ -30,6 +34,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
udelay (5); /* wait 50 ms */
 
disable_interrupts();
+
+   reset_misc();
reset_cpu(0);
 
/*NOTREACHED*/
diff --git a/include/common.h b/include/common.h
index cc74633..557893a 100644
--- a/include/common.h
+++ b/include/common.h
@@ -623,6 +623,7 @@ int checkicache   (void);
 intcheckdcache   (void);
 void   upmconfig (unsigned int, unsigned int *, unsigned int);
 ulong  get_tbclk (void);
+void   reset_misc(void);
 void   reset_cpu (ulong addr);
 #if defined (CONFIG_OF_LIBFDT)  defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup(void *blob, bd_t *bd);
-- 
1.9.1

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


[U-Boot] [PATCH v7 09/12] samsung: misc: use board specific functions to set env board info

2014-07-30 Thread Przemyslaw Marczak
This change adds setup of environmental board info using
get_board_name() and get_board_type() functions for config
CONFIG_BOARD_TYPES.

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Piotr Wilczek p.wilc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com

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

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

Changes v5:
- misc.c: set_bard_info(): remove a call to get_board_name()
---
 board/samsung/common/misc.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 9e52452..8766f0c 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -79,8 +79,16 @@ void set_board_info(void)
setenv(board_rev, info);
 #endif
 #ifdef CONFIG_OF_LIBFDT
-   snprintf(info, ARRAY_SIZE(info),  %s%x-%s.dtb,
-CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+   const char *bdtype = ;
+   const char *bdname = CONFIG_SYS_BOARD;
+
+#ifdef CONFIG_BOARD_TYPES
+   bdtype = get_board_type();
+   sprintf(info, %s%s, bdname, bdtype);
+   setenv(boardname, info);
+#endif
+   snprintf(info, ARRAY_SIZE(info),  %s%x-%s%s.dtb,
+CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
setenv(fdtfile, info);
 #endif
 }
-- 
1.9.1

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


[U-Boot] [PATCH v7 05/12] samsung: misc: add function for setting $dfu_alt_info

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

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Piotr Wilczek p.wilc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com

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

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

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

Changes v5:
- set_dfu_alt_info(): remove malloc and declare cache aligned buffer
- set_dfu_alt_info(): introduce CONFIG_SET_DFU_ALT_BUF_LEN
---
 board/samsung/common/misc.c | 41 +
 include/samsung/misc.h  |  6 ++
 2 files changed, 47 insertions(+)

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

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


[U-Boot] [PATCH v7 08/12] samsung: board: enable support of multiple board types

2014-07-30 Thread Przemyslaw Marczak
This change adds declaration of functions:
- set_board_type() - called at board_early_init_f()
- get_board_type() - called at checkboard()

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Piotr Wilczek p.wilc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com

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

Changes v4:
- checkboard(): remove redundant variable

Changes v5:
- board.c: move call to set_board_type() into board_early_init_f()
- misc.h: remove get_board_name() function declaration
---
 board/samsung/common/board.c | 15 ++-
 include/samsung/misc.h   |  4 
 2 files changed, 14 insertions(+), 5 deletions(-)

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

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


[U-Boot] [PATCH v7 11/12] odroid: add odroid U3/X2 device tree description

2014-07-30 Thread Przemyslaw Marczak
This is a standard description for Odroid boards.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Tom Rini tr...@ti.com
---
 arch/arm/dts/Makefile  |  3 +-
 arch/arm/dts/exynos4412-odroid.dts | 70 ++
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos4412-odroid.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 6e2e313..8bcc69c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,7 +1,8 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
exynos4210-universal_c210.dtb \
exynos4210-trats.dtb \
-   exynos4412-trats2.dtb
+   exynos4412-trats2.dtb \
+   exynos4412-odroid.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4412-odroid.dts 
b/arch/arm/dts/exynos4412-odroid.dts
new file mode 100644
index 000..24d0bf1
--- /dev/null
+++ b/arch/arm/dts/exynos4412-odroid.dts
@@ -0,0 +1,70 @@
+/*
+ * Odroid-U3/X2 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Odroid based on Exynos4412;
+   compatible = samsung,odroid, samsung,exynos4412;
+
+   aliases {
+   i2c0 = /i2c@1386;
+   serial0 = /serial@1380;
+   console = /serial@1381;
+   mmc2 = sdhci@1253;
+   mmc4 = dwmmc@1255;
+   };
+
+   i2c@1386 {
+   samsung,i2c-sda-delay = 100;
+   samsung,i2c-slave-addr = 0x10;
+   samsung,i2c-max-bus-freq = 10;
+   status = okay;
+
+   max77686_pmic@09 {
+   compatible = maxim,max77686_pmic;
+   interrupts = 7 0;
+   reg = 0x09 0 0;
+   #clock-cells = 1;
+   };
+   };
+
+   serial@1381 {
+   status = okay;
+   };
+
+   sdhci@1251 {
+   status = disabled;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0xC2 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+
+   dwmmc@1255 {
+   samsung,bus-width = 8;
+   samsung,timing = 2 1 0;
+   samsung,removable = 0;
+   fifoth_val = 0x203f0040;
+   bus_hz = 4;
+   div = 0x3;
+   index = 4;
+   };
+};
-- 
1.9.1

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


[U-Boot] [PATCH v7 10/12] odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Tom Rini tr...@ti.com

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

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

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

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

diff --git a/board/samsung/odroid/Makefile b/board/samsung/odroid/Makefile
new file mode 100644
index 000..b98aaeb
--- /dev/null
+++ b/board/samsung/odroid/Makefile
@@ -0,0 +1,8 @@
+#
+# Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+# Przemyslaw Marczak p.marc...@samsung.com
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := odroid.o
diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
new file mode 100644
index 000..ac19527
--- /dev/null
+++ b/board/samsung/odroid/odroid.c
@@ -0,0 +1,470 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Przemyslaw Marczak p.marc...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include asm/arch/pinmux.h
+#include asm/arch/power.h
+#include asm/arch/clock.h
+#include asm/arch/gpio.h
+#include asm/gpio.h
+#include asm/arch/cpu.h
+#include power/pmic.h
+#include power/max77686_pmic.h
+#include errno.h
+#include usb.h
+#include usb/s3c_udc.h
+#include samsung/misc.h
+#include setup.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_BOARD_TYPES
+/* Odroid board types */
+enum {
+   ODROID_TYPE_U3,
+   ODROID_TYPE_X2,
+   ODROID_TYPES,
+};
+
+void set_board_type(void)
+{
+   /* Set GPA1 pin 1 to HI - enable XCL205 output */
+   writel(XCL205_EN_GPIO_CON_CFG, XCL205_EN_GPIO_CON);
+   writel(XCL205_EN_GPIO_DAT_CFG, XCL205_EN_GPIO_CON + 0x4);
+   writel(XCL205_EN_GPIO_PUD_CFG, XCL205_EN_GPIO_CON + 0x8);
+   writel(XCL205_EN_GPIO_DRV_CFG, XCL205_EN_GPIO_CON + 0xc);
+
+   /* Set GPC1 pin 2 to IN - check XCL205 output state */
+   writel(XCL205_STATE_GPIO_CON_CFG, XCL205_STATE_GPIO_CON);
+   writel(XCL205_STATE_GPIO_PUD_CFG, XCL205_STATE_GPIO_CON + 0x8);
+
+   /* XCL205 - needs some latch time */
+   sdelay(20);
+
+   /* Check GPC1 pin2 - LED supplied by XCL205 - X2 only */
+   if (readl(XCL205_STATE_GPIO_DAT)  (1  XCL205_STATE_GPIO_PIN))
+   gd-board_type = ODROID_TYPE_X2;
+   else
+   gd-board_type = ODROID_TYPE_U3;
+}
+
+const char *get_board_type(void)
+{
+   const char *board_type[] = {u3, x2};
+
+   return board_type[gd-board_type];
+}
+#endif
+
+#ifdef CONFIG_SET_DFU_ALT_INFO
+char *get_dfu_alt_system(void)
+{
+   return getenv(dfu_alt_system);
+}
+
+char *get_dfu_alt_boot(void)
+{
+   char *alt_boot;
+
+   switch (get_boot_mode()) {
+   case BOOT_MODE_SD:
+   alt_boot = CONFIG_DFU_ALT_BOOT_SD;
+   break;
+   case BOOT_MODE_EMMC:
+   case BOOT_MODE_EMMC_SD:
+   alt_boot = CONFIG_DFU_ALT_BOOT_EMMC;
+   break;
+   default:
+   alt_boot = NULL;
+   break;
+   }
+   return alt_boot;
+}
+#endif
+
+static void board_clock_init(void)
+{
+   unsigned int set, clr, clr_src_cpu, clr_pll_con0, clr_src_dmc;
+   struct exynos4x12_clock *clk = (struct exynos4x12_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
+   */
+   clr_src_cpu = MUX_APLL_SEL(1) | MUX_CORE_SEL(1) |
+ MUX_HPM_SEL(1) | MUX_MPLL_USER_SEL_C(1);
+   set = MUX_APLL_SEL(0) | 

[U-Boot] [PATCH v7 04/12] board:samsung: check the boot device and init the right mmc driver.

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

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes V3:
- separate two changes into two commits

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

Changes V5:
- none

Changes V6:
- update boot mode name
---
 board/samsung/common/board.c | 37 +++--
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 9dc7c83..1fa0e51 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -240,22 +240,39 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
+static int init_mmc(void)
+{
+#ifdef CONFIG_SDHCI
+   return exynos_mmc_init(gd-fdt_blob);
+#else
+   return 0;
+#endif
+}
+
+static int init_dwmmc(void)
 {
-   int ret;
 #ifdef CONFIG_DWMMC
-   /* dwmmc initializattion for available channels */
-   ret = exynos_dwmmc_init(gd-fdt_blob);
-   if (ret)
-   debug(dwmmc init failed\n);
+   return exynos_dwmmc_init(gd-fdt_blob);
+#else
+   return 0;
 #endif
+}
+
+int board_mmc_init(bd_t *bis)
+{
+   int ret;
+
+   if (get_boot_mode() == BOOT_MODE_SD) {
+   ret = init_mmc();
+   ret |= init_dwmmc();
+   } else {
+   ret = init_dwmmc();
+   ret |= init_mmc();
+   }
 
-#ifdef CONFIG_SDHCI
-   /* mmc initializattion for available channels */
-   ret = exynos_mmc_init(gd-fdt_blob);
if (ret)
debug(mmc init failed\n);
-#endif
+
return ret;
 }
 #endif
-- 
1.9.1

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


[U-Boot] [PATCH v7 12/12] odroid: add odroid_config

2014-07-30 Thread Przemyslaw Marczak
This config is valid for two devices:
- Odroid X2,
- Odroid U3.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Tom Rini tr...@ti.com

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

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

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

Changes v6:
- odroid.h: fix ramdisk load issue
---
 boards.cfg   |   1 +
 doc/README.odroid| 143 +++
 include/configs/odroid.h | 216 +++
 3 files changed, 360 insertions(+)
 create mode 100644 doc/README.odroid
 create mode 100644 include/configs/odroid.h

diff --git a/boards.cfg b/boards.cfg
index 8e2db82..458c500 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -293,6 +293,7 @@ Active  arm armv7  exynos  samsung  
   smdk5420
 Active  arm armv7  exynos  samsung smdkv310
smdkv310  - 

Chander Kashyap k.chan...@samsung.com
 Active  arm armv7  exynos  samsung trats   
trats - 

Lukasz Majewski l.majew...@samsung.com
 Active  arm armv7  exynos  samsung trats2  
trats2- 

Piotr Wilczek p.wilc...@samsung.com
+Active  arm armv7  exynos  samsung odroid  
odroid- 

Przemyslaw Marczak p.marc...@samsung.com
 Active  arm armv7  exynos  samsung universal_c210  
s5pc210_universal - 

Przemyslaw Marczak p.marc...@samsung.com
 Active  arm armv7  highbank-   highbank
highbank  - 

Rob Herring r...@kernel.org
 Active  arm armv7  keystoneti  k2hk_evm
k2hk_evm  - 

Vitaly Andrianov vita...@ti.com
diff --git a/doc/README.odroid b/doc/README.odroid
new file mode 100644
index 000..528bb95
--- /dev/null
+++ b/doc/README.odroid
@@ -0,0 +1,143 @@
+ U-boot for Odroid X2/U3
+
+
+1. Summary
+==
+This is a quick instruction for setup Odroid boards based on Exynos4412.
+Board config: odroid_config
+
+2. Supported devices
+
+This U-BOOT config can be used on two boards:
+- Odroid U3
+- Odroid X2
+with CPU Exynos 4412 rev 2.0 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:
+http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=downloadvalue=boot.tar.gz
+or here:
+http://odroid.in/guides/ubuntu-lfs/boot.tar.gz
+
+4. Boot media layout
+
+The table below shows SD/eMMC cards layout for U-boot.
+The block offset is starting from 0 and the block size is 512B.
+ -
+|  Binary   | Block offset| part type |
+|   name| SD   | eMMC |(eMMC only)|
+ -
+| Bl1   | 1| 0|  1 (boot) |
+| Bl2   | 31   | 30   |  1 (boot) |
+| U-boot| 63   | 62   |  1 (boot) |
+| Tzsw  | 2111 | 2110 |  1 (boot) |
+| Uboot Env | 2500 | 2500 |  0 (user) |
+ -
+
+5. Prepare the SD boot card - with SD card reader

[U-Boot] [PATCH v7 02/12] exynos: pinmux: fix the gpio names for exynos4x12 mmc

2014-07-30 Thread Przemyslaw Marczak
This change fixes the bad gpio configuration for the exynos dwmmc.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Beomho Seo beomho@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Jaehoon Chung jh80.ch...@samsung.com
---
 arch/arm/cpu/armv7/exynos/pinmux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 86a0c75..b929486 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -704,8 +704,8 @@ static int exynos4x12_mmc_config(int peripheral, int flags)
ext_func = S5P_GPIO_FUNC(0x3);
break;
case PERIPH_ID_SDMMC4:
-   start = EXYNOS4_GPIO_K00;
-   start_ext = EXYNOS4_GPIO_K13;
+   start = EXYNOS4X12_GPIO_K00;
+   start_ext = EXYNOS4X12_GPIO_K13;
func = S5P_GPIO_FUNC(0x3);
ext_func = S5P_GPIO_FUNC(0x4);
break;
-- 
1.9.1

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


[U-Boot] [U-boot] Origen board boot failed with 2014.07 source code

2014-07-30 Thread TigerLiu
Hi, singh:

I have an Origen(Cortex-A9 Dual Core, Exynos 4210) development
board.(InSignal produced) 

I followed below steps to verify the latest u-boot release code:

1. build uboot

make origen_config

make all



then it will origen-spl.bin in spl dir.

2. run dd command to burn raw images into a SD Card.

   dd iflag=dsync oflag=dsync if=./origen-spl.bin of=/dev/sdb bs=512

dd iflag=dsync oflag=dsync if=./u-boot.bin of=/dev/sdb bs=512 seek=65

 

but nothing appeared in a UART terminal.

 

Best wishes,

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


Re: [U-Boot] [PATCH 3/3] test: ums: Add script for testing UMS gadget operation

2014-07-30 Thread Lukasz Majewski
Hi Stephen,

 On 07/29/2014 07:45 AM, Lukasz Majewski wrote:
  This commit adds new test for UMS USB gadget to u-boot mainline
  tree. It it similar in operation to the one already available in
  test/dfu directory.
 
 Patches 1 and 2,
 Acked-by: Stephen Warren swar...@nvidia.com
 
 For this patch, I wonder whether:
 
 a) Should it do some raw dd tests too, for partitions/devices without
 a filesystem? Perhaps we should have separate scripts (for each of
 DFU and UMS) for filesystem and raw testing. So, this could be
 addressed later.

I think that we should prepare separate scripts. One script per tested
functionality.

 
 b) Should this script (optionally?) create the filesystem itself, so
 the test is completely self-contained. Otherwise, the user has to
 manually run e.g. parted and mk*fs themselves, by which time they've
 already tested UMS a fair bit without this script.

The test should be extended to accept an additional flat - e.g.
--create_fs.
As you pointed out, this could save some time.

 
 c) Do we really need the Y parameters (filesystem type) to the
 script? mount will automatically try all known filesystem types on
 my Linux host at least, and it would make it simpler to run the
 script if you simply dropped the -t option to mount.

I agree. The Y parameter will be removed and we will allow mount to do
the job.

 
  diff --git a/test/ums/README b/test/ums/README
 
  +Example usage:
  +1. On the target:
  +   create UMS exportable partition with a proper file system
  created on
  +   it (e.g. EXT4, FAT).
  +   ums 0 mmc 0
  +2. On the host:
  +   sudo test/ums/ums_gadget_test.sh X Y dir [test_file]
  +   e.g. sudo test/ums/ums_gadget_test.sh 1 vfat /mnt ./dat_14M.img
 
 can you s/X/PARTNUM/ s/Y/fstype/ here. That'd make the example
 command a bit more explanatory even without the paragraph below that
 explains what X and Y are, and also make it easier to correlate the
 description with the command.

Ok, I will do that.

 
  +
  +... where X is the partition number on which UMS operates and the
  Y is +the file system. The 'dir' parameter is the mount directory
  on the HOST. +Information about available partitions one can read
  from target via the +'mmc part' command.
 
 Perhaps this should say:
 'mmc part' or 'part list' commands.

Ok.

 
  +The optional [test_file] parameter is for specifying the exact
  test file +to use.
  \ No newline at end of file
 
 That's probably not right.

Ok.

 
  diff --git a/test/ums/ums_gadget_test.sh
  b/test/ums/ums_gadget_test.sh
 
  +../dfu/dfu_gadget_test_init.sh 33M 97M
 
 I'm just curious what's special about those two sizes.

Nothing special. I just wanted to have sufficiently large files to test
UMS capabilities (since I assume, that DFU will not transfer so large
files very often).

With UMS it is not so important to test the corner cases values (as we
did with DFU tests), but to check how well transfers of large files is
performed.

 
  +ums_test_file () {
 
  +mount -t $2 /dev/$MEM_DEV $MNT_DIR
  +if [ -f $MNT_DIR/dat_* ]; then
  +   rm $MNT_DIR/dat_*
  +fi
  +sync
  +
  +cp ./$1 $MNT_DIR
  +sync
  +umount $MNT_DIR
 
 I'm not sure any of those syncs are necessary; mount should sync
 as part of its own operation.

Yes, I agree. mount/umount do the sync as well. I will fix this.

 
  +MD5_TX=$MD5SUM
  +sleep 1
 
 Why do we need to sleep?

On my linux box there were some problems without this delay (probably
caused by time needed for plugging in USB device).

Maybe on your setup it will work smoothly.

 
  +if [ $# -lt 3 ]; then
  +   echo Wrong number of arguments
  +   echo Example:
  +   echo sudo ./ums_gadget_test.sh 1 vfat /mnt [test_file]
  +   die
  +fi
  +
  +MNT_DIR=$3
 
 I think here, we should assign all positional arguments to named 
 variables rather than using $1/... later on; something like:
 
 PART_NUM=$1; shift
 FSTYPE=$1; shift
 MNT_DIR=$1; shift
 TEST_FILES=$@
 

Ok.

 For MNT_DIR, can we simply create a temporary directory (e.g. 
 /mnt/tmp-ums-test-$$) so the user doesn't have to pass in the name?
 The script requires root after all.

Ok.

 
  +MEM_DEV=`dmesg | tail -n 10 | grep -E  sd[a-z]: - | cut -d ':'
  -f 1` +MEM_DEV=$(echo $MEM_DEV | cut -d ']' -f2 | tr -d ' ')
 
 May as well use `` or $() consistently for those two lines.

According to the reply written below, we will not need this code.

 
 This seems slightly dangerous; what if my system has been plugged in
 for a long time and I've plugged in some other USB storage device
 since. Better to take the device name on the command-line, or perhaps
 to take the USB VID/PID on the command-line, then scan sysfs for a
 USB device with matching VID/PID, and find out what device node is
 hosted by it.

Your proposition is more reliable. I think that the idProduct/idVendor
shall be passed to the script.

 
  \ No newline at end of file
 
 Probably should fix that too.

Ok.

 
 Can you add a trap handler so that if the user CTRL-C's the script,

Re: [U-Boot] [PATCH v1 2/4] get_maintainer.pl: import script from linux 3.15

2014-07-30 Thread Simon Glass
Hi Daniel,

On 26 July 2014 19:54, Daniel Schwierzeck daniel.schwierz...@gmail.com wrote:
 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com

Can you please check this? I see differences between this script and
the Linux v3.15 version (commit 1860e37).

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 3/4] get_maintainer.pl: adapt to U-Boot tree

2014-07-30 Thread Simon Glass
On 26 July 2014 19:54, Daniel Schwierzeck daniel.schwierz...@gmail.com wrote:
 Switch core maintainer to Tom Rini. Adapt directory layout for
 git tree detection.

 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com

Tested with some local patches and patman.

Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Can not boot Linux with new FIT image on ARMv8

2014-07-30 Thread Simon Glass
Hi,

On 29 July 2014 10:04, Duxiaoqiang duxiaoqi...@huawei.com wrote:
 Hi All:

 I am trying to make use of verified Uboot on ARMv8 FVP platform.
 I setup environment followed the below procedure, but failed after entered 
 Linux kernel.
 There was nothing prompt information except Starting kernel.
 Operation procedure as bellow:

 1)  Add 
 CONFIG_OF_CONTROL/CONFIG_RSA/CONFIG_FIT_SIGNATURE/CONFIG_FIT/CONFIG_OF_SEPARATE
  to vexpress_aemv8a.h

 2)   Generate RSA keys use openssl tool

 3)  Create a kernel.its file that used to build the FIT image

 / {

 description = Chrome OS kernel image with one or more FDT blobs;

 #address-cells = 1;



 images {

kernel@1 {

  description = kernel image;

 data = /incbin/(Image.gz);

 type = kernel_noload;

 arch = arm64;

 os = linux;

 compression = gzip;

 load = 0x8900;

 entry = 0x8900;

 kernel-version = 1;

 signature@1 {

  algo = sha1,rsa2048;

  key-name-hint = dev;

 };

};

fdt@1 {

 description = fdb blob;

 data = /incbin/(atf_psci.dtb);

 type = flat_dt;

 arch = arm64;

 compression = none;

 fdt-version = 1;

 signature@1 {

  algo = sha1,rsa2048;

  key-name-hint = dev;

 };

};

  ramsidk@1 {

ramdisk


  description=ramdisk;

  data = /incbin/(filesystem.cpio.gz);

  type = ramdisk;

 arch = arm64;

 os = linux;

 compression = gzip;

 load = 0xaa00;

 entry = 0xaa00;

 signature@1 {

  algo = sha1,rsa2048;

  key-name-hint = dev;

 };

  };

 };

 configurations {

default = conf@1;

conf@1 {

 kernel = kernel@1;

 fdt = fdt@1;

  ramdisk = ramdisk@1;

};

 };

 };



 4)  Get the Image.gz and atf_psci.dtb and ramdisk file(These images and 
 device tree blob files are verified before with old uImage format, and they 
 are ok)

 5)  Build Uboot enanbled FDT:

 # make vexpress_aemv8a_config

 # make CROSS_COMPILE= DEVICE_TREE=atf_psci all

 Before compile, CONFIG_OF_SEPARATE has been added to vexpress_aemv8a.h; Also 
 atf_psci.dts file was added to arch/arm/dts directory.

 After build , u-boot-dtb.bin file was generated.
 6)  Build and signed FIT image as:

# cp atf_psco.dtb atf_psci_public.dtb

 # mkimage -D -I dts -O dtb -p 2000 -F -f kernel.its -k key -K 
 atf_psci_public.dtb -r image.fit
 7)  Build FDT uboot with public key
 # make CROSS_COMPILE= EXT_DTB=/WORK/atf_psci_public.dtb
 And public key attached u-boot-dtb.bin file was generated.
 8)  Load FIT image image.fit to address 0xc304 on Foundation

 The images are verified successful, however system hangs after enter Linux.
 I debugged Linux kernel with console output, and found that before function 
 start_kernel be called it is normal.
 (After __turn_mmu_on function on kernel, the MMU was enabled, and my console 
 output is invalid for not been mapped. So my debug was stopped before 
 start_kernel. But I believe there is no obstacle between __turn_mmu_on 
 function and start_kernel function).
 And also, I checked the input parameter fdt_blob for kernel, the address 
 seems normal.

 This problem has confused me several days, I will appreciated if you can give 
 me susggestions.

You could try 'setenv verify n' to turn off verification. That will
make sure that the problem is actually related to verified boot. Does
the image boot OK without verified boot?

It says:

Loading Device Tree to 9fe0, end 9fe04a91 ... 
 fdt_rsv_mem_addr = c32b2540

Is that a valid address? What addresses are the kernel, FDT and
ramdisk loaded to when you use the legacy image?

Everything looks OK to me on the U-Boot side.

 Logs are bellow.
 =Logs are bellow===
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
 Booting trusted firmware boot loader stage 1
 Built : 10:44:52, Jul 29 2014
 Booting trusted firmware boot loader stage 2
 BL2 Built : 10:44:54, Jul 29 2014
 Booting trusted firmware boot loader stage 3
 BL31 Built : 10:44:56, Jul 29 2014
 BL33 image pc = 0x8800

 U-Boot 2014.07-rc4 (Jul 29 2014 - 10:43:19) vexpress_aemv8a

 U-Boot code: 8800 - 88039BF0  BSS: - 8806FB00
 monitor len: 0006FB00
 ramsize: 7800
 Top of RAM usable for U-Boot at: 1
 

Re: [U-Boot] [PATCH v8 07/13] tools: add genboardscfg.py

2014-07-30 Thread Tom Rini
On Wed, Jul 30, 2014 at 02:08:19PM +0900, Masahiro Yamada wrote:

 Now the primary data for each board is in Kconfig, defconfig and
 MAINTAINERS.
 
 It is true boards.cfg is needed for MAKEALL and buildman and might be
 useful to brouse all the supported boards in a single database.
 But it would be painful to maintain the boards.cfg in sync.
 
 So, this is the solution.
 Add a tool to generate the equivalent boards.cfg file based on
 the latest Kconfig, defconfig and MAINTAINERS.
 
 We can keep all the functions of MAKEALL and buildman with it.
 
 The best thing would be to change MAKEALL and buildman for not
 depending on boards.cfg in the future, but it would take some time.
[snip]
 +def get_make_cmd():
 +Get the command name of GNU Make.
 +try:
 +make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
 +except subprocess.CalledProcessError:
 +print  sys.stderr, 'GNU Make not found'
 +sys.exit(1)
 +return make_cmd.rstrip()

So subprocess.check_output comes from Python 2.7 and Ubuntu 10.04 ships
with 2.6.  This isn't a deal-breaker as I'm working on updating the two
calls here now (and we'll set aside mailmapper, that's not going to be
commonly used I think).

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Tom Rini
The function subprocess.check_output() only exists in Python 2.7 and
later (and there are long term supported distributions that ship with
2.6.x).  Replace this with a call to subprocess.Popen() and then checking
output via communicate()

Signed-off-by: Tom Rini tr...@ti.com
---
 tools/genboardscfg.py |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
index 805e4eb..6588392 100755
--- a/tools/genboardscfg.py
+++ b/tools/genboardscfg.py
@@ -83,7 +83,8 @@ def check_top_directory():
 def get_make_cmd():
 Get the command name of GNU Make.
 try:
-make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
+process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
+make_cmd, unused = process.communicate()
 except subprocess.CalledProcessError:
 print  sys.stderr, 'GNU Make not found'
 sys.exit(1)
@@ -493,8 +494,10 @@ def main():
 sys.exit(1)
 else:
 try:
-jobs = int(subprocess.check_output(['getconf',
-'_NPROCESSORS_ONLN']))
+process = subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
+   stdout=subprocess.PIPE)
+jobstr, unused = process.communicate()
+jobs = int(jobstr)
 except subprocess.CalledProcessError:
 print 'info: failed to get the number of CPUs. Set jobs to 1'
 jobs = 1
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH v8 07/13] tools: add genboardscfg.py

2014-07-30 Thread Simon Glass
Hi Tom,

On 30 July 2014 15:07, Tom Rini tr...@ti.com wrote:
 On Wed, Jul 30, 2014 at 02:08:19PM +0900, Masahiro Yamada wrote:

 Now the primary data for each board is in Kconfig, defconfig and
 MAINTAINERS.

 It is true boards.cfg is needed for MAKEALL and buildman and might be
 useful to brouse all the supported boards in a single database.
 But it would be painful to maintain the boards.cfg in sync.

 So, this is the solution.
 Add a tool to generate the equivalent boards.cfg file based on
 the latest Kconfig, defconfig and MAINTAINERS.

 We can keep all the functions of MAKEALL and buildman with it.

 The best thing would be to change MAKEALL and buildman for not
 depending on boards.cfg in the future, but it would take some time.
 [snip]
 +def get_make_cmd():
 +Get the command name of GNU Make.
 +try:
 +make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
 +except subprocess.CalledProcessError:
 +print  sys.stderr, 'GNU Make not found'
 +sys.exit(1)
 +return make_cmd.rstrip()

 So subprocess.check_output comes from Python 2.7 and Ubuntu 10.04 ships
 with 2.6.  This isn't a deal-breaker as I'm working on updating the two
 calls here now (and we'll set aside mailmapper, that's not going to be
 commonly used I think).

We could use tools/patman/command.py's OutputOneLine().

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Driver Model and DTS Parsing

2014-07-30 Thread Simon Glass
Hi Stephen,

On 12 June 2014 23:31, Stephen Warren swar...@wwwdotorg.org wrote:
 On 06/11/2014 10:55 PM, Simon Glass wrote:
 ...
 Tegra doesn't have much in the device tree for GPIOs - it seems to be
 all hard-coded in the software. So I ended up with the code you saw
 which just iterates over a known number of banks, creating a device
 for each.

 That still sounds wrong. Tegra HW has a single GPIO controller that
 exposes a bunch of GPIOs. It isn't logically divided into banks or any
 other construct that is multi-level  Although the naming of the
 individual GPIOs does call something a bank, that's just a name of a
 register, not separate HW blocks. It's just going to be confusing to
 users if the U-Boot representation doesn't match what the HW actually has.

I'm getting back to this as I just re-issued the series.

I don't see the mismatch you are referring to here. U-Boot people are
used to seeing GPIOs as named banks, and the Tegra TRM uses bank names
also.


 There's zero extra indirection caused by SW correctly describing the HW
 as a single bank. I have absolutely no idea what you mean my extra
 indirection here; any time there is a driver for a GPIO, you call a
 function to set a GPIO. That doesn't change based on whether there are
 32 or 1 GPIO controller drivers.  The only difference is how many
 drivers you have to search through to find the right one. For Tegra at
 least, I'm arguing for 1 driver to match the 1 HW module.

OK let me explain a bit more.

At the moment, the GPIO uclass supports a single GPIO bank, defined as
something that has a name, like A, or B. Within that bank there can be
several individual GPIO lines. This is what the Tegra TRM refers to as
A0, A1, B0, B1, etc.

Should we wish to support banks A-Z, AA, BB, etc. all as a single GPIO
device, we would need to redo the uclass to support this. It would
need to support having more than one bank (a one-to-many relationship)
and thus we would need a second-level data structure to hold the bank
names of each bank. In that case each GPIO device would hold a list of
banks, each bank having a set of GPIOs. The 'gpio' command would need
to query the device for the list of available banks and use that in
decoding its command line parameters.

The list of banks is the secondary data structure that I am referring
to, and is what I would like to avoid for now, given that in U-Boot
devices can have children. It may be in the future that we end up
going that way, but so far I would prefer to avoid secondary data
structures and keep things really simple.


 DT is supposed to represent the differences between boards more than the
 differences between SoCs. Anything that the driver can reasonably derive
 from the compatible value shouldn't be represented in the DT. That's why
 the Tegra GPIO DT node just has a compatible value, register address,
 and list of interrupts. Nothing more is required. If anything else were
 put in DT, you'd end up just wasting time parsing from DT static data
 that could just be in the driver.

This is fine, although it is entirely a trade-off between code and
data. Some SoCs use the device tree to specify differences between the
SoCs (e.g. pinmux on exynos) and some don't. There doesn't seem to be
a hard-and-fast rule. In this case I was just expressing the fact that
the device tree is not really used for the GPIO devices on Tegra.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 07/13] tools: add genboardscfg.py

2014-07-30 Thread Tom Rini
On Wed, Jul 30, 2014 at 04:12:09PM +0100, Simon Glass wrote:
 Hi Tom,
 
 On 30 July 2014 15:07, Tom Rini tr...@ti.com wrote:
  On Wed, Jul 30, 2014 at 02:08:19PM +0900, Masahiro Yamada wrote:
 
  Now the primary data for each board is in Kconfig, defconfig and
  MAINTAINERS.
 
  It is true boards.cfg is needed for MAKEALL and buildman and might be
  useful to brouse all the supported boards in a single database.
  But it would be painful to maintain the boards.cfg in sync.
 
  So, this is the solution.
  Add a tool to generate the equivalent boards.cfg file based on
  the latest Kconfig, defconfig and MAINTAINERS.
 
  We can keep all the functions of MAKEALL and buildman with it.
 
  The best thing would be to change MAKEALL and buildman for not
  depending on boards.cfg in the future, but it would take some time.
  [snip]
  +def get_make_cmd():
  +Get the command name of GNU Make.
  +try:
  +make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
  +except subprocess.CalledProcessError:
  +print  sys.stderr, 'GNU Make not found'
  +sys.exit(1)
  +return make_cmd.rstrip()
 
  So subprocess.check_output comes from Python 2.7 and Ubuntu 10.04 ships
  with 2.6.  This isn't a deal-breaker as I'm working on updating the two
  calls here now (and we'll set aside mailmapper, that's not going to be
  commonly used I think).
 
 We could use tools/patman/command.py's OutputOneLine().

That feels like a lot of code to borrow, or should we be able to just
import and use it?  And would you mind reviewing the patch I posted that
switches over to subprocess.Popen() ?  Thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] test mail

2014-07-30 Thread Masahiro Yamada
Sorry for noise.
---
 README | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README b/README
index f704eb3..b634ee0 100644
--- a/README
+++ b/README
@@ -6406,3 +6406,4 @@ Notes:
   u-boot mailing list. Bigger patches will be moderated. If they are
   reasonable and not too big, they will be acknowledged. But patches
   bigger than the size limit should be avoided.
+a
-- 
1.9.1

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


Re: [U-Boot] [PATCH v5 05/11] exynos: dts: Adjust device tree files for U-Boot

2014-07-30 Thread Simon Glass
Hi Tom,

On 28 July 2014 21:27, Tom Rini tr...@ti.com wrote:
 On Mon, Jul 28, 2014 at 06:11:32AM -0600, Simon Glass wrote:

 The pinctrl bindings used by Linux are an incomplete description of the
 hardware. It is possible in most cases to determine the register address
 of each, but not in all cases. By adding an additional property we can
 fix this, and avoid adding a table to U-Boot for every single Exynos
 SOC.

 So here's my fear..

 [snip]
 @@ -49,7 +57,7 @@
   i2c@12ca {
   #address-cells = 1;
   #size-cells = 0;
 - compatible = samsung,s3c2440-i27c;
 + compatible = samsung,s3c2440-i2c;
   reg = 0x12CA 0x100;
   interrupts = 0 60 0;
   };

 Except for the above (what's going on? pulling in a typo fix from
 upstream?) they're legal regular non-U-Boot-prefixed changes.  Are
 they going back into the master copy in Linux?

Oops I missed this email. The typo is just my mistake - we don't need
this change and the typo is in the previous patch.


 diff --git a/arch/arm/dts/exynos5420-pinctrl.dtsi 
 b/arch/arm/dts/exynos5420-pinctrl.dtsi
 index b3e63d1..df31f37 100644
 --- a/arch/arm/dts/exynos5420-pinctrl.dtsi
 +++ b/arch/arm/dts/exynos5420-pinctrl.dtsi
 @@ -13,6 +13,18 @@
  */

  / {
 + /* Replicate the ordering of arch/arm/include/asm/arch-exynos/gpio.h */
 + pinctrl@1401 {
 + };
 + pinctrl@1340 {
 + };
 + pinctrl@1341 {
 + };
 + pinctrl@1400 {
 + };
 + pinctrl@0386 {
 + };

 So this isn't going to head back to Linux, clearly...

 Is there some way we can contain our changes under includes perhaps?

I hope that this one could go away, since the order of GPIOs doesn't
ultimately matter. At present we assume a particular order due to the
numbering of GPIOs. But once we move to named GPIOs in the device tree
we can drop this ordering patch.

In general, yes we could create a new include file for the U-Boot
device tree additions.

We might be able to send these up to the kernel as they are pretty
harmless and do describe the hardware. Perhaps the kernel people will
push back on the basis that they are unnecessary for the kernel. I'm
not sure. What do you think?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 07/13] tools: add genboardscfg.py

2014-07-30 Thread Simon Glass
Hi Tom,

On 30 July 2014 16:22, Tom Rini tr...@ti.com wrote:
 On Wed, Jul 30, 2014 at 04:12:09PM +0100, Simon Glass wrote:
 Hi Tom,

 On 30 July 2014 15:07, Tom Rini tr...@ti.com wrote:
  On Wed, Jul 30, 2014 at 02:08:19PM +0900, Masahiro Yamada wrote:
 
  Now the primary data for each board is in Kconfig, defconfig and
  MAINTAINERS.
 
  It is true boards.cfg is needed for MAKEALL and buildman and might be
  useful to brouse all the supported boards in a single database.
  But it would be painful to maintain the boards.cfg in sync.
 
  So, this is the solution.
  Add a tool to generate the equivalent boards.cfg file based on
  the latest Kconfig, defconfig and MAINTAINERS.
 
  We can keep all the functions of MAKEALL and buildman with it.
 
  The best thing would be to change MAKEALL and buildman for not
  depending on boards.cfg in the future, but it would take some time.
  [snip]
  +def get_make_cmd():
  +Get the command name of GNU Make.
  +try:
  +make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
  +except subprocess.CalledProcessError:
  +print  sys.stderr, 'GNU Make not found'
  +sys.exit(1)
  +return make_cmd.rstrip()
 
  So subprocess.check_output comes from Python 2.7 and Ubuntu 10.04 ships
  with 2.6.  This isn't a deal-breaker as I'm working on updating the two
  calls here now (and we'll set aside mailmapper, that's not going to be
  commonly used I think).

 We could use tools/patman/command.py's OutputOneLine().

 That feels like a lot of code to borrow, or should we be able to just
 import and use it?  And would you mind reviewing the patch I posted that
 switches over to subprocess.Popen() ?  Thanks!

Yes it is a lot of code. You can just import and borrow it so long as
it is available on the python path. See tools/buildman/buildman.py for
the code:

# Bring in the patman libraries
our_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(our_path, '../patman'))

I didn't see that patch you mention, will take a look.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 09/16] dm: exynos: Move serial to driver model

2014-07-30 Thread Tom Rini
On Wed, Jul 30, 2014 at 03:49:46AM -0600, Simon Glass wrote:

 Change the Exynos serial driver to work with driver model and switch over
 all Exynos5 boards to use it.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 
 Changes in v3:
 - Avoid reordering functions

Yay.

 @@ -108,14 +91,11 @@ static int serial_init_dev(const int dev_index)
   /* No interrupts, no DMA, pure polling */
   writel(0x245, uart-ucon);
  
 - serial_setbrg_dev(dev_index);
 -
   return 0;
  }

So setbrg is called elsewhere, in a more common area?  That's documented
somewhere right?  This seems otherwise to be a straight-forward
conversion.  Things we used to loop for in the driver are now handled a
bit higher up and otherwise we find what to talk to in a slightly
different manner.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 09/16] dm: exynos: Move serial to driver model

2014-07-30 Thread Simon Glass
Hi Tom,

On 30 July 2014 16:38, Tom Rini tr...@ti.com wrote:
 On Wed, Jul 30, 2014 at 03:49:46AM -0600, Simon Glass wrote:

 Change the Exynos serial driver to work with driver model and switch over
 all Exynos5 boards to use it.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

 Changes in v3:
 - Avoid reordering functions

 Yay.

 @@ -108,14 +91,11 @@ static int serial_init_dev(const int dev_index)
   /* No interrupts, no DMA, pure polling */
   writel(0x245, uart-ucon);

 - serial_setbrg_dev(dev_index);
 -
   return 0;
  }

 So setbrg is called elsewhere, in a more common area?  That's documented
 somewhere right?

Yes, and sort-of. Since you don't have a baud rate at init time you
could only set a default value anyway. I'll add a comment to the
serial.h uclass.

 This seems otherwise to be a straight-forward
 conversion.  Things we used to loop for in the driver are now handled a
 bit higher up and otherwise we find what to talk to in a slightly
 different manner.

Yes it's not too bad, if you ignore all the multi-serial mush being
deleted. I felt that looping in a driver waiting for a character was a
bad idea (how serial_getc() used to work).

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Simon Glass
Hi Tom,

On 30 July 2014 15:24, Tom Rini tr...@ti.com wrote:
 The function subprocess.check_output() only exists in Python 2.7 and
 later (and there are long term supported distributions that ship with
 2.6.x).  Replace this with a call to subprocess.Popen() and then checking
 output via communicate()

 Signed-off-by: Tom Rini tr...@ti.com

Looks fine as it is - see a few optional comments below.

Acked-by: Simon Glass s...@chromium.org

 ---
  tools/genboardscfg.py |9 ++---
  1 files changed, 6 insertions(+), 3 deletions(-)

 diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
 index 805e4eb..6588392 100755
 --- a/tools/genboardscfg.py
 +++ b/tools/genboardscfg.py
 @@ -83,7 +83,8 @@ def check_top_directory():
  def get_make_cmd():
  Get the command name of GNU Make.
  try:
 -make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
 +process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
 +make_cmd, unused = process.communicate()

Sometimes people use underscore for unused variables, like:

   make_cmd, _ = process.communicate()

but in this case you could also do:

   make_cmd = process.communicate()[0]

  except subprocess.CalledProcessError:
  print  sys.stderr, 'GNU Make not found'
  sys.exit(1)
 @@ -493,8 +494,10 @@ def main():
  sys.exit(1)
  else:
  try:
 -jobs = int(subprocess.check_output(['getconf',
 -'_NPROCESSORS_ONLN']))
 +process = subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
 +   stdout=subprocess.PIPE)
 +jobstr, unused = process.communicate()
 +jobs = int(jobstr)
  except subprocess.CalledProcessError:
  print 'info: failed to get the number of CPUs. Set jobs to 1'
  jobs = 1
 --
 1.7.0.4

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Driver Model and DTS Parsing

2014-07-30 Thread Stephen Warren

On 07/30/2014 09:26 AM, Simon Glass wrote:

Hi Stephen,

On 12 June 2014 23:31, Stephen Warren swar...@wwwdotorg.org wrote:

On 06/11/2014 10:55 PM, Simon Glass wrote:
...

Tegra doesn't have much in the device tree for GPIOs - it seems to be
all hard-coded in the software. So I ended up with the code you saw
which just iterates over a known number of banks, creating a device
for each.


That still sounds wrong. Tegra HW has a single GPIO controller that
exposes a bunch of GPIOs. It isn't logically divided into banks or any
other construct that is multi-level  Although the naming of the
individual GPIOs does call something a bank, that's just a name of a
register, not separate HW blocks. It's just going to be confusing to
users if the U-Boot representation doesn't match what the HW actually has.


I'm getting back to this as I just re-issued the series.

I don't see the mismatch you are referring to here. U-Boot people are
used to seeing GPIOs as named banks, and the Tegra TRM uses bank names
also.


The mismaatch is that in HW, there is a single GPIO controller that has 
a large number of GPIOs, not a number of GPIO controllers that each has 
a smaller number of GPIOs.


U-Boot's commands/APIs/... should model this directly; a single 
controller object that has a large number of GPIOs within it.


As such, an example user-visible GPIO command needs to be roughly 
something like:


# using integer IDs
gpio set tegra 128
 ^^^^ (controller instance name) (GPIO ID)
or:

# using names within the controller
gpio set tegra PQ0
 ^^^^ (controller instance name) (GPIO name)

(note that there must be separate controller ID and GPIO ID parameters 
in the commands in order to e.g. differentiate between 2 instances of 
the same I2C GPIO expander chip; something like pca9555@a0@i2c0, 
pca9555@i2c1@a4)


not:

gpio set tegraP 10
 ^^ ^^ (hypothetical bank name) (GPIO ID within bank)

or:

gpio set P10
 ^^ GPIO name without any controller ID


There's zero extra indirection caused by SW correctly describing the HW
as a single bank. I have absolutely no idea what you mean my extra
indirection here; any time there is a driver for a GPIO, you call a
function to set a GPIO. That doesn't change based on whether there are
32 or 1 GPIO controller drivers.  The only difference is how many
drivers you have to search through to find the right one. For Tegra at
least, I'm arguing for 1 driver to match the 1 HW module.


OK let me explain a bit more.

At the moment, the GPIO uclass supports a single GPIO bank, defined as
something that has a name, like A, or B.


The GPIO bank name should just be Tegra. The Tegra TRM specifies a 
single GPIO controller, in the address map etc., and there should be a 
single U-Boot object that represents it.  Really the phrase bank in 
U-Boot needs to be replaced with controller.


 Within that bank there can be

several individual GPIO lines. This is what the Tegra TRM refers to as
A0, A1, B0, B1, etc.


While the TRM does use the phrase bank, I believe this is just a 
collision with the term you happened to choose. It's not used for the 
same semantic purposes. There's no intent to divide the Tegra GPIO 
controller into a bunch of logically separate HW blocks. bank in the 
TRM is just a convenient word to refer the fact that more than 32 GPIOs 
are supported, so they don't all fit into a single 32-bit register.


So, the semantics of the HW are:

A single GPIO controller named tegra.

Within that, there are a bunch of GPIOs. Each has a number e.g. 0..250 
(for Tegra124) and a name (PA0, PA1, ... PA7, PB0, PB1, ..., PFF2). 
Users should be able to refer to those GPIOs either by integer ID, or by 
name.


To support this, the GPIO uclass would need:

* A string name for the controller

* A set of functions/ops to manipulate the GPIOs (e.g. set input, set 
output, set output value) that accept integer IDs as the parameter for 
the GPIO ID.


* If GPIOs have names as well as numbers, an optional function to 
convert a string name to an integer GPIO ID.



Should we wish to support banks A-Z, AA, BB, etc. all as a single GPIO
device, we would need to redo the uclass to support this.


No you wouldn't. Just put all the GPIOs into a single uclass instance. 
For naming, you can have the optional string-int conversion function in 
the uclass, or perhaps just ignore names (the kernel operates on 
integers for GPIOs...).


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


Re: [U-Boot] clang sandbox warning

2014-07-30 Thread Simon Glass
Hi Jeroen,

On 10 June 2014 19:38, Jeroen Hofstee jer...@myspectrum.nl wrote:
 Hello Simon,

 While trying to find a u-boot make command which likely works with a
 pre-build clang linux package I got the following warnings:

 `make CC=clang -no-integrated-as HOSTCC=clang -no-integrated-as
 HOST_TOOLS_ALL=y sandbox_config tools`


 /home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:59:17:
 warning: variable 'flags' is uninitialized when used here
 [-Wuninitialized]
 local_irq_save(flags);
^
 /home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:56:21:
 note: initialize the variable 'flags' to silence this warning
 unsigned long flags;
^
 = 0
 /home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:81:17:
 warning: variable 'flags' is uninitialized when used here
 [-Wuninitialized]
 local_irq_save(flags);
^
 /home/jeroen/software/u-boot/arch/sandbox/include/asm/bitops.h:78:21:
 note: initialize the variable 'flags' to silence this warning
 unsigned long flags;
^
 = 0

 I guess gcc accepts this since flags is not actually used. Anyway merely
 mentioned for completeness. You might be interested in:

 /home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:77:6: warning:
 variable 'ret' is used uninitialized whenever 'if' condition is true
 [-Wsometimes-uninitialized]
 if (!rsa) {
 ^~~~
 /home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:94:9: note:
 uninitialized use occurs here
 return ret;
^~~
 /home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:77:2: note:
 remove the 'if' if its condition is always false
 if (!rsa) {
 ^~~
 /home/jeroen/software/u-boot/tools/../lib/rsa/rsa-sign.c:48:9: note:
 initialize the variable 'ret' to silence this warning
 int ret;
^
 = 0

 which actually looks like a bug. And:


 /home/jeroen/software/u-boot/tools/../lib/rsa/rsa-verify.c:59:27:
 warning: comparison of unsigned expression = 0 is always true
 [-Wtautological-compare]
 for (i = key-len - 1; i = 0; i--) {
~ ^  ~


 which looks a bit odd, especially since there is no way to break out of
 the loop and reach the final return statement, which has a comment to
 that it might be useful (equal).

Both of these looks like bugs - I will copy you on a patch (I don't
see a fix from you in patchwork). Thanks for reporting this.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] rsa: Fix two errors in the implementation

2014-07-30 Thread Simon Glass
1. Failure to set the return code correctly
2. Failure to detect the loop end condition when the value is equal to
the modulus.

Reported-by: Jeroen Hofstee jer...@myspectrum.nl
Signed-off-by: Simon Glass s...@chromium.org
---

 lib/rsa/rsa-sign.c   | 1 +
 lib/rsa/rsa-verify.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
index 83f5e87..6905131 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -76,6 +76,7 @@ static int rsa_get_pub_key(const char *keydir, const char 
*name, RSA **rsap)
rsa = EVP_PKEY_get1_RSA(key);
if (!rsa) {
rsa_err(Couldn't convert to a RSA style key);
+   ret = -EINVAL;
goto err_rsa;
}
fclose(f);
diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c
index bcb9063..02e3eeb 100644
--- a/lib/rsa/rsa-verify.c
+++ b/lib/rsa/rsa-verify.c
@@ -54,9 +54,9 @@ static void subtract_modulus(const struct rsa_public_key 
*key, uint32_t num[])
 static int greater_equal_modulus(const struct rsa_public_key *key,
 uint32_t num[])
 {
-   uint32_t i;
+   int i;
 
-   for (i = key-len - 1; i = 0; i--) {
+   for (i = (int)key-len - 1; i = 0; i--) {
if (num[i]  key-modulus[i])
return 0;
if (num[i]  key-modulus[i])
-- 
2.0.0.526.g5318336

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


Re: [U-Boot] Driver Model and DTS Parsing

2014-07-30 Thread Simon Glass
Hi Stephen,

On 30 July 2014 16:47, Stephen Warren swar...@wwwdotorg.org wrote:
 On 07/30/2014 09:26 AM, Simon Glass wrote:

 Hi Stephen,

 On 12 June 2014 23:31, Stephen Warren swar...@wwwdotorg.org wrote:

 On 06/11/2014 10:55 PM, Simon Glass wrote:
 ...

 Tegra doesn't have much in the device tree for GPIOs - it seems to be
 all hard-coded in the software. So I ended up with the code you saw
 which just iterates over a known number of banks, creating a device
 for each.


 That still sounds wrong. Tegra HW has a single GPIO controller that
 exposes a bunch of GPIOs. It isn't logically divided into banks or any
 other construct that is multi-level  Although the naming of the
 individual GPIOs does call something a bank, that's just a name of a
 register, not separate HW blocks. It's just going to be confusing to
 users if the U-Boot representation doesn't match what the HW actually
 has.


 I'm getting back to this as I just re-issued the series.

 I don't see the mismatch you are referring to here. U-Boot people are
 used to seeing GPIOs as named banks, and the Tegra TRM uses bank names
 also.


 The mismaatch is that in HW, there is a single GPIO controller that has a
 large number of GPIOs, not a number of GPIO controllers that each has a
 smaller number of GPIOs.

 U-Boot's commands/APIs/... should model this directly; a single controller
 object that has a large number of GPIOs within it.

 As such, an example user-visible GPIO command needs to be roughly something
 like:

 # using integer IDs
 gpio set tegra 128
  ^^^^ (controller instance name) (GPIO ID)
 or:

 # using names within the controller
 gpio set tegra PQ0
  ^^^^ (controller instance name) (GPIO name)

 (note that there must be separate controller ID and GPIO ID parameters in
 the commands in order to e.g. differentiate between 2 instances of the same
 I2C GPIO expander chip; something like pca9555@a0@i2c0, pca9555@i2c1@a4)

 not:

 gpio set tegraP 10
  ^^ ^^ (hypothetical bank name) (GPIO ID within bank)

 or:

 gpio set P10
  ^^ GPIO name without any controller ID


This will require enhancing the gpio command further, right?


 There's zero extra indirection caused by SW correctly describing the HW
 as a single bank. I have absolutely no idea what you mean my extra
 indirection here; any time there is a driver for a GPIO, you call a
 function to set a GPIO. That doesn't change based on whether there are
 32 or 1 GPIO controller drivers.  The only difference is how many
 drivers you have to search through to find the right one. For Tegra at
 least, I'm arguing for 1 driver to match the 1 HW module.


 OK let me explain a bit more.

 At the moment, the GPIO uclass supports a single GPIO bank, defined as
 something that has a name, like A, or B.


 The GPIO bank name should just be Tegra. The Tegra TRM specifies a single
 GPIO controller, in the address map etc., and there should be a single
 U-Boot object that represents it.  Really the phrase bank in U-Boot needs
 to be replaced with controller.

But that would change the meaning - at present a GPIO device in U-Boot
is a GPIO bank.



 Within that bank there can be

 several individual GPIO lines. This is what the Tegra TRM refers to as
 A0, A1, B0, B1, etc.


 While the TRM does use the phrase bank, I believe this is just a collision
 with the term you happened to choose. It's not used for the same semantic
 purposes. There's no intent to divide the Tegra GPIO controller into a bunch
 of logically separate HW blocks. bank in the TRM is just a convenient word
 to refer the fact that more than 32 GPIOs are supported, so they don't all
 fit into a single 32-bit register.

As an aside, using this logic, it is odd that there are only 8 GPIOs
per bank, instead of 32?


 So, the semantics of the HW are:

 A single GPIO controller named tegra.

 Within that, there are a bunch of GPIOs. Each has a number e.g. 0..250 (for
 Tegra124) and a name (PA0, PA1, ... PA7, PB0, PB1, ..., PFF2). Users should
 be able to refer to those GPIOs either by integer ID, or by name.

 To support this, the GPIO uclass would need:

 * A string name for the controller

 * A set of functions/ops to manipulate the GPIOs (e.g. set input, set
 output, set output value) that accept integer IDs as the parameter for the
 GPIO ID.

 * If GPIOs have names as well as numbers, an optional function to convert a
 string name to an integer GPIO ID.


 Should we wish to support banks A-Z, AA, BB, etc. all as a single GPIO
 device, we would need to redo the uclass to support this.


 No you wouldn't. Just put all the GPIOs into a single uclass instance. For
 naming, you can have the optional string-int conversion function in the
 uclass, or perhaps just ignore names (the kernel operates on integers for
 GPIOs...).


OK here we are talking about enhancing the uclass interface to support
conversion of names into numbers. I would prefer to have that logic be
common, and sit a level higher 

Re: [U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Tom Rini
On Wed, Jul 30, 2014 at 04:46:32PM +0100, Simon Glass wrote:

 Hi Tom,
 
 On 30 July 2014 15:24, Tom Rini tr...@ti.com wrote:
  The function subprocess.check_output() only exists in Python 2.7 and
  later (and there are long term supported distributions that ship with
  2.6.x).  Replace this with a call to subprocess.Popen() and then checking
  output via communicate()
 
  Signed-off-by: Tom Rini tr...@ti.com
 
 Looks fine as it is - see a few optional comments below.
 
 Acked-by: Simon Glass s...@chromium.org
 
  ---
   tools/genboardscfg.py |9 ++---
   1 files changed, 6 insertions(+), 3 deletions(-)
 
  diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
  index 805e4eb..6588392 100755
  --- a/tools/genboardscfg.py
  +++ b/tools/genboardscfg.py
  @@ -83,7 +83,8 @@ def check_top_directory():
   def get_make_cmd():
   Get the command name of GNU Make.
   try:
  -make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
  +process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
  +make_cmd, unused = process.communicate()
 
 Sometimes people use underscore for unused variables, like:
 
make_cmd, _ = process.communicate()
 
 but in this case you could also do:
 
make_cmd = process.communicate()[0]
 
   except subprocess.CalledProcessError:
   print  sys.stderr, 'GNU Make not found'
   sys.exit(1)
  @@ -493,8 +494,10 @@ def main():
   sys.exit(1)
   else:
   try:
  -jobs = int(subprocess.check_output(['getconf',
  -'_NPROCESSORS_ONLN']))
  +process = subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
  +   stdout=subprocess.PIPE)
  +jobstr, unused = process.communicate()
  +jobs = int(jobstr)
   except subprocess.CalledProcessError:
   print 'info: failed to get the number of CPUs. Set jobs to 1'
   jobs = 1

Ah, OK, thanks.  I've cleaned up both to just do communicate()[0] (and
condensed the jobs part back to a single line).  One last sanity check
build going on now.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Masahiro YAMADA
Hi Tom,


2014-07-30 23:24 GMT+09:00 Tom Rini tr...@ti.com:

 The function subprocess.check_output() only exists in Python 2.7 and
 later (and there are long term supported distributions that ship with
 2.6.x).  Replace this with a call to subprocess.Popen() and then checking
 output via communicate()

Unfortunately..  :-(
Anyway, thanks for catching this issue.


 Signed-off-by: Tom Rini tr...@ti.com
 ---
  tools/genboardscfg.py |9 ++---
  1 files changed, 6 insertions(+), 3 deletions(-)

 diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
 index 805e4eb..6588392 100755
 --- a/tools/genboardscfg.py
 +++ b/tools/genboardscfg.py
 @@ -83,7 +83,8 @@ def check_top_directory():
  def get_make_cmd():
  Get the command name of GNU Make.
  try:
 -make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
 +process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
 +make_cmd, unused = process.communicate()
  except subprocess.CalledProcessError:
  print  sys.stderr, 'GNU Make not found'
  sys.exit(1)



No good.

Unlike check_output(),  the communicate() method never throws
CalledProcessError exception,
which means the lines in except are never run.

When scripts/show-gnu-make fails, the function will not error out, but
just return a null string.
To know if the subprocess succeeded or not, 'returncode' should be checked.


The correct code should be something like this:


def get_make_cmd():
Get the command name of GNU Make.
process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
ret = process.communicate()
if process.returncode:
print  sys.stderr, 'GNU Make not found'
sys.exit(1)
return ret[0].strip()




 @@ -493,8 +494,10 @@ def main():
  sys.exit(1)
  else:
  try:
 -jobs = int(subprocess.check_output(['getconf',
 -'_NPROCESSORS_ONLN']))
 +process = subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
 +   stdout=subprocess.PIPE)
 +jobstr, unused = process.communicate()
 +jobs = int(jobstr)
  except subprocess.CalledProcessError:
  print 'info: failed to get the number of CPUs. Set jobs to 1'
  jobs = 1
 --

Ditto.
'except subprocess.CalledProcessError:' is meaningless and never
catches an exception.

In this case, 'getconf' may not exist on some systems.

If the 'getconf' command is not found, Popen() will throw OSError exception.
If the command is found but fails by some reason, int() will throw ValueError.
We cannot handle the other exceptions.

So, we can write the code something like this:

 ...
else:
try:
jobs = int(subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
 stdout=subprocess.PIPE).communicate()[0])
except (OSError, ValueError):
# getconf command not found or fails
print 'info: failed to get the number of CPUs. Set jobs to 1'
jobs = 1
gen_boards_cfg(jobs)



Best Regards
Masahiro Yamada
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Tom Rini
On Thu, Jul 31, 2014 at 02:54:43AM +0900, Masahiro YAMADA wrote:
 Hi Tom,
 
 
 2014-07-30 23:24 GMT+09:00 Tom Rini tr...@ti.com:
 
  The function subprocess.check_output() only exists in Python 2.7 and
  later (and there are long term supported distributions that ship with
  2.6.x).  Replace this with a call to subprocess.Popen() and then checking
  output via communicate()
 
 Unfortunately..  :-(
 Anyway, thanks for catching this issue.
 
 
  Signed-off-by: Tom Rini tr...@ti.com
  ---
   tools/genboardscfg.py |9 ++---
   1 files changed, 6 insertions(+), 3 deletions(-)
 
  diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
  index 805e4eb..6588392 100755
  --- a/tools/genboardscfg.py
  +++ b/tools/genboardscfg.py
  @@ -83,7 +83,8 @@ def check_top_directory():
   def get_make_cmd():
   Get the command name of GNU Make.
   try:
  -make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
  +process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
  +make_cmd, unused = process.communicate()
   except subprocess.CalledProcessError:
   print  sys.stderr, 'GNU Make not found'
   sys.exit(1)
 
 
 
 No good.
 
 Unlike check_output(),  the communicate() method never throws
 CalledProcessError exception,
 which means the lines in except are never run.
 
 When scripts/show-gnu-make fails, the function will not error out, but
 just return a null string.
 To know if the subprocess succeeded or not, 'returncode' should be checked.
 
 
 The correct code should be something like this:
 
 
 def get_make_cmd():
 Get the command name of GNU Make.
 process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
 ret = process.communicate()
 if process.returncode:
 print  sys.stderr, 'GNU Make not found'
 sys.exit(1)
 return ret[0].strip()
 
 
 
 
  @@ -493,8 +494,10 @@ def main():
   sys.exit(1)
   else:
   try:
  -jobs = int(subprocess.check_output(['getconf',
  -'_NPROCESSORS_ONLN']))
  +process = subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
  +   stdout=subprocess.PIPE)
  +jobstr, unused = process.communicate()
  +jobs = int(jobstr)
   except subprocess.CalledProcessError:
   print 'info: failed to get the number of CPUs. Set jobs to 1'
   jobs = 1
  --
 
 Ditto.
 'except subprocess.CalledProcessError:' is meaningless and never
 catches an exception.
 
 In this case, 'getconf' may not exist on some systems.
 
 If the 'getconf' command is not found, Popen() will throw OSError exception.
 If the command is found but fails by some reason, int() will throw ValueError.
 We cannot handle the other exceptions.
 
 So, we can write the code something like this:
 
  ...
 else:
 try:
 jobs = int(subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
  stdout=subprocess.PIPE).communicate()[0])
 except (OSError, ValueError):
 # getconf command not found or fails
 print 'info: failed to get the number of CPUs. Set jobs to 1'
 jobs = 1
 gen_boards_cfg(jobs)

Arg.  Do you want me to fold / rework things like that or do you want to
post a v9 of just this patch, adapted as you've shown?

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Tom Rini
On Wed, Jul 30, 2014 at 02:04:50PM -0400, Tom Rini wrote:
 On Thu, Jul 31, 2014 at 02:54:43AM +0900, Masahiro YAMADA wrote:
  Hi Tom,
  
  
  2014-07-30 23:24 GMT+09:00 Tom Rini tr...@ti.com:
  
   The function subprocess.check_output() only exists in Python 2.7 and
   later (and there are long term supported distributions that ship with
   2.6.x).  Replace this with a call to subprocess.Popen() and then checking
   output via communicate()
  
  Unfortunately..  :-(
  Anyway, thanks for catching this issue.
  
  
   Signed-off-by: Tom Rini tr...@ti.com
   ---
tools/genboardscfg.py |9 ++---
1 files changed, 6 insertions(+), 3 deletions(-)
  
   diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
   index 805e4eb..6588392 100755
   --- a/tools/genboardscfg.py
   +++ b/tools/genboardscfg.py
   @@ -83,7 +83,8 @@ def check_top_directory():
def get_make_cmd():
Get the command name of GNU Make.
try:
   -make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
   +process = subprocess.Popen([SHOW_GNU_MAKE], 
   stdout=subprocess.PIPE)
   +make_cmd, unused = process.communicate()
except subprocess.CalledProcessError:
print  sys.stderr, 'GNU Make not found'
sys.exit(1)
  
  
  
  No good.
  
  Unlike check_output(),  the communicate() method never throws
  CalledProcessError exception,
  which means the lines in except are never run.
  
  When scripts/show-gnu-make fails, the function will not error out, but
  just return a null string.
  To know if the subprocess succeeded or not, 'returncode' should be checked.
  
  
  The correct code should be something like this:
  
  
  def get_make_cmd():
  Get the command name of GNU Make.
  process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
  ret = process.communicate()
  if process.returncode:
  print  sys.stderr, 'GNU Make not found'
  sys.exit(1)
  return ret[0].strip()
  
  
  
  
   @@ -493,8 +494,10 @@ def main():
sys.exit(1)
else:
try:
   -jobs = int(subprocess.check_output(['getconf',
   -'_NPROCESSORS_ONLN']))
   +process = subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
   +   stdout=subprocess.PIPE)
   +jobstr, unused = process.communicate()
   +jobs = int(jobstr)
except subprocess.CalledProcessError:
print 'info: failed to get the number of CPUs. Set jobs to 1'
jobs = 1
   --
  
  Ditto.
  'except subprocess.CalledProcessError:' is meaningless and never
  catches an exception.
  
  In this case, 'getconf' may not exist on some systems.
  
  If the 'getconf' command is not found, Popen() will throw OSError exception.
  If the command is found but fails by some reason, int() will throw 
  ValueError.
  We cannot handle the other exceptions.
  
  So, we can write the code something like this:
  
   ...
  else:
  try:
  jobs = int(subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
   
  stdout=subprocess.PIPE).communicate()[0])
  except (OSError, ValueError):
  # getconf command not found or fails
  print 'info: failed to get the number of CPUs. Set jobs to 1'
  jobs = 1
  gen_boards_cfg(jobs)
 
 Arg.  Do you want me to fold / rework things like that or do you want to
 post a v9 of just this patch, adapted as you've shown?

... doing it this way now, testing, will move from there :)

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Masahiro YAMADA
Tom,



 Arg.  Do you want me to fold / rework things like that or do you want to
 post a v9 of just this patch, adapted as you've shown?


Either is fine for me.

But if you were about to apply v8
(it looks like you are doing the final test),
could you rework things, please?

No more updates from me. Thanks!


Best Regards
Masahiro Yamada
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools/genboardscfg.py: Don't rely on subprocess.check_output

2014-07-30 Thread Masahiro YAMADA
Hi Tom,


2014-07-31 3:04 GMT+09:00 Tom Rini tr...@ti.com:

 Arg.  Do you want me to fold / rework things like that or do you want to
 post a v9 of just this patch, adapted as you've shown?


Either is fine for me.

If you were about to apply v8  (I saw you are doing one last build check now),
could you rework things, please?

No more updates from me.


Best Regards
Masahiro Yamada
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 01/13] kconfig: import Kconfig files from Linux 3.16-rc7

2014-07-30 Thread Tom Rini
On Wed, Jul 30, 2014 at 02:08:13PM +0900, Masahiro Yamada wrote:

 Import
   - scripts/kconfig/*
   - include/linux/kconfig.h
 from Linux 3.16-rc7.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Reviewed-by: Simon Glass s...@chromium.org

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >