Re: [U-Boot] [PATCH 2/2] spi: ti_qspi: Fix baudrate divider calculation

2016-10-13 Thread Vignesh R
Hi,

On Thursday 13 October 2016 05:41 PM, Jagan Teki wrote:
> On Wed, Oct 12, 2016 at 9:46 AM, Vignesh R  wrote:
>> Fix the divider calculation logic to choose a value so that the
>> resulting baudrate is either equal to or closest possible baudrate less
>> than the requested value.
>>
>> Signed-off-by: Vignesh R 
>> ---
>>  drivers/spi/ti_qspi.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c
>> index 52520dff6325..d97e2479d1b3 100644
>> --- a/drivers/spi/ti_qspi.c
>> +++ b/drivers/spi/ti_qspi.c
>> @@ -16,6 +16,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> @@ -118,7 +119,7 @@ static void ti_spi_set_speed(struct ti_qspi_priv *priv, 
>> uint hz)
>> if (!hz)
>> clk_div = 0;
>> else
>> -   clk_div = (priv->fclk / hz) - 1;
>> +   clk_div = DIV_ROUND_UP(priv->fclk, hz) - 1;
> 
> Better to have a checks for min and max divider values or mask.

That code already exists in this function.


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


Re: [U-Boot] [U-Boot, v6, 07/10] smbios: Generate type 4 on non-x86 systems

2016-10-13 Thread Bin Meng
On Fri, Oct 14, 2016 at 1:13 PM, Alexander Graf  wrote:
>
>
>> Am 14.10.2016 um 03:50 schrieb Bin Meng :
>>
>> On Thu, Oct 13, 2016 at 10:35 PM, Alexander Graf  wrote:
 The type 4 table generation code is very x86 centric today. Refactor things
 out into the device model cpu class to allow the tables to get generated 
 for
 other architectures as well.

 Signed-off-by: Alexander Graf 
 Reviewed-by: Simon Glass 
 Reviewed-by: Bin Meng 
>>>
>>> Thanks, applied to
>>
>> Applied to where?
>
> Sorry, my efi-next tree.
>

At which repo? I don't see it at git.denx.de. I thought it was going
to be applied by Tom directly.

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


Re: [U-Boot] [U-Boot, v6, 07/10] smbios: Generate type 4 on non-x86 systems

2016-10-13 Thread Alexander Graf


> Am 14.10.2016 um 03:50 schrieb Bin Meng :
> 
> On Thu, Oct 13, 2016 at 10:35 PM, Alexander Graf  wrote:
>>> The type 4 table generation code is very x86 centric today. Refactor things
>>> out into the device model cpu class to allow the tables to get generated for
>>> other architectures as well.
>>> 
>>> Signed-off-by: Alexander Graf 
>>> Reviewed-by: Simon Glass 
>>> Reviewed-by: Bin Meng 
>> 
>> Thanks, applied to
> 
> Applied to where?

Sorry, my efi-next tree.

Alex


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


[U-Boot] [PATCH 3/3] board: ti: amx3xx: Remove multiple EEPROM reads

2016-10-13 Thread Lokesh Vutla
Detect the board very early and avoid reading eeprom multiple times.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/cpu/armv7/am33xx/board.c|  3 +++
 arch/arm/include/asm/arch-am33xx/sys_proto.h |  1 +
 board/ti/am335x/board.c  | 32 +++-
 board/ti/am43xx/board.c  | 15 +
 4 files changed, 17 insertions(+), 34 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 8340b54..5ebeac0 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -288,6 +288,9 @@ void early_system_init(void)
set_uart_mux_conf();
setup_early_clocks();
uart_soft_reset();
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
+   do_board_detect();
+#endif
 #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
/* Enable RTC32K clock */
rtc32k_enable();
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h 
b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index 4e942ba..0c5792b 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -45,3 +45,4 @@ int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency);
 
 void enable_usb_clocks(int index);
 void disable_usb_clocks(int index);
+void do_board_detect(void);
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index fc1353a..da9eab4 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -64,10 +64,16 @@ static struct ctrl_dev *cdev = (struct ctrl_dev 
*)CTRL_DEVICE_BASE;
 /*
  * Read header information from EEPROM into global structure.
  */
-static inline int __maybe_unused read_eeprom(void)
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
+void do_board_detect(void)
 {
-   return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
+   enable_i2c0_pin_mux();
+   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+
+   if (ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR))
+   printf("ti_i2c_eeprom_init failed\n");
 }
+#endif
 
 #ifndef CONFIG_DM_SERIAL
 struct serial_device *default_serial_console(void)
@@ -248,9 +254,6 @@ void am33xx_spl_board_init(void)
 {
int mpu_vdd;
 
-   if (read_eeprom() < 0)
-   puts("Could not get board ID.\n");
-
/* Get the frequency */
dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
 
@@ -388,11 +391,6 @@ void am33xx_spl_board_init(void)
 
 const struct dpll_params *get_dpll_ddr_params(void)
 {
-   enable_i2c0_pin_mux();
-   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-   if (read_eeprom() < 0)
-   puts("Could not get board ID.\n");
-
if (board_is_evm_sk())
return _ddr_evm_sk;
else if (board_is_bone_lt() || board_is_icev2())
@@ -422,9 +420,6 @@ void set_uart_mux_conf(void)
 
 void set_mux_conf_regs(void)
 {
-   if (read_eeprom() < 0)
-   puts("Could not get board ID.\n");
-
enable_board_pin_mux();
 }
 
@@ -462,9 +457,6 @@ const struct ctrl_ioregs ioregs = {
 
 void sdram_init(void)
 {
-   if (read_eeprom() < 0)
-   puts("Could not get board ID.\n");
-
if (board_is_evm_sk()) {
/*
 * EVM SK 1.2A and later use gpio0_7 to enable DDR3.
@@ -642,13 +634,8 @@ int board_late_init(void)
 #endif
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-   int rc;
char *name = NULL;
 
-   rc = read_eeprom();
-   if (rc)
-   puts("Could not get board ID.\n");
-
if (board_is_bbg1())
name = "BBG1";
set_board_info_env(name);
@@ -779,9 +766,6 @@ int board_eth_init(bd_t *bis)
(defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
 
 #ifdef CONFIG_DRIVER_TI_CPSW
-   if (read_eeprom() < 0)
-   puts("Could not get board ID.\n");
-
if (board_is_bone() || board_is_bone_lt() ||
board_is_idk()) {
writel(MII_MODE_ENABLE, >miisel);
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index f04a06e..ba6f88f 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -39,10 +39,13 @@ static struct ctrl_dev *cdev = (struct ctrl_dev 
*)CTRL_DEVICE_BASE;
 /*
  * Read header information from EEPROM into global structure.
  */
-static inline int __maybe_unused read_eeprom(void)
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
+void do_board_detect(void)
 {
-   return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
+   if (ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR))
+   printf("ti_i2c_eeprom_init failed\n");
 }
+#endif
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 
@@ -337,9 +340,6 @@ const struct dpll_params *get_dpll_ddr_params(void)
 {
int ind = get_sys_clk_index();
 
-   if (read_eeprom() < 0)
-   return NULL;
-
if (board_is_eposevm())
return _evm_dpll_ddr[ind];
   

[U-Boot] [PATCH 0/3] ARM: AMx3xx: Minor cleanup in early init code

2016-10-13 Thread Lokesh Vutla
This series does a minor cleanup for early initialization code on AM33xx and
AM43xx based platforms.

Logs:
AM437x-GP EVM: http://pastebin.ubuntu.com/23321700/
BBB: http://pastebin.ubuntu.com/23321698/

Lokesh Vutla (3):
  ARM: AMx3xx: Allow arch specific code to use early DM
  ARM: AMx3xx: Centralize early clock initialization
  board: ti: amx3xx: Remove multiple EEPROM reads

 arch/arm/cpu/armv7/am33xx/board.c| 31 +--
 arch/arm/cpu/armv7/am33xx/clock.c|  9 ++--
 arch/arm/include/asm/arch-am33xx/sys_proto.h |  2 ++
 board/ti/am335x/board.c  | 32 +++-
 board/ti/am43xx/board.c  | 15 +
 5 files changed, 46 insertions(+), 43 deletions(-)

-- 
2.9.3

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


[U-Boot] [PATCH 2/3] ARM: AMx3xx: Centralize early clock initialization

2016-10-13 Thread Lokesh Vutla
This is similar to Commit 93e6253d11030 ("ARM: OMAP4/5: Centralize
early clock initialization") that was done for OMAP4+, reflecting the same
for AM33xx and AM43xx SoCs to centralize clock initialization.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/cpu/armv7/am33xx/board.c| 2 +-
 arch/arm/cpu/armv7/am33xx/clock.c| 9 +++--
 arch/arm/include/asm/arch-am33xx/sys_proto.h | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 1ba4ec5..8340b54 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -286,7 +286,7 @@ void early_system_init(void)
 #endif
watchdog_disable();
set_uart_mux_conf();
-   setup_clocks_for_console();
+   setup_early_clocks();
uart_soft_reset();
 #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
/* Enable RTC32K clock */
diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
b/arch/arm/cpu/armv7/am33xx/clock.c
index 9b9b78e..3d17698 100644
--- a/arch/arm/cpu/armv7/am33xx/clock.c
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -232,10 +232,15 @@ __weak void scale_vcores(void)
 {
 }
 
-void prcm_init()
+void setup_early_clocks(void)
 {
+   setup_clocks_for_console();
enable_basic_clocks();
+   timer_init();
+}
+
+void prcm_init(void)
+{
scale_vcores();
setup_dplls();
-   timer_init();
 }
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h 
b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index ed1a46c..4e942ba 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -19,6 +19,7 @@ u32 get_sysboot_value(void);
 extern struct ctrl_stat *cstat;
 u32 get_device_type(void);
 void save_omap_boot_params(void);
+void setup_early_clocks(void);
 void setup_clocks_for_console(void);
 void mpu_pll_config_val(int mpull_m);
 void ddr_pll_config(unsigned int ddrpll_M);
-- 
2.9.3

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


[U-Boot] [PATCH 1/3] ARM: AMx3xx: Allow arch specific code to use early DM

2016-10-13 Thread Lokesh Vutla
Early system initialization is being done before initf_dm is being called
in U-Boot. Then system will fail to boot if any of the DM enabled driver
is being called in this system initialization code. So, rearrange the
code a bit so that DM enabled drivers can be called during early system
initialization. This is inspired by commit e850ed82bce8 ("ARM: OMAP4+: Allow
arch specific code to use early DM")

Signed-off-by: Lokesh Vutla 
---
 arch/arm/cpu/armv7/am33xx/board.c | 26 --
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 68baded..1ba4ec5 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -270,15 +270,11 @@ static void watchdog_disable(void)
;
 }
 
-#ifdef CONFIG_SPL_BUILD
-void board_init_f(ulong dummy)
+void s_init(void)
 {
-   board_early_init_f();
-   sdram_init();
 }
-#endif
 
-void s_init(void)
+void early_system_init(void)
 {
/*
 * The ROM will only have set up sufficient pinmux to allow for the
@@ -297,4 +293,22 @@ void s_init(void)
rtc32k_enable();
 #endif
 }
+
+#ifdef CONFIG_SPL_BUILD
+void board_init_f(ulong dummy)
+{
+   early_system_init();
+   board_early_init_f();
+   sdram_init();
+}
 #endif
+
+#endif
+
+int arch_cpu_init_dm(void)
+{
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+   early_system_init();
+#endif
+   return 0;
+}
-- 
2.9.3

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


[U-Boot] [PATCH] spi: kirkwood_spi: implement mvebu_spi_set_mode()

2016-10-13 Thread Chris Packham
Set the appropriate bits in the interface config register based
on the SPI_ mode flags.

Signed-off-by: Chris Packham 
---

 arch/arm/include/asm/arch-mvebu/spi.h |  4 
 drivers/spi/kirkwood_spi.c| 13 +
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/include/asm/arch-mvebu/spi.h 
b/arch/arm/include/asm/arch-mvebu/spi.h
index 78869a253d1f..3545aed17347 100644
--- a/arch/arm/include/asm/arch-mvebu/spi.h
+++ b/arch/arm/include/asm/arch-mvebu/spi.h
@@ -52,6 +52,10 @@ struct kwspi_registers {
 #define KWSPI_ADRLEN_3BYTE (2 << 8)
 #define KWSPI_ADRLEN_4BYTE (3 << 8)
 #define KWSPI_ADRLEN_MASK  (3 << 8)
+#define KWSPI_CPOL (1 << 11)
+#define KWSPI_CPHA (1 << 12)
+#define KWSPI_TXLSBF   (1 << 13)
+#define KWSPI_RXLSBF   (1 << 14)
 
 #define KWSPI_IRQUNMASK1 /* unmask SPI interrupt */
 #define KWSPI_IRQMASK  0 /* mask SPI interrupt */
diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index 6851ba942f51..69a0be9ea5b2 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -271,6 +271,19 @@ static int mvebu_spi_set_speed(struct udevice *bus, uint 
hz)
 
 static int mvebu_spi_set_mode(struct udevice *bus, uint mode)
 {
+   struct mvebu_spi_platdata *plat = dev_get_platdata(bus);
+   struct kwspi_registers *reg = plat->spireg;
+   u32 data = readl(>cfg);
+
+   if (mode & SPI_CPHA)
+   data |= KWSPI_CPHA;
+   if (mode & SPI_CPOL)
+   data |= KWSPI_CPOL;
+   if (mode & SPI_LSB_FIRST)
+   data |= (KWSPI_RXLSBF | KWSPI_TXLSBF);
+
+   writel(data, >cfg);
+
return 0;
 }
 
-- 
2.10.0.479.g7c56b16

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


[U-Boot] Booting from MMC, other partition

2016-10-13 Thread Robert Ianovich
I have a iMX233 with SD as storage and I need to have first partition
fat32, otherways windows will not open the SD card at all. Customer needs
to get/save some data from windows.

So what I did is wrote U-Boot on 2'nd and rootfs on 3'rd.

Command (m for help): p
Disk /dev/sdb: 7,4 GiB, 7969177600 bytes, 15564800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x763f9f2e

Device Boot   Start  End Sectors  Size Id Type
/dev/sdb1  2048  8390655 83886084G  c W95 FAT32 (LBA)
/dev/sdb2  *8390656  8521727  131072   64M 53 OnTrack DM6 Aux3
/dev/sdb3   8521728 15564799 7043072  3,4G 83 Linux

U-Boot starts just fine but cannot boot from 3'rd.

There is a solution for this, do I need to recompile U-Boot.

If so, where should I modify.

Thanks very much in advance,
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: psci: save and restore registers from r4 to r12

2016-10-13 Thread Chenhui Zhao
On Thu, Oct 13, 2016 at 5:52 PM, Chen-Yu Tsai  wrote:
> On Sat, Oct 8, 2016 at 7:08 PM, Chenhui Zhao  wrote:
>> Save and restore core registers from r4 to r12 so that PSCI code won't
>> break their value.
>>
>> Signed-off-by: Chenhui Zhao 
>> Signed-off-by: Alison Wang 
>> Signed-off-by: Abhimanyu Saini 
>> ---
>>  arch/arm/cpu/armv7/psci.S | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S
>> index 6a36208..746297c 100644
>> --- a/arch/arm/cpu/armv7/psci.S
>> +++ b/arch/arm/cpu/armv7/psci.S
>> @@ -152,7 +152,7 @@ _psci_table:
>> .word   0
>>
>>  _smc_psci:
>> -   push{r4-r7,lr}
>> +   push{r4-r12,lr}
>
> This change is not needed. This function only uses r4-r7.
> Any subroutines called should save variable registers (r4-r12)
> themselves, per the ARM calling conventions.
>
> ChenYu
>

I do not think it is a normal calling, instead it is an exception
handler. In the exception context,
it is necessary to save/restore all registers.

Sorry, my mail server has something wrong.

Chenhui

>>
>> @ Switch to secure
>> mrc p15, 0, r7, c1, c1, 0
>> @@ -175,7 +175,7 @@ _smc_psci:
>> @ Switch back to non-secure
>>  2: mcr p15, 0, r7, c1, c1, 0
>>
>> -   pop {r4-r7, lr}
>> +   pop {r4-r12, lr}
>> movspc, lr  @ Return to the kernel
>>
>>  @ Requires dense and single-cluster CPU ID space
>> --
>> 1.9.1
>>
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: dts: am437x-idk: Fix QSPI compatible string

2016-10-13 Thread Jagan Teki
On Thu, Oct 13, 2016 at 6:24 PM, Tom Rini  wrote:
> On Thu, Oct 13, 2016 at 05:45:52PM +0530, Jagan Teki wrote:
>> On Thu, Oct 13, 2016 at 3:53 PM, Vignesh R  wrote:
>> > Unlike Linux kernel, U-Boot depends on "spi-flash" compatible to probe
>> > m25p80 spi-nor devices. Hence, add "spi-flash" compatible string to
>> > m25p80 node. Without this patch, flash device DT data is not parsed and
>> > QSPI operates in unsupported mode leading to data corruption.
>> >
>> > Signed-off-by: Vignesh R 
>>
>> Applied to u-boot-spi/master
>
> ... I don't like that we need a non u-boot prefixed string here for the
> binding to work as that will lead to harder re-syncs later on the dt
> files.  Why aren't we matching on the existing part?  Thanks!

Most of these compatibles from Linux, and we're unable to support as
of now. and moment we moved to spi-nor the we will maintain the
compatible of all these like Linux.

Too speed-up, can you please look at the last approach was submitted on [1]

[1] [PATCH RFC v8 00/16] SPI-NOR/MTD addition

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
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v6, 07/10] smbios: Generate type 4 on non-x86 systems

2016-10-13 Thread Bin Meng
On Thu, Oct 13, 2016 at 10:35 PM, Alexander Graf  wrote:
>> The type 4 table generation code is very x86 centric today. Refactor things
>> out into the device model cpu class to allow the tables to get generated for
>> other architectures as well.
>>
>> Signed-off-by: Alexander Graf 
>> Reviewed-by: Simon Glass 
>> Reviewed-by: Bin Meng 
>
> Thanks, applied to

Applied to where?

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


[U-Boot] [PATCH] usb: xhci-mvebu: use xhci_deregister() for .remove callback

2016-10-13 Thread Masahiro Yamada
No need to use a wrapper that is equivalent to xhci_deregister().

Signed-off-by: Masahiro Yamada 
---

 drivers/usb/host/xhci-mvebu.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c
index 23c241a..46eb937 100644
--- a/drivers/usb/host/xhci-mvebu.c
+++ b/drivers/usb/host/xhci-mvebu.c
@@ -56,11 +56,6 @@ static int xhci_usb_probe(struct udevice *dev)
return xhci_register(dev, ctx->hcd, hcor);
 }
 
-static int xhci_usb_remove(struct udevice *dev)
-{
-   return xhci_deregister(dev);
-}
-
 static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
 {
struct mvebu_xhci_platdata *plat = dev_get_platdata(dev);
@@ -89,7 +84,7 @@ U_BOOT_DRIVER(usb_xhci) = {
.of_match = xhci_usb_ids,
.ofdata_to_platdata = xhci_usb_ofdata_to_platdata,
.probe = xhci_usb_probe,
-   .remove = xhci_usb_remove,
+   .remove = xhci_deregister,
.ops= _usb_ops,
.platdata_auto_alloc_size = sizeof(struct mvebu_xhci_platdata),
.priv_auto_alloc_size = sizeof(struct mvebu_xhci),
-- 
1.9.1

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


[U-Boot] [PATCH] usb: ehci-vf: use ehci_deregister() for .remove callback

2016-10-13 Thread Masahiro Yamada
This driver was recently converted to Driver Model, so missed the
subsystem-wide cleanups by commit 405273427366 ("usb: replace
ehci_*_remove() with usb_deregister()").

Signed-off-by: Masahiro Yamada 
---

 drivers/usb/host/ehci-vf.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
index f6f9efb..f389bff 100644
--- a/drivers/usb/host/ehci-vf.c
+++ b/drivers/usb/host/ehci-vf.c
@@ -339,17 +339,6 @@ static int ehci_usb_probe(struct udevice *dev)
return ehci_register(dev, hccr, hcor, _ehci_ops, 0, priv->init_type);
 }
 
-static int ehci_usb_remove(struct udevice *dev)
-{
-   int ret;
-
-   ret = ehci_deregister(dev);
-   if (ret)
-   return ret;
-
-   return 0;
-}
-
 static const struct udevice_id vf_usb_ids[] = {
{ .compatible = "fsl,vf610-usb" },
{ }
@@ -361,7 +350,7 @@ U_BOOT_DRIVER(usb_ehci) = {
.of_match = vf_usb_ids,
.bind = vf_usb_bind,
.probe = ehci_usb_probe,
-   .remove = ehci_usb_remove,
+   .remove = ehci_deregister,
.ops = _usb_ops,
.ofdata_to_platdata = vf_usb_ofdata_to_platdata,
.platdata_auto_alloc_size = sizeof(struct usb_platdata),
-- 
1.9.1

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


Re: [U-Boot] NFS and timeouts?

2016-10-13 Thread Tom Rini
On Thu, Oct 13, 2016 at 04:52:14PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On 13 October 2016 at 13:11, Tom Rini  wrote:
> > Hey all,
> >
> > I've noticed now, but not dug into a problem that goes like this.  On
> > every platform that I have tried NFS on now (and I wasn't a user before
> > the test came in) I see:
> > # nfs 8000 /tftpboot/1MiBtest.bin
> > link up on port 0, speed 1000, full duplex
> > #
> >  #
> >  #
> >  ##T T T T
> > done
> > Bytes transferred = 1048576 (10 hex)
> >
> > for the same 1MiB file.  The link line will vary from board to board but
> > the end result is that I always see 4 T (for timeout) at the end of the
> > transfer.  On boards where I am doing this on gigabit the initial
> > transfer is fast enough that the timeout doesn't cause failure.  On the
> > boards where I'm at 100Mbit instead however, I fail.
> 
> I have seen this also - what type of interface are you using?

I see it on CPSW (am335x, dra7xx) and the USB smsc95xx on rpi3 and the
USB ASIX on omap3_beagle.

-- 
Tom


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


Re: [U-Boot] [PATCH V2 2/2] net: add driver for Synopsys Ethernet QoS device

2016-10-13 Thread Stephen Warren

On 10/11/2016 05:41 PM, Joe Hershberger wrote:

On Tue, Oct 4, 2016 at 12:45 AM, Stephen Warren  wrote:

From: Stephen Warren 

This driver supports the Synopsys Designware Ethernet QoS (Quality of
Service) a/k/a eqos IP block, which is a different design than the HW
supported by the existing designware.c driver. The IP supports many
options for bus type, clocking/reset structure, and feature list. This
driver currently supports the specific configuration used in NVIDIA's
Tegra186 chip, but should be extensible to other combinations quite
easily, as explained in the source.



diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c



+/*
+ * This represents the "Transmit Normal Descriptor (Read Format). The format


It looks like I missed a trailing " over here -->   ^


+ * written by HW is different, except for the OWN bit in the flags field. Field


"The format written by HW is different, except for the OWN bit in the
flags field."

This sentence is confusing. Different how?  If it's written by HW,
isn't it read by driver? Hence it's this format? What is this "Read
Format" naming convention?


There's a descriptor in memory. SW writes data to it in one format (the 
"write format") and HW consumes that. Once HW has completed the work 
associated with the descriptor, if re-writes the entire contents in a 
completely different format (the "read format"). The only commonality 
between the two formats is the location of the OWN bit which indicates 
whether SW has written the data and HW now owns the descriptor, or 
whether HW has written the data and SW owns the descriptor. The current 
driver doesn't interpret any of the bits that HW writes except for the 
OWN bit, which tells SW that HW has finished processing the packet 
associated with the descriptor. Other fields (e.g. timestamps IIRC) are 
ignored.


"read format" and "write format" are terms from the Synopsis documentation.


+ * naming assumes SW places uses single buffer per descriptor, rather than


There's "a" missing --> ^


+ * separate header/payload buffers, such that a single 64-bit pointer is used.


This sentence is also odd. Is this copied from a data sheet that was
processed through Google translate?


There are multiple possible formats for the descriptor SW writes. One 
allows two 32-bit buffer pointers (e.g. packet header and body) too be 
included in the descriptor and the other allows a single 64-bit buffer 
to be included in the descriptor.


The descriptions do perhaps rely on terminology from the Synopsis 
documentation, but without that reliance, the comment would need to 
duplicate rather a lot of the Synopsis documentation, which would be 
problematic.

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


Re: [U-Boot] [PATCH 2/2] net: add driver for Synopsys Ethernet QoS device

2016-10-13 Thread Joe Hershberger
On Fri, Oct 14, 2016 at 1:35 AM, Stephen Warren  wrote:
> On 10/11/2016 04:48 PM, Joe Hershberger wrote:
>>
>> On Tue, Oct 4, 2016 at 12:13 AM, Stephen Warren 
>> wrote:
>>>
>>> On 09/23/2016 03:49 PM, Joe Hershberger wrote:


 Hi Stephen,

 Thanks for sending this! I have some comments below.

 Cheers,
 -Joe

 On Mon, Sep 12, 2016 at 12:48 PM, Stephen Warren 
 wrote:
>
>
> From: Stephen Warren 
>
> This driver supports the Synopsys Designware Ethernet QoS (Quality of
> Service) a/k/a eqos IP block, which is a different design than the HW
> supported by the existing designware.c driver. The IP supports many
> options for bus type, clocking/reset structure, and feature list. This
> driver currently supports the specific configuration used in NVIDIA's
> Tegra186 chip, but should be extensible to other combinations quite
> easily, as explained in the source.
>>>
>>>
> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
>>>
>>>
 +static int eqos_start(struct udevice *dev)
>>>
>>>
> +   /* Update the MAC address */
> +   val = (plat->enetaddr[5] << 8) |
> +   (plat->enetaddr[4]);
> +   writel(val, eqos->regs + EQOS_MAC_ADDRESS0_HIGH);
> +   val = (plat->enetaddr[3] << 24) |
> +   (plat->enetaddr[2] << 16) |
> +   (plat->enetaddr[1] << 8) |
> +   (plat->enetaddr[0]);
> +   writel(val, eqos->regs + EQOS_MAC_ADDRESS0_LOW);



 This should be implemented in write_hwaddr() op.
>>>
>>>
>>> That op is never called because this driver is only instantiated by
>>> device
>>> tree. Since this code can't be skipped, it can't be moved to that op.
>>
>>
>> I don't understand what you're saying here. That op is called in
>> eth_initialize() on every device found in device tree.
>
>
> Oh, so it is. I must have screwed up my tracing before.
>
> Anyway, I still don't believe using write_hwaddr() is correct for this HW.
> It's marked optional in include/net.h; it would be implemented in cases
> where the MAC address should be passed to subsequent SW in Ethernet
> controller registers. That's not the case here. The master location for the
> MAC address is in an unrelated EEPROM that all drivers must read.

That sounds more like a NV storage location for a read_rom_hwaddr() op
to get a default mac addr that can be overridden with the env. The
write_hwaddr is about what the mac uses to filter for limiting packet
ingress. One reason to support it as an op is so that when the env var
for the mac address is changed, the mac filter in the hw is also
updated.

> Resetting
> the device (as any driver would do to guarantee correct operation no matter
> what SW ran before), or never initializing it in the first place (as is the
> case now without any driver in U-Boot) means that those registers cannot be
> assumed to contain valid data.

That's what the comment I quoted in my last mail is directly
addressing. It does make that data valid.

> Thus SW after U-Boot won't rely on the MAC
> address register values,

And yet it does in most cases, hence the comment I quoted in the last mail.

> and hence there's no need to implement
> .write_hwaddr() separately, since that's the only reason it exists
> separately according to the comments in include/net.h.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] net: add driver for Synopsys Ethernet QoS device

2016-10-13 Thread Stephen Warren

On 10/11/2016 04:48 PM, Joe Hershberger wrote:

On Tue, Oct 4, 2016 at 12:13 AM, Stephen Warren  wrote:

On 09/23/2016 03:49 PM, Joe Hershberger wrote:


Hi Stephen,

Thanks for sending this! I have some comments below.

Cheers,
-Joe

On Mon, Sep 12, 2016 at 12:48 PM, Stephen Warren 
wrote:


From: Stephen Warren 

This driver supports the Synopsys Designware Ethernet QoS (Quality of
Service) a/k/a eqos IP block, which is a different design than the HW
supported by the existing designware.c driver. The IP supports many
options for bus type, clocking/reset structure, and feature list. This
driver currently supports the specific configuration used in NVIDIA's
Tegra186 chip, but should be extensible to other combinations quite
easily, as explained in the source.



diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c



+static int eqos_start(struct udevice *dev)



+   /* Update the MAC address */
+   val = (plat->enetaddr[5] << 8) |
+   (plat->enetaddr[4]);
+   writel(val, eqos->regs + EQOS_MAC_ADDRESS0_HIGH);
+   val = (plat->enetaddr[3] << 24) |
+   (plat->enetaddr[2] << 16) |
+   (plat->enetaddr[1] << 8) |
+   (plat->enetaddr[0]);
+   writel(val, eqos->regs + EQOS_MAC_ADDRESS0_LOW);



This should be implemented in write_hwaddr() op.


That op is never called because this driver is only instantiated by device
tree. Since this code can't be skipped, it can't be moved to that op.


I don't understand what you're saying here. That op is called in
eth_initialize() on every device found in device tree.


Oh, so it is. I must have screwed up my tracing before.

Anyway, I still don't believe using write_hwaddr() is correct for this 
HW. It's marked optional in include/net.h; it would be implemented in 
cases where the MAC address should be passed to subsequent SW in 
Ethernet controller registers. That's not the case here. The master 
location for the MAC address is in an unrelated EEPROM that all drivers 
must read. Resetting the device (as any driver would do to guarantee 
correct operation no matter what SW ran before), or never initializing 
it in the first place (as is the case now without any driver in U-Boot) 
means that those registers cannot be assumed to contain valid data. Thus 
SW after U-Boot won't rely on the MAC address register values, and hence 
there's no need to implement .write_hwaddr() separately, since that's 
the only reason it exists separately according to the comments in 
include/net.h.


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


Re: [U-Boot] [PATCH v5] ARM: sun71: dts: add support for Bananapi BPI-R1

2016-10-13 Thread Stephen Arnold
Okay, rebased on u-boot master again and updated the config for
i2c/spl.  I have an RFC patch for u-boot and an updated kernel dts to
test; I also brought in the (small) sun7i-a20.dtsi patch to add the
standard A20 i2c4 pins_a which is the only i2c brought out on the Pi
header (goes with pin fix for uart3).

Since this is not quite what I'm running now, and I had to go back and
trace some wiring on the schematic for USB, I think I've got it dialed
in now, so I'll test it when my kernel is finished.

If that looks good, I'll make a kernel patch and try that list for a change...

Thanks, Steve

On Wed, Oct 12, 2016 at 9:27 AM, Jagan Teki  wrote:
> On Wed, Oct 12, 2016 at 12:18 AM, Stephen Arnold
>  wrote:
>> Okay, but I could use a little clarity; do you want the u-boot dts to
>> look just like my (proposed) kernel dts?  Or do I start with kernel
>> dts and remove the gmac/axp209 stuff?
>>
>> If we can merge all of this feedback into a single list of changes,
>> then I can take a whack at it later this week (after a few work
>> things).  Back to the test mtg...
>
> Please take a reference of Linux dts and add tested nodes/properties,
> this would be certainly gives a better understanding and maintenance
> easy.
>
> 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
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] NFS and timeouts?

2016-10-13 Thread Joe Hershberger
On Fri, Oct 14, 2016 at 12:52 AM, Simon Glass  wrote:
> Hi Tom,
>
> On 13 October 2016 at 13:11, Tom Rini  wrote:
>> Hey all,
>>
>> I've noticed now, but not dug into a problem that goes like this.  On
>> every platform that I have tried NFS on now (and I wasn't a user before
>> the test came in) I see:
>> # nfs 8000 /tftpboot/1MiBtest.bin
>> link up on port 0, speed 1000, full duplex
>> #
>>  #
>>  #
>>  ##T T T T
>> done
>> Bytes transferred = 1048576 (10 hex)
>>
>> for the same 1MiB file.  The link line will vary from board to board but
>> the end result is that I always see 4 T (for timeout) at the end of the
>> transfer.  On boards where I am doing this on gigabit the initial
>> transfer is fast enough that the timeout doesn't cause failure.  On the
>> boards where I'm at 100Mbit instead however, I fail.
>
> I have seen this also - what type of interface are you using?

Does this happen in your testing, Guillaume?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-fdt (take 2)

2016-10-13 Thread Simon Glass
Hi Tom,

Here is a second attempt with this patch pulled in:

http://patchwork.ozlabs.org/patch/681814/


The following changes since commit c69f6d04ec66433f2360490a5cd0263c83aab18f:

  Merge branch 'master' of http://git.denx.de/u-boot-mmc (2016-10-13
08:13:56 -0400)

are available in the git repository at:

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

for you to fetch changes up to 42b7600d62ae288a8c12431d232b89b26ec61721:

  libfdt: Drop inlining of fdt_path_offset() (2016-10-13 14:12:40 -0600)


David Gibson (1):
  libfdt: Fix undefined behaviour in fdt_offset_ptr()

Hannes Schmelzer (1):
  cmd/fdt: add possibilty to have 'extrasize' on fdt resize

Simon Glass (4):
  libfdt: Sync up with upstream
  libfdt: Bring in upstream stringlist functions
  libfdt: Sync fdt_for_each_subnode() with upstream
  libfdt: Drop inlining of fdt_path_offset()

 arch/arm/mach-tegra/xusb-padctl-common.c |  18 +-
 arch/arm/mach-uniphier/board_late_init.c |   5 ++-
 arch/x86/cpu/irq.c   |   5 +--
 board/compulab/cm_fx6/cm_fx6.c   |   2 +-
 cmd/fdt.c|   9 +++--
 common/fdt_support.c |   3 +-
 common/image-fdt.c   |   2 +-
 common/image-fit.c   |  21 +--
 common/image-sig.c   |   8 ++---
 common/image.c   |  19 +-
 drivers/clk/clk-uclass.c |   6 ++--
 drivers/core/device.c|   2 +-
 drivers/gpio/dwapb_gpio.c|   3 +-
 drivers/i2c/mxc_i2c.c|   2 +-
 drivers/mailbox/mailbox-uclass.c |   6 ++--
 drivers/net/cpsw.c   |   2 +-
 drivers/net/keystone_net.c   |   4 +--
 drivers/net/mvpp2.c  |   2 +-
 drivers/net/sun8i_emac.c |   5 +--
 drivers/pci/pci_tegra.c  |   2 +-
 drivers/phy/marvell/comphy_core.c|   2 +-
 drivers/pinctrl/exynos/pinctrl-exynos.c  |   9 +++--
 drivers/pinctrl/meson/pinctrl-meson.c|   4 +--
 drivers/pinctrl/pinctrl-generic.c|  10 +++---
 drivers/pinctrl/pinctrl-uclass.c |   2 +-
 drivers/power/pmic/palmas.c  |   2 +-
 drivers/reset/reset-uclass.c |   6 ++--
 drivers/spi/fsl_qspi.c   |   2 +-
 drivers/video/sunxi_display.c|   2 +-
 include/fdt_support.h|  10 +-
 include/libfdt.h | 187
+
 lib/fdtdec.c |   4 +--
 lib/libfdt/fdt.c |  13 +++
 lib/libfdt/fdt_overlay.c |   8 ++---
 lib/libfdt/fdt_ro.c  | 119
++
 lib/libfdt/fdt_rw.c  |   4 ++-
 lib/libfdt/fdt_wip.c |   6 ++--
 test/overlay/cmd_ut_overlay.c|   5 ++-
 38 files changed, 299 insertions(+), 222 deletions(-)


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


Re: [U-Boot] [PATCH v3 01/10] binman: Introduce binman, a tool for building binary images

2016-10-13 Thread Simon Glass
Hi Masahiro,

On 4 October 2016 at 22:08, Masahiro Yamada
 wrote:
> Hi Simon,
>
>
> 2016-10-05 9:25 GMT+09:00 Simon Glass :
>
>> +
>> +Image description format
>> +
>> +
>> +The binman node is called 'binman'. An example image description is shown
>> +below:
>> +
>> +   binman {
>> +   filename = "u-boot-sunxi-with-spl.bin";
>> +   pad-byte = <0xff>;
>> +   blob {
>> +   filename = "spl/sunxi-spl.bin";
>> +   };
>> +   u-boot {
>> +   pos = ;
>> +   };
>> +   };
>
>
> Oh my, finally CONFIG_ in device tree.
>
> If CONFIG_SPL_OF_CONTROL is enabled, SPL can parse "/binman/u-boot/pos" 
> property
> to know which offset address SPL should load U-Boot proper from,
> then remove CONFIG_SPL_PAD_TO.
> Otherwise, I have no idea to avoid this.

Yes we can do that. but in any case we need this CONFIG in the DT. I
think this CONFIG (or one depending on it) is also used in the build
to provide the link address for U-Boot.

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


Re: [U-Boot] [PATCH 1/3] ARM: uniphier: remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT defines

2016-10-13 Thread Simon Glass
On 13 October 2016 at 09:39, Masahiro Yamada
 wrote:
> ARCH_UNIPHIER selects DM_USB, where CONFIG_USB_MAX_CONTROLLER_COUNT
> is not used.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  include/configs/uniphier.h | 1 -
>  1 file changed, 1 deletion(-)

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


Re: [U-Boot] NFS and timeouts?

2016-10-13 Thread Simon Glass
Hi Tom,

On 13 October 2016 at 13:11, Tom Rini  wrote:
> Hey all,
>
> I've noticed now, but not dug into a problem that goes like this.  On
> every platform that I have tried NFS on now (and I wasn't a user before
> the test came in) I see:
> # nfs 8000 /tftpboot/1MiBtest.bin
> link up on port 0, speed 1000, full duplex
> #
>  #
>  #
>  ##T T T T
> done
> Bytes transferred = 1048576 (10 hex)
>
> for the same 1MiB file.  The link line will vary from board to board but
> the end result is that I always see 4 T (for timeout) at the end of the
> transfer.  On boards where I am doing this on gigabit the initial
> transfer is fast enough that the timeout doesn't cause failure.  On the
> boards where I'm at 100Mbit instead however, I fail.

I have seen this also - what type of interface are you using?

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


Re: [U-Boot] [PATCH v2] pmic: palmas: Accommodate fdt_for_each_subnode signature change

2016-10-13 Thread Simon Glass
On 13 October 2016 at 09:02, Keerthy  wrote:

>
> Accommodate fdt_for_each_subnode signature change.
>
> Signed-off-by: Keerthy 
> Acked-by: Simon Glass 
> ---
>
> Changes in v2:
>
> * Corrected  subject.
> * Added Simon's Ack.
>
>  drivers/power/pmic/palmas.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patched into u-boot-fdt/master.

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


Re: [U-Boot] Pull request: u-boot-net.git master

2016-10-13 Thread Tom Rini
On Thu, Oct 13, 2016 at 12:34:54PM -0500, Joe Hershberger wrote:

> Hi Tom,
> 
> The following changes since commit 5ebd27d860ec0c6e36f1b0f973653fe66a7360be:
> 
>   Merge branch 'master' of git://git.denx.de/u-boot-x86 (2016-10-12 13:59:26 
> -0400)
> 
> are available in the git repository at:
> 
> 
>   git://git.denx.de/u-boot-net.git master
> 
> for you to fetch changes up to c9abfbdd66ed97e1cac8553d0b31bd23f68480a9:
> 
>   net: smsc95xx: fix DM MAC address reading (2016-10-13 12:25:40 -0500)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] cmd/nand.c: Remove unnecessarily repeated step

2016-10-13 Thread Benoît Thébaudeau
Dear Ahmed Samir Khalil,

On Mon, Oct 10, 2016 at 6:44 AM, Ahmed Samir Khalil
 wrote:
> Getting the current NAND device is already done once as part
>  of nand command. Therefore, repeating this step as part of
>  the sub-commands is unnecessary.
>
> Signed-off-by: Ahmed Samir Khalil 
> ---
>  cmd/nand.c | 6 --
>  1 file changed, 6 deletions(-)
>
> diff --git a/cmd/nand.c b/cmd/nand.c
> index ec7f1df..71ffe85 100644
> --- a/cmd/nand.c
> +++ b/cmd/nand.c
> @@ -528,8 +528,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
> char * const argv[])
> if (set_dev(dev))
> return 1;
>
> -   mtd = nand_info[dev];
> -
> memset(, 0, sizeof(opts));
> opts.offset = off;
> opts.length = size;
> @@ -597,8 +595,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
> char * const argv[])
> if (set_dev(dev))
> return 1;
>
> -   mtd = nand_info[dev];
> -
> if (argc > 4 && !str2long(argv[4], )) {
> printf("'%s' is not a number\n", argv[4]);
> return 1;
> @@ -626,8 +622,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
> char * const argv[])
> rwsize = size;
> }
>
> -   mtd = nand_info[dev];
> -
> if (!s || !strcmp(s, ".jffs2") ||
> !strcmp(s, ".e") || !strcmp(s, ".i")) {
> if (read)

Quickly looking at the code, these assignments of mtd directly follow
calls to mtd_arg_off_size(), which may alter dev, so they are required
and should not be removed. This is even mentioned in the comment block
above the initialization of mtd that you refer to: "The following
commands operate on the current device, _unless overridden by a
partition specifier_.".

Best regards,
Benoît
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] NFS and timeouts?

2016-10-13 Thread Tom Rini
Hey all,

I've noticed now, but not dug into a problem that goes like this.  On
every platform that I have tried NFS on now (and I wasn't a user before
the test came in) I see:
# nfs 8000 /tftpboot/1MiBtest.bin
link up on port 0, speed 1000, full duplex
#
 #
 #
 ##T T T T
done
Bytes transferred = 1048576 (10 hex)

for the same 1MiB file.  The link line will vary from board to board but
the end result is that I always see 4 T (for timeout) at the end of the
transfer.  On boards where I am doing this on gigabit the initial
transfer is fast enough that the timeout doesn't cause failure.  On the
boards where I'm at 100Mbit instead however, I fail.

-- 
Tom


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


Re: [U-Boot] net: smsc95xx: fix DM MAC address reading

2016-10-13 Thread Joe Hershberger
Hi Stephen,

https://patchwork.ozlabs.org/patch/670537/ was applied to u-boot-net.git.

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


Re: [U-Boot] rtl8169: fix cache misalignment message on transmit.

2016-10-13 Thread Joe Hershberger
Hi Peter,

https://patchwork.ozlabs.org/patch/669676/ was applied to u-boot-net.git.

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


Re: [U-Boot] test: add NFS download test

2016-10-13 Thread Joe Hershberger
Hi Guillaume,

https://patchwork.ozlabs.org/patch/669800/ was applied to u-boot-net.git.

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


Re: [U-Boot] net: mv88e61xx: Add support for fixed links

2016-10-13 Thread Joe Hershberger
Hi Chris,

https://patchwork.ozlabs.org/patch/662993/ was applied to u-boot-net.git.

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


Re: [U-Boot] net: Fix cache misalignment message after network load operations

2016-10-13 Thread Joe Hershberger
Hi Peter,

https://patchwork.ozlabs.org/patch/669691/ was applied to u-boot-net.git.

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


Re: [U-Boot] net: write enetaddr down to hardware on env_callback

2016-10-13 Thread Joe Hershberger
Hi Hannes,

https://patchwork.ozlabs.org/patch/665202/ was applied to u-boot-net.git.

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


Re: [U-Boot] net: mvneta: fix typo in comment

2016-10-13 Thread Joe Hershberger
Hi Chris,

https://patchwork.ozlabs.org/patch/663514/ was applied to u-boot-net.git.

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


Re: [U-Boot] net: Add support for mv88e609x switches

2016-10-13 Thread Joe Hershberger
Hi Chris,

https://patchwork.ozlabs.org/patch/662992/ was applied to u-boot-net.git.

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


Re: [U-Boot] board: am335x: Always set eth/eth1addr environment variable

2016-10-13 Thread Joe Hershberger
Hi Roger,

https://patchwork.ozlabs.org/patch/662259/ was applied to u-boot-net.git.

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


Re: [U-Boot] board: am335x-icev2: add ethernet phy mode detection logic

2016-10-13 Thread Joe Hershberger
Hi Roger,

https://patchwork.ozlabs.org/patch/662258/ was applied to u-boot-net.git.

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


Re: [U-Boot] include: configs: am335x: add Atheros phy support

2016-10-13 Thread Joe Hershberger
Hi Mugunthan,

https://patchwork.ozlabs.org/patch/681803/ was applied to u-boot-net.git.

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


Re: [U-Boot] phy: atheros: add support for RGMII_ID, RGMII_TXID and RGMII_RXID

2016-10-13 Thread Joe Hershberger
Hi Andrea,

https://patchwork.ozlabs.org/patch/626776/ was applied to u-boot-net.git.

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


Re: [U-Boot] driver: net: cpsw: add support for RGMII id mode support and RMII clock source selection

2016-10-13 Thread Joe Hershberger
Hi Mugunthan,

https://patchwork.ozlabs.org/patch/681802/ was applied to u-boot-net.git.

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


Re: [U-Boot] drivers: net: phy: atheros: add separate config for AR8031

2016-10-13 Thread Joe Hershberger
Hi Mugunthan,

https://patchwork.ozlabs.org/patch/681801/ was applied to u-boot-net.git.

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


[U-Boot] Pull request: u-boot-net.git master

2016-10-13 Thread Joe Hershberger
Hi Tom,

The following changes since commit 5ebd27d860ec0c6e36f1b0f973653fe66a7360be:

  Merge branch 'master' of git://git.denx.de/u-boot-x86 (2016-10-12 13:59:26 
-0400)

are available in the git repository at:


  git://git.denx.de/u-boot-net.git master

for you to fetch changes up to c9abfbdd66ed97e1cac8553d0b31bd23f68480a9:

  net: smsc95xx: fix DM MAC address reading (2016-10-13 12:25:40 -0500)


Andrea Merello (1):
  phy: atheros: add support for RGMII_ID, RGMII_TXID and RGMII_RXID

Chris Packham (3):
  net: Add support for mv88e609x switches
  net: mv88e61xx: Add support for fixed links
  net: mvneta: fix typo in comment

Guillaume GARDET (1):
  test: add NFS download test

Hannes Schmelzer (1):
  net: write enetaddr down to hardware on env_callback

Mugunthan V N (3):
  drivers: net: phy: atheros: add separate config for AR8031
  include: configs: am335x: add Atheros phy support
  driver: net: cpsw: add support for RGMII id mode support and RMII clock 
source selection

Peter Chubb (2):
  rtl8169: fix cache misalignment message on transmit.
  net: Fix cache misalignment message after network load operations

Roger Quadros (2):
  board: am335x-icev2: add ethernet phy mode detection logic
  board: am335x: Always set eth/eth1addr environment variable

Stephen Warren (1):
  net: smsc95xx: fix DM MAC address reading

 board/ti/am335x/board.c  | 154 +-
 cmd/net.c|   3 -
 drivers/net/cpsw.c   | 157 +++
 drivers/net/mvneta.c |   2 +-
 drivers/net/phy/atheros.c|  53 ++-
 drivers/net/phy/mv88e61xx.c  |  61 -
 drivers/net/rtl8169.c|   3 +-
 drivers/usb/eth/smsc95xx.c   |  16 +
 include/configs/am335x_evm.h |   2 +
 include/cpsw.h   |   1 +
 net/eth-uclass.c |   1 +
 test/py/tests/test_net.py|  49 ++
 12 files changed, 447 insertions(+), 55 deletions(-)

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


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

2016-10-13 Thread Tom Rini
On Tue, Oct 11, 2016 at 11:36:40AM -0600, Simon Glass wrote:

> Hi Tom,
> 
> This includes lp873x PMIC support, moving patman to work with Python 3
> (mostly), buildman improvements, cros_ec flashinfo support and sandbox
> filesystem test fixes. It also includes the MMC patches I've been
> holding off for months. I still worry that it might cause problems
> with some boards, but we should find out quickly once this is in.
> 
> 
> The following changes since commit f5fd45ff64e28a73499548358e3d1ceda0de7daf:
> 
>   Merge branch 'master' of git://www.denx.de/git/u-boot-imx
> (2016-10-08 09:33:37 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-dm.git
> 
> for you to fetch changes up to bfeba0173aa45c24bbdba45149716c83258d25f6:
> 
>   cmd: cros_ec: Move crosec commands to cmd subdirectory (2016-10-11
> 10:17:08 -0600)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


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

2016-10-13 Thread Tom Rini
On Tue, Oct 11, 2016 at 08:37:56AM +0900, Jaehoon Chung wrote:

> Dear Tom,
> 
> Could you these patches on u-boot/master?
> 
> The following changes since commit f5fd45ff64e28a73499548358e3d1ceda0de7daf:
> 
>   Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08 
> 09:33:37 -0400)
> 
> are available in the git repository at:
> 
>   http://git.denx.de/u-boot-mmc.git master
> 
> for you to fetch changes up to 57718f017b10871cd9dc03dca56c3bd690fc2614:
> 
>   mmc: Fix cast for 64-bit compilation (2016-10-11 07:46:11 +0900)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] power: twl6030: fix code refactoring

2016-10-13 Thread Tom Rini
On Thu, Oct 13, 2016 at 01:47:53PM +0300, Nicolae Rosia wrote:

> From: Nicolae Rosia 
> 
> Commit a85362fb3e1fc7833723accddbbae431091d06b8 refactored the code
> but the register read ended up in the wrong if branch.
> Currently, the else branch checks a variable which is always 0.
> 
> Signed-off-by: Nicolae Rosia 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [U-Boot,17/27] sandbox: Use asm-generic/io.h

2016-10-13 Thread Tom Rini
On Sat, Oct 01, 2016 at 03:19:20PM +0100, Paul Burton wrote:

> Convert the sandbox architecture to make use of the new asm-generic/io.h
> to provide address mapping functions. As sandbox actually performs
> non-identity mapping between physical & virtual addresses we can't
> simply make use of the generic mapping functions, but are able to
> implement phys_to_virt() & make use of it from map_physmem().
[snip]
> +phys_addr_t virt_to_phys(void *vaddr)
> +{
> + return (phys_addr_t)(vaddr - gd->arch.ram_buf);

../arch/sandbox/cpu/cpu.c: In function ‘virt_to_phys’:
../arch/sandbox/cpu/cpu.c:65:29: error: invalid operands to binary - (have 
‘void *’ and ‘uint8_t *’)
  return (phys_addr_t)(vaddr - gd->arch.ram_buf);

[snip]
> -/*
> - * Given a physical address and a length, return a virtual address
> - * that can be used to access the memory range with the caching
> - * properties specified by "flags".
> - */
> -#define MAP_NOCACHE  (0)
> -#define MAP_WRCOMBINE(0)
> -#define MAP_WRBACK   (0)
> -#define MAP_WRTHROUGH(0)
[snip]
> @@ -71,6 +69,7 @@ static inline void _outsw(volatile u16 *port, const void 
> *buf, int ns)
>  #define out16(addr, val)
>  #define in16(addr)   0
>  
> +#include 

... but we use MAP_WRBACK in map/unmap_sysmem which are before we
include this so they don't compile.

Please fix and run test/py/test.py for sandbox when you're done to
ensure it's still all happy, thanks!

-- 
Tom


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


[U-Boot] [PATCH 2/3] ARM: zynq(mp): remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT defines

2016-10-13 Thread Masahiro Yamada
ARCH_ZYNQ(MP) selects DM_USB, where CONFIG_USB_MAX_CONTROLLER_COUNT
is not used.

Signed-off-by: Masahiro Yamada 
---

 include/configs/xilinx_zynqmp.h | 1 -
 include/configs/zynq-common.h   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index adc42cf..c8e1ffa 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -110,7 +110,6 @@
 #define CONFIG_SYS_LOAD_ADDR   0x800
 
 #if defined(CONFIG_ZYNQMP_USB)
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS  2
 #define CONFIG_USB_XHCI_ZYNQMP
 
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 0118fd2..7cca83f 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -86,7 +86,6 @@
 
 #ifdef CONFIG_USB_EHCI_ZYNQ
 # define CONFIG_EHCI_IS_TDI
-# define CONFIG_USB_MAX_CONTROLLER_COUNT   2
 
 # define CONFIG_SYS_DFU_DATA_BUF_SIZE  0x60
 # define DFU_DEFAULT_POLL_TIMEOUT  300
-- 
1.9.1

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


[U-Boot] [PATCH 1/3] ARM: uniphier: remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT defines

2016-10-13 Thread Masahiro Yamada
ARCH_UNIPHIER selects DM_USB, where CONFIG_USB_MAX_CONTROLLER_COUNT
is not used.

Signed-off-by: Masahiro Yamada 
---

 include/configs/uniphier.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index 7331d13..5be46e5 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -126,7 +126,6 @@
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS  0
 
 /* USB */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT2
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 4
 #define CONFIG_FAT_WRITE
 #define CONFIG_DOS_PARTITION
-- 
1.9.1

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


[U-Boot] [PATCH 3/3] ARM: sunxi: remove unneeded CONFIG_USB_MAX_CONTROLLER_COUNT defines

2016-10-13 Thread Masahiro Yamada
ARCH_SUNXI selects DM_USB, where CONFIG_USB_MAX_CONTROLLER_COUNT
is not used.

Signed-off-by: Masahiro Yamada 
---

 include/configs/sun4i.h | 1 -
 include/configs/sun5i.h | 1 -
 include/configs/sun6i.h | 1 -
 include/configs/sun7i.h | 1 -
 include/configs/sun8i.h | 1 -
 5 files changed, 5 deletions(-)

diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h
index ea079eb..3dfd95a 100644
--- a/include/configs/sun4i.h
+++ b/include/configs/sun4i.h
@@ -14,7 +14,6 @@
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
-#define CONFIG_USB_MAX_CONTROLLER_COUNT2
 #endif
 
 #define CONFIG_SUNXI_USB_PHYS  3
diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h
index d257659..ec8f319 100644
--- a/include/configs/sun5i.h
+++ b/include/configs/sun5i.h
@@ -14,7 +14,6 @@
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
-#define CONFIG_USB_MAX_CONTROLLER_COUNT1
 #endif
 
 #define CONFIG_SUNXI_USB_PHYS  2
diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h
index 67a26c2..6c1eca4 100644
--- a/include/configs/sun6i.h
+++ b/include/configs/sun6i.h
@@ -17,7 +17,6 @@
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
-#define CONFIG_USB_MAX_CONTROLLER_COUNT2
 #endif
 
 #define CONFIG_SUNXI_USB_PHYS  3
diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
index d8e6e20..5455901 100644
--- a/include/configs/sun7i.h
+++ b/include/configs/sun7i.h
@@ -15,7 +15,6 @@
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
-#define CONFIG_USB_MAX_CONTROLLER_COUNT2
 #endif
 
 #define CONFIG_SUNXI_USB_PHYS  3
diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
index 011d70f..a4c3fb6 100644
--- a/include/configs/sun8i.h
+++ b/include/configs/sun8i.h
@@ -15,7 +15,6 @@
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
-#define CONFIG_USB_MAX_CONTROLLER_COUNT1
 #endif
 
 #ifdef CONFIG_MACH_SUN8I_H3
-- 
1.9.1

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


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

2016-10-13 Thread Keerthy



On Thursday 13 October 2016 08:38 PM, Simon Glass wrote:

Hi Keerthy,

On 13 October 2016 at 08:59, Keerthy  wrote:

Simon,

On Thursday 13 October 2016 07:54 PM, Simon Glass wrote:


Hi Tom,

On 12 October 2016 at 08:13, Tom Rini  wrote:



On Tue, Oct 11, 2016 at 02:29:01PM -0600, Simon Glass wrote:


Hi Tom,

This is mostly syncing up with upstream. I have a few more things to do
also (some small, some large).


The following changes since commit
f5fd45ff64e28a73499548358e3d1ceda0de7daf:

  Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08
09:33:37 -0400)

are available in the git repository at:

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

for you to fetch changes up to 7f899e436fe1e952950a14df92600d68d55dea5c:

  libfdt: Drop inlining of fdt_path_offset() (2016-10-11 14:26:46 -0600)



Something in here is breaking my TI J6 Eco platform.  I'll try and kick
a rebase and bisect of just this series later to pinpoint which one is
at fault (I'm testing all of the other stuff that piled up while my
power was out atm).  Thanks!



I'm not sure how this fault could affect your platform, since
Keerthy's fix applies to a driver that is not yet upstream (it's in
the dm pull request).

Could there be another fault lurking?



I tried u-boot master + dm branch. That is fine.
I tried u-boot master + fdt branch. That is fine.

Then i tried u-boot master + fdt branch + dm branch. That is when i saw the
hang on DRA72.

Boot is fine. I am not sure if Tom saw any other issue.


Sounds good, thanks.

BTW what's up with your hex email address?


Oh wow! I am seeing it as j-keer...@ti.com. Let me check what is going 
with my mailer. Thanks for catching it.




Regards,
Simon


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


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

2016-10-13 Thread Simon Glass
Hi Keerthy,

On 13 October 2016 at 08:59, Keerthy  wrote:
> Simon,
>
> On Thursday 13 October 2016 07:54 PM, Simon Glass wrote:
>>
>> Hi Tom,
>>
>> On 12 October 2016 at 08:13, Tom Rini  wrote:
>>>
>>>
>>> On Tue, Oct 11, 2016 at 02:29:01PM -0600, Simon Glass wrote:
>>>
 Hi Tom,

 This is mostly syncing up with upstream. I have a few more things to do
 also (some small, some large).


 The following changes since commit
 f5fd45ff64e28a73499548358e3d1ceda0de7daf:

   Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08
 09:33:37 -0400)

 are available in the git repository at:

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

 for you to fetch changes up to 7f899e436fe1e952950a14df92600d68d55dea5c:

   libfdt: Drop inlining of fdt_path_offset() (2016-10-11 14:26:46 -0600)

>>>
>>> Something in here is breaking my TI J6 Eco platform.  I'll try and kick
>>> a rebase and bisect of just this series later to pinpoint which one is
>>> at fault (I'm testing all of the other stuff that piled up while my
>>> power was out atm).  Thanks!
>>
>>
>> I'm not sure how this fault could affect your platform, since
>> Keerthy's fix applies to a driver that is not yet upstream (it's in
>> the dm pull request).
>>
>> Could there be another fault lurking?
>
>
> I tried u-boot master + dm branch. That is fine.
> I tried u-boot master + fdt branch. That is fine.
>
> Then i tried u-boot master + fdt branch + dm branch. That is when i saw the
> hang on DRA72.
>
> Boot is fine. I am not sure if Tom saw any other issue.

Sounds good, thanks.

BTW what's up with your hex email address?

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


Re: [U-Boot] [PATCH] arm: psci: save and restore registers from r4 to r12

2016-10-13 Thread C.H. Zhao



From: Chen-Yu Tsai 
Sent: Thursday, October 13, 2016 5:52 PM
To: C.H. Zhao
Cc: U-Boot Mailing List; Albert ARIBAUD; z.chen...@gmail.com
Subject: Re: [U-Boot] [PATCH] arm: psci: save and restore registers from r4 to 
r12

On Sat, Oct 8, 2016 at 7:08 PM, Chenhui Zhao  wrote:
> Save and restore core registers from r4 to r12 so that PSCI code won't
> break their value.
>
> Signed-off-by: Chenhui Zhao 
> Signed-off-by: Alison Wang 
> Signed-off-by: Abhimanyu Saini 
> ---
>  arch/arm/cpu/armv7/psci.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S
> index 6a36208..746297c 100644
> --- a/arch/arm/cpu/armv7/psci.S
> +++ b/arch/arm/cpu/armv7/psci.S
> @@ -152,7 +152,7 @@ _psci_table:
> .word   0
>
>  _smc_psci:
> -   push{r4-r7,lr}
> +   push{r4-r12,lr}

This change is not needed. This function only uses r4-r7.
Any subroutines called should save variable registers (r4-r12)
themselves, per the ARM calling conventions.

ChenYu


[Chenhui] I do not think it is a normal calling, instead it is an exception 
handler. In the exception context,
it is necessary to save/restore all registers.

>
> @ Switch to secure
> mrc p15, 0, r7, c1, c1, 0
> @@ -175,7 +175,7 @@ _smc_psci:
> @ Switch back to non-secure
>  2: mcr p15, 0, r7, c1, c1, 0
>
> -   pop {r4-r7, lr}
> +   pop {r4-r12, lr}
> movspc, lr  @ Return to the kernel
>
>  @ Requires dense and single-cluster CPU ID space
> --
> 1.9.1
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
U-Boot Info Page - lists.denx.de Mailing 
Lists
lists.denx.de
To see the collection of prior postings to the list, visit the U-Boot Archives. 
Using U-Boot: To post a message to all the list members, send email to ...



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


[U-Boot] [PATCH] mmc: refactor two core functions

2016-10-13 Thread Masahiro Yamada
Drop unneeded variables and assignments.

Signed-off-by: Masahiro Yamada 
---

 drivers/mmc/mmc-uclass.c | 15 ++-
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 425abb1..4e955da 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -116,13 +116,7 @@ int get_mmc_num(void)
 
 int mmc_get_next_devnum(void)
 {
-   int ret;
-
-   ret = blk_find_max_devnum(IF_TYPE_MMC);
-   if (ret < 0)
-   return ret;
-
-   return ret;
+   return blk_find_max_devnum(IF_TYPE_MMC);
 }
 
 struct blk_desc *mmc_get_blk_desc(struct mmc *mmc)
@@ -243,7 +237,6 @@ static int mmc_select_hwpart(struct udevice *bdev, int 
hwpart)
struct udevice *mmc_dev = dev_get_parent(bdev);
struct mmc *mmc = mmc_get_mmc_dev(mmc_dev);
struct blk_desc *desc = dev_get_uclass_platdata(bdev);
-   int ret;
 
if (desc->hwpart == hwpart)
return 0;
@@ -251,11 +244,7 @@ static int mmc_select_hwpart(struct udevice *bdev, int 
hwpart)
if (mmc->part_config == MMCPART_NOAVAILABLE)
return -EMEDIUMTYPE;
 
-   ret = mmc_switch_part(mmc, hwpart);
-   if (ret)
-   return ret;
-
-   return 0;
+   return mmc_switch_part(mmc, hwpart);
 }
 
 static const struct blk_ops mmc_blk_ops = {
-- 
1.9.1

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


Re: [U-Boot] [PATCH v3 00/29] Kconfig: Move console options to Kconfig

2016-10-13 Thread Tom Rini
On Thu, Oct 13, 2016 at 08:51:09AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On 13 October 2016 at 08:02, Tom Rini  wrote:
> > On Thu, Sep 29, 2016 at 02:22:59PM -0600, Simon Glass wrote:
> >
> >> This series moves a number of console-related CONFIG options to Kconfig.
> >> Those that are not currently used are removed.
> >>
> >> A few unused video drivers are also removed and there are a few minor
> >> adjustments to improve the code. But mostly this follows the output of
> >> the moveconfig tool.
> >>
> >> It is build-tested to check that everything still works. The series is
> >> available at u-boot-dm/video-working
> >
> > Can you please re-base this on top of tree?  The BOARDINFO/CPUINFO
> > migration made this painful to re-apply, sorry.  Thanks!
> 
> Yes, will do. I should probably wait until the pending pull requests go in.

Yeah, good idea, I see a few more configs/ changes locally.

-- 
Tom


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


Re: [U-Boot] [PATCH] pmic: palmas: Accommodate fdt_subnode_offset signature change

2016-10-13 Thread Keerthy



On Thursday 13 October 2016 06:22 PM, Simon Glass wrote:

On 13 October 2016 at 05:57, Keerthy  wrote:

Accommodate fdt_subnode_offset signature change.

Signed-off-by: Keerthy 
---
 drivers/power/pmic/palmas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Acked-by: Simon Glass 


Thanks just noticed that $Subject also needs to reflect the right 
function name. Sending a v2 with that changed and your Ack.





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


[U-Boot] [PATCH v2] pmic: palmas: Accommodate fdt_for_each_subnode signature change

2016-10-13 Thread Keerthy
Accommodate fdt_for_each_subnode signature change.

Signed-off-by: Keerthy 
Acked-by: Simon Glass 
---

Changes in v2:

* Corrected  subject.
* Added Simon's Ack.

 drivers/power/pmic/palmas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/pmic/palmas.c b/drivers/power/pmic/palmas.c
index 6c79a93..0ab425e 100644
--- a/drivers/power/pmic/palmas.c
+++ b/drivers/power/pmic/palmas.c
@@ -52,7 +52,7 @@ static int palmas_bind(struct udevice *dev)
int node = dev->of_offset;
int subnode, len;
 
-   fdt_for_each_subnode(blob, subnode, node) {
+   fdt_for_each_subnode(subnode, blob, node) {
const char *name;
char *temp;
 
-- 
1.9.1

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


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

2016-10-13 Thread Keerthy

Simon,

On Thursday 13 October 2016 07:54 PM, Simon Glass wrote:

Hi Tom,

On 12 October 2016 at 08:13, Tom Rini  wrote:


On Tue, Oct 11, 2016 at 02:29:01PM -0600, Simon Glass wrote:


Hi Tom,

This is mostly syncing up with upstream. I have a few more things to do
also (some small, some large).


The following changes since commit f5fd45ff64e28a73499548358e3d1ceda0de7daf:

  Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08
09:33:37 -0400)

are available in the git repository at:

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

for you to fetch changes up to 7f899e436fe1e952950a14df92600d68d55dea5c:

  libfdt: Drop inlining of fdt_path_offset() (2016-10-11 14:26:46 -0600)



Something in here is breaking my TI J6 Eco platform.  I'll try and kick
a rebase and bisect of just this series later to pinpoint which one is
at fault (I'm testing all of the other stuff that piled up while my
power was out atm).  Thanks!


I'm not sure how this fault could affect your platform, since
Keerthy's fix applies to a driver that is not yet upstream (it's in
the dm pull request).

Could there be another fault lurking?


I tried u-boot master + dm branch. That is fine.
I tried u-boot master + fdt branch. That is fine.

Then i tried u-boot master + fdt branch + dm branch. That is when i saw 
the hang on DRA72.


Boot is fine. I am not sure if Tom saw any other issue.

Regards,
Keerthy


Regards,
Simon


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


Re: [U-Boot] [PATCH] pmic: lp873x: Accommodate fdt_subnode_offset signature change

2016-10-13 Thread Keerthy



On Thursday 13 October 2016 06:22 PM, Simon Glass wrote:

Hi Keerthy,

On 13 October 2016 at 05:56, Keerthy  wrote:

Accommodate fdt_subnode_offset signature change.

Signed-off-by: Keerthy 
---
 drivers/power/pmic/lp873x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/pmic/lp873x.c b/drivers/power/pmic/lp873x.c
index 307f96b..2af86b1 100644
--- a/drivers/power/pmic/lp873x.c
+++ b/drivers/power/pmic/lp873x.c
@@ -51,7 +51,7 @@ static int lp873x_bind(struct udevice *dev)
int children;
int node = dev->of_offset;

-   regulators_node = fdt_subnode_offset(blob, node, "regulators");
+   regulators_node = fdt_subnode_offset(node, blob, "regulators");


I don't think the signature has changed on this one.


Ouch! I went through your patch again. Oversight. This is not needed.
Palmas patch is good enough.

Thanks,
Keerthy





if (regulators_node <= 0) {
printf("%s: %s reg subnode not found!", __func__, dev->name);
--
1.9.1



Regards,
Simon


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


Re: [U-Boot] [PATCH v3 00/29] Kconfig: Move console options to Kconfig

2016-10-13 Thread Simon Glass
Hi Tom,

On 13 October 2016 at 08:02, Tom Rini  wrote:
> On Thu, Sep 29, 2016 at 02:22:59PM -0600, Simon Glass wrote:
>
>> This series moves a number of console-related CONFIG options to Kconfig.
>> Those that are not currently used are removed.
>>
>> A few unused video drivers are also removed and there are a few minor
>> adjustments to improve the code. But mostly this follows the output of
>> the moveconfig tool.
>>
>> It is build-tested to check that everything still works. The series is
>> available at u-boot-dm/video-working
>
> Can you please re-base this on top of tree?  The BOARDINFO/CPUINFO
> migration made this painful to re-apply, sorry.  Thanks!

Yes, will do. I should probably wait until the pending pull requests go in.

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


Re: [U-Boot] [U-Boot,v6,10/10] smbios: Provide serial number

2016-10-13 Thread Alexander Graf
> If the system has a valid "serial#" environment variable set (which boards 
> that
> can find it out programatically set automatically), use that as input for the
> serial number and UUID fields in the SMBIOS tables.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Bin Meng 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot,v2,3/8] efi: Fix missing EFIAPI specifiers

2016-10-13 Thread Alexander Graf
> These are missing in some functions. Add them to keep things consistent.
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 
> Reviewed-by: Alexander Graf 

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


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

2016-10-13 Thread Simon Glass
Hi Tom,

On 13 October 2016 at 08:33, Tom Rini  wrote:
> On Thu, Oct 13, 2016 at 08:24:22AM -0600, Simon Glass wrote:
>> Hi Tom,
>>
>> On 12 October 2016 at 08:13, Tom Rini  wrote:
>> >
>> > On Tue, Oct 11, 2016 at 02:29:01PM -0600, Simon Glass wrote:
>> >
>> > > Hi Tom,
>> > >
>> > > This is mostly syncing up with upstream. I have a few more things to do
>> > > also (some small, some large).
>> > >
>> > >
>> > > The following changes since commit 
>> > > f5fd45ff64e28a73499548358e3d1ceda0de7daf:
>> > >
>> > >   Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08
>> > > 09:33:37 -0400)
>> > >
>> > > are available in the git repository at:
>> > >
>> > >   git://git.denx.de/u-boot-fdt.git
>> > >
>> > > for you to fetch changes up to 7f899e436fe1e952950a14df92600d68d55dea5c:
>> > >
>> > >   libfdt: Drop inlining of fdt_path_offset() (2016-10-11 14:26:46 -0600)
>> > >
>> >
>> > Something in here is breaking my TI J6 Eco platform.  I'll try and kick
>> > a rebase and bisect of just this series later to pinpoint which one is
>> > at fault (I'm testing all of the other stuff that piled up while my
>> > power was out atm).  Thanks!
>>
>> I'm not sure how this fault could affect your platform, since
>> Keerthy's fix applies to a driver that is not yet upstream (it's in
>> the dm pull request).
>>
>> Could there be another fault lurking?
>
> No, it makes sense.  The -dm pull adds the new driver used on J6Eco and
> -fdt changes the call semantics used in that new driver.

OK that's good. I'll sort this out once things land in mainline.

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


Re: [U-Boot] [U-Boot,v2,2/8] efi: Use asmlinkage for EFIAPI

2016-10-13 Thread Alexander Graf
> This is required for x86 and is also correct for ARM (since it is empty).
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [U-Boot, v2, 6/8] x86: efi: Add EFI loader support for x86

2016-10-13 Thread Alexander Graf
> Add the required pieces to support the EFI loader on x86.
> 
> Since U-Boot only builds for 32-bit on x86, only a 32-bit EFI application
> is supported. If a 64-bit kernel must be booted, U-Boot supports this
> directly using FIT (see doc/uImage.FIT/kernel.its). U-Boot can act as a
> payload for both 32-bit and 64-bit EFI.
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [U-Boot,3/5] arm: Add PSCI shutdown function

2016-10-13 Thread Alexander Graf
> Using PSCI you can not only reset the system, you can also shut it down!
> This patch exposes a function to do exactly that to whatever code wants
> to make use of it.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot, v3, 1/7] efi_loader: Update description of internal efi_mem_carve_out

2016-10-13 Thread Alexander Graf
> In 74c16acce30bb882ad5951829d8dafef8eea564c the return values where
> changed, but the description was kept.
> 
> Signed-off-by: Stefan Brüns 
> Reviewed-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot,v6,06/10] cpu: Add get_vendor callback

2016-10-13 Thread Alexander Graf
> The CPU udevice already has a few callbacks to retreive information
> about the currently running CPUs. This patch adds a new get_vendor()
> call that returns the vendor of the main CPUs.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [U-Boot, v3, 7/7] efi_loader: Do not leak memory when unlinking a mapping

2016-10-13 Thread Alexander Graf
> As soon as a mapping is unlinked from the list, there are no further
> references to it, so it should be freed. If it not unlinked,
> update the start address and length.
> 
> Signed-off-by: Stefan Brüns 
> Reviewed-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot,5/5] efi_loader: Add generic PSCI RTS

2016-10-13 Thread Alexander Graf
> Now that we have generic PSCI reset and shutdown support in place, we can
> advertise those as EFI Run Time Services, allowing efi applications and
> OSs to reset and shut down systems.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot, v6, 07/10] smbios: Generate type 4 on non-x86 systems

2016-10-13 Thread Alexander Graf
> The type 4 table generation code is very x86 centric today. Refactor things
> out into the device model cpu class to allow the tables to get generated for
> other architectures as well.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [U-Boot, v6, 02/10] x86: Move smbios generation into arch independent directory

2016-10-13 Thread Alexander Graf
> We will need the SMBIOS generation function on ARM as well going forward,
> so let's move it into a non arch specific location.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Bin Meng 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot,2/5] arm: Disable HVC PSCI calls by default

2016-10-13 Thread Alexander Graf
> All systems that are running on armv8 are running bare metal with firmware
> that implements PSCI running in EL3. That means we don't really need to expose
> the hypercall variants of them.
> 
> This patch leaves the code in, but makes the code explicit enough to have the
> compiler optimize it out. With this we don't need to worry about hvc vs smc
> calling convention when calling psci helper functions.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot, v3, 5/7] efi_loader: Readd freed pages to memory pool

2016-10-13 Thread Alexander Graf
> Currently each allocation creates a new mapping. Readding the mapping
> as free memory (EFI_CONVENTIONAL_MEMORY) potentially allows to hand out
> an existing mapping, thus limiting the number of mapping descriptors in
> the memory map.
> 
> Mitigates a problem with current (4.8rc7) linux kernels when doing an
> efi_get_memory map, resulting in an infinite loop. Space for the memory
> map is reserved with allocate_pool (implicitly creating a new mapping) and
> filled. If there is insufficient slack space (8 entries) in the map, the
> space is freed and a new round is started, with space for one more entry.
> As each round increases requirement and allocation by exactly one, there
> is never enough slack space. (At least 32 entries are allocated, so as
> long as there are less than 24 entries, there is enough slack).
> Earlier kernels reserved no slack, and did less allocations, so this
> problem was not visible.
> 
> Signed-off-by: Stefan Brüns 
> Reviewed-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot, 1/5] efi_loader: Allow boards to implement get_time and reset_system

2016-10-13 Thread Alexander Graf
> EFI allows an OS to leverage firmware drivers while the OS is running. In the
> generic code we so far had to stub those implementations out, because we would
> need board specific knowledge about MMIO setups for it.
> 
> However, boards can easily implement those themselves. This patch provides the
> framework so that a board can implement its own versions of get_time and
> reset_system which would actually do something useful.
> 
> While at it we also introduce a simple way for code to reserve MMIO pointers
> as runtime available.
> 
> Signed-off-by: Alexander Graf 

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


Re: [U-Boot] efi_loader: Allow bouncing for network

2016-10-13 Thread Alexander Graf
> So far bounce buffers were only used for disk I/O, but network I/O
> may suffer from the same problem.
> 
> On platforms that have problems doing DMA on high addresses, let's
> also bounce outgoing network packets. Incoming ones always already
> get bounced.
> 
> This patch fixes EFI PXE boot on ZynqMP for me.
> 
> Signed-off-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot, v4, 4/7] efi_loader: Track size of pool allocations to allow freeing

2016-10-13 Thread Alexander Graf
> We need a functional free_pool implementation, as otherwise each
> allocate_pool causes growth of the memory descriptor table.
> 
> Different to free_pages, free_pool does not provide the size for the
> to be freed allocation, thus we have to track the size ourselves.
> 
> As the only EFI requirement for pool allocation is an alignment of
> 8 bytes, we can keep allocating a range using the page allocator,
> reserve the first 8 bytes for our bookkeeping and hand out the
> remainder to the caller. This saves us from having to use any
> independent data structures for tracking.
> 
> To simplify the conversion between pool allocations and the corresponding
> page allocation, we create an auxiliary struct efi_pool_allocation.
> 
> Given the allocation size free_pool size can handoff freeing the page
> range, which was indirectly allocated by a call to allocate_pool,
> to free_pages.
> 
> Signed-off-by: Stefan Brüns 
> Reviewed-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot, v6, 03/10] efi_loader: Expose efi_install_configuration_table

2016-10-13 Thread Alexander Graf
> We want to be able to add configuration table entries from our own code as
> well as from EFI payload code. Export the boot service function internally
> too, so that we can reuse it.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot, v6, 01/10] x86: Move table csum into separate file

2016-10-13 Thread Alexander Graf
> We need the checksum function without all the other table functionality
> soon, so let's split it out into its own C file.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [U-Boot, v6, 08/10] smbios: Expose in efi_loader as table

2016-10-13 Thread Alexander Graf
> We can pass SMBIOS easily as EFI configuration table to an EFI payload. This
> patch adds enablement for that case.
> 
> While at it, we also enable SMBIOS generation for ARM systems, since they 
> support
> EFI_LOADER.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Bin Meng 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] efi_loader: Fix crash on 32-bit systems

2016-10-13 Thread Alexander Graf
> A type mismatch in the efi_allocate_pool boot service flow causes
> hazardous memory scribbling on 32-bit systems.
> 
> This is efi_allocate_pool's prototype:
> 
> static efi_status_t EFIAPI efi_allocate_pool(int pool_type,
>   unsigned long size,
>   void **buffer);
> 
> Internally, it invokes efi_allocate_pages as follows:
> 
> efi_allocate_pages(0, pool_type, (size + 0xfff) >> 12,
>   (void*)buffer);
> 
> This is efi_allocate_pages' prototype:
> 
> efi_status_t efi_allocate_pages(int type, int memory_type,
>   unsigned long pages,
>   uint64_t *memory);
> 
> The problem: efi_allocate_pages does this internally:
> 
> *memory = addr;
> 
> This fix in efi_allocate_pool uses a transitional uintptr_t cast to
> ensure the correct outcome, irrespective of the system's native word
> size.
> 
> This was observed when bootefi'ing the EFI instance of FreeBSD's first
> stage bootstrap (boot1.efi) on a 32-bit ARM platform (Qemu VExpress +
> Cortex-a9).
> 
> Signed-off-by: Robin Randhawa 

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


Re: [U-Boot] [U-Boot, v4, 3/7] efi_loader: Move efi_allocate_pool implementation to efi_memory.c

2016-10-13 Thread Alexander Graf
> We currently handle efi_allocate_pool() in our boot time service
> file. In the following patch, pool allocation will receive additional
> internal semantics that we should preserve inside efi_memory.c instead.
> 
> As foundation for those changes, split the function into an externally
> facing efi_allocate_pool_ext() for use by payloads and an internal helper
> efi_allocate_pool() in efi_memory.c that handles the actual allocation.
> 
> While at it, change the magic 0xfff / 12 constants to the more obvious
> EFI_PAGE_MASK/SHIFT defines.
> 
> Signed-off-by: Stefan Brüns 
> Reviewed-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot, 4/5] arm: Provide common PSCI based reset handler

2016-10-13 Thread Alexander Graf
> Most armv8 systems have PSCI support enabled in EL3, either through
> ARM Trusted Firmware or other firmware.
> 
> On these systems, we do not need to implement system reset manually,
> but can instead rely on higher level firmware to deal with it.
> 
> The exclude list seems excessive right now, but NXP is working on
> providing an in-tree PSCI implementation, so that all NXP systems
> can eventually use PSCI as well.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot, v6, 09/10] efi_loader: Fix efi_install_configuration_table

2016-10-13 Thread Alexander Graf
> So far we were only installing the FDT table and didn't have space
> to store any other. Hence nobody realized that our efi table allocation
> was broken in that it didn't set the indicator for the number of tables
> plus one.
> 
> This patch fixes it, allowing code to allocate new efi tables.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot,v2,3/5] efi_loader: gop: Expose fb when 32bpp

2016-10-13 Thread Alexander Graf
> When we're running in 32bpp mode, expose the frame buffer address
> to our payloads so that Linux efifb can pick it up.
> 
> Signed-off-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot, v6, 04/10] smbios: Allow compilation on 64bit systems

2016-10-13 Thread Alexander Graf
> The SMBIOS generation code passes pointers as u32. That causes the compiler
> to warn on casts to pointers. This patch moves all address pointers to
> uintptr_t instead.
> 
> Technically u32 would be enough for the current SMBIOS2 style tables, but
> we may want to extend the code to SMBIOS3 in the future which is 64bit
> address capable.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Bin Meng 
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [U-Boot, v4, 2/7] efi_loader: Fix memory map size check to avoid out-of-bounds access

2016-10-13 Thread Alexander Graf
> The current efi_get_memory_map() function overwrites the map_size
> property before reading its value. That way the sanity check whether our
> memory map fits into the given array always succeeds, potentially
> overwriting arbitrary payload memory.
> 
> This patch moves the property update write after its sanity check, so
> that the check actually verifies the correct value.
> 
> So far this has not triggered any known bugs, but we're better off safe
> than sorry.
> 
> If the buffer is to small, the returned memory_map_size indicates the
> required size to the caller.
> 
> Signed-off-by: Stefan Brüns 
> Reviewed-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot,v6,05/10] cpu: Add DMTF id and family fields

2016-10-13 Thread Alexander Graf
> For SMBIOS tables we need to know the CPU family as well as CPU IDs. This
> patches allocates some space for them in the cpu device and populates it
> on x86.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [U-Boot, v3, 6/7] efi_loader: Keep memory mapping sorted when splitting an entry

2016-10-13 Thread Alexander Graf
> The code assumes sorted mappings in descending address order. When
> splitting a mapping, insert the new part next to the current mapping.
> 
> Signed-off-by: Stefan Brüns 
> Reviewed-by: Alexander Graf 

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


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

2016-10-13 Thread Tom Rini
On Thu, Oct 13, 2016 at 08:24:22AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On 12 October 2016 at 08:13, Tom Rini  wrote:
> >
> > On Tue, Oct 11, 2016 at 02:29:01PM -0600, Simon Glass wrote:
> >
> > > Hi Tom,
> > >
> > > This is mostly syncing up with upstream. I have a few more things to do
> > > also (some small, some large).
> > >
> > >
> > > The following changes since commit 
> > > f5fd45ff64e28a73499548358e3d1ceda0de7daf:
> > >
> > >   Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08
> > > 09:33:37 -0400)
> > >
> > > are available in the git repository at:
> > >
> > >   git://git.denx.de/u-boot-fdt.git
> > >
> > > for you to fetch changes up to 7f899e436fe1e952950a14df92600d68d55dea5c:
> > >
> > >   libfdt: Drop inlining of fdt_path_offset() (2016-10-11 14:26:46 -0600)
> > >
> >
> > Something in here is breaking my TI J6 Eco platform.  I'll try and kick
> > a rebase and bisect of just this series later to pinpoint which one is
> > at fault (I'm testing all of the other stuff that piled up while my
> > power was out atm).  Thanks!
> 
> I'm not sure how this fault could affect your platform, since
> Keerthy's fix applies to a driver that is not yet upstream (it's in
> the dm pull request).
> 
> Could there be another fault lurking?

No, it makes sense.  The -dm pull adds the new driver used on J6Eco and
-fdt changes the call semantics used in that new driver.

-- 
Tom


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


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

2016-10-13 Thread Simon Glass
Hi Tom,

On 12 October 2016 at 08:13, Tom Rini  wrote:
>
> On Tue, Oct 11, 2016 at 02:29:01PM -0600, Simon Glass wrote:
>
> > Hi Tom,
> >
> > This is mostly syncing up with upstream. I have a few more things to do
> > also (some small, some large).
> >
> >
> > The following changes since commit f5fd45ff64e28a73499548358e3d1ceda0de7daf:
> >
> >   Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08
> > 09:33:37 -0400)
> >
> > are available in the git repository at:
> >
> >   git://git.denx.de/u-boot-fdt.git
> >
> > for you to fetch changes up to 7f899e436fe1e952950a14df92600d68d55dea5c:
> >
> >   libfdt: Drop inlining of fdt_path_offset() (2016-10-11 14:26:46 -0600)
> >
>
> Something in here is breaking my TI J6 Eco platform.  I'll try and kick
> a rebase and bisect of just this series later to pinpoint which one is
> at fault (I'm testing all of the other stuff that piled up while my
> power was out atm).  Thanks!

I'm not sure how this fault could affect your platform, since
Keerthy's fix applies to a driver that is not yet upstream (it's in
the dm pull request).

Could there be another fault lurking?

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


Re: [U-Boot] [PATCH 2/3] ext4: Fix handling of direntlen in unlink_filename

2016-10-13 Thread Tom Rini
On Sun, Oct 09, 2016 at 08:15:27PM +0200, Stefan Brüns wrote:

> The direntlen checks were quite bogus, i.e. the loop termination used
> "len + offset == blocksize" (exact match only), and checked for a
> direntlen less than 0. The latter can never happen as the len is
> unsigned, this has been reported by Coverity, CID 153384.
> 
> Use the same code as in search_dir for directory traversal. This code
> has the correct checks for direntlen >= sizeof(struct dirent), and
> offset < blocksize.
> 
> Signed-off-by: Stefan Brüns 

Reported-by: Coverity (CID: 153383, 153384)
Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH 1/3] ext4: cleanup unlink_filename function

2016-10-13 Thread Tom Rini
On Sun, Oct 09, 2016 at 08:15:26PM +0200, Stefan Brüns wrote:

> Use the same variable names as in search_dir, to make purpose of variables
> more obvious.
> 
> Signed-off-by: Stefan Brüns 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH 0/3] ext4: cleanup/fix unlink_filename function

2016-10-13 Thread Tom Rini
On Sun, Oct 09, 2016 at 08:15:25PM +0200, Stefan Brüns wrote:

> This patch series addresses Coverity defects CID 153383/153384.
> The first patch is a preparation patch, the second addresses the
> actual issue.
> The last patch corrects the journal handling in the same function.

Thanks for fixing these!

-- 
Tom


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


Re: [U-Boot] [PATCH 3/3] ext4: Only write journal entries for modified blocks in unlink_filename

2016-10-13 Thread Tom Rini
On Sun, Oct 09, 2016 at 08:15:28PM +0200, Stefan Brüns wrote:

> Instead of creating a journal entry for each directory block, even
> if the block is unmodified, only log the modified block.
> 
> Signed-off-by: Stefan Brüns 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v2 2/6] Move CONFIG_VIDEO_IPUV3 to defconfig

2016-10-13 Thread Soeren Moch

Move CONFIG_VIDEO_IPUV3 from include/configs to configs

Cc: Tom Rini
Cc: Stefano Babic
Signed-off-by: Jagan Teki
---
  configs/aristainetos2_defconfig   | 1 +
  configs/aristainetos2b_defconfig  | 1 +
  configs/aristainetos_defconfig| 1 +
  configs/cgtqmx6eval_defconfig | 1 +
  configs/cm_fx6_defconfig  | 1 +
  configs/gwventana_defconfig   | 1 +
  configs/m53evk_defconfig  | 1 +
  configs/mx51evk_defconfig | 1 +
  configs/mx53loco_defconfig| 1 +
  configs/mx6cuboxi_defconfig   | 1 +
  configs/mx6qsabreauto_defconfig   | 1 +
  configs/mx6sabresd_spl_defconfig  | 1 +
  configs/nitrogen6dl2g_defconfig   | 1 +
  configs/nitrogen6dl_defconfig | 1 +
  configs/nitrogen6q2g_defconfig| 1 +
  configs/nitrogen6q_defconfig  | 1 +
  configs/nitrogen6s1g_defconfig| 1 +
  configs/nitrogen6s_defconfig  | 1 +
  configs/novena_defconfig  | 1 +
  configs/tbs2910_defconfig | 1 +
  configs/wandboard_defconfig   | 1 +
  include/configs/aristainetos-common.h | 1 -
  include/configs/cgtqmx6eval.h | 1 -
  include/configs/cm_fx6.h  | 1 -
  include/configs/gw_ventana.h  | 1 -
  include/configs/m53evk.h  | 1 -
  include/configs/mx51evk.h | 1 -
  include/configs/mx53loco.h| 1 -
  include/configs/mx6cuboxi.h   | 1 -
  include/configs/mx6sabre_common.h | 1 -
  include/configs/nitrogen6x.h  | 1 -
  include/configs/novena.h  | 1 -
  include/configs/tbs2910.h | 1 -
  include/configs/wandboard.h   | 1 -
  34 files changed, 21 insertions(+), 13 deletions(-)

For the tbs2910 board CONFIG_VIDEO_IPUV3 depends on CONFIG_VIDEO.
So for me it makes absolutely no sense to convert CONFIG_VIDEO_IPUV3 to 
Kconfig without converting CONFIG_VIDEO before and so loosing this 
dependency.


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


[U-Boot] [PATCH v2 2/3] include: configs: am335x: add Atheros phy support

2016-10-13 Thread Mugunthan V N
In AM335x GP EVM, Atheros 8031 phy is used, enable the driver as
AM335x SoC RGMII delay mode has to be enabled in phy as mentioned
in the silicon errata Advisory 1.0.10

Signed-off-by: Mugunthan V N 
Acked-by: Joe Hershberger 
---
 include/configs/am335x_evm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 272c71b..daa7dd8 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -432,6 +432,8 @@
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
 #define CONFIG_PHY_SMSC
+/* Enable Atheros phy driver */
+#define CONFIG_PHY_ATHEROS
 
 /*
  * NOR Size = 16 MiB
-- 
2.10.1.445.g3cdd5d1

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


[U-Boot] [PATCH v2 0/3] Add Atheros phy delay support and CPSW RGMII id support

2016-10-13 Thread Mugunthan V N
This patch series adds support for RGMII phy internal delay
support for Atheros 8031 phy driver and also add support for
the phy mode configuration in control module in cpsw driver.

Tested the series on the following EVMs with a zImage download
from server, logs [1] and pushed a branch for testing [2].

* DRA 72 Rev B EVM
* DRA 72 Rev C EVM
* DRA 74 EVM
* AM437x GP EVM
* AM335x BBB
* AM335x GP EVM

Changes from initial version:
* Added RMII refl clock "rmii-clock-ext" DT parsing.

[1] - http://pastebin.ubuntu.com/23317809/
[2] - git://git.ti.com/~mugunthanvnm/ti-u-boot/mugunth-ti-u-boot.git 
cpsw-rgmii-v2

Mugunthan V N (3):
  drivers: net: phy: atheros: add separate config for AR8031
  include: configs: am335x: add Atheros phy support
  driver: net: cpsw: add support for RGMII id mode support and RMII
clock source selection

 drivers/net/cpsw.c   | 157 +++
 drivers/net/phy/atheros.c|  37 +-
 include/configs/am335x_evm.h |   2 +
 include/cpsw.h   |   1 +
 4 files changed, 182 insertions(+), 15 deletions(-)

-- 
2.10.1.445.g3cdd5d1

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


[U-Boot] [PATCH v2 3/3] driver: net: cpsw: add support for RGMII id mode support and RMII clock source selection

2016-10-13 Thread Mugunthan V N
cpsw driver supports only selection of phy mode in control module
but control module has more setting like RGMII ID mode selection,
RMII clock source selection. So ported to cpsw-phy-sel driver
from kernel to u-boot.

Signed-off-by: Mugunthan V N 
Signed-off-by: Lokesh Vutla 
Acked-by: Joe Hershberger 
---
 drivers/net/cpsw.c | 157 -
 include/cpsw.h |   1 +
 2 files changed, 144 insertions(+), 14 deletions(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index d17505e..d1f024e 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -225,6 +225,18 @@ struct cpdma_chan {
void*hdp, *cp, *rxfree;
 };
 
+/* AM33xx SoC specific definitions for the CONTROL port */
+#define AM33XX_GMII_SEL_MODE_MII   0
+#define AM33XX_GMII_SEL_MODE_RMII  1
+#define AM33XX_GMII_SEL_MODE_RGMII 2
+
+#define AM33XX_GMII_SEL_RGMII1_IDMODE  BIT(4)
+#define AM33XX_GMII_SEL_RGMII2_IDMODE  BIT(5)
+#define AM33XX_GMII_SEL_RMII1_IO_CLK_ENBIT(6)
+#define AM33XX_GMII_SEL_RMII2_IO_CLK_ENBIT(7)
+
+#define GMII_SEL_MODE_MASK 0x3
+
 #define desc_write(desc, fld, val) __raw_writel((u32)(val), &(desc)->fld)
 #define desc_read(desc, fld)   __raw_readl(&(desc)->fld)
 #define desc_read_ptr(desc, fld)   ((void *)__raw_readl(&(desc)->fld))
@@ -1150,12 +1162,129 @@ static inline fdt_addr_t cpsw_get_addr_by_node(const 
void *fdt, int node)
  false);
 }
 
+static void cpsw_gmii_sel_am3352(struct cpsw_priv *priv,
+phy_interface_t phy_mode)
+{
+   u32 reg;
+   u32 mask;
+   u32 mode = 0;
+   bool rgmii_id = false;
+   int slave = priv->data.active_slave;
+
+   reg = readl(priv->data.gmii_sel);
+
+   switch (phy_mode) {
+   case PHY_INTERFACE_MODE_RMII:
+   mode = AM33XX_GMII_SEL_MODE_RMII;
+   break;
+
+   case PHY_INTERFACE_MODE_RGMII:
+   mode = AM33XX_GMII_SEL_MODE_RGMII;
+   break;
+   case PHY_INTERFACE_MODE_RGMII_ID:
+   case PHY_INTERFACE_MODE_RGMII_RXID:
+   case PHY_INTERFACE_MODE_RGMII_TXID:
+   mode = AM33XX_GMII_SEL_MODE_RGMII;
+   rgmii_id = true;
+   break;
+
+   case PHY_INTERFACE_MODE_MII:
+   default:
+   mode = AM33XX_GMII_SEL_MODE_MII;
+   break;
+   };
+
+   mask = GMII_SEL_MODE_MASK << (slave * 2) | BIT(slave + 6);
+   mode <<= slave * 2;
+
+   if (priv->data.rmii_clock_external) {
+   if (slave == 0)
+   mode |= AM33XX_GMII_SEL_RMII1_IO_CLK_EN;
+   else
+   mode |= AM33XX_GMII_SEL_RMII2_IO_CLK_EN;
+   }
+
+   if (rgmii_id) {
+   if (slave == 0)
+   mode |= AM33XX_GMII_SEL_RGMII1_IDMODE;
+   else
+   mode |= AM33XX_GMII_SEL_RGMII2_IDMODE;
+   }
+
+   reg &= ~mask;
+   reg |= mode;
+
+   writel(reg, priv->data.gmii_sel);
+}
+
+static void cpsw_gmii_sel_dra7xx(struct cpsw_priv *priv,
+phy_interface_t phy_mode)
+{
+   u32 reg;
+   u32 mask;
+   u32 mode = 0;
+   int slave = priv->data.active_slave;
+
+   reg = readl(priv->data.gmii_sel);
+
+   switch (phy_mode) {
+   case PHY_INTERFACE_MODE_RMII:
+   mode = AM33XX_GMII_SEL_MODE_RMII;
+   break;
+
+   case PHY_INTERFACE_MODE_RGMII:
+   case PHY_INTERFACE_MODE_RGMII_ID:
+   case PHY_INTERFACE_MODE_RGMII_RXID:
+   case PHY_INTERFACE_MODE_RGMII_TXID:
+   mode = AM33XX_GMII_SEL_MODE_RGMII;
+   break;
+
+   case PHY_INTERFACE_MODE_MII:
+   default:
+   mode = AM33XX_GMII_SEL_MODE_MII;
+   break;
+   };
+
+   switch (slave) {
+   case 0:
+   mask = GMII_SEL_MODE_MASK;
+   break;
+   case 1:
+   mask = GMII_SEL_MODE_MASK << 4;
+   mode <<= 4;
+   break;
+   default:
+   dev_err(priv->dev, "invalid slave number...\n");
+   return;
+   }
+
+   if (priv->data.rmii_clock_external)
+   dev_err(priv->dev, "RMII External clock is not supported\n");
+
+   reg &= ~mask;
+   reg |= mode;
+
+   writel(reg, priv->data.gmii_sel);
+}
+
+static void cpsw_phy_sel(struct cpsw_priv *priv, const char *compat,
+phy_interface_t phy_mode)
+{
+   if (!strcmp(compat, "ti,am3352-cpsw-phy-sel"))
+   cpsw_gmii_sel_am3352(priv, phy_mode);
+   if (!strcmp(compat, "ti,am43xx-cpsw-phy-sel"))
+   cpsw_gmii_sel_am3352(priv, phy_mode);
+   else if (!strcmp(compat, "ti,dra7xx-cpsw-phy-sel"))
+   cpsw_gmii_sel_dra7xx(priv, phy_mode);
+}
+
 static int 

[U-Boot] [PATCH v2 1/3] drivers: net: phy: atheros: add separate config for AR8031

2016-10-13 Thread Mugunthan V N
In the current driver implementation, config() callback is common
for AR8035 and AR8031 phy. In config() callback, driver tries to
configure MMD Access Control Register and MMD Access Address Data
Register unconditionally for both phy versions which leads to
auto negotiation failure in AM335x EVMsk second port which uses
AR8031 Giga bit RGMII phy. Fixing this by adding separate config
for AR8031 phy.

Reviewed-by: Sekhar Nori 
Signed-off-by: Mugunthan V N 
Acked-by: Joe Hershberger 
---
 drivers/net/phy/atheros.c | 37 -
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index e57c412..faf5175 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -8,6 +8,15 @@
  */
 #include 
 
+#define AR803x_PHY_DEBUG_ADDR_REG  0x1d
+#define AR803x_PHY_DEBUG_DATA_REG  0x1e
+
+#define AR803x_DEBUG_REG_5 0x5
+#define AR803x_RGMII_TX_CLK_DLY0x100
+
+#define AR803x_DEBUG_REG_0 0x0
+#define AR803x_RGMII_RX_CLK_DLY0x8000
+
 static int ar8021_config(struct phy_device *phydev)
 {
phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
@@ -17,6 +26,32 @@ static int ar8021_config(struct phy_device *phydev)
return 0;
 }
 
+static int ar8031_config(struct phy_device *phydev)
+{
+   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
+   phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
+   phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_ADDR_REG,
+ AR803x_DEBUG_REG_5);
+   phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_DATA_REG,
+ AR803x_RGMII_TX_CLK_DLY);
+   }
+
+   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
+   phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
+   phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_ADDR_REG,
+ AR803x_DEBUG_REG_0);
+   phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_DATA_REG,
+ AR803x_RGMII_RX_CLK_DLY);
+   }
+
+   phydev->supported = phydev->drv->features;
+
+   genphy_config_aneg(phydev);
+   genphy_restart_aneg(phydev);
+
+   return 0;
+}
+
 static int ar8035_config(struct phy_device *phydev)
 {
int regval;
@@ -54,7 +89,7 @@ static struct phy_driver AR8031_driver =  {
.uid = 0x4dd074,
.mask = 0xffef,
.features = PHY_GBIT_FEATURES,
-   .config = ar8035_config,
+   .config = ar8031_config,
.startup = genphy_startup,
.shutdown = genphy_shutdown,
 };
-- 
2.10.1.445.g3cdd5d1

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


  1   2   >