Re: [U-Boot] [PATCH v3 3/3] spl: dfu: reduce spl-dfu MLO size

2017-05-13 Thread Tom Rini
On Fri, May 12, 2017 at 08:44:31AM +, B, Ravi wrote:
> Hi Tom
> 
> Sorry for late response, some how missed this mail.
> 
> >>  
> >>  obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o
> >> +ifndef CONFIG_SPL_BUILD
> >>  obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
> >> +endif
> >> +obj-$(CONFIG_SPL_DFU_MMC) += dfu_mmc.o
> 
> >This becomes obj-$(CONFIG_$(SPL_)DFU_MMC) += dfu_mmc.o
> 
> >> diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index 
> >> 926ccbd..ba509db 100644
> >> --- a/drivers/dfu/dfu_mmc.c
> >> +++ b/drivers/dfu/dfu_mmc.c
> > [snip]
> >> @@ -154,7 +155,11 @@ static int mmc_file_op(enum dfu_op op, struct 
> >> dfu_entity *dfu,
> >>  
> >>debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
> >>  
> >> +#if CONFIG_IS_ENABLED(DFU_MMC)
> >> +  ret = cli_simple_run_command(cmd_buf, 0); #else
> >>ret = run_command(cmd_buf, 0);
> >> +#endif
> 
> >This doesn't make sense.  CONFIG_IS_ENABLED(DFU_MMC) is true for 
> >CONFIG_DFU_MMC or CONFIG_SPL_DFU_MMC.  Thanks!
> 
> True, My bad, I realized it lately after posting the patch.
> 
> I will use run_command() only, which abstrace use of both
> simple_cli_xx() and hush_parser.
> 
> Since cli_hush.c is compile out for SPL to reduce the size.  SPL must
> use simple_cli_xx().
> Since by default CONFIG_HUSH_PARSER is defined for both SPL/U-BOOT,
> this leads to compile error. I need to fix this way.

We keep running into problems due to trying to whack in what to do in
DFU via command rather than via API.  Can you make an attempt to convert
things over, in both SPL and not SPL, in DFU to using ABI instead, to
see if we can get the size reduction here still, and not have to try and
put fragile to other use cases ifdefs in common code?  Thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-mips/master

2017-05-13 Thread Tom Rini
On Fri, May 12, 2017 at 11:08:03PM +0200, Daniel Schwierzeck wrote:

> Hi Tom,
> 
> please pull some follow-up fixes for Broadcom MIPS and some minor updates for 
> MIPS Boston board.
> 
> Travis CI: https://travis-ci.org/danielschwierzeck/u-boot/builds/231519583
> 
> 
> The following changes since commit 1f5541c8818d3ecd243f9bbf58db9ea5f55a3195:
> 
>   Merge git://git.denx.de/u-boot-rockchip (2017-05-10 17:40:11 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-mips.git master
> 
> for you to fetch changes up to bc34986c86fc119813f406d95bb43e75e09b0df9:
> 
>   boston: Enable CONFIG_DISTRO_DEFAULTS in defconfigs (2017-05-12 13:29:50 
> +0200)
> 

Applied to u-boot/master, thanks!




-- 
Tom


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


[U-Boot] [PATCH] sandbox: Fix comparison of unsigned enum expression warning

2017-05-13 Thread Tom Rini
In os_dirent_get_typename() we are checking that type falls within the
known values of the enum os_dirent_t.  With clang-3.8 testing this value
as being >= 0 results in a warning as it will always be true.  This
assumes of course that we are only given valid data.  Given that we want
to sanity check the input, we change this to check that it falls within
the range of the first to the last entry in the given enum.

Cc: Simon Glass 
Signed-off-by: Tom Rini 
---
 arch/sandbox/cpu/os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 35ea00ce3ca0..7243bfc1b1fd 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -395,7 +395,7 @@ const char *os_dirent_typename[OS_FILET_COUNT] = {
 
 const char *os_dirent_get_typename(enum os_dirent_t type)
 {
-   if (type >= 0 && type < OS_FILET_COUNT)
+   if (type >= OS_FILET_REG && type < OS_FILET_COUNT)
return os_dirent_typename[type];
 
return os_dirent_typename[OS_FILET_UNKNOWN];
-- 
1.9.1

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


Re: [U-Boot] [PATCH] usb: ehci: Add Renesas RCar M3/H3 EHCI support

2017-05-13 Thread Nobuhiro Iwamatsu
Hi!

2017-05-13 22:56 GMT+09:00 Marek Vasut :
> From: Hiroyuki Yokoyama 
>
> Add a USB controller driver for the EHCI block in R8A7795/R8A7796 SoC.
> This is a stopgap measure until we have proper DT support, clock and
> reset framework in place, at which point we can switch to ehci-generic.
>
> Signed-off-by: Hiroyuki Yokoyama 
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 

Reviewed-by: Nobuhiro Iwamatsu 

> ---
>  drivers/usb/host/Kconfig  |   8 +++
>  drivers/usb/host/Makefile |   1 +
>  drivers/usb/host/ehci-rcar_gen3.c | 106 
> ++
>  3 files changed, 115 insertions(+)
>  create mode 100644 drivers/usb/host/ehci-rcar_gen3.c
>
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index fb5aa6f889..18971acf54 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -130,6 +130,14 @@ config USB_EHCI_MSM
>   This driver supports combination of Chipidea USB controller
>   and Synapsys USB PHY in host mode only.
>
> +config USB_EHCI_RCAR_GEN3
> +   bool "Support for Renesas RCar M3/H3 EHCI USB controller"
> +   depends on RCAR_GEN3
> +   default y
> +   ---help---
> + Enables support for the on-chip EHCI controller on Renesas
> + R8A7795 and R8A7796 SoCs.
> +
>  config USB_EHCI_ZYNQ
> bool "Support for Xilinx Zynq on-chip EHCI USB controller"
> depends on ARCH_ZYNQ
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index 58c0cf54c2..5d481757e5 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -51,6 +51,7 @@ obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
>  obj-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
>  obj-$(CONFIG_USB_EHCI_VF) += ehci-vf.o
>  obj-$(CONFIG_USB_EHCI_RMOBILE) += ehci-rmobile.o
> +obj-$(CONFIG_USB_EHCI_RCAR_GEN3) += ehci-rcar_gen3.o
>  obj-$(CONFIG_USB_EHCI_ZYNQ) += ehci-zynq.o
>
>  # xhci
> diff --git a/drivers/usb/host/ehci-rcar_gen3.c 
> b/drivers/usb/host/ehci-rcar_gen3.c
> new file mode 100644
> index 00..525e7f3573
> --- /dev/null
> +++ b/drivers/usb/host/ehci-rcar_gen3.c
> @@ -0,0 +1,106 @@
> +/*
> + * drivers/usb/host/ehci-rcar_gen3.
> + * This file is EHCI HCD (Host Controller Driver) for USB.
> + *
> + * Copyright (C) 2015-2017 Renesas Electronics Corporation
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "ehci.h"
> +
> +#define RCAR_GEN3_USB_BASE(n)  (0xEE08 + ((n) * 0x2))
> +
> +#define EHCI_USBCMD0x120
> +
> +#define CORE_SPD_RSM_TIMSET0x30c
> +#define CORE_OC_TIMSET 0x310
> +
> +/* Register offset */
> +#define AHB_OFFSET 0x200
> +
> +#define BASE_HSUSB 0xE659
> +#define REG_LPSTS  (BASE_HSUSB + 0x0102)   /* 16bit */
> +#define SUSPM  0x4000
> +#define SUSPM_NORMAL   BIT(14)
> +#define REG_UGCTRL2(BASE_HSUSB + 0x0184)   /* 32bit */
> +#define USB0SEL0x0030
> +#define USB0SEL_EHCI   0x0010
> +
> +#define SMSTPCR7   0xE615014C
> +#define SMSTPCR700 BIT(0)  /* EHCI3 */
> +#define SMSTPCR701 BIT(1)  /* EHCI2 */
> +#define SMSTPCR702 BIT(2)  /* EHCI1 */
> +#define SMSTPCR703 BIT(3)  /* EHCI0 */
> +#define SMSTPCR704 BIT(4)  /* HSUSB */
> +
> +#define AHB_PLL_RSTBIT(1)
> +
> +#define USBH_INTBENBIT(2)
> +#define USBH_INTAENBIT(1)
> +
> +#define AHB_INT_ENABLE 0x200
> +#define AHB_USBCTR 0x20c
> +
> +int ehci_hcd_stop(int index)
> +{
> +#if defined(CONFIG_R8A7795)
> +   const u32 mask = SMSTPCR703 | SMSTPCR702 | SMSTPCR701 | SMSTPCR700;
> +#else
> +   const u32 mask = SMSTPCR703 | SMSTPCR702;
> +#endif
> +   const u32 base = RCAR_GEN3_USB_BASE(index);
> +   int ret;
> +
> +   /* Reset EHCI */
> +   setbits_le32((uintptr_t)(base + EHCI_USBCMD), CMD_RESET);
> +   ret = wait_for_bit("ehci-rcar", (void *)(uintptr_t)base + EHCI_USBCMD,
> +  CMD_RESET, false, 10, true);
> +   if (ret) {
> +   printf("ehci-rcar: reset failed (index=%i, ret=%i).\n",
> +  index, ret);
> +   }
> +
> +   setbits_le32(SMSTPCR7, BIT(3 - index));
> +
> +   if ((readl(SMSTPCR7) & mask) == mask)
> +   setbits_le32(SMSTPCR7, SMSTPCR704);
> +
> +   return 0;
> +}
> +
> +int ehci_hcd_init(int index, enum usb_init_type init,
> + struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> +{
> +   const void __iomem *base =
> +   (void __iomem *)(uintptr_t)RCAR_GEN3_USB_BASE(index);
> +   struct usb_ehci *ehci = (struct usb_ehci *)(uintptr_t)base;
> +
> +   clrbits_le32(SMSTPCR7, BIT(3 - index));
> +   clrbits_le32(SMSTPCR7, SMSTPCR704);
> +
> +   *hccr = (struct ehci_hccr 

Re: [U-Boot] [PATCH 5/5] mmc: sh_sdhi: Add SDHI support

2017-05-13 Thread Nobuhiro Iwamatsu
Hi,

2017-05-13 22:51 GMT+09:00 Marek Vasut :
> From: Kouei Abe 
>
> R-Car Gen3 series have four SD card interfaces (SDHI0 to SDHI3),
> two of which can also be used as MMC interfaces (SDHI2 and SDHI3).
> This adds High-speed mode SD clock frequency between 25MHz and 50MHz,
> 8bit/4bit bus width, high capacity and low voltage device support.
>
> Signed-off-by: Kouei Abe 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> Cc: Jaehoon Chung 

Reviewed-by: Nobuhiro Iwamatsu 

> ---
>  drivers/mmc/sh_sdhi.c | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
> index c64beb6e2a..d181b63905 100644
> --- a/drivers/mmc/sh_sdhi.c
> +++ b/drivers/mmc/sh_sdhi.c
> @@ -698,6 +698,19 @@ static const struct mmc_ops sh_sdhi_ops = {
> .init   = sh_sdhi_initialize,
>  };
>
> +#ifdef CONFIG_RCAR_GEN3
> +static struct mmc_config sh_sdhi_cfg = {
> +   .name   = DRIVER_NAME,
> +   .ops= &sh_sdhi_ops,
> +   .f_min  = CLKDEV_INIT,
> +   .f_max  = CLKDEV_HS_DATA,
> +   .voltages   = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
> +   .host_caps  = MMC_MODE_4BIT | MMC_MODE_8BIT | MMC_MODE_HS |
> + MMC_MODE_HS_52MHz,
> +   .part_type  = PART_TYPE_DOS,
> +   .b_max  = CONFIG_SYS_MMC_MAX_BLK_COUNT,
> +};
> +#else
>  static struct mmc_config sh_sdhi_cfg = {
> .name   = DRIVER_NAME,
> .ops= &sh_sdhi_ops,
> @@ -708,6 +721,7 @@ static struct mmc_config sh_sdhi_cfg = {
> .part_type  = PART_TYPE_DOS,
> .b_max  = CONFIG_SYS_MMC_MAX_BLK_COUNT,
>  };
> +#endif
>
>  int sh_sdhi_init(unsigned long addr, int ch, unsigned long quirks)
>  {
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 18/23] ARM: rmobile: salvator-x: Add DVFS and PMIC support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add support for rebooting the board using the ROHM BD9571MWV I2C PMIC,
> but keep the CPU reboot option as a fallback.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c |  9 +
>  include/configs/salvator-x.h  | 12 
>  2 files changed, 21 insertions(+)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index 38ff99a17c..acc541df0c 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -50,6 +50,7 @@ void s_init(void)
>  #define TMU1_MSTP124   BIT(24) /* non-secure */
>  #define SCIF2_MSTP310  BIT(10) /* SCIF2 */
>  #define ETHERAVB_MSTP812   BIT(12)
> +#define DVFS_MSTP926   BIT(26)
>  #define SD0_MSTP314BIT(14)
>  #define SD1_MSTP313BIT(13)
>  #define SD2_MSTP312BIT(12) /* either MMC0 */
> @@ -78,6 +79,10 @@ int board_early_init_f(void)
> writel(0, SD2CKCR);
> writel(0, SD3CKCR);
>
> +#if defined(CONFIG_SYS_I2C) && defined(CONFIG_SYS_I2C_SH)
> +   /* DVFS for reset */
> +   mstp_clrbits_le32(MSTPSR9, SMSTPCR9, DVFS_MSTP926);
> +#endif
> return 0;
>  }
>
> @@ -235,8 +240,12 @@ const struct rmobile_sysinfo sysinfo = {
>
>  void reset_cpu(ulong addr)
>  {
> +#if defined(CONFIG_SYS_I2C) && defined(CONFIG_SYS_I2C_SH)
> +   i2c_reg_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x20, 0x80);
> +#else
> /* only CA57 ? */
> writel(RST_CODE, RST_CA57RESCNT);
> +#endif
>  }
>
>  static const struct sh_serial_platdata serial_platdata = {
> diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
> index b5a98d6db2..0e5c130b13 100644
> --- a/include/configs/salvator-x.h
> +++ b/include/configs/salvator-x.h
> @@ -50,6 +50,18 @@
>  #define GICD_BASE  0xF101
>  #define GICC_BASE  0xF102
>
> +/* i2c */
> +#define CONFIG_SYS_I2C
> +#define CONFIG_SYS_I2C_SH
> +#define CONFIG_SYS_I2C_SLAVE   0x60
> +#define CONFIG_SYS_I2C_SH_NUM_CONTROLLERS  1
> +#define CONFIG_SYS_I2C_SH_SPEED0   40
> +#define CONFIG_SH_I2C_DATA_HIGH4
> +#define CONFIG_SH_I2C_DATA_LOW 5
> +#define CONFIG_SH_I2C_CLOCK1000
> +
> +#define CONFIG_SYS_I2C_POWERIC_ADDR0x30
> +
>  /* SDHI */
>  #define CONFIG_SH_SDHI_FREQ2
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 23/23] ARM: rmobile: salvator-x: Add R8A7796 support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add minor ifdeffery and default board config for the Salvator-XS board
> with R8A7796 M3 SoC.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/MAINTAINERS  |  1 +
>  board/renesas/salvator-x/salvator-x.c | 28 ++--
>  configs/r8a7796_salvator-x_defconfig  | 31 +++
>  3 files changed, 58 insertions(+), 2 deletions(-)
>  create mode 100644 configs/r8a7796_salvator-x_defconfig
>
> diff --git a/board/renesas/salvator-x/MAINTAINERS 
> b/board/renesas/salvator-x/MAINTAINERS
> index 33c105d0cc..f7b98fb097 100644
> --- a/board/renesas/salvator-x/MAINTAINERS
> +++ b/board/renesas/salvator-x/MAINTAINERS
> @@ -4,3 +4,4 @@ S:  Maintained
>  F: board/renesas/salvator-x/
>  F: include/configs/salvator-x.h
>  F: configs/r8a7795_salvator-x_defconfig
> +F: configs/r8a7796_salvator-x_defconfig
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index 14385d7361..6270de4e40 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -1,6 +1,6 @@
>  /*
>   * board/renesas/salvator-x/salvator-x.c
> - * This file is Salvator-X board support.
> + * This file is Salvator-X/Salvator-XS board support.
>   *
>   * Copyright (C) 2015-2017 Renesas Electronics Corporation
>   * Copyright (C) 2015 Nobuhiro Iwamatsu 
> @@ -98,14 +98,20 @@ int board_init(void)
> gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x5;
>
> /* Init PFC controller */
> +#if defined(CONFIG_R8A7795)
> r8a7795_pinmux_init();
> +#elif defined(CONFIG_R8A7796)
> +   r8a7796_pinmux_init();
> +#endif
>
> +#if defined(CONFIG_R8A7795)
> /* GSX: force power and clock supply */
> writel(0x001F, SYSC_PWRONCR2);
> while (readl(SYSC_PWRSR2) != 0x03E0)
> mdelay(20);
>
> mstp_clrbits_le32(MSTPSR1, SMSTPCR1, GSX_MSTP112);
> +#endif
>
> /* USB1 pull-up */
> setbits_le32(PFC_PUEN6, PUEN_USB1_OVC | PUEN_USB1_PWEN);
> @@ -134,6 +140,7 @@ int board_init(void)
> /* IPSR3 */
> gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL);
>
> +#if defined(CONFIG_R8A7795)
> /* USB2_OVC */
> gpio_request(GPIO_GP_6_15, NULL);
> gpio_direction_input(GPIO_GP_6_15);
> @@ -142,7 +149,7 @@ int board_init(void)
> gpio_request(GPIO_GP_6_14, NULL);
> gpio_direction_output(GPIO_GP_6_14, 1);
> gpio_set_value(GPIO_GP_6_14, 1);
> -
> +#endif
> /* AVB_PHY_RST */
> gpio_request(GPIO_GP_2_10, NULL);
> gpio_direction_output(GPIO_GP_2_10, 0);
> @@ -200,7 +207,13 @@ int board_mmc_init(bd_t *bis)
> gpio_request(GPIO_GFN_SD2_DAT2, NULL);
> gpio_request(GPIO_GFN_SD2_DAT3, NULL);
> gpio_request(GPIO_GFN_SD2_CLK, NULL);
> +#if defined(CONFIG_R8A7795)
> gpio_request(GPIO_GFN_SD2_CMD, NULL);
> +#elif defined(CONFIG_R8A7796)
> +   gpio_request(GPIO_FN_SD2_CMD, NULL);
> +#else
> +#error Only R8A7795 and R87796 is supported
> +#endif
> gpio_request(GPIO_GP_5_3, NULL);
> gpio_request(GPIO_GP_5_9, NULL);
> gpio_direction_output(GPIO_GP_5_3, 0);  /* 1: 3.3V, 0: 1.8V */
> @@ -211,6 +224,7 @@ int board_mmc_init(bd_t *bis)
> if (ret)
> return ret;
>
> +#if defined(CONFIG_R8A7795)
> /* SDHI3 */
> gpio_request(GPIO_GFN_SD3_DAT0, NULL);  /* GP_4_9 */
> gpio_request(GPIO_GFN_SD3_DAT1, NULL);  /* GP_4_10 */
> @@ -218,6 +232,16 @@ int board_mmc_init(bd_t *bis)
> gpio_request(GPIO_GFN_SD3_DAT3, NULL);  /* GP_4_12 */
> gpio_request(GPIO_GFN_SD3_CLK, NULL);   /* GP_4_7 */
> gpio_request(GPIO_GFN_SD3_CMD, NULL);   /* GP_4_8 */
> +#elif defined(CONFIG_R8A7796)
> +   gpio_request(GPIO_FN_SD3_DAT0, NULL);   /* GP_4_9 */
> +   gpio_request(GPIO_FN_SD3_DAT1, NULL);   /* GP_4_10 */
> +   gpio_request(GPIO_FN_SD3_DAT2, NULL);   /* GP_4_11 */
> +   gpio_request(GPIO_FN_SD3_DAT3, NULL);   /* GP_4_12 */
> +   gpio_request(GPIO_FN_SD3_CLK, NULL);/* GP_4_7 */
> +   gpio_request(GPIO_FN_SD3_CMD, NULL);/* GP_4_8 */
> +#else
> +#error Only R8A7795 and R87796 is supported
> +#endif
> /* IPSR10 */
> gpio_request(GPIO_FN_SD3_CD, NULL);
> gpio_request(GPIO_FN_SD3_WP, NULL);
> diff --git a/configs/r8a7796_salvator-x_defconfig 
> b/configs/r8a7796_salvator-x_defconfig
> new file mode 100644
> index 00..d6f1840eab
> --- /dev/null
> +++ b/configs/r8a7796_salvator-x_defconfig
> @@ -0,0 +1,31 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_RMOBILE=y
> +CONFIG_SYS_MALLOC_F_LEN=0x2000
> +CONFIG_RCAR_GEN3=y
> +CONFIG_TARGET_SALVATOR_X=y
> +CONFIG_DEFAULT_FDT_FILE=r8a7796-salvator-x.dtb
> +CONFIG_VERSION_VARIABLE=y
> +CONFIG_CMD_BOOTZ=y
> +CONFIG_CMD_FDT=y
> +CONFIG_R8A7796=y
> +CONFIG_SH_SDHI=y
> +#

Re: [U-Boot] [PATCH 3/5] mmc: sh_sdhi: Add 64-bit access to sd_buf support

2017-05-13 Thread Nobuhiro Iwamatsu
Hi!

2017-05-13 22:51 GMT+09:00 Marek Vasut :
> From: Kouei Abe 
>
> Renesas SDHI SD/MMC driver has 16-bit width bus access to SD_BUF.
> This adds 64-bit width bus access to SD_BUF.
>
> Signed-off-by: Kouei Abe 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> Cc: Jaehoon Chung 

Reviewed-by: Nobuhiro Iwamatsu 

> ---
>  arch/arm/mach-rmobile/include/mach/sh_sdhi.h |  8 +++--
>  drivers/mmc/sh_sdhi.c| 53 
> ++--
>  2 files changed, 48 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h 
> b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
> index 057bf3f8bb..a5ea45b707 100644
> --- a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
> +++ b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
> @@ -1,9 +1,9 @@
>  /*
>   * drivers/mmc/sh-sdhi.h
>   *
> - * SD/MMC driver for Reneas rmobile ARM SoCs
> + * SD/MMC driver for Renesas rmobile ARM SoCs
>   *
> - * Copyright (C) 2013-2014 Renesas Electronics Corporation
> + * Copyright (C) 2013-2017 Renesas Electronics Corporation
>   * Copyright (C) 2008-2009 Renesas Solutions Corp.
>   *
>   * SPDX-License-Identifier:GPL-2.0
> @@ -162,7 +162,9 @@
>  #defineCLKDEV_INIT 40  /* 100 - 400 
> KHz */
>
>  /* For quirk */
> -#define SH_SDHI_QUIRK_16BIT_BUF(1)
> +#define SH_SDHI_QUIRK_16BIT_BUFBIT(0)
> +#define SH_SDHI_QUIRK_64BIT_BUFBIT(1)
> +
>  int sh_sdhi_init(unsigned long addr, int ch, unsigned long quirks);
>
>  #endif /* _SH_SDHI_H */
> diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
> index 7f0b4c2603..d1dd0f0fc3 100644
> --- a/drivers/mmc/sh_sdhi.c
> +++ b/drivers/mmc/sh_sdhi.c
> @@ -3,7 +3,7 @@
>   *
>   * SD/MMC driver for Renesas rmobile ARM SoCs.
>   *
> - * Copyright (C) 2011,2013-2014 Renesas Electronics Corporation
> + * Copyright (C) 2011,2013-2017 Renesas Electronics Corporation
>   * Copyright (C) 2014 Nobuhiro Iwamatsu 
>   * Copyright (C) 2008-2009 Renesas Solutions Corp.
>   *
> @@ -29,6 +29,17 @@ struct sh_sdhi_host {
> unsigned char sd_error;
> unsigned char detect_waiting;
>  };
> +
> +static inline void sh_sdhi_writeq(struct sh_sdhi_host *host, int reg, u64 
> val)
> +{
> +   writeq(val, host->addr + (reg << host->bus_shift));
> +}
> +
> +static inline u64 sh_sdhi_readq(struct sh_sdhi_host *host, int reg)
> +{
> +   return readq(host->addr + (reg << host->bus_shift));
> +}
> +
>  static inline void sh_sdhi_writew(struct sh_sdhi_host *host, int reg, u16 
> val)
>  {
> writew(val, host->addr + (reg << host->bus_shift));
> @@ -261,6 +272,7 @@ static int sh_sdhi_single_read(struct sh_sdhi_host *host, 
> struct mmc_data *data)
> long time;
> unsigned short blocksize, i;
> unsigned short *p = (unsigned short *)data->dest;
> +   u64 *q = (u64 *)data->dest;
>
> if ((unsigned long)p & 0x0001) {
> debug(DRIVER_NAME": %s: The data pointer is unaligned.",
> @@ -281,8 +293,12 @@ static int sh_sdhi_single_read(struct sh_sdhi_host 
> *host, struct mmc_data *data)
>
> host->wait_int = 0;
> blocksize = sh_sdhi_readw(host, SDHI_SIZE);
> -   for (i = 0; i < blocksize / 2; i++)
> -   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
> +   if (host->quirks & SH_SDHI_QUIRK_64BIT_BUF)
> +   for (i = 0; i < blocksize / 8; i++)
> +   *q++ = sh_sdhi_readq(host, SDHI_BUF0);
> +   else
> +   for (i = 0; i < blocksize / 2; i++)
> +   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
>
> time = sh_sdhi_wait_interrupt_flag(host);
> if (time == 0 || host->sd_error != 0)
> @@ -297,6 +313,7 @@ static int sh_sdhi_multi_read(struct sh_sdhi_host *host, 
> struct mmc_data *data)
> long time;
> unsigned short blocksize, i, sec;
> unsigned short *p = (unsigned short *)data->dest;
> +   u64 *q = (u64 *)data->dest;
>
> if ((unsigned long)p & 0x0001) {
> debug(DRIVER_NAME": %s: The data pointer is unaligned.",
> @@ -319,8 +336,12 @@ static int sh_sdhi_multi_read(struct sh_sdhi_host *host, 
> struct mmc_data *data)
>
> host->wait_int = 0;
> blocksize = sh_sdhi_readw(host, SDHI_SIZE);
> -   for (i = 0; i < blocksize / 2; i++)
> -   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
> +   if (host->quirks & SH_SDHI_QUIRK_64BIT_BUF)
> +   for (i = 0; i < blocksize / 8; i++)
> +   *q++ = sh_sdhi_readq(host, SDHI_BUF0);
> +   else
> +   for (i = 0; i < blocksize / 2; i++)
> +   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
> }
>
> return 0;
> @@ -332,6 +353,7 @@ static int sh_sdhi_single_write(struct sh_sdhi_host *host,
> long time;
> unsigned short blocksize, i;
> const unsigned

Re: [U-Boot] [PATCH 1/5] mmc: sh_sdhi: Fix Kconfig entry

2017-05-13 Thread Nobuhiro Iwamatsu
Hi!

2017-05-13 22:51 GMT+09:00 Marek Vasut :
> The Kconfig entry depends on RMOBILE, but this was renamed
> to ARCH_RMOBILE in commit 1cc95f6e1b38 (ARM: Rmobile: Rename
> CONFIG_RMOBILE to CONFIG_ARCH_RMOBILE) . Fix this omission.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> Cc: Jaehoon Chung 

Reviewed-by: Nobuhiro Iwamatsu 

> ---
>  drivers/mmc/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index 6ac26dd137..b2d70a37bd 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -159,7 +159,7 @@ config MMC_OMAP36XX_PINS
>
>  config SH_SDHI
> bool "SuperH/Renesas ARM SoCs on-chip SDHI host controller support"
> -   depends on RMOBILE
> +   depends on ARCH_RMOBILE
> help
>   Support for the on-chip SDHI host controller on SuperH/Renesas ARM 
> SoCs platform
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] mmc: sh_sdhi: Add MMC version 5.0 support

2017-05-13 Thread Nobuhiro Iwamatsu
Hi,

2017-05-13 22:51 GMT+09:00 Marek Vasut :
> From: Kouei Abe 
>
> Renesas SDHI SD/MMC driver did not support MMC version 5.0 devices.
> This adds MMC version 5.0 device support.
>
> Signed-off-by: Kouei Abe 
> Signed-off-by: Hiroyuki Yokoyama 
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> Cc: Jaehoon Chung 

Reviewed-by: Nobuhiro Iwamatsu 

> ---
>  arch/arm/mach-rmobile/include/mach/sh_sdhi.h |  7 ++-
>  drivers/mmc/sh_sdhi.c| 24 +++-
>  2 files changed, 25 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h 
> b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
> index a5ea45b707..1fb0648b12 100644
> --- a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
> +++ b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
> @@ -50,8 +50,10 @@
>  /* SDHI CMD VALUE */
>  #define CMD_MASK   0x
>  #define SDHI_APP   0x0040
> +#define SDHI_MMC_SEND_OP_COND  0x0701
>  #define SDHI_SD_APP_SEND_SCR   0x0073
>  #define SDHI_SD_SWITCH 0x1C06
> +#define SDHI_MMC_SEND_EXT_CSD  0x1C08
>
>  /* SDHI_PORTSEL */
>  #define USE_1PORT  (1 << 8) /* 1 port */
> @@ -120,7 +122,10 @@
>  #define CLK_ENABLE (1 << 8)
>
>  /* SDHI_OPTION */
> -#define OPT_BUS_WIDTH_1(1 << 15)   /* bus width 
> = 1 bit */
> +#define OPT_BUS_WIDTH_M(5 << 13)   /* 101b 
> (15-13bit) */
> +#define OPT_BUS_WIDTH_1(4 << 13)   /* bus width 
> = 1 bit */
> +#define OPT_BUS_WIDTH_4(0 << 13)   /* bus width 
> = 4 bit */
> +#define OPT_BUS_WIDTH_8(1 << 13)   /* bus width 
> = 8 bit */
>
>  /* SDHI_ERR_STS1 */
>  #define ERR_STS1_CRC_ERROR ((1 << 11) | (1 << 10) | (1 << 9) | \
> diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
> index d1dd0f0fc3..c64beb6e2a 100644
> --- a/drivers/mmc/sh_sdhi.c
> +++ b/drivers/mmc/sh_sdhi.c
> @@ -489,6 +489,13 @@ static unsigned short sh_sdhi_set_cmd(struct 
> sh_sdhi_host *host,
> else /* SD_SWITCH */
> opc = SDHI_SD_SWITCH;
> break;
> +   case MMC_CMD_SEND_OP_COND:
> +   opc = SDHI_MMC_SEND_OP_COND;
> +   break;
> +   case MMC_CMD_SEND_EXT_CSD:
> +   if (data)
> +   opc = SDHI_MMC_SEND_EXT_CSD;
> +   break;
> default:
> break;
> }
> @@ -513,6 +520,7 @@ static unsigned short sh_sdhi_data_trans(struct 
> sh_sdhi_host *host,
> case MMC_CMD_READ_SINGLE_BLOCK:
> case SDHI_SD_APP_SEND_SCR:
> case SDHI_SD_SWITCH: /* SD_SWITCH */
> +   case SDHI_MMC_SEND_EXT_CSD:
> ret = sh_sdhi_single_read(host, data);
> break;
> default:
> @@ -648,12 +656,18 @@ static int sh_sdhi_set_ios(struct mmc *mmc)
> if (ret)
> return -EINVAL;
>
> -   if (mmc->bus_width == 4)
> -   sh_sdhi_writew(host, SDHI_OPTION, ~OPT_BUS_WIDTH_1 &
> -  sh_sdhi_readw(host, SDHI_OPTION));
> +   if (mmc->bus_width == 8)
> +   sh_sdhi_writew(host, SDHI_OPTION,
> +  OPT_BUS_WIDTH_8 | (~OPT_BUS_WIDTH_M &
> +  sh_sdhi_readw(host, SDHI_OPTION)));
> +   else if (mmc->bus_width == 4)
> +   sh_sdhi_writew(host, SDHI_OPTION,
> +  OPT_BUS_WIDTH_4 | (~OPT_BUS_WIDTH_M &
> +  sh_sdhi_readw(host, SDHI_OPTION)));
> else
> -   sh_sdhi_writew(host, SDHI_OPTION, OPT_BUS_WIDTH_1 |
> -  sh_sdhi_readw(host, SDHI_OPTION));
> +   sh_sdhi_writew(host, SDHI_OPTION,
> +  OPT_BUS_WIDTH_1 | (~OPT_BUS_WIDTH_M &
> +  sh_sdhi_readw(host, SDHI_OPTION)));
>
> debug("clock = %d, buswidth = %d\n", mmc->clock, mmc->bus_width);
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 22/23] ARM: rmobile: salvator-x: Rename the defconfig to match the SoC

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Rename the salvator-x_defconfig to r8a7795_salvator-x_defconfig in
> preparation for the r8a7796 support on salvator-x board.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/MAINTAINERS   | 2 +-
>  configs/{salvator-x_defconfig => r8a7795_salvator-x_defconfig} | 0
>  2 files changed, 1 insertion(+), 1 deletion(-)
>  rename configs/{salvator-x_defconfig => r8a7795_salvator-x_defconfig} (100%)
>
> diff --git a/board/renesas/salvator-x/MAINTAINERS 
> b/board/renesas/salvator-x/MAINTAINERS
> index abd05c88e0..33c105d0cc 100644
> --- a/board/renesas/salvator-x/MAINTAINERS
> +++ b/board/renesas/salvator-x/MAINTAINERS
> @@ -3,4 +3,4 @@ M:  Nobuhiro Iwamatsu 
>  S: Maintained
>  F: board/renesas/salvator-x/
>  F: include/configs/salvator-x.h
> -F: configs/salvator-x_defconfig
> +F: configs/r8a7795_salvator-x_defconfig
> diff --git a/configs/salvator-x_defconfig 
> b/configs/r8a7795_salvator-x_defconfig
> similarity index 100%
> rename from configs/salvator-x_defconfig
> rename to configs/r8a7795_salvator-x_defconfig
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/5] mmc: sh_sdhi: Set SD_INFOx interrupt mask before command starting

2017-05-13 Thread Nobuhiro Iwamatsu
Hi,

2017-05-13 22:51 GMT+09:00 Marek Vasut :
> From: Kouei Abe 
>
> When setting interrupt mask after command starting, an unintended
> interrupt status sometimes occurs.
>
> Signed-off-by: Kouei Abe 
> Signed-off-by: Hiroyuki Yokoyama 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> Cc: Jaehoon Chung 

Reviewed-by: Nobuhiro Iwamatsu 

> ---
>  drivers/mmc/sh_sdhi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
> index 25224e2e1d..7f0b4c2603 100644
> --- a/drivers/mmc/sh_sdhi.c
> +++ b/drivers/mmc/sh_sdhi.c
> @@ -546,8 +546,6 @@ static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
> break;
> }
>
> -   sh_sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
> -
> host->wait_int = 0;
> sh_sdhi_writew(host, SDHI_INFO1_MASK,
>~INFO1M_RESP_END & sh_sdhi_readw(host, 
> SDHI_INFO1_MASK));
> @@ -557,6 +555,8 @@ static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
>INFO2M_RESP_TIMEOUT | INFO2M_ILA) &
>sh_sdhi_readw(host, SDHI_INFO2_MASK));
>
> +   sh_sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
> +
> time = sh_sdhi_wait_interrupt_flag(host);
> if (!time)
> return sh_sdhi_error_manage(host);
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 11/23] ARM: rmobile: salvator-x: Use BIT() macro in board file

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Cosmetic change, replace (1 << (n)) with BIT(n) .
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index 0164306b52..d0e21ab667 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -44,10 +44,10 @@ void s_init(void)
> writel(0x, CPGWPR);
>  }
>
> -#define GSX_MSTP112(1 << 12)   /* 3DG */
> -#define TMU0_MSTP125   (1 << 25)   /* secure */
> -#define TMU1_MSTP124   (1 << 24)   /* non-secure */
> -#define SCIF2_MSTP310  (1 << 10)   /* SCIF2 */
> +#define GSX_MSTP112BIT(12) /* 3DG */
> +#define TMU0_MSTP125   BIT(25) /* secure */
> +#define TMU1_MSTP124   BIT(24) /* non-secure */
> +#define SCIF2_MSTP310  BIT(10) /* SCIF2 */
>
>  int board_early_init_f(void)
>  {
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 17/23] ARM: rmobile: salvator-x: Add RAVB ethernet support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add support for the AVB ethernet on the Salvator-X board.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c | 46 
> +++
>  configs/salvator-x_defconfig  |  7 ++
>  include/configs/salvator-x.h  |  6 +
>  3 files changed, 59 insertions(+)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index 1ee5cf1051..38ff99a17c 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -49,6 +49,7 @@ void s_init(void)
>  #define TMU0_MSTP125   BIT(25) /* secure */
>  #define TMU1_MSTP124   BIT(24) /* non-secure */
>  #define SCIF2_MSTP310  BIT(10) /* SCIF2 */
> +#define ETHERAVB_MSTP812   BIT(12)
>  #define SD0_MSTP314BIT(14)
>  #define SD1_MSTP313BIT(13)
>  #define SD2_MSTP312BIT(12) /* either MMC0 */
> @@ -65,6 +66,8 @@ int board_early_init_f(void)
> mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125 | TMU1_MSTP124);
> /* SCIF2 */
> mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SCIF2_MSTP310);
> +   /* EHTERAVB */
> +   mstp_clrbits_le32(MSTPSR8, SMSTPCR8, ETHERAVB_MSTP812);
> /* eMMC */
> mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD1_MSTP313 | SD2_MSTP312);
> /* SDHI0, 3 */
> @@ -99,9 +102,52 @@ int board_init(void)
>
> mstp_clrbits_le32(MSTPSR1, SMSTPCR1, GSX_MSTP112);
>
> +#ifdef CONFIG_RAVB
> +   /* EtherAVB Enable */
> +   /* GPSR2 */
> +   gpio_request(GPIO_GFN_AVB_AVTP_CAPTURE_A, NULL);
> +   gpio_request(GPIO_GFN_AVB_AVTP_MATCH_A, NULL);
> +   gpio_request(GPIO_GFN_AVB_LINK, NULL);
> +   gpio_request(GPIO_GFN_AVB_PHY_INT, NULL);
> +   gpio_request(GPIO_GFN_AVB_MAGIC, NULL);
> +   gpio_request(GPIO_GFN_AVB_MDC, NULL);
> +
> +   /* IPSR0 */
> +   gpio_request(GPIO_IFN_AVB_MDC, NULL);
> +   gpio_request(GPIO_IFN_AVB_MAGIC, NULL);
> +   gpio_request(GPIO_IFN_AVB_PHY_INT, NULL);
> +   gpio_request(GPIO_IFN_AVB_LINK, NULL);
> +   gpio_request(GPIO_IFN_AVB_AVTP_MATCH_A, NULL);
> +   gpio_request(GPIO_IFN_AVB_AVTP_CAPTURE_A, NULL);
> +   /* IPSR1 */
> +   gpio_request(GPIO_FN_AVB_AVTP_PPS, NULL);
> +   /* IPSR2 */
> +   gpio_request(GPIO_FN_AVB_AVTP_MATCH_B, NULL);
> +   /* IPSR3 */
> +   gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL);
> +
> +   /* AVB_PHY_RST */
> +   gpio_request(GPIO_GP_2_10, NULL);
> +   gpio_direction_output(GPIO_GP_2_10, 0);
> +   mdelay(20);
> +   gpio_set_value(GPIO_GP_2_10, 1);
> +   udelay(1);
> +#endif
> +
> return 0;
>  }
>
> +static struct eth_pdata salvator_x_ravb_platdata = {
> +   .iobase = 0xE680,
> +   .phy_interface  = 0,
> +   .max_speed  = 1000,
> +};
> +
> +U_BOOT_DEVICE(salvator_x_ravb) = {
> +   .name   = "ravb",
> +   .platdata   = &salvator_x_ravb_platdata,
> +};
> +
>  #ifdef CONFIG_SH_SDHI
>  int board_mmc_init(bd_t *bis)
>  {
> diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
> index 1478b6ae3b..3738fe4536 100644
> --- a/configs/salvator-x_defconfig
> +++ b/configs/salvator-x_defconfig
> @@ -12,7 +12,14 @@ CONFIG_SH_SDHI=y
>  # CONFIG_CMD_IMLS is not set
>  CONFIG_CMD_EDITENV=y
>  CONFIG_CMD_SAVEENV=y
> +CONFIG_CMD_NET=y
> +CONFIG_CMD_NFS=y
> +CONFIG_CMD_MII=y
> +CONFIG_CMD_PING=y
> +CONFIG_CMD_DHCP=y
>  CONFIG_DOS_PARTITION=y
>  CONFIG_MMC=y
>  CONFIG_GENERIC_MMC=y
>  CONFIG_OF_LIBFDT=y
> +CONFIG_DM_ETH=y
> +CONFIG_RENESAS_RAVB=y
> diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
> index 91307eb353..b5a98d6db2 100644
> --- a/include/configs/salvator-x.h
> +++ b/include/configs/salvator-x.h
> @@ -25,6 +25,12 @@
>  /* [A] Hyper Flash */
>  /* use to RPC(SPI Multi I/O Bus Controller) */
>
> +/* Ethernet RAVB */
> +#define CONFIG_NET_MULTI
> +#define CONFIG_PHY_MICREL
> +#define CONFIG_BITBANGMII
> +#define CONFIG_BITBANGMII_MULTI
> +
>  /* Board Clock */
>  /* XTAL_CLK : 33.33MHz */
>  #define RCAR_XTAL_CLK  u
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 16/23] ARM: rmobile: salvator-x: Add SD support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add support for the SD card slots on the Salvator-X board.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c | 89 
> ++-
>  configs/salvator-x_defconfig  |  8 ++--
>  include/configs/salvator-x.h  | 10 +++-
>  3 files changed, 102 insertions(+), 5 deletions(-)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index 3f2bebf74f..1ee5cf1051 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -2,7 +2,7 @@
>   * board/renesas/salvator-x/salvator-x.c
>   * This file is Salvator-X board support.
>   *
> - * Copyright (C) 2015 Renesas Electronics Corporation
> + * Copyright (C) 2015-2017 Renesas Electronics Corporation
>   * Copyright (C) 2015 Nobuhiro Iwamatsu 
>   *
>   * SPDX-License-Identifier: GPL-2.0+
> @@ -22,6 +22,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>
> @@ -48,6 +49,15 @@ void s_init(void)
>  #define TMU0_MSTP125   BIT(25) /* secure */
>  #define TMU1_MSTP124   BIT(24) /* non-secure */
>  #define SCIF2_MSTP310  BIT(10) /* SCIF2 */
> +#define SD0_MSTP314BIT(14)
> +#define SD1_MSTP313BIT(13)
> +#define SD2_MSTP312BIT(12) /* either MMC0 */
> +#define SD3_MSTP311BIT(11) /* either MMC1 */
> +
> +#define SD0CKCR0xE6150074
> +#define SD1CKCR0xE6150078
> +#define SD2CKCR0xE6150268
> +#define SD3CKCR0xE615026C
>
>  int board_early_init_f(void)
>  {
> @@ -55,6 +65,15 @@ int board_early_init_f(void)
> mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125 | TMU1_MSTP124);
> /* SCIF2 */
> mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SCIF2_MSTP310);
> +   /* eMMC */
> +   mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD1_MSTP313 | SD2_MSTP312);
> +   /* SDHI0, 3 */
> +   mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD0_MSTP314 | SD3_MSTP311);
> +
> +   writel(0, SD0CKCR);
> +   writel(0, SD1CKCR);
> +   writel(0, SD2CKCR);
> +   writel(0, SD3CKCR);
>
> return 0;
>  }
> @@ -83,6 +102,74 @@ int board_init(void)
> return 0;
>  }
>
> +#ifdef CONFIG_SH_SDHI
> +int board_mmc_init(bd_t *bis)
> +{
> +   int ret = -ENODEV;
> +
> +   /* SDHI0 */
> +   gpio_request(GPIO_GFN_SD0_DAT0, NULL);
> +   gpio_request(GPIO_GFN_SD0_DAT1, NULL);
> +   gpio_request(GPIO_GFN_SD0_DAT2, NULL);
> +   gpio_request(GPIO_GFN_SD0_DAT3, NULL);
> +   gpio_request(GPIO_GFN_SD0_CLK, NULL);
> +   gpio_request(GPIO_GFN_SD0_CMD, NULL);
> +   gpio_request(GPIO_GFN_SD0_CD, NULL);
> +   gpio_request(GPIO_GFN_SD0_WP, NULL);
> +
> +   gpio_request(GPIO_GP_5_2, NULL);
> +   gpio_request(GPIO_GP_5_1, NULL);
> +   gpio_direction_output(GPIO_GP_5_2, 1);  /* power on */
> +   gpio_direction_output(GPIO_GP_5_1, 1);  /* 1: 3.3V, 0: 1.8V */
> +
> +   ret = sh_sdhi_init(CONFIG_SYS_SH_SDHI0_BASE, 0,
> +  SH_SDHI_QUIRK_64BIT_BUF);
> +   if (ret)
> +   return ret;
> +
> +   /* SDHI1/SDHI2 eMMC */
> +   gpio_request(GPIO_GFN_SD1_DAT0, NULL);
> +   gpio_request(GPIO_GFN_SD1_DAT1, NULL);
> +   gpio_request(GPIO_GFN_SD1_DAT2, NULL);
> +   gpio_request(GPIO_GFN_SD1_DAT3, NULL);
> +   gpio_request(GPIO_GFN_SD2_DAT0, NULL);
> +   gpio_request(GPIO_GFN_SD2_DAT1, NULL);
> +   gpio_request(GPIO_GFN_SD2_DAT2, NULL);
> +   gpio_request(GPIO_GFN_SD2_DAT3, NULL);
> +   gpio_request(GPIO_GFN_SD2_CLK, NULL);
> +   gpio_request(GPIO_GFN_SD2_CMD, NULL);
> +   gpio_request(GPIO_GP_5_3, NULL);
> +   gpio_request(GPIO_GP_5_9, NULL);
> +   gpio_direction_output(GPIO_GP_5_3, 0);  /* 1: 3.3V, 0: 1.8V */
> +   gpio_direction_output(GPIO_GP_5_9, 0);  /* 1: 3.3V, 0: 1.8V */
> +
> +   ret = sh_sdhi_init(CONFIG_SYS_SH_SDHI2_BASE, 1,
> +  SH_SDHI_QUIRK_64BIT_BUF);
> +   if (ret)
> +   return ret;
> +
> +   /* SDHI3 */
> +   gpio_request(GPIO_GFN_SD3_DAT0, NULL);  /* GP_4_9 */
> +   gpio_request(GPIO_GFN_SD3_DAT1, NULL);  /* GP_4_10 */
> +   gpio_request(GPIO_GFN_SD3_DAT2, NULL);  /* GP_4_11 */
> +   gpio_request(GPIO_GFN_SD3_DAT3, NULL);  /* GP_4_12 */
> +   gpio_request(GPIO_GFN_SD3_CLK, NULL);   /* GP_4_7 */
> +   gpio_request(GPIO_GFN_SD3_CMD, NULL);   /* GP_4_8 */
> +   /* IPSR10 */
> +   gpio_request(GPIO_FN_SD3_CD, NULL);
> +   gpio_request(GPIO_FN_SD3_WP, NULL);
> +
> +   gpio_request(GPIO_GP_3_15, NULL);
> +   gpio_request(GPIO_GP_3_14, NULL);
> +   gpio_direction_output(GPIO_GP_3_15, 1); /* power on */
> +   gpio_direction_output(GPIO_GP_3_14, 1); /* 1: 3.3V, 0: 1.8V */
> +
> +   

Re: [U-Boot] [PATCH 19/23] ARM: rmobile: salvator-x: Add USB support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add support for the EHCI USB.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c | 12 
>  configs/salvator-x_defconfig  |  6 ++
>  include/configs/salvator-x.h  |  7 +++
>  3 files changed, 25 insertions(+)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index acc541df0c..44e4006f5c 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -107,6 +107,9 @@ int board_init(void)
>
> mstp_clrbits_le32(MSTPSR1, SMSTPCR1, GSX_MSTP112);
>
> +   /* USB1 pull-up */
> +   setbits_le32(PFC_PUEN6, PUEN_USB1_OVC | PUEN_USB1_PWEN);
> +
>  #ifdef CONFIG_RAVB
> /* EtherAVB Enable */
> /* GPSR2 */
> @@ -131,6 +134,15 @@ int board_init(void)
> /* IPSR3 */
> gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL);
>
> +   /* USB2_OVC */
> +   gpio_request(GPIO_GP_6_15, NULL);
> +   gpio_direction_input(GPIO_GP_6_15);
> +
> +   /* USB2_PWEN */
> +   gpio_request(GPIO_GP_6_14, NULL);
> +   gpio_direction_output(GPIO_GP_6_14, 1);
> +   gpio_set_value(GPIO_GP_6_14, 1);
> +
> /* AVB_PHY_RST */
> gpio_request(GPIO_GP_2_10, NULL);
> gpio_direction_output(GPIO_GP_2_10, 0);
> diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
> index 3738fe4536..60e0b720bb 100644
> --- a/configs/salvator-x_defconfig
> +++ b/configs/salvator-x_defconfig
> @@ -17,6 +17,12 @@ CONFIG_CMD_NFS=y
>  CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
>  CONFIG_CMD_DHCP=y
> +CONFIG_CMD_USB=y
> +CONFIG_USB=y
> +CONFIG_USB_HOST=y
> +CONFIG_USB_EHCI_HCD=y
> +CONFIG_USB_STORAGE=y
> +CONFIG_USB_EHCI_RCAR_GEN3=y
>  CONFIG_DOS_PARTITION=y
>  CONFIG_MMC=y
>  CONFIG_GENERIC_MMC=y
> diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
> index 0e5c130b13..4ac9328e1b 100644
> --- a/include/configs/salvator-x.h
> +++ b/include/configs/salvator-x.h
> @@ -62,6 +62,13 @@
>
>  #define CONFIG_SYS_I2C_POWERIC_ADDR0x30
>
> +/* USB */
> +#ifdef CONFIG_R8A7795
> +#define CONFIG_USB_MAX_CONTROLLER_COUNT3
> +#else
> +#define CONFIG_USB_MAX_CONTROLLER_COUNT2
> +#endif
> +
>  /* SDHI */
>  #define CONFIG_SH_SDHI_FREQ2
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 21/23] ARM: rmobile: salvator-x: Enable SCIF2 clock

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> There are two UARTs on the board, so enable the clock for the
> second one as well.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  include/configs/salvator-x.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
> index 4ac9328e1b..0ac3900326 100644
> --- a/include/configs/salvator-x.h
> +++ b/include/configs/salvator-x.h
> @@ -81,6 +81,8 @@
>  /* Module stop status bits */
>  /* MFIS, SCIF1 */
>  #define CONFIG_SMSTP2_ENA  0x2040
> +/* SCIF2 */
> +#define CONFIG_SMSTP3_ENA  0x0400
>  /* INTC-AP, IRQC */
>  #define CONFIG_SMSTP4_ENA  0x0180
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 14/23] ARM: rmobile: salvator-x: Zap redefined DECLARE_GLOBAL_DATA_PTR

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> The macro is used twice in the salvator-x board file, drop one.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index d0e21ab667..038d6de610 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -65,7 +65,6 @@ int board_early_init_f(void)
>  /* -/W 32 Power resume control register 2 (3DG) */
>  #defineSYSC_PWRONCR2   0xE618010C
>
> -DECLARE_GLOBAL_DATA_PTR;
>  int board_init(void)
>  {
> /* adress of boot parameters */
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 20/23] ARM: rmobile: salvator-x: Count all DRAM in all slots

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Instead of counting only the DRAM in the first slot, count
> all the DRAM in all slots and report it accordingly.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c | 30 +-
>  1 file changed, 29 insertions(+), 1 deletion(-)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index 44e4006f5c..14385d7361 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -235,8 +235,36 @@ int board_mmc_init(bd_t *bis)
>
>  int dram_init(void)
>  {
> -   gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
> +   gd->ram_size = PHYS_SDRAM_1_SIZE;
> +#if (CONFIG_NR_DRAM_BANKS >= 2)
> +   gd->ram_size += PHYS_SDRAM_2_SIZE;
> +#endif
> +#if (CONFIG_NR_DRAM_BANKS >= 3)
> +   gd->ram_size += PHYS_SDRAM_3_SIZE;
> +#endif
> +#if (CONFIG_NR_DRAM_BANKS >= 4)
> +   gd->ram_size += PHYS_SDRAM_4_SIZE;
> +#endif
> +
> +   return 0;
> +}
>
> +int dram_init_banksize(void)
> +{
> +   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> +   gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
> +#if (CONFIG_NR_DRAM_BANKS >= 2)
> +   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
> +   gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
> +#endif
> +#if (CONFIG_NR_DRAM_BANKS >= 3)
> +   gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
> +   gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
> +#endif
> +#if (CONFIG_NR_DRAM_BANKS >= 4)
> +   gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
> +   gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
> +#endif
> return 0;
>  }
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 12/23] ARM: rmobile: salvator-x: Move OF_LIBFDT and CMD_FDT to board config

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Move these two Kconfig symbols to the salvator-x_defconfig.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  configs/salvator-x_defconfig   | 2 ++
>  include/configs/rcar-gen3-common.h | 2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
> index 8f9b5b5328..9fb0b898f1 100644
> --- a/configs/salvator-x_defconfig
> +++ b/configs/salvator-x_defconfig
> @@ -5,9 +5,11 @@ CONFIG_RCAR_GEN3=y
>  CONFIG_TARGET_SALVATOR_X=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_CMD_BOOTZ=y
> +CONFIG_CMD_FDT=y
>  CONFIG_R8A7795=y
>  # CONFIG_CMD_IMI is not set
>  # CONFIG_CMD_IMLS is not set
>  # CONFIG_CMD_XIMG is not set
>  CONFIG_DOS_PARTITION=y
>  # CONFIG_MMC is not set
> +CONFIG_OF_LIBFDT=y
> diff --git a/include/configs/rcar-gen3-common.h 
> b/include/configs/rcar-gen3-common.h
> index 304478af07..6bc8ab18b6 100644
> --- a/include/configs/rcar-gen3-common.h
> +++ b/include/configs/rcar-gen3-common.h
> @@ -17,7 +17,6 @@
>  #define CONFIG_CMD_EXT2
>  #define CONFIG_CMD_EXT4
>  #define CONFIG_CMD_EXT4_WRITE
> -#define CONFIG_CMD_FDT
>
>  #define CONFIG_REMAKE_ELF
>
> @@ -34,7 +33,6 @@
>  #define CONFIG_SETUP_MEMORY_TAGS
>  #define CONFIG_INITRD_TAG
>  #define CONFIG_CMDLINE_EDITING
> -#define CONFIG_OF_LIBFDT
>
>  #undef CONFIG_SHOW_BOOT_PROGRESS
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 13/23] ARM: rmobile: salvator-x: Set default device tree

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Set default device tree file in the salvator-x_defconfig
> and use it in the environment.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  configs/salvator-x_defconfig   | 1 +
>  include/configs/rcar-gen3-common.h | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
> index 9fb0b898f1..8cef6075e9 100644
> --- a/configs/salvator-x_defconfig
> +++ b/configs/salvator-x_defconfig
> @@ -3,6 +3,7 @@ CONFIG_ARCH_RMOBILE=y
>  CONFIG_SYS_MALLOC_F_LEN=0x2000
>  CONFIG_RCAR_GEN3=y
>  CONFIG_TARGET_SALVATOR_X=y
> +CONFIG_DEFAULT_FDT_FILE=r8a7795-salvator-x.dtb
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_CMD_BOOTZ=y
>  CONFIG_CMD_FDT=y
> diff --git a/include/configs/rcar-gen3-common.h 
> b/include/configs/rcar-gen3-common.h
> index 6bc8ab18b6..e73bc61856 100644
> --- a/include/configs/rcar-gen3-common.h
> +++ b/include/configs/rcar-gen3-common.h
> @@ -100,7 +100,7 @@
>
>  #define CONFIG_BOOTCOMMAND \
> "tftp 0x4808 Image; " \
> -   "tftp 0x4800 Image-r8a7795-salvator-x.dtb; " \
> +   "tftp 0x4800 Image-"CONFIG_DEFAULT_FDT_FILE"; " \
> "booti 0x4808 - 0x4800"
>
>  #endif /* __RCAR_GEN3_COMMON_H */
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 15/23] ARM: rmobile: salvator-x: Adjust UART clock

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> The UART uses internal SCIF clock except on R8A7795 H3 WS1.0 .
> Use the internal clock and ignore the early version of the chip.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  board/renesas/salvator-x/salvator-x.c | 4 ++--
>  include/configs/salvator-x.h  | 5 +++--
>  scripts/config_whitelist.txt  | 1 +
>  3 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/board/renesas/salvator-x/salvator-x.c 
> b/board/renesas/salvator-x/salvator-x.c
> index 038d6de610..3f2bebf74f 100644
> --- a/board/renesas/salvator-x/salvator-x.c
> +++ b/board/renesas/salvator-x/salvator-x.c
> @@ -109,8 +109,8 @@ void reset_cpu(ulong addr)
>  static const struct sh_serial_platdata serial_platdata = {
> .base = SCIF2_BASE,
> .type = PORT_SCIF,
> -   .clk = 14745600,/* 0xE1 */
> -   .clk_mode = EXT_CLK,
> +   .clk = CONFIG_SH_SCIF_CLK_FREQ,
> +   .clk_mode = INT_CLK,
>  };
>
>  U_BOOT_DEVICE(salvator_x_scif2) = {
> diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
> index 81a7226d62..94f62a7358 100644
> --- a/include/configs/salvator-x.h
> +++ b/include/configs/salvator-x.h
> @@ -20,7 +20,7 @@
>  #define CONFIG_SCIF_CONSOLE
>  #define CONFIG_CONS_SCIF2
>  #define CONFIG_CONS_INDEX  2
> -#define CONFIG_SH_SCIF_CLK_FREQCONFIG_SYS_CLK_FREQ
> +#define CONFIG_SH_SCIF_CLK_FREQCONFIG_S3D4_CLK_FREQ
>
>  /* [A] Hyper Flash */
>  /* use to RPC(SPI Multi I/O Bus Controller) */
> @@ -31,10 +31,11 @@
>  #define RCAR_XTAL_CLK  u
>  #define CONFIG_SYS_CLK_FREQRCAR_XTAL_CLK
>  /* ch0to2 CPclk, ch3to11 S3D2_PEREclk, ch12to14 S3D2_RTclk */
> -/* CPclk 16.66MHz, S3D2 133.33MHz  */
> +/* CPclk 16.66MHz, S3D2 133.33MHz , S3D4 66.66MHz  */
>  #define CONFIG_CP_CLK_FREQ (CONFIG_SYS_CLK_FREQ / 2)
>  #define CONFIG_PLL1_CLK_FREQ   (CONFIG_SYS_CLK_FREQ * 192 / 2)
>  #define CONFIG_S3D2_CLK_FREQ   (2u/2)
> +#define CONFIG_S3D4_CLK_FREQ   (2u/4)
>
>  /* Generic Timer Definitions (use in assembler source) */
>  #define COUNTER_FREQUENCY  0xFE502A/* 16.66MHz from CPclk */
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index 7646bb6842..2ab6217433 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -2396,6 +2396,7 @@ CONFIG_S3C24XX_TACLS
>  CONFIG_S3C24XX_TWRPH0
>  CONFIG_S3C24XX_TWRPH1
>  CONFIG_S3D2_CLK_FREQ
> +CONFIG_S3D4_CLK_FREQ
>  CONFIG_S5P
>  CONFIG_S5PC100
>  CONFIG_S5PC110
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 09/23] ARM: rmobile: Add R8A7796 support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add Kconfig entry for the R8A7796 RCar M3 SoC.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  arch/arm/mach-rmobile/Kconfig.64 |  3 +++
>  arch/arm/mach-rmobile/Makefile   |  1 +
>  arch/arm/mach-rmobile/include/mach/r8a7796.h | 39 
> 
>  arch/arm/mach-rmobile/include/mach/rmobile.h |  2 ++
>  arch/arm/mach-rmobile/memmap-r8a7796.c   | 30 +
>  include/configs/rcar-gen3-common.h   | 31 ++
>  6 files changed, 101 insertions(+), 5 deletions(-)
>  create mode 100644 arch/arm/mach-rmobile/include/mach/r8a7796.h
>  create mode 100644 arch/arm/mach-rmobile/memmap-r8a7796.c
>
> diff --git a/arch/arm/mach-rmobile/Kconfig.64 
> b/arch/arm/mach-rmobile/Kconfig.64
> index e0c27ed9c6..4ffc40edc6 100644
> --- a/arch/arm/mach-rmobile/Kconfig.64
> +++ b/arch/arm/mach-rmobile/Kconfig.64
> @@ -6,6 +6,9 @@ choice
>  config R8A7795
> bool "Renesas SoC R8A7795"
>
> +config R8A7796
> +   bool "Renesas SoC R8A7796"
> +
>  endchoice
>
>  choice
> diff --git a/arch/arm/mach-rmobile/Makefile b/arch/arm/mach-rmobile/Makefile
> index 3b56fcf96f..2aea527bae 100644
> --- a/arch/arm/mach-rmobile/Makefile
> +++ b/arch/arm/mach-rmobile/Makefile
> @@ -17,5 +17,6 @@ obj-$(CONFIG_R8A7792) += lowlevel_init_ca15.o 
> cpu_info-rcar.o pfc-r8a7792.o
>  obj-$(CONFIG_R8A7793) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7793.o
>  obj-$(CONFIG_R8A7794) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7794.o
>  obj-$(CONFIG_R8A7795) += lowlevel_init_gen3.o cpu_info-rcar.o pfc-r8a7795.o 
> memmap-r8a7795.o
> +obj-$(CONFIG_R8A7796) += lowlevel_init_gen3.o cpu_info-rcar.o pfc-r8a7796.o 
> memmap-r8a7796.o
>  obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o
>  obj-$(CONFIG_TMU_TIMER) += ../../sh/lib/time.o
> diff --git a/arch/arm/mach-rmobile/include/mach/r8a7796.h 
> b/arch/arm/mach-rmobile/include/mach/r8a7796.h
> new file mode 100644
> index 00..a7d1ba23bb
> --- /dev/null
> +++ b/arch/arm/mach-rmobile/include/mach/r8a7796.h
> @@ -0,0 +1,39 @@
> +/*
> + * arch/arm/include/asm/arch-rcar_gen3/r8a7796.h
> + * This file defines registers and value for r8a7796.
> + *
> + * Copyright (C) 2016 Renesas Electronics Corporation
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#ifndef __ASM_ARCH_R8A7796_H
> +#define __ASM_ARCH_R8A7796_H
> +
> +#include "rcar-gen3-base.h"
> +
> +/* Module stop control/status register bits */
> +#define MSTP0_BITS 0x0020
> +#define MSTP1_BITS 0x
> +#define MSTP2_BITS 0x340E2FDC
> +#define MSTP3_BITS 0xFFDF
> +#define MSTP4_BITS 0x8184
> +#define MSTP5_BITS 0xC3FF
> +#define MSTP6_BITS 0x
> +#define MSTP7_BITS 0x
> +#define MSTP8_BITS 0x01F1FFF7
> +#define MSTP9_BITS 0xFFFE
> +#define MSTP10_BITS0xFFFEFFE0
> +#define MSTP11_BITS0x00B7
> +
> +/* SDHI */
> +#define CONFIG_SYS_SH_SDHI0_BASE 0xEE10
> +#define CONFIG_SYS_SH_SDHI1_BASE 0xEE12
> +#define CONFIG_SYS_SH_SDHI2_BASE 0xEE14/* either MMC0 */
> +#define CONFIG_SYS_SH_SDHI3_BASE 0xEE16/* either MMC1 */
> +#define CONFIG_SYS_SH_SDHI_NR_CHANNEL 4
> +
> +/* SH-I2C */
> +#define CONFIG_SYS_I2C_SH_BASE00xE60B
> +
> +#endif /* __ASM_ARCH_R8A7796_H */
> diff --git a/arch/arm/mach-rmobile/include/mach/rmobile.h 
> b/arch/arm/mach-rmobile/include/mach/rmobile.h
> index 22d97b19ab..654349b0b3 100644
> --- a/arch/arm/mach-rmobile/include/mach/rmobile.h
> +++ b/arch/arm/mach-rmobile/include/mach/rmobile.h
> @@ -18,6 +18,8 @@
>  #include 
>  #elif defined(CONFIG_R8A7795)
>  #include 
> +#elif defined(CONFIG_R8A7796)
> +#include 
>  #else
>  #error "SOC Name not defined"
>  #endif
> diff --git a/arch/arm/mach-rmobile/memmap-r8a7796.c 
> b/arch/arm/mach-rmobile/memmap-r8a7796.c
> new file mode 100644
> index 00..648743d51e
> --- /dev/null
> +++ b/arch/arm/mach-rmobile/memmap-r8a7796.c
> @@ -0,0 +1,30 @@
> +/*
> + * Copyright (C) 2017 Marek Vasut 
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +
> +static struct mm_region r8a7796_mem_map[] = {
> +   {
> +   .virt = 0x0UL,
> +   .phys = 0x0UL,
> +   .size = 0xe000UL,
> +   .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
> +PTE_BLOCK_INNER_SHARE
> +   }, {
> +   .virt = 0xe000UL,
> +   .phys = 0xe000UL,
> +   .size = 0xe000UL,
> +   .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
> +PTE_BLOCK_NON_SHARE |
> +PTE_BLOCK_PXN | PTE_BLOCK_UXN
> +   }, {
> +   /* List terminator */
> +   0,
> +   }
> +};
> +
> +struct mm_region *mem_map = r8a7796_mem_map;
> diff --git a/include/configs/rc

Re: [U-Boot] [PATCH 07/23] ARM: rmobile: Add R8A7796 into the CPU table

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add entry for the R8A7796 RCar M3 SoC into the CPU info table.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  arch/arm/mach-rmobile/cpu_info.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-rmobile/cpu_info.c 
> b/arch/arm/mach-rmobile/cpu_info.c
> index 208228ff45..faa53197d5 100644
> --- a/arch/arm/mach-rmobile/cpu_info.c
> +++ b/arch/arm/mach-rmobile/cpu_info.c
> @@ -57,6 +57,7 @@ static const struct {
> { 0x4B, "R8A7793" },
> { 0x4C, "R8A7794" },
> { 0x4F, "R8A7795" },
> +   { 0x52, "R8A7796" },
> { 0x0, "CPU" },
>  };
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 10/23] ARM: rmobile: Allow R8A7796 Salvator-X configuration

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> The Salvator-X can have both H3 and M3 CPU on it, drop the
> select R8A7795 to allow both configurations.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  arch/arm/mach-rmobile/Kconfig.64 | 3 +--
>  configs/salvator-x_defconfig | 1 +
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-rmobile/Kconfig.64 
> b/arch/arm/mach-rmobile/Kconfig.64
> index 4ffc40edc6..5db93ac8d6 100644
> --- a/arch/arm/mach-rmobile/Kconfig.64
> +++ b/arch/arm/mach-rmobile/Kconfig.64
> @@ -17,9 +17,8 @@ choice
>
>  config TARGET_SALVATOR_X
> bool "Salvator-X board"
> -   select R8A7795
> help
> -  Support for Renesas R-Car Gen3 R8a7795 platform
> +  Support for Renesas R-Car Gen3 platform
>
>  endchoice
>
> diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
> index b1500296da..8f9b5b5328 100644
> --- a/configs/salvator-x_defconfig
> +++ b/configs/salvator-x_defconfig
> @@ -5,6 +5,7 @@ CONFIG_RCAR_GEN3=y
>  CONFIG_TARGET_SALVATOR_X=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_CMD_BOOTZ=y
> +CONFIG_R8A7795=y
>  # CONFIG_CMD_IMI is not set
>  # CONFIG_CMD_IMLS is not set
>  # CONFIG_CMD_XIMG is not set
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 05/23] ARM: rmobile: Make the Gen3 SoC configurable

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Allow selecting the Gen3 SoC in preparation for RCar M3 .
> No functional change.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  arch/arm/mach-rmobile/Kconfig.64 | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rmobile/Kconfig.64 
> b/arch/arm/mach-rmobile/Kconfig.64
> index f748c33a3e..e0c27ed9c6 100644
> --- a/arch/arm/mach-rmobile/Kconfig.64
> +++ b/arch/arm/mach-rmobile/Kconfig.64
> @@ -1,7 +1,12 @@
>  if RCAR_GEN3
>
> +choice
> +   prompt "Select Target SoC"
> +
>  config R8A7795
> -   bool
> +   bool "Renesas SoC R8A7795"
> +
> +endchoice
>
>  choice
> prompt "Renesus ARM64 SoCs board select"
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 06/23] ARM: rmobile: Add R8A7795 into the CPU table

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Add entry for the R8A7795 RCar H3 SoC into the CPU info table.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  arch/arm/mach-rmobile/cpu_info.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-rmobile/cpu_info.c 
> b/arch/arm/mach-rmobile/cpu_info.c
> index 129ab0c0f7..208228ff45 100644
> --- a/arch/arm/mach-rmobile/cpu_info.c
> +++ b/arch/arm/mach-rmobile/cpu_info.c
> @@ -56,6 +56,7 @@ static const struct {
> { 0x4A, "R8A7792" },
> { 0x4B, "R8A7793" },
> { 0x4C, "R8A7794" },
> +   { 0x4F, "R8A7795" },
> { 0x0, "CPU" },
>  };
>
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 08/23] ARM: rmobile: Handle R8A7796 r1.1 in the PRR code

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> The R8A7796 r1.1 reports itself as r2.0 , add quirk into the
> PRR code to fix this report.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  arch/arm/mach-rmobile/cpu_info-rcar.c | 19 ---
>  1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-rmobile/cpu_info-rcar.c 
> b/arch/arm/mach-rmobile/cpu_info-rcar.c
> index 42ee30fbe7..c373eef73d 100644
> --- a/arch/arm/mach-rmobile/cpu_info-rcar.c
> +++ b/arch/arm/mach-rmobile/cpu_info-rcar.c
> @@ -8,7 +8,10 @@
>  #include 
>  #include 
>
> -#define PRR 0xFF44
> +#define PRR0xFF44
> +#define PRR_MASK   0x7fff
> +#define R8A7796_REV_1_00x5200
> +#define R8A7796_REV_1_10x5210
>
>  u32 rmobile_get_cpu_type(void)
>  {
> @@ -17,10 +20,20 @@ u32 rmobile_get_cpu_type(void)
>
>  u32 rmobile_get_cpu_rev_integer(void)
>  {
> -   return ((readl(PRR) & 0x00F0) >> 4) + 1;
> +   const u32 prr = readl(PRR);
> +
> +   if ((prr & PRR_MASK) == R8A7796_REV_1_1)
> +   return 1;
> +   else
> +   return ((prr & 0x00F0) >> 4) + 1;
>  }
>
>  u32 rmobile_get_cpu_rev_fraction(void)
>  {
> -   return readl(PRR) & 0x000F;
> +   const u32 prr = readl(PRR);
> +
> +   if ((prr & PRR_MASK) == R8A7796_REV_1_1)
> +   return 1;
> +   else
> +   return prr & 0x000F;
>  }
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 04/23] ARM: rmobile: Update link address to match latest BL2

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> Update the CONFIG_SYS_TEXT_BASE to match BL2 Rev.1.0.9 and newer,
> which loads the U-Boot to 0x5000 .
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  include/configs/rcar-gen3-common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/configs/rcar-gen3-common.h 
> b/include/configs/rcar-gen3-common.h
> index 056aea3fdb..c87d31950f 100644
> --- a/include/configs/rcar-gen3-common.h
> +++ b/include/configs/rcar-gen3-common.h
> @@ -52,7 +52,7 @@
>  #define CONFIG_SYS_BAUDRATE_TABLE  { 115200, 38400 }
>
>  /* MEMORY */
> -#define CONFIG_SYS_TEXT_BASE   0x4900
> +#define CONFIG_SYS_TEXT_BASE   0x5000
>  #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_TEXT_BASE + 
> 0x7fff0)
>
>  #define CONFIG_SYS_SDRAM_BASE  (0x4800)
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 03/23] ARM: rmobile: Zap RCAR_GEN3_EXTRAM_BOOT

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:57 GMT+09:00 Marek Vasut :
> This Kconfig option is not used on any board, so drop it.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  arch/arm/mach-rmobile/Kconfig.64 | 5 -
>  1 file changed, 5 deletions(-)
>
> diff --git a/arch/arm/mach-rmobile/Kconfig.64 
> b/arch/arm/mach-rmobile/Kconfig.64
> index 2a7eeba828..f748c33a3e 100644
> --- a/arch/arm/mach-rmobile/Kconfig.64
> +++ b/arch/arm/mach-rmobile/Kconfig.64
> @@ -18,11 +18,6 @@ endchoice
>  config SYS_SOC
> default "rmobile"
>
> -config RCAR_GEN3_EXTRAM_BOOT
> -   bool "Enable boot from RAM"
> -   depends on TARGET_SALVATOR_X
> -   default n
> -
>  source "board/renesas/salvator-x/Kconfig"
>
>  endif
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] serial: sh: Add r8a7796 support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:55 GMT+09:00 Marek Vasut :
> From: Hiroyuki Yokoyama 
>
> Signed-off-by: Hiroyuki Yokoyama 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> ---
>  drivers/serial/serial_sh.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/serial/serial_sh.h b/drivers/serial/serial_sh.h
> index 348f544d0a..4d27122243 100644
> --- a/drivers/serial/serial_sh.h
> +++ b/drivers/serial/serial_sh.h
> @@ -226,7 +226,8 @@ struct uart_port {
>  # define SCSCR_INIT(port)  0x38/* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
>  #elif defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
> defined(CONFIG_R8A7792) || defined(CONFIG_R8A7793) || \
> -   defined(CONFIG_R8A7794) || defined(CONFIG_R8A7795)
> +   defined(CONFIG_R8A7794) || defined(CONFIG_R8A7795) || \
> +   defined(CONFIG_R8A7796)
>  # if defined(CONFIG_SCIF_A)
>  #  define SCIF_ORER0x0200
>  # else
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] net: ravb: Add Renesas Ethernet RAVB driver

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:54 GMT+09:00 Marek Vasut :
> Add driver for the Renesas Ethernet AVB block found in RCar H3/M3.
>
> Signed-off-by: Marek Vasut 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> Cc: Tom Rini 
> Cc: Joe Hershberger 
> Based on work of:
> Hiroyuki Yokoyama 
> Takeshi Kihara 
> Kazuya Mizuguchi 
> ---
>  drivers/net/Kconfig  |   8 +
>  drivers/net/Makefile |   1 +
>  drivers/net/ravb.c   | 601 
> +++
>  3 files changed, 610 insertions(+)
>  create mode 100644 drivers/net/ravb.c
>
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 9cd0d94cbd..d7a33d69fb 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -225,4 +225,12 @@ config GMAC_ROCKCHIP
>   This driver provides Rockchip SoCs network support based on the
>   Synopsys Designware driver.
>
> +config RENESAS_RAVB
> +   bool "Renesas Ethernet AVB MAC"
> +   depends on DM_ETH && RCAR_GEN3
> +   select PHYLIB
> +   help
> + This driver implements support for the Ethernet AVB block in
> + Renesas M3 and H3 SoCs.
> +
>  endif # NETDEVICES
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index aedb2cc90d..0aaac6bd81 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -56,6 +56,7 @@ obj-$(CONFIG_RTL8169) += rtl8169.o
>  obj-$(CONFIG_ETH_SANDBOX) += sandbox.o
>  obj-$(CONFIG_ETH_SANDBOX_RAW) += sandbox-raw.o
>  obj-$(CONFIG_SH_ETHER) += sh_eth.o
> +obj-$(CONFIG_RENESAS_RAVB) += ravb.o
>  obj-$(CONFIG_SMC9) += smc9.o
>  obj-$(CONFIG_SMC911X) += smc911x.o
>  obj-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
> diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
> new file mode 100644
> index 00..ab45a31d6a
> --- /dev/null
> +++ b/drivers/net/ravb.c
> @@ -0,0 +1,601 @@
> +/*
> + * drivers/net/ravb.c
> + * This file is driver for Renesas Ethernet AVB.
> + *
> + * Copyright (C) 2015-2017  Renesas Electronics Corporation
> + *
> + * Based on the SuperH Ethernet driver.
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* Registers */
> +#define RAVB_REG_CCC   0x000
> +#define RAVB_REG_DBAT  0x004
> +#define RAVB_REG_CSR   0x00C
> +#define RAVB_REG_APSR  0x08C
> +#define RAVB_REG_RCR   0x090
> +#define RAVB_REG_TGC   0x300
> +#define RAVB_REG_TCCR  0x304
> +#define RAVB_REG_RIC0  0x360
> +#define RAVB_REG_RIC1  0x368
> +#define RAVB_REG_RIC2  0x370
> +#define RAVB_REG_TIC   0x378
> +#define RAVB_REG_ECMR  0x500
> +#define RAVB_REG_RFLR  0x508
> +#define RAVB_REG_ECSIPR0x518
> +#define RAVB_REG_PIR   0x520
> +#define RAVB_REG_GECMR 0x5b0
> +#define RAVB_REG_MAHR  0x5c0
> +#define RAVB_REG_MALR  0x5c8
> +
> +#define CCC_OPC_CONFIG BIT(0)
> +#define CCC_OPC_OPERATION  BIT(1)
> +#define CCC_BOCBIT(20)
> +
> +#define CSR_OPS0x000F
> +#define CSR_OPS_CONFIG BIT(1)
> +
> +#define TCCR_TSRQ0 BIT(0)
> +
> +#define RFLR_RFL_MIN   0x05EE
> +
> +#define PIR_MDIBIT(3)
> +#define PIR_MDOBIT(2)
> +#define PIR_MMDBIT(1)
> +#define PIR_MDCBIT(0)
> +
> +#define ECMR_TRCCM BIT(26)
> +#define ECMR_RZPF  BIT(20)
> +#define ECMR_PFR   BIT(18)
> +#define ECMR_RXF   BIT(17)
> +#define ECMR_REBIT(6)
> +#define ECMR_TEBIT(5)
> +#define ECMR_DMBIT(1)
> +#define ECMR_CHG_DM(ECMR_TRCCM | ECMR_RZPF | ECMR_PFR | ECMR_RXF)
> +
> +/* DMA Descriptors */
> +#define RAVB_NUM_BASE_DESC 16
> +#define RAVB_NUM_TX_DESC   8
> +#define RAVB_NUM_RX_DESC   8
> +
> +#define RAVB_TX_QUEUE_OFFSET   0
> +#define RAVB_RX_QUEUE_OFFSET   4
> +
> +#define RAVB_DESC_DT(n)((n) << 28)
> +#define RAVB_DESC_DT_FSINGLE   RAVB_DESC_DT(0x7)
> +#define RAVB_DESC_DT_LINKFIX   RAVB_DESC_DT(0x9)
> +#define RAVB_DESC_DT_EOS   RAVB_DESC_DT(0xa)
> +#define RAVB_DESC_DT_FEMPTYRAVB_DESC_DT(0xc)
> +#define RAVB_DESC_DT_EEMPTYRAVB_DESC_DT(0x3)
> +#define RAVB_DESC_DT_MASK  RAVB_DESC_DT(0xf)
> +
> +#define RAVB_DESC_DS(n)(((n) & 0xfff) << 0)
> +#define RAVB_DESC_DS_MASK  0xfff
> +
> +#define RAVB_RX_DESC_MSC_MCBIT(23)
> +#define RAVB_RX_DESC_MSC_CEEF  BIT(22)
> +#define RAVB_RX_DESC_MSC_CRL   BIT(21)
> +#define RAVB_RX_DESC_MSC_FRE   BIT(20)
> +#define RAVB_RX_DESC_MSC_RTLF  BIT(19)
> +#define RAVB_RX_DESC_MSC_RTSF  B

Re: [U-Boot] [PATCH] gpio: rcar_gen3: Fix GPIO read support

2017-05-13 Thread Nobuhiro Iwamatsu
Applied to rmobile branch, thanks!

2017-05-13 22:48 GMT+09:00 Marek Vasut :
> From: Kouei Abe 
>
> This patch fixes to read the GPIO status after confirming the
> INOUT setting.
>
> Signed-off-by: Kouei Abe 
> Signed-off-by: Hiroyuki Yokoyama 
> Cc: Hiroyuki Yokoyama 
> Cc: Nobuhiro Iwamatsu 
> Cc: Tom Rini 
> ---
>  drivers/gpio/sh_pfc.c | 17 +++--
>  1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/sh_pfc.c b/drivers/gpio/sh_pfc.c
> index a0eac137c2..ad8da9ef28 100644
> --- a/drivers/gpio/sh_pfc.c
> +++ b/drivers/gpio/sh_pfc.c
> @@ -66,17 +66,18 @@ static void gpio_write_raw_reg(void *mapped_reg,
>  }
>
>  static int gpio_read_bit(struct pinmux_data_reg *dr,
> +unsigned long offset,
>  unsigned long in_pos)
>  {
> unsigned long pos;
>
> pos = dr->reg_width - (in_pos + 1);
>
> -   debug("read_bit: addr = %lx, pos = %ld, "
> -"r_width = %ld\n", dr->reg, pos, dr->reg_width);
> +   debug("read_bit: addr = %lx, pos = %ld, r_width = %ld\n",
> + dr->reg + offset, pos, dr->reg_width);
>
> -   return
> -   (gpio_read_raw_reg(dr->mapped_reg + 0x4, dr->reg_width) >> pos) & 
> 1;
> +   return (gpio_read_raw_reg(dr->mapped_reg + offset,
> + dr->reg_width) >> pos) & 1;
>  }
>
>  static void gpio_write_bit(struct pinmux_data_reg *dr,
> @@ -559,12 +560,16 @@ static int sh_gpio_direction_output(unsigned offset, 
> int value)
>  static int sh_gpio_get_value(struct pinmux_info *gpioc, unsigned gpio)
>  {
> struct pinmux_data_reg *dr = NULL;
> -   int bit = 0;
> +   int bit = 0, offset = 0;
>
> if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0)
> return -1;
> +#if defined(CONFIG_RCAR_GEN3)
> +   if ((gpioc->gpios[gpio].flags & PINMUX_FLAG_TYPE) == 
> PINMUX_TYPE_INPUT)
> +   offset += 4;
> +#endif
>
> -   return gpio_read_bit(dr, bit);
> +   return gpio_read_bit(dr, offset, bit);
>  }
>
>  static int sh_gpio_get(unsigned offset)
> --
> 2.11.0
>



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] regulator: pwm: Fix handling of missing init voltage

2017-05-13 Thread Mark Kettenis
Since priv->init_voltage is an unsigned integer it can never be
negative.  So the current code fails to detect a missing
'regulator-init-microvolt' property and instead misconfigures the
PWM device.  Fix this by making the relevant members of
'struct pwm_regulator_info' signed integers.

Signed-off-by: Mark Kettenis 
---

The current device tree for the Firefly-RK3399 does not have a
'regulator-init-microvolt' property for the 'vdd-log' regulator.
Without this fix U-Boot configures a voltage that is too low which
causes the Ethernet interface to drop almost all packets.

 drivers/power/regulator/pwm_regulator.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/power/regulator/pwm_regulator.c 
b/drivers/power/regulator/pwm_regulator.c
index a6c9fccd68..00a7cca7f7 100644
--- a/drivers/power/regulator/pwm_regulator.c
+++ b/drivers/power/regulator/pwm_regulator.c
@@ -32,13 +32,13 @@ struct pwm_regulator_info {
bool polarity;
struct udevice *pwm;
/* initialize voltage of regulator */
-   unsigned int init_voltage;
+   int init_voltage;
/* the maximum voltage of regulator */
-   unsigned int max_voltage;
+   int max_voltage;
/* the minimum voltage of regulator */
-   unsigned int min_voltage;
+   int min_voltage;
/* the current voltage of regulator */
-   unsigned int volt_uV;
+   int volt_uV;
 };
 
 static int pwm_regulator_enable(struct udevice *dev, bool enable)
-- 
2.13.0

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


Re: [U-Boot] i.MX6: u-boot,dm-pre-reloc block U-Boot

2017-05-13 Thread Jagan Teki
Hi All,

On Thu, May 11, 2017 at 1:40 PM, Jagan Teki  wrote:
> On Thu, May 11, 2017 at 7:39 AM, Lokesh Vutla  wrote:
>>
>>
>> On 5/11/2017 12:52 AM, Jagan Teki wrote:
>>> Hi Lokesh,
>>>
>>> On Tue, May 9, 2017 at 10:03 PM, Jagan Teki  
>>> wrote:
 On Tue, May 9, 2017 at 8:54 PM, Lokesh Vutla  wrote:
>
>
> On Tuesday 09 May 2017 08:37 PM, Jagan Teki wrote:
>> On Tue, May 9, 2017 at 7:49 PM, Lokesh Vutla  wrote:
>>>
>>>
>>> On Tuesday 09 May 2017 04:35 PM, Jagan Teki wrote:
 Hi All,

 I'm trying to add SPL_OF_CONTROL for i.MX6UL, with usdhc1 and gpio1
 nodes are marking as "u-boot,dm-pre-reloc" like
>>>
>>> Did you try "u-boot,dm-spl" instead?
>>
>> Yes, no change.
>
> Hmm..Ideally this should have taken effect :(
>
>>
>>>
>>>

 --- a/arch/arm/dts/imx6ul.dtsi
 +++ b/arch/arm/dts/imx6ul.dtsi
 @@ -129,6 +129,7 @@
 };

 soc {
 +   u-boot,dm-pre-reloc;
 #address-cells = <1>;
 #size-cells = <1>;
 compatible = "simple-bus";
 @@ -180,6 +181,7 @@
 };

 aips1: aips-bus@0200 {
 +   u-boot,dm-pre-reloc;
 compatible = "fsl,aips-bus", "simple-bus";
 #address-cells = <1>;
 #size-cells = <1>;
 @@ -405,6 +407,7 @@
 };

 gpio1: gpio@0209c000 {
 +   u-boot,dm-pre-reloc;
 compatible = "fsl,imx6ul-gpio",
 "fsl,imx35-gpio";
 reg = <0x0209c000 0x4000>;
 interrupts = >>> IRQ_TYPE_LEVEL_HIGH>,
 @@ -724,6 +727,7 @@
 };

 aips2: aips-bus@0210 {
 +   u-boot,dm-pre-reloc;
 compatible = "fsl,aips-bus", "simple-bus";
 #address-cells = <1>;
 #size-cells = <1>;
 @@ -781,6 +785,7 @@
 };

 usdhc1: usdhc@0219 {
 +   u-boot,dm-pre-reloc;
 compatible = "fsl,imx6ul-usdhc",
 "fsl,imx6sx-usdhc";
 reg = <0x0219 0x4000>;
 interrupts = >>> IRQ_TYPE_LEVEL_HIGH>;

 SPL is loading fine from MMC but block the U-Boot that means we can't
 see U-Boot log on console.
>>>
>>> Any chance you can try enabling early debug? Since enabling pre-reloc is
>>> going for a toss, I guess your malloc size is going for a toss. Can you
>>> try increasing initial malloc size?
>>
>> Yes, I've increased malloc CONFIG_SYS_MALLOC_LEN from 16M to upto 128M
>> but no change.
>
> No, try CONFIG_SYS_MALLOC_F_LEN=0x2000.
>
> Is it possible to check where exactly is it hanged?

 Yes, it hangs while relocating dram[1] and I also observed the main
 bus nodes are are 'not found' which I haven't see before and these are
 marked 'u-boot,dm-spl'

 uclass_find_device_by_seq: 0 -1
 uclass_find_device_by_seq: 0 0
- -1 -1 'soc'
- -1 -1 'aips-bus@0200'
- -1 -1 'aips-bus@0210'
- not found
>>>
>>> Any clue, I still investigating. Look like the node seq numbers which
>>> are marked as "u-boot,dm-spl" in SPL are checking before relocating in
>>> U-Boot, and they seems not found.
>>>
>>> Interestingly I couldn't see any panic or exception, the code ends
>>> board_f last line.
>>
>> Manfred posted a patch[1] stating a similar issue. See if it fixes it?
>
> It's not. I think this hanged at relocation assembly relocate_code or
> relocate_vectors.

Any help on this, this look relocation is not possible in U-Boot with
'u-boot,dm-pre-reloc' and incidentally removing property from /soc all
works fine.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 08/12] i2c: Finish dropping use of CONFIG_I2C_HARD

2017-05-13 Thread Tom Rini
On Fri, May 12, 2017 at 09:09:56PM -0600, Simon Glass wrote:

> Drop use of this long-deprecated option.
> 
> Signed-off-by: Simon Glass 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v3 07/12] i2c: omap: Modify code to work without CONFIG_I2C_HARD

2017-05-13 Thread Tom Rini
On Fri, May 12, 2017 at 09:09:55PM -0600, Simon Glass wrote:

> Drop use of this long-deprecated option.
> 
> Signed-off-by: Simon Glass 
> Suggested-by: Lokesh Vutla 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [linux-sunxi] Re: [PATCH 3/3] sunxi: video: Add H3/H5 TV out driver

2017-05-13 Thread Chen-Yu Tsai
On Sat, May 13, 2017 at 11:02 PM,   wrote:
> 在 2017-05-13 00:06,Maxime Ripard 写道:
>>
>> Hi Jernej,
>>
>> The patch content looks fine, but there's a few things that would need
>> to be addressed.
>>
>> On Wed, May 10, 2017 at 06:46:30PM +0200, Jernej Skrabec wrote:
>>>
>>> This commit adds support for TV (composite) output.
>>>
>>> Signed-off-by: Jernej Skrabec 
>>> ---
>>>
>>>  arch/arm/include/asm/arch-sunxi/cpu_sun4i.h |  10 ++
>>>  arch/arm/include/asm/arch-sunxi/display2.h  |  17 +++
>>>  arch/arm/include/asm/arch-sunxi/tve.h   |  17 ++-
>>>  drivers/video/sunxi/Makefile|   2 +-
>>>  drivers/video/sunxi/sunxi_de2.c |  60 ---
>>>  drivers/video/sunxi/sunxi_tve.c | 156
>>> 
>>>  drivers/video/sunxi/tve.c   |   6 +-
>>
>>
>> The difference between sunxi_tve and tve is not really obvious. What
>> about calling sunxi_tve tve-uclass, or something like that?
>>
>>>  7 files changed, 251 insertions(+), 17 deletions(-)
>>>  create mode 100644 drivers/video/sunxi/sunxi_tve.c
>>>
>>> diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
>>> b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
>>> index 6aa5e91ada..2419062d45 100644
>>> --- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
>>> +++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
>>> @@ -34,7 +34,9 @@
>>>  #define SUNXI_MS_BASE  0x01c07000
>>>  #define SUNXI_TVD_BASE 0x01c08000
>>>  #define SUNXI_CSI0_BASE0x01c09000
>>> +#ifndef CONFIG_MACH_SUNXI_H3_H5
>>>  #define SUNXI_TVE0_BASE0x01c0a000
>>> +#endif
>>
>>
>> This should be part of a seperate patch.
>>
>>>  #define SUNXI_EMAC_BASE0x01c0b000
>>>  #define SUNXI_LCD0_BASE0x01c0C000
>>>  #define SUNXI_LCD1_BASE0x01c0d000
>>> @@ -161,10 +163,18 @@ defined(CONFIG_MACH_SUN50I)
>>>  /* module sram */
>>>  #define SUNXI_SRAM_C_BASE  0x01d0
>>>
>>> +#ifndef CONFIG_MACH_SUN8I_H3
>>>  #define SUNXI_DE_FE0_BASE  0x01e0
>>> +#else
>>> +#define SUNXI_TVE0_BASE0x01e0
>>> +#endif
>>
>>
>> This one should be in that other patch
>>
>>>  #define SUNXI_DE_FE1_BASE  0x01e2
>>>  #define SUNXI_DE_BE0_BASE  0x01e6
>>> +#ifndef CONFIG_MACH_SUN50I_H5
>>>  #define SUNXI_DE_BE1_BASE  0x01e4
>>> +#else
>>> +#define SUNXI_TVE0_BASE0x01e4
>>> +#endif
>>
>>
>> And that one too.
>>
>>>  #define SUNXI_MP_BASE  0x01e8
>>>  #define SUNXI_AVG_BASE 0x01ea
>>>
>>> diff --git a/arch/arm/include/asm/arch-sunxi/display2.h
>>> b/arch/arm/include/asm/arch-sunxi/display2.h
>>> index b5875f9605..359cacd90b 100644
>>> --- a/arch/arm/include/asm/arch-sunxi/display2.h
>>> +++ b/arch/arm/include/asm/arch-sunxi/display2.h
>>> @@ -90,6 +90,23 @@ struct de_ui {
>>> u32 ovl_size;
>>>  };
>>>
>>> +struct de_csc {
>>> +   u32 csc_ctl;
>>> +   u8 res[0xc];
>>> +   u32 coef11;
>>> +   u32 coef12;
>>> +   u32 coef13;
>>> +   u32 coef14;
>>> +   u32 coef21;
>>> +   u32 coef22;
>>> +   u32 coef23;
>>> +   u32 coef24;
>>> +   u32 coef31;
>>> +   u32 coef32;
>>> +   u32 coef33;
>>> +   u32 coef34;
>>> +};
>>> +
>>
>>
>> This should be in another patch (let's call it patch 2)
>>
>>>  /*
>>>   * DE register constants.
>>>   */
>>> diff --git a/arch/arm/include/asm/arch-sunxi/tve.h
>>> b/arch/arm/include/asm/arch-sunxi/tve.h
>>> index 41a14a68e4..ff34bbbc12 100644
>>> --- a/arch/arm/include/asm/arch-sunxi/tve.h
>>> +++ b/arch/arm/include/asm/arch-sunxi/tve.h
>>> @@ -45,7 +45,9 @@ struct sunxi_tve_reg {
>>> u32 csc_reg1;   /* 0x044 */
>>> u32 csc_reg2;   /* 0x048 */
>>> u32 csc_reg3;   /* 0x04c */
>>> -   u8 res1[0xb0];  /* 0x050 */
>>> +   u8 res1[0xa8];  /* 0x050 */
>>> +   u32 auto_detect_cfg0;   /* 0x0f8 */
>>> +   u32 auto_detect_cfg1;   /* 0x0fc */
>>> u32 color_burst;/* 0x100 */
>>> u32 vsync_num;  /* 0x104 */
>>> u32 notch_freq; /* 0x108 */
>>> @@ -62,6 +64,10 @@ struct sunxi_tve_reg {
>>> u32 slave_para; /* 0x134 */
>>> u32 cfg1;   /* 0x138 */
>>> u32 cfg2;   /* 0x13c */
>>> +   u8 res2[0x1c4]; /* 0x140 */
>>> +   u32 calibration;/* 0x304 */
>>> +   u8 res3[0x4];   /* 0x308 */
>>> +   u32 unknown3;   /* 0x30c */
>>
>>
>> And these yet another one (patch 3)
>>
>>>  };
>>>
>>>  /*
>>> @@ -79,12 +85,14 @@ struct sunxi_tve_reg {
>>>  #define SUNXI_TVE_CFG0_PAL 0x07030001
>>>  #define SUNXI_TVE_CFG0_NTSC  

Re: [U-Boot] [PATCH 17/17] Kconfig: OMAP: USB: Migrate CONFIG_USB_EHCI_OMAP to Kconfig

2017-05-13 Thread Tom Rini
On Sat, May 13, 2017 at 12:51:43PM +0200, Marek Vasut wrote:
> On 05/13/2017 04:33 AM, Tom Rini wrote:
> > Follow the exiting logic for the i.MX options when migrating this
> > option.
> > 
> > Cc: Marek Vasut 
> > Signed-off-by: Tom Rini 
> 
> Reviewed-by: Marek Vasut 
> 
> Any reason why you only converted the OMAP and iMX6 stuff and not the
> rest, like MXC, MXS etc. ?

Series size, and the i.MX6 conversions were just cleaning up headers
that already had the option converted.  Most of the others (marvell
being the notable to me exception since I had to iterate over fixing
Kirkwood then Orion5x) had been done.  I do plan more conversions.

-- 
Tom


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


Re: [U-Boot] [linux-sunxi] Re: [PATCH 3/3] sunxi: video: Add H3/H5 TV out driver

2017-05-13 Thread icenowy

在 2017-05-13 00:06,Maxime Ripard 写道:

Hi Jernej,

The patch content looks fine, but there's a few things that would need
to be addressed.

On Wed, May 10, 2017 at 06:46:30PM +0200, Jernej Skrabec wrote:

This commit adds support for TV (composite) output.

Signed-off-by: Jernej Skrabec 
---

 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h |  10 ++
 arch/arm/include/asm/arch-sunxi/display2.h  |  17 +++
 arch/arm/include/asm/arch-sunxi/tve.h   |  17 ++-
 drivers/video/sunxi/Makefile|   2 +-
 drivers/video/sunxi/sunxi_de2.c |  60 ---
 drivers/video/sunxi/sunxi_tve.c | 156 


 drivers/video/sunxi/tve.c   |   6 +-


The difference between sunxi_tve and tve is not really obvious. What
about calling sunxi_tve tve-uclass, or something like that?


 7 files changed, 251 insertions(+), 17 deletions(-)
 create mode 100644 drivers/video/sunxi/sunxi_tve.c

diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h 
b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h

index 6aa5e91ada..2419062d45 100644
--- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
@@ -34,7 +34,9 @@
 #define SUNXI_MS_BASE  0x01c07000
 #define SUNXI_TVD_BASE 0x01c08000
 #define SUNXI_CSI0_BASE0x01c09000
+#ifndef CONFIG_MACH_SUNXI_H3_H5
 #define SUNXI_TVE0_BASE0x01c0a000
+#endif


This should be part of a seperate patch.


 #define SUNXI_EMAC_BASE0x01c0b000
 #define SUNXI_LCD0_BASE0x01c0C000
 #define SUNXI_LCD1_BASE0x01c0d000
@@ -161,10 +163,18 @@ defined(CONFIG_MACH_SUN50I)
 /* module sram */
 #define SUNXI_SRAM_C_BASE  0x01d0

+#ifndef CONFIG_MACH_SUN8I_H3
 #define SUNXI_DE_FE0_BASE  0x01e0
+#else
+#define SUNXI_TVE0_BASE0x01e0
+#endif


This one should be in that other patch


 #define SUNXI_DE_FE1_BASE  0x01e2
 #define SUNXI_DE_BE0_BASE  0x01e6
+#ifndef CONFIG_MACH_SUN50I_H5
 #define SUNXI_DE_BE1_BASE  0x01e4
+#else
+#define SUNXI_TVE0_BASE0x01e4
+#endif


And that one too.


 #define SUNXI_MP_BASE  0x01e8
 #define SUNXI_AVG_BASE 0x01ea

diff --git a/arch/arm/include/asm/arch-sunxi/display2.h 
b/arch/arm/include/asm/arch-sunxi/display2.h

index b5875f9605..359cacd90b 100644
--- a/arch/arm/include/asm/arch-sunxi/display2.h
+++ b/arch/arm/include/asm/arch-sunxi/display2.h
@@ -90,6 +90,23 @@ struct de_ui {
u32 ovl_size;
 };

+struct de_csc {
+   u32 csc_ctl;
+   u8 res[0xc];
+   u32 coef11;
+   u32 coef12;
+   u32 coef13;
+   u32 coef14;
+   u32 coef21;
+   u32 coef22;
+   u32 coef23;
+   u32 coef24;
+   u32 coef31;
+   u32 coef32;
+   u32 coef33;
+   u32 coef34;
+};
+


This should be in another patch (let's call it patch 2)


 /*
  * DE register constants.
  */
diff --git a/arch/arm/include/asm/arch-sunxi/tve.h 
b/arch/arm/include/asm/arch-sunxi/tve.h

index 41a14a68e4..ff34bbbc12 100644
--- a/arch/arm/include/asm/arch-sunxi/tve.h
+++ b/arch/arm/include/asm/arch-sunxi/tve.h
@@ -45,7 +45,9 @@ struct sunxi_tve_reg {
u32 csc_reg1;   /* 0x044 */
u32 csc_reg2;   /* 0x048 */
u32 csc_reg3;   /* 0x04c */
-   u8 res1[0xb0];  /* 0x050 */
+   u8 res1[0xa8];  /* 0x050 */
+   u32 auto_detect_cfg0;   /* 0x0f8 */
+   u32 auto_detect_cfg1;   /* 0x0fc */
u32 color_burst;/* 0x100 */
u32 vsync_num;  /* 0x104 */
u32 notch_freq; /* 0x108 */
@@ -62,6 +64,10 @@ struct sunxi_tve_reg {
u32 slave_para; /* 0x134 */
u32 cfg1;   /* 0x138 */
u32 cfg2;   /* 0x13c */
+   u8 res2[0x1c4]; /* 0x140 */
+   u32 calibration;/* 0x304 */
+   u8 res3[0x4];   /* 0x308 */
+   u32 unknown3;   /* 0x30c */


And these yet another one (patch 3)


 };

 /*
@@ -79,12 +85,14 @@ struct sunxi_tve_reg {
 #define SUNXI_TVE_CFG0_PAL 0x07030001
 #define SUNXI_TVE_CFG0_NTSC0x0703
 #define SUNXI_TVE_DAC_CFG0_VGA 0x403e1ac7
-#ifdef CONFIG_MACH_SUN5I
+#if defined(CONFIG_MACH_SUN5I) || defined(CONFIG_MACH_SUNXI_H3_H5)
 #define SUNXI_TVE_DAC_CFG0_COMPOSITE   0x433f0009
 #else
 #define SUNXI_TVE_DAC_CFG0_COMPOSITE   0x403f0008
 #endif
+#define SUNXI_TVE_DAC_CFG0_DETECTION   0x433f0289
 #define SUNXI_TVE_FILTER_COMPOSITE 0x0120
+#define SUNXI_TVE_CHROMA_FREQ_PAL  0x2a098acb
 #define SUNXI_TVE_CHROMA_FREQ_PAL_M0

[U-Boot] [PATCH 20/23] ARM: rmobile: salvator-x: Count all DRAM in all slots

2017-05-13 Thread Marek Vasut
Instead of counting only the DRAM in the first slot, count
all the DRAM in all slots and report it accordingly.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c | 30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index 44e4006f5c..14385d7361 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -235,8 +235,36 @@ int board_mmc_init(bd_t *bis)
 
 int dram_init(void)
 {
-   gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+   gd->ram_size = PHYS_SDRAM_1_SIZE;
+#if (CONFIG_NR_DRAM_BANKS >= 2)
+   gd->ram_size += PHYS_SDRAM_2_SIZE;
+#endif
+#if (CONFIG_NR_DRAM_BANKS >= 3)
+   gd->ram_size += PHYS_SDRAM_3_SIZE;
+#endif
+#if (CONFIG_NR_DRAM_BANKS >= 4)
+   gd->ram_size += PHYS_SDRAM_4_SIZE;
+#endif
+
+   return 0;
+}
 
+int dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+   gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+#if (CONFIG_NR_DRAM_BANKS >= 2)
+   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+   gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+#endif
+#if (CONFIG_NR_DRAM_BANKS >= 3)
+   gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
+   gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
+#endif
+#if (CONFIG_NR_DRAM_BANKS >= 4)
+   gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
+   gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
+#endif
return 0;
 }
 
-- 
2.11.0

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


[U-Boot] [PATCH 19/23] ARM: rmobile: salvator-x: Add USB support

2017-05-13 Thread Marek Vasut
Add support for the EHCI USB.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c | 12 
 configs/salvator-x_defconfig  |  6 ++
 include/configs/salvator-x.h  |  7 +++
 3 files changed, 25 insertions(+)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index acc541df0c..44e4006f5c 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -107,6 +107,9 @@ int board_init(void)
 
mstp_clrbits_le32(MSTPSR1, SMSTPCR1, GSX_MSTP112);
 
+   /* USB1 pull-up */
+   setbits_le32(PFC_PUEN6, PUEN_USB1_OVC | PUEN_USB1_PWEN);
+
 #ifdef CONFIG_RAVB
/* EtherAVB Enable */
/* GPSR2 */
@@ -131,6 +134,15 @@ int board_init(void)
/* IPSR3 */
gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL);
 
+   /* USB2_OVC */
+   gpio_request(GPIO_GP_6_15, NULL);
+   gpio_direction_input(GPIO_GP_6_15);
+
+   /* USB2_PWEN */
+   gpio_request(GPIO_GP_6_14, NULL);
+   gpio_direction_output(GPIO_GP_6_14, 1);
+   gpio_set_value(GPIO_GP_6_14, 1);
+
/* AVB_PHY_RST */
gpio_request(GPIO_GP_2_10, NULL);
gpio_direction_output(GPIO_GP_2_10, 0);
diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
index 3738fe4536..60e0b720bb 100644
--- a/configs/salvator-x_defconfig
+++ b/configs/salvator-x_defconfig
@@ -17,6 +17,12 @@ CONFIG_CMD_NFS=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_DHCP=y
+CONFIG_CMD_USB=y
+CONFIG_USB=y
+CONFIG_USB_HOST=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_EHCI_RCAR_GEN3=y
 CONFIG_DOS_PARTITION=y
 CONFIG_MMC=y
 CONFIG_GENERIC_MMC=y
diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
index 0e5c130b13..4ac9328e1b 100644
--- a/include/configs/salvator-x.h
+++ b/include/configs/salvator-x.h
@@ -62,6 +62,13 @@
 
 #define CONFIG_SYS_I2C_POWERIC_ADDR0x30
 
+/* USB */
+#ifdef CONFIG_R8A7795
+#define CONFIG_USB_MAX_CONTROLLER_COUNT3
+#else
+#define CONFIG_USB_MAX_CONTROLLER_COUNT2
+#endif
+
 /* SDHI */
 #define CONFIG_SH_SDHI_FREQ2
 
-- 
2.11.0

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


[U-Boot] [PATCH 14/23] ARM: rmobile: salvator-x: Zap redefined DECLARE_GLOBAL_DATA_PTR

2017-05-13 Thread Marek Vasut
The macro is used twice in the salvator-x board file, drop one.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index d0e21ab667..038d6de610 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -65,7 +65,6 @@ int board_early_init_f(void)
 /* -/W 32 Power resume control register 2 (3DG) */
 #defineSYSC_PWRONCR2   0xE618010C
 
-DECLARE_GLOBAL_DATA_PTR;
 int board_init(void)
 {
/* adress of boot parameters */
-- 
2.11.0

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


[U-Boot] [PATCH 08/23] ARM: rmobile: Handle R8A7796 r1.1 in the PRR code

2017-05-13 Thread Marek Vasut
The R8A7796 r1.1 reports itself as r2.0 , add quirk into the
PRR code to fix this report.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/cpu_info-rcar.c | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-rmobile/cpu_info-rcar.c 
b/arch/arm/mach-rmobile/cpu_info-rcar.c
index 42ee30fbe7..c373eef73d 100644
--- a/arch/arm/mach-rmobile/cpu_info-rcar.c
+++ b/arch/arm/mach-rmobile/cpu_info-rcar.c
@@ -8,7 +8,10 @@
 #include 
 #include 
 
-#define PRR 0xFF44
+#define PRR0xFF44
+#define PRR_MASK   0x7fff
+#define R8A7796_REV_1_00x5200
+#define R8A7796_REV_1_10x5210
 
 u32 rmobile_get_cpu_type(void)
 {
@@ -17,10 +20,20 @@ u32 rmobile_get_cpu_type(void)
 
 u32 rmobile_get_cpu_rev_integer(void)
 {
-   return ((readl(PRR) & 0x00F0) >> 4) + 1;
+   const u32 prr = readl(PRR);
+
+   if ((prr & PRR_MASK) == R8A7796_REV_1_1)
+   return 1;
+   else
+   return ((prr & 0x00F0) >> 4) + 1;
 }
 
 u32 rmobile_get_cpu_rev_fraction(void)
 {
-   return readl(PRR) & 0x000F;
+   const u32 prr = readl(PRR);
+
+   if ((prr & PRR_MASK) == R8A7796_REV_1_1)
+   return 1;
+   else
+   return prr & 0x000F;
 }
-- 
2.11.0

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


[U-Boot] [PATCH 18/23] ARM: rmobile: salvator-x: Add DVFS and PMIC support

2017-05-13 Thread Marek Vasut
Add support for rebooting the board using the ROHM BD9571MWV I2C PMIC,
but keep the CPU reboot option as a fallback.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c |  9 +
 include/configs/salvator-x.h  | 12 
 2 files changed, 21 insertions(+)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index 38ff99a17c..acc541df0c 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -50,6 +50,7 @@ void s_init(void)
 #define TMU1_MSTP124   BIT(24) /* non-secure */
 #define SCIF2_MSTP310  BIT(10) /* SCIF2 */
 #define ETHERAVB_MSTP812   BIT(12)
+#define DVFS_MSTP926   BIT(26)
 #define SD0_MSTP314BIT(14)
 #define SD1_MSTP313BIT(13)
 #define SD2_MSTP312BIT(12) /* either MMC0 */
@@ -78,6 +79,10 @@ int board_early_init_f(void)
writel(0, SD2CKCR);
writel(0, SD3CKCR);
 
+#if defined(CONFIG_SYS_I2C) && defined(CONFIG_SYS_I2C_SH)
+   /* DVFS for reset */
+   mstp_clrbits_le32(MSTPSR9, SMSTPCR9, DVFS_MSTP926);
+#endif
return 0;
 }
 
@@ -235,8 +240,12 @@ const struct rmobile_sysinfo sysinfo = {
 
 void reset_cpu(ulong addr)
 {
+#if defined(CONFIG_SYS_I2C) && defined(CONFIG_SYS_I2C_SH)
+   i2c_reg_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x20, 0x80);
+#else
/* only CA57 ? */
writel(RST_CODE, RST_CA57RESCNT);
+#endif
 }
 
 static const struct sh_serial_platdata serial_platdata = {
diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
index b5a98d6db2..0e5c130b13 100644
--- a/include/configs/salvator-x.h
+++ b/include/configs/salvator-x.h
@@ -50,6 +50,18 @@
 #define GICD_BASE  0xF101
 #define GICC_BASE  0xF102
 
+/* i2c */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SH
+#define CONFIG_SYS_I2C_SLAVE   0x60
+#define CONFIG_SYS_I2C_SH_NUM_CONTROLLERS  1
+#define CONFIG_SYS_I2C_SH_SPEED0   40
+#define CONFIG_SH_I2C_DATA_HIGH4
+#define CONFIG_SH_I2C_DATA_LOW 5
+#define CONFIG_SH_I2C_CLOCK1000
+
+#define CONFIG_SYS_I2C_POWERIC_ADDR0x30
+
 /* SDHI */
 #define CONFIG_SH_SDHI_FREQ2
 
-- 
2.11.0

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


[U-Boot] [PATCH 13/23] ARM: rmobile: salvator-x: Set default device tree

2017-05-13 Thread Marek Vasut
Set default device tree file in the salvator-x_defconfig
and use it in the environment.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 configs/salvator-x_defconfig   | 1 +
 include/configs/rcar-gen3-common.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
index 9fb0b898f1..8cef6075e9 100644
--- a/configs/salvator-x_defconfig
+++ b/configs/salvator-x_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_SALVATOR_X=y
+CONFIG_DEFAULT_FDT_FILE=r8a7795-salvator-x.dtb
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_FDT=y
diff --git a/include/configs/rcar-gen3-common.h 
b/include/configs/rcar-gen3-common.h
index 6bc8ab18b6..e73bc61856 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -100,7 +100,7 @@
 
 #define CONFIG_BOOTCOMMAND \
"tftp 0x4808 Image; " \
-   "tftp 0x4800 Image-r8a7795-salvator-x.dtb; " \
+   "tftp 0x4800 Image-"CONFIG_DEFAULT_FDT_FILE"; " \
"booti 0x4808 - 0x4800"
 
 #endif /* __RCAR_GEN3_COMMON_H */
-- 
2.11.0

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


[U-Boot] [PATCH 09/23] ARM: rmobile: Add R8A7796 support

2017-05-13 Thread Marek Vasut
Add Kconfig entry for the R8A7796 RCar M3 SoC.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/Kconfig.64 |  3 +++
 arch/arm/mach-rmobile/Makefile   |  1 +
 arch/arm/mach-rmobile/include/mach/r8a7796.h | 39 
 arch/arm/mach-rmobile/include/mach/rmobile.h |  2 ++
 arch/arm/mach-rmobile/memmap-r8a7796.c   | 30 +
 include/configs/rcar-gen3-common.h   | 31 ++
 6 files changed, 101 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-rmobile/include/mach/r8a7796.h
 create mode 100644 arch/arm/mach-rmobile/memmap-r8a7796.c

diff --git a/arch/arm/mach-rmobile/Kconfig.64 b/arch/arm/mach-rmobile/Kconfig.64
index e0c27ed9c6..4ffc40edc6 100644
--- a/arch/arm/mach-rmobile/Kconfig.64
+++ b/arch/arm/mach-rmobile/Kconfig.64
@@ -6,6 +6,9 @@ choice
 config R8A7795
bool "Renesas SoC R8A7795"
 
+config R8A7796
+   bool "Renesas SoC R8A7796"
+
 endchoice
 
 choice
diff --git a/arch/arm/mach-rmobile/Makefile b/arch/arm/mach-rmobile/Makefile
index 3b56fcf96f..2aea527bae 100644
--- a/arch/arm/mach-rmobile/Makefile
+++ b/arch/arm/mach-rmobile/Makefile
@@ -17,5 +17,6 @@ obj-$(CONFIG_R8A7792) += lowlevel_init_ca15.o cpu_info-rcar.o 
pfc-r8a7792.o
 obj-$(CONFIG_R8A7793) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7793.o
 obj-$(CONFIG_R8A7794) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7794.o
 obj-$(CONFIG_R8A7795) += lowlevel_init_gen3.o cpu_info-rcar.o pfc-r8a7795.o 
memmap-r8a7795.o
+obj-$(CONFIG_R8A7796) += lowlevel_init_gen3.o cpu_info-rcar.o pfc-r8a7796.o 
memmap-r8a7796.o
 obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o
 obj-$(CONFIG_TMU_TIMER) += ../../sh/lib/time.o
diff --git a/arch/arm/mach-rmobile/include/mach/r8a7796.h 
b/arch/arm/mach-rmobile/include/mach/r8a7796.h
new file mode 100644
index 00..a7d1ba23bb
--- /dev/null
+++ b/arch/arm/mach-rmobile/include/mach/r8a7796.h
@@ -0,0 +1,39 @@
+/*
+ * arch/arm/include/asm/arch-rcar_gen3/r8a7796.h
+ * This file defines registers and value for r8a7796.
+ *
+ * Copyright (C) 2016 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ASM_ARCH_R8A7796_H
+#define __ASM_ARCH_R8A7796_H
+
+#include "rcar-gen3-base.h"
+
+/* Module stop control/status register bits */
+#define MSTP0_BITS 0x0020
+#define MSTP1_BITS 0x
+#define MSTP2_BITS 0x340E2FDC
+#define MSTP3_BITS 0xFFDF
+#define MSTP4_BITS 0x8184
+#define MSTP5_BITS 0xC3FF
+#define MSTP6_BITS 0x
+#define MSTP7_BITS 0x
+#define MSTP8_BITS 0x01F1FFF7
+#define MSTP9_BITS 0xFFFE
+#define MSTP10_BITS0xFFFEFFE0
+#define MSTP11_BITS0x00B7
+
+/* SDHI */
+#define CONFIG_SYS_SH_SDHI0_BASE 0xEE10
+#define CONFIG_SYS_SH_SDHI1_BASE 0xEE12
+#define CONFIG_SYS_SH_SDHI2_BASE 0xEE14/* either MMC0 */
+#define CONFIG_SYS_SH_SDHI3_BASE 0xEE16/* either MMC1 */
+#define CONFIG_SYS_SH_SDHI_NR_CHANNEL 4
+
+/* SH-I2C */
+#define CONFIG_SYS_I2C_SH_BASE00xE60B
+
+#endif /* __ASM_ARCH_R8A7796_H */
diff --git a/arch/arm/mach-rmobile/include/mach/rmobile.h 
b/arch/arm/mach-rmobile/include/mach/rmobile.h
index 22d97b19ab..654349b0b3 100644
--- a/arch/arm/mach-rmobile/include/mach/rmobile.h
+++ b/arch/arm/mach-rmobile/include/mach/rmobile.h
@@ -18,6 +18,8 @@
 #include 
 #elif defined(CONFIG_R8A7795)
 #include 
+#elif defined(CONFIG_R8A7796)
+#include 
 #else
 #error "SOC Name not defined"
 #endif
diff --git a/arch/arm/mach-rmobile/memmap-r8a7796.c 
b/arch/arm/mach-rmobile/memmap-r8a7796.c
new file mode 100644
index 00..648743d51e
--- /dev/null
+++ b/arch/arm/mach-rmobile/memmap-r8a7796.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2017 Marek Vasut 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+
+static struct mm_region r8a7796_mem_map[] = {
+   {
+   .virt = 0x0UL,
+   .phys = 0x0UL,
+   .size = 0xe000UL,
+   .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+PTE_BLOCK_INNER_SHARE
+   }, {
+   .virt = 0xe000UL,
+   .phys = 0xe000UL,
+   .size = 0xe000UL,
+   .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+PTE_BLOCK_NON_SHARE |
+PTE_BLOCK_PXN | PTE_BLOCK_UXN
+   }, {
+   /* List terminator */
+   0,
+   }
+};
+
+struct mm_region *mem_map = r8a7796_mem_map;
diff --git a/include/configs/rcar-gen3-common.h 
b/include/configs/rcar-gen3-common.h
index c87d31950f..304478af07 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -2,7 +2,7 @@
  * include/configs/rcar-gen3-common.h
  * This file is R-Car Gen3 common configuration file.
  *
- * Copyright (C) 2015 Renesas Electronics Corporation
+ * Copyright (

[U-Boot] [PATCH 17/23] ARM: rmobile: salvator-x: Add RAVB ethernet support

2017-05-13 Thread Marek Vasut
Add support for the AVB ethernet on the Salvator-X board.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c | 46 +++
 configs/salvator-x_defconfig  |  7 ++
 include/configs/salvator-x.h  |  6 +
 3 files changed, 59 insertions(+)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index 1ee5cf1051..38ff99a17c 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -49,6 +49,7 @@ void s_init(void)
 #define TMU0_MSTP125   BIT(25) /* secure */
 #define TMU1_MSTP124   BIT(24) /* non-secure */
 #define SCIF2_MSTP310  BIT(10) /* SCIF2 */
+#define ETHERAVB_MSTP812   BIT(12)
 #define SD0_MSTP314BIT(14)
 #define SD1_MSTP313BIT(13)
 #define SD2_MSTP312BIT(12) /* either MMC0 */
@@ -65,6 +66,8 @@ int board_early_init_f(void)
mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125 | TMU1_MSTP124);
/* SCIF2 */
mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SCIF2_MSTP310);
+   /* EHTERAVB */
+   mstp_clrbits_le32(MSTPSR8, SMSTPCR8, ETHERAVB_MSTP812);
/* eMMC */
mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD1_MSTP313 | SD2_MSTP312);
/* SDHI0, 3 */
@@ -99,9 +102,52 @@ int board_init(void)
 
mstp_clrbits_le32(MSTPSR1, SMSTPCR1, GSX_MSTP112);
 
+#ifdef CONFIG_RAVB
+   /* EtherAVB Enable */
+   /* GPSR2 */
+   gpio_request(GPIO_GFN_AVB_AVTP_CAPTURE_A, NULL);
+   gpio_request(GPIO_GFN_AVB_AVTP_MATCH_A, NULL);
+   gpio_request(GPIO_GFN_AVB_LINK, NULL);
+   gpio_request(GPIO_GFN_AVB_PHY_INT, NULL);
+   gpio_request(GPIO_GFN_AVB_MAGIC, NULL);
+   gpio_request(GPIO_GFN_AVB_MDC, NULL);
+
+   /* IPSR0 */
+   gpio_request(GPIO_IFN_AVB_MDC, NULL);
+   gpio_request(GPIO_IFN_AVB_MAGIC, NULL);
+   gpio_request(GPIO_IFN_AVB_PHY_INT, NULL);
+   gpio_request(GPIO_IFN_AVB_LINK, NULL);
+   gpio_request(GPIO_IFN_AVB_AVTP_MATCH_A, NULL);
+   gpio_request(GPIO_IFN_AVB_AVTP_CAPTURE_A, NULL);
+   /* IPSR1 */
+   gpio_request(GPIO_FN_AVB_AVTP_PPS, NULL);
+   /* IPSR2 */
+   gpio_request(GPIO_FN_AVB_AVTP_MATCH_B, NULL);
+   /* IPSR3 */
+   gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL);
+
+   /* AVB_PHY_RST */
+   gpio_request(GPIO_GP_2_10, NULL);
+   gpio_direction_output(GPIO_GP_2_10, 0);
+   mdelay(20);
+   gpio_set_value(GPIO_GP_2_10, 1);
+   udelay(1);
+#endif
+
return 0;
 }
 
+static struct eth_pdata salvator_x_ravb_platdata = {
+   .iobase = 0xE680,
+   .phy_interface  = 0,
+   .max_speed  = 1000,
+};
+
+U_BOOT_DEVICE(salvator_x_ravb) = {
+   .name   = "ravb",
+   .platdata   = &salvator_x_ravb_platdata,
+};
+
 #ifdef CONFIG_SH_SDHI
 int board_mmc_init(bd_t *bis)
 {
diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
index 1478b6ae3b..3738fe4536 100644
--- a/configs/salvator-x_defconfig
+++ b/configs/salvator-x_defconfig
@@ -12,7 +12,14 @@ CONFIG_SH_SDHI=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EDITENV=y
 CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_NET=y
+CONFIG_CMD_NFS=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DHCP=y
 CONFIG_DOS_PARTITION=y
 CONFIG_MMC=y
 CONFIG_GENERIC_MMC=y
 CONFIG_OF_LIBFDT=y
+CONFIG_DM_ETH=y
+CONFIG_RENESAS_RAVB=y
diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
index 91307eb353..b5a98d6db2 100644
--- a/include/configs/salvator-x.h
+++ b/include/configs/salvator-x.h
@@ -25,6 +25,12 @@
 /* [A] Hyper Flash */
 /* use to RPC(SPI Multi I/O Bus Controller) */
 
+/* Ethernet RAVB */
+#define CONFIG_NET_MULTI
+#define CONFIG_PHY_MICREL
+#define CONFIG_BITBANGMII
+#define CONFIG_BITBANGMII_MULTI
+
 /* Board Clock */
 /* XTAL_CLK : 33.33MHz */
 #define RCAR_XTAL_CLK  u
-- 
2.11.0

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


[U-Boot] [PATCH 23/23] ARM: rmobile: salvator-x: Add R8A7796 support

2017-05-13 Thread Marek Vasut
Add minor ifdeffery and default board config for the Salvator-XS board
with R8A7796 M3 SoC.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/MAINTAINERS  |  1 +
 board/renesas/salvator-x/salvator-x.c | 28 ++--
 configs/r8a7796_salvator-x_defconfig  | 31 +++
 3 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100644 configs/r8a7796_salvator-x_defconfig

diff --git a/board/renesas/salvator-x/MAINTAINERS 
b/board/renesas/salvator-x/MAINTAINERS
index 33c105d0cc..f7b98fb097 100644
--- a/board/renesas/salvator-x/MAINTAINERS
+++ b/board/renesas/salvator-x/MAINTAINERS
@@ -4,3 +4,4 @@ S:  Maintained
 F: board/renesas/salvator-x/
 F: include/configs/salvator-x.h
 F: configs/r8a7795_salvator-x_defconfig
+F: configs/r8a7796_salvator-x_defconfig
diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index 14385d7361..6270de4e40 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -1,6 +1,6 @@
 /*
  * board/renesas/salvator-x/salvator-x.c
- * This file is Salvator-X board support.
+ * This file is Salvator-X/Salvator-XS board support.
  *
  * Copyright (C) 2015-2017 Renesas Electronics Corporation
  * Copyright (C) 2015 Nobuhiro Iwamatsu 
@@ -98,14 +98,20 @@ int board_init(void)
gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x5;
 
/* Init PFC controller */
+#if defined(CONFIG_R8A7795)
r8a7795_pinmux_init();
+#elif defined(CONFIG_R8A7796)
+   r8a7796_pinmux_init();
+#endif
 
+#if defined(CONFIG_R8A7795)
/* GSX: force power and clock supply */
writel(0x001F, SYSC_PWRONCR2);
while (readl(SYSC_PWRSR2) != 0x03E0)
mdelay(20);
 
mstp_clrbits_le32(MSTPSR1, SMSTPCR1, GSX_MSTP112);
+#endif
 
/* USB1 pull-up */
setbits_le32(PFC_PUEN6, PUEN_USB1_OVC | PUEN_USB1_PWEN);
@@ -134,6 +140,7 @@ int board_init(void)
/* IPSR3 */
gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL);
 
+#if defined(CONFIG_R8A7795)
/* USB2_OVC */
gpio_request(GPIO_GP_6_15, NULL);
gpio_direction_input(GPIO_GP_6_15);
@@ -142,7 +149,7 @@ int board_init(void)
gpio_request(GPIO_GP_6_14, NULL);
gpio_direction_output(GPIO_GP_6_14, 1);
gpio_set_value(GPIO_GP_6_14, 1);
-
+#endif
/* AVB_PHY_RST */
gpio_request(GPIO_GP_2_10, NULL);
gpio_direction_output(GPIO_GP_2_10, 0);
@@ -200,7 +207,13 @@ int board_mmc_init(bd_t *bis)
gpio_request(GPIO_GFN_SD2_DAT2, NULL);
gpio_request(GPIO_GFN_SD2_DAT3, NULL);
gpio_request(GPIO_GFN_SD2_CLK, NULL);
+#if defined(CONFIG_R8A7795)
gpio_request(GPIO_GFN_SD2_CMD, NULL);
+#elif defined(CONFIG_R8A7796)
+   gpio_request(GPIO_FN_SD2_CMD, NULL);
+#else
+#error Only R8A7795 and R87796 is supported
+#endif
gpio_request(GPIO_GP_5_3, NULL);
gpio_request(GPIO_GP_5_9, NULL);
gpio_direction_output(GPIO_GP_5_3, 0);  /* 1: 3.3V, 0: 1.8V */
@@ -211,6 +224,7 @@ int board_mmc_init(bd_t *bis)
if (ret)
return ret;
 
+#if defined(CONFIG_R8A7795)
/* SDHI3 */
gpio_request(GPIO_GFN_SD3_DAT0, NULL);  /* GP_4_9 */
gpio_request(GPIO_GFN_SD3_DAT1, NULL);  /* GP_4_10 */
@@ -218,6 +232,16 @@ int board_mmc_init(bd_t *bis)
gpio_request(GPIO_GFN_SD3_DAT3, NULL);  /* GP_4_12 */
gpio_request(GPIO_GFN_SD3_CLK, NULL);   /* GP_4_7 */
gpio_request(GPIO_GFN_SD3_CMD, NULL);   /* GP_4_8 */
+#elif defined(CONFIG_R8A7796)
+   gpio_request(GPIO_FN_SD3_DAT0, NULL);   /* GP_4_9 */
+   gpio_request(GPIO_FN_SD3_DAT1, NULL);   /* GP_4_10 */
+   gpio_request(GPIO_FN_SD3_DAT2, NULL);   /* GP_4_11 */
+   gpio_request(GPIO_FN_SD3_DAT3, NULL);   /* GP_4_12 */
+   gpio_request(GPIO_FN_SD3_CLK, NULL);/* GP_4_7 */
+   gpio_request(GPIO_FN_SD3_CMD, NULL);/* GP_4_8 */
+#else
+#error Only R8A7795 and R87796 is supported
+#endif
/* IPSR10 */
gpio_request(GPIO_FN_SD3_CD, NULL);
gpio_request(GPIO_FN_SD3_WP, NULL);
diff --git a/configs/r8a7796_salvator-x_defconfig 
b/configs/r8a7796_salvator-x_defconfig
new file mode 100644
index 00..d6f1840eab
--- /dev/null
+++ b/configs/r8a7796_salvator-x_defconfig
@@ -0,0 +1,31 @@
+CONFIG_ARM=y
+CONFIG_ARCH_RMOBILE=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_RCAR_GEN3=y
+CONFIG_TARGET_SALVATOR_X=y
+CONFIG_DEFAULT_FDT_FILE=r8a7796-salvator-x.dtb
+CONFIG_VERSION_VARIABLE=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_FDT=y
+CONFIG_R8A7796=y
+CONFIG_SH_SDHI=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_EDITENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_NET=y
+CONFIG_CMD_NFS=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_USB=y
+CONFIG_USB=y
+CONFIG_USB_HOST=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_EHCI_RCAR_GEN3=y
+CONFIG_DOS_PARTITION=y
+CONFIG_MMC=y

[U-Boot] [PATCH 11/23] ARM: rmobile: salvator-x: Use BIT() macro in board file

2017-05-13 Thread Marek Vasut
Cosmetic change, replace (1 << (n)) with BIT(n) .

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index 0164306b52..d0e21ab667 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -44,10 +44,10 @@ void s_init(void)
writel(0x, CPGWPR);
 }
 
-#define GSX_MSTP112(1 << 12)   /* 3DG */
-#define TMU0_MSTP125   (1 << 25)   /* secure */
-#define TMU1_MSTP124   (1 << 24)   /* non-secure */
-#define SCIF2_MSTP310  (1 << 10)   /* SCIF2 */
+#define GSX_MSTP112BIT(12) /* 3DG */
+#define TMU0_MSTP125   BIT(25) /* secure */
+#define TMU1_MSTP124   BIT(24) /* non-secure */
+#define SCIF2_MSTP310  BIT(10) /* SCIF2 */
 
 int board_early_init_f(void)
 {
-- 
2.11.0

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


[U-Boot] [PATCH 21/23] ARM: rmobile: salvator-x: Enable SCIF2 clock

2017-05-13 Thread Marek Vasut
There are two UARTs on the board, so enable the clock for the
second one as well.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 include/configs/salvator-x.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
index 4ac9328e1b..0ac3900326 100644
--- a/include/configs/salvator-x.h
+++ b/include/configs/salvator-x.h
@@ -81,6 +81,8 @@
 /* Module stop status bits */
 /* MFIS, SCIF1 */
 #define CONFIG_SMSTP2_ENA  0x2040
+/* SCIF2 */
+#define CONFIG_SMSTP3_ENA  0x0400
 /* INTC-AP, IRQC */
 #define CONFIG_SMSTP4_ENA  0x0180
 
-- 
2.11.0

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


[U-Boot] [PATCH 07/23] ARM: rmobile: Add R8A7796 into the CPU table

2017-05-13 Thread Marek Vasut
Add entry for the R8A7796 RCar M3 SoC into the CPU info table.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/cpu_info.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-rmobile/cpu_info.c b/arch/arm/mach-rmobile/cpu_info.c
index 208228ff45..faa53197d5 100644
--- a/arch/arm/mach-rmobile/cpu_info.c
+++ b/arch/arm/mach-rmobile/cpu_info.c
@@ -57,6 +57,7 @@ static const struct {
{ 0x4B, "R8A7793" },
{ 0x4C, "R8A7794" },
{ 0x4F, "R8A7795" },
+   { 0x52, "R8A7796" },
{ 0x0, "CPU" },
 };
 
-- 
2.11.0

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


[U-Boot] [PATCH 22/23] ARM: rmobile: salvator-x: Rename the defconfig to match the SoC

2017-05-13 Thread Marek Vasut
Rename the salvator-x_defconfig to r8a7795_salvator-x_defconfig in
preparation for the r8a7796 support on salvator-x board.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/MAINTAINERS   | 2 +-
 configs/{salvator-x_defconfig => r8a7795_salvator-x_defconfig} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename configs/{salvator-x_defconfig => r8a7795_salvator-x_defconfig} (100%)

diff --git a/board/renesas/salvator-x/MAINTAINERS 
b/board/renesas/salvator-x/MAINTAINERS
index abd05c88e0..33c105d0cc 100644
--- a/board/renesas/salvator-x/MAINTAINERS
+++ b/board/renesas/salvator-x/MAINTAINERS
@@ -3,4 +3,4 @@ M:  Nobuhiro Iwamatsu 
 S: Maintained
 F: board/renesas/salvator-x/
 F: include/configs/salvator-x.h
-F: configs/salvator-x_defconfig
+F: configs/r8a7795_salvator-x_defconfig
diff --git a/configs/salvator-x_defconfig b/configs/r8a7795_salvator-x_defconfig
similarity index 100%
rename from configs/salvator-x_defconfig
rename to configs/r8a7795_salvator-x_defconfig
-- 
2.11.0

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


[U-Boot] [PATCH 16/23] ARM: rmobile: salvator-x: Add SD support

2017-05-13 Thread Marek Vasut
Add support for the SD card slots on the Salvator-X board.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c | 89 ++-
 configs/salvator-x_defconfig  |  8 ++--
 include/configs/salvator-x.h  | 10 +++-
 3 files changed, 102 insertions(+), 5 deletions(-)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index 3f2bebf74f..1ee5cf1051 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -2,7 +2,7 @@
  * board/renesas/salvator-x/salvator-x.c
  * This file is Salvator-X board support.
  *
- * Copyright (C) 2015 Renesas Electronics Corporation
+ * Copyright (C) 2015-2017 Renesas Electronics Corporation
  * Copyright (C) 2015 Nobuhiro Iwamatsu 
  *
  * SPDX-License-Identifier: GPL-2.0+
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -48,6 +49,15 @@ void s_init(void)
 #define TMU0_MSTP125   BIT(25) /* secure */
 #define TMU1_MSTP124   BIT(24) /* non-secure */
 #define SCIF2_MSTP310  BIT(10) /* SCIF2 */
+#define SD0_MSTP314BIT(14)
+#define SD1_MSTP313BIT(13)
+#define SD2_MSTP312BIT(12) /* either MMC0 */
+#define SD3_MSTP311BIT(11) /* either MMC1 */
+
+#define SD0CKCR0xE6150074
+#define SD1CKCR0xE6150078
+#define SD2CKCR0xE6150268
+#define SD3CKCR0xE615026C
 
 int board_early_init_f(void)
 {
@@ -55,6 +65,15 @@ int board_early_init_f(void)
mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125 | TMU1_MSTP124);
/* SCIF2 */
mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SCIF2_MSTP310);
+   /* eMMC */
+   mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD1_MSTP313 | SD2_MSTP312);
+   /* SDHI0, 3 */
+   mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD0_MSTP314 | SD3_MSTP311);
+
+   writel(0, SD0CKCR);
+   writel(0, SD1CKCR);
+   writel(0, SD2CKCR);
+   writel(0, SD3CKCR);
 
return 0;
 }
@@ -83,6 +102,74 @@ int board_init(void)
return 0;
 }
 
+#ifdef CONFIG_SH_SDHI
+int board_mmc_init(bd_t *bis)
+{
+   int ret = -ENODEV;
+
+   /* SDHI0 */
+   gpio_request(GPIO_GFN_SD0_DAT0, NULL);
+   gpio_request(GPIO_GFN_SD0_DAT1, NULL);
+   gpio_request(GPIO_GFN_SD0_DAT2, NULL);
+   gpio_request(GPIO_GFN_SD0_DAT3, NULL);
+   gpio_request(GPIO_GFN_SD0_CLK, NULL);
+   gpio_request(GPIO_GFN_SD0_CMD, NULL);
+   gpio_request(GPIO_GFN_SD0_CD, NULL);
+   gpio_request(GPIO_GFN_SD0_WP, NULL);
+
+   gpio_request(GPIO_GP_5_2, NULL);
+   gpio_request(GPIO_GP_5_1, NULL);
+   gpio_direction_output(GPIO_GP_5_2, 1);  /* power on */
+   gpio_direction_output(GPIO_GP_5_1, 1);  /* 1: 3.3V, 0: 1.8V */
+
+   ret = sh_sdhi_init(CONFIG_SYS_SH_SDHI0_BASE, 0,
+  SH_SDHI_QUIRK_64BIT_BUF);
+   if (ret)
+   return ret;
+
+   /* SDHI1/SDHI2 eMMC */
+   gpio_request(GPIO_GFN_SD1_DAT0, NULL);
+   gpio_request(GPIO_GFN_SD1_DAT1, NULL);
+   gpio_request(GPIO_GFN_SD1_DAT2, NULL);
+   gpio_request(GPIO_GFN_SD1_DAT3, NULL);
+   gpio_request(GPIO_GFN_SD2_DAT0, NULL);
+   gpio_request(GPIO_GFN_SD2_DAT1, NULL);
+   gpio_request(GPIO_GFN_SD2_DAT2, NULL);
+   gpio_request(GPIO_GFN_SD2_DAT3, NULL);
+   gpio_request(GPIO_GFN_SD2_CLK, NULL);
+   gpio_request(GPIO_GFN_SD2_CMD, NULL);
+   gpio_request(GPIO_GP_5_3, NULL);
+   gpio_request(GPIO_GP_5_9, NULL);
+   gpio_direction_output(GPIO_GP_5_3, 0);  /* 1: 3.3V, 0: 1.8V */
+   gpio_direction_output(GPIO_GP_5_9, 0);  /* 1: 3.3V, 0: 1.8V */
+
+   ret = sh_sdhi_init(CONFIG_SYS_SH_SDHI2_BASE, 1,
+  SH_SDHI_QUIRK_64BIT_BUF);
+   if (ret)
+   return ret;
+
+   /* SDHI3 */
+   gpio_request(GPIO_GFN_SD3_DAT0, NULL);  /* GP_4_9 */
+   gpio_request(GPIO_GFN_SD3_DAT1, NULL);  /* GP_4_10 */
+   gpio_request(GPIO_GFN_SD3_DAT2, NULL);  /* GP_4_11 */
+   gpio_request(GPIO_GFN_SD3_DAT3, NULL);  /* GP_4_12 */
+   gpio_request(GPIO_GFN_SD3_CLK, NULL);   /* GP_4_7 */
+   gpio_request(GPIO_GFN_SD3_CMD, NULL);   /* GP_4_8 */
+   /* IPSR10 */
+   gpio_request(GPIO_FN_SD3_CD, NULL);
+   gpio_request(GPIO_FN_SD3_WP, NULL);
+
+   gpio_request(GPIO_GP_3_15, NULL);
+   gpio_request(GPIO_GP_3_14, NULL);
+   gpio_direction_output(GPIO_GP_3_15, 1); /* power on */
+   gpio_direction_output(GPIO_GP_3_14, 1); /* 1: 3.3V, 0: 1.8V */
+
+   ret = sh_sdhi_init(CONFIG_SYS_SH_SDHI3_BASE, 2,
+  SH_SDHI_QUIRK_64BIT_BUF);
+   return ret;
+}
+#endif
+
 int dram_init(void)
 {
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
index 8cef6075e9..1478b6ae3b 100644
--- a/configs/sal

[U-Boot] [PATCH 12/23] ARM: rmobile: salvator-x: Move OF_LIBFDT and CMD_FDT to board config

2017-05-13 Thread Marek Vasut
Move these two Kconfig symbols to the salvator-x_defconfig.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 configs/salvator-x_defconfig   | 2 ++
 include/configs/rcar-gen3-common.h | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
index 8f9b5b5328..9fb0b898f1 100644
--- a/configs/salvator-x_defconfig
+++ b/configs/salvator-x_defconfig
@@ -5,9 +5,11 @@ CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_SALVATOR_X=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_FDT=y
 CONFIG_R8A7795=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_DOS_PARTITION=y
 # CONFIG_MMC is not set
+CONFIG_OF_LIBFDT=y
diff --git a/include/configs/rcar-gen3-common.h 
b/include/configs/rcar-gen3-common.h
index 304478af07..6bc8ab18b6 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -17,7 +17,6 @@
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_EXT4
 #define CONFIG_CMD_EXT4_WRITE
-#define CONFIG_CMD_FDT
 
 #define CONFIG_REMAKE_ELF
 
@@ -34,7 +33,6 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 #define CONFIG_CMDLINE_EDITING
-#define CONFIG_OF_LIBFDT
 
 #undef CONFIG_SHOW_BOOT_PROGRESS
 
-- 
2.11.0

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


[U-Boot] [PATCH 10/23] ARM: rmobile: Allow R8A7796 Salvator-X configuration

2017-05-13 Thread Marek Vasut
The Salvator-X can have both H3 and M3 CPU on it, drop the
select R8A7795 to allow both configurations.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/Kconfig.64 | 3 +--
 configs/salvator-x_defconfig | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rmobile/Kconfig.64 b/arch/arm/mach-rmobile/Kconfig.64
index 4ffc40edc6..5db93ac8d6 100644
--- a/arch/arm/mach-rmobile/Kconfig.64
+++ b/arch/arm/mach-rmobile/Kconfig.64
@@ -17,9 +17,8 @@ choice
 
 config TARGET_SALVATOR_X
bool "Salvator-X board"
-   select R8A7795
help
-  Support for Renesas R-Car Gen3 R8a7795 platform
+  Support for Renesas R-Car Gen3 platform
 
 endchoice
 
diff --git a/configs/salvator-x_defconfig b/configs/salvator-x_defconfig
index b1500296da..8f9b5b5328 100644
--- a/configs/salvator-x_defconfig
+++ b/configs/salvator-x_defconfig
@@ -5,6 +5,7 @@ CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_SALVATOR_X=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_R8A7795=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
-- 
2.11.0

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


[U-Boot] [PATCH 04/23] ARM: rmobile: Update link address to match latest BL2

2017-05-13 Thread Marek Vasut
Update the CONFIG_SYS_TEXT_BASE to match BL2 Rev.1.0.9 and newer,
which loads the U-Boot to 0x5000 .

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 include/configs/rcar-gen3-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/rcar-gen3-common.h 
b/include/configs/rcar-gen3-common.h
index 056aea3fdb..c87d31950f 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -52,7 +52,7 @@
 #define CONFIG_SYS_BAUDRATE_TABLE  { 115200, 38400 }
 
 /* MEMORY */
-#define CONFIG_SYS_TEXT_BASE   0x4900
+#define CONFIG_SYS_TEXT_BASE   0x5000
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_TEXT_BASE + 0x7fff0)
 
 #define CONFIG_SYS_SDRAM_BASE  (0x4800)
-- 
2.11.0

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


[U-Boot] [PATCH 15/23] ARM: rmobile: salvator-x: Adjust UART clock

2017-05-13 Thread Marek Vasut
The UART uses internal SCIF clock except on R8A7795 H3 WS1.0 .
Use the internal clock and ignore the early version of the chip.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/salvator-x/salvator-x.c | 4 ++--
 include/configs/salvator-x.h  | 5 +++--
 scripts/config_whitelist.txt  | 1 +
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/board/renesas/salvator-x/salvator-x.c 
b/board/renesas/salvator-x/salvator-x.c
index 038d6de610..3f2bebf74f 100644
--- a/board/renesas/salvator-x/salvator-x.c
+++ b/board/renesas/salvator-x/salvator-x.c
@@ -109,8 +109,8 @@ void reset_cpu(ulong addr)
 static const struct sh_serial_platdata serial_platdata = {
.base = SCIF2_BASE,
.type = PORT_SCIF,
-   .clk = 14745600,/* 0xE1 */
-   .clk_mode = EXT_CLK,
+   .clk = CONFIG_SH_SCIF_CLK_FREQ,
+   .clk_mode = INT_CLK,
 };
 
 U_BOOT_DEVICE(salvator_x_scif2) = {
diff --git a/include/configs/salvator-x.h b/include/configs/salvator-x.h
index 81a7226d62..94f62a7358 100644
--- a/include/configs/salvator-x.h
+++ b/include/configs/salvator-x.h
@@ -20,7 +20,7 @@
 #define CONFIG_SCIF_CONSOLE
 #define CONFIG_CONS_SCIF2
 #define CONFIG_CONS_INDEX  2
-#define CONFIG_SH_SCIF_CLK_FREQCONFIG_SYS_CLK_FREQ
+#define CONFIG_SH_SCIF_CLK_FREQCONFIG_S3D4_CLK_FREQ
 
 /* [A] Hyper Flash */
 /* use to RPC(SPI Multi I/O Bus Controller) */
@@ -31,10 +31,11 @@
 #define RCAR_XTAL_CLK  u
 #define CONFIG_SYS_CLK_FREQRCAR_XTAL_CLK
 /* ch0to2 CPclk, ch3to11 S3D2_PEREclk, ch12to14 S3D2_RTclk */
-/* CPclk 16.66MHz, S3D2 133.33MHz  */
+/* CPclk 16.66MHz, S3D2 133.33MHz , S3D4 66.66MHz  */
 #define CONFIG_CP_CLK_FREQ (CONFIG_SYS_CLK_FREQ / 2)
 #define CONFIG_PLL1_CLK_FREQ   (CONFIG_SYS_CLK_FREQ * 192 / 2)
 #define CONFIG_S3D2_CLK_FREQ   (2u/2)
+#define CONFIG_S3D4_CLK_FREQ   (2u/4)
 
 /* Generic Timer Definitions (use in assembler source) */
 #define COUNTER_FREQUENCY  0xFE502A/* 16.66MHz from CPclk */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 7646bb6842..2ab6217433 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2396,6 +2396,7 @@ CONFIG_S3C24XX_TACLS
 CONFIG_S3C24XX_TWRPH0
 CONFIG_S3C24XX_TWRPH1
 CONFIG_S3D2_CLK_FREQ
+CONFIG_S3D4_CLK_FREQ
 CONFIG_S5P
 CONFIG_S5PC100
 CONFIG_S5PC110
-- 
2.11.0

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


[U-Boot] [PATCH 05/23] ARM: rmobile: Make the Gen3 SoC configurable

2017-05-13 Thread Marek Vasut
Allow selecting the Gen3 SoC in preparation for RCar M3 .
No functional change.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/Kconfig.64 | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rmobile/Kconfig.64 b/arch/arm/mach-rmobile/Kconfig.64
index f748c33a3e..e0c27ed9c6 100644
--- a/arch/arm/mach-rmobile/Kconfig.64
+++ b/arch/arm/mach-rmobile/Kconfig.64
@@ -1,7 +1,12 @@
 if RCAR_GEN3
 
+choice
+   prompt "Select Target SoC"
+
 config R8A7795
-   bool
+   bool "Renesas SoC R8A7795"
+
+endchoice
 
 choice
prompt "Renesus ARM64 SoCs board select"
-- 
2.11.0

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


[U-Boot] [PATCH 06/23] ARM: rmobile: Add R8A7795 into the CPU table

2017-05-13 Thread Marek Vasut
Add entry for the R8A7795 RCar H3 SoC into the CPU info table.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/cpu_info.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-rmobile/cpu_info.c b/arch/arm/mach-rmobile/cpu_info.c
index 129ab0c0f7..208228ff45 100644
--- a/arch/arm/mach-rmobile/cpu_info.c
+++ b/arch/arm/mach-rmobile/cpu_info.c
@@ -56,6 +56,7 @@ static const struct {
{ 0x4A, "R8A7792" },
{ 0x4B, "R8A7793" },
{ 0x4C, "R8A7794" },
+   { 0x4F, "R8A7795" },
{ 0x0, "CPU" },
 };
 
-- 
2.11.0

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


[U-Boot] [PATCH 03/23] ARM: rmobile: Zap RCAR_GEN3_EXTRAM_BOOT

2017-05-13 Thread Marek Vasut
This Kconfig option is not used on any board, so drop it.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/Kconfig.64 | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-rmobile/Kconfig.64 b/arch/arm/mach-rmobile/Kconfig.64
index 2a7eeba828..f748c33a3e 100644
--- a/arch/arm/mach-rmobile/Kconfig.64
+++ b/arch/arm/mach-rmobile/Kconfig.64
@@ -18,11 +18,6 @@ endchoice
 config SYS_SOC
default "rmobile"
 
-config RCAR_GEN3_EXTRAM_BOOT
-   bool "Enable boot from RAM"
-   depends on TARGET_SALVATOR_X
-   default n
-
 source "board/renesas/salvator-x/Kconfig"
 
 endif
-- 
2.11.0

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


[U-Boot] [PATCH 01/23] ARM: rmobile: Update R8A7795 PFC and GPIO tables

2017-05-13 Thread Marek Vasut
Sync the PFC and GPIO tables with the latest 3.5.3 release from
Renesas . This adds ES2.0 support.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/include/mach/r8a7795-gpio.h |  182 +--
 arch/arm/mach-rmobile/pfc-r8a7795.c   | 1465 +++--
 2 files changed, 897 insertions(+), 750 deletions(-)

diff --git a/arch/arm/mach-rmobile/include/mach/r8a7795-gpio.h 
b/arch/arm/mach-rmobile/include/mach/r8a7795-gpio.h
index 63e156da27..554063ab8f 100644
--- a/arch/arm/mach-rmobile/include/mach/r8a7795-gpio.h
+++ b/arch/arm/mach-rmobile/include/mach/r8a7795-gpio.h
@@ -2,7 +2,7 @@
  * arch/arm/include/asm/arch-rcar_gen3/r8a7795-gpio.h
  * This file defines pin function control of gpio.
  *
- * Copyright (C) 2015 Renesas Electronics Corporation
+ * Copyright (C) 2015-2016 Renesas Electronics Corporation
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -13,6 +13,8 @@
  * GPIO_FN_xx - GPIO used to select pin function
  * GPIO_GP_x_x - GPIO mapped to real I/O pin on CPU
  */
+
+/* V2(ES2.0) */
 enum {
GPIO_GP_0_0, GPIO_GP_0_1, GPIO_GP_0_2, GPIO_GP_0_3,
GPIO_GP_0_4, GPIO_GP_0_5, GPIO_GP_0_6, GPIO_GP_0_7,
@@ -26,6 +28,7 @@ enum {
GPIO_GP_1_16, GPIO_GP_1_17, GPIO_GP_1_18, GPIO_GP_1_19,
GPIO_GP_1_20, GPIO_GP_1_21, GPIO_GP_1_22, GPIO_GP_1_23,
GPIO_GP_1_24, GPIO_GP_1_25, GPIO_GP_1_26, GPIO_GP_1_27,
+   GPIO_GP_1_28,
 
GPIO_GP_2_0, GPIO_GP_2_1, GPIO_GP_2_2, GPIO_GP_2_3,
GPIO_GP_2_4, GPIO_GP_2_5, GPIO_GP_2_6, GPIO_GP_2_7,
@@ -81,6 +84,7 @@ enum {
GPIO_GFN_D0,
 
/* GPSR1 */
+   GPIO_GFN_CLKOUT,
GPIO_GFN_EX_WAIT0_A,
GPIO_GFN_WE1x,
GPIO_GFN_WE0x,
@@ -146,23 +150,23 @@ enum {
GPIO_GFN_SD0_CLK,
 
/* GPSR4 */
-   GPIO_FN_SD3_DS,
+   GPIO_GFN_SD3_DS,
GPIO_GFN_SD3_DAT7,
GPIO_GFN_SD3_DAT6,
GPIO_GFN_SD3_DAT5,
GPIO_GFN_SD3_DAT4,
-   GPIO_FN_SD3_DAT3,
-   GPIO_FN_SD3_DAT2,
-   GPIO_FN_SD3_DAT1,
-   GPIO_FN_SD3_DAT0,
-   GPIO_FN_SD3_CMD,
-   GPIO_FN_SD3_CLK,
+   GPIO_GFN_SD3_DAT3,
+   GPIO_GFN_SD3_DAT2,
+   GPIO_GFN_SD3_DAT1,
+   GPIO_GFN_SD3_DAT0,
+   GPIO_GFN_SD3_CMD,
+   GPIO_GFN_SD3_CLK,
GPIO_GFN_SD2_DS,
GPIO_GFN_SD2_DAT3,
GPIO_GFN_SD2_DAT2,
GPIO_GFN_SD2_DAT1,
GPIO_GFN_SD2_DAT0,
-   GPIO_FN_SD2_CMD,
+   GPIO_GFN_SD2_CMD,
GPIO_GFN_SD2_CLK,
 
/* GPSR5 */
@@ -194,8 +198,8 @@ enum {
GPIO_GFN_SCK0,
 
/* GPSR6 */
-   GPIO_GFN_USB31_OVC,
-   GPIO_GFN_USB31_PWEN,
+   GPIO_GFN_USB3_OVC,
+   GPIO_GFN_USB3_PWEN,
GPIO_GFN_USB30_OVC,
GPIO_GFN_USB30_PWEN,
GPIO_GFN_USB1_OVC,
@@ -224,8 +228,8 @@ enum {
GPIO_GFN_SSI_SDATA2_A,
GPIO_GFN_SSI_SDATA1_A,
GPIO_GFN_SSI_SDATA0,
-   GPIO_GFN_SSI_WS0129,
-   GPIO_GFN_SSI_SCK0129,
+   GPIO_GFN_SSI_WS01239,
+   GPIO_GFN_SSI_SCK01239,
 
/* GPSR7 */
GPIO_FN_HDMI1_CEC,
@@ -237,7 +241,7 @@ enum {
GPIO_IFN_AVB_MDC,
GPIO_FN_MSIOF2_SS2_C,
GPIO_IFN_AVB_MAGIC,
-   GPIO_FN_MSIOF2_S1_C,
+   GPIO_FN_MSIOF2_SS1_C,
GPIO_FN_SCK4_A,
GPIO_IFN_AVB_PHY_INT,
GPIO_FN_MSIOF2_SYNC_C,
@@ -248,6 +252,7 @@ enum {
GPIO_IFN_AVB_AVTP_MATCH_A,
GPIO_FN_MSIOF2_RXD_C,
GPIO_FN_CTS4x_A,
+   GPIO_FN_FSCLKST2x_A,
GPIO_IFN_AVB_AVTP_CAPTURE_A,
GPIO_FN_MSIOF2_TXD_C,
GPIO_FN_RTS4x_TANS_A,
@@ -257,50 +262,53 @@ enum {
GPIO_FN_VI4_DATA0_B,
GPIO_FN_CAN0_TX_B,
GPIO_FN_CANFD0_TX_B,
+   GPIO_FN_MSIOF3_SS2_E,
GPIO_IFN_IRQ1,
GPIO_FN_QPOLA,
GPIO_FN_DU_DISP,
GPIO_FN_VI4_DATA1_B,
GPIO_FN_CAN0_RX_B,
GPIO_FN_CANFD0_RX_B,
+   GPIO_FN_MSIOF3_SS1_E,
 
/* IPSR1 */
GPIO_IFN_IRQ2,
GPIO_FN_QCPV_QDE,
GPIO_FN_DU_EXODDF_DU_ODDF_DISP_CDE,
GPIO_FN_VI4_DATA2_B,
+   GPIO_FN_MSIOF3_SYNC_E,
GPIO_FN_PWM3_B,
GPIO_IFN_IRQ3,
GPIO_FN_QSTVB_QVE,
GPIO_FN_A25,
GPIO_FN_DU_DOTCLKOUT1,
GPIO_FN_VI4_DATA3_B,
+   GPIO_FN_MSIOF3_SCK_E,
GPIO_FN_PWM4_B,
GPIO_IFN_IRQ4,
GPIO_FN_QSTH_QHS,
GPIO_FN_A24,
GPIO_FN_DU_EXHSYNC_DU_HSYNC,
GPIO_FN_VI4_DATA4_B,
+   GPIO_FN_MSIOF3_RXD_E,
GPIO_FN_PWM5_B,
GPIO_IFN_IRQ5,
GPIO_FN_QSTB_QHE,
GPIO_FN_A23,
GPIO_FN_DU_EXVSYNC_DU_VSYNC,
GPIO_FN_VI4_DATA5_B,
+   GPIO_FN_FSCLKST2x_B,
+   GPIO_FN_MSIOF3_TXD_E,
GPIO_FN_PWM6_B,
GPIO_IFN_PWM0,
GPIO_FN_AVB_AVTP_PPS,
-   GPIO_FN_A22,
GPIO_FN_VI4_DATA6_B,
GPIO_FN_IECLK_B,
GPIO_IFN_PWM1_A,
-   GPIO_FN_A21,
GPIO_FN_HRX3_D,
GPIO_FN_VI4_DATA7_B,
GPIO_FN_IERX_B,
GPIO_IFN_PWM2_A,
-   GPIO_FN_PWMFSW0,
-

[U-Boot] [PATCH] usb: ehci: Add Renesas RCar M3/H3 EHCI support

2017-05-13 Thread Marek Vasut
From: Hiroyuki Yokoyama 

Add a USB controller driver for the EHCI block in R8A7795/R8A7796 SoC.
This is a stopgap measure until we have proper DT support, clock and
reset framework in place, at which point we can switch to ehci-generic.

Signed-off-by: Hiroyuki Yokoyama 
Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 drivers/usb/host/Kconfig  |   8 +++
 drivers/usb/host/Makefile |   1 +
 drivers/usb/host/ehci-rcar_gen3.c | 106 ++
 3 files changed, 115 insertions(+)
 create mode 100644 drivers/usb/host/ehci-rcar_gen3.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index fb5aa6f889..18971acf54 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -130,6 +130,14 @@ config USB_EHCI_MSM
  This driver supports combination of Chipidea USB controller
  and Synapsys USB PHY in host mode only.
 
+config USB_EHCI_RCAR_GEN3
+   bool "Support for Renesas RCar M3/H3 EHCI USB controller"
+   depends on RCAR_GEN3
+   default y
+   ---help---
+ Enables support for the on-chip EHCI controller on Renesas
+ R8A7795 and R8A7796 SoCs.
+
 config USB_EHCI_ZYNQ
bool "Support for Xilinx Zynq on-chip EHCI USB controller"
depends on ARCH_ZYNQ
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 58c0cf54c2..5d481757e5 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
 obj-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
 obj-$(CONFIG_USB_EHCI_VF) += ehci-vf.o
 obj-$(CONFIG_USB_EHCI_RMOBILE) += ehci-rmobile.o
+obj-$(CONFIG_USB_EHCI_RCAR_GEN3) += ehci-rcar_gen3.o
 obj-$(CONFIG_USB_EHCI_ZYNQ) += ehci-zynq.o
 
 # xhci
diff --git a/drivers/usb/host/ehci-rcar_gen3.c 
b/drivers/usb/host/ehci-rcar_gen3.c
new file mode 100644
index 00..525e7f3573
--- /dev/null
+++ b/drivers/usb/host/ehci-rcar_gen3.c
@@ -0,0 +1,106 @@
+/*
+ * drivers/usb/host/ehci-rcar_gen3.
+ * This file is EHCI HCD (Host Controller Driver) for USB.
+ *
+ * Copyright (C) 2015-2017 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "ehci.h"
+
+#define RCAR_GEN3_USB_BASE(n)  (0xEE08 + ((n) * 0x2))
+
+#define EHCI_USBCMD0x120
+
+#define CORE_SPD_RSM_TIMSET0x30c
+#define CORE_OC_TIMSET 0x310
+
+/* Register offset */
+#define AHB_OFFSET 0x200
+
+#define BASE_HSUSB 0xE659
+#define REG_LPSTS  (BASE_HSUSB + 0x0102)   /* 16bit */
+#define SUSPM  0x4000
+#define SUSPM_NORMAL   BIT(14)
+#define REG_UGCTRL2(BASE_HSUSB + 0x0184)   /* 32bit */
+#define USB0SEL0x0030
+#define USB0SEL_EHCI   0x0010
+
+#define SMSTPCR7   0xE615014C
+#define SMSTPCR700 BIT(0)  /* EHCI3 */
+#define SMSTPCR701 BIT(1)  /* EHCI2 */
+#define SMSTPCR702 BIT(2)  /* EHCI1 */
+#define SMSTPCR703 BIT(3)  /* EHCI0 */
+#define SMSTPCR704 BIT(4)  /* HSUSB */
+
+#define AHB_PLL_RSTBIT(1)
+
+#define USBH_INTBENBIT(2)
+#define USBH_INTAENBIT(1)
+
+#define AHB_INT_ENABLE 0x200
+#define AHB_USBCTR 0x20c
+
+int ehci_hcd_stop(int index)
+{
+#if defined(CONFIG_R8A7795)
+   const u32 mask = SMSTPCR703 | SMSTPCR702 | SMSTPCR701 | SMSTPCR700;
+#else
+   const u32 mask = SMSTPCR703 | SMSTPCR702;
+#endif
+   const u32 base = RCAR_GEN3_USB_BASE(index);
+   int ret;
+
+   /* Reset EHCI */
+   setbits_le32((uintptr_t)(base + EHCI_USBCMD), CMD_RESET);
+   ret = wait_for_bit("ehci-rcar", (void *)(uintptr_t)base + EHCI_USBCMD,
+  CMD_RESET, false, 10, true);
+   if (ret) {
+   printf("ehci-rcar: reset failed (index=%i, ret=%i).\n",
+  index, ret);
+   }
+
+   setbits_le32(SMSTPCR7, BIT(3 - index));
+
+   if ((readl(SMSTPCR7) & mask) == mask)
+   setbits_le32(SMSTPCR7, SMSTPCR704);
+
+   return 0;
+}
+
+int ehci_hcd_init(int index, enum usb_init_type init,
+ struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+{
+   const void __iomem *base =
+   (void __iomem *)(uintptr_t)RCAR_GEN3_USB_BASE(index);
+   struct usb_ehci *ehci = (struct usb_ehci *)(uintptr_t)base;
+
+   clrbits_le32(SMSTPCR7, BIT(3 - index));
+   clrbits_le32(SMSTPCR7, SMSTPCR704);
+
+   *hccr = (struct ehci_hccr *)((uintptr_t)&ehci->caplength);
+   *hcor = (struct ehci_hcor *)((uintptr_t)*hccr +
+   HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
+
+   /* Enable interrupt */
+   setbits_le32(base + AHB_INT_ENABLE, USBH_INTBEN | USBH_INTAEN);
+   writel(0x014e029b, base + CORE_SPD_RSM_TIMSET);
+   writel(0x000209ab, base + CORE_O

[U-Boot] [PATCH] serial: sh: Add r8a7796 support

2017-05-13 Thread Marek Vasut
From: Hiroyuki Yokoyama 

Signed-off-by: Hiroyuki Yokoyama 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
---
 drivers/serial/serial_sh.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/serial_sh.h b/drivers/serial/serial_sh.h
index 348f544d0a..4d27122243 100644
--- a/drivers/serial/serial_sh.h
+++ b/drivers/serial/serial_sh.h
@@ -226,7 +226,8 @@ struct uart_port {
 # define SCSCR_INIT(port)  0x38/* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
 #elif defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
defined(CONFIG_R8A7792) || defined(CONFIG_R8A7793) || \
-   defined(CONFIG_R8A7794) || defined(CONFIG_R8A7795)
+   defined(CONFIG_R8A7794) || defined(CONFIG_R8A7795) || \
+   defined(CONFIG_R8A7796)
 # if defined(CONFIG_SCIF_A)
 #  define SCIF_ORER0x0200
 # else
-- 
2.11.0

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


[U-Boot] [PATCH] net: ravb: Add Renesas Ethernet RAVB driver

2017-05-13 Thread Marek Vasut
Add driver for the Renesas Ethernet AVB block found in RCar H3/M3.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
Cc: Tom Rini 
Cc: Joe Hershberger 
Based on work of:
Hiroyuki Yokoyama 
Takeshi Kihara 
Kazuya Mizuguchi 
---
 drivers/net/Kconfig  |   8 +
 drivers/net/Makefile |   1 +
 drivers/net/ravb.c   | 601 +++
 3 files changed, 610 insertions(+)
 create mode 100644 drivers/net/ravb.c

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 9cd0d94cbd..d7a33d69fb 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -225,4 +225,12 @@ config GMAC_ROCKCHIP
  This driver provides Rockchip SoCs network support based on the
  Synopsys Designware driver.
 
+config RENESAS_RAVB
+   bool "Renesas Ethernet AVB MAC"
+   depends on DM_ETH && RCAR_GEN3
+   select PHYLIB
+   help
+ This driver implements support for the Ethernet AVB block in
+ Renesas M3 and H3 SoCs.
+
 endif # NETDEVICES
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index aedb2cc90d..0aaac6bd81 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_RTL8169) += rtl8169.o
 obj-$(CONFIG_ETH_SANDBOX) += sandbox.o
 obj-$(CONFIG_ETH_SANDBOX_RAW) += sandbox-raw.o
 obj-$(CONFIG_SH_ETHER) += sh_eth.o
+obj-$(CONFIG_RENESAS_RAVB) += ravb.o
 obj-$(CONFIG_SMC9) += smc9.o
 obj-$(CONFIG_SMC911X) += smc911x.o
 obj-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
new file mode 100644
index 00..ab45a31d6a
--- /dev/null
+++ b/drivers/net/ravb.c
@@ -0,0 +1,601 @@
+/*
+ * drivers/net/ravb.c
+ * This file is driver for Renesas Ethernet AVB.
+ *
+ * Copyright (C) 2015-2017  Renesas Electronics Corporation
+ *
+ * Based on the SuperH Ethernet driver.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Registers */
+#define RAVB_REG_CCC   0x000
+#define RAVB_REG_DBAT  0x004
+#define RAVB_REG_CSR   0x00C
+#define RAVB_REG_APSR  0x08C
+#define RAVB_REG_RCR   0x090
+#define RAVB_REG_TGC   0x300
+#define RAVB_REG_TCCR  0x304
+#define RAVB_REG_RIC0  0x360
+#define RAVB_REG_RIC1  0x368
+#define RAVB_REG_RIC2  0x370
+#define RAVB_REG_TIC   0x378
+#define RAVB_REG_ECMR  0x500
+#define RAVB_REG_RFLR  0x508
+#define RAVB_REG_ECSIPR0x518
+#define RAVB_REG_PIR   0x520
+#define RAVB_REG_GECMR 0x5b0
+#define RAVB_REG_MAHR  0x5c0
+#define RAVB_REG_MALR  0x5c8
+
+#define CCC_OPC_CONFIG BIT(0)
+#define CCC_OPC_OPERATION  BIT(1)
+#define CCC_BOCBIT(20)
+
+#define CSR_OPS0x000F
+#define CSR_OPS_CONFIG BIT(1)
+
+#define TCCR_TSRQ0 BIT(0)
+
+#define RFLR_RFL_MIN   0x05EE
+
+#define PIR_MDIBIT(3)
+#define PIR_MDOBIT(2)
+#define PIR_MMDBIT(1)
+#define PIR_MDCBIT(0)
+
+#define ECMR_TRCCM BIT(26)
+#define ECMR_RZPF  BIT(20)
+#define ECMR_PFR   BIT(18)
+#define ECMR_RXF   BIT(17)
+#define ECMR_REBIT(6)
+#define ECMR_TEBIT(5)
+#define ECMR_DMBIT(1)
+#define ECMR_CHG_DM(ECMR_TRCCM | ECMR_RZPF | ECMR_PFR | ECMR_RXF)
+
+/* DMA Descriptors */
+#define RAVB_NUM_BASE_DESC 16
+#define RAVB_NUM_TX_DESC   8
+#define RAVB_NUM_RX_DESC   8
+
+#define RAVB_TX_QUEUE_OFFSET   0
+#define RAVB_RX_QUEUE_OFFSET   4
+
+#define RAVB_DESC_DT(n)((n) << 28)
+#define RAVB_DESC_DT_FSINGLE   RAVB_DESC_DT(0x7)
+#define RAVB_DESC_DT_LINKFIX   RAVB_DESC_DT(0x9)
+#define RAVB_DESC_DT_EOS   RAVB_DESC_DT(0xa)
+#define RAVB_DESC_DT_FEMPTYRAVB_DESC_DT(0xc)
+#define RAVB_DESC_DT_EEMPTYRAVB_DESC_DT(0x3)
+#define RAVB_DESC_DT_MASK  RAVB_DESC_DT(0xf)
+
+#define RAVB_DESC_DS(n)(((n) & 0xfff) << 0)
+#define RAVB_DESC_DS_MASK  0xfff
+
+#define RAVB_RX_DESC_MSC_MCBIT(23)
+#define RAVB_RX_DESC_MSC_CEEF  BIT(22)
+#define RAVB_RX_DESC_MSC_CRL   BIT(21)
+#define RAVB_RX_DESC_MSC_FRE   BIT(20)
+#define RAVB_RX_DESC_MSC_RTLF  BIT(19)
+#define RAVB_RX_DESC_MSC_RTSF  BIT(18)
+#define RAVB_RX_DESC_MSC_RFE   BIT(17)
+#define RAVB_RX_DESC_MSC_CRC   BIT(16)
+#define RAVB_RX_DESC_MSC_MASK  (0xff << 16)
+
+#define RAVB_RX_DESC_MSC_RX_ERR_MASK \
+   (RAVB_RX_DESC_MSC_CRC | RAVB_RX_DESC_MSC_RFE | RAVB_RX_DESC_MSC_RTLF | \
+RAVB_RX_DESC_MSC_RTSF | RAVB_RX_DESC_MSC_CEEF)
+
+#define RAVB_TX_TIMEOUT_

[U-Boot] [PATCH 5/5] mmc: sh_sdhi: Add SDHI support

2017-05-13 Thread Marek Vasut
From: Kouei Abe 

R-Car Gen3 series have four SD card interfaces (SDHI0 to SDHI3),
two of which can also be used as MMC interfaces (SDHI2 and SDHI3).
This adds High-speed mode SD clock frequency between 25MHz and 50MHz,
8bit/4bit bus width, high capacity and low voltage device support.

Signed-off-by: Kouei Abe 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
Cc: Jaehoon Chung 
---
 drivers/mmc/sh_sdhi.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
index c64beb6e2a..d181b63905 100644
--- a/drivers/mmc/sh_sdhi.c
+++ b/drivers/mmc/sh_sdhi.c
@@ -698,6 +698,19 @@ static const struct mmc_ops sh_sdhi_ops = {
.init   = sh_sdhi_initialize,
 };
 
+#ifdef CONFIG_RCAR_GEN3
+static struct mmc_config sh_sdhi_cfg = {
+   .name   = DRIVER_NAME,
+   .ops= &sh_sdhi_ops,
+   .f_min  = CLKDEV_INIT,
+   .f_max  = CLKDEV_HS_DATA,
+   .voltages   = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
+   .host_caps  = MMC_MODE_4BIT | MMC_MODE_8BIT | MMC_MODE_HS |
+ MMC_MODE_HS_52MHz,
+   .part_type  = PART_TYPE_DOS,
+   .b_max  = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};
+#else
 static struct mmc_config sh_sdhi_cfg = {
.name   = DRIVER_NAME,
.ops= &sh_sdhi_ops,
@@ -708,6 +721,7 @@ static struct mmc_config sh_sdhi_cfg = {
.part_type  = PART_TYPE_DOS,
.b_max  = CONFIG_SYS_MMC_MAX_BLK_COUNT,
 };
+#endif
 
 int sh_sdhi_init(unsigned long addr, int ch, unsigned long quirks)
 {
-- 
2.11.0

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


[U-Boot] [PATCH 4/5] mmc: sh_sdhi: Add MMC version 5.0 support

2017-05-13 Thread Marek Vasut
From: Kouei Abe 

Renesas SDHI SD/MMC driver did not support MMC version 5.0 devices.
This adds MMC version 5.0 device support.

Signed-off-by: Kouei Abe 
Signed-off-by: Hiroyuki Yokoyama 
Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
Cc: Jaehoon Chung 
---
 arch/arm/mach-rmobile/include/mach/sh_sdhi.h |  7 ++-
 drivers/mmc/sh_sdhi.c| 24 +++-
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h 
b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
index a5ea45b707..1fb0648b12 100644
--- a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
+++ b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
@@ -50,8 +50,10 @@
 /* SDHI CMD VALUE */
 #define CMD_MASK   0x
 #define SDHI_APP   0x0040
+#define SDHI_MMC_SEND_OP_COND  0x0701
 #define SDHI_SD_APP_SEND_SCR   0x0073
 #define SDHI_SD_SWITCH 0x1C06
+#define SDHI_MMC_SEND_EXT_CSD  0x1C08
 
 /* SDHI_PORTSEL */
 #define USE_1PORT  (1 << 8) /* 1 port */
@@ -120,7 +122,10 @@
 #define CLK_ENABLE (1 << 8)
 
 /* SDHI_OPTION */
-#define OPT_BUS_WIDTH_1(1 << 15)   /* bus width = 
1 bit */
+#define OPT_BUS_WIDTH_M(5 << 13)   /* 101b 
(15-13bit) */
+#define OPT_BUS_WIDTH_1(4 << 13)   /* bus width = 
1 bit */
+#define OPT_BUS_WIDTH_4(0 << 13)   /* bus width = 
4 bit */
+#define OPT_BUS_WIDTH_8(1 << 13)   /* bus width = 
8 bit */
 
 /* SDHI_ERR_STS1 */
 #define ERR_STS1_CRC_ERROR ((1 << 11) | (1 << 10) | (1 << 9) | \
diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
index d1dd0f0fc3..c64beb6e2a 100644
--- a/drivers/mmc/sh_sdhi.c
+++ b/drivers/mmc/sh_sdhi.c
@@ -489,6 +489,13 @@ static unsigned short sh_sdhi_set_cmd(struct sh_sdhi_host 
*host,
else /* SD_SWITCH */
opc = SDHI_SD_SWITCH;
break;
+   case MMC_CMD_SEND_OP_COND:
+   opc = SDHI_MMC_SEND_OP_COND;
+   break;
+   case MMC_CMD_SEND_EXT_CSD:
+   if (data)
+   opc = SDHI_MMC_SEND_EXT_CSD;
+   break;
default:
break;
}
@@ -513,6 +520,7 @@ static unsigned short sh_sdhi_data_trans(struct 
sh_sdhi_host *host,
case MMC_CMD_READ_SINGLE_BLOCK:
case SDHI_SD_APP_SEND_SCR:
case SDHI_SD_SWITCH: /* SD_SWITCH */
+   case SDHI_MMC_SEND_EXT_CSD:
ret = sh_sdhi_single_read(host, data);
break;
default:
@@ -648,12 +656,18 @@ static int sh_sdhi_set_ios(struct mmc *mmc)
if (ret)
return -EINVAL;
 
-   if (mmc->bus_width == 4)
-   sh_sdhi_writew(host, SDHI_OPTION, ~OPT_BUS_WIDTH_1 &
-  sh_sdhi_readw(host, SDHI_OPTION));
+   if (mmc->bus_width == 8)
+   sh_sdhi_writew(host, SDHI_OPTION,
+  OPT_BUS_WIDTH_8 | (~OPT_BUS_WIDTH_M &
+  sh_sdhi_readw(host, SDHI_OPTION)));
+   else if (mmc->bus_width == 4)
+   sh_sdhi_writew(host, SDHI_OPTION,
+  OPT_BUS_WIDTH_4 | (~OPT_BUS_WIDTH_M &
+  sh_sdhi_readw(host, SDHI_OPTION)));
else
-   sh_sdhi_writew(host, SDHI_OPTION, OPT_BUS_WIDTH_1 |
-  sh_sdhi_readw(host, SDHI_OPTION));
+   sh_sdhi_writew(host, SDHI_OPTION,
+  OPT_BUS_WIDTH_1 | (~OPT_BUS_WIDTH_M &
+  sh_sdhi_readw(host, SDHI_OPTION)));
 
debug("clock = %d, buswidth = %d\n", mmc->clock, mmc->bus_width);
 
-- 
2.11.0

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


[U-Boot] [PATCH 3/5] mmc: sh_sdhi: Add 64-bit access to sd_buf support

2017-05-13 Thread Marek Vasut
From: Kouei Abe 

Renesas SDHI SD/MMC driver has 16-bit width bus access to SD_BUF.
This adds 64-bit width bus access to SD_BUF.

Signed-off-by: Kouei Abe 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
Cc: Jaehoon Chung 
---
 arch/arm/mach-rmobile/include/mach/sh_sdhi.h |  8 +++--
 drivers/mmc/sh_sdhi.c| 53 ++--
 2 files changed, 48 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h 
b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
index 057bf3f8bb..a5ea45b707 100644
--- a/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
+++ b/arch/arm/mach-rmobile/include/mach/sh_sdhi.h
@@ -1,9 +1,9 @@
 /*
  * drivers/mmc/sh-sdhi.h
  *
- * SD/MMC driver for Reneas rmobile ARM SoCs
+ * SD/MMC driver for Renesas rmobile ARM SoCs
  *
- * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ * Copyright (C) 2013-2017 Renesas Electronics Corporation
  * Copyright (C) 2008-2009 Renesas Solutions Corp.
  *
  * SPDX-License-Identifier:GPL-2.0
@@ -162,7 +162,9 @@
 #defineCLKDEV_INIT 40  /* 100 - 400 
KHz */
 
 /* For quirk */
-#define SH_SDHI_QUIRK_16BIT_BUF(1)
+#define SH_SDHI_QUIRK_16BIT_BUFBIT(0)
+#define SH_SDHI_QUIRK_64BIT_BUFBIT(1)
+
 int sh_sdhi_init(unsigned long addr, int ch, unsigned long quirks);
 
 #endif /* _SH_SDHI_H */
diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
index 7f0b4c2603..d1dd0f0fc3 100644
--- a/drivers/mmc/sh_sdhi.c
+++ b/drivers/mmc/sh_sdhi.c
@@ -3,7 +3,7 @@
  *
  * SD/MMC driver for Renesas rmobile ARM SoCs.
  *
- * Copyright (C) 2011,2013-2014 Renesas Electronics Corporation
+ * Copyright (C) 2011,2013-2017 Renesas Electronics Corporation
  * Copyright (C) 2014 Nobuhiro Iwamatsu 
  * Copyright (C) 2008-2009 Renesas Solutions Corp.
  *
@@ -29,6 +29,17 @@ struct sh_sdhi_host {
unsigned char sd_error;
unsigned char detect_waiting;
 };
+
+static inline void sh_sdhi_writeq(struct sh_sdhi_host *host, int reg, u64 val)
+{
+   writeq(val, host->addr + (reg << host->bus_shift));
+}
+
+static inline u64 sh_sdhi_readq(struct sh_sdhi_host *host, int reg)
+{
+   return readq(host->addr + (reg << host->bus_shift));
+}
+
 static inline void sh_sdhi_writew(struct sh_sdhi_host *host, int reg, u16 val)
 {
writew(val, host->addr + (reg << host->bus_shift));
@@ -261,6 +272,7 @@ static int sh_sdhi_single_read(struct sh_sdhi_host *host, 
struct mmc_data *data)
long time;
unsigned short blocksize, i;
unsigned short *p = (unsigned short *)data->dest;
+   u64 *q = (u64 *)data->dest;
 
if ((unsigned long)p & 0x0001) {
debug(DRIVER_NAME": %s: The data pointer is unaligned.",
@@ -281,8 +293,12 @@ static int sh_sdhi_single_read(struct sh_sdhi_host *host, 
struct mmc_data *data)
 
host->wait_int = 0;
blocksize = sh_sdhi_readw(host, SDHI_SIZE);
-   for (i = 0; i < blocksize / 2; i++)
-   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
+   if (host->quirks & SH_SDHI_QUIRK_64BIT_BUF)
+   for (i = 0; i < blocksize / 8; i++)
+   *q++ = sh_sdhi_readq(host, SDHI_BUF0);
+   else
+   for (i = 0; i < blocksize / 2; i++)
+   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
 
time = sh_sdhi_wait_interrupt_flag(host);
if (time == 0 || host->sd_error != 0)
@@ -297,6 +313,7 @@ static int sh_sdhi_multi_read(struct sh_sdhi_host *host, 
struct mmc_data *data)
long time;
unsigned short blocksize, i, sec;
unsigned short *p = (unsigned short *)data->dest;
+   u64 *q = (u64 *)data->dest;
 
if ((unsigned long)p & 0x0001) {
debug(DRIVER_NAME": %s: The data pointer is unaligned.",
@@ -319,8 +336,12 @@ static int sh_sdhi_multi_read(struct sh_sdhi_host *host, 
struct mmc_data *data)
 
host->wait_int = 0;
blocksize = sh_sdhi_readw(host, SDHI_SIZE);
-   for (i = 0; i < blocksize / 2; i++)
-   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
+   if (host->quirks & SH_SDHI_QUIRK_64BIT_BUF)
+   for (i = 0; i < blocksize / 8; i++)
+   *q++ = sh_sdhi_readq(host, SDHI_BUF0);
+   else
+   for (i = 0; i < blocksize / 2; i++)
+   *p++ = sh_sdhi_readw(host, SDHI_BUF0);
}
 
return 0;
@@ -332,6 +353,7 @@ static int sh_sdhi_single_write(struct sh_sdhi_host *host,
long time;
unsigned short blocksize, i;
const unsigned short *p = (const unsigned short *)data->src;
+   const u64 *q = (const u64 *)data->src;
 
if ((unsigned long)p & 0x0001) {
debug(DRIVER_NAME": %s: The data pointer is unaligned.",
@@ -356,8 +378,12 @@ static int sh_sdhi_single_write(struct sh_sdhi_host *host,
 
host->wait_int = 0;
  

[U-Boot] [PATCH 2/5] mmc: sh_sdhi: Set SD_INFOx interrupt mask before command starting

2017-05-13 Thread Marek Vasut
From: Kouei Abe 

When setting interrupt mask after command starting, an unintended
interrupt status sometimes occurs.

Signed-off-by: Kouei Abe 
Signed-off-by: Hiroyuki Yokoyama 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
Cc: Jaehoon Chung 
---
 drivers/mmc/sh_sdhi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
index 25224e2e1d..7f0b4c2603 100644
--- a/drivers/mmc/sh_sdhi.c
+++ b/drivers/mmc/sh_sdhi.c
@@ -546,8 +546,6 @@ static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
break;
}
 
-   sh_sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
-
host->wait_int = 0;
sh_sdhi_writew(host, SDHI_INFO1_MASK,
   ~INFO1M_RESP_END & sh_sdhi_readw(host, SDHI_INFO1_MASK));
@@ -557,6 +555,8 @@ static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
   INFO2M_RESP_TIMEOUT | INFO2M_ILA) &
   sh_sdhi_readw(host, SDHI_INFO2_MASK));
 
+   sh_sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
+
time = sh_sdhi_wait_interrupt_flag(host);
if (!time)
return sh_sdhi_error_manage(host);
-- 
2.11.0

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


[U-Boot] [PATCH 1/5] mmc: sh_sdhi: Fix Kconfig entry

2017-05-13 Thread Marek Vasut
The Kconfig entry depends on RMOBILE, but this was renamed
to ARCH_RMOBILE in commit 1cc95f6e1b38 (ARM: Rmobile: Rename
CONFIG_RMOBILE to CONFIG_ARCH_RMOBILE) . Fix this omission.

Signed-off-by: Marek Vasut 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
Cc: Jaehoon Chung 
---
 drivers/mmc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 6ac26dd137..b2d70a37bd 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -159,7 +159,7 @@ config MMC_OMAP36XX_PINS
 
 config SH_SDHI
bool "SuperH/Renesas ARM SoCs on-chip SDHI host controller support"
-   depends on RMOBILE
+   depends on ARCH_RMOBILE
help
  Support for the on-chip SDHI host controller on SuperH/Renesas ARM 
SoCs platform
 
-- 
2.11.0

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


[U-Boot] [PATCH] gpio: rcar_gen3: Fix GPIO read support

2017-05-13 Thread Marek Vasut
From: Kouei Abe 

This patch fixes to read the GPIO status after confirming the
INOUT setting.

Signed-off-by: Kouei Abe 
Signed-off-by: Hiroyuki Yokoyama 
Cc: Hiroyuki Yokoyama 
Cc: Nobuhiro Iwamatsu 
Cc: Tom Rini 
---
 drivers/gpio/sh_pfc.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/sh_pfc.c b/drivers/gpio/sh_pfc.c
index a0eac137c2..ad8da9ef28 100644
--- a/drivers/gpio/sh_pfc.c
+++ b/drivers/gpio/sh_pfc.c
@@ -66,17 +66,18 @@ static void gpio_write_raw_reg(void *mapped_reg,
 }
 
 static int gpio_read_bit(struct pinmux_data_reg *dr,
+unsigned long offset,
 unsigned long in_pos)
 {
unsigned long pos;
 
pos = dr->reg_width - (in_pos + 1);
 
-   debug("read_bit: addr = %lx, pos = %ld, "
-"r_width = %ld\n", dr->reg, pos, dr->reg_width);
+   debug("read_bit: addr = %lx, pos = %ld, r_width = %ld\n",
+ dr->reg + offset, pos, dr->reg_width);
 
-   return
-   (gpio_read_raw_reg(dr->mapped_reg + 0x4, dr->reg_width) >> pos) & 1;
+   return (gpio_read_raw_reg(dr->mapped_reg + offset,
+ dr->reg_width) >> pos) & 1;
 }
 
 static void gpio_write_bit(struct pinmux_data_reg *dr,
@@ -559,12 +560,16 @@ static int sh_gpio_direction_output(unsigned offset, int 
value)
 static int sh_gpio_get_value(struct pinmux_info *gpioc, unsigned gpio)
 {
struct pinmux_data_reg *dr = NULL;
-   int bit = 0;
+   int bit = 0, offset = 0;
 
if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0)
return -1;
+#if defined(CONFIG_RCAR_GEN3)
+   if ((gpioc->gpios[gpio].flags & PINMUX_FLAG_TYPE) == PINMUX_TYPE_INPUT)
+   offset += 4;
+#endif
 
-   return gpio_read_bit(dr, bit);
+   return gpio_read_bit(dr, offset, bit);
 }
 
 static int sh_gpio_get(unsigned offset)
-- 
2.11.0

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


[U-Boot] [PATCH] omap3: omap3_logic: switch to using TI_COMMON_CMD_OPTION

2017-05-13 Thread Adam Ford
Enable TI_COMMON_CMD_OPTIONS and remove similar options
from the defconfig. Updated with savedefconfig

CMD_USB isn't enabled yet.  I have some testing to do with
musb.

Signed-off-by: Adam Ford 

diff --git a/board/logicpd/omap3som/Kconfig b/board/logicpd/omap3som/Kconfig
index 03d272a..68d40dc 100644
--- a/board/logicpd/omap3som/Kconfig
+++ b/board/logicpd/omap3som/Kconfig
@@ -9,4 +9,6 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
default "omap3_logic"
 
+source "board/ti/common/Kconfig"
+
 endif
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index 561bdfb..50450c9 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -1,11 +1,11 @@
 CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
+CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_OMAP3_LOGIC=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
 CONFIG_DEFAULT_DEVICE_TREE="logicpd-torpedo-37xx-devkit"
-CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="NAND"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
@@ -16,29 +16,14 @@ CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="OMAP Logic # "
-CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
-CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_MMC=y
-CONFIG_CMD_PART=y
-CONFIG_CMD_SPI=y
-CONFIG_CMD_I2C=y
+# CONFIG_CMD_USB is not set
 # CONFIG_CMD_FPGA is not set
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
-CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
-CONFIG_EFI_PARTITION=y
 CONFIG_OF_CONTROL=y
 # CONFIG_BLK is not set
 CONFIG_DM_I2C=y
-- 
2.7.4

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


[U-Boot] [PATCH] power: twl4030: Add imply CMD_POWEROFF when TWL4030 is enabled

2017-05-13 Thread Adam Ford
Now that CMD_POWEROFF can turn off the twl4030, let's imply that
just incase someone wants to disable it.

Signed-off-by: Adam Ford 
---

 drivers/power/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index a7d56e6..d8c107e 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -311,6 +311,7 @@ config SY8106A_VOUT1_VOLT
 config TWL4030_POWER
depends on OMAP34XX
bool "Enable driver for TI TWL4030 power management chip"
+   imply CMD_POWEROFF
---help---
The TWL4030 in a combination audio CODEC/power management with
GPIO and it is commonly used with the OMAP3 family of processors
-- 
2.7.4

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


Re: [U-Boot] [PATCH 17/17] Kconfig: OMAP: USB: Migrate CONFIG_USB_EHCI_OMAP to Kconfig

2017-05-13 Thread Marek Vasut
On 05/13/2017 04:33 AM, Tom Rini wrote:
> Follow the exiting logic for the i.MX options when migrating this
> option.
> 
> Cc: Marek Vasut 
> Signed-off-by: Tom Rini 

Reviewed-by: Marek Vasut 

Any reason why you only converted the OMAP and iMX6 stuff and not the
rest, like MXC, MXS etc. ?

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 15/17] Kconfig: USB: Migrate CONFIG_USB_EHCI_HCD users to Kconfig

2017-05-13 Thread Marek Vasut
On 05/13/2017 04:33 AM, Tom Rini wrote:
> Migrate the rest of the users of CONFIG_USB_EHCI_HCD over to Kconfig.
> For a few SoCs, imply or default y this if USB is enabled.  In some
> cases we had not already migrated to CONFIG_USB so do that as well.
> 
> Cc: Marek Vasut 
> Signed-off-by: Tom Rini 

Reviewed-by: Marek Vasut 

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 16/17] Kconfig: USB: Migrate existing USB_EHCI_xxx options

2017-05-13 Thread Marek Vasut
On 05/13/2017 04:33 AM, Tom Rini wrote:
> The following options are migrated over fully now:
> - USB_EHCI_ATMEL
> - USB_EHCI_MARVELL
> - USB_EHCI_MX6
> - USB_EHCI_MX7
> - USB_EHCI_MSM
> - USB_EHCI_ZYNQ
> - USB_EHCI_GENERIC
> 
> This also requires fixing the depends on USB_EHCI_MARVELL as it's used
> by Orion5X and Kirkwood as well.
> 
> Cc: Marek Vasut 
> Signed-off-by: Tom Rini 

Reviewed-by: Marek Vasut 

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 14/17] Kconfig: USB: Migrate CONFIG_USB_EHCI to CONFIG_USB_EHCI_HCD

2017-05-13 Thread Marek Vasut
On 05/13/2017 04:33 AM, Tom Rini wrote:
> In order to be able to migrate the various SoC EHCI CONFIG options we
> first need to finish the switch from CONFIG_USB_EHCI to
> CONFIG_USB_EHCI_HCD.
> 
> Cc: Marek Vasut 
> Signed-off-by: Tom Rini 

Reviewed-by: Marek Vasut 

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] marvell: armada385: Add the Turris Omnia board

2017-05-13 Thread Andreas Färber
Hi Marek,

Thanks for working on this.

Am 12.05.2017 um 16:10 schrieb Marek Behún:
> The Turris Omnia is a open-source router created by CZ.NIC.
> 
> The code is based on the Marvell/db-88f6820-gp by Stefan Roese
> with modifications from Tomas Hlavacek in the CZ.NIC turris-omnia-uboot
> repository, which can be found at
> https://gitlab.labs.nic.cz/turris/turris-omnia-uboot
> 
> The code does not yet support reading the ATSHA204 cryptochip, which
> stores the serial number of the device, as well as the base MAC
> address.
> 
> Also, the device does by default use btrfs as the main filesystem, on
> which kernel and device tree is stored. U-Boot does not yes support

"not yet"

> btrfs, thus the configuration header defaults to ext4.
> 

Given the above history remarks, shouldn't there also be a Signed-off-by
from Tomas before yours?

> Signed-off-by: Marek Behun 
> ---
>  arch/arm/dts/armada-385-turris-omnia.dts | 428 
> +++

Please indicate in the commit message where exactly this file comes from
- tree and tag/commit. Were any changes done compared to mainline Linux?

>  arch/arm/mach-mvebu/Kconfig  |   7 +
>  board/CZ.NIC/turris_omnia/Makefile   |   7 +
>  board/CZ.NIC/turris_omnia/kwbimage.cfg   |  12 +
>  board/CZ.NIC/turris_omnia/turris_omnia.c | 364 ++
>  configs/turris_omnia_defconfig   |  59 +
>  include/configs/turris_omnia.h   | 181 +
>  7 files changed, 1058 insertions(+)
>  create mode 100644 arch/arm/dts/armada-385-turris-omnia.dts
>  create mode 100644 board/CZ.NIC/turris_omnia/Makefile
>  create mode 100644 board/CZ.NIC/turris_omnia/kwbimage.cfg
>  create mode 100644 board/CZ.NIC/turris_omnia/turris_omnia.c
>  create mode 100644 configs/turris_omnia_defconfig
>  create mode 100644 include/configs/turris_omnia.h
> 
> diff --git a/arch/arm/dts/armada-385-turris-omnia.dts 
> b/arch/arm/dts/armada-385-turris-omnia.dts
> new file mode 100644
> index 000..369b69a
> --- /dev/null
> +++ b/arch/arm/dts/armada-385-turris-omnia.dts
> @@ -0,0 +1,428 @@
> +/*
> + * Device Tree file for the Turris Omnia
> + *
> + * Copyright (C) 2014 Marvell
> + *
> + * Marek Behun  + * Gregory CLEMENT 
[...]
> diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h
> new file mode 100644
> index 000..0c7960d
> --- /dev/null
> +++ b/include/configs/turris_omnia.h
> @@ -0,0 +1,181 @@
> +/*
> + * Copyright (C) 2017 Marek Behun 
> + * Copyright (C) 2016 Tomas Hlavacek 
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#ifndef _CONFIG_TURRIS_OMNIA_H
> +#define _CONFIG_TURRIS_OMNIA_H
> +
> +/*
> + * High Level Configuration Options (easy to change)
> + */
> +
> +#define CONFIG_DISPLAY_BOARDINFO_LATE
> +#define CONFIG_LIB_RAND
> +#define CONFIG_NET_RANDOM_ETHADDR
> +#define CONFIG_CMD_EXT4
> +
> +/*
> + * TEXT_BASE needs to be below 16MiB, since this area is scrubbed
> + * for DDR ECC byte filling in the SPL before loading the main
> + * U-Boot into it.
> + */
> +#define  CONFIG_SYS_TEXT_BASE0x0080
> +#define CONFIG_SYS_TCLK  25000   /* 250MHz */
> +
> +/*
> + * Commands configuration
> + */
> +#define CONFIG_CMD_ENV
> +#define CONFIG_CMD_PCI
> +#define CONFIG_SCSI
> +
> +/* RAW initrd support */
> +#define CONFIG_SUPPORT_RAW_INITRD
> +
> +/*#define CONFIG_ATSHA204
> +#define CONFIG_ATSHA204_ADDR 0x64*/

The address shouldn't hurt to define, but please drop the commented-out
not-yet-upstream define. Chances are, as a new driver, it should go into
the Kconfig.

> +
> +/* I2C */
> +#define CONFIG_DM_I2C
> +#define CONFIG_SYS_I2C_MVTWSI
> +
> +/* Watchdog */
> +#ifndef CONFIG_SPL_BUILD
> +#define CONFIG_HW_WATCHDOG
> +#define CONFIG_ORION_WATCHDOG
> +#endif
> +
> +/* SPI NOR flash default params, used by sf commands */
> +#define CONFIG_SF_DEFAULT_SPEED  100
> +#define CONFIG_SF_DEFAULT_MODE   SPI_MODE_3
> +#define CONFIG_SPI_FLASH_SPANSION
> +
> +/*
> + * SDIO/MMC Card Configuration
> + */
> +#define CONFIG_SYS_MMC_BASE  MVEBU_SDIO_BASE
> +
> +/*
> + * SATA/SCSI/AHCI configuration
> + */
> +#define CONFIG_LIBATA
> +#define CONFIG_SCSI_AHCI
> +#define CONFIG_SCSI_AHCI_PLAT
> +#define CONFIG_SYS_SCSI_MAX_SCSI_ID  2
> +#define CONFIG_SYS_SCSI_MAX_LUN  1
> +#define CONFIG_SYS_SCSI_MAX_DEVICE   (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
> +  CONFIG_SYS_SCSI_MAX_LUN)
> +
> +/* Partition support */
> +
> +/* Additional FS support/configuration */
> +#define CONFIG_SUPPORT_VFAT
> +
> +/* USB/EHCI configuration */
> +#define CONFIG_EHCI_IS_TDI
> +
> +/* Environment in SPI NOR flash */
> +#define CONFIG_ENV_IS_IN_SPI_FLASH
> +#define CONFIG_ENV_OFFSET(3*(1 << 18)) /* 768KiB in */
> +#define CONFIG_ENV_SIZE  (64 << 10) /* 64KiB */
> +#define CONFIG_ENV_SECT_SIZE (256 << 10) /* 256KiB sectors */
> +
> +#define CONFIG_PHY_MARVELL   /* there is a marvel

Re: [U-Boot] Machine ID

2017-05-13 Thread Chris Packham
On Fri, May 12, 2017 at 9:53 PM, Vic  wrote:
> Hi All.
>
> I'm having difficulty with getting a board booting Linux from U-boot. This
> is an existing unit, so I don't get much choice over changing versions of
> kernel of U-boot.
>
> bdinfo gives me the machine ID I expect, but when I try to boot my
> newly-built kernel, I get an "unsupported machine ID" error; the vlaue it
> prints is not what U-boot gives me, and not what I expect. The supported
> types for this kernel do include the machine ID I'm tryin to use...
>
> Would someone walk me through the process by which U-boot sends the machine
> ID to the kernel, please? That's clearly gone wrong somewhere.
>

You haven't specified which u-boot or Linux versions you're using so
I'm going to assume a recent version of each.

The machid is passed to the kernel in r1 see boot_jump_linux[1], it is
possible to override it with the "machid" environment variable.

Most arm platforms supported by Linux these days use a device-tree
which basically makes the machid redundant, but it does mean u-boot
needs to be passing a device-tree blob for the platform. If you are
using a version of u-boot that can't pass a device-tree blob to the
kernel you will need to build your kernel with
CONFIG_ARM_APPENDED_DTB.

--
[1] - 
http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/lib/bootm.c;hb=HEAD#l390
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot