Re: [U-Boot] [linux-sunxi] [PATCH 2/2] sunxi: OrangePi Zero: defconfig: enable SPI flash

2017-01-14 Thread Priit Laes
On Sat, 2017-01-14 at 02:06 +, Andre Przywara wrote:
> Newer OrangePi Zero boards all come with 16 Mib SPI flash soldered,
> from
> which the board can actually boot from.
> Enable the SPL support for the SPI controller and SPI flash to allow
> putting the SPL, the DT and U-Boot proper into there. This will let
> a board boot without an SD card inserted.
> The flash chip can be written with a version of the sunxi-fel tool.

Thanks, I had this one in my queue :)

> 
> Signed-off-by: Andre Przywara 

Tested-by: Priit Laes 

> ---
>  configs/orangepi_zero_defconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/configs/orangepi_zero_defconfig
> b/configs/orangepi_zero_defconfig
> index 8813927..abb3fcf 100644
> --- a/configs/orangepi_zero_defconfig
> +++ b/configs/orangepi_zero_defconfig
> @@ -13,3 +13,5 @@ CONFIG_SPL=y
>  # CONFIG_CMD_FPGA is not set
>  CONFIG_SUN8I_EMAC=y
>  CONFIG_USB_EHCI_HCD=y
> +CONFIG_SPL_SPI_SUNXI=y
> +CONFIG_SPL_SPI_FLASH_SUPPORT=y
> -- 
> 2.8.2
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] u-boot.git or u-boot-x86.git for x86_64 u-boots?

2017-01-14 Thread Bin Meng
+Simon,

On Fri, Jan 13, 2017 at 4:12 AM, Joakim Tjernlund
 wrote:
> I found two repos w.r.t x86_64 for u-boot, which one should I use?
>

U-Boot x86_64 support is not in mainstream yet.

> I am ATM only looking at USING the qemu-x86 target for now.
>
> BTW, I found tools/binman/binman.py only worked with python 2.7, maybe you 
> can change
> the shebang to python2.7 as my default python is 3.4
>

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


Re: [U-Boot] u-boot.git or u-boot-x86.git for x86_64 u-boots?

2017-01-14 Thread Bin Meng
Hi Joakim,

On Sat, Jan 14, 2017 at 9:25 PM, Joakim Tjernlund
 wrote:
> On Sat, 2017-01-14 at 19:51 +0800, Bin Meng wrote:
>> +Simon,
>>
>> On Fri, Jan 13, 2017 at 4:12 AM, Joakim Tjernlund
>>  wrote:
>> > I found two repos w.r.t x86_64 for u-boot, which one should I use?
>> >
>>
>> U-Boot x86_64 support is not in mainstream yet.
>
> So I should use u-boot-x86.git for now then.
> Strangely u-boot.git did work too.

u-boot.git is the mainstream repo while u-boot-x86.git is the x86 repo
which has WIP patches and queued to be pulled into u-boot.git

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


Re: [U-Boot] [PATCH v2 30/63] x86: Tidy up use of size_t in relocation

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Addresses should not be cast to size_t. Use uintptr_t instead.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/relocate.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

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


Re: [U-Boot] [PATCH v2 32/63] x86: Move the i386 code into its own directory

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Much of the cpu and interrupt code cannot be compiled on 64-bit x86. Move it
> into its own directory and build it only in 32-bit mode.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/Makefile   |   6 +-
>  arch/x86/cpu/cpu.c  | 504 --
>  arch/x86/cpu/i386/Makefile  |   7 +
>  arch/x86/cpu/i386/cpu.c | 534 
> 
>  arch/x86/cpu/{interrupts.c => i386/interrupt.c} |   4 -
>  arch/x86/include/asm/mp.h   |   3 +
>  6 files changed, 549 insertions(+), 509 deletions(-)
>  create mode 100644 arch/x86/cpu/i386/Makefile
>  create mode 100644 arch/x86/cpu/i386/cpu.c
>  rename arch/x86/cpu/{interrupts.c => i386/interrupt.c} (99%)
>

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


Re: [U-Boot] [PATCH v2 29/63] x86: Add support for 64-bit relocation

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Add a 64-bit relocation function. SPL loads U-Boot into RAM at a fixed
> address and runs it. U-Boot then relocates itself to the top of RAM using
> this relocation function.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/relocate.c | 45 +
>  1 file changed, 45 insertions(+)
>

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


Re: [U-Boot] [PATCH v2 31/63] x86: Add an SPL implementation

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> SPL needs to set up the machine ready for loading 64-bit U-Boot and jumping
> to it. Call the existing init routines in order to accomplish this.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/include/asm/spl.h |   8 +++
>  arch/x86/lib/Makefile  |   1 +
>  arch/x86/lib/spl.c | 149 
> +
>  3 files changed, 158 insertions(+)
>  create mode 100644 arch/x86/include/asm/spl.h
>  create mode 100644 arch/x86/lib/spl.c
>
> diff --git a/arch/x86/include/asm/spl.h b/arch/x86/include/asm/spl.h
> new file mode 100644
> index 000..a8bce98
> --- /dev/null
> +++ b/arch/x86/include/asm/spl.h
> @@ -0,0 +1,8 @@
> +/*
> + * Copyright (C) 2014 Google, Inc

nits: 2016?

> + * Written by Simon Glass 
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + *
> + * This file is required for SPL to build, but is empty.
> + */
> diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
> index ff402dc..db538ad 100644
> --- a/arch/x86/lib/Makefile
> +++ b/arch/x86/lib/Makefile
> @@ -37,6 +37,7 @@ endif
>  obj-y  += tables.o
>  obj-$(CONFIG_CMD_ZBOOT)+= zimage.o
>  obj-$(CONFIG_HAVE_FSP) += fsp/
> +obj-$(CONFIG_SPL_BUILD) += spl.o
>
>  extra-$(CONFIG_USE_PRIVATE_LIBGCC) += lib.a
>
> diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c
> new file mode 100644
> index 000..61d085f
> --- /dev/null
> +++ b/arch/x86/lib/spl.c
> @@ -0,0 +1,149 @@
> +/*
> + * Copyright (c) 2016 Google, Inc
> + *

nits: unnecessary blank line

> + *
> + * SPDX-License-Identifier: GPL-2.0
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static int x86_spl_init(void)
> +{
> +   /*
> +* TODO(s...@chromium.org): We use this area of RAM for the stack
> +* and global_data in SPL. Once U-Boot starts up and releocates it
> +* is not needed. We could make this a CONFIG option or perhaps
> +* place it immediately below CONFIG_SYS_TEXT_BASE.
> +*/
> +   char *ptr = (char *)0x11;
> +   int ret;
> +
> +   debug("%s starting\n", __func__);
> +   ret = spl_init();
> +   if (ret) {
> +   debug("%s: spl_init() failed\n", __func__);
> +   return ret;
> +   }
> +   preloader_console_init();
> +
> +   ret = arch_cpu_init();
> +   if (ret) {
> +   debug("%s: arch_cpu_init() failed\n", __func__);
> +   return ret;
> +   }
> +   ret = arch_cpu_init_dm();
> +   if (ret) {
> +   debug("%s: arch_cpu_init_dm() failed\n", __func__);
> +   return ret;
> +   }
> +   ret = print_cpuinfo();
> +   if (ret) {
> +   debug("%s: print_cpuinfo() failed\n", __func__);
> +   return ret;
> +   }
> +   ret = dram_init();
> +   if (ret) {
> +   debug("%s: dram_init() failed\n", __func__);
> +   return ret;
> +   }
> +   memset(&__bss_start, 0, (ulong)&__bss_end - (ulong)&__bss_start);
> +
> +   /* TODO(s...@chromium.org): Consider calling cpu_init_r() here */
> +   ret = interrupt_init();
> +   if (ret) {
> +   debug("%s: interrupt_init() failed\n", __func__);
> +   return ret;
> +   }
> +
> +   gd->new_gd = (struct global_data *)ptr + 0x100;

Is 0x100 enough for the stack? maybe some comments here?

> +   memcpy(gd->new_gd, gd, sizeof(*gd));
> +   arch_setup_gd(gd->new_gd);
> +   gd->start_addr_sp = (ulong)ptr;
> +
> +   /* Cache the SPI flash. Otherwise copying the code to RAM takes ages 
> */
> +   ret = mtrr_add_request(MTRR_TYPE_WRBACK,
> +  (1ULL << 32) - CONFIG_XIP_ROM_SIZE,
> +  CONFIG_XIP_ROM_SIZE);
> +   if (ret) {
> +   debug("%s: SPI cache setup failed\n", __func__);
> +   return ret;
> +   }
> +
> +   return 0;
> +}
> +
> +void board_init_f(ulong flags)
> +{
> +   int ret;
> +
> +   ret = x86_spl_init();
> +   if (ret) {
> +   debug("Error %d\n", ret);
> +   hang();
> +   }
> +
> +   /* Uninit CAR and jump to board_init_f_r() */
> +   board_init_f_r_trampoline(gd->start_addr_sp);
> +}
> +
> +void board_init_f_r(void)
> +{
> +   init_cache_f_r();
> +   gd->flags &= ~GD_FLG_SERIAL_READY;
> +   debug("cache status %d\n", dcache_status());
> +   board_init_r(gd, 0);
> +}
> +
> +u32 spl_boot_device(void)
> +{
> +   return BOOT_DEVICE_BOARD;
> +}
> +
> +int spl_start_uboot(void)
> +{
> +   return 0;
> +}
> +
> +void spl_board_announce_boot_device(void)
> +{
> +   printf("SPI flash");
> +}
> +
> +static int spl_board_load_image(struct spl_image_info *spl_image,
> +   struct spl_boot_device *bootdev)
> +{
> +   spl_image->si

Re: [U-Boot] [PATCH v2 33/63] x86: Add cpu code for x86_64

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> There is not much needed at present, but set up a separate directory to put
> this code as it grows.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/Makefile|  4 +++-
>  arch/x86/cpu/x86_64/Makefile |  6 ++
>  arch/x86/cpu/x86_64/cpu.c| 35 +++
>  arch/x86/cpu/x86_64/interrupts.c | 30 ++
>  4 files changed, 74 insertions(+), 1 deletion(-)
>  create mode 100644 arch/x86/cpu/x86_64/Makefile
>  create mode 100644 arch/x86/cpu/x86_64/cpu.c
>  create mode 100644 arch/x86/cpu/x86_64/interrupts.c
>
> diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
> index 41ad481..7f89ff0 100644
> --- a/arch/x86/cpu/Makefile
> +++ b/arch/x86/cpu/Makefile
> @@ -38,6 +38,8 @@ obj-$(CONFIG_PCI) += pci.o
>  obj-$(CONFIG_SMP) += sipi_vector.o
>  obj-y += turbo.o
>
> -ifeq ($(CONFIG_$(SPL_)X86_64),)
> +ifeq ($(CONFIG_$(SPL_)X86_64),y)
> +obj-y += x86_64/
> +else
>  obj-y += i386/
>  endif
> diff --git a/arch/x86/cpu/x86_64/Makefile b/arch/x86/cpu/x86_64/Makefile
> new file mode 100644
> index 000..4b06386
> --- /dev/null
> +++ b/arch/x86/cpu/x86_64/Makefile
> @@ -0,0 +1,6 @@
> +#
> +# (C) Copyright 2016 Google, Inc
> +# Written by Simon Glass 
> +#
> +
> +obj-y += cpu.o interrupts.o
> diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c
> new file mode 100644
> index 000..c1d3788
> --- /dev/null
> +++ b/arch/x86/cpu/x86_64/cpu.c
> @@ -0,0 +1,35 @@
> +/*
> + * (C) Copyright 2016 Google, Inc
> + * Written by Simon Glass 
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#include 
> +#include 

nits:  is not needed

> +
> +int cpu_has_64bit(void)
> +{
> +   return true;
> +}
> +
> +void enable_caches(void)
> +{
> +   /* Not implemented */
> +}
> +
> +void disable_caches(void)
> +{
> +   /* Not implemented */
> +}
> +
> +int dcache_status(void)
> +{
> +   return true;
> +}
> +
> +int x86_mp_init(void)
> +{
> +   /* Not implemented */
> +   return 0;
> +}
> diff --git a/arch/x86/cpu/x86_64/interrupts.c 
> b/arch/x86/cpu/x86_64/interrupts.c
> new file mode 100644
> index 000..d814b6a
> --- /dev/null
> +++ b/arch/x86/cpu/x86_64/interrupts.c
> @@ -0,0 +1,30 @@
> +/*
> + * (C) Copyright 2016 Google, Inc
> + * Written by Simon Glass 
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +
> +void enable_interrupts(void)
> +{
> +   asm("sti\n");
> +}
> +
> +int disable_interrupts(void)
> +{
> +   long flags;
> +
> +   asm volatile ("pushfq ; popq %0 ; cli\n" : "=g" (flags) : );
> +
> +   return flags & X86_EFLAGS_IF;
> +}
> +
> +int interrupt_init(void)
> +{
> +   /* Nothing to do - this was already done in SPL */
> +   return 0;
> +}
> +

nits: this line is not needed

Other than that,
Reviewed-by: Bin Meng 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 34/63] x86: Support global_data on x86_64

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> At present this is just an ordinary variable. We may consider making it a
> fixed register in the future.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/x86_64/cpu.c  | 13 +
>  arch/x86/include/asm/global_data.h |  6 +-
>  2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c
> index c1d3788..da2ad11 100644
> --- a/arch/x86/cpu/x86_64/cpu.c
> +++ b/arch/x86/cpu/x86_64/cpu.c
> @@ -8,6 +8,19 @@
>  #include 
>  #include 
>
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/* Global declaration of gd */
> +struct global_data *global_data_ptr;
> +
> +void arch_setup_gd(gd_t *new_gd)
> +{
> +   global_data_ptr = new_gd;
> +
> +   /* TODO(s...@chromium.org): Why is this needed? */

What happens if this is not needed? Can you explain a little bit about the TODO?

> +   printch(' ');
> +}
> +
>  int cpu_has_64bit(void)
>  {
> return true;
> diff --git a/arch/x86/include/asm/global_data.h 
> b/arch/x86/include/asm/global_data.h
> index 7434f77..ce9e5cc 100644
> --- a/arch/x86/include/asm/global_data.h
> +++ b/arch/x86/include/asm/global_data.h
> @@ -104,7 +104,7 @@ struct arch_global_data {
>  #include 
>
>  #ifndef __ASSEMBLY__
> -# ifdef CONFIG_EFI_APP
> +# if defined(CONFIG_EFI_APP) || CONFIG_IS_ENABLED(X86_64)
>
>  #define gd global_data_ptr
>
> @@ -114,7 +114,11 @@ static inline __attribute__((no_instrument_function)) 
> gd_t *get_fs_gd_ptr(void)
>  {
> gd_t *gd_ptr;
>
> +#if CONFIG_IS_ENABLED(X86_64)
> +   asm volatile("fs mov 0, %0\n" : "=r" (gd_ptr));
> +#else
> asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
> +#endif

Can both of them be consolidated as one: asm volatile("fs mov 0, %0\n"
: "=r" (gd_ptr));

>
> return gd_ptr;
>  }
> --

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


Re: [U-Boot] [PATCH v2 38/63] x86: Add SPL build rules for start-up code

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> When SPL is used we need to build the 16-bit start-up code. Add Makefile
> rules to handle this.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  scripts/Makefile.spl | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
>

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


Re: [U-Boot] [PATCH v2 35/63] x86: Fix up CONFIG_X86_64 check

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> When SPL and U-Boot proper have different settings for this flag, we need to
> use the correct one. Fix this up in the interrupt code.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/i386/interrupt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

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


Re: [U-Boot] [PATCH v2 37/63] x86: Add a link script for SPL

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> If SPL is used it is always build in 32-bit mode. Add a link script to
> handle the correct placement of the sections.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/u-boot-spl.lds | 74 
> +
>  1 file changed, 74 insertions(+)
>  create mode 100644 arch/x86/cpu/u-boot-spl.lds
>

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


Re: [U-Boot] [PATCH v2 36/63] x86: Add a link script for 64-bit x86

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This needs a different image format from 32-bit x86, so add a new link
> script.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/config.mk |  6 
>  arch/x86/cpu/u-boot-64.lds | 76 
> ++
>  2 files changed, 82 insertions(+)
>  create mode 100644 arch/x86/cpu/u-boot-64.lds
>

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


Re: [U-Boot] [PATCH v2 39/63] x86: Fix up byteorder.h for x86_64

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Remove the very old x86 code and add support for 64-bit.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/include/asm/byteorder.h | 17 +
>  1 file changed, 9 insertions(+), 8 deletions(-)
>

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


Re: [U-Boot] [PATCH v2 41/63] x86: Fix up type sizes for 64-bit

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Adjust types as needed to support 64-bit compilation.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/include/asm/posix_types.h | 5 +
>  arch/x86/include/asm/types.h   | 5 +
>  2 files changed, 10 insertions(+)
>
> diff --git a/arch/x86/include/asm/posix_types.h 
> b/arch/x86/include/asm/posix_types.h
> index 5529f32..717f6cb 100644
> --- a/arch/x86/include/asm/posix_types.h
> +++ b/arch/x86/include/asm/posix_types.h
> @@ -16,8 +16,13 @@ typedef int  __kernel_pid_t;
>  typedef unsigned short __kernel_ipc_pid_t;
>  typedef unsigned short __kernel_uid_t;
>  typedef unsigned short __kernel_gid_t;
> +#if CONFIG_IS_ENABLED(X86_64)
> +typedef unsigned long  __kernel_size_t;
> +typedef long   __kernel_ssize_t;
> +#else
>  typedef unsigned int   __kernel_size_t;
>  typedef int__kernel_ssize_t;
> +#endif

Should these two just be the same? using long for both 32-bit and 64-bit

>  typedef int__kernel_ptrdiff_t;
>  typedef long   __kernel_time_t;
>  typedef long   __kernel_suseconds_t;
> diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
> index 880dcb4..a47e581 100644
> --- a/arch/x86/include/asm/types.h
> +++ b/arch/x86/include/asm/types.h
> @@ -44,7 +44,12 @@ typedef __INT64_TYPE__ s64;
>  typedef __UINT64_TYPE__ u64;
>  #endif
>
> +#if CONFIG_IS_ENABLED(X86_64)
> +#define BITS_PER_LONG 64
> +#else
>  #define BITS_PER_LONG 32
> +#endif
> +
>  /* Dma addresses are 32-bits wide.  */
>
>  typedef u32 dma_addr_t;

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


Re: [U-Boot] [PATCH v2 44/63] x86: ivybridge: Provide a dummy SDRAM init for 64-bit

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> We don't support SDRAM init in 64-bit mode since it is essentially
> impossible to get into that mode before SDRAM set up. Provide dummy functions
> for now. At some point we will need to pass the SDRAM parameters through from
> SPL.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/ivybridge/Makefile|  3 +++
>  arch/x86/cpu/ivybridge/sdram_nop.c | 29 +
>  2 files changed, 32 insertions(+)
>  create mode 100644 arch/x86/cpu/ivybridge/sdram_nop.c
>
> diff --git a/arch/x86/cpu/ivybridge/Makefile b/arch/x86/cpu/ivybridge/Makefile
> index 1a526c8f..25fbd59 100644
> --- a/arch/x86/cpu/ivybridge/Makefile
> +++ b/arch/x86/cpu/ivybridge/Makefile
> @@ -16,5 +16,8 @@ ifndef CONFIG_SPL_BUILD
>  obj-y += sata.o
>  endif
>  obj-$(CONFIG_$(SPL_)X86_32BIT_INIT) += sdram.o
> +ifndef CONFIG_$(SPL_)X86_32BIT_INIT
> +obj-y += sdram_nop.o
> +endif
>  endif
>  obj-y += bd82x6x.o
> diff --git a/arch/x86/cpu/ivybridge/sdram_nop.c 
> b/arch/x86/cpu/ivybridge/sdram_nop.c
> new file mode 100644
> index 000..edb3cb1
> --- /dev/null
> +++ b/arch/x86/cpu/ivybridge/sdram_nop.c
> @@ -0,0 +1,29 @@
> +/*
> + * Copyright (c) 2016 Google, Inc
> + *

nits: remove this blank line

> + *
> + * SPDX-License-Identifier:GPL-2.0
> + */
> +
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +int dram_init(void)
> +{
> +   gd->ram_size = 1ULL << 31;
> +   gd->bd->bi_dram[0].start = 0;
> +   gd->bd->bi_dram[0].size = gd->ram_size;
> +
> +   return 0;
> +}
> +
> +int misc_init_r(void)
> +{
> +   return 0;
> +}
> +
> +int print_cpuinfo(void)
> +{
> +   return 0;
> +}

Should the above two functions be put into arch/x86/cpu/x86_64/cpu.c?
They are not SDRAM related.

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


Re: [U-Boot] [PATCH v2 43/63] x86: ivybridge: Skipt SATA init in SPL

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This doesn't work at present. Disable it for now.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/ivybridge/Makefile | 2 ++
>  1 file changed, 2 insertions(+)

Except the commit title typo: Skipt -> Skip

Reviewed-by: Bin Meng 

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


Re: [U-Boot] [PATCH v2 42/63] x86: Mention the MRC region in the README

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This is left out of the example memory map. Add it to avoid confusion.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  doc/README.x86 | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/doc/README.x86 b/doc/README.x86
> index a38cc1b..42169d8 100644
> --- a/doc/README.x86
> +++ b/doc/README.x86
> @@ -308,6 +308,7 @@ Offset   Description Controlling config
>  6f   MRC cache   CONFIG_ENABLE_MRC_CACHE
>  70   u-boot-dtb.bin  CONFIG_SYS_TEXT_BASE
>  79   vga.bin CONFIG_VGA_BIOS_ADDR
> +7a   mrc.bin CONFIG_X86_MRC_ADDR

This is for MinnowMax board but it does not require mrc.bin. So this
patch is not necessary.

>  7c   fsp.bin CONFIG_FSP_ADDR
>  7f8000(depends on size of fsp.bin)
>  7ff800   U-Boot 16-bit boot  CONFIG_SYS_X86_START16

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


Re: [U-Boot] [PATCH v2 45/63] x86: Don't try to run the VGA BIOS in 64-bit mode

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This is not supported, so disable it for now.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/Makefile | 2 ++
>  drivers/pci/pci_rom.c | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
>

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


Re: [U-Boot] [PATCH v2 40/63] x86: Drop flag_is_changable() on x86_64

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This doesn't build at present and is not used in a 64-bit build. Disable it
> for now.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/include/asm/cpu.h | 3 +++
>  1 file changed, 3 insertions(+)
>

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


Re: [U-Boot] [PATCH v2 48/63] x86: Don't build 32-bit efi files on x86_64

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> These cannot be built in this mode, so drop them.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/Makefile | 4 
>  1 file changed, 4 insertions(+)
>

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


Re: [U-Boot] [PATCH v2 46/63] x86: Don't build call64 and setjmp on 64-bit

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> These are currently not supported. Calling 64-bit code from 64-bit U-Boot is
> much simpler, so this code is not needed. setjmp() is not yet implemented for
> 64-bit.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/Makefile | 6 +-
>  arch/x86/lib/bootm.c  | 2 ++
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
> index 7f89ff0..f0135a7 100644
> --- a/arch/x86/cpu/Makefile
> +++ b/arch/x86/cpu/Makefile
> @@ -14,7 +14,11 @@ else
>  extra-y= start.o
>  endif
>  extra-$(CONFIG_$(SPL_)X86_16BIT_INIT) += resetvec.o start16.o
> -obj-y  += cpu.o cpu_x86.o call64.o setjmp.o
> +ifndef CONFIG_$(SPL_)X86_64
> +obj-y  += call64.o setjmp.o
> +endif
> +
> +obj-y  += cpu.o cpu_x86.o
>
>  AFLAGS_REMOVE_call32.o := -mregparm=3 \
> $(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
> diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
> index 80fadef..4ac01a3 100644
> --- a/arch/x86/lib/bootm.c
> +++ b/arch/x86/lib/bootm.c
> @@ -150,7 +150,9 @@ int boot_linux_kernel(ulong setup_base, ulong 
> load_address, bool image_64bit)
> puts("Cannot boot 64-bit kernel on 32-bit machine\n");
> return -EFAULT;
> }
> +#if !CONFIG_IS_ENABLED(X86_64)
> return cpu_jump_to_64bit(setup_base, load_address);

Can we add a comment here mentioning booting 64-bit kernel is not
supported? Also, do we plan to support 64-bit U-Boot booting 32-bit
kernel? I guess no?

> +#endif
> } else {
> /*
> * Set %ebx, %ebp, and %edi to 0, %esi to point to the
> --

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


Re: [U-Boot] [PATCH v2 49/63] x86: Don't try to boot Linux from SPL

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Booting into linux from 64-bit U-Boot is not yet supported. Avoid bringing
> in the bootm code until it is implemented.
>
> Of course 32-bit U-Boot still supported booting into both 32- and 64-bit
> kernels.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/Makefile | 4 
>  1 file changed, 4 insertions(+)
>

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


Re: [U-Boot] [PATCH v2 47/63] x86: Don't build cpu files which are not supported on 64-bit

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Some files cannot be built with 64-bit and mostly don't make sense in that
> context. Disable them.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/Makefile | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
>

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


Re: [U-Boot] [PATCH v2 50/63] x86: Drop interrupt support in 64-bit mode

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This is not currently supported, so drop the code.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/interrupts.c | 5 +
>  1 file changed, 5 insertions(+)
>

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


Re: [U-Boot] [PATCH v2 52/63] x86: Move pirq_routing_table to global_data

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> To avoid using BSS in SPL before SDRAM is set up, move this field to
> global_data.
>

Why is this needed? pirq routing table setup is done after SDRAM
initialization. Isn't SPL doing this with a different order?

> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/irq.c | 12 +---
>  arch/x86/include/asm/global_data.h |  1 +
>  2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
> index e3e928b..442d373 100644
> --- a/arch/x86/cpu/irq.c
> +++ b/arch/x86/cpu/irq.c
> @@ -17,8 +17,6 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> -static struct irq_routing_table *pirq_routing_table;
> -
>  bool pirq_check_irq_routed(struct udevice *dev, int link, u8 irq)
>  {
> struct irq_router *priv = dev_get_priv(dev);
> @@ -219,7 +217,7 @@ static int create_pirq_routing_table(struct udevice *dev)
> /* Fix up the table checksum */
> rt->checksum = table_compute_checksum(rt, rt->size);
>
> -   pirq_routing_table = rt;
> +   gd->arch.pirq_routing_table = rt;
>
> return 0;
>  }
> @@ -250,8 +248,8 @@ int irq_router_common_init(struct udevice *dev)
> return ret;
> }
> /* Route PIRQ */
> -   pirq_route_irqs(dev, pirq_routing_table->slots,
> -   get_irq_slot_count(pirq_routing_table));
> +   pirq_route_irqs(dev, gd->arch.pirq_routing_table->slots,
> +   get_irq_slot_count(gd->arch.pirq_routing_table));
>
> if (IS_ENABLED(CONFIG_GENERATE_ACPI_TABLE))
> irq_enable_sci(dev);
> @@ -266,10 +264,10 @@ int irq_router_probe(struct udevice *dev)
>
>  ulong write_pirq_routing_table(ulong addr)
>  {
> -   if (!pirq_routing_table)
> +   if (!gd->arch.pirq_routing_table)
> return addr;
>
> -   return copy_pirq_routing_table(addr, pirq_routing_table);
> +   return copy_pirq_routing_table(addr, gd->arch.pirq_routing_table);
>  }
>
>  static const struct udevice_id irq_router_ids[] = {
> diff --git a/arch/x86/include/asm/global_data.h 
> b/arch/x86/include/asm/global_data.h
> index ce9e5cc..e24cee7 100644
> --- a/arch/x86/include/asm/global_data.h
> +++ b/arch/x86/include/asm/global_data.h
> @@ -93,6 +93,7 @@ struct arch_global_data {
> char *mrc_output;
> unsigned int mrc_output_len;
> ulong table;/* Table pointer from previous loader 
> */
> +   struct irq_routing_table *pirq_routing_table;
>  #ifdef CONFIG_SEABIOS
> u32 high_table_ptr;
> u32 high_table_limit;
> --

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


Re: [U-Boot] [PATCH v2 51/63] x86: Support jumping from SPL to U-Boot

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Add a rough function to handle jumping from 32-bit SPL to 64-bit U-Boot.
> This still needs work to clean it up.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/call64.S  |  3 +++
>  arch/x86/cpu/i386/cpu.c| 65 
> ++
>  arch/x86/include/asm/cpu.h |  9 +++
>  3 files changed, 77 insertions(+)
>

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


Re: [U-Boot] [PATCH v2 54/63] x86: Change irq_already_routed to a local variable

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This avoids using BSS before SDRAM is set up in SPL.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/pirq_routing.c | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
>

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


Re: [U-Boot] [PATCH v2 56/63] x86: Move setjmp to the i386 directory

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This code is only used in 32-bit mode. Move it so that it does not get
> built with 64-bit U-Boot.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/Makefile| 3 ---
>  arch/x86/cpu/i386/Makefile   | 1 +
>  arch/x86/cpu/{ => i386}/setjmp.S | 0
>  3 files changed, 1 insertion(+), 3 deletions(-)
>  rename arch/x86/cpu/{ => i386}/setjmp.S (100%)
>

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


Re: [U-Boot] [PATCH v2 58/63] x86: link: Add a text base for 64-bit U-Boot

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Set up the 64-bit U-Boot text base if building for that target.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  board/google/chromebook_link/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

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


Re: [U-Boot] [PATCH v2 57/63] x86: Add a dummy setjmp implementation for x86_64

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> We don't have the code for this yet. Add a dummy version for now, so that
> EFI builds correctly.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2:
> - Add the 'val' parameter to longjmp()
>
>  arch/x86/cpu/x86_64/Makefile |  2 +-
>  arch/x86/cpu/x86_64/setjmp.c | 20 
>  2 files changed, 21 insertions(+), 1 deletion(-)
>  create mode 100644 arch/x86/cpu/x86_64/setjmp.c
>

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


Re: [U-Boot] [PATCH v2 59/63] x86: link: Add SPL declarations to the binman image

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> When building for 64-bit we need to put an SPL binary into the image. Update
> the binman image description to reflect this.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/dts/u-boot.dtsi | 19 +++
>  1 file changed, 19 insertions(+)
>

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


Re: [U-Boot] [PATCH v2 55/63] x86: Move call64 to the i386 directory

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> This code is only used in 32-bit mode. Move it so that it does not get
> built with 64-bit U-Boot.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/Makefile| 2 +-
>  arch/x86/cpu/i386/Makefile   | 1 +
>  arch/x86/cpu/{ => i386}/call64.S | 0
>  3 files changed, 2 insertions(+), 1 deletion(-)
>  rename arch/x86/cpu/{ => i386}/call64.S (100%)
>

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


Re: [U-Boot] [PATCH v2 62/63] x86: Update compile/link flags to support 64-bit U-Boot

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Update config.mk settings to support both 32-bit and 64-bit U-Boot.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/config.mk | 30 --
>  arch/x86/cpu/config.mk |  2 --
>  2 files changed, 28 insertions(+), 4 deletions(-)
>

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


Re: [U-Boot] [PATCH v2 63/63] x86: link: Add a config for 64-bit U-Boot

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Add a new link config which uses 64-bit U-Boot. This is not fully
> functional but is it a start. Missing features:
>
> - SDRAM sizing
> - Booting linux
> - EFI support
> - SCSI device init
> (and others)
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2:
> - Drop patch 'video: Use ulong for video frame buffer address'
> - Add a new 64-bit link config instead of changing the existing one
>
>  board/google/Kconfig |  7 +++
>  board/google/chromebook_link/Kconfig |  2 +-
>  board/google/chromebook_link/MAINTAINERS |  7 +++
>  configs/chromebook_link64_defconfig  | 94 
> 
>  4 files changed, 109 insertions(+), 1 deletion(-)
>  create mode 100644 configs/chromebook_link64_defconfig
>

What's the difference between this patch and patch#61: "x86: link: Add
build options for SPL"?

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


Re: [U-Boot] [PATCH v2 61/63] x86: link: Add build options for SPL

2017-01-14 Thread Bin Meng
Hi Simon,

On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> If SPL is used we want to use the generic SPL framework and boot from SPI
> via a board-specific means. Add these options to the board config file.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  configs/chromebook_link_defconfig | 23 ++-
>  include/configs/chromebook_link.h |  9 +
>  2 files changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/configs/chromebook_link_defconfig 
> b/configs/chromebook_link_defconfig
> index 782123b..ebaec30 100644
> --- a/configs/chromebook_link_defconfig
> +++ b/configs/chromebook_link_defconfig
> @@ -1,5 +1,13 @@
>  CONFIG_X86=y
> -CONFIG_SYS_MALLOC_F_LEN=0x1800
> +CONFIG_SPL_GPIO_SUPPORT=y
> +CONFIG_SPL_LIBCOMMON_SUPPORT=y
> +CONFIG_SPL_LIBGENERIC_SUPPORT=y
> +CONFIG_SYS_MALLOC_F_LEN=0x2000
> +CONFIG_SPL_I2C_SUPPORT=y
> +CONFIG_SPL_SERIAL_SUPPORT=y
> +CONFIG_SPL_SPI_FLASH_SUPPORT=y
> +CONFIG_SPL_SPI_SUPPORT=y
> +CONFIG_VIDEO=y

Is this newly supported?

>  CONFIG_VENDOR_GOOGLE=y
>  CONFIG_DEFAULT_DEVICE_TREE="chromebook_link"
>  CONFIG_TARGET_CHROMEBOOK_LINK=y
> @@ -8,9 +16,17 @@ CONFIG_HAVE_MRC=y
>  CONFIG_SMP=y
>  CONFIG_HAVE_VGA_BIOS=y
>  CONFIG_FIT=y
> +CONFIG_SPL_LOAD_FIT=y
>  CONFIG_BOOTSTAGE=y
>  CONFIG_BOOTSTAGE_REPORT=y
>  CONFIG_SYS_CONSOLE_INFO_QUIET=y
> +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
> +CONFIG_SPL_CPU_SUPPORT=y
> +CONFIG_SPL_NET_SUPPORT=y
> +CONFIG_SPL_PCI_SUPPORT=y
> +CONFIG_SPL_PCH_SUPPORT=y
> +CONFIG_SPL_RTC_SUPPORT=y
> +CONFIG_SPL_TIMER_SUPPORT=y
>  CONFIG_HUSH_PARSER=y
>  CONFIG_CMD_CPU=y
>  # CONFIG_CMD_IMLS is not set
> @@ -33,8 +49,12 @@ CONFIG_CMD_EXT4_WRITE=y
>  CONFIG_CMD_FAT=y
>  CONFIG_CMD_FS_GENERIC=y
>  CONFIG_OF_CONTROL=y
> +CONFIG_SPL_OF_CONTROL=y
> +CONFIG_SPL_DM=y
>  CONFIG_REGMAP=y
> +CONFIG_SPL_REGMAP=y
>  CONFIG_SYSCON=y
> +CONFIG_SPL_SYSCON=y
>  CONFIG_CPU=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_INTEL=y
> @@ -58,6 +78,7 @@ CONFIG_USB=y
>  CONFIG_DM_USB=y
>  CONFIG_USB_STORAGE=y
>  CONFIG_DM_VIDEO=y
> +CONFIG_VIDEO_IVYBRIDGE_IGD=y

Same question as 'CONFIG_VIDEO=y' above

>  CONFIG_USB_KEYBOARD=y
>  CONFIG_VIDEO_VESA=y
>  CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
> diff --git a/include/configs/chromebook_link.h 
> b/include/configs/chromebook_link.h
> index f2d798a..b116a27 100644
> --- a/include/configs/chromebook_link.h
> +++ b/include/configs/chromebook_link.h
> @@ -19,4 +19,13 @@
>  #define CONFIG_ENV_SECT_SIZE   0x1000
>  #define CONFIG_ENV_OFFSET  0x003f8000
>
> +#define CONFIG_SPL_FRAMEWORK
> +
> +#define CONFIG_SPL_TEXT_BASE   0xfffd
> +
> +#define BOOT_DEVICE_SPI10

nits: looks '10' indention is not correct?

> +
> +#define CONFIG_SPL_BOARD_LOAD_IMAGE
> +#define BOOT_DEVICE_BOARD  11
> +
>  #endif /* __CONFIG_H */
> --

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


Re: [U-Boot] [PATCH v2 60/63] x86: link: Set up device tree for SPL

2017-01-14 Thread Bin Meng
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass  wrote:
> Add the correct pre-relocation tag so that the required device tree nodes
> are present in the SPL device tree.
>
> On x86 it doesn't make a lot of sense to have a separate SPL device tree.
> Since everything is in the same ROM we might as well just use the main
> device tree in both SPL and U-Boot proper. But we haven't implemented that,
> so this is a good first step.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/dts/chromebook_link.dts | 15 ++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>

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


Re: [U-Boot] [U-Boot,v6,11/13] sunxi: Use binman for sunxi boards

2017-01-14 Thread Emmanuel Vadot
On Wed, 11 Jan 2017 22:08:03 -0700
Simon Glass  wrote:

> Hi Emmanuel,
> 
> On 28 December 2016 at 03:57, Emmanuel Vadot  wrote:
> > On Wed, 28 Dec 2016 11:30:10 +0100
> > Emmanuel Vadot  wrote:
> >
> >>
> >>  Hello Simon,
> >>
> >> On Fri, 23 Dec 2016 01:39:06 -0700
> >> Simon Glass  wrote:
> >>
> >> > On 18 December 2016 at 19:48, Tom Rini  wrote:
> >> > > On Fri, Nov 25, 2016 at 08:16:01PM -0700, Simon Glass wrote:
> >> > >
> >> > >> Move sunxi boards to use binman. This involves adding the image 
> >> > >> definition
> >> > >> to the device tree and using it in the Makefile.
> >> > >>
> >> > >> Signed-off-by: Simon Glass 
> >> > >
> >> > > Reviewed-by: Tom Rini 
> >> > >
> >> > > --
> >> > > Tom
> >> >
> >> > Applied to u-boot-dm and now in mainline.
> >>
> >>  Shouldn't all the config for sunxi board defines
> >> CONFIG_SPL_OF_PLATDATA=y now so libfdt.so will be built ?
> >>
> >
> >  Sorry, I meant the python module.
> 
> Well for now an easier solution is to build sandbox_spl once. My plan
> is to upstream the Python bindings to libfdt, but it's slow going.
> There should be no major consequence to not having the module. It is
> just fractionally slower.
> 
> Regards,
> Simon

 On FreeBSD we don't have fdtget as part as our base system and it's
not available in the ports (well now it is).
 For now we simply don't depend on CONFIG_SPL_OF_PLATDATA to compile
the swig bindings as it's faster to compile/use it than using fdtget.
 Maybe this patch
https://people.freebsd.org/~manu/uboot/2017.01/0001-build-Always-build-the-libfdt-python-module.patch
make sense to be upstream in u-boot ?
 It doesn't take that long to compile the bindings and there is still
the check on the presence of the swig binary.

 Thanks,

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


Re: [U-Boot] u-boot.git or u-boot-x86.git for x86_64 u-boots?

2017-01-14 Thread Joakim Tjernlund
On Sat, 2017-01-14 at 19:51 +0800, Bin Meng wrote:
> +Simon,
> 
> On Fri, Jan 13, 2017 at 4:12 AM, Joakim Tjernlund
>  wrote:
> > I found two repos w.r.t x86_64 for u-boot, which one should I use?
> > 
> 
> U-Boot x86_64 support is not in mainstream yet.

So I should use u-boot-x86.git for now then.
Strangely u-boot.git did work too.

> 
> > I am ATM only looking at USING the qemu-x86 target for now.
> > 
> > BTW, I found tools/binman/binman.py only worked with python 2.7, maybe you 
> > can change
> > the shebang to python2.7 as my default python is 3.4
> > 
> 
> Regards,
> Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH 1/2] sunxi: dts: OrangePi Zero: add Ethernet node

2017-01-14 Thread jonsm...@gmail.com
Can you simultaneously use both Ethernet interfaces on the A64? I've
received conflicting answers to this question.

On Fri, Jan 13, 2017 at 9:06 PM, Andre Przywara  wrote:
> The OrangePi Zero can happily use the EMAC along with its integrated
> PHY to use Ethernet (for TFTP booting, for instance).
> Add the emac node to the board .dts by copying it from the OrangePi One
> DT.
>
> Signed-off-by: Andre Przywara 
> ---
>  arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts 
> b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
> index 0989434..20d489c 100644
> --- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
> +++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
> @@ -99,6 +99,17 @@
> status = "okay";
>  };
>
> +&emac {
> +   phy = <&phy1>;
> +   phy-mode = "mii";
> +   allwinner,use-internal-phy;
> +   allwinner,leds-active-low;
> +   status = "okay";
> +   phy1: ethernet-phy@1 {
> +   reg = <1>;
> +   };
> +};
> +
>  &mmc0 {
> pinctrl-names = "default";
> pinctrl-0 = <&mmc0_pins_a>;
> --
> 2.8.2
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Jon Smirl
jonsm...@gmail.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v6,11/13] sunxi: Use binman for sunxi boards

2017-01-14 Thread Tom Rini
On Sat, Jan 14, 2017 at 02:38:02PM +0100, Emmanuel Vadot wrote:
> On Wed, 11 Jan 2017 22:08:03 -0700
> Simon Glass  wrote:
> 
> > Hi Emmanuel,
> > 
> > On 28 December 2016 at 03:57, Emmanuel Vadot  wrote:
> > > On Wed, 28 Dec 2016 11:30:10 +0100
> > > Emmanuel Vadot  wrote:
> > >
> > >>
> > >>  Hello Simon,
> > >>
> > >> On Fri, 23 Dec 2016 01:39:06 -0700
> > >> Simon Glass  wrote:
> > >>
> > >> > On 18 December 2016 at 19:48, Tom Rini  wrote:
> > >> > > On Fri, Nov 25, 2016 at 08:16:01PM -0700, Simon Glass wrote:
> > >> > >
> > >> > >> Move sunxi boards to use binman. This involves adding the image 
> > >> > >> definition
> > >> > >> to the device tree and using it in the Makefile.
> > >> > >>
> > >> > >> Signed-off-by: Simon Glass 
> > >> > >
> > >> > > Reviewed-by: Tom Rini 
> > >> > >
> > >> > > --
> > >> > > Tom
> > >> >
> > >> > Applied to u-boot-dm and now in mainline.
> > >>
> > >>  Shouldn't all the config for sunxi board defines
> > >> CONFIG_SPL_OF_PLATDATA=y now so libfdt.so will be built ?
> > >>
> > >
> > >  Sorry, I meant the python module.
> > 
> > Well for now an easier solution is to build sandbox_spl once. My plan
> > is to upstream the Python bindings to libfdt, but it's slow going.
> > There should be no major consequence to not having the module. It is
> > just fractionally slower.
> > 
> > Regards,
> > Simon
> 
>  On FreeBSD we don't have fdtget as part as our base system and it's
> not available in the ports (well now it is).
>  For now we simply don't depend on CONFIG_SPL_OF_PLATDATA to compile
> the swig bindings as it's faster to compile/use it than using fdtget.
>  Maybe this patch
> https://people.freebsd.org/~manu/uboot/2017.01/0001-build-Always-build-the-libfdt-python-module.patch
> make sense to be upstream in u-boot ?
>  It doesn't take that long to compile the bindings and there is still
> the check on the presence of the swig binary.

Yes, I think the FreeBSD patch there should be upstream, it seems
reasonable enough for portability.

-- 
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] u-boot.git or u-boot-x86.git for x86_64 u-boots?

2017-01-14 Thread Simon Glass
Hi Joakim,

On 14 January 2017 at 04:51, Bin Meng  wrote:
> +Simon,
>
> On Fri, Jan 13, 2017 at 4:12 AM, Joakim Tjernlund
>  wrote:
>> I found two repos w.r.t x86_64 for u-boot, which one should I use?
>>
>
> U-Boot x86_64 support is not in mainstream yet.

I'll be sending v3 fairly soon. But even then it is not complete.
Various things need fixing up and polishing - e.g. SDRAM sizing,
graphics ROMs, actually booting Linux!

>
>> I am ATM only looking at USING the qemu-x86 target for now.
>>
>> BTW, I found tools/binman/binman.py only worked with python 2.7, maybe you 
>> can change
>> the shebang to python2.7 as my default python is 3.4

We should probably patch it to work on 3.4 also.

>>
>
> Regards,
> Bin

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


Re: [U-Boot] Rockchip RK3288 regulator device table problem

2017-01-14 Thread Simon Glass
Hi Rick,

On 3 January 2017 at 11:21, Rick Bronson  wrote:
> Hi Simon,
>
>   I'm not sure what to do about (in drivers/power/regulator/rk808.c):
>
> static const struct rk808_reg_info rk808_ldo[] = {
> { 100, 10, LDO1_ON_VSEL, 5, },
> ...
>
>   I had to change this table as my LDO values are different for this
> board.  I'd like to fix it to take values from the device tree but
> couldn't find an example.  Maybe you can point me to one.

Do you mean that the table values are wrong? They should be defined in
the datasheet.

Or if you are trying to change the voltages, you can use the device
tree. See for example rk3288-firefly.dtsi:

regulator-min-microvolt = <85>;
regulator-max-microvolt = <135>;

Then you call regulator_set_value() to set the voltage, or perhaps
regulator_autoset() if there is only one voltage. Or even
regulators_enable_boot_on().

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


Re: [U-Boot] [PATCH 1/1] common/image.c: prefixes for binary multiples

2017-01-14 Thread Simon Glass
On 4 January 2017 at 05:45, Heinrich Schuchardt  wrote:
> IEC 8-13:2008 Quantities and units
> Part 13: Information science and technology
>
> defines the prefixes to use for binary multiples.
>
> Instead of writing
> Data Size:6726132 Bytes = 6568.49 kB = 6.41 MB
> in dumpimage we should write
> Data Size:6726132 Bytes = 6568.49 KiB = 6.41 MiB.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  common/image.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Ah, progress. I think :-)

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


Re: [U-Boot] [PATCH] armv8: fsl-layerscape: Fix SECURE_BOOT config

2017-01-14 Thread Simon Glass
On 4 January 2017 at 11:32, York Sun  wrote:
> Without a prompt in Kconfig, SECURE_BOOT cannot be selected by
> defconfig. The option was dropped unintentionally when defconfig
> files were cleaned up. Three targets were impacted
> ls1043ardb_SECURE_BOOT, ls2080ardb_SECURE_BOOT,
> ls2080aqds_SECURE_BOOT.
>
> Signed-off-by: York Sun 
>
> ---
>
>  arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 2 +-
>  configs/ls1043ardb_SECURE_BOOT_defconfig  | 1 +
>  configs/ls2080aqds_SECURE_BOOT_defconfig  | 1 +
>  configs/ls2080ardb_SECURE_BOOT_defconfig  | 1 +
>  4 files changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass 

It might be worth pointing to your README in the Kconfig help.

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


Re: [U-Boot] [PATCH V2 4/7] ARM: dts: exnyos4210-universl_c210: add i2c_5 and pmic nodes

2017-01-14 Thread Simon Glass
On 5 January 2017 at 03:16, Jaehoon Chung  wrote:
> Add the i2c_5 node and pmic as its child node.
>
> Signed-off-by: Jaehoon Chung 
> ---
>  arch/arm/dts/exynos4210-universal_c210.dts | 164 
> +
>  1 file changed, 164 insertions(+)

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


Re: [U-Boot] [PATCH V3 2/7] ARM: dts: exnyos4210-universl_c210: add i2c_5 and pmic nodes

2017-01-14 Thread Simon Glass
On 8 January 2017 at 22:47, Jaehoon Chung  wrote:
> Add the i2c_5 node and pmic as its child node.
>
> Signed-off-by: Jaehoon Chung 
> ---
>  arch/arm/dts/exynos4210-universal_c210.dts | 164 
> +
>  1 file changed, 164 insertions(+)

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


Re: [U-Boot] [PATCH 01/12] aspeed: Add mach-aspeed directory and basic Kconfig

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> Signed-off-by: Maxim Sloyko 
> ---
>
>  arch/arm/Kconfig  |  7 +++
>  arch/arm/Makefile |  1 +
>  arch/arm/mach-aspeed/Kconfig  | 15 +++
>  arch/arm/mach-aspeed/Makefile |  8 
>  4 files changed, 31 insertions(+)
>  create mode 100644 arch/arm/mach-aspeed/Kconfig
>  create mode 100644 arch/arm/mach-aspeed/Makefile
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 714dd8b514..135c544335 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -882,8 +882,15 @@ config TARGET_THUNDERX_88XX
> select OF_CONTROL
> select SYS_CACHE_SHIFT_7
>
> +config ARCH_ASPEED
> +   bool "Support Aspeed SoCs"
> +   select OF_CONTROL
> +   select DM
> +
>  endchoice
>
> +source "arch/arm/mach-aspeed/Kconfig"
> +
>  source "arch/arm/mach-at91/Kconfig"
>
>  source "arch/arm/mach-bcm283x/Kconfig"
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index 236debb452..cc73e1038e 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -50,6 +50,7 @@ PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
>
>  # Machine directory name.  This list is sorted alphanumerically
>  # by CONFIG_* macro name.
> +machine-$(CONFIG_ARCH_ASPEED)  += aspeed
>  machine-$(CONFIG_ARCH_AT91)+= at91
>  machine-$(CONFIG_ARCH_BCM283X) += bcm283x
>  machine-$(CONFIG_ARCH_DAVINCI) += davinci
> diff --git a/arch/arm/mach-aspeed/Kconfig b/arch/arm/mach-aspeed/Kconfig
> new file mode 100644
> index 00..43cdbeda84
> --- /dev/null
> +++ b/arch/arm/mach-aspeed/Kconfig
> @@ -0,0 +1,15 @@
> +if ARCH_ASPEED
> +
> +config SYS_ARCH
> +   default "arm"
> +
> +config SYS_SOC
> +   default "aspeed"
> +
> +config ASPEED_AST2500
> +   bool "Support Aspeed AST2500 SoC"
> +   select CPU_ARM1176
> +   help
> + The Aspeed AST2500 is a ARM-based SoC with arm1176 CPU

Can you please expand this a bit? E.g. a summary of peripherals it
has, what the chip is used for...

> +
> +endif
> diff --git a/arch/arm/mach-aspeed/Makefile b/arch/arm/mach-aspeed/Makefile
> new file mode 100644
> index 00..8e276b4a9f
> --- /dev/null
> +++ b/arch/arm/mach-aspeed/Makefile
> @@ -0,0 +1,8 @@
> +#
> +# Copyright (c) 2014 Google, Inc
> +#
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +
> +obj-$(CONFIG_ARCH_ASPEED) += ast_wdt.o
> +obj-$(CONFIG_ASPEED_AST2500) += ast2500/ ast2500-board.o
> --
> 2.11.0.390.gc69c2f50cf-goog
>

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


Re: [U-Boot] [PATCH 03/12] aspeed: Add Timer Support

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> Add support for timer for Aspeed ast2400/ast2500 devices.
> The driver actually controls several devices, but because all devices
> share the same Control Register, it is somewhat difficult to completely
> decouple them. Since only one timer is needed at the moment, this should
> be OK.
>
> The timer uses fixed clock, so does not rely on a clock driver.
>
> Signed-off-by: Maxim Sloyko 
> ---
>
>  arch/arm/include/asm/arch-aspeed/timer.h | 54 ++
>  drivers/timer/Kconfig|  7 +++
>  drivers/timer/Makefile   |  1 +
>  drivers/timer/ast_timer.c| 96 
> 
>  4 files changed, 158 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-aspeed/timer.h
>  create mode 100644 drivers/timer/ast_timer.c

Reviewed-by: Simon Glass 

nits below.

>
> diff --git a/arch/arm/include/asm/arch-aspeed/timer.h 
> b/arch/arm/include/asm/arch-aspeed/timer.h
> new file mode 100644
> index 00..87c5b354ec
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-aspeed/timer.h
> @@ -0,0 +1,54 @@
> +/*
> + * Copyright (c) 2016 Google, Inc
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +#ifndef _ASM_ARCH_TIMER_H
> +#define _ASM_ARCH_TIMER_H
> +
> +/* Each timer has 4 control bits in ctrl1 register.
> + * Timer1 uses bits 0:3, Timer2 uses bits 4:7 and so on,
> + * such that timer X uses bits (4 * X - 4):(4 * X - 1)
> + * If the timer does not support PWM, bit 4 is reserved.
> + */
> +#define AST_TMC_EN (1 << 0)
> +#define AST_TMC_1MHZ   (1 << 1)
> +#define AST_TMC_OVFINTR(1 << 2)
> +#define AST_TMC_PWM(1 << 3)
> +
> +/* Timers are counted from 1 in the datasheet. */
> +#define AST_TMC_CTRL1_SHIFT(n) (4 * ((n) - 1))
> +
> +#define AST_TMC_RATE  (1000*1000)
> +
> +#ifndef __ASSEMBLY__
> +
> +/*
> + * All timers share control registers, which makes it harder to make them
> + * separate devices. Since only one timer is needed at the moment, making
> + * it this just one device.
> + */
> +
> +struct ast_timer_counter {
> +   u32 status;
> +   u32 reload_val;
> +   u32 match1;
> +   u32 match2;
> +};
> +
> +struct ast_timer {
> +   struct ast_timer_counter timers1[3];
> +   u32 ctrl1;
> +   u32 ctrl2;
> +#ifdef CONFIG_ASPEED_AST2500
> +   u32 ctrl3;
> +   u32 ctrl1_clr;
> +#else
> +   u32 reserved[2];
> +#endif
> +   struct ast_timer_counter timers2[5];
> +};
> +
> +#endif  /* __ASSEMBLY__ */
> +
> +#endif  /* _ASM_ARCH_TIMER_H */
> diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
> index cb18f12fc9..9c5f98bb88 100644
> --- a/drivers/timer/Kconfig
> +++ b/drivers/timer/Kconfig
> @@ -46,4 +46,11 @@ config OMAP_TIMER
> help
>   Select this to enable an timer for Omap devices.
>
> +config AST_TIMER
> +   bool "Aspeed ast2400/ast2500 timer support"
> +   depends on TIMER
> +   default y if ARCH_ASPEED
> +   help
> + Select this to enable timer for Aspeed ast2400/ast2500 devices.

Can you add more detail? How many channels? What features are
supported by the driver?

> +
>  endmenu
> diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile
> index f351fbb4e0..a4b1a486b0 100644
> --- a/drivers/timer/Makefile
> +++ b/drivers/timer/Makefile
> @@ -9,3 +9,4 @@ obj-$(CONFIG_ALTERA_TIMER)  += altera_timer.o
>  obj-$(CONFIG_SANDBOX_TIMER)+= sandbox_timer.o
>  obj-$(CONFIG_X86_TSC_TIMER)+= tsc_timer.o
>  obj-$(CONFIG_OMAP_TIMER)   += omap-timer.o
> +obj-$(CONFIG_AST_TIMER)+= ast_timer.o
> diff --git a/drivers/timer/ast_timer.c b/drivers/timer/ast_timer.c
> new file mode 100644
> index 00..f644882f40
> --- /dev/null
> +++ b/drivers/timer/ast_timer.c
> @@ -0,0 +1,96 @@
> +/*
> + * Copyright 2016 Google Inc.
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#define AST_TICK_TIMER  1
> +#define AST_TMC_RELOAD_VAL  0x
> +
> +struct ast_timer_priv {
> +   struct ast_timer *regs;
> +};
> +
> +static struct ast_timer_counter *ast_get_timer_counter(struct ast_timer 
> *timer,
> +  int n)
> +{
> +   if (n > 3)
> +   return &timer->timers2[n - 4];
> +   else
> +   return &timer->timers1[n - 1];
> +}
> +
> +static int ast_timer_probe(struct udevice *dev)
> +{
> +   struct ast_timer_priv *priv = dev_get_priv(dev);
> +   struct ast_timer_counter *tmc = ast_get_timer_counter(priv->regs,
> + AST_TICK_TIMER);

I suppose tmc could be in your struct ast_timer_priv to save you doing
this each time?

> +   struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
> +
> +   writel(AST_TMC_

Re: [U-Boot] [PATCH 04/12] aspeed: Add sysreset driver

2017-01-14 Thread Simon Glass
On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> The driver uses watchdog timer to do resets and particular
> watchdog device to use is hardcoded (0)
>
> Signed-off-by: Maxim Sloyko 
> ---
>
>  drivers/sysreset/Makefile   |  1 +
>  drivers/sysreset/sysreset_ast.c | 55 
> +
>  2 files changed, 56 insertions(+)
>  create mode 100644 drivers/sysreset/sysreset_ast.c

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


Re: [U-Boot] [PATCH 02/12] aspeed: Add support for Watchdot Timer

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> The driver is compatible with AST2400 and AST2500 watchdogs.
> There is no uclass for Watchdog yet, so the driver does not follow
> the driver model. It also uses fixed clock, so no clock driver
> is needed.
>
> # Conflicts:
> #   arch/arm/mach-aspeed/Makefile
>
> Signed-off-by: Maxim Sloyko 
> ---
>
>  arch/arm/include/asm/arch-aspeed/wdt.h | 89 
> ++
>  arch/arm/mach-aspeed/Makefile  |  3 +-
>  arch/arm/mach-aspeed/ast_wdt.c | 44 +
>  3 files changed, 134 insertions(+), 2 deletions(-)
>  create mode 100644 arch/arm/include/asm/arch-aspeed/wdt.h
>  create mode 100644 arch/arm/mach-aspeed/ast_wdt.c
>
> diff --git a/arch/arm/include/asm/arch-aspeed/wdt.h 
> b/arch/arm/include/asm/arch-aspeed/wdt.h
> new file mode 100644
> index 00..32774b1a70
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-aspeed/wdt.h
> @@ -0,0 +1,89 @@
> +/*
> + * (C) Copyright 2016 Google, Inc
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#ifndef _ASM_ARCH_WDT_H
> +#define _ASM_ARCH_WDT_H
> +
> +#define WDT_BASE   0x1e785000

This should come from DT. I suggest creating a simple uclass for the
watchdog timer, so you can make this a proper driver-model driver.

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


Re: [U-Boot] [PATCH 05/12] aspeed/ast2500: Device Tree and bindings for some of the clocks

2017-01-14 Thread Simon Glass
Hi Maxim,

On 5 January 2017 at 15:20, Maxim Sloyko  wrote:
> On Wed, Jan 4, 2017 at 7:26 PM, Tom Rini  wrote:
>> On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
>>> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini  wrote:
>>> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
>>> >
>>> >> Signed-off-by: Maxim Sloyko 
>>> >> ---
>>> >>
>>> >>  arch/arm/dts/ast2500.dtsi   | 423 
>>> >> 
>>> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
>>> >>  2 files changed, 452 insertions(+)
>>> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
>>> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
>>> >>
>>> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
>>> >> new file mode 100644
>>> >> index 00..1a2a3f7ee3
>>> >> --- /dev/null
>>> >> +++ b/arch/arm/dts/ast2500.dtsi
>>> >> @@ -0,0 +1,423 @@
>>> >> +/* This device tree is copied from
>>> >> + * 
>>> >> https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
>>> >
>>> > Is this also found in the Linux kernel or not yet?  Thanks!
>>>
>>> Yes, this is also in in main Linux kernel now, as I've found out, but
>>> actually there is a number of differences, most notably there is no
>>> pin configuration in this device tree, because there is no pinctrl
>>> driver.
>
> Actually, I take that back, I was looking at the wrong linux Linux
> kernel tree still... Only basic version of device tree has made it to
> mainline kernel, but it's enough at the moment, so I used that
> instead.
>
>>>
>>> Should I remove this reference or modify it?
>>
>> Ideally, we will take the kernel dts files and then add what we need on
>> top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
>> -u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
>> arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
>
> OK, so I took the device tree from the Linux kernel, (ast2500.dtsi),
> added modifications in ast2500-u-boot.dtsi and now include
> ast2500-u-boot.dtsi in ast2500-evb.dts. Let me know if I misunderstood
> you.

There is some magic in the Makefile which automatically includes the
.dtsi if you name it correctly:

# Try these files in order to find the U-Boot-specific .dtsi include file
u_boot_dtsi_options = $(wildcard $(dts_dir)/$(basename $(notdir
$<))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
$(wildcard $(dts_dir)/u-boot.dtsi)


So you should not need to include it explicitly.

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


Re: [U-Boot] [PATCH 07/12] aspeed/ast2500: Helper function to get access to SCU

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> Helper function to get access to SCU (System Control Unit) through Clock
> driver. This is similar to rockchip_get_cru function, which was used as
> an example.
>
> It will be used by other drivers to get access to SCU.
>
> Signed-off-by: Maxim Sloyko 
> ---
>
>  arch/arm/mach-aspeed/Kconfig   |  2 ++
>  arch/arm/mach-aspeed/Makefile  |  1 +
>  arch/arm/mach-aspeed/ast2500/Kconfig   |  6 ++
>  arch/arm/mach-aspeed/ast2500/Makefile  |  1 +
>  arch/arm/mach-aspeed/ast2500/clk_ast2500.c | 31 
> ++
>  5 files changed, 41 insertions(+)
>  create mode 100644 arch/arm/mach-aspeed/ast2500/Kconfig
>  create mode 100644 arch/arm/mach-aspeed/ast2500/Makefile
>  create mode 100644 arch/arm/mach-aspeed/ast2500/clk_ast2500.c

The code seems fine.

It seems odd that you have Kconfig changes here also. Why is that?

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


Re: [U-Boot] [PATCH 06/12] aspeed/ast2500: Add Clock Driver

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> This driver is ast2500 specific and is not compatible with earlier

ast2500-specific

> versions of this chip. The differences are not that large, but they are
> in somewhat random places, so making it compatible with ast2400 is not
> worth the effort at the moment.
>
> Signed-off-by: Maxim Sloyko 
> ---
>
>  arch/arm/include/asm/arch-aspeed/scu_ast2500.h | 108 +++
>  drivers/clk/Makefile   |   2 +
>  drivers/clk/aspeed/Makefile|   7 +
>  drivers/clk/aspeed/clk_ast2500.c   | 255 
> +
>  4 files changed, 372 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-aspeed/scu_ast2500.h
>  create mode 100644 drivers/clk/aspeed/Makefile
>  create mode 100644 drivers/clk/aspeed/clk_ast2500.c
>
> diff --git a/arch/arm/include/asm/arch-aspeed/scu_ast2500.h 
> b/arch/arm/include/asm/arch-aspeed/scu_ast2500.h
> new file mode 100644
> index 00..febff9d2d3
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-aspeed/scu_ast2500.h
> @@ -0,0 +1,108 @@
> +#ifndef _ASM_ARCH_SCU_AST2500_H
> +#define _ASM_ARCH_SCU_AST2500_H
> +
> +#define SCU_UNLOCK_VALUE   0x1688a8a8
> +
> +#define SCU_HWSTRAP_VGAMEM_MASK3
> +#define SCU_HWSTRAP_VGAMEM_SHIFT   2
> +#define SCU_HWSTRAP_DDR4   (1 << 24)
> +#define SCU_HWSTRAP_CLKIN_25MHZ(1 << 23)
> +
> +#define SCU_MPLL_DENUM_SHIFT   0
> +#define SCU_MPLL_DENUM_MASK0x1f
> +#define SCU_MPLL_NUM_SHIFT 5
> +#define SCU_MPLL_NUM_MASK  0xff
> +#define SCU_MPLL_POST_SHIFT13
> +#define SCU_MPLL_POST_MASK 0x3f
> +
> +#define SCU_HPLL_DENUM_SHIFT   0
> +#define SCU_HPLL_DENUM_MASK0x1f
> +#define SCU_HPLL_NUM_SHIFT 5
> +#define SCU_HPLL_NUM_MASK  0xff
> +#define SCU_HPLL_POST_SHIFT13
> +#define SCU_HPLL_POST_MASK 0x3f
> +
> +#define SCU_MISC2_UARTCLK_SHIFT24
> +
> +#define SCU_MISC_UARTCLK_DIV13 (1 << 12)
> +
> +#ifndef __ASSEMBLY__
> +
> +struct ast2500_clk_priv {
> +   struct ast2500_scu *scu;
> +};
> +
> +struct ast2500_scu {
> +   u32 protection_key;
> +   u32 sysreset_ctrl1;
> +   u32 clk_sel1;
> +   u32 clk_stop_ctrl1;
> +   u32 freq_counter_ctrl;
> +   u32 freq_counter_cmp;
> +   u32 intr_ctrl;
> +   u32 d2_pll_param;
> +   u32 m_pll_param;
> +   u32 h_pll_param;
> +   u32 d_pll_param;
> +   u32 misc_ctrl1;
> +   u32 pci_config[3];
> +   u32 sysreset_status;
> +   u32 vga_handshake[2];
> +   u32 mac_clk_delay;
> +   u32 misc_ctrl2;
> +   u32 vga_scratch[8];
> +   u32 hwstrap;
> +   u32 rng_ctrl;
> +   u32 rng_data;
> +   u32 rev_id;
> +   u32 pinmux_ctrl[6];
> +   u32 reserved0;
> +   u32 extrst_sel;
> +   u32 pinmux_ctrl1[4];
> +   u32 reserved1[2];
> +   u32 mac_clk_delay_100M;
> +   u32 mac_clk_delay_10M;
> +   u32 wakeup_enable;
> +   u32 wakeup_control;
> +   u32 reserved2[3];
> +   u32 sysreset_ctrl2;
> +   u32 clk_sel2;
> +   u32 clk_stop_ctrl2;
> +   u32 freerun_counter;
> +   u32 freerun_counter_ext;
> +   u32 clk_duty_meas_ctrl;
> +   u32 clk_duty_meas_res;
> +   u32 reserved3[4];
> +   /* The next registers are not key protected */

key-protected

> +   struct ast2500_cpu2 {
> +   u32 ctrl;
> +   u32 base_addr[9];
> +   u32 cache_ctrl;
> +   } cpu2;
> +   u32 reserved4;
> +   u32 d_pll_ext_param[3];
> +   u32 d2_pll_ext_param[3];
> +   u32 mh_pll_ext_param;
> +   u32 reserved5;
> +   u32 chip_id[2];
> +   u32 reserved6[2];
> +   u32 uart_clk_ctrl;
> +   u32 reserved7[7];
> +   u32 pcie_config;
> +   u32 mmio_decode;
> +   u32 reloc_ctrl_decode[2];
> +   u32 mailbox_addr;
> +   u32 shared_sram_decode[2];
> +   u32 bmc_rev_id;
> +   u32 reserved8;
> +   u32 bmc_device_id;
> +   u32 reserved9[13];
> +   u32 clk_duty_sel;
> +};
> +
> +int ast_get_clk(struct udevice **devp);
> +void *ast_get_scu(void);

Function comments please.

> +
> +#endif  /* __ASSEMBLY__ */
> +
> +#endif  /* _ASM_ARCH_SCU_AST2500_H */
> diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
> index 40a5e8cae8..625513789c 100644
> --- a/drivers/clk/Makefile
> +++ b/drivers/clk/Makefile
> @@ -16,3 +16,5 @@ obj-$(CONFIG_CLK_UNIPHIER) += uniphier/
>  obj-$(CONFIG_CLK_EXYNOS) += exynos/
>  obj-$(CONFIG_CLK_AT91) += at91/
>  obj-$(CONFIG_CLK_BOSTON) += clk_boston.o
> +
> +obj-$(CONFIG_ARCH_ASPEED) += aspeed/
> diff --git a/drivers/clk/aspeed/Makefile b/drivers/clk/aspeed/Makefile
> new file mode 100644
> index 00..65d1cd6e29
> --- /dev/null
> +++ b/drivers/clk/aspeed/Makefile
> @@ -0,0 +1,7 @@
> +#
> +# Copyright (c) 2016 Google, Inc
> +#
> +# SPDX-License-

Re: [U-Boot] [PATCH 10/12] aspeed: Common configuration parameters for aspeed boards

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> Signed-off-by: Maxim Sloyko 
> ---
>
>  include/configs/aspeed-common.h | 84 
> +
>  1 file changed, 84 insertions(+)
>  create mode 100644 include/configs/aspeed-common.h
>
> diff --git a/include/configs/aspeed-common.h b/include/configs/aspeed-common.h
> new file mode 100644
> index 00..c125e39e3f
> --- /dev/null
> +++ b/include/configs/aspeed-common.h
> @@ -0,0 +1,84 @@
> +/*
> + * Copyright (C) 2012-2020  ASPEED Technology Inc.
> + * Ryan Chen 
> + *
> + * Copyright 2016 IBM Corporation
> + * (C) Copyright 2016 Google, Inc
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#ifndef __AST_COMMON_CONFIG_H
> +#define __AST_COMMON_CONFIG_H
> +
> +/* Misc CPU related */
> +#define CONFIG_CMDLINE_TAG
> +#define CONFIG_SETUP_MEMORY_TAGS
> +#define CONFIG_INITRD_TAG
> +
> +#define CONFIG_CMDLINE_EDITING 1

Drop the '1' from this

> +
> +/* Enable cache controller */
> +#define CONFIG_SYS_DCACHE_OFF  1

and this

> +
> +#ifdef CONFIG_PRE_CON_BUF_SZ
> +#define PRE_CON_RAM_SZ CONFIG_PRE_CON_BUF_SZ
> +#else
> +#define PRE_CON_RAM_SZ 0
> +#endif

What is this for?

> +
> +#define CONFIG_SYS_SDRAM_BASE  0x8000
> +#define CONFIG_SYS_INIT_RAM_ADDR   (0x1e72 + PRE_CON_RAM_SZ)
> +#define CONFIG_SYS_INIT_RAM_SIZE   (36*1024 - PRE_CON_RAM_SZ)
> +#define SYS_INIT_RAM_END   (CONFIG_SYS_INIT_RAM_ADDR \
> ++ CONFIG_SYS_INIT_RAM_SIZE)
> +#define CONFIG_SYS_INIT_SP_ADDR(SYS_INIT_RAM_END \
> +- GENERATED_GBL_DATA_SIZE)
> +#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE \
> +- GENERATED_GBL_DATA_SIZE)

Those last two should not be needed

> +
> +#define CONFIG_NR_DRAM_BANKS   1
> +
> +#define CONFIG_SYS_TEXT_BASE   0x
> +
> +#define CONFIG_SYS_MALLOC_LEN  (32 << 20)
> +
> +/*
> + * NS16550 Configuration
> + */
> +#define CONFIG_BAUDRATE115200
> +
> +/*
> + * BOOTP options
> + */
> +#define CONFIG_BOOTP_BOOTFILESIZE
> +#define CONFIG_BOOTP_BOOTPATH
> +#define CONFIG_BOOTP_GATEWAY
> +#define CONFIG_BOOTP_HOSTNAME
> +#define CONFIG_BOOTP_SUBNETMASK
> +
> +/*
> + * Miscellaneous configurable options
> + */
> +#define CONFIG_SYS_LONGHELP
> +#define CONFIG_SYS_CBSIZE  256
> +
> +/* Print Buffer Size */
> +#define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE \
> ++ sizeof(CONFIG_SYS_PROMPT) + 16)
> +#define CONFIG_SYS_MAXARGS 16
> +#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
> +
> +#define CONFIG_BOOTARGS \
> +   "console=ttyS4,115200n8" \
> +   " root=/dev/ram rw"
> +
> +#define CONFIG_BOOTCOMMAND "bootm 2008 2030"
> +#define CONFIG_ENV_OVERWRITE
> +
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> +   "verify=yes\0"  \
> +   "spi_dma=yes\0" \
> +   ""
> +
> +#endif /* __AST_COMMON_CONFIG_H */
> --
> 2.11.0.390.gc69c2f50cf-goog
>

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


Re: [U-Boot] [PATCH 09/12] aspeed/ast2500: Common board init functions for ast2500 based boards

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> Signed-off-by: Maxim Sloyko 
> ---
>
>  arch/arm/mach-aspeed/Makefile|  2 +-
>  arch/arm/mach-aspeed/ast2500-board.c | 74 
> 
>  2 files changed, 75 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/mach-aspeed/ast2500-board.c
>
> diff --git a/arch/arm/mach-aspeed/Makefile b/arch/arm/mach-aspeed/Makefile
> index 1f7af71b03..9d29ff7f6f 100644
> --- a/arch/arm/mach-aspeed/Makefile
> +++ b/arch/arm/mach-aspeed/Makefile
> @@ -5,4 +5,4 @@
>  #
>
>  obj-$(CONFIG_ARCH_ASPEED) += ast_wdt.o
> -obj-$(CONFIG_ASPEED_AST2500) += ast2500/
> +obj-$(CONFIG_ASPEED_AST2500) += ast2500/ ast2500-board.o
> diff --git a/arch/arm/mach-aspeed/ast2500-board.c 
> b/arch/arm/mach-aspeed/ast2500-board.c
> new file mode 100644
> index 00..5b2b0ce132
> --- /dev/null
> +++ b/arch/arm/mach-aspeed/ast2500-board.c
> @@ -0,0 +1,74 @@
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

Check include file order.

> +
> +/* Second Watchdog Timer by default is configured

/*
 * Second watchdog...
 * ...
 */

Please check globally. Try to use more columns if you can.

> + * to trigger secondary boot source.
> + */
> +#define AST_2ND_BOOT_WDT   (1)

Remove () around simple constants.

> +
> +/* Third Watchdog Timer by default is configured
> + * to toggle Flash address mode switch before reset.
> + */
> +#define AST_FLASH_ADDR_DETECT_WDT  (2)
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +void lowlevel_init(void)
> +{
> +   /*
> +* These two watchdogs need to be stopped as soon as possible,
> +* otherwise the board might hang. By default they are set to
> +* a very short timeout and even simple debug write to serial
> +* console early in the init process might cause them to fire.
> +*/
> +   struct ast_wdt *flash_addr_wdt =
> +   (struct ast_wdt *)(WDT_BASE +
> +  sizeof(struct ast_wdt) *
> +  AST_FLASH_ADDR_DETECT_WDT);
> +
> +   clrbits_le32(&flash_addr_wdt->ctrl, WDT_CTRL_EN);
> +
> +#ifndef CONFIG_FIRMWARE_2ND_BOOT
> +   struct ast_wdt *sec_boot_wdt =
> +   (struct ast_wdt *)(WDT_BASE +
> +  sizeof(struct ast_wdt) *
> +  AST_2ND_BOOT_WDT);
> +
> +   clrbits_le32(&sec_boot_wdt->ctrl, WDT_CTRL_EN);
> +#endif

Seems this should call a helper function in ast_wdt.c or similar.

> +}
> +
> +int board_init(void)
> +{
> +   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;

blank line

> +   return 0;
> +}
> +
> +int dram_init(void)
> +{
> +   struct udevice *dev;
> +   int ret = uclass_get_device(UCLASS_RAM, 0, &dev);

blank line, and better to separate decl and code in this case, since
you check it below.

> +   if (ret) {
> +   debug("DRAM FAIL1\r\n");
> +   return ret;
> +   }
> +
> +   struct ram_info ram;

move to top of function

> +   ret = ram_get_info(dev, &ram);
> +   if (ret) {
> +   debug("DRAM FAIL2\r\n");
> +   return ret;
> +   }
> +

drop extra blank line

> +
> +   gd->ram_size = ram.size;

blank line

> +   return 0;
> +}
> +
> --
> 2.11.0.390.gc69c2f50cf-goog
>

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


Re: [U-Boot] [PATCH 08/12] aspeed/ast2500: Add SDRAM MC driver

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> The driver is very ast2500 specific and is completely incompatible

ast2500-specific

> with previous versions of the chip.
>
> The memory controller is very poorly documented by Aspeed in the
> datasheet, with any mention of the whole range of registers missing. The
> initialization procedure has been basically taken from Aspeed SDK, where
> it is implemented in assembly and rewritten in C, with very limited
> understanding of what exacly it is doing.

Here I think you mean:
where
 it is implemented in assembly. Here it is rewritten in C, with very limited
 understanding of what exactly (spelling) it is doing.


>
> Signed-off-by: Maxim Sloyko 
> ---
>
>  arch/arm/include/asm/arch-aspeed/sdram_ast2500.h | 133 +++
>  arch/arm/mach-aspeed/ast2500/Makefile|   2 +-
>  arch/arm/mach-aspeed/ast2500/sdram_ast2500.c | 443 
> +++
>  3 files changed, 577 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/include/asm/arch-aspeed/sdram_ast2500.h
>  create mode 100644 arch/arm/mach-aspeed/ast2500/sdram_ast2500.c
>
> diff --git a/arch/arm/include/asm/arch-aspeed/sdram_ast2500.h 
> b/arch/arm/include/asm/arch-aspeed/sdram_ast2500.h
> new file mode 100644
> index 00..ca70898df6
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-aspeed/sdram_ast2500.h
> @@ -0,0 +1,133 @@
> +#ifndef _ASM_ARCH_SDRAM_AST2500_H
> +#define _ASM_ARCH_SDRAM_AST2500_H
> +
> +#define SDRAM_UNLOCK_KEY   0xfc600309
> +#define SDRAM_VIDEO_UNLOCK_KEY 0x2003000f
> +
> +#define SDRAM_PCR_CKE_EN   (1 << 0)
> +#define SDRAM_PCR_AUTOPWRDN_EN (1 << 1)
> +#define SDRAM_PCR_CKE_DELAY_SHIFT  4
> +#define SDRAM_PCR_CKE_DELAY_MASK   7
> +#define SDRAM_PCR_RESETN_DIS   (1 << 7)
> +#define SDRAM_PCR_ODT_EN   (1 << 8)
> +#define SDRAM_PCR_ODT_AUTO_ON  (1 << 10)
> +#define SDRAM_PCR_ODT_EXT_EN   (1 << 11)
> +#define SDRAM_PCR_TCKE_PW_SHIFT12
> +#define SDRAM_PCR_TCKE_PW_MASK 7
> +#define SDRAM_PCR_RGAP_CTRL_EN (1 << 15)
> +#define SDRAM_PCR_MREQI_DIS(1 << 17)
> +
> +/* Fixed priority DRAM Requests mask */
> +#define SDRAM_REQ_VGA_HW_CURSOR(1 << 0)
> +#define SDRAM_REQ_VGA_TEXT_CG_FONT (1 << 1)
> +#define SDRAM_REQ_VGA_TEXT_ASCII   (1 << 2)
> +#define SDRAM_REQ_VGA_CRT  (1 << 3)
> +#define SDRAM_REQ_SOC_DC_CURSOR(1 << 4)
> +#define SDRAM_REQ_SOC_DC_OCD   (1 << 5)
> +#define SDRAM_REQ_SOC_DC_CRT   (1 << 6)
> +#define SDRAM_REQ_VIDEO_HIPRI_WRITE(1 << 7)
> +#define SDRAM_REQ_USB20_EHCI1  (1 << 8)
> +#define SDRAM_REQ_USB20_EHCI2  (1 << 9)
> +#define SDRAM_REQ_CPU  (1 << 10)
> +#define SDRAM_REQ_AHB2 (1 << 11)
> +#define SDRAM_REQ_AHB  (1 << 12)
> +#define SDRAM_REQ_MAC0 (1 << 13)
> +#define SDRAM_REQ_MAC1 (1 << 14)
> +#define SDRAM_REQ_PCIE (1 << 16)
> +#define SDRAM_REQ_XDMA (1 << 17)
> +#define SDRAM_REQ_ENCRYPTION   (1 << 18)
> +#define SDRAM_REQ_VIDEO_FLAG   (1 << 21)
> +#define SDRAM_REQ_VIDEO_LOW_PRI_WRITE  (1 << 28)
> +#define SDRAM_REQ_2D_RW(1 << 29)
> +#define SDRAM_REQ_MEMCHECK (1 << 30)
> +
> +#define SDRAM_ICR_RESET_ALL(1 << 31)
> +
> +#define SDRAM_CONF_CAP_SHIFT   0
> +#define SDRAM_CONF_CAP_MASK3
> +#define SDRAM_CONF_DDR4(1 << 4)
> +#define SDRAM_CONF_SCRAMBLE(1 << 8)
> +#define SDRAM_CONF_SCRAMBLE_PAT2   (1 << 9)
> +#define SDRAM_CONF_CACHE_EN(1 << 10)
> +#define SDRAM_CONF_CACHE_INIT_EN   (1 << 12)
> +#define SDRAM_CONF_DUALX8  (1 << 13)
> +#define SDRAM_CONF_CACHE_INIT_DONE (1 << 19)
> +
> +#define SDRAM_CONF_CAP_128M0
> +#define SDRAM_CONF_CAP_256M1
> +#define SDRAM_CONF_CAP_512M2
> +#define SDRAM_CONF_CAP_1024M   3
> +
> +#define SDRAM_MISC_DDR4_TREFRESH   (1 << 3)
> +
> +#define SDRAM_PHYCTRL0_INIT(1 << 0)
> +#define SDRAM_PHYCTRL0_AUTO_UPDATE (1 << 1)
> +#define SDRAM_PHYCTRL0_NRST(1 << 2)
> +
> +#define SDRAM_REFRESH_CYCLES_SHIFT 0
> +#define SDRAM_REFRESH_CYCLES_MASK  0xf
> +#define SDRAM_REFRESH_ZQCS_EN  (1 << 7)
> +#define SDRAM_REFRESH_PERIOD_SHIFT 8
> +#define SDRAM_REFRESH_PERIOD_MASK  0xf
> +
> +#define SDRAM_TEST_LEN_SHIFT   4
> +#define SDRAM_TEST_LEN_MASK0xf
> +#define SDRAM_TEST_START_ADDR_SHIFT24
> +#define SDRAM_TEST_START_ADDR_MASK 0x3f
> +
> +#define SDRAM_TEST_EN  (1 << 0)
> +#define SDRAM_TEST_MODE_SHIFT  1
> +#define SDRAM_TEST_MODE_MASK   3
> +#define SDRAM_TEST_MODE_WO 0
> +#define SDRAM_TEST_MODE_RB 1
> +#define SDRAM_TEST_MODE_RW 2
> +#de

Re: [U-Boot] [PATCH 2/2] cmd: fdt: Print error message when fdt application fails

2017-01-14 Thread Simon Glass
On 17 December 2016 at 15:48, Simon Glass  wrote:
> On 16 December 2016 at 02:33, Maxime Ripard
>  wrote:
>> On Thu, Dec 15, 2016 at 03:03:27PM -0800, Stefan Agner wrote:
>>> From: Stefan Agner 
>>>
>>> There are lots of reason why a FDT application might fail, the
>>> error code might give an indication. Let the error code translate
>>> in a error string so users can try to understand what went wrong.
>>>
>>> Signed-off-by: Stefan Agner 
>>
>> Acked-by: Maxime Ripard 
>
> Acked-by: Simon Glass 

Applied to u-boot-fdt, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] libfdt: Correct fdt handling of overlays without fixups and base trees without symbols

2017-01-14 Thread Simon Glass
On 25 December 2016 at 22:24, Simon Glass  wrote:
> On 21 December 2016 at 03:58, Stefan Agner  wrote:
>> From: David Gibson 
>>
>> The fdt_overlay_apply() function purports to support the edge cases where
>> an overlay has no fixups to be applied, or a base tree which has no
>> symbols (the latter can only work if the former is also true).  However it
>> gets it wrong in a couple of small ways:
>>
>>   * In the no fixups case, it doesn't fail immediately, but will attempt
>> fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
>> offset, which will fail.  Instead it should succeed immediately, since
>> there's nothing to do.
>>   * In the case of no symbols, it again doesn't fail immediately.  However
>> if there is an actual fixup it will fail with an unexpected error,
>> because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
>> look up the symbols.  We should instead return -FDT_ERR_NOTFOUND
>> directly.
>>
>> Both of these errors lead to the code returning misleading error codes in
>> failing cases.
>>
>> [ DTC commit: 7d8ef6e1db9794f72805a0855f4f7f12fadd03d3 ]
>>
>> Signed-off-by: David Gibson 
>> Signed-off-by: Stefan Agner 
>> ---
>>
>> Changes in v2:
>> - Backported patch from libfdt
>>
>>  lib/libfdt/fdt_overlay.c | 7 ++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-fdt, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 12/12] aspeed: Configuration for ast2500 eval board

2017-01-14 Thread Simon Glass
Hi Maxim,

On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> ---
>

Commit message?

> ---
>
> Signed-off-by: Maxim Sloyko 
> ---
>  arch/arm/mach-aspeed/ast2500/Kconfig   |  7 +++
>  board/aspeed/evb_ast2500/Kconfig   | 12 
>  board/aspeed/evb_ast2500/Makefile  |  1 +
>  board/aspeed/evb_ast2500/evb_ast2500.c |  1 +
>  configs/evb-ast2500_defconfig  | 21 +
>  include/configs/evb_ast2500.h  | 30 ++
>  6 files changed, 72 insertions(+)
>  create mode 100644 board/aspeed/evb_ast2500/Kconfig
>  create mode 100644 board/aspeed/evb_ast2500/Makefile
>  create mode 100644 board/aspeed/evb_ast2500/evb_ast2500.c
>  create mode 100644 configs/evb-ast2500_defconfig
>  create mode 100644 include/configs/evb_ast2500.h
>
> diff --git a/arch/arm/mach-aspeed/ast2500/Kconfig 
> b/arch/arm/mach-aspeed/ast2500/Kconfig
> index c0b448f19e..7397d0c179 100644
> --- a/arch/arm/mach-aspeed/ast2500/Kconfig
> +++ b/arch/arm/mach-aspeed/ast2500/Kconfig
> @@ -3,4 +3,11 @@ if ASPEED_AST2500
>  config SYS_CPU
> default "arm1176"
>
> +config TARGET_EVB_AST2500
> +   bool "Evb-AST2500"
> +   help
> + Evb-AST2500 is Aspeed evaluation board for AST2500 chip.

More details? What peripherals does it provide?

> +
> +source "board/aspeed/evb_ast2500/Kconfig"
> +
>  endif
> diff --git a/board/aspeed/evb_ast2500/Kconfig 
> b/board/aspeed/evb_ast2500/Kconfig
> new file mode 100644
> index 00..73a8ae85f6
> --- /dev/null
> +++ b/board/aspeed/evb_ast2500/Kconfig
> @@ -0,0 +1,12 @@
> +if TARGET_EVB_AST2500
> +
> +config SYS_BOARD
> +   default "evb_ast2500"
> +
> +config SYS_VENDOR
> +   default "aspeed"
> +
> +config SYS_CONFIG_NAME
> +   default "evb_ast2500"
> +
> +endif
> diff --git a/board/aspeed/evb_ast2500/Makefile 
> b/board/aspeed/evb_ast2500/Makefile
> new file mode 100644
> index 00..4564098299
> --- /dev/null
> +++ b/board/aspeed/evb_ast2500/Makefile
> @@ -0,0 +1 @@
> +obj-y += evb_ast2500.o
> diff --git a/board/aspeed/evb_ast2500/evb_ast2500.c 
> b/board/aspeed/evb_ast2500/evb_ast2500.c
> new file mode 100644
> index 00..65e11030d8
> --- /dev/null
> +++ b/board/aspeed/evb_ast2500/evb_ast2500.c
> @@ -0,0 +1 @@
> +#include 
> diff --git a/configs/evb-ast2500_defconfig b/configs/evb-ast2500_defconfig
> new file mode 100644
> index 00..4598f6f418
> --- /dev/null
> +++ b/configs/evb-ast2500_defconfig
> @@ -0,0 +1,21 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_ASPEED=y
> +CONFIG_ASPEED_AST2500=y
> +CONFIG_TARGET_EVB_AST2500=y
> +CONFIG_DEFAULT_DEVICE_TREE="ast2500-evb"
> +CONFIG_OF_CONTROL=y
> +CONFIG_DM=y
> +CONFIG_SYS_MALLOC_F_LEN=0x2000
> +CONFIG_DISPLAY_CPUINFO=n
> +CONFIG_SYS_NS16550=y
> +CONFIG_DM_SERIAL=y
> +CONFIG_SYSRESET=y
> +CONFIG_CLK=y
> +CONFIG_TIMER=y
> +CONFIG_RAM=y
> +CONFIG_REGMAP=y
> +CONFIG_PRE_CONSOLE_BUFFER=y
> +CONFIG_PRE_CON_BUF_ADDR=0x1e72
> +CONFIG_PRE_CON_BUF_SZ=4096
> +CONFIG_SYS_NO_FLASH=y
> +CONFIG_CMD_IMLS=n
> diff --git a/include/configs/evb_ast2500.h b/include/configs/evb_ast2500.h
> new file mode 100644
> index 00..28d11a2bdf
> --- /dev/null
> +++ b/include/configs/evb_ast2500.h
> @@ -0,0 +1,30 @@
> +/*
> + * Copyright (C) 2012-2020  ASPEED Technology Inc.
> + * Ryan Chen 
> + *
> + * Copyright 2016 Google Inc
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +#include 
> +
> +

Drop extra BLANK LINE

> +#define CONFIG_SYS_MEMTEST_START   (CONFIG_SYS_SDRAM_BASE + 0x30)
> +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x500)
> +
> +#define CONFIG_SYS_UBOOT_BASE  CONFIG_SYS_TEXT_BASE
> +
> +/*
> + * Memory Info
> + */

Could be on one line

> +#define CONFIG_SYS_LOAD_ADDR   0x8300
> +
> +#define CONFIG_ENV_IS_NOWHERE  1

You can drop the 1.

> +
> +#define CONFIG_ENV_SIZE0x2
> +
> +#endif /* __CONFIG_H */
> --
> 2.11.0.390.gc69c2f50cf-goog
>

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


Re: [U-Boot] [PATCH 11/12] aspeed: Device Tree for ast2500 Eval Board

2017-01-14 Thread Simon Glass
On 4 January 2017 at 12:46, Maxim Sloyko  wrote:
> Signed-off-by: Maxim Sloyko 

Please add a commit message explaining where it came from.

> ---
>
>  arch/arm/dts/Makefile|  2 ++
>  arch/arm/dts/ast2500-evb.dts | 23 +++
>  2 files changed, 25 insertions(+)
>  create mode 100644 arch/arm/dts/ast2500-evb.dts

Reviewed-by: Simon Glass 

>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index f43746966c..1bee50e237 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -316,6 +316,8 @@ dtb-$(CONFIG_ARCH_BCM283X) += \
> bcm2836-rpi-2-b.dtb \
> bcm2837-rpi-3-b.dtb
>
> +dtb-$(CONFIG_ARCH_ASPEED) += ast2500-evb.dtb
> +
>  targets += $(dtb-y)
>
>  # Add any required device tree compiler flags here
> diff --git a/arch/arm/dts/ast2500-evb.dts b/arch/arm/dts/ast2500-evb.dts
> new file mode 100644
> index 00..b1a415f7d7
> --- /dev/null
> +++ b/arch/arm/dts/ast2500-evb.dts
> @@ -0,0 +1,23 @@
> +/dts-v1/;
> +
> +#include "ast2500.dtsi"
> +
> +/ {
> +   memory {
> +   device_type = "memory";
> +   reg = <0x8000 0x2000>;
> +   };
> +
> +   chosen {
> +   stdout-path = &uart5;
> +   };
> +};
> +
> +&uart5 {
> +   u-boot,dm-pre-reloc;

Consider putting this and any other U-Boot-specific things in a
u-boot*.dtsi file if you have one.

> +   status = "okay";
> +};
> +
> +&sdrammc {
> +   clock-frequency = <4>;
> +};
> --
> 2.11.0.390.gc69c2f50cf-goog
>

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


Re: [U-Boot] [PATCH v2] cmd/fdt: Make fdt get value endian-safe for single-cell properties

2017-01-14 Thread Simon Glass
On 12 January 2017 at 19:19, Simon Glass  wrote:
> On 9 January 2017 at 08:08, Andreas Färber  wrote:
>> On a Raspberry Pi 2 disagreements on cell endianness can be observed:
>>
>>   U-Boot> fdt print /soc/gpio@7e20 phandle
>>   phandle = <0x000d>
>>   U-Boot> fdt get value myvar /soc/gpio@7e20 phandle; printenv myvar
>>   myvar=0x0D00
>>
>> Fix this by always treating the pointer as BE and converting it in
>> fdt_value_setenv(), like its counterpart fdt_parse_prop() already does.
>>
>> Consistently use fdt32_t, fdt32_to_cpu() and cpu_to_fdt32().
>>
>> Fixes: bc80295 ("fdt: Add get commands to fdt")
>> Cc: Joe Hershberger 
>> Cc: Gerald Van Baren 
>> Signed-off-by: Andreas Färber 
>> ---
>>  cmd/fdt.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-fdt, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-fdt

2017-01-14 Thread Simon Glass
Hi Tom,

Just a few fixes.

The following changes since commit 70c1e0474a9df2c4493b4e2330cc41d3132b4e90:

  Merge git://git.denx.de/u-boot-rockchip (2017-01-12 21:20:51 -0500)

are available in the git repository at:

  git://git.denx.de/u-boot-fdt.git

for you to fetch changes up to b05bf6c75d03c925737e228472b694cbeaa503c2:

  cmd/fdt: Make fdt get value endian-safe for single-cell properties
(2017-01-14 10:09:46 -0700)


Andreas Färber (1):
  cmd/fdt: Make fdt get value endian-safe for single-cell properties

David Gibson (1):
  libfdt: Correct fdt handling of overlays without fixups and base
trees without symbols

Stefan Agner (1):
  cmd: fdt: Print error message when fdt application fails

 cmd/fdt.c| 10 +++---
 lib/libfdt/fdt_overlay.c |  7 ++-
 2 files changed, 13 insertions(+), 4 deletions(-)

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


[U-Boot] [PATCH] Kconfig: CONFIG_OF_PLATDATA doesn't really exist

2017-01-14 Thread Tom Rini
There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini 
---
 common/spl/spl.c | 2 +-
 drivers/serial/Kconfig   | 2 +-
 scripts/config_whitelist.txt | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index a76ea3a60342..e512ee03effa 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -248,7 +248,7 @@ int spl_init(void)
}
}
if (IS_ENABLED(CONFIG_SPL_DM)) {
-   /* With CONFIG_OF_PLATDATA, bring in all devices */
+   /* With CONFIG_SPL_OF_PLATDATA, bring in all devices */
ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA));
if (ret) {
debug("dm_init_and_scan() returned error %d\n", ret);
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index b26ada38adaf..b11f3ff89eb6 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -352,7 +352,7 @@ config ROCKCHIP_SERIAL
depends on DM_SERIAL && SPL_OF_PLATDATA
help
  Select this to enable a debug UART for Rockchip devices when using
- CONFIG_OF_PLATDATA (i.e. a compiled-in device tree replacemenmt).
+ CONFIG_SPL_OF_PLATDATA (i.e. a compiled-in device tree replacemenmt).
  This uses the ns16550 driver, converting the platdata from of-platdata
  to the ns16550 format.
 
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 1ad9f7e9e7ab..d7244c56ad8e 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2229,7 +2229,6 @@ CONFIG_ODROID_REV_AIN
 CONFIG_OFF_PADCONF
 CONFIG_OF_
 CONFIG_OF_IDE_FIXUP
-CONFIG_OF_PLATDATA
 CONFIG_OF_SPI
 CONFIG_OF_SPI_FLASH
 CONFIG_OF_STDOUT_PATH
-- 
1.9.1

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


[U-Boot] [PATCH] rockchip: Correct MAINTAINER entry for chromebook_minnie

2017-01-14 Thread Simon Glass
This is wrong at present, so genboardscfg.py gives the following warnings:

WARNING: no status info for 'chromebook_minnie'
WARNING: no maintainers for 'chromebook_minnie'

Fix it.

Signed-off-by: Simon Glass 
---

 board/google/veyron/MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/google/veyron/MAINTAINERS b/board/google/veyron/MAINTAINERS
index d582cb00e2b..246a3e3b555 100644
--- a/board/google/veyron/MAINTAINERS
+++ b/board/google/veyron/MAINTAINERS
@@ -12,9 +12,9 @@ F:board/google/veyron/
 F: include/configs/veyron.h
 F: configs/chromebit_mickey_defconfig
 
-CHROMEBIT MINNIE BOARD
+CHROMEBOOK MINNIE BOARD
 M: Simon Glass 
 S: Maintained
 F: board/google/veyron/
 F: include/configs/veyron.h
-F: configs/chromebit_minnie_defconfig
+F: configs/chromebook_minnie_defconfig
-- 
2.11.0.483.g087da7b7c-goog

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


Re: [U-Boot] [PATCH 1/2] ARM: uniphier: enable Cadence eMMC controller for LD11/LD20

2017-01-14 Thread Masahiro Yamada
2017-01-04 20:08 GMT+09:00 Masahiro Yamada :
> Enable SDMA (Single Operation DMA) for LD11, but not for LD20.
> The SDMA does not work for LD20 boards because they are generally
> equipped with more memory than fits in the 32 bit physical address
> space supported by the SDMA.
>
> Signed-off-by: Masahiro Yamada 
>

Applied to u-boot-uniphier/master.


-- 
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 2/2] ARM: dts: uniphier: add UniPhier specific compatible to eMMC node

2017-01-14 Thread Masahiro Yamada
2017-01-04 20:08 GMT+09:00 Masahiro Yamada :
> The "cdns,sd4hc" is a fallback of the IP.  Add the SoC-specific
> compatible string.
>
> Signed-off-by: Masahiro Yamada 

Applied to u-boot-uniphier/master.

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


Re: [U-Boot] Please pull u-boot-fdt

2017-01-14 Thread Tom Rini
On Sat, Jan 14, 2017 at 10:14:44AM -0700, Simon Glass wrote:

> Hi Tom,
> 
> Just a few fixes.
> 
> The following changes since commit 70c1e0474a9df2c4493b4e2330cc41d3132b4e90:
> 
>   Merge git://git.denx.de/u-boot-rockchip (2017-01-12 21:20:51 -0500)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-fdt.git
> 
> for you to fetch changes up to b05bf6c75d03c925737e228472b694cbeaa503c2:
> 
>   cmd/fdt: Make fdt get value endian-safe for single-cell properties
> (2017-01-14 10:09:46 -0700)
> 

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


Re: [U-Boot] [U-Boot, 2/4] omap3_igep00x0: Rework MACH_TYPE and status LED logic slightly

2017-01-14 Thread Tom Rini
On Tue, Jan 10, 2017 at 05:22:06PM -0500, Tom Rini wrote:

> The MACH_TYPE for IGEP0032 was never officially used and has been
> removed from upstream, so we must not use it.  In order to remove this
> we need to rework the status LED logic.
> 
> Cc: Enric Balletbo i Serra 
> Signed-off-by: Tom Rini 
> Acked-by: Enric Balletbo i Serra 

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


Re: [U-Boot] [U-Boot, 3/4] arm: Remove unregister MACH_TYPE_xxx uses

2017-01-14 Thread Tom Rini
On Tue, Jan 10, 2017 at 05:22:07PM -0500, Tom Rini wrote:

> Before we can sync with the latest mach-types.h file from the Linux
> Kernel we need to remove some instances of MACH_TYPE_xxx from our
> sources.  As these values have been removed from the canonical upstream
> source we should not be using them either, so drop.
> 
> Cc: Tom Warren 
> Cc: Lucas Stach 
> Cc: Luka Perkov 
> Cc: Stephen Warren 
> Cc: Heiko Schocher 
> Cc: Thomas Weber 
> Cc: Lucile Quirion 
> Cc: Matthias Weisser 
> Cc: Suriyan Ramasami 
> Cc: Nobuhiro Iwamatsu 
> Cc: Bo Shen 
> Cc: Nick Thompson 
> Cc: Stefano Babic 
> Cc: Erik van Luijk 
> Cc: Lokesh Vutla 
> Signed-off-by: Tom Rini 

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


Re: [U-Boot] [U-Boot, 4/4] arm: Re-sync asm/mach-types.h with Linux Kernel v4.9

2017-01-14 Thread Tom Rini
On Tue, Jan 10, 2017 at 05:22:08PM -0500, Tom Rini wrote:

> This re-syncs the MACH_TYPE_xxx values from the Linux Kernel v4.9
> release.  In addition this removes all of the machine_arch_type and
> machine_is_xxx logic that is unused in U-Boot.  This removal removes a
> large number of otherwise unused CONFIG values from the list to be
> converted.
> 
> Cc: Masahiro Yamada 
> Signed-off-by: Tom Rini 
> Tested-by: Adam Ford 

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


Re: [U-Boot] [PATCH] Kconfig: CONFIG_OF_PLATDATA doesn't really exist

2017-01-14 Thread Tom Rini
On Sat, Jan 14, 2017 at 12:21:39PM -0500, Tom Rini wrote:

> There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
> the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.
> 
> Signed-off-by: Tom Rini 

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


Re: [U-Boot] [U-Boot, 1/4] omap3_logic: Rework MACH_TYPE and fdtfile logic

2017-01-14 Thread Tom Rini
On Tue, Jan 10, 2017 at 05:22:05PM -0500, Tom Rini wrote:

> The MACH_TYPE values for the omap37xx based platforms are no longer
> officially valid, so we must not set and pass them.  In order to not
> reference them but still be able to set the default fdtfile based on the
> board detection logic we need to combine the two steps into one.
> 
> Cc: Adam Ford 
> Signed-off-by: Tom Rini 
> Acked-by: Adam Ford 

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


Re: [U-Boot] [PATCH v3 1/2] Convert CONFIG_SPL_RAM_DEVICE to defconfig

2017-01-14 Thread Stefan Agner
Hi Tom,

I think this did not get applied yet?

--
Stefan

On 2016-12-22 22:51, Stefan Agner wrote:
> From: Stefan Agner 
> 
> This converts the following to Kconfig:
>   CONFIG_SPL_RAM_DEVICE
> 
> Signed-off-by: Stefan Agner 
> ---
> 
> Changes in v3: None
> Changes in v2: None
> 
>  common/spl/Kconfig   | 9 +
>  include/configs/microblaze-generic.h | 1 -
>  include/configs/socfpga_common.h | 1 -
>  include/configs/tegra-common.h   | 1 -
>  include/configs/xilinx_zynqmp.h  | 1 -
>  include/configs/zynq-common.h| 1 -
>  6 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index cba51f5df6..ea084f462b 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -449,6 +449,15 @@ config SPL_POWER_SUPPORT
> in drivers/power, drivers/power/pmic and drivers/power/regulator
> as part of an SPL build.
>  
> +config SPL_RAM_DEVICE
> + bool "Support booting from preloaded image in RAM"
> + depends on SPL
> + default y if MICROBLAZE || ARCH_SOCFPGA || TEGRA || ARCH_ZYNQ
> + help
> +   Enable booting of an image already loaded in RAM. The image has to
> +   be already in memory when SPL takes over, e.g. loaded by the boot
> +   ROM.
> +
>  config SPL_SATA_SUPPORT
>   bool "Support loading from SATA"
>   depends on SPL
> diff --git a/include/configs/microblaze-generic.h
> b/include/configs/microblaze-generic.h
> index 7abffdb2ef..cc90b73fa1 100644
> --- a/include/configs/microblaze-generic.h
> +++ b/include/configs/microblaze-generic.h
> @@ -284,7 +284,6 @@
>  
>  #define CONFIG_SPL_LDSCRIPT  "arch/microblaze/cpu/u-boot-spl.lds"
>  
> -#define CONFIG_SPL_RAM_DEVICE
>  #ifdef CONFIG_SYS_FLASH_BASE
>  # define CONFIG_SYS_UBOOT_BASE   CONFIG_SYS_FLASH_BASE
>  #endif
> diff --git a/include/configs/socfpga_common.h 
> b/include/configs/socfpga_common.h
> index 58a6550844..7292469433 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -309,7 +309,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
>   * 0x_FF00 .. End of SRAM
>   */
>  #define CONFIG_SPL_FRAMEWORK
> -#define CONFIG_SPL_RAM_DEVICE
>  #define CONFIG_SPL_TEXT_BASE CONFIG_SYS_INIT_RAM_ADDR
>  #define CONFIG_SPL_MAX_SIZE  (64 * 1024)
>  
> diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
> index 23a0e782e0..f30fec84a2 100644
> --- a/include/configs/tegra-common.h
> +++ b/include/configs/tegra-common.h
> @@ -98,7 +98,6 @@
>  
>  /* Defines for SPL */
>  #define CONFIG_SPL_FRAMEWORK
> -#define CONFIG_SPL_RAM_DEVICE
>  #define CONFIG_SPL_BOARD_INIT
>  #define CONFIG_SPL_NAND_SIMPLE
>  #define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_TEXT_BASE - \
> diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
> index fb4f6d6806..8845ff425d 100644
> --- a/include/configs/xilinx_zynqmp.h
> +++ b/include/configs/xilinx_zynqmp.h
> @@ -260,7 +260,6 @@
>  
>  #define CONFIG_SPL_FRAMEWORK
>  #define CONFIG_SPL_BOARD_INIT
> -#define CONFIG_SPL_RAM_DEVICE
>  
>  /* u-boot is like dtb */
>  #define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin"
> diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
> index 953e7311a6..e04be5c18c 100644
> --- a/include/configs/zynq-common.h
> +++ b/include/configs/zynq-common.h
> @@ -296,7 +296,6 @@
>  #define CONFIG_CMD_SPL
>  #define CONFIG_SPL_FRAMEWORK
>  #define CONFIG_SPL_BOARD_INIT
> -#define CONFIG_SPL_RAM_DEVICE
>  
>  #define CONFIG_SPL_LDSCRIPT  "arch/arm/mach-zynq/u-boot-spl.lds"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] Convert CONFIG_SPL_RAM_DEVICE to defconfig

2017-01-14 Thread Tom Rini
On Sat, Jan 14, 2017 at 01:14:42PM -0800, Stefan Agner wrote:

> Hi Tom,
> 
> I think this did not get applied yet?

Thanks for the reminder, testing this now.

> 
> --
> Stefan
> 
> On 2016-12-22 22:51, Stefan Agner wrote:
> > From: Stefan Agner 
> > 
> > This converts the following to Kconfig:
> >   CONFIG_SPL_RAM_DEVICE
> > 
> > Signed-off-by: Stefan Agner 
> > ---
> > 
> > Changes in v3: None
> > Changes in v2: None
> > 
> >  common/spl/Kconfig   | 9 +
> >  include/configs/microblaze-generic.h | 1 -
> >  include/configs/socfpga_common.h | 1 -
> >  include/configs/tegra-common.h   | 1 -
> >  include/configs/xilinx_zynqmp.h  | 1 -
> >  include/configs/zynq-common.h| 1 -
> >  6 files changed, 9 insertions(+), 5 deletions(-)
> > 
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index cba51f5df6..ea084f462b 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -449,6 +449,15 @@ config SPL_POWER_SUPPORT
> >   in drivers/power, drivers/power/pmic and drivers/power/regulator
> >   as part of an SPL build.
> >  
> > +config SPL_RAM_DEVICE
> > +   bool "Support booting from preloaded image in RAM"
> > +   depends on SPL
> > +   default y if MICROBLAZE || ARCH_SOCFPGA || TEGRA || ARCH_ZYNQ
> > +   help
> > + Enable booting of an image already loaded in RAM. The image has to
> > + be already in memory when SPL takes over, e.g. loaded by the boot
> > + ROM.
> > +
> >  config SPL_SATA_SUPPORT
> > bool "Support loading from SATA"
> > depends on SPL
> > diff --git a/include/configs/microblaze-generic.h
> > b/include/configs/microblaze-generic.h
> > index 7abffdb2ef..cc90b73fa1 100644
> > --- a/include/configs/microblaze-generic.h
> > +++ b/include/configs/microblaze-generic.h
> > @@ -284,7 +284,6 @@
> >  
> >  #define CONFIG_SPL_LDSCRIPT"arch/microblaze/cpu/u-boot-spl.lds"
> >  
> > -#define CONFIG_SPL_RAM_DEVICE
> >  #ifdef CONFIG_SYS_FLASH_BASE
> >  # define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_FLASH_BASE
> >  #endif
> > diff --git a/include/configs/socfpga_common.h 
> > b/include/configs/socfpga_common.h
> > index 58a6550844..7292469433 100644
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -309,7 +309,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
> >   * 0x_FF00 .. End of SRAM
> >   */
> >  #define CONFIG_SPL_FRAMEWORK
> > -#define CONFIG_SPL_RAM_DEVICE
> >  #define CONFIG_SPL_TEXT_BASE   CONFIG_SYS_INIT_RAM_ADDR
> >  #define CONFIG_SPL_MAX_SIZE(64 * 1024)
> >  
> > diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
> > index 23a0e782e0..f30fec84a2 100644
> > --- a/include/configs/tegra-common.h
> > +++ b/include/configs/tegra-common.h
> > @@ -98,7 +98,6 @@
> >  
> >  /* Defines for SPL */
> >  #define CONFIG_SPL_FRAMEWORK
> > -#define CONFIG_SPL_RAM_DEVICE
> >  #define CONFIG_SPL_BOARD_INIT
> >  #define CONFIG_SPL_NAND_SIMPLE
> >  #define CONFIG_SPL_MAX_FOOTPRINT   (CONFIG_SYS_TEXT_BASE - \
> > diff --git a/include/configs/xilinx_zynqmp.h 
> > b/include/configs/xilinx_zynqmp.h
> > index fb4f6d6806..8845ff425d 100644
> > --- a/include/configs/xilinx_zynqmp.h
> > +++ b/include/configs/xilinx_zynqmp.h
> > @@ -260,7 +260,6 @@
> >  
> >  #define CONFIG_SPL_FRAMEWORK
> >  #define CONFIG_SPL_BOARD_INIT
> > -#define CONFIG_SPL_RAM_DEVICE
> >  
> >  /* u-boot is like dtb */
> >  #define CONFIG_SPL_FS_LOAD_ARGS_NAME   "u-boot.bin"
> > diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
> > index 953e7311a6..e04be5c18c 100644
> > --- a/include/configs/zynq-common.h
> > +++ b/include/configs/zynq-common.h
> > @@ -296,7 +296,6 @@
> >  #define CONFIG_CMD_SPL
> >  #define CONFIG_SPL_FRAMEWORK
> >  #define CONFIG_SPL_BOARD_INIT
> > -#define CONFIG_SPL_RAM_DEVICE
> >  
> >  #define CONFIG_SPL_LDSCRIPT"arch/arm/mach-zynq/u-boot-spl.lds"

-- 
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 5/9] ARM: uniphier: refactor Support Card init code

2017-01-14 Thread Masahiro Yamada
Splitting reset assertion (support_card_reset) and deassertion
(support_card_init) is not adding much value any more.  Handle
all the initialization of Support Card in support_card_init(),
then remove support_card_reset().

Also, detect_num_flash_banks() can have a static qualifier.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/init/init-ld11.c | 2 --
 arch/arm/mach-uniphier/init/init-ld20.c | 2 --
 arch/arm/mach-uniphier/init/init-ld4.c  | 4 +---
 arch/arm/mach-uniphier/init/init-pro4.c | 4 +---
 arch/arm/mach-uniphier/init/init-pro5.c | 2 --
 arch/arm/mach-uniphier/init/init-pxs2.c | 2 --
 arch/arm/mach-uniphier/init/init-sld3.c | 4 +---
 arch/arm/mach-uniphier/init/init-sld8.c | 4 +---
 arch/arm/mach-uniphier/micro-support-card.c | 7 ---
 arch/arm/mach-uniphier/micro-support-card.h | 5 -
 10 files changed, 8 insertions(+), 28 deletions(-)

diff --git a/arch/arm/mach-uniphier/init/init-ld11.c 
b/arch/arm/mach-uniphier/init/init-ld11.c
index 64fe000..e19dc5b 100644
--- a/arch/arm/mach-uniphier/init/init-ld11.c
+++ b/arch/arm/mach-uniphier/init/init-ld11.c
@@ -15,8 +15,6 @@ int uniphier_ld11_init(const struct uniphier_board_data *bd)
 {
uniphier_ld11_sbc_init();
 
-   support_card_reset();
-
support_card_init();
 
led_puts("L0");
diff --git a/arch/arm/mach-uniphier/init/init-ld20.c 
b/arch/arm/mach-uniphier/init/init-ld20.c
index ec4563b..e056d5d 100644
--- a/arch/arm/mach-uniphier/init/init-ld20.c
+++ b/arch/arm/mach-uniphier/init/init-ld20.c
@@ -15,8 +15,6 @@ int uniphier_ld20_init(const struct uniphier_board_data *bd)
 {
uniphier_ld11_sbc_init();
 
-   support_card_reset();
-
support_card_init();
 
led_puts("L0");
diff --git a/arch/arm/mach-uniphier/init/init-ld4.c 
b/arch/arm/mach-uniphier/init/init-ld4.c
index a56fb7f..a5b9493 100644
--- a/arch/arm/mach-uniphier/init/init-ld4.c
+++ b/arch/arm/mach-uniphier/init/init-ld4.c
@@ -18,12 +18,10 @@ int uniphier_ld4_init(const struct uniphier_board_data *bd)
 
uniphier_ld4_sbc_init();
 
-   support_card_reset();
+   support_card_init();
 
uniphier_ld4_dpll_init(bd);
 
-   support_card_init();
-
led_puts("L0");
 
uniphier_memconf_2ch_init(bd);
diff --git a/arch/arm/mach-uniphier/init/init-pro4.c 
b/arch/arm/mach-uniphier/init/init-pro4.c
index 8e2ebc7..c277071 100644
--- a/arch/arm/mach-uniphier/init/init-pro4.c
+++ b/arch/arm/mach-uniphier/init/init-pro4.c
@@ -16,12 +16,10 @@ int uniphier_pro4_init(const struct uniphier_board_data *bd)
 {
uniphier_sbc_init_savepin();
 
-   support_card_reset();
+   support_card_init();
 
uniphier_pro4_dpll_init(bd);
 
-   support_card_init();
-
led_puts("L0");
 
uniphier_memconf_2ch_init(bd);
diff --git a/arch/arm/mach-uniphier/init/init-pro5.c 
b/arch/arm/mach-uniphier/init/init-pro5.c
index 37c62ef..4e7041b 100644
--- a/arch/arm/mach-uniphier/init/init-pro5.c
+++ b/arch/arm/mach-uniphier/init/init-pro5.c
@@ -14,8 +14,6 @@ int uniphier_pro5_init(const struct uniphier_board_data *bd)
 {
uniphier_sbc_init_savepin();
 
-   support_card_reset();
-
support_card_init();
 
led_puts("L0");
diff --git a/arch/arm/mach-uniphier/init/init-pxs2.c 
b/arch/arm/mach-uniphier/init/init-pxs2.c
index d080b9b..f7d5b48 100644
--- a/arch/arm/mach-uniphier/init/init-pxs2.c
+++ b/arch/arm/mach-uniphier/init/init-pxs2.c
@@ -16,8 +16,6 @@ int uniphier_pxs2_init(const struct uniphier_board_data *bd)
 
uniphier_pxs2_sbc_init();
 
-   support_card_reset();
-
support_card_init();
 
led_puts("L0");
diff --git a/arch/arm/mach-uniphier/init/init-sld3.c 
b/arch/arm/mach-uniphier/init/init-sld3.c
index 0b8d6c5..50d9eaf 100644
--- a/arch/arm/mach-uniphier/init/init-sld3.c
+++ b/arch/arm/mach-uniphier/init/init-sld3.c
@@ -18,12 +18,10 @@ int uniphier_sld3_init(const struct uniphier_board_data *bd)
 
uniphier_sbc_init_admulti();
 
-   support_card_reset();
+   support_card_init();
 
uniphier_sld3_dpll_init(bd);
 
-   support_card_init();
-
led_puts("L0");
 
uniphier_memconf_3ch_no_disbit_init(bd);
diff --git a/arch/arm/mach-uniphier/init/init-sld8.c 
b/arch/arm/mach-uniphier/init/init-sld8.c
index 075ac27..8da2843 100644
--- a/arch/arm/mach-uniphier/init/init-sld8.c
+++ b/arch/arm/mach-uniphier/init/init-sld8.c
@@ -18,12 +18,10 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd)
 
uniphier_ld4_sbc_init();
 
-   support_card_reset();
+   support_card_init();
 
uniphier_sld8_dpll_init(bd);
 
-   support_card_init();
-
led_puts("L0");
 
uniphier_memconf_2ch_init(bd);
diff --git a/arch/arm/mach-uniphier/micro-support-card.c 
b/arch/arm/mach-uniphier/micro-support-card.c
index e53bcdf..80c5d97 100644
--- a/arch/arm/mach-uniphier/micro-support-card.c
+++ b/arch/arm/mach-uniphier/micro-support-card.c
@@ -25,12 +25,12 @@

[U-Boot] [PATCH 4/9] ARM: uniphier: refactor SBC init code

2017-01-14 Thread Masahiro Yamada
Merge sbc-admulti.c and sbc-savepin.c into a single file to avoid
code duplication.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/init.h  | 27 ++-
 arch/arm/mach-uniphier/init/init-ld11.c|  6 +--
 arch/arm/mach-uniphier/init/init-ld20.c|  6 +--
 arch/arm/mach-uniphier/init/init-ld4.c |  3 +-
 arch/arm/mach-uniphier/init/init-pro4.c|  2 +-
 arch/arm/mach-uniphier/init/init-pro5.c|  2 +-
 arch/arm/mach-uniphier/init/init-pxs2.c|  3 +-
 arch/arm/mach-uniphier/init/init-sld3.c|  2 +-
 arch/arm/mach-uniphier/init/init-sld8.c|  3 +-
 arch/arm/mach-uniphier/sbc/Makefile| 17 ---
 arch/arm/mach-uniphier/sbc/sbc-admulti.c   | 53 --
 arch/arm/mach-uniphier/sbc/sbc-ld11.c  | 25 ++
 arch/arm/mach-uniphier/sbc/sbc-ld4.c   |  6 +--
 arch/arm/mach-uniphier/sbc/sbc-pxs2.c  |  6 +--
 .../arm/mach-uniphier/sbc/{sbc-savepin.c => sbc.c} | 36 ---
 15 files changed, 89 insertions(+), 108 deletions(-)
 delete mode 100644 arch/arm/mach-uniphier/sbc/sbc-admulti.c
 create mode 100644 arch/arm/mach-uniphier/sbc/sbc-ld11.c
 rename arch/arm/mach-uniphier/sbc/{sbc-savepin.c => sbc.c} (58%)

diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
index 0708aa0..78c2eee 100644
--- a/arch/arm/mach-uniphier/init.h
+++ b/arch/arm/mach-uniphier/init.h
@@ -46,31 +46,30 @@ int uniphier_ld11_init(const struct uniphier_board_data 
*bd);
 int uniphier_ld20_init(const struct uniphier_board_data *bd);
 
 #if defined(CONFIG_MICRO_SUPPORT_CARD)
-int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd);
-int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd);
-int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd);
-int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd);
+void uniphier_sbc_init_admulti(void);
+void uniphier_sbc_init_savepin(void);
+void uniphier_ld4_sbc_init(void);
+void uniphier_pxs2_sbc_init(void);
+void uniphier_ld11_sbc_init(void);
 #else
-static inline int uniphier_sbc_init_admulti(
-   const struct uniphier_board_data *bd)
+static inline void uniphier_sbc_init_admulti(void)
 {
-   return 0;
 }
 
-static inline int uniphier_sbc_init_savepin(
-   const struct uniphier_board_data *bd)
+static inline void uniphier_sbc_init_savepin(void)
 {
-   return 0;
 }
 
-static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd)
+static inline void uniphier_ld4_sbc_init(void)
 {
-   return 0;
 }
 
-static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd)
+static inline void uniphier_pxs2_sbc_init(void)
+{
+}
+
+static inline void uniphier_ld11_sbc_init(void)
 {
-   return 0;
 }
 #endif
 
diff --git a/arch/arm/mach-uniphier/init/init-ld11.c 
b/arch/arm/mach-uniphier/init/init-ld11.c
index 93b2162..64fe000 100644
--- a/arch/arm/mach-uniphier/init/init-ld11.c
+++ b/arch/arm/mach-uniphier/init/init-ld11.c
@@ -13,11 +13,7 @@
 
 int uniphier_ld11_init(const struct uniphier_board_data *bd)
 {
-   uniphier_sbc_init_savepin(bd);
-   uniphier_pxs2_sbc_init(bd);
-   /* pins for NAND and System Bus are multiplexed */
-   if (spl_boot_device() != BOOT_DEVICE_NAND)
-   uniphier_pin_init("system_bus_grp");
+   uniphier_ld11_sbc_init();
 
support_card_reset();
 
diff --git a/arch/arm/mach-uniphier/init/init-ld20.c 
b/arch/arm/mach-uniphier/init/init-ld20.c
index de39b9a..ec4563b 100644
--- a/arch/arm/mach-uniphier/init/init-ld20.c
+++ b/arch/arm/mach-uniphier/init/init-ld20.c
@@ -13,11 +13,7 @@
 
 int uniphier_ld20_init(const struct uniphier_board_data *bd)
 {
-   uniphier_sbc_init_savepin(bd);
-   uniphier_pxs2_sbc_init(bd);
-   /* pins for NAND and System Bus are multiplexed */
-   if (spl_boot_device() != BOOT_DEVICE_NAND)
-   uniphier_pin_init("system_bus_grp");
+   uniphier_ld11_sbc_init();
 
support_card_reset();
 
diff --git a/arch/arm/mach-uniphier/init/init-ld4.c 
b/arch/arm/mach-uniphier/init/init-ld4.c
index caf02a5..a56fb7f 100644
--- a/arch/arm/mach-uniphier/init/init-ld4.c
+++ b/arch/arm/mach-uniphier/init/init-ld4.c
@@ -16,8 +16,7 @@ int uniphier_ld4_init(const struct uniphier_board_data *bd)
 {
uniphier_ld4_bcu_init(bd);
 
-   uniphier_sbc_init_savepin(bd);
-   uniphier_ld4_sbc_init(bd);
+   uniphier_ld4_sbc_init();
 
support_card_reset();
 
diff --git a/arch/arm/mach-uniphier/init/init-pro4.c 
b/arch/arm/mach-uniphier/init/init-pro4.c
index 32d09bb..8e2ebc7 100644
--- a/arch/arm/mach-uniphier/init/init-pro4.c
+++ b/arch/arm/mach-uniphier/init/init-pro4.c
@@ -14,7 +14,7 @@
 
 int uniphier_pro4_init(const struct uniphier_board_data *bd)
 {
-   uniphier_sbc_init_savepin(bd);
+   uniphier_sbc_init_savepin();

[U-Boot] [PATCH 3/9] ARM: uniphier: refactor MEMCONF init code

2017-01-14 Thread Masahiro Yamada
Currently, memconf-sld3.c and memconf-pxs2.c duplicate the code.

There are 3 patterns in terms of MEMCONF init:
  - DRAM 2 channels: LD4, sLD8, Pro4, Pro5, LD11
  - DRAM 3 channels: sLD3
  - DRAM 3 channels (Ch2 is disable by MEMCONF[21]): Pxs2, LD20

All of them can be moved into a single file by a little more
refactoring.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/Makefile   |   3 +-
 arch/arm/mach-uniphier/init.h |   6 +-
 arch/arm/mach-uniphier/init/init-ld11.c   |   2 +-
 arch/arm/mach-uniphier/init/init-ld20.c   |   3 +-
 arch/arm/mach-uniphier/init/init-ld4.c|   2 +-
 arch/arm/mach-uniphier/init/init-pro4.c   |   2 +-
 arch/arm/mach-uniphier/init/init-pro5.c   |   2 +-
 arch/arm/mach-uniphier/init/init-pxs2.c   |   3 +-
 arch/arm/mach-uniphier/init/init-sld3.c   |   3 +-
 arch/arm/mach-uniphier/init/init-sld8.c   |   2 +-
 arch/arm/mach-uniphier/memconf.c  | 163 ++
 arch/arm/mach-uniphier/memconf/Makefile   |   9 --
 arch/arm/mach-uniphier/memconf/memconf-pxs2.c |  68 ---
 arch/arm/mach-uniphier/memconf/memconf-sld3.c |  60 --
 arch/arm/mach-uniphier/memconf/memconf.c  | 107 -
 15 files changed, 176 insertions(+), 259 deletions(-)
 create mode 100644 arch/arm/mach-uniphier/memconf.c
 delete mode 100644 arch/arm/mach-uniphier/memconf/Makefile
 delete mode 100644 arch/arm/mach-uniphier/memconf/memconf-pxs2.c
 delete mode 100644 arch/arm/mach-uniphier/memconf/memconf-sld3.c
 delete mode 100644 arch/arm/mach-uniphier/memconf/memconf.c

diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index ae78548..98b42a0 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -4,7 +4,8 @@
 
 ifdef CONFIG_SPL_BUILD
 
-obj-y += init/ bcu/ memconf/
+obj-y += memconf.o
+obj-y += init/ bcu/
 obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/
 
 else
diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
index 327fa8b..0708aa0 100644
--- a/arch/arm/mach-uniphier/init.h
+++ b/arch/arm/mach-uniphier/init.h
@@ -77,9 +77,9 @@ static inline int uniphier_pxs2_sbc_init(const struct 
uniphier_board_data *bd)
 int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
 int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
 
-int memconf_init(const struct uniphier_board_data *bd);
-int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd);
-int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd);
+int uniphier_memconf_2ch_init(const struct uniphier_board_data *bd);
+int uniphier_memconf_3ch_no_disbit_init(const struct uniphier_board_data *bd);
+int uniphier_memconf_3ch_init(const struct uniphier_board_data *bd);
 
 int uniphier_sld3_dpll_init(const struct uniphier_board_data *bd);
 int uniphier_ld4_dpll_init(const struct uniphier_board_data *bd);
diff --git a/arch/arm/mach-uniphier/init/init-ld11.c 
b/arch/arm/mach-uniphier/init/init-ld11.c
index 9d43a13..93b2162 100644
--- a/arch/arm/mach-uniphier/init/init-ld11.c
+++ b/arch/arm/mach-uniphier/init/init-ld11.c
@@ -25,7 +25,7 @@ int uniphier_ld11_init(const struct uniphier_board_data *bd)
 
led_puts("L0");
 
-   memconf_init(bd);
+   uniphier_memconf_2ch_init(bd);
 
led_puts("L1");
 
diff --git a/arch/arm/mach-uniphier/init/init-ld20.c 
b/arch/arm/mach-uniphier/init/init-ld20.c
index 6702430..de39b9a 100644
--- a/arch/arm/mach-uniphier/init/init-ld20.c
+++ b/arch/arm/mach-uniphier/init/init-ld20.c
@@ -25,8 +25,7 @@ int uniphier_ld20_init(const struct uniphier_board_data *bd)
 
led_puts("L0");
 
-   memconf_init(bd);
-   uniphier_pxs2_memconf_init(bd);
+   uniphier_memconf_3ch_init(bd);
 
led_puts("L1");
 
diff --git a/arch/arm/mach-uniphier/init/init-ld4.c 
b/arch/arm/mach-uniphier/init/init-ld4.c
index 5f4880c..caf02a5 100644
--- a/arch/arm/mach-uniphier/init/init-ld4.c
+++ b/arch/arm/mach-uniphier/init/init-ld4.c
@@ -27,7 +27,7 @@ int uniphier_ld4_init(const struct uniphier_board_data *bd)
 
led_puts("L0");
 
-   memconf_init(bd);
+   uniphier_memconf_2ch_init(bd);
 
led_puts("L1");
 
diff --git a/arch/arm/mach-uniphier/init/init-pro4.c 
b/arch/arm/mach-uniphier/init/init-pro4.c
index e57eb86..32d09bb 100644
--- a/arch/arm/mach-uniphier/init/init-pro4.c
+++ b/arch/arm/mach-uniphier/init/init-pro4.c
@@ -24,7 +24,7 @@ int uniphier_pro4_init(const struct uniphier_board_data *bd)
 
led_puts("L0");
 
-   memconf_init(bd);
+   uniphier_memconf_2ch_init(bd);
 
led_puts("L1");
 
diff --git a/arch/arm/mach-uniphier/init/init-pro5.c 
b/arch/arm/mach-uniphier/init/init-pro5.c
index ea53dcf..3fc09a4 100644
--- a/arch/arm/mach-uniphier/init/init-pro5.c
+++ b/arch/arm/mach-uniphier/init/init-pro5.c
@@ -20,7 +20,7 @@ int uniphier_pro5_init(const struct uniphier_board_data *bd)
 
led_puts("L0");
 
-   memconf_init(bd);
+ 

[U-Boot] [PATCH 7/9] ARM: uniphier: refactor board_init()

2017-01-14 Thread Masahiro Yamada
The code here is cluttered due to the switch statement.  Introduce a
table of callbacks to clean up the initialization code across SoCs.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/board_init.c | 219 +++-
 1 file changed, 140 insertions(+), 79 deletions(-)

diff --git a/arch/arm/mach-uniphier/board_init.c 
b/arch/arm/mach-uniphier/board_init.c
index 4cab7fe..77f1fb0 100644
--- a/arch/arm/mach-uniphier/board_init.c
+++ b/arch/arm/mach-uniphier/board_init.c
@@ -48,116 +48,177 @@ static void uniphier_setup_xirq(void)
writel(tmp, 0x5590);
 }
 
-static void uniphier_nand_pin_init(bool cs2)
+#ifdef CONFIG_ARCH_UNIPHIER_LD11
+static void uniphier_ld11_misc_init(void)
 {
-#ifdef CONFIG_NAND_DENALI
-   if (uniphier_pin_init(cs2 ? "nand2cs_grp" : "nand_grp"))
-   pr_err("failed to init NAND pins\n");
-#endif
+   sg_set_pinsel(149, 14, 8, 4);   /* XIRQ0-> XIRQ0 */
+   sg_set_iectrl(149);
+   sg_set_pinsel(153, 14, 8, 4);   /* XIRQ4-> XIRQ4 */
+   sg_set_iectrl(153);
 }
+#endif
 
-int board_init(void)
+#ifdef CONFIG_ARCH_UNIPHIER_LD20
+static void uniphier_ld20_misc_init(void)
 {
-   led_puts("U0");
+   sg_set_pinsel(149, 14, 8, 4);   /* XIRQ0-> XIRQ0 */
+   sg_set_iectrl(149);
+   sg_set_pinsel(153, 14, 8, 4);   /* XIRQ4-> XIRQ4 */
+   sg_set_iectrl(153);
+
+   /* ES1 errata: increase VDD09 supply to suppress VBO noise */
+   if (uniphier_get_soc_revision() == 1) {
+   writel(0x0003, 0x6184e004);
+   writel(0x0100, 0x6184e040);
+   writel(0xb500, 0x6184e024);
+   writel(0x0001, 0x6184e000);
+   }
+
+   cci500_init(2);
+}
+#endif
+
+struct uniphier_initdata {
+   enum uniphier_soc_id soc_id;
+   bool nand_2cs;
+   void (*pll_init)(void);
+   void (*clk_init)(void);
+   void (*misc_init)(void);
+};
 
-   switch (uniphier_get_soc_type()) {
+struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_SLD3)
-   case SOC_UNIPHIER_SLD3:
-   uniphier_nand_pin_init(true);
-   led_puts("U1");
-   uniphier_sld3_pll_init();
-   uniphier_ld4_clk_init();
-   break;
+   {
+   .soc_id = SOC_UNIPHIER_SLD3,
+   .nand_2cs = true,
+   .pll_init = uniphier_sld3_pll_init,
+   .clk_init = uniphier_ld4_clk_init,
+   },
 #endif
 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
-   case SOC_UNIPHIER_LD4:
-   uniphier_nand_pin_init(true);
-   led_puts("U1");
-   uniphier_ld4_pll_init();
-   uniphier_ld4_clk_init();
-   break;
+   {
+   .soc_id = SOC_UNIPHIER_LD4,
+   .nand_2cs = true,
+   .pll_init = uniphier_ld4_pll_init,
+   .clk_init = uniphier_ld4_clk_init,
+   },
 #endif
 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
-   case SOC_UNIPHIER_PRO4:
-   uniphier_nand_pin_init(false);
-   led_puts("U1");
-   uniphier_pro4_pll_init();
-   uniphier_pro4_clk_init();
-   break;
+   {
+   .soc_id = SOC_UNIPHIER_PRO4,
+   .nand_2cs = false,
+   .pll_init = uniphier_pro4_pll_init,
+   .clk_init = uniphier_pro4_clk_init,
+   },
 #endif
 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
-   case SOC_UNIPHIER_SLD8:
-   uniphier_nand_pin_init(true);
-   led_puts("U1");
-   uniphier_ld4_pll_init();
-   uniphier_ld4_clk_init();
-   break;
+   {
+   .soc_id = SOC_UNIPHIER_SLD8,
+   .nand_2cs = true,
+   .pll_init = uniphier_ld4_pll_init,
+   .clk_init = uniphier_ld4_clk_init,
+   },
 #endif
 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
-   case SOC_UNIPHIER_PRO5:
-   uniphier_nand_pin_init(true);
-   led_puts("U1");
-   uniphier_pro5_clk_init();
-   break;
+   {
+   .soc_id = SOC_UNIPHIER_PRO5,
+   .nand_2cs = true,
+   .clk_init = uniphier_pro5_clk_init,
+   },
 #endif
 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
-   case SOC_UNIPHIER_PXS2:
-   uniphier_nand_pin_init(true);
-   led_puts("U1");
-   uniphier_pxs2_clk_init();
-   break;
+   {
+   .soc_id = SOC_UNIPHIER_PXS2,
+   .nand_2cs = true,
+   .clk_init = uniphier_pxs2_clk_init,
+   },
 #endif
 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
-   case SOC_UNIPHIER_LD6B:
-   uniphier_nand_pin_init(true);
-   led_puts("U1");
-   uniphier_pxs2_clk_init();
-   break;
+   {
+   .soc_id = SOC_UNIPHIER_LD6B,
+   .nand_2cs = true,
+   .clk_init = uniphier_pxs

[U-Boot] [PATCH 1/9] ARM: uniphier: remove unneeded argument of uniphier_ld20_pll_init()

2017-01-14 Thread Masahiro Yamada
At first, we thought the LD20 PLL setting would be board dependent,
but this argument turned out unneeded after all.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/board_init.c   | 8 +---
 arch/arm/mach-uniphier/clk/pll-ld20.c | 4 +---
 arch/arm/mach-uniphier/init.h | 2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-uniphier/board_init.c 
b/arch/arm/mach-uniphier/board_init.c
index 8c7864c..4cab7fe 100644
--- a/arch/arm/mach-uniphier/board_init.c
+++ b/arch/arm/mach-uniphier/board_init.c
@@ -58,14 +58,8 @@ static void uniphier_nand_pin_init(bool cs2)
 
 int board_init(void)
 {
-   const struct uniphier_board_data *bd;
-
led_puts("U0");
 
-   bd = uniphier_get_board_param();
-   if (!bd)
-   return -ENODEV;
-
switch (uniphier_get_soc_type()) {
 #if defined(CONFIG_ARCH_UNIPHIER_SLD3)
case SOC_UNIPHIER_SLD3:
@@ -147,7 +141,7 @@ int board_init(void)
sg_set_pinsel(153, 14, 8, 4);   /* XIRQ4-> XIRQ4 */
sg_set_iectrl(153);
led_puts("U1");
-   uniphier_ld20_pll_init(bd);
+   uniphier_ld20_pll_init();
uniphier_ld20_clk_init();
cci500_init(2);
break;
diff --git a/arch/arm/mach-uniphier/clk/pll-ld20.c 
b/arch/arm/mach-uniphier/clk/pll-ld20.c
index 8ad6883..121a369 100644
--- a/arch/arm/mach-uniphier/clk/pll-ld20.c
+++ b/arch/arm/mach-uniphier/clk/pll-ld20.c
@@ -11,7 +11,7 @@
 #include "../sc64-regs.h"
 #include "pll.h"
 
-int uniphier_ld20_pll_init(const struct uniphier_board_data *bd)
+void uniphier_ld20_pll_init(void)
 {
uniphier_ld20_sscpll_init(SC_CPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
/* do nothing for SPLL */
@@ -36,6 +36,4 @@ int uniphier_ld20_pll_init(const struct uniphier_board_data 
*bd)
 
uniphier_ld20_dspll_init(SC_VPLL8KCTRL);
uniphier_ld20_dspll_init(SC_A2PLLCTRL);
-
-   return 0;
 }
diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
index f3f9e54..af74dd8 100644
--- a/arch/arm/mach-uniphier/init.h
+++ b/arch/arm/mach-uniphier/init.h
@@ -105,7 +105,7 @@ void uniphier_sld3_pll_init(void);
 void uniphier_ld4_pll_init(void);
 void uniphier_pro4_pll_init(void);
 void uniphier_ld11_pll_init(void);
-int uniphier_ld20_pll_init(const struct uniphier_board_data *bd);
+void uniphier_ld20_pll_init(void);
 
 void uniphier_ld4_clk_init(void);
 void uniphier_pro4_clk_init(void);
-- 
2.7.4

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


[U-Boot] [PATCH 6/9] ARM: uniphier: make BCU init into void function

2017-01-14 Thread Masahiro Yamada
These functions never fail, so no need to return a value.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/bcu/bcu-ld4.c  | 4 +---
 arch/arm/mach-uniphier/bcu/bcu-sld3.c | 4 +---
 arch/arm/mach-uniphier/init.h | 4 ++--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-uniphier/bcu/bcu-ld4.c 
b/arch/arm/mach-uniphier/bcu/bcu-ld4.c
index eeab802..ca70480 100644
--- a/arch/arm/mach-uniphier/bcu/bcu-ld4.c
+++ b/arch/arm/mach-uniphier/bcu/bcu-ld4.c
@@ -11,7 +11,7 @@
 
 #define ch(x) ((x) >= 32 ? 0 : (x) < 0 ? 0x : 0x << (x))
 
-int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd)
+void uniphier_ld4_bcu_init(const struct uniphier_board_data *bd)
 {
int shift;
 
@@ -30,6 +30,4 @@ int uniphier_ld4_bcu_init(const struct uniphier_board_data 
*bd)
 
shift -= 32;
writel(ch(shift), BCIPPCCHR4); /* 0xc000-0xdfff */
-
-   return 0;
 }
diff --git a/arch/arm/mach-uniphier/bcu/bcu-sld3.c 
b/arch/arm/mach-uniphier/bcu/bcu-sld3.c
index 493e6d5..4e92076 100644
--- a/arch/arm/mach-uniphier/bcu/bcu-sld3.c
+++ b/arch/arm/mach-uniphier/bcu/bcu-sld3.c
@@ -11,7 +11,7 @@
 
 #define ch(x) ((x) >= 32 ? 0 : (x) < 0 ? 0x : 0x << (x))
 
-int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd)
+void uniphier_sld3_bcu_init(const struct uniphier_board_data *bd)
 {
int shift;
 
@@ -34,6 +34,4 @@ int uniphier_sld3_bcu_init(const struct uniphier_board_data 
*bd)
 
shift -= 32;
writel(ch(shift), BCIPPCCHR4); /* 0xc000-0xdfff */
-
-   return 0;
 }
diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
index 78c2eee..18393e5 100644
--- a/arch/arm/mach-uniphier/init.h
+++ b/arch/arm/mach-uniphier/init.h
@@ -73,8 +73,8 @@ static inline void uniphier_ld11_sbc_init(void)
 }
 #endif
 
-int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
-int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
+void uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
+void uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
 
 int uniphier_memconf_2ch_init(const struct uniphier_board_data *bd);
 int uniphier_memconf_3ch_no_disbit_init(const struct uniphier_board_data *bd);
-- 
2.7.4

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


[U-Boot] [PATCH 0/9] ARM: uniphier: UniPhier changes for v2017.03-rc1

2017-01-14 Thread Masahiro Yamada
Mostly cleanups of SoC init code.


Masahiro Yamada (9):
  ARM: uniphier: remove unneeded argument of uniphier_ld20_pll_init()
  ARM: uniphier: split out UMC clock enable
  ARM: uniphier: refactor MEMCONF init code
  ARM: uniphier: refactor SBC init code
  ARM: uniphier: refactor Support Card init code
  ARM: uniphier: make BCU init into void function
  ARM: uniphier: refactor board_init()
  ARM: uniphier: refactor spl_init_board()
  ARM: uniphier: move SBC and Support Card init code to U-Boot proper

 arch/arm/mach-uniphier/Makefile|  10 +-
 arch/arm/mach-uniphier/bcu/bcu-ld4.c   |   4 +-
 arch/arm/mach-uniphier/bcu/bcu-sld3.c  |   4 +-
 arch/arm/mach-uniphier/board_init.c| 237 +
 arch/arm/mach-uniphier/clk/Makefile|  18 +-
 .../clk/{early-clk-ld11.c => clk-dram-ld11.c}  |   8 +-
 .../clk/{early-clk-ld20.c => clk-dram-ld20.c}  |   8 +-
 .../clk/{early-clk-pro5.c => clk-dram-pro5.c}  |   9 +-
 .../clk/{early-clk-pxs2.c => clk-dram-pxs2.c}  |  14 +-
 .../clk/{early-clk-ld4.c => clk-dram-sld3.c}   |   9 +-
 arch/arm/mach-uniphier/clk/clk-early-ld11.c|  21 ++
 arch/arm/mach-uniphier/clk/clk-early-sld3.c|  30 +++
 arch/arm/mach-uniphier/clk/dpll-pro5.c |   6 +
 arch/arm/mach-uniphier/clk/dpll-pxs2.c |   6 +
 arch/arm/mach-uniphier/clk/pll-ld20.c  |   4 +-
 arch/arm/mach-uniphier/dram/Makefile   |   2 +
 arch/arm/mach-uniphier/dram/umc-pro5.c |  12 ++
 arch/arm/mach-uniphier/dram/umc-sld3.c |   6 +
 arch/arm/mach-uniphier/init.h  |  56 ++---
 arch/arm/mach-uniphier/init/Makefile   |  15 --
 arch/arm/mach-uniphier/init/init-ld11.c|  63 --
 arch/arm/mach-uniphier/init/init-ld20.c|  62 --
 arch/arm/mach-uniphier/init/init-ld4.c |  59 -
 arch/arm/mach-uniphier/init/init-pro4.c|  56 -
 arch/arm/mach-uniphier/init/init-pro5.c|  42 
 arch/arm/mach-uniphier/init/init-pxs2.c|  50 -
 arch/arm/mach-uniphier/init/init-sld3.c|  49 -
 arch/arm/mach-uniphier/init/init-sld8.c|  59 -
 arch/arm/mach-uniphier/init/init.c |  71 --
 arch/arm/mach-uniphier/memconf.c   | 163 ++
 arch/arm/mach-uniphier/memconf/Makefile|   9 -
 arch/arm/mach-uniphier/memconf/memconf-pxs2.c  |  68 --
 arch/arm/mach-uniphier/memconf/memconf-sld3.c  |  60 --
 arch/arm/mach-uniphier/memconf/memconf.c   | 107 --
 arch/arm/mach-uniphier/micro-support-card.c|   7 +-
 arch/arm/mach-uniphier/micro-support-card.h|   5 -
 arch/arm/mach-uniphier/sbc/Makefile|  17 +-
 arch/arm/mach-uniphier/sbc/sbc-admulti.c   |  53 -
 arch/arm/mach-uniphier/sbc/sbc-ld11.c  |  25 +++
 arch/arm/mach-uniphier/sbc/sbc-ld4.c   |   6 +-
 arch/arm/mach-uniphier/sbc/sbc-pxs2.c  |   6 +-
 .../arm/mach-uniphier/sbc/{sbc-savepin.c => sbc.c} |  36 +++-
 arch/arm/mach-uniphier/spl_board_init.c| 185 
 43 files changed, 713 insertions(+), 1024 deletions(-)
 rename arch/arm/mach-uniphier/clk/{early-clk-ld11.c => clk-dram-ld11.c} (74%)
 rename arch/arm/mach-uniphier/clk/{early-clk-ld20.c => clk-dram-ld20.c} (78%)
 rename arch/arm/mach-uniphier/clk/{early-clk-pro5.c => clk-dram-pro5.c} (76%)
 rename arch/arm/mach-uniphier/clk/{early-clk-pxs2.c => clk-dram-pxs2.c} (70%)
 rename arch/arm/mach-uniphier/clk/{early-clk-ld4.c => clk-dram-sld3.c} (69%)
 create mode 100644 arch/arm/mach-uniphier/clk/clk-early-ld11.c
 create mode 100644 arch/arm/mach-uniphier/clk/clk-early-sld3.c
 create mode 100644 arch/arm/mach-uniphier/clk/dpll-pro5.c
 create mode 100644 arch/arm/mach-uniphier/clk/dpll-pxs2.c
 create mode 100644 arch/arm/mach-uniphier/dram/umc-pro5.c
 create mode 100644 arch/arm/mach-uniphier/dram/umc-sld3.c
 delete mode 100644 arch/arm/mach-uniphier/init/Makefile
 delete mode 100644 arch/arm/mach-uniphier/init/init-ld11.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-ld20.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-ld4.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-pro4.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-pro5.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-pxs2.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-sld3.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-sld8.c
 delete mode 100644 arch/arm/mach-uniphier/init/init.c
 create mode 100644 arch/arm/mach-uniphier/memconf.c
 delete mode 100644 arch/arm/mach-uniphier/memconf/Makefile
 delete mode 100644 arch/arm/mach-uniphier/memconf/memconf-pxs2.c
 delete mode 100644 arch/arm/mach-uniphier/memconf/memconf-sld3.c
 delete mode 100644 arch/arm/mach-uniphier/memconf/memconf.c
 delete mode 100644 arch/arm/mach-uniphier/sbc/sbc-admulti.c
 cr

[U-Boot] [PATCH 8/9] ARM: uniphier: refactor spl_init_board()

2017-01-14 Thread Masahiro Yamada
Merge init-*.c into a single file using a table of callbacks because
the initialization flow is almost common among SoCs.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/Makefile |   3 +-
 arch/arm/mach-uniphier/clk/Makefile |   6 +-
 arch/arm/mach-uniphier/clk/dpll-pro5.c  |   6 +
 arch/arm/mach-uniphier/clk/dpll-pxs2.c  |   6 +
 arch/arm/mach-uniphier/dram/Makefile|   2 +
 arch/arm/mach-uniphier/dram/umc-pro5.c  |  12 ++
 arch/arm/mach-uniphier/dram/umc-sld3.c  |   6 +
 arch/arm/mach-uniphier/init.h   |   4 +
 arch/arm/mach-uniphier/init/Makefile|  15 ---
 arch/arm/mach-uniphier/init/init-ld11.c |  58 -
 arch/arm/mach-uniphier/init/init-ld20.c |  56 -
 arch/arm/mach-uniphier/init/init-ld4.c  |  57 -
 arch/arm/mach-uniphier/init/init-pro4.c |  55 -
 arch/arm/mach-uniphier/init/init-pro5.c |  41 ---
 arch/arm/mach-uniphier/init/init-pxs2.c |  47 ---
 arch/arm/mach-uniphier/init/init-sld3.c |  47 ---
 arch/arm/mach-uniphier/init/init-sld8.c |  57 -
 arch/arm/mach-uniphier/init/init.c  |  71 ---
 arch/arm/mach-uniphier/spl_board_init.c | 209 
 19 files changed, 250 insertions(+), 508 deletions(-)
 create mode 100644 arch/arm/mach-uniphier/clk/dpll-pro5.c
 create mode 100644 arch/arm/mach-uniphier/clk/dpll-pxs2.c
 create mode 100644 arch/arm/mach-uniphier/dram/umc-pro5.c
 create mode 100644 arch/arm/mach-uniphier/dram/umc-sld3.c
 delete mode 100644 arch/arm/mach-uniphier/init/Makefile
 delete mode 100644 arch/arm/mach-uniphier/init/init-ld11.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-ld20.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-ld4.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-pro4.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-pro5.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-pxs2.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-sld3.c
 delete mode 100644 arch/arm/mach-uniphier/init/init-sld8.c
 delete mode 100644 arch/arm/mach-uniphier/init/init.c
 create mode 100644 arch/arm/mach-uniphier/spl_board_init.c

diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index 98b42a0..7f1abd0 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -4,8 +4,9 @@
 
 ifdef CONFIG_SPL_BUILD
 
+obj-y += spl_board_init.o
 obj-y += memconf.o
-obj-y += init/ bcu/
+obj-y += bcu/
 obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/
 
 else
diff --git a/arch/arm/mach-uniphier/clk/Makefile 
b/arch/arm/mach-uniphier/clk/Makefile
index 765660f..eff8383 100644
--- a/arch/arm/mach-uniphier/clk/Makefile
+++ b/arch/arm/mach-uniphier/clk/Makefile
@@ -8,9 +8,9 @@ obj-$(CONFIG_ARCH_UNIPHIER_SLD3)+= clk-early-sld3.o 
clk-dram-sld3.o dpll-sld3.o
 obj-$(CONFIG_ARCH_UNIPHIER_LD4)+= clk-early-sld3.o 
clk-dram-sld3.o dpll-ld4.o
 obj-$(CONFIG_ARCH_UNIPHIER_PRO4)   += clk-early-sld3.o clk-dram-sld3.o 
dpll-pro4.o
 obj-$(CONFIG_ARCH_UNIPHIER_SLD8)   += clk-early-sld3.o clk-dram-sld3.o 
dpll-sld8.o
-obj-$(CONFIG_ARCH_UNIPHIER_PRO5)   += clk-early-sld3.o clk-dram-pro5.o
-obj-$(CONFIG_ARCH_UNIPHIER_PXS2)   += clk-early-sld3.o clk-dram-pxs2.o
-obj-$(CONFIG_ARCH_UNIPHIER_LD6B)   += clk-early-sld3.o clk-dram-pxs2.o
+obj-$(CONFIG_ARCH_UNIPHIER_PRO5)   += clk-early-sld3.o clk-dram-pro5.o 
dpll-pro5.o
+obj-$(CONFIG_ARCH_UNIPHIER_PXS2)   += clk-early-sld3.o clk-dram-pxs2.o 
dpll-pxs2.o
+obj-$(CONFIG_ARCH_UNIPHIER_LD6B)   += clk-early-sld3.o clk-dram-pxs2.o 
dpll-pxs2.o
 obj-$(CONFIG_ARCH_UNIPHIER_LD11)   += clk-early-ld11.o clk-dram-ld11.o 
dpll-ld11.o
 obj-$(CONFIG_ARCH_UNIPHIER_LD20)   += clk-early-ld11.o clk-dram-ld20.o 
dpll-ld20.o
 
diff --git a/arch/arm/mach-uniphier/clk/dpll-pro5.c 
b/arch/arm/mach-uniphier/clk/dpll-pro5.c
new file mode 100644
index 000..d3a42c7
--- /dev/null
+++ b/arch/arm/mach-uniphier/clk/dpll-pro5.c
@@ -0,0 +1,6 @@
+#include "../init.h"
+
+int uniphier_pro5_dpll_init(const struct uniphier_board_data *bd)
+{
+   return 0;
+}
diff --git a/arch/arm/mach-uniphier/clk/dpll-pxs2.c 
b/arch/arm/mach-uniphier/clk/dpll-pxs2.c
new file mode 100644
index 000..328ebf6
--- /dev/null
+++ b/arch/arm/mach-uniphier/clk/dpll-pxs2.c
@@ -0,0 +1,6 @@
+#include "../init.h"
+
+int uniphier_pxs2_dpll_init(const struct uniphier_board_data *bd)
+{
+   return 0;
+}
diff --git a/arch/arm/mach-uniphier/dram/Makefile 
b/arch/arm/mach-uniphier/dram/Makefile
index 5b9d892..2ce6199 100644
--- a/arch/arm/mach-uniphier/dram/Makefile
+++ b/arch/arm/mach-uniphier/dram/Makefile
@@ -4,12 +4,14 @@
 
 ifdef CONFIG_SPL_BUILD
 
+obj-$(CONFIG_ARCH_UNIPHIER_SLD3)   += umc-sld3.o
 obj-$(CONFIG_ARCH_UNIPHIER_LD4)+= umc-ld4.o \
   ddrphy-training.o ddrphy-ld4.o
 obj-$(CONFIG_ARCH_UNIPHIER_PRO4)   += umc-pro4.o \
   ddrphy-training.o ddrphy-ld4.o
 obj-$(CONFIG_

[U-Boot] [PATCH 9/9] ARM: uniphier: move SBC and Support Card init code to U-Boot proper

2017-01-14 Thread Masahiro Yamada
Initialize SBC and Support Card in U-Boot proper instead of SPL.

We may run different firmware (ex. ARM Trusted Firmware) before
U-Boot, and basic SoC initialization may be done there.  In that
case, SPL may not be used.

The motivation for preparing SBC and Support Card in SPL was to use
LED for early debugging, but this is not mandatory to boot SoCs.
With this commit, LED will be unavailable in SPL, but we can use a
debug serial instead.  So, this change will not be a big deal.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/Makefile |  6 +++---
 arch/arm/mach-uniphier/board_init.c | 16 
 arch/arm/mach-uniphier/spl_board_init.c | 24 
 3 files changed, 19 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index 7f1abd0..ab2c6dc 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -7,7 +7,6 @@ ifdef CONFIG_SPL_BUILD
 obj-y += spl_board_init.o
 obj-y += memconf.o
 obj-y += bcu/
-obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/
 
 else
 
@@ -17,6 +16,9 @@ obj-y += board_init.o
 obj-$(CONFIG_BOARD_LATE_INIT) += board_late_init.o
 obj-y += reset.o
 
+obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/ micro-support-card.o
+obj-y += pinctrl-glue.o
+
 endif
 
 obj-y += boards.o
@@ -24,9 +26,7 @@ obj-y += soc_info.o
 obj-y += boot-mode/
 obj-y += clk/
 obj-y += dram/
-obj-y += pinctrl-glue.o
 
-obj-$(CONFIG_MICRO_SUPPORT_CARD) += micro-support-card.o
 obj-$(CONFIG_DEBUG_UART_UNIPHIER) += debug-uart/
 
 obj-$(CONFIG_CPU_V7) += arm32/
diff --git a/arch/arm/mach-uniphier/board_init.c 
b/arch/arm/mach-uniphier/board_init.c
index 77f1fb0..3bd4cdd 100644
--- a/arch/arm/mach-uniphier/board_init.c
+++ b/arch/arm/mach-uniphier/board_init.c
@@ -81,6 +81,7 @@ static void uniphier_ld20_misc_init(void)
 struct uniphier_initdata {
enum uniphier_soc_id soc_id;
bool nand_2cs;
+   void (*sbc_init)(void);
void (*pll_init)(void);
void (*clk_init)(void);
void (*misc_init)(void);
@@ -91,6 +92,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_SLD3,
.nand_2cs = true,
+   .sbc_init = uniphier_sbc_init_admulti,
.pll_init = uniphier_sld3_pll_init,
.clk_init = uniphier_ld4_clk_init,
},
@@ -99,6 +101,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_LD4,
.nand_2cs = true,
+   .sbc_init = uniphier_ld4_sbc_init,
.pll_init = uniphier_ld4_pll_init,
.clk_init = uniphier_ld4_clk_init,
},
@@ -107,6 +110,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_PRO4,
.nand_2cs = false,
+   .sbc_init = uniphier_sbc_init_savepin,
.pll_init = uniphier_pro4_pll_init,
.clk_init = uniphier_pro4_clk_init,
},
@@ -115,6 +119,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_SLD8,
.nand_2cs = true,
+   .sbc_init = uniphier_ld4_sbc_init,
.pll_init = uniphier_ld4_pll_init,
.clk_init = uniphier_ld4_clk_init,
},
@@ -123,6 +128,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_PRO5,
.nand_2cs = true,
+   .sbc_init = uniphier_sbc_init_savepin,
.clk_init = uniphier_pro5_clk_init,
},
 #endif
@@ -130,6 +136,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_PXS2,
.nand_2cs = true,
+   .sbc_init = uniphier_pxs2_sbc_init,
.clk_init = uniphier_pxs2_clk_init,
},
 #endif
@@ -137,6 +144,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_LD6B,
.nand_2cs = true,
+   .sbc_init = uniphier_pxs2_sbc_init,
.clk_init = uniphier_pxs2_clk_init,
},
 #endif
@@ -144,6 +152,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_LD11,
.nand_2cs = false,
+   .sbc_init = uniphier_ld11_sbc_init,
.pll_init = uniphier_ld11_pll_init,
.clk_init = uniphier_ld11_clk_init,
.misc_init = uniphier_ld11_misc_init,
@@ -153,6 +162,7 @@ struct uniphier_initdata uniphier_initdata[] = {
{
.soc_id = SOC_UNIPHIER_LD20,
.nand_2cs = false,
+   .sbc_init = uniphier_ld11_sbc_init,
.pll_init = uniphier_ld20_pll_init,
.clk_init = uniphier_ld20_clk_init,
.misc_init = uniphier_ld20_misc_init,
@@ -188,6 +198,12 @@ int board_init(void)
   

[U-Boot] [PATCH 2/9] ARM: uniphier: split out UMC clock enable

2017-01-14 Thread Masahiro Yamada
The clock enable bits for UMC are more SoC-specific than for
the other hardware blocks.  Separate the UMC clocks and the other
clocks for better code reuse across SoCs.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/clk/Makefile| 18 ++---
 .../clk/{early-clk-ld11.c => clk-dram-ld11.c}  |  8 +-
 .../clk/{early-clk-ld20.c => clk-dram-ld20.c}  |  8 +-
 .../clk/{early-clk-pro5.c => clk-dram-pro5.c}  |  9 ++-
 .../clk/{early-clk-pxs2.c => clk-dram-pxs2.c}  | 14 +-
 .../clk/{early-clk-ld4.c => clk-dram-sld3.c}   |  9 ++-
 arch/arm/mach-uniphier/clk/clk-early-ld11.c| 21 +++
 arch/arm/mach-uniphier/clk/clk-early-sld3.c| 30 ++
 arch/arm/mach-uniphier/init.h  | 13 ++
 arch/arm/mach-uniphier/init/init-ld11.c|  3 ++-
 arch/arm/mach-uniphier/init/init-ld20.c|  3 ++-
 arch/arm/mach-uniphier/init/init-ld4.c |  3 ++-
 arch/arm/mach-uniphier/init/init-pro4.c|  3 ++-
 arch/arm/mach-uniphier/init/init-pro5.c|  3 ++-
 arch/arm/mach-uniphier/init/init-pxs2.c|  3 ++-
 arch/arm/mach-uniphier/init/init-sld3.c|  3 ++-
 arch/arm/mach-uniphier/init/init-sld8.c|  3 ++-
 17 files changed, 91 insertions(+), 63 deletions(-)
 rename arch/arm/mach-uniphier/clk/{early-clk-ld11.c => clk-dram-ld11.c} (74%)
 rename arch/arm/mach-uniphier/clk/{early-clk-ld20.c => clk-dram-ld20.c} (78%)
 rename arch/arm/mach-uniphier/clk/{early-clk-pro5.c => clk-dram-pro5.c} (76%)
 rename arch/arm/mach-uniphier/clk/{early-clk-pxs2.c => clk-dram-pxs2.c} (70%)
 rename arch/arm/mach-uniphier/clk/{early-clk-ld4.c => clk-dram-sld3.c} (69%)
 create mode 100644 arch/arm/mach-uniphier/clk/clk-early-ld11.c
 create mode 100644 arch/arm/mach-uniphier/clk/clk-early-sld3.c

diff --git a/arch/arm/mach-uniphier/clk/Makefile 
b/arch/arm/mach-uniphier/clk/Makefile
index 95f433e..765660f 100644
--- a/arch/arm/mach-uniphier/clk/Makefile
+++ b/arch/arm/mach-uniphier/clk/Makefile
@@ -4,15 +4,15 @@
 
 ifdef CONFIG_SPL_BUILD
 
-obj-$(CONFIG_ARCH_UNIPHIER_SLD3)   += early-clk-ld4.o dpll-sld3.o
-obj-$(CONFIG_ARCH_UNIPHIER_LD4)+= early-clk-ld4.o dpll-ld4.o
-obj-$(CONFIG_ARCH_UNIPHIER_PRO4)   += early-clk-ld4.o dpll-pro4.o
-obj-$(CONFIG_ARCH_UNIPHIER_SLD8)   += early-clk-ld4.o dpll-sld8.o
-obj-$(CONFIG_ARCH_UNIPHIER_PRO5)   += early-clk-pro5.o
-obj-$(CONFIG_ARCH_UNIPHIER_PXS2)   += early-clk-pxs2.o
-obj-$(CONFIG_ARCH_UNIPHIER_LD6B)   += early-clk-pxs2.o
-obj-$(CONFIG_ARCH_UNIPHIER_LD11)   += early-clk-ld11.o dpll-ld11.o
-obj-$(CONFIG_ARCH_UNIPHIER_LD20)   += early-clk-ld20.o dpll-ld20.o
+obj-$(CONFIG_ARCH_UNIPHIER_SLD3)   += clk-early-sld3.o clk-dram-sld3.o 
dpll-sld3.o
+obj-$(CONFIG_ARCH_UNIPHIER_LD4)+= clk-early-sld3.o 
clk-dram-sld3.o dpll-ld4.o
+obj-$(CONFIG_ARCH_UNIPHIER_PRO4)   += clk-early-sld3.o clk-dram-sld3.o 
dpll-pro4.o
+obj-$(CONFIG_ARCH_UNIPHIER_SLD8)   += clk-early-sld3.o clk-dram-sld3.o 
dpll-sld8.o
+obj-$(CONFIG_ARCH_UNIPHIER_PRO5)   += clk-early-sld3.o clk-dram-pro5.o
+obj-$(CONFIG_ARCH_UNIPHIER_PXS2)   += clk-early-sld3.o clk-dram-pxs2.o
+obj-$(CONFIG_ARCH_UNIPHIER_LD6B)   += clk-early-sld3.o clk-dram-pxs2.o
+obj-$(CONFIG_ARCH_UNIPHIER_LD11)   += clk-early-ld11.o clk-dram-ld11.o 
dpll-ld11.o
+obj-$(CONFIG_ARCH_UNIPHIER_LD20)   += clk-early-ld11.o clk-dram-ld20.o 
dpll-ld20.o
 
 else
 
diff --git a/arch/arm/mach-uniphier/clk/early-clk-ld11.c 
b/arch/arm/mach-uniphier/clk/clk-dram-ld11.c
similarity index 74%
rename from arch/arm/mach-uniphier/clk/early-clk-ld11.c
rename to arch/arm/mach-uniphier/clk/clk-dram-ld11.c
index c94d83c..95bd9e6 100644
--- a/arch/arm/mach-uniphier/clk/early-clk-ld11.c
+++ b/arch/arm/mach-uniphier/clk/clk-dram-ld11.c
@@ -10,7 +10,7 @@
 #include "../init.h"
 #include "../sc64-regs.h"
 
-int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd)
+void uniphier_ld11_dram_clk_init(void)
 {
u32 tmp;
 
@@ -20,13 +20,7 @@ int uniphier_ld11_early_clk_init(const struct 
uniphier_board_data *bd)
writel(tmp, SC_RSTCTRL7);
 
/* provide clocks */
-   tmp = readl(SC_CLKCTRL4);
-   tmp |= SC_CLKCTRL4_PERI;
-   writel(tmp, SC_CLKCTRL4);
-
tmp = readl(SC_CLKCTRL7);
tmp |= SC_CLKCTRL7_UMC31 | SC_CLKCTRL7_UMC30;
writel(tmp, SC_CLKCTRL7);
-
-   return 0;
 }
diff --git a/arch/arm/mach-uniphier/clk/early-clk-ld20.c 
b/arch/arm/mach-uniphier/clk/clk-dram-ld20.c
similarity index 78%
rename from arch/arm/mach-uniphier/clk/early-clk-ld20.c
rename to arch/arm/mach-uniphier/clk/clk-dram-ld20.c
index 5201a55..2b1bf32 100644
--- a/arch/arm/mach-uniphier/clk/early-clk-ld20.c
+++ b/arch/arm/mach-uniphier/clk/clk-dram-ld20.c
@@ -9,7 +9,7 @@
 #include "../init.h"
 #include "../sc64-regs.h"
 
-int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd